commit 0d382a262c0638d0f572fc37193ccc5ed3dc895f Author: tpearson Date: Wed Feb 17 00:32:19 2010 +0000 Added old abandoned version of k9copy git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1091546 283d02a7-25f6-0310-bc7c-ecb5cbfe19da diff --git a/AUTHORS b/AUTHORS new file mode 100755 index 0000000..b727fda --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Jean-Michel PETIT diff --git a/COPYING b/COPYING new file mode 100755 index 0000000..c13faf0 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100755 index 0000000..0519ecb --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/INSTALL b/INSTALL new file mode 100755 index 0000000..02a4a07 --- /dev/null +++ b/INSTALL @@ -0,0 +1,167 @@ +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, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + 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 at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' 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 a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Type `make install' to install the programs and any data files and + documentation. + + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +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 supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + 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' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +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 host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +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. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..a7dae17 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,39 @@ +SUBDIRS = doc dvdread libdvdnav k9Mplayer libk9copy k9author k9decmpeg k9devices k9vamps \ + po src + +$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ; + +$(top_srcdir)/subdirs: + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs + +$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in + @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4 + +MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files + +messages: rc.cpp + $(EXTRACTRC) `find . -name "*.ui"` >> rc.cpp + $(EXTRACTRC) `find . -name "*.rc"` >> rc.cpp + $(XGETTEXT) `find -name "*.cpp"` -o $(podir)/k9copy.pot + +package-messages: + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages + $(MAKE) -C po merge + +EXTRA_DIST = admin COPYING configure.in.in + +dist-hook: + cd $(top_distdir) && perl admin/am_edit -padmin + cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs + +AM_CXXFLAGS = -O0 -g3 + + + + + + + + +INCLUDES = -I$(top_srcdir)/dvdread diff --git a/Makefile.cvs b/Makefile.cvs new file mode 100755 index 0000000..4c0afd1 --- /dev/null +++ b/Makefile.cvs @@ -0,0 +1,10 @@ +all: + @echo "This Makefile is only for the CVS repository" + @echo "This will be deleted before making the distribution" + @echo "" + $(MAKE) -f admin/Makefile.common cvs + +dist: + $(MAKE) -f admin/Makefile.common dist + +.SILENT: diff --git a/NEWS b/NEWS new file mode 100755 index 0000000..0519ecb --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/README b/README new file mode 100755 index 0000000..ea5b96d --- /dev/null +++ b/README @@ -0,0 +1,12 @@ +install from sources: + +make -f Makefile.cvs +./configure --prefix=/usr +make +make install (as root) + + +k9copy can now copy dvd with bad sectors. +for a faster copy from a dvd with bad sectors : reduce the readahead for the drive : + +as root: hdparm -a8 /dev/dvd diff --git a/TODO b/TODO new file mode 100755 index 0000000..dc90d46 --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +more options for mp4 encoding +improve copy with bad sectors + \ No newline at end of file diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..c4bc9ed --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,11207 @@ +## -*- autoconf -*- + +dnl This file is part of the KDE libraries/packages +dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) +dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) + +dnl This file is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. + +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Library General Public License for more details. + +dnl You should have received a copy of the GNU Library General Public License +dnl along with this library; see the file COPYING.LIB. If not, write to +dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301, USA. + +dnl IMPORTANT NOTE: +dnl Please do not modify this file unless you expect your modifications to be +dnl carried into every other module in the repository. +dnl +dnl Single-module modifications are best placed in configure.in for kdelibs +dnl and kdebase or configure.in.in if present. + +# KDE_PATH_X_DIRECT +dnl Internal subroutine of AC_PATH_X. +dnl Set ac_x_includes and/or ac_x_libraries. +AC_DEFUN([KDE_PATH_X_DIRECT], +[ +AC_REQUIRE([KDE_CHECK_LIB64]) + +if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + + # First, try using that file with no special directory specified. +AC_TRY_CPP([#include <$x_direct_test_include>], +[# We can compile using X headers with no special include directory. +ac_x_includes=], +[# Look for the header file in a standard set of common directories. +# Check X11 before X11Rn because it is often a symlink to the current release. + for ac_dir in \ + /usr/X11/include \ + /usr/X11R6/include \ + /usr/X11R5/include \ + /usr/X11R4/include \ + \ + /usr/include/X11 \ + /usr/include/X11R6 \ + /usr/include/X11R5 \ + /usr/include/X11R4 \ + \ + /usr/local/X11/include \ + /usr/local/X11R6/include \ + /usr/local/X11R5/include \ + /usr/local/X11R4/include \ + \ + /usr/local/include/X11 \ + /usr/local/include/X11R6 \ + /usr/local/include/X11R5 \ + /usr/local/include/X11R4 \ + \ + /usr/X386/include \ + /usr/x386/include \ + /usr/XFree86/include/X11 \ + \ + /usr/include \ + /usr/local/include \ + /usr/unsupported/include \ + /usr/athena/include \ + /usr/local/x11r5/include \ + /usr/lpp/Xamples/include \ + \ + /usr/openwin/include \ + /usr/openwin/share/include \ + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + ac_x_includes=$ac_dir + break + fi + done]) +fi # $ac_x_includes = NO + +if test "$ac_x_libraries" = NO; then + # Check for the libraries. + + test -z "$x_direct_test_library" && x_direct_test_library=Xt + test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc + + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS="$LIBS" + LIBS="-l$x_direct_test_library $LIBS" +AC_TRY_LINK(, [${x_direct_test_function}()], +[LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries=], +[LIBS="$ac_save_LIBS" +# First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \ + /usr/X11/lib${kdelibsuff} \ + /usr/X11R6/lib${kdelibsuff} \ + /usr/X11R5/lib${kdelibsuff} \ + /usr/X11R4/lib${kdelibsuff} \ + \ + /usr/lib${kdelibsuff}/X11 \ + /usr/lib${kdelibsuff}/X11R6 \ + /usr/lib${kdelibsuff}/X11R5 \ + /usr/lib${kdelibsuff}/X11R4 \ + \ + /usr/local/X11/lib${kdelibsuff} \ + /usr/local/X11R6/lib${kdelibsuff} \ + /usr/local/X11R5/lib${kdelibsuff} \ + /usr/local/X11R4/lib${kdelibsuff} \ + \ + /usr/local/lib${kdelibsuff}/X11 \ + /usr/local/lib${kdelibsuff}/X11R6 \ + /usr/local/lib${kdelibsuff}/X11R5 \ + /usr/local/lib${kdelibsuff}/X11R4 \ + \ + /usr/X386/lib${kdelibsuff} \ + /usr/x386/lib${kdelibsuff} \ + /usr/XFree86/lib${kdelibsuff}/X11 \ + \ + /usr/lib${kdelibsuff} \ + /usr/local/lib${kdelibsuff} \ + /usr/unsupported/lib${kdelibsuff} \ + /usr/athena/lib${kdelibsuff} \ + /usr/local/x11r5/lib${kdelibsuff} \ + /usr/lpp/Xamples/lib${kdelibsuff} \ + /lib/usr/lib${kdelibsuff}/X11 \ + \ + /usr/openwin/lib${kdelibsuff} \ + /usr/openwin/share/lib${kdelibsuff} \ + ; \ +do +dnl Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done]) +fi # $ac_x_libraries = NO +]) + + +dnl ------------------------------------------------------------------------ +dnl Find a file (or one of more files in a list of dirs) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_FIND_FILE], +[ +$3=NO +for i in $2; +do + for j in $1; + do + echo "configure: __oline__: $i/$j" >&AC_FD_CC + if test -r "$i/$j"; then + echo "taking that" >&AC_FD_CC + $3=$i + break 2 + fi + done +done +]) + +dnl KDE_FIND_PATH(programm-name, variable-name, list of directories, +dnl if-not-found, test-parameter) +AC_DEFUN([KDE_FIND_PATH], +[ + AC_MSG_CHECKING([for $1]) + if test -n "$$2"; then + kde_cv_path="$$2"; + else + kde_cache=`echo $1 | sed 'y%./+-%__p_%'` + + AC_CACHE_VAL(kde_cv_path_$kde_cache, + [ + kde_cv_path="NONE" + dirs="$3" + kde_save_IFS=$IFS + IFS=':' + for dir in $PATH; do + dirs="$dirs $dir" + done + IFS=$kde_save_IFS + + for dir in $dirs; do + if test -x "$dir/$1"; then + if test -n "$5" + then + evalstr="$dir/$1 $5 2>&1 " + if eval $evalstr; then + kde_cv_path="$dir/$1" + break + fi + else + kde_cv_path="$dir/$1" + break + fi + fi + done + + eval "kde_cv_path_$kde_cache=$kde_cv_path" + + ]) + + eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\"" + + fi + + if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then + AC_MSG_RESULT(not found) + $4 + else + AC_MSG_RESULT($kde_cv_path) + $2=$kde_cv_path + + fi +]) + +AC_DEFUN([KDE_MOC_ERROR_MESSAGE], +[ + AC_MSG_ERROR([No Qt meta object compiler (moc) found! +Please check whether you installed Qt correctly. +You need to have a running moc binary. +configure tried to run $ac_cv_path_moc and the test didn't +succeed. If configure shouldn't have tried this one, set +the environment variable MOC to the right one before running +configure. +]) +]) + +AC_DEFUN([KDE_UIC_ERROR_MESSAGE], +[ + AC_MSG_WARN([No Qt ui compiler (uic) found! +Please check whether you installed Qt correctly. +You need to have a running uic binary. +configure tried to run $ac_cv_path_uic and the test didn't +succeed. If configure shouldn't have tried this one, set +the environment variable UIC to the right one before running +configure. +]) +]) + + +AC_DEFUN([KDE_CHECK_UIC_FLAG], +[ + AC_MSG_CHECKING([whether uic supports -$1 ]) + kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` + AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache, + [ + cat >conftest.ui < +EOT + ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null" + if AC_TRY_EVAL(ac_uic_testrun); then + eval "kde_cv_prog_uic_$kde_cache=yes" + else + eval "kde_cv_prog_uic_$kde_cache=no" + fi + rm -f conftest* + ]) + + if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then + AC_MSG_RESULT([yes]) + : + $3 + else + AC_MSG_RESULT([no]) + : + $4 + fi +]) + + +dnl ------------------------------------------------------------------------ +dnl Find the meta object compiler and the ui compiler in the PATH, +dnl in $QTDIR/bin, and some more usual places +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_PATH_QT_MOC_UIC], +[ + AC_REQUIRE([KDE_CHECK_PERL]) + qt_bindirs="" + for dir in $kde_qt_dirs; do + qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc" + done + qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin" + if test ! "$ac_qt_bindir" = "NO"; then + qt_bindirs="$ac_qt_bindir $qt_bindirs" + fi + + KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE]) + if test -z "$UIC_NOT_NEEDED"; then + KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""]) + if test -z "$UIC_PATH" ; then + KDE_UIC_ERROR_MESSAGE + exit 1 + else + UIC=$UIC_PATH + + if test $kde_qtver = 3; then + KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no) + KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no) + + if test x$ac_uic_supports_libpath = xyes; then + UIC="$UIC -L \$(kde_widgetdir)" + fi + if test x$ac_uic_supports_nounload = xyes; then + UIC="$UIC -nounload" + fi + fi + fi + else + UIC="echo uic not available: " + fi + + AC_SUBST(MOC) + AC_SUBST(UIC) + + UIC_TR="i18n" + if test $kde_qtver = 3; then + UIC_TR="tr2i18n" + fi + + AC_SUBST(UIC_TR) +]) + +AC_DEFUN([KDE_1_CHECK_PATHS], +[ + KDE_1_CHECK_PATH_HEADERS + + KDE_TEST_RPATH= + + if test -n "$USE_RPATH"; then + + if test -n "$kde_libraries"; then + KDE_TEST_RPATH="-R $kde_libraries" + fi + + if test -n "$qt_libraries"; then + KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries" + fi + + if test -n "$x_libraries"; then + KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries" + fi + + KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH" + fi + +AC_MSG_CHECKING([for KDE libraries installed]) +ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5' + +if AC_TRY_EVAL(ac_link) && test -s conftest; then + AC_MSG_RESULT(yes) +else + AC_MSG_ERROR([your system fails at linking a small KDE application! +Check, if your compiler is installed correctly and if you have used the +same compiler to compile Qt and kdelibs as you did use now. +For more details about this problem, look at the end of config.log.]) +fi + +if eval `KDEDIR= ./conftest 2>&5`; then + kde_result=done +else + kde_result=problems +fi + +KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log +kde_have_all_paths=yes + +KDE_SET_PATHS($kde_result) + +]) + +AC_DEFUN([KDE_SET_PATHS], +[ + kde_cv_all_paths="kde_have_all_paths=\"yes\" \ + kde_htmldir=\"$kde_htmldir\" \ + kde_appsdir=\"$kde_appsdir\" \ + kde_icondir=\"$kde_icondir\" \ + kde_sounddir=\"$kde_sounddir\" \ + kde_datadir=\"$kde_datadir\" \ + kde_locale=\"$kde_locale\" \ + kde_cgidir=\"$kde_cgidir\" \ + kde_confdir=\"$kde_confdir\" \ + kde_kcfgdir=\"$kde_kcfgdir\" \ + kde_mimedir=\"$kde_mimedir\" \ + kde_toolbardir=\"$kde_toolbardir\" \ + kde_wallpaperdir=\"$kde_wallpaperdir\" \ + kde_templatesdir=\"$kde_templatesdir\" \ + kde_bindir=\"$kde_bindir\" \ + kde_servicesdir=\"$kde_servicesdir\" \ + kde_servicetypesdir=\"$kde_servicetypesdir\" \ + kde_moduledir=\"$kde_moduledir\" \ + kde_styledir=\"$kde_styledir\" \ + kde_widgetdir=\"$kde_widgetdir\" \ + xdg_appsdir=\"$xdg_appsdir\" \ + xdg_menudir=\"$xdg_menudir\" \ + xdg_directorydir=\"$xdg_directorydir\" \ + kde_result=$1" +]) + +AC_DEFUN([KDE_SET_DEFAULT_PATHS], +[ +if test "$1" = "default"; then + + if test -z "$kde_htmldir"; then + kde_htmldir='\${datadir}/doc/HTML' + fi + if test -z "$kde_appsdir"; then + kde_appsdir='\${datadir}/applnk' + fi + if test -z "$kde_icondir"; then + kde_icondir='\${datadir}/icons' + fi + if test -z "$kde_sounddir"; then + kde_sounddir='\${datadir}/sounds' + fi + if test -z "$kde_datadir"; then + kde_datadir='\${datadir}/apps' + fi + if test -z "$kde_locale"; then + kde_locale='\${datadir}/locale' + fi + if test -z "$kde_cgidir"; then + kde_cgidir='\${exec_prefix}/cgi-bin' + fi + if test -z "$kde_confdir"; then + kde_confdir='\${datadir}/config' + fi + if test -z "$kde_kcfgdir"; then + kde_kcfgdir='\${datadir}/config.kcfg' + fi + if test -z "$kde_mimedir"; then + kde_mimedir='\${datadir}/mimelnk' + fi + if test -z "$kde_toolbardir"; then + kde_toolbardir='\${datadir}/toolbar' + fi + if test -z "$kde_wallpaperdir"; then + kde_wallpaperdir='\${datadir}/wallpapers' + fi + if test -z "$kde_templatesdir"; then + kde_templatesdir='\${datadir}/templates' + fi + if test -z "$kde_bindir"; then + kde_bindir='\${exec_prefix}/bin' + fi + if test -z "$kde_servicesdir"; then + kde_servicesdir='\${datadir}/services' + fi + if test -z "$kde_servicetypesdir"; then + kde_servicetypesdir='\${datadir}/servicetypes' + fi + if test -z "$kde_moduledir"; then + if test "$kde_qtver" = "2"; then + kde_moduledir='\${libdir}/kde2' + else + kde_moduledir='\${libdir}/kde3' + fi + fi + if test -z "$kde_styledir"; then + kde_styledir='\${libdir}/kde3/plugins/styles' + fi + if test -z "$kde_widgetdir"; then + kde_widgetdir='\${libdir}/kde3/plugins/designer' + fi + if test -z "$xdg_appsdir"; then + xdg_appsdir='\${datadir}/applications/kde' + fi + if test -z "$xdg_menudir"; then + xdg_menudir='\${sysconfdir}/xdg/menus' + fi + if test -z "$xdg_directorydir"; then + xdg_directorydir='\${datadir}/desktop-directories' + fi + + KDE_SET_PATHS(defaults) + +else + + if test $kde_qtver = 1; then + AC_MSG_RESULT([compiling]) + KDE_1_CHECK_PATHS + else + AC_MSG_ERROR([path checking not yet supported for KDE 2]) + fi + +fi +]) + +AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS], +[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" || + test -z "$kde_icondir" || test -z "$kde_sounddir" || + test -z "$kde_datadir" || test -z "$kde_locale" || + test -z "$kde_cgidir" || test -z "$kde_confdir" || + test -z "$kde_kcfgdir" || + test -z "$kde_mimedir" || test -z "$kde_toolbardir" || + test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" || + test -z "$kde_bindir" || test -z "$kde_servicesdir" || + test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" || + test -z "$kde_styledir" || test -z "kde_widgetdir" || + test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" || + test "x$kde_have_all_paths" != "xyes"; then + kde_have_all_paths=no + fi +]) + +AC_DEFUN([KDE_MISSING_PROG_ERROR], +[ + AC_MSG_ERROR([The important program $1 was not found! +Please check whether you installed KDE correctly. +]) +]) + +AC_DEFUN([KDE_MISSING_ARTS_ERROR], +[ + AC_MSG_ERROR([The important program $1 was not found! +Please check whether you installed aRts correctly or use +--without-arts to compile without aRts support (this will remove functionality). +]) +]) + +AC_DEFUN([KDE_SUBST_PROGRAMS], +[ + AC_ARG_WITH(arts, + AC_HELP_STRING([--without-arts],[build without aRts [default=yes]]), + [build_arts=$withval], + [build_arts=yes] + ) + AM_CONDITIONAL(include_ARTS, test "$build_arts" != "no") + + kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde3/bin /usr/kde/bin /usr/local/kde/bin" + test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs" + if test -n "$KDEDIRS"; then + kde_save_IFS=$IFS + IFS=: + for dir in $KDEDIRS; do + kde_default_bindirs="$dir/bin $kde_default_bindirs " + done + IFS=$kde_save_IFS + fi + kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs" + KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)]) + KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)]) + if test "$build_arts" != "no"; then + KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)]) + KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)]) + fi + KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs]) + KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs]) + + kde32ornewer=1 + if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then + kde32ornewer= + else + if test "$kde_qtver" = "3" && test "$kde_qtsubver" -le 1; then + kde32ornewer= + fi + fi + + if test -n "$kde32ornewer"; then + KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)]) + KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)]) + fi + KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [XMLLINT=""]) + + if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then + kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share" + test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs" + AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET) + if test "$KDE_XSL_STYLESHEET" = "NO"; then + KDE_XSL_STYLESHEET="" + else + KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl" + fi + fi + + DCOP_DEPENDENCIES='$(DCOPIDL)' + if test -n "$kde32ornewer"; then + KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)' + DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)' + AC_SUBST(KCONFIG_COMPILER) + AC_SUBST(KCFG_DEPENDENCIES) + AC_SUBST(DCOPIDLNG) + fi + AC_SUBST(DCOPIDL) + AC_SUBST(DCOPIDL2CPP) + AC_SUBST(DCOP_DEPENDENCIES) + AC_SUBST(MCOPIDL) + AC_SUBST(ARTSCCONFIG) + AC_SUBST(KDECONFIG) + AC_SUBST(MEINPROC) + AC_SUBST(KDE_XSL_STYLESHEET) + AC_SUBST(XMLLINT) + + if test -x "$KDECONFIG"; then # it can be "compiled" + kde_libs_prefix=`$KDECONFIG --prefix` + if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then + AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs. + This means it has been moved since you installed it. + This won't work. Please recompile kdelibs for the new prefix. + ]) + fi + kde_libs_htmldir=`$KDECONFIG --install html --expandvars` + else + kde_libs_prefix='$(prefix)' + kde_libs_htmldir='$(kde_htmldir)' + fi + AC_SUBST(kde_libs_prefix) + AC_SUBST(kde_libs_htmldir) +])dnl + +AC_DEFUN([AC_CREATE_KFSSTND], +[ +AC_REQUIRE([AC_CHECK_RPATH]) + +AC_MSG_CHECKING([for KDE paths]) +kde_result="" +kde_cached_paths=yes +AC_CACHE_VAL(kde_cv_all_paths, +[ + KDE_SET_DEFAULT_PATHS($1) + kde_cached_paths=no +]) +eval "$kde_cv_all_paths" +KDE_CHECK_PATHS_FOR_COMPLETENESS +if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then + # wrong values were cached, may be, we can set better ones + kde_result= + kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir= + kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir= + kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir= + kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir= + kde_have_all_paths= + kde_styledir= + kde_widgetdir= + xdg_appsdir = xdg_menudir= xdg_directorydir= + KDE_SET_DEFAULT_PATHS($1) + eval "$kde_cv_all_paths" + KDE_CHECK_PATHS_FOR_COMPLETENESS + kde_result="$kde_result (cache overridden)" +fi +if test "$kde_have_all_paths" = "no"; then + AC_MSG_ERROR([configure could not run a little KDE program to test the environment. +Since it had compiled and linked before, it must be a strange problem on your system. +Look at config.log for details. If you are not able to fix this, look at +http://www.kde.org/faq/installation.html or any www.kde.org mirror. +(If you're using an egcs version on Linux, you may update binutils!) +]) +else + rm -f conftest* + AC_MSG_RESULT($kde_result) +fi + +bindir=$kde_bindir + +KDE_SUBST_PROGRAMS + +]) + +AC_DEFUN([AC_SUBST_KFSSTND], +[ +AC_SUBST(kde_htmldir) +AC_SUBST(kde_appsdir) +AC_SUBST(kde_icondir) +AC_SUBST(kde_sounddir) +AC_SUBST(kde_datadir) +AC_SUBST(kde_locale) +AC_SUBST(kde_confdir) +AC_SUBST(kde_kcfgdir) +AC_SUBST(kde_mimedir) +AC_SUBST(kde_wallpaperdir) +AC_SUBST(kde_bindir) +dnl X Desktop Group standards +AC_SUBST(xdg_appsdir) +AC_SUBST(xdg_menudir) +AC_SUBST(xdg_directorydir) +dnl for KDE 2 +AC_SUBST(kde_templatesdir) +AC_SUBST(kde_servicesdir) +AC_SUBST(kde_servicetypesdir) +AC_SUBST(kde_moduledir) +AC_SUBST(kdeinitdir, '$(kde_moduledir)') +AC_SUBST(kde_styledir) +AC_SUBST(kde_widgetdir) +if test "$kde_qtver" = 1; then + kde_minidir="$kde_icondir/mini" +else +# for KDE 1 - this breaks KDE2 apps using minidir, but +# that's the plan ;-/ + kde_minidir="/dev/null" +fi +dnl AC_SUBST(kde_minidir) +dnl AC_SUBST(kde_cgidir) +dnl AC_SUBST(kde_toolbardir) +]) + +AC_DEFUN([KDE_MISC_TESTS], +[ + dnl Checks for libraries. + AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD + AC_SUBST(LIBUTIL) + AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD + AC_SUBST(LIBCOMPAT) + kde_have_crypt= + AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes], + AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [ + AC_MSG_WARN([you have no crypt in either libcrypt or libc. +You should install libcrypt from another source or configure with PAM +support]) + kde_have_crypt=no + ])) + AC_SUBST(LIBCRYPT) + if test $kde_have_crypt = yes; then + AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function]) + fi + AC_CHECK_SOCKLEN_T + AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + AC_CHECK_LIB(dnet_stub, dnet_ntoa, + [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) + fi + AC_CHECK_FUNC(inet_ntoa) + if test $ac_cv_func_inet_ntoa = no; then + AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl") + fi + AC_CHECK_FUNC(connect) + if test $ac_cv_func_connect = no; then + AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", , + $X_EXTRA_LIBS) + fi + + AC_CHECK_FUNC(remove) + if test $ac_cv_func_remove = no; then + AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + AC_CHECK_FUNC(shmat, , + AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc")) + + # more headers that need to be explicitly included on darwin + AC_CHECK_HEADERS(sys/types.h stdint.h) + + # darwin requires a poll emulation library + AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll") + + # CoreAudio framework + AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [ + AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API]) + FRAMEWORK_COREAUDIO="-Xlinker -framework -Xlinker CoreAudio" + ]) + + AC_CHECK_RES_INIT + AC_SUBST(LIB_POLL) + AC_SUBST(FRAMEWORK_COREAUDIO) + LIBSOCKET="$X_EXTRA_LIBS" + AC_SUBST(LIBSOCKET) + AC_SUBST(X_EXTRA_LIBS) + AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4 + AC_SUBST(LIBUCB) + + case $host in dnl this *is* LynxOS specific + *-*-lynxos* ) + AC_MSG_CHECKING([LynxOS header file wrappers]) + [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"] + AC_MSG_RESULT(disabled) + AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS + ;; + esac + + KDE_CHECK_TYPES + KDE_CHECK_LIBDL + KDE_CHECK_STRLCPY + +# darwin needs this to initialize the environment +AC_CHECK_HEADERS(crt_externs.h) +AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])]) + +AH_VERBATIM(_DARWIN_ENVIRON, +[ +#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) +# include +# include +# define environ (*_NSGetEnviron()) +#endif +]) + +AH_VERBATIM(_AIX_STRINGS_H_BZERO, +[ +/* + * AIX defines FD_SET in terms of bzero, but fails to include + * that defines bzero. + */ + +#if defined(_AIX) +#include +#endif +]) + +AC_CHECK_FUNCS([vsnprintf snprintf]) + +AH_VERBATIM(_TRU64,[ +/* + * On HP-UX, the declaration of vsnprintf() is needed every time ! + */ + +#if !defined(HAVE_VSNPRINTF) || defined(hpux) +#if __STDC__ +#include +#include +#else +#include +#endif +#ifdef __cplusplus +extern "C" +#endif +int vsnprintf(char *str, size_t n, char const *fmt, va_list ap); +#ifdef __cplusplus +extern "C" +#endif +int snprintf(char *str, size_t n, char const *fmt, ...); +#endif +]) + +]) + +dnl ------------------------------------------------------------------------ +dnl Find the header files and libraries for X-Windows. Extended the +dnl macro AC_PATH_X +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([K_PATH_X], +[ +AC_REQUIRE([KDE_MISC_TESTS])dnl +AC_REQUIRE([KDE_CHECK_LIB64]) + +AC_ARG_ENABLE( + embedded, + AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]), + kde_use_qt_emb=$enableval, + kde_use_qt_emb=no +) + +AC_ARG_ENABLE( + qtopia, + AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]), + kde_use_qt_emb_palm=$enableval, + kde_use_qt_emb_palm=no +) + +AC_ARG_ENABLE( + mac, + AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]), + kde_use_qt_mac=$enableval, + kde_use_qt_mac=no +) + +if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then + +AC_MSG_CHECKING(for X) + +AC_CACHE_VAL(kde_cv_have_x, +[# One or both of the vars are not set, and there is no cached value. +if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then + kde_x_includes=NO +else + kde_x_includes=$x_includes +fi +if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then + kde_x_libraries=NO +else + kde_x_libraries=$x_libraries +fi + +# below we use the standard autoconf calls +ac_x_libraries=$kde_x_libraries +ac_x_includes=$kde_x_includes + +KDE_PATH_X_DIRECT +dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries. +dnl Unfortunately, if compiling with the N32 ABI, this is not the correct +dnl location. The correct location is /usr/lib32 or an undefined value +dnl (the linker is smart enough to pick the correct default library). +dnl Things work just fine if you use just AC_PATH_X_DIRECT. +dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to +dnl /usr/openwin/include, which doesn't work. /usr/include does work, so +dnl x_includes should be left alone. +case "$host" in +mips-sgi-irix6*) + ;; +*-*-solaris*) + ;; +*) + _AC_PATH_X_XMKMF + if test -z "$ac_x_includes"; then + ac_x_includes="." + fi + if test -z "$ac_x_libraries"; then + ac_x_libraries="/usr/lib${kdelibsuff}" + fi +esac +#from now on we use our own again + +# when the user already gave --x-includes, we ignore +# what the standard autoconf macros told us. +if test "$kde_x_includes" = NO; then + kde_x_includes=$ac_x_includes +fi + +# for --x-libraries too +if test "$kde_x_libraries" = NO; then + kde_x_libraries=$ac_x_libraries +fi + +if test "$kde_x_includes" = NO; then + AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!]) +fi + +if test "$kde_x_libraries" = NO; then + AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!]) +fi + +# Record where we found X for the cache. +kde_cv_have_x="have_x=yes \ + kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries" +])dnl + +eval "$kde_cv_have_x" + +if test "$have_x" != yes; then + AC_MSG_RESULT($have_x) + no_x=yes +else + AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes]) +fi + +if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then + X_INCLUDES="" + x_includes="."; dnl better than nothing :- + else + x_includes=$kde_x_includes + X_INCLUDES="-I$x_includes" +fi + +if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then + X_LDFLAGS="" + x_libraries="/usr/lib"; dnl better than nothing :- + else + x_libraries=$kde_x_libraries + X_LDFLAGS="-L$x_libraries" +fi +all_includes="$X_INCLUDES" +all_libraries="$X_LDFLAGS" + +# Check for libraries that X11R6 Xt/Xaw programs need. +ac_save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS $X_LDFLAGS" +# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to +# check for ICE first), but we must link in the order -lSM -lICE or +# we get undefined symbols. So assume we have SM if we have ICE. +# These have to be linked with before -lX11, unlike the other +# libraries we check for below, so use a different variable. +# --interran@uluru.Stanford.EDU, kb@cs.umb.edu. +AC_CHECK_LIB(ICE, IceConnectionNumber, + [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS) +LDFLAGS="$ac_save_LDFLAGS" + +LIB_X11='-lX11 $(LIBSOCKET)' + +AC_MSG_CHECKING(for libXext) +AC_CACHE_VAL(kde_cv_have_libXext, +[ +kde_ldflags_safe="$LDFLAGS" +kde_libs_safe="$LIBS" + +LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS" +LIBS="-lXext -lX11 $LIBSOCKET" + +AC_TRY_LINK([ +#include +#ifdef STDC_HEADERS +# include +#endif +], +[ +printf("hello Xext\n"); +], +kde_cv_have_libXext=yes, +kde_cv_have_libXext=no +) + +LDFLAGS=$kde_ldflags_safe +LIBS=$kde_libs_safe +]) + +AC_MSG_RESULT($kde_cv_have_libXext) + +if test "$kde_cv_have_libXext" = "no"; then + AC_MSG_ERROR([We need a working libXext to proceed. Since configure +can't find it itself, we stop here assuming that make wouldn't find +them either.]) +fi + +LIB_XEXT="-lXext" +QTE_NORTTI="" + +elif test "$kde_use_qt_emb" = "yes"; then + dnl We're using QT Embedded + CPPFLAGS=-DQWS + CXXFLAGS="$CXXFLAGS -fno-rtti" + QTE_NORTTI="-fno-rtti -DQWS" + X_PRE_LIBS="" + LIB_X11="" + LIB_XEXT="" + LIB_XRENDER="" + LIBSM="" + X_INCLUDES="" + X_LDFLAGS="" + x_includes="" + x_libraries="" +elif test "$kde_use_qt_mac" = "yes"; then + dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to + dnl be included to get the information) --Sam + CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp" + CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp" + X_PRE_LIBS="" + LIB_X11="" + LIB_XEXT="" + LIB_XRENDER="" + LIBSM="" + X_INCLUDES="" + X_LDFLAGS="" + x_includes="" + x_libraries="" +fi +AC_SUBST(X_PRE_LIBS) +AC_SUBST(LIB_X11) +AC_SUBST(LIB_XRENDER) +AC_SUBST(LIBSM) +AC_SUBST(X_INCLUDES) +AC_SUBST(X_LDFLAGS) +AC_SUBST(x_includes) +AC_SUBST(x_libraries) +AC_SUBST(QTE_NORTTI) +AC_SUBST(LIB_XEXT) + +]) + +AC_DEFUN([KDE_PRINT_QT_PROGRAM], +[ +AC_REQUIRE([KDE_USE_QT]) +cat > conftest.$ac_ext < +#include +EOF +if test "$kde_qtver" = "2"; then +cat >> conftest.$ac_ext < +#include +#include +EOF + +if test $kde_qtsubver -gt 0; then +cat >> conftest.$ac_ext <> conftest.$ac_ext < +#include +#include +EOF +fi + +echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext +cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC +fi + +rm -f conftest* +CXXFLAGS="$ac_cxxflags_safe" +LDFLAGS="$ac_ldflags_safe" +LIBS="$ac_libs_safe" + +LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" +export LD_LIBRARY_PATH +LIBRARY_PATH="$ac_LIBRARY_PATH" +export LIBRARY_PATH +AC_LANG_RESTORE +]) + +if test "$kde_cv_qt_direct" = "yes"; then + AC_MSG_RESULT(yes) + $1 +else + AC_MSG_RESULT(no) + $2 +fi +]) + +dnl ------------------------------------------------------------------------ +dnl Try to find the Qt headers and libraries. +dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed) +dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_PATH_QT_1_3], +[ +AC_REQUIRE([K_PATH_X]) +AC_REQUIRE([KDE_USE_QT]) +AC_REQUIRE([KDE_CHECK_LIB64]) + +dnl ------------------------------------------------------------------------ +dnl Add configure flag to enable linking to MT version of Qt library. +dnl ------------------------------------------------------------------------ + +AC_ARG_ENABLE( + mt, + AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]), + kde_use_qt_mt=$enableval, + [ + if test $kde_qtver = 3; then + kde_use_qt_mt=yes + else + kde_use_qt_mt=no + fi + ] +) + +USING_QT_MT="" + +dnl ------------------------------------------------------------------------ +dnl If we not get --disable-qt-mt then adjust some vars for the host. +dnl ------------------------------------------------------------------------ + +KDE_MT_LDFLAGS= +KDE_MT_LIBS= +if test "x$kde_use_qt_mt" = "xyes"; then + KDE_CHECK_THREADING + if test "x$kde_use_threading" = "xyes"; then + CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS" + KDE_MT_LDFLAGS="$USE_THREADS" + KDE_MT_LIBS="$LIBPTHREAD" + else + kde_use_qt_mt=no + fi +fi +AC_SUBST(KDE_MT_LDFLAGS) +AC_SUBST(KDE_MT_LIBS) + +kde_qt_was_given=yes + +dnl ------------------------------------------------------------------------ +dnl If we haven't been told how to link to Qt, we work it out for ourselves. +dnl ------------------------------------------------------------------------ +if test -z "$LIBQT_GLOB"; then + if test "x$kde_use_qt_emb" = "xyes"; then + LIBQT_GLOB="libqte.*" + else + LIBQT_GLOB="libqt.*" + fi +fi + +if test -z "$LIBQT"; then +dnl ------------------------------------------------------------ +dnl If we got --enable-embedded then adjust the Qt library name. +dnl ------------------------------------------------------------ + if test "x$kde_use_qt_emb" = "xyes"; then + qtlib="qte" + else + qtlib="qt" + fi + + kde_int_qt="-l$qtlib" +else + kde_int_qt="$LIBQT" + kde_lib_qt_set=yes +fi + +if test -z "$LIBQPE"; then +dnl ------------------------------------------------------------ +dnl If we got --enable-palmtop then add -lqpe to the link line +dnl ------------------------------------------------------------ + if test "x$kde_use_qt_emb" = "xyes"; then + if test "x$kde_use_qt_emb_palm" = "xyes"; then + LIB_QPE="-lqpe" + else + LIB_QPE="" + fi + else + LIB_QPE="" + fi +fi + +dnl ------------------------------------------------------------------------ +dnl If we got --enable-qt-mt then adjust the Qt library name for the host. +dnl ------------------------------------------------------------------------ + +if test "x$kde_use_qt_mt" = "xyes"; then + if test -z "$LIBQT"; then + LIBQT="-l$qtlib-mt" + kde_int_qt="-l$qtlib-mt" + else + LIBQT="$qtlib-mt" + kde_int_qt="$qtlib-mt" + fi + LIBQT_GLOB="lib$qtlib-mt.*" + USING_QT_MT="using -mt" +else + LIBQT="-l$qtlib" +fi + +if test $kde_qtver != 1; then + + AC_REQUIRE([AC_FIND_PNG]) + AC_REQUIRE([AC_FIND_JPEG]) + LIBQT="$LIBQT $LIBPNG $LIBJPEG" +fi + +if test $kde_qtver = 3; then + AC_REQUIRE([KDE_CHECK_LIBDL]) + LIBQT="$LIBQT $LIBDL" +fi + +AC_MSG_CHECKING([for Qt]) + +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET" +fi +ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO +qt_libraries="" +qt_includes="" +AC_ARG_WITH(qt-dir, + AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]), + [ ac_qt_includes="$withval"/include + ac_qt_libraries="$withval"/lib${kdelibsuff} + ac_qt_bindir="$withval"/bin + ]) + +AC_ARG_WITH(qt-includes, + AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]), + [ + ac_qt_includes="$withval" + ]) + +kde_qt_libs_given=no + +AC_ARG_WITH(qt-libraries, + AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]), + [ ac_qt_libraries="$withval" + kde_qt_libs_given=yes + ]) + +AC_CACHE_VAL(ac_cv_have_qt, +[#try to guess Qt locations + +qt_incdirs="" +for dir in $kde_qt_dirs; do + qt_incdirs="$qt_incdirs $dir/include $dir" +done +qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes" +if test ! "$ac_qt_includes" = "NO"; then + qt_incdirs="$ac_qt_includes $qt_incdirs" +fi + +if test "$kde_qtver" != "1"; then + kde_qt_header=qstyle.h +else + kde_qt_header=qglobal.h +fi + +AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) +ac_qt_includes="$qt_incdir" + +qt_libdirs="" +for dir in $kde_qt_dirs; do + qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir" +done +qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries" +if test ! "$ac_qt_libraries" = "NO"; then + qt_libdir=$ac_qt_libraries +else + qt_libdirs="$ac_qt_libraries $qt_libdirs" + # if the Qt was given, the chance is too big that libqt.* doesn't exist + qt_libdir=NONE + for dir in $qt_libdirs; do + try="ls -1 $dir/${LIBQT_GLOB}" + if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi + done +fi +for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do + if test -e "$a"; then + LIBQT="$LIBQT ${kde_int_qt}_incremental" + break + fi +done + +ac_qt_libraries="$qt_libdir" + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +ac_cxxflags_safe="$CXXFLAGS" +ac_ldflags_safe="$LDFLAGS" +ac_libs_safe="$LIBS" + +CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" +LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS" +LIBS="$LIBS $LIBQT $KDE_MT_LIBS" + +KDE_PRINT_QT_PROGRAM + +if AC_TRY_EVAL(ac_link) && test -s conftest; then + rm -f conftest* +else + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&AC_FD_CC + ac_qt_libraries="NO" +fi +rm -f conftest* +CXXFLAGS="$ac_cxxflags_safe" +LDFLAGS="$ac_ldflags_safe" +LIBS="$ac_libs_safe" + +AC_LANG_RESTORE +if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then + ac_cv_have_qt="have_qt=no" + ac_qt_notfound="" + missing_qt_mt="" + if test "$ac_qt_includes" = NO; then + if test "$ac_qt_libraries" = NO; then + ac_qt_notfound="(headers and libraries)"; + else + ac_qt_notfound="(headers)"; + fi + else + if test "x$kde_use_qt_mt" = "xyes"; then + missing_qt_mt=" +Make sure that you have compiled Qt with thread support!" + ac_qt_notfound="(library $qtlib-mt)"; + else + ac_qt_notfound="(library $qtlib)"; + fi + fi + + AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation! +For more details about this problem, look at the end of config.log.$missing_qt_mt]) +else + have_qt="yes" +fi +]) + +eval "$ac_cv_have_qt" + +if test "$have_qt" != yes; then + AC_MSG_RESULT([$have_qt]); +else + ac_cv_have_qt="have_qt=yes \ + ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" + AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT]) + + qt_libraries="$ac_qt_libraries" + qt_includes="$ac_qt_includes" +fi + +if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then + KDE_CHECK_QT_DIRECT(qt_libraries= ,[]) +fi + +AC_SUBST(qt_libraries) +AC_SUBST(qt_includes) + +if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then + QT_INCLUDES="" +else + QT_INCLUDES="-I$qt_includes" + all_includes="$QT_INCLUDES $all_includes" +fi + +if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then + QT_LDFLAGS="" +else + QT_LDFLAGS="-L$qt_libraries" + all_libraries="$all_libraries $QT_LDFLAGS" +fi +test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS" + +AC_SUBST(QT_INCLUDES) +AC_SUBST(QT_LDFLAGS) +AC_PATH_QT_MOC_UIC + +KDE_CHECK_QT_JPEG + +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)' +else +LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)' +fi +test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS" +for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do + if test -e "$a"; then + LIB_QT="$LIB_QT ${kde_int_qt}_incremental" + break + fi +done + +AC_SUBST(LIB_QT) +AC_SUBST(LIB_QPE) + +AC_SUBST(kde_qtver) +]) + +AC_DEFUN([AC_PATH_QT], +[ +AC_PATH_QT_1_3 +]) + +AC_DEFUN([KDE_CHECK_UIC_PLUGINS], +[ +AC_REQUIRE([AC_PATH_QT_MOC_UIC]) + +if test x$ac_uic_supports_libpath = xyes; then + +AC_MSG_CHECKING([if UIC has KDE plugins available]) +AC_CACHE_VAL(kde_cv_uic_plugins, +[ +cat > actest.ui << EOF + +NewConnectionDialog + + + + testInput + + + + +EOF + + + +kde_cv_uic_plugins=no +kde_line="$UIC_PATH -L $kde_widgetdir" +if test x$ac_uic_supports_nounload = xyes; then + kde_line="$kde_line -nounload" +fi +kde_line="$kde_line -impl actest.h actest.ui > actest.cpp" +if AC_TRY_EVAL(kde_line); then + # if you're trying to debug this check and think it's incorrect, + # better check your installation. The check _is_ correct - your + # installation is not. + if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then + kde_cv_uic_plugins=yes + fi +fi +rm -f actest.ui actest.cpp +]) + +AC_MSG_RESULT([$kde_cv_uic_plugins]) +if test "$kde_cv_uic_plugins" != yes; then + AC_MSG_ERROR([you need to install kdelibs first.]) +fi +fi +]) + +AC_DEFUN([KDE_CHECK_FINAL], +[ + AC_ARG_ENABLE(final, + AC_HELP_STRING([--enable-final], + [build size optimized apps (experimental - needs lots of memory)]), + kde_use_final=$enableval, kde_use_final=no) + + if test "x$kde_use_final" = "xyes"; then + KDE_USE_FINAL_TRUE="" + KDE_USE_FINAL_FALSE="#" + else + KDE_USE_FINAL_TRUE="#" + KDE_USE_FINAL_FALSE="" + fi + AC_SUBST(KDE_USE_FINAL_TRUE) + AC_SUBST(KDE_USE_FINAL_FALSE) +]) + +AC_DEFUN([KDE_CHECK_CLOSURE], +[ + AC_ARG_ENABLE(closure, + AC_HELP_STRING([--enable-closure],[delay template instantiation]), + kde_use_closure=$enableval, kde_use_closure=no) + + KDE_NO_UNDEFINED="" + if test "x$kde_use_closure" = "xyes"; then + KDE_USE_CLOSURE_TRUE="" + KDE_USE_CLOSURE_FALSE="#" +# CXXFLAGS="$CXXFLAGS $REPO" + else + KDE_USE_CLOSURE_TRUE="#" + KDE_USE_CLOSURE_FALSE="" + KDE_NO_UNDEFINED="" + case $host in + *-*-linux-gnu) + KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined], + [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined], + [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"], + [KDE_NO_UNDEFINED=""])], + [KDE_NO_UNDEFINED=""]) + ;; + esac + fi + AC_SUBST(KDE_USE_CLOSURE_TRUE) + AC_SUBST(KDE_USE_CLOSURE_FALSE) + AC_SUBST(KDE_NO_UNDEFINED) +]) + +AC_DEFUN([KDE_CHECK_NMCHECK], +[ + AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]), + kde_use_nmcheck=$enableval, kde_use_nmcheck=no) + + if test "$kde_use_nmcheck" = "yes"; then + KDE_USE_NMCHECK_TRUE="" + KDE_USE_NMCHECK_FALSE="#" + else + KDE_USE_NMCHECK_TRUE="#" + KDE_USE_NMCHECK_FALSE="" + fi + AC_SUBST(KDE_USE_NMCHECK_TRUE) + AC_SUBST(KDE_USE_NMCHECK_FALSE) +]) + +AC_DEFUN([KDE_EXPAND_MAKEVAR], [ +savex=$exec_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +tmp=$$2 +while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done +exec_prefix=$savex +]) + +dnl ------------------------------------------------------------------------ +dnl Now, the same with KDE +dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed) +dnl and $(kde_includes) will be the kdehdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_BASE_PATH_KDE], +[ +AC_REQUIRE([KDE_CHECK_STL]) +AC_REQUIRE([AC_PATH_QT])dnl +AC_REQUIRE([KDE_CHECK_LIB64]) + +AC_CHECK_RPATH +AC_MSG_CHECKING([for KDE]) + +if test "${prefix}" != NONE; then + kde_includes=${includedir} + KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir) + + kde_libraries=${libdir} + KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir) + +else + ac_kde_includes= + ac_kde_libraries= + kde_libraries="" + kde_includes="" +fi + +AC_CACHE_VAL(ac_cv_have_kde, +[#try to guess kde locations + +if test "$kde_qtver" = 1; then + kde_check_header="ksock.h" + kde_check_lib="libkdecore.la" +else + kde_check_header="ksharedptr.h" + kde_check_lib="libkio.la" +fi + +if test -z "$1"; then + +kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes $qt_includes" +test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs" +kde_incdirs="$ac_kde_includes $kde_incdirs" +AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir) +ac_kde_includes="$kde_incdir" + +if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then + AC_MSG_ERROR([ +in the prefix, you've chosen, are no KDE headers installed. This will fail. +So, check this please and use another prefix!]) +fi + +kde_libdirs="/usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/kde3 /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/kde3/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}" +test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs" +kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs" +AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir) +ac_kde_libraries="$kde_libdir" + +kde_widgetdir=NO +dnl this might be somewhere else +AC_FIND_FILE("kde3/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir) + +if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then +AC_MSG_ERROR([ +in the prefix, you've chosen, are no KDE libraries installed. This will fail. +So, check this please and use another prefix!]) +fi + +if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/kde3/plugins/designer/kdewidgets.la"; then +AC_MSG_ERROR([ +I can't find the designer plugins. These are required and should have been installed +by kdelibs]) +fi + +if test -n "$kde_widgetdir"; then + kde_widgetdir="$kde_widgetdir/kde3/plugins/designer" +fi + + +if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then + ac_cv_have_kde="have_kde=no" +else + ac_cv_have_kde="have_kde=yes \ + ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" +fi + +else dnl test -z $1 + + ac_cv_have_kde="have_kde=no" + +fi +])dnl + +eval "$ac_cv_have_kde" + +if test "$have_kde" != "yes"; then + if test "${prefix}" = NONE; then + ac_kde_prefix="$ac_default_prefix" + else + ac_kde_prefix="$prefix" + fi + if test "$exec_prefix" = NONE; then + ac_kde_exec_prefix="$ac_kde_prefix" + AC_MSG_RESULT([will be installed in $ac_kde_prefix]) + else + ac_kde_exec_prefix="$exec_prefix" + AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix]) + fi + + kde_libraries="${libdir}" + kde_includes="${includedir}" + +else + ac_cv_have_kde="have_kde=yes \ + ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries" + AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes]) + + kde_libraries="$ac_kde_libraries" + kde_includes="$ac_kde_includes" +fi +AC_SUBST(kde_libraries) +AC_SUBST(kde_includes) + +if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then + KDE_INCLUDES="" +else + KDE_INCLUDES="-I$kde_includes" + all_includes="$KDE_INCLUDES $all_includes" +fi + +KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION" + +KDE_LDFLAGS="-L$kde_libraries" +if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then + all_libraries="$all_libraries $KDE_LDFLAGS" +fi + +AC_SUBST(KDE_LDFLAGS) +AC_SUBST(KDE_INCLUDES) + +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + +all_libraries="$all_libraries $USER_LDFLAGS" +all_includes="$all_includes $USER_INCLUDES" +AC_SUBST(all_includes) +AC_SUBST(all_libraries) + +if test -z "$1"; then +KDE_CHECK_UIC_PLUGINS +fi + +ac_kde_libraries="$kde_libdir" + +AC_SUBST(AUTODIRS) + + +]) + +AC_DEFUN([KDE_CHECK_EXTRA_LIBS], +[ +AC_MSG_CHECKING(for extra includes) +AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]), + kde_use_extra_includes="$withval", + kde_use_extra_includes=NONE +) +kde_extra_includes= +if test -n "$kde_use_extra_includes" && \ + test "$kde_use_extra_includes" != "NONE"; then + + ac_save_ifs=$IFS + IFS=':' + for dir in $kde_use_extra_includes; do + kde_extra_includes="$kde_extra_includes $dir" + USER_INCLUDES="$USER_INCLUDES -I$dir" + done + IFS=$ac_save_ifs + kde_use_extra_includes="added" +else + kde_use_extra_includes="no" +fi +AC_SUBST(USER_INCLUDES) + +AC_MSG_RESULT($kde_use_extra_includes) + +kde_extra_libs= +AC_MSG_CHECKING(for extra libs) +AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]), + kde_use_extra_libs=$withval, + kde_use_extra_libs=NONE +) +if test -n "$kde_use_extra_libs" && \ + test "$kde_use_extra_libs" != "NONE"; then + + ac_save_ifs=$IFS + IFS=':' + for dir in $kde_use_extra_libs; do + kde_extra_libs="$kde_extra_libs $dir" + KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir" + USER_LDFLAGS="$USER_LDFLAGS -L$dir" + done + IFS=$ac_save_ifs + kde_use_extra_libs="added" +else + kde_use_extra_libs="no" +fi + +AC_SUBST(USER_LDFLAGS) + +AC_MSG_RESULT($kde_use_extra_libs) + +]) + +AC_DEFUN([KDE_1_CHECK_PATH_HEADERS], +[ + AC_MSG_CHECKING([for KDE headers installed]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS +cat > conftest.$ac_ext < +#endif +#include +#include "confdefs.h" +#include + +int main() { + printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data()); + printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data()); + printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data()); + printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data()); + printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data()); + printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data()); + printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data()); + printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data()); + printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data()); + printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data()); + printf("kde_wallpaperdir=\\"%s\\"\n", + KApplication::kde_wallpaperdir().data()); + printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data()); + printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data()); + printf("kde_servicesdir=\\"/tmp/dummy\\"\n"); + printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n"); + printf("kde_moduledir=\\"/tmp/dummy\\"\n"); + printf("kde_styledir=\\"/tmp/dummy\\"\n"); + printf("kde_widgetdir=\\"/tmp/dummy\\"\n"); + printf("xdg_appsdir=\\"/tmp/dummy\\"\n"); + printf("xdg_menudir=\\"/tmp/dummy\\"\n"); + printf("xdg_directorydir=\\"/tmp/dummy\\"\n"); + printf("kde_kcfgdir=\\"/tmp/dummy\\"\n"); + return 0; + } +EOF + + ac_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$all_includes $CPPFLAGS" + if AC_TRY_EVAL(ac_compile); then + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR([your system is not able to compile a small KDE application! +Check, if you installed the KDE header files correctly. +For more details about this problem, look at the end of config.log.]) + fi + CPPFLAGS=$ac_save_CPPFLAGS + + AC_LANG_RESTORE +]) + +AC_DEFUN([KDE_CHECK_KDEQTADDON], +[ +AC_MSG_CHECKING(for kde-qt-addon) +AC_CACHE_VAL(kde_cv_have_kdeqtaddon, +[ + kde_ldflags_safe="$LDFLAGS" + kde_libs_safe="$LIBS" + kde_cxxflags_safe="$CXXFLAGS" + + LIBS="-lkde-qt-addon $LIBQT $LIBS" + CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes" + LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS" + + AC_TRY_LINK([ + #include + ], + [ + QDomDocument doc; + ], + kde_cv_have_kdeqtaddon=yes, + kde_cv_have_kdeqtaddon=no + ) + + LDFLAGS=$kde_ldflags_safe + LIBS=$kde_libs_safe + CXXFLAGS=$kde_cxxflags_safe +]) + +AC_MSG_RESULT($kde_cv_have_kdeqtaddon) + +if test "$kde_cv_have_kdeqtaddon" = "no"; then + AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first. +It is a separate package (and CVS module) named kde-qt-addon.]) +fi +]) + +AC_DEFUN([KDE_CREATE_LIBS_ALIASES], +[ + AC_REQUIRE([KDE_MISC_TESTS]) + AC_REQUIRE([KDE_CHECK_LIBDL]) + AC_REQUIRE([K_PATH_X]) + +if test $kde_qtver = 3; then + AC_SUBST(LIB_KDECORE, "-lkdecore") + AC_SUBST(LIB_KDEUI, "-lkdeui") + AC_SUBST(LIB_KIO, "-lkio") + AC_SUBST(LIB_SMB, "-lsmb") + AC_SUBST(LIB_KAB, "-lkab") + AC_SUBST(LIB_KABC, "-lkabc") + AC_SUBST(LIB_KHTML, "-lkhtml") + AC_SUBST(LIB_KSPELL, "-lkspell") + AC_SUBST(LIB_KPARTS, "-lkparts") + AC_SUBST(LIB_KDEPRINT, "-lkdeprint") + AC_SUBST(LIB_KUTILS, "-lkutils") + AC_SUBST(LIB_KDEPIM, "-lkdepim") +# these are for backward compatibility + AC_SUBST(LIB_KSYCOCA, "-lkio") + AC_SUBST(LIB_KFILE, "-lkio") +elif test $kde_qtver = 2; then + AC_SUBST(LIB_KDECORE, "-lkdecore") + AC_SUBST(LIB_KDEUI, "-lkdeui") + AC_SUBST(LIB_KIO, "-lkio") + AC_SUBST(LIB_KSYCOCA, "-lksycoca") + AC_SUBST(LIB_SMB, "-lsmb") + AC_SUBST(LIB_KFILE, "-lkfile") + AC_SUBST(LIB_KAB, "-lkab") + AC_SUBST(LIB_KHTML, "-lkhtml") + AC_SUBST(LIB_KSPELL, "-lkspell") + AC_SUBST(LIB_KPARTS, "-lkparts") + AC_SUBST(LIB_KDEPRINT, "-lkdeprint") +else + AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)") + AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)") + AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)") + AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)") + AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)") +fi +]) + +AC_DEFUN([AC_PATH_KDE], +[ + AC_BASE_PATH_KDE + AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]), + [ + if test "$enableval" = "no"; + then ac_use_path_checking="default" + else ac_use_path_checking="" + fi + ], + [ + if test "$kde_qtver" = 1; + then ac_use_path_checking="" + else ac_use_path_checking="default" + fi + ] + ) + + AC_CREATE_KFSSTND($ac_use_path_checking) + + AC_SUBST_KFSSTND + KDE_CREATE_LIBS_ALIASES +]) + +dnl KDE_CHECK_FUNC_EXT(, [headers], [sample-use], [C prototype], [autoheader define], [call if found]) +AC_DEFUN([KDE_CHECK_FUNC_EXT], +[ +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(kde_cv_func_$1, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +save_CXXFLAGS="$CXXFLAGS" +kde_safe_LIBS="$LIBS" +LIBS="$LIBS $X_EXTRA_LIBS" +if test "$GXX" = "yes"; then +CXXFLAGS="$CXXFLAGS -pedantic-errors" +fi +AC_TRY_COMPILE([ +$2 +], +[ +$3 +], +kde_cv_func_$1=yes, +kde_cv_func_$1=no) +CXXFLAGS="$save_CXXFLAGS" +LIBS="$kde_safe_LIBS" +AC_LANG_RESTORE +]) + +AC_MSG_RESULT($kde_cv_func_$1) + +AC_MSG_CHECKING([if $1 needs custom prototype]) +AC_CACHE_VAL(kde_cv_proto_$1, +[ +if test "x$kde_cv_func_$1" = xyes; then + kde_cv_proto_$1=no +else + case "$1" in + setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat) + kde_cv_proto_$1="yes - in libkdefakes" + ;; + *) + kde_cv_proto_$1=unknown + ;; + esac +fi + +if test "x$kde_cv_proto_$1" = xunknown; then + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + kde_safe_libs=$LIBS + LIBS="$LIBS $X_EXTRA_LIBS" + AC_TRY_LINK([ +$2 + +extern "C" $4; +], +[ +$3 +], +[ kde_cv_func_$1=yes + kde_cv_proto_$1=yes ], + [kde_cv_proto_$1="$1 unavailable"] +) +LIBS=$kde_safe_libs +AC_LANG_RESTORE +fi +]) +AC_MSG_RESULT($kde_cv_proto_$1) + +if test "x$kde_cv_func_$1" = xyes; then + AC_DEFINE(HAVE_$5, 1, [Define if you have $1]) + $6 +fi +if test "x$kde_cv_proto_$1" = xno; then + AC_DEFINE(HAVE_$5_PROTO, 1, + [Define if you have the $1 prototype]) +fi + +AH_VERBATIM([_HAVE_$5_PROTO], +[ +#if !defined(HAVE_$5_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +$4; +#ifdef __cplusplus +} +#endif +#endif +]) +]) + +AC_DEFUN([AC_CHECK_SETENV], +[ + KDE_CHECK_FUNC_EXT(setenv, [ +#include +], + [setenv("VAR", "VALUE", 1);], + [int setenv (const char *, const char *, int)], + [SETENV]) +]) + +AC_DEFUN([AC_CHECK_UNSETENV], +[ + KDE_CHECK_FUNC_EXT(unsetenv, [ +#include +], + [unsetenv("VAR");], + [void unsetenv (const char *)], + [UNSETENV]) +]) + +AC_DEFUN([AC_CHECK_GETDOMAINNAME], +[ + KDE_CHECK_FUNC_EXT(getdomainname, [ +#include +#include +#include +], + [ +char buffer[200]; +getdomainname(buffer, 200); +], + [#include + int getdomainname (char *, size_t)], + [GETDOMAINNAME]) +]) + +AC_DEFUN([AC_CHECK_GETHOSTNAME], +[ + KDE_CHECK_FUNC_EXT(gethostname, [ +#include +#include +], + [ +char buffer[200]; +gethostname(buffer, 200); +], + [int gethostname (char *, unsigned int)], + [GETHOSTNAME]) +]) + +AC_DEFUN([AC_CHECK_USLEEP], +[ + KDE_CHECK_FUNC_EXT(usleep, [ +#include +], + [ +usleep(200); +], + [int usleep (unsigned int)], + [USLEEP]) +]) + + +AC_DEFUN([AC_CHECK_RANDOM], +[ + KDE_CHECK_FUNC_EXT(random, [ +#include +], + [ +random(); +], + [long int random(void)], + [RANDOM]) + + KDE_CHECK_FUNC_EXT(srandom, [ +#include +], + [ +srandom(27); +], + [void srandom(unsigned int)], + [SRANDOM]) + +]) + +AC_DEFUN([AC_CHECK_INITGROUPS], +[ + KDE_CHECK_FUNC_EXT(initgroups, [ +#include +#include +#include +], + [ +char buffer[200]; +initgroups(buffer, 27); +], + [int initgroups(const char *, gid_t)], + [INITGROUPS]) +]) + +AC_DEFUN([AC_CHECK_MKSTEMPS], +[ + KDE_CHECK_FUNC_EXT(mkstemps, [ +#include +#include +], + [ +mkstemps("/tmp/aaaXXXXXX", 6); +], + [int mkstemps(char *, int)], + [MKSTEMPS]) +]) + +AC_DEFUN([AC_CHECK_MKDTEMP], +[ + KDE_CHECK_FUNC_EXT(mkdtemp, [ +#include +#include +], + [ +mkdtemp("/tmp/aaaXXXXXX"); +], + [char *mkdtemp(char *)], + [MKDTEMP]) +]) + + +AC_DEFUN([AC_CHECK_RES_INIT], +[ + AC_MSG_CHECKING([if res_init needs -lresolv]) + kde_libs_safe="$LIBS" + LIBS="$LIBS $X_EXTRA_LIBS -lresolv" + AC_TRY_LINK( + [ +#include +#include +#include +#include + ], + [ + res_init(); + ], + [ + LIBRESOLV="-lresolv" + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function]) + ], + [ AC_MSG_RESULT(no) ] + ) + LIBS=$kde_libs_safe + AC_SUBST(LIBRESOLV) + + AC_MSG_CHECKING([if res_init is available]) + AC_TRY_COMPILE( + [ +#include +#include +#include +#include + ], + [ + res_init(); + ], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function]) + ], + [ AC_MSG_RESULT(no) ] + ) +]) + +AC_DEFUN([AC_CHECK_STRLCPY], +[ + KDE_CHECK_FUNC_EXT(strlcpy, [ +#include +], +[ char buf[20]; + strlcpy(buf, "KDE function test", sizeof(buf)); +], + [unsigned long strlcpy(char*, const char*, unsigned long)], + [STRLCPY]) +]) + +AC_DEFUN([AC_CHECK_STRLCAT], +[ + KDE_CHECK_FUNC_EXT(strlcat, [ +#include +], +[ char buf[20]; + buf[0]='\0'; + strlcat(buf, "KDE function test", sizeof(buf)); +], + [unsigned long strlcat(char*, const char*, unsigned long)], + [STRLCAT]) +]) + +AC_DEFUN([AC_FIND_GIF], + [AC_MSG_CHECKING([for giflib]) +AC_CACHE_VAL(ac_cv_lib_gif, +[ac_save_LIBS="$LIBS" +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBS="$all_libraries -lgif -lX11 $LIBSOCKET" +else +LIBS="$all_libraries -lgif" +fi +AC_TRY_LINK(dnl +[ +#ifdef __cplusplus +extern "C" { +#endif +int GifLastError(void); +#ifdef __cplusplus +} +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +], + [return GifLastError();], + eval "ac_cv_lib_gif=yes", + eval "ac_cv_lib_gif=no") +LIBS="$ac_save_LIBS" +])dnl +if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif]) +else + AC_MSG_ERROR(You need giflib30. Please install the kdesupport package) +fi +]) + +AC_DEFUN([KDE_FIND_JPEG_HELPER], +[ +AC_MSG_CHECKING([for libjpeg$2]) +AC_CACHE_VAL(ac_cv_lib_jpeg_$1, +[ +ac_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm" +ac_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK( +[/* Override any gcc2 internal prototype to avoid an error. */ +struct jpeg_decompress_struct; +typedef struct jpeg_decompress_struct * j_decompress_ptr; +typedef int size_t; +#ifdef __cplusplus +extern "C" { +#endif + void jpeg_CreateDecompress(j_decompress_ptr cinfo, + int version, size_t structsize); +#ifdef __cplusplus +} +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +], + [jpeg_CreateDecompress(0L, 0, 0);], + eval "ac_cv_lib_jpeg_$1=-ljpeg$2", + eval "ac_cv_lib_jpeg_$1=no") +LIBS="$ac_save_LIBS" +CFLAGS="$ac_save_CFLAGS" +]) + +if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then + LIBJPEG="$ac_cv_lib_jpeg_$1" + AC_MSG_RESULT($ac_cv_lib_jpeg_$1) +else + AC_MSG_RESULT(no) + $3 +fi + +]) + +AC_DEFUN([AC_FIND_JPEG], +[ +dnl first look for libraries +KDE_FIND_JPEG_HELPER(6b, 6b, + KDE_FIND_JPEG_HELPER(normal, [], + [ + LIBJPEG= + ] + ) +) + +dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h +dnl requires system dependent includes loaded before it) +jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes" +AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir) +test "x$jpeg_incdir" = xNO && jpeg_incdir= + +dnl if headers _and_ libraries are missing, this is no error, and we +dnl continue with a warning (the user will get no jpeg support in khtml) +dnl if only one is missing, it means a configuration error, but we still +dnl only warn +if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then + AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg]) +else + if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then + AC_MSG_WARN([ +There is an installation error in jpeg support. You seem to have only one +of either the headers _or_ the libraries installed. You may need to either +provide correct --with-extra-... options, or the development package of +libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/ +Disabling JPEG support. +]) + else + AC_MSG_WARN([libjpeg not found. disable JPEG support.]) + fi + jpeg_incdir= + LIBJPEG= +fi + +AC_SUBST(LIBJPEG) +AH_VERBATIM(_AC_CHECK_JPEG, +[/* + * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system + * headers and I'm too lazy to write a configure test as long as only + * unixware is related + */ +#ifdef _UNIXWARE +#define HAVE_BOOLEAN +#endif +]) +]) + +AC_DEFUN([KDE_CHECK_QT_JPEG], +[ +if test -n "$LIBJPEG"; then +AC_MSG_CHECKING([if Qt needs $LIBJPEG]) +AC_CACHE_VAL(kde_cv_qt_jpeg, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ac_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS $LIBQT" +LIBS=`echo $LIBS | sed "s/$LIBJPEG//"` +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK( +[#include ], + [ + int argc; + char** argv; + QApplication app(argc, argv);], + eval "kde_cv_qt_jpeg=no", + eval "kde_cv_qt_jpeg=yes") +LIBS="$ac_save_LIBS" +CXXFLAGS="$ac_save_CXXFLAGS" +AC_LANG_RESTORE +fi +]) + +if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then + AC_MSG_RESULT(yes) + LIBJPEG_QT='$(LIBJPEG)' +else + AC_MSG_RESULT(no) + LIBJPEG_QT= +fi + +]) + +AC_DEFUN([AC_FIND_ZLIB], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_MSG_CHECKING([for libz]) +AC_CACHE_VAL(ac_cv_lib_z, +[ +kde_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET" +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK(dnl +[ +#include +], +[ + char buf[42]; + gzFile f = (gzFile) 0; + /* this would segfault.. but we only link, don't run */ + (void) gzgets(f, buf, sizeof(buf)); + + return (zlibVersion() == ZLIB_VERSION); +], + eval "ac_cv_lib_z='-lz'", + eval "ac_cv_lib_z=no") +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if test ! "$ac_cv_lib_z" = no; then + AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz]) + LIBZ="$ac_cv_lib_z" + AC_MSG_RESULT($ac_cv_lib_z) +else + AC_MSG_ERROR(not found. + Possibly configure picks up an outdated version + installed by XFree86. Remove it from your system. + + Check your installation and look into config.log) + LIBZ="" +fi +AC_SUBST(LIBZ) +]) + +AC_DEFUN([KDE_TRY_TIFFLIB], +[ +AC_MSG_CHECKING([for libtiff $1]) + +AC_CACHE_VAL(kde_cv_libtiff_$1, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +kde_save_LIBS="$LIBS" +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm" +else +LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm" +fi +kde_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl +[ +#include +], + [return (TIFFOpen( "", "r") == 0); ], +[ + kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ" +], [ + kde_cv_libtiff_$1=no +]) + +LIBS="$kde_save_LIBS" +CXXFLAGS="$kde_save_CXXFLAGS" +AC_LANG_RESTORE +]) + +if test "$kde_cv_libtiff_$1" = "no"; then + AC_MSG_RESULT(no) + LIBTIFF="" + $3 +else + LIBTIFF="$kde_cv_libtiff_$1" + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff]) + $2 +fi + +]) + +AC_DEFUN([AC_FIND_TIFF], +[ +AC_REQUIRE([K_PATH_X]) +AC_REQUIRE([AC_FIND_ZLIB]) +AC_REQUIRE([AC_FIND_JPEG]) +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + +KDE_TRY_TIFFLIB(tiff, [], + KDE_TRY_TIFFLIB(tiff34)) + +AC_SUBST(LIBTIFF) +]) + + +AC_DEFUN([AC_FIND_PNG], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_REQUIRE([AC_FIND_ZLIB]) +AC_MSG_CHECKING([for libpng]) +AC_CACHE_VAL(ac_cv_lib_png, +[ +kde_save_LIBS="$LIBS" +if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then +LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET" +else +LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm" +fi +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl + [ + #include + ], + [ + png_structp png_ptr = png_create_read_struct( /* image ptr */ + PNG_LIBPNG_VER_STRING, 0, 0, 0 ); + return( png_ptr != 0 ); + ], + eval "ac_cv_lib_png='-lpng $LIBZ -lm'", + eval "ac_cv_lib_png=no" +) +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng]) + LIBPNG="$ac_cv_lib_png" + AC_SUBST(LIBPNG) + AC_MSG_RESULT($ac_cv_lib_png) +else + AC_MSG_RESULT(no) + LIBPNG="" + AC_SUBST(LIBPNG) +fi +]) + + +AC_DEFUN([AC_FIND_JASPER], +[ +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_REQUIRE([AC_FIND_JPEG]) +AC_MSG_CHECKING([for jasper]) +AC_CACHE_VAL(ac_cv_jasper, +[ +kde_save_LIBS="$LIBS" +LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm" +kde_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $all_includes $USER_INCLUDES" + +AC_TRY_LINK(dnl + [ + #include + ], + [ + return( jas_init() ); + ], + eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'", + eval "ac_cv_jasper=no" +) +LIBS="$kde_save_LIBS" +CFLAGS="$kde_save_CFLAGS" +])dnl +if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then + AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper]) + LIB_JASPER="$ac_cv_jasper" + AC_MSG_RESULT($ac_cv_jasper) +else + AC_MSG_RESULT(no) + LIB_JASPER="" +fi +AC_SUBST(LIB_JASPER) +]) + +AC_DEFUN([AC_CHECK_BOOL], +[ + AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool]) +]) + +AC_DEFUN([AC_CHECK_GNU_EXTENSIONS], +[ +AC_MSG_CHECKING(if you need GNU extensions) +AC_CACHE_VAL(ac_cv_gnu_extensions, +[ +cat > conftest.c << EOF +#include + +#ifdef __GNU_LIBRARY__ +yes +#endif +EOF + +if (eval "$ac_cpp conftest.c") 2>&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_gnu_extensions=yes +else + ac_cv_gnu_extensions=no +fi +]) + +AC_MSG_RESULT($ac_cv_gnu_extensions) +if test "$ac_cv_gnu_extensions" = "yes"; then + AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions]) +fi +]) + +AC_DEFUN([KDE_CHECK_COMPILER_FLAG], +[ +AC_MSG_CHECKING([whether $CXX supports -$1]) +kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'` +AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache, +[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -$1" + AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], []) + CXXFLAGS="$save_CXXFLAGS" + AC_LANG_RESTORE +]) +if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then + AC_MSG_RESULT(yes) + : + $2 +else + AC_MSG_RESULT(no) + : + $3 +fi +]) + +dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables +dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) +dnl it's all white-space separated +AC_DEFUN([AC_REMOVE_FORBIDDEN], +[ __val=$$1 + __forbid=" $2 " + if test -n "$__val"; then + __new="" + ac_save_IFS=$IFS + IFS=" " + for i in $__val; do + case "$__forbid" in + *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; + *) # Careful to not add spaces, where there were none, because otherwise + # libtool gets confused, if we change e.g. CXX + if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; + esac + done + IFS=$ac_save_IFS + $1=$__new + fi +]) + +dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given +AC_DEFUN([AC_VALIDIFY_CXXFLAGS], +[dnl +if test "x$kde_use_qt_emb" != "xyes"; then + AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) + AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath]) +else + AC_REMOVE_FORBIDDEN(CXX, [-rpath]) + AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath]) +fi +]) + +AC_DEFUN([AC_CHECK_COMPILERS], +[ + AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]), + [ + case $enableval in + yes) + kde_use_debug_code="yes" + kde_use_debug_define=no + ;; + full) + kde_use_debug_code="full" + kde_use_debug_define=no + ;; + *) + kde_use_debug_code="no" + kde_use_debug_define=yes + ;; + esac + ], + [kde_use_debug_code="no" + kde_use_debug_define=no + ]) + + dnl Just for configure --help + AC_ARG_ENABLE(dummyoption, + AC_HELP_STRING([--disable-debug], + [disables debug output and debug symbols [default=no]]), + [],[]) + + AC_ARG_ENABLE(strict, + AC_HELP_STRING([--enable-strict], + [compiles with strict compiler options (may not work!)]), + [ + if test $enableval = "no"; then + kde_use_strict_options="no" + else + kde_use_strict_options="yes" + fi + ], [kde_use_strict_options="no"]) + + AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similiar]), + [ + if test $enableval = "no"; then + kde_use_warnings="no" + else + kde_use_warnings="yes" + fi + ], [kde_use_warnings="yes"]) + + dnl enable warnings for debug build + if test "$kde_use_debug_code" != "no"; then + kde_use_warnings=yes + fi + + AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]), + [kde_use_profiling=$enableval], + [kde_use_profiling="no"] + ) + + dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS + CFLAGS=" $CFLAGS" + + AC_PROG_CC + + AC_PROG_CPP + + if test "$GCC" = "yes"; then + if test "$kde_use_debug_code" != "no"; then + if test $kde_use_debug_code = "full"; then + CFLAGS="-g3 -fno-inline $CFLAGS" + else + CFLAGS="-g -O2 $CFLAGS" + fi + else + CFLAGS="-O2 $CFLAGS" + fi + fi + + if test "$kde_use_debug_define" = "yes"; then + CFLAGS="-DNDEBUG $CFLAGS" + fi + + + case "$host" in + *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";; + *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";; + esac + + if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then + LDFLAGS="" + fi + + CXXFLAGS=" $CXXFLAGS" + + AC_PROG_CXX + + if test "$GXX" = "yes" || test "$CXX" = "KCC"; then + if test "$kde_use_debug_code" != "no"; then + if test "$CXX" = "KCC"; then + CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS" + else + if test "$kde_use_debug_code" = "full"; then + CXXFLAGS="-g3 -fno-inline $CXXFLAGS" + else + CXXFLAGS="-g -O2 $CXXFLAGS" + fi + fi + KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"]) + + dnl convenience compiler flags + KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""]) + AC_SUBST(WOVERLOADED_VIRTUAL) + else + if test "$CXX" = "KCC"; then + CXXFLAGS="+K3 $CXXFLAGS" + else + CXXFLAGS="-O2 $CXXFLAGS" + fi + fi + fi + + if test "$kde_use_debug_define" = "yes"; then + CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS" + fi + + if test "$kde_use_profiling" = "yes"; then + KDE_CHECK_COMPILER_FLAG(pg, + [ + CFLAGS="-pg $CFLAGS" + CXXFLAGS="-pg $CXXFLAGS" + ]) + fi + + if test "$kde_use_warnings" = "yes"; then + if test "$GCC" = "yes"; then + case $host in + *-*-linux-gnu) + CFLAGS="-ansi -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS" + CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS" + KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"; CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"]) + ;; + esac + CXXFLAGS="-Wall -W -Wpointer-arith -Wwrite-strings $CXXFLAGS" + KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"]) + KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"]) + KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"]) + fi + fi + + if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then + CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS" + fi + + if test "$GXX" = "yes"; then + KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"]) + KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"]) + KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"]) + KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= ) + fi + if test "$CXX" = "KCC"; then + dnl unfortunately we currently cannot disable exception support in KCC + dnl because doing so is binary incompatible and Qt by default links with exceptions :-( + dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"]) + dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= ) + + AC_ARG_ENABLE(pch, + AC_HELP_STRING([--enable-pch], + [enables precompiled header support (currently only KCC) [default=no]]), + [ + kde_use_pch=$enableval + ],[kde_use_pch=no]) + + if test "$kde_use_pch" = "yes"; then + dnl TODO: support --pch-dir! + KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"]) + dnl the below works (but the dir must exist), but it's + dnl useless for a whole package. + dnl The are precompiled headers for each source file, so when compiling + dnl from scratch, it doesn't make a difference, and they take up + dnl around ~5Mb _per_ sourcefile. + dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp, + dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"]) + fi + dnl this flag controls inlining. by default KCC inlines in optimisation mode + dnl all implementations that are defined inside the class {} declaration. + dnl because of templates-compatibility with broken gcc compilers, this + dnl can cause excessive inlining. This flag limits it to a sane level + KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"]) + KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"]) + KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"]) + KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"]) + dnl Some source files are shared between multiple executables + dnl (or libraries) and some of those need template instantiations. + dnl In that case KCC needs to compile those sources with + dnl --one_instantiation_per_object. To make it easy for us we compile + dnl _all_ objects with that flag (--one_per is a shorthand). + KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"]) + fi + AC_SUBST(USE_EXCEPTIONS) + dnl obsolete macro - provided to keep things going + USE_RTTI= + AC_SUBST(USE_RTTI) + + case "$host" in + *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;; + *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";; + *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";; + *-*-solaris*) + if test "$GXX" = yes; then + libstdcpp=`$CXX -print-file-name=libstdc++.so` + if test ! -f $libstdcpp; then + AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so]) + fi + fi + ;; + esac + + AC_VALIDIFY_CXXFLAGS + + AC_PROG_CXXCPP + + if test "$GCC" = yes; then + NOOPT_CFLAGS=-O0 + fi + KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0]) + + AC_SUBST(NOOPT_CXXFLAGS) + AC_SUBST(NOOPT_CFLAGS) + + KDE_CHECK_FINAL + KDE_CHECK_CLOSURE + KDE_CHECK_NMCHECK + + ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), []) +]) + +AC_DEFUN([KDE_ADD_DEPENDENCIES], +[ + [A]M_DEPENDENCIES(CC) + [A]M_DEPENDENCIES(CXX) +]) + +dnl just a wrapper to clean up configure.in +AC_DEFUN([KDE_PROG_LIBTOOL], +[ +AC_REQUIRE([AC_CHECK_COMPILERS]) +AC_REQUIRE([AC_ENABLE_SHARED]) +AC_REQUIRE([AC_ENABLE_STATIC]) + +AC_REQUIRE([AC_LIBTOOL_DLOPEN]) +AC_REQUIRE([KDE_CHECK_LIB64]) + +AC_OBJEXT +AC_EXEEXT + +AM_PROG_LIBTOOL +AC_LIBTOOL_CXX + +LIBTOOL_SHELL="/bin/sh ./libtool" +# LIBTOOL="$LIBTOOL --silent" +KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)" +AC_SUBST(KDE_PLUGIN) + +# we patch configure quite some so we better keep that consistent for incremental runs +AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure') +]) + +AC_DEFUN([KDE_CHECK_LIB64], +[ + kdelibsuff=no + AC_ARG_ENABLE(libsuffix, + AC_HELP_STRING([--enable-libsuffix], + [/lib directory suffix (64,32,none[=default])]), + kdelibsuff=$enableval) + # TODO: add an auto case that compiles a little C app to check + # where the glibc is + if test "$kdelibsuff" = "no"; then + kdelibsuff= + fi + if test -z "$kdelibsuff"; then + AC_MSG_RESULT([not using lib directory suffix]) + AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories) + else + if test "$libdir" = '${exec_prefix}/lib'; then + libdir="$libdir${kdelibsuff}" + AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms + fi + AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${kdelibsuff}\""], Suffix for lib directories) + AC_MSG_RESULT([using lib directory suffix $kdelibsuff]) + fi +]) + +AC_DEFUN([KDE_CHECK_TYPES], +[ AC_CHECK_SIZEOF(int, 4)dnl + AC_CHECK_SIZEOF(short)dnl + AC_CHECK_SIZEOF(long, 4)dnl + AC_CHECK_SIZEOF(char *, 4)dnl +])dnl + +AC_DEFUN([KDE_DO_IT_ALL], +[ +AC_CANONICAL_SYSTEM +AC_ARG_PROGRAM +AM_INIT_AUTOMAKE($1, $2) +AM_DISABLE_LIBRARIES +AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde}) +AC_CHECK_COMPILERS +KDE_PROG_LIBTOOL +AM_KDE_WITH_NLS +AC_PATH_KDE +]) + +AC_DEFUN([AC_CHECK_RPATH], +[ +AC_MSG_CHECKING(for rpath) +AC_ARG_ENABLE(rpath, + AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]), + USE_RPATH=$enableval, USE_RPATH=yes) + +if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then + + KDE_RPATH="-R \$(kde_libraries)" + + if test -n "$qt_libraries"; then + KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)" + fi + dnl $x_libraries is set to /usr/lib in case + if test -n "$X_LDFLAGS"; then + X_RPATH="-R \$(x_libraries)" + KDE_RPATH="$KDE_RPATH $X_RPATH" + fi + if test -n "$KDE_EXTRA_RPATH"; then + KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)" + fi +fi +AC_SUBST(KDE_EXTRA_RPATH) +AC_SUBST(KDE_RPATH) +AC_SUBST(X_RPATH) +AC_MSG_RESULT($USE_RPATH) +]) + +dnl Check for the type of the third argument of getsockname +AC_DEFUN([AC_CHECK_SOCKLEN_T], [ + AC_MSG_CHECKING(for socklen_t) + AC_CACHE_VAL(ac_cv_socklen_t, [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ +#include +#include + ],[ +socklen_t a=0; +getsockname(0,(struct sockaddr*)0, &a); + ], + ac_cv_socklen_t=socklen_t, + AC_TRY_COMPILE([ +#include +#include + ],[ +int a=0; +getsockname(0,(struct sockaddr*)0, &a); + ], + ac_cv_socklen_t=int, + ac_cv_socklen_t=size_t + ) + ) + AC_LANG_RESTORE + ]) + + AC_MSG_RESULT($ac_cv_socklen_t) + if test "$ac_cv_socklen_t" != "socklen_t"; then + AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t, + [Define the real type of socklen_t]) + fi + AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define]) + +]) + +dnl This is a merge of some macros out of the gettext aclocal.m4 +dnl since we don't need anything, I took the things we need +dnl the copyright for them is: +dnl > +dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +dnl This Makefile.in is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. +dnl > +dnl for this file it is relicensed under LGPL + +AC_DEFUN([AM_KDE_WITH_NLS], + [ + dnl If we use NLS figure out what method + + AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt, + [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then + AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + MSGFMT=$GMSGFMT + AC_SUBST(GMSGFMT) + AC_SUBST(MSGFMT) + + AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext programs is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + AC_SUBST(XGETTEXT) + + ]) + +# Search path for a program which passes the given test. +# Ulrich Drepper , 1996. + +# serial 1 +# Stephan Kulow: I appended a _KDE against name conflicts + +dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + + +# Check whether LC_MESSAGES is available in . +# Ulrich Drepper , 1995. + +# serial 1 + +AC_DEFUN([AM_LC_MESSAGES], + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES]) + fi + fi]) + +dnl From Jim Meyering. +dnl FIXME: migrate into libit. + +AC_DEFUN([AM_FUNC_OBSTACK], +[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack, + [AC_TRY_LINK([#include "obstack.h"], + [struct obstack *mem;obstack_free(mem,(char *) 0)], + am_cv_func_obstack=yes, + am_cv_func_obstack=no)]) + if test $am_cv_func_obstack = yes; then + AC_DEFINE(HAVE_OBSTACK) + else + LIBOBJS="$LIBOBJS obstack.o" + fi +]) + +dnl From Jim Meyering. Use this if you use the GNU error.[ch]. +dnl FIXME: Migrate into libit + +AC_DEFUN([AM_FUNC_ERROR_AT_LINE], +[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line, + [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");], + am_cv_lib_error_at_line=yes, + am_cv_lib_error_at_line=no)]) + if test $am_cv_lib_error_at_line = no; then + LIBOBJS="$LIBOBJS error.o" + fi + AC_SUBST(LIBOBJS)dnl +]) + +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995. + +# serial 1 +# Stephan Kulow: I put a KDE in it to avoid name conflicts + +AC_DEFUN([AM_KDE_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([AM_KDE_WITH_NLS])dnl + AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h]) + AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \ +__argz_count __argz_stringify __argz_next]) + + AC_MSG_CHECKING(for stpcpy) + AC_CACHE_VAL(kde_cv_func_stpcpy, + [ + kde_safe_cxxflags=$CXXFLAGS + CXXFLAGS="-Werror" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ + #include + ], + [ + char buffer[200]; + stpcpy(buffer, buffer); + ], + kde_cv_func_stpcpy=yes, + kde_cv_func_stpcpy=no) + AC_LANG_RESTORE + CXXFLAGS=$kde_safe_cxxflags + ]) + AC_MSG_RESULT($kde_cv_func_stpcpy) + if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then + AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy]) + fi + + AM_LC_MESSAGES + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + ]) + +AC_DEFUN([AC_HAVE_XPM], + [AC_REQUIRE_CPP()dnl + AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + + test -z "$XPM_LDFLAGS" && XPM_LDFLAGS= + test -z "$XPM_INCLUDE" && XPM_INCLUDE= + + AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]), + xpm_test=$withval, xpm_test="yes") + if test "x$xpm_test" = xno; then + ac_cv_have_xpm=no + else + AC_MSG_CHECKING(for XPM) + AC_CACHE_VAL(ac_cv_have_xpm, + [ + ac_save_ldflags="$LDFLAGS" + ac_save_cflags="$CFLAGS" + if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then + LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET" + else + LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET" + fi + CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES" + test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS" + AC_TRY_LINK([#include ],[], + ac_cv_have_xpm="yes",ac_cv_have_xpm="no") + LDFLAGS="$ac_save_ldflags" + CFLAGS="$ac_save_cflags" + ])dnl + + if test "$ac_cv_have_xpm" = no; then + AC_MSG_RESULT(no) + XPM_LDFLAGS="" + XPMINC="" + $2 + else + AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support]) + if test "$XPM_LDFLAGS" = ""; then + XPMLIB='-lXpm $(LIB_X11)' + else + XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)' + fi + if test "$XPM_INCLUDE" = ""; then + XPMINC="" + else + XPMINC="-I$XPM_INCLUDE" + fi + AC_MSG_RESULT(yes) + $1 + fi + fi + AC_SUBST(XPMINC) + AC_SUBST(XPMLIB) +]) + +AC_DEFUN([AC_HAVE_DPMS], + [AC_REQUIRE_CPP()dnl + AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + + test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS= + test -z "$DPMS_INCLUDE" && DPMS_INCLUDE= + DPMS_LIB= + + AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]), + dpms_test=$withval, dpms_test="yes") + if test "x$dpms_test" = xno; then + ac_cv_have_dpms=no + else + AC_MSG_CHECKING(for DPMS) + dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms. + dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms". + AC_CACHE_VAL(ac_cv_have_dpms, + [ + if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then + AC_MSG_RESULT(no) + ac_cv_have_dpms="no" + else + ac_save_ldflags="$LDFLAGS" + ac_save_cflags="$CFLAGS" + ac_save_libs="$LIBS" + LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET" + CFLAGS="$CFLAGS $X_INCLUDES" + test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" + AC_TRY_LINK([ + #include + #include + #include + #include + int foo_test_dpms() + { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[], + ac_cv_have_dpms="yes", [ + LDFLAGS="$ac_save_ldflags" + CFLAGS="$ac_save_cflags" + LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET" + LIBS="$LIBS -lXdpms" + CFLAGS="$CFLAGS $X_INCLUDES" + test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" + AC_TRY_LINK([ + #include + #include + #include + #include + int foo_test_dpms() + { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[], + [ + ac_cv_have_dpms="-lXdpms" + ],ac_cv_have_dpms="no") + ]) + LDFLAGS="$ac_save_ldflags" + CFLAGS="$ac_save_cflags" + LIBS="$ac_save_libs" + fi + ])dnl + + if test "$ac_cv_have_dpms" = no; then + AC_MSG_RESULT(no) + DPMS_LDFLAGS="" + DPMSINC="" + $2 + else + AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support]) + if test "$ac_cv_have_dpms" = "-lXdpms"; then + DPMS_LIB="-lXdpms" + fi + if test "$DPMS_LDFLAGS" = ""; then + DPMSLIB="$DPMS_LIB "'$(LIB_X11)' + else + DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)' + fi + if test "$DPMS_INCLUDE" = ""; then + DPMSINC="" + else + DPMSINC="-I$DPMS_INCLUDE" + fi + AC_MSG_RESULT(yes) + $1 + fi + fi + ac_save_cflags="$CFLAGS" + CFLAGS="$CFLAGS $X_INCLUDES" + test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS" + AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO, + [Define if you have the DPMSCapable prototype in ]) + AC_CHECK_DECL(DPMSCapable, + AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),, + [#include ]) + AH_TEMPLATE(HAVE_DPMSINFO_PROTO, + [Define if you have the DPMSInfo prototype in ]) + AC_CHECK_DECL(DPMSInfo, + AC_DEFINE(HAVE_DPMSINFO_PROTO),, + [#include ]) + CFLAGS="$ac_save_cflags" + AC_SUBST(DPMSINC) + AC_SUBST(DPMSLIB) +]) + +AC_DEFUN([AC_HAVE_GL], + [AC_REQUIRE_CPP()dnl + AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) + + test -z "$GL_LDFLAGS" && GL_LDFLAGS= + test -z "$GL_INCLUDE" && GL_INCLUDE= + + AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]), + gl_test=$withval, gl_test="yes") + if test "x$kde_use_qt_emb" = "xyes"; then + # GL and Qt Embedded is a no-go for now. + ac_cv_have_gl=no + elif test "x$gl_test" = xno; then + ac_cv_have_gl=no + else + AC_MSG_CHECKING(for GL) + AC_CACHE_VAL(ac_cv_have_gl, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_ldflags="$LDFLAGS" + ac_save_cxxflags="$CXXFLAGS" + LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU" + test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11" + LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET" + CXXFLAGS="$CFLAGS $X_INCLUDES" + test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" + AC_TRY_LINK([#include +#include +], [], + ac_cv_have_gl="mesa", ac_cv_have_gl="no") + if test "x$ac_cv_have_gl" = "xno"; then + LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL" + test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11" + LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET" + CXXFLAGS="$ac_save_cflags $X_INCLUDES" + test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS" + AC_TRY_LINK([#include +#include +], [], + ac_cv_have_gl="yes", ac_cv_have_gl="no") + fi + AC_LANG_RESTORE + LDFLAGS="$ac_save_ldflags" + CXXFLAGS="$ac_save_cxxflags" + ])dnl + + if test "$ac_cv_have_gl" = "no"; then + AC_MSG_RESULT(no) + GL_LDFLAGS="" + GLINC="" + $2 + else + AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)]) + if test "$GL_LDFLAGS" = ""; then + if test "$ac_cv_have_gl" = "mesa"; then + GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)' + else + GLLIB='-lGLU -lGL $(LIB_X11)' + fi + else + if test "$ac_cv_have_gl" = "mesa"; then + GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)' + else + GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)' + fi + fi + if test "$GL_INCLUDE" = ""; then + GLINC="" + else + GLINC="-I$GL_INCLUDE" + fi + AC_MSG_RESULT($ac_cv_have_gl) + $1 + fi + fi + AC_SUBST(GLINC) + AC_SUBST(GLLIB) +]) + + + dnl shadow password and PAM magic - maintained by ossi@kde.org + +AC_DEFUN([KDE_PAM], [ + AC_REQUIRE([KDE_CHECK_LIBDL]) + + want_pam= + AC_ARG_WITH(pam, + AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]), + [ if test "x$withval" = "xyes"; then + want_pam=yes + pam_service=kde + elif test "x$withval" = "xno"; then + want_pam=no + else + want_pam=yes + pam_service=$withval + fi + ], [ pam_service=kde ]) + + use_pam= + PAMLIBS= + if test "x$want_pam" != xno; then + AC_CHECK_LIB(pam, pam_start, [ + AC_CHECK_HEADER(security/pam_appl.h, + [ pam_header=security/pam_appl.h ], + [ AC_CHECK_HEADER(pam/pam_appl.h, + [ pam_header=pam/pam_appl.h ], + [ + AC_MSG_WARN([PAM detected, but no headers found! +Make sure you have the necessary development packages installed.]) + ] + ) + ] + ) + ], , $LIBDL) + if test -z "$pam_header"; then + if test "x$want_pam" = xyes; then + AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!]) + fi + else + AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)]) + PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL" + use_pam=yes + + dnl darwin claims to be something special + if test "$pam_header" = "pam/pam_appl.h"; then + AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/]) + fi + + dnl test whether struct pam_message is const (Linux) or not (Sun) + AC_MSG_CHECKING(for const pam_message) + AC_EGREP_HEADER([struct pam_message], $pam_header, + [ AC_EGREP_HEADER([const struct pam_message], $pam_header, + [AC_MSG_RESULT([const: Linux-type PAM])], + [AC_MSG_RESULT([nonconst: Sun-type PAM]) + AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])] + )], + [AC_MSG_RESULT([not found - assume const, Linux-type PAM])]) + fi + fi + + AC_SUBST(PAMLIBS) +]) + +dnl DEF_PAM_SERVICE(arg name, full name, define name) +AC_DEFUN([DEF_PAM_SERVICE], [ + AC_ARG_WITH($1-pam, + AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]), + [ if test "x$use_pam" = xyes; then + $3_PAM_SERVICE=$withval + else + AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected. +You may want to enforce it by using --with-pam.]) + fi + ], + [ if test "x$use_pam" = xyes; then + $3_PAM_SERVICE="$pam_service" + fi + ]) + if test -n "$$3_PAM_SERVICE"; then + AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE]) + AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2]) + fi + AC_SUBST($3_PAM_SERVICE) +]) + +AC_DEFUN([KDE_SHADOWPASSWD], [ + AC_REQUIRE([KDE_PAM]) + + AC_CHECK_LIB(shadow, getspent, + [ LIBSHADOW="-lshadow" + ac_use_shadow=yes + ], + [ dnl for UnixWare + AC_CHECK_LIB(gen, getspent, + [ LIBGEN="-lgen" + ac_use_shadow=yes + ], + [ AC_CHECK_FUNC(getspent, + [ ac_use_shadow=yes ], + [ ac_use_shadow=no ]) + ]) + ]) + AC_SUBST(LIBSHADOW) + AC_SUBST(LIBGEN) + + AC_MSG_CHECKING([for shadow passwords]) + + AC_ARG_WITH(shadow, + AC_HELP_STRING([--with-shadow],[If you want shadow password support]), + [ if test "x$withval" != "xno"; then + use_shadow=yes + else + use_shadow=no + fi + ], [ + use_shadow="$ac_use_shadow" + ]) + + if test "x$use_shadow" = xyes; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords]) + else + AC_MSG_RESULT(no) + LIBSHADOW= + LIBGEN= + fi + + dnl finally make the relevant binaries setuid root, if we have shadow passwds. + dnl this still applies, if we could use it indirectly through pam. + if test "x$use_shadow" = xyes || + ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then + case $host in + *-*-freebsd* | *-*-netbsd* | *-*-openbsd*) + SETUIDFLAGS="-m 4755 -o root";; + *) + SETUIDFLAGS="-m 4755";; + esac + fi + AC_SUBST(SETUIDFLAGS) + +]) + +AC_DEFUN([KDE_PASSWDLIBS], [ + AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT + AC_REQUIRE([KDE_PAM]) + AC_REQUIRE([KDE_SHADOWPASSWD]) + + if test "x$use_pam" = "xyes"; then + PASSWDLIBS="$PAMLIBS" + else + PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN" + fi + + dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but + dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires + dnl root to read, so kcheckpass needs to be root (even when using pam, since pam + dnl may need to read /etc/master.passwd). + case $host in + *-*-freebsd*) + SETUIDFLAGS="-m 4755 -o root" + ;; + *) + ;; + esac + + AC_SUBST(PASSWDLIBS) +]) + +AC_DEFUN([KDE_CHECK_LIBDL], +[ +AC_CHECK_LIB(dl, dlopen, [ +LIBDL="-ldl" +ac_cv_have_dlfcn=yes +]) + +AC_CHECK_LIB(dld, shl_unload, [ +LIBDL="-ldld" +ac_cv_have_shload=yes +]) + +AC_SUBST(LIBDL) +]) + +AC_DEFUN([KDE_CHECK_DLOPEN], +[ +KDE_CHECK_LIBDL +AC_CHECK_HEADERS(dlfcn.h dl.h) +if test "$ac_cv_header_dlfcn_h" = "no"; then + ac_cv_have_dlfcn=no +fi + +if test "$ac_cv_header_dl_h" = "no"; then + ac_cv_have_shload=no +fi + +dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE +dnl (MM) +AC_ARG_ENABLE(dlopen, +AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]), +enable_dlopen=$enableval, +enable_dlopen=yes) + +# override the user's opinion, if we know it better ;) +if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then + enable_dlopen=no +fi + +if test "$ac_cv_have_dlfcn" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn]) +fi + +if test "$ac_cv_have_shload" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload]) +fi + +if test "$enable_dlopen" = no ; then + test -n "$1" && eval $1 +else + test -n "$2" && eval $2 +fi + +]) + +AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING], +[ +KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no) +KDE_PROG_LIBTOOL +AC_MSG_CHECKING([dynamic loading]) +eval "`egrep '^build_libtool_libs=' libtool`" +if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then + dynamic_loading=yes + AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING) +else + dynamic_loading=no +fi +AC_MSG_RESULT($dynamic_loading) +if test "$dynamic_loading" = "yes"; then + $1 +else + $2 +fi +]) + +AC_DEFUN([KDE_ADD_INCLUDES], +[ +if test -z "$1"; then + test_include="Pix.h" +else + test_include="$1" +fi + +AC_MSG_CHECKING([for libg++ ($test_include)]) + +AC_CACHE_VAL(kde_cv_libgpp_includes, +[ +kde_cv_libgpp_includes=no + + for ac_dir in \ + \ + /usr/include/g++ \ + /usr/include \ + /usr/unsupported/include \ + /opt/include \ + $extra_include \ + ; \ + do + if test -r "$ac_dir/$test_include"; then + kde_cv_libgpp_includes=$ac_dir + break + fi + done +]) + +AC_MSG_RESULT($kde_cv_libgpp_includes) +if test "$kde_cv_libgpp_includes" != "no"; then + all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES" +fi +]) +]) + +AC_DEFUN([KDE_CHECK_LIBPTHREAD], +[ + LIBPTHREAD="" + + if test -n "$PTHREAD_LIBS"; then + PTHREAD_LIBS_save="$PTHREAD_LIBS" + PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'` + KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [LIBPTHREAD="$PTHREAD_LIBS_save"] ) + PTHREAD_LIBS="$PTHREAD_LIBS_save" + fi + + if test -z "$LIBPTHREAD"; then + AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] ) + fi + + AC_SUBST(LIBPTHREAD) +]) + +AC_DEFUN([KDE_CHECK_PTHREAD_OPTION], +[ + USE_THREADS="" + if test -z "$LIBPTHREAD"; then + KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"]) + fi + + AH_VERBATIM(__svr_define, [ +#if defined(__SVR4) && !defined(__svr4__) +#define __svr4__ 1 +#endif +]) + case $host_os in + solaris*) + KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"]) + CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4" + ;; + freebsd*) + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS" + ;; + aix*) + CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" + LIBPTHREAD="$LIBPTHREAD -lc_r" + ;; + linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" + if test "$CXX" = "KCC"; then + CXXFLAGS="$CXXFLAGS --thread_safe" + NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe" + fi + ;; + *) + ;; + esac + AC_SUBST(USE_THREADS) + AC_SUBST(LIBPTHREAD) +]) + +AC_DEFUN([KDE_CHECK_THREADING], +[ + AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) + AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION]) + dnl default is yes if libpthread is found and no if no libpthread is available + if test -z "$LIBPTHREAD"; then + if test -z "$USE_THREADS"; then + kde_check_threading_default=no + else + kde_check_threading_default=yes + fi + else + kde_check_threading_default=yes + fi + AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]), + kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default) + if test "x$kde_use_threading" = "xyes"; then + AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)]) + fi +]) + +AC_DEFUN([KDE_TRY_LINK_PYTHON], +[ +if test "$kde_python_link_found" = no; then + +if test "$1" = normal; then + AC_MSG_CHECKING(if a Python application links) +else + AC_MSG_CHECKING(if Python depends on $2) +fi + +AC_CACHE_VAL(kde_cv_try_link_python_$1, +[ +kde_save_cflags="$CFLAGS" +CFLAGS="$CFLAGS $PYTHONINC" +kde_save_libs="$LIBS" +LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET" +kde_save_ldflags="$LDFLAGS" +LDFLAGS="$LDFLAGS $PYTHONLIB" + +AC_TRY_LINK( +[ +#include +],[ + PySys_SetArgv(1, 0); +], + [kde_cv_try_link_python_$1=yes], + [kde_cv_try_link_python_$1=no] +) +CFLAGS="$kde_save_cflags" +LIBS="$kde_save_libs" +LDFLAGS="$kde_save_ldflags" +]) + +if test "$kde_cv_try_link_python_$1" = "yes"; then + AC_MSG_RESULT(yes) + kde_python_link_found=yes + if test ! "$1" = normal; then + LIBPYTHON="$LIBPYTHON $2" + fi + $3 +else + AC_MSG_RESULT(no) + $4 +fi + +fi + +]) + +AC_DEFUN([KDE_CHECK_PYTHON_DIR], +[ +AC_MSG_CHECKING([for Python directory]) + +AC_CACHE_VAL(kde_cv_pythondir, +[ + if test -z "$PYTHONDIR"; then + kde_cv_pythondir=/usr/local + else + kde_cv_pythondir="$PYTHONDIR" + fi +]) + +AC_ARG_WITH(pythondir, +AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]), +[ + ac_python_dir=$withval +], ac_python_dir=$kde_cv_pythondir +) + +AC_MSG_RESULT($ac_python_dir) +]) + +AC_DEFUN([KDE_CHECK_PYTHON_INTERN], +[ +AC_REQUIRE([KDE_CHECK_LIBDL]) +AC_REQUIRE([KDE_CHECK_LIBPTHREAD]) +AC_REQUIRE([KDE_CHECK_PYTHON_DIR]) + +if test -z "$1"; then + version="1.5" +else + version="$1" +fi + +AC_MSG_CHECKING([for Python$version]) + +python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes" +AC_FIND_FILE(Python.h, $python_incdirs, python_incdir) +if test ! -r $python_incdir/Python.h; then + AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir) + python_incdir=$python_incdir/python$version + if test ! -r $python_incdir/Python.h; then + python_incdir=no + fi +fi + +PYTHONINC=-I$python_incdir + +python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs" +AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir) +if test ! -r $python_libdir/libpython$version.so; then + AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir) + if test ! -r $python_libdir/libpython$version.a; then + AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir) + python_libdir=$python_libdir/python$version/config + if test ! -r $python_libdir/libpython$version.a; then + python_libdir=no + fi + fi +fi + +PYTHONLIB=-L$python_libdir +kde_orig_LIBPYTHON=$LIBPYTHON +if test -z "$LIBPYTHON"; then + LIBPYTHON=-lpython$version +fi + +AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir) +python_moddir=$python_moddir/python$version +if test ! -r $python_moddir/copy.py; then + python_moddir=no +fi + +PYTHONMODDIR=$python_moddir + +AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir) + +if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then + LIBPYTHON=$kde_orig_LIBPYTHON + test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB="" + test "x$PYTHONINC" = "x-Ino" && PYTHONINC="" + $2 +else + dnl Note: this test is very weak + kde_python_link_found=no + KDE_TRY_LINK_PYTHON(normal) + KDE_TRY_LINK_PYTHON(m, -lm) + KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD) + KDE_TRY_LINK_PYTHON(tcl, -ltcl) + KDE_TRY_LINK_PYTHON(db2, -ldb2) + KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil]) + KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil]) + KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm]) + KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses]) + KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [], + [AC_MSG_WARN([it seems, Python depends on another library. + Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this + and contact the authors to let them know about this problem]) + ]) + + LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET" + AC_SUBST(PYTHONINC) + AC_SUBST(PYTHONLIB) + AC_SUBST(LIBPYTHON) + AC_SUBST(PYTHONMODDIR) + AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python]) +fi + +]) + + +AC_DEFUN([KDE_CHECK_PYTHON], +[ + KDE_CHECK_PYTHON_INTERN("2.3", + [KDE_CHECK_PYTHON_INTERN("2.2", + [KDE_CHECK_PYTHON_INTERN("2.1", + [KDE_CHECK_PYTHON_INTERN("2.0", + [KDE_CHECK_PYTHON_INTERN($1, $2) ]) + ]) + ]) + ]) +]) + +AC_DEFUN([KDE_CHECK_STL], +[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`" + + AC_MSG_CHECKING([if C++ programs can be compiled]) + AC_CACHE_VAL(kde_cv_stl_works, + [ + AC_TRY_COMPILE([ +#include +using namespace std; +],[ + string astring="Hallo Welt."; + astring.erase(0, 6); // now astring is "Welt" + return 0; +], kde_cv_stl_works=yes, + kde_cv_stl_works=no) +]) + + AC_MSG_RESULT($kde_cv_stl_works) + + if test "$kde_cv_stl_works" = "yes"; then + # back compatible + AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI]) + else + AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs. +Check config.log for details - if you're using a Linux distribution you might miss +a package named similiar to libstd++-dev.]) + fi + + CXXFLAGS="$ac_save_CXXFLAGS" + AC_LANG_RESTORE +]) + +AC_DEFUN([AC_FIND_QIMGIO], + [AC_REQUIRE([AC_FIND_JPEG]) +AC_REQUIRE([KDE_CHECK_EXTRA_LIBS]) +AC_MSG_CHECKING([for qimgio]) +AC_CACHE_VAL(ac_cv_lib_qimgio, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +ac_save_LIBS="$LIBS" +ac_save_CXXFLAGS="$CXXFLAGS" +LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT" +CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" +AC_TRY_RUN(dnl +[ +#include +#include +int main() { + QString t = "hallo"; + t.fill('t'); + qInitImageIO(); +} +], + ac_cv_lib_qimgio=yes, + ac_cv_lib_qimgio=no, + ac_cv_lib_qimgio=no) +LIBS="$ac_save_LIBS" +CXXFLAGS="$ac_save_CXXFLAGS" +AC_LANG_RESTORE +])dnl +if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then + LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG" + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available]) + AC_SUBST(LIBQIMGIO) +else + AC_MSG_RESULT(not found) +fi +]) + +AC_DEFUN([AM_DISABLE_LIBRARIES], +[ + AC_PROVIDE([AM_ENABLE_STATIC]) + AC_PROVIDE([AM_ENABLE_SHARED]) + enable_static=no + enable_shared=yes +]) + + +AC_DEFUN([AC_CHECK_UTMP_FILE], +[ + AC_MSG_CHECKING([for utmp file]) + + AC_CACHE_VAL(kde_cv_utmp_file, + [ + kde_cv_utmp_file=no + + for ac_file in \ + \ + /var/run/utmp \ + /var/adm/utmp \ + /etc/utmp \ + ; \ + do + if test -r "$ac_file"; then + kde_cv_utmp_file=$ac_file + break + fi + done + ]) + + if test "$kde_cv_utmp_file" != "no"; then + AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries]) + $1 + AC_MSG_RESULT($kde_cv_utmp_file) + else + $2 + AC_MSG_RESULT([non found]) + fi +]) + + +AC_DEFUN([KDE_CREATE_SUBDIRSLIST], +[ + +DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin" + +if test ! -s $srcdir/subdirs; then + dnl Note: Makefile.common creates subdirs, so this is just a fallback + TOPSUBDIRS="" + files=`cd $srcdir && ls -1` + dirs=`for i in $files; do if test -d $i; then echo $i; fi; done` + for i in $dirs; do + echo $i >> $srcdir/subdirs + done +fi + +ac_topsubdirs= +if test -s $srcdir/inst-apps; then + ac_topsubdirs="`cat $srcdir/inst-apps`" +elif test -s $srcdir/subdirs; then + ac_topsubdirs="`cat $srcdir/subdirs`" +fi + +for i in $ac_topsubdirs; do + AC_MSG_CHECKING([if $i should be compiled]) + if test -d $srcdir/$i; then + install_it="yes" + for j in $DO_NOT_COMPILE; do + if test $i = $j; then + install_it="no" + fi + done + else + install_it="no" + fi + AC_MSG_RESULT($install_it) + vari=`echo $i | sed -e 's,[[-+.]],_,g'` + if test $install_it = "yes"; then + TOPSUBDIRS="$TOPSUBDIRS $i" + eval "$vari""_SUBDIR_included=yes" + else + eval "$vari""_SUBDIR_included=no" + fi +done + +AC_SUBST(TOPSUBDIRS) +]) + +AC_DEFUN([KDE_CHECK_NAMESPACES], +[ +AC_MSG_CHECKING(whether C++ compiler supports namespaces) +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE([ +], +[ +namespace Foo { + extern int i; + namespace Bar { + extern int i; + } +} + +int Foo::i = 0; +int Foo::Bar::i = 1; +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_NAMESPACES) +], [ +AC_MSG_RESULT(no) +]) +AC_LANG_RESTORE +]) + +dnl ------------------------------------------------------------------------ +dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_CHECK_S_ISSOCK], +[ +AC_MSG_CHECKING(for S_ISSOCK) +AC_CACHE_VAL(ac_cv_have_s_issock, +[ +AC_TRY_LINK( +[ +#include +], +[ +struct stat buff; +int b = S_ISSOCK( buff.st_mode ); +], +ac_cv_have_s_issock=yes, +ac_cv_have_s_issock=no) +]) +AC_MSG_RESULT($ac_cv_have_s_issock) +if test "$ac_cv_have_s_issock" = "yes"; then + AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.]) +fi + +AH_VERBATIM(_ISSOCK, +[ +#ifndef HAVE_S_ISSOCK +#define HAVE_S_ISSOCK +#define S_ISSOCK(mode) (1==0) +#endif +]) + +]) + +dnl ------------------------------------------------------------------------ +dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([AC_CHECK_KDEMAXPATHLEN], +[ +AC_MSG_CHECKING(for MAXPATHLEN) +AC_CACHE_VAL(ac_cv_maxpathlen, +[ +cat > conftest.$ac_ext < +#endif +#include +#include +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif + +KDE_HELLO MAXPATHLEN + +EOF + +ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out" + +if AC_TRY_EVAL(ac_try) && test -s conftest.out; then + ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out` +else + ac_cv_maxpathlen=1024 +fi + +rm conftest.* + +]) +AC_MSG_RESULT($ac_cv_maxpathlen) +AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] ) +]) + +AC_DEFUN([KDE_CHECK_HEADER], +[ + AC_LANG_SAVE + kde_safe_cppflags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $all_includes" + AC_LANG_CPLUSPLUS + AC_CHECK_HEADER([$1], [$2], [$3], [$4]) + CPPFLAGS=$kde_safe_cppflags + AC_LANG_RESTORE +]) + +AC_DEFUN([KDE_CHECK_HEADERS], +[ + AH_CHECK_HEADERS([$1]) + AC_LANG_SAVE + kde_safe_cppflags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $all_includes" + AC_LANG_CPLUSPLUS + AC_CHECK_HEADERS([$1], [$2], [$3], [$4]) + CPPFLAGS=$kde_safe_cppflags + AC_LANG_RESTORE +]) + +AC_DEFUN([KDE_FAST_CONFIGURE], +[ + dnl makes configure fast (needs perl) + AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]), + with_fast_perl=$enableval, with_fast_perl=yes) +]) + +AC_DEFUN([KDE_CONF_FILES], +[ + val= + if test -f $srcdir/configure.files ; then + val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files` + fi + CONF_FILES= + if test -n "$val" ; then + for i in $val ; do + CONF_FILES="$CONF_FILES $i" + done + fi + AC_SUBST(CONF_FILES) +])dnl + +AC_DEFUN([KDE_SET_PREFIX], +[ + unset CDPATH + dnl make $KDEDIR the default for the installation + AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde}) + + if test "x$prefix" = "xNONE"; then + prefix=$ac_default_prefix + ac_configure_args="$ac_configure_args --prefix=$prefix" + fi + # And delete superfluous '/' to make compares easier + prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'` + KDE_FAST_CONFIGURE + KDE_CONF_FILES +]) + +pushdef([AC_PROG_INSTALL], +[ + dnl our own version, testing for a -p flag + popdef([AC_PROG_INSTALL]) + dnl as AC_PROG_INSTALL works as it works we first have + dnl to save if the user didn't specify INSTALL, as the + dnl autoconf one overwrites INSTALL and we have no chance to find + dnl out afterwards + test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL + test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM + test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT + AC_PROG_INSTALL + + if test -z "$kde_save_INSTALL_given" ; then + # OK, user hasn't given any INSTALL, autoconf found one for us + # now we test, if it supports the -p flag + AC_MSG_CHECKING(for -p flag to install) + rm -f confinst.$$.* > /dev/null 2>&1 + echo "Testtest" > confinst.$$.orig + ac_res=no + if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then + if test -f confinst.$$.new ; then + # OK, -p seems to do no harm to install + INSTALL="${INSTALL} -p" + ac_res=yes + fi + fi + rm -f confinst.$$.* + AC_MSG_RESULT($ac_res) + fi + dnl the following tries to resolve some signs and wonders coming up + dnl with different autoconf/automake versions + dnl e.g.: + dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s + dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS) + dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s + dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has + dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the + dnl install-@DIR@PROGRAMS targets to explicitly use that flag + dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as + dnl INSTALL_SCRIPT, which breaks with automake <= 1.4 + dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure + dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from + dnl automake (due to broken Makefile.am or whatever) to install programs, + dnl and so does not see the -s flag in automake > 1.4 + dnl to clean up that mess we: + dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG + dnl which cleans KDE's program with automake > 1.4; + dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems + dnl with automake<=1.4 + dnl note that dues to this sometimes two '-s' flags are used (if KDE + dnl properly uses install-@DIR@PROGRAMS, but I don't care + dnl + dnl And to all this comes, that I even can't write in comments variable + dnl names used by automake, because it is so stupid to think I wanted to + dnl _use_ them, therefor I have written A_M_... instead of AM_ + dnl hmm, I wanted to say something ... ahh yes: Arghhh. + + if test -z "$kde_save_INSTALL_PROGRAM_given" ; then + INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)' + fi + if test -z "$kde_save_INSTALL_SCRIPT_given" ; then + INSTALL_SCRIPT='${INSTALL}' + fi +])dnl + +AC_DEFUN([KDE_LANG_CPLUSPLUS], +[AC_LANG_CPLUSPLUS +ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' +pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS]) +]) + +pushdef([AC_LANG_CPLUSPLUS], +[popdef([AC_LANG_CPLUSPLUS]) +KDE_LANG_CPLUSPLUS +]) + +AC_DEFUN([KDE_CHECK_LONG_LONG], +[ +AC_MSG_CHECKING(for long long) +AC_CACHE_VAL(kde_cv_c_long_long, +[ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_LINK([], [ + long long foo = 0; + foo = foo+1; + ], + kde_cv_c_long_long=yes, kde_cv_c_long_long=no) + AC_LANG_RESTORE +]) +AC_MSG_RESULT($kde_cv_c_long_long) +if test "$kde_cv_c_long_long" = yes; then + AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype]) +fi +]) + +AC_DEFUN([KDE_CHECK_LIB], +[ + kde_save_LDFLAGS="$LDFLAGS" + dnl AC_CHECK_LIB modifies LIBS, so save it here + kde_save_LIBS="$LIBS" + LDFLAGS="$LDFLAGS $all_libraries" + case $host_os in + aix*) LDFLAGS="-brtl $LDFLAGS" + test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS" + ;; + esac + AC_CHECK_LIB($1, $2, $3, $4, $5) + LDFLAGS="$kde_save_LDFLAGS" + LIBS="$kde_save_LIBS" +]) + +AC_DEFUN([KDE_JAVA_PREFIX], +[ + dir=`dirname "$1"` + base=`basename "$1"` + list=`ls -1 $dir 2> /dev/null` + for entry in $list; do + if test -d $dir/$entry/bin; then + case $entry in + $base) + javadirs="$javadirs $dir/$entry/bin" + ;; + esac + elif test -d $dir/$entry/jre/bin; then + case $entry in + $base) + javadirs="$javadirs $dir/$entry/jre/bin" + ;; + esac + fi + done +]) + +dnl KDE_CHEC_JAVA_DIR(onlyjre) +AC_DEFUN([KDE_CHECK_JAVA_DIR], +[ + +AC_ARG_WITH(java, +AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]), +[ ac_java_dir=$withval +], ac_java_dir="" +) + +AC_MSG_CHECKING([for Java]) + +dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH +if test "x$ac_java_dir" = "xno"; then + kde_java_bindir=no + kde_java_includedir=no + kde_java_libjvmdir=no + kde_java_libgcjdir=no + kde_java_libhpidir=no +else + if test "x$ac_java_dir" = "x"; then + + + dnl No option set -> collect list of candidate paths + if test -n "$JAVA_HOME"; then + KDE_JAVA_PREFIX($JAVA_HOME) + fi + KDE_JAVA_PREFIX(/usr/j2se) + KDE_JAVA_PREFIX(/usr/lib/j2se) + KDE_JAVA_PREFIX(/usr/j*dk*) + KDE_JAVA_PREFIX(/usr/lib/j*dk*) + KDE_JAVA_PREFIX(/opt/j*sdk*) + KDE_JAVA_PREFIX(/usr/lib/java*) + KDE_JAVA_PREFIX(/usr/java*) + KDE_JAVA_PREFIX(/usr/java/j*dk*) + KDE_JAVA_PREFIX(/usr/java/j*re*) + KDE_JAVA_PREFIX(/usr/lib/SunJava2*) + KDE_JAVA_PREFIX(/usr/lib/SunJava*) + KDE_JAVA_PREFIX(/usr/lib/IBMJava2*) + KDE_JAVA_PREFIX(/usr/lib/IBMJava*) + KDE_JAVA_PREFIX(/opt/java*) + + kde_cv_path="NONE" + kde_save_IFS=$IFS + IFS=':' + for dir in $PATH; do + if test -d "$dir"; then + javadirs="$javadirs $dir" + fi + done + IFS=$kde_save_IFS + jredirs= + + dnl Now javadirs contains a list of paths that exist, all ending with bin/ + for dir in $javadirs; do + dnl Check for the java executable + if test -x "$dir/java"; then + dnl And also check for a libjvm.so somewhere under there + dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big. + if test "$dir" != "/usr/bin"; then + libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` + if test ! -f $libjvmdir/libjvm.so; then continue; fi + jredirs="$jredirs $dir" + fi + fi + done + + dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found + JAVAC= + JAVA= + kde_java_bindir=no + for dir in $jredirs; do + JAVA="$dir/java" + kde_java_bindir=$dir + if test -x "$dir/javac"; then + JAVAC="$dir/javac" + break + fi + done + + if test -n "$JAVAC"; then + dnl this substitution might not work - well, we test for jni.h below + kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'` + else + kde_java_includedir=no + fi + else + dnl config option set + kde_java_bindir=$ac_java_dir/bin + if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then + kde_java_includedir=no + else + kde_java_includedir=$ac_java_dir/include + fi + fi +fi + +dnl At this point kde_java_bindir and kde_java_includedir are either set or "no" +if test "x$kde_java_bindir" != "xno"; then + + dnl Look for libjvm.so + kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1` + dnl Look for libgcj.so + kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1` + dnl Look for libhpi.so and avoid green threads + kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1` + + dnl Now check everything's fine under there + dnl the include dir is our flag for having the JDK + if test -d "$kde_java_includedir"; then + if test ! -x "$kde_java_bindir/javac"; then + AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.]) + fi + if test ! -x "$kde_java_bindir/javah"; then + AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) + fi + if test ! -x "$kde_java_bindir/jar"; then + AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) + fi + if test ! -r "$kde_java_includedir/jni.h"; then + AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.]) + fi + + jni_includes="-I$kde_java_includedir" + dnl Strange thing, jni.h requires jni_md.h which is under genunix here.. + dnl and under linux here.. + + dnl not needed for gcj + + if test "x$kde_java_libgcjdir" = "x"; then + test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux" + test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris" + test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix" + fi + + else + JAVAC= + jni_includes= + fi + + if test "x$kde_java_libgcjdir" = "x"; then + if test ! -r "$kde_java_libjvmdir/libjvm.so"; then + AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.]) + fi + else + if test ! -r "$kde_java_libgcjdir/libgcj.so"; then + AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.]) + fi + fi + + if test ! -x "$kde_java_bindir/java"; then + AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.]) + fi + + dnl not needed for gcj compile + + if test "x$kde_java_libgcjdir" = "x"; then + if test ! -r "$kde_java_libhpidir/libhpi.so"; then + AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.]) + fi + fi + + if test -n "$jni_includes"; then + dnl Check for JNI version + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + ac_cxxflags_safe="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $all_includes $jni_includes" + + AC_TRY_COMPILE([ + #include + ], + [ + #ifndef JNI_VERSION_1_2 + Syntax Error + #endif + ],[ kde_jni_works=yes ], + [ kde_jni_works=no ]) + + if test $kde_jni_works = no; then + AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h. + You need to have Java Development Kit (JDK) version 1.2. + + Use --with-java to specify another location. + Use --without-java to configure without java support. + Or download a newer JDK and try again. + See e.g. http://java.sun.com/products/jdk/1.2 ]) + fi + + CXXFLAGS="$ac_cxxflags_safe" + AC_LANG_RESTORE + + dnl All tests ok, inform and subst the variables + + JAVAC=$kde_java_bindir/javac + JAVAH=$kde_java_bindir/javah + JAR=$kde_java_bindir/jar + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + if test "x$kde_java_libgcjdir" = "x"; then + JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi" + else + JVMLIBS="-L$kde_java_libgcjdir -lgcj" + fi + AC_MSG_RESULT([java JDK in $kde_java_bindir]) + + else + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + AC_MSG_RESULT([java JRE in $kde_java_bindir]) + fi +elif test -d "/Library/Java/Home"; then + kde_java_bindir="/Library/Java/Home/bin" + jni_includes="-I/Library/Java/Home/include" + + JAVAC=$kde_java_bindir/javac + JAVAH=$kde_java_bindir/javah + JAR=$kde_java_bindir/jar + JVMLIBS="-Xlinker -framework -Xlinker JavaVM" + + AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is]) + AC_MSG_RESULT([Apple Java Framework]) +else + AC_MSG_RESULT([none found]) +fi + +AC_SUBST(JAVAC) +AC_SUBST(JAVAH) +AC_SUBST(JAR) +AC_SUBST(JVMLIBS) +AC_SUBST(jni_includes) + +# for backward compat +kde_cv_java_includedir=$kde_java_includedir +kde_cv_java_bindir=$kde_java_bindir +]) + +dnl this is a redefinition of autoconf 2.5x's AC_FOREACH. +dnl When the argument list becomes big, as in KDE for AC_OUTPUT in +dnl big packages, m4_foreach is dog-slow. So use our own version of +dnl it. (matz@kde.org) +m4_define([mm_foreach], +[m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])]) +m4_define([mm_car], [[$1]]) +m4_define([mm_car2], [[$@]]) +m4_define([_mm_foreach], +[m4_if(m4_quote($2), [], [], + [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1], + mm_car2(m4_shift($2)), + [$3])])]) +m4_define([AC_FOREACH], +[mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])]) + +AC_DEFUN([KDE_NEED_FLEX], +[ +kde_libs_safe=$LIBS +LIBS="$LIBS $USER_LDFLAGS" +AM_PROG_LEX +LIBS=$kde_libs_safe +if test -z "$LEXLIB"; then + AC_MSG_ERROR([You need to have flex installed.]) +fi +AC_SUBST(LEXLIB) +]) + +AC_DEFUN([AC_PATH_QTOPIA], +[ + dnl TODO: use AC_CACHE_VAL + + if test -z "$1"; then + qtopia_minver_maj=1 + qtopia_minver_min=5 + qtopia_minver_pat=0 + else + qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"` + qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"` + qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"` + fi + + qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat" + qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat" + + AC_REQUIRE([AC_PATH_QT]) + + AC_MSG_CHECKING([for Qtopia]) + + LIB_QTOPIA="-lqpe" + AC_SUBST(LIB_QTOPIA) + + kde_qtopia_dirs="$QPEDIR /opt/Qtopia" + + ac_qtopia_incdir=NO + + AC_ARG_WITH(qtopia-dir, + AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]), + [ ac_qtopia_incdir="$withval"/include] ) + + qtopia_incdirs="" + for dir in $kde_qtopia_dirs; do + qtopia_incdirs="$qtopia_incdirs $dir/include" + done + + if test ! "$ac_qtopia_incdir" = "NO"; then + qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs" + fi + + qtopia_incdir="" + AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir) + ac_qtopia_incdir="$qtopia_incdir" + + if test -z "$qtopia_incdir"; then + AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.]) + fi + + qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`; + qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`; + qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`; + + qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat" + qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat" + if test "$qtopia_ver" -lt "$qtopia_minver"; then + AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr +is required.]) + fi + + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + ac_cxxflags_safe="$CXXFLAGS" + ac_ldflags_safe="$LDFLAGS" + ac_libs_safe="$LIBS" + + CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes" + LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS" + LIBS="$LIBS $LIB_QTOPIA $LIBQT" + + cat > conftest.$ac_ext < +#include + +int main( int argc, char **argv ) +{ + QPEApplication app( argc, argv ); + return 0; +} +EOF + + if AC_TRY_EVAL(ac_link) && test -s conftest; then + rm -f conftest* + else + rm -f conftest* + AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at +the end of config.log]) + fi + + CXXFLAGS="$ac_cxxflags_safe" + LDFLAGS="$ac_ldflags_safe" + LIBS="$ac_libs_safe" + + AC_LANG_RESTORE + + QTOPIA_INCLUDES="-I$qtopia_incdir" + AC_SUBST(QTOPIA_INCLUDES) + + AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir]) +]) + + +AC_DEFUN([KDE_INIT_DOXYGEN], +[ +AC_MSG_CHECKING([for Qt docs]) +kde_qtdir= +if test "${with_qt_dir+set}" = set; then + kde_qtdir="$with_qt_dir" +fi + +AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR) +AC_MSG_RESULT($QTDOCDIR) + +AC_SUBST(QTDOCDIR) + +KDE_FIND_PATH(dot, DOT, [], []) +if test -n "$DOT"; then + KDE_HAVE_DOT="YES" +else + KDE_HAVE_DOT="NO" +fi +AC_SUBST(KDE_HAVE_DOT) +KDE_FIND_PATH(doxygen, DOXYGEN, [], []) +AC_SUBST(DOXYGEN) + +DOXYGEN_PROJECT_NAME="$1" +DOXYGEN_PROJECT_NUMBER="$2" +AC_SUBST(DOXYGEN_PROJECT_NAME) +AC_SUBST(DOXYGEN_PROJECT_NUMBER) + +KDE_HAS_DOXYGEN=no +if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then + KDE_HAS_DOXYGEN=yes +fi +AC_SUBST(KDE_HAS_DOXYGEN) + +]) + + +AC_DEFUN([AC_FIND_BZIP2], +[ +AC_MSG_CHECKING([for bzDecompress in libbz2]) +AC_CACHE_VAL(ac_cv_lib_bzip2, +[ +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +kde_save_LIBS="$LIBS" +LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET" +kde_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" +AC_TRY_LINK(dnl +[ +#define BZ_NO_STDIO +#include +], + [ bz_stream s; (void) bzDecompress(&s); ], + eval "ac_cv_lib_bzip2='-lbz2'", + eval "ac_cv_lib_bzip2=no") +LIBS="$kde_save_LIBS" +CXXFLAGS="$kde_save_CXXFLAGS" +AC_LANG_RESTORE +])dnl +AC_MSG_RESULT($ac_cv_lib_bzip2) + +if test ! "$ac_cv_lib_bzip2" = no; then + BZIP2DIR=bzip2 + + LIBBZ2="$ac_cv_lib_bzip2" + AC_SUBST(LIBBZ2) + +else + + cxx_shared_flag= + ld_shared_flag= + KDE_CHECK_COMPILER_FLAG(shared, [ + ld_shared_flag="-shared" + ]) + KDE_CHECK_COMPILER_FLAG(fPIC, [ + cxx_shared_flag="-fPIC" + ]) + + AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2]) + AC_CACHE_VAL(ac_cv_lib_bzip2_prefix, + [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + kde_save_LIBS="$LIBS" + LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET" + kde_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES" + + AC_TRY_LINK(dnl + [ + #define BZ_NO_STDIO + #include + ], + [ bz_stream s; (void) BZ2_bzDecompress(&s); ], + eval "ac_cv_lib_bzip2_prefix='-lbz2'", + eval "ac_cv_lib_bzip2_prefix=no") + LIBS="$kde_save_LIBS" + CXXFLAGS="$kde_save_CXXFLAGS" + AC_LANG_RESTORE + ])dnl + + AC_MSG_RESULT($ac_cv_lib_bzip2_prefix) + + if test ! "$ac_cv_lib_bzip2_prefix" = no; then + BZIP2DIR=bzip2 + + LIBBZ2="$ac_cv_lib_bzip2_prefix" + AC_SUBST(LIBBZ2) + + AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix]) + dnl else, we just ignore this + fi + +fi +AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR") +]) + +dnl ------------------------------------------------------------------------ +dnl Try to find the SSL headers and libraries. +dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed) +dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed) +dnl ------------------------------------------------------------------------ +dnl +AC_DEFUN([KDE_CHECK_SSL], +[ +LIBSSL="-lssl -lcrypto" +AC_REQUIRE([KDE_CHECK_LIB64]) + +ac_ssl_includes=NO ac_ssl_libraries=NO +ssl_libraries="" +ssl_includes="" +AC_ARG_WITH(ssl-dir, + AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]), + [ ac_ssl_includes="$withval"/include + ac_ssl_libraries="$withval"/lib$kdelibsuff + ]) + +want_ssl=yes +AC_ARG_WITH(ssl, + AC_HELP_STRING([--without-ssl],[disable SSL checks]), + [want_ssl=$withval]) + +if test $want_ssl = yes; then + +AC_MSG_CHECKING(for OpenSSL) + +AC_CACHE_VAL(ac_cv_have_ssl, +[#try to guess OpenSSL locations + + ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes" + ssl_incdirs="$ac_ssl_includes $ssl_incdirs" + AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir) + ac_ssl_includes="$ssl_incdir" + + ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs" + if test ! "$ac_ssl_libraries" = "NO"; then + ssl_libdirs="$ac_ssl_libraries $ssl_libdirs" + fi + + test=NONE + ssl_libdir=NONE + for dir in $ssl_libdirs; do + try="ls -1 $dir/libssl*" + if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi + done + + ac_ssl_libraries="$ssl_libdir" + + ac_ldflags_safe="$LDFLAGS" + ac_libs_safe="$LIBS" + + LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries" + LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref" + + AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();, + ac_ssl_rsaref="yes" + , + ac_ssl_rsaref="no" + ) + + LDFLAGS="$ac_ldflags_safe" + LIBS="$ac_libs_safe" + + if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then + have_ssl=no + else + have_ssl=yes; + fi + + ]) + + eval "$ac_cv_have_ssl" + + AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes]) + + AC_MSG_CHECKING([whether OpenSSL uses rsaref]) + AC_MSG_RESULT($ac_ssl_rsaref) + + AC_MSG_CHECKING([for easter eggs]) + AC_MSG_RESULT([none found]) + +else + have_ssl=no +fi + +if test "$have_ssl" = yes; then + AC_MSG_CHECKING(for OpenSSL version) + dnl Check for SSL version + AC_CACHE_VAL(ac_cv_ssl_version, + [ + + cat >conftest.$ac_ext < +#include + int main() { + +#ifndef OPENSSL_VERSION_NUMBER + printf("ssl_version=\\"error\\"\n"); +#else + if (OPENSSL_VERSION_NUMBER < 0x00906000) + printf("ssl_version=\\"old\\"\n"); + else + printf("ssl_version=\\"ok\\"\n"); +#endif + return (0); + } +EOF + + ac_save_CPPFLAGS=$CPPFLAGS + if test "$ac_ssl_includes" != "/usr/include"; then + CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes" + fi + + if AC_TRY_EVAL(ac_link); then + + if eval `./conftest 2>&5`; then + if test $ssl_version = error; then + AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !]) + else + if test $ssl_version = old; then + AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.]) + have_ssl=no + fi + fi + ac_cv_ssl_version="ssl_version=$ssl_version" + else + AC_MSG_ERROR([Your system couldn't run a small SSL test program. + Check config.log, and if you can't figure it out, send a mail to + David Faure , attaching your config.log]) + fi + + else + AC_MSG_ERROR([Your system couldn't link a small SSL test program. + Check config.log, and if you can't figure it out, send a mail to + David Faure , attaching your config.log]) + fi + CPPFLAGS=$ac_save_CPPFLAGS + + ]) + + eval "$ac_cv_ssl_version" + AC_MSG_RESULT($ssl_version) +fi + +if test "$have_ssl" != yes; then + LIBSSL=""; +else + AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL]) + ac_cv_have_ssl="have_ssl=yes \ + ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref" + + + ssl_libraries="$ac_ssl_libraries" + ssl_includes="$ac_ssl_includes" + + if test "$ac_ssl_rsaref" = yes; then + LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref" + fi + + if test $ssl_version = "old"; then + AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6]) + fi +fi + +SSL_INCLUDES= + +if test "$ssl_includes" = "/usr/include"; then + if test -f /usr/kerberos/include/krb5.h; then + SSL_INCLUDES="-I/usr/kerberos/include" + fi +elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then + SSL_INCLUDES="-I$ssl_includes" +fi + +if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then + SSL_LDFLAGS="" +else + SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries" +fi + +AC_SUBST(SSL_INCLUDES) +AC_SUBST(SSL_LDFLAGS) +AC_SUBST(LIBSSL) +]) + +AC_DEFUN([KDE_CHECK_STRLCPY], +[ + AC_REQUIRE([AC_CHECK_STRLCAT]) + AC_REQUIRE([AC_CHECK_STRLCPY]) + AC_CHECK_SIZEOF(size_t) + AC_CHECK_SIZEOF(unsigned long) + + AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long]) + AC_TRY_COMPILE(,[ + #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG + choke me + #endif + ],AC_MSG_RESULT([yes]),[ + AC_MSG_RESULT(no) + AC_MSG_ERROR([ + Apparently on your system our assumption sizeof size_t == sizeof unsigned long + does not apply. Please mail kde-devel@kde.org with a description of your system! + ]) + ]) +]) + +AC_DEFUN([KDE_CHECK_BINUTILS], +[ + AC_MSG_CHECKING([if ld supports unversioned version maps]) + + kde_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + echo "{ local: extern \"C++\" { foo }; };" > conftest.map + AC_TRY_LINK([int foo;], +[ +#ifdef __INTEL_COMPILER +icc apparently does not support libtools version-info and version-script +at the same time. Dunno where the bug is, but until somebody figured out, +better disable the optional version scripts. +#endif + + foo = 42; +], kde_supports_versionmaps=yes, kde_supports_versionmaps=no) + LDFLAGS="$kde_save_LDFLAGS" + rm -f conftest.map + AM_CONDITIONAL(include_VERSION_SCRIPT, + [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"]) + + AC_MSG_RESULT($kde_supports_versionmaps) +]) + +AC_DEFUN([AM_PROG_OBJC],[ +AC_CHECK_PROGS(OBJC, gcc, gcc) +test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH]) +if test "x${OBJCFLAGS-unset}" = xunset; then + OBJCFLAGS="-g -O2" +fi +AC_SUBST(OBJCFLAGS) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)]) +]) + +AC_DEFUN([KDE_CHECK_PERL], +[ + KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [ + AC_MSG_ERROR([No Perl found in your $PATH. +We need perl to generate some code.]) + ]) + AC_SUBST(PERL) +]) +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001 +## Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## 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. +## +## As a special exception to the GNU General Public License, if you +## distribute this file as part of a program that contains a +## configuration script generated by Autoconf, you may include it under +## the same distribution terms that you use for the rest of that program. + +# serial 47 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LINUX_64_MODE="32" + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + LINUX_64_MODE="64" + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + testring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + libsuff= + if test "x$LINUX_64_MODE" = x64; then + # Some platforms are per default 64-bit, so there's no /lib64 + if test -d /lib64; then + libsuff=64 + fi + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +#- set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + irix5* | nonstopux*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + case $host_cpu in + alpha* | hppa* | i*86 | ia64* | m68* | mips* | powerpc* | sparc* | s390* | sh* | x86_64* ) + lt_cv_deplibs_check_method=pass_all ;; + # the debian people say, arm and glibc 2.3.1 works for them with pass_all + arm* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that LIBLTDL +# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If +# DIRECTORY is not provided and an installed libltdl is not found, it is +# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single +# quotes!). If your package is not flat and you're not using automake, +# define top_builddir and top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# -------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# +# Check for any special shared library compilation flags. +# +_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= +if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac +fi +if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no + fi +fi + + +# +# Check to make sure the static flag actually works. +# +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +# Report which librarie types wil actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + darwin* | rhapsody*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cc + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # KDE requires run time linking. Make it the default. + aix_use_runtimelinking=yes + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='-qmkshrobj ${wl}-G' + else + shared_flag='-qmkshrobj' + fi + fi + fi + + # Let the compiler handle the export list. + _LT_AC_TAGVAR(always_export_symbols, $1)=no + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext='$shrext' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris* | sysv5*) + symcode='[[BDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGISTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $CC in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + + # KDE requires run time linking. Make it the default. + aix_use_runtimelinking=yes + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='-qmkshrobj ${wl}-G' + else + shared_flag='-qmkshrobj' + fi + fi + fi + + # Let the compiler handle the export list. + _LT_AC_TAGVAR(always_export_symbols, $1)=no + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi4*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + if test "$GXX" = yes ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..87ce185 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,881 @@ +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.63],, +[m4_warning([this file was generated for autoconf 2.63. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 13 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([acinclude.m4]) diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..03d3c27 --- /dev/null +++ b/config.h.in @@ -0,0 +1,257 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* 386 architecture */ +#undef ARCH_386 + +/* x86 architecture */ +#undef ARCH_X86 + +/* x86_64 architecture */ +#undef ARCH_X86_64 + +/* HAL API version 0.4 */ +#undef HAL_0_4 + +/* Define if you have the CoreAudio API */ +#undef HAVE_COREAUDIO + +/* Define to 1 if you have the header file. */ +#undef HAVE_CRT_EXTERNS_H + +/* Defines if your system has the crypt function */ +#undef HAVE_CRYPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* compile in HAL support */ +#undef HAVE_HAL + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have libjpeg */ +#undef HAVE_LIBJPEG + +/* Define if you have libpng */ +#undef HAVE_LIBPNG + +/* Define if you have a working libpthread (will enable threaded code) */ +#undef HAVE_LIBPTHREAD + +/* Define if you have libz */ +#undef HAVE_LIBZ + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if your system needs _NSGetEnviron to set up the environment */ +#undef HAVE_NSGETENVIRON + +/* openGL support */ +#undef HAVE_OPENGL + +/* Define if you have the res_init function */ +#undef HAVE_RES_INIT + +/* Define if you have a STL implementation by SGI */ +#undef HAVE_SGI_STL + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have strlcat */ +#undef HAVE_STRLCAT + +/* Define if you have the strlcat prototype */ +#undef HAVE_STRLCAT_PROTO + +/* Define if you have strlcpy */ +#undef HAVE_STRLCPY + +/* Define if you have the strlcpy prototype */ +#undef HAVE_STRLCPY_PROTO + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Suffix for lib directories */ +#undef KDELIBSUFF + +/* Define a safe value for MAXPATHLEN */ +#undef KDEMAXPATHLEN + +/* new ffmpeg */ +#undef NEW_FFMPEG + +/* No openGL support */ +#undef NO_OPENGL + +/* old ffmpeg */ +#undef OLD_FFMPEG + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of `char *', as computed by sizeof. */ +#undef SIZEOF_CHAR_P + +/* The size of `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* The size of `unsigned long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* + * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system + * headers and I'm too lazy to write a configure test as long as only + * unixware is related + */ +#ifdef _UNIXWARE +#define HAVE_BOOLEAN +#endif + + + +/* + * AIX defines FD_SET in terms of bzero, but fails to include + * that defines bzero. + */ + +#if defined(_AIX) +#include +#endif + + + +#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) +# include +# include +# define environ (*_NSGetEnviron()) +#endif + + + +#if !defined(HAVE_STRLCAT_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +unsigned long strlcat(char*, const char*, unsigned long); +#ifdef __cplusplus +} +#endif +#endif + + + +#if !defined(HAVE_STRLCPY_PROTO) +#ifdef __cplusplus +extern "C" { +#endif +unsigned long strlcpy(char*, const char*, unsigned long); +#ifdef __cplusplus +} +#endif +#endif + + + +/* + * On HP-UX, the declaration of vsnprintf() is needed every time ! + */ + +#if !defined(HAVE_VSNPRINTF) || defined(hpux) +#if __STDC__ +#include +#include +#else +#include +#endif +#ifdef __cplusplus +extern "C" +#endif +int vsnprintf(char *str, size_t n, char const *fmt, va_list ap); +#ifdef __cplusplus +extern "C" +#endif +int snprintf(char *str, size_t n, char const *fmt, ...); +#endif + + + +#if defined(__SVR4) && !defined(__svr4__) +#define __svr4__ 1 +#endif + + +/* Compatibility define */ +#undef ksize_t + +/* Define the real type of socklen_t */ +#undef socklen_t diff --git a/configure.files b/configure.files new file mode 100644 index 0000000..89d14b2 --- /dev/null +++ b/configure.files @@ -0,0 +1,3 @@ +./admin/configure.in.min +configure.in.in +./k9devices/configure.in.in diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..726148d --- /dev/null +++ b/configure.in @@ -0,0 +1,273 @@ +dnl This file is part of the KDE libraries/packages +dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org) + +dnl This file is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Library General Public +dnl License as published by the Free Software Foundation; either +dnl version 2 of the License, or (at your option) any later version. + +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Library General Public License for more details. + +dnl You should have received a copy of the GNU Library General Public License +dnl along with this library; see the file COPYING.LIB. If not, write to +dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301, USA. + +# Original Author was Kalle@kde.org +# I lifted it in some mater. (Stephan Kulow) +# I used much code from Janos Farkas + +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(acinclude.m4) dnl a source file from your sub dir + +dnl This is so we can use kde-common +AC_CONFIG_AUX_DIR(admin) + +dnl This ksh/zsh feature conflicts with `cd blah ; pwd` +unset CDPATH + +dnl Checking host/target/build systems, for make, install etc. +AC_CANONICAL_SYSTEM +dnl Perform program name transformation +AC_ARG_PROGRAM + +dnl Automake doc recommends to do this only here. (Janos) +AM_INIT_AUTOMAKE(k9copy, 1.2.4) dnl searches for some needed programs + +KDE_SET_PREFIX + +dnl generate the config header +AM_CONFIG_HEADER(config.h) dnl at the distribution this done + +dnl Checks for programs. +AC_CHECK_COMPILERS +AC_ENABLE_SHARED(yes) +AC_ENABLE_STATIC(no) +KDE_PROG_LIBTOOL + +dnl for NLS support. Call them in this order! +dnl WITH_NLS is for the po files +AM_KDE_WITH_NLS + +KDE_USE_QT(3.0.0) +AC_PATH_KDE +#MIN_CONFIG(3.0.0) + +dnl PACKAGE set before +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + +case "$target" in + i?86-* | k?-*) + AC_DEFINE([ARCH_X86],,[x86 architecture]) + AC_DEFINE([ARCH_386],,[386 architecture]) + ARCH_X86=yes + ARCH_386=yes + ARCH_X86_64=no + ;; + x86_64-*) + AC_DEFINE([ARCH_X86_64],,[x86_64 architecture]) + ARCH_X86=no + ARCH_386=no + ARCH_X86_64=yes + ;; + *) + ARCH_X86=no + ARCH_386=no + ARCH_X86_64=no + ;; +esac + +AC_MSG_CHECKING(for X86 architecture) +AC_MSG_RESULT($ARCH_X86) +AM_CONDITIONAL(ARCH_X86, [test "$ARCH_X86" = "yes"]) + +AC_MSG_CHECKING(for 386 architecture) +AC_MSG_RESULT($ARCH_386) +AM_CONDITIONAL(ARCH_386, [test "$ARCH_386" = "yes"]) + +AC_MSG_CHECKING(for X86_64 architecture) +AC_MSG_RESULT($ARCH_X86_64) +AM_CONDITIONAL(ARCH_X86_64, [test "$ARCH_X86_64" = "yes"]) + +have_gl=no +AC_CHECK_HEADER([GL/gl.h], \ +[AC_DEFINE(HAVE_OPENGL, 1, [openGL support]) have_gl=yes], \ +[AC_DEFINE(NO_OPENGL, 1, [No openGL support])]) + + +AC_CHECK_HEADER([ffmpeg/avcodec.h], \ +[AC_DEFINE(OLD_FFMPEG,1, [old ffmpeg])], \ + [AC_CHECK_HEADER([libavcodec/avcodec.h], \ + [AC_DEFINE(NEW_FFMPEG,1, [new ffmpeg])], \ + [AC_MSG_ERROR([libavcodec may be missing]) ])]) + + + + + have_hal=no + AC_MSG_CHECKING(for the HAL) + + AC_ARG_ENABLE([k3bdevices], + AC_HELP_STRING([--enable-k3bdevices], + [do not activate hal/dbus support (use k3bdevice instead)]), + [enable_hal=no], + [enable_hal=yes]) + + + if test x"$enable_hal" = xyes; then + hal_inc=NOTFOUND + hal_lib=NOTFOUND + hal=NOTFOUND + + search_incs="$kde_includes /usr/include /usr/include/hal /usr/local/include /usr/local/include/hal" + AC_FIND_FILE(libhal.h libhal-storage.h, $search_incs, hal_incdir) + + if [test -r $hal_incdir/libhal.h] ; then + HAL_INCS="-I$hal_incdir" + hal_inc=FOUND + fi + + if test -r $hal_incdir/libhal-storage.h ; then + hal_storage_version=4 + grep LibHalVolume $hal_incdir/libhal-storage.h \ + > /dev/null 2>&1 && hal_storage_version=5 + if test $hal_storage_version = 4 ; then + AC_DEFINE(HAL_0_4, , [HAL API version 0.4]) + fi + fi + + search_libs="$kde_libraries /usr/lib64 /usr/lib /usr/local/lib /lib /lib64" + AC_FIND_FILE(libhal.so, $search_libs, hal_libdir) + + if [test -r $hal_libdir/libhal.so] ; then + HAL_LIBS="-L$hal_libdir -lhal" + hal_lib=FOUND + fi + + if [test -r $hal_libdir/libhal-storage.so] ; then + HAL_LIBS_STORAGE="-L$hal_libdir -lhal-storage" + hal_lib_storage=FOUND + fi + + if [test $hal_inc = FOUND] && [test $hal_lib = FOUND] ; then + AC_MSG_RESULT(headers $hal_incdir libraries $hal_libdir) + hal=FOUND + else + AC_MSG_RESULT(searched but not found) + AC_MSG_ERROR(libhal may be missing) + fi + + AC_SUBST(HAL_INCS) + AC_SUBST(HAL_LIBS) + + + ########### Check for DBus + + AC_MSG_CHECKING(for DBus) + + dbus_inc=NOTFOUND + dbus_lib=NOTFOUND + dbus=NOTFOUND + + search_incs="$kde_includes /usr/include /usr/include/dbus-1.0 /usr/local/include /usr/local/include/dbus-1.0" + AC_FIND_FILE(dbus/dbus.h, $search_incs, dbus_incdir) + + search_incs_arch_deps="$kde_includes /usr/lib64/dbus-1.0/include /usr/lib/dbus-1.0/include /usr/local/lib/dbus-1.0/include" + AC_FIND_FILE(dbus/dbus-arch-deps.h, $search_incs_arch_deps, dbus_incdir_arch_deps) + + if [test -r $dbus_incdir/dbus/dbus.h] && [test -r $dbus_incdir_arch_deps/dbus/dbus-arch-deps.h] ; then + DBUS_INCS="-I$dbus_incdir -I$dbus_incdir_arch_deps" + dbus_inc=FOUND + fi + + search_libs="$kde_libraries /usr/lib64 /usr/lib /usr/local/lib /lib /lib64" + AC_FIND_FILE(libdbus-1.so, $search_libs, dbus_libdir) + + if test -r $dbus_libdir/libdbus-1.so ; then + DBUS_LIBS="-L$dbus_libdir -ldbus-1" + dbus_lib=FOUND + fi + + if [test $dbus_inc = FOUND] && [test $dbus_lib = FOUND] ; then + AC_MSG_RESULT(headers $dbus_incdir $dbus_incdir_arch_deps libraries $dbus_libdir) + dbus=FOUND + else + AC_MSG_RESULT(searched but not found) + AC_MSG_ERROR(dbus may be missing) + fi + + AC_SUBST(DBUS_INCS) + AC_SUBST(DBUS_LIBS) + + + ########### Check if media HAL backend should be compiled + + HAL_DBUS_LIBS="" + if [test "x$hal" = "xFOUND"] && [test "x$dbus" = "xFOUND"] && [ test $hal_storage_version = 5 ] ; then + AC_DEFINE(HAVE_HAL, , [compile in HAL support]) + have_hal=yes + HAL_DBUS_LIBS="$HAL_LIBS $HAL_LIBS_STORAGE $DBUS_LIBS" + fi + + AC_SUBST(HAL_DBUS_LIBS) +else + search_incs="$kde_includes /usr/include /usr/local/include" + AC_FIND_FILE(k3bdevice.h, $search_incs, k3b_incdir) + + if [test -r $k3b_incdir/k3bdevice.h] ; then + k3b_inc=FOUND + fi + + search_libs="$kde_libraries /usr/lib64 /usr/lib /usr/local/lib /lib /lib64" + AC_FIND_FILE(libk3bdevice.so, $search_libs, k3b_libdir) + + if [test -r $k3b_libdir/libk3bdevice.so] ; then + K3B_LIBS="-lk3bdevice" + k3b_lib=FOUND + fi + + if [test $k3b_inc = FOUND] && [test $k3b_lib = FOUND] ; then + AC_MSG_RESULT(headers $k3b_incdir libraries $k3b_libdir) + k3b=FOUND + else + AC_MSG_RESULT(libk3bdevice searched but not found) + AC_MSG_ERROR(libk3bdevice may be missing) + fi + + AC_SUBST(K3B_LIBS) + +fi + +KDE_CREATE_SUBDIRSLIST +AC_CONFIG_FILES([ Makefile ]) +AC_CONFIG_FILES([ doc/Makefile ]) +AC_CONFIG_FILES([ doc/k9copy/Makefile ]) +AC_CONFIG_FILES([ dvdread/Makefile ]) +AC_CONFIG_FILES([ k9author/Makefile ]) +AC_CONFIG_FILES([ k9decmpeg/Makefile ]) +AC_CONFIG_FILES([ k9devices/Makefile ]) +AC_CONFIG_FILES([ k9Mplayer/Makefile ]) +AC_CONFIG_FILES([ k9vamps/Makefile ]) +AC_CONFIG_FILES([ libdvdnav/Makefile ]) +AC_CONFIG_FILES([ libk9copy/Makefile ]) +AC_CONFIG_FILES([ po/Makefile ]) +AC_CONFIG_FILES([ src/Makefile ]) +AC_CONFIG_FILES([ src/icons/Makefile ]) +AC_OUTPUT +if test "$all_tests" = "bad"; then + if test ! "$cache_file" = "/dev/null"; then + echo "" + echo "Please remove the file $cache_file after changing your setup" + echo "so that configure will find the changes next time." + echo "" + fi +else + echo "" + echo "Good - your configure finished. Start make now" + echo "" +fi diff --git a/configure.in.in b/configure.in.in new file mode 100755 index 0000000..f8ff819 --- /dev/null +++ b/configure.in.in @@ -0,0 +1,54 @@ +#MIN_CONFIG(3.0.0) + +AM_INIT_AUTOMAKE(k9copy, 1.2.4) +AC_C_BIGENDIAN +AC_CHECK_KDEMAXPATHLEN + +case "$target" in + i?86-* | k?-*) + AC_DEFINE([ARCH_X86],,[x86 architecture]) + AC_DEFINE([ARCH_386],,[386 architecture]) + ARCH_X86=yes + ARCH_386=yes + ARCH_X86_64=no + ;; + x86_64-*) + AC_DEFINE([ARCH_X86_64],,[x86_64 architecture]) + ARCH_X86=no + ARCH_386=no + ARCH_X86_64=yes + ;; + *) + ARCH_X86=no + ARCH_386=no + ARCH_X86_64=no + ;; +esac + +AC_MSG_CHECKING(for X86 architecture) +AC_MSG_RESULT($ARCH_X86) +AM_CONDITIONAL(ARCH_X86, [test "$ARCH_X86" = "yes"]) + +AC_MSG_CHECKING(for 386 architecture) +AC_MSG_RESULT($ARCH_386) +AM_CONDITIONAL(ARCH_386, [test "$ARCH_386" = "yes"]) + +AC_MSG_CHECKING(for X86_64 architecture) +AC_MSG_RESULT($ARCH_X86_64) +AM_CONDITIONAL(ARCH_X86_64, [test "$ARCH_X86_64" = "yes"]) + +have_gl=no +AC_CHECK_HEADER([GL/gl.h], \ +[AC_DEFINE(HAVE_OPENGL, 1, [openGL support]) have_gl=yes], \ +[AC_DEFINE(NO_OPENGL, 1, [No openGL support])]) + + +AC_CHECK_HEADER([ffmpeg/avcodec.h], \ +[AC_DEFINE(OLD_FFMPEG,1, [old ffmpeg])], \ + [AC_CHECK_HEADER([libavcodec/avcodec.h], \ + [AC_DEFINE(NEW_FFMPEG,1, [new ffmpeg])], \ + [AC_MSG_ERROR([libavcodec may be missing]) ])]) + + + + diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100755 index 0000000..6d4e373 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,6 @@ +# the SUBDIRS is filled automatically by am_edit. If files are +# in this directory they are installed into the english dir + +KDE_LANG = en +KDE_DOCS = AUTO +SUBDIRS = k9copy diff --git a/doc/k9copy/Makefile.am b/doc/k9copy/Makefile.am new file mode 100644 index 0000000..22146b2 --- /dev/null +++ b/doc/k9copy/Makefile.am @@ -0,0 +1,5 @@ +KDE_LANG = en +KDE_DOCS = k9copy +kde_docs_KDEDOCS = mainwindow.png open1.png open2.png treeview.png \ + keepmenus.png playback.png btncopy.png settingsDVD.png btnmp4.png settingsMP4.png \ + settingsMencoder.png diff --git a/doc/k9copy/btncopy.png b/doc/k9copy/btncopy.png new file mode 100644 index 0000000..0c79804 Binary files /dev/null and b/doc/k9copy/btncopy.png differ diff --git a/doc/k9copy/btnmp4.png b/doc/k9copy/btnmp4.png new file mode 100644 index 0000000..1ab5e6f Binary files /dev/null and b/doc/k9copy/btnmp4.png differ diff --git a/doc/k9copy/index.docbook b/doc/k9copy/index.docbook new file mode 100644 index 0000000..1e25fb9 --- /dev/null +++ b/doc/k9copy/index.docbook @@ -0,0 +1,459 @@ + + + k9copy"> + + + + +]> + + + + + +&k9copy; Handbook + + + +Jean-Michel + +Petit + +
k9copy@free.fr
+
+
+
+ + + + +2004 +2007 +The k9copy Author + + + +&FDLNotice; + + + +02/11/2007 +1.1.0 + + + + + +A DVD Backup tool for KDE. http://k9copy.sourceforge.net + + + + + + +k9copy +vamps +dvd + + +
+ + + + + +k9copy shell + + +The Main Window + + +Main Window + + + + + + + Screenshot + + + + +The main goal of k9copy is to be an easy to use and powerfull DVD backup app. + + +Once oppened, the DVD structure is shown in a treeview (the central widget). + + +The selection is made by checkboxes. You can select the entire DVD, a Titleset or just a specific language or subtitle from a DVD title. + +The backup can be made in three ways : +- backup with orginal menus. In this case, k9copy reproduces the orginial structure of the DVD without the unselected parts. + +- backup without menus. In this case, k9copy reproduces the orginial structure of the DVD without the unselected parts and without menus. + +- backup without menus via dvdauthor . In this case, k9copy makes a reauthoring of the DVD. K9copy uses libdvdnav from xine to ensure that the DVD will be copied as it were played with xine. + + + + +Make a dvd backup + +Open the dvd + + Select a dvd device from the list or click on buttons on right of the list to select a directory or a dvd image file. + + + + + + + Click on the button Open from the main toolbar or File->Open from the main menu. + + + + + + + + + The treeview will be filled with the DVD structure + + + + + Selection of titles to copy + + DVD structure + + + + + + Screenshot + + + + + + Use the checkbox at the top of the treeview to make a copy of the entire DVD. + + + Use the checkbox beside the titleset to make a copy of a whole titleset. + + + It's now possible to selecte only the wanted chapters from a title. + + + A title must have a video stream : if you select an audio language or a subtitle language, the video stream will be automatically selected. If you deselect the video stream, the title will not be backuped. + + + + +Playback options of the new DVD + +If the DVD you want to backup has interactive menus, you can keep them on your backup. Some DVDs have menus whose size is important. To preserve these menus would increase the shrink factor and would involve a loss of quality. + + + + + + + +If you chose not to preserve the menus, you can then define some playback options : + + + + + + + + + + +When a title is selected, it appears in the Selected Titles list. Use buttons on the right of this list to define in which order the titles will be played. + + +You can define the default audio language or the default subtitle for each title. Hilite a title in the title list and the two comboboxes will be filled with the available languages (those which where selected in the treeview). + + + +Perform the copy + +Once you have selected the titles, you can proceed with copy : + + + + + + + + + + +DVD backup settings + + DVD backup settings + + + + + + Screenshot + + + + + + Temporary files will be placed in the output directory + Define the max size of the backup + By default, &k9copy; uses its own burning method. Since the burning options are limited, you can use the a powerfull burning software: k3b. + AutoBurn allows to run the DVD burning without confirmation. + When using quickscan, &k9copy; will not analyze the dvd title to estimate the sizes of each stream. The DVD analyze can take a long time if DVD contains many features. + + + + + +MPEG-4 Encoding +&k9copy; offers the possibility to encode DVD titles in MPEG-4 via MEncoder. + + +Just select an audio stream from a title in the treeview and click on the button + + + + + + + + +MPEG-4 settings + + MPEG-4 settings + + + + + + Screenshot + + + + + + Select the codec used to encode mp4. Default codecs are XViD and lavc MP4, but you can add other codecs supported by MEncoder. + Choose the max size of an avi file an the number of files wanted. + Enter the width of the mpeg4 video. + Enter the height of the mpeg4 video. + Audio will be encoded in mp3 using lame. You can choose the bitrate of the mp3 audio stream. + + + + + + +MEncoder settings + + MEncoder settings + + + + + + Screenshot + + + + +You can add codecs supported by MEncoder: + +Video example : xvid -xvidencopts bitrate=$VIDBR + +Audio example : mp3lame -lameopts abr:br=$AUDBR + +You can use following variables : + + $VIDBR : video bitrate (calculated) + $AUDBR : audio bitrate (settings) + $WIDTH : width (settings) + $HEIGHT : height (settings) + $PASS : pass number (runtime) + + + + + + + + +Command Line Options + +Usage: + +k9copy +--input +--output +--play +--dvdtitle +--startsector +--endsector +--audiofilter +--subpicturefilter +--vampsfactor +--inputsize +--totalsize +--dvdsize +--chapter +--cell +--inject +--initstatus + + + + + + + + + +input device + + + +output device + + + +&k9copy; is used to play a title or part of title to stdout + + + + +the dvd title to play + + + +sector to start playing from + + + +sector to end playing from + + +Selection of audio streams + + + +Selection of subtitles + + + +Shrink factor + + + +Size of the cell being copied + + + +Total size of titles to play + + + +Final size of the dvd to produce + + + +Number of the chapter to play + + + +Number of a cell from chapter to play + + + +Name of the file used to save status between 2 calls of k9copy + + + +Initialize status file + + + + + + + + + + +Copyright and License + + +Program copyright 2004-2007, Jean-Michel Petit + + + + +&underFDL; + + + + +&underGPL; + + + + +&documentation.index; +
+ + + + + + + + + + + + + + diff --git a/doc/k9copy/index.xml b/doc/k9copy/index.xml new file mode 100644 index 0000000..0fcc227 --- /dev/null +++ b/doc/k9copy/index.xml @@ -0,0 +1,445 @@ + + + K9Copy"> + + + + +]> + + + + + +&k9copy; Handbook + + + +Jean-Michel + +Petit + +
k9copy@free.fr
+
+
+
+ + + + +2004 +2006 +The K9Copy Authors + + + +&FDLNotice; + + + +04/06/2006 +1.1.0 + + + + + +A DVD Backup tool for KDE. http://k9copy.sourceforge.net + + + + + + +k9copy +vamps +dvd + + +
+ + + + + +k9copy shell + + +The Main Window + + +Main Window + + + + + + + Screenshot + + + + +The main goal of k9copy is to be an easy to use and powerfull DVD backup app. + + +Once oppened, the DVD structure is shown in a treeview (the central widget). + + +The selection is made by checkboxes. You can select the entire DVD, a Titleset or just a specific language or subtitle from a DVD title. + +For DVD backup there are two possibilities : +- backup with orginal menus. In this case, k9copy reproduces the orginial structure of the DVD without the unselected parts. + +- backup without menus. In this case, k9copy makes a reauthoring of the DVD. K9copy uses libdvdnav from xine to ensure that the DVD will be copied as it were played with xine. + + + + +Making a dvd backup + +Open the dvd + + Select a dvd device from the list or click on buttons on right of the list to select a directory or a dvd image file. + + + + + + + Click on the button Open from the main toolbar or File->Open from the main menu. + + + + + + + + + The treeview will be filled with the DVD structure + + + + + Selection of titles to copy + + DVD structure + + + + + + Screenshot + + + + + + Use the checkbox at the top of the treeview to make a copy of the entire DVD. + + + Use the checkbox beside the titleset to make a copy of an entire titleset. + + + A title must have a video stream : if you select an audio language or a subtitle language, the video stream will be automatically selected. If you deselect the video stream, the title will not be backuped. + + + + +Playback options of the new DVD + +If the DVD you want to backup has interactive menus, you can keep them on your backup. On some DVDs, menus are very big and keeping them will increase the shrink factor and reduce the quality of the video stream. + + + + + + + +If you have choosen to not keep original menus, it's possible to define some playback options : + + + + + + + + + + +When a title is selected, it appears in the Selected Titles list. Use buttons on the right of this list to define in which order the titles will be played. + + +You can define the default audio language or the default subtitle for each title. Hilite a title in the title list and the two comboboxes will be filled with the available languages (those which where selected in the treeview). + + + +Executing the copy + +Once you have selected the titles, you can proceed with copy : + + + + + + + + + + +DVD backup settings + + DVD backup settings + + + + + + Screenshot + + + + + + Temporary files will be placed in the output directory + Define the max size of the backup + By default, &k9copy; uses its own burning method. Since the burning options are limited, you can use the a powerfull burning software: k3b. + AutoBurn allows to run the DVD burning without confirmation. + When using quickscan, &k9copy; will not analyze the dvd title to estimate the sizes of each stream. The DVD analyze can take a long time if DVD contains many features. + + + + + +Encoding MPEG-4 +&k9copy; offers the possibility to encode DVD titles in MPEG-4 by using MEncoder. + + +Just select an audio stream from a title in the treeview and click on the button + + + + + + + + +MPEG-4 settings + + MPEG-4 settings + + + + + + Screenshot + + + + + + Select the codec used to encode mp4. Default codecs are XViD and lavc MP4, but you can add other codecs supported by MEncoder. + Choose the max size of an avi file an the number of files wanted. + Enter the width of the mpeg4 video. + Enter the height of the mpeg4 video. + Audio will be encoded in mp3 using lame. You can choose the bitrate of the mp3 audio stream. + + + + + + + +Command Line Options + +Usage: + +k9copy + + + + + + +--fullscreen +--play +--audiodriver +--videodriver +--device +--verbose +--wizard +file + + + + + + + + + +Starts &k9copy; in fullscreen mode. + + + + +Starts with last played track. + + + + +Sets the audio driver. Arguments can be: alsa, arts, oss, ... + + + + +Sets the video driver. Arguments can be: xv, xshm, dxr3 ,... + + + + +Sets the Audio-CD/VCD/DVD path to (argument). + + + + +Outputs more debug messages. + + + +Runs installation wizard. + + + + +Files to play. Can be local files, a directory, an URL or "AudioCD", "VCD", "DVD". + + + + + + + + + + + +Questions and Answers + + + +Kaffeine-FAQ + + +xine-FAQ + + +For Questions use the k9copy-user mailinglist. +(First check the archive + if the question is still answered.) + + + + + + +Reporting BUGS + + +Before you report a bug, please first make sure the bug has not been reported +yet in the bug tracking system at http://www.sourceforge.net/projects/k9copy. +Also have a look into the mailinglist archive. + + + +Please use only the tracking system on sourceforge for reporting bugs and log in before +submitting (if you've a sourceforge account). + + + +When you submit a bug, please include all of the following information: + + +versions of Kaffeine, xine, KDE, X11 +the backtrace from KDE's Crash Manager +console output (you can use --verbose to get more) + + + + + + + +Copyright and License + + +Program copyright 2003-2005, The Kaffeine Authors + + + + +Documentation copyright 2003-2005, Jürgen Kofler k9copy@gmx.net, Christophe Thommeret hftom@free.fr + + + + +&underFDL; + + + + +&underGPL; + + + + +&documentation.index; +
+ + + + + + + + + + + + + + diff --git a/doc/k9copy/keepmenus.png b/doc/k9copy/keepmenus.png new file mode 100644 index 0000000..c2bc3e8 Binary files /dev/null and b/doc/k9copy/keepmenus.png differ diff --git a/doc/k9copy/mainwindow.png b/doc/k9copy/mainwindow.png new file mode 100644 index 0000000..f12a3bc Binary files /dev/null and b/doc/k9copy/mainwindow.png differ diff --git a/doc/k9copy/open1.png b/doc/k9copy/open1.png new file mode 100644 index 0000000..f598c50 Binary files /dev/null and b/doc/k9copy/open1.png differ diff --git a/doc/k9copy/open2.png b/doc/k9copy/open2.png new file mode 100644 index 0000000..8f4ac4c Binary files /dev/null and b/doc/k9copy/open2.png differ diff --git a/doc/k9copy/playback.png b/doc/k9copy/playback.png new file mode 100644 index 0000000..ebe5e05 Binary files /dev/null and b/doc/k9copy/playback.png differ diff --git a/doc/k9copy/settingsDVD.png b/doc/k9copy/settingsDVD.png new file mode 100644 index 0000000..bc0ae90 Binary files /dev/null and b/doc/k9copy/settingsDVD.png differ diff --git a/doc/k9copy/settingsMP4.png b/doc/k9copy/settingsMP4.png new file mode 100644 index 0000000..9bb24ab Binary files /dev/null and b/doc/k9copy/settingsMP4.png differ diff --git a/doc/k9copy/settingsMencoder.png b/doc/k9copy/settingsMencoder.png new file mode 100644 index 0000000..f9eed5d Binary files /dev/null and b/doc/k9copy/settingsMencoder.png differ diff --git a/doc/k9copy/treeview.png b/doc/k9copy/treeview.png new file mode 100644 index 0000000..1744acf Binary files /dev/null and b/doc/k9copy/treeview.png differ diff --git a/dvdread/Makefile.am b/dvdread/Makefile.am new file mode 100644 index 0000000..5c9fddf --- /dev/null +++ b/dvdread/Makefile.am @@ -0,0 +1,8 @@ + +METASOURCES = AUTO +noinst_LTLIBRARIES = libdvdread.la +libdvdread_la_LDFLAGS = $(all_libraries) +libdvdread_la_SOURCES = dvd_input.c dvd_reader.c dvd_udf.c ifo_read.c md5.c \ + nav_read.c +noinst_HEADERS = bswap.h dvd_input.h dvd_reader.h dvd_udf.h dvdread_internal.h \ + ifo_read.h ifo_types.h md5.h nav_read.h nav_types.h diff --git a/dvdread/bswap.h b/dvdread/bswap.h new file mode 100644 index 0000000..11c9774 --- /dev/null +++ b/dvdread/bswap.h @@ -0,0 +1,126 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#ifndef BSWAP_H_INCLUDED +#define BSWAP_H_INCLUDED + +/* + * Copyright (C) 2000, 2001 Billy Biggs , + * Håkan Hjort + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#if defined(WORDS_BIGENDIAN) +/* All bigendian systems are fine, just ignore the swaps. */ +#define B2N_16(x) (void)(x) +#define B2N_32(x) (void)(x) +#define B2N_64(x) (void)(x) + +#else + +/* For __FreeBSD_version */ +#if defined(HAVE_SYS_PARAM_H) +#include +#endif + +#if defined(__linux__) +#include +#define B2N_16(x) x = bswap_16(x) +#define B2N_32(x) x = bswap_32(x) +#define B2N_64(x) x = bswap_64(x) + +#elif defined(__NetBSD__) +#include +#define B2N_16(x) BE16TOH(x) +#define B2N_32(x) BE32TOH(x) +#define B2N_64(x) BE64TOH(x) + +#elif defined(__OpenBSD__) +#include +#define B2N_16(x) x = swap16(x) +#define B2N_32(x) x = swap32(x) +#define B2N_64(x) x = swap64(x) + +#elif defined(__FreeBSD__) && __FreeBSD_version >= 470000 +#include +#define B2N_16(x) x = be16toh(x) +#define B2N_32(x) x = be32toh(x) +#if __FreeBSD_version >= 500000 +#define B2N_64(x) x = be64toh(x) +#else +#define B2N_64(x) \ + x = ((((x) & 0xff00000000000000) >> 56) | \ + (((x) & 0x00ff000000000000) >> 40) | \ + (((x) & 0x0000ff0000000000) >> 24) | \ + (((x) & 0x000000ff00000000) >> 8) | \ + (((x) & 0x00000000ff000000) << 8) | \ + (((x) & 0x0000000000ff0000) << 24) | \ + (((x) & 0x000000000000ff00) << 40) | \ + (((x) & 0x00000000000000ff) << 56)) +#endif /* _FreeBSD_version >= 500000 */ + +#elif defined(__DragonFly__) +#include +#define B2N_16(x) x = be16toh(x) +#define B2N_32(x) x = be32toh(x) +#define B2N_64(x) x = be64toh(x) + + +#elif defined(__APPLE__) || defined(__DARWIN__) +#include +#define B2N_16(x) x = OSSwapBigToHostConstInt16(x) +#define B2N_32(x) x = OSSwapBigToHostConstInt32(x) +#define B2N_64(x) x = OSSwapBigToHostConstInt64(x) + +#else +#if defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX) +/* These systems don't have swap macros */ +#else +/* If there isn't a header provided with your system with this functionality + * add the relevant || define( ) to the list above. + */ +#warning "You should add endian swap macros for your system" +#endif + +/* This is a slow but portable implementation, it has multiple evaluation + * problems so beware. + * Old FreeBSD's and Solaris don't have or any other such + * functionality! + */ + +#define B2N_16(x) \ + x = ((((x) & 0xff00) >> 8) | \ + (((x) & 0x00ff) << 8)) +#define B2N_32(x) \ + x = ((((x) & 0xff000000) >> 24) | \ + (((x) & 0x00ff0000) >> 8) | \ + (((x) & 0x0000ff00) << 8) | \ + (((x) & 0x000000ff) << 24)) +#define B2N_64(x) \ + x = ((((x) & 0xff00000000000000) >> 56) | \ + (((x) & 0x00ff000000000000) >> 40) | \ + (((x) & 0x0000ff0000000000) >> 24) | \ + (((x) & 0x000000ff00000000) >> 8) | \ + (((x) & 0x00000000ff000000) << 8) | \ + (((x) & 0x0000000000ff0000) << 24) | \ + (((x) & 0x000000000000ff00) << 40) | \ + (((x) & 0x00000000000000ff) << 56)) + + + +#endif + +#endif /* WORDS_BIGENDIAN */ + +#endif /* BSWAP_H_INCLUDED */ diff --git a/dvdread/dvd_input.c b/dvdread/dvd_input.c new file mode 100644 index 0000000..99ddd2d --- /dev/null +++ b/dvdread/dvd_input.c @@ -0,0 +1,414 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2002 Samuel Hocevar , + * Håkan Hjort + * + * 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 02111, USA. + */ + +#include "config.h" + +#include +#include +#define __USE_GNU /* to get O_DIRECT in linux */ +#include +#include + +#include "dvd_reader.h" +#include "dvd_input.h" + +#include "dvdread_internal.h" + +/* The function pointers that is the exported interface of this file. */ +dvd_input_t (*dvdinput_open) (const char *); +int (*dvdinput_close) (dvd_input_t); +int (*dvdinput_seek) (dvd_input_t, int); +int (*dvdinput_title) (dvd_input_t, int); +/** + * pointer must be aligned to 2048 bytes + * if reading from a raw/O_DIRECT file + */ +int (*dvdinput_read) (dvd_input_t, void *, int, int); + +char * (*dvdinput_error) (dvd_input_t); + +#ifdef HAVE_DVDCSS_DVDCSS_H +/* linking to libdvdcss */ +#include +#define DVDcss_open(a) dvdcss_open((char*)(a)) +#define DVDcss_close dvdcss_close +#define DVDcss_seek dvdcss_seek +#define DVDcss_title dvdcss_title +#define DVDcss_read dvdcss_read +#define DVDcss_error dvdcss_error +#else +/* dlopening libdvdcss */ +#include +typedef struct dvdcss_s *dvdcss_handle; +static dvdcss_handle (*DVDcss_open) (const char *); +static int (*DVDcss_close) (dvdcss_handle); +static int (*DVDcss_seek) (dvdcss_handle, int, int); +static int (*DVDcss_title) (dvdcss_handle, int); +static int (*DVDcss_read) (dvdcss_handle, void *, int, int); +static char * (*DVDcss_error) (dvdcss_handle); +#endif + +/* The DVDinput handle, add stuff here for new input methods. */ +struct dvd_input_s { + /* libdvdcss handle */ + dvdcss_handle dvdcss; + + /* dummy file input */ + int fd; +}; + + +/** + * initialize and open a DVD device or file. + */ +static dvd_input_t css_open(const char *target) +{ + dvd_input_t dev; + + /* Allocate the handle structure */ + dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s)); + if(dev == NULL) { + /* malloc has set errno to ENOMEM */ + return NULL; + } + + /* Really open it with libdvdcss */ + dev->dvdcss = DVDcss_open(target); + if(dev->dvdcss == 0) { + free(dev); + dev = NULL; + } + + return dev; +} + +/** + * return the last error message + */ +static char *css_error(dvd_input_t dev) +{ + return DVDcss_error(dev->dvdcss); +} + +/** + * seek into the device. + */ +static int css_seek(dvd_input_t dev, int blocks) +{ + /* DVDINPUT_NOFLAGS should match the DVDCSS_NOFLAGS value. */ + return DVDcss_seek(dev->dvdcss, blocks, DVDINPUT_NOFLAGS); +} + +/** + * set the block for the begining of a new title (key). + */ +static int css_title(dvd_input_t dev, int block) +{ + return DVDcss_title(dev->dvdcss, block); +} + +/** + * read data from the device. + */ +static int css_read(dvd_input_t dev, void *buffer, int blocks, int flags) +{ + return DVDcss_read(dev->dvdcss, buffer, blocks, flags); +} + +/** + * close the DVD device and clean up the library. + */ +static int css_close(dvd_input_t dev) +{ + int ret; + + ret = DVDcss_close(dev->dvdcss); + + if(ret < 0) + return ret; + + free(dev); + + return 0; +} + +/* Need to use O_BINARY for WIN32 */ +#ifndef O_BINARY +#ifdef _O_BINARY +#define O_BINARY _O_BINARY +#else +#define O_BINARY 0 +#endif +#endif + +/** + * initialize and open a DVD device or file. + */ +static dvd_input_t file_open(const char *target) +{ + dvd_input_t dev; + char *use_odirect; + int oflags; + + oflags = O_RDONLY | O_BINARY; + use_odirect = getenv("DVDREAD_USE_DIRECT"); + if(use_odirect) { +#ifndef O_DIRECT +#define O_DIRECT 0 +#endif + oflags |= O_DIRECT; + } + /* Allocate the library structure */ + dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s)); + if(dev == NULL) { + return NULL; + } + + /* Open the device */ + dev->fd = open(target, oflags); + if(dev->fd < 0) { + free(dev); + return NULL; + } + + return dev; +} + +/** + * return the last error message + */ +static char *file_error(dvd_input_t dev) +{ + /* use strerror(errno)? */ + return (char *)"unknown error"; +} + +/** + * seek into the device. + */ +static int file_seek(dvd_input_t dev, int blocks) +{ + off_t pos = (off_t)blocks * (off_t)DVD_VIDEO_LB_LEN; + + pos = lseek(dev->fd, pos, SEEK_SET); + if(pos < 0) { + return pos; + } + /* assert pos % DVD_VIDEO_LB_LEN == 0 */ + return (int) (pos / DVD_VIDEO_LB_LEN); +} + +/** + * set the block for the begining of a new title (key). + */ +static int file_title(dvd_input_t dev, int block) +{ + return -1; +} + +/** + * read data from the device. + */ +static int file_read(dvd_input_t dev, void *buffer, int blocks, int flags) +{ + size_t len; + ssize_t ret; + unsigned char *buf = buffer; + + len = (size_t)blocks * DVD_VIDEO_LB_LEN; + + while(len > 0) { + + ret = read(dev->fd, buf, len); + + if(ret < 0) { + /* One of the reads failed, too bad. We won't even bother + * returning the reads that went ok, and as in the posix spec + * the file postition is left unspecified after a failure. */ + return ret; + } + + if(ret == 0) { + /* Nothing more to read. Return the whole blocks, if any, that we got. + and adjust the file possition back to the previous block boundary. */ + size_t bytes = (size_t)blocks * DVD_VIDEO_LB_LEN - len; + off_t over_read = -(bytes % DVD_VIDEO_LB_LEN); + /*off_t pos =*/ lseek(dev->fd, over_read, SEEK_CUR); + /* should have pos % 2048 == 0 */ + return (int) (bytes / DVD_VIDEO_LB_LEN); + } + + buf+=ret; + len -= ret; + } + + return blocks; +} + +/** + * close the DVD device and clean up. + */ +static int file_close(dvd_input_t dev) +{ + int ret; + + ret = close(dev->fd); + + if(ret < 0) + return ret; + + free(dev); + + return 0; +} + + +static void *dvdcss_library = NULL; +static int dvdcss_library_init = 0; + +/** + * Free any objects allocated by dvdinput_setup. + * Should only be called when libdvdread is not to be used any more. + * Closes dlopened libraries. + */ +void dvdinput_free(void) +{ +#ifdef HAVE_DVDCSS_DVDCSS_H + /* linked statically, nothing to free */ + return; +#else + if(dvdcss_library) { + dlclose(dvdcss_library); + dvdcss_library = NULL; + } + dvdcss_library_init = 0; + return; +#endif +} + + +/** + * Setup read functions with either libdvdcss or minimal DVD access. + */ +int dvdinput_setup(void) +{ + char **dvdcss_version = NULL; + int verbose; + + /* dlopening libdvdcss */ + if(dvdcss_library_init) { + /* libdvdcss is already dlopened, function ptrs set */ + if(dvdcss_library) { + return 1; /* css available */ + } else { + return 0; /* css not available */ + } + } + + verbose = get_verbose(); + +#ifdef HAVE_DVDCSS_DVDCSS_H + /* linking to libdvdcss */ + dvdcss_library = &dvdcss_library; /* Give it some value != NULL */ + /* the DVDcss_* functions have been #defined at the top */ + dvdcss_version = &dvdcss_interface_2; + +#else + + dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY); + + if(dvdcss_library != NULL) { +#if defined(__OpenBSD__) && !defined(__ELF__) +#define U_S "_" +#else +#define U_S +#endif + DVDcss_open = (dvdcss_handle (*)(const char*)) + dlsym(dvdcss_library, U_S "dvdcss_open"); + DVDcss_close = (int (*)(dvdcss_handle)) + dlsym(dvdcss_library, U_S "dvdcss_close"); + DVDcss_title = (int (*)(dvdcss_handle, int)) + dlsym(dvdcss_library, U_S "dvdcss_title"); + DVDcss_seek = (int (*)(dvdcss_handle, int, int)) + dlsym(dvdcss_library, U_S "dvdcss_seek"); + DVDcss_read = (int (*)(dvdcss_handle, void*, int, int)) + dlsym(dvdcss_library, U_S "dvdcss_read"); + DVDcss_error = (char* (*)(dvdcss_handle)) + dlsym(dvdcss_library, U_S "dvdcss_error"); + + dvdcss_version = (char **)dlsym(dvdcss_library, U_S "dvdcss_interface_2"); + + if(dlsym(dvdcss_library, U_S "dvdcss_crack")) { + if(verbose >= 0) { + fprintf(stderr, + "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n" + "libdvdread: You should get the latest version from " + "http://www.videolan.org/\n" ); + } + dlclose(dvdcss_library); + dvdcss_library = NULL; + } else if(!DVDcss_open || !DVDcss_close || !DVDcss_title || !DVDcss_seek + || !DVDcss_read || !DVDcss_error || !dvdcss_version) { + if(verbose >= 0) { + fprintf(stderr, "libdvdread: Missing symbols in libdvdcss.so.2, " + "this shouldn't happen !\n"); + } + dlclose(dvdcss_library); + dvdcss_library = NULL; + } + } +#endif /* HAVE_DVDCSS_DVDCSS_H */ + + dvdcss_library_init = 1; + + if(dvdcss_library) { + /* + char *psz_method = getenv( "DVDCSS_METHOD" ); + char *psz_verbose = getenv( "DVDCSS_VERBOSE" ); + fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method); + fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose); + */ + if(verbose >= 1) { + fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n", + *dvdcss_version); + } + /* libdvdcss wrapper functions */ + dvdinput_open = css_open; + dvdinput_close = css_close; + dvdinput_seek = css_seek; + dvdinput_title = css_title; + dvdinput_read = css_read; + dvdinput_error = css_error; + return 1; + + } else { + if(verbose >= 1) { + fprintf(stderr, "libdvdread: Encrypted DVD support unavailable.\n"); + } + /* libdvdcss replacement functions */ + dvdinput_open = file_open; + dvdinput_close = file_close; + dvdinput_seek = file_seek; + dvdinput_title = file_title; + dvdinput_read = file_read; + dvdinput_error = file_error; + return 0; + } +} diff --git a/dvdread/dvd_input.h b/dvdread/dvd_input.h new file mode 100644 index 0000000..bc9544d --- /dev/null +++ b/dvdread/dvd_input.h @@ -0,0 +1,55 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#ifndef DVD_INPUT_H_INCLUDED +#define DVD_INPUT_H_INCLUDED + +/* + * Copyright (C) 2001, 2002 Samuel Hocevar , + * Håkan Hjort + * + * 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 02111, USA. + */ + +/** + * Defines and flags. Make sure they fit the libdvdcss API! + */ +#define DVDINPUT_NOFLAGS 0 + +#define DVDINPUT_READ_DECRYPT (1 << 0) + +typedef struct dvd_input_s *dvd_input_t; + +/** + * Pointers which will be filled either the input methods functions. + */ +extern dvd_input_t (*dvdinput_open) (const char *); +extern int (*dvdinput_close) (dvd_input_t); +extern int (*dvdinput_seek) (dvd_input_t, int); +extern int (*dvdinput_title) (dvd_input_t, int); +extern int (*dvdinput_read) (dvd_input_t, void *, int, int); +extern char * (*dvdinput_error) (dvd_input_t); + +/** + * Free any objects allocated by dvdinput_setup. + * Should only be called when libdvdread is not to be used any more. + * Closes dlopened libraries. + */ +void dvdinput_free(void); + +/** + * Setup function accessed by dvd_reader.c. Returns 1 if there is CSS support. + */ +int dvdinput_setup(void); + +#endif /* DVD_INPUT_H_INCLUDED */ diff --git a/dvdread/dvd_reader.c b/dvdread/dvd_reader.c new file mode 100644 index 0000000..d1d9c97 --- /dev/null +++ b/dvdread/dvd_reader.c @@ -0,0 +1,1614 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2001, 2002, 2003 Billy Biggs , + * H�kan Hjort , + * Bj�rn Englund + * + * 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 02111, USA. + */ + +#include "config.h" + +#include +#include +#include /* For the timing of dvdcss_title crack. */ +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DARWIN__) || defined(__DragonFly__) +#define SYS_BSD 1 +#endif + +#if defined(__sun) +#include +#elif defined(SYS_BSD) +#include +#elif defined(__linux__) +#include +#endif + +#include "dvd_reader.h" +#include "dvd_input.h" +#include "dvd_udf.h" +#include "md5.h" + +#include "dvdread_internal.h" + +#define DEFAULT_UDF_CACHE_LEVEL 1 + +struct dvd_reader_s { + /* Basic information. */ + int isImageFile; + + /* Hack for keeping track of the css status. + * 0: no css, 1: perhaps (need init of keys), 2: have done init */ + int css_state; + int css_title; /* Last title that we have called dvdinpute_title for. */ + + /* Information required for an image file. */ + dvd_input_t dev; + + /* Information required for a directory path drive. */ + char *path_root; + + /* Filesystem cache */ + int udfcache_level; /* 0 - turned off, 1 - on */ + void *udfcache; + + /* block aligned malloc */ + void *align; + + /* error message verbosity level */ + int verbose; +}; + +struct dvd_file_s { + /* Basic information. */ + dvd_reader_t *dvd; + + /* Hack for selecting the right css title. */ + int css_title; + + /* Information required for an image file. */ + uint32_t lb_start; + uint32_t seek_pos; + + /* Information required for a directory path drive. */ + size_t title_sizes[ 9 ]; + dvd_input_t title_devs[ 9 ]; + + /* Calculated at open-time, size in blocks. */ + ssize_t filesize; +}; + + +#define DVDREAD_VERBOSE_DEFAULT 0 + +int get_verbose(void) +{ + char *dvdread_verbose; + int verbose; + + dvdread_verbose = getenv("DVDREAD_VERBOSE"); + if(dvdread_verbose) { + verbose = (int)strtol(dvdread_verbose, NULL, 0); + } else { + verbose = DVDREAD_VERBOSE_DEFAULT; + } + return verbose; +} + +int dvdread_verbose(dvd_reader_t *dvd) +{ + return dvd->verbose; +} + +dvd_reader_t *device_of_file(dvd_file_t *file) +{ + return file->dvd; +} + +/** + * Returns the compiled version. (DVDREAD_VERSION as an int) + */ +int DVDVersion(void) +{ + return DVDREAD_VERSION; +} + + +/** + * Set the level of caching on udf + * level = 0 (no caching) + * level = 1 (caching filesystem info) + */ +int DVDUDFCacheLevel(dvd_reader_t *device, int level) +{ + struct dvd_reader_s *dev = (struct dvd_reader_s *)device; + + if(level > 0) { + level = 1; + } else if(level < 0) { + return dev->udfcache_level; + } + + dev->udfcache_level = level; + + return level; +} + +void *GetUDFCacheHandle(dvd_reader_t *device) +{ + struct dvd_reader_s *dev = (struct dvd_reader_s *)device; + + return dev->udfcache; +} + +void SetUDFCacheHandle(dvd_reader_t *device, void *cache) +{ + struct dvd_reader_s *dev = (struct dvd_reader_s *)device; + + dev->udfcache = cache; +} + +void *GetAlignHandle(dvd_reader_t *device) +{ + struct dvd_reader_s *dev = (struct dvd_reader_s *)device; + + return dev->align; +} + +void SetAlignHandle(dvd_reader_t *device, void *align) +{ + struct dvd_reader_s *dev = (struct dvd_reader_s *)device; + + dev->align = align; +} + +#ifdef WIN32 /* replacement gettimeofday implementation */ +#include +static int gettimeofday( struct timeval *tv, void *tz ) +{ + struct timeb t; + ftime( &t ); + tv->tv_sec = t.time; + tv->tv_usec = t.millitm * 1000; + return 0; +} +#endif + + +/* Loop over all titles and call dvdcss_title to crack the keys. */ +static int initAllCSSKeys( dvd_reader_t *dvd ) +{ + struct timeval all_s, all_e; + struct timeval t_s, t_e; + char filename[ MAX_UDF_FILE_NAME_LEN ]; + uint32_t start, len; + int title; + + char *nokeys_str = getenv("DVDREAD_NOKEYS"); + if(nokeys_str != NULL) + return 0; + + if(dvd->verbose >= 1) { + fprintf( stderr, "\n" ); + fprintf( stderr, "libdvdread: Attempting to retrieve all CSS keys\n" ); + fprintf( stderr, "libdvdread: This can take a _long_ time, " + "please be patient\n\n" ); + } + gettimeofday(&all_s, NULL); + + for( title = 0; title < 100; title++ ) { + gettimeofday( &t_s, NULL ); + if( title == 0 ) { + sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" ); + } else { + sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, 0 ); + } + start = UDFFindFile( dvd, filename, &len ); + if( start != 0 && len != 0 ) { + /* Perform CSS key cracking for this title. */ + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Get key for %s at 0x%08x\n", + filename, start ); + } + if( dvdinput_title( dvd->dev, (int)start ) < 0 ) { + if(dvd->verbose >= 0) { + fprintf( stderr, "libdvdread: Error cracking CSS key for %s (0x%08x)\n", filename, start); + } + } + gettimeofday( &t_e, NULL ); + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Elapsed time %ld\n", + (long int) t_e.tv_sec - t_s.tv_sec ); + } + } + + if( title == 0 ) continue; + + gettimeofday( &t_s, NULL ); + sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, 1 ); + start = UDFFindFile( dvd, filename, &len ); + if( start == 0 || len == 0 ) break; + + /* Perform CSS key cracking for this title. */ + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Get key for %s at 0x%08x\n", + filename, start ); + } + if( dvdinput_title( dvd->dev, (int)start ) < 0 ) { + if(dvd->verbose >= 0) { + fprintf( stderr, "libdvdread: Error cracking CSS key for %s (0x%08x)!!\n", filename, start); + } + } + gettimeofday( &t_e, NULL ); + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Elapsed time %ld\n", + (long int) t_e.tv_sec - t_s.tv_sec ); + } + } + title--; + + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Found %d VTS's\n", title ); + } + gettimeofday(&all_e, NULL); + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Elapsed time %ld\n", + (long int) all_e.tv_sec - all_s.tv_sec ); + } + return 0; +} + + + +/** + * Open a DVD image or block device file. + * Checks if the root directory in the udf image file can be found. + * If not it assumes this isn't a valid udf image and returns NULL + */ +static dvd_reader_t *DVDOpenImageFile( const char *location, int have_css ) +{ + dvd_reader_t *dvd; + dvd_input_t dev; + int verbose; + + verbose = get_verbose(); + + dev = dvdinput_open( location ); + if( !dev ) { + if(verbose >= 1) { + fprintf( stderr, "libdvdread: Can't open '%s' for reading: %s\n", + location, strerror(errno)); + } + return NULL; + } + + dvd = (dvd_reader_t *) malloc( sizeof( dvd_reader_t ) ); + if( !dvd ) { + int tmp_errno = errno; + dvdinput_close(dev); + errno = tmp_errno; + return NULL; + } + dvd->verbose = verbose; + dvd->isImageFile = 1; + dvd->dev = dev; + dvd->path_root = NULL; + + dvd->udfcache_level = DEFAULT_UDF_CACHE_LEVEL; + dvd->udfcache = NULL; + + dvd->align = NULL; + + if( have_css ) { + /* Only if DVDCSS_METHOD = title, a bit if it's disc or if + * DVDCSS_METHOD = key but region missmatch. Unfortunaly we + * don't have that information. */ + + dvd->css_state = 1; /* Need key init. */ + } + dvd->css_title = 0; + + /* sanity check, is it a valid UDF image, can we find the root dir */ + if(!UDFFindFile(dvd, "/", NULL)) { + dvdinput_close(dvd->dev); + if(dvd->udfcache) { + FreeUDFCache(dvd, dvd->udfcache); + } + if(dvd->align) { + if(dvd->verbose >= 0) { + fprintf(stderr, "libdvdread: DVDOpenImageFile(): Memory leak in align functions 1\n"); + } + } + free(dvd); + return NULL; + } + return dvd; +} + +static dvd_reader_t *DVDOpenPath( const char *path_root ) +{ + dvd_reader_t *dvd; + + dvd = (dvd_reader_t *) malloc( sizeof( dvd_reader_t ) ); + if( !dvd ) { + return NULL; + } + dvd->verbose = get_verbose(); + dvd->isImageFile = 0; + dvd->dev = 0; + dvd->path_root = strdup( path_root ); + if(!dvd->path_root) { + free(dvd); + return 0; + } + dvd->udfcache_level = DEFAULT_UDF_CACHE_LEVEL; + dvd->udfcache = NULL; + + dvd->align = NULL; + + dvd->css_state = 0; /* Only used in the UDF path */ + dvd->css_title = 0; /* Only matters in the UDF path */ + + return dvd; +} + +#if defined(__sun) +/* /dev/rdsk/c0t6d0s0 (link to /devices/...) + /vol/dev/rdsk/c0t6d0/?? + /vol/rdsk/ */ +static char *sun_block2char( const char *path ) +{ + char *new_path; + + /* Must contain "/dsk/" */ + if( !strstr( path, "/dsk/" ) ) return (char *) strdup( path ); + + /* Replace "/dsk/" with "/rdsk/" */ + new_path = malloc( strlen(path) + 2 ); + strcpy( new_path, path ); + strcpy( strstr( new_path, "/dsk/" ), "" ); + strcat( new_path, "/rdsk/" ); + strcat( new_path, strstr( path, "/dsk/" ) + strlen( "/dsk/" ) ); + + return new_path; +} +#endif + +#if defined(SYS_BSD) +/* FreeBSD /dev/(r)(a)cd0c (a is for atapi), recomended to _not_ use r + update: FreeBSD and DragonFly no longer uses the prefix so don't add it. + + OpenBSD /dev/rcd0c, it needs to be the raw device + NetBSD /dev/rcd0[d|c|..] d for x86, c (for non x86), perhaps others + Darwin /dev/rdisk0, it needs to be the raw device + BSD/OS /dev/sr0c (if not mounted) or /dev/rsr0c ('c' any letter will do) + + returns a string allocated with strdup which should be free()'d when + no longer used. +*/ +static char *bsd_block2char( const char *path ) +{ +#if defined(__FreeBSD__) || defined(__DragonFly__) + return (char *) strdup( path ); +#else + char *new_path; + + /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */ + if( strncmp( path, "/dev/", 5 ) || !strncmp( path, "/dev/r", 6 ) ) + return (char *) strdup( path ); + + /* Replace "/dev/" with "/dev/r" */ + new_path = malloc( strlen(path) + 2 ); + strcpy( new_path, "/dev/r" ); + strcat( new_path, path + strlen( "/dev/" ) ); + + return new_path; +#endif /* __FreeBSD__ || __DragonFly__ */ +} +#endif + + +dvd_reader_t *DVDOpen( const char *path ) +{ + struct stat fileinfo; + int ret, have_css; + char *dev_name = NULL; + int internal_errno = 0; + int verbose; + + if( path == NULL ) { + errno = EINVAL; + return NULL; + } + + verbose = get_verbose(); + +#ifdef WIN32 + /* Stat doesn't work on devices under mingwin/cygwin. */ + if( path[0] && path[1] == ':' && path[2] == '\0' ) + { + /* Don't try to stat the file */ + fileinfo.st_mode = S_IFBLK; + } + else +#endif + { + ret = stat( path, &fileinfo ); + if( ret < 0 ) { + int tmp_errno = errno; + /* If we can't stat the file, give up */ + if(verbose >= 1) { + fprintf( stderr, "libdvdread: Can't stat '%s': %s\n", + path, strerror(errno)); + } + errno = tmp_errno; + return NULL; + } + } + + /* Try to open libdvdcss or fall back to standard functions */ + have_css = dvdinput_setup(); + + /* First check if this is a block/char device or a file*/ + if( S_ISBLK( fileinfo.st_mode ) || + S_ISCHR( fileinfo.st_mode ) || + S_ISREG( fileinfo.st_mode ) ) { + /** + * Block devices and regular files are assumed to be DVD-Video images. + */ + dvd_reader_t *dvd = NULL; +#if defined(__sun) + dev_name = sun_block2char( path ); +#elif defined(SYS_BSD) + dev_name = bsd_block2char( path ); +#else + dev_name = strdup( path ); +#endif + dvd = DVDOpenImageFile( dev_name, have_css ); + free( dev_name ); + + return dvd; + } else if( S_ISDIR( fileinfo.st_mode ) ) { + dvd_reader_t *auth_drive = 0; + char *path_copy; +#if defined(SYS_BSD) + struct fstab* fe; +#elif defined(__sun) || defined(__linux__) + FILE *mntfile; +#endif + + /* XXX: We should scream real loud here. */ + if( !(path_copy = strdup( path ) ) ) return 0; + +#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */ + /* Resolve any symlinks and get the absolut dir name. */ + { + char *new_path; + char *current_path; + + current_path = malloc(PATH_MAX); + if(current_path) { + if(!getcwd(current_path, PATH_MAX)) { + free(current_path); + current_path = NULL; + } + } + if(current_path) { + chdir( path_copy ); + new_path = malloc(PATH_MAX); + if(new_path) { + if(!getcwd(new_path, PATH_MAX )) { + free(new_path); + new_path = NULL; + } + } + + chdir(current_path); + free(current_path); + if( new_path ) { + free( path_copy ); + path_copy = new_path; + } + } + } +#endif + + /** + * If we're being asked to open a directory, check if that directory + * is the mountpoint for a DVD-ROM which we can use instead. + */ + + if( strlen( path_copy ) > 1 ) { + if( path_copy[ strlen( path_copy ) - 1 ] == '/' ) { + path_copy[ strlen( path_copy ) - 1 ] = '\0'; + } + } + + if( strlen( path_copy ) >= 9 ) { + if( !strcasecmp( &(path_copy[ strlen( path_copy ) - 9 ]), + "/video_ts" ) ) { + path_copy[ strlen( path_copy ) - 9 ] = '\0'; + if(path_copy[0] == '\0') { + path_copy[0] = '/'; + path_copy[1] = '\0'; + } + } + } + +#if defined(SYS_BSD) + if( ( fe = getfsfile( path_copy ) ) ) { + dev_name = bsd_block2char( fe->fs_spec ); + if(verbose >= 1) { + fprintf( stderr, + "libdvdread: Attempting to use device %s" + " mounted on %s%s\n", + dev_name, + fe->fs_file, + have_css ? " for CSS authentication" : ""); + } + auth_drive = DVDOpenImageFile( dev_name, have_css ); + if(!auth_drive) { + internal_errno = errno; + } + } +#elif defined(__sun) + mntfile = fopen( MNTTAB, "r" ); + if( mntfile ) { + struct mnttab mp; + int res; + + while( ( res = getmntent( mntfile, &mp ) ) != -1 ) { + if( res == 0 && !strcmp( mp.mnt_mountp, path_copy ) ) { + dev_name = sun_block2char( mp.mnt_special ); + if(verbose >= 1) { + fprintf( stderr, + "libdvdread: Attempting to use device %s" + " mounted on %s%s\n", + dev_name, + mp.mnt_mountp, + have_css ? " for CSS authentication" : ""); + } + auth_drive = DVDOpenImageFile( dev_name, have_css ); + if(!auth_drive) { + internal_errno = errno; + } + break; + } + } + fclose( mntfile ); + } +#elif defined(__linux__) + mntfile = fopen( MOUNTED, "r" ); + if( mntfile ) { + struct mntent *me; + + while( ( me = getmntent( mntfile ) ) ) { + if( !strcmp( me->mnt_dir, path_copy ) ) { + if(verbose >= 1) { + fprintf( stderr, + "libdvdread: Attempting to use device %s" + " mounted on %s%s\n", + me->mnt_fsname, + me->mnt_dir, + have_css ? " for CSS authentication" : ""); + } + auth_drive = DVDOpenImageFile( me->mnt_fsname, have_css ); + if(!auth_drive) { + internal_errno = errno; + } + dev_name = strdup(me->mnt_fsname); + break; + } + } + fclose( mntfile ); + } +#endif + if( !dev_name ) { + if(verbose >= 1) { + fprintf( stderr, "libdvdread: Couldn't find device name.\n" ); + } + } else if( !auth_drive ) { + if(verbose >= 1) { + fprintf( stderr, "libdvdread: Device %s inaccessible%s: %s\n", + dev_name, + have_css ? ", CSS authentication not available" : "", + strerror(internal_errno)); + } + } + + free( dev_name ); + free( path_copy ); + + /** + * If we've opened a drive, just use that. + */ + if( auth_drive ) { + return auth_drive; + } + /** + * Otherwise, we now try to open the directory tree instead. + */ + return DVDOpenPath( path ); + } + + /* If it's none of the above, screw it. */ + if(verbose >= 1) { + fprintf( stderr, "libdvdread: Could not open %s\n", path ); + } + return 0; +} + +void DVDClose( dvd_reader_t *dvd ) +{ + if( dvd ) { + if( dvd->dev ) dvdinput_close( dvd->dev ); + if( dvd->path_root ) free( dvd->path_root ); + if( dvd->udfcache ) FreeUDFCache( dvd, dvd->udfcache ); + if(dvd->align) { + if(dvd->verbose >= 0) { + fprintf(stderr, "libdvdread: DVDClose(): Memory leak in align functions\n"); + } + } + + free( dvd ); + } +} + +void DVDInit(void) +{ + dvdinput_setup(); +} + +void DVDFinish(void) +{ + dvdinput_free(); +} + +/** + * Open an unencrypted file on a DVD image file. + */ +static dvd_file_t *DVDOpenFileUDF( dvd_reader_t *dvd, char *filename ) +{ + uint32_t start, len; + dvd_file_t *dvd_file; + + start = UDFFindFile( dvd, filename, &len ); + if( !start ) return 0; + + dvd_file = (dvd_file_t *) malloc( sizeof( dvd_file_t ) ); + if( !dvd_file ) return 0; + dvd_file->dvd = dvd; + dvd_file->lb_start = start; + dvd_file->seek_pos = 0; + memset( dvd_file->title_sizes, 0, sizeof( dvd_file->title_sizes ) ); + memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) ); + dvd_file->filesize = len / DVD_VIDEO_LB_LEN; + + return dvd_file; +} + +/** + * Searches for in directory , ignoring case. + * Returns 0 and full filename in . + * or -1 on file not found. + * or -2 on path not found. + */ +static int findDirFile( const char *path, const char *file, char *filename ) +{ + DIR *dir; + struct dirent *ent; + + dir = opendir( path ); + if( !dir ) return -2; + + while( ( ent = readdir( dir ) ) != NULL ) { + if( !strcasecmp( ent->d_name, file ) ) { + sprintf( filename, "%s%s%s", path, + ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ), + ent->d_name ); + closedir(dir); + return 0; + } + } + closedir(dir); + return -1; +} + +static int findDVDFile( dvd_reader_t *dvd, const char *file, char *filename ) +{ + char video_path[ PATH_MAX + 1 ]; + const char *nodirfile; + int ret; + + /* Strip off the directory for our search */ + if( !strncasecmp( "/VIDEO_TS/", file, 10 ) ) { + nodirfile = &(file[ 10 ]); + } else { + nodirfile = file; + } + + ret = findDirFile( dvd->path_root, nodirfile, filename ); + if( ret < 0 ) { + /* Try also with adding the path, just in case. */ + sprintf( video_path, "%s/VIDEO_TS/", dvd->path_root ); + ret = findDirFile( video_path, nodirfile, filename ); + if( ret < 0 ) { + /* Try with the path, but in lower case. */ + sprintf( video_path, "%s/video_ts/", dvd->path_root ); + ret = findDirFile( video_path, nodirfile, filename ); + if( ret < 0 ) { + return 0; + } + } + } + + return 1; +} + +/** + * Open an unencrypted file from a DVD directory tree. + */ +static dvd_file_t *DVDOpenFilePath( dvd_reader_t *dvd, char *filename ) +{ + char full_path[ PATH_MAX + 1 ]; + dvd_file_t *dvd_file; + struct stat fileinfo; + dvd_input_t dev; + + /* Get the full path of the file. */ + if( !findDVDFile( dvd, filename, full_path ) ) return 0; + + dev = dvdinput_open( full_path ); + if( !dev ) return 0; + + dvd_file = (dvd_file_t *) malloc( sizeof( dvd_file_t ) ); + if( !dvd_file ) return 0; + dvd_file->dvd = dvd; + dvd_file->lb_start = 0; + dvd_file->seek_pos = 0; + memset( dvd_file->title_sizes, 0, sizeof( dvd_file->title_sizes ) ); + memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) ); + dvd_file->filesize = 0; + + if( stat( full_path, &fileinfo ) < 0 ) { + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); + } + free( dvd_file ); + return 0; + } + dvd_file->title_sizes[ 0 ] = fileinfo.st_size / DVD_VIDEO_LB_LEN; + dvd_file->title_devs[ 0 ] = dev; + dvd_file->filesize = dvd_file->title_sizes[ 0 ]; + + return dvd_file; +} + +static dvd_file_t *DVDOpenVOBUDF( dvd_reader_t *dvd, int title, int menu ) +{ + char filename[ MAX_UDF_FILE_NAME_LEN ]; + uint32_t start, len; + dvd_file_t *dvd_file; + + if( title == 0 ) { + sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" ); + } else { + sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 ); + } + start = UDFFindFile( dvd, filename, &len ); + if( start == 0 ) return 0; + + dvd_file = (dvd_file_t *) malloc( sizeof( dvd_file_t ) ); + if( !dvd_file ) return 0; + dvd_file->dvd = dvd; + /*Hack*/ dvd_file->css_title = title << 1 | menu; + dvd_file->lb_start = start; + dvd_file->seek_pos = 0; + memset( dvd_file->title_sizes, 0, sizeof( dvd_file->title_sizes ) ); + memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) ); + dvd_file->filesize = len / DVD_VIDEO_LB_LEN; + + /* Calculate the complete file size for every file in the VOBS */ + if( !menu ) { + int cur; + + for( cur = 2; cur < 10; cur++ ) { + sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur ); + if( !UDFFindFile( dvd, filename, &len ) ) break; + dvd_file->filesize += len / DVD_VIDEO_LB_LEN; + } + } + + if( dvd->css_state == 1 /* Need key init */ ) { + initAllCSSKeys( dvd ); + dvd->css_state = 2; + } + /* + if( dvdinput_title( dvd_file->dvd->dev, (int)start ) < 0 ) { + fprintf( stderr, "libdvdread: Error cracking CSS key for %s\n", + filename ); + } + */ + + return dvd_file; +} + +static dvd_file_t *DVDOpenVOBPath( dvd_reader_t *dvd, int title, int menu ) +{ + char filename[ MAX_UDF_FILE_NAME_LEN ]; + char full_path[ PATH_MAX + 1 ]; + struct stat fileinfo; + dvd_file_t *dvd_file; + int i; + + dvd_file = (dvd_file_t *) malloc( sizeof( dvd_file_t ) ); + if( !dvd_file ) return 0; + dvd_file->dvd = dvd; + /*Hack*/ dvd_file->css_title = title << 1 | menu; + dvd_file->lb_start = 0; + dvd_file->seek_pos = 0; + memset( dvd_file->title_sizes, 0, sizeof( dvd_file->title_sizes ) ); + memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) ); + dvd_file->filesize = 0; + + if( menu ) { + dvd_input_t dev; + + if( title == 0 ) { + sprintf( filename, "VIDEO_TS.VOB" ); + } else { + sprintf( filename, "VTS_%02i_0.VOB", title ); + } + if( !findDVDFile( dvd, filename, full_path ) ) { + free( dvd_file ); + return 0; + } + + dev = dvdinput_open( full_path ); + if( dev == NULL ) { + free( dvd_file ); + return 0; + } + + if( stat( full_path, &fileinfo ) < 0 ) { + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); + } + free( dvd_file ); + return 0; + } + dvd_file->title_sizes[ 0 ] = fileinfo.st_size / DVD_VIDEO_LB_LEN; + dvd_file->title_devs[ 0 ] = dev; + dvdinput_title( dvd_file->title_devs[0], 0); + dvd_file->filesize = dvd_file->title_sizes[ 0 ]; + + } else { + for( i = 0; i < 9; ++i ) { + + sprintf( filename, "VTS_%02i_%i.VOB", title, i + 1 ); + if( !findDVDFile( dvd, filename, full_path ) ) { + break; + } + + if( stat( full_path, &fileinfo ) < 0 ) { + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); + } + break; + } + + dvd_file->title_sizes[ i ] = fileinfo.st_size / DVD_VIDEO_LB_LEN; + dvd_file->title_devs[ i ] = dvdinput_open( full_path ); + dvdinput_title( dvd_file->title_devs[ i ], 0 ); + dvd_file->filesize += dvd_file->title_sizes[ i ]; + } + if( !dvd_file->title_devs[ 0 ] ) { + free( dvd_file ); + return 0; + } + } + + return dvd_file; +} + +dvd_file_t *DVDOpenFile( dvd_reader_t *dvd, int titlenum, + dvd_read_domain_t domain ) +{ + char filename[ MAX_UDF_FILE_NAME_LEN ]; + + /* Check arguments. */ + if( dvd == NULL || titlenum < 0 ) { + errno = EINVAL; + return NULL; + } + + switch( domain ) { + case DVD_READ_INFO_FILE: + if( titlenum == 0 ) { + sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" ); + } else { + sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum ); + } + break; + case DVD_READ_INFO_BACKUP_FILE: + if( titlenum == 0 ) { + sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" ); + } else { + sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum ); + } + break; + case DVD_READ_MENU_VOBS: + if( dvd->isImageFile ) { + return DVDOpenVOBUDF( dvd, titlenum, 1 ); + } else { + return DVDOpenVOBPath( dvd, titlenum, 1 ); + } + break; + case DVD_READ_TITLE_VOBS: + if( titlenum == 0 ) return 0; + if( dvd->isImageFile ) { + return DVDOpenVOBUDF( dvd, titlenum, 0 ); + } else { + return DVDOpenVOBPath( dvd, titlenum, 0 ); + } + break; + default: + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Invalid domain for file open.\n" ); + } + errno = EINVAL; + return NULL; + } + + if( dvd->isImageFile ) { + return DVDOpenFileUDF( dvd, filename ); + } else { + return DVDOpenFilePath( dvd, filename ); + } +} + +void DVDCloseFile( dvd_file_t *dvd_file ) +{ + int i; + + if( dvd_file ) { + if( dvd_file->dvd->isImageFile ) { + ; + } else { + for( i = 0; i < 9; ++i ) { + if( dvd_file->title_devs[ i ] ) { + dvdinput_close( dvd_file->title_devs[i] ); + } + } + } + + free( dvd_file ); + dvd_file = 0; + } +} + +static int DVDFileStatVOBUDF(dvd_reader_t *dvd, int title, + int menu, dvd_stat_t *statbuf) +{ + char filename[ MAX_UDF_FILE_NAME_LEN ]; + uint32_t size; + off_t tot_size; + off_t parts_size[9]; + int nr_parts = 0; + int n; + + if( title == 0 ) { + sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" ); + } else { + sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 ); + } + if(!UDFFindFile( dvd, filename, &size )) { + return -1; + } + tot_size = size; + nr_parts = 1; + parts_size[0] = size; + + if( !menu ) { + int cur; + + for( cur = 2; cur < 10; cur++ ) { + sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur ); + if( !UDFFindFile( dvd, filename, &size ) ) { + break; + } + parts_size[nr_parts] = size; + tot_size += size; + nr_parts++; + } + } + + statbuf->size = tot_size; + statbuf->nr_parts = nr_parts; + for(n = 0; n < nr_parts; n++) { + statbuf->parts_size[n] = parts_size[n]; + } + return 0; +} + + +static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title, + int menu, dvd_stat_t *statbuf ) +{ + char filename[ MAX_UDF_FILE_NAME_LEN ]; + char full_path[ PATH_MAX + 1 ]; + struct stat fileinfo; + off_t tot_size; + off_t parts_size[9]; + int nr_parts = 0; + int n; + + + + if( title == 0 ) { + sprintf( filename, "VIDEO_TS.VOB" ); + } else { + sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 ); + } + if( !findDVDFile( dvd, filename, full_path ) ) { + return -1; + } + + if( stat( full_path, &fileinfo ) < 0 ) { + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); + } + return -1; + } + + + tot_size = fileinfo.st_size; + nr_parts = 1; + parts_size[0] = fileinfo.st_size; + + if( !menu ) { + int cur; + + for( cur = 2; cur < 10; cur++ ) { + + sprintf( filename, "VTS_%02d_%d.VOB", title, cur ); + if( !findDVDFile( dvd, filename, full_path ) ) { + break; + } + + if( stat( full_path, &fileinfo ) < 0 ) { + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); + } + break; + } + + parts_size[nr_parts] = fileinfo.st_size; + tot_size += parts_size[nr_parts]; + nr_parts++; + } + } + + statbuf->size = tot_size; + statbuf->nr_parts = nr_parts; + for(n = 0; n < nr_parts; n++) { + statbuf->parts_size[n] = parts_size[n]; + } + return 0; +} + + +int DVDFileStat(dvd_reader_t *dvd, int titlenum, + dvd_read_domain_t domain, dvd_stat_t *statbuf) +{ + char filename[ MAX_UDF_FILE_NAME_LEN ]; + char full_path[ PATH_MAX + 1 ]; + struct stat fileinfo; + uint32_t size; + + /* Check arguments. */ + if( dvd == NULL || titlenum < 0 ) { + errno = EINVAL; + return -1; + } + + switch( domain ) { + case DVD_READ_INFO_FILE: + if( titlenum == 0 ) { + sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" ); + } else { + sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum ); + } + break; + case DVD_READ_INFO_BACKUP_FILE: + if( titlenum == 0 ) { + sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" ); + } else { + sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum ); + } + break; + case DVD_READ_MENU_VOBS: + if( dvd->isImageFile ) { + return DVDFileStatVOBUDF( dvd, titlenum, 1, statbuf ); + } else { + return DVDFileStatVOBPath( dvd, titlenum, 1, statbuf ); + } + break; + case DVD_READ_TITLE_VOBS: + if( titlenum == 0 ) { + return -1; + } + if( dvd->isImageFile ) { + return DVDFileStatVOBUDF( dvd, titlenum, 0, statbuf ); + } else { + return DVDFileStatVOBPath( dvd, titlenum, 0, statbuf ); + } + break; + default: + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Invalid domain for file stat.\n" ); + } + errno = EINVAL; + return -1; + } + + if( dvd->isImageFile ) { + if( UDFFindFile( dvd, filename, &size ) ) { + statbuf->size = size; + statbuf->nr_parts = 1; + statbuf->parts_size[0] = size; + return 0; + } + } else { + if( findDVDFile( dvd, filename, full_path ) ) { + if( stat( full_path, &fileinfo ) < 0 ) { + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); + } + } else { + statbuf->size = fileinfo.st_size; + statbuf->nr_parts = 1; + statbuf->parts_size[0] = statbuf->size; + return 0; + } + } + } + return -1; +} + +/** + * Internal, but used from dvd_udf.c + * + * @param device A read handle. + * @param lb_number Logical block number to start read from. + * @param block_count Number of logical blocks to read. + * @param data Pointer to buffer where read data should be stored. + * This buffer must be large enough to hold lb_number*2048 bytes. + * The pointer must be aligned to the logical block size when + * reading from a raw/O_DIRECT device. + * @param encrypted 0 if no decryption shall be performed, + * 1 if decryption shall be performed + * @param return Returns number of blocks read on success, negative on error + */ +int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number, + size_t block_count, unsigned char *data, + int encrypted ) +{ + int ret; + + if( !device->dev ) { + if(device->verbose >= 1) { + fprintf( stderr, "libdvdread: Fatal error in block read.\n" ); + } + return 0; + } + + ret = dvdinput_seek( device->dev, (int) lb_number ); + if( ret != (int) lb_number ) { + if(device->verbose >= 1) { + fprintf( stderr, + "libdvdread: UDFReadBlocksRaw: Can't seek to block %u\n", + lb_number ); + } + return 0; + } + + return dvdinput_read( device->dev, (char *) data, + (int) block_count, encrypted ); +} + +/** + * This is using a single input and starting from 'dvd_file->lb_start' offset. + * + * Reads 'block_count' blocks from 'dvd_file' at block offset 'offset' + * into the buffer located at 'data' and if 'encrypted' is set + * descramble the data if it's encrypted. Returning either an + * negative error or the number of blocks read. + * + * @param data Pointer to buffer where read data should be placed. + * This buffer must be large enough to hold block_count*2048 bytes. + * The pointer must be aligned to 2048 bytes when reading from + * a raw/O_DIRECT device. + * @return Returns the number of blocks read on success or a negative error. + */ +static int DVDReadBlocksUDF( dvd_file_t *dvd_file, uint32_t offset, + size_t block_count, unsigned char *data, + int encrypted ) +{ + return UDFReadBlocksRaw( dvd_file->dvd, dvd_file->lb_start + offset, + block_count, data, encrypted ); +} + +/** + * This is using possibly several inputs and starting from an offset of '0'. + * data must be aligned to logical block size (2048 bytes) of the device + * for raw/O_DIRECT devices to work + * Reads 'block_count' blocks from 'dvd_file' at block offset 'offset' + * into the buffer located at 'data' and if 'encrypted' is set + * descramble the data if it's encrypted. Returning either an + * negative error or the number of blocks read. + * + * @param dvd_file A file read handle. + * @param offset Block offset from start of file. + * @return Returns number of blocks read on success, negative on error. + */ +static int DVDReadBlocksPath( dvd_file_t *dvd_file, unsigned int offset, + size_t block_count, unsigned char *data, + int encrypted ) +{ + int i; + int ret, ret2, off; + + ret = 0; + ret2 = 0; + for( i = 0; i < 9; ++i ) { + if( !dvd_file->title_sizes[ i ] ) return 0; /* Past end of file */ + + if( offset < dvd_file->title_sizes[ i ] ) { + if( ( offset + block_count ) <= dvd_file->title_sizes[ i ] ) { + off = dvdinput_seek( dvd_file->title_devs[ i ], (int)offset ); + if( off < 0 || off != (int)offset ) { + if(dvd_file->dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: DVDReadBlocksPath1: Can't seek to block %d\n", + offset ); + } + return off < 0 ? off : 0; + } + ret = dvdinput_read( dvd_file->title_devs[ i ], data, + (int)block_count, encrypted ); + break; + } else { + size_t part1_size = dvd_file->title_sizes[ i ] - offset; + /* FIXME: Really needs to be a while loop. + * (This is only true if you try and read >1GB at a time) */ + + /* Read part 1 */ + off = dvdinput_seek( dvd_file->title_devs[ i ], (int)offset ); + if( off < 0 || off != (int)offset ) { + if(dvd_file->dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: DVDReadBlocksPath2: Can't seek to block %d\n", + offset ); + } + return off < 0 ? off : 0; + } + ret = dvdinput_read( dvd_file->title_devs[ i ], data, + (int)part1_size, encrypted ); + if( ret < 0 ) return ret; + /* FIXME: This is wrong if i is the last file in the set. + * also error from this read will not show in ret. */ + + /* Does the next part exist? If not then return now. */ + if( !dvd_file->title_devs[ i + 1 ] ) return ret; + + /* Read part 2 */ + off = dvdinput_seek( dvd_file->title_devs[ i + 1 ], 0 ); + if( off < 0 || off != 0 ) { + if(dvd_file->dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: DVDReadBlocksPath3: Can't seek to block %d\n", 0 ); + } + return off < 0 ? off : 0; + } + ret2 = dvdinput_read( dvd_file->title_devs[ i + 1 ], + data + ( part1_size + * (int64_t)DVD_VIDEO_LB_LEN ), + (int)(block_count - part1_size), + encrypted ); + if( ret2 < 0 ) return ret2; + break; + } + } else { + offset -= dvd_file->title_sizes[ i ]; + } + } + + return ret + ret2; +} + +/** + * This is broken reading more than 2Gb at a time if ssize_t is 32-bit. + */ +ssize_t DVDReadBlocks( dvd_file_t *dvd_file, int offset, + size_t block_count, unsigned char *data ) +{ + int ret; + + /* Check arguments. */ + if( dvd_file == NULL || offset < 0 || data == NULL ) + return -1; + + /* Hack, and it will still fail for multiple opens in a threaded app ! */ + if( dvd_file->dvd->css_title != dvd_file->css_title ) { + dvd_file->dvd->css_title = dvd_file->css_title; + if( dvd_file->dvd->isImageFile ) { + dvdinput_title( dvd_file->dvd->dev, (int)dvd_file->lb_start ); + } + /* Here each vobu has it's own dvdcss handle, so no need to update + else { + dvdinput_title( dvd_file->title_devs[ 0 ], (int)dvd_file->lb_start ); + }*/ + } + + if( dvd_file->dvd->isImageFile ) { + ret = DVDReadBlocksUDF( dvd_file, (uint32_t)offset, + block_count, data, DVDINPUT_READ_DECRYPT ); + } else { + ret = DVDReadBlocksPath( dvd_file, (unsigned int)offset, + block_count, data, DVDINPUT_READ_DECRYPT ); + } + + return (ssize_t)ret; +} + +int DVDFileSeek( dvd_file_t *dvd_file, int offset ) +{ + /* Check arguments. */ + if( dvd_file == NULL || offset < 0 ) + return -1; + + if( offset > dvd_file->filesize * DVD_VIDEO_LB_LEN ) { + return -1; + } + dvd_file->seek_pos = (uint32_t) offset; + return offset; +} + +#ifndef HAVE_UINTPTR_T +#warning "Assuming that (unsigned long) can hold (void *)" +/*typedef unsigned long uintptr_t;*/ +#endif + +#define DVD_ALIGN(ptr) (void *)((((uintptr_t)(ptr)) + (DVD_VIDEO_LB_LEN-1)) \ + / DVD_VIDEO_LB_LEN * DVD_VIDEO_LB_LEN) + +ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size ) +{ + unsigned char *secbuf_start; + unsigned char *secbuf; /*must be aligned to 2048-bytes for raw/O_DIRECT*/ + unsigned int numsec, seek_sector, seek_byte; + int ret; + + /* Check arguments. */ + if( dvd_file == NULL || data == NULL ) { + errno = EINVAL; + return -1; + } + seek_sector = dvd_file->seek_pos / DVD_VIDEO_LB_LEN; + seek_byte = dvd_file->seek_pos % DVD_VIDEO_LB_LEN; + + numsec = ( ( seek_byte + byte_size ) / DVD_VIDEO_LB_LEN ) + + ( ( ( seek_byte + byte_size ) % DVD_VIDEO_LB_LEN ) ? 1 : 0 ); + + /* must align to 2048 bytes if we are reading from raw/O_DIRECT */ + secbuf_start = (unsigned char *) malloc( (numsec+1) * DVD_VIDEO_LB_LEN ); + if( !secbuf_start ) { + /* errno will be set to ENOMEM by malloc */ + return -1; + } + + secbuf = DVD_ALIGN(secbuf_start); + + if( dvd_file->dvd->isImageFile ) { + ret = DVDReadBlocksUDF( dvd_file, (uint32_t) seek_sector, + (size_t) numsec, secbuf, DVDINPUT_NOFLAGS ); + } else { + ret = DVDReadBlocksPath( dvd_file, seek_sector, + (size_t) numsec, secbuf, DVDINPUT_NOFLAGS ); + } + + if( ret != (int) numsec ) { + free( secbuf_start ); + return ret < 0 ? ret : 0; + } + + memcpy( data, &(secbuf[ seek_byte ]), byte_size ); + free( secbuf_start ); + + dvd_file->seek_pos += byte_size; + return byte_size; +} + +ssize_t DVDFileSize( dvd_file_t *dvd_file ) +{ + /* Check arguments. */ + if( dvd_file == NULL ) + return -1; + + return dvd_file->filesize; +} + +int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid ) +{ + struct md5_ctx ctx; + int title; + int nr_of_files = 0; + int tmp_errno; + int nofiles_errno = ENOENT; + /* Check arguments. */ + if( dvd == NULL || discid == NULL ) { + errno = EINVAL; + return -1; + } + /* Go through the first 10 IFO:s, in order, + * and md5sum them, i.e VIDEO_TS.IFO and VTS_0?_0.IFO */ + md5_init_ctx( &ctx ); + for( title = 0; title < 10; title++ ) { + dvd_file_t *dvd_file = DVDOpenFile( dvd, title, DVD_READ_INFO_FILE ); + if( dvd_file != NULL ) { + ssize_t bytes_read; + size_t file_size = dvd_file->filesize * DVD_VIDEO_LB_LEN; + char *buffer = malloc( file_size ); + + nr_of_files++; + + if( buffer == NULL ) { + /* errno will be set to ENOMEM by malloc */ + return -1; + } + + bytes_read = DVDReadBytes( dvd_file, buffer, file_size ); + if( bytes_read != file_size ) { + tmp_errno = errno; + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: DVDDiscId read returned %d bytes" + ", wanted %d\n", (int)bytes_read, (int)file_size ); + } + free(buffer); + DVDCloseFile( dvd_file ); + errno = tmp_errno; + return -1; + } + + md5_process_bytes( buffer, file_size, &ctx ); + + DVDCloseFile( dvd_file ); + free( buffer ); + } else { + if(errno != ENOENT) { + nofiles_errno = errno; + } + } + } + md5_finish_ctx( &ctx, discid ); + if(nr_of_files == 0) { + errno = nofiles_errno; + return -1; + } + return 0; +} + + +int DVDISOVolumeInfo( dvd_reader_t *dvd, + char *volid, unsigned int volid_size, + unsigned char *volsetid, unsigned int volsetid_size ) +{ + unsigned char *buffer; /* must be aligned to 2048 for raw/O_DIRECT */ + unsigned char *buffer_start; + int ret; + + /* Check arguments. */ + if( dvd == NULL ) { + errno = EINVAL; + return -1; + } + + if( dvd->dev == NULL ) { + /* No block access, so no ISO... */ + errno = EINVAL; + return -1; + } + + buffer_start = malloc( 2 * DVD_VIDEO_LB_LEN ); + if( buffer_start == NULL ) { + return -1; + } + + buffer = DVD_ALIGN(buffer_start); + + ret = UDFReadBlocksRaw( dvd, 16, 1, buffer, 0 ); + if( ret != 1 ) { + if(dvd->verbose >= 1) { + fprintf( stderr, "libdvdread: DVDISOVolumeInfo, failed to " + "read ISO9660 Primary Volume Descriptor!\n" ); + } + free(buffer_start); + return -1; + } + + if( (volid != NULL) && (volid_size > 0) ) { + unsigned int n; + for(n = 0; n < 32; n++) { + if(buffer[40+n] == 0x20) { + break; + } + } + + if(volid_size > n+1) { + volid_size = n+1; + } + + memcpy(volid, &buffer[40], volid_size-1); + volid[volid_size-1] = '\0'; + } + + if( (volsetid != NULL) && (volsetid_size > 0) ) { + if(volsetid_size > 128) { + volsetid_size = 128; + } + memcpy(volsetid, &buffer[190], volsetid_size); + } + free(buffer_start); + + return 0; +} + + +int DVDUDFVolumeInfo( dvd_reader_t *dvd, + char *volid, unsigned int volid_size, + unsigned char *volsetid, unsigned int volsetid_size ) +{ + int ret; + /* Check arguments. */ + if( dvd == NULL ) + return -1; + + if( dvd->dev == NULL ) { + /* No block access, so no UDF VolumeSet Identifier */ + return -1; + } + + if( (volid != NULL) && (volid_size > 0) ) { + ret = UDFGetVolumeIdentifier(dvd, volid, volid_size); + if(!ret) { + return -1; + } + } + if( (volsetid != NULL) && (volsetid_size > 0) ) { + ret = UDFGetVolumeSetIdentifier(dvd, volsetid, volsetid_size); + if(!ret) { + return -1; + } + } + + return 0; +} diff --git a/dvdread/dvd_reader.h b/dvdread/dvd_reader.h new file mode 100644 index 0000000..d666e8a --- /dev/null +++ b/dvdread/dvd_reader.h @@ -0,0 +1,344 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#ifndef DVD_READER_H_INCLUDED +#define DVD_READER_H_INCLUDED + +/* + * Copyright (C) 2001, 2002 Billy Biggs , + * Håkan Hjort , + * Björn Englund + * + * 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 + */ + +#include + +/** + * The DVD access interface. + * + * This file contains the functions that form the interface to to + * reading files located on a DVD. + */ + +/** + * The current version. (0.9.4 => 904, 1.2.3 => 10203) + */ +#define DVDREAD_VERSION 907 + + +/** + * The length of one Logical Block of a DVD. + */ +#define DVD_VIDEO_LB_LEN 2048 + +/** + * Maximum length of filenames allowed in UDF. + */ +#define MAX_UDF_FILE_NAME_LEN 2048 + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Opaque type that is used as a handle for one instance of an opened DVD. + */ +typedef struct dvd_reader_s dvd_reader_t; + +/** + * Opaque type for a file read handle, much like a normal fd or FILE *. + */ +typedef struct dvd_file_s dvd_file_t; + +/** + * Returns the compiled version. (DVDREAD_VERSION as an int) + */ +int DVDVersion(void); + + +/** + * Opens a block device of a DVD-ROM file, or an image file, or a directory + * name for a mounted DVD or HD copy of a DVD. + * + * If the given file is a block device, or is the mountpoint for a block + * device, then that device is used for CSS authentication using libdvdcss. + * If no device is available, then no CSS authentication is performed, + * and we hope that the image is decrypted. + * + * If the path given is a directory, then the files in that directory may be + * in any one of these formats: + * + * path/VIDEO_TS/VTS_01_1.VOB + * path/video_ts/vts_01_1.vob + * path/VTS_01_1.VOB + * path/vts_01_1.vob + * + * @param path Specifies the the device, file or directory to be used. + * @return If successful a a read handle is returned. Otherwise 0 is returned. + * + * dvd = DVDOpen(path); + * + * Threads: this function uses chdir() and getcwd(). + * The current working directory is global to all threads, + * so using chdir/getcwd in another thread could give unexpected results. + */ +dvd_reader_t *DVDOpen( const char * ); + +/** + * Closes and cleans up the DVD reader object. + * + * You must close all open files before calling this function. + * + * @param dvd A read handle that should be closed. + * + * DVDClose(dvd); + */ +void DVDClose( dvd_reader_t * ); + +/** + * Initializes libdvdread to be used with multithreading apps. + * + * You must call this function before using any other functions of libdvdread + * if you are going to use libdvdread in multiple threads in your program. + * If you are not using threads, or using libdvdread from just one thread, + * you do not need to call this, but you are allowed to do so anyway. + * + * There are several restrictions on how you can use libdvdread in + * multithreading apps, see further documentation. + * + * If you have called DVDFinish() you need to call DVDInit again to use + * libdvdread in multiple threads. + * + * DVDInit(void); + */ +void DVDInit(void); + +/** + * frees any dlopened objects. + * + * You must DVDClose all handles opened with DVDOpen before calling this. + * Use this function if you need to close the dlopened libs and any other + * objects that have been dynamically allocated by libdvdread. + * + * DVDFinish(void); + */ +void DVDFinish(void); + +/** + * + */ +typedef enum { + DVD_READ_INFO_FILE, /**< VIDEO_TS.IFO or VTS_XX_0.IFO (title) */ + DVD_READ_INFO_BACKUP_FILE, /**< VIDEO_TS.BUP or VTS_XX_0.BUP (title) */ + DVD_READ_MENU_VOBS, /**< VIDEO_TS.VOB or VTS_XX_0.VOB (title) */ + DVD_READ_TITLE_VOBS /**< VTS_XX_[1-9].VOB (title). All files in + the title set are opened and read as a + single file. */ +} dvd_read_domain_t; + +/** + * + */ +typedef struct { + off_t size; /**< Total size of file in bytes */ + int nr_parts; /**< Number of file parts */ + off_t parts_size[9]; /**< Size of each part in bytes */ +} dvd_stat_t; + +/** + * Stats a file on the DVD given the title number and domain. + * The information about the file is stored in a dvd_stat_t + * which contains information about the size of the file and + * the number of parts in case of a multipart file and the respective + * sizes of the parts. + * A multipart file is for instance VTS_02_1.VOB, VTS_02_2.VOB, VTS_02_3.VOB + * The size of VTS_02_1.VOB will be stored in stat->parts_size[0], + * VTS_02_2.VOB in stat->parts_size[1], ... + * The total size (sum of all parts) is stored in stat->size and + * stat->nr_parts will hold the number of parts. + * Only DVD_READ_TITLE_VOBS (VTS_??_[1-9].VOB) can be multipart files. + * + * This function is only of use if you want to get the size of each file + * in the filesystem. These sizes are not needed to use any other + * functions in libdvdread. + * + * @param dvd A dvd read handle. + * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0. + * @param domain Which domain. + * @param stat Pointer to where the result is stored. + * @return If successful 0, otherwise -1. + * + * int DVDFileStat(dvd, titlenum, domain, stat); + */ +int DVDFileStat(dvd_reader_t *, int, dvd_read_domain_t, dvd_stat_t *); + +/** + * Opens a file on the DVD given the title number and domain. + * + * If the title number is 0, the video manager information is opened + * (VIDEO_TS.[IFO,BUP,VOB]). Returns a file structure which may be + * used for reads, or 0 if the file was not found. + * + * @param dvd A dvd read handle. + * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0. + * @param domain Which domain. + * @return If successful a a file read handle is returned, otherwise 0. + * + * dvd_file = DVDOpenFile(dvd, titlenum, domain); */ +dvd_file_t *DVDOpenFile( dvd_reader_t *, int, dvd_read_domain_t ); + +/** + * Closes a file and frees the associated structure. + * + * @param dvd_file The file read handle to be closed. + * + * DVDCloseFile(dvd_file); + */ +void DVDCloseFile( dvd_file_t * ); + +/** + * Reads block_count number of blocks from the file at the given block offset. + * Returns number of blocks read on success, -1 on error. This call is only + * for reading VOB data, and should not be used when reading the IFO files. + * When reading from an encrypted drive, blocks are decrypted using libdvdcss + * where required. + * + * @param dvd_file A file read handle. + * @param offset Block offset from the start of the file to start reading at. + * @param block_count Number of block to read. + * @param data Pointer to a buffer to write the data into. + * It must be aligned to the logical block size of the device when + * reading from a raw/O_DIRECT device (2048 bytes for DVD) + * @return Returns number of blocks read on success, -1 on error. + * + * blocks_read = DVDReadBlocks(dvd_file, offset, block_count, data); + */ +ssize_t DVDReadBlocks( dvd_file_t *, int, size_t, unsigned char * ); + +/** + * Seek to the given position in the file. Returns the resulting position in + * bytes from the beginning of the file. The seek position is only used for + * byte reads from the file, the block read call always reads from the given + * offset. + * + * @param dvd_file A file read handle. + * @param seek_offset Byte offset from the start of the file to seek to. + * @return The resulting position in bytes from the beginning of the file. + * + * offset_set = DVDFileSeek(dvd_file, seek_offset); + */ +int DVDFileSeek( dvd_file_t *, int ); + +/** + * Reads the given number of bytes from the file. This call can only be used + * on the information files, and may not be used for reading from a VOB. This + * reads from and increments the currrent seek position for the file. + * + * @param dvd_file A file read handle. + * @param data Pointer to a buffer to write the data into. + * @param bytes Number of bytes to read. + * @return Returns number of bytes read on success, -1 on error. + * + * bytes_read = DVDReadBytes(dvd_file, data, bytes); + */ +ssize_t DVDReadBytes( dvd_file_t *, void *, size_t ); + +/** + * Returns the file size in blocks. + * + * @param dvd_file A file read handle. + * @return The size of the file in blocks, -1 on error. + * + * blocks = DVDFileSize(dvd_file); + */ +ssize_t DVDFileSize( dvd_file_t * ); + +/** + * Get a unique 128 bit disc ID. + * This is the MD5 sum of VIDEO_TS.IFO and the VTS_0?_0.IFO files + * in title order (those that exist). + * If you need a 'text' representation of the id, print it as a + * hexadecimal number, using lowercase letters, discid[0] first. + * I.e. the same format as the command-line 'md5sum' program uses. + * + * @param dvd A read handle to get the disc ID from + * @param discid The buffer to put the disc ID into. The buffer must + * have room for 128 bits (16 chars). + * @return 0 on success, -1 on error. + */ +int DVDDiscID( dvd_reader_t *, unsigned char * ); + +/** + * Get the UDF VolumeIdentifier and VolumeSetIdentifier + * from the PrimaryVolumeDescriptor. + * + * @param dvd A read handle to get the disc ID from + * @param volid The buffer to put the VolumeIdentifier into. + * The VolumeIdentifier is latin-1 encoded (8bit unicode) + * null terminated and max 32 bytes (including '\0') + * @param volid_size No more than volid_size bytes will be copied to volid. + * If the VolumeIdentifier is truncated because of this + * it will still be null terminated. + * @param volsetid The buffer to put the VolumeSetIdentifier into. + * The VolumeIdentifier is 128 bytes as + * stored in the UDF PrimaryVolumeDescriptor. + * Note that this is not a null terminated string. + * @param volsetid_size At most volsetid_size bytes will be copied to volsetid. + * @return 0 on success, -1 on error. + */ +int DVDUDFVolumeInfo( dvd_reader_t *, char *, unsigned int, + unsigned char *, unsigned int ); + +/** + * Get the ISO9660 VolumeIdentifier and VolumeSetIdentifier + * + * * Only use this function as fallback if DVDUDFVolumeInfo returns 0 * + * * this will happen on a disc mastered only with a iso9660 filesystem * + * * All video DVD discs have UDF filesystem * + * + * @param dvd A read handle to get the disc ID from + * @param volid The buffer to put the VolumeIdentifier into. + * The VolumeIdentifier is coded with '0-9','A-Z','_' + * null terminated and max 33 bytes (including '\0') + * @param volid_size No more than volid_size bytes will be copied to volid. + * If the VolumeIdentifier is truncated because of this + * it will still be null terminated. + * @param volsetid The buffer to put the VolumeSetIdentifier into. + * The VolumeIdentifier is 128 bytes as + * stored in the ISO9660 PrimaryVolumeDescriptor. + * Note that this is not a null terminated string. + * @param volsetid_size At most volsetid_size bytes will be copied to volsetid. + * @return 0 on success, -1 on error. + */ +int DVDISOVolumeInfo( dvd_reader_t *, char *, unsigned int, + unsigned char *, unsigned int ); + +/** + * Sets the level of caching that is done when reading from a device + * + * @param dvd A read handle to get the disc ID from + * @param level The level of caching wanted. + * -1 - returns the current setting. + * 0 - UDF Cache turned off. + * 1 - (default level) Pointers to IFO files and some data from + * PrimaryVolumeDescriptor are cached. + * + * @return The level of caching. + */ +int DVDUDFCacheLevel( dvd_reader_t *, int ); + +#ifdef __cplusplus +}; +#endif +#endif /* DVD_READER_H_INCLUDED */ diff --git a/dvdread/dvd_udf.c b/dvdread/dvd_udf.c new file mode 100644 index 0000000..9af6ad0 --- /dev/null +++ b/dvdread/dvd_udf.c @@ -0,0 +1,1216 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + * This code is based on dvdudf by: + * Christian Wolff . + * + * Modifications by: + * Billy Biggs . + * Bj�rn Englund . + * + * dvdudf: parse and read the UDF volume information of a DVD Video + * Copyright (C) 1999 Christian Wolff for convergence integrated media + * GmbH The author can be reached at scarabaeus@convergence.de, the + * project's page is at http://linuxtv.org/dvd/ + * + * 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. Or, point your browser to + * http://www.gnu.org/copyleft/gpl.html + */ + +#include "config.h" + +#include +#include +#include + +#include +#include +#include +#include + +#if defined(HAVE_INTTYPES_H) +#include +#elif defined(HAVE_STDINT_H) +#include +#endif + +#include "dvd_reader.h" +#include "dvd_udf.h" +#include "dvdread_internal.h" + +#ifndef EMEDIUMTYPE +#define EMEDIUMTYPE ENOENT +#endif + +#ifndef HAVE_UINTPTR_T +#warning "Assuming that (unsigned long) can hold (void *)" +/*typedef unsigned long uintptr_t;*/ +#endif + +#define DVD_ALIGN(ptr) (void *)((((uintptr_t)(ptr)) + (DVD_VIDEO_LB_LEN-1)) \ + / DVD_VIDEO_LB_LEN * DVD_VIDEO_LB_LEN) + +typedef struct { + void *start; + void *aligned; +} dvdalign_ptrs_t; + +typedef struct { + dvdalign_ptrs_t *ptrs; + uint32_t ptrs_in_use; + uint32_t ptrs_max; +} dvdalign_t; + +extern void *GetAlignHandle(dvd_reader_t *device); +extern void SetAlignHandle(dvd_reader_t *device, void *align); + +/** + * Allocates aligned memory (for use with reads from raw/O_DIRECT devices). + * This memory must be freed with dvdalign_free() + * The size of the memory that is allocate is num_lbs*2048 bytes. + * The memory will be suitably aligned for use with + * block reads from raw/O_DIRECT device. + * @param num_lbs Number of logical blocks (2048 bytes) to allocate. + * @return Returns pointer to allocated memory, or NULL on failure + * This isn't supposed to be fast/efficient, if that is needed + * this function should be rewritten to use posix_memalign or similar. + * It's just needed for aligning memory for small block reads from + * raw/O_DIRECT devices. + * We assume that 2048 is enough alignment for all systems at the moment. + * Not thread safe. Only use this from one thread. + * Depends on sizeof(unsigned long) being at least as large as sizeof(void *) + */ +static void *dvdalign_lbmalloc(dvd_reader_t *device, uint32_t num_lbs) +{ + void *m; + int n; + dvdalign_t *a; + + m = malloc((num_lbs+1)*DVD_VIDEO_LB_LEN); + if(m == NULL) { + return m; + } + a = (dvdalign_t *)GetAlignHandle(device); + if(a == NULL) { + a = malloc(sizeof(dvdalign_t)); + if(a == NULL) { + return a; + } + a->ptrs = NULL; + a->ptrs_in_use = 0; + a->ptrs_max = 0; + SetAlignHandle(device, (void *)a); + } + + if(a->ptrs_in_use >= a->ptrs_max) { + a->ptrs = realloc(a->ptrs, (a->ptrs_max+10)*sizeof(dvdalign_ptrs_t)); + if(a->ptrs == NULL) { + free(m); + return NULL; + } + a->ptrs_max+=10; + for(n = a->ptrs_in_use; n < a->ptrs_max; n++) { + a->ptrs[n].start = NULL; + a->ptrs[n].aligned = NULL; + } + n = a->ptrs_in_use; + } else { + for(n = 0; n < a->ptrs_max; n++) { + if(a->ptrs[n].start == NULL) { + break; + } + } + } + + a->ptrs[n].start = m; + a->ptrs[n].aligned = DVD_ALIGN(m); + + a->ptrs_in_use++; + + /* If this function starts to be used too much print a warning. + Either there is a memory leak somewhere or we need to rewrite this to + a more efficient version. + */ + if(a->ptrs_in_use > 50) { + if(dvdread_verbose(device) >= 0) { + fprintf(stderr, "libdvdread: dvdalign_lbmalloc(), more allocs than supposed: %u\n", a->ptrs_in_use); + } + } + + return a->ptrs[n].aligned; +} + +/** + * Frees memory allocated with dvdalign_lbmemory() + * @param ptr Pointer to memory space to free + * Not thread safe. + */ +static void dvdalign_lbfree(dvd_reader_t *device, void *ptr) +{ + int n; + dvdalign_t *a; + + a = (dvdalign_t *)GetAlignHandle(device); + if(a && a->ptrs) { + for(n = 0; n < a->ptrs_max; n++) { + if(a->ptrs[n].aligned == ptr) { + free(a->ptrs[n].start); + a->ptrs[n].start = NULL; + a->ptrs[n].aligned = NULL; + a->ptrs_in_use--; + if(a->ptrs_in_use == 0) { + free(a->ptrs); + a->ptrs = NULL; + a->ptrs_max = 0; + free(a); + a = NULL; + SetAlignHandle(device, (void *)a); + } + return; + } + } + } + if(dvdread_verbose(device) >= 0) { + fprintf(stderr, "libdvdread: dvdalign_lbfree(), error trying to free mem: %08lx (%u)\n", (unsigned long)ptr, a ? a->ptrs_in_use : 0); + } +} + + +/* Private but located in/shared with dvd_reader.c */ +extern int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number, + size_t block_count, unsigned char *data, + int encrypted ); + +/** @internal + * Its required to either fail or deliver all the blocks asked for. + * + * @param data Pointer to a buffer where data is returned. This must be large + * enough to hold lb_number*2048 bytes. + * It must be aligned to system specific (2048) logical blocks size when + * reading from raw/O_DIRECT device. + */ +static int DVDReadLBUDF( dvd_reader_t *device, uint32_t lb_number, + size_t block_count, unsigned char *data, + int encrypted ) +{ + int ret; + size_t count = block_count; + + while(count > 0) { + + ret = UDFReadBlocksRaw(device, lb_number, count, data, encrypted); + + if(ret <= 0) { + /* One of the reads failed or nothing more to read, too bad. + * We won't even bother returning the reads that went ok. */ + return ret; + } + + count -= (size_t)ret; + lb_number += (uint32_t)ret; + } + + return block_count; +} + + +#ifndef NULL +#define NULL ((void *)0) +#endif + +struct Partition { + int valid; + char VolumeDesc[128]; + uint16_t Flags; + uint16_t Number; + char Contents[32]; + uint32_t AccessType; + uint32_t Start; + uint32_t Length; +}; + +struct AD { + uint32_t Location; + uint32_t Length; + uint8_t Flags; + uint16_t Partition; +}; + +struct extent_ad { + uint32_t location; + uint32_t length; +}; + +struct avdp_t { + struct extent_ad mvds; + struct extent_ad rvds; +}; + +struct pvd_t { + uint8_t VolumeIdentifier[32]; + uint8_t VolumeSetIdentifier[128]; +}; + +struct lbudf { + uint32_t lb; + uint8_t *data; +}; + +struct icbmap { + uint32_t lbn; + struct AD file; + uint8_t filetype; +}; + +struct udf_cache { + int avdp_valid; + struct avdp_t avdp; + int pvd_valid; + struct pvd_t pvd; + int partition_valid; + struct Partition partition; + int rooticb_valid; + struct AD rooticb; + int lb_num; + struct lbudf *lbs; + int map_num; + struct icbmap *maps; +}; + +typedef enum { + PartitionCache, RootICBCache, LBUDFCache, MapCache, AVDPCache, PVDCache +} UDFCacheType; + +extern void *GetUDFCacheHandle(dvd_reader_t *device); +extern void SetUDFCacheHandle(dvd_reader_t *device, void *cache); + + +void FreeUDFCache(dvd_reader_t *device, void *cache) +{ + int n; + + struct udf_cache *c = (struct udf_cache *)cache; + if(c == NULL) { + return; + } + + for(n = 0; n < c->lb_num; n++) { + if(c->lbs[n].data) { + /* free data */ + dvdalign_lbfree(device, c->lbs[n].data); + } + } + c->lb_num = 0; + + if(c->lbs) { + free(c->lbs); + } + if(c->maps) { + free(c->maps); + } + free(c); +} + + +static int GetUDFCache(dvd_reader_t *device, UDFCacheType type, + uint32_t nr, void *data) +{ + int n; + struct udf_cache *c; + + if(DVDUDFCacheLevel(device, -1) <= 0) { + return 0; + } + + c = (struct udf_cache *)GetUDFCacheHandle(device); + + if(c == NULL) { + return 0; + } + + switch(type) { + case AVDPCache: + if(c->avdp_valid) { + *(struct avdp_t *)data = c->avdp; + return 1; + } + break; + case PVDCache: + if(c->pvd_valid) { + *(struct pvd_t *)data = c->pvd; + return 1; + } + break; + case PartitionCache: + if(c->partition_valid) { + *(struct Partition *)data = c->partition; + return 1; + } + break; + case RootICBCache: + if(c->rooticb_valid) { + *(struct AD *)data = c->rooticb; + return 1; + } + break; + case LBUDFCache: + for(n = 0; n < c->lb_num; n++) { + if(c->lbs[n].lb == nr) { + *(uint8_t **)data = c->lbs[n].data; + return 1; + } + } + break; + case MapCache: + for(n = 0; n < c->map_num; n++) { + if(c->maps[n].lbn == nr) { + *(struct icbmap *)data = c->maps[n]; + return 1; + } + } + break; + default: + break; + } + + return 0; +} + +static int SetUDFCache(dvd_reader_t *device, UDFCacheType type, + uint32_t nr, void *data) +{ + int n; + struct udf_cache *c; + + if(DVDUDFCacheLevel(device, -1) <= 0) { + return 0; + } + + c = (struct udf_cache *)GetUDFCacheHandle(device); + + if(c == NULL) { + c = calloc(1, sizeof(struct udf_cache)); + /* fprintf(stderr, "calloc: %d\n", sizeof(struct udf_cache)); */ + if(c == NULL) { + return 0; + } + SetUDFCacheHandle(device, c); + } + + + switch(type) { + case AVDPCache: + c->avdp = *(struct avdp_t *)data; + c->avdp_valid = 1; + break; + case PVDCache: + c->pvd = *(struct pvd_t *)data; + c->pvd_valid = 1; + break; + case PartitionCache: + c->partition = *(struct Partition *)data; + c->partition_valid = 1; + break; + case RootICBCache: + c->rooticb = *(struct AD *)data; + c->rooticb_valid = 1; + break; + case LBUDFCache: + for(n = 0; n < c->lb_num; n++) { + if(c->lbs[n].lb == nr) { + /* replace with new data */ + c->lbs[n].data = *(uint8_t **)data; + c->lbs[n].lb = nr; + return 1; + } + } + c->lb_num++; + c->lbs = realloc(c->lbs, c->lb_num * sizeof(struct lbudf)); + /* + fprintf(stderr, "realloc lb: %d * %d = %d\n", + c->lb_num, sizeof(struct lbudf), + c->lb_num * sizeof(struct lbudf)); + */ + if(c->lbs == NULL) { + c->lb_num = 0; + return 0; + } + c->lbs[n].data = *(uint8_t **)data; + c->lbs[n].lb = nr; + break; + case MapCache: + for(n = 0; n < c->map_num; n++) { + if(c->maps[n].lbn == nr) { + /* replace with new data */ + c->maps[n] = *(struct icbmap *)data; + c->maps[n].lbn = nr; + return 1; + } + } + c->map_num++; + c->maps = realloc(c->maps, c->map_num * sizeof(struct icbmap)); + /* + fprintf(stderr, "realloc maps: %d * %d = %d\n", + c->map_num, sizeof(struct icbmap), + c->map_num * sizeof(struct icbmap)); + */ + if(c->maps == NULL) { + c->map_num = 0; + return 0; + } + c->maps[n] = *(struct icbmap *)data; + c->maps[n].lbn = nr; + break; + default: + return 0; + } + + return 1; +} + + +/* For direct data access, LSB first */ +#define GETN1(p) ((uint8_t)data[p]) +#define GETN2(p) ((uint16_t)data[p] | ((uint16_t)data[(p) + 1] << 8)) +#define GETN3(p) ((uint32_t)data[p] | ((uint32_t)data[(p) + 1] << 8) \ + | ((uint32_t)data[(p) + 2] << 16)) +#define GETN4(p) ((uint32_t)data[p] \ + | ((uint32_t)data[(p) + 1] << 8) \ + | ((uint32_t)data[(p) + 2] << 16) \ + | ((uint32_t)data[(p) + 3] << 24)) +/* This is wrong with regard to endianess */ +#define GETN(p, n, target) memcpy(target, &data[p], n) + +static int Unicodedecode( uint8_t *data, int len, char *target ) +{ + int p = 1, i = 0; + + if( ( data[ 0 ] == 8 ) || ( data[ 0 ] == 16 ) ) do { + if( data[ 0 ] == 16 ) p++; /* Ignore MSB of unicode16 */ + if( p < len ) { + target[ i++ ] = data[ p++ ]; + } + } while( p < len ); + + target[ i ] = '\0'; + return 0; +} + +static int UDFDescriptor( uint8_t *data, uint16_t *TagID ) +{ + *TagID = GETN2(0); + return 0; +} + +static int UDFExtentAD( uint8_t *data, uint32_t *Length, uint32_t *Location ) +{ + *Length = GETN4(0); + *Location = GETN4(4); + return 0; +} + +static int UDFShortAD( uint8_t *data, struct AD *ad, + struct Partition *partition ) +{ + ad->Length = GETN4(0); + ad->Flags = ad->Length >> 30; + ad->Length &= 0x3FFFFFFF; + ad->Location = GETN4(4); + ad->Partition = partition->Number; /* use number of current partition*/ + return 0; +} + +static int UDFLongAD( uint8_t *data, struct AD *ad ) +{ + ad->Length = GETN4(0); + ad->Flags = ad->Length >> 30; + ad->Length &= 0x3FFFFFFF; + ad->Location = GETN4(4); + ad->Partition = GETN2(8); + /*GETN(10, 6, Use);*/ + return 0; +} + +static int UDFExtAD( uint8_t *data, struct AD *ad ) +{ + ad->Length = GETN4(0); + ad->Flags = ad->Length >> 30; + ad->Length &= 0x3FFFFFFF; + ad->Location = GETN4(12); + ad->Partition = GETN2(16); + /*GETN(10, 6, Use);*/ + return 0; +} + +static int UDFICB( uint8_t *data, uint8_t *FileType, uint16_t *Flags ) +{ + *FileType = GETN1(11); + *Flags = GETN2(18); + return 0; +} + + +static int UDFPartition( uint8_t *data, uint16_t *Flags, uint16_t *Number, + char *Contents, uint32_t *Start, uint32_t *Length ) +{ + *Flags = GETN2(20); + *Number = GETN2(22); + GETN(24, 32, Contents); + *Start = GETN4(188); + *Length = GETN4(192); + return 0; +} + +/** + * Reads the volume descriptor and checks the parameters. Returns 0 on OK, 1 + * on error. + */ +static int UDFLogVolume( uint8_t *data, char *VolumeDescriptor ) +{ + uint32_t lbsize, MT_L, N_PM; + Unicodedecode(&data[84], 128, VolumeDescriptor); + lbsize = GETN4(212); /* should be 2048*/ + MT_L = GETN4(264); /* should be 6 */ + N_PM = GETN4(268); /* should be 1 */ + if (lbsize != DVD_VIDEO_LB_LEN) return 1; + return 0; +} + +static int UDFFileEntry( uint8_t *data, uint8_t *FileType, + struct Partition *partition, struct AD *ad ) +{ + uint16_t flags; + uint32_t L_EA, L_AD; + unsigned int p; + + UDFICB( &data[ 16 ], FileType, &flags ); + + /* Init ad for an empty file (i.e. there isn't a AD, L_AD == 0 ) */ + ad->Length = GETN4( 60 ); /* Really 8 bytes a 56*/ + ad->Flags = 0; + ad->Location = 0; /* what should we put here? */ + ad->Partition = partition->Number; /* use number of current partition*/ + + L_EA = GETN4( 168 ); + L_AD = GETN4( 172 ); + p = 176 + L_EA; + while( p < 176 + L_EA + L_AD ) { + switch( flags & 0x0007 ) { + case 0: UDFShortAD( &data[ p ], ad, partition ); p += 8; break; + case 1: UDFLongAD( &data[ p ], ad ); p += 16; break; + case 2: UDFExtAD( &data[ p ], ad ); p += 20; break; + case 3: + switch( L_AD ) { + case 8: UDFShortAD( &data[ p ], ad, partition ); break; + case 16: UDFLongAD( &data[ p ], ad ); break; + case 20: UDFExtAD( &data[ p ], ad ); break; + } + p += L_AD; + break; + default: + p += L_AD; break; + } + } + return 0; +} + +static int UDFFileIdentifier( uint8_t *data, uint8_t *FileCharacteristics, + char *FileName, struct AD *FileICB ) +{ + uint8_t L_FI; + uint16_t L_IU; + + *FileCharacteristics = GETN1(18); + L_FI = GETN1(19); + UDFLongAD(&data[20], FileICB); + L_IU = GETN2(36); + if (L_FI) Unicodedecode(&data[38 + L_IU], L_FI, FileName); + else FileName[0] = '\0'; + return 4 * ((38 + L_FI + L_IU + 3) / 4); +} + +/** + * Maps ICB to FileAD + * ICB: Location of ICB of directory to scan + * FileType: Type of the file + * File: Location of file the ICB is pointing to + * return 1 on success, 0 on error; + */ +static int UDFMapICB( dvd_reader_t *device, struct AD ICB, uint8_t *FileType, + struct Partition *partition, struct AD *File ) +{ + uint8_t *LogBlock; + uint32_t lbnum; + uint16_t TagID; + struct icbmap tmpmap; + + lbnum = partition->Start + ICB.Location; + tmpmap.lbn = lbnum; + if(GetUDFCache(device, MapCache, lbnum, &tmpmap)) { + *FileType = tmpmap.filetype; + *File = tmpmap.file; + return 1; + } + + LogBlock = dvdalign_lbmalloc(device, 1); + if(!LogBlock) { + return 0; + } + + do { + if( DVDReadLBUDF( device, lbnum++, 1, LogBlock, 0 ) <= 0 ) { + TagID = 0; + } else { + UDFDescriptor( LogBlock, &TagID ); + } + + if( TagID == 261 ) { + UDFFileEntry( LogBlock, FileType, partition, File ); + tmpmap.file = *File; + tmpmap.filetype = *FileType; + SetUDFCache(device, MapCache, tmpmap.lbn, &tmpmap); + dvdalign_lbfree(device, LogBlock); + return 1; + }; + } while( ( lbnum <= partition->Start + ICB.Location + ( ICB.Length - 1 ) + / DVD_VIDEO_LB_LEN ) && ( TagID != 261 ) ); + + dvdalign_lbfree(device, LogBlock); + return 0; +} + +/** + * Dir: Location of directory to scan + * FileName: Name of file to look for + * FileICB: Location of ICB of the found file + * return 1 on success, 0 on error; + */ +static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName, + struct Partition *partition, struct AD *FileICB, + int cache_file_info) +{ + char filename[ MAX_UDF_FILE_NAME_LEN ]; + uint8_t *directory; + uint32_t lbnum; + uint16_t TagID; + uint8_t filechar; + unsigned int p; + uint8_t *cached_dir = NULL; + uint32_t dir_lba; + struct AD tmpICB; + int found = 0; + int in_cache = 0; + + /* Scan dir for ICB of file */ + lbnum = partition->Start + Dir.Location; + + if(DVDUDFCacheLevel(device, -1) > 0) { + /* caching */ + + if(!GetUDFCache(device, LBUDFCache, lbnum, &cached_dir)) { + dir_lba = (Dir.Length + DVD_VIDEO_LB_LEN) / DVD_VIDEO_LB_LEN; + if((cached_dir = dvdalign_lbmalloc(device, dir_lba)) == NULL) { + return 0; + } + if( DVDReadLBUDF( device, lbnum, dir_lba, cached_dir, 0) <= 0 ) { + dvdalign_lbfree(device, cached_dir); + cached_dir = NULL; + } + SetUDFCache(device, LBUDFCache, lbnum, &cached_dir); + } else { + in_cache = 1; + } + + if(cached_dir == NULL) { + return 0; + } + + p = 0; + + while( p < Dir.Length ) { + UDFDescriptor( &cached_dir[ p ], &TagID ); + if( TagID == 257 ) { + p += UDFFileIdentifier( &cached_dir[ p ], &filechar, + filename, &tmpICB ); + if(cache_file_info && !in_cache) { + uint8_t tmpFiletype; + struct AD tmpFile; + + if( !strcasecmp( FileName, filename ) ) { + *FileICB = tmpICB; + found = 1; + + } + UDFMapICB(device, tmpICB, &tmpFiletype, + partition, &tmpFile); + } else { + if( !strcasecmp( FileName, filename ) ) { + *FileICB = tmpICB; + return 1; + } + } + } else { + if(cache_file_info && (!in_cache) && found) { + return 1; + } + return 0; + } + } + if(cache_file_info && (!in_cache) && found) { + return 1; + } + return 0; + } + + directory = dvdalign_lbmalloc(device, 2); + if(!directory) { + return 0; + } + if( DVDReadLBUDF( device, lbnum, 2, directory, 0 ) <= 0 ) { + dvdalign_lbfree(device, directory); + return 0; + } + + p = 0; + while( p < Dir.Length ) { + if( p > DVD_VIDEO_LB_LEN ) { + ++lbnum; + p -= DVD_VIDEO_LB_LEN; + Dir.Length -= DVD_VIDEO_LB_LEN; + if( DVDReadLBUDF( device, lbnum, 2, directory, 0 ) <= 0 ) { + dvdalign_lbfree(device, directory); + return 0; + } + } + UDFDescriptor( &directory[ p ], &TagID ); + if( TagID == 257 ) { + p += UDFFileIdentifier( &directory[ p ], &filechar, + filename, FileICB ); + if( !strcasecmp( FileName, filename ) ) { + dvdalign_lbfree(device, directory); + return 1; + } + } else { + dvdalign_lbfree(device, directory); + return 0; + } + } + + dvdalign_lbfree(device, directory); + return 0; +} + + +static int UDFGetAVDP( dvd_reader_t *device, + struct avdp_t *avdp) +{ + uint8_t *Anchor; + uint32_t lbnum, MVDS_location, MVDS_length; + uint16_t TagID; + uint32_t lastsector; + int terminate; + struct avdp_t; + + if(GetUDFCache(device, AVDPCache, 0, avdp)) { + return 1; + } + + /* Find Anchor */ + lastsector = 0; + lbnum = 256; /* Try #1, prime anchor */ + terminate = 0; + + Anchor = dvdalign_lbmalloc(device, 1); + if(!Anchor) { + return 0; + } + for(;;) { + if( DVDReadLBUDF( device, lbnum, 1, Anchor, 0 ) > 0 ) { + UDFDescriptor( Anchor, &TagID ); + } else { + TagID = 0; + } + if (TagID != 2) { + /* Not an anchor */ + if( terminate ) { + dvdalign_lbfree(device, Anchor); + errno = EMEDIUMTYPE; + return 0; /* Final try failed */ + } + + if( lastsector ) { + /* We already found the last sector. Try #3, alternative + * backup anchor. If that fails, don't try again. + */ + lbnum = lastsector; + terminate = 1; + } else { + /* TODO: Find last sector of the disc (this is optional). */ + if( lastsector ) { + /* Try #2, backup anchor */ + lbnum = lastsector - 256; + } else { + /* Unable to find last sector */ + dvdalign_lbfree(device, Anchor); + errno = EMEDIUMTYPE; + return 0; + } + } + } else { + /* It's an anchor! We can leave */ + break; + } + } + /* Main volume descriptor */ + UDFExtentAD( &Anchor[ 16 ], &MVDS_length, &MVDS_location ); + avdp->mvds.location = MVDS_location; + avdp->mvds.length = MVDS_length; + + /* Backup volume descriptor */ + UDFExtentAD( &Anchor[ 24 ], &MVDS_length, &MVDS_location ); + avdp->rvds.location = MVDS_location; + avdp->rvds.length = MVDS_length; + + SetUDFCache(device, AVDPCache, 0, avdp); + + dvdalign_lbfree(device, Anchor); + return 1; +} + +/** + * Looks for partition on the disc. Returns 1 if partition found, 0 on error. + * partnum: Number of the partition, starting at 0. + * part: structure to fill with the partition information + */ +static int UDFFindPartition( dvd_reader_t *device, int partnum, + struct Partition *part ) +{ + uint8_t *LogBlock; + uint32_t lbnum, MVDS_location, MVDS_length; + uint16_t TagID; + int i, volvalid; + struct avdp_t avdp; + + + if(!UDFGetAVDP(device, &avdp)) { + return 0; + } + + LogBlock = dvdalign_lbmalloc(device, 1); + if(!LogBlock) { + return 0; + } + /* Main volume descriptor */ + MVDS_location = avdp.mvds.location; + MVDS_length = avdp.mvds.length; + + part->valid = 0; + volvalid = 0; + part->VolumeDesc[ 0 ] = '\0'; + i = 1; + do { + /* Find Volume Descriptor */ + lbnum = MVDS_location; + do { + + if( DVDReadLBUDF( device, lbnum++, 1, LogBlock, 0 ) <= 0 ) { + TagID = 0; + } else { + UDFDescriptor( LogBlock, &TagID ); + } + + if( ( TagID == 5 ) && ( !part->valid ) ) { + /* Partition Descriptor */ + UDFPartition( LogBlock, &part->Flags, &part->Number, + part->Contents, &part->Start, &part->Length ); + part->valid = ( partnum == part->Number ); + } else if( ( TagID == 6 ) && ( !volvalid ) ) { + /* Logical Volume Descriptor */ + if( UDFLogVolume( LogBlock, part->VolumeDesc ) ) { + /* TODO: sector size wrong! */ + } else { + volvalid = 1; + } + } + + } while( ( lbnum <= MVDS_location + ( MVDS_length - 1 ) + / DVD_VIDEO_LB_LEN ) && ( TagID != 8 ) + && ( ( !part->valid ) || ( !volvalid ) ) ); + + if( ( !part->valid) || ( !volvalid ) ) { + /* Backup volume descriptor */ + MVDS_location = avdp.mvds.location; + MVDS_length = avdp.mvds.length; + } + } while( i-- && ( ( !part->valid ) || ( !volvalid ) ) ); + + dvdalign_lbfree(device, LogBlock); + /* We only care for the partition, not the volume */ + return part->valid; +} + +uint32_t UDFFindFile( dvd_reader_t *device, char *filename, + uint32_t *filesize ) +{ + uint8_t *LogBlock; + uint32_t lbnum; + uint16_t TagID; + struct Partition partition; + struct AD RootICB, File, ICB; + char tokenline[ MAX_UDF_FILE_NAME_LEN ]; + char *token; + uint8_t filetype; + + if(filesize) { + *filesize = 0; + } + tokenline[0] = '\0'; + strcat( tokenline, filename ); + + + if(!(GetUDFCache(device, PartitionCache, 0, &partition) && + GetUDFCache(device, RootICBCache, 0, &RootICB))) { + /* Find partition, 0 is the standard location for DVD Video.*/ + if( !UDFFindPartition( device, 0, &partition ) ) { + return 0; + } + SetUDFCache(device, PartitionCache, 0, &partition); + + LogBlock = dvdalign_lbmalloc(device, 1); + if(!LogBlock) { + return 0; + } + /* Find root dir ICB */ + lbnum = partition.Start; + do { + if( DVDReadLBUDF( device, lbnum++, 1, LogBlock, 0 ) <= 0 ) { + TagID = 0; + } else { + UDFDescriptor( LogBlock, &TagID ); + } + + /* File Set Descriptor */ + if( TagID == 256 ) { /* File Set Descriptor*/ + UDFLongAD( &LogBlock[ 400 ], &RootICB ); + } + } while( ( lbnum < partition.Start + partition.Length ) + && ( TagID != 8 ) && ( TagID != 256 ) ); + + dvdalign_lbfree(device, LogBlock); + + /* Sanity checks. */ + if( TagID != 256 ) { + return 0; + } + if( RootICB.Partition != 0 ) { + return 0; + } + SetUDFCache(device, RootICBCache, 0, &RootICB); + } + + /* Find root dir */ + if( !UDFMapICB( device, RootICB, &filetype, &partition, &File ) ) { + return 0; + } + if( filetype != 4 ) { + return 0; /* Root dir should be dir */ + } + { + int cache_file_info = 0; + /* Tokenize filepath */ + token = strtok(tokenline, "/"); + + while( token != NULL ) { + + if( !UDFScanDir( device, File, token, &partition, &ICB, + cache_file_info)) { + return 0; + } + if( !UDFMapICB( device, ICB, &filetype, &partition, &File ) ) { + return 0; + } + if(!strcmp(token, "VIDEO_TS")) { + cache_file_info = 1; + } + token = strtok( NULL, "/" ); + } + } + + /* Sanity check. */ + if( File.Partition != 0 ) { + return 0; + } + + if(filesize) { + *filesize = File.Length; + } + /* Hack to not return partition.Start for empty files. */ + if( !File.Location ) { + return 0; + } else { + return partition.Start + File.Location; + } +} + + + +/** + * Gets a Descriptor . + * Returns 1 if descriptor found, 0 on error. + * id, tagid of descriptor + * bufsize, size of BlockBuf (must be >= DVD_VIDEO_LB_LEN) + * and aligned for raw/O_DIRECT read. + */ +static int UDFGetDescriptor( dvd_reader_t *device, int id, + uint8_t *descriptor, int bufsize) +{ + uint32_t lbnum, MVDS_location, MVDS_length; + struct avdp_t avdp; + uint16_t TagID; + uint32_t lastsector; + int i, terminate; + int desc_found = 0; + /* Find Anchor */ + lastsector = 0; + lbnum = 256; /* Try #1, prime anchor */ + terminate = 0; + if(bufsize < DVD_VIDEO_LB_LEN) { + return 0; + } + + if(!UDFGetAVDP(device, &avdp)) { + return 0; + } + + /* Main volume descriptor */ + MVDS_location = avdp.mvds.location; + MVDS_length = avdp.mvds.length; + + i = 1; + do { + /* Find Descriptor */ + lbnum = MVDS_location; + do { + + if( DVDReadLBUDF( device, lbnum++, 1, descriptor, 0 ) <= 0 ) { + TagID = 0; + } else { + UDFDescriptor( descriptor, &TagID ); + } + + if( (TagID == id) && ( !desc_found ) ) { + /* Descriptor */ + desc_found = 1; + } + } while( ( lbnum <= MVDS_location + ( MVDS_length - 1 ) + / DVD_VIDEO_LB_LEN ) && ( TagID != 8 ) + && ( !desc_found) ); + + if( !desc_found ) { + /* Backup volume descriptor */ + MVDS_location = avdp.rvds.location; + MVDS_length = avdp.rvds.length; + } + } while( i-- && ( !desc_found ) ); + + + return desc_found; +} + + +static int UDFGetPVD(dvd_reader_t *device, struct pvd_t *pvd) +{ + uint8_t *pvd_buf; + + if(GetUDFCache(device, PVDCache, 0, pvd)) { + return 1; + } + + pvd_buf = dvdalign_lbmalloc(device, 1); + if(!pvd_buf) { + return 0; + } + if(!UDFGetDescriptor( device, 1, pvd_buf, 1*DVD_VIDEO_LB_LEN)) { + dvdalign_lbfree(device, pvd_buf); + return 0; + } + + memcpy(pvd->VolumeIdentifier, &pvd_buf[24], 32); + memcpy(pvd->VolumeSetIdentifier, &pvd_buf[72], 128); + SetUDFCache(device, PVDCache, 0, pvd); + + dvdalign_lbfree(device, pvd_buf); + + return 1; +} + +/** + * Gets the Volume Identifier string, in 8bit unicode (latin-1) + * volid, place to put the string + * volid_size, size of the buffer volid points to + * returns the size of buffer needed for all data + */ +int UDFGetVolumeIdentifier(dvd_reader_t *device, char *volid, + unsigned int volid_size) +{ + struct pvd_t pvd; + unsigned int volid_len; + + /* get primary volume descriptor */ + if(!UDFGetPVD(device, &pvd)) { + return 0; + } + + volid_len = pvd.VolumeIdentifier[31]; + if(volid_len > 31) { + /* this field is only 32 bytes something is wrong */ + volid_len = 31; + } + if(volid_size > volid_len) { + volid_size = volid_len; + } + Unicodedecode(pvd.VolumeIdentifier, volid_size, volid); + + return volid_len; +} + +/** + * Gets the Volume Set Identifier, as a 128-byte dstring (not decoded) + * WARNING This is not a null terminated string + * volsetid, place to put the data + * volsetid_size, size of the buffer volsetid points to + * the buffer should be >=128 bytes to store the whole volumesetidentifier + * returns the size of the available volsetid information (128) + * or 0 on error + */ +int UDFGetVolumeSetIdentifier(dvd_reader_t *device, uint8_t *volsetid, + unsigned int volsetid_size) +{ + struct pvd_t pvd; + + /* get primary volume descriptor */ + if(!UDFGetPVD(device, &pvd)) { + return 0; + } + + + if(volsetid_size > 128) { + volsetid_size = 128; + } + + memcpy(volsetid, pvd.VolumeSetIdentifier, volsetid_size); + + return 128; +} diff --git a/dvdread/dvd_udf.h b/dvdread/dvd_udf.h new file mode 100644 index 0000000..cf66ce4 --- /dev/null +++ b/dvdread/dvd_udf.h @@ -0,0 +1,66 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#ifndef DVD_UDF_H_INCLUDED +#define DVD_UDF_H_INCLUDED + +/* + * This code is based on dvdudf by: + * Christian Wolff . + * + * Modifications by: + * Billy Biggs . + * Björn Englund . + * + * dvdudf: parse and read the UDF volume information of a DVD Video + * Copyright (C) 1999 Christian Wolff for convergence integrated media + * GmbH The author can be reached at scarabaeus@convergence.de, the + * project's page is at http://linuxtv.org/dvd/ + * + * 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. Or, point your browser to + * http://www.gnu.org/copyleft/gpl.html + */ + +#if defined(HAVE_INTTYPES_H) +#include +#elif defined(HAVE_STDINT_H) +#include +#endif + +#include "dvd_reader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Looks for a file on the UDF disc/imagefile and returns the block number + * where it begins, or 0 if it is not found. The filename should be an + * absolute pathname on the UDF filesystem, starting with '/'. For example, + * '/VIDEO_TS/VTS_01_1.IFO'. On success, filesize will be set to the size of + * the file in bytes. + * This implementation relies on that the file size is less than 2^32 + * A DVD file can at most be 2^30 (-2048 ?). + */ +uint32_t UDFFindFile( dvd_reader_t *device, char *filename, uint32_t *size ); + +void FreeUDFCache(dvd_reader_t *device, void *cache); +int UDFGetVolumeIdentifier(dvd_reader_t *device, + char *volid, unsigned int volid_size); +int UDFGetVolumeSetIdentifier(dvd_reader_t *device, + uint8_t *volsetid, unsigned int volsetid_size); +#ifdef __cplusplus +}; +#endif +#endif /* DVD_UDF_H_INCLUDED */ diff --git a/dvdread/dvdread_internal.h b/dvdread/dvdread_internal.h new file mode 100644 index 0000000..995d491 --- /dev/null +++ b/dvdread/dvdread_internal.h @@ -0,0 +1,18 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#ifndef DVDREAD_INTERNAL_H +#define DVDREAD_INTERNAL_H + + +#define CHECK_VALUE(arg) \ + if(!(arg)) { \ + fprintf(stderr, "\n*** libdvdread: CHECK_VALUE failed in %s:%i ***" \ + "\n*** for %s ***\n\n", \ + __FILE__, __LINE__, # arg ); \ + } + + +int get_verbose(void); +int dvdread_verbose(dvd_reader_t *dvd); +dvd_reader_t *device_of_file(dvd_file_t *file); + +#endif /* DVDREAD_INTERNAL_H */ diff --git a/dvdread/ifo_read.c b/dvdread/ifo_read.c new file mode 100644 index 0000000..e58b913 --- /dev/null +++ b/dvdread/ifo_read.c @@ -0,0 +1,2181 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2000, 2001, 2002, 2003 + * Bj�rn Englund , + * H�kan Hjort + * + * 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 + */ + +#include "config.h" + +#include +#include + +#if defined(HAVE_INTTYPES_H) +#include +#elif defined(HAVE_STDINT_H) +#include +#endif + +#include +#include + +#include "bswap.h" +#include "ifo_types.h" +#include "ifo_read.h" +#include "dvd_reader.h" +#include "dvdread_internal.h" + +#ifndef DVD_BLOCK_LEN +#define DVD_BLOCK_LEN 2048 +#endif + +#ifndef NDEBUG +#define CHECK_ZERO0(arg) \ + if(arg != 0) { \ + fprintf(stderr, "*** Zero check failed in %s:%i\n for %s = 0x%x\n", \ + __FILE__, __LINE__, # arg, arg); \ + } +#define CHECK_ZERO(arg) \ + if(memcmp(my_friendly_zeros, &arg, sizeof(arg))) { \ + unsigned int i_CZ; \ + fprintf(stderr, "*** Zero check failed in %s:%i\n for %s = 0x", \ + __FILE__, __LINE__, # arg ); \ + for(i_CZ = 0; i_CZ < sizeof(arg); i_CZ++) \ + fprintf(stderr, "%02x", *((uint8_t *)&arg + i_CZ)); \ + fprintf(stderr, "\n"); \ + } +static const uint8_t my_friendly_zeros[2048]; +#else +#define CHECK_ZERO0(arg) (void)(arg) +#define CHECK_ZERO(arg) (void)(arg) +#endif + + +/* Prototypes for internal functions */ +static int ifoRead_VMG(ifo_handle_t *ifofile); +static int ifoRead_VTS(ifo_handle_t *ifofile); +static int ifoRead_PGC(ifo_handle_t *ifofile, pgc_t *pgc, unsigned int offset); +static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile, + pgc_command_tbl_t *cmd_tbl, + unsigned int offset); +static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile, + pgc_program_map_t *program_map, + unsigned int nr, unsigned int offset); +static int ifoRead_CELL_PLAYBACK_TBL(ifo_handle_t *ifofile, + cell_playback_t *cell_playback, + unsigned int nr, unsigned int offset); +static int ifoRead_CELL_POSITION_TBL(ifo_handle_t *ifofile, + cell_position_t *cell_position, + unsigned int nr, unsigned int offset); +static int ifoRead_VTS_ATTRIBUTES(ifo_handle_t *ifofile, + vts_attributes_t *vts_attributes, + unsigned int offset); +static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile, c_adt_t *c_adt, + unsigned int sector); +static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile, + vobu_admap_t *vobu_admap, + unsigned int sector); +static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit, + unsigned int offset); + +static void ifoFree_PGC(pgc_t *pgc); +static void ifoFree_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl); +static void ifoFree_PGCIT_internal(pgcit_t *pgcit); + +static ifo_handle_t *ifoOpen_File(ifo_handle_t *ifofile, int title, + char *suffix); +static ifo_handle_t *ifoOpenVMGI_File(ifo_handle_t *ifofile, char *suffix); +static ifo_handle_t *ifoOpenVTSI_File(ifo_handle_t *ifofile, int title, + char *suffix); + +static int DVDFileSeek_( dvd_file_t *dvd_file, uint32_t offset ) { + return (DVDFileSeek(dvd_file, (int)offset) == (int)offset); +} + + +ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) { + ifo_handle_t *ifofile; + + ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t)); + if(!ifofile) + return NULL; + + memset(ifofile, 0, sizeof(ifo_handle_t)); + + ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_FILE); + if(!ifoOpen_File(ifofile, title, "IFO")) { + if(title) { + if(dvdread_verbose(dvd) >= 1) { + fprintf(stderr, "libdvdread: Can't open file VTS_%02d_0.%s.\n", + title, "IFO"); + } + } else { + if(dvdread_verbose(dvd) >= 1) { + fprintf(stderr, "libdvdread: Can't open file VIDEO_TS.%s.\n", "IFO"); + } + } + /* lower functions free the pointer, reallocate */ + ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t)); + if(!ifofile) + return NULL; + + memset(ifofile, 0, sizeof(ifo_handle_t)); + + ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_BACKUP_FILE); + if(!ifoOpen_File(ifofile, title, "BUP")) { + if(title) { + if(dvdread_verbose(dvd) >= 1) { + fprintf(stderr, "libdvdread: Can't open file VTS_%02d_0.%s.\n", + title, "BUP"); + } + } else { + if(dvdread_verbose(dvd) >= 1) { + fprintf(stderr, "libdvdread: Can't open file VIDEO_TS.%s.\n", "BUP"); + } + } + return NULL; + } + } + return ifofile; +} + +static ifo_handle_t *ifoOpen_File(ifo_handle_t *ifofile, int title, + char *suffix) { + if(!ifofile->file) { + free(ifofile); + return NULL; + } + + /* First check if this is a VMGI file. */ + if(ifoRead_VMG(ifofile)) { + + /* These are both mandatory. */ + if(!ifoRead_FP_PGC(ifofile) || !ifoRead_TT_SRPT(ifofile)) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 0) { + fprintf(stderr, "libdvdread: Invalid main menu IFO (VIDEO_TS.%s).\n", + suffix); + } + ifoClose(ifofile); + return NULL; + } + + ifoRead_PGCI_UT(ifofile); + ifoRead_PTL_MAIT(ifofile); + + /* This is also mandatory. */ + if(!ifoRead_VTS_ATRT(ifofile)) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 0) { + fprintf(stderr, "libdvdread: Invalid main menu IFO (VIDEO_TS.%s).\n", + suffix); + } + ifoClose(ifofile); + return NULL; + } + + ifoRead_TXTDT_MGI(ifofile); + ifoRead_C_ADT(ifofile); + ifoRead_VOBU_ADMAP(ifofile); + + return ifofile; + } + + if(ifoRead_VTS(ifofile)) { + + if(!ifoRead_VTS_PTT_SRPT(ifofile) || !ifoRead_PGCIT(ifofile)) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 0) { + fprintf(stderr, "libdvdread: Invalid title IFO (VTS_%02d_0.%s).\n", + title, suffix); + } + ifoClose(ifofile); + return NULL; + } + + ifoRead_PGCI_UT(ifofile); + ifoRead_VTS_TMAPT(ifofile); + ifoRead_C_ADT(ifofile); + ifoRead_VOBU_ADMAP(ifofile); + + if(!ifoRead_TITLE_C_ADT(ifofile) || !ifoRead_TITLE_VOBU_ADMAP(ifofile)) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 0) { + fprintf(stderr, "libdvdread: Invalid title IFO (VTS_%02d_0.%s).\n", + title, suffix); + } + ifoClose(ifofile); + return NULL; + } + + return ifofile; + } + + if(title) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 0) { + fprintf(stderr, "libdvdread: Invalid IFO for title %d (VTS_%02d_0.%s).\n", + title, title, suffix); + } + } else { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 0) { + fprintf(stderr, "libdvdread: Invalid IFO for VMGM (VIDEO_TS.%s).\n", + suffix); + } + } + ifoClose(ifofile); + return NULL; +} + + +ifo_handle_t *ifoOpenVMGI(dvd_reader_t *dvd) { + ifo_handle_t *ifofile; + + ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t)); + if(!ifofile) + return NULL; + + memset(ifofile, 0, sizeof(ifo_handle_t)); + + ifofile->file = DVDOpenFile(dvd, 0, DVD_READ_INFO_FILE); + if(!ifoOpenVMGI_File(ifofile, "IFO")) { + if(dvdread_verbose(dvd) >= 1) { + fprintf(stderr, "libdvdread: Can't open file VIDEO_TS.IFO: %s\n", + strerror(errno)); + } + + /* lower functions free the pointer, reallocate */ + ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t)); + if(!ifofile) + return NULL; + + memset(ifofile, 0, sizeof(ifo_handle_t)); + + ifofile->file = DVDOpenFile(dvd, 0, DVD_READ_INFO_BACKUP_FILE); + if(!ifoOpenVMGI_File(ifofile, "BUP")) + if(dvdread_verbose(dvd) >= 1) { + fprintf(stderr, "libdvdread: Can't open file VIDEO_TS.BUP: %s\n", + strerror(errno)); + } + return NULL; + } + return ifofile; +} + +static ifo_handle_t *ifoOpenVMGI_File(ifo_handle_t *ifofile, char *suffix) { + if(!ifofile->file) { + free(ifofile); + return NULL; + } + + if(ifoRead_VMG(ifofile)) + return ifofile; + + if(dvdread_verbose(device_of_file(ifofile->file)) >= 0) { + fprintf(stderr, "libdvdread: Invalid main menu IFO (VIDEO_TS.%s).\n", + suffix); + } + ifoClose(ifofile); + return NULL; +} + + +ifo_handle_t *ifoOpenVTSI(dvd_reader_t *dvd, int title) { + ifo_handle_t *ifofile; + + ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t)); + if(!ifofile) + return NULL; + + memset(ifofile, 0, sizeof(ifo_handle_t)); + + if(title <= 0 || title > 99) { + if(dvdread_verbose(dvd) >= 0) { + fprintf(stderr, "libdvdread: ifoOpenVTSI invalid title (%d).\n", title); + } + free(ifofile); + errno = EINVAL; + return NULL; + } + + ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_FILE); + if(!ifoOpenVTSI_File(ifofile, title, "IFO")) { + if(dvdread_verbose(dvd) >= 1) { + fprintf(stderr, "libdvdread: Can't open file VTS_%02d_0.%s.\n", title, "IFO"); + } + /* lower functions free the pointer, reallocate */ + ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t)); + if(!ifofile) + return NULL; + + memset(ifofile, 0, sizeof(ifo_handle_t)); + + ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_BACKUP_FILE); + if(!ifoOpenVTSI_File(ifofile, title, "BUP")) + if(dvdread_verbose(dvd) >= 1) { + fprintf(stderr, "libdvdread: Can't open file VTS_%02d_0.%s.\n", title, "BUP"); + } + return NULL; + } + return ifofile; +} + +static ifo_handle_t *ifoOpenVTSI_File(ifo_handle_t* ifofile, int title, char *suffix) { + if(!ifofile->file) { + free(ifofile); + return NULL; + } + + ifoRead_VTS(ifofile); + if(ifofile->vtsi_mat) + return ifofile; + + if(dvdread_verbose(device_of_file(ifofile->file)) >= 0) { + fprintf(stderr, "libdvdread: Invalid IFO for title %d (VTS_%02d_0.%s).\n", + title, title, suffix); + } + ifoClose(ifofile); + return NULL; +} + + +void ifoClose(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + ifoFree_VOBU_ADMAP(ifofile); + ifoFree_TITLE_VOBU_ADMAP(ifofile); + ifoFree_C_ADT(ifofile); + ifoFree_TITLE_C_ADT(ifofile); + ifoFree_TXTDT_MGI(ifofile); + ifoFree_VTS_ATRT(ifofile); + ifoFree_PTL_MAIT(ifofile); + ifoFree_PGCI_UT(ifofile); + ifoFree_TT_SRPT(ifofile); + ifoFree_FP_PGC(ifofile); + ifoFree_PGCIT(ifofile); + ifoFree_VTS_PTT_SRPT(ifofile); + ifoFree_VTS_TMAPT(ifofile); + + if(ifofile->vmgi_mat) + free(ifofile->vmgi_mat); + + if(ifofile->vtsi_mat) + free(ifofile->vtsi_mat); + + DVDCloseFile(ifofile->file); + ifofile->file = 0; + free(ifofile); + ifofile = 0; +} + + +static int ifoRead_VMG(ifo_handle_t *ifofile) { + vmgi_mat_t *vmgi_mat; + + vmgi_mat = (vmgi_mat_t *)malloc(sizeof(vmgi_mat_t)); + if(!vmgi_mat) + return 0; + + ifofile->vmgi_mat = vmgi_mat; + + if(!DVDFileSeek_(ifofile->file, 0)) { + free(ifofile->vmgi_mat); + ifofile->vmgi_mat = 0; + return 0; + } + + if(!DVDReadBytes(ifofile->file, vmgi_mat, sizeof(vmgi_mat_t))) { + free(ifofile->vmgi_mat); + ifofile->vmgi_mat = 0; + return 0; + } + + if(strncmp("DVDVIDEO-VMG", vmgi_mat->vmg_identifier, 12) != 0) { + free(ifofile->vmgi_mat); + ifofile->vmgi_mat = 0; + return 0; + } + + B2N_32(vmgi_mat->vmg_last_sector); + B2N_32(vmgi_mat->vmgi_last_sector); + B2N_32(vmgi_mat->vmg_category); + B2N_16(vmgi_mat->vmg_nr_of_volumes); + B2N_16(vmgi_mat->vmg_this_volume_nr); + B2N_16(vmgi_mat->vmg_nr_of_title_sets); + B2N_64(vmgi_mat->vmg_pos_code); + B2N_32(vmgi_mat->vmgi_last_byte); + B2N_32(vmgi_mat->first_play_pgc); + B2N_32(vmgi_mat->vmgm_vobs); + B2N_32(vmgi_mat->tt_srpt); + B2N_32(vmgi_mat->vmgm_pgci_ut); + B2N_32(vmgi_mat->ptl_mait); + B2N_32(vmgi_mat->vts_atrt); + B2N_32(vmgi_mat->txtdt_mgi); + B2N_32(vmgi_mat->vmgm_c_adt); + B2N_32(vmgi_mat->vmgm_vobu_admap); + B2N_16(vmgi_mat->vmgm_audio_attr.lang_code); + B2N_16(vmgi_mat->vmgm_subp_attr.lang_code); + + + CHECK_ZERO(vmgi_mat->zero_1); + CHECK_ZERO(vmgi_mat->zero_2); + CHECK_ZERO(vmgi_mat->zero_3); + CHECK_ZERO(vmgi_mat->zero_4); + CHECK_ZERO(vmgi_mat->zero_5); + CHECK_ZERO(vmgi_mat->zero_6); + CHECK_ZERO(vmgi_mat->zero_7); + CHECK_ZERO(vmgi_mat->zero_8); + CHECK_ZERO(vmgi_mat->zero_9); + CHECK_ZERO(vmgi_mat->zero_10); + CHECK_VALUE(vmgi_mat->vmg_last_sector != 0); + CHECK_VALUE(vmgi_mat->vmgi_last_sector != 0); + CHECK_VALUE(vmgi_mat->vmgi_last_sector * 2 <= vmgi_mat->vmg_last_sector); + CHECK_VALUE(vmgi_mat->vmgi_last_sector * 2 <= vmgi_mat->vmg_last_sector); + CHECK_VALUE(vmgi_mat->vmg_nr_of_volumes != 0); + CHECK_VALUE(vmgi_mat->vmg_this_volume_nr != 0); + CHECK_VALUE(vmgi_mat->vmg_this_volume_nr <= vmgi_mat->vmg_nr_of_volumes); + CHECK_VALUE(vmgi_mat->disc_side == 1 || vmgi_mat->disc_side == 2); + CHECK_VALUE(vmgi_mat->vmg_nr_of_title_sets != 0); + CHECK_VALUE(vmgi_mat->vmgi_last_byte >= 341); + CHECK_VALUE(vmgi_mat->vmgi_last_byte / DVD_BLOCK_LEN <= + vmgi_mat->vmgi_last_sector); + /* It seems that first_play_pgc is optional. */ + CHECK_VALUE(vmgi_mat->first_play_pgc < vmgi_mat->vmgi_last_byte); + CHECK_VALUE(vmgi_mat->vmgm_vobs == 0 || + (vmgi_mat->vmgm_vobs > vmgi_mat->vmgi_last_sector && + vmgi_mat->vmgm_vobs < vmgi_mat->vmg_last_sector)); + CHECK_VALUE(vmgi_mat->tt_srpt <= vmgi_mat->vmgi_last_sector); + CHECK_VALUE(vmgi_mat->vmgm_pgci_ut <= vmgi_mat->vmgi_last_sector); + CHECK_VALUE(vmgi_mat->ptl_mait <= vmgi_mat->vmgi_last_sector); + CHECK_VALUE(vmgi_mat->vts_atrt <= vmgi_mat->vmgi_last_sector); + CHECK_VALUE(vmgi_mat->txtdt_mgi <= vmgi_mat->vmgi_last_sector); + CHECK_VALUE(vmgi_mat->vmgm_c_adt <= vmgi_mat->vmgi_last_sector); + CHECK_VALUE(vmgi_mat->vmgm_vobu_admap <= vmgi_mat->vmgi_last_sector); + + CHECK_VALUE(vmgi_mat->nr_of_vmgm_audio_streams <= 1); + CHECK_VALUE(vmgi_mat->nr_of_vmgm_subp_streams <= 1); + + return 1; +} + + +static int ifoRead_VTS(ifo_handle_t *ifofile) { + vtsi_mat_t *vtsi_mat; + int i; + + vtsi_mat = (vtsi_mat_t *)malloc(sizeof(vtsi_mat_t)); + if(!vtsi_mat) + return 0; + + ifofile->vtsi_mat = vtsi_mat; + + if(!DVDFileSeek_(ifofile->file, 0)) { + free(ifofile->vtsi_mat); + ifofile->vtsi_mat = 0; + return 0; + } + + if(!(DVDReadBytes(ifofile->file, vtsi_mat, sizeof(vtsi_mat_t)))) { + free(ifofile->vtsi_mat); + ifofile->vtsi_mat = 0; + return 0; + } + + if(strncmp("DVDVIDEO-VTS", vtsi_mat->vts_identifier, 12) != 0) { + free(ifofile->vtsi_mat); + ifofile->vtsi_mat = 0; + return 0; + } + + B2N_32(vtsi_mat->vts_last_sector); + B2N_32(vtsi_mat->vtsi_last_sector); + B2N_32(vtsi_mat->vts_category); + B2N_32(vtsi_mat->vtsi_last_byte); + B2N_32(vtsi_mat->vtsm_vobs); + B2N_32(vtsi_mat->vtstt_vobs); + B2N_32(vtsi_mat->vts_ptt_srpt); + B2N_32(vtsi_mat->vts_pgcit); + B2N_32(vtsi_mat->vtsm_pgci_ut); + B2N_32(vtsi_mat->vts_tmapt); + B2N_32(vtsi_mat->vtsm_c_adt); + B2N_32(vtsi_mat->vtsm_vobu_admap); + B2N_32(vtsi_mat->vts_c_adt); + B2N_32(vtsi_mat->vts_vobu_admap); + B2N_16(vtsi_mat->vtsm_audio_attr.lang_code); + B2N_16(vtsi_mat->vtsm_subp_attr.lang_code); + for(i = 0; i < 8; i++) + B2N_16(vtsi_mat->vts_audio_attr[i].lang_code); + for(i = 0; i < 32; i++) + B2N_16(vtsi_mat->vts_subp_attr[i].lang_code); + + + CHECK_ZERO(vtsi_mat->zero_1); + CHECK_ZERO(vtsi_mat->zero_2); + CHECK_ZERO(vtsi_mat->zero_3); + CHECK_ZERO(vtsi_mat->zero_4); + CHECK_ZERO(vtsi_mat->zero_5); + CHECK_ZERO(vtsi_mat->zero_6); + CHECK_ZERO(vtsi_mat->zero_7); + CHECK_ZERO(vtsi_mat->zero_8); + CHECK_ZERO(vtsi_mat->zero_9); + CHECK_ZERO(vtsi_mat->zero_10); + CHECK_ZERO(vtsi_mat->zero_11); + CHECK_ZERO(vtsi_mat->zero_12); + CHECK_ZERO(vtsi_mat->zero_13); + CHECK_ZERO(vtsi_mat->zero_14); + CHECK_ZERO(vtsi_mat->zero_15); + CHECK_ZERO(vtsi_mat->zero_16); + CHECK_ZERO(vtsi_mat->zero_17); + CHECK_ZERO(vtsi_mat->zero_18); + CHECK_ZERO(vtsi_mat->zero_19); + CHECK_ZERO(vtsi_mat->zero_20); + CHECK_ZERO(vtsi_mat->zero_21); + CHECK_VALUE(vtsi_mat->vtsi_last_sector*2 <= vtsi_mat->vts_last_sector); + CHECK_VALUE(vtsi_mat->vtsi_last_byte/DVD_BLOCK_LEN <= vtsi_mat->vtsi_last_sector); + CHECK_VALUE(vtsi_mat->vtsm_vobs == 0 || + (vtsi_mat->vtsm_vobs > vtsi_mat->vtsi_last_sector && + vtsi_mat->vtsm_vobs < vtsi_mat->vts_last_sector)); + CHECK_VALUE(vtsi_mat->vtstt_vobs == 0 || + (vtsi_mat->vtstt_vobs > vtsi_mat->vtsi_last_sector && + vtsi_mat->vtstt_vobs < vtsi_mat->vts_last_sector)); + CHECK_VALUE(vtsi_mat->vts_ptt_srpt <= vtsi_mat->vtsi_last_sector); + CHECK_VALUE(vtsi_mat->vts_pgcit <= vtsi_mat->vtsi_last_sector); + CHECK_VALUE(vtsi_mat->vtsm_pgci_ut <= vtsi_mat->vtsi_last_sector); + CHECK_VALUE(vtsi_mat->vts_tmapt <= vtsi_mat->vtsi_last_sector); + CHECK_VALUE(vtsi_mat->vtsm_c_adt <= vtsi_mat->vtsi_last_sector); + CHECK_VALUE(vtsi_mat->vtsm_vobu_admap <= vtsi_mat->vtsi_last_sector); + CHECK_VALUE(vtsi_mat->vts_c_adt <= vtsi_mat->vtsi_last_sector); + CHECK_VALUE(vtsi_mat->vts_vobu_admap <= vtsi_mat->vtsi_last_sector); + + CHECK_VALUE(vtsi_mat->nr_of_vtsm_audio_streams <= 1); + CHECK_VALUE(vtsi_mat->nr_of_vtsm_subp_streams <= 1); + + CHECK_VALUE(vtsi_mat->nr_of_vts_audio_streams <= 8); + for(i = vtsi_mat->nr_of_vts_audio_streams; i < 8; i++) + CHECK_ZERO(vtsi_mat->vts_audio_attr[i]); + + CHECK_VALUE(vtsi_mat->nr_of_vts_subp_streams <= 32); + for(i = vtsi_mat->nr_of_vts_subp_streams; i < 32; i++) + CHECK_ZERO(vtsi_mat->vts_subp_attr[i]); + + for(i = 0; i < 8; i++) { + CHECK_ZERO0(vtsi_mat->vts_mu_audio_attr[i].zero1); + CHECK_ZERO0(vtsi_mat->vts_mu_audio_attr[i].zero2); + CHECK_ZERO0(vtsi_mat->vts_mu_audio_attr[i].zero3); + CHECK_ZERO0(vtsi_mat->vts_mu_audio_attr[i].zero4); + CHECK_ZERO0(vtsi_mat->vts_mu_audio_attr[i].zero5); + CHECK_ZERO(vtsi_mat->vts_mu_audio_attr[i].zero6); + } + + return 1; +} + + +static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile, + pgc_command_tbl_t *cmd_tbl, + unsigned int offset) { + unsigned int total; + + memset(cmd_tbl, 0, sizeof(pgc_command_tbl_t)); + + if(!DVDFileSeek_(ifofile->file, offset)) + return 0; + + if(!(DVDReadBytes(ifofile->file, cmd_tbl, PGC_COMMAND_TBL_SIZE))) + return 0; + + B2N_16(cmd_tbl->nr_of_pre); + B2N_16(cmd_tbl->nr_of_post); + B2N_16(cmd_tbl->nr_of_cell); + B2N_16(cmd_tbl->last_byte); + + total = cmd_tbl->nr_of_pre + cmd_tbl->nr_of_post + cmd_tbl->nr_of_cell; + CHECK_VALUE(PGC_COMMAND_TBL_SIZE + total * COMMAND_DATA_SIZE + <= cmd_tbl->last_byte + 1U); + CHECK_VALUE(total <= 255); + + if(cmd_tbl->nr_of_pre != 0) { + unsigned int pre_cmds_size = cmd_tbl->nr_of_pre * COMMAND_DATA_SIZE; + cmd_tbl->pre_cmds = (vm_cmd_t *)malloc(pre_cmds_size); + if(!cmd_tbl->pre_cmds) + return 0; + + if(!(DVDReadBytes(ifofile->file, cmd_tbl->pre_cmds, pre_cmds_size))) { + free(cmd_tbl->pre_cmds); + return 0; + } + } + + if(cmd_tbl->nr_of_post != 0) { + unsigned int post_cmds_size = cmd_tbl->nr_of_post * COMMAND_DATA_SIZE; + cmd_tbl->post_cmds = (vm_cmd_t *)malloc(post_cmds_size); + if(!cmd_tbl->post_cmds) { + if(cmd_tbl->pre_cmds) + free(cmd_tbl->pre_cmds); + return 0; + } + if(!(DVDReadBytes(ifofile->file, cmd_tbl->post_cmds, post_cmds_size))) { + if(cmd_tbl->pre_cmds) + free(cmd_tbl->pre_cmds); + free(cmd_tbl->post_cmds); + return 0; + } + } + + if(cmd_tbl->nr_of_cell != 0) { + unsigned int cell_cmds_size = cmd_tbl->nr_of_cell * COMMAND_DATA_SIZE; + cmd_tbl->cell_cmds = (vm_cmd_t *)malloc(cell_cmds_size); + if(!cmd_tbl->cell_cmds) { + if(cmd_tbl->pre_cmds) + free(cmd_tbl->pre_cmds); + if(cmd_tbl->post_cmds) + free(cmd_tbl->post_cmds); + return 0; + } + if(!(DVDReadBytes(ifofile->file, cmd_tbl->cell_cmds, cell_cmds_size))) { + if(cmd_tbl->pre_cmds) + free(cmd_tbl->pre_cmds); + if(cmd_tbl->post_cmds) + free(cmd_tbl->post_cmds); + free(cmd_tbl->cell_cmds); + return 0; + } + } + + /* + * Make a run over all the commands and see that we can interpret them all? + */ + return 1; +} + + +static void ifoFree_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl) { + if(cmd_tbl) { + if(cmd_tbl->nr_of_pre && cmd_tbl->pre_cmds) + free(cmd_tbl->pre_cmds); + if(cmd_tbl->nr_of_post && cmd_tbl->post_cmds) + free(cmd_tbl->post_cmds); + if(cmd_tbl->nr_of_cell && cmd_tbl->cell_cmds) + free(cmd_tbl->cell_cmds); + free(cmd_tbl); + } +} + +static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile, + pgc_program_map_t *program_map, + unsigned int nr, unsigned int offset) { + unsigned int size = nr * sizeof(pgc_program_map_t); + + if(!DVDFileSeek_(ifofile->file, offset)) + return 0; + + if(!(DVDReadBytes(ifofile->file, program_map, size))) + return 0; + + return 1; +} + +static int ifoRead_CELL_PLAYBACK_TBL(ifo_handle_t *ifofile, + cell_playback_t *cell_playback, + unsigned int nr, unsigned int offset) { + unsigned int i; + unsigned int size = nr * sizeof(cell_playback_t); + + if(!DVDFileSeek_(ifofile->file, offset)) + return 0; + + if(!(DVDReadBytes(ifofile->file, cell_playback, size))) + return 0; + + for(i = 0; i < nr; i++) { + B2N_32(cell_playback[i].first_sector); + B2N_32(cell_playback[i].first_ilvu_end_sector); + B2N_32(cell_playback[i].last_vobu_start_sector); + B2N_32(cell_playback[i].last_sector); + + /* Changed < to <= because this was false in the movie 'Pi'. */ + CHECK_VALUE(cell_playback[i].last_vobu_start_sector <= + cell_playback[i].last_sector); + CHECK_VALUE(cell_playback[i].first_sector <= + cell_playback[i].last_vobu_start_sector); + } + + return 1; +} + + +static int ifoRead_CELL_POSITION_TBL(ifo_handle_t *ifofile, + cell_position_t *cell_position, + unsigned int nr, unsigned int offset) { + unsigned int i; + unsigned int size = nr * sizeof(cell_position_t); + + if(!DVDFileSeek_(ifofile->file, offset)) + return 0; + + if(!(DVDReadBytes(ifofile->file, cell_position, size))) + return 0; + + for(i = 0; i < nr; i++) { + B2N_16(cell_position[i].vob_id_nr); + CHECK_ZERO(cell_position[i].zero_1); + } + + return 1; +} + +static int ifoRead_PGC(ifo_handle_t *ifofile, pgc_t *pgc, unsigned int offset) { + unsigned int i; + + if(!DVDFileSeek_(ifofile->file, offset)) + return 0; + + if(!(DVDReadBytes(ifofile->file, pgc, PGC_SIZE))) + return 0; + + B2N_16(pgc->next_pgc_nr); + B2N_16(pgc->prev_pgc_nr); + B2N_16(pgc->goup_pgc_nr); + B2N_16(pgc->command_tbl_offset); + B2N_16(pgc->program_map_offset); + B2N_16(pgc->cell_playback_offset); + B2N_16(pgc->cell_position_offset); + + for(i = 0; i < 8; i++) + B2N_16(pgc->audio_control[i]); + for(i = 0; i < 32; i++) + B2N_32(pgc->subp_control[i]); + for(i = 0; i < 16; i++) + B2N_32(pgc->palette[i]); + + CHECK_ZERO(pgc->zero_1); + CHECK_VALUE(pgc->nr_of_programs <= pgc->nr_of_cells); + + /* verify time (look at print_time) */ + for(i = 0; i < 8; i++) + if(!pgc->audio_control[i] & 0x8000) /* The 'is present' bit */ + CHECK_ZERO(pgc->audio_control[i]); + for(i = 0; i < 32; i++) + if(!pgc->subp_control[i] & 0x80000000) /* The 'is present' bit */ + CHECK_ZERO(pgc->subp_control[i]); + + /* Check that time is 0:0:0:0 also if nr_of_programs == 0 */ + if(pgc->nr_of_programs == 0) { + CHECK_ZERO(pgc->still_time); + CHECK_ZERO(pgc->pg_playback_mode); /* ??*/ + CHECK_VALUE(pgc->program_map_offset == 0); + CHECK_VALUE(pgc->cell_playback_offset == 0); + CHECK_VALUE(pgc->cell_position_offset == 0); + } else { + CHECK_VALUE(pgc->program_map_offset != 0); + CHECK_VALUE(pgc->cell_playback_offset != 0); + CHECK_VALUE(pgc->cell_position_offset != 0); + } + + if(pgc->command_tbl_offset != 0) { + pgc->command_tbl = malloc(sizeof(pgc_command_tbl_t)); + if(!pgc->command_tbl) + return 0; + + if(!ifoRead_PGC_COMMAND_TBL(ifofile, pgc->command_tbl, + offset + pgc->command_tbl_offset)) { + free(pgc->command_tbl); + return 0; + } + } else { + pgc->command_tbl = NULL; + } + + if(pgc->program_map_offset != 0) { + if(pgc->nr_of_programs != 0) { + + pgc->program_map = malloc(pgc->nr_of_programs * sizeof(pgc_program_map_t)); + if(!pgc->program_map) { + ifoFree_PGC_COMMAND_TBL(pgc->command_tbl); + return 0; + } + if(!ifoRead_PGC_PROGRAM_MAP(ifofile, pgc->program_map,pgc->nr_of_programs, + offset + pgc->program_map_offset)) { + ifoFree_PGC_COMMAND_TBL(pgc->command_tbl); + free(pgc->program_map); + return 0; + } + } else { + pgc->program_map = NULL; + } + } else { + pgc->program_map = NULL; + } + + if(pgc->cell_playback_offset != 0) { + if(pgc->nr_of_cells != 0) { + + pgc->cell_playback = malloc(pgc->nr_of_cells * sizeof(cell_playback_t)); + if(!pgc->cell_playback) { + ifoFree_PGC_COMMAND_TBL(pgc->command_tbl); + if(pgc->program_map) + free(pgc->program_map); + return 0; + } + if(!ifoRead_CELL_PLAYBACK_TBL(ifofile, pgc->cell_playback, + pgc->nr_of_cells, + offset + pgc->cell_playback_offset)) { + ifoFree_PGC_COMMAND_TBL(pgc->command_tbl); + if(pgc->program_map) + free(pgc->program_map); + free(pgc->cell_playback); + return 0; + } + } else { + pgc->cell_playback = NULL; + } + } else { + pgc->cell_playback = NULL; + } + + if(pgc->cell_position_offset != 0) { + if(pgc->nr_of_cells != 0) { + + pgc->cell_position = malloc(pgc->nr_of_cells * sizeof(cell_position_t)); + if(!pgc->cell_position) { + ifoFree_PGC(pgc); + return 0; + } + if(!ifoRead_CELL_POSITION_TBL(ifofile, pgc->cell_position, + pgc->nr_of_cells, + offset + pgc->cell_position_offset)) { + ifoFree_PGC(pgc); + return 0; + } + } else { + pgc->cell_position = NULL; + } + } else { + pgc->cell_position = NULL; + } + + return 1; +} + +int ifoRead_FP_PGC(ifo_handle_t *ifofile) { + + if(!ifofile) + return 0; + + if(!ifofile->vmgi_mat) + return 0; + + /* It seems that first_play_pgc is optional after all. */ + ifofile->first_play_pgc = 0; + if(ifofile->vmgi_mat->first_play_pgc == 0) + return 1; + + ifofile->first_play_pgc = (pgc_t *)malloc(sizeof(pgc_t)); + if(!ifofile->first_play_pgc) + return 0; + + if(!ifoRead_PGC(ifofile, ifofile->first_play_pgc, + ifofile->vmgi_mat->first_play_pgc)) { + free(ifofile->first_play_pgc); + ifofile->first_play_pgc = 0; + return 0; + } + + return 1; +} + +static void ifoFree_PGC(pgc_t *pgc) { + if(pgc) { + ifoFree_PGC_COMMAND_TBL(pgc->command_tbl); + if(pgc->program_map) + free(pgc->program_map); + if(pgc->cell_playback) + free(pgc->cell_playback); + if(pgc->cell_position) + free(pgc->cell_position); + } +} + +void ifoFree_FP_PGC(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + if(ifofile->first_play_pgc) { + ifoFree_PGC(ifofile->first_play_pgc); + free(ifofile->first_play_pgc); + ifofile->first_play_pgc = 0; + } +} + + +int ifoRead_TT_SRPT(ifo_handle_t *ifofile) { + tt_srpt_t *tt_srpt; + int i, info_length; + + if(!ifofile) + return 0; + + if(!ifofile->vmgi_mat) + return 0; + + if(ifofile->vmgi_mat->tt_srpt == 0) /* mandatory */ + return 0; + + if(!DVDFileSeek_(ifofile->file, ifofile->vmgi_mat->tt_srpt * DVD_BLOCK_LEN)) + return 0; + + tt_srpt = (tt_srpt_t *)malloc(sizeof(tt_srpt_t)); + if(!tt_srpt) + return 0; + + ifofile->tt_srpt = tt_srpt; + + if(!(DVDReadBytes(ifofile->file, tt_srpt, TT_SRPT_SIZE))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n"); + } + free(tt_srpt); + return 0; + } + + B2N_16(tt_srpt->nr_of_srpts); + B2N_32(tt_srpt->last_byte); + + info_length = tt_srpt->last_byte + 1 - TT_SRPT_SIZE; + + tt_srpt->title = (title_info_t *)malloc(info_length); + if(!tt_srpt->title) { + free(tt_srpt); + ifofile->tt_srpt = 0; + return 0; + } + if(!(DVDReadBytes(ifofile->file, tt_srpt->title, info_length))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n"); + } + ifoFree_TT_SRPT(ifofile); + return 0; + } + + for(i = 0; i < tt_srpt->nr_of_srpts; i++) { + B2N_16(tt_srpt->title[i].nr_of_ptts); + B2N_16(tt_srpt->title[i].parental_id); + B2N_32(tt_srpt->title[i].title_set_sector); + } + + + CHECK_ZERO(tt_srpt->zero_1); + CHECK_VALUE(tt_srpt->nr_of_srpts != 0); + CHECK_VALUE(tt_srpt->nr_of_srpts < 100); /*??*/ + CHECK_VALUE(tt_srpt->nr_of_srpts * sizeof(title_info_t) <= info_length); + + for(i = 0; i < tt_srpt->nr_of_srpts; i++) { + CHECK_VALUE(tt_srpt->title[i].pb_ty.zero_1 == 0); + CHECK_VALUE(tt_srpt->title[i].nr_of_angles != 0); + CHECK_VALUE(tt_srpt->title[i].nr_of_angles < 10); + /*CHECK_VALUE(tt_srpt->title[i].nr_of_ptts != 0); + / XXX: this assertion breaks Ghostbusters:*/ + CHECK_VALUE(tt_srpt->title[i].nr_of_ptts < 1000); /*??*/ + CHECK_VALUE(tt_srpt->title[i].title_set_nr != 0); + CHECK_VALUE(tt_srpt->title[i].title_set_nr < 100); /* ?? */ + CHECK_VALUE(tt_srpt->title[i].vts_ttn != 0); + CHECK_VALUE(tt_srpt->title[i].vts_ttn < 100); /* ?? */ + /*CHECK_VALUE(tt_srpt->title[i].title_set_sector != 0);*/ + } + + /* Make this a function*/ +#if 0 + if(memcmp((uint8_t *)tt_srpt->title + + tt_srpt->nr_of_srpts * sizeof(title_info_t), + my_friendly_zeros, + info_length - tt_srpt->nr_of_srpts * sizeof(title_info_t))) { + fprintf(stderr, "VMG_PTT_SRPT slack is != 0, "); + hexdump((uint8_t *)tt_srpt->title + + tt_srpt->nr_of_srpts * sizeof(title_info_t), + info_length - tt_srpt->nr_of_srpts * sizeof(title_info_t)); + } +#endif + + return 1; +} + + +void ifoFree_TT_SRPT(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + if(ifofile->tt_srpt) { + free(ifofile->tt_srpt->title); + free(ifofile->tt_srpt); + ifofile->tt_srpt = 0; + } +} + + +int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) { + vts_ptt_srpt_t *vts_ptt_srpt; + int info_length, i, j; + uint32_t *data; + + if(!ifofile) + return 0; + + if(!ifofile->vtsi_mat) + return 0; + + if(ifofile->vtsi_mat->vts_ptt_srpt == 0) /* mandatory */ + return 0; + + if(!DVDFileSeek_(ifofile->file, + ifofile->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN)) + return 0; + + vts_ptt_srpt = (vts_ptt_srpt_t *)malloc(sizeof(vts_ptt_srpt_t)); + if(!vts_ptt_srpt) + return 0; + + ifofile->vts_ptt_srpt = vts_ptt_srpt; + + if(!(DVDReadBytes(ifofile->file, vts_ptt_srpt, VTS_PTT_SRPT_SIZE))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read PTT search table.\n"); + } + free(vts_ptt_srpt); + return 0; + } + + B2N_16(vts_ptt_srpt->nr_of_srpts); + B2N_32(vts_ptt_srpt->last_byte); + + CHECK_ZERO(vts_ptt_srpt->zero_1); + CHECK_VALUE(vts_ptt_srpt->nr_of_srpts != 0); + CHECK_VALUE(vts_ptt_srpt->nr_of_srpts < 100); /* ??*/ + + info_length = vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE; + + data = (uint32_t *)malloc(info_length); + if(!data) { + free(vts_ptt_srpt); + ifofile->vts_ptt_srpt = 0; + return 0; + } + if(!(DVDReadBytes(ifofile->file, data, info_length))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read PTT search table.\n"); + } + free(vts_ptt_srpt); + free(data); + ifofile->vts_ptt_srpt = 0; + return 0; + } + + for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) { + B2N_32(data[i]); + /* assert(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1); + Magic Knight Rayearth Daybreak is mastered very strange and has + Titles with 0 PTTs. They all have a data[i] offsets beyond the end of + of the vts_ptt_srpt structure. */ + CHECK_VALUE(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1 + 4); + } + + vts_ptt_srpt->ttu_offset = data; + + vts_ptt_srpt->title = malloc(vts_ptt_srpt->nr_of_srpts * sizeof(ttu_t)); + if(!vts_ptt_srpt->title) { + free(vts_ptt_srpt); + free(data); + ifofile->vts_ptt_srpt = 0; + return 0; + } + for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) { + int n; + if(i < vts_ptt_srpt->nr_of_srpts - 1) + n = (data[i+1] - data[i]); + else + n = (vts_ptt_srpt->last_byte + 1 - data[i]); + /* assert(n > 0 && (n % 4) == 0); + Magic Knight Rayearth Daybreak is mastered very strange and has + Titles with 0 PTTs. */ + if(n < 0) n = 0; + CHECK_VALUE(n % 4 == 0); + + vts_ptt_srpt->title[i].nr_of_ptts = n / 4; + vts_ptt_srpt->title[i].ptt = malloc(n * sizeof(ptt_info_t)); + if(!vts_ptt_srpt->title[i].ptt) { + for(n = 0; n < i; n++) + free(vts_ptt_srpt->title[n].ptt); + free(vts_ptt_srpt); + free(data); + ifofile->vts_ptt_srpt = 0; + return 0; + } + for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) { + /* The assert placed here because of Magic Knight Rayearth Daybreak */ + CHECK_VALUE(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1); + vts_ptt_srpt->title[i].ptt[j].pgcn + = *(uint16_t*)(((char *)data) + data[i] + 4*j - VTS_PTT_SRPT_SIZE); + vts_ptt_srpt->title[i].ptt[j].pgn + = *(uint16_t*)(((char *)data) + data[i] + 4*j + 2 - VTS_PTT_SRPT_SIZE); + } + } + + for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) { + for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) { + B2N_16(vts_ptt_srpt->title[i].ptt[j].pgcn); + B2N_16(vts_ptt_srpt->title[i].ptt[j].pgn); + } + } + + for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) { + CHECK_VALUE(vts_ptt_srpt->title[i].nr_of_ptts < 1000); /* ??*/ + for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) { + CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgcn != 0 ); + CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgcn < 1000); /* ??*/ + CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgn != 0); + CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgn < 100); /* ?? */ + } + } + + return 1; +} + + +void ifoFree_VTS_PTT_SRPT(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + if(ifofile->vts_ptt_srpt) { + int i; + for(i = 0; i < ifofile->vts_ptt_srpt->nr_of_srpts; i++) + free(ifofile->vts_ptt_srpt->title[i].ptt); + free(ifofile->vts_ptt_srpt->ttu_offset); + free(ifofile->vts_ptt_srpt->title); + free(ifofile->vts_ptt_srpt); + ifofile->vts_ptt_srpt = 0; + } +} + + +int ifoRead_PTL_MAIT(ifo_handle_t *ifofile) { + ptl_mait_t *ptl_mait; + int info_length; + unsigned int i, j; + + if(!ifofile) + return 0; + + if(!ifofile->vmgi_mat) + return 0; + + if(ifofile->vmgi_mat->ptl_mait == 0) + return 1; + + if(!DVDFileSeek_(ifofile->file, ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN)) + return 0; + + ptl_mait = (ptl_mait_t *)malloc(sizeof(ptl_mait_t)); + if(!ptl_mait) + return 0; + + ifofile->ptl_mait = ptl_mait; + + if(!(DVDReadBytes(ifofile->file, ptl_mait, PTL_MAIT_SIZE))) { + free(ptl_mait); + ifofile->ptl_mait = 0; + return 0; + } + + B2N_16(ptl_mait->nr_of_countries); + B2N_16(ptl_mait->nr_of_vtss); + B2N_32(ptl_mait->last_byte); + + CHECK_VALUE(ptl_mait->nr_of_countries != 0); + CHECK_VALUE(ptl_mait->nr_of_countries < 100); /* ?? */ + CHECK_VALUE(ptl_mait->nr_of_vtss != 0); + CHECK_VALUE(ptl_mait->nr_of_vtss < 100); /* ?? */ + CHECK_VALUE(ptl_mait->nr_of_countries * PTL_MAIT_COUNTRY_SIZE + <= ptl_mait->last_byte + 1 - PTL_MAIT_SIZE); + + info_length = ptl_mait->nr_of_countries * sizeof(ptl_mait_country_t); + ptl_mait->countries = (ptl_mait_country_t *)malloc(info_length); + if(!ptl_mait->countries) { + free(ptl_mait); + ifofile->ptl_mait = 0; + return 0; + } + + for(i = 0; i < ptl_mait->nr_of_countries; i++) { + if(!(DVDReadBytes(ifofile->file, &ptl_mait->countries[i], PTL_MAIT_COUNTRY_SIZE))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read PTL_MAIT.\n"); + } + free(ptl_mait->countries); + free(ptl_mait); + ifofile->ptl_mait = 0; + return 0; + } + } + + for(i = 0; i < ptl_mait->nr_of_countries; i++) { + B2N_16(ptl_mait->countries[i].country_code); + B2N_16(ptl_mait->countries[i].pf_ptl_mai_start_byte); + } + + for(i = 0; i < ptl_mait->nr_of_countries; i++) { + CHECK_ZERO(ptl_mait->countries[i].zero_1); + CHECK_ZERO(ptl_mait->countries[i].zero_2); + CHECK_VALUE(ptl_mait->countries[i].pf_ptl_mai_start_byte + + 16U * (ptl_mait->nr_of_vtss + 1) <= ptl_mait->last_byte + 1U); + } + + for(i = 0; i < ptl_mait->nr_of_countries; i++) { + uint16_t *pf_temp; + + if(!DVDFileSeek_(ifofile->file, + ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN + + ptl_mait->countries[i].pf_ptl_mai_start_byte)) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to seak PTL_MAIT table.\n"); + } + free(ptl_mait->countries); + free(ptl_mait); + return 0; + } + info_length = (ptl_mait->nr_of_vtss + 1) * sizeof(pf_level_t); + pf_temp = (uint16_t *)malloc(info_length); + if(!pf_temp) { + for(j = 0; j < i ; j++) { + free(ptl_mait->countries[j].pf_ptl_mai); + } + free(ptl_mait->countries); + free(ptl_mait); + return 0; + } + if(!(DVDReadBytes(ifofile->file, pf_temp, info_length))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read PTL_MAIT table.\n"); + } + free(pf_temp); + for(j = 0; j < i ; j++) { + free(ptl_mait->countries[j].pf_ptl_mai); + } + free(ptl_mait->countries); + free(ptl_mait); + return 0; + } + for (j = 0; j < ((ptl_mait->nr_of_vtss + 1) * 8); j++) { + B2N_16(pf_temp[j]); + } + ptl_mait->countries[i].pf_ptl_mai = (pf_level_t *)malloc(info_length); + if(!ptl_mait->countries[i].pf_ptl_mai) { + free(pf_temp); + for(j = 0; j < i ; j++) { + free(ptl_mait->countries[j].pf_ptl_mai); + } + free(ptl_mait->countries); + free(ptl_mait); + return 0; + } + { /* Transpose the array so we can use C indexing. */ + int level, vts; + for(level = 0; level < 8; level++) { + for(vts = 0; vts <= ptl_mait->nr_of_vtss; vts++) { + ptl_mait->countries[i].pf_ptl_mai[vts][level] = + pf_temp[(7-level)*(ptl_mait->nr_of_vtss+1) + vts]; + } + } + free(pf_temp); + } + } + return 1; +} + +void ifoFree_PTL_MAIT(ifo_handle_t *ifofile) { + unsigned int i; + + if(!ifofile) + return; + + if(ifofile->ptl_mait) { + for(i = 0; i < ifofile->ptl_mait->nr_of_countries; i++) { + free(ifofile->ptl_mait->countries[i].pf_ptl_mai); + } + free(ifofile->ptl_mait->countries); + free(ifofile->ptl_mait); + ifofile->ptl_mait = 0; + } +} + +int ifoRead_VTS_TMAPT(ifo_handle_t *ifofile) { + vts_tmapt_t *vts_tmapt; + uint32_t *vts_tmap_srp; + unsigned int offset; + int info_length; + unsigned int i, j; + + if(!ifofile) + return 0; + + if(!ifofile->vtsi_mat) + return 0; + + /* Seems to be optional, at least when there are no OneSequencial Titles */ + if(ifofile->vtsi_mat->vts_tmapt == 0) { + ifofile->vts_tmapt = NULL; + return 1; + } + + offset = ifofile->vtsi_mat->vts_tmapt * DVD_BLOCK_LEN; + + if(!DVDFileSeek_(ifofile->file, offset)) + return 0; + + vts_tmapt = (vts_tmapt_t *)malloc(sizeof(vts_tmapt_t)); + if(!vts_tmapt) + return 0; + + ifofile->vts_tmapt = vts_tmapt; + + if(!(DVDReadBytes(ifofile->file, vts_tmapt, VTS_TMAPT_SIZE))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read VTS_TMAPT.\n"); + } + free(vts_tmapt); + ifofile->vts_tmapt = NULL; + return 0; + } + + B2N_16(vts_tmapt->nr_of_tmaps); + B2N_32(vts_tmapt->last_byte); + + CHECK_ZERO(vts_tmapt->zero_1); + + info_length = vts_tmapt->nr_of_tmaps * 4; + + vts_tmap_srp = (uint32_t *)malloc(info_length); + if(!vts_tmap_srp) { + free(vts_tmapt); + ifofile->vts_tmapt = NULL; + return 0; + } + + vts_tmapt->tmap_offset = vts_tmap_srp; + + if(!(DVDReadBytes(ifofile->file, vts_tmap_srp, info_length))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read VTS_TMAPT.\n"); + } + free(vts_tmap_srp); + free(vts_tmapt); + ifofile->vts_tmapt = NULL; + return 0; + } + + for (i = 0; i < vts_tmapt->nr_of_tmaps; i++) { + B2N_32(vts_tmap_srp[i]); + } + + + info_length = vts_tmapt->nr_of_tmaps * sizeof(vts_tmap_t); + + vts_tmapt->tmap = (vts_tmap_t *)malloc(info_length); + if(!vts_tmapt->tmap) { + free(vts_tmap_srp); + free(vts_tmapt); + ifofile->vts_tmapt = NULL; + return 0; + } + + memset(vts_tmapt->tmap, 0, info_length); /* So ifoFree_VTS_TMAPT works. */ + + for(i = 0; i < vts_tmapt->nr_of_tmaps; i++) { + if(!DVDFileSeek_(ifofile->file, offset + vts_tmap_srp[i])) { + ifoFree_VTS_TMAPT(ifofile); + return 0; + } + + if(!(DVDReadBytes(ifofile->file, &vts_tmapt->tmap[i], VTS_TMAP_SIZE))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read VTS_TMAP.\n"); + } + ifoFree_VTS_TMAPT(ifofile); + return 0; + } + + B2N_16(vts_tmapt->tmap[i].nr_of_entries); + CHECK_ZERO(vts_tmapt->tmap[i].zero_1); + + if(vts_tmapt->tmap[i].nr_of_entries == 0) { /* Early out if zero entries */ + vts_tmapt->tmap[i].map_ent = NULL; + continue; + } + + info_length = vts_tmapt->tmap[i].nr_of_entries * sizeof(map_ent_t); + + vts_tmapt->tmap[i].map_ent = (map_ent_t *)malloc(info_length); + if(!vts_tmapt->tmap[i].map_ent) { + ifoFree_VTS_TMAPT(ifofile); + return 0; + } + + if(!(DVDReadBytes(ifofile->file, vts_tmapt->tmap[i].map_ent, info_length))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read VTS_TMAP_ENT.\n"); + } + ifoFree_VTS_TMAPT(ifofile); + return 0; + } + + for(j = 0; j < vts_tmapt->tmap[i].nr_of_entries; j++) + B2N_32(vts_tmapt->tmap[i].map_ent[j]); + } + + return 1; +} + +void ifoFree_VTS_TMAPT(ifo_handle_t *ifofile) { + unsigned int i; + + if(!ifofile) + return; + + if(ifofile->vts_tmapt) { + for(i = 0; i < ifofile->vts_tmapt->nr_of_tmaps; i++) + if(ifofile->vts_tmapt->tmap[i].map_ent) + free(ifofile->vts_tmapt->tmap[i].map_ent); + free(ifofile->vts_tmapt->tmap); + free(ifofile->vts_tmapt->tmap_offset); + free(ifofile->vts_tmapt); + ifofile->vts_tmapt = NULL; + } +} + + +int ifoRead_TITLE_C_ADT(ifo_handle_t *ifofile) { + + if(!ifofile) + return 0; + + if(!ifofile->vtsi_mat) + return 0; + + if(ifofile->vtsi_mat->vts_c_adt == 0) /* mandatory */ + return 0; + + ifofile->vts_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t)); + if(!ifofile->vts_c_adt) + return 0; + + if(!ifoRead_C_ADT_internal(ifofile, ifofile->vts_c_adt, + ifofile->vtsi_mat->vts_c_adt)) { + free(ifofile->vts_c_adt); + ifofile->vts_c_adt = 0; + return 0; + } + + return 1; +} + +int ifoRead_C_ADT(ifo_handle_t *ifofile) { + unsigned int sector; + + if(!ifofile) + return 0; + + if(ifofile->vmgi_mat) { + if(ifofile->vmgi_mat->vmgm_c_adt == 0) + return 1; + sector = ifofile->vmgi_mat->vmgm_c_adt; + } else if(ifofile->vtsi_mat) { + if(ifofile->vtsi_mat->vtsm_c_adt == 0) + return 1; + sector = ifofile->vtsi_mat->vtsm_c_adt; + } else { + return 0; + } + + ifofile->menu_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t)); + if(!ifofile->menu_c_adt) + return 0; + + if(!ifoRead_C_ADT_internal(ifofile, ifofile->menu_c_adt, sector)) { + free(ifofile->menu_c_adt); + ifofile->menu_c_adt = 0; + return 0; + } + + return 1; +} + +static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile, + c_adt_t *c_adt, unsigned int sector) { + int i, info_length; + + if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN)) + return 0; + + if(!(DVDReadBytes(ifofile->file, c_adt, C_ADT_SIZE))) + return 0; + + B2N_16(c_adt->nr_of_vobs); + B2N_32(c_adt->last_byte); + + info_length = c_adt->last_byte + 1 - C_ADT_SIZE; + + CHECK_ZERO(c_adt->zero_1); + /* assert(c_adt->nr_of_vobs > 0); + Magic Knight Rayearth Daybreak is mastered very strange and has + Titles with a VOBS that has no cells. */ + CHECK_VALUE(info_length % sizeof(cell_adr_t) == 0); + + /* assert(info_length / sizeof(cell_adr_t) >= c_adt->nr_of_vobs); + Enemy of the State region 2 (de) has Titles where nr_of_vobs field + is to high, they high ones are never referenced though. */ + if(info_length / sizeof(cell_adr_t) < c_adt->nr_of_vobs) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: *C_ADT nr_of_vobs > avaiable info entries\n"); + } + c_adt->nr_of_vobs = info_length / sizeof(cell_adr_t); + } + + c_adt->cell_adr_table = (cell_adr_t *)malloc(info_length); + if(!c_adt->cell_adr_table) + return 0; + + if(info_length && + !(DVDReadBytes(ifofile->file, c_adt->cell_adr_table, info_length))) { + free(c_adt->cell_adr_table); + return 0; + } + + for(i = 0; i < info_length/sizeof(cell_adr_t); i++) { + B2N_16(c_adt->cell_adr_table[i].vob_id); + B2N_32(c_adt->cell_adr_table[i].start_sector); + B2N_32(c_adt->cell_adr_table[i].last_sector); + + CHECK_ZERO(c_adt->cell_adr_table[i].zero_1); + CHECK_VALUE(c_adt->cell_adr_table[i].vob_id > 0); + CHECK_VALUE(c_adt->cell_adr_table[i].vob_id <= c_adt->nr_of_vobs); + CHECK_VALUE(c_adt->cell_adr_table[i].cell_id > 0); + CHECK_VALUE(c_adt->cell_adr_table[i].start_sector < + c_adt->cell_adr_table[i].last_sector); + } + + return 1; +} + + +static void ifoFree_C_ADT_internal(c_adt_t *c_adt) { + if(c_adt) { + free(c_adt->cell_adr_table); + free(c_adt); + } +} + +void ifoFree_C_ADT(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + ifoFree_C_ADT_internal(ifofile->menu_c_adt); + ifofile->menu_c_adt = 0; +} + +void ifoFree_TITLE_C_ADT(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + ifoFree_C_ADT_internal(ifofile->vts_c_adt); + ifofile->vts_c_adt = 0; +} + +int ifoRead_TITLE_VOBU_ADMAP(ifo_handle_t *ifofile) { + if(!ifofile) + return 0; + + if(!ifofile->vtsi_mat) + return 0; + + if(ifofile->vtsi_mat->vts_vobu_admap == 0) /* mandatory */ + return 0; + + ifofile->vts_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t)); + if(!ifofile->vts_vobu_admap) + return 0; + + if(!ifoRead_VOBU_ADMAP_internal(ifofile, ifofile->vts_vobu_admap, + ifofile->vtsi_mat->vts_vobu_admap)) { + free(ifofile->vts_vobu_admap); + ifofile->vts_vobu_admap = 0; + return 0; + } + + return 1; +} + +int ifoRead_VOBU_ADMAP(ifo_handle_t *ifofile) { + unsigned int sector; + + if(!ifofile) + return 0; + + if(ifofile->vmgi_mat) { + if(ifofile->vmgi_mat->vmgm_vobu_admap == 0) + return 1; + sector = ifofile->vmgi_mat->vmgm_vobu_admap; + } else if(ifofile->vtsi_mat) { + if(ifofile->vtsi_mat->vtsm_vobu_admap == 0) + return 1; + sector = ifofile->vtsi_mat->vtsm_vobu_admap; + } else { + return 0; + } + + ifofile->menu_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t)); + if(!ifofile->menu_vobu_admap) + return 0; + + if(!ifoRead_VOBU_ADMAP_internal(ifofile, ifofile->menu_vobu_admap, sector)) { + free(ifofile->menu_vobu_admap); + ifofile->menu_vobu_admap = 0; + return 0; + } + + return 1; +} + +static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile, + vobu_admap_t *vobu_admap, + unsigned int sector) { + unsigned int i; + int info_length; + + if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN)) + return 0; + + if(!(DVDReadBytes(ifofile->file, vobu_admap, VOBU_ADMAP_SIZE))) + return 0; + + B2N_32(vobu_admap->last_byte); + + info_length = vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE; + /* assert(info_length > 0); + Magic Knight Rayearth Daybreak is mastered very strange and has + Titles with a VOBS that has no VOBUs. */ + CHECK_VALUE(info_length % sizeof(uint32_t) == 0); + + vobu_admap->vobu_start_sectors = (uint32_t *)malloc(info_length); + if(!vobu_admap->vobu_start_sectors) { + return 0; + } + if(info_length && + !(DVDReadBytes(ifofile->file, + vobu_admap->vobu_start_sectors, info_length))) { + free(vobu_admap->vobu_start_sectors); + return 0; + } + + for(i = 0; i < info_length/sizeof(uint32_t); i++) + B2N_32(vobu_admap->vobu_start_sectors[i]); + + return 1; +} + + +static void ifoFree_VOBU_ADMAP_internal(vobu_admap_t *vobu_admap) { + if(vobu_admap) { + free(vobu_admap->vobu_start_sectors); + free(vobu_admap); + } +} + +void ifoFree_VOBU_ADMAP(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + ifoFree_VOBU_ADMAP_internal(ifofile->menu_vobu_admap); + ifofile->menu_vobu_admap = 0; +} + +void ifoFree_TITLE_VOBU_ADMAP(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + ifoFree_VOBU_ADMAP_internal(ifofile->vts_vobu_admap); + ifofile->vts_vobu_admap = 0; +} + +int ifoRead_PGCIT(ifo_handle_t *ifofile) { + + if(!ifofile) + return 0; + + if(!ifofile->vtsi_mat) + return 0; + + if(ifofile->vtsi_mat->vts_pgcit == 0) /* mandatory */ + return 0; + + ifofile->vts_pgcit = (pgcit_t *)malloc(sizeof(pgcit_t)); + if(!ifofile->vts_pgcit) + return 0; + + if(!ifoRead_PGCIT_internal(ifofile, ifofile->vts_pgcit, + ifofile->vtsi_mat->vts_pgcit * DVD_BLOCK_LEN)) { + free(ifofile->vts_pgcit); + ifofile->vts_pgcit = 0; + return 0; + } + + return 1; +} + +static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit, + unsigned int offset) { + int i, info_length; + uint8_t *data, *ptr; + + if(!DVDFileSeek_(ifofile->file, offset)) + return 0; + + if(!(DVDReadBytes(ifofile->file, pgcit, PGCIT_SIZE))) + return 0; + + B2N_16(pgcit->nr_of_pgci_srp); + B2N_32(pgcit->last_byte); + + CHECK_ZERO(pgcit->zero_1); + /* assert(pgcit->nr_of_pgci_srp != 0); + Magic Knight Rayearth Daybreak is mastered very strange and has + Titles with 0 PTTs. */ + CHECK_VALUE(pgcit->nr_of_pgci_srp < 10000); /* ?? seen max of 1338*/ + + info_length = pgcit->nr_of_pgci_srp * PGCI_SRP_SIZE; + data = malloc(info_length); + if(!data) + return 0; + + if(info_length && !(DVDReadBytes(ifofile->file, data, info_length))) { + free(data); + return 0; + } + + pgcit->pgci_srp = malloc(pgcit->nr_of_pgci_srp * sizeof(pgci_srp_t)); + if(!pgcit->pgci_srp) { + free(data); + return 0; + } + ptr = data; + for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { + memcpy(&pgcit->pgci_srp[i], ptr, PGCI_SRP_SIZE); + ptr += PGCI_SRP_SIZE; + B2N_16(pgcit->pgci_srp[i].ptl_id_mask); + B2N_32(pgcit->pgci_srp[i].pgc_start_byte); + CHECK_VALUE(pgcit->pgci_srp[i].unknown1 == 0); + } + free(data); + + for(i = 0; i < pgcit->nr_of_pgci_srp; i++) + CHECK_VALUE(pgcit->pgci_srp[i].pgc_start_byte + PGC_SIZE <= pgcit->last_byte+1); + + for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { + pgcit->pgci_srp[i].pgc = malloc(sizeof(pgc_t)); + if(!pgcit->pgci_srp[i].pgc) { + int j; + for(j = 0; j < i; j++) { + ifoFree_PGC(pgcit->pgci_srp[j].pgc); + free(pgcit->pgci_srp[j].pgc); + } + free(pgcit->pgci_srp); + pgcit->pgci_srp = NULL; + return 0; + } + if(!ifoRead_PGC(ifofile, pgcit->pgci_srp[i].pgc, + offset + pgcit->pgci_srp[i].pgc_start_byte)) { + int j; + for(j = 0; j < i; j++) { + ifoFree_PGC(pgcit->pgci_srp[j].pgc); + free(pgcit->pgci_srp[j].pgc); + } + free(pgcit->pgci_srp); + pgcit->pgci_srp = NULL; + return 0; + } + } + + return 1; +} + +static void ifoFree_PGCIT_internal(pgcit_t *pgcit) { + if(pgcit) { + int i; + for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { + ifoFree_PGC(pgcit->pgci_srp[i].pgc); + free(pgcit->pgci_srp[i].pgc); + } + free(pgcit->pgci_srp); + } +} + +void ifoFree_PGCIT(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + if(ifofile->vts_pgcit) { + ifoFree_PGCIT_internal(ifofile->vts_pgcit); + free(ifofile->vts_pgcit); + ifofile->vts_pgcit = 0; + } +} + + +int ifoRead_PGCI_UT(ifo_handle_t *ifofile) { + pgci_ut_t *pgci_ut; + unsigned int sector; + unsigned int i; + int info_length; + uint8_t *data, *ptr; + + if(!ifofile) + return 0; + + if(ifofile->vmgi_mat) { + if(ifofile->vmgi_mat->vmgm_pgci_ut == 0) + return 1; + sector = ifofile->vmgi_mat->vmgm_pgci_ut; + } else if(ifofile->vtsi_mat) { + if(ifofile->vtsi_mat->vtsm_pgci_ut == 0) + return 1; + sector = ifofile->vtsi_mat->vtsm_pgci_ut; + } else { + return 0; + } + + ifofile->pgci_ut = (pgci_ut_t *)malloc(sizeof(pgci_ut_t)); + if(!ifofile->pgci_ut) + return 0; + + if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN)) { + free(ifofile->pgci_ut); + ifofile->pgci_ut = 0; + return 0; + } + + if(!(DVDReadBytes(ifofile->file, ifofile->pgci_ut, PGCI_UT_SIZE))) { + free(ifofile->pgci_ut); + ifofile->pgci_ut = 0; + return 0; + } + + pgci_ut = ifofile->pgci_ut; + + B2N_16(pgci_ut->nr_of_lus); + B2N_32(pgci_ut->last_byte); + + CHECK_ZERO(pgci_ut->zero_1); + CHECK_VALUE(pgci_ut->nr_of_lus != 0); + CHECK_VALUE(pgci_ut->nr_of_lus < 100); /* ?? 3-4 ?*/ + CHECK_VALUE((uint32_t)pgci_ut->nr_of_lus * PGCI_LU_SIZE < pgci_ut->last_byte); + + info_length = pgci_ut->nr_of_lus * PGCI_LU_SIZE; + data = malloc(info_length); + if(!data) { + free(pgci_ut); + ifofile->pgci_ut = 0; + return 0; + } + if(!(DVDReadBytes(ifofile->file, data, info_length))) { + free(data); + free(pgci_ut); + ifofile->pgci_ut = 0; + return 0; + } + + pgci_ut->lu = malloc(pgci_ut->nr_of_lus * sizeof(pgci_lu_t)); + if(!pgci_ut->lu) { + free(data); + free(pgci_ut); + ifofile->pgci_ut = 0; + return 0; + } + ptr = data; + for(i = 0; i < pgci_ut->nr_of_lus; i++) { + memcpy(&pgci_ut->lu[i], ptr, PGCI_LU_SIZE); + ptr += PGCI_LU_SIZE; + B2N_16(pgci_ut->lu[i].lang_code); + B2N_32(pgci_ut->lu[i].lang_start_byte); + } + free(data); + + for(i = 0; i < pgci_ut->nr_of_lus; i++) { + /* Maybe this is only defined for v1.1 and later titles? + If the bits in 'lu[i].exists' are enumerated abcd efgh then: + VTS_x_yy.IFO VIDEO_TS.IFO + a == 0x83 "Root" 0x82 "Title" + b == 0x84 "Subpicture" + c == 0x85 "Audio" + d == 0x86 "Angle" + e == 0x87 "PTT" + */ + CHECK_VALUE((pgci_ut->lu[i].exists & 0x07) == 0); + } + + for(i = 0; i < pgci_ut->nr_of_lus; i++) { + pgci_ut->lu[i].pgcit = malloc(sizeof(pgcit_t)); + if(!pgci_ut->lu[i].pgcit) { + unsigned int j; + for(j = 0; j < i; j++) { + ifoFree_PGCIT_internal(pgci_ut->lu[j].pgcit); + free(pgci_ut->lu[j].pgcit); + } + free(pgci_ut->lu); + free(pgci_ut); + ifofile->pgci_ut = 0; + return 0; + } + if(!ifoRead_PGCIT_internal(ifofile, pgci_ut->lu[i].pgcit, + sector * DVD_BLOCK_LEN + + pgci_ut->lu[i].lang_start_byte)) { + unsigned int j; + for(j = 0; j < i; j++) { + ifoFree_PGCIT_internal(pgci_ut->lu[j].pgcit); + free(pgci_ut->lu[j].pgcit); + } + free(pgci_ut->lu[i].pgcit); + free(pgci_ut->lu); + free(pgci_ut); + ifofile->pgci_ut = 0; + return 0; + } + /* FIXME: Iterate and verify that all menus that should exists accordingly + / to pgci_ut->lu[i].exists really do? */ + } + + return 1; +} + + +void ifoFree_PGCI_UT(ifo_handle_t *ifofile) { + unsigned int i; + + if(!ifofile) + return; + + if(ifofile->pgci_ut) { + for(i = 0; i < ifofile->pgci_ut->nr_of_lus; i++) { + ifoFree_PGCIT_internal(ifofile->pgci_ut->lu[i].pgcit); + free(ifofile->pgci_ut->lu[i].pgcit); + } + free(ifofile->pgci_ut->lu); + free(ifofile->pgci_ut); + ifofile->pgci_ut = 0; + } +} + +static int ifoRead_VTS_ATTRIBUTES(ifo_handle_t *ifofile, + vts_attributes_t *vts_attributes, + unsigned int offset) { + unsigned int i; + + if(!DVDFileSeek_(ifofile->file, offset)) + return 0; + + if(!(DVDReadBytes(ifofile->file, vts_attributes, sizeof(vts_attributes_t)))) + return 0; + + B2N_32(vts_attributes->last_byte); + B2N_32(vts_attributes->vts_cat); + B2N_16(vts_attributes->vtsm_audio_attr.lang_code); + B2N_16(vts_attributes->vtsm_subp_attr.lang_code); + for(i = 0; i < 8; i++) + B2N_16(vts_attributes->vtstt_audio_attr[i].lang_code); + for(i = 0; i < 32; i++) + B2N_16(vts_attributes->vtstt_subp_attr[i].lang_code); + + CHECK_ZERO(vts_attributes->zero_1); + CHECK_ZERO(vts_attributes->zero_2); + CHECK_ZERO(vts_attributes->zero_3); + CHECK_ZERO(vts_attributes->zero_4); + CHECK_ZERO(vts_attributes->zero_5); + CHECK_ZERO(vts_attributes->zero_6); + CHECK_ZERO(vts_attributes->zero_7); + CHECK_VALUE(vts_attributes->nr_of_vtsm_audio_streams <= 1); + CHECK_VALUE(vts_attributes->nr_of_vtsm_subp_streams <= 1); + CHECK_VALUE(vts_attributes->nr_of_vtstt_audio_streams <= 8); + for(i = vts_attributes->nr_of_vtstt_audio_streams; i < 8; i++) + CHECK_ZERO(vts_attributes->vtstt_audio_attr[i]); + CHECK_VALUE(vts_attributes->nr_of_vtstt_subp_streams <= 32); + { + unsigned int nr_coded; + CHECK_VALUE(vts_attributes->last_byte + 1 >= VTS_ATTRIBUTES_MIN_SIZE); + nr_coded = (vts_attributes->last_byte + 1 - VTS_ATTRIBUTES_MIN_SIZE)/6; + /* This is often nr_coded = 70, how do you know how many there really are?*/ + if(nr_coded > 32) { /* We haven't read more from disk/file anyway*/ + nr_coded = 32; + } + CHECK_VALUE(vts_attributes->nr_of_vtstt_subp_streams <= nr_coded); + for(i = vts_attributes->nr_of_vtstt_subp_streams; i < nr_coded; i++) + CHECK_ZERO(vts_attributes->vtstt_subp_attr[i]); + } + + return 1; +} + + + +int ifoRead_VTS_ATRT(ifo_handle_t *ifofile) { + vts_atrt_t *vts_atrt; + unsigned int i, info_length, sector; + uint32_t *data; + + if(!ifofile) + return 0; + + if(!ifofile->vmgi_mat) + return 0; + + if(ifofile->vmgi_mat->vts_atrt == 0) /* mandatory */ + return 0; + + sector = ifofile->vmgi_mat->vts_atrt; + if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN)) + return 0; + + vts_atrt = (vts_atrt_t *)malloc(sizeof(vts_atrt_t)); + if(!vts_atrt) + return 0; + + ifofile->vts_atrt = vts_atrt; + + if(!(DVDReadBytes(ifofile->file, vts_atrt, VTS_ATRT_SIZE))) { + free(vts_atrt); + ifofile->vts_atrt = 0; + return 0; + } + + B2N_16(vts_atrt->nr_of_vtss); + B2N_32(vts_atrt->last_byte); + + CHECK_ZERO(vts_atrt->zero_1); + CHECK_VALUE(vts_atrt->nr_of_vtss != 0); + CHECK_VALUE(vts_atrt->nr_of_vtss < 100); /*??*/ + CHECK_VALUE((uint32_t)vts_atrt->nr_of_vtss * (4 + VTS_ATTRIBUTES_MIN_SIZE) + + VTS_ATRT_SIZE < vts_atrt->last_byte + 1); + + info_length = vts_atrt->nr_of_vtss * sizeof(uint32_t); + data = (uint32_t *)malloc(info_length); + if(!data) { + free(vts_atrt); + ifofile->vts_atrt = 0; + return 0; + } + + vts_atrt->vts_atrt_offsets = data; + + if(!(DVDReadBytes(ifofile->file, data, info_length))) { + free(data); + free(vts_atrt); + ifofile->vts_atrt = 0; + return 0; + } + + for(i = 0; i < vts_atrt->nr_of_vtss; i++) { + B2N_32(data[i]); + CHECK_VALUE(data[i] + VTS_ATTRIBUTES_MIN_SIZE < vts_atrt->last_byte + 1); + } + + info_length = vts_atrt->nr_of_vtss * sizeof(vts_attributes_t); + vts_atrt->vts = (vts_attributes_t *)malloc(info_length); + if(!vts_atrt->vts) { + free(data); + free(vts_atrt); + ifofile->vts_atrt = 0; + return 0; + } + for(i = 0; i < vts_atrt->nr_of_vtss; i++) { + unsigned int offset = data[i]; + if(!ifoRead_VTS_ATTRIBUTES(ifofile, &(vts_atrt->vts[i]), + (sector * DVD_BLOCK_LEN) + offset)) { + free(data); + free(vts_atrt); + ifofile->vts_atrt = 0; + return 0; + } + + /* This assert cant be in ifoRead_VTS_ATTRIBUTES*/ + CHECK_VALUE(offset + vts_atrt->vts[i].last_byte <= vts_atrt->last_byte + 1); + /* Is this check correct?*/ + } + + return 1; +} + + +void ifoFree_VTS_ATRT(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + if(ifofile->vts_atrt) { + free(ifofile->vts_atrt->vts); + free(ifofile->vts_atrt->vts_atrt_offsets); + free(ifofile->vts_atrt); + ifofile->vts_atrt = 0; + } +} + + +int ifoRead_TXTDT_MGI(ifo_handle_t *ifofile) { + txtdt_mgi_t *txtdt_mgi; + + if(!ifofile) + return 0; + + if(!ifofile->vmgi_mat) + return 0; + + /* Return successfully if there is nothing to read. */ + if(ifofile->vmgi_mat->txtdt_mgi == 0) + return 1; + + if(!DVDFileSeek_(ifofile->file, + ifofile->vmgi_mat->txtdt_mgi * DVD_BLOCK_LEN)) + return 0; + + txtdt_mgi = (txtdt_mgi_t *)malloc(sizeof(txtdt_mgi_t)); + if(!txtdt_mgi) { + return 0; + } + ifofile->txtdt_mgi = txtdt_mgi; + + if(!(DVDReadBytes(ifofile->file, txtdt_mgi, TXTDT_MGI_SIZE))) { + if(dvdread_verbose(device_of_file(ifofile->file)) >= 1) { + fprintf(stderr, "libdvdread: Unable to read TXTDT_MGI.\n"); + } + free(txtdt_mgi); + ifofile->txtdt_mgi = 0; + return 0; + } + + /* fprintf(stderr, "-- Not done yet --\n");*/ + return 1; +} + +void ifoFree_TXTDT_MGI(ifo_handle_t *ifofile) { + if(!ifofile) + return; + + if(ifofile->txtdt_mgi) { + free(ifofile->txtdt_mgi); + ifofile->txtdt_mgi = 0; + } +} + diff --git a/dvdread/ifo_read.h b/dvdread/ifo_read.h new file mode 100644 index 0000000..b1acc76 --- /dev/null +++ b/dvdread/ifo_read.h @@ -0,0 +1,228 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#ifndef IFO_READ_H_INCLUDED +#define IFO_READ_H_INCLUDED + +/* + * Copyright (C) 2000, 2001, 2002 Bj�rn Englund , + * H�kan Hjort + * + * 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 + */ + +#include "ifo_types.h" +#include "dvd_reader.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * handle = ifoOpen(dvd, title); + * + * Opens an IFO and reads in all the data for the IFO file corresponding to the + * given title. If title 0 is given, the video manager IFO file is read. + * Returns a handle to a completely parsed structure. + */ +ifo_handle_t *ifoOpen(dvd_reader_t *, int ); + +/** + * handle = ifoOpenVMGI(dvd); + * + * Opens an IFO and reads in _only_ the vmgi_mat data. This call can be used + * together with the calls below to read in each segment of the IFO file on + * demand. + */ +ifo_handle_t *ifoOpenVMGI(dvd_reader_t *); + +/** + * handle = ifoOpenVTSI(dvd, title); + * + * Opens an IFO and reads in _only_ the vtsi_mat data. This call can be used + * together with the calls below to read in each segment of the IFO file on + * demand. + */ +ifo_handle_t *ifoOpenVTSI(dvd_reader_t *, int); + +/** + * ifoClose(ifofile); + * Cleans up the IFO information. This will free all data allocated for the + * substructures. + */ +void ifoClose(ifo_handle_t *); + +/** + * The following functions are for reading only part of the VMGI/VTSI files. + * Returns 1 if the data was successfully read and 0 on error. + */ + +/** + * okay = ifoRead_PLT_MAIT(ifofile); + * + * Read in the Parental Management Information table, filling the + * ifofile->ptl_mait structure and its substructures. This data is only + * located in the video manager information file. This fills the + * ifofile->ptl_mait structure and all its substructures. + */ +int ifoRead_PTL_MAIT(ifo_handle_t *); + +/** + * okay = ifoRead_VTS_ATRT(ifofile); + * + * Read in the attribute table for the main menu vob, filling the + * ifofile->vts_atrt structure and its substructures. Only located in the + * video manager information file. This fills in the ifofile->vts_atrt + * structure and all its substructures. + */ +int ifoRead_VTS_ATRT(ifo_handle_t *); + +/** + * okay = ifoRead_TT_SRPT(ifofile); + * + * Reads the title info for the main menu, filling the ifofile->tt_srpt + * structure and its substructures. This data is only located in the video + * manager information file. This structure is mandatory in the IFO file. + */ +int ifoRead_TT_SRPT(ifo_handle_t *); + +/** + * okay = ifoRead_VTS_PTT_SRPT(ifofile); + * + * Reads in the part of title search pointer table, filling the + * ifofile->vts_ptt_srpt structure and its substructures. This data is only + * located in the video title set information file. This structure is + * mandatory, and must be included in the VTSI file. + */ +int ifoRead_VTS_PTT_SRPT(ifo_handle_t *); + +/** + * okay = ifoRead_FP_PGC(ifofile); + * + * Reads in the first play program chain data, filling the + * ifofile->first_play_pgc structure. This data is only located in the video + * manager information file (VMGI). This structure is optional. + */ +int ifoRead_FP_PGC(ifo_handle_t *); + +/** + * okay = ifoRead_PGCIT(ifofile); + * + * Reads in the program chain information table for the video title set. Fills + * in the ifofile->vts_pgcit structure and its substructures, which includes + * the data for each program chain in the set. This data is only located in + * the video title set information file. This structure is mandatory, and must + * be included in the VTSI file. + */ +int ifoRead_PGCIT(ifo_handle_t *); + +/** + * okay = ifoRead_PGCI_UT(ifofile); + * + * Reads in the menu PGCI unit table for the menu VOB. For the video manager, + * this corresponds to the VIDEO_TS.VOB file, and for each title set, this + * corresponds to the VTS_XX_0.VOB file. This data is located in both the + * video manager and video title set information files. For VMGI files, this + * fills the ifofile->vmgi_pgci_ut structure and all its substructures. For + * VTSI files, this fills the ifofile->vtsm_pgci_ut structure. + */ +int ifoRead_PGCI_UT(ifo_handle_t *); + +/** + * okay = ifoRead_VTS_TMAPT(ifofile); + * + * Reads in the VTS Time Map Table, this data is only located in the video + * title set information file. This fills the ifofile->vts_tmapt structure + * and all its substructures. When pressent enables VOBU level time-based + * seeking for One_Sequential_PGC_Titles. + */ +int ifoRead_VTS_TMAPT(ifo_handle_t *); + +/** + * okay = ifoRead_C_ADT(ifofile); + * + * Reads in the cell address table for the menu VOB. For the video manager, + * this corresponds to the VIDEO_TS.VOB file, and for each title set, this + * corresponds to the VTS_XX_0.VOB file. This data is located in both the + * video manager and video title set information files. For VMGI files, this + * fills the ifofile->vmgm_c_adt structure and all its substructures. For VTSI + * files, this fills the ifofile->vtsm_c_adt structure. + */ +int ifoRead_C_ADT(ifo_handle_t *); + +/** + * okay = ifoRead_TITLE_C_ADT(ifofile); + * + * Reads in the cell address table for the video title set corresponding to + * this IFO file. This data is only located in the video title set information + * file. This structure is mandatory, and must be included in the VTSI file. + * This call fills the ifofile->vts_c_adt structure and its substructures. + */ +int ifoRead_TITLE_C_ADT(ifo_handle_t *); + +/** + * okay = ifoRead_VOBU_ADMAP(ifofile); + * + * Reads in the VOBU address map for the menu VOB. For the video manager, this + * corresponds to the VIDEO_TS.VOB file, and for each title set, this + * corresponds to the VTS_XX_0.VOB file. This data is located in both the + * video manager and video title set information files. For VMGI files, this + * fills the ifofile->vmgm_vobu_admap structure and all its substructures. For + * VTSI files, this fills the ifofile->vtsm_vobu_admap structure. + */ +int ifoRead_VOBU_ADMAP(ifo_handle_t *); + +/** + * okay = ifoRead_TITLE_VOBU_ADMAP(ifofile); + * + * Reads in the VOBU address map for the associated video title set. This data + * is only located in the video title set information file. This structure is + * mandatory, and must be included in the VTSI file. Fills the + * ifofile->vts_vobu_admap structure and its substructures. + */ +int ifoRead_TITLE_VOBU_ADMAP(ifo_handle_t *); + +/** + * okay = ifoRead_TXTDT_MGI(ifofile); + * + * Reads in the text data strings for the DVD. Fills the ifofile->txtdt_mgi + * structure and all its substructures. This data is only located in the video + * manager information file. This structure is mandatory, and must be included + * in the VMGI file. + */ +int ifoRead_TXTDT_MGI(ifo_handle_t *); + +/** + * The following functions are used for freeing parsed sections of the + * ifo_handle_t structure and the allocated substructures. The free calls + * below are safe: they will not mind if you attempt to free part of an IFO + * file which was not read in or which does not exist. + */ +void ifoFree_PTL_MAIT(ifo_handle_t *); +void ifoFree_VTS_ATRT(ifo_handle_t *); +void ifoFree_TT_SRPT(ifo_handle_t *); +void ifoFree_VTS_PTT_SRPT(ifo_handle_t *); +void ifoFree_FP_PGC(ifo_handle_t *); +void ifoFree_PGCIT(ifo_handle_t *); +void ifoFree_PGCI_UT(ifo_handle_t *); +void ifoFree_VTS_TMAPT(ifo_handle_t *); +void ifoFree_C_ADT(ifo_handle_t *); +void ifoFree_TITLE_C_ADT(ifo_handle_t *); +void ifoFree_VOBU_ADMAP(ifo_handle_t *); +void ifoFree_TITLE_VOBU_ADMAP(ifo_handle_t *); +void ifoFree_TXTDT_MGI(ifo_handle_t *); + +#ifdef __cplusplus +}; +#endif +#endif /* IFO_READ_H_INCLUDED */ diff --git a/dvdread/ifo_types.h b/dvdread/ifo_types.h new file mode 100644 index 0000000..ec4937d --- /dev/null +++ b/dvdread/ifo_types.h @@ -0,0 +1,893 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#ifndef IFO_TYPES_H_INCLUDED +#define IFO_TYPES_H_INCLUDED + +/* + * Copyright (C) 2000, 2001 Bj�rn Englund , + * H�kan Hjort + * + * 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 + */ + +#include "dvd_reader.h" + +#if defined(__BEOS__) +#if !defined(_INTTYPES_H_) && !defined(_INTTYPES_H) && !defined(_STDINT_H_) && !defined(_STDINT_H) +#error "Must include or before any libdvdread header." +#endif +#else +#if !defined(UINT8_MAX) || !defined(UINT16_MAX) || !defined(INT32_MAX) +#error "Must include or before any libdvdread header." +#endif +#endif + +#undef ATTRIBUTE_PACKED +#undef PRAGMA_PACK_BEGIN +#undef PRAGMA_PACK_END + +#if defined(__GNUC__) +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#define ATTRIBUTE_PACKED __attribute__ ((packed)) +#define PRAGMA_PACK 0 +#endif +#endif + +#if !defined(ATTRIBUTE_PACKED) +#define ATTRIBUTE_PACKED +#define PRAGMA_PACK 1 +#endif + +#if PRAGMA_PACK +#pragma pack(1) +#endif + + +/** + * Common + * + * The following structures are used in both the VMGI and VTSI. + */ + + +/** + * DVD Time Information. + */ +typedef struct { + uint8_t hour; + uint8_t minute; + uint8_t second; + uint8_t frame_u; /* The two high bits are the frame rate. */ +} ATTRIBUTE_PACKED dvd_time_t; + +/** + * Type to store per-command data. + */ +typedef struct { + uint8_t bytes[8]; +} ATTRIBUTE_PACKED vm_cmd_t; +#define COMMAND_DATA_SIZE 8U + + +/** + * Video Attributes. + */ +typedef struct { +#ifdef WORDS_BIGENDIAN + unsigned int mpeg_version : 2; + unsigned int video_format : 2; + unsigned int display_aspect_ratio : 2; + unsigned int permitted_df : 2; + + unsigned int line21_cc_1 : 1; + unsigned int line21_cc_2 : 1; + unsigned int unknown1 : 1; + unsigned int bit_rate : 1; + + unsigned int picture_size : 2; + unsigned int letterboxed : 1; + unsigned int film_mode : 1; +#else + unsigned int permitted_df : 2; + unsigned int display_aspect_ratio : 2; + unsigned int video_format : 2; + unsigned int mpeg_version : 2; + + unsigned int film_mode : 1; + unsigned int letterboxed : 1; + unsigned int picture_size : 2; + + unsigned int bit_rate : 1; + unsigned int unknown1 : 1; + unsigned int line21_cc_2 : 1; + unsigned int line21_cc_1 : 1; +#endif +} ATTRIBUTE_PACKED video_attr_t; + +/** + * Audio Attributes. + */ +typedef struct { +#ifdef WORDS_BIGENDIAN + unsigned int audio_format : 3; + unsigned int multichannel_extension : 1; + unsigned int lang_type : 2; + unsigned int application_mode : 2; + + unsigned int quantization : 2; + unsigned int sample_frequency : 2; + unsigned int unknown1 : 1; + unsigned int channels : 3; +#else + unsigned int application_mode : 2; + unsigned int lang_type : 2; + unsigned int multichannel_extension : 1; + unsigned int audio_format : 3; + + unsigned int channels : 3; + unsigned int unknown1 : 1; + unsigned int sample_frequency : 2; + unsigned int quantization : 2; +#endif + uint16_t lang_code; + uint8_t lang_extension; + uint8_t code_extension; + uint8_t unknown3; + union { + struct { +#ifdef WORDS_BIGENDIAN + unsigned int unknown4 : 1; + unsigned int channel_assignment : 3; + unsigned int version : 2; + unsigned int mc_intro : 1; /* probably 0: true, 1:false */ + unsigned int mode : 1; /* Karaoke mode 0: solo 1: duet */ +#else + unsigned int mode : 1; + unsigned int mc_intro : 1; + unsigned int version : 2; + unsigned int channel_assignment : 3; + unsigned int unknown4 : 1; +#endif + } ATTRIBUTE_PACKED karaoke; + struct { +#ifdef WORDS_BIGENDIAN + unsigned int unknown5 : 4; + unsigned int dolby_encoded : 1; /* suitable for surround decoding */ + unsigned int unknown6 : 3; +#else + unsigned int unknown6 : 3; + unsigned int dolby_encoded : 1; + unsigned int unknown5 : 4; +#endif + } ATTRIBUTE_PACKED surround; + } ATTRIBUTE_PACKED app_info; +} ATTRIBUTE_PACKED audio_attr_t; + + +/** + * MultiChannel Extension + */ +typedef struct { +#ifdef WORDS_BIGENDIAN + unsigned int zero1 : 7; + unsigned int ach0_gme : 1; + + unsigned int zero2 : 7; + unsigned int ach1_gme : 1; + + unsigned int zero3 : 4; + unsigned int ach2_gv1e : 1; + unsigned int ach2_gv2e : 1; + unsigned int ach2_gm1e : 1; + unsigned int ach2_gm2e : 1; + + unsigned int zero4 : 4; + unsigned int ach3_gv1e : 1; + unsigned int ach3_gv2e : 1; + unsigned int ach3_gmAe : 1; + unsigned int ach3_se2e : 1; + + unsigned int zero5 : 4; + unsigned int ach4_gv1e : 1; + unsigned int ach4_gv2e : 1; + unsigned int ach4_gmBe : 1; + unsigned int ach4_seBe : 1; +#else + unsigned int ach0_gme : 1; + unsigned int zero1 : 7; + + unsigned int ach1_gme : 1; + unsigned int zero2 : 7; + + unsigned int ach2_gm2e : 1; + unsigned int ach2_gm1e : 1; + unsigned int ach2_gv2e : 1; + unsigned int ach2_gv1e : 1; + unsigned int zero3 : 4; + + unsigned int ach3_se2e : 1; + unsigned int ach3_gmAe : 1; + unsigned int ach3_gv2e : 1; + unsigned int ach3_gv1e : 1; + unsigned int zero4 : 4; + + unsigned int ach4_seBe : 1; + unsigned int ach4_gmBe : 1; + unsigned int ach4_gv2e : 1; + unsigned int ach4_gv1e : 1; + unsigned int zero5 : 4; +#endif + uint8_t zero6[19]; +} ATTRIBUTE_PACKED multichannel_ext_t; + + +/** + * Subpicture Attributes. + */ +typedef struct { + /* + * type: 0 not specified + * 1 language + * 2 other + * coding mode: 0 run length + * 1 extended + * 2 other + * language: indicates language if type == 1 + * lang extension: if type == 1 contains the lang extension + */ +#ifdef WORDS_BIGENDIAN + unsigned int code_mode : 3; + unsigned int zero1 : 3; + unsigned int type : 2; +#else + unsigned int type : 2; + unsigned int zero1 : 3; + unsigned int code_mode : 3; +#endif + uint8_t zero2; + uint16_t lang_code; + uint8_t lang_extension; + uint8_t code_extension; +} ATTRIBUTE_PACKED subp_attr_t; + + + +/** + * PGC Command Table. + */ +typedef struct { + uint16_t nr_of_pre; + uint16_t nr_of_post; + uint16_t nr_of_cell; + uint16_t last_byte; + vm_cmd_t *pre_cmds; + vm_cmd_t *post_cmds; + vm_cmd_t *cell_cmds; +} ATTRIBUTE_PACKED pgc_command_tbl_t; +#define PGC_COMMAND_TBL_SIZE 8U + +/** + * PGC Program Map + */ +typedef uint8_t pgc_program_map_t; + +/** + * Cell Playback Information. + */ +typedef struct { +#ifdef WORDS_BIGENDIAN + unsigned int block_mode : 2; + unsigned int block_type : 2; + unsigned int seamless_play : 1; + unsigned int interleaved : 1; + unsigned int stc_discontinuity: 1; + unsigned int seamless_angle : 1; + + unsigned int playback_mode : 1; /**< When set, enter StillMode after each VOBU */ + unsigned int restricted : 1; /**< ?? drop out of fastforward? */ + unsigned int unknown2 : 6; +#else + unsigned int seamless_angle : 1; + unsigned int stc_discontinuity: 1; + unsigned int interleaved : 1; + unsigned int seamless_play : 1; + unsigned int block_type : 2; + unsigned int block_mode : 2; + + unsigned int unknown2 : 6; + unsigned int restricted : 1; + unsigned int playback_mode : 1; +#endif + uint8_t still_time; + uint8_t cell_cmd_nr; + dvd_time_t playback_time; + uint32_t first_sector; + uint32_t first_ilvu_end_sector; + uint32_t last_vobu_start_sector; + uint32_t last_sector; +} ATTRIBUTE_PACKED cell_playback_t; + +#define BLOCK_TYPE_NONE 0x0 +#define BLOCK_TYPE_ANGLE_BLOCK 0x1 + +#define BLOCK_MODE_NOT_IN_BLOCK 0x0 +#define BLOCK_MODE_FIRST_CELL 0x1 +#define BLOCK_MODE_IN_BLOCK 0x2 +#define BLOCK_MODE_LAST_CELL 0x3 + +/** + * Cell Position Information. + */ +typedef struct { + uint16_t vob_id_nr; + uint8_t zero_1; + uint8_t cell_nr; +} ATTRIBUTE_PACKED cell_position_t; + +/** + * User Operations. + */ +typedef struct { +#ifdef WORDS_BIGENDIAN + unsigned int zero : 7; /* 25-31 */ + unsigned int video_pres_mode_change : 1; /* 24 */ + + unsigned int karaoke_audio_pres_mode_change : 1; /* 23 */ + unsigned int angle_change : 1; + unsigned int subpic_stream_change : 1; + unsigned int audio_stream_change : 1; + unsigned int pause_on : 1; + unsigned int still_off : 1; + unsigned int button_select_or_activate : 1; + unsigned int resume : 1; /* 16 */ + + unsigned int chapter_menu_call : 1; /* 15 */ + unsigned int angle_menu_call : 1; + unsigned int audio_menu_call : 1; + unsigned int subpic_menu_call : 1; + unsigned int root_menu_call : 1; + unsigned int title_menu_call : 1; + unsigned int backward_scan : 1; + unsigned int forward_scan : 1; /* 8 */ + + unsigned int next_pg_search : 1; /* 7 */ + unsigned int prev_or_top_pg_search : 1; + unsigned int time_or_chapter_search : 1; + unsigned int go_up : 1; + unsigned int stop : 1; + unsigned int title_play : 1; + unsigned int chapter_search_or_play : 1; + unsigned int title_or_time_play : 1; /* 0 */ +#else + unsigned int video_pres_mode_change : 1; /* 24 */ + unsigned int zero : 7; /* 25-31 */ + + unsigned int resume : 1; /* 16 */ + unsigned int button_select_or_activate : 1; + unsigned int still_off : 1; + unsigned int pause_on : 1; + unsigned int audio_stream_change : 1; + unsigned int subpic_stream_change : 1; + unsigned int angle_change : 1; + unsigned int karaoke_audio_pres_mode_change : 1; /* 23 */ + + unsigned int forward_scan : 1; /* 8 */ + unsigned int backward_scan : 1; + unsigned int title_menu_call : 1; + unsigned int root_menu_call : 1; + unsigned int subpic_menu_call : 1; + unsigned int audio_menu_call : 1; + unsigned int angle_menu_call : 1; + unsigned int chapter_menu_call : 1; /* 15 */ + + unsigned int title_or_time_play : 1; /* 0 */ + unsigned int chapter_search_or_play : 1; + unsigned int title_play : 1; + unsigned int stop : 1; + unsigned int go_up : 1; + unsigned int time_or_chapter_search : 1; + unsigned int prev_or_top_pg_search : 1; + unsigned int next_pg_search : 1; /* 7 */ +#endif +} ATTRIBUTE_PACKED user_ops_t; + +/** + * Program Chain Information. + */ +typedef struct { + uint16_t zero_1; + uint8_t nr_of_programs; + uint8_t nr_of_cells; + dvd_time_t playback_time; + user_ops_t prohibited_ops; + uint16_t audio_control[8]; /* New type? */ + uint32_t subp_control[32]; /* New type? */ + uint16_t next_pgc_nr; + uint16_t prev_pgc_nr; + uint16_t goup_pgc_nr; + uint8_t pg_playback_mode; + uint8_t still_time; + uint32_t palette[16]; /* New type struct {zero_1, Y, Cr, Cb} ? */ + uint16_t command_tbl_offset; + uint16_t program_map_offset; + uint16_t cell_playback_offset; + uint16_t cell_position_offset; + pgc_command_tbl_t *command_tbl; + pgc_program_map_t *program_map; + cell_playback_t *cell_playback; + cell_position_t *cell_position; +} ATTRIBUTE_PACKED pgc_t; +#define PGC_SIZE 236U + +/** + * Program Chain Information Search Pointer. + */ +typedef struct { + uint8_t entry_id; +#ifdef WORDS_BIGENDIAN + unsigned int block_mode : 2; + unsigned int block_type : 2; + unsigned int unknown1 : 4; +#else + unsigned int unknown1 : 4; + unsigned int block_type : 2; + unsigned int block_mode : 2; +#endif + uint16_t ptl_id_mask; + uint32_t pgc_start_byte; + pgc_t *pgc; +} ATTRIBUTE_PACKED pgci_srp_t; +#define PGCI_SRP_SIZE 8U + +/** + * Program Chain Information Table. + */ +typedef struct { + uint16_t nr_of_pgci_srp; + uint16_t zero_1; + uint32_t last_byte; + pgci_srp_t *pgci_srp; +} ATTRIBUTE_PACKED pgcit_t; +#define PGCIT_SIZE 8U + +/** + * Menu PGCI Language Unit. + */ +typedef struct { + uint16_t lang_code; + uint8_t lang_extension; + uint8_t exists; + uint32_t lang_start_byte; + pgcit_t *pgcit; +} ATTRIBUTE_PACKED pgci_lu_t; +#define PGCI_LU_SIZE 8U + +/** + * Menu PGCI Unit Table. + */ +typedef struct { + uint16_t nr_of_lus; + uint16_t zero_1; + uint32_t last_byte; + pgci_lu_t *lu; +} ATTRIBUTE_PACKED pgci_ut_t; +#define PGCI_UT_SIZE 8U + +/** + * Cell Address Information. + */ +typedef struct { + uint16_t vob_id; + uint8_t cell_id; + uint8_t zero_1; + uint32_t start_sector; + uint32_t last_sector; +} ATTRIBUTE_PACKED cell_adr_t; + +/** + * Cell Address Table. + */ +typedef struct { + uint16_t nr_of_vobs; /* VOBs */ + uint16_t zero_1; + uint32_t last_byte; + cell_adr_t *cell_adr_table; /* No explicit size given. */ +} ATTRIBUTE_PACKED c_adt_t; +#define C_ADT_SIZE 8U + +/** + * VOBU Address Map. + */ +typedef struct { + uint32_t last_byte; + uint32_t *vobu_start_sectors; +} ATTRIBUTE_PACKED vobu_admap_t; +#define VOBU_ADMAP_SIZE 4U + + + + +/** + * VMGI + * + * The following structures relate to the Video Manager. + */ + +/** + * Video Manager Information Management Table. + */ +typedef struct { + char vmg_identifier[12]; + uint32_t vmg_last_sector; + uint8_t zero_1[12]; + uint32_t vmgi_last_sector; + uint8_t zero_2; + uint8_t specification_version; + uint32_t vmg_category; + uint16_t vmg_nr_of_volumes; + uint16_t vmg_this_volume_nr; + uint8_t disc_side; + uint8_t zero_3[19]; + uint16_t vmg_nr_of_title_sets; /* Number of VTSs. */ + char provider_identifier[32]; + uint64_t vmg_pos_code; + uint8_t zero_4[24]; + uint32_t vmgi_last_byte; + uint32_t first_play_pgc; + uint8_t zero_5[56]; + uint32_t vmgm_vobs; /* sector */ + uint32_t tt_srpt; /* sector */ + uint32_t vmgm_pgci_ut; /* sector */ + uint32_t ptl_mait; /* sector */ + uint32_t vts_atrt; /* sector */ + uint32_t txtdt_mgi; /* sector */ + uint32_t vmgm_c_adt; /* sector */ + uint32_t vmgm_vobu_admap; /* sector */ + uint8_t zero_6[32]; + + video_attr_t vmgm_video_attr; + uint8_t zero_7; + uint8_t nr_of_vmgm_audio_streams; /* should be 0 or 1 */ + audio_attr_t vmgm_audio_attr; + audio_attr_t zero_8[7]; + uint8_t zero_9[17]; + uint8_t nr_of_vmgm_subp_streams; /* should be 0 or 1 */ + subp_attr_t vmgm_subp_attr; + subp_attr_t zero_10[27]; /* XXX: how much 'padding' here? */ +} ATTRIBUTE_PACKED vmgi_mat_t; + +typedef struct { +#ifdef WORDS_BIGENDIAN + unsigned int zero_1 : 1; + unsigned int multi_or_random_pgc_title : 1; /* 0: one sequential pgc title */ + unsigned int jlc_exists_in_cell_cmd : 1; + unsigned int jlc_exists_in_prepost_cmd : 1; + unsigned int jlc_exists_in_button_cmd : 1; + unsigned int jlc_exists_in_tt_dom : 1; + unsigned int chapter_search_or_play : 1; /* UOP 1 */ + unsigned int title_or_time_play : 1; /* UOP 0 */ +#else + unsigned int title_or_time_play : 1; + unsigned int chapter_search_or_play : 1; + unsigned int jlc_exists_in_tt_dom : 1; + unsigned int jlc_exists_in_button_cmd : 1; + unsigned int jlc_exists_in_prepost_cmd : 1; + unsigned int jlc_exists_in_cell_cmd : 1; + unsigned int multi_or_random_pgc_title : 1; + unsigned int zero_1 : 1; +#endif +} ATTRIBUTE_PACKED playback_type_t; + +/** + * Title Information. + */ +typedef struct { + playback_type_t pb_ty; + uint8_t nr_of_angles; + uint16_t nr_of_ptts; + uint16_t parental_id; + uint8_t title_set_nr; + uint8_t vts_ttn; + uint32_t title_set_sector; +} ATTRIBUTE_PACKED title_info_t; + +/** + * PartOfTitle Search Pointer Table. + */ +typedef struct { + uint16_t nr_of_srpts; + uint16_t zero_1; + uint32_t last_byte; + title_info_t *title; +} ATTRIBUTE_PACKED tt_srpt_t; +#define TT_SRPT_SIZE 8U + + +/** + * Parental Management Information Unit Table. + * Level 1 (US: G), ..., 7 (US: NC-17), 8 + */ +typedef uint16_t pf_level_t[8]; + +/** + * Parental Management Information Unit Table. + */ +typedef struct { + uint16_t country_code; + uint16_t zero_1; + uint16_t pf_ptl_mai_start_byte; + uint16_t zero_2; + pf_level_t *pf_ptl_mai; /* table of (nr_of_vtss + 1), video_ts is first */ +} ATTRIBUTE_PACKED ptl_mait_country_t; +#define PTL_MAIT_COUNTRY_SIZE 8U + +/** + * Parental Management Information Table. + */ +typedef struct { + uint16_t nr_of_countries; + uint16_t nr_of_vtss; + uint32_t last_byte; + ptl_mait_country_t *countries; +} ATTRIBUTE_PACKED ptl_mait_t; +#define PTL_MAIT_SIZE 8U + +/** + * Video Title Set Attributes. + */ +typedef struct { + uint32_t last_byte; + uint32_t vts_cat; + + video_attr_t vtsm_vobs_attr; + uint8_t zero_1; + uint8_t nr_of_vtsm_audio_streams; /* should be 0 or 1 */ + audio_attr_t vtsm_audio_attr; + audio_attr_t zero_2[7]; + uint8_t zero_3[16]; + uint8_t zero_4; + uint8_t nr_of_vtsm_subp_streams; /* should be 0 or 1 */ + subp_attr_t vtsm_subp_attr; + subp_attr_t zero_5[27]; + + uint8_t zero_6[2]; + + video_attr_t vtstt_vobs_video_attr; + uint8_t zero_7; + uint8_t nr_of_vtstt_audio_streams; + audio_attr_t vtstt_audio_attr[8]; + uint8_t zero_8[16]; + uint8_t zero_9; + uint8_t nr_of_vtstt_subp_streams; + subp_attr_t vtstt_subp_attr[32]; +} ATTRIBUTE_PACKED vts_attributes_t; +#define VTS_ATTRIBUTES_SIZE 542U +#define VTS_ATTRIBUTES_MIN_SIZE 356U + +/** + * Video Title Set Attribute Table. + */ +typedef struct { + uint16_t nr_of_vtss; + uint16_t zero_1; + uint32_t last_byte; + vts_attributes_t *vts; + uint32_t *vts_atrt_offsets; /* offsets table for each vts_attributes */ +} ATTRIBUTE_PACKED vts_atrt_t; +#define VTS_ATRT_SIZE 8U + +/** + * Text Data. (Incomplete) + */ +typedef struct { + uint32_t last_byte; /* offsets are relative here */ + uint16_t offsets[100]; /* == nr_of_srpts + 1 (first is disc title) */ +#if 0 + uint16_t unknown; /* 0x48 ?? 0x48 words (16bit) info following */ + uint16_t zero_1; + + uint8_t type_of_info; /* ?? 01 == disc, 02 == Title, 04 == Title part */ + uint8_t unknown1; + uint8_t unknown2; + uint8_t unknown3; + uint8_t unknown4; /* ?? allways 0x30 language?, text format? */ + uint8_t unknown5; + uint16_t offset; /* from first */ + + char text[12]; /* ended by 0x09 */ +#endif +} ATTRIBUTE_PACKED txtdt_t; + +/** + * Text Data Language Unit. (Incomplete) + */ +typedef struct { + uint16_t lang_code; + uint16_t unknown; /* 0x0001, title 1? disc 1? side 1? */ + uint32_t txtdt_start_byte; /* prt, rel start of vmg_txtdt_mgi */ + txtdt_t *txtdt; +} ATTRIBUTE_PACKED txtdt_lu_t; +#define TXTDT_LU_SIZE 8U + +/** + * Text Data Manager Information. (Incomplete) + */ +typedef struct { + char disc_name[14]; /* how many bytes?? */ + uint16_t nr_of_language_units; /* 32bit?? */ + uint32_t last_byte; + txtdt_lu_t *lu; +} ATTRIBUTE_PACKED txtdt_mgi_t; +#define TXTDT_MGI_SIZE 20U + + +/** + * VTS + * + * Structures relating to the Video Title Set (VTS). + */ + +/** + * Video Title Set Information Management Table. + */ +typedef struct { + char vts_identifier[12]; + uint32_t vts_last_sector; + uint8_t zero_1[12]; + uint32_t vtsi_last_sector; + uint8_t zero_2; + uint8_t specification_version; + uint32_t vts_category; + uint16_t zero_3; + uint16_t zero_4; + uint8_t zero_5; + uint8_t zero_6[19]; + uint16_t zero_7; + uint8_t zero_8[32]; + uint64_t zero_9; + uint8_t zero_10[24]; + uint32_t vtsi_last_byte; + uint32_t zero_11; + uint8_t zero_12[56]; + uint32_t vtsm_vobs; /* sector */ + uint32_t vtstt_vobs; /* sector */ + uint32_t vts_ptt_srpt; /* sector */ + uint32_t vts_pgcit; /* sector */ + uint32_t vtsm_pgci_ut; /* sector */ + uint32_t vts_tmapt; /* sector */ + uint32_t vtsm_c_adt; /* sector */ + uint32_t vtsm_vobu_admap; /* sector */ + uint32_t vts_c_adt; /* sector */ + uint32_t vts_vobu_admap; /* sector */ + uint8_t zero_13[24]; + + video_attr_t vtsm_video_attr; + uint8_t zero_14; + uint8_t nr_of_vtsm_audio_streams; /* should be 0 or 1 */ + audio_attr_t vtsm_audio_attr; + audio_attr_t zero_15[7]; + uint8_t zero_16[17]; + uint8_t nr_of_vtsm_subp_streams; /* should be 0 or 1 */ + subp_attr_t vtsm_subp_attr; + subp_attr_t zero_17[27]; + uint8_t zero_18[2]; + + video_attr_t vts_video_attr; + uint8_t zero_19; + uint8_t nr_of_vts_audio_streams; + audio_attr_t vts_audio_attr[8]; + uint8_t zero_20[17]; + uint8_t nr_of_vts_subp_streams; + subp_attr_t vts_subp_attr[32]; + uint16_t zero_21; + multichannel_ext_t vts_mu_audio_attr[8]; + /* XXX: how much 'padding' here, if any? */ +} ATTRIBUTE_PACKED vtsi_mat_t; + +/** + * PartOfTitle Unit Information. + */ +typedef struct { + uint16_t pgcn; + uint16_t pgn; +} ATTRIBUTE_PACKED ptt_info_t; + +/** + * PartOfTitle Information. + */ +typedef struct { + uint16_t nr_of_ptts; + ptt_info_t *ptt; +} ATTRIBUTE_PACKED ttu_t; + +/** + * PartOfTitle Search Pointer Table. + */ +typedef struct { + uint16_t nr_of_srpts; + uint16_t zero_1; + uint32_t last_byte; + ttu_t *title; + uint32_t *ttu_offset; /* offset table for each ttu */ +} ATTRIBUTE_PACKED vts_ptt_srpt_t; +#define VTS_PTT_SRPT_SIZE 8U + + +/** + * Time Map Entry. + */ +/* Should this be bit field at all or just the uint32_t? */ +typedef uint32_t map_ent_t; + +/** + * Time Map. + */ +typedef struct { + uint8_t tmu; /* Time unit, in seconds */ + uint8_t zero_1; + uint16_t nr_of_entries; + map_ent_t *map_ent; +} ATTRIBUTE_PACKED vts_tmap_t; +#define VTS_TMAP_SIZE 4U + +/** + * Time Map Table. + */ +typedef struct { + uint16_t nr_of_tmaps; + uint16_t zero_1; + uint32_t last_byte; + vts_tmap_t *tmap; + uint32_t *tmap_offset; /* offset table for each tmap */ +} ATTRIBUTE_PACKED vts_tmapt_t; +#define VTS_TMAPT_SIZE 8U + + +#if PRAGMA_PACK +#pragma pack() +#endif + + +/** + * The following structure defines an IFO file. The structure is divided into + * two parts, the VMGI, or Video Manager Information, which is read from the + * VIDEO_TS.[IFO,BUP] file, and the VTSI, or Video Title Set Information, which + * is read in from the VTS_XX_0.[IFO,BUP] files. + */ +typedef struct { + dvd_file_t *file; + + /* VMGI */ + vmgi_mat_t *vmgi_mat; + tt_srpt_t *tt_srpt; + pgc_t *first_play_pgc; + ptl_mait_t *ptl_mait; + vts_atrt_t *vts_atrt; + txtdt_mgi_t *txtdt_mgi; + + /* Common */ + pgci_ut_t *pgci_ut; + c_adt_t *menu_c_adt; + vobu_admap_t *menu_vobu_admap; + + /* VTSI */ + vtsi_mat_t *vtsi_mat; + vts_ptt_srpt_t *vts_ptt_srpt; + pgcit_t *vts_pgcit; + vts_tmapt_t *vts_tmapt; + c_adt_t *vts_c_adt; + vobu_admap_t *vts_vobu_admap; +} ifo_handle_t; + +#endif /* IFO_TYPES_H_INCLUDED */ diff --git a/dvdread/md5.c b/dvdread/md5.c new file mode 100644 index 0000000..3e02b6b --- /dev/null +++ b/dvdread/md5.c @@ -0,0 +1,407 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* md5.c - Functions to compute MD5 message digest of files or memory blocks + according to the definition of MD5 in RFC 1321 from April 1992. + Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + 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, 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. */ + +/* Written by Ulrich Drepper , 1995. */ + +#include "config.h" + +#include +#include +#include +#include "md5.h" + +#ifdef _LIBC +# include +# if __BYTE_ORDER == __BIG_ENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +#ifdef WORDS_BIGENDIAN +# define SWAP(n) \ + (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) +#else +# define SWAP(n) (n) +#endif + + +/* This array contains the bytes used to pad the buffer to the next + 64-byte boundary. (RFC 1321, 3.1: Step 1) */ +static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; + + +/* Initialize structure containing state of computation. + (RFC 1321, 3.3: Step 3) */ +void +md5_init_ctx (ctx) + struct md5_ctx *ctx; +{ + ctx->A = 0x67452301; + ctx->B = 0xefcdab89; + ctx->C = 0x98badcfe; + ctx->D = 0x10325476; + + ctx->total[0] = ctx->total[1] = 0; + ctx->buflen = 0; +} + +/* Put result from CTX in first 16 bytes following RESBUF. The result + must be in little endian byte order. + + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +void * +md5_read_ctx (ctx, resbuf) + const struct md5_ctx *ctx; + void *resbuf; +{ + ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); + ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); + ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); + ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); + + return resbuf; +} + +/* Process the remaining bytes in the internal buffer and the usual + prolog according to the standard and write the result to RESBUF. + + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +void * +md5_finish_ctx (ctx, resbuf) + struct md5_ctx *ctx; + void *resbuf; +{ + /* Take yet unprocessed bytes into account. */ + md5_uint32 bytes = ctx->buflen; + size_t pad; + + /* Now count remaining bytes. */ + ctx->total[0] += bytes; + if (ctx->total[0] < bytes) + ++ctx->total[1]; + + pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; + memcpy (&ctx->buffer[bytes], fillbuf, pad); + + /* Put the 64-bit file length in *bits* at the end of the buffer. */ + *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); + *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | + (ctx->total[0] >> 29)); + + /* Process last bytes. */ + md5_process_block (ctx->buffer, bytes + pad + 8, ctx); + + return md5_read_ctx (ctx, resbuf); +} + +/* Compute MD5 message digest for bytes read from STREAM. The + resulting message digest number will be written into the 16 bytes + beginning at RESBLOCK. */ +int +md5_stream (stream, resblock) + FILE *stream; + void *resblock; +{ + /* Important: BLOCKSIZE must be a multiple of 64. */ +#define BLOCKSIZE 4096 + struct md5_ctx ctx; + char buffer[BLOCKSIZE + 72]; + size_t sum; + + /* Initialize the computation context. */ + md5_init_ctx (&ctx); + + /* Iterate over full file contents. */ + while (1) + { + /* We read the file in blocks of BLOCKSIZE bytes. One call of the + computation function processes the whole buffer so that with the + next round of the loop another block can be read. */ + size_t n; + sum = 0; + + /* Read block. Take care for partial reads. */ + do + { + n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); + + sum += n; + } + while (sum < BLOCKSIZE && n != 0); + if (n == 0 && ferror (stream)) + return 1; + + /* If end of file is reached, end the loop. */ + if (n == 0) + break; + + /* Process buffer with BLOCKSIZE bytes. Note that + BLOCKSIZE % 64 == 0 + */ + md5_process_block (buffer, BLOCKSIZE, &ctx); + } + + /* Add the last bytes if necessary. */ + if (sum > 0) + md5_process_bytes (buffer, sum, &ctx); + + /* Construct result in desired memory. */ + md5_finish_ctx (&ctx, resblock); + return 0; +} + +/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The + result is always in little endian byte order, so that a byte-wise + output yields to the wanted ASCII representation of the message + digest. */ +void * +md5_buffer (buffer, len, resblock) + const char *buffer; + size_t len; + void *resblock; +{ + struct md5_ctx ctx; + + /* Initialize the computation context. */ + md5_init_ctx (&ctx); + + /* Process whole buffer but last len % 64 bytes. */ + md5_process_bytes (buffer, len, &ctx); + + /* Put result in desired memory area. */ + return md5_finish_ctx (&ctx, resblock); +} + + +void +md5_process_bytes (buffer, len, ctx) + const void *buffer; + size_t len; + struct md5_ctx *ctx; +{ + /* When we already have some bits in our internal buffer concatenate + both inputs first. */ + if (ctx->buflen != 0) + { + size_t left_over = ctx->buflen; + size_t add = 128 - left_over > len ? len : 128 - left_over; + + memcpy (&ctx->buffer[left_over], buffer, add); + ctx->buflen += add; + + if (left_over + add > 64) + { + md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx); + /* The regions in the following copy operation cannot overlap. */ + memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], + (left_over + add) & 63); + ctx->buflen = (left_over + add) & 63; + } + + buffer = (const char *) buffer + add; + len -= add; + } + + /* Process available complete blocks. */ + if (len > 64) + { + md5_process_block (buffer, len & ~63, ctx); + buffer = (const char *) buffer + (len & ~63); + len &= 63; + } + + /* Move remaining bytes in internal buffer. */ + if (len > 0) + { + memcpy (ctx->buffer, buffer, len); + ctx->buflen = len; + } +} + + +/* These are the four functions used in the four steps of the MD5 algorithm + and defined in the RFC 1321. The first function is a little bit optimized + (as found in Colin Plumbs public domain implementation). */ +/* #define FF(b, c, d) ((b & c) | (~b & d)) */ +#define FF(b, c, d) (d ^ (b & (c ^ d))) +#define FG(b, c, d) FF (d, b, c) +#define FH(b, c, d) (b ^ c ^ d) +#define FI(b, c, d) (c ^ (b | ~d)) + +/* Process LEN bytes of BUFFER, accumulating context into CTX. + It is assumed that LEN % 64 == 0. */ + +void +md5_process_block (buffer, len, ctx) + const void *buffer; + size_t len; + struct md5_ctx *ctx; +{ + md5_uint32 correct_words[16]; + const md5_uint32 *words = buffer; + size_t nwords = len / sizeof (md5_uint32); + const md5_uint32 *endp = words + nwords; + md5_uint32 A = ctx->A; + md5_uint32 B = ctx->B; + md5_uint32 C = ctx->C; + md5_uint32 D = ctx->D; + + /* First increment the byte count. RFC 1321 specifies the possible + length of the file up to 2^64 bits. Here we only compute the + number of bytes. Do a double word increment. */ + ctx->total[0] += len; + if (ctx->total[0] < len) + ++ctx->total[1]; + + /* Process all bytes in the buffer with 64 bytes in each round of + the loop. */ + while (words < endp) + { + md5_uint32 *cwp = correct_words; + md5_uint32 A_save = A; + md5_uint32 B_save = B; + md5_uint32 C_save = C; + md5_uint32 D_save = D; + + /* First round: using the given function, the context and a constant + the next context is computed. Because the algorithms processing + unit is a 32-bit word and it is determined to work on words in + little endian byte order we perhaps have to change the byte order + before the computation. To reduce the work for the next steps + we store the swapped words in the array CORRECT_WORDS. */ + +#define OP(a, b, c, d, s, T) \ + do \ + { \ + a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ + ++words; \ + a = rol (a, s); \ + a += b; \ + } \ + while (0) + + /* Before we start, one word to the strange constants. + They are defined in RFC 1321 as + + T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64, or + perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin $_))}' + */ + + /* Round 1. */ + OP (A, B, C, D, 7, 0xd76aa478); + OP (D, A, B, C, 12, 0xe8c7b756); + OP (C, D, A, B, 17, 0x242070db); + OP (B, C, D, A, 22, 0xc1bdceee); + OP (A, B, C, D, 7, 0xf57c0faf); + OP (D, A, B, C, 12, 0x4787c62a); + OP (C, D, A, B, 17, 0xa8304613); + OP (B, C, D, A, 22, 0xfd469501); + OP (A, B, C, D, 7, 0x698098d8); + OP (D, A, B, C, 12, 0x8b44f7af); + OP (C, D, A, B, 17, 0xffff5bb1); + OP (B, C, D, A, 22, 0x895cd7be); + OP (A, B, C, D, 7, 0x6b901122); + OP (D, A, B, C, 12, 0xfd987193); + OP (C, D, A, B, 17, 0xa679438e); + OP (B, C, D, A, 22, 0x49b40821); + + /* For the second to fourth round we have the possibly swapped words + in CORRECT_WORDS. Redefine the macro to take an additional first + argument specifying the function to use. */ +#undef OP +#define OP(f, a, b, c, d, k, s, T) \ + do \ + { \ + a += f (b, c, d) + correct_words[k] + T; \ + a = rol (a, s); \ + a += b; \ + } \ + while (0) + + /* Round 2. */ + OP (FG, A, B, C, D, 1, 5, 0xf61e2562); + OP (FG, D, A, B, C, 6, 9, 0xc040b340); + OP (FG, C, D, A, B, 11, 14, 0x265e5a51); + OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); + OP (FG, A, B, C, D, 5, 5, 0xd62f105d); + OP (FG, D, A, B, C, 10, 9, 0x02441453); + OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); + OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); + OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); + OP (FG, D, A, B, C, 14, 9, 0xc33707d6); + OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); + OP (FG, B, C, D, A, 8, 20, 0x455a14ed); + OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); + OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); + OP (FG, C, D, A, B, 7, 14, 0x676f02d9); + OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); + + /* Round 3. */ + OP (FH, A, B, C, D, 5, 4, 0xfffa3942); + OP (FH, D, A, B, C, 8, 11, 0x8771f681); + OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); + OP (FH, B, C, D, A, 14, 23, 0xfde5380c); + OP (FH, A, B, C, D, 1, 4, 0xa4beea44); + OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); + OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); + OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); + OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); + OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); + OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); + OP (FH, B, C, D, A, 6, 23, 0x04881d05); + OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); + OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); + OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); + OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); + + /* Round 4. */ + OP (FI, A, B, C, D, 0, 6, 0xf4292244); + OP (FI, D, A, B, C, 7, 10, 0x432aff97); + OP (FI, C, D, A, B, 14, 15, 0xab9423a7); + OP (FI, B, C, D, A, 5, 21, 0xfc93a039); + OP (FI, A, B, C, D, 12, 6, 0x655b59c3); + OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); + OP (FI, C, D, A, B, 10, 15, 0xffeff47d); + OP (FI, B, C, D, A, 1, 21, 0x85845dd1); + OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); + OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); + OP (FI, C, D, A, B, 6, 15, 0xa3014314); + OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); + OP (FI, A, B, C, D, 4, 6, 0xf7537e82); + OP (FI, D, A, B, C, 11, 10, 0xbd3af235); + OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); + OP (FI, B, C, D, A, 9, 21, 0xeb86d391); + + /* Add the starting values of the context. */ + A += A_save; + B += B_save; + C += C_save; + D += D_save; + } + + /* Put checksum in context given as argument. */ + ctx->A = A; + ctx->B = B; + ctx->C = C; + ctx->D = D; +} diff --git a/dvdread/md5.h b/dvdread/md5.h new file mode 100644 index 0000000..2d9a8b4 --- /dev/null +++ b/dvdread/md5.h @@ -0,0 +1,162 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* md5.h - Declaration of functions and data types used for MD5 sum + computing library functions. + Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + 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, 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. */ + +#ifndef _MD5_H +#define _MD5_H + +#include + +#if defined HAVE_LIMITS_H || _LIBC +# include +#endif + +/* The following contortions are an attempt to use the C preprocessor + to determine an unsigned integral type that is 32 bits wide. An + alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but + doing that would require that the configure script compile and *run* + the resulting executable. Locally running cross-compiled executables + is usually not possible. */ + +#ifdef _LIBC +# include +typedef u_int32_t md5_uint32; +#else +# if defined __STDC__ && __STDC__ +# define UINT_MAX_32_BITS 4294967295U +# else +# define UINT_MAX_32_BITS 0xFFFFFFFF +# endif + +/* If UINT_MAX isn't defined, assume it's a 32-bit type. + This should be valid for all systems GNU cares about because + that doesn't include 16-bit systems, and only modern systems + (that certainly have ) have 64+-bit integral types. */ + +# ifndef UINT_MAX +# define UINT_MAX UINT_MAX_32_BITS +# endif + +# if UINT_MAX == UINT_MAX_32_BITS +typedef unsigned int md5_uint32; +# else +# if USHRT_MAX == UINT_MAX_32_BITS +typedef unsigned short md5_uint32; +# else +# if ULONG_MAX == UINT_MAX_32_BITS +typedef unsigned long md5_uint32; +# else +/* The following line is intended to evoke an error. + Using #error is not portable enough. */ +"Cannot determine unsigned 32-bit data type." +# endif +# endif +# endif +#endif + +#undef __P +#if defined (__STDC__) && __STDC__ +#define __P(x) x +#else +#define __P(x) () +#endif + +/* Structure to save state of computation between the single steps. */ +struct md5_ctx +{ + md5_uint32 A; + md5_uint32 B; + md5_uint32 C; + md5_uint32 D; + + md5_uint32 total[2]; + md5_uint32 buflen; + char buffer[128]; +}; + +/* + * The following three functions are build up the low level used in + * the functions `md5_stream' and `md5_buffer'. + */ + +/* Initialize structure containing state of computation. + (RFC 1321, 3.3: Step 3) */ +extern void md5_init_ctx __P ((struct md5_ctx *ctx)); + +/* Starting with the result of former calls of this function (or the + initialization function update the context for the next LEN bytes + starting at BUFFER. + It is necessary that LEN is a multiple of 64!!! */ +extern void md5_process_block __P ((const void *buffer, size_t len, + struct md5_ctx *ctx)); + +/* Starting with the result of former calls of this function (or the + initialization function update the context for the next LEN bytes + starting at BUFFER. + It is NOT required that LEN is a multiple of 64. */ +extern void md5_process_bytes __P ((const void *buffer, size_t len, + struct md5_ctx *ctx)); + +/* Process the remaining bytes in the buffer and put result from CTX + in first 16 bytes following RESBUF. The result is always in little + endian byte order, so that a byte-wise output yields to the wanted + ASCII representation of the message digest. + + IMPORTANT: On some systems it is required that RESBUF be correctly + aligned for a 32 bits value. */ +extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); + + +/* Put result from CTX in first 16 bytes following RESBUF. The result is + always in little endian byte order, so that a byte-wise output yields + to the wanted ASCII representation of the message digest. + + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); + + +/* Compute MD5 message digest for bytes read from STREAM. The + resulting message digest number will be written into the 16 bytes + beginning at RESBLOCK. */ +extern int md5_stream __P ((FILE *stream, void *resblock)); + +/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The + result is always in little endian byte order, so that a byte-wise + output yields to the wanted ASCII representation of the message + digest. */ +extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); + +/* The following is from gnupg-1.0.2's cipher/bithelp.h. */ +/* Rotate a 32 bit integer by n bytes */ +#if defined __GNUC__ && defined __i386__ +static md5_uint32 +rol(md5_uint32 x, int n) +{ + __asm__("roll %%cl,%0" + :"=r" (x) + :"0" (x),"c" (n)); + return x; +} +#else +# define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) +#endif + +#endif diff --git a/dvdread/nav_read.c b/dvdread/nav_read.c new file mode 100644 index 0000000..54d9a11 --- /dev/null +++ b/dvdread/nav_read.c @@ -0,0 +1,209 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + * Copyright (C) 2000, 2001, 2002, 2003 H�kan Hjort + * + * 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 + */ + +#include "config.h" + +#include +#include +#if defined(HAVE_INTTYPES_H) +#include +#elif defined(HAVE_STDINT_H) +#include +#endif + +#include "bswap.h" +#include "nav_types.h" +#include "nav_read.h" +#include "dvdread_internal.h" + +void navRead_PCI(pci_t *pci, unsigned char *buffer) { + int i, j; + + CHECK_VALUE(sizeof(pci_t) == PCI_BYTES - 1); /* -1 for substream id*/ + + memcpy(pci, buffer, sizeof(pci_t)); + + /* Endian conversions */ + + /* pci pci_gi */ + B2N_32(pci->pci_gi.nv_pck_lbn); + B2N_16(pci->pci_gi.vobu_cat); + B2N_32(pci->pci_gi.vobu_s_ptm); + B2N_32(pci->pci_gi.vobu_e_ptm); + B2N_32(pci->pci_gi.vobu_se_e_ptm); + + /* pci nsml_agli */ + for(i = 0; i < 9; i++) + B2N_32(pci->nsml_agli.nsml_agl_dsta[i]); + + /* pci hli hli_gi */ + B2N_16(pci->hli.hl_gi.hli_ss); + B2N_32(pci->hli.hl_gi.hli_s_ptm); + B2N_32(pci->hli.hl_gi.hli_e_ptm); + B2N_32(pci->hli.hl_gi.btn_se_e_ptm); + + /* pci hli btn_colit */ + for(i = 0; i < 3; i++) + for(j = 0; j < 2; j++) + B2N_32(pci->hli.btn_colit.btn_coli[i][j]); + + /* NOTE: I've had to change the structure from the disk layout to get + * the packing to work with Sun's Forte C compiler. */ + + /* pci hli btni */ + for(i = 0; i < 36; i++) { + char tmp[sizeof(pci->hli.btnit[i])], swap; + memcpy(tmp, &(pci->hli.btnit[i]), sizeof(pci->hli.btnit[i])); + /* Byte 4 to 7 are 'rotated' was: ABCD EFGH IJ is: ABCG DEFH IJ */ + swap = tmp[6]; + tmp[6] = tmp[5]; + tmp[5] = tmp[4]; + tmp[4] = tmp[3]; + tmp[3] = swap; + + /* Then there are the two B2N_24(..) calls */ +#ifndef WORDS_BIGENDIAN + swap = tmp[0]; + tmp[0] = tmp[2]; + tmp[2] = swap; + + swap = tmp[4]; + tmp[4] = tmp[6]; + tmp[6] = swap; +#endif + memcpy(&(pci->hli.btnit[i]), tmp, sizeof(pci->hli.btnit[i])); + } + + +#ifndef NDEBUG + /* Asserts */ + + /* pci pci gi */ + CHECK_VALUE(pci->pci_gi.zero1 == 0); + + /* pci hli hli_gi */ + CHECK_VALUE(pci->hli.hl_gi.zero1 == 0); + CHECK_VALUE(pci->hli.hl_gi.zero2 == 0); + CHECK_VALUE(pci->hli.hl_gi.zero3 == 0); + CHECK_VALUE(pci->hli.hl_gi.zero4 == 0); + CHECK_VALUE(pci->hli.hl_gi.zero5 == 0); + + /* Are there buttons defined here? */ + if((pci->hli.hl_gi.hli_ss & 0x03) != 0) { + CHECK_VALUE(pci->hli.hl_gi.btn_ns != 0); + CHECK_VALUE(pci->hli.hl_gi.btngr_ns != 0); + } else { + CHECK_VALUE((pci->hli.hl_gi.btn_ns != 0 && pci->hli.hl_gi.btngr_ns != 0) + || (pci->hli.hl_gi.btn_ns == 0 && pci->hli.hl_gi.btngr_ns == 0)); + } + + /* pci hli btnit */ + for(i = 0; i < pci->hli.hl_gi.btngr_ns; i++) { + for(j = 0; j < (36 / pci->hli.hl_gi.btngr_ns); j++) { + int n = (36 / pci->hli.hl_gi.btngr_ns) * i + j; + CHECK_VALUE(pci->hli.btnit[n].zero1 == 0); + CHECK_VALUE(pci->hli.btnit[n].zero2 == 0); + CHECK_VALUE(pci->hli.btnit[n].zero3 == 0); + CHECK_VALUE(pci->hli.btnit[n].zero4 == 0); + CHECK_VALUE(pci->hli.btnit[n].zero5 == 0); + CHECK_VALUE(pci->hli.btnit[n].zero6 == 0); + + if (j < pci->hli.hl_gi.btn_ns) { + CHECK_VALUE(pci->hli.btnit[n].x_start <= pci->hli.btnit[n].x_end); + CHECK_VALUE(pci->hli.btnit[n].y_start <= pci->hli.btnit[n].y_end); + CHECK_VALUE(pci->hli.btnit[n].up <= pci->hli.hl_gi.btn_ns); + CHECK_VALUE(pci->hli.btnit[n].down <= pci->hli.hl_gi.btn_ns); + CHECK_VALUE(pci->hli.btnit[n].left <= pci->hli.hl_gi.btn_ns); + CHECK_VALUE(pci->hli.btnit[n].right <= pci->hli.hl_gi.btn_ns); + /*vmcmd_verify(pci->hli.btnit[n].cmd);*/ + } else { + int k; + CHECK_VALUE(pci->hli.btnit[n].btn_coln == 0); + CHECK_VALUE(pci->hli.btnit[n].auto_action_mode == 0); + CHECK_VALUE(pci->hli.btnit[n].x_start == 0); + CHECK_VALUE(pci->hli.btnit[n].y_start == 0); + CHECK_VALUE(pci->hli.btnit[n].x_end == 0); + CHECK_VALUE(pci->hli.btnit[n].y_end == 0); + CHECK_VALUE(pci->hli.btnit[n].up == 0); + CHECK_VALUE(pci->hli.btnit[n].down == 0); + CHECK_VALUE(pci->hli.btnit[n].left == 0); + CHECK_VALUE(pci->hli.btnit[n].right == 0); + for (k = 0; k < 8; k++) + CHECK_VALUE(pci->hli.btnit[n].cmd.bytes[k] == 0); /*CHECK_ZERO?*/ + } + } + } +#endif /* !NDEBUG */ +} + +void navRead_DSI(dsi_t *dsi, unsigned char *buffer) { + int i; + + CHECK_VALUE(sizeof(dsi_t) == DSI_BYTES - 1); /* -1 for substream id*/ + + memcpy(dsi, buffer, sizeof(dsi_t)); + + /* Endian conversions */ + + /* dsi dsi gi */ + B2N_32(dsi->dsi_gi.nv_pck_scr); + B2N_32(dsi->dsi_gi.nv_pck_lbn); + B2N_32(dsi->dsi_gi.vobu_ea); + B2N_32(dsi->dsi_gi.vobu_1stref_ea); + B2N_32(dsi->dsi_gi.vobu_2ndref_ea); + B2N_32(dsi->dsi_gi.vobu_3rdref_ea); + B2N_16(dsi->dsi_gi.vobu_vob_idn); + + /* dsi sml pbi */ + B2N_16(dsi->sml_pbi.category); + B2N_32(dsi->sml_pbi.ilvu_ea); + B2N_32(dsi->sml_pbi.ilvu_sa); + B2N_16(dsi->sml_pbi.size); + B2N_32(dsi->sml_pbi.vob_v_s_s_ptm); + B2N_32(dsi->sml_pbi.vob_v_e_e_ptm); + + /* dsi sml agli */ + for(i = 0; i < 9; i++) { + B2N_32(dsi->sml_agli.data[ i ].address); + B2N_16(dsi->sml_agli.data[ i ].size); + } + + /* dsi vobu sri */ + B2N_32(dsi->vobu_sri.next_video); + for(i = 0; i < 19; i++) + B2N_32(dsi->vobu_sri.fwda[i]); + B2N_32(dsi->vobu_sri.next_vobu); + B2N_32(dsi->vobu_sri.prev_vobu); + for(i = 0; i < 19; i++) + B2N_32(dsi->vobu_sri.bwda[i]); + B2N_32(dsi->vobu_sri.prev_video); + + /* dsi synci */ + for(i = 0; i < 8; i++) + B2N_16(dsi->synci.a_synca[i]); + for(i = 0; i < 32; i++) + B2N_32(dsi->synci.sp_synca[i]); + + + /* Asserts */ + + /* dsi dsi gi */ + CHECK_VALUE(dsi->dsi_gi.zero1 == 0); +} + diff --git a/dvdread/nav_read.h b/dvdread/nav_read.h new file mode 100644 index 0000000..3f24558 --- /dev/null +++ b/dvdread/nav_read.h @@ -0,0 +1,52 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#ifndef NAV_READ_H_INCLUDED +#define NAV_READ_H_INCLUDED + +/* + * Copyright (C) 2000, 2001, 2002 H�kan Hjort . + * + * 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 + */ + +#include "nav_types.h" + +/** + * Parsing of NAV data, PCI and DSI parts. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Reads the PCI packet data pointed to into th pci struct. + * + * @param pci Pointer to the PCI data structure to be filled in. + * @param bufffer Pointer to the buffer of the on disc PCI data. + */ +void navRead_PCI(pci_t *, unsigned char *); + +/** + * Reads the DSI packet data pointed to into dsi struct. + * + * @param dsi Pointer to the DSI data structure to be filled in. + * @param bufffer Pointer to the buffer of the on disc DSI data. + */ +void navRead_DSI(dsi_t *, unsigned char *); + +#ifdef __cplusplus +}; +#endif +#endif /* NAV_READ_H_INCLUDED */ diff --git a/dvdread/nav_types.h b/dvdread/nav_types.h new file mode 100644 index 0000000..12e19f8 --- /dev/null +++ b/dvdread/nav_types.h @@ -0,0 +1,307 @@ +/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#ifndef NAV_TYPES_H_INCLUDED +#define NAV_TYPES_H_INCLUDED + +/* + * Copyright (C) 2000, 2001, 2002 H�kan Hjort + * + * The data structures in this file should represent the layout of the + * pci and dsi packets as they are stored in the stream. Information + * found by reading the source to VOBDUMP is the base for the structure + * and names of these data types. + * + * VOBDUMP: a program for examining DVD .VOB files. + * Copyright 1998, 1999 Eric Smith + * + * VOBDUMP is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. Note that I am not + * granting permission to redistribute or modify VOBDUMP under the terms + * of any later version of the General Public License. + * + * This program is distributed in the hope that it will be useful (or at + * least amusing), 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 + */ + +#include "ifo_types.h"/* only dvd_time_t, vm_cmd_t and user_ops_t */ +/* If it's ever removed add a uintX_t test. */ + +#undef ATTRIBUTE_PACKED +#undef PRAGMA_PACK_BEGIN +#undef PRAGMA_PACK_END + +#if defined(__GNUC__) +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#define ATTRIBUTE_PACKED __attribute__ ((packed)) +#define PRAGMA_PACK 0 +#endif +#endif + +#if !defined(ATTRIBUTE_PACKED) +#define ATTRIBUTE_PACKED +#define PRAGMA_PACK 1 +#endif + + +/* The length including the substream id byte. */ +#define PCI_BYTES 0x3d4 +#define DSI_BYTES 0x3fa + +#define PS2_PCI_SUBSTREAM_ID 0x00 +#define PS2_DSI_SUBSTREAM_ID 0x01 + +/* Remove this */ +#define DSI_START_BYTE 1031 + + +#if PRAGMA_PACK +#pragma pack(1) +#endif + + +/** + * PCI General Information + */ +typedef struct { + uint32_t nv_pck_lbn; /**< sector address of this nav pack */ + uint16_t vobu_cat; /**< 'category' of vobu */ + uint16_t zero1; /**< reserved */ + user_ops_t vobu_uop_ctl; /**< UOP of vobu */ + uint32_t vobu_s_ptm; /**< start presentation time of vobu */ + uint32_t vobu_e_ptm; /**< end presentation time of vobu */ + uint32_t vobu_se_e_ptm; /**< end ptm of sequence end in vobu */ + dvd_time_t e_eltm; /**< Cell elapsed time */ + char vobu_isrc[32]; +} ATTRIBUTE_PACKED pci_gi_t; + +/** + * Non Seamless Angle Information + */ +typedef struct { + uint32_t nsml_agl_dsta[9]; /**< address of destination vobu in AGL_C#n */ +} ATTRIBUTE_PACKED nsml_agli_t; + +/** + * Highlight General Information + * + * For btngrX_dsp_ty the bits have the following meaning: + * 000b: normal 4/3 only buttons + * XX1b: wide (16/9) buttons + * X1Xb: letterbox buttons + * 1XXb: pan&scan buttons + */ +typedef struct { + uint16_t hli_ss; /**< status, only low 2 bits 0: no buttons, 1: different 2: equal 3: eual except for button cmds */ + uint32_t hli_s_ptm; /**< start ptm of hli */ + uint32_t hli_e_ptm; /**< end ptm of hli */ + uint32_t btn_se_e_ptm; /**< end ptm of button select */ +#ifdef WORDS_BIGENDIAN + unsigned int zero1 : 2; /**< reserved */ + unsigned int btngr_ns : 2; /**< number of button groups 1, 2 or 3 with 36/18/12 buttons */ + unsigned int zero2 : 1; /**< reserved */ + unsigned int btngr1_dsp_ty : 3; /**< display type of subpic stream for button group 1 */ + unsigned int zero3 : 1; /**< reserved */ + unsigned int btngr2_dsp_ty : 3; /**< display type of subpic stream for button group 2 */ + unsigned int zero4 : 1; /**< reserved */ + unsigned int btngr3_dsp_ty : 3; /**< display type of subpic stream for button group 3 */ +#else + unsigned int btngr1_dsp_ty : 3; + unsigned int zero2 : 1; + unsigned int btngr_ns : 2; + unsigned int zero1 : 2; + unsigned int btngr3_dsp_ty : 3; + unsigned int zero4 : 1; + unsigned int btngr2_dsp_ty : 3; + unsigned int zero3 : 1; +#endif + uint8_t btn_ofn; /**< button offset number range 0-255 */ + uint8_t btn_ns; /**< number of valid buttons <= 36/18/12 (low 6 bits) */ + uint8_t nsl_btn_ns; /**< number of buttons selectable by U_BTNNi (low 6 bits) nsl_btn_ns <= btn_ns */ + uint8_t zero5; /**< reserved */ + uint8_t fosl_btnn; /**< forcedly selected button (low 6 bits) */ + uint8_t foac_btnn; /**< forcedly activated button (low 6 bits) */ +} ATTRIBUTE_PACKED hl_gi_t; + + +/** + * Button Color Information Table + * Each entry beeing a 32bit word that contains the color indexs and alpha + * values to use. They are all represented by 4 bit number and stored + * like this [Ci3, Ci2, Ci1, Ci0, A3, A2, A1, A0]. The actual palette + * that the indexes reference is in the PGC. + * @TODO split the uint32_t into a struct + */ +typedef struct { + uint32_t btn_coli[3][2]; /**< [button color number-1][select:0/action:1] */ +} ATTRIBUTE_PACKED btn_colit_t; + +/** + * Button Information + * + * NOTE: I've had to change the structure from the disk layout to get + * the packing to work with Sun's Forte C compiler. + * The 4 and 7 bytes are 'rotated' was: ABC DEF GHIJ is: ABCG DEFH IJ + */ +typedef struct { +#ifdef WORDS_BIGENDIAN + unsigned int btn_coln : 2; /**< button color number */ + unsigned int x_start : 10; /**< x start offset within the overlay */ + unsigned int zero1 : 2; /**< reserved */ + unsigned int x_end : 10; /**< x end offset within the overlay */ + + unsigned int zero3 : 2; /**< reserved */ + unsigned int up : 6; /**< button index when pressing up */ + + unsigned int auto_action_mode : 2; /**< 0: no, 1: activated if selected */ + unsigned int y_start : 10; /**< y start offset within the overlay */ + unsigned int zero2 : 2; /**< reserved */ + unsigned int y_end : 10; /**< y end offset within the overlay */ + + unsigned int zero4 : 2; /**< reserved */ + unsigned int down : 6; /**< button index when pressing down */ + unsigned int zero5 : 2; /**< reserved */ + unsigned int left : 6; /**< button index when pressing left */ + unsigned int zero6 : 2; /**< reserved */ + unsigned int right : 6; /**< button index when pressing right */ +#else + unsigned int x_end : 10; + unsigned int zero1 : 2; + unsigned int x_start : 10; + unsigned int btn_coln : 2; + + unsigned int up : 6; + unsigned int zero3 : 2; + + unsigned int y_end : 10; + unsigned int zero2 : 2; + unsigned int y_start : 10; + unsigned int auto_action_mode : 2; + + unsigned int down : 6; + unsigned int zero4 : 2; + unsigned int left : 6; + unsigned int zero5 : 2; + unsigned int right : 6; + unsigned int zero6 : 2; +#endif + vm_cmd_t cmd; +} ATTRIBUTE_PACKED btni_t; + +/** + * Highlight Information + */ +typedef struct { + hl_gi_t hl_gi; + btn_colit_t btn_colit; + btni_t btnit[36]; +} ATTRIBUTE_PACKED hli_t; + +/** + * PCI packet + */ +typedef struct { + pci_gi_t pci_gi; + nsml_agli_t nsml_agli; + hli_t hli; + uint8_t zero1[189]; +} ATTRIBUTE_PACKED pci_t; + + + + +/** + * DSI General Information + */ +typedef struct { + uint32_t nv_pck_scr; + uint32_t nv_pck_lbn; /**< sector address of this nav pack */ + uint32_t vobu_ea; /**< end address of this VOBU */ + uint32_t vobu_1stref_ea; /**< end address of the 1st reference image */ + uint32_t vobu_2ndref_ea; /**< end address of the 2nd reference image */ + uint32_t vobu_3rdref_ea; /**< end address of the 3rd reference image */ + uint16_t vobu_vob_idn; /**< VOB Id number that this VOBU is part of */ + uint8_t zero1; /**< reserved */ + uint8_t vobu_c_idn; /**< Cell Id number that this VOBU is part of */ + dvd_time_t c_eltm; /**< Cell elapsed time */ +} ATTRIBUTE_PACKED dsi_gi_t; + +/** + * Seamless Playback Information + */ +typedef struct { + uint16_t category; /**< 'category' of seamless VOBU */ + uint32_t ilvu_ea; /**< end address of interleaved Unit */ + uint32_t ilvu_sa; /**< start address of next interleaved unit */ + uint16_t size; /**< size of next interleaved unit */ + uint32_t vob_v_s_s_ptm; /**< video start ptm in vob */ + uint32_t vob_v_e_e_ptm; /**< video end ptm in vob */ + struct { + uint32_t stp_ptm1; + uint32_t stp_ptm2; + uint32_t gap_len1; + uint32_t gap_len2; + } vob_a[8]; +} ATTRIBUTE_PACKED sml_pbi_t; + +/** + * Seamless Angle Infromation for one angle + */ +typedef struct { + uint32_t address; /**< offset to next ILVU, high bit is before/after */ + uint16_t size; /**< byte size of the ILVU pointed to by address */ +} ATTRIBUTE_PACKED sml_agl_data_t; + +/** + * Seamless Angle Infromation + */ +typedef struct { + sml_agl_data_t data[9]; +} ATTRIBUTE_PACKED sml_agli_t; + +/** + * VOBU Search Information + */ +typedef struct { + uint32_t next_video; /**< Next vobu that contains video */ + uint32_t fwda[19]; /**< Forwards, time */ + uint32_t next_vobu; + uint32_t prev_vobu; + uint32_t bwda[19]; /**< Backwards, time */ + uint32_t prev_video; +} ATTRIBUTE_PACKED vobu_sri_t; + +#define SRI_END_OF_CELL 0x3fffffff + +/** + * Synchronous Information + */ +typedef struct { + uint16_t a_synca[8]; /**< offset to first audio packet for this VOBU */ + uint32_t sp_synca[32]; /**< offset to first subpicture packet */ +} ATTRIBUTE_PACKED synci_t; + +/** + * DSI packet + */ +typedef struct { + dsi_gi_t dsi_gi; + sml_pbi_t sml_pbi; + sml_agli_t sml_agli; + vobu_sri_t vobu_sri; + synci_t synci; + uint8_t zero1[471]; +} ATTRIBUTE_PACKED dsi_t; + + +#if PRAGMA_PACK +#pragma pack() +#endif + +#endif /* NAV_TYPES_H_INCLUDED */ diff --git a/k9Mplayer/Makefile.am b/k9Mplayer/Makefile.am new file mode 100644 index 0000000..b037c99 --- /dev/null +++ b/k9Mplayer/Makefile.am @@ -0,0 +1,8 @@ +INCLUDES = -I$(top_srcdir)/dvdread -I$(top_srcdir)/libk9copy $(all_includes) +METASOURCES = AUTO + +noinst_LTLIBRARIES = libk9mplayer.la +libk9mplayer_la_SOURCES = mplayer.ui k9mplayer.cpp + +libk9mplayer_la_LIBADD = $(top_builddir)/libdvdnav/libk9dvdnav.la +noinst_HEADERS = k9mplayer.h diff --git a/k9Mplayer/k9mplayer.cpp b/k9Mplayer/k9mplayer.cpp new file mode 100644 index 0000000..c5f501e --- /dev/null +++ b/k9Mplayer/k9mplayer.cpp @@ -0,0 +1,234 @@ + +#include "k9common.h" +#include "k9config.h" +#include +#include +#include +#include "k9mplayer.h" +#include +#include +#include +#include "k9dvd.h" +#include "k9dvdtitle.h" +#include +#include +#include +#include +#include +#include +#include + +K9Mplayer::K9Mplayer(QObject *parent,const char *name,const QStringList args):MPlayer((QWidget*)parent) { + m_seeking=FALSE; + m_initVol=TRUE; + m_title=0; + + m_process=new KProcess(this); + m_ratio=4.0/3.0; + + slider->setRange(0, 100); + slider->setSteps(1, 1); + bPlay->setPixmap(SmallIcon("player_play")); + bStop->setPixmap(SmallIcon("player_stop")); + bSwitchAudio->setPixmap(SmallIcon("cycle")); + connect(m_process,SIGNAL(receivedStdout( KProcess*, char*, int )),this,SLOT(receivedStdout( KProcess*, char*, int ))); + m_timer=new QTimer(this); + connect(m_process,SIGNAL(wroteStdin( KProcess* )),this,SLOT(wroteStdin( KProcess* ))); + connect(m_timer,SIGNAL(timeout()),this,SLOT(timeout())); + m_container=new QWidget(Label); +} + + +K9Mplayer::~K9Mplayer() {} + +void K9Mplayer::resizeEvent ( QResizeEvent * _resizeEvent) { + int w,h; + w=Label->width(); + h=Label->width() /m_ratio; + if (h>Label->height()) { + h=Label->height(); + w=Label->height()*m_ratio; + } + + m_container->resize(w,h); + m_container->move((Label->width()-w)/2,(Label->height()-h)/2); +} + + +void K9Mplayer::wroteStdin( KProcess *_process) { + m_canwrite = TRUE; +} + +void K9Mplayer::timeout() { + sendCmd( "get_percent_pos"); + +} + +void K9Mplayer::setDevice(const QString & _device) { + m_device=_device; +} + + +void K9Mplayer::setTitle( const QString & _numTitle,const QString &_numChapter) { + if (m_process->isRunning()) { + sendCmd("quit"); + m_process->wait( 1000); + } + k9Config config; + QString vout[]= {"x11","xv","gl2","sdl"}; + QString aout[]= {"alsa","oss","sdl"}; + QString vo=vout[config.getMplayerVout()]; + QString ao=aout[config.getMplayerAout()]; + + + m_process->clearArguments(); + *m_process << "mplayer"; + *m_process << "-vo" << vo << "-ao" << ao << "-sws" << "0"; + *m_process << "-framedrop"; + *m_process << "-wid" << QString::number(m_container->winId()) ; + *m_process << "-slave" ; + *m_process << "-idle"; + *m_process << "-dvd-device" << m_device; + if (_numChapter !="") + *m_process << "-chapter" << _numChapter; + + *m_process << QString("dvd://%1").arg(_numTitle); + if (!m_process->start( KProcess::NotifyOnExit,KProcess::All)) { + KMessageBox::error (qApp->mainWidget(),i18n("Unable to run %1").arg("mplayer") , i18n("Preview")); + } + m_canwrite=TRUE; + + m_position=0; + slider->setValue(m_position); +} + + + + +/*$SPECIALIZATION$*/ + +void K9Mplayer::receivedStdout (KProcess *proc, char *buffer, int buflen) { + QString buf = QString::fromLatin1(buffer, buflen); + sscanf(buf.latin1(),"ANS_PERCENT_POSITION=%d",&m_position); + if (!m_seeking && m_position>0) { + slider->setValue(m_position); + } + int audio=0; + if (buf.contains("ANS_switch_audio")) + sscanf(buf.latin1(),"ANS_switch_audio=%d",&audio); + if (audio >0) { + for (int i=0;i < m_dvdTitle->getaudioStreamCount();i++) { + k9DVDAudioStream * str=m_dvdTitle->getaudioStream(i); + if (str->getStreamId() == audio) { + cbAudio->setCurrentItem(i); + } + } + } +} + +void K9Mplayer::slotLengthChanged() {} + +void K9Mplayer::slotNewPosition(int _pos,const QTime & _time) { + slider->setValue(_pos); + +} + +void K9Mplayer::sliderReleased() { + sendCmd( QString("seek %1 1").arg((int)slider->value())); + m_seeking=FALSE; +} + +void K9Mplayer::sliderChanged( int _value) {} + +void K9Mplayer::sliderPressed() { + m_seeking=TRUE; + +} + +void K9Mplayer::bPlayClick() { + setTitle(QString::number( m_title),""); +} + +void K9Mplayer::bStopClick() { + sendCmd("quit"); +} + + +void K9Mplayer::bDownClick() { + sendCmd( QString("volume -1")); + +} + +void K9Mplayer::bSwitchAudioClick() { + sendCmd( QString("switch_audio")); + sendCmd( QString("get_property switch_audio")); +} + +void K9Mplayer::bUpClick() { + sendCmd( QString("volume +1")); + +} + + +void K9Mplayer::open( k9DVD *_dvd,k9DVDTitle *_title,int chapter) { + cbSub->clear(); + cbAudio->clear(); + for (int i=0; i< _title->getaudioStreamCount();i++) { + k9DVDAudioStream *aud=_title->getaudioStream(i); + cbAudio->insertItem(NULL,QString("%1-%2").arg(aud->getID()).arg(aud->getlanguage()),-1); + } + + for (int i=0; i< _title->getsubPictureCount();i++) { + k9DVDSubtitle *sub=_title->getsubtitle(i); + cbSub->insertItem(NULL,QString("%1-%2").arg(sub->getID().first()).arg(sub->getlanguage()),-1); + } + + if(_title->getaspectRatio()=="16:9") + m_ratio=16.0/9.0; + else + m_ratio=4.0/3.0; + resizeEvent( NULL); + + setDevice( _dvd->getDevice()); + m_dvdTitle=_title; + m_title=_title->getnumTitle(); + setTitle( QString::number(m_title),QString::number(chapter)); + if (_title->getaudioStreamCount() >0) + cbAudioActivated( 0); + if (_title->getsubPictureCount() >0) + cbSubActivated( 0); + if (!m_timer->isActive()) + m_timer->start(200,FALSE); + +} + +void K9Mplayer::titleChanged() {} + +void K9Mplayer::cbAudioActivated( int _value) { + if (m_dvdTitle) { + int value=m_dvdTitle->getaudioStream( _value)->getStreamId(); + sendCmd(QString( "switch_audio %1").arg(value)); + } +} + +void K9Mplayer::cbSubActivated( int _value) { + sendCmd(QString("sub_select %1").arg(_value)); + +} + + +void K9Mplayer::sendCmd( QString _cmd) { + while (!m_canwrite) { + qApp->processEvents(); + if ( !m_process->isRunning()) + return; + } + + _cmd +="\n"; + m_canwrite=FALSE; + m_process->writeStdin( _cmd.latin1() ,_cmd.length()); + +} + +#include "k9mplayer.moc" + diff --git a/k9Mplayer/k9mplayer.h b/k9Mplayer/k9mplayer.h new file mode 100644 index 0000000..c4723e8 --- /dev/null +++ b/k9Mplayer/k9mplayer.h @@ -0,0 +1,66 @@ + +#ifndef K9Mplayer_H +#define K9Mplayer_H + +#include "k9common.h" +#include "../k9Mplayer/mplayer.h" + + +class k9DVD; +class k9DVDTitle; +class KProcess; +class QTimer; +class QResizeEvent; + +class K9Mplayer : public MPlayer +{ + Q_OBJECT +private: + KProcess *m_process; + bool m_seeking,m_initVol; + int m_title; + k9DVDTitle *m_dvdTitle; + QString m_device; + QTimer *m_timer; + void sendCmd(QString _cmd); + int m_position; + bool m_canwrite; + QWidget *m_container; + float m_ratio; +public: + //K9Mplayer(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + K9Mplayer(QObject *parent=0,const char *name=0,const QStringList args=0); + ~K9Mplayer(); + /*$PUBLIC_FUNCTIONS$*/ + void setDevice(const QString & _device); + void setTitle(const QString & _numTitle,const QString &_numChapter); +private slots: + void slotLengthChanged(); + void slotNewPosition(int _pos,const QTime & _time); + void receivedStdout (KProcess *proc, char *buffer, int buflen); + void wroteStdin(KProcess *_process); + void timeout(); +public slots: + /*$PUBLIC_SLOTS$*/ + virtual void sliderReleased(); + virtual void bPlayClick(); + virtual void bStopClick(); + virtual void sliderPressed(); + virtual void sliderChanged(int _value); + virtual void open(k9DVD *_dvd,k9DVDTitle *_title,int chapter); + virtual void titleChanged(); + virtual void cbAudioActivated (int _value); + virtual void cbSubActivated (int _value); + virtual void bUpClick(); + virtual void bDownClick(); + virtual void bSwitchAudioClick(); +protected: + /*$PROTECTED_FUNCTIONS$*/ + void resizeEvent ( QResizeEvent * _resiseEvent); +protected slots: + /*$PROTECTED_SLOTS$*/ + +}; + +#endif + diff --git a/k9Mplayer/mplayer.cpp b/k9Mplayer/mplayer.cpp new file mode 100644 index 0000000..fcde29b --- /dev/null +++ b/k9Mplayer/mplayer.cpp @@ -0,0 +1,663 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './mplayer.ui' +** +** Created: dim. oct. 26 08:55:16 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "mplayer.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "kicondialog.h" +#include "kpushbutton.h" +static const unsigned char img0_mplayer[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x27, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x9f, 0x74, 0x11, 0xc1, 0x00, 0x00, 0x05, + 0x28, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, 0xed, 0x59, 0x7d, 0x6c, 0x53, + 0x55, 0x14, 0xff, 0xdd, 0xb7, 0x96, 0xc2, 0xf8, 0x18, 0x44, 0xe6, 0x24, + 0x23, 0xac, 0x54, 0x37, 0x4d, 0x8b, 0x5a, 0xa6, 0x83, 0x65, 0x23, 0x92, + 0xf8, 0x0f, 0x11, 0x03, 0xc9, 0x02, 0xcd, 0x08, 0x09, 0x9b, 0x6e, 0x2c, + 0xa2, 0xb8, 0xfd, 0x83, 0xe0, 0x18, 0x6e, 0x44, 0xd4, 0x2c, 0x59, 0x20, + 0x28, 0x06, 0xe5, 0x63, 0x84, 0x00, 0xe2, 0xf6, 0xc7, 0x16, 0x97, 0x99, + 0x2c, 0x24, 0x10, 0x15, 0x71, 0x8f, 0xca, 0xe6, 0x36, 0x89, 0x20, 0x5f, + 0x5b, 0x67, 0x07, 0x03, 0x44, 0x2c, 0xa2, 0x6c, 0x6b, 0x37, 0xee, 0xf1, + 0x8f, 0xf2, 0xae, 0x7d, 0x7d, 0xaf, 0xeb, 0x74, 0xfd, 0xd0, 0xc4, 0x5f, + 0xd2, 0xe4, 0xde, 0x7b, 0xce, 0x3b, 0xfd, 0x9d, 0x93, 0x73, 0xce, 0xbd, + 0xef, 0x3e, 0x26, 0xcb, 0x32, 0xfe, 0x6d, 0xa8, 0xdb, 0x7f, 0x91, 0xa4, + 0x04, 0x86, 0xfc, 0xa2, 0x0c, 0x36, 0x9a, 0x9e, 0x21, 0x56, 0x84, 0x82, + 0xd1, 0xd2, 0xe0, 0xa6, 0x93, 0xc7, 0x7f, 0xc4, 0xc8, 0xc8, 0xfd, 0x90, + 0x3a, 0x67, 0x5a, 0xaf, 0x10, 0x63, 0x0c, 0xdb, 0x6b, 0x5f, 0xd0, 0x75, + 0x82, 0x45, 0x33, 0xf2, 0x1d, 0xad, 0x77, 0xa9, 0xb1, 0xee, 0x0c, 0x06, + 0xef, 0x79, 0xc1, 0xa4, 0x51, 0x83, 0x18, 0x16, 0x3b, 0x0e, 0x2c, 0xd5, + 0x18, 0x18, 0x37, 0xf9, 0x96, 0x06, 0x37, 0x9d, 0xed, 0x70, 0xe3, 0x46, + 0xff, 0x1d, 0x24, 0x24, 0x48, 0xe3, 0xb2, 0x15, 0x0e, 0xc1, 0x0e, 0x8c, + 0x29, 0x6d, 0x5a, 0x1a, 0xdc, 0xd4, 0x7d, 0xe9, 0x26, 0x2e, 0x5f, 0xb8, + 0x01, 0xa3, 0x31, 0x41, 0x57, 0x27, 0xda, 0xc4, 0xf5, 0xa0, 0x22, 0x3f, + 0xc3, 0x96, 0x45, 0xb9, 0x5f, 0xde, 0xc6, 0x2f, 0xcb, 0x1f, 0x56, 0x29, + 0x65, 0x67, 0x67, 0xc7, 0x94, 0x54, 0x20, 0x18, 0x63, 0x70, 0x2c, 0xd9, + 0x89, 0x6b, 0x7d, 0xbf, 0x6a, 0x65, 0xb2, 0x2c, 0xc3, 0x95, 0x6a, 0xa7, + 0x92, 0xf6, 0xdf, 0xf0, 0x5c, 0xf2, 0x04, 0xb4, 0x2c, 0x9a, 0x11, 0x07, + 0x8a, 0xe1, 0xc1, 0x18, 0xc3, 0xe9, 0xd3, 0xa7, 0x55, 0x69, 0xc3, 0x9a, + 0xae, 0x0d, 0xd2, 0x6a, 0xe7, 0x1d, 0x00, 0xc0, 0x1f, 0x79, 0x29, 0x71, + 0x21, 0x36, 0x56, 0x04, 0x3b, 0x20, 0x29, 0xc4, 0x3f, 0x9c, 0x3f, 0x2d, + 0x6e, 0xa4, 0xc6, 0x0a, 0x22, 0x52, 0xcd, 0x45, 0x95, 0xad, 0x49, 0x9b, + 0x14, 0x73, 0x32, 0xe3, 0x85, 0x20, 0x6f, 0x1c, 0x67, 0x1f, 0x8e, 0x07, + 0x62, 0xdf, 0xdf, 0x22, 0x88, 0xff, 0xc9, 0xc7, 0x12, 0x5b, 0x87, 0x1f, + 0x17, 0x55, 0xfb, 0x9f, 0x23, 0xff, 0xc5, 0xcf, 0x3e, 0x31, 0x36, 0x10, + 0x00, 0xbd, 0x52, 0x65, 0xcc, 0xbf, 0xaa, 0xb4, 0xa7, 0xc0, 0xb9, 0x32, + 0x56, 0xa0, 0xa7, 0x13, 0x2d, 0x4c, 0x0c, 0x38, 0x9d, 0x18, 0xa6, 0x19, + 0x24, 0xfc, 0x3e, 0xc2, 0x35, 0x4a, 0x39, 0xd6, 0x4a, 0x00, 0x80, 0x7c, + 0xfe, 0x1d, 0x10, 0x91, 0x98, 0xb7, 0x9e, 0xdb, 0x86, 0xa1, 0xa1, 0x61, + 0x3c, 0x9f, 0xb9, 0x4d, 0xe8, 0xee, 0x3e, 0x54, 0x0c, 0xfb, 0xb3, 0x69, + 0x00, 0xfc, 0x0e, 0x70, 0xae, 0xb5, 0x17, 0x29, 0x04, 0xc6, 0x45, 0xaa, + 0xb2, 0x4e, 0x1e, 0x55, 0xb9, 0xb4, 0xe8, 0xa0, 0x26, 0xd2, 0x0a, 0x76, + 0x1f, 0x2a, 0x46, 0xeb, 0xb9, 0x6d, 0x58, 0x5f, 0x78, 0x00, 0x00, 0xe0, + 0xf5, 0x7a, 0x23, 0x46, 0x72, 0x2c, 0x90, 0xe6, 0xdf, 0x3a, 0x1b, 0xb2, + 0xc1, 0x3f, 0x9a, 0x91, 0x82, 0xef, 0x9c, 0x3d, 0xc8, 0x7e, 0xe2, 0x2d, + 0xf8, 0x7c, 0x23, 0x00, 0x10, 0xd2, 0x11, 0x00, 0xb0, 0x58, 0x2c, 0x62, + 0x6c, 0x30, 0x18, 0x60, 0xb7, 0xdb, 0xe1, 0x76, 0xbb, 0x21, 0x49, 0xfe, + 0xd2, 0x6a, 0x6b, 0x6b, 0x13, 0x63, 0x49, 0x92, 0x34, 0x63, 0x49, 0x92, + 0xe0, 0xf5, 0x7a, 0x61, 0xb1, 0x58, 0x60, 0xb1, 0x58, 0x54, 0x3a, 0xba, + 0xe4, 0xf5, 0x16, 0x15, 0x82, 0x47, 0x9a, 0x5e, 0x7f, 0x60, 0x9c, 0xa1, + 0xfd, 0x4a, 0x35, 0x00, 0xa0, 0xb3, 0xad, 0x57, 0xe8, 0xbd, 0x56, 0x50, + 0x8b, 0x85, 0x19, 0x5b, 0xb0, 0xfb, 0x50, 0x31, 0x00, 0xa0, 0xbf, 0xbf, + 0x1f, 0xbb, 0x76, 0xed, 0x12, 0xa9, 0xd3, 0xd5, 0xd5, 0x85, 0xb2, 0xb2, + 0x32, 0xa1, 0x9f, 0x92, 0xa2, 0x3e, 0x3b, 0xf9, 0x7c, 0x3e, 0x78, 0x3c, + 0x1e, 0x00, 0x7f, 0xd5, 0x89, 0xc9, 0x64, 0x82, 0xcb, 0xe5, 0x42, 0x6f, + 0x6f, 0x2f, 0x38, 0xe7, 0xa8, 0xad, 0xad, 0xd5, 0xf0, 0xab, 0x9f, 0x68, + 0xa3, 0x90, 0xe4, 0xdd, 0x3f, 0xdd, 0x16, 0x06, 0x89, 0x93, 0xca, 0x78, + 0x75, 0x55, 0x93, 0xd0, 0xfb, 0xe8, 0xf0, 0x5a, 0x7c, 0x7b, 0xe9, 0x3d, + 0x91, 0xef, 0x00, 0x50, 0x5a, 0x5a, 0x8a, 0xab, 0x57, 0xaf, 0x8a, 0x79, + 0x73, 0x73, 0x33, 0xf2, 0xf2, 0xf2, 0xc4, 0x3c, 0x30, 0x92, 0x46, 0xa3, + 0x11, 0x9b, 0x37, 0x6f, 0x06, 0x00, 0x14, 0x16, 0x16, 0x8a, 0x5a, 0x59, + 0xb7, 0x6e, 0x9d, 0xd0, 0x29, 0x2a, 0x2a, 0xd2, 0xf0, 0x3b, 0xd8, 0x3b, + 0xe8, 0x1f, 0xc8, 0xb2, 0x8c, 0xc4, 0xc6, 0xeb, 0x44, 0x44, 0xc4, 0x39, + 0x27, 0xce, 0x39, 0xcd, 0x4b, 0xdd, 0x40, 0x59, 0xe9, 0x15, 0xc4, 0x39, + 0x27, 0x22, 0xa2, 0x93, 0x27, 0xce, 0x13, 0xe7, 0x9c, 0xb2, 0xd2, 0x2b, + 0x28, 0x73, 0xee, 0x9b, 0x34, 0x38, 0xe0, 0xa3, 0xac, 0xf4, 0x0a, 0xea, + 0x38, 0xe3, 0x12, 0xcf, 0x70, 0xce, 0x09, 0x80, 0x6a, 0x0c, 0x80, 0x3a, + 0x3b, 0x3b, 0xc9, 0xef, 0x3b, 0x91, 0xc3, 0xe1, 0x20, 0x87, 0xc3, 0x21, + 0x64, 0xc1, 0xba, 0x05, 0x05, 0x05, 0x62, 0x6e, 0x36, 0x9b, 0x55, 0xb6, + 0x95, 0x5f, 0x62, 0xe3, 0x75, 0x4a, 0x6c, 0xbc, 0x4e, 0xb2, 0x2c, 0xfb, + 0xcf, 0xf3, 0x8b, 0xfb, 0xe7, 0x92, 0x6f, 0xc5, 0x23, 0x51, 0x6d, 0x71, + 0x80, 0x3f, 0xea, 0x4a, 0xab, 0xed, 0xe9, 0xe9, 0x81, 0xd9, 0x6c, 0xfe, + 0xdb, 0x36, 0xa6, 0x7c, 0x76, 0x13, 0x00, 0x70, 0x62, 0x96, 0x8b, 0x19, + 0x00, 0xe0, 0xa9, 0xa4, 0xd8, 0x5c, 0x22, 0x28, 0xc4, 0x23, 0xd5, 0x4a, + 0x25, 0x00, 0xf8, 0x64, 0xc1, 0xf4, 0x88, 0x18, 0x0b, 0x07, 0x22, 0x8a, + 0xe8, 0x1e, 0x20, 0x01, 0x80, 0xe7, 0x5c, 0x1b, 0x8b, 0x76, 0xca, 0x44, + 0x1a, 0x17, 0x67, 0xd9, 0x29, 0x6e, 0x97, 0x4e, 0xc1, 0x60, 0x8c, 0xa1, + 0x64, 0xd5, 0x3e, 0x5c, 0x38, 0x7f, 0x0d, 0x73, 0xcc, 0x33, 0x71, 0xb4, + 0xb9, 0x74, 0xd4, 0x1a, 0x7c, 0xe3, 0xfb, 0xbb, 0xf1, 0xbb, 0x31, 0x53, + 0xc0, 0x18, 0x43, 0xae, 0xad, 0x4a, 0xd4, 0x83, 0x77, 0x68, 0x18, 0xbd, + 0xdd, 0xb7, 0x34, 0xc7, 0x93, 0x60, 0xd4, 0x65, 0x4f, 0x8f, 0x2f, 0x79, + 0xc6, 0x18, 0x72, 0xac, 0x95, 0xf0, 0x0e, 0x0d, 0xa3, 0xbd, 0xbb, 0x5a, + 0x23, 0x5f, 0xbe, 0xb8, 0x06, 0x39, 0xd6, 0x4a, 0xec, 0xaf, 0x7f, 0x05, + 0xd6, 0x27, 0x53, 0x55, 0xb2, 0x29, 0x3d, 0x1d, 0x4c, 0xec, 0x18, 0x4e, + 0xa7, 0x33, 0xe6, 0xef, 0x81, 0x39, 0xd6, 0x4a, 0x18, 0x8d, 0x09, 0x68, + 0xef, 0xae, 0xc6, 0xec, 0xd9, 0xb3, 0x51, 0x53, 0x53, 0xa3, 0x92, 0x37, + 0x9f, 0xdc, 0x84, 0xd5, 0x2f, 0xe5, 0xa2, 0x64, 0xd5, 0x5e, 0x30, 0xc6, + 0xc4, 0xce, 0x6f, 0x7b, 0xd0, 0x1d, 0xe3, 0x76, 0x9e, 0xdf, 0xfb, 0xfe, + 0x09, 0x00, 0xc0, 0x57, 0x5d, 0x5b, 0xc5, 0x5a, 0x79, 0x79, 0x39, 0x24, + 0x49, 0x42, 0x5f, 0x5f, 0x9f, 0x58, 0x5b, 0xbf, 0x71, 0x09, 0x00, 0xe0, + 0xe9, 0x39, 0x9b, 0x60, 0x68, 0xb8, 0x01, 0xfb, 0x74, 0x23, 0x3e, 0x48, + 0xbc, 0xcc, 0x80, 0x20, 0xf2, 0x0b, 0x32, 0xb6, 0x44, 0x9f, 0xf5, 0x03, + 0x1c, 0xde, 0xff, 0x35, 0x4c, 0x26, 0xfd, 0xac, 0x4d, 0x4b, 0x4b, 0x83, + 0x24, 0x49, 0xa2, 0xad, 0x1e, 0xfd, 0xbc, 0x0c, 0x93, 0xa7, 0x98, 0x70, + 0x2a, 0xd5, 0xc5, 0xb6, 0x4f, 0xba, 0x24, 0x32, 0x44, 0xf5, 0xb4, 0xd1, + 0x98, 0x80, 0x5c, 0x5b, 0x15, 0x8c, 0x13, 0x0c, 0xd8, 0xf7, 0xe9, 0x5a, + 0x3c, 0x94, 0x1c, 0xfa, 0x2e, 0x67, 0x66, 0xf2, 0xd4, 0x71, 0x3b, 0x70, + 0xcc, 0x59, 0x31, 0xaa, 0xdc, 0x60, 0xf0, 0xd3, 0x0b, 0xd5, 0x75, 0x54, + 0xe4, 0x07, 0xee, 0x79, 0x91, 0x38, 0xd9, 0x84, 0x61, 0xdf, 0x08, 0x5e, + 0x5e, 0xb9, 0x67, 0xdc, 0xe4, 0x02, 0x71, 0xff, 0x3e, 0xc7, 0x33, 0x0b, + 0x2d, 0x58, 0xf3, 0xaa, 0x55, 0x89, 0x1c, 0x49, 0xa3, 0x1c, 0xaf, 0x01, + 0xc0, 0xe3, 0xf1, 0x20, 0x29, 0x29, 0x29, 0xa4, 0x5c, 0x45, 0xfe, 0xe3, + 0xfa, 0x3c, 0xb6, 0xa1, 0xb8, 0xe5, 0x1f, 0xef, 0x56, 0xc4, 0x09, 0x53, + 0x93, 0x26, 0x61, 0xe1, 0xa2, 0xc7, 0xb0, 0x74, 0xe5, 0x9c, 0xb0, 0x0d, + 0x60, 0xd1, 0xbc, 0xad, 0x70, 0x5e, 0x7c, 0x57, 0xb3, 0x9e, 0x9f, 0x9f, + 0x8f, 0xba, 0xba, 0x3a, 0x31, 0xdf, 0xb3, 0xf3, 0xb8, 0xee, 0xf3, 0x9a, + 0xa4, 0xdb, 0x71, 0x60, 0x69, 0x58, 0x07, 0x06, 0x06, 0x7c, 0x58, 0xb6, + 0x22, 0x73, 0x4c, 0x04, 0x43, 0x21, 0xd4, 0xff, 0xe8, 0x1d, 0x1f, 0x8e, + 0xd4, 0x9e, 0x42, 0x9a, 0x25, 0x59, 0xb3, 0x1e, 0xd5, 0x2f, 0x23, 0xe1, + 0xb0, 0xa1, 0xb8, 0x85, 0x18, 0x63, 0xf8, 0xe6, 0x87, 0xb7, 0xc1, 0x18, + 0xd3, 0xcd, 0xed, 0x5c, 0x5b, 0x15, 0x00, 0xfd, 0x2f, 0x23, 0x71, 0xbd, + 0xfa, 0x50, 0x08, 0xe5, 0xda, 0xaa, 0xe0, 0xf3, 0x8e, 0xa8, 0x64, 0xca, + 0xce, 0x1b, 0xa8, 0x17, 0x8c, 0xb8, 0x46, 0x5e, 0xc1, 0xc6, 0x92, 0x63, + 0xa4, 0x97, 0x2e, 0x9c, 0x13, 0x76, 0x1e, 0x7c, 0x31, 0x64, 0x6a, 0xfe, + 0x09, 0xba, 0x8d, 0x3c, 0xd6, 0xd8, 0xe3, 0x9a, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +static const unsigned char img1_mplayer[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x16, + 0x08, 0x06, 0x00, 0x00, 0x00, 0xc4, 0xb4, 0x6c, 0x3b, 0x00, 0x00, 0x03, + 0xf8, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x95, 0x95, 0xdd, 0x6f, 0x14, + 0x55, 0x18, 0xc6, 0x7f, 0xe7, 0xcc, 0xc7, 0xee, 0x6c, 0x77, 0x96, 0x2d, + 0x2d, 0x1f, 0x8b, 0xba, 0x14, 0xd1, 0x34, 0x06, 0x21, 0xb8, 0x2b, 0x26, + 0xdc, 0x10, 0x63, 0xa2, 0x06, 0x89, 0x5e, 0x60, 0x42, 0x14, 0x13, 0xbd, + 0x2a, 0x81, 0x3b, 0x13, 0x2f, 0xbc, 0xf2, 0x4a, 0x13, 0xfe, 0x02, 0xc3, + 0xc5, 0x24, 0xc4, 0x3b, 0x2e, 0xc4, 0x44, 0x63, 0x22, 0x44, 0x88, 0x89, + 0x51, 0xc4, 0x8f, 0xb2, 0x4d, 0x45, 0x94, 0x10, 0xa8, 0x7c, 0xa5, 0x6c, + 0xb7, 0xdd, 0xed, 0x7e, 0xb0, 0x3b, 0x3b, 0xb3, 0x33, 0xe7, 0x78, 0xb1, + 0xb4, 0xb6, 0x48, 0xb1, 0x3c, 0xc9, 0x93, 0xc9, 0x99, 0x39, 0xf3, 0x7b, + 0x9f, 0xbc, 0x6f, 0xce, 0x8c, 0xe0, 0x21, 0x2a, 0x1c, 0x99, 0xb4, 0x40, + 0xaf, 0x03, 0x95, 0x43, 0xeb, 0x14, 0x68, 0x40, 0xfb, 0x68, 0x55, 0xb6, + 0x54, 0xb3, 0xf2, 0x8b, 0xf7, 0x72, 0xb8, 0xd2, 0xbb, 0xe2, 0x21, 0xd0, + 0xdd, 0xc0, 0x01, 0xd0, 0x3b, 0x11, 0xe4, 0x11, 0xd6, 0x00, 0x00, 0x2a, + 0xe8, 0xa0, 0xe3, 0x5b, 0xc0, 0xa4, 0x50, 0xd1, 0xc9, 0x82, 0x3e, 0x7e, + 0xce, 0xf3, 0xbc, 0xf8, 0x7f, 0xc1, 0x85, 0x23, 0x93, 0x5b, 0x41, 0xbc, + 0x8f, 0x61, 0x1d, 0x4c, 0x0f, 0xa4, 0xb2, 0x1b, 0x87, 0x33, 0x72, 0xc3, + 0x50, 0x92, 0xd1, 0xe1, 0x16, 0x8e, 0x15, 0x73, 0xad, 0x96, 0xe6, 0x7a, + 0x45, 0x31, 0x37, 0x3b, 0xab, 0x6a, 0x0d, 0xdf, 0x57, 0x91, 0x7f, 0xce, + 0xd2, 0x77, 0x3f, 0xd9, 0xa1, 0x4f, 0x9c, 0xf7, 0x3c, 0x2f, 0x7a, 0x20, + 0xb8, 0x70, 0x64, 0x72, 0x33, 0x88, 0x63, 0xd8, 0x99, 0xbd, 0x3b, 0x9f, + 0x74, 0x78, 0x6d, 0x97, 0xcb, 0xf6, 0x27, 0x34, 0xeb, 0xb3, 0x16, 0x86, + 0xec, 0x6f, 0xd5, 0xc0, 0x7c, 0x2b, 0x62, 0xaa, 0xdc, 0xe3, 0x54, 0xa9, + 0xcb, 0x0f, 0x17, 0xe7, 0x09, 0xfd, 0xe6, 0x5f, 0x09, 0x55, 0xfb, 0xf0, + 0x59, 0x7d, 0xf2, 0xd4, 0x02, 0xdc, 0xb8, 0x2f, 0xe9, 0xa7, 0xe9, 0x4c, + 0xe6, 0xd5, 0x37, 0x76, 0xaf, 0x11, 0xef, 0xbe, 0xe8, 0xf0, 0x74, 0xce, + 0x20, 0x61, 0x19, 0xf4, 0x62, 0x08, 0x23, 0xbd, 0x68, 0x43, 0x0a, 0x86, + 0x33, 0x26, 0xdb, 0x37, 0x5b, 0x6c, 0x18, 0xb4, 0xf8, 0xbb, 0xa2, 0x87, + 0x9b, 0x5d, 0xf1, 0x7c, 0x55, 0x6f, 0x29, 0xed, 0x2d, 0x3a, 0xb7, 0x4b, + 0xa5, 0x92, 0x5e, 0x04, 0xe7, 0x76, 0x1d, 0x3e, 0x8a, 0xed, 0xbe, 0xb5, + 0xef, 0x85, 0xac, 0x78, 0xbd, 0x68, 0x61, 0x5b, 0x92, 0x30, 0xd2, 0x04, + 0xbd, 0xfb, 0x1c, 0x2a, 0x82, 0x9e, 0x22, 0x88, 0x34, 0x5a, 0x6b, 0x36, + 0xad, 0xb5, 0x70, 0x53, 0x96, 0xf8, 0xf3, 0x76, 0x3c, 0xd4, 0x0d, 0xb5, + 0xb5, 0x89, 0x89, 0x33, 0xc5, 0x62, 0xb1, 0x27, 0xfa, 0x69, 0x2f, 0xec, + 0x16, 0x46, 0xf2, 0x9b, 0x1d, 0x4f, 0xad, 0xcd, 0x1e, 0xdc, 0xe3, 0xe0, + 0x3a, 0x92, 0x6f, 0x27, 0xfc, 0x95, 0xe6, 0xba, 0x4c, 0xaf, 0x3c, 0xe7, + 0xd0, 0x8b, 0x34, 0x5f, 0xfd, 0xea, 0xf3, 0xfd, 0x44, 0xa5, 0x61, 0x04, + 0xd3, 0xef, 0x6d, 0xe7, 0x8b, 0xd3, 0x66, 0xe1, 0xf0, 0xb8, 0x85, 0xd6, + 0x07, 0xd2, 0x03, 0xc9, 0x4c, 0x61, 0xab, 0x4d, 0xac, 0x14, 0x8d, 0xb6, + 0x06, 0xe0, 0xa3, 0xb7, 0xd7, 0x3f, 0x14, 0xfa, 0xf1, 0x89, 0x0a, 0x9d, + 0x40, 0xd1, 0x0d, 0x15, 0xa3, 0xb9, 0x98, 0xdf, 0xaf, 0x25, 0xdc, 0x5a, + 0x35, 0xbd, 0xbf, 0xd2, 0x1b, 0xf9, 0xd9, 0x04, 0xd6, 0x01, 0x3b, 0x33, + 0x99, 0x35, 0x32, 0x9b, 0x8c, 0x68, 0xb6, 0xe5, 0xaa, 0x92, 0x2e, 0xe8, + 0xb3, 0x1f, 0x13, 0x00, 0x34, 0xfd, 0x14, 0x2d, 0xd2, 0x52, 0x51, 0xdf, + 0xd6, 0x14, 0xf9, 0xbc, 0x09, 0xe4, 0x10, 0x32, 0x3f, 0xec, 0x0a, 0xfc, + 0x50, 0xe1, 0x87, 0x8a, 0x7e, 0xde, 0xd5, 0x15, 0x10, 0x2a, 0xe4, 0x6a, + 0x2d, 0xd3, 0x5f, 0x98, 0x26, 0x08, 0x23, 0x87, 0x61, 0xe7, 0x4d, 0x20, + 0x85, 0x4c, 0x0c, 0xa4, 0xac, 0x1e, 0xf5, 0xb6, 0x42, 0x0a, 0xb0, 0xcd, + 0x15, 0xcf, 0xcd, 0x32, 0x5d, 0x9b, 0x4b, 0x2e, 0x2f, 0x22, 0x04, 0xc8, + 0x84, 0x23, 0x14, 0xae, 0xb9, 0x70, 0xb3, 0xd9, 0xb5, 0x98, 0x69, 0x68, + 0x0c, 0x09, 0xae, 0xb3, 0x3a, 0x30, 0xc0, 0xd5, 0x5a, 0x06, 0xb1, 0xb0, + 0x5d, 0xdf, 0x2b, 0x80, 0x92, 0x26, 0x68, 0x1f, 0x15, 0x74, 0x66, 0xda, + 0x0e, 0xed, 0x38, 0xb9, 0xf8, 0x50, 0xaf, 0x7c, 0xda, 0x1f, 0xa8, 0x3e, + 0x5c, 0x43, 0xdc, 0xed, 0x0a, 0x1d, 0x05, 0x26, 0x5a, 0x95, 0x81, 0x5b, + 0x8d, 0x8e, 0xda, 0x12, 0x0b, 0xe7, 0x91, 0x60, 0x0b, 0x32, 0x8d, 0xfe, + 0x44, 0xee, 0xfa, 0x01, 0xe8, 0xb8, 0x22, 0x55, 0xbb, 0x2c, 0x2d, 0xd5, + 0xac, 0x00, 0x93, 0x04, 0x35, 0x65, 0x19, 0x1a, 0x7b, 0x89, 0x57, 0xab, + 0xa4, 0x19, 0x63, 0x9b, 0x31, 0x22, 0xac, 0x2a, 0x93, 0xee, 0x95, 0xac, + 0xbe, 0x71, 0x47, 0x00, 0x14, 0x0f, 0x9d, 0xdf, 0x23, 0xec, 0xf4, 0x97, + 0xb9, 0xdc, 0xc6, 0xc1, 0x41, 0xd7, 0x7e, 0xa4, 0x26, 0x18, 0x12, 0x22, + 0x05, 0xf3, 0xad, 0x90, 0xf2, 0xf4, 0x74, 0xcb, 0xe9, 0x5e, 0xfe, 0x60, + 0x54, 0x9e, 0xfd, 0xda, 0x04, 0x28, 0xe8, 0xe3, 0xe7, 0x2e, 0x44, 0x63, + 0x9f, 0xb7, 0xea, 0xb3, 0x87, 0x46, 0x86, 0x06, 0x49, 0x98, 0xa2, 0xff, + 0x79, 0x5a, 0x08, 0x7d, 0xdf, 0x70, 0x34, 0x2c, 0x1b, 0x58, 0x10, 0x69, + 0x6e, 0xd6, 0xe7, 0x51, 0x61, 0xe3, 0xbb, 0x51, 0x79, 0xf6, 0x27, 0xa0, + 0x65, 0x00, 0x94, 0x4a, 0x25, 0xfd, 0x78, 0xe1, 0x9d, 0xa9, 0xa0, 0xc7, + 0x33, 0x4a, 0xc5, 0x9b, 0x1f, 0x1b, 0x32, 0x44, 0x2a, 0x21, 0x48, 0x58, + 0xba, 0x6f, 0x73, 0xf9, 0x35, 0x69, 0xff, 0xbb, 0x16, 0xf4, 0xb8, 0x72, + 0xb3, 0xa9, 0xaa, 0xb5, 0xc6, 0xf8, 0x50, 0x7c, 0xe9, 0x58, 0x56, 0x4c, + 0x5f, 0x5a, 0x04, 0x03, 0xec, 0x2b, 0x58, 0xd5, 0xaa, 0xce, 0x8f, 0x37, + 0x7c, 0x73, 0x5b, 0xb3, 0x13, 0x8d, 0xb8, 0x29, 0x8b, 0xb5, 0xae, 0x89, + 0x6d, 0x49, 0x6c, 0x53, 0xfc, 0xc7, 0x96, 0x01, 0x73, 0x8d, 0x1e, 0x17, + 0xa7, 0x1a, 0x94, 0x67, 0x9b, 0xe3, 0xeb, 0xa2, 0x89, 0xa3, 0x79, 0x59, + 0xfa, 0x0d, 0x98, 0xf3, 0x3c, 0x2f, 0x5e, 0x04, 0x97, 0x4a, 0x25, 0xbd, + 0xb7, 0x98, 0xaa, 0x55, 0xf5, 0xc8, 0x44, 0xc3, 0x37, 0x52, 0xb3, 0x8d, + 0xde, 0x48, 0xab, 0x13, 0xd9, 0x49, 0x33, 0x12, 0x03, 0x8e, 0x89, 0x29, + 0x25, 0x52, 0x80, 0xd6, 0x31, 0xd5, 0xf9, 0x36, 0x7f, 0x5c, 0xef, 0xa8, + 0xcb, 0x37, 0x5b, 0x77, 0xeb, 0xf5, 0xe6, 0xe9, 0xa1, 0xf8, 0xd2, 0xb1, + 0x7b, 0xd0, 0x8a, 0xe7, 0x79, 0xbd, 0xa5, 0xdd, 0x5b, 0xd4, 0xd8, 0xd8, + 0x98, 0x04, 0x06, 0x2e, 0xf2, 0xe6, 0x4b, 0x91, 0x4c, 0xef, 0x57, 0x58, + 0xdb, 0xa4, 0x14, 0x39, 0xd7, 0x31, 0x1c, 0x80, 0x96, 0x1f, 0x77, 0x55, + 0xac, 0x2a, 0x26, 0xdd, 0x2b, 0xc9, 0x78, 0xe6, 0xcc, 0xbd, 0x9e, 0xce, + 0x00, 0xf5, 0x15, 0xff, 0x20, 0x4b, 0xe0, 0x02, 0xb0, 0x2b, 0xf1, 0x48, + 0xb6, 0x29, 0xf2, 0x79, 0x0c, 0x3b, 0x2f, 0xc0, 0x15, 0x28, 0x29, 0x74, + 0x14, 0x48, 0xd5, 0x2e, 0x67, 0xf5, 0x8d, 0x3b, 0x6b, 0x8c, 0xb9, 0x1a, + 0xd0, 0x02, 0x7c, 0xcf, 0xf3, 0xd4, 0x52, 0xc6, 0x3f, 0x42, 0xb8, 0xe4, + 0xbf, 0xe2, 0x7a, 0x6d, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, + 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +static const unsigned char img2_mplayer[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x16, + 0x08, 0x06, 0x00, 0x00, 0x00, 0xc4, 0xb4, 0x6c, 0x3b, 0x00, 0x00, 0x04, + 0x7c, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x85, 0x95, 0xdb, 0x6f, 0x54, + 0x55, 0x14, 0x87, 0xbf, 0xbd, 0xcf, 0x65, 0x6e, 0x9d, 0xe9, 0x94, 0x16, + 0x4b, 0x11, 0x86, 0x02, 0x31, 0x84, 0x54, 0xa0, 0x4e, 0x45, 0x83, 0x89, + 0x97, 0x60, 0xd4, 0x54, 0xa2, 0x89, 0x68, 0x8c, 0xb7, 0xf8, 0x56, 0x02, + 0x0f, 0x24, 0xbc, 0x10, 0xff, 0x00, 0x25, 0xfd, 0x03, 0xd4, 0xf4, 0xe1, + 0x28, 0x0f, 0xbe, 0xf4, 0x41, 0x1e, 0x4d, 0x30, 0x62, 0x7c, 0x21, 0x48, + 0x08, 0x65, 0x48, 0xad, 0x88, 0x21, 0xb1, 0x40, 0xa9, 0xd2, 0xce, 0xb4, + 0xd3, 0x99, 0x33, 0xcc, 0xe5, 0xdc, 0xf6, 0xf6, 0x61, 0xda, 0x42, 0x4d, + 0x8b, 0x27, 0x59, 0x59, 0x67, 0x9f, 0xbd, 0xd7, 0x77, 0x7e, 0x6b, 0x65, + 0x65, 0x6d, 0xc1, 0x63, 0x9e, 0xfc, 0x89, 0x49, 0x0b, 0xf4, 0x66, 0x50, + 0x7d, 0x68, 0x9d, 0x04, 0x0d, 0xe8, 0x26, 0x5a, 0xcd, 0x59, 0xca, 0x2d, + 0x5e, 0x71, 0x5e, 0xf3, 0x37, 0x8a, 0x15, 0x8f, 0x81, 0x1e, 0x02, 0xde, + 0x07, 0x3d, 0x88, 0x20, 0x87, 0xb0, 0x52, 0x00, 0x28, 0xaf, 0x81, 0x8e, + 0xee, 0x01, 0x93, 0x42, 0x85, 0xe7, 0xf2, 0xfa, 0xec, 0x25, 0xc7, 0x71, + 0xa2, 0xff, 0x05, 0xe7, 0x4f, 0x4c, 0xee, 0x06, 0x71, 0x0a, 0xc3, 0xfa, + 0xa8, 0x23, 0x95, 0xcc, 0x6e, 0xe9, 0xc9, 0xc8, 0xde, 0xee, 0x38, 0x7b, + 0x7a, 0x6a, 0x24, 0xac, 0x88, 0xbf, 0xca, 0x1d, 0xdc, 0x29, 0x2a, 0x16, + 0x4a, 0x25, 0x55, 0xae, 0x36, 0x9b, 0x2a, 0x6c, 0x5e, 0xb2, 0xf4, 0x83, + 0x2f, 0xf6, 0xeb, 0xf1, 0xcb, 0x8e, 0xe3, 0x84, 0xeb, 0x82, 0xf3, 0x27, + 0x26, 0x77, 0x80, 0x18, 0xc3, 0xce, 0x0c, 0x0f, 0xee, 0x4a, 0xf0, 0xe6, + 0xc1, 0x34, 0xfb, 0xb6, 0x6b, 0x9e, 0xc8, 0x5a, 0x18, 0xb2, 0x7d, 0x54, + 0x03, 0x4b, 0xb5, 0x90, 0xe9, 0xb9, 0x80, 0xf3, 0x85, 0x16, 0x17, 0xa7, + 0x96, 0xf0, 0x9b, 0xee, 0xcd, 0x98, 0x2a, 0x7f, 0xf6, 0xb4, 0x3e, 0x77, + 0x7e, 0x05, 0x6e, 0xfc, 0x47, 0xe9, 0xd7, 0x1d, 0x99, 0xcc, 0x1b, 0x6f, + 0x1f, 0xea, 0x14, 0x9f, 0xbe, 0x92, 0xe0, 0xa9, 0x3e, 0x83, 0x98, 0x65, + 0xf0, 0xcd, 0x4f, 0x15, 0xf6, 0x6e, 0x8f, 0xe1, 0x87, 0x1a, 0x3f, 0xd4, + 0x18, 0x52, 0xd0, 0x93, 0x31, 0xd9, 0xb7, 0xc3, 0xa2, 0xb7, 0xcb, 0xe2, + 0x76, 0x51, 0xf7, 0xb8, 0x2d, 0xf1, 0xec, 0xa2, 0xde, 0x59, 0x18, 0x1e, + 0x4a, 0xcc, 0x16, 0x0a, 0x05, 0xbd, 0x0a, 0xee, 0x3b, 0x78, 0x7c, 0x14, + 0x3b, 0xfd, 0xc1, 0x91, 0xe7, 0xb2, 0xe2, 0xad, 0x21, 0x0b, 0xdb, 0x92, + 0xf8, 0xa1, 0xc6, 0x0b, 0x34, 0xef, 0xbc, 0x90, 0xe5, 0xab, 0x1f, 0x16, + 0xd9, 0xb5, 0xc5, 0xc2, 0xf3, 0x15, 0x5e, 0xa0, 0xf0, 0x42, 0x8d, 0xd6, + 0x9a, 0xad, 0x9b, 0x2c, 0xd2, 0x49, 0x4b, 0xfc, 0x31, 0x1b, 0x75, 0xb7, + 0x7c, 0x6d, 0x6d, 0xe5, 0xfa, 0x85, 0xa1, 0xa1, 0xa1, 0xc0, 0x68, 0xab, + 0xbd, 0x76, 0x48, 0x18, 0xb1, 0xd1, 0x03, 0xbb, 0x33, 0xf1, 0xe1, 0xbc, + 0x85, 0x94, 0xe0, 0x07, 0x8a, 0x56, 0xd0, 0x86, 0x6c, 0xeb, 0x89, 0xf1, + 0xe2, 0x40, 0x8a, 0x93, 0xdf, 0x69, 0x9e, 0xc9, 0x05, 0x78, 0x81, 0x5e, + 0xde, 0x6f, 0x67, 0xb0, 0xa9, 0x43, 0x52, 0xf7, 0x4d, 0x66, 0x4a, 0x41, + 0x7f, 0x29, 0xda, 0x3e, 0xd9, 0xcb, 0xcd, 0xdb, 0x46, 0xfe, 0xf8, 0x84, + 0x05, 0x9c, 0x4a, 0xa7, 0xd3, 0x2f, 0xbd, 0x3a, 0x98, 0x12, 0x5d, 0x1d, + 0xe0, 0x05, 0x9a, 0x56, 0xd0, 0x56, 0xeb, 0x05, 0x9a, 0xdd, 0x5b, 0xe3, + 0x00, 0xbc, 0xf7, 0xbc, 0xc1, 0xe9, 0x71, 0xc1, 0xde, 0x2d, 0xfe, 0x9a, + 0xfd, 0x56, 0xa0, 0xb0, 0x0d, 0x9f, 0xe9, 0x79, 0x65, 0xd7, 0x5b, 0x61, + 0x60, 0x84, 0xd5, 0x8b, 0x26, 0xb0, 0x19, 0x18, 0xcc, 0x64, 0x3a, 0x65, + 0x36, 0x1e, 0xe2, 0xd6, 0xe5, 0x46, 0x1d, 0x08, 0xc0, 0xf8, 0x49, 0x9b, + 0x0f, 0xbf, 0x84, 0xa3, 0x07, 0x5c, 0xa2, 0x48, 0x33, 0x5b, 0x8e, 0x98, + 0x9a, 0xcb, 0xe2, 0x36, 0x93, 0xd4, 0xe8, 0x90, 0x8a, 0xca, 0x80, 0x2b, + 0x72, 0x39, 0x13, 0xe8, 0x43, 0xc8, 0x5c, 0x4f, 0x5a, 0xd0, 0xf4, 0x15, + 0x4d, 0x5f, 0xa1, 0x97, 0xdb, 0x65, 0xc5, 0xaf, 0x0f, 0xcf, 0xb0, 0xbf, + 0xb7, 0xc2, 0xe4, 0xdf, 0x29, 0x66, 0xdd, 0x76, 0x46, 0x98, 0x26, 0x08, + 0xa3, 0x0f, 0xc3, 0xce, 0x49, 0x20, 0x89, 0x8c, 0xa5, 0x92, 0x56, 0x40, + 0xa5, 0xae, 0x70, 0x1b, 0x0a, 0xcf, 0xd7, 0xb4, 0x7c, 0xbd, 0xea, 0x37, + 0x52, 0xfe, 0xdb, 0x7c, 0x96, 0x52, 0x23, 0xb9, 0xfa, 0x4d, 0x08, 0x01, + 0x32, 0x96, 0x10, 0x90, 0x5e, 0xcd, 0xdb, 0x6d, 0x59, 0xcc, 0x57, 0x25, + 0x45, 0x57, 0x52, 0x6d, 0x4a, 0x2a, 0x4d, 0x83, 0x7b, 0x95, 0x18, 0x57, + 0x67, 0x52, 0x8f, 0x2d, 0x8b, 0x1f, 0x19, 0x08, 0x41, 0xdb, 0x56, 0x7e, + 0x80, 0x92, 0x26, 0xe8, 0x26, 0xca, 0x6b, 0xcc, 0xd7, 0x13, 0xd4, 0xa3, + 0x78, 0x3b, 0x7f, 0x40, 0x23, 0xa8, 0xf9, 0x36, 0x7a, 0x7d, 0xc1, 0x00, + 0xbc, 0x3e, 0xfa, 0xf0, 0x5d, 0x88, 0x76, 0x14, 0x51, 0xab, 0x25, 0x74, + 0xe8, 0x99, 0x68, 0x35, 0x07, 0xdc, 0xab, 0x36, 0xd4, 0xce, 0x48, 0x24, + 0xd6, 0x04, 0x6a, 0xe4, 0x86, 0xd3, 0xe4, 0xf0, 0x19, 0x08, 0x96, 0x27, + 0x84, 0x69, 0x80, 0x04, 0x1e, 0x34, 0x3d, 0xd0, 0x51, 0x51, 0xaa, 0xfa, + 0x9c, 0xb4, 0x94, 0x5b, 0x04, 0x26, 0xf1, 0xca, 0xca, 0x32, 0x34, 0xf6, + 0x23, 0x16, 0x33, 0x22, 0xd6, 0x93, 0x7c, 0xf8, 0x0c, 0x80, 0x22, 0x69, + 0x45, 0x24, 0xad, 0x88, 0xb8, 0x19, 0x61, 0x9b, 0x11, 0xc2, 0x5f, 0x54, + 0x26, 0xad, 0x5b, 0x59, 0x7d, 0xf7, 0xbe, 0x79, 0xc5, 0x79, 0xcd, 0x1f, + 0x3a, 0x76, 0xf9, 0x5c, 0xe4, 0x55, 0x3f, 0xb1, 0xa2, 0x44, 0x57, 0x57, + 0xda, 0x5e, 0x23, 0x52, 0x69, 0x80, 0xcc, 0xea, 0x7a, 0x64, 0xac, 0xc6, + 0xb6, 0x34, 0x08, 0xa1, 0x57, 0xcf, 0xb5, 0xe7, 0x87, 0x8f, 0x6a, 0x2d, + 0xd5, 0x13, 0xd1, 0xfc, 0x85, 0x4e, 0x63, 0xa1, 0x6c, 0x02, 0xe4, 0xf5, + 0xd9, 0x4b, 0xd7, 0xc2, 0x91, 0xef, 0x6b, 0x95, 0xd2, 0xb1, 0xfe, 0xee, + 0x2e, 0x62, 0xa6, 0x78, 0xd8, 0x6f, 0x3c, 0x04, 0x9f, 0xfe, 0x76, 0x9e, + 0xac, 0x0d, 0xda, 0x5e, 0xa9, 0x69, 0xfb, 0x8c, 0x17, 0x6a, 0x66, 0x2a, + 0x4b, 0x28, 0xbf, 0xfa, 0xcb, 0x1e, 0xf9, 0xf3, 0xaf, 0x40, 0xcd, 0x00, + 0x28, 0x14, 0x0a, 0x7a, 0x5b, 0xfe, 0xe3, 0x69, 0x2f, 0x60, 0xaf, 0x52, + 0xd1, 0x8e, 0x27, 0xbb, 0x0d, 0x91, 0x8c, 0x09, 0x62, 0x96, 0x26, 0x66, + 0x69, 0x5e, 0xde, 0x97, 0xe6, 0xf3, 0xf1, 0xfb, 0xc4, 0xcc, 0xf6, 0x3a, + 0x6e, 0xb7, 0x7d, 0xcc, 0xd4, 0x08, 0x02, 0x6e, 0xcd, 0xb8, 0x6a, 0xb1, + 0x5c, 0x9d, 0xe8, 0x8e, 0x6e, 0x8c, 0x65, 0xc5, 0x3f, 0x37, 0x56, 0xc1, + 0x00, 0x47, 0xf2, 0xd6, 0xe2, 0xa2, 0xce, 0x4d, 0x54, 0x9b, 0xe6, 0x80, + 0xdb, 0x08, 0xfb, 0xd3, 0x49, 0x8b, 0x4d, 0x69, 0x13, 0xdb, 0x92, 0x5c, + 0xbe, 0x59, 0xc7, 0x36, 0xc5, 0x1a, 0xb3, 0x0c, 0x58, 0xa8, 0x06, 0x4c, + 0x4d, 0x57, 0x99, 0x2b, 0xb9, 0x13, 0x9b, 0xc3, 0xeb, 0xa3, 0x39, 0x59, + 0xb8, 0x0a, 0x2c, 0x38, 0x8e, 0x13, 0xad, 0x82, 0x0b, 0x85, 0x82, 0x1e, + 0x1e, 0x4a, 0x96, 0x17, 0x75, 0xff, 0xf5, 0x6a, 0xd3, 0x48, 0x96, 0xaa, + 0x41, 0x7f, 0xad, 0x11, 0xda, 0x71, 0x33, 0x14, 0xa9, 0x84, 0x89, 0x29, + 0x25, 0x52, 0x80, 0xd6, 0x11, 0x8b, 0x4b, 0x75, 0x7e, 0xbf, 0xd3, 0x50, + 0x7f, 0xce, 0xd4, 0x1e, 0x54, 0x2a, 0xee, 0x8f, 0xdd, 0xd1, 0x8d, 0xb1, + 0x65, 0x68, 0xd1, 0x71, 0x9c, 0x00, 0xd6, 0x69, 0xa6, 0x91, 0x91, 0x11, + 0x09, 0xa4, 0xa6, 0x78, 0xf7, 0x70, 0x28, 0x3b, 0x8e, 0x2a, 0xac, 0x01, + 0x29, 0x45, 0x5f, 0x3a, 0x61, 0x24, 0x00, 0x6a, 0xcd, 0xa8, 0xa5, 0x22, + 0x55, 0x34, 0x69, 0xdd, 0x8a, 0x47, 0xf3, 0x17, 0x96, 0x6b, 0x3a, 0x0f, + 0x54, 0x36, 0xbc, 0x41, 0x1e, 0x81, 0x0b, 0xc0, 0x2e, 0x46, 0xfd, 0x59, + 0x57, 0xe4, 0x72, 0x18, 0x76, 0x4e, 0x40, 0x5a, 0xa0, 0xa4, 0xd0, 0xa1, + 0x27, 0x55, 0x7d, 0x2e, 0xab, 0xef, 0xde, 0xef, 0x34, 0x16, 0xca, 0x40, + 0x0d, 0x68, 0x3a, 0x8e, 0xa3, 0x1e, 0x65, 0xfc, 0x0b, 0x65, 0xf3, 0x41, + 0x6e, 0xc3, 0xc8, 0xf6, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, + 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +static const unsigned char img3_mplayer[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x16, + 0x08, 0x06, 0x00, 0x00, 0x00, 0xc4, 0xb4, 0x6c, 0x3b, 0x00, 0x00, 0x04, + 0x6e, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x95, 0x94, 0x4f, 0x68, 0xdb, + 0x56, 0x1c, 0xc7, 0xbf, 0xcf, 0x96, 0x2d, 0xdb, 0x92, 0x6d, 0x49, 0xb5, + 0x83, 0x93, 0xda, 0x8e, 0x9b, 0xd0, 0x36, 0x81, 0xae, 0x0d, 0xa5, 0x0c, + 0xf7, 0x32, 0xe8, 0xc6, 0x46, 0x42, 0xc8, 0x8a, 0xd2, 0x32, 0xda, 0x83, + 0x19, 0x65, 0xf4, 0xb2, 0xc1, 0x46, 0xa0, 0x97, 0xb2, 0x0d, 0xb6, 0x6b, + 0x61, 0x30, 0xc6, 0x7a, 0xef, 0x9f, 0xd3, 0x28, 0xad, 0x2e, 0xa5, 0x26, + 0xec, 0x52, 0xba, 0xd1, 0x43, 0x58, 0x1d, 0xdc, 0x85, 0x26, 0x6d, 0x5d, + 0xb7, 0x69, 0xfc, 0xa7, 0x69, 0x1c, 0x59, 0xb2, 0x54, 0x63, 0xcb, 0x8a, + 0xdf, 0x0e, 0x5b, 0x44, 0xbc, 0x64, 0x29, 0xfb, 0x81, 0x4e, 0xfa, 0x7e, + 0x3f, 0xef, 0xfb, 0x7e, 0xef, 0xbd, 0x1f, 0xa1, 0x94, 0xe2, 0x6d, 0x25, + 0xcb, 0x72, 0x5f, 0x30, 0x18, 0x3c, 0xea, 0x72, 0xb9, 0x18, 0x5d, 0xd7, + 0xff, 0x50, 0x14, 0xe5, 0xd5, 0xdb, 0x3c, 0x64, 0x27, 0xb0, 0x2c, 0xcb, + 0xfe, 0x54, 0x2a, 0xf5, 0x7d, 0x24, 0x12, 0x19, 0x93, 0x24, 0x29, 0x9e, + 0x4a, 0xa5, 0x62, 0xd1, 0x68, 0x54, 0x20, 0x84, 0xa0, 0x56, 0xab, 0xe9, + 0xcf, 0x9f, 0x3f, 0x7f, 0xb5, 0xbe, 0xbe, 0x5e, 0x5e, 0x5b, 0x5b, 0x5b, + 0x58, 0x5e, 0x5e, 0xfe, 0x46, 0x51, 0x14, 0x73, 0x57, 0xb0, 0x2c, 0xcb, + 0x64, 0x60, 0x60, 0xe0, 0xcb, 0x64, 0x32, 0xf9, 0xd9, 0xc4, 0xc4, 0xc4, + 0x3b, 0x8d, 0x46, 0x03, 0xe5, 0x72, 0x19, 0x4f, 0x9f, 0x3e, 0xc5, 0xca, + 0xca, 0x0a, 0x28, 0xa5, 0x48, 0x24, 0x12, 0xd8, 0xbf, 0x7f, 0x3f, 0xf6, + 0xee, 0xdd, 0x0b, 0x41, 0x10, 0x90, 0xcd, 0x66, 0x17, 0x97, 0x97, 0x97, + 0xaf, 0x55, 0x2a, 0x95, 0x4b, 0x8a, 0xa2, 0x74, 0xb7, 0x81, 0x65, 0x59, + 0xe6, 0x0f, 0x1c, 0x38, 0x90, 0x3d, 0x79, 0xf2, 0x64, 0xda, 0xeb, 0xf5, + 0x32, 0xd9, 0x6c, 0x16, 0xd5, 0x6a, 0x75, 0xd7, 0xed, 0xf6, 0xf5, 0xf5, + 0x61, 0x72, 0x72, 0x12, 0xdd, 0x6e, 0xb7, 0x7b, 0xeb, 0xd6, 0xad, 0xf9, + 0x27, 0x4f, 0x9e, 0x7c, 0xa8, 0x28, 0x4a, 0xbd, 0x07, 0x7c, 0xe1, 0xc2, + 0x85, 0xdb, 0x99, 0x4c, 0x66, 0xb2, 0x54, 0x2a, 0xe1, 0xde, 0xbd, 0x7b, + 0x6f, 0x6b, 0x61, 0x4f, 0xa5, 0xd3, 0x69, 0x0c, 0x0f, 0x0f, 0xe3, 0xfa, + 0xf5, 0xeb, 0x77, 0x0b, 0x85, 0xc2, 0x07, 0x8a, 0xa2, 0x74, 0x19, 0x00, + 0x98, 0x99, 0x99, 0xb9, 0x74, 0xea, 0xd4, 0xa9, 0x8f, 0x2c, 0xcb, 0x42, + 0x2e, 0x97, 0x03, 0xcf, 0xf3, 0xff, 0x0b, 0xbc, 0xb0, 0xb0, 0x80, 0xfe, + 0xfe, 0x7e, 0xc8, 0xb2, 0xfc, 0xde, 0xcd, 0x9b, 0x37, 0x7f, 0x06, 0xf0, + 0x39, 0x99, 0x9e, 0x9e, 0x1e, 0x99, 0x9a, 0x9a, 0xfa, 0x3d, 0x9d, 0x4e, + 0xef, 0x99, 0x9d, 0x9d, 0x45, 0xb7, 0xdb, 0xdd, 0x66, 0x4c, 0x24, 0x12, + 0x88, 0x44, 0x22, 0xf8, 0xe7, 0xf0, 0x9c, 0x7e, 0x6f, 0x2d, 0x42, 0x08, + 0xc6, 0xc7, 0xc7, 0x91, 0xcf, 0xe7, 0x8d, 0x3b, 0x77, 0xee, 0xbc, 0xcf, + 0x44, 0xa3, 0xd1, 0x33, 0x83, 0x83, 0x83, 0x7b, 0x5a, 0xad, 0x16, 0x38, + 0x8e, 0xeb, 0x11, 0x87, 0xc3, 0x61, 0xa4, 0xd3, 0x69, 0x48, 0x92, 0x04, + 0x00, 0xe8, 0x74, 0x3a, 0xb0, 0x6d, 0x1b, 0xba, 0xae, 0x63, 0x7e, 0x7e, + 0x1e, 0x9a, 0xa6, 0xf5, 0xe8, 0x9b, 0xcd, 0x26, 0x52, 0xa9, 0x54, 0x50, + 0x14, 0xc5, 0x33, 0x0c, 0xc7, 0x71, 0x87, 0xfd, 0x7e, 0x3f, 0x74, 0x5d, + 0xef, 0x69, 0x81, 0xdb, 0xed, 0xc6, 0x91, 0x23, 0x47, 0x10, 0x0a, 0x85, + 0x60, 0xdb, 0xb6, 0x93, 0xca, 0x30, 0x0c, 0xd8, 0xb6, 0x8d, 0x83, 0x07, + 0x0f, 0xe2, 0xf1, 0xe3, 0xc7, 0xce, 0x3f, 0x00, 0xd0, 0x34, 0x0d, 0x92, + 0x24, 0x81, 0xe7, 0xf9, 0x11, 0xc6, 0xe7, 0xf3, 0x0d, 0x79, 0xbd, 0x5e, + 0x34, 0x9b, 0x4d, 0x04, 0x83, 0x41, 0x47, 0xe4, 0xf3, 0xf9, 0x60, 0x59, + 0x16, 0x54, 0x55, 0x05, 0x00, 0x50, 0x4a, 0x1d, 0xb0, 0x69, 0x9a, 0xa0, + 0x94, 0x42, 0x10, 0x04, 0xb4, 0xdb, 0x6d, 0xc7, 0xb3, 0xb1, 0xb1, 0x01, + 0xb7, 0xdb, 0x0d, 0x9f, 0xcf, 0x37, 0xc4, 0x74, 0x3a, 0x9d, 0xf6, 0xea, + 0xea, 0x2a, 0x62, 0xb1, 0x18, 0xdc, 0x6e, 0xb7, 0x23, 0xb2, 0x6d, 0x1b, + 0xa5, 0x52, 0x09, 0x7e, 0xbf, 0x1f, 0x0c, 0xc3, 0x38, 0xad, 0x78, 0xf3, + 0xe6, 0x0d, 0x28, 0xa5, 0xa0, 0x94, 0xc2, 0xe3, 0xf1, 0xf4, 0xec, 0x32, + 0x14, 0x0a, 0x61, 0x6d, 0x6d, 0x0d, 0x96, 0x65, 0x59, 0x8c, 0x61, 0x18, + 0xc5, 0xf5, 0xf5, 0xf5, 0x77, 0x93, 0xc9, 0x64, 0x4f, 0x62, 0xc3, 0x30, + 0xb0, 0xba, 0xba, 0xea, 0x40, 0x36, 0xbf, 0xcd, 0xf4, 0x9b, 0x8f, 0x65, + 0xab, 0x87, 0x65, 0x59, 0xa8, 0xaa, 0x0a, 0xc3, 0x30, 0x9e, 0x31, 0xa6, + 0x69, 0xce, 0x69, 0x9a, 0x76, 0xc6, 0x34, 0x4d, 0x88, 0xa2, 0xe8, 0x88, + 0x78, 0x9e, 0x47, 0xb5, 0x5a, 0xc5, 0xeb, 0xd7, 0xaf, 0xb7, 0x01, 0x29, + 0xa5, 0x88, 0x44, 0x22, 0x88, 0xc7, 0xe3, 0x20, 0x84, 0xf4, 0x84, 0x69, + 0x34, 0x1a, 0x68, 0x34, 0x1a, 0x7f, 0xba, 0x87, 0x86, 0x86, 0x5e, 0xba, + 0x5c, 0xae, 0xe9, 0x56, 0xab, 0x25, 0xf6, 0xf7, 0xf7, 0x43, 0x92, 0x24, + 0xb0, 0x2c, 0x0b, 0x96, 0x65, 0x11, 0x8f, 0xc7, 0xd1, 0x6e, 0xb7, 0xb1, + 0xb2, 0xb2, 0x02, 0xc3, 0x30, 0xd0, 0x6c, 0x36, 0xd1, 0xe9, 0x74, 0x30, + 0x3a, 0x3a, 0x8a, 0xe3, 0xc7, 0x8f, 0x23, 0x10, 0x08, 0x38, 0x5a, 0xc3, + 0x30, 0x90, 0xcb, 0xe5, 0x50, 0x2c, 0x16, 0x2b, 0xe5, 0x72, 0xf9, 0x2b, + 0x42, 0x29, 0x45, 0x26, 0x93, 0x39, 0x97, 0x4c, 0x26, 0x7f, 0x18, 0x18, + 0x18, 0x10, 0x4f, 0x9c, 0x38, 0x81, 0x44, 0x22, 0xd1, 0x73, 0x8d, 0x28, + 0xa5, 0xd0, 0x75, 0xdd, 0x39, 0xb0, 0xad, 0x29, 0x01, 0xa0, 0x5c, 0x2e, + 0xe3, 0xfe, 0xfd, 0xfb, 0x28, 0x95, 0x4a, 0x66, 0xb1, 0x58, 0xfc, 0xfa, + 0xca, 0x95, 0x2b, 0x3f, 0x39, 0x4f, 0x3a, 0x93, 0xc9, 0xfc, 0x38, 0x38, + 0x38, 0xf8, 0x85, 0x24, 0x49, 0xcc, 0xb1, 0x63, 0xc7, 0x30, 0x3a, 0x3a, + 0x8a, 0x68, 0x34, 0x8a, 0xdd, 0xaa, 0x56, 0xab, 0x61, 0x69, 0x69, 0x09, + 0xf9, 0x7c, 0x1e, 0xaa, 0xaa, 0x76, 0x0b, 0x85, 0xc2, 0xb5, 0xab, 0x57, + 0xaf, 0x9e, 0x03, 0x00, 0x66, 0x53, 0x64, 0x9a, 0xe6, 0xcc, 0x8b, 0x17, + 0x2f, 0xb8, 0x7a, 0xbd, 0xfe, 0xb1, 0xaa, 0xaa, 0x7d, 0x0f, 0x1f, 0x3e, + 0xc4, 0xa1, 0x43, 0x87, 0x10, 0x0e, 0x87, 0x21, 0x08, 0x82, 0xb3, 0x48, + 0xad, 0x56, 0x43, 0xbd, 0x5e, 0x47, 0xa3, 0xd1, 0xc0, 0xd2, 0xd2, 0x12, + 0xaa, 0xd5, 0x2a, 0x34, 0x4d, 0x53, 0x55, 0x55, 0x9d, 0x35, 0x0c, 0xe3, + 0xfc, 0x26, 0x6f, 0xdb, 0x3c, 0x3e, 0x7d, 0xfa, 0xf4, 0xd1, 0x40, 0x20, + 0xf0, 0x5b, 0x38, 0x1c, 0x0e, 0xb0, 0x2c, 0x0b, 0x42, 0x08, 0x58, 0x96, + 0x75, 0x5a, 0xa0, 0x69, 0x1a, 0x2c, 0xcb, 0x72, 0xae, 0xa4, 0x6d, 0xdb, + 0xed, 0x4a, 0xa5, 0x32, 0x7e, 0xe3, 0xc6, 0x8d, 0xbb, 0x5b, 0x39, 0x3b, + 0x0e, 0xfa, 0xb3, 0x67, 0xcf, 0xfe, 0x22, 0x8a, 0xe2, 0x27, 0x5e, 0xaf, + 0x17, 0x84, 0x10, 0x74, 0x3a, 0x1d, 0x6c, 0x6c, 0x6c, 0x80, 0x10, 0x02, + 0xaf, 0xd7, 0x0b, 0x8e, 0xe3, 0x10, 0x0e, 0x87, 0x31, 0x36, 0x36, 0x86, + 0x07, 0x0f, 0x1e, 0xdc, 0xbe, 0x78, 0xf1, 0xe2, 0xd4, 0xbf, 0x19, 0xcc, + 0x36, 0x2a, 0x80, 0x56, 0xab, 0x75, 0x5e, 0xd7, 0xf5, 0xa4, 0x24, 0x49, + 0xe9, 0x58, 0x2c, 0x86, 0x7d, 0xfb, 0xf6, 0x41, 0x10, 0x04, 0x88, 0xa2, + 0x88, 0xe1, 0xe1, 0x61, 0xf0, 0x3c, 0x0f, 0x42, 0x08, 0x2e, 0x5f, 0xbe, + 0x9c, 0x9b, 0x9b, 0x9b, 0xfb, 0x74, 0x27, 0xc6, 0x8e, 0x89, 0x81, 0xbf, + 0x07, 0x3f, 0xcb, 0xb2, 0xdf, 0xf9, 0xfd, 0xfe, 0x89, 0x44, 0x22, 0x11, + 0x1f, 0x19, 0x19, 0x09, 0xa5, 0x52, 0x29, 0xb8, 0x5c, 0x2e, 0xe3, 0xd1, + 0xa3, 0x47, 0x95, 0x42, 0xa1, 0xf0, 0xeb, 0xe2, 0xe2, 0xe2, 0xb7, 0x8a, + 0xa2, 0x68, 0x3b, 0xf9, 0xff, 0x13, 0xbc, 0x65, 0x01, 0x0f, 0x80, 0x21, + 0x8e, 0xe3, 0x0e, 0x7b, 0x3c, 0x1e, 0xb7, 0xa6, 0x69, 0x79, 0x00, 0xcf, + 0x14, 0x45, 0xb1, 0x76, 0xf3, 0xfd, 0x05, 0x05, 0x39, 0x26, 0x66, 0x88, + 0x20, 0x72, 0x94, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82 +}; + + +/* + * Constructs a MPlayer as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +MPlayer::MPlayer( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QImage img; + img.loadFromData( img0_mplayer, sizeof( img0_mplayer ), "PNG" ); + image0 = img; + img.loadFromData( img1_mplayer, sizeof( img1_mplayer ), "PNG" ); + image1 = img; + img.loadFromData( img2_mplayer, sizeof( img2_mplayer ), "PNG" ); + image2 = img; + img.loadFromData( img3_mplayer, sizeof( img3_mplayer ), "PNG" ); + image3 = img; + if ( !name ) + setName( "MPlayer" ); + setEnabled( TRUE ); + setIcon( image0 ); + MPlayerLayout = new QGridLayout( this, 1, 1, 3, 3, "MPlayerLayout"); + + textLabel1 = new QLabel( this, "textLabel1" ); + + MPlayerLayout->addWidget( textLabel1, 0, 0 ); + + cbAudio = new QComboBox( FALSE, this, "cbAudio" ); + + MPlayerLayout->addWidget( cbAudio, 0, 1 ); + spacer1 = new QSpacerItem( 190, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + MPlayerLayout->addItem( spacer1, 0, 5 ); + + cbSub = new QComboBox( FALSE, this, "cbSub" ); + + MPlayerLayout->addWidget( cbSub, 0, 4 ); + + textLabel1_2 = new QLabel( this, "textLabel1_2" ); + + MPlayerLayout->addWidget( textLabel1_2, 0, 3 ); + + bSwitchAudio = new KPushButton( this, "bSwitchAudio" ); + bSwitchAudio->setMaximumSize( QSize( 22, 22 ) ); + bSwitchAudio->setFlat( TRUE ); + + MPlayerLayout->addWidget( bSwitchAudio, 0, 2 ); + + layout6 = new QHBoxLayout( 0, 0, 6, "layout6"); + + bStop = new KPushButton( this, "bStop" ); + bStop->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bStop->sizePolicy().hasHeightForWidth() ) ); + bStop->setMinimumSize( QSize( 30, 30 ) ); + bStop->setPixmap( image1 ); + bStop->setFlat( TRUE ); + layout6->addWidget( bStop ); + + bPlay = new KPushButton( this, "bPlay" ); + bPlay->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bPlay->sizePolicy().hasHeightForWidth() ) ); + bPlay->setMinimumSize( QSize( 30, 30 ) ); + bPlay->setPixmap( image2 ); + bPlay->setFlat( TRUE ); + layout6->addWidget( bPlay ); + + slider = new QSlider( this, "slider" ); + slider->setOrientation( QSlider::Horizontal ); + layout6->addWidget( slider ); + + layout5 = new QHBoxLayout( 0, 0, 6, "layout5"); + + bDown = new KPushButton( this, "bDown" ); + bDown->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, bDown->sizePolicy().hasHeightForWidth() ) ); + bDown->setMinimumSize( QSize( 22, 22 ) ); + bDown->setMaximumSize( QSize( 22, 22 ) ); + QFont bDown_font( bDown->font() ); + bDown_font.setBold( TRUE ); + bDown->setFont( bDown_font ); + bDown->setFlat( TRUE ); + layout5->addWidget( bDown ); + + pixmapLabel1 = new QLabel( this, "pixmapLabel1" ); + pixmapLabel1->setMaximumSize( QSize( 22, 22 ) ); + pixmapLabel1->setPixmap( image3 ); + pixmapLabel1->setScaledContents( TRUE ); + layout5->addWidget( pixmapLabel1 ); + + bUp = new KPushButton( this, "bUp" ); + bUp->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, bUp->sizePolicy().hasHeightForWidth() ) ); + bUp->setMinimumSize( QSize( 22, 22 ) ); + bUp->setMaximumSize( QSize( 22, 22 ) ); + QFont bUp_font( bUp->font() ); + bUp_font.setBold( TRUE ); + bUp->setFont( bUp_font ); + bUp->setFlat( TRUE ); + layout5->addWidget( bUp ); + layout6->addLayout( layout5 ); + + MPlayerLayout->addMultiCellLayout( layout6, 4, 4, 0, 5 ); + + frame4 = new QFrame( this, "frame4" ); + frame4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, frame4->sizePolicy().hasHeightForWidth() ) ); + frame4->setFrameShape( QFrame::HLine ); + frame4->setFrameShadow( QFrame::Raised ); + + MPlayerLayout->addMultiCellWidget( frame4, 1, 1, 0, 5 ); + + Label = new QLabel( this, "Label" ); + Label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, Label->sizePolicy().hasHeightForWidth() ) ); + Label->setPaletteBackgroundColor( QColor( 0, 0, 0 ) ); + Label->setAlignment( int( QLabel::AlignCenter ) ); + + MPlayerLayout->addMultiCellWidget( Label, 2, 2, 0, 5 ); + + frame3 = new QFrame( this, "frame3" ); + frame3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, frame3->sizePolicy().hasHeightForWidth() ) ); + frame3->setFrameShape( QFrame::HLine ); + frame3->setFrameShadow( QFrame::Raised ); + + MPlayerLayout->addMultiCellWidget( frame3, 3, 3, 0, 5 ); + languageChange(); + resize( QSize(559, 458).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bStop, SIGNAL( clicked() ), this, SLOT( bStopClick() ) ); + connect( bPlay, SIGNAL( clicked() ), this, SLOT( bPlayClick() ) ); + connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); + connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); + connect( slider, SIGNAL( valueChanged(int) ), this, SLOT( sliderChanged(int) ) ); + connect( cbAudio, SIGNAL( activated(int) ), this, SLOT( cbAudioActivated(int) ) ); + connect( cbSub, SIGNAL( activated(int) ), this, SLOT( cbSubActivated(int) ) ); + connect( bDown, SIGNAL( clicked() ), this, SLOT( bDownClick() ) ); + connect( bUp, SIGNAL( clicked() ), this, SLOT( bUpClick() ) ); + connect( bSwitchAudio, SIGNAL( clicked() ), this, SLOT( bSwitchAudioClick() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MPlayer::~MPlayer() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void MPlayer::languageChange() +{ + setCaption( tr2i18n( "Preview" ) ); + textLabel1->setText( tr2i18n( "Audio" ) ); + textLabel1_2->setText( tr2i18n( "Subpicture" ) ); + bSwitchAudio->setText( QString::null ); + bStop->setText( QString::null ); + bPlay->setText( QString::null ); + bPlay->setAccel( QKeySequence( QString::null ) ); + bDown->setText( tr2i18n( "-" ) ); + bDown->setAccel( QKeySequence( QString::null ) ); + bUp->setText( tr2i18n( "+" ) ); + bUp->setAccel( QKeySequence( QString::null ) ); + Label->setText( QString::null ); +} + +void MPlayer::bStopClick() +{ + qWarning( "MPlayer::bStopClick(): Not implemented yet" ); +} + +void MPlayer::cbAudioActivated(int) +{ + qWarning( "MPlayer::cbAudioActivated(int): Not implemented yet" ); +} + +void MPlayer::slider_sliderReleased() +{ + qWarning( "MPlayer::slider_sliderReleased(): Not implemented yet" ); +} + +void MPlayer::sliderReleased() +{ + qWarning( "MPlayer::sliderReleased(): Not implemented yet" ); +} + +void MPlayer::sliderPressed() +{ + qWarning( "MPlayer::sliderPressed(): Not implemented yet" ); +} + +void MPlayer::sliderChanged(int) +{ + qWarning( "MPlayer::sliderChanged(int): Not implemented yet" ); +} + +void MPlayer::bPlayClick() +{ + qWarning( "MPlayer::bPlayClick(): Not implemented yet" ); +} + +void MPlayer::cbSubActivated(int) +{ + qWarning( "MPlayer::cbSubActivated(int): Not implemented yet" ); +} + +void MPlayer::bUpClick() +{ + qWarning( "MPlayer::bUpClick(): Not implemented yet" ); +} + +void MPlayer::bDownClick() +{ + qWarning( "MPlayer::bDownClick(): Not implemented yet" ); +} + +void MPlayer::bSwitchAudioClick() +{ + qWarning( "MPlayer::bSwitchAudioClick(): Not implemented yet" ); +} + +#include "mplayer.moc" diff --git a/k9Mplayer/mplayer.ui b/k9Mplayer/mplayer.ui new file mode 100644 index 0000000..5c79975 --- /dev/null +++ b/k9Mplayer/mplayer.ui @@ -0,0 +1,439 @@ + +MPlayer + + + MPlayer + + + true + + + + 0 + 0 + 559 + 458 + + + + Preview + + + image0 + + + + unnamed + + + 3 + + + 3 + + + + textLabel1 + + + Audio + + + + + cbAudio + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 190 + 20 + + + + + + cbSub + + + + + textLabel1_2 + + + Subpicture + + + + + bSwitchAudio + + + + 22 + 22 + + + + + + + true + + + + + layout6 + + + + unnamed + + + + bStop + + + + 0 + 0 + 0 + 0 + + + + + 30 + 30 + + + + + + + image1 + + + true + + + + + bPlay + + + + 0 + 0 + 0 + 0 + + + + + 30 + 30 + + + + + + + image2 + + + + + + true + + + + + slider + + + Horizontal + + + + + layout5 + + + + unnamed + + + + bDown + + + + 1 + 1 + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + 1 + + + + - + + + + + + true + + + + + pixmapLabel1 + + + + 22 + 22 + + + + image3 + + + true + + + + + bUp + + + + 1 + 1 + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + 1 + + + + + + + + + + + true + + + + + + + + + frame4 + + + + 7 + 0 + 0 + 0 + + + + HLine + + + Raised + + + + + Label + + + + 7 + 7 + 0 + 0 + + + + + 0 + 0 + 0 + + + + + + + AlignCenter + + + + + frame3 + + + + 7 + 0 + 0 + 0 + + + + HLine + + + Raised + + + + + + + 89504e470d0a1a0a0000000d494844520000002f0000002708060000009f7411c100000528494441545885ed597d6c535514ffddb796c2f81844e62423ac54374d8b5aa683652392f80f1103c902cd08099b6e2ca2b8fd83e0186e44d42c59202806e5638400e2f6c71697992c241015718fcae63689205f5b670703442ca26c6b37eef18ff2ae7d7dafeb74fdd0c45fd2e4de7bce3bfd9d9373cebdef3e26cb32fe6da8db7f91a40486fca20c369a9e21568482d1d2e0a693c77fc4c8c8fd903a675aaf10630cdb6b5fd075824533f21dad77a9b1ee0c06ef79c1a4518318163b0e2cd5181837f99606379ded70e346ff1d242448e3b2150ec10e8c296d5a1adcd47de9262e5fb801a331415727dac4f5a0223fc39645b95fdec62fcb1f5629656767c79454201863702cd9896b7dbf6a65b22cc3956aa792f6dff05cf204b42c9a11078ae1c118c3e9d3a75569c39aae0dd26ae71d00c01f792971213656043b2029c43f9c3f2d6ea4c60a2252cd4595ad499b147332e385206f1c671f8e0762dfdf2288ffc9c7125b871f1755fb9f23ffc5cf3e31361000bd5265ccbfaab4a7c0b93256a0a7132d4c0c389d18a61924fc3ec2354a39d64a00807cfe1d109198b79edb86a1a1613c9fb94de8ee3e540cfbb36900fc0e70aeb5172904c645aab24e1e55b9b4e8a026d20a761f2a46ebb96d585f780000e0f57a2346722c90e6df3a1bb2c13f9a9182ef9c3dc87ee22df87c230010d21100b0582c626c301860b7dbe176bb2149fed26a6b6b1363499234634992e0f57a61b15860b158543abae4f5161582479a5e7f609ca1fd4a3500a0b3ad57e8bd56508b85195bb0fb503100a0bfbf1fbb76ed12a9d3d5d585b2b232a19f92a23e3bf97c3e783c1e007fd589c96482cbe5426f6f2f38e7a8adadd5f0ab9f68a390e4dd3fdd16068993ca78755593d0fbe8f05a7c7be93d91ef00505a5a8aab57af8a79737333f2f2f2c43c309246a3119b376f06001416168a5a59b76e9dd0292a2ad2f03bd83be81fc8b28cc4c6eb4444c43927ce39cd4bdd4059e915c4392722a29327ce13e79cb2d22b2873ee9b3438e0a3acf40aea38e312cf70ce09806a0c803a3b3bc9ef3b91c3e12087c32164c1ba050505626e369b55b6955f62e3754a6cbc4eb22cfbcff38bfbe7926fc523516d71803fea4aabede9e981d96cfedb36a67c7613007062968b1900e0a9a4d85c2228c423d54a2500f864c1f488180b07228ae81e200180e75c1b8b76ca441a1767d9296e974ec1608ca164d53e5c387f0d73cc3371b4b974d41a7ce3fbbbf1bb3153c01843aead4ad483776818bdddb734c79360d4654f8f2f79c61872ac95f00e0da3bdbb5a235fbeb80639d64aecaf7f05d6275355b2293d1d4cec184ea733e6ef8139d64a188d0968efaec6ecd9b3515353a392379fdc84d52fe5a264d55e30c6c4ce6f7bd01de3769edffbfe0900c0575d5bc55a7979392449425f5f9f585bbf710900e0e9399b6068b801fb74233e48bccc8020f20b32b6449ff5031cdeff354c26fdac4d4b4b832449a2ad1efdbc0c93a798702ad5c5b64fba243244f5b4d198805c5b158c130cd8f7e95a3c941cfa2e6766f2d4713b70cc5931aadc60f0d30bd57554e407ee799138d98461df085e5eb967dce40271ff3ec7330b2d58f3aa55891c49a31caf01c0e3f120292929a45c45fee3fa3cb6a1b8e51fef56c40953932661e1a2c7b074e59cb00d60d1bcad705e7c57b39e9f9f8fbaba3a31dfb3f3b8eef39aa4db716069580706067c58b622734c044321d4ffe81d1f8ed49e429a2559b31ed52f23e1b0a1b8851863f8e687b7c118d3cded5c5b1500fd2f2371bdfa5008e5daaae0f38ea864cace1ba8178cb8465ec1c69263a4972e9c13761e7c31646afe09ba8d3cd6d8e39a010000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003f849444154388d9595dd6f145518c67fe7ccc7ee6c77962d2d1f8bba14d1340621b82b26dc1063a206895e60421413bd2a813b132fbcf24a13fe02c3c524c43b2ec444632244888951c48fb24d459410a87ca56cb7dded7eb03b3bb333e778b1b4b648b13cc993c99939f37b9fbc6fce8ce0212a1c99b440af039543eb146840fb6855b654b3f28bf772b8d2bbe221d0ddc001d03b11e411d600002ae8a0e35bc0a450d1c9823e7ecef3bcf87fc18523935b41bc8f611d4c0fa4b21b873372c35092d1e1168e1573ad96e67a4531373bab6a0ddf57917fced2773fd9a14f9cf73c2f7a20b8706472338863d899bd3b9f74786d97cbf62734ebb31686ec6fd5c07c2b62aadce354a9cb0f17e709fde65f0955fbf0597df2d402dcb82fe9a7e94ce6d53776af11efbee8f074ce206119f4620823bd68430a863326db375b6c18b4f8bba2879b5df17c556f29ed2d3ab74ba5925e04e7761d3e8aedbeb5ef85ac78bd68615b9230d204bdfb1c2a829e2288345a6b36adb5705396f8f3763cd40db5b5898933c562b127fa692fec1646f29b1d4fadcd1edce3e03a926f27fc95e6ba4caf3ce7d08b345ffdeaf3fd44a56104d3ef6de78bd366e1f0b885d607d203c94c61ab4dac148db606e0a3b7d73f14faf1890a9d40d10d15a3b998dfaf25dc5a35bdbfd21bf9d904d6013b339935329b8c68b6e5aa922ee8b31f130034fd142dd25251dfd614f9bc09e410323fec0afc50e1878a7eded515102ae46a2dd35f982608238761e74d20854c0ca4ac1ef5b6420ab0cd15cfcd325d9b4b2e2f2204c8842314aeb970b3d9b59869680c09aeb33a30c0d55a06b1b05ddf2b809226681f157466da0eed38b9f850af7cda1fa83e5c43dced0a1d05265a95815b8d8eda120be791600b328dfe44eefa01e8b82255bb2c2dd5ac0093043565191a7b8957aba419639b3122ac2a93ee95acbe714700140f9ddf23ecf497b9dcc6c141d77ea42618122205f3ad90f2f474cbe95efe60549efdda0428e8e3e72e44639fb7eab3874686064998a2ff795a087ddf70342c1b5810696ed6e75161e3bb5179f627a06500944a25fd78e19da9a0c7334ac59b1f1b32442a214858ba6f73f93569ffbb16f4b872b3a9aab5c6f8507ce958564c5f5a0403ec2b58d5aace8f377c735bb3138db8298bb5ae896d496c53fcc79601738d1e17a71a94679be3eba289a37959fa0d98f33c2f5e04974a25bdb798aa55f5c844c33752b38dde48ab13d9493312038e8929255280d631d5f9367f5cefa8cb375b77ebf5e6e9a1f8d2b17bd08ae779bda5dd5bd4d8d89804062ef2e64b914cef5758dba41439d7311c80961f7755ac2a26dd2bc978e6ccbd9ece00f515ff204be002b02bf148b629f2790c3b2fc0152829741448d52e67f58d3b6b8cb91ad0027ccff3d452c63f42b8e4bfe27a6d4a0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000047c49444154388d8595db6f54551487bfbdcf656e9de994164b118602318454a04e4583899760d454a289688cb7f856020f24bc10ff0025fd03d4f4e1280fbef4411e4d30627c2148086548ad8821b140a9d2ceb4d39933cce5dcf6f661da424d8b275959679fbdd7777e6b65656dc1639efc89490bf466507d689d040de8265acd59ca2d5e715ef3378a158f811e02de073d882087b0520028af818eee01934285e7f2faec25c771a2ff05e74f4cee06710ac3faa82395cc6ee9c9c8deee387b7a6a24ac88bfca1ddc292a164a2555ae369b2a6c5eb2f4832ff6ebf1cb8ee384eb82f32726778018c3ce0c0fee4af0e6c134fbb66b9ec85a18b27d54034bb590e9b980f3851617a796f09beecd982a7ff6b43e777e056efc47e9d71d99cc1b6f1fea149fbe92e0a93e839865f0cd4f15f66e8fe1871a3fd41852d09331d9b7c3a2b7cbe27651f7b82df1eca2de59181e4acc160a05bd0aee3b787c143bfdc191e7b2e2ad210bdb92f8a1c60b34efbc90e5ab1f16d9b5c5c2f3155ea0f0428dd69aad9b2cd2494bfc311b75b77c6d6de5fa85a1a1a1c068abbd764818b1d103bb33f1e1bc8594e0078a56d0866ceb89f1e2408a93df699ec90578815ede6f67b0a94352f74d664a417f29da3ed9cbcddb46fef884059c4aa7d32fbd3a98125d1de0059a56d056eb059add5be300bcf7bcc1e971c1de2dfe9afd56a0b00d9fe97965d75b616084d58b26b01918cc643a65361ee2d6e5461d08c0f8499b0fbf84a3075ca248335b8e989acbe23693d4e8908aca802b723913e843c85c4f5ad0f4154d5fa197db65c5af0fcfb0bfb7c2e4df2966dd7646982608a30fc3ce4920898ca5925640a5ae701b0acfd7b47cbdea3752fedb7c965223b9fa4d0801329610905ecddb6d59cc57254557526d4a2a4d837b95185767528f2d8b1f190841db567e809226e826ca6bccd713d4a3783b7f4023a8f9367a7dc100bc3efaf05d88761451ab2574e899683507dcab36d4ce4824d6046ae486d3e4f019089627846980041e343dd05151aafa9cb4945b0426f1caca3234f623163322d6937cf80c8022694524ad88b819619b11c25f5426ad5b597df7be79c579cd1f3a76f95ce4553fb1a2445757da5e23526980ccea7a64acc6b63408a157cfb5e7878f6a2dd513d1fc854e63a16c02e4f5d94bd7c291ef6b95d2b1feee2e62a678d86f3c049ffe769eac0dda5ea969fb8c176a662a4b28bffacb1ef9f3af40cd0028140a7a5bfee3692f60af52d18e27bb0d918c0962962666695ede97e6f3f1fbc4ccf63a6eb77dccd408026ecdb86ab15c9de88e6e8c65c53f3756c10047f2d6e2a2ce4d549be680db08fbd3498b4d6913db925cbe59c736c51ab30c58a8064c4d57992bb9139bc3eba33959b80a2c388e13ad820b85821e1e4a961775fff56ad34896aa417fad11da713314a9848929255280d6118b4b757ebfd3507fced41e542aee8fddd18db16568d1719c00d669a691911109a4a678f770283b8e2aac0129455f3a6124006acda8a522553469dd8a47f317966b3a0f5436bc411e810bc02e46fd5957e47218764e405aa0a4d0a127557d2eabefdeef3416ca400d683a8ea31e65fc0b65f3416ec3c8f69a0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000046e49444154388d95944f68db561cc7bfcf962ddb926d49b58393da8e9bd03681ae0da50cf732e8c64642c88ad232da831965f4b2c146a097b20db66b6130c67aef9fd328ad2ea526ec52bad143581ddc85266d5db769fca7691c59b25463cb8adf0e5b44bc6429fb814efa7e3feffb7eefbd1fa194e26d25cb725f30183cea72b9185dd7ff5014e5d5db3c6427b02ccbfe542af57d2412199324299e4aa562d168542084a056abe9cf9f3f7fb5bebe5e5e5b5b5b585e5efe4651147357b02ccb646060e0cb6432f9d9c4c4c43b8d4603e572194f9f3ec5caca0a28a5482412d8bf7f3ff6eedd0b411090cd6617979797af552a954b8aa274b7816559e60f1c38903d79f264daebf532d96c16d56a75d7edf6f5f561727212dd6eb77bebd6adf9274f9e7ca8284abd077ce1c285db994c66b2542ae1debd7b6f6b614fa5d3690c0f0fe3faf5eb770b85c2078aa2741900989999b974ead4a98f2ccb422e9703cff3ff0bbcb0b080fefe7ec8b2fcdecd9b377f06f039999e9e1e999a9afa3d9d4eef999d9d45b7dbdd664c2412884422f8e7f09c7e6f2d4208c6c7c791cfe78d3b77eebccf44a3d1338383837b5aad16388eeb1187c361a4d36948920400e8743ab06d1bbaae637e7e1e9aa6f5e89bcd2652a9545014c5330cc77187fd7e3f745def6981dbedc6912347100a8560dbb693ca300cd8b68d83070fe2f1e3c7ce3f00d0340d922481e7f911c6e7f30d79bd5e349b4d04834147e4f3f960591654550500504a1db0699aa094421004b4db6dc7b3b1b101b7db0d9fcf37c4743a9df6eaea2a62b118dc6eb723b26d1ba552097ebf1f0cc338ad78f3e60d28a5a094c2e3f1f4ec32140a616d6d0d9665598c6118c5f5f5f57793c9644f62c330b0babaea4036bfcdf49b8f65ab876559a8aa0ac3309e31a669ce699a76c6344d88a2e888789e47b55ac5ebd7afb70129a588442288c7e32084f48469341a68341a7fba8786865eba5caee956ab25f6f7f7439224b02c0b9665118fc7d16eb7b1b2b202c330d06c36d1e974303a3a8ae3c78f231008385ac33090cbe5502c162be572f92b422945269339974c267f181818104f9c38814422d1738d28a5d075dd39b0ad2901a05c2ee3fefdfb28954a66b158fcfaca952b3f394f3a93c9fc383838f8852449ccb163c7303a3a8a68348addaa56ab61696909f97c1eaaaa760b85c2b5ab57af9e03006653649ae6cc8b172fb87abdfeb1aaaa7d0f1f3ec4a14387100e87210882b348ad5643bd5e47a3d1c0d2d212aad52a344d5355559d350ce3fc266fdb3c3e7dfaf4d14020f05b381c0eb02c0b42085896755aa0691a2ccb72aea46ddbed4aa5327ee3c68dbb5b393b0efab367cffe228ae2275eaf178410743a1d6c6c6c801002afd70b8ee3100e8731363686070f1edcbe78f1e2d4bf19cc362a8056ab755ed7f5a42449e9582c867dfbf641100488a288e1e161f03c0f42082e5fbe9c9b9b9bfb7427c68e8981bf073fcbb2dff9fdfe894422111f191909a55229b85c2ee3d1a3479542a1f0ebe2e2e2b78aa2683bf9ff13bc65010f80218ee30e7b3c1eb7a6697900cf1445b176f3fd0505392666882072940000000049454e44ae426082 + + + + + bStop + clicked() + MPlayer + bStopClick() + + + bPlay + clicked() + MPlayer + bPlayClick() + + + slider + sliderReleased() + MPlayer + sliderReleased() + + + slider + sliderPressed() + MPlayer + sliderPressed() + + + slider + valueChanged(int) + MPlayer + sliderChanged(int) + + + cbAudio + activated(int) + MPlayer + cbAudioActivated(int) + + + cbSub + activated(int) + MPlayer + cbSubActivated(int) + + + bDown + clicked() + MPlayer + bDownClick() + + + bUp + clicked() + MPlayer + bUpClick() + + + bSwitchAudio + clicked() + MPlayer + bSwitchAudioClick() + + + + bStopClick() + cbAudioActivated(int) + slider_sliderReleased() + sliderReleased() + sliderPressed() + sliderChanged( int ) + bPlayClick() + cbSubActivated(int) + bUpClick() + bDownClick() + bSwitchAudioClick() + + + + kicondialog.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + + diff --git a/k9author/Makefile.am b/k9author/Makefile.am new file mode 100644 index 0000000..afe0945 --- /dev/null +++ b/k9author/Makefile.am @@ -0,0 +1,18 @@ +AM_CPPFLAGS= -I$(srcdir) $(all_includes) + +KDE_CXXFLAGS = $(ENABLE_PERMISSIVE_FLAG) + +METASOURCES = AUTO + +noinst_LTLIBRARIES = libk9author.la +libk9author_la_LDFLAGS = $(all_libraries) +libk9author_la_SOURCES = chapterEdit.ui import.ui k9avidecode.cpp k9avifile.cpp \ + k9canvasselection.cpp k9chapteredit.cpp k9import.cpp k9importfiles.cpp k9lvitemimport.cpp \ + k9menu.cpp k9menubutton.cpp k9menuedit.cpp k9menueditor.cpp k9newdvd.cpp \ + k9newtitle.cpp k9title.cpp menuEdit.ui newTitle.ui +noinst_HEADERS = k9avidecode.h k9avifile.h k9canvasselection.h k9chapteredit.h \ + k9import.h k9importfiles.h k9lvitemimport.h k9menu.h k9menubutton.h k9menuedit.h \ + k9menueditor.h k9newdvd.h k9newtitle.h k9title.h +libk9author_la_LIBADD = $(top_builddir)/libk9copy/libk9copy.la $(LIB_KDEUI) +INCLUDES = -I$(top_srcdir)/dvdread -I$(top_srcdir)/k9devices \ + -I$(top_srcdir)/k9vamps -I$(top_srcdir)/libk9copy -I$(top_srcdir)/src $(all_includes) diff --git a/k9author/chapterEdit.cpp b/k9author/chapterEdit.cpp new file mode 100644 index 0000000..d344b5e --- /dev/null +++ b/k9author/chapterEdit.cpp @@ -0,0 +1,212 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './chapterEdit.ui' +** +** Created: dim. oct. 26 08:56:28 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "chapterEdit.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ktimewidget.h" +#include "kurlrequester.h" +#include "klineedit.h" +#include "kpushbutton.h" + +/* + * Constructs a chapterEdit as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +chapterEdit::chapterEdit( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "chapterEdit" ); + setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) ); + chapterEditLayout = new QGridLayout( this, 1, 1, 11, 6, "chapterEditLayout"); + + twstart = new KTimeWidget( this, "twstart" ); + twstart->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, twstart->sizePolicy().hasHeightForWidth() ) ); + + chapterEditLayout->addWidget( twstart, 1, 2 ); + + textLabel1 = new QLabel( this, "textLabel1" ); + + chapterEditLayout->addWidget( textLabel1, 1, 1 ); + + textLabel3 = new QLabel( this, "textLabel3" ); + + chapterEditLayout->addWidget( textLabel3, 0, 1 ); + + urFile = new KURLRequester( this, "urFile" ); + urFile->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, urFile->sizePolicy().hasHeightForWidth() ) ); + urFile->setMinimumSize( QSize( 200, 0 ) ); + + chapterEditLayout->addMultiCellWidget( urFile, 0, 0, 2, 4 ); + + bStart = new KPushButton( this, "bStart" ); + bStart->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bStart->sizePolicy().hasHeightForWidth() ) ); + + chapterEditLayout->addWidget( bStart, 1, 3 ); + spacer2 = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + chapterEditLayout->addMultiCell( spacer2, 1, 2, 4, 4 ); + + ckBreakStart = new QCheckBox( this, "ckBreakStart" ); + + chapterEditLayout->addMultiCellWidget( ckBreakStart, 2, 2, 2, 3 ); + spacer1 = new QSpacerItem( 21, 60, QSizePolicy::Minimum, QSizePolicy::Expanding ); + chapterEditLayout->addItem( spacer1, 6, 2 ); + + textLabel2 = new QLabel( this, "textLabel2" ); + + chapterEditLayout->addWidget( textLabel2, 4, 1 ); + + ckBreakEnd = new QCheckBox( this, "ckBreakEnd" ); + + chapterEditLayout->addMultiCellWidget( ckBreakEnd, 5, 5, 2, 3 ); + + twend = new KTimeWidget( this, "twend" ); + twend->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, twend->sizePolicy().hasHeightForWidth() ) ); + + chapterEditLayout->addWidget( twend, 4, 2 ); + spacer3 = new QSpacerItem( 20, 31, QSizePolicy::Minimum, QSizePolicy::Fixed ); + chapterEditLayout->addItem( spacer3, 3, 2 ); + + layout3 = new QGridLayout( 0, 1, 1, 0, 6, "layout3"); + + lPosition = new QLabel( this, "lPosition" ); + lPosition->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, lPosition->sizePolicy().hasHeightForWidth() ) ); + + layout3->addWidget( lPosition, 1, 1 ); + + slider = new QSlider( this, "slider" ); + slider->setOrientation( QSlider::Horizontal ); + + layout3->addWidget( slider, 1, 0 ); + + image = new QLabel( this, "image" ); + image->setMinimumSize( QSize( 320, 200 ) ); + image->setPaletteBackgroundColor( QColor( 0, 0, 0 ) ); + image->setScaledContents( TRUE ); + + layout3->addMultiCellWidget( image, 0, 0, 0, 1 ); + + chapterEditLayout->addMultiCellLayout( layout3, 0, 6, 0, 0 ); + + bEnd = new KPushButton( this, "bEnd" ); + bEnd->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bEnd->sizePolicy().hasHeightForWidth() ) ); + + chapterEditLayout->addWidget( bEnd, 4, 3 ); + + bTitleButton = new QPushButton( this, "bTitleButton" ); + bTitleButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bTitleButton->sizePolicy().hasHeightForWidth() ) ); + + chapterEditLayout->addWidget( bTitleButton, 7, 0 ); + languageChange(); + resize( QSize(627, 300).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( urFile, SIGNAL( urlSelected(const QString&) ), this, SLOT( urlSelected(const QString&) ) ); + connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); + connect( slider, SIGNAL( valueChanged(int) ), this, SLOT( sliderChanged() ) ); + connect( bStart, SIGNAL( clicked() ), this, SLOT( bStartClick() ) ); + connect( bEnd, SIGNAL( clicked() ), this, SLOT( bEndClick() ) ); + connect( twstart, SIGNAL( valueChanged(const QTime&) ), this, SLOT( startChanged(const QTime&) ) ); + connect( twend, SIGNAL( valueChanged(const QTime&) ), this, SLOT( endChanged(const QTime&) ) ); + connect( ckBreakEnd, SIGNAL( clicked() ), this, SLOT( ckBreakEndClick() ) ); + connect( ckBreakStart, SIGNAL( clicked() ), this, SLOT( ckBreakStartClick() ) ); + connect( bTitleButton, SIGNAL( clicked() ), this, SLOT( bTitleButtonClick() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +chapterEdit::~chapterEdit() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void chapterEdit::languageChange() +{ + setCaption( tr2i18n( "Chapter properties" ) ); + textLabel1->setText( tr2i18n( "start" ) ); + textLabel3->setText( tr2i18n( "video" ) ); + urFile->setFilter( tr2i18n( "*.avi\n" +"*.mpeg" ) ); + bStart->setText( tr2i18n( "set Current Frame" ) ); + ckBreakStart->setText( tr2i18n( "break continuity" ) ); + textLabel2->setText( tr2i18n( "end" ) ); + ckBreakEnd->setText( tr2i18n( "break continuity" ) ); + lPosition->setText( tr2i18n( "--:--:--" ) ); + bEnd->setText( tr2i18n( "set Current Frame" ) ); + bTitleButton->setText( tr2i18n( "set Title button" ) ); +} + +void chapterEdit::urlSelected(const QString&) +{ + qWarning( "chapterEdit::urlSelected(const QString&): Not implemented yet" ); +} + +void chapterEdit::sliderReleased() +{ + qWarning( "chapterEdit::sliderReleased(): Not implemented yet" ); +} + +void chapterEdit::sliderChanged() +{ + qWarning( "chapterEdit::sliderChanged(): Not implemented yet" ); +} + +void chapterEdit::bStartClick() +{ + qWarning( "chapterEdit::bStartClick(): Not implemented yet" ); +} + +void chapterEdit::startChanged(const QTime&) +{ + qWarning( "chapterEdit::startChanged(const QTime&): Not implemented yet" ); +} + +void chapterEdit::endChanged(const QTime&) +{ + qWarning( "chapterEdit::endChanged(const QTime&): Not implemented yet" ); +} + +void chapterEdit::bEndClick() +{ + qWarning( "chapterEdit::bEndClick(): Not implemented yet" ); +} + +void chapterEdit::ckBreakStartClick() +{ + qWarning( "chapterEdit::ckBreakStartClick(): Not implemented yet" ); +} + +void chapterEdit::ckBreakEndClick() +{ + qWarning( "chapterEdit::ckBreakEndClick(): Not implemented yet" ); +} + +void chapterEdit::bTitleButtonClick() +{ + qWarning( "chapterEdit::bTitleButtonClick(): Not implemented yet" ); +} + +#include "chapterEdit.moc" diff --git a/k9author/chapterEdit.ui b/k9author/chapterEdit.ui new file mode 100644 index 0000000..d61622b --- /dev/null +++ b/k9author/chapterEdit.ui @@ -0,0 +1,359 @@ + +chapterEdit + + + chapterEdit + + + + 0 + 0 + 627 + 300 + + + + + 5 + 5 + 0 + 0 + + + + Chapter properties + + + + unnamed + + + + twstart + + + + 0 + 0 + 0 + 0 + + + + + + textLabel1 + + + start + + + + + textLabel3 + + + video + + + + + urFile + + + + 1 + 5 + 0 + 0 + + + + + 200 + 0 + + + + *.avi +*.mpeg + + + + + bStart + + + + 0 + 0 + 0 + 0 + + + + set Current Frame + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 16 + 20 + + + + + + ckBreakStart + + + break continuity + + + + + spacer1 + + + Vertical + + + Expanding + + + + 21 + 60 + + + + + + textLabel2 + + + end + + + + + ckBreakEnd + + + break continuity + + + + + twend + + + + 0 + 0 + 0 + 0 + + + + + + spacer3 + + + Vertical + + + Fixed + + + + 20 + 31 + + + + + + layout3 + + + + unnamed + + + + lPosition + + + + 0 + 0 + 0 + 0 + + + + --:--:-- + + + + + slider + + + Horizontal + + + + + image + + + + 320 + 200 + + + + + 0 + 0 + 0 + + + + true + + + + + + + bEnd + + + + 0 + 0 + 0 + 0 + + + + set Current Frame + + + + + bTitleButton + + + + 0 + 0 + 0 + 0 + + + + set Title button + + + + + + + urFile + urlSelected(const QString&) + chapterEdit + urlSelected(const QString&) + + + slider + sliderReleased() + chapterEdit + sliderReleased() + + + slider + valueChanged(int) + chapterEdit + sliderChanged() + + + bStart + clicked() + chapterEdit + bStartClick() + + + bEnd + clicked() + chapterEdit + bEndClick() + + + twstart + valueChanged(const QTime&) + chapterEdit + startChanged(const QTime&) + + + twend + valueChanged(const QTime&) + chapterEdit + endChanged(const QTime&) + + + ckBreakEnd + clicked() + chapterEdit + ckBreakEndClick() + + + ckBreakStart + clicked() + chapterEdit + ckBreakStartClick() + + + bTitleButton + clicked() + chapterEdit + bTitleButtonClick() + + + + urlSelected( const QString &) + sliderReleased() + sliderChanged() + bStartClick() + startChanged(const QTime &) + endChanged(const QTime &) + bEndClick() + ckBreakStartClick() + ckBreakEndClick() + bTitleButtonClick() + + + + ktimewidget.h + kurlrequester.h + klineedit.h + kpushbutton.h + kpushbutton.h + ktimewidget.h + kpushbutton.h + + diff --git a/k9author/import.cpp b/k9author/import.cpp new file mode 100644 index 0000000..b81705a --- /dev/null +++ b/k9author/import.cpp @@ -0,0 +1,130 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './import.ui' +** +** Created: dim. oct. 26 08:56:28 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "import.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kcombobox.h" +#include "kselect.h" + +/* + * Constructs a import as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +import::import( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "import" ); + importLayout = new QGridLayout( this, 1, 1, 11, 6, "importLayout"); + + textLabel1 = new QLabel( this, "textLabel1" ); + textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) ); + + importLayout->addWidget( textLabel1, 0, 0 ); + + layout2 = new QGridLayout( 0, 1, 1, 0, 6, "layout2"); + + lvDVD = new QListView( this, "lvDVD" ); + lvDVD->addColumn( tr2i18n( "Video files" ) ); + lvDVD->header()->setClickEnabled( FALSE, lvDVD->header()->count() - 1 ); + lvDVD->addColumn( tr2i18n( "..." ) ); + lvDVD->header()->setClickEnabled( FALSE, lvDVD->header()->count() - 1 ); + lvDVD->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, lvDVD->sizePolicy().hasHeightForWidth() ) ); + lvDVD->setMinimumSize( QSize( 0, 200 ) ); + lvDVD->setRootIsDecorated( FALSE ); + lvDVD->setResizeMode( QListView::AllColumns ); + + layout2->addMultiCellWidget( lvDVD, 0, 1, 0, 0 ); + + importLayout->addMultiCellLayout( layout2, 1, 1, 0, 3 ); + + cbOutputDev = new KComboBox( FALSE, this, "cbOutputDev" ); + + importLayout->addWidget( cbOutputDev, 0, 1 ); + + cbFormat = new QComboBox( FALSE, this, "cbFormat" ); + cbFormat->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, cbFormat->sizePolicy().hasHeightForWidth() ) ); + + importLayout->addWidget( cbFormat, 0, 2 ); + + lTotal = new QLabel( this, "lTotal" ); + lTotal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, lTotal->sizePolicy().hasHeightForWidth() ) ); + + importLayout->addWidget( lTotal, 2, 3 ); + + gsTotal = new KGradientSelector( this, "gsTotal" ); + gsTotal->setEnabled( FALSE ); + gsTotal->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, gsTotal->sizePolicy().hasHeightForWidth() ) ); + gsTotal->setMaximumSize( QSize( 32767, 13 ) ); + gsTotal->setValue( 0 ); + gsTotal->setMaxValue( 180 ); + gsTotal->setFirstColor( QColor( 255, 77, 6 ) ); + gsTotal->setSecondColor( QColor( 85, 255, 0 ) ); + + importLayout->addMultiCellWidget( gsTotal, 2, 2, 0, 2 ); + languageChange(); + resize( QSize(524, 416).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( lvDVD, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( lvDVDItemSelected(QListViewItem*) ) ); + connect( cbFormat, SIGNAL( activated(const QString&) ), this, SLOT( cbFormatActivated(const QString&) ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +import::~import() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void import::languageChange() +{ + setCaption( tr2i18n( "import" ) ); + textLabel1->setText( tr2i18n( "Output" ) ); + lvDVD->header()->setLabel( 0, tr2i18n( "Video files" ) ); + lvDVD->header()->setLabel( 1, tr2i18n( "..." ) ); + cbFormat->clear(); + cbFormat->insertItem( tr2i18n( "PAL" ) ); + cbFormat->insertItem( tr2i18n( "NTSC" ) ); + lTotal->setText( tr2i18n( "--:--:--" ) ); +} + +void import::lvDVDItemSelected(QListViewItem*) +{ + qWarning( "import::lvDVDItemSelected(QListViewItem*): Not implemented yet" ); +} + +void import::bAddClick() +{ + qWarning( "import::bAddClick(): Not implemented yet" ); +} + +void import::cbFormatActivated(const QString&) +{ + qWarning( "import::cbFormatActivated(const QString&): Not implemented yet" ); +} + +#include "import.moc" diff --git a/k9author/import.ui b/k9author/import.ui new file mode 100644 index 0000000..fc42a9e --- /dev/null +++ b/k9author/import.ui @@ -0,0 +1,207 @@ + +import + + + import + + + + 0 + 0 + 524 + 416 + + + + import + + + + unnamed + + + + textLabel1 + + + + 0 + 5 + 0 + 0 + + + + Output + + + + + layout2 + + + + unnamed + + + + + Video files + + + false + + + true + + + + + ... + + + false + + + true + + + + lvDVD + + + + 7 + 7 + 0 + 0 + + + + + 0 + 200 + + + + false + + + AllColumns + + + + + + + cbOutputDev + + + + + + PAL + + + + + NTSC + + + + cbFormat + + + + 0 + 0 + 0 + 0 + + + + + + lTotal + + + + 0 + 0 + 0 + 0 + + + + --:--:-- + + + + + gsTotal + + + false + + + + 5 + 0 + 0 + 0 + + + + + 32767 + 13 + + + + 0 + + + 180 + + + + 255 + 77 + 6 + + + + + 85 + 255 + 0 + + + + + + + + lvDVD + selectionChanged(QListViewItem*) + import + lvDVDItemSelected(QListViewItem*) + + + cbFormat + activated(const QString&) + import + cbFormatActivated(const QString&) + + + + lvDVDItemSelected(QListViewItem *) + bAddClick() + cbFormatActivated(const QString &) + + + + kcombobox.h + kselect.h + + diff --git a/k9author/k9avidecode.cpp b/k9author/k9avidecode.cpp new file mode 100644 index 0000000..1ef120d --- /dev/null +++ b/k9author/k9avidecode.cpp @@ -0,0 +1,265 @@ +// +// C++ Implementation: k9avidecode +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9avidecode.h" + +#ifdef OLD_FFMPEG +#include +#endif +#ifdef NEW_FFMPEG +#include +#endif + +#include +#include +#include +#include +#include "ac.h" + +void *CodecHandle=0; +void *FormatHandle=0; +int glibref=0; + +k9AviDecode::k9AviDecode(QObject *parent, const char *name) + : QObject(parent, name) { + if (glibref==0) { + CodecHandle=dlopen("libavcodec.so",RTLD_LAZY | RTLD_GLOBAL); + FormatHandle=dlopen("libavformat.so",RTLD_LAZY | RTLD_GLOBAL); + } + if (!CodecHandle) { + m_error =i18n("Cannot open then library %1").arg("libavcodec"); + return; + } + if (!FormatHandle) { + m_error =i18n("Cannot open then library %1").arg("libavformat"); + return; + } + m_error=""; + av_register_all = (av_register_all_t)dlsym(FormatHandle,"av_register_all"); + av_open_input_file = (av_open_input_file_t)dlsym(FormatHandle,"av_open_input_file"); + av_find_stream_info = (av_find_stream_info_t)dlsym(FormatHandle,"av_find_stream_info"); + avcodec_find_decoder =(avcodec_find_decoder_t) dlsym(CodecHandle,"avcodec_find_decoder"); + avcodec_open = (avcodec_open_t)dlsym(CodecHandle,"avcodec_open"); + avcodec_alloc_frame = (avcodec_alloc_frame_t)dlsym(CodecHandle,"avcodec_alloc_frame"); + avpicture_get_size = (avpicture_get_size_t)dlsym(CodecHandle,"avpicture_get_size"); + av_malloc = (av_malloc_t)dlsym(CodecHandle,"av_malloc"); + avpicture_fill = (avpicture_fill_t)dlsym(CodecHandle,"avpicture_fill"); + av_read_frame = (av_read_frame_t)dlsym(FormatHandle,"av_read_frame"); + avcodec_decode_video = (avcodec_decode_video_t)dlsym(CodecHandle,"avcodec_decode_video"); + img_convert = (img_convert_t)dlsym(CodecHandle,"img_convert"); + av_free = (av_free_t)dlsym(CodecHandle,"av_free"); + avcodec_close = (avcodec_close_t)dlsym(FormatHandle,"avcodec_close"); + av_close_input_file = (av_close_input_file_t)dlsym(FormatHandle,"av_close_input_file"); + av_seek_frame=(av_seek_frame_t)dlsym(FormatHandle,"av_seek_frame"); + av_rescale_q=(av_rescale_q_t)dlsym(FormatHandle,"av_rescale_q"); + avcodec_flush_buffers=(avcodec_flush_buffers_t)dlsym(CodecHandle,"avcodec_flush_buffers"); + + av_gettime=(av_gettime_t)dlsym(FormatHandle,"av_gettime"); + av_register_all(); + m_opened=false; + + glibref++; +} + + +k9AviDecode::~k9AviDecode() { + if (m_opened) + close(); + glibref--; + if (glibref==0) { + dlclose(FormatHandle); + dlclose(CodecHandle); + } + +} + + +#include "k9avidecode.moc" + + +bool k9AviDecode::open(const QString & _fileName) { + m_error=""; + if (m_opened) + close(); + + // Open video file + if (av_open_input_file(&m_FormatCtx, _fileName.utf8(), NULL, 0, NULL)!=0) { + m_error=i18n("Couldn't open the file %1").arg(_fileName); + return false; // Couldn't open file} + } +// Retrieve stream information + if (av_find_stream_info(m_FormatCtx)<0) { + m_error =i18n("Couldn't find stream information"); + return false; // Couldn't find stream information + } + int i; + +// Find the first video stream + m_videoStream=-1; + for (i=0; inb_streams; i++) + if (m_FormatCtx->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO) { + m_videoStream=i; + break; + } + if (m_videoStream==-1) { + m_error=i18n("The file doesn't contain any video stream"); + return false; // Didn't find a video stream + } + + // Get a pointer to the codec context for the video stream + m_CodecCtx=m_FormatCtx->streams[m_videoStream]->codec; + + +// Find the decoder for the video stream + m_Codec=avcodec_find_decoder(m_CodecCtx->codec_id); + if (m_Codec==NULL) { + m_error=i18n("Unsupported codec"); + return false; // Codec not found + } +// Open codec + if (avcodec_open(m_CodecCtx, m_Codec)<0) { + m_error =i18n("Could'nt open the codec"); + return false; // Could not open codec + } + + +// Allocate video frame + m_Frame=avcodec_alloc_frame(); + +// Allocate an AVFrame structure + m_FrameRGB=avcodec_alloc_frame(); + if (m_FrameRGB==NULL) { + m_error =i18n ("Unable to allocate memory for frames"); + return false; + } + + + int numBytes; +// Determine required buffer size and allocate buffer + numBytes=avpicture_get_size(PIX_FMT_RGB24, m_CodecCtx->width, + m_CodecCtx->height); + m_buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); + +// Assign appropriate parts of buffer to image planes in pFrameRGB +// Note that pFrameRGB is an AVFrame, but AVFrame is a superset +// of AVPicture + avpicture_fill((AVPicture *)m_FrameRGB, m_buffer, PIX_FMT_RGB24, + m_CodecCtx->width, m_CodecCtx->height); + + m_duration=(double)m_FormatCtx->duration / AV_TIME_BASE; + m_opened=true; + m_fileName=_fileName; + return true; +} + +void k9AviDecode::seek(double _seconds) { + AVRational time_base = m_FormatCtx->streams[m_videoStream]->time_base; + int64_t fspos = (int64_t)(_seconds * AV_TIME_BASE); + fspos=av_rescale_q(fspos, AV_TIME_BASE_Q, time_base); + int i=av_seek_frame(m_FormatCtx, m_videoStream, fspos, AVSEEK_FLAG_BACKWARD ); + double pos=av_gettime() / 1000000; +} + +void k9AviDecode::readFrame(double _seconds) { + AVRational time_base = m_FormatCtx->streams[m_videoStream]->time_base; + int64_t fspos = (int64_t)(_seconds * AV_TIME_BASE); + fspos=av_rescale_q(fspos, AV_TIME_BASE_Q, time_base); + int res=av_seek_frame(m_FormatCtx, m_videoStream, fspos, AVSEEK_FLAG_BACKWARD ); + avcodec_flush_buffers(m_CodecCtx); + int frameFinished=0; + AVPacket packet; + + bool bFound=false; + while (av_read_frame(m_FormatCtx, &packet)>=0 && !bFound) { + // Is this a packet from the video stream? + if (packet.stream_index==m_videoStream) { + // Decode video frame + avcodec_decode_video(m_CodecCtx, m_Frame, &frameFinished, + packet.data, packet.size); + + // Did we get a video frame? + if (frameFinished) { +// if (m_Frame->pts >=fspos) + int64_t cur_dts=fspos; + if (m_FormatCtx->cur_st) + cur_dts= m_FormatCtx->cur_st->cur_dts; + if (cur_dts >=fspos) { + bFound=true; + // Convert the image from its native format to RGB + img_convert((AVPicture *)m_FrameRGB, PIX_FMT_RGB24, + (AVPicture*)m_Frame, m_CodecCtx->pix_fmt, + m_CodecCtx->width, m_CodecCtx->height); + + // convert frame to QImage + SaveFrame(m_FrameRGB, m_CodecCtx->width, + m_CodecCtx->height); + } + } + } + + // Free the packet that was allocated by av_read_frame + av_free_packet(&packet); + } + +} + +void k9AviDecode::SaveFrame(AVFrame *pFrame, int width, int height) { + QImage pix; + int len =(int) (3*width*height); + char c[255]; + // Write header + sprintf(c,"P6\n%d %d\n255\n", width, height); + char *s= (char*) malloc(len+strlen(c)); + tc_memcpy(s,c,strlen(c)); + tc_memcpy(s+strlen(c),pFrame->data[0], len); + pix.loadFromData((uchar*)s,strlen(c)+len); + free(s); + emit drawFrame( &pix); + +} + +void k9AviDecode::close() { + if (m_opened) { + // Free the RGB image + av_free(m_buffer); + av_free(m_FrameRGB); + + // Free the YUV frame + av_free(m_Frame); + + // Close the codec + avcodec_close(m_CodecCtx); + + // Close the video file + av_close_input_file(m_FormatCtx); + m_opened=false; + } +} + + +double k9AviDecode::getDuration() const { + return m_duration; +} + + +bool k9AviDecode::opened() const { + return m_opened; +} + + +QString k9AviDecode::getFileName() const { + return m_fileName; +} + + +QString k9AviDecode::getError() const { + return m_error; +} diff --git a/k9author/k9avidecode.h b/k9author/k9avidecode.h new file mode 100644 index 0000000..53f6029 --- /dev/null +++ b/k9author/k9avidecode.h @@ -0,0 +1,112 @@ +// +// C++ Interface: k9avidecode +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9AVIDECODE_H +#define K9AVIDECODE_H + +#include "k9common.h" +#include +#ifdef OLD_FFMPEG +#include +#endif +#ifdef NEW_FFMPEG +#include +#endif + + +#include + +/** + @author Jean-Michel PETIT +*/ + + +//typedef dvd_file_t * (*DVDOpenFile_t) ( dvd_reader_t *, int, dvd_read_domain_t ); +typedef void (*av_register_all_t) (void); +typedef int64_t (*av_gettime_t) (void); +typedef int (*av_open_input_file_t)(AVFormatContext **, const char *,AVInputFormat *,int, AVFormatParameters *); +typedef int (*av_find_stream_info_t)(AVFormatContext *); +typedef AVCodec* (*avcodec_find_decoder_t)(enum CodecID); +typedef int (*avcodec_open_t)(AVCodecContext *, AVCodec *); +typedef AVFrame * (*avcodec_alloc_frame_t)(void); + +typedef int (*avpicture_get_size_t)(int , int , int ); +typedef void * (*av_malloc_t)(unsigned int ); +typedef int (*avpicture_fill_t)(AVPicture *, uint8_t *,int , int , int); +typedef int (*av_read_frame_t)(AVFormatContext *, AVPacket *); + +typedef int (*avcodec_decode_video_t)(AVCodecContext *, AVFrame *,int *, uint8_t *, int ); +typedef int (*img_convert_t)(AVPicture *, int , const AVPicture *, int ,int, int); +typedef void (*av_free_t)(void *); +typedef int (*avcodec_close_t)(AVCodecContext *); +typedef void (*av_close_input_file_t)(AVFormatContext *); +typedef int (*av_seek_frame_t)(AVFormatContext *,int,int64_t timestamp,int flags); typedef int64_t (*av_rescale_q_t)(int64_t , AVRational , AVRational ) ; +typedef void (*avcodec_flush_buffers_t)(AVCodecContext *); + + + + +class k9AviDecode : public QObject +{ +Q_OBJECT +public: + k9AviDecode(QObject *parent = 0, const char *name = 0); + + ~k9AviDecode(); + bool open(const QString & _fileName); + void readFrame(double _seconds); + void seek(double _seconds); + void close(); + double getDuration() const; + bool opened() const; + + QString getFileName() const; + + QString getError() const; + +private: + av_register_all_t av_register_all; + av_open_input_file_t av_open_input_file; + av_find_stream_info_t av_find_stream_info; + avcodec_find_decoder_t avcodec_find_decoder; + avcodec_open_t avcodec_open; + avcodec_alloc_frame_t avcodec_alloc_frame; + av_seek_frame_t av_seek_frame; + avpicture_get_size_t avpicture_get_size; + av_malloc_t av_malloc; + avpicture_fill_t avpicture_fill; + av_read_frame_t av_read_frame; + avcodec_decode_video_t avcodec_decode_video; + img_convert_t img_convert; + av_free_t av_free; + avcodec_close_t avcodec_close; + av_close_input_file_t av_close_input_file; + av_rescale_q_t av_rescale_q; + av_gettime_t av_gettime; + avcodec_flush_buffers_t avcodec_flush_buffers; + + + AVFormatContext *m_FormatCtx; + AVCodecContext *m_CodecCtx; + AVCodec *m_Codec; + AVFrame *m_Frame,*m_FrameRGB; + uint8_t *m_buffer; + int m_videoStream; + bool m_opened; + double m_duration; + QString m_fileName; + QString m_error; + void SaveFrame(AVFrame *pFrame, int width, int height); +signals: + void drawFrame(QImage*); +}; + +#endif diff --git a/k9author/k9avifile.cpp b/k9author/k9avifile.cpp new file mode 100644 index 0000000..1ace5f6 --- /dev/null +++ b/k9author/k9avifile.cpp @@ -0,0 +1,185 @@ +// +// C++ Implementation: k9avifile +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9common.h" +#include "k9avifile.h" +#include "k9title.h" + +k9AviFile::k9AviFile(k9Title *parent, const char *name) + : QObject(parent, name) +{ + m_num=parent->getFiles()->count(); + setTitle(parent); + m_previous=NULL; + m_next=NULL; + m_breakNext=false; + m_breakPrevious=false; +} + + +k9AviFile::~k9AviFile() +{ +} + + +#include "k9avifile.moc" + + +QString k9AviFile::getFileName() const +{ + return m_fileName; +} + + +void k9AviFile::setFileName ( const QString& _value ) +{ + m_fileName = _value; + emit aviFileUpdated (this); +} + + +QTime k9AviFile::getStart() const +{ + return m_start; +} + + +void k9AviFile::setStart ( const QTime& _value ) +{ + m_start = _value; + emit aviFileUpdated (this); +} + + +QTime k9AviFile::getEnd() const +{ + return m_end; +} + + +void k9AviFile::setEnd ( const QTime& _value ) +{ + m_end = _value; + emit aviFileUpdated (this); +} + + +QString k9AviFile::getLabel() const +{ + return m_label; +} + + +void k9AviFile::setLabel ( const QString& _value ) +{ + m_label = _value; + emit aviFileUpdated (this); +} + + +k9Title* k9AviFile::getTitle() const +{ + return m_title; +} + + +void k9AviFile::setTitle ( k9Title* _value ) +{ + m_title = _value; + m_title->getFiles()->append(this); + m_title->getFiles()->sort(); +} + + +int k9AviFile::getNum() const +{ + return m_num; +} + + + + +k9AviFile* k9AviFile::getPrevious() const +{ + return m_previous; +} + + +void k9AviFile::setPrevious ( k9AviFile* _value ) +{ + m_previous = _value; + m_breakPrevious=false; +} + + +k9AviFile* k9AviFile::getNext() const +{ + return m_next; +} + + +void k9AviFile::setNext ( k9AviFile* _value ) +{ + m_next = _value; + m_breakPrevious=false; +} + +void k9AviFile::setBreakPrevious(bool _state) { + m_breakPrevious=_state; + if ( ! _state){ + if (m_previous !=NULL) { + m_previous->setEnd(this->getStart()); + m_previous->m_breakNext=false; + } + } else { + if (m_previous!=NULL) { + m_previous ->m_breakNext=true; + } + } + +} + +bool k9AviFile::getBreakPrevious() { + return m_breakPrevious; +} + +void k9AviFile::setBreakNext(bool _state) { + m_breakNext=_state; + if ( ! _state){ + if (m_next !=NULL) { + m_next->setStart(this->getEnd()); + m_next->m_breakPrevious=false; + } + } else { + if (m_next!=NULL) { + m_next ->m_breakPrevious=true; + } + } + + +} + +bool k9AviFile::getBreakNext() { + return m_breakNext; +} + + + +QImage k9AviFile::getImage() const { + return m_image; +} + + +void k9AviFile::setImage(const QImage& _value) { + m_image = _value; + emit aviFileUpdated (this); + emit imageChanged(_value); +} diff --git a/k9author/k9avifile.h b/k9author/k9avifile.h new file mode 100644 index 0000000..83a6f17 --- /dev/null +++ b/k9author/k9avifile.h @@ -0,0 +1,80 @@ +// +// C++ Interface: k9avifile +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9AVIFILE_H +#define K9AVIFILE_H + +#include +#include +#include + +/** + @author Jean-Michel PETIT +*/ +class k9Title; +class k9AviFile : public QObject +{ +Q_OBJECT +public: + k9AviFile(k9Title *parent = 0, const char *name = 0); + + ~k9AviFile(); + + void setFileName ( const QString& _value ); + QString getFileName() const; + + void setStart ( const QTime& _value ); + QTime getStart() const; + + void setEnd ( const QTime& _value ); + QTime getEnd() const; + + void setLabel ( const QString& _value ); + QString getLabel() const; + + k9Title* getTitle() const; + + int getNum() const; + + void setPrevious ( k9AviFile* _value ); + k9AviFile* getPrevious() const; + + void setNext ( k9AviFile* _value ); + k9AviFile* getNext() const; + + void setBreakPrevious(bool _state); + bool getBreakPrevious(); + + void setBreakNext(bool _state); + bool getBreakNext(); + + void setImage(const QImage& _value); + QImage getImage() const; + + +private: + QString m_fileName; + QTime m_start; + QString m_label; + QTime m_end; + k9Title *m_title; + QImage m_image; + int m_num; + bool m_breakNext,m_breakPrevious; + k9AviFile *m_previous; + k9AviFile *m_next; + void setTitle ( k9Title* _value ); +signals: + void aviFileUpdated(k9AviFile *_aviFile); + void imageChanged(const QImage &); +}; + +#endif diff --git a/k9author/k9canvasselection.cpp b/k9author/k9canvasselection.cpp new file mode 100644 index 0000000..8b9d72f --- /dev/null +++ b/k9author/k9canvasselection.cpp @@ -0,0 +1,330 @@ +// // +// C++ Implementation: k9canvasselection +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9canvasselection.h" +#include "k9menubutton.h" + +k9CanvasSelectionRedim::k9CanvasSelectionRedim (ePosition _position,int _x,int _y,int _w,int _h,QCanvas *canvas,k9CanvasSelection *selection):QCanvasRectangle(_x,_y,_w,_h,canvas) { + m_position=_position; + m_selection=selection; +} + +void k9CanvasSelectionRedim::moveBy(double _x,double _y) { + m_offsetX=_x; + m_offsetY=_y; + QCanvasRectangle::moveBy(_x,_y); +} + +void k9CanvasSelectionRedim::updateSelection() { + int w,h; + int w1=m_selection->getWidth(); + int h1=m_selection->getHeight(); + int x1=m_selection->getLeft(); + int y1=m_selection->getTop(); + switch (m_position) { + case RedimTopLeft: + w=m_selection->getWidth()-m_offsetX; + h=m_selection->getHeight()-m_offsetY; + if (m_selection->canScale(-m_offsetX,-m_offsetY)) { + m_selection->setWidth(w); + m_selection->setHeight(h); + m_selection->moveBy(m_offsetX,m_offsetY); + } + break; + case RedimMiddleRight : + w= m_selection->getWidth()+ m_offsetX; + if (m_selection->canScale(m_offsetX,0)) + m_selection->setWidth(w); + break; + case RedimTopMiddle: + h=m_selection->getHeight()-m_offsetY; + if (m_selection->canScale(0,-m_offsetY)) { + m_selection->setHeight(h); + m_selection->moveBy(0,m_offsetY); + } + break; + case RedimTopRight: + h=m_selection->getHeight()-m_offsetY; + w=m_selection->getWidth()+ m_offsetX; + if (m_selection->canScale(m_offsetX,-m_offsetY)) { + m_selection->setHeight(h); + m_selection->setWidth( w); + m_selection->moveBy(0,m_offsetY); + } + break; + case RedimMiddleLeft: + w=m_selection->getWidth()-m_offsetX; + if (m_selection->canScale(-m_offsetX,0)) { + m_selection->setWidth(w); + m_selection->moveBy(m_offsetX,0); + } + break; + case RedimBottomLeft: + w=m_selection->getWidth()-m_offsetX; + h=m_selection->getHeight()+m_offsetY; + if (m_selection->canScale(-m_offsetX,+m_offsetY)) { + m_selection->setWidth(w); + m_selection->setHeight(h); + m_selection->moveBy(m_offsetX,0); + } + break; + case RedimBottomMiddle: + h=m_selection->getHeight()+m_offsetY; + if (m_selection->canScale(0,+m_offsetY)) + m_selection->setHeight(h); + break; + + case RedimBottomRight: + w=m_selection->getWidth()+m_offsetX; + h=m_selection->getHeight()+m_offsetY; + if (m_selection->canScale(+m_offsetX,+m_offsetY)) { + m_selection->setWidth(w); + m_selection->setHeight(h); + } + break; + } + m_selection->scale(m_selection->getLeft()-x1,m_selection->getTop()-y1, m_selection->getWidth()-w1,m_selection->getHeight()-h1); + m_selection->update(); + +} + + +k9CanvasSelection::k9CanvasSelection(k9MenuEditor *_editor) + : QObject(_editor) { + m_rect=NULL; + m_editor=_editor; +} + + +k9CanvasSelection::~k9CanvasSelection() {} + +void k9CanvasSelection::setPosition(QPoint _p) { + if (m_rect==NULL) { + QCanvas *m_canvas=m_editor->canvas(); + m_rect=new QCanvasRectangle(m_editor->canvas()); + QBrush brush(Qt::green); + m_rm=new k9CanvasSelectionRedim(k9CanvasSelectionRedim::RedimMiddleRight,0,0,10,10,m_canvas,this); + m_rm->setPen(Qt::black); + m_rm->setBrush(brush); + + m_lt=new k9CanvasSelectionRedim(k9CanvasSelectionRedim::RedimTopLeft,0,0,10,10,m_canvas,this); + m_lt->setPen(Qt::black); + m_lt->setBrush(brush); + + m_mt=new k9CanvasSelectionRedim(k9CanvasSelectionRedim::RedimTopMiddle,0,0,10,10,m_canvas,this); + m_mt->setPen(Qt::black); + m_mt->setBrush(brush); + + m_mt=new k9CanvasSelectionRedim(k9CanvasSelectionRedim::RedimTopMiddle,0,0,10,10,m_canvas,this); + m_mt->setPen(Qt::black); + m_mt->setBrush(brush); + + m_rt=new k9CanvasSelectionRedim(k9CanvasSelectionRedim::RedimTopRight,0,0,10,10,m_canvas,this); + m_rt->setPen(Qt::black); + m_rt->setBrush(brush); + + m_lm=new k9CanvasSelectionRedim(k9CanvasSelectionRedim::RedimMiddleLeft,0,0,10,10,m_canvas,this); + m_lm->setPen(Qt::black); + m_lm->setBrush(brush); + + m_lb=new k9CanvasSelectionRedim(k9CanvasSelectionRedim::RedimBottomLeft,0,0,10,10,m_canvas,this); + m_lb->setPen(Qt::black); + m_lb->setBrush(brush); + + m_mb=new k9CanvasSelectionRedim(k9CanvasSelectionRedim::RedimBottomMiddle,0,0,10,10,m_canvas,this); + m_mb->setPen(Qt::black); + m_mb->setBrush(brush); + + m_rb=new k9CanvasSelectionRedim(k9CanvasSelectionRedim::RedimBottomRight,0,0,10,10,m_canvas,this); + m_rb->setPen(Qt::black); + m_rb->setBrush(brush); + } else { + m_rect->setCanvas(m_editor->canvas()); + m_lt->setCanvas(m_editor->canvas()); + m_mt->setCanvas(m_editor->canvas()); + m_rt->setCanvas(m_editor->canvas()); + m_lm->setCanvas(m_editor->canvas()); + m_rm->setCanvas(m_editor->canvas()); + m_lb->setCanvas(m_editor->canvas()); + m_mb->setCanvas(m_editor->canvas()); + m_rb->setCanvas(m_editor->canvas()); + ; + } + m_rect->setPen(QPen(Qt::red)); + m_rect->setX(_p.x()); + m_rect->setY(_p.y()); + m_rect->setSize(0,0); + +} + +void k9CanvasSelection::release() { + if (m_rect) { + if (m_editor->getSelection()->count() !=0) { + drawSelection(); + } else { + hide(); + hideRedim(); + } + m_editor->canvas()->update(); + } +} + +void k9CanvasSelection::drawSelection() { + int left=720,top=576,right=0,bottom=0; + QPtrList *selection=m_editor->getSelection(); + + for (k9MenuButton *b=selection->first();b;b=selection->next()) { + left=QMIN(left,b->getLeft()); + top=QMIN(top,b->getTop()); + right=QMAX(right,b->getWidth()+b->getLeft()); + bottom=QMAX(bottom,b->getTop()+b->getHeight()); + } + m_rect->setX(left-2); + m_rect->setY(top-2); + m_rect->setSize(right-left+4,bottom-top+4); + update(); +} + +void k9CanvasSelection::update() { + int x=(int)m_rect->x() -5; + int y=(int)m_rect->y()-5; + int w=getWidth(); + int h=getHeight(); + + int count=m_editor->canvas()->allItems().count(); + + m_lt->move(x,y); + m_lt->setZ(count--); + + m_mt->move(x+w/2,y); + m_mt->setZ(count--); + + m_rt->move(x+w,y); + m_rt->setZ(count--); + + m_lm->move(x,y+h/2); + m_lm->setZ(count--); + + m_rm->move(x+w,y+h/2); + m_rm->setZ(count--); + + m_lb->move(x,y+h); + m_lb->setZ(count--); + + m_mb->move(x+w/2,y+h); + m_mb->setZ(count--); + + m_rb->move(x+w,y+h); + m_rb->setZ(count--); + + m_rect->setZ(count--); + + QCanvasItemList l=m_editor->canvas()->allItems(); + for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + QCanvasItem *item=*it; + if (item != m_rect && item !=m_lt && item !=m_rt && item != m_mt && item !=m_lm && item != m_rm && item != m_lb && item != m_mb && item !=m_rb) + item->setZ(count--); + } + + showRedim(); + show(); +} + +void k9CanvasSelection::scale(int _x,int _y,int _w, int _h) { + QPtrList *buttons=m_editor->getSelection(); + for (k9MenuButton *b=buttons->first();b;b=buttons->next()) { + b->moveBy(_x,_y,false); + if (b->getWidth() + _w >10) + b->setWidth(b->getWidth()+_w,false); + if (b->getHeight() +_h >10) + b->setHeight(b->getHeight()+_h); + } + +} + +bool k9CanvasSelection::canScale(int _w, int _h) { + QPtrList *buttons=m_editor->getSelection(); + for (k9MenuButton *b=buttons->first();b;b=buttons->next()) { + if (b->getWidth() + _w <10) + return false; + if (b->getHeight() +_h <10) + return false; + } + return true; +} + + +void k9CanvasSelection::hide() { + m_rect->hide(); + hideRedim(); +} +void k9CanvasSelection::hideRedim() { + m_lt->hide(); + m_mt->hide(); + m_rt->hide(); + m_lm->hide(); + m_rm->hide(); + m_lb->hide(); + m_mb->hide(); + m_rb->hide(); + +} + +void k9CanvasSelection::show() { + m_rect->show(); +} +void k9CanvasSelection::showRedim() { + m_lt->show(); + m_mt->show(); + m_rt->show(); + m_lm->show(); + m_rm->show(); + m_lb->show(); + m_mb->show(); + m_rb->show(); + +} + + +void k9CanvasSelection::setSize(int _w,int _h) { + m_rect->setSize(_w,_h); +} + +QRect k9CanvasSelection::getRect() { + return m_rect->rect(); + +} + +void k9CanvasSelection::moveBy(int _x,int _y) { + m_rect->moveBy(_x,_y); +} + +int k9CanvasSelection::getWidth() { + return m_rect->width(); +} +void k9CanvasSelection::setWidth(int _w) { + m_rect->setSize(_w,m_rect->height()); +} +int k9CanvasSelection::getHeight() { + return m_rect->height(); +} +void k9CanvasSelection::setHeight(int _h) { + m_rect->setSize(m_rect->width(),_h); +} + +int k9CanvasSelection::getLeft() { + return (int)m_rect->x(); +} +int k9CanvasSelection::getTop() { + return (int)m_rect->y(); +} + +#include "k9canvasselection.moc" diff --git a/k9author/k9canvasselection.h b/k9author/k9canvasselection.h new file mode 100644 index 0000000..e5ff0fb --- /dev/null +++ b/k9author/k9canvasselection.h @@ -0,0 +1,71 @@ +// +// C++ Interface: k9canvasselection +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9CANVASSELECTION_H +#define K9CANVASSELECTION_H + +#include "k9menueditor.h" +#include +/** + @author Jean-Michel PETIT +*/ + +class k9CanvasSelection; +class k9CanvasSelectionRedim : public QCanvasRectangle { +public: + enum ePosition { RedimTopLeft=2002,RedimTopMiddle=2003,RedimTopRight=2004,RedimMiddleLeft=2005,RedimBottomLeft=2006,RedimBottomMiddle=2007,RedimBottomRight=2008,RedimMiddleRight=2009} ; + k9CanvasSelectionRedim (ePosition _position,int _x,int _y,int _w,int _h,QCanvas *canvas,k9CanvasSelection *selection); + void updateSelection(); + virtual int rtti() const { + return m_position; + } + virtual void moveBy(double _x,double _y); +private: + k9CanvasSelection *m_selection; + ePosition m_position; + double m_offsetX,m_offsetY; +}; + + +class k9CanvasSelection : public QObject +{ +Q_OBJECT +public: + k9CanvasSelection(k9MenuEditor *_editor); + + ~k9CanvasSelection(); + void setPosition (QPoint _p); + void release(); + void hide(); + void hideRedim(); + void showRedim(); + void show(); + void setSize(int _w,int _h); + QRect getRect(); + void moveBy(int _x,int _y); + int getWidth(); + void setWidth(int _w); + int getHeight(); + void setHeight(int _h); + int getLeft(); + int getTop(); + void update(); + void scale(int _x,int _y, int _w,int _h); + void drawSelection(); + bool canScale(int _w, int _h); + +private: + k9MenuEditor *m_editor; + QCanvasRectangle *m_rect; + k9CanvasSelectionRedim *m_lt,*m_mt,*m_rt,*m_lm,*m_rm,*m_lb,*m_mb,*m_rb; +}; + +#endif diff --git a/k9author/k9chapteredit.cpp b/k9author/k9chapteredit.cpp new file mode 100644 index 0000000..e199477 --- /dev/null +++ b/k9author/k9chapteredit.cpp @@ -0,0 +1,200 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9chapteredit.h" +#include "k9drawimage.h" +#include +#include +#include +#include +#include +#include +#include +#include "k9title.h" +#include +#include + +k9ChapterEdit::k9ChapterEdit(QWidget* parent, const char* name, WFlags fl) +: chapterEdit(parent,name,fl) +{ + m_wimage=new k9DrawImage(image,0); + QGridLayout *l=new QGridLayout(image,1,1); + l->addWidget(m_wimage,0,0); + m_wimage->setPaletteBackgroundColor(Qt::black); + connect(&m_aviDecode,SIGNAL(drawFrame(QImage*)),this,SLOT(drawImage(QImage*))); + bTitleButton->setIconSet (SmallIcon("frame_image")); + +} + +k9ChapterEdit::~k9ChapterEdit() +{ +} + +/*$SPECIALIZATION$*/ + +void k9ChapterEdit::sliderReleased() { + // m_aviDecode.seek((double)slider->value() / 100); + // m_aviDecode.readFrame(); +} +void k9ChapterEdit::sliderChanged() { + if (m_aviDecode.opened()) { + //m_aviDecode.seek((double)slider->value() / 100); + m_aviDecode.readFrame((double)slider->value() / 1000); + QTime t; + t=t.addMSecs((double)slider->value()); + lPosition->setText(t.toString("hh:mm:ss")); + } +} + + +void k9ChapterEdit::urlSelected(const QString& _fileName) { + m_aviDecode.open(_fileName); + if (!m_noUpdate) { + if (_fileName !=m_aviFile->getFileName()) { + ckBreakEnd->setChecked(false); + ckBreakStart->setChecked(false); + ckBreakEndClick(); + ckBreakStartClick(); + } + m_aviFile->setFileName(_fileName); + } + + QTime t; + int sec=t.msecsTo(m_aviFile->getStart()); + slider->setMaxValue((int)(m_aviDecode.getDuration()*1000)); + + slider->setValue(sec); + +} + +void k9ChapterEdit::drawImage(QImage * _image) { + //QPixmap p(*_image); + //image->setPixmap(p); + m_wimage->setImage(*_image); + m_image=*_image; +} + +void k9ChapterEdit::bStartClick() { + QTime t; + int secs=slider->value()/1000; + t=t.addSecs(secs); + twstart->setTime(t); +} + +void k9ChapterEdit::bEndClick() { + QTime t; + int secs=slider->value()/1000; + t=t.addSecs(secs); + twend->setTime(t); +} + +void k9ChapterEdit::setAviFile(k9AviFile *_aviFile) { + this->setEnabled(_aviFile!=NULL); + m_aviFile=_aviFile; + if (_aviFile) { + m_noUpdate=true; + k9AviFile *p=m_aviFile->getPrevious(); + k9AviFile *n=m_aviFile->getNext(); + m_minTime=m_aviFile->getStart(); + m_maxTime=m_aviFile->getEnd(); + if (p) { + if(p->getFileName() !=_aviFile->getFileName()) { + ckBreakStart->setEnabled(false); + m_minTime.setHMS(0,0,0,0); + } else { + ckBreakStart->setEnabled(true); + m_minTime=p->getStart(); + } + } + if (n) { + if(n->getFileName() !=_aviFile->getFileName()) { + ckBreakEnd->setEnabled(false); + m_maxTime=_aviFile->getEnd(); + } else { + ckBreakEnd->setEnabled(true); + m_maxTime=n->getEnd(); + } + } + + + twstart->setTime(m_aviFile->getStart()); + twend->setTime(m_aviFile->getEnd()); + urFile->setURL(m_aviFile->getFileName()); + urlSelected(m_aviFile->getFileName()); + ckBreakStart->setChecked(m_aviFile->getBreakPrevious()); + ckBreakEnd->setChecked(m_aviFile->getBreakNext()); + } + m_noUpdate=false; + +} + +void k9ChapterEdit::startChanged(const QTime& _time) { + if (!m_noUpdate) { + QTime t=_time; + if (t > m_maxTime ) + t=m_maxTime; + else if (t < m_minTime) + t=m_minTime; + else if (t >m_aviFile->getEnd()) + t=m_aviFile->getEnd(); + if (t!=_time) + twstart->setTime(t); + m_aviFile->setStart(t); + if (!m_aviFile->getBreakPrevious() && m_aviFile->getPrevious()!=NULL) { + m_aviFile->getPrevious()->setEnd(t); + } + QTime t2; + slider->setValue(t2.msecsTo(t)); + m_aviFile->setImage(m_image); + } +} + +void k9ChapterEdit::endChanged(const QTime& _time) { + if (!m_noUpdate) { + QTime t=_time; + if (t > m_maxTime ) + t=m_maxTime; + else if (t < m_minTime) + t=m_minTime; + else if (t getStart()) + t=m_aviFile->getStart(); + if (t!=_time) + twend->setTime(t); + m_aviFile->setEnd(t); + QTime t2; + if (!m_aviFile->getBreakNext() && m_aviFile->getNext()!=NULL) { + QImage i=m_image; + m_aviDecode.readFrame((double)t2.msecsTo(t)/1000.0); + m_aviFile->getNext()->setImage(m_image); + m_image=i; + m_aviFile->getNext()->setStart(t); + } + slider->setValue(t2.msecsTo(t)); + } +} + +void k9ChapterEdit::ckBreakStartClick() { + m_aviFile->setBreakPrevious(ckBreakStart->isOn()); + +} + +void k9ChapterEdit::bTitleButtonClick() { + m_aviFile->getTitle()->getButton()->setImage(m_image); +} + +void k9ChapterEdit::ckBreakEndClick() { + m_aviFile->setBreakNext(ckBreakEnd->isOn()); +} + +#include "k9chapteredit.moc" + diff --git a/k9author/k9chapteredit.h b/k9author/k9chapteredit.h new file mode 100644 index 0000000..87be4f8 --- /dev/null +++ b/k9author/k9chapteredit.h @@ -0,0 +1,60 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9CHAPTEREDIT_H +#define K9CHAPTEREDIT_H + +#include "k9common.h" +#include "../k9author/chapterEdit.h" +#include "k9avidecode.h" +#include "k9avifile.h" + +class k9DrawImage; +class k9ChapterEdit : public chapterEdit +{ + Q_OBJECT + +public: + k9ChapterEdit(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9ChapterEdit(); + /*$PUBLIC_FUNCTIONS$*/ + +public slots: + /*$PUBLIC_SLOTS$*/ +private: + k9AviDecode m_aviDecode; + k9DrawImage *m_wimage; + k9AviFile *m_aviFile; + QTime m_minTime,m_maxTime; + bool m_noUpdate; + QImage m_image; +protected: + /*$PROTECTED_FUNCTIONS$*/ + virtual void sliderReleased(); + virtual void sliderChanged(); + virtual void bStartClick(); + virtual void bEndClick(); + virtual void ckBreakStartClick(); + virtual void ckBreakEndClick(); + virtual void urlSelected(const QString&); + virtual void startChanged(const QTime&); + virtual void endChanged(const QTime&); + virtual void bTitleButtonClick(); +protected slots: + /*$PROTECTED_SLOTS$*/ + void drawImage(QImage *); +public slots: + void setAviFile(k9AviFile *_aviFile); +}; + +#endif + diff --git a/k9author/k9import.cpp b/k9author/k9import.cpp new file mode 100644 index 0000000..774bc8e --- /dev/null +++ b/k9author/k9import.cpp @@ -0,0 +1,250 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9import.h" +#include "k9title.h" +#include "k9avifile.h" +#include "k9lvitemimport.h" +#include +#include "k9menuedit.h" +#include "k9haldevice.h" +#include "k9config.h" +#include "k9burndvd.h" +#include +#include +#include +#include +#include +#include "k9processlist.h" + +k9Import::k9Import(QWidget* parent, const char* name,k9CdDrives *_drives) + : import(parent,name) { + m_parent=(k9Copy*) parent; + drives=_drives; + + connect(&m_newDVD,SIGNAL(sigAddTitle()),this,SLOT(titleAdded())); +} + +k9Import::~k9Import() {} + + + +/*$SPECIALIZATION$*/ + +void k9Import::init() { + m_root=new QListViewItem(lvDVD,i18n("Root Menu")); + m_root->setOpen(true); + m_root->setPixmap(0,SmallIcon("dvd_unmount")); + emit aviFileSelected(NULL); + + connect(drives,SIGNAL(deviceAdded( k9CdDrive*)),this,SLOT(deviceAdded( k9CdDrive* ))); + connect(drives,SIGNAL(deviceRemoved( k9CdDrive*)),this,SLOT(deviceRemoved( k9CdDrive* ))); + + readDrives(); + m_root->setSelected(true); + emit rootSelected(&m_newDVD); + + +} + +void k9Import::readDrives() { + cbOutputDev->clear(); + recorderList.clear(); + cbOutputDev->insertItem(i18n("ISO Image")); + cbOutputDev->insertItem(i18n("Folder")); + + drives->scanDrives(); + +} + +void k9Import::deviceAdded(k9CdDrive *_drive) { + addDrive(_drive); +} + +void k9Import::deviceRemoved(k9CdDrive *_drive) { + + int i=recorderList.find(_drive); + recorderList.remove( i); + cbOutputDev->removeItem(i+2); + +} + +void k9Import::addDrive(k9CdDrive *drive) { +#ifdef HAVE_HAL + if (drive->getDevice()!=NULL) { + k9HalDevice *dev=drive->getDevice(); + connect(dev,SIGNAL(volumeChanged( const QString &,const QString &)),this,SLOT(volumeChanged(const QString&,const QString&))); + } +#endif + if (drive->canWriteDVD) { + cbOutputDev->insertItem(drive->name+ " ("+drive->device+")",-1); + recorderList.append(drive); + } + +} + +void k9Import::volumeChanged(const QString &device,const QString &volumeName) {} + + +#include "k9import.moc" + + + +QListViewItem* k9Import::getRoot() const { + return m_root; +} + + +void k9Import::aviFileUpdated(k9AviFile *_aviFile) { + k9LvItemImport *itemTitle = (k9LvItemImport*)m_root->firstChild(); + while (itemTitle) { + k9LvItemImport *itemChapter = (k9LvItemImport*)itemTitle->firstChild(); + while (itemChapter) { + if (itemChapter->getAviFile()==_aviFile) { + itemChapter->setText(1,_aviFile->getStart().toString("hh:mm:ss") +" - "+_aviFile->getEnd().toString("hh:mm:ss")); + itemChapter->setPixmap(0,QPixmap(_aviFile->getImage().smoothScale(50,40))); + } + itemChapter=(k9LvItemImport*)itemChapter->nextSibling(); + } + itemTitle=(k9LvItemImport*)itemTitle->nextSibling(); + } + updateTotalTime(); +} + +void k9Import::buttonUpdated(k9MenuButton *_button, const QImage &_image) { + k9LvItemImport *itemTitle = (k9LvItemImport*)m_root->firstChild(); + while (itemTitle) { + if (itemTitle->getTitle()->getButton()==_button) { + QImage img=_image.smoothScale(50,40,QImage::ScaleFree); + QPixmap pix(img); + itemTitle->setPixmap(0,pix); + } + itemTitle=(k9LvItemImport*)itemTitle->nextSibling(); + } +} + + + +void k9Import::lvDVDItemSelected (QListViewItem *_item) { + k9LvItemImport *item=(k9LvItemImport*)_item; + + switch (_item->rtti()) { + case 1002: + emit aviFileSelected(item->getAviFile()); + emit titleSelected(item->getTitle()); + break; + case 1001: + emit titleSelected(item->getTitle()); + break; + default: + emit rootSelected(&m_newDVD); + break; + } +} + +void k9Import::setProgressWindow(QWidget *_widget) { + m_toolView=m_parent->setToolWindow(_widget,KDockWidget::DockRight,i18n("processing"),i18n("processing")); + m_dockWidget = m_parent->getVisibleDock(); + m_parent->setActions( false); + m_toolView->show(); +// this->setEnabled(false); + +} + +void k9Import::removeProgressWindow() { + m_parent->setActions(true); + + m_parent->removeToolWindow( m_toolView); + this->setEnabled(true); + if (m_dockWidget!=NULL) + m_dockWidget->changeHideShowState(); +} + +void k9Import::execute() { + QString filename; + k9Config config; + QString outputDir=config.getPrefOutput(); + if (cbOutputDev->currentItem() ==0) { + filename=KFileDialog::getSaveFileName (QDir::homeDirPath(),"*.iso", 0,i18n("Save image to disk")); + if (filename =="") + return; + } else if (cbOutputDev->currentItem()==1) { + outputDir= KFileDialog::getExistingDirectory(QDir::homeDirPath()); + if (outputDir=="") + return; + } + +// k9Progress *progress=new k9Progress(m_parent,0); +// m_newDVD.setProgress(progress); +// setProgressWindow(progress); + k9ProcessList *p=new k9ProcessList(this,0,0); + setProgressWindow(p); + m_newDVD.setProcessList(p); + m_newDVD.setWorkDir(outputDir); + m_newDVD.execute(); + removeProgressWindow(); + bool burn=(m_newDVD.getError()=="") ; + if (burn && cbOutputDev->currentItem()!=1) { + //changeStatusbar(i18n("Burning DVD"),sbMessage); + + k9BurnDVD b; + + setProgressWindow( b.getDialog()); + b.setworkDir(config.getPrefOutput() ); + b.setUseK3b(config.getPrefK3b() ); + b.setAutoBurn(config.getPrefAutoBurn()); + b.setvolId("DVD"); + b.setSpeed( i18n("default")); + if (cbOutputDev->currentItem() !=0) { + k9CdDrive * drive=(k9CdDrive*)recorderList.at(cbOutputDev->currentItem()-2); + b.setburnDevice(drive->device); + } else + b.makeIso(filename); + b.burn(); + removeProgressWindow(); + } + + +} + + +void k9Import::cbFormatActivated(const QString &_format) { + if (_format == "PAL") { + m_newDVD.setFormat(k9NewDVD::PAL); + m_menuEdit->setFormat(k9MenuEdit::PAL); + } else { + m_newDVD.setFormat(k9NewDVD::NTSC); + m_menuEdit->setFormat(k9MenuEdit::NTSC); + } + +} + +void k9Import::setMenuEdit(k9MenuEdit* _value) { + m_menuEdit = _value; +} + +void k9Import::setEnableCreate(bool _state) { + m_parent->setEnabledCreateDVD(true); +} + +void k9Import::titleAdded() { + emit rootSelected(&m_newDVD); +} + +void k9Import::updateTotalTime() { + int total=m_newDVD.getTotalTime(); + gsTotal->setValue(total/60); + QTime t(0,0,0); + t=t.addSecs(total); + lTotal->setText(t.toString("hh:mm:ss")); +} diff --git a/k9author/k9import.h b/k9author/k9import.h new file mode 100644 index 0000000..e883bed --- /dev/null +++ b/k9author/k9import.h @@ -0,0 +1,79 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9IMPORT_H +#define K9IMPORT_H + +#include "k9common.h" +#include +#include "k9copy.h" +#include "../k9author/import.h" +#include "../k9author/k9newdvd.h" + + +class k9AviFile; +class k9MenuButton; +class k9MenuEdit; +class k9Import : public import { + Q_OBJECT +private: + QListViewItem *m_root; + k9NewDVD m_newDVD; + KMdiToolViewAccessor *m_toolView; + KDockWidget *m_dockWidget; + k9Copy *m_parent; + QPtrList recorderList; + k9CdDrives *drives; + k9MenuEdit *m_menuEdit; + +public: + k9Import(QWidget* parent = 0, const char* name = 0,k9CdDrives *_drives=0 ); + ~k9Import(); + /*$PUBLIC_FUNCTIONS$*/ + void init(); + void execute(); + QListViewItem* getRoot() const; + k9NewDVD *getNewDVD() { + return &m_newDVD; + } + +public slots: + /*$PUBLIC_SLOTS$*/ + void aviFileUpdated(k9AviFile *_aviFile); + void buttonUpdated(k9MenuButton *_button, const QImage &_image); + void setMenuEdit(k9MenuEdit* _value); + void setEnableCreate(bool _state); + void updateTotalTime(); + void titleAdded(); +protected: + /*$PROTECTED_FUNCTIONS$*/ + void setProgressWindow(QWidget *_widget); + void removeProgressWindow(); + void readDrives(); + void addDrive (k9CdDrive *_drive); + +protected slots: + /*$PROTECTED_SLOTS$*/ + void lvDVDItemSelected (QListViewItem *); + void cbFormatActivated(const QString &_format); + virtual void deviceAdded(k9CdDrive *_drive); + virtual void deviceRemoved(k9CdDrive *_drive); + virtual void volumeChanged(const QString &device,const QString &volumeName); + +signals: + void aviFileSelected(k9AviFile *_aviFile); + void titleSelected(k9Title *); + void rootSelected(k9NewDVD *); +}; + +#endif + diff --git a/k9author/k9importfiles.cpp b/k9author/k9importfiles.cpp new file mode 100644 index 0000000..2cb6138 --- /dev/null +++ b/k9author/k9importfiles.cpp @@ -0,0 +1,52 @@ +// +// C++ Implementation: k9importfiles +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9importfiles.h" +#include "k9import.h" +#include "k9newtitle.h" +#include "klocale.h" +#include "kapplication.h" +#include "k9chapteredit.h" +#include "k9avifile.h" +#include "k9menuedit.h" + +k9ImportFiles::k9ImportFiles(QWidget *parent, const char *name) + : KMdiMainFrm( parent, name ,KMdi::IDEAlMode ) +{ + this->setCaption(kapp->makeStdCaption(i18n("Create new DVD"),true)); + m_k9Import=new k9Import(this); + m_k9ImportView=createWrapper( m_k9Import,"",""); + addWindow(m_k9ImportView, KMdi::StandardAdd); + + + k9MenuEdit *menu=new k9MenuEdit(this); + addToolWindow(menu, KDockWidget::DockRight, getMainDockWidget(),0,i18n("Edit menu"),i18n("Edit Menu")); + + k9ChapterEdit *ch=new k9ChapterEdit(this); + addToolWindow(ch, KDockWidget::DockBottom, getMainDockWidget(),0,i18n("Chapter properties"),i18n("Chapter properties")); + + connect(m_k9Import,SIGNAL(aviFileSelected(k9AviFile*)),ch,SLOT(setAviFile(k9AviFile*))); + + m_k9NewTitle=new k9NewTitle(this); + m_k9NewTitle->setK9Import(m_k9Import); + addToolWindow(m_k9NewTitle, KDockWidget::DockBottom, getMainDockWidget(),0,i18n("Add title"),i18n("Add title")); + + m_k9Import->init(); + +} + + +k9ImportFiles::~k9ImportFiles() +{ +} + + +#include "k9importfiles.moc" diff --git a/k9author/k9importfiles.h b/k9author/k9importfiles.h new file mode 100644 index 0000000..136c131 --- /dev/null +++ b/k9author/k9importfiles.h @@ -0,0 +1,42 @@ +// +// C++ Interface: k9importfiles +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9IMPORTFILES_H +#define K9IMPORTFILES_H + +#include "k9common.h" + +#include +#include +#include +#include + +/** + @author Jean-Michel PETIT +*/ + +class k9Import; +class k9NewTitle; +class k9ImportFiles : public KMdiMainFrm +{ +Q_OBJECT +public: + k9ImportFiles(QWidget *parent = 0, const char *name = 0); + + ~k9ImportFiles(); +private: + k9Import *m_k9Import; + KMdiChildView *m_k9ImportView; + k9NewTitle *m_k9NewTitle; + KMdiChildView *m_k9NewTitleView; +}; + +#endif diff --git a/k9author/k9lvitemimport.cpp b/k9author/k9lvitemimport.cpp new file mode 100644 index 0000000..e946c8a --- /dev/null +++ b/k9author/k9lvitemimport.cpp @@ -0,0 +1,54 @@ +// +// C++ Implementation: k9lvitemimport +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9lvitemimport.h" + + +k9LvItemImport::k9LvItemImport( QListViewItem *parent,eObjectType _objectType) + : QListViewItem( parent) { + m_objectType=_objectType; + m_title=NULL; + m_aviFile=NULL; +} + +int k9LvItemImport::rtti () const { + switch(m_objectType) { + case TITLE: + return 1001; + case CHAPTER: + return 1002; + default: + return 1000; + } +} + +int k9LvItemImport::compare(QListViewItem *i,int col,bool ascending) const { + int res; + if (i->rtti()== 1001) { + k9LvItemImport *item2=(k9LvItemImport*)i; + return this->getTitle()->getNum()-item2->getTitle()->getNum(); + } + if (i->rtti()== 1002) { + k9LvItemImport *item2=(k9LvItemImport*)i; + return this->getAviFile()->getNum() - item2->getAviFile()->getNum() ; + } + return QListViewItem::compare(i,col,ascending); +} + + +void k9LvItemImport::setTitle(k9Title* _value) { + m_title = _value; + QPixmap pix(m_title->getButton()->getImage()); + setPixmap(0,pix); +} + +k9LvItemImport::~k9LvItemImport() { +} diff --git a/k9author/k9lvitemimport.h b/k9author/k9lvitemimport.h new file mode 100644 index 0000000..22aa3a2 --- /dev/null +++ b/k9author/k9lvitemimport.h @@ -0,0 +1,43 @@ +// +// C++ Interface: k9lvitemimport +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9LVITEMIMPORT_H +#define K9LVITEMIMPORT_H + +#include "k9common.h" +#include +#include "k9avifile.h" +#include "k9title.h" +/** + @author Jean-Michel PETIT +*/ +class k9LvItemImport: public QListViewItem { +public: + enum eObjectType {ROOT,TITLE,CHAPTER}; + + k9LvItemImport( QListViewItem *parent,eObjectType _objectType); + ~k9LvItemImport(); + virtual int rtti () const; + eObjectType getObjectType() { return m_objectType;}; + + void setAviFile ( k9AviFile* _value ){m_aviFile = _value;} + k9AviFile* getAviFile() const { return m_aviFile;} + + void setTitle(k9Title* _value); + k9Title* getTitle() const { return m_title;} + virtual int compare (QListViewItem *i,int col,bool ascending) const; +private: + eObjectType m_objectType; + k9AviFile *m_aviFile; + k9Title *m_title; +}; + +#endif diff --git a/k9author/k9menu.cpp b/k9author/k9menu.cpp new file mode 100644 index 0000000..b219ba3 --- /dev/null +++ b/k9author/k9menu.cpp @@ -0,0 +1,333 @@ +// +// C++ Implementation: k9menu +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9menu.h" +#include "k9menubutton.h" +#include "k9process.h" +#include +#include +#include +#include +#include +#include "k9tools.h" + +k9Menu::k9Menu(QObject *parent, const char *name) + : QObject(parent, name),m_format(PAL) { + m_buttons.setAutoDelete(false); + m_canvas=new QCanvas(this); + QPixmap pix(720,576); + pix.fill(Qt::black); + m_canvas->setBackgroundPixmap(pix); + m_startScript=m_startScript2=m_endScript=""; +} + + +k9Menu::~k9Menu() {} + + +#include "k9menu.moc" + + + +k9MenuButton *k9Menu::addButton() { + k9MenuButton *button=new k9MenuButton(m_canvas); + m_buttons.append(button); + return button; + +} + + + +void k9Menu::createMenus(QDomElement *_rootNode) { + + m_config=new k9Config(); + int height=m_format==PAL?576:480; + + QImage img; + + //create menu image + QCanvasItemList l=m_canvas->allItems(); + for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + if ( (*it)->rtti() > 1001 || (*it)->rtti()==QCanvasItem::Rtti_Rectangle ) + (*it)->hide(); + } + + + QPixmap pixbg(720,height); + QPainter pbg(&pixbg); + m_canvas->resize(720,height); + m_canvas->update(); + m_canvas->drawArea(QRect(0,0,720,height),&pbg); + + //create the hilite picture + int lineWidth=2; + img.create(720,height,8,3,QImage::IgnoreEndian); + QPixmap pixhi; + pixhi.convertFromImage(img,0); + pixhi.fill(Qt::white); + QPainter phi(&pixhi); + QPen penhi; + penhi.setColor(m_config->getPrefButtonHiliteColor()); + penhi.setWidth(lineWidth*2); + phi.setPen(penhi); + phi.setBrush(Qt::NoBrush); + //create the hilite mask + QBitmap mask(720,height); + mask.fill(Qt::color0); + QPainter pmk(&mask); + QPen penmk; + penmk.setColor(Qt::color1); + penmk.setWidth(lineWidth*2); + pmk.setPen(penmk); + pmk.setBrush(Qt::NoBrush); + + //draw buttons + for (k9MenuButton *button=m_buttons.first();button;button=m_buttons.next()) { + //draw hilight + phi.drawRect(button->getLeft()+lineWidth,button->getTop()+lineWidth,button->getWidth()-lineWidth,button->getHeight()-lineWidth); + pmk.drawRect(button->getLeft()+lineWidth,button->getTop()+lineWidth,button->getWidth()-lineWidth,button->getHeight()-lineWidth); + + } + pbg.end(); + phi.end(); + pmk.end(); + pixhi.setMask(mask); + //save menu image + + QString bgFileName=m_workDir+KApplication::randomString(8)+".jpg"; + QString hiFileName=m_workDir+KApplication::randomString(8)+".png"; + QString m2vFileName= m_workDir+KApplication::randomString(8)+".m2v"; + QString mpaFileName= m_workDir+KApplication::randomString(8)+".m2v"; + QString mpgFileName= m_workDir+KApplication::randomString(8)+".mpg"; + + pixbg.save(bgFileName,"JPEG",-1); + pixhi.save(hiFileName,"PNG",-1); + + convertJpegToMpeg(bgFileName,m2vFileName); + createAudio(mpaFileName); + multiplex(mpaFileName,m2vFileName,mpgFileName); + spumux(hiFileName,mpgFileName); + appendMenu(_rootNode); + +// mask.save(m_workDir+"/mask.bmp","BMP",-1); + + QFile::remove(bgFileName); + QFile::remove(m2vFileName); + QFile::remove(mpaFileName); + QFile::remove(mpgFileName); + QFile::remove(hiFileName); + delete m_config; +} + +void k9Menu::convertJpegToMpeg(const QString &_imageJpg,const QString &_imageMpg) { + k9Process *process=new k9Process(0,0); + process->setWorkingDirectory(m_workDir); + process->setUseShell(true); + if (m_format==NTSC) { + *process << "jpeg2yuv" << "-n" << "50" << "-I" << "p" << "-f" << "29.97" << "-j" << _imageJpg << "|"; + *process << "mpeg2enc" << "-n" << "n" <<"-f" << "8" << "-o" << _imageMpg; + } else { + *process << "jpeg2yuv" << "-n" << "50" << "-I" << "p" << "-f" << "25" << "-j" << _imageJpg << "|"; + *process << "mpeg2enc" << "-n" << "p" <<"-f" << "8" << "-o" << _imageMpg; + } + process->start(); + process->sync(); + if (!process->normalExit()) { + qDebug("error converting jpeg to mpeg"); + } + qDebug(process->debug().latin1()); +} + +void k9Menu::createAudio(const QString & _audioFile) { + k9Process *process=new k9Process(0,0); + process->setWorkingDirectory(m_workDir); + process->setUseShell(true); + if (k9Tools::checkProgram("toolame")) + *process << "dd" << "if=/dev/zero" << "bs=4" << "count=1920" << "|" << "toolame" << "-b" << "128" << "-s" << "48" << "/dev/stdin" << _audioFile; + else + *process << "dd" << "if=/dev/zero" << "bs=4" << "count=1920" << "|" << "twolame" <<"-r" << "-b" << "128" << "-s" << "48000" << "/dev/stdin" << _audioFile; + + process->start(); + process->sync(); + if (!process->normalExit()) { + qDebug("error creating audio stream"); + } +} +void k9Menu::multiplex(const QString &_audio, const QString &_video, const QString _result) { + k9Process *process=new k9Process(0,0); + process->setWorkingDirectory(m_workDir); + process->setUseShell(true); + *process << "mplex" << "-f" << "8" << "-o" << _result << _video << _audio; + process->start(); + process->sync(); + if (!process->normalExit()) { + qDebug("error multiplexing audio and video"); + } +} + +void k9Menu::spumux(const QString &_hiFileName,const QString &_mpgFileName) { + QDomElement stream,spu; + + QDomDocument xml; + + QDomElement root = xml.createElement( "subpictures" ); + xml.appendChild( root ); + + stream=xml.createElement("stream"); + root.appendChild(stream); + + spu=xml.createElement("spu"); + stream.appendChild(spu); + + spu.setAttribute("start","00:00:00.0"); + spu.setAttribute("end","00:00:00.0"); + spu.setAttribute("highlight",_hiFileName); + spu.setAttribute("select",_hiFileName); + + //spu.setAttribute("autooutline","infer"); + spu.setAttribute("force","yes"); + // spu.setAttribute("autoorder","rows"); + spu.setAttribute("xoffset","0"); + spu.setAttribute("yoffset","0"); + + int i=1; + for (k9MenuButton *button=m_buttons.first();button;button=m_buttons.next()) { + QDomElement eButton = xml.createElement("button"); + spu.appendChild(eButton); + eButton.setAttribute("name",QString("button%1").arg(i)); + eButton.setAttribute("x0", QString::number(button->getLeft())); + eButton.setAttribute("y0",QString::number(button->getTop())); + eButton.setAttribute("x1",QString::number(button->getLeft()+button->getWidth())); + eButton.setAttribute("y1",QString::number(button->getTop()+button->getHeight())); + i++; + } + + QString spuFileName(m_workDir + KApplication::randomString(8)+ ".xml"); + QFile file( spuFileName ); + if ( file.open( IO_WriteOnly ) ) { + QTextStream stream( &file ); + xml.save(stream,1); + file.close(); + } + + + k9Process *process=new k9Process(0,0); + process->setWorkingDirectory(m_workDir); + process->setUseShell(true); +// *process << "mplex" << "-f" << "8" << "-o" << _result << _video << _audio; + *process << "spumux" << spuFileName << "<" << _mpgFileName << ">" << m_menuFileName; + process->start(); + process->sync(); + if (!process->normalExit()) { + qDebug("error multiplexing audio and video"); + } + + file.remove(); +} + +void k9Menu::appendMenu(QDomElement *_rootNode) { + QDomDocument doc=_rootNode->ownerDocument(); + QDomNodeList l=_rootNode->elementsByTagName("menus"); + QDomNode menus; + if (l.count()==0) { + menus=doc.createElement("menus"); + _rootNode->appendChild(menus); + } else { + menus=l.item(0); + } + + QDomElement pgc=doc.createElement("pgc"); + menus.appendChild(pgc); + QDomElement pre=doc.createElement("pre"); + pgc.appendChild(pre); + QDomText txt=doc.createTextNode(m_startScript +m_startScript2); + pre.appendChild(txt); + + QDomElement vob=doc.createElement("vob"); + pgc.appendChild(vob); + vob.setAttribute("file",m_menuFileName); + vob.setAttribute("pause","inf"); + int i=1; + for (k9MenuButton *button=m_buttons.first();button;button=m_buttons.next()) { + QDomElement eButton = doc.createElement("button"); + pgc.appendChild(eButton); + QDomText eButtonTxt=doc.createTextNode(button->getScript()); + eButton.appendChild(eButtonTxt); + eButton.setAttribute("name",QString("button%1").arg(i)); + i++; + } + + +} + +QString k9Menu::getWorkDir() const { + return m_workDir; +} + + +void k9Menu::setWorkDir(const QString& _value) { + m_workDir = _value; +} + + +void k9Menu::setFormat(const eFormat& _value) { + m_format = _value; +} + + +QString k9Menu::getMenuFileName() const { + return m_menuFileName; +} + + +void k9Menu::setMenuFileName(const QString& _value) { + m_menuFileName = _value; +} + + + + +QCanvas* k9Menu::getCanvas() const { + return m_canvas; +} + + +void k9Menu::setCanvas(QCanvas* _value) { + m_canvas = _value; +} + +void k9Menu::setStartScript(const QString &_value) { + m_startScript=_value; +} + + +QString k9Menu::getStartScript() const { + return m_startScript; +} + +void k9Menu::setStartScript2(const QString &_value) { + m_startScript2=_value; +} + + +QString k9Menu::getStartScript2() const { + return m_startScript2; +} + + +QString k9Menu::getEndScript() const { + return m_endScript; +} + + +void k9Menu::setEndScript(const QString& _value) { + m_endScript = _value; +} diff --git a/k9author/k9menu.h b/k9author/k9menu.h new file mode 100644 index 0000000..91e8a20 --- /dev/null +++ b/k9author/k9menu.h @@ -0,0 +1,71 @@ +// +// C++ Interface: k9menu +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9MENU_H +#define K9MENU_H + +#include "k9common.h" +#include "k9config.h" +#include +#include +#include +#include +#include +#include +/** + @author Jean-Michel PETIT +*/ +class k9MenuButton; +class k9Menu : public QObject { + Q_OBJECT +public slots: + void setStartScript(const QString &); + void setStartScript2(const QString &); + void setEndScript(const QString& _value); + +public: + enum eFormat { + PAL=1,NTSC=2 + }; + k9Menu(QObject *parent = 0, const char *name = 0); + ~k9Menu(); + k9MenuButton *addButton(); + void createMenus(QDomElement *_rootNode); + void setWorkDir(const QString& _value); + QString getWorkDir() const; + void setFormat(const eFormat& _value); + void setMenuFileName(const QString& _value); + QString getMenuFileName() const; + + void setCanvas(QCanvas* _value); + QCanvas* getCanvas() const; + + QString getStartScript() const; + QString getEndScript() const; + QString getStartScript2() const; +private: + QPtrList m_buttons; + QString m_workDir; + QString m_menuFileName; + eFormat m_format; + QCanvas *m_canvas; + QString m_startScript; + QString m_startScript2; + QString m_endScript; + k9Config *m_config; + void convertJpegToMpeg(const QString &_imageJpg,const QString &_imageMpg) ; + void createAudio(const QString & _audioFile); + void multiplex(const QString &_audio, const QString &_video, const QString _result); + void spumux(const QString &_hiFileName,const QString &_mpgFileName); + void appendMenu(QDomElement *_rootNode); +}; + +#endif diff --git a/k9author/k9menubutton.cpp b/k9author/k9menubutton.cpp new file mode 100644 index 0000000..73908e9 --- /dev/null +++ b/k9author/k9menubutton.cpp @@ -0,0 +1,296 @@ +// +// C++ Implementation: k9menubutton +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9menubutton.h" +#include +#include +#include + +k9CanvasSprite::k9CanvasSprite (QCanvasPixmapArray *a,QCanvas *canvas,k9MenuButton *button) : QCanvasSprite(a,canvas) { + m_button=button; +} + +void k9CanvasSprite::update() { + m_button->update(); +} + + +k9MenuButton* k9CanvasSprite::getButton() const { + return m_button; +} + +void k9MenuButton::select(bool _value) { + /* if (_value) { + m_lt->show(); + m_mt->show(); + m_rt->show(); + m_lm->show(); + m_rm->show(); + m_lb->show(); + m_mb->show(); + m_rb->show(); + } else { + m_lt->hide(); + m_mt->hide(); + m_rt->hide(); + m_lm->hide(); + m_rm->hide(); + m_lb->hide(); + m_mb->hide(); + m_rb->hide(); + }*/ +} + +void k9MenuButton::update() { + int x=m_sprite->x()-5; + int y=m_sprite->y()-5; + int w=m_width; + int h=m_height; + + int count=m_canvas->allItems().count(); +/* + m_lt->move(x,y); + m_lt->setZ(count--); + + m_mt->move(x+w/2,y); + m_mt->setZ(count--); + + m_rt->move(x+w,y); + m_rt->setZ(count--); + + m_lm->move(x,y+h/2); + m_lm->setZ(count--); + + m_rm->move(x+w,y+h/2); + m_rm->setZ(count--); + + m_lb->move(x,y+h); + m_lb->setZ(count--); + + m_mb->move(x+w/2,y+h); + m_mb->setZ(count--); + + m_rb->move(x+w,y+h); + m_rb->setZ(count--); +*/ + switch(m_textPosition) { + case RIGHT: + m_text->move(x+2+w,y+2+h/2-m_text->boundingRect().height()/2); + break; + case BOTTOM: + m_text->move(x+2+w/2 - m_text->boundingRect().width()/2,y+2+h); + break; + } + m_text->show(); + m_text->setZ(count --); + + m_sprite->setZ(count--); + emit sigsetLeft(getLeft()); + emit sigsetTop(getTop()); + emit sigsetWidth(getWidth()); + emit sigsetHeight(getHeight()); +} + +k9MenuButton::k9MenuButton(QCanvas *parent, const char *name) + : QObject(parent, name),m_width(0),m_height(0) +{ + m_canvas=parent; + m_sprite=NULL; + m_pixmap=NULL; + m_text=new QCanvasText("",m_canvas); + m_text->setColor(Qt::yellow); + +} + + +k9MenuButton::~k9MenuButton() +{ +} + +void k9MenuButton::setImage(const QImage &_image) { + m_image=_image; + emit sigsetImage(this,_image); + loadImage(); + +} + +void k9MenuButton::setImage(const QString &_fileName){ + m_image.load(_fileName); + emit sigsetImage(this,m_image); + loadImage(); +} + +void k9MenuButton::loadImage() { + QImage tmp=m_image.smoothScale(m_width,m_height); + int x=0,y=0; + if (m_sprite) { + x=m_sprite->x(); + y=m_sprite->y(); + delete m_sprite; + } + QPixmap pix; + pix.convertFromImage(tmp); + + m_pixmap=new QCanvasPixmap(pix,QPoint(0,0)); + + + m_pixmapArray.setImage(0,m_pixmap); + m_sprite = new k9CanvasSprite(&m_pixmapArray,m_canvas,this); + m_sprite->move(x,y); + m_sprite->show(); + update(); + m_canvas->update(); +} + +void k9MenuButton::setWidth(int _value,bool _reload) { + m_width=_value; + emit sigsetWidth(_value); + if (_reload) + loadImage(); +} + +int k9MenuButton::getWidth() { + return m_width; +} + +void k9MenuButton::setHeight(int _value,bool _reload) { + m_height=_value; + emit sigsetHeight(_value); + if (_reload) + loadImage(); +} + +int k9MenuButton::getHeight() { + return m_height; +} + +void k9MenuButton::setTop(int _value,bool _reload) { + m_sprite->setY(_value); + emit sigsetTop(_value); + if (_reload) + loadImage(); +} + +void k9MenuButton::setLeft(int _value,bool _reload) { + m_sprite->setX(_value); + emit sigsetLeft(_value); + if (_reload) + loadImage(); +} + +int k9MenuButton::getTop() { + return m_sprite->y(); +} + +int k9MenuButton::getLeft() { + return m_sprite->x(); +} + +void k9MenuButton::setFont(QFont _font) { + m_text->setFont(_font); + update(); + m_canvas->update(); + emit sigsetFont(_font); +} + +QFont k9MenuButton::getFont() { + return m_text->font(); +} + +void k9MenuButton::setColor(QColor _color) { + m_text->setColor(_color); + m_canvas->update(); + emit sigsetColor(_color); +} + +QColor k9MenuButton::getColor() { + return m_text->color(); +} + +void k9MenuButton::setText(QString _text) { + m_text->setText(_text); + update(); + m_canvas->update(); + emit sigsetText(_text); +} + +QString k9MenuButton::getText() { + return m_text->text(); +} + + + +void k9MenuButton::moveBy(int _x,int _y,bool _reload) { + int x=getLeft(); + int y=getTop(); + m_sprite->moveBy(_x,_y); + emit sigsetLeft(x+_x); + emit sigsetTop(y+_y); + + if(_reload) + loadImage(); +} +#include "k9menubutton.moc" + + + + +k9MenuButton::eTextPosition k9MenuButton::getTextPosition() const { + return m_textPosition; +} + + +void k9MenuButton::setTextPosition(const eTextPosition& _value) { + m_textPosition = _value; + update(); + m_canvas->update(); + emit sigsetTextPosition(_value); +} + + +QImage k9MenuButton::getImage() const { + return m_image; +} + + +QString k9MenuButton::getScript() const { + return m_script; +} + + +void k9MenuButton::setScript(const QString& _value) { + m_script = _value; +} + + +int k9MenuButton::getAngle() const { + return m_angle; +} + + +void k9MenuButton::setAngle(int _value) { + m_angle = _value; +} + + +k9CanvasSprite* k9MenuButton::getSprite() const { + return m_sprite; +} + + +int k9MenuButton::getNum() const { + return m_num; +} + + +void k9MenuButton::setNum(int _value) { + m_num = _value; +} diff --git a/k9author/k9menubutton.h b/k9author/k9menubutton.h new file mode 100644 index 0000000..135340e --- /dev/null +++ b/k9author/k9menubutton.h @@ -0,0 +1,116 @@ +// +// C++ Interface: k9menubutton +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9MENUBUTTON_H +#define K9MENUBUTTON_H + +#include +#include +#include +#include + +/** + @author Jean-Michel PETIT +*/ +class k9MenuButton; +class k9CanvasSprite : public QCanvasSprite { +public: + k9CanvasSprite (QCanvasPixmapArray *a,QCanvas *canvas,k9MenuButton *button); + virtual int rtti() const { + return 1000; + } + void update(); + + k9MenuButton* getButton() const; + +private: + k9MenuButton *m_button; +}; + + +class k9MenuButton : public QObject { + Q_OBJECT +public: + enum eTextPosition {BOTTOM=1,RIGHT=2}; + + k9MenuButton(QCanvas *parent = 0, const char *name = 0); + + ~k9MenuButton(); + void setWidth(int _value,bool _reload=true); + int getWidth(); + void setHeight(int _value,bool _reload=true); + int getHeight(); + void setTop(int _value,bool _reload=true); + void setLeft(int _value,bool _reload=true); + void setFont(QFont _font); + QFont getFont(); + void setColor(QColor _color); + QColor getColor(); + void setText(QString _text); + QString getText(); + void select(bool); + int getTop(); + int getLeft(); + + void moveBy(int x,int y,bool _reload=true); + void update(); +public slots: + void setImage(const QImage &_image); + void setImage(const QString &_fileName); + + void setTextPosition(const eTextPosition& _value); + eTextPosition getTextPosition() const; + + QImage getImage() const; + + void setScript(const QString& _value); + QString getScript() const; + + void setAngle(int _value); + int getAngle() const; + + k9CanvasSprite* getSprite() const; + + void setNum(int _value); + + + int getNum() const; + + + +private: + QCanvas *m_canvas; + QCanvasPixmapArray m_pixmapArray; + QCanvasPixmap *m_pixmap; + k9CanvasSprite *m_sprite; + int m_num; + QCanvasText *m_text; + QImage m_image; + int m_width; + int m_height; + int m_angle; + eTextPosition m_textPosition; + QString m_script; + void loadImage(); +signals: + void sigsetTop(int); + void sigsetLeft(int); + void sigsetWidth(int); + void sigsetHeight(int); + + void sigsetFont(const QFont &); + void sigsetColor(const QColor &); + void sigsetImage(k9MenuButton *,const QImage &); + void sigsetText(const QString &); + void sigsetTextPosition(int); +}; + +#endif diff --git a/k9author/k9menuedit.cpp b/k9author/k9menuedit.cpp new file mode 100644 index 0000000..8ab0bc5 --- /dev/null +++ b/k9author/k9menuedit.cpp @@ -0,0 +1,319 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "k9common.h" +#include "k9menuedit.h" +#include "k9menueditor.h" +#include "k9menu.h" +#include "k9title.h" +#include "k9newdvd.h" +#include +#include +#include +#include "k9menubutton.h" +#include +#include +#include +#include +#include +#include + + + + +k9MenuEdit::k9MenuEdit(QWidget* parent, const char* name,QCanvas *_canvas) + : menuEdit(parent,name) { + bAddText->setPixmap (SmallIcon("add")); + m_noUpdate=false; + m_canvas=_canvas; + m_format=PAL; + m_imageHeight=576; + QGridLayout *grid=new QGridLayout(frame,1,1); + m_menuEditor=new k9MenuEditor(*m_canvas,frame); + grid->addWidget(m_menuEditor,0,0); + m_canvas->resize(720,m_imageHeight); + m_text=NULL; + m_menuEditor->setMenu(this); + connect(m_menuEditor,SIGNAL(itemSelected()),this,SLOT(itemSelected())); + cbPosTitle->setEnabled(false); +} +void k9MenuEdit::updateTextPos(const QPoint &_point) { + emit updatePos(_point); +} + +void k9MenuEdit::itemSelected() { + bool unselect=true; + m_noUpdate=true; + m_canvas->update(); + urBackground->setURL(""); + if (m_menuEditor->getSelected()) { + // m_menuEditor->getSelected()->select(true); + cbColor->setColor(m_menuEditor->getSelected()->getColor()); + leTitle->setText(m_menuEditor->getSelected()->getText()); + cbPosTitle->setEnabled(true); + cbPosTitle->setCurrentItem(m_menuEditor->getSelected()->getTextPosition()-1); + urBackground->setEnabled(true); + m_canvas->update(); + } else if (m_menuEditor->getMoving()) { + if (m_menuEditor->getMoving()->rtti()==QCanvasItem::Rtti_Text) { + m_text=(QCanvasText*)m_menuEditor->getMoving(); + leTitle->setText(m_text->text()); + cbColor->setColor(m_text->color()); + cbPosTitle->setEnabled(false); + urBackground->setEnabled(false); + } + } else { + urBackground->setEnabled(true); + cbPosTitle->setEnabled(false); + } + m_noUpdate=false; +} + + + + + +k9MenuEdit::~k9MenuEdit() {} + +/*$SPECIALIZATION$*/ + + +void k9MenuEdit::bFontClick() { + if (m_menuEditor->getSelected()) { + k9MenuButton *b=m_menuEditor->getSelected(); + QFont myFont(b->getFont()); + int result = KFontDialog::getFont( myFont ); + if ( result == KFontDialog::Accepted && m_menuEditor->getSelected() ) { + QPtrList *l=m_menuEditor->getSelection(); + for (b=l->first();b;b=l->next()) { + b->setFont(myFont); + } + } + } else { + if (m_text) { + QFont myFont(m_text->font()); + int result = KFontDialog::getFont( myFont ); + if ( result == KFontDialog::Accepted ) + setFont(myFont); + } + + } +} + +void k9MenuEdit::urBackgroundSelected(const QString &_fileName) { + if ( m_menuEditor->getSelected() ) { +//If a button is selected, set the button image ... + k9MenuButton *b=(k9MenuButton*)m_menuEditor->getSelected(); + QImage img; + img.load(_fileName); + b->setImage(img); + } else { +//...otherwise, set the menu background image + QImage img; + img.load(_fileName); + img=img.smoothScale(720,m_imageHeight,QImage::ScaleMax); + setBackgroundImage(img); + } +} + +void k9MenuEdit::cbColorChanged(const QColor &_color) { + if (m_noUpdate) + return; + if ( m_menuEditor->getSelected() ) { + QPtrList *l=m_menuEditor->getSelection(); + for (k9MenuButton *b=l->first();b;b=l->next()) { + b->setColor(_color); + } + //m_menuEditor->getSelected()->setColor(_color); + } else { + setColor(_color); + } + +} + +void k9MenuEdit::cbPosTitleActivated(int _value) { + if (m_noUpdate) + return; + if ( m_menuEditor->getSelected() ) { + QPtrList *l=m_menuEditor->getSelection(); + for (k9MenuButton *b=l->first();b;b=l->next()) { + b->setTextPosition((k9MenuButton::eTextPosition)(_value+1)); + } + } +} + +void k9MenuEdit::setBackgroundImage(const QImage &_image) { + m_background=_image; + m_canvas->setBackgroundPixmap(QPixmap(_image)); + emit backgroundImageChanged(_image); +} + +void k9MenuEdit::leTitleChanged(const QString &_value) { + if (m_noUpdate) + return; + if ( m_menuEditor->getSelected() ) { + QPtrList *l=m_menuEditor->getSelection(); + for (k9MenuButton *b=l->first();b;b=l->next()) { + QString c=_value; + b->setText(c.replace("%n",QString::number(b->getNum()))); + } + //m_menuEditor->getSelected()->setText(_value); + } else { + setText(_value); + } +} + +#include "k9menuedit.moc" + + + + + +void k9MenuEdit::setText(const QString &_value) { + if (m_text) + m_text->setText(_value); + m_canvas->update(); + emit textChanged(_value); +} + +void k9MenuEdit::setFont(const QFont &_value) { + if (m_text) + m_text->setFont(_value); + m_canvas->update(); + emit textFontChanged(_value); +} + +void k9MenuEdit::setColor(const QColor &_value) { + if (m_text) + m_text->setColor(_value); + m_canvas->update(); + emit textColorChanged(_value); +} + +QCanvasText* k9MenuEdit::getText() const { + return m_text; +} + + +k9MenuEdit::eFormat k9MenuEdit::getFormat() const { + return m_format; +} + + +void k9MenuEdit::setFormat(const eFormat& _value) { + m_format = _value; + if (_value==NTSC) + m_imageHeight=480; + else + m_imageHeight=576; + QPixmap pix=m_canvas->backgroundPixmap(); + QImage img=pix.convertToImage().smoothScale(720,m_imageHeight); + m_canvas->resize(720,m_imageHeight); + m_menuEditor->setMaximumSize(QSize(724,m_imageHeight+4)); + m_canvas->setBackgroundPixmap(QPixmap(img)); +} + + +QCanvas *k9MenuEdit::getCanvas() { + return m_canvas; +} + + +void k9MenuEdit::setCanvas(QCanvas* _value) { + m_canvas = _value; + m_text=NULL; + m_menuEditor->setCanvas(_value); + m_canvas->resize(720,m_imageHeight); + m_canvas->update(); + m_menuEditor->updateContents(); +} + +void k9MenuEdit::titleSelected(k9Title *_title) { + disconnect (this,SIGNAL(startScriptChanged(const QString&)),0,0); + disconnect (this,SIGNAL(endScriptChanged(const QString&)),0,0); + cbEnd->setEnabled(true); + m_menuEditor->clearSelection(); + lTitle->setText(i18n("Title %1 Menu").arg(_title->getNum()+1)); + setCanvas(_title->getMenu()->getCanvas()); + m_menuType=TITLEMENU; + cbStart->clear(); + cbEnd->clear(); + m_startScripts.clear(); + m_endScripts.clear(); + + + cbStart->insertItem(i18n("Play Menu")); + m_startScripts << ""; + cbStart->insertItem(i18n("Play Title")); + m_startScripts << "if (g1==0) {g1=1; jump title 1 chapter 1;}"; + if (_title->getMenu()->getStartScript() !="") + cbStart->setCurrentItem(cbStart->count()-1); + connect (this,SIGNAL(startScriptChanged(const QString&)),_title->getMenu(),SLOT(setStartScript(const QString&))); + + cbEnd->insertItem(i18n("Play Root Menu")); + m_endScripts << "g6=0; call vmgm menu;"; + cbEnd->insertItem(i18n("Play Title Menu")); + m_endScripts << "call menu;"; + k9NewDVD *newDVD=(k9NewDVD*)_title->parent() ; + k9NewDVDItems *items=newDVD->getTitles(); + for (k9Title *title=items->first();title;title=items->next()) { + cbEnd->insertItem(i18n("Play Title %1").arg(title->getNum()+1)); + QString script=QString("g6=%1; call vmgm menu;" ).arg(title->getNum()+1); + m_endScripts << script; + } + for (int i=0;igetMenu()->getEndScript()== *(m_endScripts.at(i))) + cbEnd->setCurrentItem(i); + } + connect (this,SIGNAL(endScriptChanged(const QString&)),_title->getMenu(),SLOT(setEndScript(const QString&))); + +} + +void k9MenuEdit::rootSelected(k9NewDVD *_newDVD) { + disconnect (this,SIGNAL(startScriptChanged(const QString&)),0,0); + disconnect (this,SIGNAL(endScriptChanged(const QString&)),0,0); + cbEnd->setEnabled(false); + m_menuEditor->clearSelection(); + lTitle->setText(i18n("Root Menu")); + setCanvas(_newDVD->getRootMenu()->getCanvas()); + m_menuType=ROOTMENU; + cbStart->clear(); + m_startScripts.clear(); + cbStart->insertItem(i18n("Play Menu")); + m_startScripts << ""; + k9NewDVDItems *items=_newDVD->getTitles(); + for (k9Title *title=items->first();title;title=items->next()) { + cbStart->insertItem(i18n("Play Title %1").arg(title->getNum()+1)); + // QString script=QString("if (g5==0) {g5=1; jump title %1;}" ).arg(title->getNum()+1); + QString script=QString("g6=%1;" ).arg(title->getNum()+1); + m_startScripts << script; + if (script==_newDVD->getRootMenu()->getStartScript()) + cbStart->setCurrentItem(cbStart->count()-1); + } + connect (this,SIGNAL(startScriptChanged(const QString&)),_newDVD->getRootMenu(),SLOT(setStartScript(const QString&))); +} + +void k9MenuEdit::bAddTextClick() { + m_text=new QCanvasText(m_canvas); + m_text->show(); + m_menuEditor->setMoving(m_text); + setText(leTitle->text()); + setColor(cbColor->color()); +} + +void k9MenuEdit::cbStartActivated (int _value) { + emit startScriptChanged(m_startScripts[_value]); +} + +void k9MenuEdit::cbEndActivated (int _value) { + emit endScriptChanged(m_endScripts[_value]); +} diff --git a/k9author/k9menuedit.h b/k9author/k9menuedit.h new file mode 100644 index 0000000..f11a6b7 --- /dev/null +++ b/k9author/k9menuedit.h @@ -0,0 +1,85 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9MENUEDIT_H +#define K9MENUEDIT_H + +#include "../k9author/menuEdit.h" +#include +#include + +class k9MenuButton; +class k9MenuEdit; +class k9Title; +class k9NewDVD; +class k9MenuEditor; + + +class k9MenuEdit : public menuEdit { + Q_OBJECT +public: + enum eFormat {PAL=1,NTSC=2}; + enum eMenuType {ROOTMENU,TITLEMENU}; + + k9MenuEdit(QWidget* parent = 0, const char* name = 0,QCanvas *_canvas=0); + ~k9MenuEdit(); + /*$PUBLIC_FUNCTIONS$*/ + void setBackgroundImage(const QImage &_image); + void setText(const QString &_value); + void setFont(const QFont &_value); + void setColor(const QColor &_value); + void updateTextPos(const QPoint &_point); +public slots: + /*$PUBLIC_SLOTS$*/ + void itemSelected(); + QCanvasText* getText() const; + void setFormat(const eFormat& _value); + k9MenuEdit::eFormat getFormat() const; + QCanvas *getCanvas(); + void setCanvas(QCanvas* _value); + void titleSelected(k9Title *); + void rootSelected(k9NewDVD *); + +protected: + /*$PROTECTED_FUNCTIONS$*/ + virtual void bFontClick(); + virtual void urBackgroundSelected(const QString &_fileName); + virtual void cbColorChanged(const QColor &_color); + virtual void leTitleChanged(const QString &_value); + virtual void cbPosTitleActivated(int _value); + virtual void bAddTextClick(); + virtual void cbStartActivated (int _value); + virtual void cbEndActivated (int _value); + k9MenuEditor *m_menuEditor; + QCanvas *m_canvas; + QImage m_background; + QCanvasText *m_text; + eFormat m_format; + int m_imageHeight; + eMenuType m_menuType; + QStringList m_startScripts; + QStringList m_endScripts; + bool m_noUpdate; +protected slots: + /*$PROTECTED_SLOTS$*/ +signals: + void backgroundImageChanged(const QImage &); + void textChanged(const QString&); + void startScriptChanged(const QString&); + void endScriptChanged(const QString&); + void textColorChanged(const QColor &); + void textFontChanged(const QFont&); + void updatePos(const QPoint &); +}; + +#endif + diff --git a/k9author/k9menueditor.cpp b/k9author/k9menueditor.cpp new file mode 100644 index 0000000..1af07a1 --- /dev/null +++ b/k9author/k9menueditor.cpp @@ -0,0 +1,237 @@ +// +// C++ Implementation: k9menueditor +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9menueditor.h" +#include "k9menubutton.h" +#include "k9menuedit.h" +#include "k9canvasselection.h" +#include +#include +#include +k9MenuEditor::k9MenuEditor( + QCanvas& c, QWidget* parent, + const char* name, WFlags f) : + QCanvasView(&c,parent,name,f) { + this->setMaximumSize(QSize(724,580)); + moving=NULL; + m_canvasSelection=new k9CanvasSelection(this); + viewport()->setMouseTracking(true); +} + + +void k9MenuEditor::contentsMouseReleaseEvent(QMouseEvent* e) { + m_canvasSelection->release(); + emit itemSelected(); +} + + +void k9MenuEditor::contentsMousePressEvent(QMouseEvent* e) { + QPoint p = inverseWorldMatrix().map(e->pos()); + moving_start = p; + QCanvasItemList l=canvas()->collisions(p); + moving=0; + for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + QCanvasItem *item=*it; + if (item->rtti()==QCanvasItem::Rtti_Rectangle) + moving = item; + if (item->rtti()>2000) { + moving=item; + return; + } + } + if (moving) + return; + for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { +// if ((*it)->rtti()==QCanvasItem::Rtti_Rectangle) +// continue; + moving = *it; + if (moving->rtti()==1000) { + if (e->state() & QMouseEvent::ControlButton) + addSelection(moving); + else { + if (!isSelected(moving)) { + clearSelection(); + addSelection(moving); + } + } + m_canvasSelection->setPosition(p); + m_canvasSelection->drawSelection(); + } else if (moving->rtti() <1001 ) + clearSelection(); + emit itemSelected(); + return; + } + m_canvasSelection->setPosition(p); + clearSelection(); + emit itemSelected(); +} + +void k9MenuEditor::clear() { + QCanvasItemList list = canvas()->allItems(); + QCanvasItemList::Iterator it = list.begin(); + for (; it != list.end(); ++it) { + if ( *it ) + delete *it; + } +} + +void k9MenuEditor::clearSelection() { + for (k9MenuButton *b=m_selection.first();b;b=m_selection.next()) + b->select(false); + m_selection.clear(); +} + +bool k9MenuEditor::isSelected(QCanvasItem *_item) { + k9CanvasSprite *s=(k9CanvasSprite *)_item; + k9MenuButton *button=s->getButton(); + if (m_selection.find(button) !=-1) + return true; + else + return false; +} + +void k9MenuEditor::addSelection(QCanvasItem *_item) { + k9CanvasSprite *s=(k9CanvasSprite *)_item; + k9MenuButton *button=s->getButton(); + if (m_selection.find(button) !=-1) { + button->select(false); + m_selection.remove(button); + } else { + button->select(true); + m_selection.append(button); + } +} + +void k9MenuEditor::updateCursor(QMouseEvent *e) { + QPoint p = inverseWorldMatrix().map(e->pos()); + QCanvasItemList l=canvas()->collisions(p); + for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + QCanvasItem *item=*it; + switch (item->rtti()) { + case QCanvasItem::Rtti_Rectangle : + setCursor(KCursor::sizeAllCursor()); + return; + case 2002 : + case 2008: + setCursor(KCursor::sizeFDiagCursor()); + return; + case 2003: + case 2007: + setCursor(KCursor::sizeVerCursor()); + return; + case 2004: + case 2006: + setCursor(KCursor::sizeBDiagCursor()); + return; + case 2005: + case 2009: + setCursor(KCursor::sizeHorCursor()); + return; + default: + setCursor(KCursor::arrowCursor()); + } + } + setCursor(KCursor::arrowCursor()); +} + +void k9MenuEditor::contentsMouseMoveEvent(QMouseEvent* e) { + updateCursor(e); + if ( moving && (e->state() & Qt::LeftButton ==Qt::LeftButton) ) { + if (moving->rtti() !=QCanvasItem::Rtti_Text || moving==m_menu->getText()) { + QPoint p = inverseWorldMatrix().map(e->pos()); + int offsetX=p.x() - moving_start.x(); + int offsetY=p.y() - moving_start.y(); + moving_start = p; + if (moving->rtti()==1000 || moving->rtti() == QCanvasItem::Rtti_Rectangle) { + for (k9MenuButton *b=m_selection.first();b;b=m_selection.next()) { + k9CanvasSprite*spr=b->getSprite(); + spr->moveBy(offsetX,offsetY); + spr->update(); + } + + } else + moving->moveBy(offsetX,offsetY); + + if (moving->rtti() >2001 && moving->rtti() <2010) { + k9CanvasSelectionRedim *ssr=(k9CanvasSelectionRedim*)moving; + ssr->updateSelection(); + } else if (moving->rtti() != QCanvasItem::Rtti_Text ){ + //if selection not resized, move the selection + m_canvasSelection->moveBy(offsetX,offsetY); + m_canvasSelection->update(); + } + + if (moving==m_menu->getText()) + emit m_menu->updateTextPos(QPoint(moving->x(),moving->y())); + canvas()->update(); + } + } else if ((e->state() & Qt::LeftButton) ==Qt::LeftButton ) { + m_canvasSelection->hide(); + canvas()->update(); + QPoint p = inverseWorldMatrix().map(e->pos()); + int offsetX=p.x() - moving_start.x(); + int offsetY=p.y() - moving_start.y(); + m_canvasSelection->setSize(offsetX,offsetY); + m_canvasSelection->show(); + canvas()->update(); + clearSelection(); + QCanvasItemList l=canvas()->collisions(m_canvasSelection->getRect()); + for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + QCanvasItem *item = *it; + if (item->rtti()==1000) { + addSelection(item); + } + } + } +} + +void k9MenuEditor::resizeEvent ( QResizeEvent * e ) { + QWMatrix m; + double scalex=(e->size().width()-4.0)/720.0; + double scaley=(e->size().height()-4.0)/576.0; + m.scale(QMIN(scalex,scaley),QMIN(scalex,scaley)); + this->setWorldMatrix(m); + +} + +k9MenuButton * k9MenuEditor::getSelected() { +/* if (moving) { + if (moving->rtti()==1000) { + k9CanvasSprite *s=(k9CanvasSprite *)moving; + return s->getButton(); + } + } +*/ + if (m_selection.count() >0) + return m_selection.first(); + return NULL; +} + +QCanvasItem* k9MenuEditor::getMoving() const { + return moving; +} + + +void k9MenuEditor::setMoving(QCanvasItem* _value) { + moving = _value; +} + + + +QPtrList< k9MenuButton > *k9MenuEditor::getSelection() { + return &m_selection; +} + +void k9MenuEditor::hideSelection() { + m_canvasSelection->hide(); +} + +#include "k9menueditor.moc" diff --git a/k9author/k9menueditor.h b/k9author/k9menueditor.h new file mode 100644 index 0000000..53c1921 --- /dev/null +++ b/k9author/k9menueditor.h @@ -0,0 +1,64 @@ +// +// C++ Interface: k9menueditor +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9MENUEDITOR_H +#define K9MENUEDITOR_H + +#include + +/** + @author Jean-Michel PETIT +*/ + +class k9MenuButton; +class k9MenuEdit; +class k9CanvasSelection; +class k9MenuEditor : public QCanvasView { + Q_OBJECT + +public: + k9MenuEditor(QCanvas&, QWidget* parent=0, const char* name=0, WFlags f=0); + void clear(); + + k9MenuButton* getSelected() ; + void setMenu(k9MenuEdit *_menu) { + m_menu=_menu; + } + + QCanvasItem* getMoving() const; + + void setMoving(QCanvasItem* _value); + QPtrList< k9MenuButton > *getSelection() ; + void clearSelection(); + void hideSelection(); +protected: + void contentsMousePressEvent(QMouseEvent*); + void contentsMouseMoveEvent(QMouseEvent*); + void contentsMouseReleaseEvent(QMouseEvent* e); + void updateCursor(QMouseEvent *e); + virtual void resizeEvent ( QResizeEvent * e ); + void addSelection(QCanvasItem *_item); + bool isSelected(QCanvasItem *_item); + void drawSelection(); +signals: + void status(const QString&); + void itemSelected(); + +private: + QCanvasItem* moving; + QCanvasRectangle *m_rect; + QPoint moving_start; + k9MenuEdit *m_menu; + QPtrList m_selection; + k9CanvasSelection *m_canvasSelection; +}; + +#endif diff --git a/k9author/k9newdvd.cpp b/k9author/k9newdvd.cpp new file mode 100644 index 0000000..7cc73bd --- /dev/null +++ b/k9author/k9newdvd.cpp @@ -0,0 +1,439 @@ +// +// C++ Implementation: k9newdvd +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9newdvd.h" +#include "k9title.h" +#include "k9tools.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "k9menu.h" +#include "k9menubutton.h" +#include "k9processlist.h" +#include +#include + +k9NewDVD::k9NewDVD(QObject *parent, const char *name) + : QObject(parent, name) { + m_workDir=locateLocal("tmp", "k9copy/" ) ; + m_rootMenu=new k9Menu(this); + m_format=PAL; +} + + +k9NewDVD::~k9NewDVD() {} + +int k9NewDVDItems::compareItems(QPtrCollection::Item item1,QPtrCollection::Item item2) { + k9Title *_i1=(k9Title*) item1; + k9Title *_i2=(k9Title*) item2; + + return (_i1->getNum() - _i2->getNum()); + + +} + +void k9NewDVD::execute() { + m_cancel=false; + m_error=""; + m_config=new k9Config(); + // connect(m_process, SIGNAL(receivedStderr(KProcess *, char *, int)),this, SLOT(getStderr(KProcess *, char *, int) )); + + connect(&m_aviDecode,SIGNAL(drawFrame(QImage*)),this,SLOT(drawImage(QImage*))); + k9Tools::clearOutput(m_workDir+"dvd"); + createXML(); + disconnect(&m_aviDecode,SIGNAL(drawFrame(QImage*)),this,SLOT(drawImage(QImage*))); + delete m_config; +} + +#include "k9newdvd.moc" + + +void k9NewDVD::drawImage(QImage * _image) { +// m_progress->setImage(*_image); +} + +void k9NewDVD::setFormat ( const eFormat& _value ) { + m_format = _value; + m_rootMenu->setFormat((k9Menu::eFormat)_value); + for (k9Title *title=m_titles.first();title;title=m_titles.next()) { + title->getMenu()->setFormat((k9Menu::eFormat)_value); + } + +} + +void k9NewDVD::createXML() { + + m_rootMenu->setWorkDir(m_workDir); + + QString menuFileName=m_workDir+KApplication::randomString(8)+".mpg"; + m_rootMenu->setMenuFileName(menuFileName); + + m_xml=new QDomDocument(); + QDomElement root = m_xml->createElement( "dvdauthor" ); + root.setAttribute ("dest",m_workDir+"dvd"); + m_xml->appendChild( root ); + + // Create vmgm menu + QDomElement vmgm = m_xml->createElement("vmgm"); + root.appendChild(vmgm); + m_processList->addProgress(i18n("Creating root menu")); + m_rootMenu->createMenus(&vmgm); + + addTitles(root); + m_processList->execute(); + m_totalEncodedSize=0; + m_offset=0; + m_lastvalue=0; + for ( QStringList::Iterator it = m_tmpFiles.begin(); it != m_tmpFiles.end(); ++it ) { + QString file= *it; + if (file.endsWith(".mpeg")) { + QFileInfo f(file); + m_totalEncodedSize+=f.size(); + } + } + m_totalEncodedSize/=1024*1024; + m_cancel=m_processList->getCancel(); + bool error=false; + if (!m_cancel) { + QString dvdAuthor(m_workDir+"/"+KApplication::randomString(8)+".xml"); + QFile file( dvdAuthor); + + file.open(IO_WriteOnly); + QTextStream stream( &file ); + m_xml->save(stream,1); + file.close(); + + m_processList->clear(); + k9Process *process=m_processList->addProcess(i18n("authoring")); + connect(process, SIGNAL(receivedStderr(KProcess *, char *, int)),this, SLOT(getStderr(KProcess *, char *, int) )); + *process << "dvdauthor" << "-x" << dvdAuthor; + m_processList->execute(); + m_cancel=m_processList->getCancel(); + error=m_processList->getError(); + // else + // m_error=i18n("An error occured while running dvdauthor"); + + file.remove(); + } + if (m_cancel) + m_error=i18n("The dvd authoring was canceled"); + else if (error) + m_error=i18n("An error occured while running DVDAuthor:\n")+ m_stdout; + QFile::remove(menuFileName); + for ( QStringList::Iterator it = m_tmpFiles.begin(); it != m_tmpFiles.end(); ++it ) { + QFile::remove(*it); + } + m_tmpFiles.clear(); + if (m_error !="") { + KMessageBox::error( 0, m_error, i18n("Authoring")); + } + delete m_xml; + +} + +void k9NewDVD::addTitles (QDomElement &_root) { + calcVideoBitrate(); + for (k9Title *title=m_titles.first();title && !m_cancel;title=m_titles.next()) { + QDomElement titleSet = m_xml->createElement("titleset"); + _root.appendChild(titleSet); + QDomElement pgc; + k9Menu *menu=title->getMenu(); + menu->setWorkDir(m_workDir); + QString menuFileName=m_workDir+KApplication::randomString(8)+".mpg"; + m_tmpFiles << menuFileName, + menu->setMenuFileName(menuFileName); + m_processList->addProgress(i18n("Creating menu for title %1").arg(title->getNum()+1)); + menu->createMenus(&titleSet); + + QDomElement eTitle=m_xml->createElement("titles"); + titleSet.appendChild(eTitle); + QDomElement e=m_xml->createElement("video"); + e.setAttribute("aspect","16:9"); + e.setAttribute("format",m_format==PAL?"PAL":"NTSC"); +// if (l_track->getaspectRatio()!="4:3") { + e.setAttribute("widescreen","nopanscan"); +// }setProgressWindow + eTitle.appendChild(e); + + e=m_xml->createElement("audio"); + e.setAttribute("format","ac3"); + e.setAttribute("channels","2"); + eTitle.appendChild(e); + + pgc=m_xml->createElement("pgc"); + eTitle.appendChild(pgc); + QDomElement post=m_xml->createElement("post"); + pgc.appendChild(post); + QDomText txt=m_xml->createTextNode(title->getMenu()->getEndScript()); + post.appendChild(txt); + + QPtrList *l=title->getFiles(); + for (k9AviFile *aviFile= l->first();aviFile && !m_cancel;aviFile=l->next()) { + if ( aviFile->getPrevious()==NULL || aviFile->getBreakPrevious()) { + QString cmd="",chapters=""; + createMencoderCmd(cmd,chapters,aviFile); + e=m_xml->createElement("vob"); + e.setAttribute("file",cmd); + e.setAttribute("chapters",chapters); + pgc.appendChild(e); + m_tmpFiles << cmd; + } + } + } + +} + +void k9NewDVD::setWorkDir ( const QString& _value ) { + m_workDir = _value; + if (!m_workDir.endsWith("/")) + m_workDir +="/"; +} + +void k9NewDVD::createMencoderCmd(QString &_cmd,QString &_chapters, k9AviFile *_aviFile) { + // m_aviDecode.open(_aviFile->getFileName()); + m_timer.start(); + m_timer2.start(); + m_timer3.start(); + QTime end; + k9AviFile *file=_aviFile; + bool bEnd; + _chapters="0"; + do { + end=file->getEnd(); + bEnd= (file->getNext()==NULL) || (file->getBreakNext()); + file=file->getNext(); + if (!bEnd) { + int lt=_aviFile->getStart().msecsTo(end); + QTime t; + t=t.addMSecs(lt); + _chapters +="," + t.toString("hh:mm:ss"); + } + } while (!bEnd); + + QString fileName= m_workDir + KApplication::randomString(8)+".mpeg"; + QString t1=_aviFile->getStart().toString("hh:mm:ss.zzz"); + int length=_aviFile->getStart().msecsTo(end); + QTime l; + l=l.addMSecs(length); + QString t2=l.toString("hh:mm:ss.zzz"); + QString scale; + QString fps; + switch (m_format) { + case PAL: + scale="720:576"; + fps="25"; + break; + case NTSC: + scale="720:480"; + fps="30000/1001"; + break; + } + + k9Process *process=m_processList->addProcess(i18n("Encoding %1").arg(_aviFile->getFileName())); + m_processList->setFileName(process,_aviFile->getFileName()); + + QTime t(0,0); + t.start(); + m_timers[process]=t; + connect(process, SIGNAL(receivedStdout(KProcess *, char *, int)),this, SLOT(getStdout(KProcess *, char *, int) )); + //m_progress->setTitle(i18n("Encoding file")); + //m_process->clearArguments(); + *process << "mencoder" << "-oac" << "lavc" << "-ovc" << "lavc" << "-of" << "mpeg" <<"-afm" <<"libmad"; + *process << "-mpegopts" << "format=dvd" << "-vf" << "scale="+scale+",harddup" << "-srate" << "48000" << "-af" << "lavcresample=48000"; + *process << "-lavcopts" << QString("vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=%1:keyint=15:acodec=%3:abitrate=%2:aspect=16/9").arg(m_videoBitrate).arg(m_config->getPrefAudioBitrate()).arg(m_config->getPrefAudioFormat().lower()); + *process << "-ofps" << fps << "-o" << fileName << "-ss" << t1 << "-endpos" << t2 << _aviFile->getFileName(); + qDebug(process->debug()); +/* + if (!m_progress->execute()) { + m_cancel=true; + if (m_progress->getCanceled()) + m_error=i18n("The dvd authoring was canceled"); + else + m_error=i18n("An error occured while transcoding video"); + } +*/ + + _cmd=fileName; +// m_aviDecode.close(); +} + +void k9NewDVD::getStderr(KProcess *_process, char *_buffer, int _length) { + QCString tmp(_buffer,_length); + m_stdout=tmp; + int pos; + if (tmp.contains("STAT:")) { + pos=tmp.find("fixing VOBU"); + if (pos!=-1) { + QString tmp2=tmp; +// m_progress->setTitle(i18n("Authoring")); +// m_progress->setLabelText(i18n("Fixing VOBUS")); + int end=tmp2.find("%"); + if (end!=-1) { + pos =end -2; + tmp2=tmp2.mid(pos,end-pos); + tmp2=tmp2.stripWhiteSpace(); +// m_progress->setProgress(tmp2.toInt(),100); + } + } else { + pos=tmp.find("STAT: VOBU "); + if (pos !=-1) { + QCString tmp2(_buffer+pos,_length-pos); + int vobu,mb; + sscanf(tmp2.data(),"STAT: VOBU %d at %dMB",&vobu,&mb); + if (mb setProgress((k9Process*)_process,mb+m_offset,m_totalEncodedSize); + } + } + +//STAT: VOBU 16 at 3MB, 1 PGCS + + } + +} + +void k9NewDVD::getStdout(KProcess *_process, char *_buffer, int _length) { + k9Process *process=(k9Process*) _process; + if (m_timers[process].elapsed() >500) { + QCString tmp(_buffer,_length); + int pos=tmp.find("Pos:"); + if (pos!=-1) { + QString tmp2=tmp.mid(pos); + tmp2=tmp2.replace(":",": ").replace("(","").replace(")","").simplifyWhiteSpace(); + QStringList sl=QStringList::split(" ",tmp2); + float position; + sscanf(sl[1].latin1(),"%fs",&position); + int frame; + sscanf(sl[2].latin1(),"%df",&frame); + int percent; + sscanf(sl[3].latin1(),"%d",&percent); + int fps; + sscanf(sl[4].latin1(),"%d",&fps); + m_processList->setProgress(process,percent,100); + m_processList->setPos(process,position); + //m_progress->setProgress(percent,100); + // if (percent>0 &&m_timer3.elapsed() >1000 ) { + if (percent>0 ) { + int elapsed=process->getElapsed(); + QTime time2(0,0); + time2=time2.addMSecs(elapsed); + QTime time3(0,0); + float fprc=percent/100.0; + time3=time3.addMSecs((uint32_t)(elapsed*(1.0/fprc))); + m_processList->setText(process,time2.toString("hh:mm:ss") +" / " + time3.toString("hh:mm:ss"),1); + m_timer3.restart(); + } + + QString text;//=i18n("filename") + " : " + m_aviDecode.getFileName(); + text=i18n("fps")+ " : "+QString::number(fps); + m_processList->setText(process,text,2); + /* + m_progress->setLabelText(text); + if (m_timer.elapsed() > 5000) { + m_timer.restart(); + if (m_aviDecode.opened()) { + m_aviDecode.readFrame(position); + } + } + */ + } + m_timers[process].restart(); + } +} + +void k9NewDVD::appendTitle(k9Title *_title) { + m_config=new k9Config(); + m_titles.append(_title); + m_titles.sort(); + //create the menu button + k9MenuButton *btn=m_rootMenu->addButton(); + _title->setButton(btn); + btn->setNum(_title->getNum()+1); + QPixmap px(m_config->getPrefButtonWidth(),m_config->getPrefButtonHeight()); + px.fill(Qt::black); + QImage img=px.convertToImage(); + btn->setImage(img); + int nbColumn=(720-50)/(m_config->getPrefButtonWidth()+50); + int top=(int) _title->getNum()/nbColumn ; + int left=_title->getNum() %nbColumn; + btn->setTop(top*(m_config->getPrefButtonHeight()+20) +50); + btn->setLeft(left*(m_config->getPrefButtonWidth()+50) +50); + btn->setWidth(m_config->getPrefButtonWidth()); + btn->setHeight(m_config->getPrefButtonHeight()); + btn->setScript(QString("g1=0;jump titleset %1 menu;").arg(_title->getNum()+1)); + btn->setTextPosition(k9MenuButton::RIGHT); + btn->setText(i18n("title %1").arg(_title->getNum()+1)); + btn->setColor(m_config->getPrefButtonTextColor()); + btn->setFont(m_config->getPrefButtonFont()); + + QString script="\n"; + for (k9Title *t = m_titles.first();t;t=m_titles.next()) { + script +=QString("if (g6== %1) { g6=0; jump titleset %2 menu;}\n").arg(t->getNum()+1).arg(t->getNum()+1); + } + m_rootMenu->setStartScript2(script); + emit sigAddTitle(); + delete m_config; +} + + + +void k9NewDVD::setProcessList(k9ProcessList *_value) { + m_processList=_value; +} + + +k9NewDVD::eFormat k9NewDVD::getFormat() const { + return m_format; +} + + +k9Menu* k9NewDVD::getRootMenu() const { + return m_rootMenu; +} + +void k9NewDVD::calcVideoBitrate() { + // bitrate video = (MB *8388.608) /SEC - bitrate audio + int length=0; + for (k9Title *title=m_titles.first();title;title=m_titles.next()) { + k9TitleItems *chapters=title->getFiles(); + for (k9AviFile *chapter=chapters->first();chapter;chapter=chapters->next()) { + length+=chapter->getStart().msecsTo(chapter->getEnd()); + } + } + int size=m_config->getPrefSize(); + double sec=(double)length/1000.0; + // m_videoBitrate=(int)( (size * 8388.608)/sec - 192); + m_videoBitrate=8*((size*1024 - (m_config->getPrefAudioBitrate() * sec/8))/sec); + m_videoBitrate=QMIN(m_videoBitrate,9800); +} + +int k9NewDVD::getTotalTime() { + int total=0; + for (k9Title * title=m_titles.first();title;title=m_titles.next()) { + k9TitleItems *chapters=title->getFiles(); + for (k9AviFile *chapter=chapters->first();chapter;chapter=chapters->next()) { + total+=chapter->getStart().secsTo(chapter->getEnd()); + } + } + return total; +} + +QString k9NewDVD::getError() const { + return m_error; +} diff --git a/k9author/k9newdvd.h b/k9author/k9newdvd.h new file mode 100644 index 0000000..bc56b95 --- /dev/null +++ b/k9author/k9newdvd.h @@ -0,0 +1,95 @@ +// +// C++ Interface: k9newdvd +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9NEWDVD_H +#define K9NEWDVD_H + +#include "k9common.h" +#include +#include +#include +#include +#include "k9process.h" +#include "k9progress.h" +#include "k9avidecode.h" +#include "k9config.h" + + +/** + @author Jean-Michel PETIT +*/ +class k9Title; +class k9AviFile; +class k9Menu; +class k9ProcessList; +class k9NewDVDItems : public QPtrList { +protected: + virtual int compareItems ( QPtrCollection::Item item1,QPtrCollection::Item item2 ); +}; + +class k9NewDVD : public QObject { + Q_OBJECT +public: + enum eFormat {NTSC=2,PAL=1}; + k9NewDVD ( QObject *parent = 0, const char *name = 0 ); + ~k9NewDVD(); + k9NewDVDItems* getTitles() { + return &m_titles; + } + eFormat m_format; + + void execute(); + void createXML(); + void addTitles ( QDomElement &_root ); + void setFormat ( const eFormat& _value ); + + void setWorkDir ( const QString& _value ); + void appendTitle ( k9Title *_title ); + + void setProcessList(k9ProcessList *_value); + eFormat getFormat() const; + + int getTotalTime(); + k9Menu* getRootMenu() const; + + QString getError() const; + +private: + k9NewDVDItems m_titles; + QStringList m_tmpFiles; + QDomDocument *m_xml; + QString m_workDir; + k9ProcessList *m_processList; + QTime m_timer; + QTime m_timer2; + QTime m_timer3; + k9Menu *m_rootMenu; + bool m_cancel; + QString m_error; + QString m_stdout; + int m_videoBitrate; + k9AviDecode m_aviDecode; + int m_totalEncodedSize; + int m_offset; + int m_lastvalue; + QMap m_timers; + void calcVideoBitrate(); + void createMencoderCmd ( QString &_cmd,QString &_chapters, k9AviFile *_aviFile ); + k9Config *m_config; +protected slots: + void getStdout ( KProcess *, char *, int ); + void getStderr ( KProcess *, char *, int ); + void drawImage ( QImage * _image ); +signals: + void sigAddTitle(); +}; + +#endif diff --git a/k9author/k9newtitle.cpp b/k9author/k9newtitle.cpp new file mode 100644 index 0000000..a229812 --- /dev/null +++ b/k9author/k9newtitle.cpp @@ -0,0 +1,171 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9newtitle.h" +#include "k9import.h" +#include +#include +#include +#include +#include +#include "k9menu.h" +#include "k9menubutton.h" +#include "kpushbutton.h" +#include +#include +k9NewTitle::k9NewTitle(QWidget* parent, const char* name, WFlags fl) + : newTitle(parent,name,fl) { + m_fileName=""; +} + +k9NewTitle::~k9NewTitle() {} + +/*$SPECIALIZATION$*/ + +void k9NewTitle::fileSelected(const QString &_fileName) { + m_fileName=_fileName; + k9AviDecode fileInfo(0,0); + fileInfo.open(m_fileName); + double duration=fileInfo.getDuration(); + fileInfo.close(); + QTime t(0,0,0); + t=t.addSecs(duration); + lTotalTime->setText(t.toString("hh:mm:ss")); + bAdd->setEnabled(true); +} + +void k9NewTitle::drawImage (QImage *_image) { + m_image=*_image; +} + +void k9NewTitle::bAddClicked() { + k9Config config; + k9AviDecode fileInfo(0,0); + if (!fileInfo.open(m_fileName)) { + KMessageBox::error(this,fileInfo.getError(),i18n("Add title")); + return; + } + this->setCursor(KCursor::waitCursor()); + + k9LvItemImport * item=new k9LvItemImport(m_k9Import->getRoot(),k9LvItemImport::TITLE); + item->setOpen(true); + k9Title *title=new k9Title( m_k9Import->getNewDVD()); + item->setText(0,i18n("title %1").arg(title->getNum() +1)); + + connect( title->getButton(),SIGNAL(sigsetImage(k9MenuButton*, const QImage&)),m_k9Import,SLOT(buttonUpdated(k9MenuButton*, const QImage&))); + item->setTitle(title); + + + connect(&fileInfo,SIGNAL(drawFrame(QImage*)),this,SLOT(drawImage(QImage*))); + + + + QTime t; + m_k9Import->getRoot()->listView()->setColumnWidthMode(0,QListView::Maximum); + item->setText(1,t.addSecs(fileInfo.getDuration()).toString("hh:mm:ss")); + + double increment; + int maxCh; + if (rbLength->isOn()) { + QTime t; + increment=t.secsTo(twLength->time()); + maxCh=999; + } + + if (rbNumber->isOn()) { + increment=fileInfo.getDuration() /nbChapters->value(); + maxCh=nbChapters->value(); + } + + double pos=0; + k9AviFile *last=NULL; + int width=config.getPrefButtonWidth(); + int height=config.getPrefButtonHeight(); + int left=-width+20; + int top=50; + + int i=-1; + while ( pos setImage(m_image); + if (i==0) + title->getButton()->setImage(m_image); + + file->setPrevious(last); + if (last !=NULL) + last->setNext(file); + last=file; + + file->setFileName(m_fileName); + file->setStart(t.addMSecs(pos*1000)); + pos+=increment; + file->setEnd(t.addMSecs(QMIN(pos,fileInfo.getDuration()) *1000)); + k9LvItemImport * itemch=new k9LvItemImport(item,k9LvItemImport::CHAPTER); + itemch->setText(0,i18n("chapter %1").arg(i+1)); + itemch->setText(1,file->getStart().toString("hh:mm:ss") +" - "+file->getEnd().toString("hh:mm:ss") ); + itemch->setAviFile(file); + itemch->setTitle(title); + itemch->setPixmap(0,QPixmap(m_image.smoothScale(50,40))); + connect(file,SIGNAL(aviFileUpdated(k9AviFile*)),m_k9Import,SLOT(aviFileUpdated(k9AviFile*))); + + k9MenuButton *btn=title->getMenu()->addButton(); + btn->setNum(i+1); + //_title->setButton(btn); + btn->setImage(m_image); + left +=width+10; + if (left +width >720) { + left=30; + top+=height+25; + } + btn->setTop(top); + btn->setLeft(left); + btn->setWidth(width); + btn->setHeight(height); + btn->setScript(QString("jump title 1 chapter %1 ;").arg(i+1)); + btn->setTextPosition(k9MenuButton::BOTTOM); + btn->setText(i18n("chapter %1").arg(i+1)); + btn->setColor(config.getPrefButtonTextColor()); + btn->setFont(config.getPrefButtonFont()); + connect(file,SIGNAL(imageChanged(const QImage&)),btn,SLOT(setImage(const QImage&))); + + } + title->getMenu()->setEndScript("call vmgm menu;"); + fileInfo.close(); + m_k9Import->lvDVD->setSortColumn(0); + m_k9Import->lvDVD->sort(); + m_k9Import->setEnableCreate(true); + m_k9Import->updateTotalTime(); + this->setCursor(KCursor::arrowCursor()); +} + +void k9NewTitle::rbNumberClicked() { + twLength->setEnabled(false); + nbChapters->setEnabled(true); +} + +void k9NewTitle::rbLengthClicked() { + twLength->setEnabled(true); + nbChapters->setEnabled(false); + +} + +#include "k9newtitle.moc" + + + +void k9NewTitle::setK9Import ( k9Import* _value ) { + m_k9Import = _value; +} diff --git a/k9author/k9newtitle.h b/k9author/k9newtitle.h new file mode 100644 index 0000000..8df44f3 --- /dev/null +++ b/k9author/k9newtitle.h @@ -0,0 +1,52 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9NEWTITLE_H +#define K9NEWTITLE_H + +#include "k9common.h" +#include "../k9author/newTitle.h" +#include "k9lvitemimport.h" +#include + +class k9Import; +class k9NewTitle : public newTitle +{ + Q_OBJECT +private: + k9Import *m_k9Import; + QString m_fileName; + QImage m_image; +public: + k9NewTitle(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9NewTitle(); + void setK9Import ( k9Import* _value ); + + /*$PUBLIC_FUNCTIONS$*/ + +public slots: + /*$PUBLIC_SLOTS$*/ + +protected: + /*$PROTECTED_FUNCTIONS$*/ + +protected slots: + /*$PROTECTED_SLOTS$*/ + virtual void fileSelected(const QString &); + virtual void bAddClicked(); + virtual void rbNumberClicked(); + virtual void rbLengthClicked(); + virtual void drawImage (QImage *_image); +}; + +#endif + diff --git a/k9author/k9title.cpp b/k9author/k9title.cpp new file mode 100644 index 0000000..d2603e5 --- /dev/null +++ b/k9author/k9title.cpp @@ -0,0 +1,64 @@ +// +// C++ Implementation: k9title +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9title.h" +#include "k9newdvd.h" +#include "k9menu.h" + +k9Title::k9Title(k9NewDVD *parent, const char *name) + : QObject(parent, name) +{ + m_num=parent->getTitles()->count(); + parent->appendTitle(this); + m_menu=new k9Menu(this,0); + m_menu->setFormat((k9Menu::eFormat)parent->getFormat()); +} + + +k9Title::~k9Title() +{ +} + +int k9TitleItems::compareItems(QPtrCollection::Item item1,QPtrCollection::Item item2) { + k9AviFile *i1,*i2; + i1=(k9AviFile*) item1; + i2=(k9AviFile*) item2; + return (i1->getNum() - i2->getNum()); +} + +#include "k9title.moc" + + +k9TitleItems *k9Title::getFiles() +{ + return &m_files; +} + + +int k9Title::getNum() const +{ + return m_num; +} + + +k9MenuButton* k9Title::getButton() const { + return m_button; +} + + +void k9Title::setButton(k9MenuButton* _value) { + m_button = _value; +} + + +k9Menu* k9Title::getMenu() const { + return m_menu; +} diff --git a/k9author/k9title.h b/k9author/k9title.h new file mode 100644 index 0000000..8828a7d --- /dev/null +++ b/k9author/k9title.h @@ -0,0 +1,57 @@ +// +// C++ Interface: k9title +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9TITLE_H +#define K9TITLE_H + +#include "k9common.h" +#include +#include +#include "k9avifile.h" +#include "k9menubutton.h" +/** + @author Jean-Michel PETIT +*/ +class k9NewDVD; +class k9Menu; + +class k9TitleItems : public QPtrList { +protected: + virtual int compareItems(QPtrCollection::Item item1,QPtrCollection::Item item2); +}; + +class k9Title : public QObject { + Q_OBJECT +public: + k9Title(k9NewDVD *parent = 0, const char *name = 0); + ~k9Title(); + + k9TitleItems *getFiles(); + + int getNum() const; + + void setButton(k9MenuButton* _value); + + + k9MenuButton* getButton() const; + + k9Menu* getMenu() const; + + + +private: + k9TitleItems m_files; + int m_num; + k9MenuButton *m_button; + k9Menu *m_menu; +}; + +#endif diff --git a/k9author/menuEdit.cpp b/k9author/menuEdit.cpp new file mode 100644 index 0000000..db313d2 --- /dev/null +++ b/k9author/menuEdit.cpp @@ -0,0 +1,211 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './menuEdit.ui' +** +** Created: dim. oct. 26 08:56:28 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "menuEdit.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kurlrequester.h" +#include "klineedit.h" +#include "kpushbutton.h" +#include "kcolorbutton.h" + +/* + * Constructs a menuEdit as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +menuEdit::menuEdit( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "menuEdit" ); + menuEditLayout = new QGridLayout( this, 1, 1, 2, 6, "menuEditLayout"); + + textLabel2 = new QLabel( this, "textLabel2" ); + textLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) ); + + menuEditLayout->addMultiCellWidget( textLabel2, 5, 6, 0, 0 ); + + textLabel1 = new QLabel( this, "textLabel1" ); + textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) ); + + menuEditLayout->addWidget( textLabel1, 4, 0 ); + + urBackground = new KURLRequester( this, "urBackground" ); + + menuEditLayout->addMultiCellWidget( urBackground, 4, 4, 1, 5 ); + + cbColor = new KColorButton( this, "cbColor" ); + cbColor->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, cbColor->sizePolicy().hasHeightForWidth() ) ); + + menuEditLayout->addWidget( cbColor, 6, 1 ); + + bFont = new KPushButton( this, "bFont" ); + bFont->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bFont->sizePolicy().hasHeightForWidth() ) ); + + menuEditLayout->addWidget( bFont, 6, 2 ); + + cbPosTitle = new QComboBox( FALSE, this, "cbPosTitle" ); + cbPosTitle->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, cbPosTitle->sizePolicy().hasHeightForWidth() ) ); + + menuEditLayout->addWidget( cbPosTitle, 6, 3 ); + spacer1 = new QSpacerItem( 51, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + menuEditLayout->addMultiCell( spacer1, 6, 6, 4, 5 ); + + leTitle = new QLineEdit( this, "leTitle" ); + + menuEditLayout->addMultiCellWidget( leTitle, 5, 5, 1, 4 ); + + bAddText = new KPushButton( this, "bAddText" ); + bAddText->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)4, 0, 0, bAddText->sizePolicy().hasHeightForWidth() ) ); + bAddText->setMinimumSize( QSize( 24, 24 ) ); + bAddText->setMaximumSize( QSize( 24, 24 ) ); + + menuEditLayout->addWidget( bAddText, 5, 5 ); + + lTitle = new QLabel( this, "lTitle" ); + lTitle->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, lTitle->sizePolicy().hasHeightForWidth() ) ); + QFont lTitle_font( lTitle->font() ); + lTitle_font.setBold( TRUE ); + lTitle->setFont( lTitle_font ); + + menuEditLayout->addMultiCellWidget( lTitle, 0, 0, 0, 5 ); + + textLabel1_2 = new QLabel( this, "textLabel1_2" ); + + menuEditLayout->addWidget( textLabel1_2, 2, 0 ); + + cbStart = new QComboBox( FALSE, this, "cbStart" ); + + menuEditLayout->addMultiCellWidget( cbStart, 2, 2, 1, 5 ); + + textLabel1_2_2 = new QLabel( this, "textLabel1_2_2" ); + + menuEditLayout->addWidget( textLabel1_2_2, 3, 0 ); + + cbEnd = new QComboBox( FALSE, this, "cbEnd" ); + + menuEditLayout->addMultiCellWidget( cbEnd, 3, 3, 1, 5 ); + + frame = new QFrame( this, "frame" ); + frame->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, frame->sizePolicy().hasHeightForWidth() ) ); + frame->setFrameShape( QFrame::StyledPanel ); + frame->setFrameShadow( QFrame::Raised ); + + menuEditLayout->addMultiCellWidget( frame, 1, 1, 0, 5 ); + languageChange(); + resize( QSize(576, 682).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bFont, SIGNAL( clicked() ), this, SLOT( bFontClick() ) ); + connect( urBackground, SIGNAL( urlSelected(const QString&) ), this, SLOT( urBackgroundSelected(const QString&) ) ); + connect( cbColor, SIGNAL( changed(const QColor&) ), this, SLOT( cbColorChanged(const QColor&) ) ); + connect( leTitle, SIGNAL( textChanged(const QString&) ), this, SLOT( leTitleChanged(const QString&) ) ); + connect( cbPosTitle, SIGNAL( activated(int) ), this, SLOT( cbPosTitleActivated(int) ) ); + connect( bAddText, SIGNAL( clicked() ), this, SLOT( bAddTextClick() ) ); + connect( cbStart, SIGNAL( activated(int) ), this, SLOT( cbStartActivated(int) ) ); + connect( cbEnd, SIGNAL( activated(int) ), this, SLOT( cbEndActivated(int) ) ); + + // tab order + setTabOrder( cbStart, cbEnd ); + setTabOrder( cbEnd, urBackground ); + setTabOrder( urBackground, leTitle ); + setTabOrder( leTitle, bAddText ); + setTabOrder( bAddText, cbColor ); + setTabOrder( cbColor, bFont ); + setTabOrder( bFont, cbPosTitle ); +} + +/* + * Destroys the object and frees any allocated resources + */ +menuEdit::~menuEdit() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void menuEdit::languageChange() +{ + setCaption( tr2i18n( "Edit Menu" ) ); + textLabel2->setText( tr2i18n( "Text" ) ); + textLabel1->setText( tr2i18n( "Background picture" ) ); + cbColor->setText( QString::null ); + bFont->setText( tr2i18n( "Font" ) ); + cbPosTitle->clear(); + cbPosTitle->insertItem( tr2i18n( "Bottom" ) ); + cbPosTitle->insertItem( tr2i18n( "Right" ) ); + bAddText->setText( QString::null ); + bAddText->setAccel( QKeySequence( QString::null ) ); + lTitle->setText( tr2i18n( "Root Menu" ) ); + textLabel1_2->setText( tr2i18n( "At start" ) ); + cbStart->clear(); + cbStart->insertItem( tr2i18n( "Play menu" ) ); + cbStart->insertItem( tr2i18n( "Play title 1" ) ); + textLabel1_2_2->setText( tr2i18n( "At End" ) ); + cbEnd->clear(); + cbEnd->insertItem( tr2i18n( "Play root menu" ) ); + cbEnd->insertItem( tr2i18n( "Play title menu" ) ); + cbEnd->insertItem( tr2i18n( "Play title 1" ) ); +} + +void menuEdit::bFontClick() +{ + qWarning( "menuEdit::bFontClick(): Not implemented yet" ); +} + +void menuEdit::urBackgroundSelected(const QString&) +{ + qWarning( "menuEdit::urBackgroundSelected(const QString&): Not implemented yet" ); +} + +void menuEdit::cbColorChanged(const QColor&) +{ + qWarning( "menuEdit::cbColorChanged(const QColor&): Not implemented yet" ); +} + +void menuEdit::leTitleChanged(const QString&) +{ + qWarning( "menuEdit::leTitleChanged(const QString&): Not implemented yet" ); +} + +void menuEdit::cbPosTitleActivated(int) +{ + qWarning( "menuEdit::cbPosTitleActivated(int): Not implemented yet" ); +} + +void menuEdit::bAddTextClick() +{ + qWarning( "menuEdit::bAddTextClick(): Not implemented yet" ); +} + +void menuEdit::cbStartActivated(int) +{ + qWarning( "menuEdit::cbStartActivated(int): Not implemented yet" ); +} + +void menuEdit::cbEndActivated(int) +{ + qWarning( "menuEdit::cbEndActivated(int): Not implemented yet" ); +} + +#include "menuEdit.moc" diff --git a/k9author/menuEdit.ui b/k9author/menuEdit.ui new file mode 100644 index 0000000..02c0776 --- /dev/null +++ b/k9author/menuEdit.ui @@ -0,0 +1,342 @@ + +menuEdit + + + menuEdit + + + + 0 + 0 + 576 + 682 + + + + Edit Menu + + + + unnamed + + + 2 + + + + textLabel2 + + + + 0 + 5 + 0 + 0 + + + + Text + + + + + textLabel1 + + + + 0 + 5 + 0 + 0 + + + + Background picture + + + + + urBackground + + + + + cbColor + + + + 0 + 0 + 0 + 0 + + + + + + + + + bFont + + + + 0 + 0 + 0 + 0 + + + + Font + + + + + + Bottom + + + + + Right + + + + cbPosTitle + + + + 0 + 0 + 0 + 0 + + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 51 + 20 + + + + + + leTitle + + + + + bAddText + + + + 4 + 4 + 0 + 0 + + + + + 24 + 24 + + + + + 24 + 24 + + + + + + + + + + + + lTitle + + + + 5 + 0 + 0 + 0 + + + + + 1 + + + + Root Menu + + + + + textLabel1_2 + + + At start + + + + + + Play menu + + + + + Play title 1 + + + + cbStart + + + + + textLabel1_2_2 + + + At End + + + + + + Play root menu + + + + + Play title menu + + + + + Play title 1 + + + + cbEnd + + + + + frame + + + + 5 + 7 + 0 + 0 + + + + StyledPanel + + + Raised + + + + + + + bFont + clicked() + menuEdit + bFontClick() + + + urBackground + urlSelected(const QString&) + menuEdit + urBackgroundSelected(const QString&) + + + cbColor + changed(const QColor&) + menuEdit + cbColorChanged(const QColor&) + + + leTitle + textChanged(const QString&) + menuEdit + leTitleChanged(const QString&) + + + cbPosTitle + activated(int) + menuEdit + cbPosTitleActivated(int) + + + bAddText + clicked() + menuEdit + bAddTextClick() + + + cbStart + activated(int) + menuEdit + cbStartActivated(int) + + + cbEnd + activated(int) + menuEdit + cbEndActivated(int) + + + + cbStart + cbEnd + urBackground + leTitle + bAddText + cbColor + bFont + cbPosTitle + + + bFontClick() + urBackgroundSelected(const QString &) + cbColorChanged(const QColor&) + leTitleChanged(const QString &) + cbPosTitleActivated(int) + bAddTextClick() + cbStartActivated(int) + cbEndActivated(int) + + + + kurlrequester.h + klineedit.h + kpushbutton.h + kcolorbutton.h + kpushbutton.h + kpushbutton.h + + diff --git a/k9author/newTitle.cpp b/k9author/newTitle.cpp new file mode 100644 index 0000000..25786de --- /dev/null +++ b/k9author/newTitle.cpp @@ -0,0 +1,158 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './newTitle.ui' +** +** Created: dim. oct. 26 08:56:29 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "newTitle.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "knuminput.h" +#include "ktimewidget.h" +#include "kpushbutton.h" +#include "kurlrequester.h" +#include "klineedit.h" + +/* + * Constructs a newTitle as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +newTitle::newTitle( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "newTitle" ); + newTitleLayout = new QGridLayout( this, 1, 1, 11, 6, "newTitleLayout"); + + buttonGroup1 = new QButtonGroup( this, "buttonGroup1" ); + buttonGroup1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, buttonGroup1->sizePolicy().hasHeightForWidth() ) ); + buttonGroup1->setColumnLayout(0, Qt::Vertical ); + buttonGroup1->layout()->setSpacing( 6 ); + buttonGroup1->layout()->setMargin( 11 ); + buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() ); + buttonGroup1Layout->setAlignment( Qt::AlignTop ); + + nbChapters = new KIntNumInput( buttonGroup1, "nbChapters" ); + nbChapters->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, nbChapters->sizePolicy().hasHeightForWidth() ) ); + nbChapters->setMinValue( 1 ); + nbChapters->setMaxValue( 99 ); + + buttonGroup1Layout->addWidget( nbChapters, 0, 1 ); + + twLength = new KTimeWidget( buttonGroup1, "twLength" ); + twLength->setEnabled( FALSE ); + twLength->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, twLength->sizePolicy().hasHeightForWidth() ) ); + + buttonGroup1Layout->addWidget( twLength, 1, 1 ); + + rbNumber = new QRadioButton( buttonGroup1, "rbNumber" ); + rbNumber->setChecked( TRUE ); + + buttonGroup1Layout->addWidget( rbNumber, 0, 0 ); + + rbLength = new QRadioButton( buttonGroup1, "rbLength" ); + + buttonGroup1Layout->addWidget( rbLength, 1, 0 ); + spacer1 = new QSpacerItem( 131, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + buttonGroup1Layout->addMultiCell( spacer1, 0, 1, 2, 2 ); + + newTitleLayout->addMultiCellWidget( buttonGroup1, 1, 1, 0, 1 ); + spacer3 = new QSpacerItem( 21, 16, QSizePolicy::Minimum, QSizePolicy::Expanding ); + newTitleLayout->addItem( spacer3, 3, 0 ); + spacer4 = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + newTitleLayout->addItem( spacer4, 1, 2 ); + + bAdd = new KPushButton( this, "bAdd" ); + bAdd->setEnabled( FALSE ); + bAdd->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bAdd->sizePolicy().hasHeightForWidth() ) ); + bAdd->setProperty( "stdItem", 27 ); + + newTitleLayout->addWidget( bAdd, 2, 1 ); + spacer2 = new QSpacerItem( 470, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + newTitleLayout->addItem( spacer2, 2, 0 ); + + layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); + + textLabel1 = new QLabel( this, "textLabel1" ); + textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) ); + layout1->addWidget( textLabel1 ); + + urFile = new KURLRequester( this, "urFile" ); + urFile->setMode( 25 ); + layout1->addWidget( urFile ); + + lTotalTime = new QLabel( this, "lTotalTime" ); + lTotalTime->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, lTotalTime->sizePolicy().hasHeightForWidth() ) ); + layout1->addWidget( lTotalTime ); + + newTitleLayout->addMultiCellLayout( layout1, 0, 0, 0, 1 ); + languageChange(); + resize( QSize(605, 171).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( urFile, SIGNAL( urlSelected(const QString&) ), this, SLOT( fileSelected(const QString&) ) ); + connect( rbNumber, SIGNAL( clicked() ), this, SLOT( rbNumberClicked() ) ); + connect( rbLength, SIGNAL( clicked() ), this, SLOT( rbLengthClicked() ) ); + connect( bAdd, SIGNAL( clicked() ), this, SLOT( bAddClicked() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +newTitle::~newTitle() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void newTitle::languageChange() +{ + setCaption( tr2i18n( "Add title" ) ); + buttonGroup1->setTitle( QString::null ); + rbNumber->setText( tr2i18n( "number of chapters" ) ); + rbLength->setText( tr2i18n( "chapter length" ) ); + bAdd->setText( tr2i18n( "Add" ) ); + bAdd->setAccel( QKeySequence( QString::null ) ); + textLabel1->setText( tr2i18n( "Video file" ) ); + lTotalTime->setText( tr2i18n( "--:--:--" ) ); +} + +void newTitle::fileSelected(const QString&) +{ + qWarning( "newTitle::fileSelected(const QString&): Not implemented yet" ); +} + +void newTitle::rbNumberClicked() +{ + qWarning( "newTitle::rbNumberClicked(): Not implemented yet" ); +} + +void newTitle::rbLengthClicked() +{ + qWarning( "newTitle::rbLengthClicked(): Not implemented yet" ); +} + +void newTitle::bAddClicked() +{ + qWarning( "newTitle::bAddClicked(): Not implemented yet" ); +} + +#include "newTitle.moc" diff --git a/k9author/newTitle.ui b/k9author/newTitle.ui new file mode 100644 index 0000000..c68ab88 --- /dev/null +++ b/k9author/newTitle.ui @@ -0,0 +1,284 @@ + +newTitle + + + newTitle + + + + 0 + 0 + 605 + 171 + + + + Add title + + + + unnamed + + + + buttonGroup1 + + + + 5 + 0 + 0 + 0 + + + + + + + + unnamed + + + + nbChapters + + + + 1 + 0 + 0 + 0 + + + + 1 + + + 99 + + + + + twLength + + + false + + + + 0 + 5 + 0 + 0 + + + + + + rbNumber + + + number of chapters + + + true + + + + + rbLength + + + chapter length + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 131 + 21 + + + + + + + + spacer3 + + + Vertical + + + Expanding + + + + 21 + 16 + + + + + + spacer4 + + + Horizontal + + + Expanding + + + + 16 + 20 + + + + + + bAdd + + + false + + + + 0 + 0 + 0 + 0 + + + + Add + + + + + + 27 + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 470 + 20 + + + + + + layout1 + + + + unnamed + + + + textLabel1 + + + + 0 + 0 + 0 + 0 + + + + Video file + + + + + urFile + + + 25 + + + + + lTotalTime + + + + 0 + 0 + 0 + 0 + + + + --:--:-- + + + + + + + + + urFile + urlSelected(const QString&) + newTitle + fileSelected(const QString&) + + + rbNumber + clicked() + newTitle + rbNumberClicked() + + + rbLength + clicked() + newTitle + rbLengthClicked() + + + bAdd + clicked() + newTitle + bAddClicked() + + + + fileSelected(const QString&) + rbNumberClicked() + rbLengthClicked() + bAddClicked() + + + + knuminput.h + knuminput.h + ktimewidget.h + kpushbutton.h + kurlrequester.h + klineedit.h + kpushbutton.h + + diff --git a/k9decmpeg/Makefile.am b/k9decmpeg/Makefile.am new file mode 100644 index 0000000..998689a --- /dev/null +++ b/k9decmpeg/Makefile.am @@ -0,0 +1,19 @@ +AM_CPPFLAGS= -I$(srcdir) $(all_includes) + +KDE_CXXFLAGS = $(ENABLE_PERMISSIVE_FLAG) + +METASOURCES = AUTO + +libk9decmpeg_la_LDFLAGS = $(all_libraries) +noinst_LTLIBRARIES = libk9decmpeg.la +libk9decmpeg_la_SOURCES = alloc.cpp attributes.h bswap.h convert_internal.h \ + cpu_accel.cpp cpu_state.cpp decode.cpp header.cpp idct_alpha.cpp idct_altivec.cpp \ + idct.cpp idct_mmx.cpp kdecmpeg2.cpp kdecmpeg2.h mmx.h motion_comp_alpha.cpp \ + motion_comp_altivec.cpp motion_comp.cpp motion_comp_mmx.cpp motion_comp_vis.cpp mpeg2convert.h \ + mpeg2.h mpeg2_internal.h rgb.cpp rgb_mmx.cpp rgb_vis.cpp slice.cpp tendra.h \ + uyvy.cpp video_out.h vis.h vlc.h k9decodethread.cpp k9plaympeg2.cpp +INCLUDES = -I$(top_srcdir)/dvdread -I$(top_srcdir)/k9vamps \ + -I$(top_srcdir)/libdvdnav -I$(top_srcdir)/libk9copy + +noinst_HEADERS = k9decodethread.h k9plaympeg2.h + diff --git a/k9decmpeg/alloc.cpp b/k9decmpeg/alloc.cpp new file mode 100755 index 0000000..d780be7 --- /dev/null +++ b/k9decmpeg/alloc.cpp @@ -0,0 +1,70 @@ +/* + * alloc.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include +#include + +#include "mpeg2.h" + +static void * (* malloc_hook) (unsigned size, mpeg2_alloc_t reason) = NULL; +static int (* free_hook) (void * buf) = NULL; + +void * mpeg2_malloc (unsigned size, mpeg2_alloc_t reason) +{ + char * buf; + + if (malloc_hook) { + buf = (char *) malloc_hook (size, reason); + if (buf) + return buf; + } + + if (size) { + buf = (char *) malloc (size + 63 + sizeof (void **)); + if (buf) { + char * align_buf; + + align_buf = buf + 63 + sizeof (void **); + align_buf -= (long)align_buf & 63; + *(((void **)align_buf) - 1) = buf; + return align_buf; + } + } + return NULL; +} + +void mpeg2_free (void * buf) +{ + if (free_hook && free_hook (buf)) + return; + + if (buf) + free (*(((void **)buf) - 1)); +} + +void mpeg2_malloc_hooks (void * malloc (unsigned, mpeg2_alloc_t), + int free (void *)) +{ + malloc_hook = malloc; + free_hook = free; +} diff --git a/k9decmpeg/attributes.h b/k9decmpeg/attributes.h new file mode 100755 index 0000000..1c58c0a --- /dev/null +++ b/k9decmpeg/attributes.h @@ -0,0 +1,37 @@ +/* + * attributes.h + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +/* use gcc attribs to align critical data structures */ +#ifdef ATTRIBUTE_ALIGNED_MAX +#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align))) +#else +#define ATTR_ALIGN(align) +#endif + +#ifdef HAVE_BUILTIN_EXPECT +#define likely(x) __builtin_expect ((x) != 0, 1) +#define unlikely(x) __builtin_expect ((x) != 0, 0) +#else +#define likely(x) (x) +#define unlikely(x) (x) +#endif diff --git a/k9decmpeg/bswap.h b/k9decmpeg/bswap.h new file mode 100755 index 0000000..64751ff --- /dev/null +++ b/k9decmpeg/bswap.h @@ -0,0 +1,98 @@ +#ifndef BSWAP_H_INCLUDED +#define BSWAP_H_INCLUDED + +/* + * Copyright (C) 2000, 2001 Billy Biggs , + * Håkan Hjort + * + * 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 + */ + +#include + +#if defined(WORDS_BIGENDIAN) +/* All bigendian systems are fine, just ignore the swaps. */ +#define B2N_16(x) (void)(x) +#define B2N_32(x) (void)(x) +#define B2N_64(x) (void)(x) + +#else + +/* For __FreeBSD_version */ +#if defined(HAVE_SYS_PARAM_H) +#include +#endif + +#if defined(__linux__) +#include +#define B2N_16(x) x = bswap_16(x) +#define B2N_32(x) x = bswap_32(x) +#define B2N_64(x) x = bswap_64(x) + +#elif defined(__NetBSD__) +#include +#define B2N_16(x) BE16TOH(x) +#define B2N_32(x) BE32TOH(x) +#define B2N_64(x) BE64TOH(x) + +#elif defined(__OpenBSD__) +#include +#define B2N_16(x) x = swap16(x) +#define B2N_32(x) x = swap32(x) +#define B2N_64(x) x = swap64(x) + +#elif defined(__FreeBSD__) && __FreeBSD_version >= 470000 +#include +#define B2N_16(x) x = be16toh(x) +#define B2N_32(x) x = be32toh(x) +#define B2N_64(x) x = be64toh(x) + +/* This is a slow but portable implementation, it has multiple evaluation + * problems so beware. + * Old FreeBSD's and Solaris don't have or any other such + * functionality! + */ + +#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) +#define B2N_16(x) \ + x = ((((x) & 0xff00) >> 8) | \ + (((x) & 0x00ff) << 8)) +#define B2N_32(x) \ + x = ((((x) & 0xff000000) >> 24) | \ + (((x) & 0x00ff0000) >> 8) | \ + (((x) & 0x0000ff00) << 8) | \ + (((x) & 0x000000ff) << 24)) +#define B2N_64(x) \ + x = ((((x) & 0xff00000000000000) >> 56) | \ + (((x) & 0x00ff000000000000) >> 40) | \ + (((x) & 0x0000ff0000000000) >> 24) | \ + (((x) & 0x000000ff00000000) >> 8) | \ + (((x) & 0x00000000ff000000) << 8) | \ + (((x) & 0x0000000000ff0000) << 24) | \ + (((x) & 0x000000000000ff00) << 40) | \ + (((x) & 0x00000000000000ff) << 56)) + +#else + +/* If there isn't a header provided with your system with this functionality + * add the relevant || define( ) to the portable implementation above. + */ +#error "You need to add endian swap macros for you're system" + +#endif + +#endif /* WORDS_BIGENDIAN */ + +#endif /* BSWAP_H_INCLUDED */ diff --git a/k9decmpeg/convert_internal.h b/k9decmpeg/convert_internal.h new file mode 100755 index 0000000..02615fc --- /dev/null +++ b/k9decmpeg/convert_internal.h @@ -0,0 +1,41 @@ +/* + * convert_internal.h + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +typedef struct { + uint8_t * rgb_ptr; + int width; + int y_stride, rgb_stride, y_increm, uv_increm, rgb_increm; + int chroma420, convert420; + int dither_offset, dither_stride; + int y_stride_frame, uv_stride_frame, rgb_stride_frame, rgb_stride_min; +} convert_rgb_t; + +typedef void mpeg2convert_copy_t (void * id, uint8_t * const * src, + unsigned int v_offset); + +mpeg2convert_copy_t * mpeg2convert_rgb_mmxext (int bpp, int mode, + const mpeg2_sequence_t * seq); +mpeg2convert_copy_t * mpeg2convert_rgb_mmx (int bpp, int mode, + const mpeg2_sequence_t * seq); +mpeg2convert_copy_t * mpeg2convert_rgb_vis (int bpp, int mode, + const mpeg2_sequence_t * seq); diff --git a/k9decmpeg/cpu_accel.cpp b/k9decmpeg/cpu_accel.cpp new file mode 100755 index 0000000..9589868 --- /dev/null +++ b/k9decmpeg/cpu_accel.cpp @@ -0,0 +1,220 @@ +/* + * cpu_accel.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#include "k9common.h" + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" + +#ifdef MPEG2_ACCEL_DETECT +#ifdef ARCH_X86 +static inline uint32_t arch_accel (void) +{ + uint32_t eax, ebx, ecx, edx; + int AMD; + uint32_t caps; + +#if !defined(PIC) && !defined(__PIC__) +#define cpuid(op,eax,ebx,ecx,edx) \ + __asm__ ("cpuid" \ + : "=a" (eax), \ + "=b" (ebx), \ + "=c" (ecx), \ + "=d" (edx) \ + : "a" (op) \ + : "cc") +#else /* PIC version : save ebx */ +#define cpuid(op,eax,ebx,ecx,edx) \ + __asm__ ("push %%ebx\n\t" \ + "cpuid\n\t" \ + "movl %%ebx,%1\n\t" \ + "pop %%ebx" \ + : "=a" (eax), \ + "=r" (ebx), \ + "=c" (ecx), \ + "=d" (edx) \ + : "a" (op) \ + : "cc") +#endif + + __asm__ ("pushf\n\t" + "pushf\n\t" + "pop %0\n\t" + "movl %0,%1\n\t" + "xorl $0x200000,%0\n\t" + "push %0\n\t" + "popf\n\t" + "pushf\n\t" + "pop %0\n\t" + "popf" + : "=r" (eax), + "=r" (ebx) + : + : "cc"); + + if (eax == ebx) /* no cpuid */ + return 0; + + cpuid (0x00000000, eax, ebx, ecx, edx); + if (!eax) /* vendor string only */ + return 0; + + AMD = (ebx == 0x68747541) && (ecx == 0x444d4163) && (edx == 0x69746e65); + + cpuid (0x00000001, eax, ebx, ecx, edx); + if (! (edx & 0x00800000)) /* no MMX */ + return 0; + + caps = MPEG2_ACCEL_X86_MMX; + if (edx & 0x02000000) /* SSE - identical to AMD MMX extensions */ + caps = MPEG2_ACCEL_X86_MMX | MPEG2_ACCEL_X86_MMXEXT; + + cpuid (0x80000000, eax, ebx, ecx, edx); + if (eax < 0x80000001) /* no extended capabilities */ + return caps; + + cpuid (0x80000001, eax, ebx, ecx, edx); + + if (edx & 0x80000000) + caps |= MPEG2_ACCEL_X86_3DNOW; + + if (AMD && (edx & 0x00400000)) /* AMD MMX extensions */ + caps |= MPEG2_ACCEL_X86_MMXEXT; + + return caps; +} +#endif /* ARCH_X86 */ + +#if defined(ARCH_PPC) || defined(ARCH_SPARC) +#include +#include + +static sigjmp_buf jmpbuf; +static volatile sig_atomic_t canjump = 0; + +static RETSIGTYPE sigill_handler (int sig) +{ + if (!canjump) { + signal (sig, SIG_DFL); + raise (sig); + } + + canjump = 0; + siglongjmp (jmpbuf, 1); +} + +#ifdef ARCH_PPC +static inline uint32_t arch_accel (void) +{ + static RETSIGTYPE (* oldsig) (int); + + oldsig = signal (SIGILL, sigill_handler); + if (sigsetjmp (jmpbuf, 1)) { + signal (SIGILL, oldsig); + return 0; + } + + canjump = 1; + +#ifdef HAVE_ALTIVEC_H /* gnu */ +#define VAND(a,b,c) "vand " #a "," #b "," #c "\n\t" +#else /* apple */ +#define VAND(a,b,c) "vand v" #a ",v" #b ",v" #c "\n\t" +#endif + asm volatile ("mtspr 256, %0\n\t" + VAND (0, 0, 0) + : + : "r" (-1)); + + canjump = 0; + + signal (SIGILL, oldsig); + return MPEG2_ACCEL_PPC_ALTIVEC; +} +#endif /* ARCH_PPC */ + +#ifdef ARCH_SPARC +static inline uint32_t arch_accel (void) +{ + static RETSIGTYPE (* oldsig) (int); + + oldsig = signal (SIGILL, sigill_handler); + if (sigsetjmp (jmpbuf, 1)) { + signal (SIGILL, oldsig); + return 0; + } + + canjump = 1; + + /* pdist %f0, %f0, %f0 */ + __asm__ __volatile__(".word\t0x81b007c0"); + + canjump = 0; + + if (sigsetjmp (jmpbuf, 1)) { + signal (SIGILL, oldsig); + return MPEG2_ACCEL_SPARC_VIS; + } + + canjump = 1; + + /* edge8n %g0, %g0, %g0 */ + __asm__ __volatile__(".word\t0x81b00020"); + + canjump = 0; + + signal (SIGILL, oldsig); + return MPEG2_ACCEL_SPARC_VIS | MPEG2_ACCEL_SPARC_VIS2; +} +#endif /* ARCH_SPARC */ +#endif /* ARCH_PPC || ARCH_SPARC */ + +#ifdef ARCH_ALPHA +static inline uint32_t arch_accel (void) +{ + uint64_t no_mvi; + + asm volatile ("amask %1, %0" + : "=r" (no_mvi) + : "rI" (256)); /* AMASK_MVI */ + return no_mvi ? MPEG2_ACCEL_ALPHA : (MPEG2_ACCEL_ALPHA | + MPEG2_ACCEL_ALPHA_MVI); +} +#endif /* ARCH_ALPHA */ +#endif /* ACCEL_DETECT */ + +uint32_t mpeg2_detect_accel (void) +{ + uint32_t accel; + + accel = 0; +#ifdef MPEG2_ACCEL_DETECT +#if defined (ARCH_X86) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) + accel = arch_accel (); +#endif +#endif + return accel; +} diff --git a/k9decmpeg/cpu_state.cpp b/k9decmpeg/cpu_state.cpp new file mode 100755 index 0000000..f767c76 --- /dev/null +++ b/k9decmpeg/cpu_state.cpp @@ -0,0 +1,128 @@ +/* + * cpu_state.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" +#include "k9common.h" +#include + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" +#ifdef ARCH_X86 +#include "mmx.h" +#endif + +void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL; +void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL; + +#ifdef ARCH_X86 +static void state_restore_mmx (cpu_state_t * state) +{ + emms (); +} +#endif + +#ifdef ARCH_PPC +#ifdef HAVE_ALTIVEC_H /* gnu */ +#define LI(a,b) "li " #a "," #b "\n\t" +#define STVX0(a,b,c) "stvx " #a ",0," #c "\n\t" +#define STVX(a,b,c) "stvx " #a "," #b "," #c "\n\t" +#define LVX0(a,b,c) "lvx " #a ",0," #c "\n\t" +#define LVX(a,b,c) "lvx " #a "," #b "," #c "\n\t" +#else /* apple */ +#define LI(a,b) "li r" #a "," #b "\n\t" +#define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t" +#define STVX(a,b,c) "stvx v" #a ",r" #b ",r" #c "\n\t" +#define LVX0(a,b,c) "lvx v" #a ",0,r" #c "\n\t" +#define LVX(a,b,c) "lvx v" #a ",r" #b ",r" #c "\n\t" +#endif + +static void state_save_altivec (cpu_state_t * state) +{ + asm (LI (9, 16) + STVX0 (20, 0, 3) + LI (11, 32) + STVX (21, 9, 3) + LI (9, 48) + STVX (22, 11, 3) + LI (11, 64) + STVX (23, 9, 3) + LI (9, 80) + STVX (24, 11, 3) + LI (11, 96) + STVX (25, 9, 3) + LI (9, 112) + STVX (26, 11, 3) + LI (11, 128) + STVX (27, 9, 3) + LI (9, 144) + STVX (28, 11, 3) + LI (11, 160) + STVX (29, 9, 3) + LI (9, 176) + STVX (30, 11, 3) + STVX (31, 9, 3)); +} + +static void state_restore_altivec (cpu_state_t * state) +{ + asm (LI (9, 16) + LVX0 (20, 0, 3) + LI (11, 32) + LVX (21, 9, 3) + LI (9, 48) + LVX (22, 11, 3) + LI (11, 64) + LVX (23, 9, 3) + LI (9, 80) + LVX (24, 11, 3) + LI (11, 96) + LVX (25, 9, 3) + LI (9, 112) + LVX (26, 11, 3) + LI (11, 128) + LVX (27, 9, 3) + LI (9, 144) + LVX (28, 11, 3) + LI (11, 160) + LVX (29, 9, 3) + LI (9, 176) + LVX (30, 11, 3) + LVX (31, 9, 3)); +} +#endif + +void mpeg2_cpu_state_init (uint32_t accel) +{ +#ifdef ARCH_X86 + if (accel & MPEG2_ACCEL_X86_MMX) { + mpeg2_cpu_state_restore = state_restore_mmx; + } +#endif +#ifdef ARCH_PPC + if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { + mpeg2_cpu_state_save = state_save_altivec; + mpeg2_cpu_state_restore = state_restore_altivec; + } +#endif +} diff --git a/k9decmpeg/decode.cpp b/k9decmpeg/decode.cpp new file mode 100755 index 0000000..308e175 --- /dev/null +++ b/k9decmpeg/decode.cpp @@ -0,0 +1,446 @@ +/* + * decode.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" +#include "k9common.h" +#include /* memcmp/memset, try to remove */ +#include + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" + +static int mpeg2_accels = 0; + +#define BUFFER_SIZE (1194 * 1024) + +const mpeg2_info_t * mpeg2_info (mpeg2dec_t * mpeg2dec) +{ + return &(mpeg2dec->info); +} + +static inline int skip_chunk (mpeg2dec_t * mpeg2dec, int bytes) +{ + uint8_t * current; + uint32_t shift; + uint8_t * limit; + uint8_t byte; + + if (!bytes) + return 0; + + current = mpeg2dec->buf_start; + shift = mpeg2dec->shift; + limit = current + bytes; + + do { + byte = *current++; + if (shift == 0x00000100) { + int skipped; + + mpeg2dec->shift = 0xffffff00; + skipped = current - mpeg2dec->buf_start; + mpeg2dec->buf_start = current; + return skipped; + } + shift = (shift | byte) << 8; + } while (current < limit); + + mpeg2dec->shift = shift; + mpeg2dec->buf_start = current; + return 0; +} + +static inline int copy_chunk (mpeg2dec_t * mpeg2dec, int bytes) +{ + uint8_t * current; + uint32_t shift; + uint8_t * chunk_ptr; + uint8_t * limit; + uint8_t byte; + + if (!bytes) + return 0; + + current = mpeg2dec->buf_start; + shift = mpeg2dec->shift; + chunk_ptr = mpeg2dec->chunk_ptr; + limit = current + bytes; + + do { + byte = *current++; + if (shift == 0x00000100) { + int copied; + + mpeg2dec->shift = 0xffffff00; + mpeg2dec->chunk_ptr = chunk_ptr + 1; + copied = current - mpeg2dec->buf_start; + mpeg2dec->buf_start = current; + return copied; + } + shift = (shift | byte) << 8; + *chunk_ptr++ = byte; + } while (current < limit); + + mpeg2dec->shift = shift; + mpeg2dec->buf_start = current; + return 0; +} + +void mpeg2_buffer (mpeg2dec_t * mpeg2dec, uint8_t * start, uint8_t * end) +{ + mpeg2dec->buf_start = start; + mpeg2dec->buf_end = end; +} + +int mpeg2_getpos (mpeg2dec_t * mpeg2dec) +{ + return mpeg2dec->buf_end - mpeg2dec->buf_start; +} + +static inline mpeg2_state_t seek_chunk (mpeg2dec_t * mpeg2dec) +{ + int size, skipped; + + size = mpeg2dec->buf_end - mpeg2dec->buf_start; + skipped = skip_chunk (mpeg2dec, size); + if (!skipped) { + mpeg2dec->bytes_since_tag += size; + return STATE_BUFFER; + } + mpeg2dec->bytes_since_tag += skipped; + mpeg2dec->code = mpeg2dec->buf_start[-1]; + return (mpeg2_state_t)-1; +} + +mpeg2_state_t mpeg2_seek_header (mpeg2dec_t * mpeg2dec) +{ + while (mpeg2dec->code != 0xb3 && + ((mpeg2dec->code != 0xb7 && mpeg2dec->code != 0xb8 && + mpeg2dec->code) || mpeg2dec->sequence.width == (unsigned)-1)) + if (seek_chunk (mpeg2dec) == STATE_BUFFER) + return STATE_BUFFER; + mpeg2dec->chunk_start = mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer; + mpeg2dec->user_data_len = 0; + return (mpeg2dec->code ? mpeg2_parse_header (mpeg2dec) : + mpeg2_header_picture_start (mpeg2dec)); +} + +#define RECEIVED(code,state) (((state) << 8) + (code)) + +mpeg2_state_t mpeg2_parse (mpeg2dec_t * mpeg2dec) +{ + int size_buffer, size_chunk, copied; + + if (mpeg2dec->action) { + mpeg2_state_t state; + + state = mpeg2dec->action (mpeg2dec); + if ((int)state >= 0) + return state; + } + + while (1) { + while ((unsigned) (mpeg2dec->code - mpeg2dec->first_decode_slice) < + mpeg2dec->nb_decode_slices) { + size_buffer = mpeg2dec->buf_end - mpeg2dec->buf_start; + size_chunk = (mpeg2dec->chunk_buffer + BUFFER_SIZE - + mpeg2dec->chunk_ptr); + if (size_buffer <= size_chunk) { + copied = copy_chunk (mpeg2dec, size_buffer); + if (!copied) { + mpeg2dec->bytes_since_tag += size_buffer; + mpeg2dec->chunk_ptr += size_buffer; + return STATE_BUFFER; + } + } else { + copied = copy_chunk (mpeg2dec, size_chunk); + if (!copied) { + /* filled the chunk buffer without finding a start code */ + mpeg2dec->bytes_since_tag += size_chunk; + mpeg2dec->action = seek_chunk; + return STATE_INVALID; + } + } + mpeg2dec->bytes_since_tag += copied; + + mpeg2_slice (&(mpeg2dec->decoder), mpeg2dec->code, + mpeg2dec->chunk_start); + mpeg2dec->code = mpeg2dec->buf_start[-1]; + mpeg2dec->chunk_ptr = mpeg2dec->chunk_start; + } + if ((unsigned) (mpeg2dec->code - 1) >= 0xb0 - 1) + break; + if (seek_chunk (mpeg2dec) == STATE_BUFFER) + return STATE_BUFFER; + } + + switch (mpeg2dec->code) { + case 0x00: + mpeg2dec->action = mpeg2_header_picture_start; + return mpeg2dec->state; + case 0xb7: + mpeg2dec->action = mpeg2_header_end; + break; + case 0xb3: + case 0xb8: + mpeg2dec->action = mpeg2_parse_header; + break; + default: + mpeg2dec->action = seek_chunk; + return STATE_INVALID; + } + return (mpeg2dec->state == STATE_SLICE) ? STATE_SLICE : STATE_INVALID; +} + +mpeg2_state_t mpeg2_parse_header (mpeg2dec_t * mpeg2dec) +{ + static int (* process_header[]) (mpeg2dec_t * mpeg2dec) = { + mpeg2_header_picture, mpeg2_header_extension, mpeg2_header_user_data, + mpeg2_header_sequence, NULL, NULL, NULL, NULL, mpeg2_header_gop + }; + int size_buffer, size_chunk, copied; + + mpeg2dec->action = mpeg2_parse_header; + mpeg2dec->info.user_data = NULL; mpeg2dec->info.user_data_len = 0; + while (1) { + size_buffer = mpeg2dec->buf_end - mpeg2dec->buf_start; + size_chunk = (mpeg2dec->chunk_buffer + BUFFER_SIZE - + mpeg2dec->chunk_ptr); + if (size_buffer <= size_chunk) { + copied = copy_chunk (mpeg2dec, size_buffer); + if (!copied) { + mpeg2dec->bytes_since_tag += size_buffer; + mpeg2dec->chunk_ptr += size_buffer; + return STATE_BUFFER; + } + } else { + copied = copy_chunk (mpeg2dec, size_chunk); + if (!copied) { + /* filled the chunk buffer without finding a start code */ + mpeg2dec->bytes_since_tag += size_chunk; + mpeg2dec->code = 0xb4; + mpeg2dec->action = mpeg2_seek_header; + return STATE_INVALID; + } + } + mpeg2dec->bytes_since_tag += copied; + + if (process_header[mpeg2dec->code & 0x0b] (mpeg2dec)) { + mpeg2dec->code = mpeg2dec->buf_start[-1]; + mpeg2dec->action = mpeg2_seek_header; + return STATE_INVALID; + } + + mpeg2dec->code = mpeg2dec->buf_start[-1]; + switch (RECEIVED (mpeg2dec->code, mpeg2dec->state)) { + + /* state transition after a sequence header */ + case RECEIVED (0x00, STATE_SEQUENCE): + mpeg2dec->action = mpeg2_header_picture_start; + case RECEIVED (0xb8, STATE_SEQUENCE): + mpeg2_header_sequence_finalize (mpeg2dec); + break; + + /* other legal state transitions */ + case RECEIVED (0x00, STATE_GOP): + mpeg2_header_gop_finalize (mpeg2dec); + mpeg2dec->action = mpeg2_header_picture_start; + break; + case RECEIVED (0x01, STATE_PICTURE): + case RECEIVED (0x01, STATE_PICTURE_2ND): + mpeg2_header_picture_finalize (mpeg2dec, mpeg2_accels); + mpeg2dec->action = mpeg2_header_slice_start; + break; + + /* legal headers within a given state */ + case RECEIVED (0xb2, STATE_SEQUENCE): + case RECEIVED (0xb2, STATE_GOP): + case RECEIVED (0xb2, STATE_PICTURE): + case RECEIVED (0xb2, STATE_PICTURE_2ND): + case RECEIVED (0xb5, STATE_SEQUENCE): + case RECEIVED (0xb5, STATE_PICTURE): + case RECEIVED (0xb5, STATE_PICTURE_2ND): + mpeg2dec->chunk_ptr = mpeg2dec->chunk_start; + continue; + + default: + mpeg2dec->action = mpeg2_seek_header; + return STATE_INVALID; + } + + mpeg2dec->chunk_start = mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer; + mpeg2dec->user_data_len = 0; + return mpeg2dec->state; + } +} + +int mpeg2_convert (mpeg2dec_t * mpeg2dec, mpeg2_convert_t convert, void * arg) +{ + mpeg2_convert_init_t convert_init; + int error; + + error = convert (MPEG2_CONVERT_SET, NULL, &(mpeg2dec->sequence), 0, + mpeg2_accels, arg, &convert_init); + if (!error) { + mpeg2dec->convert = convert; + mpeg2dec->convert_arg = arg; + mpeg2dec->convert_id_size = convert_init.id_size; + mpeg2dec->convert_stride = 0; + } + return error; +} + +int mpeg2_stride (mpeg2dec_t * mpeg2dec, int stride) +{ + if (!mpeg2dec->convert) { + if (stride < (int) mpeg2dec->sequence.width) + stride = mpeg2dec->sequence.width; + mpeg2dec->decoder.stride_frame = stride; + } else { + mpeg2_convert_init_t convert_init; + + stride = mpeg2dec->convert (MPEG2_CONVERT_STRIDE, NULL, + &(mpeg2dec->sequence), stride, + mpeg2_accels, mpeg2dec->convert_arg, + &convert_init); + mpeg2dec->convert_id_size = convert_init.id_size; + mpeg2dec->convert_stride = stride; + } + return stride; +} + +void mpeg2_set_buf (mpeg2dec_t * mpeg2dec, uint8_t * buf[3], void * id) +{ + mpeg2_fbuf_t * fbuf; + + if (mpeg2dec->custom_fbuf) { + if (mpeg2dec->state == STATE_SEQUENCE) { + mpeg2dec->fbuf[2] = mpeg2dec->fbuf[1]; + mpeg2dec->fbuf[1] = mpeg2dec->fbuf[0]; + } + mpeg2_set_fbuf (mpeg2dec, (mpeg2dec->decoder.coding_type == + PIC_FLAG_CODING_TYPE_B)); + fbuf = mpeg2dec->fbuf[0]; + } else { + fbuf = &(mpeg2dec->fbuf_alloc[mpeg2dec->alloc_index].fbuf); + mpeg2dec->alloc_index_user = ++mpeg2dec->alloc_index; + } + fbuf->buf[0] = buf[0]; + fbuf->buf[1] = buf[1]; + fbuf->buf[2] = buf[2]; + fbuf->id = id; +} + +void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf) +{ + mpeg2dec->custom_fbuf = custom_fbuf; +} + +void mpeg2_skip (mpeg2dec_t * mpeg2dec, int skip) +{ + mpeg2dec->first_decode_slice = 1; + mpeg2dec->nb_decode_slices = skip ? 0 : (0xb0 - 1); +} + +void mpeg2_slice_region (mpeg2dec_t * mpeg2dec, int start, int end) +{ + start = (start < 1) ? 1 : (start > 0xb0) ? 0xb0 : start; + end = (end < start) ? start : (end > 0xb0) ? 0xb0 : end; + mpeg2dec->first_decode_slice = start; + mpeg2dec->nb_decode_slices = end - start; +} + +void mpeg2_tag_picture (mpeg2dec_t * mpeg2dec, uint32_t tag, uint32_t tag2) +{ + mpeg2dec->tag_previous = mpeg2dec->tag_current; + mpeg2dec->tag2_previous = mpeg2dec->tag2_current; + mpeg2dec->tag_current = tag; + mpeg2dec->tag2_current = tag2; + mpeg2dec->num_tags++; + mpeg2dec->bytes_since_tag = 0; +} + +uint32_t mpeg2_accel (uint32_t accel) +{ + if (!mpeg2_accels) { + if (accel & MPEG2_ACCEL_DETECT) + accel |= mpeg2_detect_accel (); + mpeg2_accels = accel |= MPEG2_ACCEL_DETECT; + mpeg2_cpu_state_init (accel); + mpeg2_idct_init (accel); + mpeg2_mc_init (accel); + } + return mpeg2_accels & ~MPEG2_ACCEL_DETECT; +} + +void mpeg2_reset (mpeg2dec_t * mpeg2dec, int full_reset) +{ + mpeg2dec->buf_start = mpeg2dec->buf_end = NULL; + mpeg2dec->num_tags = 0; + mpeg2dec->shift = 0xffffff00; + mpeg2dec->code = 0xb4; + mpeg2dec->action = mpeg2_seek_header; + mpeg2dec->state = STATE_INVALID; + mpeg2dec->first = 1; + + mpeg2_reset_info(&(mpeg2dec->info)); + mpeg2dec->info.gop = NULL; + mpeg2dec->info.user_data = NULL; + mpeg2dec->info.user_data_len = 0; + if (full_reset) { + mpeg2dec->info.sequence = NULL; + mpeg2_header_state_init (mpeg2dec); + } + +} + +mpeg2dec_t * mpeg2_init (void) +{ + mpeg2dec_t * mpeg2dec; + + mpeg2_accel (MPEG2_ACCEL_DETECT); + + mpeg2dec = (mpeg2dec_t *) mpeg2_malloc (sizeof (mpeg2dec_t), + MPEG2_ALLOC_MPEG2DEC); + if (mpeg2dec == NULL) + return NULL; + + memset (mpeg2dec->decoder.DCTblock, 0, 64 * sizeof (int16_t)); + memset (mpeg2dec->quantizer_matrix, 0, 4 * 64 * sizeof (uint8_t)); + + mpeg2dec->chunk_buffer = (uint8_t *) mpeg2_malloc (BUFFER_SIZE + 4, + MPEG2_ALLOC_CHUNK); + + mpeg2dec->sequence.width = (unsigned)-1; + mpeg2_reset (mpeg2dec, 1); + + return mpeg2dec; +} + +void mpeg2_close (mpeg2dec_t * mpeg2dec) +{ + mpeg2_header_state_init (mpeg2dec); + mpeg2_free (mpeg2dec->chunk_buffer); + mpeg2_free (mpeg2dec); +} diff --git a/k9decmpeg/header.cpp b/k9decmpeg/header.cpp new file mode 100755 index 0000000..21c347d --- /dev/null +++ b/k9decmpeg/header.cpp @@ -0,0 +1,892 @@ +/* + * header.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 2003 Regis Duchesne + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" +#include "k9common.h" +#include "ac.h" + +#include /* defines NULL */ +#include /* memcmp */ + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" + +#define SEQ_EXT 2 +#define SEQ_DISPLAY_EXT 4 +#define QUANT_MATRIX_EXT 8 +#define COPYRIGHT_EXT 0x10 +#define PIC_DISPLAY_EXT 0x80 +#define PIC_CODING_EXT 0x100 + +/* default intra quant matrix, in zig-zag order */ +static const uint8_t default_intra_quantizer_matrix[64] ATTR_ALIGN(16) = { + 8, + 16, 16, + 19, 16, 19, + 22, 22, 22, 22, + 22, 22, 26, 24, 26, + 27, 27, 27, 26, 26, 26, + 26, 27, 27, 27, 29, 29, 29, + 34, 34, 34, 29, 29, 29, 27, 27, + 29, 29, 32, 32, 34, 34, 37, + 38, 37, 35, 35, 34, 35, + 38, 38, 40, 40, 40, + 48, 48, 46, 46, + 56, 56, 58, + 69, 69, + 83 +}; + +uint8_t mpeg2_scan_norm[64] ATTR_ALIGN(16) = { + /* Zig-Zag scan pattern */ + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 +}; + +uint8_t mpeg2_scan_alt[64] ATTR_ALIGN(16) = { + /* Alternate scan pattern */ + 0, 8, 16, 24, 1, 9, 2, 10, 17, 25, 32, 40, 48, 56, 57, 49, + 41, 33, 26, 18, 3, 11, 4, 12, 19, 27, 34, 42, 50, 58, 35, 43, + 51, 59, 20, 28, 5, 13, 6, 14, 21, 29, 36, 44, 52, 60, 37, 45, + 53, 61, 22, 30, 7, 15, 23, 31, 38, 46, 54, 62, 39, 47, 55, 63 +}; + +void mpeg2_header_state_init (mpeg2dec_t * mpeg2dec) +{ + if (mpeg2dec->sequence.width != (unsigned)-1) { + int i; + + mpeg2dec->sequence.width = (unsigned)-1; + if (!mpeg2dec->custom_fbuf) + for (i = mpeg2dec->alloc_index_user; + i < mpeg2dec->alloc_index; i++) { + mpeg2_free (mpeg2dec->fbuf_alloc[i].fbuf.buf[0]); + mpeg2_free (mpeg2dec->fbuf_alloc[i].fbuf.buf[1]); + mpeg2_free (mpeg2dec->fbuf_alloc[i].fbuf.buf[2]); + } + if (mpeg2dec->convert_start) + for (i = 0; i < 3; i++) { + mpeg2_free (mpeg2dec->yuv_buf[i][0]); + mpeg2_free (mpeg2dec->yuv_buf[i][1]); + mpeg2_free (mpeg2dec->yuv_buf[i][2]); + } + if (mpeg2dec->decoder.convert_id) + mpeg2_free (mpeg2dec->decoder.convert_id); + } + mpeg2dec->decoder.coding_type = I_TYPE; + mpeg2dec->decoder.convert = NULL; + mpeg2dec->decoder.convert_id = NULL; + mpeg2dec->picture = mpeg2dec->pictures; + mpeg2dec->fbuf[0] = &mpeg2dec->fbuf_alloc[0].fbuf; + mpeg2dec->fbuf[1] = &mpeg2dec->fbuf_alloc[1].fbuf; + mpeg2dec->fbuf[2] = &mpeg2dec->fbuf_alloc[2].fbuf; + mpeg2dec->first = 1; + mpeg2dec->alloc_index = 0; + mpeg2dec->alloc_index_user = 0; + mpeg2dec->first_decode_slice = 1; + mpeg2dec->nb_decode_slices = 0xb0 - 1; + mpeg2dec->convert = NULL; + mpeg2dec->convert_start = NULL; + mpeg2dec->custom_fbuf = 0; + mpeg2dec->yuv_index = 0; +} + +void mpeg2_reset_info (mpeg2_info_t * info) +{ + info->current_picture = info->current_picture_2nd = NULL; + info->display_picture = info->display_picture_2nd = NULL; + info->current_fbuf = info->display_fbuf = info->discard_fbuf = NULL; +} + +static void info_user_data (mpeg2dec_t * mpeg2dec) +{ + if (mpeg2dec->user_data_len) { + mpeg2dec->info.user_data = mpeg2dec->chunk_buffer; + mpeg2dec->info.user_data_len = mpeg2dec->user_data_len - 3; + } +} + +int mpeg2_header_sequence (mpeg2dec_t * mpeg2dec) +{ + uint8_t * buffer = mpeg2dec->chunk_start; + mpeg2_sequence_t * sequence = &(mpeg2dec->new_sequence); + static unsigned int frame_period[16] = { + 0, 1126125, 1125000, 1080000, 900900, 900000, 540000, 450450, 450000, + /* unofficial: xing 15 fps */ + 1800000, + /* unofficial: libmpeg3 "Unofficial economy rates" 5/10/12/15 fps */ + 5400000, 2700000, 2250000, 1800000, 0, 0 + }; + int i; + + if ((buffer[6] & 0x20) != 0x20) /* missing marker_bit */ + return 1; + + i = (buffer[0] << 16) | (buffer[1] << 8) | buffer[2]; + if (! (sequence->display_width = sequence->picture_width = i >> 12)) + return 1; + if (! (sequence->display_height = sequence->picture_height = i & 0xfff)) + return 1; + sequence->width = (sequence->picture_width + 15) & ~15; + sequence->height = (sequence->picture_height + 15) & ~15; + sequence->chroma_width = sequence->width >> 1; + sequence->chroma_height = sequence->height >> 1; + + sequence->flags = (SEQ_FLAG_PROGRESSIVE_SEQUENCE | + SEQ_VIDEO_FORMAT_UNSPECIFIED); + + sequence->pixel_width = buffer[3] >> 4; /* aspect ratio */ + sequence->frame_period = frame_period[buffer[3] & 15]; + + sequence->byte_rate = (buffer[4]<<10) | (buffer[5]<<2) | (buffer[6]>>6); + + sequence->vbv_buffer_size = ((buffer[6]<<16)|(buffer[7]<<8))&0x1ff800; + + if (buffer[7] & 4) + sequence->flags |= SEQ_FLAG_CONSTRAINED_PARAMETERS; + + mpeg2dec->copy_matrix = 3; + if (buffer[7] & 2) { + for (i = 0; i < 64; i++) + mpeg2dec->new_quantizer_matrix[0][mpeg2_scan_norm[i]] = + (buffer[i+7] << 7) | (buffer[i+8] >> 1); + buffer += 64; + } else + for (i = 0; i < 64; i++) + mpeg2dec->new_quantizer_matrix[0][mpeg2_scan_norm[i]] = + default_intra_quantizer_matrix[i]; + + if (buffer[7] & 1) + for (i = 0; i < 64; i++) + mpeg2dec->new_quantizer_matrix[1][mpeg2_scan_norm[i]] = + buffer[i+8]; + else + memset (mpeg2dec->new_quantizer_matrix[1], 16, 64); + + sequence->profile_level_id = 0x80; + sequence->colour_primaries = 0; + sequence->transfer_characteristics = 0; + sequence->matrix_coefficients = 0; + + mpeg2dec->ext_state = SEQ_EXT; + mpeg2dec->state = STATE_SEQUENCE; + mpeg2dec->display_offset_x = mpeg2dec->display_offset_y = 0; + + return 0; +} + +static int sequence_ext (mpeg2dec_t * mpeg2dec) +{ + uint8_t * buffer = mpeg2dec->chunk_start; + mpeg2_sequence_t * sequence = &(mpeg2dec->new_sequence); + uint32_t flags; + + if (!(buffer[3] & 1)) + return 1; + + sequence->profile_level_id = (buffer[0] << 4) | (buffer[1] >> 4); + + sequence->display_width = sequence->picture_width += + ((buffer[1] << 13) | (buffer[2] << 5)) & 0x3000; + sequence->display_height = sequence->picture_height += + (buffer[2] << 7) & 0x3000; + sequence->width = (sequence->picture_width + 15) & ~15; + sequence->height = (sequence->picture_height + 15) & ~15; + flags = sequence->flags | SEQ_FLAG_MPEG2; + if (!(buffer[1] & 8)) { + flags &= ~SEQ_FLAG_PROGRESSIVE_SEQUENCE; + sequence->height = (sequence->height + 31) & ~31; + } + if (buffer[5] & 0x80) + flags |= SEQ_FLAG_LOW_DELAY; + sequence->flags = flags; + sequence->chroma_width = sequence->width; + sequence->chroma_height = sequence->height; + switch (buffer[1] & 6) { + case 0: /* invalid */ + return 1; + case 2: /* 4:2:0 */ + sequence->chroma_height >>= 1; + case 4: /* 4:2:2 */ + sequence->chroma_width >>= 1; + } + + sequence->byte_rate += ((buffer[2]<<25) | (buffer[3]<<17)) & 0x3ffc0000; + + sequence->vbv_buffer_size |= buffer[4] << 21; + + sequence->frame_period = + sequence->frame_period * ((buffer[5]&31)+1) / (((buffer[5]>>2)&3)+1); + + mpeg2dec->ext_state = SEQ_DISPLAY_EXT; + + return 0; +} + +static int sequence_display_ext (mpeg2dec_t * mpeg2dec) +{ + uint8_t * buffer = mpeg2dec->chunk_start; + mpeg2_sequence_t * sequence = &(mpeg2dec->new_sequence); + uint32_t flags; + + flags = ((sequence->flags & ~SEQ_MASK_VIDEO_FORMAT) | + ((buffer[0]<<4) & SEQ_MASK_VIDEO_FORMAT)); + if (buffer[0] & 1) { + flags |= SEQ_FLAG_COLOUR_DESCRIPTION; + sequence->colour_primaries = buffer[1]; + sequence->transfer_characteristics = buffer[2]; + sequence->matrix_coefficients = buffer[3]; + buffer += 3; + } + + if (!(buffer[2] & 2)) /* missing marker_bit */ + return 1; + + sequence->display_width = (buffer[1] << 6) | (buffer[2] >> 2); + sequence->display_height = + ((buffer[2]& 1 ) << 13) | (buffer[3] << 5) | (buffer[4] >> 3); + + return 0; +} + +static inline void finalize_sequence (mpeg2_sequence_t * sequence) +{ + int width; + int height; + + sequence->byte_rate *= 50; + + if (sequence->flags & SEQ_FLAG_MPEG2) { + switch (sequence->pixel_width) { + case 1: /* square pixels */ + sequence->pixel_width = sequence->pixel_height = 1; return; + case 2: /* 4:3 aspect ratio */ + width = 4; height = 3; break; + case 3: /* 16:9 aspect ratio */ + width = 16; height = 9; break; + case 4: /* 2.21:1 aspect ratio */ + width = 221; height = 100; break; + default: /* illegal */ + sequence->pixel_width = sequence->pixel_height = 0; return; + } + width *= sequence->display_height; + height *= sequence->display_width; + + } else { + if (sequence->byte_rate == 50 * 0x3ffff) + sequence->byte_rate = 0; /* mpeg-1 VBR */ + + switch (sequence->pixel_width) { + case 0: case 15: /* illegal */ + sequence->pixel_width = sequence->pixel_height = 0; return; + case 1: /* square pixels */ + sequence->pixel_width = sequence->pixel_height = 1; return; + case 3: /* 720x576 16:9 */ + sequence->pixel_width = 64; sequence->pixel_height = 45; return; + case 6: /* 720x480 16:9 */ + sequence->pixel_width = 32; sequence->pixel_height = 27; return; + case 12: /* 720*480 4:3 */ + sequence->pixel_width = 8; sequence->pixel_height = 9; return; + default: + height = 88 * sequence->pixel_width + 1171; + width = 2000; + } + } + + sequence->pixel_width = width; + sequence->pixel_height = height; + while (width) { /* find greatest common divisor */ + int tmp = width; + width = height % tmp; + height = tmp; + } + sequence->pixel_width /= height; + sequence->pixel_height /= height; +} + +static void copy_matrix (mpeg2dec_t * mpeg2dec, int index) +{ + if (memcmp (mpeg2dec->quantizer_matrix[index], + mpeg2dec->new_quantizer_matrix[index], 64)) { + tc_memcpy (mpeg2dec->quantizer_matrix[index], + mpeg2dec->new_quantizer_matrix[index], 64); + mpeg2dec->scaled[index] = -1; + } +} + +static void finalize_matrix (mpeg2dec_t * mpeg2dec) +{ + mpeg2_decoder_t * decoder = &(mpeg2dec->decoder); + int i; + + for (i = 0; i < 2; i++) { + if (mpeg2dec->copy_matrix & (1 << i)) + copy_matrix (mpeg2dec, i); + if ((mpeg2dec->copy_matrix & (4 << i)) && + memcmp (mpeg2dec->quantizer_matrix[i], + mpeg2dec->new_quantizer_matrix[i+2], 64)) { + copy_matrix (mpeg2dec, i + 2); + decoder->chroma_quantizer[i] = decoder->quantizer_prescale[i+2]; + } else if (mpeg2dec->copy_matrix & (5 << i)) + decoder->chroma_quantizer[i] = decoder->quantizer_prescale[i]; + } +} + +static mpeg2_state_t invalid_end_action (mpeg2dec_t * mpeg2dec) +{ + mpeg2_reset_info (&(mpeg2dec->info)); + mpeg2dec->info.gop = NULL; + info_user_data (mpeg2dec); + mpeg2_header_state_init (mpeg2dec); + mpeg2dec->sequence = mpeg2dec->new_sequence; + mpeg2dec->action = mpeg2_seek_header; + mpeg2dec->state = STATE_SEQUENCE; + return STATE_SEQUENCE; +} + +void mpeg2_header_sequence_finalize (mpeg2dec_t * mpeg2dec) +{ + mpeg2_sequence_t * sequence = &(mpeg2dec->new_sequence); + mpeg2_decoder_t * decoder = &(mpeg2dec->decoder); + + finalize_sequence (sequence); + finalize_matrix (mpeg2dec); + + decoder->mpeg1 = !(sequence->flags & SEQ_FLAG_MPEG2); + decoder->width = sequence->width; + decoder->height = sequence->height; + decoder->vertical_position_extension = (sequence->picture_height > 2800); + decoder->chroma_format = ((sequence->chroma_width == sequence->width) + + (sequence->chroma_height == sequence->height)); + + if (mpeg2dec->sequence.width != (unsigned)-1) { + unsigned int new_byte_rate; + + /* + * According to 6.1.1.6, repeat sequence headers should be + * identical to the original. However some DVDs dont respect + * that and have different bitrates in the repeat sequence + * headers. So we'll ignore that in the comparison and still + * consider these as repeat sequence headers. + * + * However, be careful not to alter the current sequence when + * returning STATE_INVALID_END. + */ + new_byte_rate = sequence->byte_rate; + sequence->byte_rate = mpeg2dec->sequence.byte_rate; + if (memcmp (&(mpeg2dec->sequence), sequence, + sizeof (mpeg2_sequence_t))) { + decoder->stride_frame = sequence->width; + sequence->byte_rate = new_byte_rate; + mpeg2_header_end (mpeg2dec); + mpeg2dec->action = invalid_end_action; + mpeg2dec->state = STATE_INVALID_END; + return; + } + sequence->byte_rate = new_byte_rate; + mpeg2dec->state = STATE_SEQUENCE_REPEATED; + } else + decoder->stride_frame = sequence->width; + mpeg2dec->sequence = *sequence; + mpeg2_reset_info (&(mpeg2dec->info)); + mpeg2dec->info.sequence = &(mpeg2dec->sequence); + mpeg2dec->info.gop = NULL; + info_user_data (mpeg2dec); +} + +int mpeg2_header_gop (mpeg2dec_t * mpeg2dec) +{ + uint8_t * buffer = mpeg2dec->chunk_start; + mpeg2_gop_t * gop = &(mpeg2dec->new_gop); + + if (! (buffer[1] & 8)) + return 1; + gop->hours = (buffer[0] >> 2) & 31; + gop->minutes = ((buffer[0] << 4) | (buffer[1] >> 4)) & 63; + gop->seconds = ((buffer[1] << 3) | (buffer[2] >> 5)) & 63; + gop->pictures = ((buffer[2] << 1) | (buffer[3] >> 7)) & 63; + gop->flags = (buffer[0] >> 7) | ((buffer[3] >> 4) & 6); + mpeg2dec->state = STATE_GOP; + return 0; +} + +void mpeg2_header_gop_finalize (mpeg2dec_t * mpeg2dec) +{ + mpeg2dec->gop = mpeg2dec->new_gop; + mpeg2_reset_info (&(mpeg2dec->info)); + mpeg2dec->info.gop = &(mpeg2dec->gop); + info_user_data (mpeg2dec); +} + +void mpeg2_set_fbuf (mpeg2dec_t * mpeg2dec, int b_type) +{ + int i; + + for (i = 0; i < 3; i++) + if (mpeg2dec->fbuf[1] != &mpeg2dec->fbuf_alloc[i].fbuf && + mpeg2dec->fbuf[2] != &mpeg2dec->fbuf_alloc[i].fbuf) { + mpeg2dec->fbuf[0] = &mpeg2dec->fbuf_alloc[i].fbuf; + mpeg2dec->info.current_fbuf = mpeg2dec->fbuf[0]; + if (b_type || (mpeg2dec->sequence.flags & SEQ_FLAG_LOW_DELAY)) { + if (b_type || mpeg2dec->convert) + mpeg2dec->info.discard_fbuf = mpeg2dec->fbuf[0]; + mpeg2dec->info.display_fbuf = mpeg2dec->fbuf[0]; + } + break; + } +} + +mpeg2_state_t mpeg2_header_picture_start (mpeg2dec_t * mpeg2dec) +{ + mpeg2_picture_t * picture = &(mpeg2dec->new_picture); + + mpeg2dec->state = ((mpeg2dec->state != STATE_SLICE_1ST) ? + STATE_PICTURE : STATE_PICTURE_2ND); + picture->flags = 0; + picture->tag = picture->tag2 = 0; + if (mpeg2dec->num_tags) { + if (mpeg2dec->bytes_since_tag >= 4) { + mpeg2dec->num_tags = 0; + picture->tag = mpeg2dec->tag_current; + picture->tag2 = mpeg2dec->tag2_current; + picture->flags = PIC_FLAG_TAGS; + } else if (mpeg2dec->num_tags > 1) { + mpeg2dec->num_tags = 1; + picture->tag = mpeg2dec->tag_previous; + picture->tag2 = mpeg2dec->tag2_previous; + picture->flags = PIC_FLAG_TAGS; + } + } + picture->display_offset[0].x = picture->display_offset[1].x = + picture->display_offset[2].x = mpeg2dec->display_offset_x; + picture->display_offset[0].y = picture->display_offset[1].y = + picture->display_offset[2].y = mpeg2dec->display_offset_y; + return mpeg2_parse_header (mpeg2dec); +} + +int mpeg2_header_picture (mpeg2dec_t * mpeg2dec) +{ + uint8_t * buffer = mpeg2dec->chunk_start; + mpeg2_picture_t * picture = &(mpeg2dec->new_picture); + mpeg2_decoder_t * decoder = &(mpeg2dec->decoder); + int type; + + type = (buffer [1] >> 3) & 7; + mpeg2dec->ext_state = PIC_CODING_EXT; + + picture->temporal_reference = (buffer[0] << 2) | (buffer[1] >> 6); + + picture->flags |= type; + + if (type == PIC_FLAG_CODING_TYPE_P || type == PIC_FLAG_CODING_TYPE_B) { + /* forward_f_code and backward_f_code - used in mpeg1 only */ + decoder->f_motion.f_code[1] = (buffer[3] >> 2) & 1; + decoder->f_motion.f_code[0] = + (((buffer[3] << 1) | (buffer[4] >> 7)) & 7) - 1; + decoder->b_motion.f_code[1] = (buffer[4] >> 6) & 1; + decoder->b_motion.f_code[0] = ((buffer[4] >> 3) & 7) - 1; + } + + /* XXXXXX decode extra_information_picture as well */ + + picture->nb_fields = 2; + + mpeg2dec->q_scale_type = 0; + decoder->intra_dc_precision = 7; + decoder->frame_pred_frame_dct = 1; + decoder->concealment_motion_vectors = 0; + decoder->scan = mpeg2_scan_norm; + decoder->picture_structure = FRAME_PICTURE; + mpeg2dec->copy_matrix = 0; + + return 0; +} + +static int picture_coding_ext (mpeg2dec_t * mpeg2dec) +{ + uint8_t * buffer = mpeg2dec->chunk_start; + mpeg2_picture_t * picture = &(mpeg2dec->new_picture); + mpeg2_decoder_t * decoder = &(mpeg2dec->decoder); + uint32_t flags; + + /* pre subtract 1 for use later in compute_motion_vector */ + decoder->f_motion.f_code[0] = (buffer[0] & 15) - 1; + decoder->f_motion.f_code[1] = (buffer[1] >> 4) - 1; + decoder->b_motion.f_code[0] = (buffer[1] & 15) - 1; + decoder->b_motion.f_code[1] = (buffer[2] >> 4) - 1; + + flags = picture->flags; + decoder->intra_dc_precision = 7 - ((buffer[2] >> 2) & 3); + decoder->picture_structure = buffer[2] & 3; + switch (decoder->picture_structure) { + case TOP_FIELD: + flags |= PIC_FLAG_TOP_FIELD_FIRST; + case BOTTOM_FIELD: + picture->nb_fields = 1; + break; + case FRAME_PICTURE: + if (!(mpeg2dec->sequence.flags & SEQ_FLAG_PROGRESSIVE_SEQUENCE)) { + picture->nb_fields = (buffer[3] & 2) ? 3 : 2; + flags |= (buffer[3] & 128) ? PIC_FLAG_TOP_FIELD_FIRST : 0; + } else + picture->nb_fields = (buffer[3]&2) ? ((buffer[3]&128) ? 6 : 4) : 2; + break; + default: + return 1; + } + decoder->top_field_first = buffer[3] >> 7; + decoder->frame_pred_frame_dct = (buffer[3] >> 6) & 1; + decoder->concealment_motion_vectors = (buffer[3] >> 5) & 1; + mpeg2dec->q_scale_type = buffer[3] & 16; + decoder->intra_vlc_format = (buffer[3] >> 3) & 1; + decoder->scan = (buffer[3] & 4) ? mpeg2_scan_alt : mpeg2_scan_norm; + flags |= (buffer[4] & 0x80) ? PIC_FLAG_PROGRESSIVE_FRAME : 0; + if (buffer[4] & 0x40) + flags |= (((buffer[4]<<26) | (buffer[5]<<18) | (buffer[6]<<10)) & + PIC_MASK_COMPOSITE_DISPLAY) | PIC_FLAG_COMPOSITE_DISPLAY; + picture->flags = flags; + + mpeg2dec->ext_state = PIC_DISPLAY_EXT | COPYRIGHT_EXT | QUANT_MATRIX_EXT; + + return 0; +} + +static int picture_display_ext (mpeg2dec_t * mpeg2dec) +{ + uint8_t * buffer = mpeg2dec->chunk_start; + mpeg2_picture_t * picture = &(mpeg2dec->new_picture); + int i, nb_pos; + + nb_pos = picture->nb_fields; + if (mpeg2dec->sequence.flags & SEQ_FLAG_PROGRESSIVE_SEQUENCE) + nb_pos >>= 1; + + for (i = 0; i < nb_pos; i++) { + int x, y; + + x = ((buffer[4*i] << 24) | (buffer[4*i+1] << 16) | + (buffer[4*i+2] << 8) | buffer[4*i+3]) >> (11-2*i); + y = ((buffer[4*i+2] << 24) | (buffer[4*i+3] << 16) | + (buffer[4*i+4] << 8) | buffer[4*i+5]) >> (10-2*i); + if (! (x & y & 1)) + return 1; + picture->display_offset[i].x = mpeg2dec->display_offset_x = x >> 1; + picture->display_offset[i].y = mpeg2dec->display_offset_y = y >> 1; + } + for (; i < 3; i++) { + picture->display_offset[i].x = mpeg2dec->display_offset_x; + picture->display_offset[i].y = mpeg2dec->display_offset_y; + } + return 0; +} + +void mpeg2_header_picture_finalize (mpeg2dec_t * mpeg2dec, uint32_t accels) +{ + mpeg2_decoder_t * decoder = &(mpeg2dec->decoder); + int old_type_b = (decoder->coding_type == B_TYPE); + int low_delay = mpeg2dec->sequence.flags & SEQ_FLAG_LOW_DELAY; + + finalize_matrix (mpeg2dec); + decoder->coding_type = mpeg2dec->new_picture.flags & PIC_MASK_CODING_TYPE; + + if (mpeg2dec->state == STATE_PICTURE) { + mpeg2_picture_t * picture; + mpeg2_picture_t * other; + + decoder->second_field = 0; + + picture = other = mpeg2dec->pictures; + if (old_type_b ^ (mpeg2dec->picture < mpeg2dec->pictures + 2)) + picture += 2; + else + other += 2; + mpeg2dec->picture = picture; + *picture = mpeg2dec->new_picture; + + if (!old_type_b) { + mpeg2dec->fbuf[2] = mpeg2dec->fbuf[1]; + mpeg2dec->fbuf[1] = mpeg2dec->fbuf[0]; + } + mpeg2dec->fbuf[0] = NULL; + mpeg2_reset_info (&(mpeg2dec->info)); + mpeg2dec->info.current_picture = picture; + mpeg2dec->info.display_picture = picture; + if (decoder->coding_type != B_TYPE) { + if (!low_delay) { + if (mpeg2dec->first) { + mpeg2dec->info.display_picture = NULL; + mpeg2dec->first = 0; + } else { + mpeg2dec->info.display_picture = other; + if (other->nb_fields == 1) + mpeg2dec->info.display_picture_2nd = other + 1; + mpeg2dec->info.display_fbuf = mpeg2dec->fbuf[1]; + } + } + if (!low_delay + !mpeg2dec->convert) + mpeg2dec->info.discard_fbuf = + mpeg2dec->fbuf[!low_delay + !mpeg2dec->convert]; + } + if (mpeg2dec->convert) { + mpeg2_convert_init_t convert_init; + if (!mpeg2dec->convert_start) { + int y_size, uv_size; + + mpeg2dec->decoder.convert_id = + mpeg2_malloc (mpeg2dec->convert_id_size, + MPEG2_ALLOC_CONVERT_ID); + mpeg2dec->convert (MPEG2_CONVERT_START, + mpeg2dec->decoder.convert_id, + &(mpeg2dec->sequence), + mpeg2dec->convert_stride, accels, + mpeg2dec->convert_arg, &convert_init); + mpeg2dec->convert_start = convert_init.start; + mpeg2dec->decoder.convert = convert_init.copy; + + y_size = decoder->stride_frame * mpeg2dec->sequence.height; + uv_size = y_size >> (2 - mpeg2dec->decoder.chroma_format); + mpeg2dec->yuv_buf[0][0] = + (uint8_t *) mpeg2_malloc (y_size, MPEG2_ALLOC_YUV); + mpeg2dec->yuv_buf[0][1] = + (uint8_t *) mpeg2_malloc (uv_size, MPEG2_ALLOC_YUV); + mpeg2dec->yuv_buf[0][2] = + (uint8_t *) mpeg2_malloc (uv_size, MPEG2_ALLOC_YUV); + mpeg2dec->yuv_buf[1][0] = + (uint8_t *) mpeg2_malloc (y_size, MPEG2_ALLOC_YUV); + mpeg2dec->yuv_buf[1][1] = + (uint8_t *) mpeg2_malloc (uv_size, MPEG2_ALLOC_YUV); + mpeg2dec->yuv_buf[1][2] = + (uint8_t *) mpeg2_malloc (uv_size, MPEG2_ALLOC_YUV); + y_size = decoder->stride_frame * 32; + uv_size = y_size >> (2 - mpeg2dec->decoder.chroma_format); + mpeg2dec->yuv_buf[2][0] = + (uint8_t *) mpeg2_malloc (y_size, MPEG2_ALLOC_YUV); + mpeg2dec->yuv_buf[2][1] = + (uint8_t *) mpeg2_malloc (uv_size, MPEG2_ALLOC_YUV); + mpeg2dec->yuv_buf[2][2] = + (uint8_t *) mpeg2_malloc (uv_size, MPEG2_ALLOC_YUV); + } + if (!mpeg2dec->custom_fbuf) { + while (mpeg2dec->alloc_index < 3) { + mpeg2_fbuf_t * fbuf; + + fbuf = &mpeg2dec->fbuf_alloc[mpeg2dec->alloc_index++].fbuf; + fbuf->id = NULL; + fbuf->buf[0] = + (uint8_t *) mpeg2_malloc (convert_init.buf_size[0], + MPEG2_ALLOC_CONVERTED); + fbuf->buf[1] = + (uint8_t *) mpeg2_malloc (convert_init.buf_size[1], + MPEG2_ALLOC_CONVERTED); + fbuf->buf[2] = + (uint8_t *) mpeg2_malloc (convert_init.buf_size[2], + MPEG2_ALLOC_CONVERTED); + } + mpeg2_set_fbuf (mpeg2dec, (decoder->coding_type == B_TYPE)); + } + } else if (!mpeg2dec->custom_fbuf) { + while (mpeg2dec->alloc_index < 3) { + mpeg2_fbuf_t * fbuf; + int y_size, uv_size; + + fbuf = &(mpeg2dec->fbuf_alloc[mpeg2dec->alloc_index++].fbuf); + fbuf->id = NULL; + y_size = decoder->stride_frame * mpeg2dec->sequence.height; + uv_size = y_size >> (2 - decoder->chroma_format); + fbuf->buf[0] = (uint8_t *) mpeg2_malloc (y_size, + MPEG2_ALLOC_YUV); + fbuf->buf[1] = (uint8_t *) mpeg2_malloc (uv_size, + MPEG2_ALLOC_YUV); + fbuf->buf[2] = (uint8_t *) mpeg2_malloc (uv_size, + MPEG2_ALLOC_YUV); + } + mpeg2_set_fbuf (mpeg2dec, (decoder->coding_type == B_TYPE)); + } + } else { + decoder->second_field = 1; + mpeg2dec->picture++; /* second field picture */ + *(mpeg2dec->picture) = mpeg2dec->new_picture; + mpeg2dec->info.current_picture_2nd = mpeg2dec->picture; + if (low_delay || decoder->coding_type == B_TYPE) + mpeg2dec->info.display_picture_2nd = mpeg2dec->picture; + } + + info_user_data (mpeg2dec); +} + +static int copyright_ext (mpeg2dec_t * mpeg2dec) +{ + return 0; +} + +static int quant_matrix_ext (mpeg2dec_t * mpeg2dec) +{ + uint8_t * buffer = mpeg2dec->chunk_start; + int i, j; + + for (i = 0; i < 4; i++) + if (buffer[0] & (8 >> i)) { + for (j = 0; j < 64; j++) + mpeg2dec->new_quantizer_matrix[i][mpeg2_scan_norm[j]] = + (buffer[j] << (i+5)) | (buffer[j+1] >> (3-i)); + mpeg2dec->copy_matrix |= 1 << i; + buffer += 64; + } + + return 0; +} + +int mpeg2_header_extension (mpeg2dec_t * mpeg2dec) +{ + static int (* parser[]) (mpeg2dec_t *) = { + 0, sequence_ext, sequence_display_ext, quant_matrix_ext, + copyright_ext, 0, 0, picture_display_ext, picture_coding_ext + }; + int ext, ext_bit; + + ext = mpeg2dec->chunk_start[0] >> 4; + ext_bit = 1 << ext; + + if (!(mpeg2dec->ext_state & ext_bit)) + return 0; /* ignore illegal extensions */ + mpeg2dec->ext_state &= ~ext_bit; + return parser[ext] (mpeg2dec); +} + +int mpeg2_header_user_data (mpeg2dec_t * mpeg2dec) +{ + mpeg2dec->user_data_len += mpeg2dec->chunk_ptr - 1 - mpeg2dec->chunk_start; + mpeg2dec->chunk_start = mpeg2dec->chunk_ptr - 1; + + return 0; +} + +static void prescale (mpeg2dec_t * mpeg2dec, int index) +{ + static int non_linear_scale [] = { + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 10, 12, 14, 16, 18, 20, 22, + 24, 28, 32, 36, 40, 44, 48, 52, + 56, 64, 72, 80, 88, 96, 104, 112 + }; + int i, j, k; + mpeg2_decoder_t * decoder = &(mpeg2dec->decoder); + + if (mpeg2dec->scaled[index] != mpeg2dec->q_scale_type) { + mpeg2dec->scaled[index] = mpeg2dec->q_scale_type; + for (i = 0; i < 32; i++) { + k = mpeg2dec->q_scale_type ? non_linear_scale[i] : (i << 1); + for (j = 0; j < 64; j++) + decoder->quantizer_prescale[index][i][j] = + k * mpeg2dec->quantizer_matrix[index][j]; + } + } +} + +mpeg2_state_t mpeg2_header_slice_start (mpeg2dec_t * mpeg2dec) +{ + mpeg2_decoder_t * decoder = &(mpeg2dec->decoder); + + mpeg2dec->info.user_data = NULL; mpeg2dec->info.user_data_len = 0; + mpeg2dec->state = ((mpeg2dec->picture->nb_fields > 1 || + mpeg2dec->state == STATE_PICTURE_2ND) ? + STATE_SLICE : STATE_SLICE_1ST); + + if (mpeg2dec->decoder.coding_type != D_TYPE) { + prescale (mpeg2dec, 0); + if (decoder->chroma_quantizer[0] == decoder->quantizer_prescale[2]) + prescale (mpeg2dec, 2); + if (mpeg2dec->decoder.coding_type != I_TYPE) { + prescale (mpeg2dec, 1); + if (decoder->chroma_quantizer[1] == decoder->quantizer_prescale[3]) + prescale (mpeg2dec, 3); + } + } + + if (!(mpeg2dec->nb_decode_slices)) + mpeg2dec->picture->flags |= PIC_FLAG_SKIP; + else if (mpeg2dec->convert_start) { + mpeg2dec->convert_start (decoder->convert_id, mpeg2dec->fbuf[0], + mpeg2dec->picture, mpeg2dec->info.gop); + + if (mpeg2dec->decoder.coding_type == B_TYPE) + mpeg2_init_fbuf (&(mpeg2dec->decoder), mpeg2dec->yuv_buf[2], + mpeg2dec->yuv_buf[mpeg2dec->yuv_index ^ 1], + mpeg2dec->yuv_buf[mpeg2dec->yuv_index]); + else { + mpeg2_init_fbuf (&(mpeg2dec->decoder), + mpeg2dec->yuv_buf[mpeg2dec->yuv_index ^ 1], + mpeg2dec->yuv_buf[mpeg2dec->yuv_index], + mpeg2dec->yuv_buf[mpeg2dec->yuv_index]); + if (mpeg2dec->state == STATE_SLICE) + mpeg2dec->yuv_index ^= 1; + } + } else { + int b_type; + + b_type = (mpeg2dec->decoder.coding_type == B_TYPE); + mpeg2_init_fbuf (&(mpeg2dec->decoder), mpeg2dec->fbuf[0]->buf, + mpeg2dec->fbuf[b_type + 1]->buf, + mpeg2dec->fbuf[b_type]->buf); + } + mpeg2dec->action = NULL; + return (mpeg2_state_t)-1; +} + +static mpeg2_state_t seek_sequence (mpeg2dec_t * mpeg2dec) +{ + mpeg2_reset_info (&(mpeg2dec->info)); + mpeg2dec->info.sequence = NULL; + mpeg2dec->info.gop = NULL; + mpeg2_header_state_init (mpeg2dec); + mpeg2dec->action = mpeg2_seek_header; + return mpeg2_seek_header (mpeg2dec); +} + +mpeg2_state_t mpeg2_header_end (mpeg2dec_t * mpeg2dec) +{ + mpeg2_picture_t * picture; + int b_type; + + b_type = (mpeg2dec->decoder.coding_type == B_TYPE); + picture = mpeg2dec->pictures; + if ((mpeg2dec->picture >= picture + 2) ^ b_type) + picture = mpeg2dec->pictures + 2; + + mpeg2_reset_info (&(mpeg2dec->info)); + if (!(mpeg2dec->sequence.flags & SEQ_FLAG_LOW_DELAY)) { + mpeg2dec->info.display_picture = picture; + if (picture->nb_fields == 1) + mpeg2dec->info.display_picture_2nd = picture + 1; + mpeg2dec->info.display_fbuf = mpeg2dec->fbuf[b_type]; + if (!mpeg2dec->convert) + mpeg2dec->info.discard_fbuf = mpeg2dec->fbuf[b_type + 1]; + } else if (!mpeg2dec->convert) + mpeg2dec->info.discard_fbuf = mpeg2dec->fbuf[b_type]; + mpeg2dec->action = seek_sequence; + return STATE_END; +} diff --git a/k9decmpeg/idct.cpp b/k9decmpeg/idct.cpp new file mode 100755 index 0000000..bd2da27 --- /dev/null +++ b/k9decmpeg/idct.cpp @@ -0,0 +1,286 @@ +/* + * idct.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" +#include "k9common.h" +#include + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" + +#define W1 2841 /* 2048 * sqrt (2) * cos (1 * pi / 16) */ +#define W2 2676 /* 2048 * sqrt (2) * cos (2 * pi / 16) */ +#define W3 2408 /* 2048 * sqrt (2) * cos (3 * pi / 16) */ +#define W5 1609 /* 2048 * sqrt (2) * cos (5 * pi / 16) */ +#define W6 1108 /* 2048 * sqrt (2) * cos (6 * pi / 16) */ +#define W7 565 /* 2048 * sqrt (2) * cos (7 * pi / 16) */ + +/* idct main entry point */ +void (* mpeg2_idct_copy) (int16_t * block, uint8_t * dest, int stride); +void (* mpeg2_idct_add) (int last, int16_t * block, + uint8_t * dest, int stride); + +/* + * In legal streams, the IDCT output should be between -384 and +384. + * In corrupted streams, it is possible to force the IDCT output to go + * to +-3826 - this is the worst case for a column IDCT where the + * column inputs are 16-bit values. + */ +uint8_t mpeg2_clip[3840 * 2 + 256]; +#define CLIP(i) ((mpeg2_clip + 3840)[i]) + +#if 0 +#define BUTTERFLY(t0,t1,W0,W1,d0,d1) \ +do { \ + t0 = W0 * d0 + W1 * d1; \ + t1 = W0 * d1 - W1 * d0; \ +} while (0) +#else +#define BUTTERFLY(t0,t1,W0,W1,d0,d1) \ +do { \ + int tmp = W0 * (d0 + d1); \ + t0 = tmp + (W1 - W0) * d1; \ + t1 = tmp - (W1 + W0) * d0; \ +} while (0) +#endif + +static void inline idct_row (int16_t * const block) +{ + int d0, d1, d2, d3; + int a0, a1, a2, a3, b0, b1, b2, b3; + int t0, t1, t2, t3; + + /* shortcut */ + if (likely (!(block[1] | ((int32_t *)block)[1] | ((int32_t *)block)[2] | + ((int32_t *)block)[3]))) { + uint32_t tmp = (uint16_t) (block[0] >> 1); + tmp |= tmp << 16; + ((int32_t *)block)[0] = tmp; + ((int32_t *)block)[1] = tmp; + ((int32_t *)block)[2] = tmp; + ((int32_t *)block)[3] = tmp; + return; + } + + d0 = (block[0] << 11) + 2048; + d1 = block[1]; + d2 = block[2] << 11; + d3 = block[3]; + t0 = d0 + d2; + t1 = d0 - d2; + BUTTERFLY (t2, t3, W6, W2, d3, d1); + a0 = t0 + t2; + a1 = t1 + t3; + a2 = t1 - t3; + a3 = t0 - t2; + + d0 = block[4]; + d1 = block[5]; + d2 = block[6]; + d3 = block[7]; + BUTTERFLY (t0, t1, W7, W1, d3, d0); + BUTTERFLY (t2, t3, W3, W5, d1, d2); + b0 = t0 + t2; + b3 = t1 + t3; + t0 -= t2; + t1 -= t3; + b1 = ((t0 + t1) >> 8) * 181; + b2 = ((t0 - t1) >> 8) * 181; + + block[0] = (a0 + b0) >> 12; + block[1] = (a1 + b1) >> 12; + block[2] = (a2 + b2) >> 12; + block[3] = (a3 + b3) >> 12; + block[4] = (a3 - b3) >> 12; + block[5] = (a2 - b2) >> 12; + block[6] = (a1 - b1) >> 12; + block[7] = (a0 - b0) >> 12; +} + +static void inline idct_col (int16_t * const block) +{ + int d0, d1, d2, d3; + int a0, a1, a2, a3, b0, b1, b2, b3; + int t0, t1, t2, t3; + + d0 = (block[8*0] << 11) + 65536; + d1 = block[8*1]; + d2 = block[8*2] << 11; + d3 = block[8*3]; + t0 = d0 + d2; + t1 = d0 - d2; + BUTTERFLY (t2, t3, W6, W2, d3, d1); + a0 = t0 + t2; + a1 = t1 + t3; + a2 = t1 - t3; + a3 = t0 - t2; + + d0 = block[8*4]; + d1 = block[8*5]; + d2 = block[8*6]; + d3 = block[8*7]; + BUTTERFLY (t0, t1, W7, W1, d3, d0); + BUTTERFLY (t2, t3, W3, W5, d1, d2); + b0 = t0 + t2; + b3 = t1 + t3; + t0 -= t2; + t1 -= t3; + b1 = ((t0 + t1) >> 8) * 181; + b2 = ((t0 - t1) >> 8) * 181; + + block[8*0] = (a0 + b0) >> 17; + block[8*1] = (a1 + b1) >> 17; + block[8*2] = (a2 + b2) >> 17; + block[8*3] = (a3 + b3) >> 17; + block[8*4] = (a3 - b3) >> 17; + block[8*5] = (a2 - b2) >> 17; + block[8*6] = (a1 - b1) >> 17; + block[8*7] = (a0 - b0) >> 17; +} + +static void mpeg2_idct_copy_c (int16_t * block, uint8_t * dest, + const int stride) +{ + int i; + + for (i = 0; i < 8; i++) + idct_row (block + 8 * i); + for (i = 0; i < 8; i++) + idct_col (block + i); + do { + dest[0] = CLIP (block[0]); + dest[1] = CLIP (block[1]); + dest[2] = CLIP (block[2]); + dest[3] = CLIP (block[3]); + dest[4] = CLIP (block[4]); + dest[5] = CLIP (block[5]); + dest[6] = CLIP (block[6]); + dest[7] = CLIP (block[7]); + + ((int32_t *)block)[0] = 0; ((int32_t *)block)[1] = 0; + ((int32_t *)block)[2] = 0; ((int32_t *)block)[3] = 0; + + dest += stride; + block += 8; + } while (--i); +} + +static void mpeg2_idct_add_c (const int last, int16_t * block, + uint8_t * dest, const int stride) +{ + int i; + + if (last != 129 || (block[0] & (7 << 4)) == (4 << 4)) { + for (i = 0; i < 8; i++) + idct_row (block + 8 * i); + for (i = 0; i < 8; i++) + idct_col (block + i); + do { + dest[0] = CLIP (block[0] + dest[0]); + dest[1] = CLIP (block[1] + dest[1]); + dest[2] = CLIP (block[2] + dest[2]); + dest[3] = CLIP (block[3] + dest[3]); + dest[4] = CLIP (block[4] + dest[4]); + dest[5] = CLIP (block[5] + dest[5]); + dest[6] = CLIP (block[6] + dest[6]); + dest[7] = CLIP (block[7] + dest[7]); + + ((int32_t *)block)[0] = 0; ((int32_t *)block)[1] = 0; + ((int32_t *)block)[2] = 0; ((int32_t *)block)[3] = 0; + + dest += stride; + block += 8; + } while (--i); + } else { + int DC; + + DC = (block[0] + 64) >> 7; + block[0] = block[63] = 0; + i = 8; + do { + dest[0] = CLIP (DC + dest[0]); + dest[1] = CLIP (DC + dest[1]); + dest[2] = CLIP (DC + dest[2]); + dest[3] = CLIP (DC + dest[3]); + dest[4] = CLIP (DC + dest[4]); + dest[5] = CLIP (DC + dest[5]); + dest[6] = CLIP (DC + dest[6]); + dest[7] = CLIP (DC + dest[7]); + dest += stride; + } while (--i); + } +} + +void mpeg2_idct_init (uint32_t accel) +{ +#ifdef ARCH_X86 + if (accel & MPEG2_ACCEL_X86_MMXEXT) { + mpeg2_idct_copy = mpeg2_idct_copy_mmxext; + mpeg2_idct_add = mpeg2_idct_add_mmxext; + mpeg2_idct_mmx_init (); + } else if (accel & MPEG2_ACCEL_X86_MMX) { + mpeg2_idct_copy = mpeg2_idct_copy_mmx; + mpeg2_idct_add = mpeg2_idct_add_mmx; + mpeg2_idct_mmx_init (); + } else +#endif +#ifdef ARCH_PPC + if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { + mpeg2_idct_copy = mpeg2_idct_copy_altivec; + mpeg2_idct_add = mpeg2_idct_add_altivec; + mpeg2_idct_altivec_init (); + } else +#endif +#ifdef ARCH_ALPHA + if (accel & MPEG2_ACCEL_ALPHA_MVI) { + mpeg2_idct_copy = mpeg2_idct_copy_mvi; + mpeg2_idct_add = mpeg2_idct_add_mvi; + mpeg2_idct_alpha_init (); + } else if (accel & MPEG2_ACCEL_ALPHA) { + int i; + + mpeg2_idct_copy = mpeg2_idct_copy_alpha; + mpeg2_idct_add = mpeg2_idct_add_alpha; + mpeg2_idct_alpha_init (); + for (i = -3840; i < 3840 + 256; i++) + CLIP(i) = (i < 0) ? 0 : ((i > 255) ? 255 : i); + } else +#endif + { + extern uint8_t mpeg2_scan_norm[64]; + extern uint8_t mpeg2_scan_alt[64]; + int i, j; + + mpeg2_idct_copy = mpeg2_idct_copy_c; + mpeg2_idct_add = mpeg2_idct_add_c; + for (i = -3840; i < 3840 + 256; i++) + CLIP(i) = (i < 0) ? 0 : ((i > 255) ? 255 : i); + for (i = 0; i < 64; i++) { + j = mpeg2_scan_norm[i]; + mpeg2_scan_norm[i] = ((j & 0x36) >> 1) | ((j & 0x09) << 2); + j = mpeg2_scan_alt[i]; + mpeg2_scan_alt[i] = ((j & 0x36) >> 1) | ((j & 0x09) << 2); + } + } +} diff --git a/k9decmpeg/idct_alpha.cpp b/k9decmpeg/idct_alpha.cpp new file mode 100755 index 0000000..4f1e88f --- /dev/null +++ b/k9decmpeg/idct_alpha.cpp @@ -0,0 +1,378 @@ +/* + * idct_alpha.c + * Copyright (C) 2002-2003 Falk Hueffner + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" +#include "k9common.h" +#ifdef ARCH_ALPHA + +#include + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" +#include "alpha_asm.h" + +#define W1 2841 /* 2048 * sqrt (2) * cos (1 * pi / 16) */ +#define W2 2676 /* 2048 * sqrt (2) * cos (2 * pi / 16) */ +#define W3 2408 /* 2048 * sqrt (2) * cos (3 * pi / 16) */ +#define W5 1609 /* 2048 * sqrt (2) * cos (5 * pi / 16) */ +#define W6 1108 /* 2048 * sqrt (2) * cos (6 * pi / 16) */ +#define W7 565 /* 2048 * sqrt (2) * cos (7 * pi / 16) */ + +extern uint8_t mpeg2_clip[3840 * 2 + 256]; +#define CLIP(i) ((mpeg2_clip + 3840)[i]) + +#if 0 +#define BUTTERFLY(t0,t1,W0,W1,d0,d1) \ +do { \ + t0 = W0 * d0 + W1 * d1; \ + t1 = W0 * d1 - W1 * d0; \ +} while (0) +#else +#define BUTTERFLY(t0,t1,W0,W1,d0,d1) \ +do { \ + int_fast32_t tmp = W0 * (d0 + d1); \ + t0 = tmp + (W1 - W0) * d1; \ + t1 = tmp - (W1 + W0) * d0; \ +} while (0) +#endif + +static void inline idct_row (int16_t * const block) +{ + uint64_t l, r; + int_fast32_t d0, d1, d2, d3; + int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3; + int_fast32_t t0, t1, t2, t3; + + l = ldq (block); + r = ldq (block + 4); + + /* shortcut */ + if (likely (!((l & ~0xffffUL) | r))) { + uint64_t tmp = (uint16_t) (l >> 1); + tmp |= tmp << 16; + tmp |= tmp << 32; + ((int32_t *)block)[0] = tmp; + ((int32_t *)block)[1] = tmp; + ((int32_t *)block)[2] = tmp; + ((int32_t *)block)[3] = tmp; + return; + } + + d0 = (sextw (l) << 11) + 2048; + d1 = sextw (extwl (l, 2)); + d2 = sextw (extwl (l, 4)) << 11; + d3 = sextw (extwl (l, 6)); + t0 = d0 + d2; + t1 = d0 - d2; + BUTTERFLY (t2, t3, W6, W2, d3, d1); + a0 = t0 + t2; + a1 = t1 + t3; + a2 = t1 - t3; + a3 = t0 - t2; + + d0 = sextw (r); + d1 = sextw (extwl (r, 2)); + d2 = sextw (extwl (r, 4)); + d3 = sextw (extwl (r, 6)); + BUTTERFLY (t0, t1, W7, W1, d3, d0); + BUTTERFLY (t2, t3, W3, W5, d1, d2); + b0 = t0 + t2; + b3 = t1 + t3; + t0 -= t2; + t1 -= t3; + b1 = ((t0 + t1) >> 8) * 181; + b2 = ((t0 - t1) >> 8) * 181; + + block[0] = (a0 + b0) >> 12; + block[1] = (a1 + b1) >> 12; + block[2] = (a2 + b2) >> 12; + block[3] = (a3 + b3) >> 12; + block[4] = (a3 - b3) >> 12; + block[5] = (a2 - b2) >> 12; + block[6] = (a1 - b1) >> 12; + block[7] = (a0 - b0) >> 12; +} + +static void inline idct_col (int16_t * const block) +{ + int_fast32_t d0, d1, d2, d3; + int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3; + int_fast32_t t0, t1, t2, t3; + + d0 = (block[8*0] << 11) + 65536; + d1 = block[8*1]; + d2 = block[8*2] << 11; + d3 = block[8*3]; + t0 = d0 + d2; + t1 = d0 - d2; + BUTTERFLY (t2, t3, W6, W2, d3, d1); + a0 = t0 + t2; + a1 = t1 + t3; + a2 = t1 - t3; + a3 = t0 - t2; + + d0 = block[8*4]; + d1 = block[8*5]; + d2 = block[8*6]; + d3 = block[8*7]; + BUTTERFLY (t0, t1, W7, W1, d3, d0); + BUTTERFLY (t2, t3, W3, W5, d1, d2); + b0 = t0 + t2; + b3 = t1 + t3; + t0 -= t2; + t1 -= t3; + b1 = ((t0 + t1) >> 8) * 181; + b2 = ((t0 - t1) >> 8) * 181; + + block[8*0] = (a0 + b0) >> 17; + block[8*1] = (a1 + b1) >> 17; + block[8*2] = (a2 + b2) >> 17; + block[8*3] = (a3 + b3) >> 17; + block[8*4] = (a3 - b3) >> 17; + block[8*5] = (a2 - b2) >> 17; + block[8*6] = (a1 - b1) >> 17; + block[8*7] = (a0 - b0) >> 17; +} + +void mpeg2_idct_copy_mvi (int16_t * block, uint8_t * dest, const int stride) +{ + uint64_t clampmask; + int i; + + for (i = 0; i < 8; i++) + idct_row (block + 8 * i); + + for (i = 0; i < 8; i++) + idct_col (block + i); + + clampmask = zap (-1, 0xaa); /* 0x00ff00ff00ff00ff */ + do { + uint64_t shorts0, shorts1; + + shorts0 = ldq (block); + shorts0 = maxsw4 (shorts0, 0); + shorts0 = minsw4 (shorts0, clampmask); + stl (pkwb (shorts0), dest); + + shorts1 = ldq (block + 4); + shorts1 = maxsw4 (shorts1, 0); + shorts1 = minsw4 (shorts1, clampmask); + stl (pkwb (shorts1), dest + 4); + + stq (0, block); + stq (0, block + 4); + + dest += stride; + block += 8; + } while (--i); +} + +void mpeg2_idct_add_mvi (const int last, int16_t * block, + uint8_t * dest, const int stride) +{ + uint64_t clampmask; + uint64_t signmask; + int i; + + if (last != 129 || (block[0] & (7 << 4)) == (4 << 4)) { + for (i = 0; i < 8; i++) + idct_row (block + 8 * i); + for (i = 0; i < 8; i++) + idct_col (block + i); + clampmask = zap (-1, 0xaa); /* 0x00ff00ff00ff00ff */ + signmask = zap (-1, 0x33); + signmask ^= signmask >> 1; /* 0x8000800080008000 */ + + do { + uint64_t shorts0, pix0, signs0; + uint64_t shorts1, pix1, signs1; + + shorts0 = ldq (block); + shorts1 = ldq (block + 4); + + pix0 = unpkbw (ldl (dest)); + /* signed subword add (MMX paddw). */ + signs0 = shorts0 & signmask; + shorts0 &= ~signmask; + shorts0 += pix0; + shorts0 ^= signs0; + /* clamp. */ + shorts0 = maxsw4 (shorts0, 0); + shorts0 = minsw4 (shorts0, clampmask); + + /* next 4. */ + pix1 = unpkbw (ldl (dest + 4)); + signs1 = shorts1 & signmask; + shorts1 &= ~signmask; + shorts1 += pix1; + shorts1 ^= signs1; + shorts1 = maxsw4 (shorts1, 0); + shorts1 = minsw4 (shorts1, clampmask); + + stl (pkwb (shorts0), dest); + stl (pkwb (shorts1), dest + 4); + stq (0, block); + stq (0, block + 4); + + dest += stride; + block += 8; + } while (--i); + } else { + int DC; + uint64_t p0, p1, p2, p3, p4, p5, p6, p7; + uint64_t DCs; + + DC = (block[0] + 64) >> 7; + block[0] = block[63] = 0; + + p0 = ldq (dest + 0 * stride); + p1 = ldq (dest + 1 * stride); + p2 = ldq (dest + 2 * stride); + p3 = ldq (dest + 3 * stride); + p4 = ldq (dest + 4 * stride); + p5 = ldq (dest + 5 * stride); + p6 = ldq (dest + 6 * stride); + p7 = ldq (dest + 7 * stride); + + if (DC > 0) { + DCs = BYTE_VEC (likely (DC <= 255) ? DC : 255); + p0 += minub8 (DCs, ~p0); + p1 += minub8 (DCs, ~p1); + p2 += minub8 (DCs, ~p2); + p3 += minub8 (DCs, ~p3); + p4 += minub8 (DCs, ~p4); + p5 += minub8 (DCs, ~p5); + p6 += minub8 (DCs, ~p6); + p7 += minub8 (DCs, ~p7); + } else { + DCs = BYTE_VEC (likely (-DC <= 255) ? -DC : 255); + p0 -= minub8 (DCs, p0); + p1 -= minub8 (DCs, p1); + p2 -= minub8 (DCs, p2); + p3 -= minub8 (DCs, p3); + p4 -= minub8 (DCs, p4); + p5 -= minub8 (DCs, p5); + p6 -= minub8 (DCs, p6); + p7 -= minub8 (DCs, p7); + } + + stq (p0, dest + 0 * stride); + stq (p1, dest + 1 * stride); + stq (p2, dest + 2 * stride); + stq (p3, dest + 3 * stride); + stq (p4, dest + 4 * stride); + stq (p5, dest + 5 * stride); + stq (p6, dest + 6 * stride); + stq (p7, dest + 7 * stride); + } +} + +void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride) +{ + int i; + + for (i = 0; i < 8; i++) + idct_row (block + 8 * i); + for (i = 0; i < 8; i++) + idct_col (block + i); + do { + dest[0] = CLIP (block[0]); + dest[1] = CLIP (block[1]); + dest[2] = CLIP (block[2]); + dest[3] = CLIP (block[3]); + dest[4] = CLIP (block[4]); + dest[5] = CLIP (block[5]); + dest[6] = CLIP (block[6]); + dest[7] = CLIP (block[7]); + + stq(0, block); + stq(0, block + 4); + + dest += stride; + block += 8; + } while (--i); +} + +void mpeg2_idct_add_alpha (const int last, int16_t * block, + uint8_t * dest, const int stride) +{ + int i; + + if (last != 129 || (block[0] & (7 << 4)) == (4 << 4)) { + for (i = 0; i < 8; i++) + idct_row (block + 8 * i); + for (i = 0; i < 8; i++) + idct_col (block + i); + do { + dest[0] = CLIP (block[0] + dest[0]); + dest[1] = CLIP (block[1] + dest[1]); + dest[2] = CLIP (block[2] + dest[2]); + dest[3] = CLIP (block[3] + dest[3]); + dest[4] = CLIP (block[4] + dest[4]); + dest[5] = CLIP (block[5] + dest[5]); + dest[6] = CLIP (block[6] + dest[6]); + dest[7] = CLIP (block[7] + dest[7]); + + stq(0, block); + stq(0, block + 4); + + dest += stride; + block += 8; + } while (--i); + } else { + int DC; + + DC = (block[0] + 64) >> 7; + block[0] = block[63] = 0; + i = 8; + do { + dest[0] = CLIP (DC + dest[0]); + dest[1] = CLIP (DC + dest[1]); + dest[2] = CLIP (DC + dest[2]); + dest[3] = CLIP (DC + dest[3]); + dest[4] = CLIP (DC + dest[4]); + dest[5] = CLIP (DC + dest[5]); + dest[6] = CLIP (DC + dest[6]); + dest[7] = CLIP (DC + dest[7]); + dest += stride; + } while (--i); + } +} + +void mpeg2_idct_alpha_init (void) +{ + extern uint8_t mpeg2_scan_norm[64]; + extern uint8_t mpeg2_scan_alt[64]; + int i, j; + + for (i = 0; i < 64; i++) { + j = mpeg2_scan_norm[i]; + mpeg2_scan_norm[i] = ((j & 0x36) >> 1) | ((j & 0x09) << 2); + j = mpeg2_scan_alt[i]; + mpeg2_scan_alt[i] = ((j & 0x36) >> 1) | ((j & 0x09) << 2); + } +} + +#endif /* ARCH_ALPHA */ diff --git a/k9decmpeg/idct_altivec.cpp b/k9decmpeg/idct_altivec.cpp new file mode 100755 index 0000000..fc68de2 --- /dev/null +++ b/k9decmpeg/idct_altivec.cpp @@ -0,0 +1,287 @@ +/* + * idct_altivec.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" +#include "k9common.h" +#ifdef ARCH_PPC + +#ifdef HAVE_ALTIVEC_H +#include +#endif + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" + +typedef vector signed char vector_s8_t; +typedef vector unsigned char vector_u8_t; +typedef vector signed short vector_s16_t; +typedef vector unsigned short vector_u16_t; +typedef vector signed int vector_s32_t; +typedef vector unsigned int vector_u32_t; + +#if defined(HAVE_ALTIVEC_H) && (__GNUC__ * 100 + __GNUC_MINOR__ < 303) +/* work around gcc <3.3 vec_mergel bug */ +static inline vector_s16_t my_vec_mergel (vector_s16_t const A, + vector_s16_t const B) +{ + static const vector_u8_t mergel = { + 0x08, 0x09, 0x18, 0x19, 0x0a, 0x0b, 0x1a, 0x1b, + 0x0c, 0x0d, 0x1c, 0x1d, 0x0e, 0x0f, 0x1e, 0x1f + }; + return vec_perm (A, B, mergel); +} +#undef vec_mergel +#define vec_mergel my_vec_mergel +#endif + +#ifdef HAVE_ALTIVEC_H /* gnu */ +#define VEC_S16(a,b,c,d,e,f,g,h) {a, b, c, d, e, f, g, h} +#else /* apple */ +#define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) (a, b, c, d, e, f, g, h) +#endif + +static const vector_s16_t constants ATTR_ALIGN(16) = + VEC_S16 (23170, 13573, 6518, 21895, -23170, -21895, 32, 31); +static const vector_s16_t constants_1 ATTR_ALIGN(16) = + VEC_S16 (16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725); +static const vector_s16_t constants_2 ATTR_ALIGN(16) = + VEC_S16 (16069, 22289, 20995, 18895, 16069, 18895, 20995, 22289); +static const vector_s16_t constants_3 ATTR_ALIGN(16) = + VEC_S16 (21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692); +static const vector_s16_t constants_4 ATTR_ALIGN(16) = + VEC_S16 (13623, 18895, 17799, 16019, 13623, 16019, 17799, 18895); + +#define IDCT \ + vector_s16_t vx0, vx1, vx2, vx3, vx4, vx5, vx6, vx7; \ + vector_s16_t vy0, vy1, vy2, vy3, vy4, vy5, vy6, vy7; \ + vector_s16_t a0, a1, a2, ma2, c4, mc4, zero, bias; \ + vector_s16_t t0, t1, t2, t3, t4, t5, t6, t7, t8; \ + vector_u16_t shift; \ + \ + c4 = vec_splat (constants, 0); \ + a0 = vec_splat (constants, 1); \ + a1 = vec_splat (constants, 2); \ + a2 = vec_splat (constants, 3); \ + mc4 = vec_splat (constants, 4); \ + ma2 = vec_splat (constants, 5); \ + bias = (vector_s16_t)vec_splat ((vector_s32_t)constants, 3); \ + \ + zero = vec_splat_s16 (0); \ + \ + vx0 = vec_adds (block[0], block[4]); \ + vx4 = vec_subs (block[0], block[4]); \ + t5 = vec_mradds (vx0, constants_1, zero); \ + t0 = vec_mradds (vx4, constants_1, zero); \ + \ + vx1 = vec_mradds (a1, block[7], block[1]); \ + vx7 = vec_mradds (a1, block[1], vec_subs (zero, block[7])); \ + t1 = vec_mradds (vx1, constants_2, zero); \ + t8 = vec_mradds (vx7, constants_2, zero); \ + \ + vx2 = vec_mradds (a0, block[6], block[2]); \ + vx6 = vec_mradds (a0, block[2], vec_subs (zero, block[6])); \ + t2 = vec_mradds (vx2, constants_3, zero); \ + t4 = vec_mradds (vx6, constants_3, zero); \ + \ + vx3 = vec_mradds (block[3], constants_4, zero); \ + vx5 = vec_mradds (block[5], constants_4, zero); \ + t7 = vec_mradds (a2, vx5, vx3); \ + t3 = vec_mradds (ma2, vx3, vx5); \ + \ + t6 = vec_adds (t8, t3); \ + t3 = vec_subs (t8, t3); \ + t8 = vec_subs (t1, t7); \ + t1 = vec_adds (t1, t7); \ + t6 = vec_mradds (a0, t6, t6); /* a0+1 == 2*c4 */ \ + t1 = vec_mradds (a0, t1, t1); /* a0+1 == 2*c4 */ \ + \ + t7 = vec_adds (t5, t2); \ + t2 = vec_subs (t5, t2); \ + t5 = vec_adds (t0, t4); \ + t0 = vec_subs (t0, t4); \ + t4 = vec_subs (t8, t3); \ + t3 = vec_adds (t8, t3); \ + \ + vy0 = vec_adds (t7, t1); \ + vy7 = vec_subs (t7, t1); \ + vy1 = vec_adds (t5, t3); \ + vy6 = vec_subs (t5, t3); \ + vy2 = vec_adds (t0, t4); \ + vy5 = vec_subs (t0, t4); \ + vy3 = vec_adds (t2, t6); \ + vy4 = vec_subs (t2, t6); \ + \ + vx0 = vec_mergeh (vy0, vy4); \ + vx1 = vec_mergel (vy0, vy4); \ + vx2 = vec_mergeh (vy1, vy5); \ + vx3 = vec_mergel (vy1, vy5); \ + vx4 = vec_mergeh (vy2, vy6); \ + vx5 = vec_mergel (vy2, vy6); \ + vx6 = vec_mergeh (vy3, vy7); \ + vx7 = vec_mergel (vy3, vy7); \ + \ + vy0 = vec_mergeh (vx0, vx4); \ + vy1 = vec_mergel (vx0, vx4); \ + vy2 = vec_mergeh (vx1, vx5); \ + vy3 = vec_mergel (vx1, vx5); \ + vy4 = vec_mergeh (vx2, vx6); \ + vy5 = vec_mergel (vx2, vx6); \ + vy6 = vec_mergeh (vx3, vx7); \ + vy7 = vec_mergel (vx3, vx7); \ + \ + vx0 = vec_mergeh (vy0, vy4); \ + vx1 = vec_mergel (vy0, vy4); \ + vx2 = vec_mergeh (vy1, vy5); \ + vx3 = vec_mergel (vy1, vy5); \ + vx4 = vec_mergeh (vy2, vy6); \ + vx5 = vec_mergel (vy2, vy6); \ + vx6 = vec_mergeh (vy3, vy7); \ + vx7 = vec_mergel (vy3, vy7); \ + \ + vx0 = vec_adds (vx0, bias); \ + t5 = vec_adds (vx0, vx4); \ + t0 = vec_subs (vx0, vx4); \ + \ + t1 = vec_mradds (a1, vx7, vx1); \ + t8 = vec_mradds (a1, vx1, vec_subs (zero, vx7)); \ + \ + t2 = vec_mradds (a0, vx6, vx2); \ + t4 = vec_mradds (a0, vx2, vec_subs (zero, vx6)); \ + \ + t7 = vec_mradds (a2, vx5, vx3); \ + t3 = vec_mradds (ma2, vx3, vx5); \ + \ + t6 = vec_adds (t8, t3); \ + t3 = vec_subs (t8, t3); \ + t8 = vec_subs (t1, t7); \ + t1 = vec_adds (t1, t7); \ + \ + t7 = vec_adds (t5, t2); \ + t2 = vec_subs (t5, t2); \ + t5 = vec_adds (t0, t4); \ + t0 = vec_subs (t0, t4); \ + t4 = vec_subs (t8, t3); \ + t3 = vec_adds (t8, t3); \ + \ + vy0 = vec_adds (t7, t1); \ + vy7 = vec_subs (t7, t1); \ + vy1 = vec_mradds (c4, t3, t5); \ + vy6 = vec_mradds (mc4, t3, t5); \ + vy2 = vec_mradds (c4, t4, t0); \ + vy5 = vec_mradds (mc4, t4, t0); \ + vy3 = vec_adds (t2, t6); \ + vy4 = vec_subs (t2, t6); \ + \ + shift = vec_splat_u16 (6); \ + vx0 = vec_sra (vy0, shift); \ + vx1 = vec_sra (vy1, shift); \ + vx2 = vec_sra (vy2, shift); \ + vx3 = vec_sra (vy3, shift); \ + vx4 = vec_sra (vy4, shift); \ + vx5 = vec_sra (vy5, shift); \ + vx6 = vec_sra (vy6, shift); \ + vx7 = vec_sra (vy7, shift); + +void mpeg2_idct_copy_altivec (int16_t * const _block, uint8_t * dest, + const int stride) +{ + vector_s16_t * const block = (vector_s16_t *)_block; + vector_u8_t tmp; + + IDCT + +#define COPY(dest,src) \ + tmp = vec_packsu (src, src); \ + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); \ + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + + COPY (dest, vx0) dest += stride; + COPY (dest, vx1) dest += stride; + COPY (dest, vx2) dest += stride; + COPY (dest, vx3) dest += stride; + COPY (dest, vx4) dest += stride; + COPY (dest, vx5) dest += stride; + COPY (dest, vx6) dest += stride; + COPY (dest, vx7) + + block[0] = block[1] = block[2] = block[3] = zero; + block[4] = block[5] = block[6] = block[7] = zero; +} + +void mpeg2_idct_add_altivec (const int last, int16_t * const _block, + uint8_t * dest, const int stride) +{ + vector_s16_t * const block = (vector_s16_t *)_block; + vector_u8_t tmp; + vector_s16_t tmp2, tmp3; + vector_u8_t perm0; + vector_u8_t perm1; + vector_u8_t p0, p1, p; + + IDCT + + p0 = vec_lvsl (0, dest); + p1 = vec_lvsl (stride, dest); + p = vec_splat_u8 (-1); + perm0 = vec_mergeh (p, p0); + perm1 = vec_mergeh (p, p1); + +#define ADD(dest,src,perm) \ + /* *(uint64_t *)&tmp = *(uint64_t *)dest; */ \ + tmp = vec_ld (0, dest); \ + tmp2 = (vector_s16_t)vec_perm (tmp, (vector_u8_t)zero, perm); \ + tmp3 = vec_adds (tmp2, src); \ + tmp = vec_packsu (tmp3, tmp3); \ + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); \ + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + + ADD (dest, vx0, perm0) dest += stride; + ADD (dest, vx1, perm1) dest += stride; + ADD (dest, vx2, perm0) dest += stride; + ADD (dest, vx3, perm1) dest += stride; + ADD (dest, vx4, perm0) dest += stride; + ADD (dest, vx5, perm1) dest += stride; + ADD (dest, vx6, perm0) dest += stride; + ADD (dest, vx7, perm1) + + block[0] = block[1] = block[2] = block[3] = zero; + block[4] = block[5] = block[6] = block[7] = zero; +} + +void mpeg2_idct_altivec_init (void) +{ + extern uint8_t mpeg2_scan_norm[64]; + extern uint8_t mpeg2_scan_alt[64]; + int i, j; + + /* the altivec idct uses a transposed input, so we patch scan tables */ + for (i = 0; i < 64; i++) { + j = mpeg2_scan_norm[i]; + mpeg2_scan_norm[i] = (j >> 3) | ((j & 7) << 3); + j = mpeg2_scan_alt[i]; + mpeg2_scan_alt[i] = (j >> 3) | ((j & 7) << 3); + } +} + +#endif diff --git a/k9decmpeg/idct_mmx.cpp b/k9decmpeg/idct_mmx.cpp new file mode 100755 index 0000000..99e8a12 --- /dev/null +++ b/k9decmpeg/idct_mmx.cpp @@ -0,0 +1,812 @@ +/* + * idct_mmx.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" +#include "k9common.h" +#ifdef ARCH_X86 + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" +#include "mmx.h" + +#define ROW_SHIFT 15 +#define COL_SHIFT 6 + +#define round(bias) ((int)(((bias)+0.5) * (1<> ROW_SHIFT; + row[1] = (a1 + b1) >> ROW_SHIFT; + row[2] = (a2 + b2) >> ROW_SHIFT; + row[3] = (a3 + b3) >> ROW_SHIFT; + row[4] = (a3 - b3) >> ROW_SHIFT; + row[5] = (a2 - b2) >> ROW_SHIFT; + row[6] = (a1 - b1) >> ROW_SHIFT; + row[7] = (a0 - b0) >> ROW_SHIFT; +} +#endif + + +/* MMXEXT row IDCT */ + +#define mmxext_table(c1,c2,c3,c4,c5,c6,c7) { c4, c2, -c4, -c2, \ + c4, c6, c4, c6, \ + c1, c3, -c1, -c5, \ + c5, c7, c3, -c7, \ + c4, -c6, c4, -c6, \ + -c4, c2, c4, -c2, \ + c5, -c1, c3, -c1, \ + c7, c3, c7, -c5 } + +static inline void mmxext_row_head (int16_t * const row, const int offset, + const int16_t * const table) +{ + movq_m2r (*(row+offset), mm2); /* mm2 = x6 x4 x2 x0 */ + + movq_m2r (*(row+offset+4), mm5); /* mm5 = x7 x5 x3 x1 */ + movq_r2r (mm2, mm0); /* mm0 = x6 x4 x2 x0 */ + + movq_m2r (*table, mm3); /* mm3 = -C2 -C4 C2 C4 */ + movq_r2r (mm5, mm6); /* mm6 = x7 x5 x3 x1 */ + + movq_m2r (*(table+4), mm4); /* mm4 = C6 C4 C6 C4 */ + pmaddwd_r2r (mm0, mm3); /* mm3 = -C4*x4-C2*x6 C4*x0+C2*x2 */ + + pshufw_r2r (mm2, mm2, 0x4e); /* mm2 = x2 x0 x6 x4 */ +} + +static inline void mmxext_row (const int16_t * const table, + const int32_t * const rounder) +{ + movq_m2r (*(table+8), mm1); /* mm1 = -C5 -C1 C3 C1 */ + pmaddwd_r2r (mm2, mm4); /* mm4 = C4*x0+C6*x2 C4*x4+C6*x6 */ + + pmaddwd_m2r (*(table+16), mm0); /* mm0 = C4*x4-C6*x6 C4*x0-C6*x2 */ + pshufw_r2r (mm6, mm6, 0x4e); /* mm6 = x3 x1 x7 x5 */ + + movq_m2r (*(table+12), mm7); /* mm7 = -C7 C3 C7 C5 */ + pmaddwd_r2r (mm5, mm1); /* mm1 = -C1*x5-C5*x7 C1*x1+C3*x3 */ + + paddd_m2r (*rounder, mm3); /* mm3 += rounder */ + pmaddwd_r2r (mm6, mm7); /* mm7 = C3*x1-C7*x3 C5*x5+C7*x7 */ + + pmaddwd_m2r (*(table+20), mm2); /* mm2 = C4*x0-C2*x2 -C4*x4+C2*x6 */ + paddd_r2r (mm4, mm3); /* mm3 = a1 a0 + rounder */ + + pmaddwd_m2r (*(table+24), mm5); /* mm5 = C3*x5-C1*x7 C5*x1-C1*x3 */ + movq_r2r (mm3, mm4); /* mm4 = a1 a0 + rounder */ + + pmaddwd_m2r (*(table+28), mm6); /* mm6 = C7*x1-C5*x3 C7*x5+C3*x7 */ + paddd_r2r (mm7, mm1); /* mm1 = b1 b0 */ + + paddd_m2r (*rounder, mm0); /* mm0 += rounder */ + psubd_r2r (mm1, mm3); /* mm3 = a1-b1 a0-b0 + rounder */ + + psrad_i2r (ROW_SHIFT, mm3); /* mm3 = y6 y7 */ + paddd_r2r (mm4, mm1); /* mm1 = a1+b1 a0+b0 + rounder */ + + paddd_r2r (mm2, mm0); /* mm0 = a3 a2 + rounder */ + psrad_i2r (ROW_SHIFT, mm1); /* mm1 = y1 y0 */ + + paddd_r2r (mm6, mm5); /* mm5 = b3 b2 */ + movq_r2r (mm0, mm4); /* mm4 = a3 a2 + rounder */ + + paddd_r2r (mm5, mm0); /* mm0 = a3+b3 a2+b2 + rounder */ + psubd_r2r (mm5, mm4); /* mm4 = a3-b3 a2-b2 + rounder */ +} + +static inline void mmxext_row_tail (int16_t * const row, const int store) +{ + psrad_i2r (ROW_SHIFT, mm0); /* mm0 = y3 y2 */ + + psrad_i2r (ROW_SHIFT, mm4); /* mm4 = y4 y5 */ + + packssdw_r2r (mm0, mm1); /* mm1 = y3 y2 y1 y0 */ + + packssdw_r2r (mm3, mm4); /* mm4 = y6 y7 y4 y5 */ + + movq_r2m (mm1, *(row+store)); /* save y3 y2 y1 y0 */ + pshufw_r2r (mm4, mm4, 0xb1); /* mm4 = y7 y6 y5 y4 */ + + /* slot */ + + movq_r2m (mm4, *(row+store+4)); /* save y7 y6 y5 y4 */ +} + +static inline void mmxext_row_mid (int16_t * const row, const int store, + const int offset, + const int16_t * const table) +{ + movq_m2r (*(row+offset), mm2); /* mm2 = x6 x4 x2 x0 */ + psrad_i2r (ROW_SHIFT, mm0); /* mm0 = y3 y2 */ + + movq_m2r (*(row+offset+4), mm5); /* mm5 = x7 x5 x3 x1 */ + psrad_i2r (ROW_SHIFT, mm4); /* mm4 = y4 y5 */ + + packssdw_r2r (mm0, mm1); /* mm1 = y3 y2 y1 y0 */ + movq_r2r (mm5, mm6); /* mm6 = x7 x5 x3 x1 */ + + packssdw_r2r (mm3, mm4); /* mm4 = y6 y7 y4 y5 */ + movq_r2r (mm2, mm0); /* mm0 = x6 x4 x2 x0 */ + + movq_r2m (mm1, *(row+store)); /* save y3 y2 y1 y0 */ + pshufw_r2r (mm4, mm4, 0xb1); /* mm4 = y7 y6 y5 y4 */ + + movq_m2r (*table, mm3); /* mm3 = -C2 -C4 C2 C4 */ + movq_r2m (mm4, *(row+store+4)); /* save y7 y6 y5 y4 */ + + pmaddwd_r2r (mm0, mm3); /* mm3 = -C4*x4-C2*x6 C4*x0+C2*x2 */ + + movq_m2r (*(table+4), mm4); /* mm4 = C6 C4 C6 C4 */ + pshufw_r2r (mm2, mm2, 0x4e); /* mm2 = x2 x0 x6 x4 */ +} + + +/* MMX row IDCT */ + +#define mmx_table(c1,c2,c3,c4,c5,c6,c7) { c4, c2, c4, c6, \ + c4, c6, -c4, -c2, \ + c1, c3, c3, -c7, \ + c5, c7, -c1, -c5, \ + c4, -c6, c4, -c2, \ + -c4, c2, c4, -c6, \ + c5, -c1, c7, -c5, \ + c7, c3, c3, -c1 } + +static inline void mmx_row_head (int16_t * const row, const int offset, + const int16_t * const table) +{ + movq_m2r (*(row+offset), mm2); /* mm2 = x6 x4 x2 x0 */ + + movq_m2r (*(row+offset+4), mm5); /* mm5 = x7 x5 x3 x1 */ + movq_r2r (mm2, mm0); /* mm0 = x6 x4 x2 x0 */ + + movq_m2r (*table, mm3); /* mm3 = C6 C4 C2 C4 */ + movq_r2r (mm5, mm6); /* mm6 = x7 x5 x3 x1 */ + + punpckldq_r2r (mm0, mm0); /* mm0 = x2 x0 x2 x0 */ + + movq_m2r (*(table+4), mm4); /* mm4 = -C2 -C4 C6 C4 */ + pmaddwd_r2r (mm0, mm3); /* mm3 = C4*x0+C6*x2 C4*x0+C2*x2 */ + + movq_m2r (*(table+8), mm1); /* mm1 = -C7 C3 C3 C1 */ + punpckhdq_r2r (mm2, mm2); /* mm2 = x6 x4 x6 x4 */ +} + +static inline void mmx_row (const int16_t * const table, + const int32_t * const rounder) +{ + pmaddwd_r2r (mm2, mm4); /* mm4 = -C4*x4-C2*x6 C4*x4+C6*x6 */ + punpckldq_r2r (mm5, mm5); /* mm5 = x3 x1 x3 x1 */ + + pmaddwd_m2r (*(table+16), mm0); /* mm0 = C4*x0-C2*x2 C4*x0-C6*x2 */ + punpckhdq_r2r (mm6, mm6); /* mm6 = x7 x5 x7 x5 */ + + movq_m2r (*(table+12), mm7); /* mm7 = -C5 -C1 C7 C5 */ + pmaddwd_r2r (mm5, mm1); /* mm1 = C3*x1-C7*x3 C1*x1+C3*x3 */ + + paddd_m2r (*rounder, mm3); /* mm3 += rounder */ + pmaddwd_r2r (mm6, mm7); /* mm7 = -C1*x5-C5*x7 C5*x5+C7*x7 */ + + pmaddwd_m2r (*(table+20), mm2); /* mm2 = C4*x4-C6*x6 -C4*x4+C2*x6 */ + paddd_r2r (mm4, mm3); /* mm3 = a1 a0 + rounder */ + + pmaddwd_m2r (*(table+24), mm5); /* mm5 = C7*x1-C5*x3 C5*x1-C1*x3 */ + movq_r2r (mm3, mm4); /* mm4 = a1 a0 + rounder */ + + pmaddwd_m2r (*(table+28), mm6); /* mm6 = C3*x5-C1*x7 C7*x5+C3*x7 */ + paddd_r2r (mm7, mm1); /* mm1 = b1 b0 */ + + paddd_m2r (*rounder, mm0); /* mm0 += rounder */ + psubd_r2r (mm1, mm3); /* mm3 = a1-b1 a0-b0 + rounder */ + + psrad_i2r (ROW_SHIFT, mm3); /* mm3 = y6 y7 */ + paddd_r2r (mm4, mm1); /* mm1 = a1+b1 a0+b0 + rounder */ + + paddd_r2r (mm2, mm0); /* mm0 = a3 a2 + rounder */ + psrad_i2r (ROW_SHIFT, mm1); /* mm1 = y1 y0 */ + + paddd_r2r (mm6, mm5); /* mm5 = b3 b2 */ + movq_r2r (mm0, mm7); /* mm7 = a3 a2 + rounder */ + + paddd_r2r (mm5, mm0); /* mm0 = a3+b3 a2+b2 + rounder */ + psubd_r2r (mm5, mm7); /* mm7 = a3-b3 a2-b2 + rounder */ +} + +static inline void mmx_row_tail (int16_t * const row, const int store) +{ + psrad_i2r (ROW_SHIFT, mm0); /* mm0 = y3 y2 */ + + psrad_i2r (ROW_SHIFT, mm7); /* mm7 = y4 y5 */ + + packssdw_r2r (mm0, mm1); /* mm1 = y3 y2 y1 y0 */ + + packssdw_r2r (mm3, mm7); /* mm7 = y6 y7 y4 y5 */ + + movq_r2m (mm1, *(row+store)); /* save y3 y2 y1 y0 */ + movq_r2r (mm7, mm4); /* mm4 = y6 y7 y4 y5 */ + + pslld_i2r (16, mm7); /* mm7 = y7 0 y5 0 */ + + psrld_i2r (16, mm4); /* mm4 = 0 y6 0 y4 */ + + por_r2r (mm4, mm7); /* mm7 = y7 y6 y5 y4 */ + + /* slot */ + + movq_r2m (mm7, *(row+store+4)); /* save y7 y6 y5 y4 */ +} + +static inline void mmx_row_mid (int16_t * const row, const int store, + const int offset, const int16_t * const table) +{ + movq_m2r (*(row+offset), mm2); /* mm2 = x6 x4 x2 x0 */ + psrad_i2r (ROW_SHIFT, mm0); /* mm0 = y3 y2 */ + + movq_m2r (*(row+offset+4), mm5); /* mm5 = x7 x5 x3 x1 */ + psrad_i2r (ROW_SHIFT, mm7); /* mm7 = y4 y5 */ + + packssdw_r2r (mm0, mm1); /* mm1 = y3 y2 y1 y0 */ + movq_r2r (mm5, mm6); /* mm6 = x7 x5 x3 x1 */ + + packssdw_r2r (mm3, mm7); /* mm7 = y6 y7 y4 y5 */ + movq_r2r (mm2, mm0); /* mm0 = x6 x4 x2 x0 */ + + movq_r2m (mm1, *(row+store)); /* save y3 y2 y1 y0 */ + movq_r2r (mm7, mm1); /* mm1 = y6 y7 y4 y5 */ + + punpckldq_r2r (mm0, mm0); /* mm0 = x2 x0 x2 x0 */ + psrld_i2r (16, mm7); /* mm7 = 0 y6 0 y4 */ + + movq_m2r (*table, mm3); /* mm3 = C6 C4 C2 C4 */ + pslld_i2r (16, mm1); /* mm1 = y7 0 y5 0 */ + + movq_m2r (*(table+4), mm4); /* mm4 = -C2 -C4 C6 C4 */ + por_r2r (mm1, mm7); /* mm7 = y7 y6 y5 y4 */ + + movq_m2r (*(table+8), mm1); /* mm1 = -C7 C3 C3 C1 */ + punpckhdq_r2r (mm2, mm2); /* mm2 = x6 x4 x6 x4 */ + + movq_r2m (mm7, *(row+store+4)); /* save y7 y6 y5 y4 */ + pmaddwd_r2r (mm0, mm3); /* mm3 = C4*x0+C6*x2 C4*x0+C2*x2 */ +} + + +#if 0 +/* C column IDCT - its just here to document the MMXEXT and MMX versions */ +static inline void idct_col (int16_t * col, int offset) +{ +/* multiplication - as implemented on mmx */ +#define F(c,x) (((c) * (x)) >> 16) + +/* saturation - it helps us handle torture test cases */ +#define S(x) (((x)>32767) ? 32767 : ((x)<-32768) ? -32768 : (x)) + + int16_t x0, x1, x2, x3, x4, x5, x6, x7; + int16_t y0, y1, y2, y3, y4, y5, y6, y7; + int16_t a0, a1, a2, a3, b0, b1, b2, b3; + int16_t u04, v04, u26, v26, u17, v17, u35, v35, u12, v12; + + col += offset; + + x0 = col[0*8]; + x1 = col[1*8]; + x2 = col[2*8]; + x3 = col[3*8]; + x4 = col[4*8]; + x5 = col[5*8]; + x6 = col[6*8]; + x7 = col[7*8]; + + u04 = S (x0 + x4); + v04 = S (x0 - x4); + u26 = S (F (T2, x6) + x2); + v26 = S (F (T2, x2) - x6); + + a0 = S (u04 + u26); + a1 = S (v04 + v26); + a2 = S (v04 - v26); + a3 = S (u04 - u26); + + u17 = S (F (T1, x7) + x1); + v17 = S (F (T1, x1) - x7); + u35 = S (F (T3, x5) + x3); + v35 = S (F (T3, x3) - x5); + + b0 = S (u17 + u35); + b3 = S (v17 - v35); + u12 = S (u17 - u35); + v12 = S (v17 + v35); + u12 = S (2 * F (C4, u12)); + v12 = S (2 * F (C4, v12)); + b1 = S (u12 + v12); + b2 = S (u12 - v12); + + y0 = S (a0 + b0) >> COL_SHIFT; + y1 = S (a1 + b1) >> COL_SHIFT; + y2 = S (a2 + b2) >> COL_SHIFT; + y3 = S (a3 + b3) >> COL_SHIFT; + + y4 = S (a3 - b3) >> COL_SHIFT; + y5 = S (a2 - b2) >> COL_SHIFT; + y6 = S (a1 - b1) >> COL_SHIFT; + y7 = S (a0 - b0) >> COL_SHIFT; + + col[0*8] = y0; + col[1*8] = y1; + col[2*8] = y2; + col[3*8] = y3; + col[4*8] = y4; + col[5*8] = y5; + col[6*8] = y6; + col[7*8] = y7; +} +#endif + + +/* MMX column IDCT */ +static inline void idct_col (int16_t * const col, const int offset) +{ +#define T1 13036 +#define T2 27146 +#define T3 43790 +#define C4 23170 + + static const short _T1[] ATTR_ALIGN(8) = {T1,T1,T1,T1}; + static const short _T2[] ATTR_ALIGN(8) = {T2,T2,T2,T2}; + static const short _T3[] ATTR_ALIGN(8) = {T3,T3,T3,T3}; + static const short _C4[] ATTR_ALIGN(8) = {C4,C4,C4,C4}; + + /* column code adapted from peter gubanov */ + /* http://www.elecard.com/peter/idct.shtml */ + + movq_m2r (*_T1, mm0); /* mm0 = T1 */ + + movq_m2r (*(col+offset+1*8), mm1); /* mm1 = x1 */ + movq_r2r (mm0, mm2); /* mm2 = T1 */ + + movq_m2r (*(col+offset+7*8), mm4); /* mm4 = x7 */ + pmulhw_r2r (mm1, mm0); /* mm0 = T1*x1 */ + + movq_m2r (*_T3, mm5); /* mm5 = T3 */ + pmulhw_r2r (mm4, mm2); /* mm2 = T1*x7 */ + + movq_m2r (*(col+offset+5*8), mm6); /* mm6 = x5 */ + movq_r2r (mm5, mm7); /* mm7 = T3-1 */ + + movq_m2r (*(col+offset+3*8), mm3); /* mm3 = x3 */ + psubsw_r2r (mm4, mm0); /* mm0 = v17 */ + + movq_m2r (*_T2, mm4); /* mm4 = T2 */ + pmulhw_r2r (mm3, mm5); /* mm5 = (T3-1)*x3 */ + + paddsw_r2r (mm2, mm1); /* mm1 = u17 */ + pmulhw_r2r (mm6, mm7); /* mm7 = (T3-1)*x5 */ + + /* slot */ + + movq_r2r (mm4, mm2); /* mm2 = T2 */ + paddsw_r2r (mm3, mm5); /* mm5 = T3*x3 */ + + pmulhw_m2r (*(col+offset+2*8), mm4);/* mm4 = T2*x2 */ + paddsw_r2r (mm6, mm7); /* mm7 = T3*x5 */ + + psubsw_r2r (mm6, mm5); /* mm5 = v35 */ + paddsw_r2r (mm3, mm7); /* mm7 = u35 */ + + movq_m2r (*(col+offset+6*8), mm3); /* mm3 = x6 */ + movq_r2r (mm0, mm6); /* mm6 = v17 */ + + pmulhw_r2r (mm3, mm2); /* mm2 = T2*x6 */ + psubsw_r2r (mm5, mm0); /* mm0 = b3 */ + + psubsw_r2r (mm3, mm4); /* mm4 = v26 */ + paddsw_r2r (mm6, mm5); /* mm5 = v12 */ + + movq_r2m (mm0, *(col+offset+3*8)); /* save b3 in scratch0 */ + movq_r2r (mm1, mm6); /* mm6 = u17 */ + + paddsw_m2r (*(col+offset+2*8), mm2);/* mm2 = u26 */ + paddsw_r2r (mm7, mm6); /* mm6 = b0 */ + + psubsw_r2r (mm7, mm1); /* mm1 = u12 */ + movq_r2r (mm1, mm7); /* mm7 = u12 */ + + movq_m2r (*(col+offset+0*8), mm3); /* mm3 = x0 */ + paddsw_r2r (mm5, mm1); /* mm1 = u12+v12 */ + + movq_m2r (*_C4, mm0); /* mm0 = C4/2 */ + psubsw_r2r (mm5, mm7); /* mm7 = u12-v12 */ + + movq_r2m (mm6, *(col+offset+5*8)); /* save b0 in scratch1 */ + pmulhw_r2r (mm0, mm1); /* mm1 = b1/2 */ + + movq_r2r (mm4, mm6); /* mm6 = v26 */ + pmulhw_r2r (mm0, mm7); /* mm7 = b2/2 */ + + movq_m2r (*(col+offset+4*8), mm5); /* mm5 = x4 */ + movq_r2r (mm3, mm0); /* mm0 = x0 */ + + psubsw_r2r (mm5, mm3); /* mm3 = v04 */ + paddsw_r2r (mm5, mm0); /* mm0 = u04 */ + + paddsw_r2r (mm3, mm4); /* mm4 = a1 */ + movq_r2r (mm0, mm5); /* mm5 = u04 */ + + psubsw_r2r (mm6, mm3); /* mm3 = a2 */ + paddsw_r2r (mm2, mm5); /* mm5 = a0 */ + + paddsw_r2r (mm1, mm1); /* mm1 = b1 */ + psubsw_r2r (mm2, mm0); /* mm0 = a3 */ + + paddsw_r2r (mm7, mm7); /* mm7 = b2 */ + movq_r2r (mm3, mm2); /* mm2 = a2 */ + + movq_r2r (mm4, mm6); /* mm6 = a1 */ + paddsw_r2r (mm7, mm3); /* mm3 = a2+b2 */ + + psraw_i2r (COL_SHIFT, mm3); /* mm3 = y2 */ + paddsw_r2r (mm1, mm4); /* mm4 = a1+b1 */ + + psraw_i2r (COL_SHIFT, mm4); /* mm4 = y1 */ + psubsw_r2r (mm1, mm6); /* mm6 = a1-b1 */ + + movq_m2r (*(col+offset+5*8), mm1); /* mm1 = b0 */ + psubsw_r2r (mm7, mm2); /* mm2 = a2-b2 */ + + psraw_i2r (COL_SHIFT, mm6); /* mm6 = y6 */ + movq_r2r (mm5, mm7); /* mm7 = a0 */ + + movq_r2m (mm4, *(col+offset+1*8)); /* save y1 */ + psraw_i2r (COL_SHIFT, mm2); /* mm2 = y5 */ + + movq_r2m (mm3, *(col+offset+2*8)); /* save y2 */ + paddsw_r2r (mm1, mm5); /* mm5 = a0+b0 */ + + movq_m2r (*(col+offset+3*8), mm4); /* mm4 = b3 */ + psubsw_r2r (mm1, mm7); /* mm7 = a0-b0 */ + + psraw_i2r (COL_SHIFT, mm5); /* mm5 = y0 */ + movq_r2r (mm0, mm3); /* mm3 = a3 */ + + movq_r2m (mm2, *(col+offset+5*8)); /* save y5 */ + psubsw_r2r (mm4, mm3); /* mm3 = a3-b3 */ + + psraw_i2r (COL_SHIFT, mm7); /* mm7 = y7 */ + paddsw_r2r (mm0, mm4); /* mm4 = a3+b3 */ + + movq_r2m (mm5, *(col+offset+0*8)); /* save y0 */ + psraw_i2r (COL_SHIFT, mm3); /* mm3 = y4 */ + + movq_r2m (mm6, *(col+offset+6*8)); /* save y6 */ + psraw_i2r (COL_SHIFT, mm4); /* mm4 = y3 */ + + movq_r2m (mm7, *(col+offset+7*8)); /* save y7 */ + + movq_r2m (mm3, *(col+offset+4*8)); /* save y4 */ + + movq_r2m (mm4, *(col+offset+3*8)); /* save y3 */ +} + + +static const int32_t rounder0[] ATTR_ALIGN(8) = + rounder ((1 << (COL_SHIFT - 1)) - 0.5); +static const int32_t rounder4[] ATTR_ALIGN(8) = rounder (0); +static const int32_t rounder1[] ATTR_ALIGN(8) = + rounder (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */ +static const int32_t rounder7[] ATTR_ALIGN(8) = + rounder (-0.25); /* C1*(C7/C4+C7-C1)/2 */ +static const int32_t rounder2[] ATTR_ALIGN(8) = + rounder (0.60355339059); /* C2 * (C6+C2)/2 */ +static const int32_t rounder6[] ATTR_ALIGN(8) = + rounder (-0.25); /* C2 * (C6-C2)/2 */ +static const int32_t rounder3[] ATTR_ALIGN(8) = + rounder (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */ +static const int32_t rounder5[] ATTR_ALIGN(8) = + rounder (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */ + + +#define declare_idct(idct,table,idct_row_head,idct_row,idct_row_tail,idct_row_mid) \ +static inline void idct (int16_t * const block) \ +{ \ + static const int16_t table04[] ATTR_ALIGN(16) = \ + table (22725, 21407, 19266, 16384, 12873, 8867, 4520); \ + static const int16_t table17[] ATTR_ALIGN(16) = \ + table (31521, 29692, 26722, 22725, 17855, 12299, 6270); \ + static const int16_t table26[] ATTR_ALIGN(16) = \ + table (29692, 27969, 25172, 21407, 16819, 11585, 5906); \ + static const int16_t table35[] ATTR_ALIGN(16) = \ + table (26722, 25172, 22654, 19266, 15137, 10426, 5315); \ + \ + idct_row_head (block, 0*8, table04); \ + idct_row (table04, rounder0); \ + idct_row_mid (block, 0*8, 4*8, table04); \ + idct_row (table04, rounder4); \ + idct_row_mid (block, 4*8, 1*8, table17); \ + idct_row (table17, rounder1); \ + idct_row_mid (block, 1*8, 7*8, table17); \ + idct_row (table17, rounder7); \ + idct_row_mid (block, 7*8, 2*8, table26); \ + idct_row (table26, rounder2); \ + idct_row_mid (block, 2*8, 6*8, table26); \ + idct_row (table26, rounder6); \ + idct_row_mid (block, 6*8, 3*8, table35); \ + idct_row (table35, rounder3); \ + idct_row_mid (block, 3*8, 5*8, table35); \ + idct_row (table35, rounder5); \ + idct_row_tail (block, 5*8); \ + \ + idct_col (block, 0); \ + idct_col (block, 4); \ +} + + +#define COPY_MMX(offset,r0,r1,r2) \ +do { \ + movq_m2r (*(block+offset), r0); \ + dest += stride; \ + movq_m2r (*(block+offset+4), r1); \ + movq_r2m (r2, *dest); \ + packuswb_r2r (r1, r0); \ +} while (0) + +static inline void block_copy (int16_t * const block, uint8_t * dest, + const int stride) +{ + movq_m2r (*(block+0*8), mm0); + movq_m2r (*(block+0*8+4), mm1); + movq_m2r (*(block+1*8), mm2); + packuswb_r2r (mm1, mm0); + movq_m2r (*(block+1*8+4), mm3); + movq_r2m (mm0, *dest); + packuswb_r2r (mm3, mm2); + COPY_MMX (2*8, mm0, mm1, mm2); + COPY_MMX (3*8, mm2, mm3, mm0); + COPY_MMX (4*8, mm0, mm1, mm2); + COPY_MMX (5*8, mm2, mm3, mm0); + COPY_MMX (6*8, mm0, mm1, mm2); + COPY_MMX (7*8, mm2, mm3, mm0); + movq_r2m (mm2, *(dest+stride)); +} + + +#define ADD_MMX(offset,r1,r2,r3,r4) \ +do { \ + movq_m2r (*(dest+2*stride), r1); \ + packuswb_r2r (r4, r3); \ + movq_r2r (r1, r2); \ + dest += stride; \ + movq_r2m (r3, *dest); \ + punpcklbw_r2r (mm0, r1); \ + paddsw_m2r (*(block+offset), r1); \ + punpckhbw_r2r (mm0, r2); \ + paddsw_m2r (*(block+offset+4), r2); \ +} while (0) + +static inline void block_add (int16_t * const block, uint8_t * dest, + const int stride) +{ + movq_m2r (*dest, mm1); + pxor_r2r (mm0, mm0); + movq_m2r (*(dest+stride), mm3); + movq_r2r (mm1, mm2); + punpcklbw_r2r (mm0, mm1); + movq_r2r (mm3, mm4); + paddsw_m2r (*(block+0*8), mm1); + punpckhbw_r2r (mm0, mm2); + paddsw_m2r (*(block+0*8+4), mm2); + punpcklbw_r2r (mm0, mm3); + paddsw_m2r (*(block+1*8), mm3); + packuswb_r2r (mm2, mm1); + punpckhbw_r2r (mm0, mm4); + movq_r2m (mm1, *dest); + paddsw_m2r (*(block+1*8+4), mm4); + ADD_MMX (2*8, mm1, mm2, mm3, mm4); + ADD_MMX (3*8, mm3, mm4, mm1, mm2); + ADD_MMX (4*8, mm1, mm2, mm3, mm4); + ADD_MMX (5*8, mm3, mm4, mm1, mm2); + ADD_MMX (6*8, mm1, mm2, mm3, mm4); + ADD_MMX (7*8, mm3, mm4, mm1, mm2); + packuswb_r2r (mm4, mm3); + movq_r2m (mm3, *(dest+stride)); +} + + +static inline void block_zero (int16_t * const block) +{ + pxor_r2r (mm0, mm0); + movq_r2m (mm0, *(block+0*4)); + movq_r2m (mm0, *(block+1*4)); + movq_r2m (mm0, *(block+2*4)); + movq_r2m (mm0, *(block+3*4)); + movq_r2m (mm0, *(block+4*4)); + movq_r2m (mm0, *(block+5*4)); + movq_r2m (mm0, *(block+6*4)); + movq_r2m (mm0, *(block+7*4)); + movq_r2m (mm0, *(block+8*4)); + movq_r2m (mm0, *(block+9*4)); + movq_r2m (mm0, *(block+10*4)); + movq_r2m (mm0, *(block+11*4)); + movq_r2m (mm0, *(block+12*4)); + movq_r2m (mm0, *(block+13*4)); + movq_r2m (mm0, *(block+14*4)); + movq_r2m (mm0, *(block+15*4)); +} + + +#define CPU_MMXEXT 0 +#define CPU_MMX 1 + +#define dup4(reg) \ +do { \ + if (cpu != CPU_MMXEXT) { \ + punpcklwd_r2r (reg, reg); \ + punpckldq_r2r (reg, reg); \ + } else \ + pshufw_r2r (reg, reg, 0x00); \ +} while (0) + +static inline void block_add_DC (int16_t * const block, uint8_t * dest, + const int stride, const int cpu) +{ + movd_v2r ((block[0] + 64) >> 7, mm0); + pxor_r2r (mm1, mm1); + movq_m2r (*dest, mm2); + dup4 (mm0); + psubsw_r2r (mm0, mm1); + packuswb_r2r (mm0, mm0); + paddusb_r2r (mm0, mm2); + packuswb_r2r (mm1, mm1); + movq_m2r (*(dest + stride), mm3); + psubusb_r2r (mm1, mm2); + block[0] = 0; + paddusb_r2r (mm0, mm3); + movq_r2m (mm2, *dest); + psubusb_r2r (mm1, mm3); + movq_m2r (*(dest + 2*stride), mm2); + dest += stride; + movq_r2m (mm3, *dest); + paddusb_r2r (mm0, mm2); + movq_m2r (*(dest + 2*stride), mm3); + psubusb_r2r (mm1, mm2); + dest += stride; + paddusb_r2r (mm0, mm3); + movq_r2m (mm2, *dest); + psubusb_r2r (mm1, mm3); + movq_m2r (*(dest + 2*stride), mm2); + dest += stride; + movq_r2m (mm3, *dest); + paddusb_r2r (mm0, mm2); + movq_m2r (*(dest + 2*stride), mm3); + psubusb_r2r (mm1, mm2); + dest += stride; + paddusb_r2r (mm0, mm3); + movq_r2m (mm2, *dest); + psubusb_r2r (mm1, mm3); + movq_m2r (*(dest + 2*stride), mm2); + dest += stride; + movq_r2m (mm3, *dest); + paddusb_r2r (mm0, mm2); + movq_m2r (*(dest + 2*stride), mm3); + psubusb_r2r (mm1, mm2); + block[63] = 0; + paddusb_r2r (mm0, mm3); + movq_r2m (mm2, *(dest + stride)); + psubusb_r2r (mm1, mm3); + movq_r2m (mm3, *(dest + 2*stride)); +} + + +declare_idct (mmxext_idct, mmxext_table, + mmxext_row_head, mmxext_row, mmxext_row_tail, mmxext_row_mid) + +void mpeg2_idct_copy_mmxext (int16_t * const block, uint8_t * const dest, + const int stride) +{ + mmxext_idct (block); + block_copy (block, dest, stride); + block_zero (block); +} + +void mpeg2_idct_add_mmxext (const int last, int16_t * const block, + uint8_t * const dest, const int stride) +{ + if (last != 129 || (block[0] & (7 << 4)) == (4 << 4)) { + mmxext_idct (block); + block_add (block, dest, stride); + block_zero (block); + } else + block_add_DC (block, dest, stride, CPU_MMXEXT); +} + + +declare_idct (mmx_idct, mmx_table, + mmx_row_head, mmx_row, mmx_row_tail, mmx_row_mid) + +void mpeg2_idct_copy_mmx (int16_t * const block, uint8_t * const dest, + const int stride) +{ + mmx_idct (block); + block_copy (block, dest, stride); + block_zero (block); +} + +void mpeg2_idct_add_mmx (const int last, int16_t * const block, + uint8_t * const dest, const int stride) +{ + if (last != 129 || (block[0] & (7 << 4)) == (4 << 4)) { + mmx_idct (block); + block_add (block, dest, stride); + block_zero (block); + } else + block_add_DC (block, dest, stride, CPU_MMX); +} + + +void mpeg2_idct_mmx_init (void) +{ + extern uint8_t mpeg2_scan_norm[64]; + extern uint8_t mpeg2_scan_alt[64]; + int i, j; + + /* the mmx/mmxext idct uses a reordered input, so we patch scan tables */ + + for (i = 0; i < 64; i++) { + j = mpeg2_scan_norm[i]; + mpeg2_scan_norm[i] = (j & 0x38) | ((j & 6) >> 1) | ((j & 1) << 2); + j = mpeg2_scan_alt[i]; + mpeg2_scan_alt[i] = (j & 0x38) | ((j & 6) >> 1) | ((j & 1) << 2); + } +} + +#endif diff --git a/k9decmpeg/k9decodethread.cpp b/k9decmpeg/k9decodethread.cpp new file mode 100644 index 0000000..a7e5498 --- /dev/null +++ b/k9decmpeg/k9decodethread.cpp @@ -0,0 +1,105 @@ +// +// C++ Implementation: k9decodethread +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9decodethread.h" + +k9DecodeThread::k9DecodeThread() +{ + m_decoder=new kDecMPEG2(this); + noData=FALSE; +} + + +k9DecodeThread::~k9DecodeThread() +{ + delete m_decoder; +} + +void k9DecodeThread::clear() { + m_fifo.clear(); + wDataRead.wakeAll(); + wDataReady.wakeAll(); + +} + +void k9DecodeThread::addData(uchar *data,uint size) { + while (1) { + if (m_fifo.freespace()>=size) { + m_fifo.enqueue(data,size); + wDataReady.wakeAll(); + break; + } else + wDataRead.wait(); + } +} + + +int k9DecodeThread::readData(uchar * data,uint size) { + uint size2=size; + uint32_t readSize=0,s=0; + + while (1) { + // is there data in the buffer? + if (m_fifo.count() >0) { + // s= size of data that we will read (maximum = size) + s=(m_fifo.count()) =size2)) { + break; + } else + wDataReady.wait(); + } + // if there's datas in input buffer and we did not get all what we wanted, we take them. + s= (m_fifo.count()) 0 ) + m_fifo.dequeue(data,s); + + wDataRead.wakeAll(); + return readSize; +} + +void k9DecodeThread::setNoData() { + noData=true; + wDataRead.wakeAll(); + wDataReady.wakeAll(); +} + +void k9DecodeThread::sleepms(int _ms) { + msleep(_ms); +} + +void k9DecodeThread::run() { + noData=FALSE; + m_decoder->start(); + while (1) { + int count=2048; + uchar buffer[count]; + uint32_t size=readData(buffer,count); + if (size==0) + break; + m_decoder->decode(buffer ,buffer+size,0); + } + m_decoder->stop(); + +} diff --git a/k9decmpeg/k9decodethread.h b/k9decmpeg/k9decodethread.h new file mode 100644 index 0000000..b98abb5 --- /dev/null +++ b/k9decmpeg/k9decodethread.h @@ -0,0 +1,52 @@ +// +// C++ Interface: k9decodethread +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9DECODETHREAD_H +#define K9DECODETHREAD_H +#include "k9common.h" +#include "k9vamps.h" + +#include +#include +#include + +#include "kdecmpeg2.h" + +/** + @author Jean-Michel PETIT +*/ +class k9DecodeThread : public QThread +{ +private: + kDecMPEG2 *m_decoder; + k9fifo m_fifo; + QWaitCondition wDataRead; + QWaitCondition wDataReady; + bool noData; + +public: + k9DecodeThread(); + ~k9DecodeThread(); + void addData(uchar *data,uint size); + void setNoData(); + void clear(); + void sleepms(int _ms); + kDecMPEG2 *getDecoder() {return m_decoder;} + +protected: + int readData(uchar * data,uint size); + void run(); + + + +}; + +#endif diff --git a/k9decmpeg/k9plaympeg2.cpp b/k9decmpeg/k9plaympeg2.cpp new file mode 100644 index 0000000..cc304a6 --- /dev/null +++ b/k9decmpeg/k9plaympeg2.cpp @@ -0,0 +1,277 @@ +// +// C++ Implementation: k9plaympeg2 +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9plaympeg2.h" +#include "kdecmpeg2.h" +#include "dvdnav.h" + +#include +#include + +k9PlayMPEG2::k9PlayMPEG2() +{ + m_title=NULL; +} + + +k9PlayMPEG2::~k9PlayMPEG2() +{ + stop(); +} + +void k9PlayMPEG2::updatePos( uint32_t _position) { + m_idxLect=_position; + m_decoder.clear(); + m_decoder.getDecoder()->restart(); +} + + + +#define DVD_LANGUAGE "en" +#define DVD_READ_CACHE 1 + +void k9PlayMPEG2::playTitle() { + dvdnav_t *dvdnav; + uint8_t mem[DVD_VIDEO_LB_LEN]; + int finished = 0; + int32_t tt = 0,ptt=0; + uint32_t pos, lgr; + int title=m_title->getnumTitle(); + + + /* open dvdnav handle */ + if (dvdnav_open(&dvdnav, m_device,m_dvd) != DVDNAV_STATUS_OK) { + setError("ERR:Error on dvdnav_open\n"); + return ; + } + + /* set read ahead cache usage */ + if (dvdnav_set_readahead_flag(dvdnav, DVD_READ_CACHE) != DVDNAV_STATUS_OK) { + setError(QString("ERR:Error on dvdnav_set_readahead_flag: %1\n").arg(dvdnav_err_to_string(dvdnav))); + return; + } + + /* set the language */ + if (dvdnav_menu_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK || + dvdnav_audio_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK || + dvdnav_spu_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK) { + setError(QString("ERR:Error on setting languages: %1\n").arg(dvdnav_err_to_string(dvdnav))); + return ; + } + + /* set the PGC positioning flag to have position information relatively to the + * whole feature instead of just relatively to the current chapter */ + if (dvdnav_set_PGC_positioning_flag(dvdnav, 1) != DVDNAV_STATUS_OK) { + setError(QString("ERR:Error on dvdnav_set_PGC_positioning_flag: %1\n").arg(dvdnav_err_to_string(dvdnav))); + return ; + } + + int32_t parts; + dvdnav_get_number_of_parts(dvdnav , title, &parts); + + if (m_chapter==0) + dvdnav_title_play(dvdnav , title); + else + dvdnav_part_play(dvdnav , title,m_chapter); + /* the read loop which regularly calls dvdnav_get_next_block + * and handles the returned events */ + + while (!finished && !m_stopped && qApp!=NULL) { + int result, event, len; + uint8_t *buf = mem; + + if (m_idxLect !=0xFFFFFFFF) { + dvdnav_sector_search(dvdnav, m_idxLect,SEEK_SET); + m_idxLect=0xFFFFFFFF; + } + + + /* the main reading function */ +#ifdef DVD_READ_CACHE + + result = dvdnav_get_next_cache_block(dvdnav, &buf, &event, &len); +#else + + result = dvdnav_get_next_block(dvdnav, buf, &event, &len); +#endif + + + if (result == DVDNAV_STATUS_ERR) { + setError(QString("ERR:Error getting next block: %1\n").arg(dvdnav_err_to_string(dvdnav))); + return; + } + + switch (event) { + case DVDNAV_NAV_PACKET: + { + dvdnav_current_title_info(dvdnav, &tt, &ptt); + dvdnav_get_position(dvdnav, &pos, &lgr); + + if (tt != title) + finished=1; + + if (finished==0 && buf[17]==0xE0) { + m_decoder.addData( buf,len); + } + if (qApp->tryLock()) { + emit setPosition( pos); + qApp->unlock(); + } + + + } + break; + //removed break --> save + case DVDNAV_BLOCK_OK: + /* We have received a regular block of the currently playing MPEG stream.*/ + m_decoder.addData( buf,len); + break; + case DVDNAV_NOP: + /* Nothing to do here. */ + break; + case DVDNAV_STILL_FRAME: + /* We have reached a still frame. A real player application would wait + * the amount of time specified by the still's length while still handling + * user input to make menus and other interactive stills work. + * A length of 0xff means an indefinite still which has to be skipped + * indirectly by some user interaction. */ + { + dvdnav_still_event_t *still_event = (dvdnav_still_event_t *)buf; + dvdnav_still_skip(dvdnav); + } + break; + case DVDNAV_WAIT: + /* We have reached a point in DVD playback, where timing is critical. + * Player application with internal fifos can introduce state + * inconsistencies, because libdvdnav is always the fifo's length + * ahead in the stream compared to what the application sees. + * Such applications should wait until their fifos are empty + * when they receive this type of event. */ + dvdnav_wait_skip(dvdnav); + break; + case DVDNAV_SPU_CLUT_CHANGE: + /* Player applications should pass the new colour lookup table to their + * SPU decoder */ + break; + case DVDNAV_SPU_STREAM_CHANGE: + /* Player applications should inform their SPU decoder to switch channels */ + break; + case DVDNAV_AUDIO_STREAM_CHANGE: + /* Player applications should inform their audio decoder to switch channels */ + break; + case DVDNAV_HIGHLIGHT: + /* Player applications should inform their overlay engine to highlight the + * given button */ + { + dvdnav_highlight_event_t *highlight_event = (dvdnav_highlight_event_t *)buf; + } + break; + case DVDNAV_VTS_CHANGE: + /* Some status information like video aspect and video scale permissions do + * not change inside a VTS. Therefore this event can be used to query such + * information only when necessary and update the decoding/displaying + * accordingly. */ + break; + case DVDNAV_CELL_CHANGE: +// dvdnav_get_position(dvdnav, &pos, &lgr); + break; + case DVDNAV_HOP_CHANNEL: + /* This event is issued whenever a non-seamless operation has been executed. + * Applications with fifos should drop the fifos content to speed up responsiveness. */ + break; + case DVDNAV_STOP: + /* Playback should end here. */ + { + finished = 1; + } + break; + default: + finished = 1; + break; + } + +#ifdef DVD_READ_CACHE + dvdnav_free_cache_block(dvdnav, buf); +#endif + + } + m_decoder.setNoData(); + /* destroy dvdnav handle */ + dvdnav_close(dvdnav); + +} + + +void k9PlayMPEG2::run() { + m_stopped=false; + + m_idxLect=m_startSector; + playTitle(); + +} + +void k9PlayMPEG2::stop() { + m_stopped=TRUE; + + m_decoder.setNoData(); + m_decoder.clear(); + m_decoder.wait(); + wait(); + +} + +void k9PlayMPEG2::play() { + if (m_stopped && m_title!=NULL) + open(m_dvd,m_device,m_title,m_chapter); +} + +kDecMPEG2 *k9PlayMPEG2::getDecoder() { + return m_decoder.getDecoder() ; +} + +void k9PlayMPEG2::open (dvd_reader_t *dvd,const QString & device,k9DVDTitle * title,int chapter=0) { + m_dvd=dvd; + m_chapter=chapter; + int ret = 0; + struct stat dvd_stat; + QString c; + m_idxLect=0xFFFFFFFF; + + stop(); + + m_title=title; + m_device=device; + + m_startSector=0; + m_lastSector=0; + ret = stat(device.utf8(), &dvd_stat); + /* if ( ret < 0 ) { + c=i18n("Can't find device %1\n").arg(device.latin1()); + setError(c); + return; + } +*/ + m_title=title; + + m_startSector=m_title->getChapter( 0)->getstartSector(); + m_lastSector= m_startSector + m_title->getsectors(); //m_title->getChapter(m_title->getchapterCount()-1)->getendSector(); + + emit setPosition( m_startSector); + emit setMax( m_lastSector); + emit setMin( m_startSector); + + m_decoder.start(QThread::LowPriority); + + start(); +} + + +#include "k9plaympeg2.moc" diff --git a/k9decmpeg/k9plaympeg2.h b/k9decmpeg/k9plaympeg2.h new file mode 100644 index 0000000..2b431e8 --- /dev/null +++ b/k9decmpeg/k9plaympeg2.h @@ -0,0 +1,66 @@ +// +// C++ Interface: k9plaympeg2 +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9PLAYMPEG2_H +#define K9PLAYMPEG2_H + +#include "k9common.h" +#include "k9dvdtitle.h" + + +#include +#include +#include +#include +#include "k9decodethread.h" +/** + @author Jean-Michel PETIT +*/ +class k9PlayMPEG2 : public QObject,public QThread +{ +Q_OBJECT +private: + k9DVDTitle *m_title; + QString m_device; + k9DecodeThread m_decoder; + uint32_t m_idxLect; + uint32_t m_startSector; + uint32_t m_lastSector; + bool m_stopped; + dvd_file_t *dvdfile; + QMutex mutex; + dvd_reader_t *m_dvd; + int m_chapter; +public: + k9PlayMPEG2(); + void open (dvd_reader_t *dvd,const QString & device,k9DVDTitle * title,int chapter); + kDecMPEG2 *getDecoder(); + void setDvd(dvd_reader_t* _value) { m_dvd = _value;} + dvd_reader_t* getDvd() const {return m_dvd;} + ~k9PlayMPEG2(); +protected: + void run(); + void playTitle(); +public slots: + void stop(); + void play(); + void updatePos(uint32_t _position); + +signals: + void setPosition(uint32_t _position); + void setMin(uint32_t _sector); + void setMax(uint32_t _sector); + + void setError(const QString & err); + +}; + +#endif diff --git a/k9decmpeg/kdecmpeg2.cpp b/k9decmpeg/kdecmpeg2.cpp new file mode 100755 index 0000000..80c1774 --- /dev/null +++ b/k9decmpeg/kdecmpeg2.cpp @@ -0,0 +1,439 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#include "kdecmpeg2.h" +#include "mpeg2.h" +#include "mpeg2convert.h" +#include +#include +#include +#include +#include +#include "k9decodethread.h" + +void k9DisplayThread::setImage( QImage _image) { + if (m_mutex.tryLock()) { + m_image=_image; + m_raw=FALSE; + start(); + } +} + +void k9DisplayThread::setRawImage(uchar *_buffer,int _width,int _height,int size) { + if (m_mutex.tryLock()) { + m_buffer=(uchar*) malloc(size); + tc_memcpy(m_buffer,_buffer,size); + m_size=size; + m_width=_width; + m_height=_height, + m_raw=TRUE; + start(); + + } +} + +void k9DisplayThread::run() { + if (qApp==NULL) + return; + if (m_raw) { + m_dec->drawRaw( m_buffer,m_width,m_height,m_size); +// free(m_buffer); + }else + m_dec->draw( &m_image); + m_mutex.unlock(); +} + + +void kDecMPEG2::init() { + demux_pid=0; + m_thread=NULL; + demux_track=0xe0; + decoder = mpeg2_init (); + m_opened=true; + if (decoder == NULL) { + fprintf (stderr, "Could not allocate a decoder object.\n"); + exit (1); + } + m_display=new k9DisplayThread(this); + m_useGL=FALSE; + +} + +kDecMPEG2::kDecMPEG2(k9DecodeThread *_thread) { + init(); + m_thread=_thread; +} + + +kDecMPEG2::kDecMPEG2(){ + init(); +} + +#define DEMUX_PAYLOAD_START 1 +int kDecMPEG2::demux (uint8_t * buf, uint8_t * end, int flags) +{ + static int mpeg1_skip_table[16] = { + 0, 0, 4, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + + /* + * the demuxer keeps some state between calls: + * if "state" = DEMUX_HEADER, then "head_buf" contains the first + * "bytes" bytes from some header. + * if "state" == DEMUX_DATA, then we need to copy "bytes" bytes + * of ES data before the next header. + * if "state" == DEMUX_SKIP, then we need to skip "bytes" bytes + * of data before the next header. + * + * NEEDBYTES makes sure we have the requested number of bytes for a + * header. If we dont, it copies what we have into head_buf and returns, + * so that when we come back with more data we finish decoding this header. + * + * DONEBYTES updates "buf" to point after the header we just parsed. + */ + +#define DEMUX_HEADER 0 +#define DEMUX_DATA 1 +#define DEMUX_SKIP 2 + static int state = DEMUX_SKIP; + static int state_bytes = 0; + static uint8_t head_buf[264]; + + uint8_t * header; + int bytes; + int len; + +#define NEEDBYTES(x) \ + do { \ + int missing; \ + \ + missing = (x) - bytes; \ + if (missing > 0) { \ + if (header == head_buf) { \ + if (missing <= end - buf) { \ + tc_memcpy (header + bytes, buf, missing); \ + buf += missing; \ + bytes = (x); \ + } else { \ + tc_memcpy (header + bytes, buf, end - buf); \ + state_bytes = bytes + end - buf; \ + return 0; \ + } \ + } else { \ + tc_memcpy (head_buf, header, bytes); \ + state = DEMUX_HEADER; \ + state_bytes = bytes; \ + return 0; \ + } \ + } \ + } while (0) + +#define DONEBYTES(x) \ + do { \ + if (header != head_buf) \ + buf = header + (x); \ + } while (0) + + if (flags & DEMUX_PAYLOAD_START) + goto payload_start; + switch (state) { + case DEMUX_HEADER: + if (state_bytes > 0) { + header = head_buf; + bytes = state_bytes; + goto continue_header; + } + break; + case DEMUX_DATA: + if (demux_pid || (state_bytes > end - buf)) { + decode_mpeg2 (buf, end); + state_bytes -= end - buf; + return 0; + } + decode_mpeg2 (buf, buf + state_bytes); + buf += state_bytes; + break; + case DEMUX_SKIP: + if (demux_pid || (state_bytes > end - buf)) { + state_bytes -= end - buf; + return 0; + } + buf += state_bytes; + break; + } + m_pause=false; + while (!m_pause) { + if (demux_pid) { + state = DEMUX_SKIP; + return 0; + } + payload_start: + header = buf; + bytes = end - buf; +continue_header: + NEEDBYTES (4); + if (header[0] || header[1] || (header[2] != 1)) { + if (demux_pid) { + state = DEMUX_SKIP; + return 0; + } else + if (header != head_buf) { + buf++; + goto payload_start; + } else { + header[0] = header[1]; + header[1] = header[2]; + header[2] = header[3]; + bytes = 3; + goto continue_header; + } + } + if (demux_pid) { + if ((header[3] >= 0xe0) && (header[3] <= 0xef)) + goto pes; + fprintf (stderr, "bad stream id %x\n", header[3]); + exit (1); + } + switch (header[3]) { + case 0xb9: /* program end code */ + /* DONEBYTES (4); */ + /* break; */ + return 1; + case 0xba: /* pack header */ + NEEDBYTES (5); + if ((header[4] & 0xc0) == 0x40) { /* mpeg2 */ + NEEDBYTES (14); + len = 14 + (header[13] & 7); + NEEDBYTES (len); + DONEBYTES (len); + /* header points to the mpeg2 pack header */ + } else if ((header[4] & 0xf0) == 0x20) { /* mpeg1 */ + NEEDBYTES (12); + DONEBYTES (12); + /* header points to the mpeg1 pack header */ + } else { + fprintf (stderr, "weird pack header\n"); + DONEBYTES (5); + } + break; + default: + if (header[3] == demux_track) { +pes: + NEEDBYTES (7); + if ((header[6] & 0xc0) == 0x80) { /* mpeg2 */ + NEEDBYTES (9); + len = 9 + header[8]; + NEEDBYTES (len); + /* header points to the mpeg2 pes header */ + if (header[7] & 0x80) { + uint32_t pts, dts; + + pts = (((header[9] >> 1) << 30) | + (header[10] << 22) | ((header[11] >> 1) << 15) | + (header[12] << 7) | (header[13] >> 1)); + dts = (!(header[7] & 0x40) ? pts : + (((header[14] >> 1) << 30) | + (header[15] << 22) | + ((header[16] >> 1) << 15) | + (header[17] << 7) | (header[18] >> 1))); + mpeg2_tag_picture (decoder, pts, dts); + } + } else { /* mpeg1 */ + int len_skip; + uint8_t * ptsbuf; + + len = 7; + while (header[len - 1] == 0xff) { + len++; + NEEDBYTES (len); + if (len > 23) { + fprintf (stderr, "too much stuffing\n"); + break; + } + } + if ((header[len - 1] & 0xc0) == 0x40) { + len += 2; + NEEDBYTES (len); + } + len_skip = len; + len += mpeg1_skip_table[header[len - 1] >> 4]; + NEEDBYTES (len); + /* header points to the mpeg1 pes header */ + ptsbuf = header + len_skip; + if ((ptsbuf[-1] & 0xe0) == 0x20) { + uint32_t pts, dts; + + pts = (((ptsbuf[-1] >> 1) << 30) | + (ptsbuf[0] << 22) | ((ptsbuf[1] >> 1) << 15) | + (ptsbuf[2] << 7) | (ptsbuf[3] >> 1)); + dts = (((ptsbuf[-1] & 0xf0) != 0x30) ? pts : + (((ptsbuf[4] >> 1) << 30) | + (ptsbuf[5] << 22) | ((ptsbuf[6] >> 1) << 15) | + (ptsbuf[7] << 7) | (ptsbuf[18] >> 1))); + mpeg2_tag_picture (decoder, pts, dts); + } + } + DONEBYTES (len); + bytes = 6 + (header[4] << 8) + header[5] - len; + if (demux_pid || (bytes > end - buf)) { + decode_mpeg2 (buf, end); + state = DEMUX_DATA; + state_bytes = bytes - (end - buf); + return 0; + } else if (bytes > 0) { + decode_mpeg2 (buf, buf + bytes); + buf += bytes; + } + } else if (header[3] < 0xb9) { + fprintf (stderr,"looks like a video stream, not system stream\n"); + DONEBYTES (4); + } else { + NEEDBYTES (6); + DONEBYTES (6); + bytes = (header[4] << 8) + header[5]; + if (bytes > end - buf) { + state = DEMUX_SKIP; + state_bytes = bytes - (end - buf); + return 0; + } + buf += bytes; + } + } + } +} + +void kDecMPEG2::sync() { + int t=40- m_timer.elapsed(); + if (t>0 && m_thread!=NULL) { + m_thread->sleepms(t); + + } + m_timer.restart(); +} + +void kDecMPEG2::save_ppm (int width, int height, uint8_t * buf, int num) +{ + + int len; + + if (!m_useGL) { + len =(int) (3*width*height); + char c[255]; + sprintf(c,"P6\n%d %d\n255\n", width, height); + char *s; + s= (char*) malloc(len+strlen(c)); + tc_memcpy(s,c,strlen(c)); + tc_memcpy(s+strlen(c),buf, len); + pix.loadFromData((uchar*)s,strlen(c)+len); + free(s); + sync(); + if (m_thread !=NULL) + m_display->setImage( pix); + else + draw( &pix); + + } else { + len =(int) (4*width*height); + sync(); + m_display->setRawImage( (uchar*)buf,width,height,len); + } + +} + +void kDecMPEG2::decode_mpeg2(uint8_t * current, uint8_t * end) +{ + const mpeg2_info_t * info; + mpeg2_state_t state; + int framenum = 0; + mpeg2_buffer (decoder, current, end); + + info = mpeg2_info (decoder); + + while (1) { + state = mpeg2_parse (decoder); + switch (state) { + case STATE_BUFFER: + return; + case STATE_SEQUENCE: + if (! m_useGL) + mpeg2_convert (decoder, mpeg2convert_rgb (MPEG2CONVERT_RGB,24), NULL); + else + mpeg2_convert (decoder, mpeg2convert_rgb (MPEG2CONVERT_BGR,32), NULL); + break; + case STATE_PICTURE: + break; + case STATE_SLICE: + case STATE_END: + case STATE_INVALID_END: + if (info->display_fbuf ) save_ppm (info->sequence->width, info->sequence->height,info->display_fbuf->buf[0], framenum++); + break; + default: + break; + } + } +} + +int kDecMPEG2::decode (uint8_t * buf, uint8_t * end, int flags) +{ + mutex.lock(); + demux (buf,end,0); + mutex.unlock(); + return 0; +} +kDecMPEG2::~kDecMPEG2(){ + m_display->wait(); + delete m_display; + if (m_opened) + mpeg2_close (decoder); +} + +void kDecMPEG2::restart() { + mutex.lock(); + if (m_opened) + mpeg2_close (decoder); + decoder = mpeg2_init (); + m_opened=true; + if (decoder == NULL) { + fprintf (stderr, "Could not allocate a decoder object.\n"); + } + mutex.unlock(); +} + + +void kDecMPEG2::start() { + m_timer.start(); + decoder = mpeg2_init (); + m_opened=true; + if (decoder == NULL) { + fprintf (stderr, "Could not allocate a decoder object.\n"); + exit (1); + } +} + +void kDecMPEG2::stop() { + if (m_opened) + mpeg2_close(decoder); + m_opened=false; +} + +void kDecMPEG2::pause() { + m_pause=true; +} + diff --git a/k9decmpeg/kdecmpeg2.h b/k9decmpeg/kdecmpeg2.h new file mode 100755 index 0000000..525aa27 --- /dev/null +++ b/k9decmpeg/kdecmpeg2.h @@ -0,0 +1,99 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#ifndef KDECMPEG2_H +#define KDECMPEG2_H +#include "k9common.h" +#include "mpeg2.h" +#include +#include +#include +#include "ac.h" +#include +#include +#include +#include +#include +/** + *@author + */ + +class kDecMPEG2; + +class k9DisplayThread:public QThread { + +public: + k9DisplayThread(kDecMPEG2 *_dec) {m_dec=_dec;} + void setImage(QImage _image); + void setRawImage(uchar *_buffer,int _width,int _height,int size); +protected: + kDecMPEG2 *m_dec; + uchar *m_buffer; + int m_size,m_width,m_height; + QImage m_image; + QMutex m_mutex; + bool m_raw; + void run(); + +}; + +class k9DecodeThread; + + +class kDecMPEG2 : public QObject { +Q_OBJECT +public: + kDecMPEG2(k9DecodeThread *_thread); + kDecMPEG2(); + ~kDecMPEG2(); + int decode (uint8_t * buf, uint8_t * end, int flags); + void restart(); + void start(); + void stop(); + void pause(); + void draw(QImage *image) {emit pixmapReady(image);} + void drawRaw(uchar *_buffer,int width,int height,int size) {emit ppmReady (_buffer,width,height,size);} + + void setUseGL(bool _value) {m_useGL = _value;} + +private: + bool m_useGL; + bool m_pause; + k9DecodeThread *m_thread; + QImage pix; + QTime m_timer; + bool m_opened; + int demux_pid; + int demux_track; + QMutex mutex; + mpeg2dec_t * decoder; + k9DisplayThread *m_display; + int demux (uint8_t * buf, uint8_t * end, int flags); + void save_ppm (int width, int height, uint8_t * buf, int num); + void decode_mpeg2(uint8_t * current, uint8_t * end); + void init(); + void sync(); + signals: // Signals + /** No descriptions */ + void pixmapReady(QImage *image); + void ppmReady(uchar *buffer,int width,int height,int size); +}; + +#endif diff --git a/k9decmpeg/mmx.h b/k9decmpeg/mmx.h new file mode 100755 index 0000000..a410caa --- /dev/null +++ b/k9decmpeg/mmx.h @@ -0,0 +1,263 @@ +/* + * mmx.h + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +/* + * The type of an value that fits in an MMX register (note that long + * long constant values MUST be suffixed by LL and unsigned long long + * values by ULL, lest they be truncated by the compiler) + */ + +typedef union { + long long q; /* Quadword (64-bit) value */ + unsigned long long uq; /* Unsigned Quadword */ + int d[2]; /* 2 Doubleword (32-bit) values */ + unsigned int ud[2]; /* 2 Unsigned Doubleword */ + short w[4]; /* 4 Word (16-bit) values */ + unsigned short uw[4]; /* 4 Unsigned Word */ + char b[8]; /* 8 Byte (8-bit) values */ + unsigned char ub[8]; /* 8 Unsigned Byte */ + float s[2]; /* Single-precision (32-bit) value */ +} ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */ + + +#define mmx_i2r(op,imm,reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "i" (imm) ) + +#define mmx_m2r(op,mem,reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "m" (mem)) + +#define mmx_r2m(op,reg,mem) \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=m" (mem) \ + : /* nothing */ ) + +#define mmx_r2r(op,regs,regd) \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd) + + +#define emms() __asm__ __volatile__ ("emms") + +#define movd_m2r(var,reg) mmx_m2r (movd, var, reg) +#define movd_r2m(reg,var) mmx_r2m (movd, reg, var) +#define movd_v2r(var,reg) __asm__ __volatile__ ("movd %0, %%" #reg \ + : /* nothing */ \ + : "rm" (var)) +#define movd_r2v(reg,var) __asm__ __volatile__ ("movd %%" #reg ", %0" \ + : "=rm" (var) \ + : /* nothing */ ) + +#define movq_m2r(var,reg) mmx_m2r (movq, var, reg) +#define movq_r2m(reg,var) mmx_r2m (movq, reg, var) +#define movq_r2r(regs,regd) mmx_r2r (movq, regs, regd) + +#define packssdw_m2r(var,reg) mmx_m2r (packssdw, var, reg) +#define packssdw_r2r(regs,regd) mmx_r2r (packssdw, regs, regd) +#define packsswb_m2r(var,reg) mmx_m2r (packsswb, var, reg) +#define packsswb_r2r(regs,regd) mmx_r2r (packsswb, regs, regd) + +#define packuswb_m2r(var,reg) mmx_m2r (packuswb, var, reg) +#define packuswb_r2r(regs,regd) mmx_r2r (packuswb, regs, regd) + +#define paddb_m2r(var,reg) mmx_m2r (paddb, var, reg) +#define paddb_r2r(regs,regd) mmx_r2r (paddb, regs, regd) +#define paddd_m2r(var,reg) mmx_m2r (paddd, var, reg) +#define paddd_r2r(regs,regd) mmx_r2r (paddd, regs, regd) +#define paddw_m2r(var,reg) mmx_m2r (paddw, var, reg) +#define paddw_r2r(regs,regd) mmx_r2r (paddw, regs, regd) + +#define paddsb_m2r(var,reg) mmx_m2r (paddsb, var, reg) +#define paddsb_r2r(regs,regd) mmx_r2r (paddsb, regs, regd) +#define paddsw_m2r(var,reg) mmx_m2r (paddsw, var, reg) +#define paddsw_r2r(regs,regd) mmx_r2r (paddsw, regs, regd) + +#define paddusb_m2r(var,reg) mmx_m2r (paddusb, var, reg) +#define paddusb_r2r(regs,regd) mmx_r2r (paddusb, regs, regd) +#define paddusw_m2r(var,reg) mmx_m2r (paddusw, var, reg) +#define paddusw_r2r(regs,regd) mmx_r2r (paddusw, regs, regd) + +#define pand_m2r(var,reg) mmx_m2r (pand, var, reg) +#define pand_r2r(regs,regd) mmx_r2r (pand, regs, regd) + +#define pandn_m2r(var,reg) mmx_m2r (pandn, var, reg) +#define pandn_r2r(regs,regd) mmx_r2r (pandn, regs, regd) + +#define pcmpeqb_m2r(var,reg) mmx_m2r (pcmpeqb, var, reg) +#define pcmpeqb_r2r(regs,regd) mmx_r2r (pcmpeqb, regs, regd) +#define pcmpeqd_m2r(var,reg) mmx_m2r (pcmpeqd, var, reg) +#define pcmpeqd_r2r(regs,regd) mmx_r2r (pcmpeqd, regs, regd) +#define pcmpeqw_m2r(var,reg) mmx_m2r (pcmpeqw, var, reg) +#define pcmpeqw_r2r(regs,regd) mmx_r2r (pcmpeqw, regs, regd) + +#define pcmpgtb_m2r(var,reg) mmx_m2r (pcmpgtb, var, reg) +#define pcmpgtb_r2r(regs,regd) mmx_r2r (pcmpgtb, regs, regd) +#define pcmpgtd_m2r(var,reg) mmx_m2r (pcmpgtd, var, reg) +#define pcmpgtd_r2r(regs,regd) mmx_r2r (pcmpgtd, regs, regd) +#define pcmpgtw_m2r(var,reg) mmx_m2r (pcmpgtw, var, reg) +#define pcmpgtw_r2r(regs,regd) mmx_r2r (pcmpgtw, regs, regd) + +#define pmaddwd_m2r(var,reg) mmx_m2r (pmaddwd, var, reg) +#define pmaddwd_r2r(regs,regd) mmx_r2r (pmaddwd, regs, regd) + +#define pmulhw_m2r(var,reg) mmx_m2r (pmulhw, var, reg) +#define pmulhw_r2r(regs,regd) mmx_r2r (pmulhw, regs, regd) + +#define pmullw_m2r(var,reg) mmx_m2r (pmullw, var, reg) +#define pmullw_r2r(regs,regd) mmx_r2r (pmullw, regs, regd) + +#define por_m2r(var,reg) mmx_m2r (por, var, reg) +#define por_r2r(regs,regd) mmx_r2r (por, regs, regd) + +#define pslld_i2r(imm,reg) mmx_i2r (pslld, imm, reg) +#define pslld_m2r(var,reg) mmx_m2r (pslld, var, reg) +#define pslld_r2r(regs,regd) mmx_r2r (pslld, regs, regd) +#define psllq_i2r(imm,reg) mmx_i2r (psllq, imm, reg) +#define psllq_m2r(var,reg) mmx_m2r (psllq, var, reg) +#define psllq_r2r(regs,regd) mmx_r2r (psllq, regs, regd) +#define psllw_i2r(imm,reg) mmx_i2r (psllw, imm, reg) +#define psllw_m2r(var,reg) mmx_m2r (psllw, var, reg) +#define psllw_r2r(regs,regd) mmx_r2r (psllw, regs, regd) + +#define psrad_i2r(imm,reg) mmx_i2r (psrad, imm, reg) +#define psrad_m2r(var,reg) mmx_m2r (psrad, var, reg) +#define psrad_r2r(regs,regd) mmx_r2r (psrad, regs, regd) +#define psraw_i2r(imm,reg) mmx_i2r (psraw, imm, reg) +#define psraw_m2r(var,reg) mmx_m2r (psraw, var, reg) +#define psraw_r2r(regs,regd) mmx_r2r (psraw, regs, regd) + +#define psrld_i2r(imm,reg) mmx_i2r (psrld, imm, reg) +#define psrld_m2r(var,reg) mmx_m2r (psrld, var, reg) +#define psrld_r2r(regs,regd) mmx_r2r (psrld, regs, regd) +#define psrlq_i2r(imm,reg) mmx_i2r (psrlq, imm, reg) +#define psrlq_m2r(var,reg) mmx_m2r (psrlq, var, reg) +#define psrlq_r2r(regs,regd) mmx_r2r (psrlq, regs, regd) +#define psrlw_i2r(imm,reg) mmx_i2r (psrlw, imm, reg) +#define psrlw_m2r(var,reg) mmx_m2r (psrlw, var, reg) +#define psrlw_r2r(regs,regd) mmx_r2r (psrlw, regs, regd) + +#define psubb_m2r(var,reg) mmx_m2r (psubb, var, reg) +#define psubb_r2r(regs,regd) mmx_r2r (psubb, regs, regd) +#define psubd_m2r(var,reg) mmx_m2r (psubd, var, reg) +#define psubd_r2r(regs,regd) mmx_r2r (psubd, regs, regd) +#define psubw_m2r(var,reg) mmx_m2r (psubw, var, reg) +#define psubw_r2r(regs,regd) mmx_r2r (psubw, regs, regd) + +#define psubsb_m2r(var,reg) mmx_m2r (psubsb, var, reg) +#define psubsb_r2r(regs,regd) mmx_r2r (psubsb, regs, regd) +#define psubsw_m2r(var,reg) mmx_m2r (psubsw, var, reg) +#define psubsw_r2r(regs,regd) mmx_r2r (psubsw, regs, regd) + +#define psubusb_m2r(var,reg) mmx_m2r (psubusb, var, reg) +#define psubusb_r2r(regs,regd) mmx_r2r (psubusb, regs, regd) +#define psubusw_m2r(var,reg) mmx_m2r (psubusw, var, reg) +#define psubusw_r2r(regs,regd) mmx_r2r (psubusw, regs, regd) + +#define punpckhbw_m2r(var,reg) mmx_m2r (punpckhbw, var, reg) +#define punpckhbw_r2r(regs,regd) mmx_r2r (punpckhbw, regs, regd) +#define punpckhdq_m2r(var,reg) mmx_m2r (punpckhdq, var, reg) +#define punpckhdq_r2r(regs,regd) mmx_r2r (punpckhdq, regs, regd) +#define punpckhwd_m2r(var,reg) mmx_m2r (punpckhwd, var, reg) +#define punpckhwd_r2r(regs,regd) mmx_r2r (punpckhwd, regs, regd) + +#define punpcklbw_m2r(var,reg) mmx_m2r (punpcklbw, var, reg) +#define punpcklbw_r2r(regs,regd) mmx_r2r (punpcklbw, regs, regd) +#define punpckldq_m2r(var,reg) mmx_m2r (punpckldq, var, reg) +#define punpckldq_r2r(regs,regd) mmx_r2r (punpckldq, regs, regd) +#define punpcklwd_m2r(var,reg) mmx_m2r (punpcklwd, var, reg) +#define punpcklwd_r2r(regs,regd) mmx_r2r (punpcklwd, regs, regd) + +#define pxor_m2r(var,reg) mmx_m2r (pxor, var, reg) +#define pxor_r2r(regs,regd) mmx_r2r (pxor, regs, regd) + + +/* 3DNOW extensions */ + +#define pavgusb_m2r(var,reg) mmx_m2r (pavgusb, var, reg) +#define pavgusb_r2r(regs,regd) mmx_r2r (pavgusb, regs, regd) + + +/* AMD MMX extensions - also available in intel SSE */ + + +#define mmx_m2ri(op,mem,reg,imm) \ + __asm__ __volatile__ (#op " %1, %0, %%" #reg \ + : /* nothing */ \ + : "m" (mem), "i" (imm)) + +#define mmx_r2ri(op,regs,regd,imm) \ + __asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \ + : /* nothing */ \ + : "i" (imm) ) + +#define mmx_fetch(mem,hint) \ + __asm__ __volatile__ ("prefetch" #hint " %0" \ + : /* nothing */ \ + : "m" (mem)) + + +#define maskmovq(regs,maskreg) mmx_r2ri (maskmovq, regs, maskreg) + +#define movntq_r2m(mmreg,var) mmx_r2m (movntq, mmreg, var) + +#define pavgb_m2r(var,reg) mmx_m2r (pavgb, var, reg) +#define pavgb_r2r(regs,regd) mmx_r2r (pavgb, regs, regd) +#define pavgw_m2r(var,reg) mmx_m2r (pavgw, var, reg) +#define pavgw_r2r(regs,regd) mmx_r2r (pavgw, regs, regd) + +#define pextrw_r2r(mmreg,reg,imm) mmx_r2ri (pextrw, mmreg, reg, imm) + +#define pinsrw_r2r(reg,mmreg,imm) mmx_r2ri (pinsrw, reg, mmreg, imm) + +#define pmaxsw_m2r(var,reg) mmx_m2r (pmaxsw, var, reg) +#define pmaxsw_r2r(regs,regd) mmx_r2r (pmaxsw, regs, regd) + +#define pmaxub_m2r(var,reg) mmx_m2r (pmaxub, var, reg) +#define pmaxub_r2r(regs,regd) mmx_r2r (pmaxub, regs, regd) + +#define pminsw_m2r(var,reg) mmx_m2r (pminsw, var, reg) +#define pminsw_r2r(regs,regd) mmx_r2r (pminsw, regs, regd) + +#define pminub_m2r(var,reg) mmx_m2r (pminub, var, reg) +#define pminub_r2r(regs,regd) mmx_r2r (pminub, regs, regd) + +#define pmovmskb(mmreg,reg) \ + __asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg) + +#define pmulhuw_m2r(var,reg) mmx_m2r (pmulhuw, var, reg) +#define pmulhuw_r2r(regs,regd) mmx_r2r (pmulhuw, regs, regd) + +#define prefetcht0(mem) mmx_fetch (mem, t0) +#define prefetcht1(mem) mmx_fetch (mem, t1) +#define prefetcht2(mem) mmx_fetch (mem, t2) +#define prefetchnta(mem) mmx_fetch (mem, nta) + +#define psadbw_m2r(var,reg) mmx_m2r (psadbw, var, reg) +#define psadbw_r2r(regs,regd) mmx_r2r (psadbw, regs, regd) + +#define pshufw_m2r(var,reg,imm) mmx_m2ri(pshufw, var, reg, imm) +#define pshufw_r2r(regs,regd,imm) mmx_r2ri(pshufw, regs, regd, imm) + +#define sfence() __asm__ __volatile__ ("sfence\n\t") diff --git a/k9decmpeg/motion_comp.cpp b/k9decmpeg/motion_comp.cpp new file mode 100755 index 0000000..11b478b --- /dev/null +++ b/k9decmpeg/motion_comp.cpp @@ -0,0 +1,130 @@ +/* + * motion_comp.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#include "k9common.h" + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" + +mpeg2_mc_t mpeg2_mc; + +void mpeg2_mc_init (uint32_t accel) +{ +#ifdef ARCH_X86 + if (accel & MPEG2_ACCEL_X86_MMXEXT) + mpeg2_mc = mpeg2_mc_mmxext; + else if (accel & MPEG2_ACCEL_X86_3DNOW) + mpeg2_mc = mpeg2_mc_3dnow; + else if (accel & MPEG2_ACCEL_X86_MMX) + mpeg2_mc = mpeg2_mc_mmx; + else +#endif +#ifdef ARCH_PPC + if (accel & MPEG2_ACCEL_PPC_ALTIVEC) + mpeg2_mc = mpeg2_mc_altivec; + else +#endif +#ifdef ARCH_ALPHA + if (accel & MPEG2_ACCEL_ALPHA) + mpeg2_mc = mpeg2_mc_alpha; + else +#endif +#ifdef ARCH_SPARC + if (accel & MPEG2_ACCEL_SPARC_VIS) + mpeg2_mc = mpeg2_mc_vis; + else +#endif + mpeg2_mc = mpeg2_mc_c; +} + +#define avg2(a,b) ((a+b+1)>>1) +#define avg4(a,b,c,d) ((a+b+c+d+2)>>2) + +#define predict_o(i) (ref[i]) +#define predict_x(i) (avg2 (ref[i], ref[i+1])) +#define predict_y(i) (avg2 (ref[i], (ref+stride)[i])) +#define predict_xy(i) (avg4 (ref[i], ref[i+1], \ + (ref+stride)[i], (ref+stride)[i+1])) + +#define put(predictor,i) dest[i] = predictor (i) +#define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i]) + +/* mc function template */ + +#define MC_FUNC(op,xy) \ +static void MC_##op##_##xy##_16_c (uint8_t * dest, const uint8_t * ref, \ + const int stride, int height) \ +{ \ + do { \ + op (predict_##xy, 0); \ + op (predict_##xy, 1); \ + op (predict_##xy, 2); \ + op (predict_##xy, 3); \ + op (predict_##xy, 4); \ + op (predict_##xy, 5); \ + op (predict_##xy, 6); \ + op (predict_##xy, 7); \ + op (predict_##xy, 8); \ + op (predict_##xy, 9); \ + op (predict_##xy, 10); \ + op (predict_##xy, 11); \ + op (predict_##xy, 12); \ + op (predict_##xy, 13); \ + op (predict_##xy, 14); \ + op (predict_##xy, 15); \ + ref += stride; \ + dest += stride; \ + } while (--height); \ +} \ +static void MC_##op##_##xy##_8_c (uint8_t * dest, const uint8_t * ref, \ + const int stride, int height) \ +{ \ + do { \ + op (predict_##xy, 0); \ + op (predict_##xy, 1); \ + op (predict_##xy, 2); \ + op (predict_##xy, 3); \ + op (predict_##xy, 4); \ + op (predict_##xy, 5); \ + op (predict_##xy, 6); \ + op (predict_##xy, 7); \ + ref += stride; \ + dest += stride; \ + } while (--height); \ +} + +/* definitions of the actual mc functions */ + +MC_FUNC (put,o) +MC_FUNC (avg,o) +MC_FUNC (put,x) +MC_FUNC (avg,x) +MC_FUNC (put,y) +MC_FUNC (avg,y) +MC_FUNC (put,xy) +MC_FUNC (avg,xy) + +MPEG2_MC_EXTERN (c) diff --git a/k9decmpeg/motion_comp_alpha.cpp b/k9decmpeg/motion_comp_alpha.cpp new file mode 100755 index 0000000..d029420 --- /dev/null +++ b/k9decmpeg/motion_comp_alpha.cpp @@ -0,0 +1,253 @@ +/* + * motion_comp_alpha.c + * Copyright (C) 2002-2003 Falk Hueffner + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#ifdef ARCH_ALPHA + +#include "k9common.h" + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" +#include "alpha_asm.h" + +static inline uint64_t avg2 (uint64_t a, uint64_t b) +{ + return (a | b) - (((a ^ b) & BYTE_VEC (0xfe)) >> 1); +} + +// Load two unaligned quadwords from addr. This macro only works if +// addr is actually unaligned. +#define ULOAD16(ret_l,ret_r,addr) \ + do { \ + uint64_t _l = ldq_u (addr + 0); \ + uint64_t _m = ldq_u (addr + 8); \ + uint64_t _r = ldq_u (addr + 16); \ + ret_l = extql (_l, addr) | extqh (_m, addr); \ + ret_r = extql (_m, addr) | extqh (_r, addr); \ + } while (0) + +// Load two aligned quadwords from addr. +#define ALOAD16(ret_l,ret_r,addr) \ + do { \ + ret_l = ldq (addr); \ + ret_r = ldq (addr + 8); \ + } while (0) + +#define OP8(LOAD,LOAD16,STORE) \ + do { \ + STORE (LOAD (pixels), block); \ + pixels += line_size; \ + block += line_size; \ + } while (--h) + +#define OP16(LOAD,LOAD16,STORE) \ + do { \ + uint64_t l, r; \ + LOAD16 (l, r, pixels); \ + STORE (l, block); \ + STORE (r, block + 8); \ + pixels += line_size; \ + block += line_size; \ + } while (--h) + +#define OP8_X2(LOAD,LOAD16,STORE) \ + do { \ + uint64_t p0, p1; \ + \ + p0 = LOAD (pixels); \ + p1 = p0 >> 8 | ((uint64_t) pixels[8] << 56); \ + STORE (avg2 (p0, p1), block); \ + pixels += line_size; \ + block += line_size; \ + } while (--h) + +#define OP16_X2(LOAD,LOAD16,STORE) \ + do { \ + uint64_t p0, p1; \ + \ + LOAD16 (p0, p1, pixels); \ + STORE (avg2(p0, p0 >> 8 | p1 << 56), block); \ + STORE (avg2(p1, p1 >> 8 | (uint64_t) pixels[16] << 56), \ + block + 8); \ + pixels += line_size; \ + block += line_size; \ + } while (--h) + +#define OP8_Y2(LOAD,LOAD16,STORE) \ + do { \ + uint64_t p0, p1; \ + p0 = LOAD (pixels); \ + pixels += line_size; \ + p1 = LOAD (pixels); \ + do { \ + uint64_t av = avg2 (p0, p1); \ + if (--h == 0) line_size = 0; \ + pixels += line_size; \ + p0 = p1; \ + p1 = LOAD (pixels); \ + STORE (av, block); \ + block += line_size; \ + } while (h); \ + } while (0) + +#define OP16_Y2(LOAD,LOAD16,STORE) \ + do { \ + uint64_t p0l, p0r, p1l, p1r; \ + LOAD16 (p0l, p0r, pixels); \ + pixels += line_size; \ + LOAD16 (p1l, p1r, pixels); \ + do { \ + uint64_t avl, avr; \ + if (--h == 0) line_size = 0; \ + avl = avg2 (p0l, p1l); \ + avr = avg2 (p0r, p1r); \ + p0l = p1l; \ + p0r = p1r; \ + pixels += line_size; \ + LOAD16 (p1l, p1r, pixels); \ + STORE (avl, block); \ + STORE (avr, block + 8); \ + block += line_size; \ + } while (h); \ + } while (0) + +#define OP8_XY2(LOAD,LOAD16,STORE) \ + do { \ + uint64_t pl, ph; \ + uint64_t p1 = LOAD (pixels); \ + uint64_t p2 = p1 >> 8 | ((uint64_t) pixels[8] << 56); \ + \ + ph = (((p1 & ~BYTE_VEC (0x03)) >> 2) + \ + ((p2 & ~BYTE_VEC (0x03)) >> 2)); \ + pl = ((p1 & BYTE_VEC (0x03)) + \ + (p2 & BYTE_VEC (0x03))); \ + \ + do { \ + uint64_t npl, nph; \ + \ + pixels += line_size; \ + p1 = LOAD (pixels); \ + p2 = (p1 >> 8) | ((uint64_t) pixels[8] << 56); \ + nph = (((p1 & ~BYTE_VEC (0x03)) >> 2) + \ + ((p2 & ~BYTE_VEC (0x03)) >> 2)); \ + npl = ((p1 & BYTE_VEC (0x03)) + \ + (p2 & BYTE_VEC (0x03))); \ + \ + STORE (ph + nph + \ + (((pl + npl + BYTE_VEC (0x02)) >> 2) & \ + BYTE_VEC (0x03)), block); \ + \ + block += line_size; \ + pl = npl; \ + ph = nph; \ + } while (--h); \ + } while (0) + +#define OP16_XY2(LOAD,LOAD16,STORE) \ + do { \ + uint64_t p0, p1, p2, p3, pl_l, ph_l, pl_r, ph_r; \ + LOAD16 (p0, p2, pixels); \ + p1 = p0 >> 8 | (p2 << 56); \ + p3 = p2 >> 8 | ((uint64_t)pixels[16] << 56); \ + \ + ph_l = (((p0 & ~BYTE_VEC (0x03)) >> 2) + \ + ((p1 & ~BYTE_VEC (0x03)) >> 2)); \ + pl_l = ((p0 & BYTE_VEC (0x03)) + \ + (p1 & BYTE_VEC(0x03))); \ + ph_r = (((p2 & ~BYTE_VEC (0x03)) >> 2) + \ + ((p3 & ~BYTE_VEC (0x03)) >> 2)); \ + pl_r = ((p2 & BYTE_VEC (0x03)) + \ + (p3 & BYTE_VEC (0x03))); \ + \ + do { \ + uint64_t npl_l, nph_l, npl_r, nph_r; \ + \ + pixels += line_size; \ + LOAD16 (p0, p2, pixels); \ + p1 = p0 >> 8 | (p2 << 56); \ + p3 = p2 >> 8 | ((uint64_t)pixels[16] << 56); \ + nph_l = (((p0 & ~BYTE_VEC (0x03)) >> 2) + \ + ((p1 & ~BYTE_VEC (0x03)) >> 2)); \ + npl_l = ((p0 & BYTE_VEC (0x03)) + \ + (p1 & BYTE_VEC (0x03))); \ + nph_r = (((p2 & ~BYTE_VEC (0x03)) >> 2) + \ + ((p3 & ~BYTE_VEC (0x03)) >> 2)); \ + npl_r = ((p2 & BYTE_VEC (0x03)) + \ + (p3 & BYTE_VEC (0x03))); \ + \ + STORE (ph_l + nph_l + \ + (((pl_l + npl_l + BYTE_VEC (0x02)) >> 2) & \ + BYTE_VEC(0x03)), block); \ + STORE (ph_r + nph_r + \ + (((pl_r + npl_r + BYTE_VEC (0x02)) >> 2) & \ + BYTE_VEC(0x03)), block + 8); \ + \ + block += line_size; \ + pl_l = npl_l; \ + ph_l = nph_l; \ + pl_r = npl_r; \ + ph_r = nph_r; \ + } while (--h); \ + } while (0) + +#define MAKE_OP(OPNAME,SIZE,SUFF,OPKIND,STORE) \ +static void MC_ ## OPNAME ## _ ## SUFF ## _ ## SIZE ## _alpha \ + (uint8_t *restrict block, const uint8_t *restrict pixels, \ + int line_size, int h) \ +{ \ + if ((uint64_t) pixels & 0x7) { \ + OPKIND (uldq, ULOAD16, STORE); \ + } else { \ + OPKIND (ldq, ALOAD16, STORE); \ + } \ +} + +#define PIXOP(OPNAME,STORE) \ + MAKE_OP (OPNAME, 8, o, OP8, STORE); \ + MAKE_OP (OPNAME, 8, x, OP8_X2, STORE); \ + MAKE_OP (OPNAME, 8, y, OP8_Y2, STORE); \ + MAKE_OP (OPNAME, 8, xy, OP8_XY2, STORE); \ + MAKE_OP (OPNAME, 16, o, OP16, STORE); \ + MAKE_OP (OPNAME, 16, x, OP16_X2, STORE); \ + MAKE_OP (OPNAME, 16, y, OP16_Y2, STORE); \ + MAKE_OP (OPNAME, 16, xy, OP16_XY2, STORE); + +#define STORE(l,b) stq (l, b) +PIXOP (put, STORE); +#undef STORE +#define STORE(l,b) stq (avg2 (l, ldq (b)), b); +PIXOP (avg, STORE); + +mpeg2_mc_t mpeg2_mc_alpha = { + { MC_put_o_16_alpha, MC_put_x_16_alpha, + MC_put_y_16_alpha, MC_put_xy_16_alpha, + MC_put_o_8_alpha, MC_put_x_8_alpha, + MC_put_y_8_alpha, MC_put_xy_8_alpha }, + { MC_avg_o_16_alpha, MC_avg_x_16_alpha, + MC_avg_y_16_alpha, MC_avg_xy_16_alpha, + MC_avg_o_8_alpha, MC_avg_x_8_alpha, + MC_avg_y_8_alpha, MC_avg_xy_8_alpha } +}; + +#endif diff --git a/k9decmpeg/motion_comp_altivec.cpp b/k9decmpeg/motion_comp_altivec.cpp new file mode 100755 index 0000000..d15a260 --- /dev/null +++ b/k9decmpeg/motion_comp_altivec.cpp @@ -0,0 +1,1010 @@ +/* + * motion_comp_altivec.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#ifdef ARCH_PPC + +#ifdef HAVE_ALTIVEC_H +#include +#endif +#include "k9common.h" + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" + +typedef vector signed char vector_s8_t; +typedef vector unsigned char vector_u8_t; +typedef vector signed short vector_s16_t; +typedef vector unsigned short vector_u16_t; +typedef vector signed int vector_s32_t; +typedef vector unsigned int vector_u32_t; + +#ifndef COFFEE_BREAK /* Workarounds for gcc suckage */ + +static inline vector_u8_t my_vec_ld (int const A, const uint8_t * const B) +{ + return vec_ld (A, (uint8_t *)B); +} +#undef vec_ld +#define vec_ld my_vec_ld + +static inline vector_u8_t my_vec_and (vector_u8_t const A, vector_u8_t const B) +{ + return vec_and (A, B); +} +#undef vec_and +#define vec_and my_vec_and + +static inline vector_u8_t my_vec_avg (vector_u8_t const A, vector_u8_t const B) +{ + return vec_avg (A, B); +} +#undef vec_avg +#define vec_avg my_vec_avg + +#endif + +static void MC_put_o_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm, ref0, ref1, tmp; + + perm = vec_lvsl (0, ref); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + tmp = vec_perm (ref0, ref1, perm); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + vec_st (tmp, 0, dest); + tmp = vec_perm (ref0, ref1, perm); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + vec_st (tmp, stride, dest); + dest += 2*stride; + tmp = vec_perm (ref0, ref1, perm); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + vec_st (tmp, 0, dest); + tmp = vec_perm (ref0, ref1, perm); + vec_st (tmp, stride, dest); +} + +static void MC_put_o_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm0, perm1, tmp0, tmp1, ref0, ref1; + + tmp0 = vec_lvsl (0, ref); + tmp0 = vec_mergeh (tmp0, tmp0); + perm0 = vec_pack ((vector_u16_t)tmp0, (vector_u16_t)tmp0); + tmp1 = vec_lvsl (stride, ref); + tmp1 = vec_mergeh (tmp1, tmp1); + perm1 = vec_pack ((vector_u16_t)tmp1, (vector_u16_t)tmp1); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + tmp0 = vec_perm (ref0, ref1, perm0); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + vec_ste ((vector_u32_t)tmp0, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp0, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_perm (ref0, ref1, perm1); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + vec_ste ((vector_u32_t)tmp1, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); + dest += stride; + tmp0 = vec_perm (ref0, ref1, perm0); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + vec_ste ((vector_u32_t)tmp0, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp0, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_perm (ref0, ref1, perm1); + vec_ste ((vector_u32_t)tmp1, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); +} + +static void MC_put_x_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t permA, permB, ref0, ref1, tmp; + + permA = vec_lvsl (0, ref); + permB = vec_add (permA, vec_splat_u8 (1)); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + tmp = vec_avg (vec_perm (ref0, ref1, permA), + vec_perm (ref0, ref1, permB)); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + vec_st (tmp, 0, dest); + tmp = vec_avg (vec_perm (ref0, ref1, permA), + vec_perm (ref0, ref1, permB)); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + vec_st (tmp, stride, dest); + dest += 2*stride; + tmp = vec_avg (vec_perm (ref0, ref1, permA), + vec_perm (ref0, ref1, permB)); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + vec_st (tmp, 0, dest); + tmp = vec_avg (vec_perm (ref0, ref1, permA), + vec_perm (ref0, ref1, permB)); + vec_st (tmp, stride, dest); +} + +static void MC_put_x_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm0A, perm0B, perm1A, perm1B, ones, tmp0, tmp1, ref0, ref1; + + ones = vec_splat_u8 (1); + tmp0 = vec_lvsl (0, ref); + tmp0 = vec_mergeh (tmp0, tmp0); + perm0A = vec_pack ((vector_u16_t)tmp0, (vector_u16_t)tmp0); + perm0B = vec_add (perm0A, ones); + tmp1 = vec_lvsl (stride, ref); + tmp1 = vec_mergeh (tmp1, tmp1); + perm1A = vec_pack ((vector_u16_t)tmp1, (vector_u16_t)tmp1); + perm1B = vec_add (perm1A, ones); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + tmp0 = vec_avg (vec_perm (ref0, ref1, perm0A), + vec_perm (ref0, ref1, perm0B)); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + vec_ste ((vector_u32_t)tmp0, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp0, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_avg (vec_perm (ref0, ref1, perm1A), + vec_perm (ref0, ref1, perm1B)); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + vec_ste ((vector_u32_t)tmp1, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); + dest += stride; + tmp0 = vec_avg (vec_perm (ref0, ref1, perm0A), + vec_perm (ref0, ref1, perm0B)); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + vec_ste ((vector_u32_t)tmp0, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp0, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_avg (vec_perm (ref0, ref1, perm1A), + vec_perm (ref0, ref1, perm1B)); + vec_ste ((vector_u32_t)tmp1, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); +} + +static void MC_put_y_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm, ref0, ref1, tmp0, tmp1, tmp; + + perm = vec_lvsl (0, ref); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + tmp0 = vec_perm (ref0, ref1, perm); + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + tmp1 = vec_perm (ref0, ref1, perm); + tmp = vec_avg (tmp0, tmp1); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + vec_st (tmp, 0, dest); + tmp0 = vec_perm (ref0, ref1, perm); + tmp = vec_avg (tmp0, tmp1); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + vec_st (tmp, stride, dest); + dest += 2*stride; + tmp1 = vec_perm (ref0, ref1, perm); + tmp = vec_avg (tmp0, tmp1); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + vec_st (tmp, 0, dest); + tmp0 = vec_perm (ref0, ref1, perm); + tmp = vec_avg (tmp0, tmp1); + vec_st (tmp, stride, dest); +} + +static void MC_put_y_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm0, perm1, tmp0, tmp1, tmp, ref0, ref1; + + tmp0 = vec_lvsl (0, ref); + tmp0 = vec_mergeh (tmp0, tmp0); + perm0 = vec_pack ((vector_u16_t)tmp0, (vector_u16_t)tmp0); + tmp1 = vec_lvsl (stride, ref); + tmp1 = vec_mergeh (tmp1, tmp1); + perm1 = vec_pack ((vector_u16_t)tmp1, (vector_u16_t)tmp1); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + tmp0 = vec_perm (ref0, ref1, perm0); + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + tmp1 = vec_perm (ref0, ref1, perm1); + tmp = vec_avg (tmp0, tmp1); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + tmp0 = vec_perm (ref0, ref1, perm0); + tmp = vec_avg (tmp0, tmp1); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_perm (ref0, ref1, perm1); + tmp = vec_avg (tmp0, tmp1); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + tmp0 = vec_perm (ref0, ref1, perm0); + tmp = vec_avg (tmp0, tmp1); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); +} + +static void MC_put_xy_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t permA, permB, ref0, ref1, A, B, avg0, avg1, xor0, xor1, tmp; + vector_u8_t ones; + + ones = vec_splat_u8 (1); + permA = vec_lvsl (0, ref); + permB = vec_add (permA, ones); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg1 = vec_avg (A, B); + xor1 = vec_xor (A, B); + tmp = vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1))); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + vec_st (tmp, 0, dest); + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + tmp = vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1))); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + vec_st (tmp, stride, dest); + dest += 2*stride; + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg1 = vec_avg (A, B); + xor1 = vec_xor (A, B); + tmp = vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1))); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + vec_st (tmp, 0, dest); + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + tmp = vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1))); + vec_st (tmp, stride, dest); +} + +static void MC_put_xy_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm0A, perm0B, perm1A, perm1B, ref0, ref1, A, B; + vector_u8_t avg0, avg1, xor0, xor1, tmp, ones; + + ones = vec_splat_u8 (1); + perm0A = vec_lvsl (0, ref); + perm0A = vec_mergeh (perm0A, perm0A); + perm0A = vec_pack ((vector_u16_t)perm0A, (vector_u16_t)perm0A); + perm0B = vec_add (perm0A, ones); + perm1A = vec_lvsl (stride, ref); + perm1A = vec_mergeh (perm1A, perm1A); + perm1A = vec_pack ((vector_u16_t)perm1A, (vector_u16_t)perm1A); + perm1B = vec_add (perm1A, ones); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + A = vec_perm (ref0, ref1, perm0A); + B = vec_perm (ref0, ref1, perm0B); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + A = vec_perm (ref0, ref1, perm1A); + B = vec_perm (ref0, ref1, perm1B); + avg1 = vec_avg (A, B); + xor1 = vec_xor (A, B); + tmp = vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1))); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + A = vec_perm (ref0, ref1, perm0A); + B = vec_perm (ref0, ref1, perm0B); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + tmp = vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1))); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + A = vec_perm (ref0, ref1, perm1A); + B = vec_perm (ref0, ref1, perm1B); + avg1 = vec_avg (A, B); + xor1 = vec_xor (A, B); + tmp = vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1))); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + A = vec_perm (ref0, ref1, perm0A); + B = vec_perm (ref0, ref1, perm0B); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + tmp = vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1))); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); +} + +#if 0 +static void MC_put_xy_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t permA, permB, ref0, ref1, A, B, C, D, tmp, zero, ones; + vector_u16_t splat2, temp; + + ones = vec_splat_u8 (1); + permA = vec_lvsl (0, ref); + permB = vec_add (permA, ones); + + zero = vec_splat_u8 (0); + splat2 = vec_splat_u16 (2); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + C = vec_perm (ref0, ref1, permA); + D = vec_perm (ref0, ref1, permB); + + temp = vec_add (vec_add ((vector_u16_t)vec_mergeh (zero, A), + (vector_u16_t)vec_mergeh (zero, B)), + vec_add ((vector_u16_t)vec_mergeh (zero, C), + (vector_u16_t)vec_mergeh (zero, D))); + temp = vec_sr (vec_add (temp, splat2), splat2); + tmp = vec_pack (temp, temp); + + vec_st (tmp, 0, dest); + dest += stride; + tmp = vec_avg (vec_perm (ref0, ref1, permA), + vec_perm (ref0, ref1, permB)); + } while (--height); +} +#endif + +static void MC_avg_o_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm, ref0, ref1, tmp, prev; + + perm = vec_lvsl (0, ref); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + prev = vec_ld (0, dest); + tmp = vec_avg (prev, vec_perm (ref0, ref1, perm)); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_st (tmp, 0, dest); + tmp = vec_avg (prev, vec_perm (ref0, ref1, perm)); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + prev = vec_ld (2*stride, dest); + vec_st (tmp, stride, dest); + dest += 2*stride; + tmp = vec_avg (prev, vec_perm (ref0, ref1, perm)); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + prev = vec_ld (stride, dest); + vec_st (tmp, 0, dest); + tmp = vec_avg (prev, vec_perm (ref0, ref1, perm)); + vec_st (tmp, stride, dest); +} + +static void MC_avg_o_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm0, perm1, tmp0, tmp1, ref0, ref1, prev; + + tmp0 = vec_lvsl (0, ref); + tmp0 = vec_mergeh (tmp0, tmp0); + perm0 = vec_pack ((vector_u16_t)tmp0, (vector_u16_t)tmp0); + tmp1 = vec_lvsl (stride, ref); + tmp1 = vec_mergeh (tmp1, tmp1); + perm1 = vec_pack ((vector_u16_t)tmp1, (vector_u16_t)tmp1); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + prev = vec_ld (0, dest); + tmp0 = vec_avg (prev, vec_perm (ref0, ref1, perm0)); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp0, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp0, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_avg (prev, vec_perm (ref0, ref1, perm1)); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp1, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); + dest += stride; + tmp0 = vec_avg (prev, vec_perm (ref0, ref1, perm0)); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp0, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp0, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_avg (prev, vec_perm (ref0, ref1, perm1)); + vec_ste ((vector_u32_t)tmp1, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); +} + +static void MC_avg_x_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t permA, permB, ref0, ref1, tmp, prev; + + permA = vec_lvsl (0, ref); + permB = vec_add (permA, vec_splat_u8 (1)); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + prev = vec_ld (0, dest); + ref += stride; + tmp = vec_avg (prev, vec_avg (vec_perm (ref0, ref1, permA), + vec_perm (ref0, ref1, permB))); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_st (tmp, 0, dest); + tmp = vec_avg (prev, vec_avg (vec_perm (ref0, ref1, permA), + vec_perm (ref0, ref1, permB))); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + prev = vec_ld (2*stride, dest); + vec_st (tmp, stride, dest); + dest += 2*stride; + tmp = vec_avg (prev, vec_avg (vec_perm (ref0, ref1, permA), + vec_perm (ref0, ref1, permB))); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + prev = vec_ld (stride, dest); + vec_st (tmp, 0, dest); + tmp = vec_avg (prev, vec_avg (vec_perm (ref0, ref1, permA), + vec_perm (ref0, ref1, permB))); + vec_st (tmp, stride, dest); +} + +static void MC_avg_x_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm0A, perm0B, perm1A, perm1B, ones, tmp0, tmp1, ref0, ref1; + vector_u8_t prev; + + ones = vec_splat_u8 (1); + tmp0 = vec_lvsl (0, ref); + tmp0 = vec_mergeh (tmp0, tmp0); + perm0A = vec_pack ((vector_u16_t)tmp0, (vector_u16_t)tmp0); + perm0B = vec_add (perm0A, ones); + tmp1 = vec_lvsl (stride, ref); + tmp1 = vec_mergeh (tmp1, tmp1); + perm1A = vec_pack ((vector_u16_t)tmp1, (vector_u16_t)tmp1); + perm1B = vec_add (perm1A, ones); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + prev = vec_ld (0, dest); + ref += stride; + tmp0 = vec_avg (prev, vec_avg (vec_perm (ref0, ref1, perm0A), + vec_perm (ref0, ref1, perm0B))); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp0, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp0, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_avg (prev, vec_avg (vec_perm (ref0, ref1, perm1A), + vec_perm (ref0, ref1, perm1B))); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp1, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); + dest += stride; + tmp0 = vec_avg (prev, vec_avg (vec_perm (ref0, ref1, perm0A), + vec_perm (ref0, ref1, perm0B))); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp0, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp0, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_avg (prev, vec_avg (vec_perm (ref0, ref1, perm1A), + vec_perm (ref0, ref1, perm1B))); + vec_ste ((vector_u32_t)tmp1, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp1, 4, (unsigned int *)dest); +} + +static void MC_avg_y_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm, ref0, ref1, tmp0, tmp1, tmp, prev; + + perm = vec_lvsl (0, ref); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + tmp0 = vec_perm (ref0, ref1, perm); + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + prev = vec_ld (0, dest); + tmp1 = vec_perm (ref0, ref1, perm); + tmp = vec_avg (prev, vec_avg (tmp0, tmp1)); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_st (tmp, 0, dest); + tmp0 = vec_perm (ref0, ref1, perm); + tmp = vec_avg (prev, vec_avg (tmp0, tmp1)); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + ref += stride; + prev = vec_ld (2*stride, dest); + vec_st (tmp, stride, dest); + dest += 2*stride; + tmp1 = vec_perm (ref0, ref1, perm); + tmp = vec_avg (prev, vec_avg (tmp0, tmp1)); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (15, ref); + prev = vec_ld (stride, dest); + vec_st (tmp, 0, dest); + tmp0 = vec_perm (ref0, ref1, perm); + tmp = vec_avg (prev, vec_avg (tmp0, tmp1)); + vec_st (tmp, stride, dest); +} + +static void MC_avg_y_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm0, perm1, tmp0, tmp1, tmp, ref0, ref1, prev; + + tmp0 = vec_lvsl (0, ref); + tmp0 = vec_mergeh (tmp0, tmp0); + perm0 = vec_pack ((vector_u16_t)tmp0, (vector_u16_t)tmp0); + tmp1 = vec_lvsl (stride, ref); + tmp1 = vec_mergeh (tmp1, tmp1); + perm1 = vec_pack ((vector_u16_t)tmp1, (vector_u16_t)tmp1); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + tmp0 = vec_perm (ref0, ref1, perm0); + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + prev = vec_ld (0, dest); + tmp1 = vec_perm (ref0, ref1, perm1); + tmp = vec_avg (prev, vec_avg (tmp0, tmp1)); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + tmp0 = vec_perm (ref0, ref1, perm0); + tmp = vec_avg (prev, vec_avg (tmp0, tmp1)); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + tmp1 = vec_perm (ref0, ref1, perm1); + tmp = vec_avg (prev, vec_avg (tmp0, tmp1)); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (7, ref); + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + tmp0 = vec_perm (ref0, ref1, perm0); + tmp = vec_avg (prev, vec_avg (tmp0, tmp1)); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); +} + +static void MC_avg_xy_16_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t permA, permB, ref0, ref1, A, B, avg0, avg1, xor0, xor1, tmp; + vector_u8_t ones, prev; + + ones = vec_splat_u8 (1); + permA = vec_lvsl (0, ref); + permB = vec_add (permA, ones); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + prev = vec_ld (0, dest); + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg1 = vec_avg (A, B); + xor1 = vec_xor (A, B); + tmp = vec_avg (prev, vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1)))); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_st (tmp, 0, dest); + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + tmp = vec_avg (prev, + vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1)))); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + ref += stride; + prev = vec_ld (2*stride, dest); + vec_st (tmp, stride, dest); + dest += 2*stride; + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg1 = vec_avg (A, B); + xor1 = vec_xor (A, B); + tmp = vec_avg (prev, + vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1)))); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (16, ref); + prev = vec_ld (stride, dest); + vec_st (tmp, 0, dest); + A = vec_perm (ref0, ref1, permA); + B = vec_perm (ref0, ref1, permB); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + tmp = vec_avg (prev, vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1)))); + vec_st (tmp, stride, dest); +} + +static void MC_avg_xy_8_altivec (uint8_t * dest, const uint8_t * ref, + const int stride, int height) +{ + vector_u8_t perm0A, perm0B, perm1A, perm1B, ref0, ref1, A, B; + vector_u8_t avg0, avg1, xor0, xor1, tmp, ones, prev; + + ones = vec_splat_u8 (1); + perm0A = vec_lvsl (0, ref); + perm0A = vec_mergeh (perm0A, perm0A); + perm0A = vec_pack ((vector_u16_t)perm0A, (vector_u16_t)perm0A); + perm0B = vec_add (perm0A, ones); + perm1A = vec_lvsl (stride, ref); + perm1A = vec_mergeh (perm1A, perm1A); + perm1A = vec_pack ((vector_u16_t)perm1A, (vector_u16_t)perm1A); + perm1B = vec_add (perm1A, ones); + + height = (height >> 1) - 1; + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + A = vec_perm (ref0, ref1, perm0A); + B = vec_perm (ref0, ref1, perm0B); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + prev = vec_ld (0, dest); + A = vec_perm (ref0, ref1, perm1A); + B = vec_perm (ref0, ref1, perm1B); + avg1 = vec_avg (A, B); + xor1 = vec_xor (A, B); + tmp = vec_avg (prev, vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1)))); + + do { + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + A = vec_perm (ref0, ref1, perm0A); + B = vec_perm (ref0, ref1, perm0B); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + tmp = vec_avg (prev, + vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1)))); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + ref += stride; + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + A = vec_perm (ref0, ref1, perm1A); + B = vec_perm (ref0, ref1, perm1B); + avg1 = vec_avg (A, B); + xor1 = vec_xor (A, B); + tmp = vec_avg (prev, + vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1)))); + } while (--height); + + ref0 = vec_ld (0, ref); + ref1 = vec_ld (8, ref); + prev = vec_ld (stride, dest); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); + dest += stride; + A = vec_perm (ref0, ref1, perm0A); + B = vec_perm (ref0, ref1, perm0B); + avg0 = vec_avg (A, B); + xor0 = vec_xor (A, B); + tmp = vec_avg (prev, vec_sub (vec_avg (avg0, avg1), + vec_and (vec_and (ones, vec_or (xor0, xor1)), + vec_xor (avg0, avg1)))); + vec_ste ((vector_u32_t)tmp, 0, (unsigned int *)dest); + vec_ste ((vector_u32_t)tmp, 4, (unsigned int *)dest); +} + +MPEG2_MC_EXTERN (altivec) + +#endif diff --git a/k9decmpeg/motion_comp_mmx.cpp b/k9decmpeg/motion_comp_mmx.cpp new file mode 100755 index 0000000..97828c4 --- /dev/null +++ b/k9decmpeg/motion_comp_mmx.cpp @@ -0,0 +1,1005 @@ +/* + * motion_comp_mmx.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#ifdef ARCH_X86 + +#include "k9common.h" + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" +#include "mmx.h" + +#define CPU_MMXEXT 0 +#define CPU_3DNOW 1 + + +/* MMX code - needs a rewrite */ + +/* + * Motion Compensation frequently needs to average values using the + * formula (x+y+1)>>1. Both MMXEXT and 3Dnow include one instruction + * to compute this, but it's been left out of classic MMX. + * + * We need to be careful of overflows when doing this computation. + * Rather than unpacking data to 16-bits, which reduces parallelism, + * we use the following formulas: + * + * (x+y)>>1 == (x&y)+((x^y)>>1) + * (x+y+1)>>1 == (x|y)-((x^y)>>1) + */ + +/* some rounding constants */ +static mmx_t mask1 = {0xfefefefefefefefeLL}; +static mmx_t round4 = {0x0002000200020002LL}; + +/* + * This code should probably be compiled with loop unrolling + * (ie, -funroll-loops in gcc)becuase some of the loops + * use a small static number of iterations. This was written + * with the assumption the compiler knows best about when + * unrolling will help + */ + +static inline void mmx_zero_reg () +{ + /* load 0 into mm0 */ + pxor_r2r (mm0, mm0); +} + +static inline void mmx_average_2_U8 (uint8_t * dest, const uint8_t * src1, + const uint8_t * src2) +{ + /* *dest = (*src1 + *src2 + 1)/ 2; */ + + movq_m2r (*src1, mm1); /* load 8 src1 bytes */ + movq_r2r (mm1, mm2); /* copy 8 src1 bytes */ + + movq_m2r (*src2, mm3); /* load 8 src2 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src2 bytes */ + + pxor_r2r (mm1, mm3); /* xor src1 and src2 */ + pand_m2r (mask1, mm3); /* mask lower bits */ + psrlq_i2r (1, mm3); /* /2 */ + por_r2r (mm2, mm4); /* or src1 and src2 */ + psubb_r2r (mm3, mm4); /* subtract subresults */ + movq_r2m (mm4, *dest); /* store result in dest */ +} + +static inline void mmx_interp_average_2_U8 (uint8_t * dest, + const uint8_t * src1, + const uint8_t * src2) +{ + /* *dest = (*dest + (*src1 + *src2 + 1)/ 2 + 1)/ 2; */ + + movq_m2r (*dest, mm1); /* load 8 dest bytes */ + movq_r2r (mm1, mm2); /* copy 8 dest bytes */ + + movq_m2r (*src1, mm3); /* load 8 src1 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src1 bytes */ + + movq_m2r (*src2, mm5); /* load 8 src2 bytes */ + movq_r2r (mm5, mm6); /* copy 8 src2 bytes */ + + pxor_r2r (mm3, mm5); /* xor src1 and src2 */ + pand_m2r (mask1, mm5); /* mask lower bits */ + psrlq_i2r (1, mm5); /* /2 */ + por_r2r (mm4, mm6); /* or src1 and src2 */ + psubb_r2r (mm5, mm6); /* subtract subresults */ + movq_r2r (mm6, mm5); /* copy subresult */ + + pxor_r2r (mm1, mm5); /* xor srcavg and dest */ + pand_m2r (mask1, mm5); /* mask lower bits */ + psrlq_i2r (1, mm5); /* /2 */ + por_r2r (mm2, mm6); /* or srcavg and dest */ + psubb_r2r (mm5, mm6); /* subtract subresults */ + movq_r2m (mm6, *dest); /* store result in dest */ +} + +static inline void mmx_average_4_U8 (uint8_t * dest, const uint8_t * src1, + const uint8_t * src2, + const uint8_t * src3, + const uint8_t * src4) +{ + /* *dest = (*src1 + *src2 + *src3 + *src4 + 2)/ 4; */ + + movq_m2r (*src1, mm1); /* load 8 src1 bytes */ + movq_r2r (mm1, mm2); /* copy 8 src1 bytes */ + + punpcklbw_r2r (mm0, mm1); /* unpack low src1 bytes */ + punpckhbw_r2r (mm0, mm2); /* unpack high src1 bytes */ + + movq_m2r (*src2, mm3); /* load 8 src2 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src2 bytes */ + + punpcklbw_r2r (mm0, mm3); /* unpack low src2 bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high src2 bytes */ + + paddw_r2r (mm3, mm1); /* add lows */ + paddw_r2r (mm4, mm2); /* add highs */ + + /* now have partials in mm1 and mm2 */ + + movq_m2r (*src3, mm3); /* load 8 src3 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src3 bytes */ + + punpcklbw_r2r (mm0, mm3); /* unpack low src3 bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high src3 bytes */ + + paddw_r2r (mm3, mm1); /* add lows */ + paddw_r2r (mm4, mm2); /* add highs */ + + movq_m2r (*src4, mm5); /* load 8 src4 bytes */ + movq_r2r (mm5, mm6); /* copy 8 src4 bytes */ + + punpcklbw_r2r (mm0, mm5); /* unpack low src4 bytes */ + punpckhbw_r2r (mm0, mm6); /* unpack high src4 bytes */ + + paddw_r2r (mm5, mm1); /* add lows */ + paddw_r2r (mm6, mm2); /* add highs */ + + /* now have subtotal in mm1 and mm2 */ + + paddw_m2r (round4, mm1); + psraw_i2r (2, mm1); /* /4 */ + paddw_m2r (round4, mm2); + psraw_i2r (2, mm2); /* /4 */ + + packuswb_r2r (mm2, mm1); /* pack (w/ saturation) */ + movq_r2m (mm1, *dest); /* store result in dest */ +} + +static inline void mmx_interp_average_4_U8 (uint8_t * dest, + const uint8_t * src1, + const uint8_t * src2, + const uint8_t * src3, + const uint8_t * src4) +{ + /* *dest = (*dest + (*src1 + *src2 + *src3 + *src4 + 2)/ 4 + 1)/ 2; */ + + movq_m2r (*src1, mm1); /* load 8 src1 bytes */ + movq_r2r (mm1, mm2); /* copy 8 src1 bytes */ + + punpcklbw_r2r (mm0, mm1); /* unpack low src1 bytes */ + punpckhbw_r2r (mm0, mm2); /* unpack high src1 bytes */ + + movq_m2r (*src2, mm3); /* load 8 src2 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src2 bytes */ + + punpcklbw_r2r (mm0, mm3); /* unpack low src2 bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high src2 bytes */ + + paddw_r2r (mm3, mm1); /* add lows */ + paddw_r2r (mm4, mm2); /* add highs */ + + /* now have partials in mm1 and mm2 */ + + movq_m2r (*src3, mm3); /* load 8 src3 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src3 bytes */ + + punpcklbw_r2r (mm0, mm3); /* unpack low src3 bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high src3 bytes */ + + paddw_r2r (mm3, mm1); /* add lows */ + paddw_r2r (mm4, mm2); /* add highs */ + + movq_m2r (*src4, mm5); /* load 8 src4 bytes */ + movq_r2r (mm5, mm6); /* copy 8 src4 bytes */ + + punpcklbw_r2r (mm0, mm5); /* unpack low src4 bytes */ + punpckhbw_r2r (mm0, mm6); /* unpack high src4 bytes */ + + paddw_r2r (mm5, mm1); /* add lows */ + paddw_r2r (mm6, mm2); /* add highs */ + + paddw_m2r (round4, mm1); + psraw_i2r (2, mm1); /* /4 */ + paddw_m2r (round4, mm2); + psraw_i2r (2, mm2); /* /4 */ + + /* now have subtotal/4 in mm1 and mm2 */ + + movq_m2r (*dest, mm3); /* load 8 dest bytes */ + movq_r2r (mm3, mm4); /* copy 8 dest bytes */ + + packuswb_r2r (mm2, mm1); /* pack (w/ saturation) */ + movq_r2r (mm1,mm2); /* copy subresult */ + + pxor_r2r (mm1, mm3); /* xor srcavg and dest */ + pand_m2r (mask1, mm3); /* mask lower bits */ + psrlq_i2r (1, mm3); /* /2 */ + por_r2r (mm2, mm4); /* or srcavg and dest */ + psubb_r2r (mm3, mm4); /* subtract subresults */ + movq_r2m (mm4, *dest); /* store result in dest */ +} + +/*-----------------------------------------------------------------------*/ + +static inline void MC_avg_mmx (const int width, int height, uint8_t * dest, + const uint8_t * ref, const int stride) +{ + mmx_zero_reg (); + + do { + mmx_average_2_U8 (dest, dest, ref); + + if (width == 16) + mmx_average_2_U8 (dest+8, dest+8, ref+8); + + dest += stride; + ref += stride; + } while (--height); +} + +static void MC_avg_o_16_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg_mmx (16, height, dest, ref, stride); +} + +static void MC_avg_o_8_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg_mmx (8, height, dest, ref, stride); +} + +/*-----------------------------------------------------------------------*/ + +static inline void MC_put_mmx (const int width, int height, uint8_t * dest, + const uint8_t * ref, const int stride) +{ + mmx_zero_reg (); + + do { + movq_m2r (* ref, mm1); /* load 8 ref bytes */ + movq_r2m (mm1,* dest); /* store 8 bytes at curr */ + + if (width == 16) + { + movq_m2r (* (ref+8), mm1); /* load 8 ref bytes */ + movq_r2m (mm1,* (dest+8)); /* store 8 bytes at curr */ + } + + dest += stride; + ref += stride; + } while (--height); +} + +static void MC_put_o_16_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put_mmx (16, height, dest, ref, stride); +} + +static void MC_put_o_8_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put_mmx (8, height, dest, ref, stride); +} + +/*-----------------------------------------------------------------------*/ + +/* Half pixel interpolation in the x direction */ +static inline void MC_avg_x_mmx (const int width, int height, uint8_t * dest, + const uint8_t * ref, const int stride) +{ + mmx_zero_reg (); + + do { + mmx_interp_average_2_U8 (dest, ref, ref+1); + + if (width == 16) + mmx_interp_average_2_U8 (dest+8, ref+8, ref+9); + + dest += stride; + ref += stride; + } while (--height); +} + +static void MC_avg_x_16_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg_x_mmx (16, height, dest, ref, stride); +} + +static void MC_avg_x_8_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg_x_mmx (8, height, dest, ref, stride); +} + +/*-----------------------------------------------------------------------*/ + +static inline void MC_put_x_mmx (const int width, int height, uint8_t * dest, + const uint8_t * ref, const int stride) +{ + mmx_zero_reg (); + + do { + mmx_average_2_U8 (dest, ref, ref+1); + + if (width == 16) + mmx_average_2_U8 (dest+8, ref+8, ref+9); + + dest += stride; + ref += stride; + } while (--height); +} + +static void MC_put_x_16_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put_x_mmx (16, height, dest, ref, stride); +} + +static void MC_put_x_8_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put_x_mmx (8, height, dest, ref, stride); +} + +/*-----------------------------------------------------------------------*/ + +static inline void MC_avg_xy_mmx (const int width, int height, uint8_t * dest, + const uint8_t * ref, const int stride) +{ + const uint8_t * ref_next = ref + stride; + + mmx_zero_reg (); + + do { + mmx_interp_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1); + + if (width == 16) + mmx_interp_average_4_U8 (dest+8, ref+8, ref+9, + ref_next+8, ref_next+9); + + dest += stride; + ref += stride; + ref_next += stride; + } while (--height); +} + +static void MC_avg_xy_16_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg_xy_mmx (16, height, dest, ref, stride); +} + +static void MC_avg_xy_8_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg_xy_mmx (8, height, dest, ref, stride); +} + +/*-----------------------------------------------------------------------*/ + +static inline void MC_put_xy_mmx (const int width, int height, uint8_t * dest, + const uint8_t * ref, const int stride) +{ + const uint8_t * ref_next = ref + stride; + + mmx_zero_reg (); + + do { + mmx_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1); + + if (width == 16) + mmx_average_4_U8 (dest+8, ref+8, ref+9, ref_next+8, ref_next+9); + + dest += stride; + ref += stride; + ref_next += stride; + } while (--height); +} + +static void MC_put_xy_16_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put_xy_mmx (16, height, dest, ref, stride); +} + +static void MC_put_xy_8_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put_xy_mmx (8, height, dest, ref, stride); +} + +/*-----------------------------------------------------------------------*/ + +static inline void MC_avg_y_mmx (const int width, int height, uint8_t * dest, + const uint8_t * ref, const int stride) +{ + const uint8_t * ref_next = ref + stride; + + mmx_zero_reg (); + + do { + mmx_interp_average_2_U8 (dest, ref, ref_next); + + if (width == 16) + mmx_interp_average_2_U8 (dest+8, ref+8, ref_next+8); + + dest += stride; + ref += stride; + ref_next += stride; + } while (--height); +} + +static void MC_avg_y_16_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg_y_mmx (16, height, dest, ref, stride); +} + +static void MC_avg_y_8_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg_y_mmx (8, height, dest, ref, stride); +} + +/*-----------------------------------------------------------------------*/ + +static inline void MC_put_y_mmx (const int width, int height, uint8_t * dest, + const uint8_t * ref, const int stride) +{ + const uint8_t * ref_next = ref + stride; + + mmx_zero_reg (); + + do { + mmx_average_2_U8 (dest, ref, ref_next); + + if (width == 16) + mmx_average_2_U8 (dest+8, ref+8, ref_next+8); + + dest += stride; + ref += stride; + ref_next += stride; + } while (--height); +} + +static void MC_put_y_16_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put_y_mmx (16, height, dest, ref, stride); +} + +static void MC_put_y_8_mmx (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put_y_mmx (8, height, dest, ref, stride); +} + + +MPEG2_MC_EXTERN (mmx) + + + + + + + +/* CPU_MMXEXT/CPU_3DNOW adaptation layer */ + +#define pavg_r2r(src,dest) \ +do { \ + if (cpu == CPU_MMXEXT) \ + pavgb_r2r (src, dest); \ + else \ + pavgusb_r2r (src, dest); \ +} while (0) + +#define pavg_m2r(src,dest) \ +do { \ + if (cpu == CPU_MMXEXT) \ + pavgb_m2r (src, dest); \ + else \ + pavgusb_m2r (src, dest); \ +} while (0) + + +/* CPU_MMXEXT code */ + + +static inline void MC_put1_8 (int height, uint8_t * dest, const uint8_t * ref, + const int stride) +{ + do { + movq_m2r (*ref, mm0); + movq_r2m (mm0, *dest); + ref += stride; + dest += stride; + } while (--height); +} + +static inline void MC_put1_16 (int height, uint8_t * dest, const uint8_t * ref, + const int stride) +{ + do { + movq_m2r (*ref, mm0); + movq_m2r (*(ref+8), mm1); + ref += stride; + movq_r2m (mm0, *dest); + movq_r2m (mm1, *(dest+8)); + dest += stride; + } while (--height); +} + +static inline void MC_avg1_8 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int cpu) +{ + do { + movq_m2r (*ref, mm0); + pavg_m2r (*dest, mm0); + ref += stride; + movq_r2m (mm0, *dest); + dest += stride; + } while (--height); +} + +static inline void MC_avg1_16 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int cpu) +{ + do { + movq_m2r (*ref, mm0); + movq_m2r (*(ref+8), mm1); + pavg_m2r (*dest, mm0); + pavg_m2r (*(dest+8), mm1); + movq_r2m (mm0, *dest); + ref += stride; + movq_r2m (mm1, *(dest+8)); + dest += stride; + } while (--height); +} + +static inline void MC_put2_8 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int offset, + const int cpu) +{ + do { + movq_m2r (*ref, mm0); + pavg_m2r (*(ref+offset), mm0); + ref += stride; + movq_r2m (mm0, *dest); + dest += stride; + } while (--height); +} + +static inline void MC_put2_16 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int offset, + const int cpu) +{ + do { + movq_m2r (*ref, mm0); + movq_m2r (*(ref+8), mm1); + pavg_m2r (*(ref+offset), mm0); + pavg_m2r (*(ref+offset+8), mm1); + movq_r2m (mm0, *dest); + ref += stride; + movq_r2m (mm1, *(dest+8)); + dest += stride; + } while (--height); +} + +static inline void MC_avg2_8 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int offset, + const int cpu) +{ + do { + movq_m2r (*ref, mm0); + pavg_m2r (*(ref+offset), mm0); + pavg_m2r (*dest, mm0); + ref += stride; + movq_r2m (mm0, *dest); + dest += stride; + } while (--height); +} + +static inline void MC_avg2_16 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int offset, + const int cpu) +{ + do { + movq_m2r (*ref, mm0); + movq_m2r (*(ref+8), mm1); + pavg_m2r (*(ref+offset), mm0); + pavg_m2r (*(ref+offset+8), mm1); + pavg_m2r (*dest, mm0); + pavg_m2r (*(dest+8), mm1); + ref += stride; + movq_r2m (mm0, *dest); + movq_r2m (mm1, *(dest+8)); + dest += stride; + } while (--height); +} + +static mmx_t mask_one = {0x0101010101010101LL}; + +static inline void MC_put4_8 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int cpu) +{ + movq_m2r (*ref, mm0); + movq_m2r (*(ref+1), mm1); + movq_r2r (mm0, mm7); + pxor_r2r (mm1, mm7); + pavg_r2r (mm1, mm0); + ref += stride; + + do { + movq_m2r (*ref, mm2); + movq_r2r (mm0, mm5); + + movq_m2r (*(ref+1), mm3); + movq_r2r (mm2, mm6); + + pxor_r2r (mm3, mm6); + pavg_r2r (mm3, mm2); + + por_r2r (mm6, mm7); + pxor_r2r (mm2, mm5); + + pand_r2r (mm5, mm7); + pavg_r2r (mm2, mm0); + + pand_m2r (mask_one, mm7); + + psubusb_r2r (mm7, mm0); + + ref += stride; + movq_r2m (mm0, *dest); + dest += stride; + + movq_r2r (mm6, mm7); /* unroll ! */ + movq_r2r (mm2, mm0); /* unroll ! */ + } while (--height); +} + +static inline void MC_put4_16 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int cpu) +{ + do { + movq_m2r (*ref, mm0); + movq_m2r (*(ref+stride+1), mm1); + movq_r2r (mm0, mm7); + movq_m2r (*(ref+1), mm2); + pxor_r2r (mm1, mm7); + movq_m2r (*(ref+stride), mm3); + movq_r2r (mm2, mm6); + pxor_r2r (mm3, mm6); + pavg_r2r (mm1, mm0); + pavg_r2r (mm3, mm2); + por_r2r (mm6, mm7); + movq_r2r (mm0, mm6); + pxor_r2r (mm2, mm6); + pand_r2r (mm6, mm7); + pand_m2r (mask_one, mm7); + pavg_r2r (mm2, mm0); + psubusb_r2r (mm7, mm0); + movq_r2m (mm0, *dest); + + movq_m2r (*(ref+8), mm0); + movq_m2r (*(ref+stride+9), mm1); + movq_r2r (mm0, mm7); + movq_m2r (*(ref+9), mm2); + pxor_r2r (mm1, mm7); + movq_m2r (*(ref+stride+8), mm3); + movq_r2r (mm2, mm6); + pxor_r2r (mm3, mm6); + pavg_r2r (mm1, mm0); + pavg_r2r (mm3, mm2); + por_r2r (mm6, mm7); + movq_r2r (mm0, mm6); + pxor_r2r (mm2, mm6); + pand_r2r (mm6, mm7); + pand_m2r (mask_one, mm7); + pavg_r2r (mm2, mm0); + psubusb_r2r (mm7, mm0); + ref += stride; + movq_r2m (mm0, *(dest+8)); + dest += stride; + } while (--height); +} + +static inline void MC_avg4_8 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int cpu) +{ + do { + movq_m2r (*ref, mm0); + movq_m2r (*(ref+stride+1), mm1); + movq_r2r (mm0, mm7); + movq_m2r (*(ref+1), mm2); + pxor_r2r (mm1, mm7); + movq_m2r (*(ref+stride), mm3); + movq_r2r (mm2, mm6); + pxor_r2r (mm3, mm6); + pavg_r2r (mm1, mm0); + pavg_r2r (mm3, mm2); + por_r2r (mm6, mm7); + movq_r2r (mm0, mm6); + pxor_r2r (mm2, mm6); + pand_r2r (mm6, mm7); + pand_m2r (mask_one, mm7); + pavg_r2r (mm2, mm0); + psubusb_r2r (mm7, mm0); + movq_m2r (*dest, mm1); + pavg_r2r (mm1, mm0); + ref += stride; + movq_r2m (mm0, *dest); + dest += stride; + } while (--height); +} + +static inline void MC_avg4_16 (int height, uint8_t * dest, const uint8_t * ref, + const int stride, const int cpu) +{ + do { + movq_m2r (*ref, mm0); + movq_m2r (*(ref+stride+1), mm1); + movq_r2r (mm0, mm7); + movq_m2r (*(ref+1), mm2); + pxor_r2r (mm1, mm7); + movq_m2r (*(ref+stride), mm3); + movq_r2r (mm2, mm6); + pxor_r2r (mm3, mm6); + pavg_r2r (mm1, mm0); + pavg_r2r (mm3, mm2); + por_r2r (mm6, mm7); + movq_r2r (mm0, mm6); + pxor_r2r (mm2, mm6); + pand_r2r (mm6, mm7); + pand_m2r (mask_one, mm7); + pavg_r2r (mm2, mm0); + psubusb_r2r (mm7, mm0); + movq_m2r (*dest, mm1); + pavg_r2r (mm1, mm0); + movq_r2m (mm0, *dest); + + movq_m2r (*(ref+8), mm0); + movq_m2r (*(ref+stride+9), mm1); + movq_r2r (mm0, mm7); + movq_m2r (*(ref+9), mm2); + pxor_r2r (mm1, mm7); + movq_m2r (*(ref+stride+8), mm3); + movq_r2r (mm2, mm6); + pxor_r2r (mm3, mm6); + pavg_r2r (mm1, mm0); + pavg_r2r (mm3, mm2); + por_r2r (mm6, mm7); + movq_r2r (mm0, mm6); + pxor_r2r (mm2, mm6); + pand_r2r (mm6, mm7); + pand_m2r (mask_one, mm7); + pavg_r2r (mm2, mm0); + psubusb_r2r (mm7, mm0); + movq_m2r (*(dest+8), mm1); + pavg_r2r (mm1, mm0); + ref += stride; + movq_r2m (mm0, *(dest+8)); + dest += stride; + } while (--height); +} + +static void MC_avg_o_16_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg1_16 (height, dest, ref, stride, CPU_MMXEXT); +} + +static void MC_avg_o_8_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg1_8 (height, dest, ref, stride, CPU_MMXEXT); +} + +static void MC_put_o_16_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put1_16 (height, dest, ref, stride); +} + +static void MC_put_o_8_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put1_8 (height, dest, ref, stride); +} + +static void MC_avg_x_16_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg2_16 (height, dest, ref, stride, 1, CPU_MMXEXT); +} + +static void MC_avg_x_8_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg2_8 (height, dest, ref, stride, 1, CPU_MMXEXT); +} + +static void MC_put_x_16_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put2_16 (height, dest, ref, stride, 1, CPU_MMXEXT); +} + +static void MC_put_x_8_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put2_8 (height, dest, ref, stride, 1, CPU_MMXEXT); +} + +static void MC_avg_y_16_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg2_16 (height, dest, ref, stride, stride, CPU_MMXEXT); +} + +static void MC_avg_y_8_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg2_8 (height, dest, ref, stride, stride, CPU_MMXEXT); +} + +static void MC_put_y_16_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put2_16 (height, dest, ref, stride, stride, CPU_MMXEXT); +} + +static void MC_put_y_8_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put2_8 (height, dest, ref, stride, stride, CPU_MMXEXT); +} + +static void MC_avg_xy_16_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg4_16 (height, dest, ref, stride, CPU_MMXEXT); +} + +static void MC_avg_xy_8_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg4_8 (height, dest, ref, stride, CPU_MMXEXT); +} + +static void MC_put_xy_16_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put4_16 (height, dest, ref, stride, CPU_MMXEXT); +} + +static void MC_put_xy_8_mmxext (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put4_8 (height, dest, ref, stride, CPU_MMXEXT); +} + + +MPEG2_MC_EXTERN (mmxext) + + + +static void MC_avg_o_16_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg1_16 (height, dest, ref, stride, CPU_3DNOW); +} + +static void MC_avg_o_8_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg1_8 (height, dest, ref, stride, CPU_3DNOW); +} + +static void MC_put_o_16_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put1_16 (height, dest, ref, stride); +} + +static void MC_put_o_8_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put1_8 (height, dest, ref, stride); +} + +static void MC_avg_x_16_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg2_16 (height, dest, ref, stride, 1, CPU_3DNOW); +} + +static void MC_avg_x_8_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg2_8 (height, dest, ref, stride, 1, CPU_3DNOW); +} + +static void MC_put_x_16_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put2_16 (height, dest, ref, stride, 1, CPU_3DNOW); +} + +static void MC_put_x_8_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put2_8 (height, dest, ref, stride, 1, CPU_3DNOW); +} + +static void MC_avg_y_16_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg2_16 (height, dest, ref, stride, stride, CPU_3DNOW); +} + +static void MC_avg_y_8_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg2_8 (height, dest, ref, stride, stride, CPU_3DNOW); +} + +static void MC_put_y_16_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put2_16 (height, dest, ref, stride, stride, CPU_3DNOW); +} + +static void MC_put_y_8_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put2_8 (height, dest, ref, stride, stride, CPU_3DNOW); +} + +static void MC_avg_xy_16_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg4_16 (height, dest, ref, stride, CPU_3DNOW); +} + +static void MC_avg_xy_8_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_avg4_8 (height, dest, ref, stride, CPU_3DNOW); +} + +static void MC_put_xy_16_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put4_16 (height, dest, ref, stride, CPU_3DNOW); +} + +static void MC_put_xy_8_3dnow (uint8_t * dest, const uint8_t * ref, + int stride, int height) +{ + MC_put4_8 (height, dest, ref, stride, CPU_3DNOW); +} + + +MPEG2_MC_EXTERN (3dnow) + +#endif diff --git a/k9decmpeg/motion_comp_vis.cpp b/k9decmpeg/motion_comp_vis.cpp new file mode 100755 index 0000000..218af8a --- /dev/null +++ b/k9decmpeg/motion_comp_vis.cpp @@ -0,0 +1,2061 @@ +/* + * motion_comp_vis.c + * Copyright (C) 2003 David S. Miller + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#ifdef ARCH_SPARC + +#include "k9common.h" + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" +#include "vis.h" + +/* The trick used in some of this file is the formula from the MMX + * motion comp code, which is: + * + * (x+y+1)>>1 == (x|y)-((x^y)>>1) + * + * This allows us to average 8 bytes at a time in a 64-bit FPU reg. + * We avoid overflows by masking before we do the shift, and we + * implement the shift by multiplying by 1/2 using mul8x16. So in + * VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask + * of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and + * the value 0x80808080 is in f8): + * + * fxor f0, f2, f10 + * fand f10, f4, f10 + * fmul8x16 f8, f10, f10 + * fand f10, f6, f10 + * for f0, f2, f12 + * fpsub16 f12, f10, f10 + */ + +#define DUP4(x) {x, x, x, x} +#define DUP8(x) {x, x, x, x, x, x, x, x} +static const int16_t constants1[] ATTR_ALIGN(8) = DUP4 (1); +static const int16_t constants2[] ATTR_ALIGN(8) = DUP4 (2); +static const int16_t constants3[] ATTR_ALIGN(8) = DUP4 (3); +static const int16_t constants6[] ATTR_ALIGN(8) = DUP4 (6); +static const int8_t constants_fe[] ATTR_ALIGN(8) = DUP8 (0xfe); +static const int8_t constants_7f[] ATTR_ALIGN(8) = DUP8 (0x7f); +static const int8_t constants128[] ATTR_ALIGN(8) = DUP8 (128); +static const int16_t constants256_512[] ATTR_ALIGN(8) = + {256, 512, 256, 512}; +static const int16_t constants256_1024[] ATTR_ALIGN(8) = + {256, 1024, 256, 1024}; + +#define REF_0 0 +#define REF_0_1 1 +#define REF_2 2 +#define REF_2_1 3 +#define REF_4 4 +#define REF_4_1 5 +#define REF_6 6 +#define REF_6_1 7 +#define REF_S0 8 +#define REF_S0_1 9 +#define REF_S2 10 +#define REF_S2_1 11 +#define REF_S4 12 +#define REF_S4_1 13 +#define REF_S6 14 +#define REF_S6_1 15 +#define DST_0 16 +#define DST_1 17 +#define DST_2 18 +#define DST_3 19 +#define CONST_1 20 +#define CONST_2 20 +#define CONST_3 20 +#define CONST_6 20 +#define MASK_fe 20 +#define CONST_128 22 +#define CONST_256 22 +#define CONST_512 22 +#define CONST_1024 22 +#define TMP0 24 +#define TMP1 25 +#define TMP2 26 +#define TMP3 27 +#define TMP4 28 +#define TMP5 29 +#define ZERO 30 +#define MASK_7f 30 + +#define TMP6 32 +#define TMP8 34 +#define TMP10 36 +#define TMP12 38 +#define TMP14 40 +#define TMP16 42 +#define TMP18 44 +#define TMP20 46 +#define TMP22 48 +#define TMP24 50 +#define TMP26 52 +#define TMP28 54 +#define TMP30 56 +#define TMP32 58 + +static void MC_put_o_16_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + int offset; + + ref = vis_alignaddr(ref); + offset = (ref != _ref) ? 16 : 0; + do { /* 5 cycles */ + vis_ld64(ref[0], TMP0); + + vis_ld64_2(ref, 8, TMP2); + + vis_ld64_2(ref, offset, TMP4); + ref += stride; + + vis_faligndata(TMP0, TMP2, REF_0); + vis_st64(REF_0, dest[0]); + + vis_faligndata(TMP2, TMP4, REF_2); + vis_st64_2(REF_2, dest, 8); + dest += stride; + } while (--height); +} + +static void MC_put_o_8_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + int offset; + + ref = vis_alignaddr(ref); + offset = (ref != _ref) ? 8 : 0; + do { /* 4 cycles */ + vis_ld64(ref[0], TMP0); + + vis_ld64_2(ref, offset, TMP2); + ref += stride; + + /* stall */ + + vis_faligndata(TMP0, TMP2, REF_0); + vis_st64(REF_0, dest[0]); + dest += stride; + } while (--height); +} + + +static void MC_avg_o_16_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + int stride_8 = stride + 8; + int offset; + + ref = vis_alignaddr(ref); + offset = (ref != _ref) ? 16 : 0; + + vis_ld64(ref[0], TMP0); + + vis_ld64(ref[8], TMP2); + + vis_ld64_2(ref, offset, TMP4); + + vis_ld64(dest[0], DST_0); + + vis_ld64(dest[8], DST_2); + + vis_ld64(constants_fe[0], MASK_fe); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64(constants_7f[0], MASK_7f); + vis_faligndata(TMP2, TMP4, REF_2); + + vis_ld64(constants128[0], CONST_128); + + ref += stride; + height = (height >> 1) - 1; + + do { /* 24 cycles */ + vis_ld64(ref[0], TMP0); + vis_xor(DST_0, REF_0, TMP6); + + vis_ld64_2(ref, 8, TMP2); + vis_and(TMP6, MASK_fe, TMP6); + + vis_ld64_2(ref, offset, TMP4); + ref += stride; + vis_mul8x16(CONST_128, TMP6, TMP6); + vis_xor(DST_2, REF_2, TMP8); + + vis_and(TMP8, MASK_fe, TMP8); + + vis_or(DST_0, REF_0, TMP10); + vis_ld64_2(dest, stride, DST_0); + vis_mul8x16(CONST_128, TMP8, TMP8); + + vis_or(DST_2, REF_2, TMP12); + vis_ld64_2(dest, stride_8, DST_2); + + vis_ld64(ref[0], TMP14); + vis_and(TMP6, MASK_7f, TMP6); + + vis_and(TMP8, MASK_7f, TMP8); + + vis_psub16(TMP10, TMP6, TMP6); + vis_st64(TMP6, dest[0]); + + vis_psub16(TMP12, TMP8, TMP8); + vis_st64_2(TMP8, dest, 8); + + dest += stride; + vis_ld64_2(ref, 8, TMP16); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64_2(ref, offset, TMP18); + vis_faligndata(TMP2, TMP4, REF_2); + ref += stride; + + vis_xor(DST_0, REF_0, TMP20); + + vis_and(TMP20, MASK_fe, TMP20); + + vis_xor(DST_2, REF_2, TMP22); + vis_mul8x16(CONST_128, TMP20, TMP20); + + vis_and(TMP22, MASK_fe, TMP22); + + vis_or(DST_0, REF_0, TMP24); + vis_mul8x16(CONST_128, TMP22, TMP22); + + vis_or(DST_2, REF_2, TMP26); + + vis_ld64_2(dest, stride, DST_0); + vis_faligndata(TMP14, TMP16, REF_0); + + vis_ld64_2(dest, stride_8, DST_2); + vis_faligndata(TMP16, TMP18, REF_2); + + vis_and(TMP20, MASK_7f, TMP20); + + vis_and(TMP22, MASK_7f, TMP22); + + vis_psub16(TMP24, TMP20, TMP20); + vis_st64(TMP20, dest[0]); + + vis_psub16(TMP26, TMP22, TMP22); + vis_st64_2(TMP22, dest, 8); + dest += stride; + } while (--height); + + vis_ld64(ref[0], TMP0); + vis_xor(DST_0, REF_0, TMP6); + + vis_ld64_2(ref, 8, TMP2); + vis_and(TMP6, MASK_fe, TMP6); + + vis_ld64_2(ref, offset, TMP4); + vis_mul8x16(CONST_128, TMP6, TMP6); + vis_xor(DST_2, REF_2, TMP8); + + vis_and(TMP8, MASK_fe, TMP8); + + vis_or(DST_0, REF_0, TMP10); + vis_ld64_2(dest, stride, DST_0); + vis_mul8x16(CONST_128, TMP8, TMP8); + + vis_or(DST_2, REF_2, TMP12); + vis_ld64_2(dest, stride_8, DST_2); + + vis_ld64(ref[0], TMP14); + vis_and(TMP6, MASK_7f, TMP6); + + vis_and(TMP8, MASK_7f, TMP8); + + vis_psub16(TMP10, TMP6, TMP6); + vis_st64(TMP6, dest[0]); + + vis_psub16(TMP12, TMP8, TMP8); + vis_st64_2(TMP8, dest, 8); + + dest += stride; + vis_faligndata(TMP0, TMP2, REF_0); + + vis_faligndata(TMP2, TMP4, REF_2); + + vis_xor(DST_0, REF_0, TMP20); + + vis_and(TMP20, MASK_fe, TMP20); + + vis_xor(DST_2, REF_2, TMP22); + vis_mul8x16(CONST_128, TMP20, TMP20); + + vis_and(TMP22, MASK_fe, TMP22); + + vis_or(DST_0, REF_0, TMP24); + vis_mul8x16(CONST_128, TMP22, TMP22); + + vis_or(DST_2, REF_2, TMP26); + + vis_and(TMP20, MASK_7f, TMP20); + + vis_and(TMP22, MASK_7f, TMP22); + + vis_psub16(TMP24, TMP20, TMP20); + vis_st64(TMP20, dest[0]); + + vis_psub16(TMP26, TMP22, TMP22); + vis_st64_2(TMP22, dest, 8); +} + +static void MC_avg_o_8_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + int offset; + + ref = vis_alignaddr(ref); + offset = (ref != _ref) ? 8 : 0; + + vis_ld64(ref[0], TMP0); + + vis_ld64_2(ref, offset, TMP2); + + vis_ld64(dest[0], DST_0); + + vis_ld64(constants_fe[0], MASK_fe); + + vis_ld64(constants_7f[0], MASK_7f); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64(constants128[0], CONST_128); + + ref += stride; + height = (height >> 1) - 1; + + do { /* 12 cycles */ + vis_ld64(ref[0], TMP0); + vis_xor(DST_0, REF_0, TMP4); + + vis_ld64_2(ref, offset, TMP2); + vis_and(TMP4, MASK_fe, TMP4); + + vis_or(DST_0, REF_0, TMP6); + vis_ld64_2(dest, stride, DST_0); + ref += stride; + vis_mul8x16(CONST_128, TMP4, TMP4); + + vis_ld64(ref[0], TMP12); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64_2(ref, offset, TMP2); + vis_xor(DST_0, REF_0, TMP0); + ref += stride; + + vis_and(TMP0, MASK_fe, TMP0); + + vis_and(TMP4, MASK_7f, TMP4); + + vis_psub16(TMP6, TMP4, TMP4); + vis_st64(TMP4, dest[0]); + dest += stride; + vis_mul8x16(CONST_128, TMP0, TMP0); + + vis_or(DST_0, REF_0, TMP6); + vis_ld64_2(dest, stride, DST_0); + + vis_faligndata(TMP12, TMP2, REF_0); + + vis_and(TMP0, MASK_7f, TMP0); + + vis_psub16(TMP6, TMP0, TMP4); + vis_st64(TMP4, dest[0]); + dest += stride; + } while (--height); + + vis_ld64(ref[0], TMP0); + vis_xor(DST_0, REF_0, TMP4); + + vis_ld64_2(ref, offset, TMP2); + vis_and(TMP4, MASK_fe, TMP4); + + vis_or(DST_0, REF_0, TMP6); + vis_ld64_2(dest, stride, DST_0); + vis_mul8x16(CONST_128, TMP4, TMP4); + + vis_faligndata(TMP0, TMP2, REF_0); + + vis_xor(DST_0, REF_0, TMP0); + + vis_and(TMP0, MASK_fe, TMP0); + + vis_and(TMP4, MASK_7f, TMP4); + + vis_psub16(TMP6, TMP4, TMP4); + vis_st64(TMP4, dest[0]); + dest += stride; + vis_mul8x16(CONST_128, TMP0, TMP0); + + vis_or(DST_0, REF_0, TMP6); + + vis_and(TMP0, MASK_7f, TMP0); + + vis_psub16(TMP6, TMP0, TMP4); + vis_st64(TMP4, dest[0]); +} + +static void MC_put_x_16_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + unsigned long off = (unsigned long) ref & 0x7; + unsigned long off_plus_1 = off + 1; + + ref = vis_alignaddr(ref); + + vis_ld64(ref[0], TMP0); + + vis_ld64_2(ref, 8, TMP2); + + vis_ld64_2(ref, 16, TMP4); + + vis_ld64(constants_fe[0], MASK_fe); + + vis_ld64(constants_7f[0], MASK_7f); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64(constants128[0], CONST_128); + vis_faligndata(TMP2, TMP4, REF_4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_2); + vis_faligndata(TMP2, TMP4, REF_6); + } else { + vis_src1(TMP2, REF_2); + vis_src1(TMP4, REF_6); + } + + ref += stride; + height = (height >> 1) - 1; + + do { /* 34 cycles */ + vis_ld64(ref[0], TMP0); + vis_xor(REF_0, REF_2, TMP6); + + vis_ld64_2(ref, 8, TMP2); + vis_xor(REF_4, REF_6, TMP8); + + vis_ld64_2(ref, 16, TMP4); + vis_and(TMP6, MASK_fe, TMP6); + ref += stride; + + vis_ld64(ref[0], TMP14); + vis_mul8x16(CONST_128, TMP6, TMP6); + vis_and(TMP8, MASK_fe, TMP8); + + vis_ld64_2(ref, 8, TMP16); + vis_mul8x16(CONST_128, TMP8, TMP8); + vis_or(REF_0, REF_2, TMP10); + + vis_ld64_2(ref, 16, TMP18); + ref += stride; + vis_or(REF_4, REF_6, TMP12); + + vis_alignaddr_g0((void *)off); + + vis_faligndata(TMP0, TMP2, REF_0); + + vis_faligndata(TMP2, TMP4, REF_4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_2); + vis_faligndata(TMP2, TMP4, REF_6); + } else { + vis_src1(TMP2, REF_2); + vis_src1(TMP4, REF_6); + } + + vis_and(TMP6, MASK_7f, TMP6); + + vis_and(TMP8, MASK_7f, TMP8); + + vis_psub16(TMP10, TMP6, TMP6); + vis_st64(TMP6, dest[0]); + + vis_psub16(TMP12, TMP8, TMP8); + vis_st64_2(TMP8, dest, 8); + dest += stride; + + vis_xor(REF_0, REF_2, TMP6); + + vis_xor(REF_4, REF_6, TMP8); + + vis_and(TMP6, MASK_fe, TMP6); + + vis_mul8x16(CONST_128, TMP6, TMP6); + vis_and(TMP8, MASK_fe, TMP8); + + vis_mul8x16(CONST_128, TMP8, TMP8); + vis_or(REF_0, REF_2, TMP10); + + vis_or(REF_4, REF_6, TMP12); + + vis_alignaddr_g0((void *)off); + + vis_faligndata(TMP14, TMP16, REF_0); + + vis_faligndata(TMP16, TMP18, REF_4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP14, TMP16, REF_2); + vis_faligndata(TMP16, TMP18, REF_6); + } else { + vis_src1(TMP16, REF_2); + vis_src1(TMP18, REF_6); + } + + vis_and(TMP6, MASK_7f, TMP6); + + vis_and(TMP8, MASK_7f, TMP8); + + vis_psub16(TMP10, TMP6, TMP6); + vis_st64(TMP6, dest[0]); + + vis_psub16(TMP12, TMP8, TMP8); + vis_st64_2(TMP8, dest, 8); + dest += stride; + } while (--height); + + vis_ld64(ref[0], TMP0); + vis_xor(REF_0, REF_2, TMP6); + + vis_ld64_2(ref, 8, TMP2); + vis_xor(REF_4, REF_6, TMP8); + + vis_ld64_2(ref, 16, TMP4); + vis_and(TMP6, MASK_fe, TMP6); + + vis_mul8x16(CONST_128, TMP6, TMP6); + vis_and(TMP8, MASK_fe, TMP8); + + vis_mul8x16(CONST_128, TMP8, TMP8); + vis_or(REF_0, REF_2, TMP10); + + vis_or(REF_4, REF_6, TMP12); + + vis_alignaddr_g0((void *)off); + + vis_faligndata(TMP0, TMP2, REF_0); + + vis_faligndata(TMP2, TMP4, REF_4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_2); + vis_faligndata(TMP2, TMP4, REF_6); + } else { + vis_src1(TMP2, REF_2); + vis_src1(TMP4, REF_6); + } + + vis_and(TMP6, MASK_7f, TMP6); + + vis_and(TMP8, MASK_7f, TMP8); + + vis_psub16(TMP10, TMP6, TMP6); + vis_st64(TMP6, dest[0]); + + vis_psub16(TMP12, TMP8, TMP8); + vis_st64_2(TMP8, dest, 8); + dest += stride; + + vis_xor(REF_0, REF_2, TMP6); + + vis_xor(REF_4, REF_6, TMP8); + + vis_and(TMP6, MASK_fe, TMP6); + + vis_mul8x16(CONST_128, TMP6, TMP6); + vis_and(TMP8, MASK_fe, TMP8); + + vis_mul8x16(CONST_128, TMP8, TMP8); + vis_or(REF_0, REF_2, TMP10); + + vis_or(REF_4, REF_6, TMP12); + + vis_and(TMP6, MASK_7f, TMP6); + + vis_and(TMP8, MASK_7f, TMP8); + + vis_psub16(TMP10, TMP6, TMP6); + vis_st64(TMP6, dest[0]); + + vis_psub16(TMP12, TMP8, TMP8); + vis_st64_2(TMP8, dest, 8); +} + +static void MC_put_x_8_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + unsigned long off = (unsigned long) ref & 0x7; + unsigned long off_plus_1 = off + 1; + + ref = vis_alignaddr(ref); + + vis_ld64(ref[0], TMP0); + + vis_ld64(ref[8], TMP2); + + vis_ld64(constants_fe[0], MASK_fe); + + vis_ld64(constants_7f[0], MASK_7f); + + vis_ld64(constants128[0], CONST_128); + vis_faligndata(TMP0, TMP2, REF_0); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_2); + } else { + vis_src1(TMP2, REF_2); + } + + ref += stride; + height = (height >> 1) - 1; + + do { /* 20 cycles */ + vis_ld64(ref[0], TMP0); + vis_xor(REF_0, REF_2, TMP4); + + vis_ld64_2(ref, 8, TMP2); + vis_and(TMP4, MASK_fe, TMP4); + ref += stride; + + vis_ld64(ref[0], TMP8); + vis_or(REF_0, REF_2, TMP6); + vis_mul8x16(CONST_128, TMP4, TMP4); + + vis_alignaddr_g0((void *)off); + + vis_ld64_2(ref, 8, TMP10); + ref += stride; + vis_faligndata(TMP0, TMP2, REF_0); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_2); + } else { + vis_src1(TMP2, REF_2); + } + + vis_and(TMP4, MASK_7f, TMP4); + + vis_psub16(TMP6, TMP4, DST_0); + vis_st64(DST_0, dest[0]); + dest += stride; + + vis_xor(REF_0, REF_2, TMP12); + + vis_and(TMP12, MASK_fe, TMP12); + + vis_or(REF_0, REF_2, TMP14); + vis_mul8x16(CONST_128, TMP12, TMP12); + + vis_alignaddr_g0((void *)off); + vis_faligndata(TMP8, TMP10, REF_0); + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP8, TMP10, REF_2); + } else { + vis_src1(TMP10, REF_2); + } + + vis_and(TMP12, MASK_7f, TMP12); + + vis_psub16(TMP14, TMP12, DST_0); + vis_st64(DST_0, dest[0]); + dest += stride; + } while (--height); + + vis_ld64(ref[0], TMP0); + vis_xor(REF_0, REF_2, TMP4); + + vis_ld64_2(ref, 8, TMP2); + vis_and(TMP4, MASK_fe, TMP4); + + vis_or(REF_0, REF_2, TMP6); + vis_mul8x16(CONST_128, TMP4, TMP4); + + vis_alignaddr_g0((void *)off); + + vis_faligndata(TMP0, TMP2, REF_0); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_2); + } else { + vis_src1(TMP2, REF_2); + } + + vis_and(TMP4, MASK_7f, TMP4); + + vis_psub16(TMP6, TMP4, DST_0); + vis_st64(DST_0, dest[0]); + dest += stride; + + vis_xor(REF_0, REF_2, TMP12); + + vis_and(TMP12, MASK_fe, TMP12); + + vis_or(REF_0, REF_2, TMP14); + vis_mul8x16(CONST_128, TMP12, TMP12); + + vis_and(TMP12, MASK_7f, TMP12); + + vis_psub16(TMP14, TMP12, DST_0); + vis_st64(DST_0, dest[0]); + dest += stride; +} + +static void MC_avg_x_16_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + unsigned long off = (unsigned long) ref & 0x7; + unsigned long off_plus_1 = off + 1; + + vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); + + vis_ld64(constants3[0], CONST_3); + vis_fzero(ZERO); + vis_ld64(constants256_512[0], CONST_256); + + ref = vis_alignaddr(ref); + do { /* 26 cycles */ + vis_ld64(ref[0], TMP0); + + vis_ld64(ref[8], TMP2); + + vis_alignaddr_g0((void *)off); + + vis_ld64(ref[16], TMP4); + + vis_ld64(dest[0], DST_0); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64(dest[8], DST_2); + vis_faligndata(TMP2, TMP4, REF_4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_2); + vis_faligndata(TMP2, TMP4, REF_6); + } else { + vis_src1(TMP2, REF_2); + vis_src1(TMP4, REF_6); + } + + vis_mul8x16au(REF_0, CONST_256, TMP0); + + vis_pmerge(ZERO, REF_2, TMP4); + vis_mul8x16au(REF_0_1, CONST_256, TMP2); + + vis_pmerge(ZERO, REF_2_1, TMP6); + + vis_padd16(TMP0, TMP4, TMP0); + + vis_mul8x16al(DST_0, CONST_512, TMP4); + vis_padd16(TMP2, TMP6, TMP2); + + vis_mul8x16al(DST_1, CONST_512, TMP6); + + vis_mul8x16au(REF_6, CONST_256, TMP12); + + vis_padd16(TMP0, TMP4, TMP0); + vis_mul8x16au(REF_6_1, CONST_256, TMP14); + + vis_padd16(TMP2, TMP6, TMP2); + vis_mul8x16au(REF_4, CONST_256, TMP16); + + vis_padd16(TMP0, CONST_3, TMP8); + vis_mul8x16au(REF_4_1, CONST_256, TMP18); + + vis_padd16(TMP2, CONST_3, TMP10); + vis_pack16(TMP8, DST_0); + + vis_pack16(TMP10, DST_1); + vis_padd16(TMP16, TMP12, TMP0); + + vis_st64(DST_0, dest[0]); + vis_mul8x16al(DST_2, CONST_512, TMP4); + vis_padd16(TMP18, TMP14, TMP2); + + vis_mul8x16al(DST_3, CONST_512, TMP6); + vis_padd16(TMP0, CONST_3, TMP0); + + vis_padd16(TMP2, CONST_3, TMP2); + + vis_padd16(TMP0, TMP4, TMP0); + + vis_padd16(TMP2, TMP6, TMP2); + vis_pack16(TMP0, DST_2); + + vis_pack16(TMP2, DST_3); + vis_st64(DST_2, dest[8]); + + ref += stride; + dest += stride; + } while (--height); +} + +static void MC_avg_x_8_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + unsigned long off = (unsigned long) ref & 0x7; + unsigned long off_plus_1 = off + 1; + int stride_times_2 = stride << 1; + + vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); + + vis_ld64(constants3[0], CONST_3); + vis_fzero(ZERO); + vis_ld64(constants256_512[0], CONST_256); + + ref = vis_alignaddr(ref); + height >>= 2; + do { /* 47 cycles */ + vis_ld64(ref[0], TMP0); + + vis_ld64_2(ref, 8, TMP2); + ref += stride; + + vis_alignaddr_g0((void *)off); + + vis_ld64(ref[0], TMP4); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64_2(ref, 8, TMP6); + ref += stride; + + vis_ld64(ref[0], TMP8); + + vis_ld64_2(ref, 8, TMP10); + ref += stride; + vis_faligndata(TMP4, TMP6, REF_4); + + vis_ld64(ref[0], TMP12); + + vis_ld64_2(ref, 8, TMP14); + ref += stride; + vis_faligndata(TMP8, TMP10, REF_S0); + + vis_faligndata(TMP12, TMP14, REF_S4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + + vis_ld64(dest[0], DST_0); + vis_faligndata(TMP0, TMP2, REF_2); + + vis_ld64_2(dest, stride, DST_2); + vis_faligndata(TMP4, TMP6, REF_6); + + vis_faligndata(TMP8, TMP10, REF_S2); + + vis_faligndata(TMP12, TMP14, REF_S6); + } else { + vis_ld64(dest[0], DST_0); + vis_src1(TMP2, REF_2); + + vis_ld64_2(dest, stride, DST_2); + vis_src1(TMP6, REF_6); + + vis_src1(TMP10, REF_S2); + + vis_src1(TMP14, REF_S6); + } + + vis_pmerge(ZERO, REF_0, TMP0); + vis_mul8x16au(REF_0_1, CONST_256, TMP2); + + vis_pmerge(ZERO, REF_2, TMP4); + vis_mul8x16au(REF_2_1, CONST_256, TMP6); + + vis_padd16(TMP0, CONST_3, TMP0); + vis_mul8x16al(DST_0, CONST_512, TMP16); + + vis_padd16(TMP2, CONST_3, TMP2); + vis_mul8x16al(DST_1, CONST_512, TMP18); + + vis_padd16(TMP0, TMP4, TMP0); + vis_mul8x16au(REF_4, CONST_256, TMP8); + + vis_padd16(TMP2, TMP6, TMP2); + vis_mul8x16au(REF_4_1, CONST_256, TMP10); + + vis_padd16(TMP0, TMP16, TMP0); + vis_mul8x16au(REF_6, CONST_256, TMP12); + + vis_padd16(TMP2, TMP18, TMP2); + vis_mul8x16au(REF_6_1, CONST_256, TMP14); + + vis_padd16(TMP8, CONST_3, TMP8); + vis_mul8x16al(DST_2, CONST_512, TMP16); + + vis_padd16(TMP8, TMP12, TMP8); + vis_mul8x16al(DST_3, CONST_512, TMP18); + + vis_padd16(TMP10, TMP14, TMP10); + vis_pack16(TMP0, DST_0); + + vis_pack16(TMP2, DST_1); + vis_st64(DST_0, dest[0]); + dest += stride; + vis_padd16(TMP10, CONST_3, TMP10); + + vis_ld64_2(dest, stride, DST_0); + vis_padd16(TMP8, TMP16, TMP8); + + vis_ld64_2(dest, stride_times_2, TMP4/*DST_2*/); + vis_padd16(TMP10, TMP18, TMP10); + vis_pack16(TMP8, DST_2); + + vis_pack16(TMP10, DST_3); + vis_st64(DST_2, dest[0]); + dest += stride; + + vis_mul8x16au(REF_S0_1, CONST_256, TMP2); + vis_pmerge(ZERO, REF_S0, TMP0); + + vis_pmerge(ZERO, REF_S2, TMP24); + vis_mul8x16au(REF_S2_1, CONST_256, TMP6); + + vis_padd16(TMP0, CONST_3, TMP0); + vis_mul8x16au(REF_S4, CONST_256, TMP8); + + vis_padd16(TMP2, CONST_3, TMP2); + vis_mul8x16au(REF_S4_1, CONST_256, TMP10); + + vis_padd16(TMP0, TMP24, TMP0); + vis_mul8x16au(REF_S6, CONST_256, TMP12); + + vis_padd16(TMP2, TMP6, TMP2); + vis_mul8x16au(REF_S6_1, CONST_256, TMP14); + + vis_padd16(TMP8, CONST_3, TMP8); + vis_mul8x16al(DST_0, CONST_512, TMP16); + + vis_padd16(TMP10, CONST_3, TMP10); + vis_mul8x16al(DST_1, CONST_512, TMP18); + + vis_padd16(TMP8, TMP12, TMP8); + vis_mul8x16al(TMP4/*DST_2*/, CONST_512, TMP20); + + vis_mul8x16al(TMP5/*DST_3*/, CONST_512, TMP22); + vis_padd16(TMP0, TMP16, TMP0); + + vis_padd16(TMP2, TMP18, TMP2); + vis_pack16(TMP0, DST_0); + + vis_padd16(TMP10, TMP14, TMP10); + vis_pack16(TMP2, DST_1); + vis_st64(DST_0, dest[0]); + dest += stride; + + vis_padd16(TMP8, TMP20, TMP8); + + vis_padd16(TMP10, TMP22, TMP10); + vis_pack16(TMP8, DST_2); + + vis_pack16(TMP10, DST_3); + vis_st64(DST_2, dest[0]); + dest += stride; + } while (--height); +} + +static void MC_put_y_16_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + int offset; + + ref = vis_alignaddr(ref); + offset = (ref != _ref) ? 16 : 0; + + vis_ld64(ref[0], TMP0); + + vis_ld64_2(ref, 8, TMP2); + + vis_ld64_2(ref, offset, TMP4); + ref += stride; + + vis_ld64(ref[0], TMP6); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64_2(ref, 8, TMP8); + vis_faligndata(TMP2, TMP4, REF_4); + + vis_ld64_2(ref, offset, TMP10); + ref += stride; + + vis_ld64(constants_fe[0], MASK_fe); + vis_faligndata(TMP6, TMP8, REF_2); + + vis_ld64(constants_7f[0], MASK_7f); + vis_faligndata(TMP8, TMP10, REF_6); + + vis_ld64(constants128[0], CONST_128); + height = (height >> 1) - 1; + do { /* 24 cycles */ + vis_ld64(ref[0], TMP0); + vis_xor(REF_0, REF_2, TMP12); + + vis_ld64_2(ref, 8, TMP2); + vis_xor(REF_4, REF_6, TMP16); + + vis_ld64_2(ref, offset, TMP4); + ref += stride; + vis_or(REF_0, REF_2, TMP14); + + vis_ld64(ref[0], TMP6); + vis_or(REF_4, REF_6, TMP18); + + vis_ld64_2(ref, 8, TMP8); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64_2(ref, offset, TMP10); + ref += stride; + vis_faligndata(TMP2, TMP4, REF_4); + + vis_and(TMP12, MASK_fe, TMP12); + + vis_and(TMP16, MASK_fe, TMP16); + vis_mul8x16(CONST_128, TMP12, TMP12); + + vis_mul8x16(CONST_128, TMP16, TMP16); + vis_xor(REF_0, REF_2, TMP0); + + vis_xor(REF_4, REF_6, TMP2); + + vis_or(REF_0, REF_2, TMP20); + + vis_and(TMP12, MASK_7f, TMP12); + + vis_and(TMP16, MASK_7f, TMP16); + + vis_psub16(TMP14, TMP12, TMP12); + vis_st64(TMP12, dest[0]); + + vis_psub16(TMP18, TMP16, TMP16); + vis_st64_2(TMP16, dest, 8); + dest += stride; + + vis_or(REF_4, REF_6, TMP18); + + vis_and(TMP0, MASK_fe, TMP0); + + vis_and(TMP2, MASK_fe, TMP2); + vis_mul8x16(CONST_128, TMP0, TMP0); + + vis_faligndata(TMP6, TMP8, REF_2); + vis_mul8x16(CONST_128, TMP2, TMP2); + + vis_faligndata(TMP8, TMP10, REF_6); + + vis_and(TMP0, MASK_7f, TMP0); + + vis_and(TMP2, MASK_7f, TMP2); + + vis_psub16(TMP20, TMP0, TMP0); + vis_st64(TMP0, dest[0]); + + vis_psub16(TMP18, TMP2, TMP2); + vis_st64_2(TMP2, dest, 8); + dest += stride; + } while (--height); + + vis_ld64(ref[0], TMP0); + vis_xor(REF_0, REF_2, TMP12); + + vis_ld64_2(ref, 8, TMP2); + vis_xor(REF_4, REF_6, TMP16); + + vis_ld64_2(ref, offset, TMP4); + vis_or(REF_0, REF_2, TMP14); + + vis_or(REF_4, REF_6, TMP18); + + vis_faligndata(TMP0, TMP2, REF_0); + + vis_faligndata(TMP2, TMP4, REF_4); + + vis_and(TMP12, MASK_fe, TMP12); + + vis_and(TMP16, MASK_fe, TMP16); + vis_mul8x16(CONST_128, TMP12, TMP12); + + vis_mul8x16(CONST_128, TMP16, TMP16); + vis_xor(REF_0, REF_2, TMP0); + + vis_xor(REF_4, REF_6, TMP2); + + vis_or(REF_0, REF_2, TMP20); + + vis_and(TMP12, MASK_7f, TMP12); + + vis_and(TMP16, MASK_7f, TMP16); + + vis_psub16(TMP14, TMP12, TMP12); + vis_st64(TMP12, dest[0]); + + vis_psub16(TMP18, TMP16, TMP16); + vis_st64_2(TMP16, dest, 8); + dest += stride; + + vis_or(REF_4, REF_6, TMP18); + + vis_and(TMP0, MASK_fe, TMP0); + + vis_and(TMP2, MASK_fe, TMP2); + vis_mul8x16(CONST_128, TMP0, TMP0); + + vis_mul8x16(CONST_128, TMP2, TMP2); + + vis_and(TMP0, MASK_7f, TMP0); + + vis_and(TMP2, MASK_7f, TMP2); + + vis_psub16(TMP20, TMP0, TMP0); + vis_st64(TMP0, dest[0]); + + vis_psub16(TMP18, TMP2, TMP2); + vis_st64_2(TMP2, dest, 8); +} + +static void MC_put_y_8_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + int offset; + + ref = vis_alignaddr(ref); + offset = (ref != _ref) ? 8 : 0; + + vis_ld64(ref[0], TMP0); + + vis_ld64_2(ref, offset, TMP2); + ref += stride; + + vis_ld64(ref[0], TMP4); + + vis_ld64_2(ref, offset, TMP6); + ref += stride; + + vis_ld64(constants_fe[0], MASK_fe); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64(constants_7f[0], MASK_7f); + vis_faligndata(TMP4, TMP6, REF_2); + + vis_ld64(constants128[0], CONST_128); + height = (height >> 1) - 1; + do { /* 12 cycles */ + vis_ld64(ref[0], TMP0); + vis_xor(REF_0, REF_2, TMP4); + + vis_ld64_2(ref, offset, TMP2); + ref += stride; + vis_and(TMP4, MASK_fe, TMP4); + + vis_or(REF_0, REF_2, TMP6); + vis_mul8x16(CONST_128, TMP4, TMP4); + + vis_faligndata(TMP0, TMP2, REF_0); + vis_ld64(ref[0], TMP0); + + vis_ld64_2(ref, offset, TMP2); + ref += stride; + vis_xor(REF_0, REF_2, TMP12); + + vis_and(TMP4, MASK_7f, TMP4); + + vis_and(TMP12, MASK_fe, TMP12); + + vis_mul8x16(CONST_128, TMP12, TMP12); + vis_or(REF_0, REF_2, TMP14); + + vis_psub16(TMP6, TMP4, DST_0); + vis_st64(DST_0, dest[0]); + dest += stride; + + vis_faligndata(TMP0, TMP2, REF_2); + + vis_and(TMP12, MASK_7f, TMP12); + + vis_psub16(TMP14, TMP12, DST_0); + vis_st64(DST_0, dest[0]); + dest += stride; + } while (--height); + + vis_ld64(ref[0], TMP0); + vis_xor(REF_0, REF_2, TMP4); + + vis_ld64_2(ref, offset, TMP2); + vis_and(TMP4, MASK_fe, TMP4); + + vis_or(REF_0, REF_2, TMP6); + vis_mul8x16(CONST_128, TMP4, TMP4); + + vis_faligndata(TMP0, TMP2, REF_0); + + vis_xor(REF_0, REF_2, TMP12); + + vis_and(TMP4, MASK_7f, TMP4); + + vis_and(TMP12, MASK_fe, TMP12); + + vis_mul8x16(CONST_128, TMP12, TMP12); + vis_or(REF_0, REF_2, TMP14); + + vis_psub16(TMP6, TMP4, DST_0); + vis_st64(DST_0, dest[0]); + dest += stride; + + vis_and(TMP12, MASK_7f, TMP12); + + vis_psub16(TMP14, TMP12, DST_0); + vis_st64(DST_0, dest[0]); +} + +static void MC_avg_y_16_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + int stride_8 = stride + 8; + int stride_16; + int offset; + + vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); + + ref = vis_alignaddr(ref); + offset = (ref != _ref) ? 16 : 0; + + vis_ld64(ref[ 0], TMP0); + vis_fzero(ZERO); + + vis_ld64(ref[ 8], TMP2); + + vis_ld64_2(ref, offset, TMP4); + stride_16 = stride + offset; + + vis_ld64(constants3[0], CONST_3); + vis_faligndata(TMP0, TMP2, REF_2); + + vis_ld64(constants256_512[0], CONST_256); + vis_faligndata(TMP2, TMP4, REF_6); + height >>= 1; + + do { /* 31 cycles */ + vis_ld64_2(ref, stride, TMP0); + vis_pmerge(ZERO, REF_2, TMP12); + vis_mul8x16au(REF_2_1, CONST_256, TMP14); + + vis_ld64_2(ref, stride_8, TMP2); + vis_pmerge(ZERO, REF_6, TMP16); + vis_mul8x16au(REF_6_1, CONST_256, TMP18); + + vis_ld64_2(ref, stride_16, TMP4); + ref += stride; + + vis_ld64(dest[0], DST_0); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64_2(dest, 8, DST_2); + vis_faligndata(TMP2, TMP4, REF_4); + + vis_ld64_2(ref, stride, TMP6); + vis_pmerge(ZERO, REF_0, TMP0); + vis_mul8x16au(REF_0_1, CONST_256, TMP2); + + vis_ld64_2(ref, stride_8, TMP8); + vis_pmerge(ZERO, REF_4, TMP4); + + vis_ld64_2(ref, stride_16, TMP10); + ref += stride; + + vis_ld64_2(dest, stride, REF_S0/*DST_4*/); + vis_faligndata(TMP6, TMP8, REF_2); + vis_mul8x16au(REF_4_1, CONST_256, TMP6); + + vis_ld64_2(dest, stride_8, REF_S2/*DST_6*/); + vis_faligndata(TMP8, TMP10, REF_6); + vis_mul8x16al(DST_0, CONST_512, TMP20); + + vis_padd16(TMP0, CONST_3, TMP0); + vis_mul8x16al(DST_1, CONST_512, TMP22); + + vis_padd16(TMP2, CONST_3, TMP2); + vis_mul8x16al(DST_2, CONST_512, TMP24); + + vis_padd16(TMP4, CONST_3, TMP4); + vis_mul8x16al(DST_3, CONST_512, TMP26); + + vis_padd16(TMP6, CONST_3, TMP6); + + vis_padd16(TMP12, TMP20, TMP12); + vis_mul8x16al(REF_S0, CONST_512, TMP20); + + vis_padd16(TMP14, TMP22, TMP14); + vis_mul8x16al(REF_S0_1, CONST_512, TMP22); + + vis_padd16(TMP16, TMP24, TMP16); + vis_mul8x16al(REF_S2, CONST_512, TMP24); + + vis_padd16(TMP18, TMP26, TMP18); + vis_mul8x16al(REF_S2_1, CONST_512, TMP26); + + vis_padd16(TMP12, TMP0, TMP12); + vis_mul8x16au(REF_2, CONST_256, TMP28); + + vis_padd16(TMP14, TMP2, TMP14); + vis_mul8x16au(REF_2_1, CONST_256, TMP30); + + vis_padd16(TMP16, TMP4, TMP16); + vis_mul8x16au(REF_6, CONST_256, REF_S4); + + vis_padd16(TMP18, TMP6, TMP18); + vis_mul8x16au(REF_6_1, CONST_256, REF_S6); + + vis_pack16(TMP12, DST_0); + vis_padd16(TMP28, TMP0, TMP12); + + vis_pack16(TMP14, DST_1); + vis_st64(DST_0, dest[0]); + vis_padd16(TMP30, TMP2, TMP14); + + vis_pack16(TMP16, DST_2); + vis_padd16(REF_S4, TMP4, TMP16); + + vis_pack16(TMP18, DST_3); + vis_st64_2(DST_2, dest, 8); + dest += stride; + vis_padd16(REF_S6, TMP6, TMP18); + + vis_padd16(TMP12, TMP20, TMP12); + + vis_padd16(TMP14, TMP22, TMP14); + vis_pack16(TMP12, DST_0); + + vis_padd16(TMP16, TMP24, TMP16); + vis_pack16(TMP14, DST_1); + vis_st64(DST_0, dest[0]); + + vis_padd16(TMP18, TMP26, TMP18); + vis_pack16(TMP16, DST_2); + + vis_pack16(TMP18, DST_3); + vis_st64_2(DST_2, dest, 8); + dest += stride; + } while (--height); +} + +static void MC_avg_y_8_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + int stride_8; + int offset; + + vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); + + ref = vis_alignaddr(ref); + offset = (ref != _ref) ? 8 : 0; + + vis_ld64(ref[ 0], TMP0); + vis_fzero(ZERO); + + vis_ld64_2(ref, offset, TMP2); + stride_8 = stride + offset; + + vis_ld64(constants3[0], CONST_3); + vis_faligndata(TMP0, TMP2, REF_2); + + vis_ld64(constants256_512[0], CONST_256); + + height >>= 1; + do { /* 20 cycles */ + vis_ld64_2(ref, stride, TMP0); + vis_pmerge(ZERO, REF_2, TMP8); + vis_mul8x16au(REF_2_1, CONST_256, TMP10); + + vis_ld64_2(ref, stride_8, TMP2); + ref += stride; + + vis_ld64(dest[0], DST_0); + + vis_ld64_2(dest, stride, DST_2); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64_2(ref, stride, TMP4); + vis_mul8x16al(DST_0, CONST_512, TMP16); + vis_pmerge(ZERO, REF_0, TMP12); + + vis_ld64_2(ref, stride_8, TMP6); + ref += stride; + vis_mul8x16al(DST_1, CONST_512, TMP18); + vis_pmerge(ZERO, REF_0_1, TMP14); + + vis_padd16(TMP12, CONST_3, TMP12); + vis_mul8x16al(DST_2, CONST_512, TMP24); + + vis_padd16(TMP14, CONST_3, TMP14); + vis_mul8x16al(DST_3, CONST_512, TMP26); + + vis_faligndata(TMP4, TMP6, REF_2); + + vis_padd16(TMP8, TMP12, TMP8); + + vis_padd16(TMP10, TMP14, TMP10); + vis_mul8x16au(REF_2, CONST_256, TMP20); + + vis_padd16(TMP8, TMP16, TMP0); + vis_mul8x16au(REF_2_1, CONST_256, TMP22); + + vis_padd16(TMP10, TMP18, TMP2); + vis_pack16(TMP0, DST_0); + + vis_pack16(TMP2, DST_1); + vis_st64(DST_0, dest[0]); + dest += stride; + vis_padd16(TMP12, TMP20, TMP12); + + vis_padd16(TMP14, TMP22, TMP14); + + vis_padd16(TMP12, TMP24, TMP0); + + vis_padd16(TMP14, TMP26, TMP2); + vis_pack16(TMP0, DST_2); + + vis_pack16(TMP2, DST_3); + vis_st64(DST_2, dest[0]); + dest += stride; + } while (--height); +} + +static void MC_put_xy_16_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + unsigned long off = (unsigned long) ref & 0x7; + unsigned long off_plus_1 = off + 1; + int stride_8 = stride + 8; + int stride_16 = stride + 16; + + vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); + + ref = vis_alignaddr(ref); + + vis_ld64(ref[ 0], TMP0); + vis_fzero(ZERO); + + vis_ld64(ref[ 8], TMP2); + + vis_ld64(ref[16], TMP4); + + vis_ld64(constants2[0], CONST_2); + vis_faligndata(TMP0, TMP2, REF_S0); + + vis_ld64(constants256_512[0], CONST_256); + vis_faligndata(TMP2, TMP4, REF_S4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_S2); + vis_faligndata(TMP2, TMP4, REF_S6); + } else { + vis_src1(TMP2, REF_S2); + vis_src1(TMP4, REF_S6); + } + + height >>= 1; + do { + vis_ld64_2(ref, stride, TMP0); + vis_mul8x16au(REF_S0, CONST_256, TMP12); + vis_pmerge(ZERO, REF_S0_1, TMP14); + + vis_alignaddr_g0((void *)off); + + vis_ld64_2(ref, stride_8, TMP2); + vis_mul8x16au(REF_S2, CONST_256, TMP16); + vis_pmerge(ZERO, REF_S2_1, TMP18); + + vis_ld64_2(ref, stride_16, TMP4); + ref += stride; + vis_mul8x16au(REF_S4, CONST_256, TMP20); + vis_pmerge(ZERO, REF_S4_1, TMP22); + + vis_ld64_2(ref, stride, TMP6); + vis_mul8x16au(REF_S6, CONST_256, TMP24); + vis_pmerge(ZERO, REF_S6_1, TMP26); + + vis_ld64_2(ref, stride_8, TMP8); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64_2(ref, stride_16, TMP10); + ref += stride; + vis_faligndata(TMP2, TMP4, REF_4); + + vis_faligndata(TMP6, TMP8, REF_S0); + + vis_faligndata(TMP8, TMP10, REF_S4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_2); + vis_faligndata(TMP2, TMP4, REF_6); + vis_faligndata(TMP6, TMP8, REF_S2); + vis_faligndata(TMP8, TMP10, REF_S6); + } else { + vis_src1(TMP2, REF_2); + vis_src1(TMP4, REF_6); + vis_src1(TMP8, REF_S2); + vis_src1(TMP10, REF_S6); + } + + vis_mul8x16au(REF_0, CONST_256, TMP0); + vis_pmerge(ZERO, REF_0_1, TMP2); + + vis_mul8x16au(REF_2, CONST_256, TMP4); + vis_pmerge(ZERO, REF_2_1, TMP6); + + vis_padd16(TMP0, CONST_2, TMP8); + vis_mul8x16au(REF_4, CONST_256, TMP0); + + vis_padd16(TMP2, CONST_2, TMP10); + vis_mul8x16au(REF_4_1, CONST_256, TMP2); + + vis_padd16(TMP8, TMP4, TMP8); + vis_mul8x16au(REF_6, CONST_256, TMP4); + + vis_padd16(TMP10, TMP6, TMP10); + vis_mul8x16au(REF_6_1, CONST_256, TMP6); + + vis_padd16(TMP12, TMP8, TMP12); + + vis_padd16(TMP14, TMP10, TMP14); + + vis_padd16(TMP12, TMP16, TMP12); + + vis_padd16(TMP14, TMP18, TMP14); + vis_pack16(TMP12, DST_0); + + vis_pack16(TMP14, DST_1); + vis_st64(DST_0, dest[0]); + vis_padd16(TMP0, CONST_2, TMP12); + + vis_mul8x16au(REF_S0, CONST_256, TMP0); + vis_padd16(TMP2, CONST_2, TMP14); + + vis_mul8x16au(REF_S0_1, CONST_256, TMP2); + vis_padd16(TMP12, TMP4, TMP12); + + vis_mul8x16au(REF_S2, CONST_256, TMP4); + vis_padd16(TMP14, TMP6, TMP14); + + vis_mul8x16au(REF_S2_1, CONST_256, TMP6); + vis_padd16(TMP20, TMP12, TMP20); + + vis_padd16(TMP22, TMP14, TMP22); + + vis_padd16(TMP20, TMP24, TMP20); + + vis_padd16(TMP22, TMP26, TMP22); + vis_pack16(TMP20, DST_2); + + vis_pack16(TMP22, DST_3); + vis_st64_2(DST_2, dest, 8); + dest += stride; + vis_padd16(TMP0, TMP4, TMP24); + + vis_mul8x16au(REF_S4, CONST_256, TMP0); + vis_padd16(TMP2, TMP6, TMP26); + + vis_mul8x16au(REF_S4_1, CONST_256, TMP2); + vis_padd16(TMP24, TMP8, TMP24); + + vis_padd16(TMP26, TMP10, TMP26); + vis_pack16(TMP24, DST_0); + + vis_pack16(TMP26, DST_1); + vis_st64(DST_0, dest[0]); + vis_pmerge(ZERO, REF_S6, TMP4); + + vis_pmerge(ZERO, REF_S6_1, TMP6); + + vis_padd16(TMP0, TMP4, TMP0); + + vis_padd16(TMP2, TMP6, TMP2); + + vis_padd16(TMP0, TMP12, TMP0); + + vis_padd16(TMP2, TMP14, TMP2); + vis_pack16(TMP0, DST_2); + + vis_pack16(TMP2, DST_3); + vis_st64_2(DST_2, dest, 8); + dest += stride; + } while (--height); +} + +static void MC_put_xy_8_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + unsigned long off = (unsigned long) ref & 0x7; + unsigned long off_plus_1 = off + 1; + int stride_8 = stride + 8; + + vis_set_gsr(5 << VIS_GSR_SCALEFACT_SHIFT); + + ref = vis_alignaddr(ref); + + vis_ld64(ref[ 0], TMP0); + vis_fzero(ZERO); + + vis_ld64(ref[ 8], TMP2); + + vis_ld64(constants2[0], CONST_2); + + vis_ld64(constants256_512[0], CONST_256); + vis_faligndata(TMP0, TMP2, REF_S0); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_S2); + } else { + vis_src1(TMP2, REF_S2); + } + + height >>= 1; + do { /* 26 cycles */ + vis_ld64_2(ref, stride, TMP0); + vis_mul8x16au(REF_S0, CONST_256, TMP8); + vis_pmerge(ZERO, REF_S2, TMP12); + + vis_alignaddr_g0((void *)off); + + vis_ld64_2(ref, stride_8, TMP2); + ref += stride; + vis_mul8x16au(REF_S0_1, CONST_256, TMP10); + vis_pmerge(ZERO, REF_S2_1, TMP14); + + vis_ld64_2(ref, stride, TMP4); + + vis_ld64_2(ref, stride_8, TMP6); + ref += stride; + vis_faligndata(TMP0, TMP2, REF_S4); + + vis_pmerge(ZERO, REF_S4, TMP18); + + vis_pmerge(ZERO, REF_S4_1, TMP20); + + vis_faligndata(TMP4, TMP6, REF_S0); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_S6); + vis_faligndata(TMP4, TMP6, REF_S2); + } else { + vis_src1(TMP2, REF_S6); + vis_src1(TMP6, REF_S2); + } + + vis_padd16(TMP18, CONST_2, TMP18); + vis_mul8x16au(REF_S6, CONST_256, TMP22); + + vis_padd16(TMP20, CONST_2, TMP20); + vis_mul8x16au(REF_S6_1, CONST_256, TMP24); + + vis_mul8x16au(REF_S0, CONST_256, TMP26); + vis_pmerge(ZERO, REF_S0_1, TMP28); + + vis_mul8x16au(REF_S2, CONST_256, TMP30); + vis_padd16(TMP18, TMP22, TMP18); + + vis_mul8x16au(REF_S2_1, CONST_256, TMP32); + vis_padd16(TMP20, TMP24, TMP20); + + vis_padd16(TMP8, TMP18, TMP8); + + vis_padd16(TMP10, TMP20, TMP10); + + vis_padd16(TMP8, TMP12, TMP8); + + vis_padd16(TMP10, TMP14, TMP10); + vis_pack16(TMP8, DST_0); + + vis_pack16(TMP10, DST_1); + vis_st64(DST_0, dest[0]); + dest += stride; + vis_padd16(TMP18, TMP26, TMP18); + + vis_padd16(TMP20, TMP28, TMP20); + + vis_padd16(TMP18, TMP30, TMP18); + + vis_padd16(TMP20, TMP32, TMP20); + vis_pack16(TMP18, DST_2); + + vis_pack16(TMP20, DST_3); + vis_st64(DST_2, dest[0]); + dest += stride; + } while (--height); +} + +static void MC_avg_xy_16_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + unsigned long off = (unsigned long) ref & 0x7; + unsigned long off_plus_1 = off + 1; + int stride_8 = stride + 8; + int stride_16 = stride + 16; + + vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT); + + ref = vis_alignaddr(ref); + + vis_ld64(ref[ 0], TMP0); + vis_fzero(ZERO); + + vis_ld64(ref[ 8], TMP2); + + vis_ld64(ref[16], TMP4); + + vis_ld64(constants6[0], CONST_6); + vis_faligndata(TMP0, TMP2, REF_S0); + + vis_ld64(constants256_1024[0], CONST_256); + vis_faligndata(TMP2, TMP4, REF_S4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_S2); + vis_faligndata(TMP2, TMP4, REF_S6); + } else { + vis_src1(TMP2, REF_S2); + vis_src1(TMP4, REF_S6); + } + + height >>= 1; + do { /* 55 cycles */ + vis_ld64_2(ref, stride, TMP0); + vis_mul8x16au(REF_S0, CONST_256, TMP12); + vis_pmerge(ZERO, REF_S0_1, TMP14); + + vis_alignaddr_g0((void *)off); + + vis_ld64_2(ref, stride_8, TMP2); + vis_mul8x16au(REF_S2, CONST_256, TMP16); + vis_pmerge(ZERO, REF_S2_1, TMP18); + + vis_ld64_2(ref, stride_16, TMP4); + ref += stride; + vis_mul8x16au(REF_S4, CONST_256, TMP20); + vis_pmerge(ZERO, REF_S4_1, TMP22); + + vis_ld64_2(ref, stride, TMP6); + vis_mul8x16au(REF_S6, CONST_256, TMP24); + vis_pmerge(ZERO, REF_S6_1, TMP26); + + vis_ld64_2(ref, stride_8, TMP8); + vis_faligndata(TMP0, TMP2, REF_0); + + vis_ld64_2(ref, stride_16, TMP10); + ref += stride; + vis_faligndata(TMP2, TMP4, REF_4); + + vis_ld64(dest[0], DST_0); + vis_faligndata(TMP6, TMP8, REF_S0); + + vis_ld64_2(dest, 8, DST_2); + vis_faligndata(TMP8, TMP10, REF_S4); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_2); + vis_faligndata(TMP2, TMP4, REF_6); + vis_faligndata(TMP6, TMP8, REF_S2); + vis_faligndata(TMP8, TMP10, REF_S6); + } else { + vis_src1(TMP2, REF_2); + vis_src1(TMP4, REF_6); + vis_src1(TMP8, REF_S2); + vis_src1(TMP10, REF_S6); + } + + vis_mul8x16al(DST_0, CONST_1024, TMP30); + vis_pmerge(ZERO, REF_0, TMP0); + + vis_mul8x16al(DST_1, CONST_1024, TMP32); + vis_pmerge(ZERO, REF_0_1, TMP2); + + vis_mul8x16au(REF_2, CONST_256, TMP4); + vis_pmerge(ZERO, REF_2_1, TMP6); + + vis_mul8x16al(DST_2, CONST_1024, REF_0); + vis_padd16(TMP0, CONST_6, TMP0); + + vis_mul8x16al(DST_3, CONST_1024, REF_2); + vis_padd16(TMP2, CONST_6, TMP2); + + vis_padd16(TMP0, TMP4, TMP0); + vis_mul8x16au(REF_4, CONST_256, TMP4); + + vis_padd16(TMP2, TMP6, TMP2); + vis_mul8x16au(REF_4_1, CONST_256, TMP6); + + vis_padd16(TMP12, TMP0, TMP12); + vis_mul8x16au(REF_6, CONST_256, TMP8); + + vis_padd16(TMP14, TMP2, TMP14); + vis_mul8x16au(REF_6_1, CONST_256, TMP10); + + vis_padd16(TMP12, TMP16, TMP12); + vis_mul8x16au(REF_S0, CONST_256, REF_4); + + vis_padd16(TMP14, TMP18, TMP14); + vis_mul8x16au(REF_S0_1, CONST_256, REF_6); + + vis_padd16(TMP12, TMP30, TMP12); + + vis_padd16(TMP14, TMP32, TMP14); + vis_pack16(TMP12, DST_0); + + vis_pack16(TMP14, DST_1); + vis_st64(DST_0, dest[0]); + vis_padd16(TMP4, CONST_6, TMP4); + + vis_ld64_2(dest, stride, DST_0); + vis_padd16(TMP6, CONST_6, TMP6); + vis_mul8x16au(REF_S2, CONST_256, TMP12); + + vis_padd16(TMP4, TMP8, TMP4); + vis_mul8x16au(REF_S2_1, CONST_256, TMP14); + + vis_padd16(TMP6, TMP10, TMP6); + + vis_padd16(TMP20, TMP4, TMP20); + + vis_padd16(TMP22, TMP6, TMP22); + + vis_padd16(TMP20, TMP24, TMP20); + + vis_padd16(TMP22, TMP26, TMP22); + + vis_padd16(TMP20, REF_0, TMP20); + vis_mul8x16au(REF_S4, CONST_256, REF_0); + + vis_padd16(TMP22, REF_2, TMP22); + vis_pack16(TMP20, DST_2); + + vis_pack16(TMP22, DST_3); + vis_st64_2(DST_2, dest, 8); + dest += stride; + + vis_ld64_2(dest, 8, DST_2); + vis_mul8x16al(DST_0, CONST_1024, TMP30); + vis_pmerge(ZERO, REF_S4_1, REF_2); + + vis_mul8x16al(DST_1, CONST_1024, TMP32); + vis_padd16(REF_4, TMP0, TMP8); + + vis_mul8x16au(REF_S6, CONST_256, REF_4); + vis_padd16(REF_6, TMP2, TMP10); + + vis_mul8x16au(REF_S6_1, CONST_256, REF_6); + vis_padd16(TMP8, TMP12, TMP8); + + vis_padd16(TMP10, TMP14, TMP10); + + vis_padd16(TMP8, TMP30, TMP8); + + vis_padd16(TMP10, TMP32, TMP10); + vis_pack16(TMP8, DST_0); + + vis_pack16(TMP10, DST_1); + vis_st64(DST_0, dest[0]); + + vis_padd16(REF_0, TMP4, REF_0); + + vis_mul8x16al(DST_2, CONST_1024, TMP30); + vis_padd16(REF_2, TMP6, REF_2); + + vis_mul8x16al(DST_3, CONST_1024, TMP32); + vis_padd16(REF_0, REF_4, REF_0); + + vis_padd16(REF_2, REF_6, REF_2); + + vis_padd16(REF_0, TMP30, REF_0); + + /* stall */ + + vis_padd16(REF_2, TMP32, REF_2); + vis_pack16(REF_0, DST_2); + + vis_pack16(REF_2, DST_3); + vis_st64_2(DST_2, dest, 8); + dest += stride; + } while (--height); +} + +static void MC_avg_xy_8_vis (uint8_t * dest, const uint8_t * _ref, + const int stride, int height) +{ + uint8_t *ref = (uint8_t *) _ref; + unsigned long off = (unsigned long) ref & 0x7; + unsigned long off_plus_1 = off + 1; + int stride_8 = stride + 8; + + vis_set_gsr(4 << VIS_GSR_SCALEFACT_SHIFT); + + ref = vis_alignaddr(ref); + + vis_ld64(ref[0], TMP0); + vis_fzero(ZERO); + + vis_ld64_2(ref, 8, TMP2); + + vis_ld64(constants6[0], CONST_6); + + vis_ld64(constants256_1024[0], CONST_256); + vis_faligndata(TMP0, TMP2, REF_S0); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_S2); + } else { + vis_src1(TMP2, REF_S2); + } + + height >>= 1; + do { /* 31 cycles */ + vis_ld64_2(ref, stride, TMP0); + vis_mul8x16au(REF_S0, CONST_256, TMP8); + vis_pmerge(ZERO, REF_S0_1, TMP10); + + vis_ld64_2(ref, stride_8, TMP2); + ref += stride; + vis_mul8x16au(REF_S2, CONST_256, TMP12); + vis_pmerge(ZERO, REF_S2_1, TMP14); + + vis_alignaddr_g0((void *)off); + + vis_ld64_2(ref, stride, TMP4); + vis_faligndata(TMP0, TMP2, REF_S4); + + vis_ld64_2(ref, stride_8, TMP6); + ref += stride; + + vis_ld64(dest[0], DST_0); + vis_faligndata(TMP4, TMP6, REF_S0); + + vis_ld64_2(dest, stride, DST_2); + + if (off != 0x7) { + vis_alignaddr_g0((void *)off_plus_1); + vis_faligndata(TMP0, TMP2, REF_S6); + vis_faligndata(TMP4, TMP6, REF_S2); + } else { + vis_src1(TMP2, REF_S6); + vis_src1(TMP6, REF_S2); + } + + vis_mul8x16al(DST_0, CONST_1024, TMP30); + vis_pmerge(ZERO, REF_S4, TMP22); + + vis_mul8x16al(DST_1, CONST_1024, TMP32); + vis_pmerge(ZERO, REF_S4_1, TMP24); + + vis_mul8x16au(REF_S6, CONST_256, TMP26); + vis_pmerge(ZERO, REF_S6_1, TMP28); + + vis_mul8x16au(REF_S0, CONST_256, REF_S4); + vis_padd16(TMP22, CONST_6, TMP22); + + vis_mul8x16au(REF_S0_1, CONST_256, REF_S6); + vis_padd16(TMP24, CONST_6, TMP24); + + vis_mul8x16al(DST_2, CONST_1024, REF_0); + vis_padd16(TMP22, TMP26, TMP22); + + vis_mul8x16al(DST_3, CONST_1024, REF_2); + vis_padd16(TMP24, TMP28, TMP24); + + vis_mul8x16au(REF_S2, CONST_256, TMP26); + vis_padd16(TMP8, TMP22, TMP8); + + vis_mul8x16au(REF_S2_1, CONST_256, TMP28); + vis_padd16(TMP10, TMP24, TMP10); + + vis_padd16(TMP8, TMP12, TMP8); + + vis_padd16(TMP10, TMP14, TMP10); + + vis_padd16(TMP8, TMP30, TMP8); + + vis_padd16(TMP10, TMP32, TMP10); + vis_pack16(TMP8, DST_0); + + vis_pack16(TMP10, DST_1); + vis_st64(DST_0, dest[0]); + dest += stride; + + vis_padd16(REF_S4, TMP22, TMP12); + + vis_padd16(REF_S6, TMP24, TMP14); + + vis_padd16(TMP12, TMP26, TMP12); + + vis_padd16(TMP14, TMP28, TMP14); + + vis_padd16(TMP12, REF_0, TMP12); + + vis_padd16(TMP14, REF_2, TMP14); + vis_pack16(TMP12, DST_2); + + vis_pack16(TMP14, DST_3); + vis_st64(DST_2, dest[0]); + dest += stride; + } while (--height); +} + +MPEG2_MC_EXTERN(vis); + +#endif /* !(ARCH_SPARC) */ diff --git a/k9decmpeg/mpeg2.h b/k9decmpeg/mpeg2.h new file mode 100755 index 0000000..e8c7d2d --- /dev/null +++ b/k9decmpeg/mpeg2.h @@ -0,0 +1,196 @@ +/* + * mpeg2.h + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#ifndef MPEG2_H +#define MPEG2_H + +#define MPEG2_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c)) +#define MPEG2_RELEASE MPEG2_VERSION (0, 4, 0) /* 0.4.0 */ + +#define SEQ_FLAG_MPEG2 1 +#define SEQ_FLAG_CONSTRAINED_PARAMETERS 2 +#define SEQ_FLAG_PROGRESSIVE_SEQUENCE 4 +#define SEQ_FLAG_LOW_DELAY 8 +#define SEQ_FLAG_COLOUR_DESCRIPTION 16 + +#define SEQ_MASK_VIDEO_FORMAT 0xe0 +#define SEQ_VIDEO_FORMAT_COMPONENT 0 +#define SEQ_VIDEO_FORMAT_PAL 0x20 +#define SEQ_VIDEO_FORMAT_NTSC 0x40 +#define SEQ_VIDEO_FORMAT_SECAM 0x60 +#define SEQ_VIDEO_FORMAT_MAC 0x80 +#define SEQ_VIDEO_FORMAT_UNSPECIFIED 0xa0 + +typedef struct mpeg2_sequence_s { + unsigned int width, height; + unsigned int chroma_width, chroma_height; + unsigned int byte_rate; + unsigned int vbv_buffer_size; + uint32_t flags; + + unsigned int picture_width, picture_height; + unsigned int display_width, display_height; + unsigned int pixel_width, pixel_height; + unsigned int frame_period; + + uint8_t profile_level_id; + uint8_t colour_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coefficients; +} mpeg2_sequence_t; + +#define GOP_FLAG_DROP_FRAME 1 +#define GOP_FLAG_BROKEN_LINK 2 +#define GOP_FLAG_CLOSED_GOP 4 + +typedef struct mpeg2_gop_s { + uint8_t hours; + uint8_t minutes; + uint8_t seconds; + uint8_t pictures; + uint32_t flags; +} mpeg2_gop_t; + +#define PIC_MASK_CODING_TYPE 7 +#define PIC_FLAG_CODING_TYPE_I 1 +#define PIC_FLAG_CODING_TYPE_P 2 +#define PIC_FLAG_CODING_TYPE_B 3 +#define PIC_FLAG_CODING_TYPE_D 4 + +#define PIC_FLAG_TOP_FIELD_FIRST 8 +#define PIC_FLAG_PROGRESSIVE_FRAME 16 +#define PIC_FLAG_COMPOSITE_DISPLAY 32 +#define PIC_FLAG_SKIP 64 +#define PIC_FLAG_TAGS 128 +#define PIC_MASK_COMPOSITE_DISPLAY 0xfffff000 + +typedef struct mpeg2_picture_s { + unsigned int temporal_reference; + unsigned int nb_fields; + uint32_t tag, tag2; + uint32_t flags; + struct { + int x, y; + } display_offset[3]; +} mpeg2_picture_t; + +typedef struct mpeg2_fbuf_s { + uint8_t * buf[3]; + void * id; +} mpeg2_fbuf_t; + +typedef struct mpeg2_info_s { + const mpeg2_sequence_t * sequence; + const mpeg2_gop_t * gop; + const mpeg2_picture_t * current_picture; + const mpeg2_picture_t * current_picture_2nd; + const mpeg2_fbuf_t * current_fbuf; + const mpeg2_picture_t * display_picture; + const mpeg2_picture_t * display_picture_2nd; + const mpeg2_fbuf_t * display_fbuf; + const mpeg2_fbuf_t * discard_fbuf; + const uint8_t * user_data; + unsigned int user_data_len; +} mpeg2_info_t; + +typedef struct mpeg2dec_s mpeg2dec_t; +typedef struct mpeg2_decoder_s mpeg2_decoder_t; + +typedef enum { + STATE_BUFFER = 0, + STATE_SEQUENCE = 1, + STATE_SEQUENCE_REPEATED = 2, + STATE_GOP = 3, + STATE_PICTURE = 4, + STATE_SLICE_1ST = 5, + STATE_PICTURE_2ND = 6, + STATE_SLICE = 7, + STATE_END = 8, + STATE_INVALID = 9, + STATE_INVALID_END = 10 +} mpeg2_state_t; + +typedef struct mpeg2_convert_init_s { + unsigned int id_size; + unsigned int buf_size[3]; + void (* start) (void * id, const mpeg2_fbuf_t * fbuf, + const mpeg2_picture_t * picture, const mpeg2_gop_t * gop); + void (* copy) (void * id, uint8_t * const * src, unsigned int v_offset); +} mpeg2_convert_init_t; +typedef enum { + MPEG2_CONVERT_SET = 0, + MPEG2_CONVERT_STRIDE = 1, + MPEG2_CONVERT_START = 2 +} mpeg2_convert_stage_t; +typedef int mpeg2_convert_t (int stage, void * id, + const mpeg2_sequence_t * sequence, int stride, + uint32_t accel, void * arg, + mpeg2_convert_init_t * result); +int mpeg2_convert (mpeg2dec_t * mpeg2dec, mpeg2_convert_t convert, void * arg); +int mpeg2_stride (mpeg2dec_t * mpeg2dec, int stride); +void mpeg2_set_buf (mpeg2dec_t * mpeg2dec, uint8_t * buf[3], void * id); +void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf); + +#define MPEG2_ACCEL_X86_MMX 1 +#define MPEG2_ACCEL_X86_3DNOW 2 +#define MPEG2_ACCEL_X86_MMXEXT 4 +#define MPEG2_ACCEL_PPC_ALTIVEC 1 +#define MPEG2_ACCEL_ALPHA 1 +#define MPEG2_ACCEL_ALPHA_MVI 2 +#define MPEG2_ACCEL_SPARC_VIS 1 +#define MPEG2_ACCEL_SPARC_VIS2 2 +#define MPEG2_ACCEL_DETECT 0x80000000 + +uint32_t mpeg2_accel (uint32_t accel); +mpeg2dec_t * mpeg2_init (void); +const mpeg2_info_t * mpeg2_info (mpeg2dec_t * mpeg2dec); +void mpeg2_close (mpeg2dec_t * mpeg2dec); + +void mpeg2_buffer (mpeg2dec_t * mpeg2dec, uint8_t * start, uint8_t * end); +int mpeg2_getpos (mpeg2dec_t * mpeg2dec); +mpeg2_state_t mpeg2_parse (mpeg2dec_t * mpeg2dec); + +void mpeg2_reset (mpeg2dec_t * mpeg2dec, int full_reset); +void mpeg2_skip (mpeg2dec_t * mpeg2dec, int skip); +void mpeg2_slice_region (mpeg2dec_t * mpeg2dec, int start, int end); + +void mpeg2_tag_picture (mpeg2dec_t * mpeg2dec, uint32_t tag, uint32_t tag2); + +void mpeg2_init_fbuf (mpeg2_decoder_t * decoder, uint8_t * current_fbuf[3], + uint8_t * forward_fbuf[3], uint8_t * backward_fbuf[3]); +void mpeg2_slice (mpeg2_decoder_t * decoder, int code, const uint8_t * buffer); + +typedef enum { + MPEG2_ALLOC_MPEG2DEC = 0, + MPEG2_ALLOC_CHUNK = 1, + MPEG2_ALLOC_YUV = 2, + MPEG2_ALLOC_CONVERT_ID = 3, + MPEG2_ALLOC_CONVERTED = 4 +} mpeg2_alloc_t; + +void * mpeg2_malloc (unsigned size, mpeg2_alloc_t reason); +void mpeg2_free (void * buf); +void mpeg2_malloc_hooks (void * malloc (unsigned, mpeg2_alloc_t), + int free (void *)); + +#endif /* MPEG2_H */ diff --git a/k9decmpeg/mpeg2_internal.h b/k9decmpeg/mpeg2_internal.h new file mode 100755 index 0000000..7e6c1df --- /dev/null +++ b/k9decmpeg/mpeg2_internal.h @@ -0,0 +1,300 @@ +/* + * mpeg2_internal.h + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +/* macroblock modes */ +#define MACROBLOCK_INTRA 1 +#define MACROBLOCK_PATTERN 2 +#define MACROBLOCK_MOTION_BACKWARD 4 +#define MACROBLOCK_MOTION_FORWARD 8 +#define MACROBLOCK_QUANT 16 +#define DCT_TYPE_INTERLACED 32 +/* motion_type */ +#define MOTION_TYPE_SHIFT 6 +#define MC_FIELD 1 +#define MC_FRAME 2 +#define MC_16X8 2 +#define MC_DMV 3 + +/* picture structure */ +#define TOP_FIELD 1 +#define BOTTOM_FIELD 2 +#define FRAME_PICTURE 3 + +/* picture coding type */ +#define I_TYPE 1 +#define P_TYPE 2 +#define B_TYPE 3 +#define D_TYPE 4 + +typedef void mpeg2_mc_fct (uint8_t *, const uint8_t *, int, int); + +typedef struct { + uint8_t * ref[2][3]; + uint8_t ** ref2[2]; + int pmv[2][2]; + int f_code[2]; +} motion_t; + +typedef void motion_parser_t (mpeg2_decoder_t * decoder, + motion_t * motion, + mpeg2_mc_fct * const * table); + +struct mpeg2_decoder_s { + /* first, state that carries information from one macroblock to the */ + /* next inside a slice, and is never used outside of mpeg2_slice() */ + + /* bit parsing stuff */ + uint32_t bitstream_buf; /* current 32 bit working set */ + int bitstream_bits; /* used bits in working set */ + const uint8_t * bitstream_ptr; /* buffer with stream data */ + + uint8_t * dest[3]; + + int offset; + int stride; + int uv_stride; + int slice_stride; + int slice_uv_stride; + int stride_frame; + unsigned int limit_x; + unsigned int limit_y_16; + unsigned int limit_y_8; + unsigned int limit_y; + + /* Motion vectors */ + /* The f_ and b_ correspond to the forward and backward motion */ + /* predictors */ + motion_t b_motion; + motion_t f_motion; + motion_parser_t * motion_parser[5]; + + /* predictor for DC coefficients in intra blocks */ + int16_t dc_dct_pred[3]; + + /* DCT coefficients */ + int16_t DCTblock[64] ATTR_ALIGN(64); + + uint8_t * picture_dest[3]; + void (* convert) (void * convert_id, uint8_t * const * src, + unsigned int v_offset); + void * convert_id; + + int dmv_offset; + unsigned int v_offset; + + /* now non-slice-specific information */ + + /* sequence header stuff */ + uint16_t * quantizer_matrix[4]; + uint16_t (* chroma_quantizer[2])[64]; + uint16_t quantizer_prescale[4][32][64]; + + /* The width and height of the picture snapped to macroblock units */ + int width; + int height; + int vertical_position_extension; + int chroma_format; + + /* picture header stuff */ + + /* what type of picture this is (I, P, B, D) */ + int coding_type; + + /* picture coding extension stuff */ + + /* quantization factor for intra dc coefficients */ + int intra_dc_precision; + /* top/bottom/both fields */ + int picture_structure; + /* bool to indicate all predictions are frame based */ + int frame_pred_frame_dct; + /* bool to indicate whether intra blocks have motion vectors */ + /* (for concealment) */ + int concealment_motion_vectors; + /* bool to use different vlc tables */ + int intra_vlc_format; + /* used for DMV MC */ + int top_field_first; + + /* stuff derived from bitstream */ + + /* pointer to the zigzag scan we're supposed to be using */ + const uint8_t * scan; + + int second_field; + + int mpeg1; +}; + +typedef struct { + mpeg2_fbuf_t fbuf; +} fbuf_alloc_t; + +struct mpeg2dec_s { + mpeg2_decoder_t decoder; + + mpeg2_info_t info; + + uint32_t shift; + int is_display_initialized; + mpeg2_state_t (* action) (struct mpeg2dec_s * mpeg2dec); + mpeg2_state_t state; + uint32_t ext_state; + + /* allocated in init - gcc has problems allocating such big structures */ + uint8_t * chunk_buffer; + /* pointer to start of the current chunk */ + uint8_t * chunk_start; + /* pointer to current position in chunk_buffer */ + uint8_t * chunk_ptr; + /* last start code ? */ + uint8_t code; + + /* picture tags */ + uint32_t tag_current, tag2_current, tag_previous, tag2_previous; + int num_tags; + int bytes_since_tag; + + int first; + int alloc_index_user; + int alloc_index; + uint8_t first_decode_slice; + uint8_t nb_decode_slices; + + unsigned int user_data_len; + + mpeg2_sequence_t new_sequence; + mpeg2_sequence_t sequence; + mpeg2_gop_t new_gop; + mpeg2_gop_t gop; + mpeg2_picture_t new_picture; + mpeg2_picture_t pictures[4]; + mpeg2_picture_t * picture; + /*const*/ mpeg2_fbuf_t * fbuf[3]; /* 0: current fbuf, 1-2: prediction fbufs */ + + fbuf_alloc_t fbuf_alloc[3]; + int custom_fbuf; + + uint8_t * yuv_buf[3][3]; + int yuv_index; + mpeg2_convert_t * convert; + void * convert_arg; + unsigned int convert_id_size; + int convert_stride; + void (* convert_start) (void * id, const mpeg2_fbuf_t * fbuf, + const mpeg2_picture_t * picture, + const mpeg2_gop_t * gop); + + uint8_t * buf_start; + uint8_t * buf_end; + + int16_t display_offset_x, display_offset_y; + + int copy_matrix; + int8_t q_scale_type, scaled[4]; + uint8_t quantizer_matrix[4][64]; + uint8_t new_quantizer_matrix[4][64]; +}; + +typedef struct { +#ifdef ARCH_PPC + uint8_t regv[12*16]; +#endif + int dummy; +} cpu_state_t; + +/* cpu_accel.c */ +uint32_t mpeg2_detect_accel (void); + +/* cpu_state.c */ +void mpeg2_cpu_state_init (uint32_t accel); + +/* decode.c */ +mpeg2_state_t mpeg2_seek_header (mpeg2dec_t * mpeg2dec); +mpeg2_state_t mpeg2_parse_header (mpeg2dec_t * mpeg2dec); + +/* header.c */ +void mpeg2_header_state_init (mpeg2dec_t * mpeg2dec); +void mpeg2_reset_info (mpeg2_info_t * info); +int mpeg2_header_sequence (mpeg2dec_t * mpeg2dec); +int mpeg2_header_gop (mpeg2dec_t * mpeg2dec); +mpeg2_state_t mpeg2_header_picture_start (mpeg2dec_t * mpeg2dec); +int mpeg2_header_picture (mpeg2dec_t * mpeg2dec); +int mpeg2_header_extension (mpeg2dec_t * mpeg2dec); +int mpeg2_header_user_data (mpeg2dec_t * mpeg2dec); +void mpeg2_header_sequence_finalize (mpeg2dec_t * mpeg2dec); +void mpeg2_header_gop_finalize (mpeg2dec_t * mpeg2dec); +void mpeg2_header_picture_finalize (mpeg2dec_t * mpeg2dec, uint32_t accels); +mpeg2_state_t mpeg2_header_slice_start (mpeg2dec_t * mpeg2dec); +mpeg2_state_t mpeg2_header_end (mpeg2dec_t * mpeg2dec); +void mpeg2_set_fbuf (mpeg2dec_t * mpeg2dec, int b_type); + +/* idct.c */ +void mpeg2_idct_init (uint32_t accel); + +/* idct_mmx.c */ +void mpeg2_idct_copy_mmxext (int16_t * block, uint8_t * dest, int stride); +void mpeg2_idct_add_mmxext (int last, int16_t * block, + uint8_t * dest, int stride); +void mpeg2_idct_copy_mmx (int16_t * block, uint8_t * dest, int stride); +void mpeg2_idct_add_mmx (int last, int16_t * block, + uint8_t * dest, int stride); +void mpeg2_idct_mmx_init (void); + +/* idct_altivec.c */ +void mpeg2_idct_copy_altivec (int16_t * block, uint8_t * dest, int stride); +void mpeg2_idct_add_altivec (int last, int16_t * block, + uint8_t * dest, int stride); +void mpeg2_idct_altivec_init (void); + +/* idct_alpha.c */ +void mpeg2_idct_copy_mvi (int16_t * block, uint8_t * dest, int stride); +void mpeg2_idct_add_mvi (int last, int16_t * block, + uint8_t * dest, int stride); +void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, int stride); +void mpeg2_idct_add_alpha (int last, int16_t * block, + uint8_t * dest, int stride); +void mpeg2_idct_alpha_init (void); + +/* motion_comp.c */ +void mpeg2_mc_init (uint32_t accel); + +typedef struct { + mpeg2_mc_fct * put [8]; + mpeg2_mc_fct * avg [8]; +} mpeg2_mc_t; + +#define MPEG2_MC_EXTERN(x) mpeg2_mc_t mpeg2_mc_##x = { \ + {MC_put_o_16_##x, MC_put_x_16_##x, MC_put_y_16_##x, MC_put_xy_16_##x, \ + MC_put_o_8_##x, MC_put_x_8_##x, MC_put_y_8_##x, MC_put_xy_8_##x}, \ + {MC_avg_o_16_##x, MC_avg_x_16_##x, MC_avg_y_16_##x, MC_avg_xy_16_##x, \ + MC_avg_o_8_##x, MC_avg_x_8_##x, MC_avg_y_8_##x, MC_avg_xy_8_##x} \ +}; + +extern mpeg2_mc_t mpeg2_mc_c; +extern mpeg2_mc_t mpeg2_mc_mmx; +extern mpeg2_mc_t mpeg2_mc_mmxext; +extern mpeg2_mc_t mpeg2_mc_3dnow; +extern mpeg2_mc_t mpeg2_mc_altivec; +extern mpeg2_mc_t mpeg2_mc_alpha; +extern mpeg2_mc_t mpeg2_mc_vis; diff --git a/k9decmpeg/mpeg2convert.h b/k9decmpeg/mpeg2convert.h new file mode 100755 index 0000000..e884e51 --- /dev/null +++ b/k9decmpeg/mpeg2convert.h @@ -0,0 +1,48 @@ +/* + * mpeg2convert.h + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#ifndef MPEG2CONVERT_H +#define MPEG2CONVERT_H + +mpeg2_convert_t mpeg2convert_rgb32; +mpeg2_convert_t mpeg2convert_rgb24; +mpeg2_convert_t mpeg2convert_rgb16; +mpeg2_convert_t mpeg2convert_rgb15; +mpeg2_convert_t mpeg2convert_rgb8; +mpeg2_convert_t mpeg2convert_bgr32; +mpeg2_convert_t mpeg2convert_bgr24; +mpeg2_convert_t mpeg2convert_bgr16; +mpeg2_convert_t mpeg2convert_bgr15; +mpeg2_convert_t mpeg2convert_bgr8; + +typedef enum { + MPEG2CONVERT_RGB = 0, + MPEG2CONVERT_BGR = 1 +} mpeg2convert_rgb_order_t; + +mpeg2_convert_t * mpeg2convert_rgb (mpeg2convert_rgb_order_t order, + unsigned int bpp); + +mpeg2_convert_t mpeg2convert_uyvy; + +#endif /* MPEG2CONVERT_H */ diff --git a/k9decmpeg/rgb.cpp b/k9decmpeg/rgb.cpp new file mode 100755 index 0000000..5dc23f4 --- /dev/null +++ b/k9decmpeg/rgb.cpp @@ -0,0 +1,583 @@ +/* + * rgb.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" +#include "k9common.h" + +#include "attributes.h" +#include "mpeg2.h" +#include "mpeg2convert.h" +#include "convert_internal.h" + +static int matrix_coefficients = 6; + +static const int Inverse_Table_6_9[8][4] = { + {117504, 138453, 13954, 34903}, /* no sequence_display_extension */ + {117504, 138453, 13954, 34903}, /* ITU-R Rec. 709 (1990) */ + {104597, 132201, 25675, 53279}, /* unspecified */ + {104597, 132201, 25675, 53279}, /* reserved */ + {104448, 132798, 24759, 53109}, /* FCC */ + {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */ + {104597, 132201, 25675, 53279}, /* SMPTE 170M */ + {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */ +}; + +static const uint8_t dither[] ATTR_ALIGN(32) = { + 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71, + 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71, + 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71, + 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71, + 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35, + 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35, + 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35, + 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35, + 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62, + 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62, + 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62, + 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62, + 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26, + 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26, + 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26, + 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26, + 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69, + 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69, + 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69, + 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69, + 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33, + 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33, + 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33, + 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33, + 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60, + 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60, + 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60, + 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60, + 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23, + 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23, + 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23, + 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23, + 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71, + 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71, + 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71, + 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71, + 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35, + 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35 +}; + +static const uint8_t dither_temporal[64] = { + 0x00, 0x20, 0x21, 0x01, 0x40, 0x60, 0x61, 0x41, + 0x42, 0x62, 0x63, 0x43, 0x02, 0x22, 0x23, 0x03, + 0x80, 0xa0, 0xa1, 0x81, 0xc0, 0xe0, 0xe1, 0xc1, + 0xc2, 0xe2, 0xe3, 0xc3, 0x82, 0xa2, 0xa3, 0x83, + 0x84, 0xa4, 0xa5, 0x85, 0xc4, 0xe4, 0xe5, 0xc5, + 0xc6, 0xe6, 0xe7, 0xc7, 0x86, 0xa6, 0xa7, 0x87, + 0x04, 0x24, 0x25, 0x05, 0x44, 0x64, 0x65, 0x45, + 0x46, 0x66, 0x67, 0x47, 0x06, 0x26, 0x27, 0x07 +}; + +typedef struct { + convert_rgb_t base; + void * table_rV[256]; + void * table_gU[256]; + int table_gV[256]; + void * table_bU[256]; +} convert_rgb_c_t; + +#define RGB(type,i) \ + U = pu[i]; \ + V = pv[i]; \ + r = (type *) id->table_rV[V]; \ + g = (type *) (((uint8_t *)id->table_gU[U]) + id->table_gV[V]); \ + b = (type *) id->table_bU[U]; + +#define DST(py,dst,i,j) \ + Y = py[i]; \ + dst[i] = r[Y] + g[Y] + b[Y]; + +#define DSTRGB(py,dst,i,j) \ + Y = py[i]; \ + dst[3*i] = r[Y]; dst[3*i+1] = g[Y]; dst[3*i+2] = b[Y]; + +#define DSTBGR(py,dst,i,j) \ + Y = py[i]; \ + dst[3*i] = b[Y]; dst[3*i+1] = g[Y]; dst[3*i+2] = r[Y]; + +#define DSTDITHER(py,dst,i,j) \ + Y = py[i]; \ + dst[i] = r[Y+pd[2*i+96*j]] + g[Y-pd[2*i+96*j]] + b[Y+pd[2*i+1+96*j]]; + +#define DO(x) x +#define SKIP(x) + +#define DECLARE_420(func,type,num,DST,DITHER) \ +static void func (void * _id, uint8_t * const * src, \ + unsigned int v_offset) \ +{ \ + const convert_rgb_c_t * const id = (convert_rgb_c_t *) _id; \ + type * dst_1; \ + const uint8_t * py_1, * pu, * pv; \ + int i; \ + DITHER(uint8_t dithpos = id->base.dither_offset;) \ + \ + dst_1 = (type *)(id->base.rgb_ptr + id->base.rgb_stride * v_offset);\ + py_1 = src[0]; pu = src[1]; pv = src[2]; \ + \ + i = 8; \ + do { \ + const uint8_t * py_2; \ + int j, U, V, Y; \ + const type * r, * g, * b; \ + type * dst_2; \ + DITHER(const uint8_t * const pd = dither + 2 * dithpos;) \ + \ + dst_2 = (type *)((char *)dst_1 + id->base.rgb_stride); \ + py_2 = py_1 + id->base.y_stride; \ + j = id->base.width; \ + do { \ + RGB (type, 0) \ + DST (py_1, dst_1, 0, 0) \ + DST (py_1, dst_1, 1, 0) \ + DST (py_2, dst_2, 0, 1) \ + DST (py_2, dst_2, 1, 1) \ + \ + RGB (type, 1) \ + DST (py_2, dst_2, 2, 1) \ + DST (py_2, dst_2, 3, 1) \ + DST (py_1, dst_1, 2, 0) \ + DST (py_1, dst_1, 3, 0) \ + \ + RGB (type, 2) \ + DST (py_1, dst_1, 4, 0) \ + DST (py_1, dst_1, 5, 0) \ + DST (py_2, dst_2, 4, 1) \ + DST (py_2, dst_2, 5, 1) \ + \ + RGB (type, 3) \ + DST (py_2, dst_2, 6, 1) \ + DST (py_2, dst_2, 7, 1) \ + DST (py_1, dst_1, 6, 0) \ + DST (py_1, dst_1, 7, 0) \ + \ + pu += 4; \ + pv += 4; \ + py_1 += 8; \ + py_2 += 8; \ + dst_1 += 8 * num; \ + dst_2 += 8 * num; \ + } while (--j); \ + py_1 += id->base.y_increm; \ + pu += id->base.uv_increm; \ + pv += id->base.uv_increm; \ + dst_1 = (type *)((char *)dst_1 + id->base.rgb_increm); \ + DITHER(dithpos += id->base.dither_stride;) \ + } while (--i); \ +} + +DECLARE_420 (rgb_c_32_420, uint32_t, 1, DST, SKIP) +DECLARE_420 (rgb_c_24_rgb_420, uint8_t, 3, DSTRGB, SKIP) +DECLARE_420 (rgb_c_24_bgr_420, uint8_t, 3, DSTBGR, SKIP) +DECLARE_420 (rgb_c_16_420, uint16_t, 1, DST, SKIP) +DECLARE_420 (rgb_c_8_420, uint8_t, 1, DSTDITHER, DO) + +#define DECLARE_422(func,type,num,DST,DITHER) \ +static void func (void * _id, uint8_t * const * src, \ + unsigned int v_offset) \ +{ \ + const convert_rgb_c_t * const id = (convert_rgb_c_t *) _id; \ + type * dst; \ + const uint8_t * py, * pu, * pv; \ + int i; \ + DITHER(uint8_t dithpos = id->base.dither_offset;) \ + \ + dst = (type *)(id->base.rgb_ptr + id->base.rgb_stride * v_offset); \ + py = src[0]; pu = src[1]; pv = src[2]; \ + \ + i = 16; \ + do { \ + int j, U, V, Y; \ + const type * r, * g, * b; \ + DITHER(const uint8_t * const pd = dither + 2 * dithpos;) \ + \ + j = id->base.width; \ + do { \ + RGB (type, 0) \ + DST (py, dst, 0, 0) \ + DST (py, dst, 1, 0) \ + \ + RGB (type, 1) \ + DST (py, dst, 2, 0) \ + DST (py, dst, 3, 0) \ + \ + RGB (type, 2) \ + DST (py, dst, 4, 0) \ + DST (py, dst, 5, 0) \ + \ + RGB (type, 3) \ + DST (py, dst, 6, 0) \ + DST (py, dst, 7, 0) \ + \ + pu += 4; \ + pv += 4; \ + py += 8; \ + dst += 8 * num; \ + } while (--j); \ + py += id->base.y_increm; \ + pu += id->base.uv_increm; \ + pv += id->base.uv_increm; \ + dst = (type *)((char *)dst + id->base.rgb_increm); \ + DITHER(dithpos += id->base.dither_stride;) \ + } while (--i); \ +} + +DECLARE_422 (rgb_c_32_422, uint32_t, 1, DST, SKIP) +DECLARE_422 (rgb_c_24_rgb_422, uint8_t, 3, DSTRGB, SKIP) +DECLARE_422 (rgb_c_24_bgr_422, uint8_t, 3, DSTBGR, SKIP) +DECLARE_422 (rgb_c_16_422, uint16_t, 1, DST, SKIP) +DECLARE_422 (rgb_c_8_422, uint8_t, 1, DSTDITHER, DO) + +#define DECLARE_444(func,type,num,DST,DITHER) \ +static void func (void * _id, uint8_t * const * src, \ + unsigned int v_offset) \ +{ \ + const convert_rgb_c_t * const id = (convert_rgb_c_t *) _id; \ + type * dst; \ + const uint8_t * py, * pu, * pv; \ + int i; \ + DITHER(uint8_t dithpos = id->base.dither_offset;) \ + \ + dst = (type *)(id->base.rgb_ptr + id->base.rgb_stride * v_offset); \ + py = src[0]; pu = src[1]; pv = src[2]; \ + \ + i = 16; \ + do { \ + int j, U, V, Y; \ + const type * r, * g, * b; \ + DITHER(const uint8_t * const pd = dither + 2 * dithpos;) \ + \ + j = id->base.width; \ + do { \ + RGB (type, 0) \ + DST (py, dst, 0, 0) \ + RGB (type, 1) \ + DST (py, dst, 1, 0) \ + RGB (type, 2) \ + DST (py, dst, 2, 0) \ + RGB (type, 3) \ + DST (py, dst, 3, 0) \ + RGB (type, 4) \ + DST (py, dst, 4, 0) \ + RGB (type, 5) \ + DST (py, dst, 5, 0) \ + RGB (type, 6) \ + DST (py, dst, 6, 0) \ + RGB (type, 7) \ + DST (py, dst, 7, 0) \ + \ + pu += 8; \ + pv += 8; \ + py += 8; \ + dst += 8 * num; \ + } while (--j); \ + py += id->base.y_increm; \ + pu += id->base.y_increm; \ + pv += id->base.y_increm; \ + dst = (type *)((char *)dst + id->base.rgb_increm); \ + DITHER(dithpos += id->base.dither_stride;) \ + } while (--i); \ +} + +DECLARE_444 (rgb_c_32_444, uint32_t, 1, DST, SKIP) +DECLARE_444 (rgb_c_24_rgb_444, uint8_t, 3, DSTRGB, SKIP) +DECLARE_444 (rgb_c_24_bgr_444, uint8_t, 3, DSTBGR, SKIP) +DECLARE_444 (rgb_c_16_444, uint16_t, 1, DST, SKIP) +DECLARE_444 (rgb_c_8_444, uint8_t, 1, DSTDITHER, DO) + +static void rgb_start (void * _id, const mpeg2_fbuf_t * fbuf, + const mpeg2_picture_t * picture, + const mpeg2_gop_t * gop) +{ + convert_rgb_t * id = (convert_rgb_t *) _id; + int uv_stride = id->uv_stride_frame; + id->y_stride = id->y_stride_frame; + id->rgb_ptr = fbuf->buf[0]; + id->rgb_stride = id->rgb_stride_frame; + id->dither_stride = 32; + id->dither_offset = dither_temporal[picture->temporal_reference & 63]; + if (picture->nb_fields == 1) { + uv_stride <<= 1; + id->y_stride <<= 1; + id->rgb_stride <<= 1; + id->dither_stride <<= 1; + id->dither_offset += 16; + if (!(picture->flags & PIC_FLAG_TOP_FIELD_FIRST)) { + id->rgb_ptr += id->rgb_stride_frame; + id->dither_offset += 32; + } + } + id->y_increm = (id->y_stride << id->convert420) - id->y_stride_frame; + id->uv_increm = uv_stride - id->uv_stride_frame; + id->rgb_increm = (id->rgb_stride << id->convert420) - id->rgb_stride_min; + id->dither_stride <<= id->convert420; +} + +static inline int div_round (int dividend, int divisor) +{ + if (dividend > 0) + return (dividend + (divisor>>1)) / divisor; + else + return -((-dividend + (divisor>>1)) / divisor); +} + +static unsigned int rgb_c_init (convert_rgb_c_t * id, + mpeg2convert_rgb_order_t order, + unsigned int bpp) +{ + int i; + uint8_t table_Y[1024]; + uint32_t * table_32 = 0; + uint16_t * table_16 = 0; + uint8_t * table_8 = 0; + uint8_t * table_332 = 0; + int entry_size = 0; + void * table_r = 0; + void * table_g = 0; + void * table_b = 0; + + int crv = Inverse_Table_6_9[matrix_coefficients][0]; + int cbu = Inverse_Table_6_9[matrix_coefficients][1]; + int cgu = -Inverse_Table_6_9[matrix_coefficients][2]; + int cgv = -Inverse_Table_6_9[matrix_coefficients][3]; + + for (i = 0; i < 1024; i++) { + int j; + + j = (76309 * (i - 384 - 16) + 32768) >> 16; + table_Y[i] = (j < 0) ? 0 : ((j > 255) ? 255 : j); + } + + switch (bpp) { + case 32: + if (!id) + return (197 + 2*682 + 256 + 132) * sizeof (uint32_t); + table_32 = (uint32_t *) (id + 1); + entry_size = sizeof (uint32_t); + table_r = table_32 + 197; + table_b = table_32 + 197 + 685; + table_g = table_32 + 197 + 2*682; + + for (i = -197; i < 256+197; i++) + ((uint32_t *) table_r)[i] = + table_Y[i+384] << ((order == MPEG2CONVERT_RGB) ? 16 : 0); + for (i = -132; i < 256+132; i++) + ((uint32_t *) table_g)[i] = table_Y[i+384] << 8; + for (i = -232; i < 256+232; i++) + ((uint32_t *) table_b)[i] = + table_Y[i+384] << ((order == MPEG2CONVERT_RGB) ? 0 : 16); + break; + + case 24: + if (!id) + return (256 + 2*232) * sizeof (uint8_t); + table_8 = (uint8_t *) (id + 1); + entry_size = sizeof (uint8_t); + table_r = table_g = table_b = table_8 + 232; + + for (i = -232; i < 256+232; i++) + ((uint8_t * )table_b)[i] = table_Y[i+384]; + break; + + case 15: + case 16: + if (!id) + return (197 + 2*682 + 256 + 132) * sizeof (uint16_t); + table_16 = (uint16_t *) (id + 1); + entry_size = sizeof (uint16_t); + table_r = table_16 + 197; + table_b = table_16 + 197 + 685; + table_g = table_16 + 197 + 2*682; + + for (i = -197; i < 256+197; i++) { + int j = table_Y[i+384] >> 3; + + if (order == MPEG2CONVERT_RGB) + j <<= ((bpp==16) ? 11 : 10); + + ((uint16_t *)table_r)[i] = j; + } + for (i = -132; i < 256+132; i++) { + int j = table_Y[i+384] >> ((bpp==16) ? 2 : 3); + + ((uint16_t *)table_g)[i] = j << 5; + } + for (i = -232; i < 256+232; i++) { + int j = table_Y[i+384] >> 3; + + if (order == MPEG2CONVERT_BGR) + j <<= ((bpp==16) ? 11 : 10); + + ((uint16_t *)table_b)[i] = j; + } + break; + + case 8: + if (!id) + return (197 + 2*682 + 256 + 232 + 71) * sizeof (uint8_t); + table_332 = (uint8_t *) (id + 1); + entry_size = sizeof (uint8_t); + table_r = table_332 + 197; + table_g = table_332 + 197 + 682 + 30; + table_b = table_332 + 197 + 2*682; + + for (i = -197; i < 256+197+30; i++) + ((uint8_t *)table_r)[i] = ((table_Y[i+384] * 7 / 255) << + (order == MPEG2CONVERT_RGB ? 5 : 0)); + for (i = -132; i < 256+132+30; i++) + ((uint8_t *)table_g)[i-30] = ((table_Y[i+384] * 7 / 255) << + (order == MPEG2CONVERT_RGB ? 2 : 3)); + for (i = -232; i < 256+232+71; i++) + ((uint8_t *)table_b)[i] = ((table_Y[i+384] / 85) << + (order == MPEG2CONVERT_RGB ? 0 : 6)); + break; + } + + for (i = 0; i < 256; i++) { + id->table_rV[i] = (((uint8_t *)table_r) + + entry_size * div_round (crv * (i-128), 76309)); + id->table_gU[i] = (((uint8_t *)table_g) + + entry_size * div_round (cgu * (i-128), 76309)); + id->table_gV[i] = entry_size * div_round (cgv * (i-128), 76309); + id->table_bU[i] = (((uint8_t *)table_b) + + entry_size * div_round (cbu * (i-128), 76309)); + } + + return 0; +} + +static int rgb_internal (mpeg2convert_rgb_order_t order, unsigned int bpp, + int stage, void * _id, const mpeg2_sequence_t * seq, + int stride, uint32_t accel, void * arg, + mpeg2_convert_init_t * result) +{ + convert_rgb_t * id = (convert_rgb_t *) _id; + mpeg2convert_copy_t * copy = (mpeg2convert_copy_t *) 0; + unsigned int id_size = sizeof (convert_rgb_t); + int chroma420 = (seq->chroma_height < seq->height); + int convert420 = 0; + int rgb_stride_min = ((bpp + 7) >> 3) * seq->width; + +#ifdef ARCH_X86 + if (!copy && (accel & MPEG2_ACCEL_X86_MMXEXT)) { + convert420 = 0; + copy = mpeg2convert_rgb_mmxext (order, bpp, seq); + } + if (!copy && (accel & MPEG2_ACCEL_X86_MMX)) { + convert420 = 0; + copy = mpeg2convert_rgb_mmx (order, bpp, seq); + } +#endif +#ifdef ARCH_SPARC + if (!copy && (accel & MPEG2_ACCEL_SPARC_VIS)) { + convert420 = chroma420; + copy = mpeg2convert_rgb_vis (order, bpp, seq); + } +#endif + if (!copy) { + int src, dest; + static void (* rgb_c[3][5]) (void *, uint8_t * const *, + unsigned int) = + {{rgb_c_24_bgr_420, rgb_c_8_420, rgb_c_16_420, + rgb_c_24_rgb_420, rgb_c_32_420}, + {rgb_c_24_bgr_422, rgb_c_8_422, rgb_c_16_422, + rgb_c_24_rgb_422, rgb_c_32_422}, + {rgb_c_24_bgr_444, rgb_c_8_444, rgb_c_16_444, + rgb_c_24_rgb_444, rgb_c_32_444}}; + + convert420 = chroma420; + id_size = (sizeof (convert_rgb_c_t) + + rgb_c_init ((convert_rgb_c_t *) id, order, bpp)); + src = ((seq->chroma_width == seq->width) + + (seq->chroma_height == seq->height)); + dest = ((bpp == 24 && order == MPEG2CONVERT_BGR) ? 0 : (bpp + 7) >> 3); + copy = rgb_c[src][dest]; + } + + result->id_size = id_size; + + if (stride < rgb_stride_min) + stride = rgb_stride_min; + + if (stage == MPEG2_CONVERT_STRIDE) + return stride; + else if (stage == MPEG2_CONVERT_START) { + id->width = seq->width >> 3; + id->y_stride_frame = seq->width; + id->uv_stride_frame = seq->chroma_width; + id->rgb_stride_frame = stride; + id->rgb_stride_min = rgb_stride_min; + id->chroma420 = chroma420; + id->convert420 = convert420; + result->buf_size[0] = stride * seq->height; + result->buf_size[1] = result->buf_size[2] = 0; + result->start = rgb_start; + result->copy = copy; + } + return 0; +} + +#define DECLARE(func,order,bpp) \ +int func (int stage, void * id, \ + const mpeg2_sequence_t * sequence, int stride, \ + uint32_t accel, void * arg, mpeg2_convert_init_t * result) \ +{ \ + return rgb_internal (order, bpp, stage, id, sequence, stride, \ + accel, arg, result); \ +} + +DECLARE (mpeg2convert_rgb32, MPEG2CONVERT_RGB, 32) +DECLARE (mpeg2convert_rgb24, MPEG2CONVERT_RGB, 24) +DECLARE (mpeg2convert_rgb16, MPEG2CONVERT_RGB, 16) +DECLARE (mpeg2convert_rgb15, MPEG2CONVERT_RGB, 15) +DECLARE (mpeg2convert_rgb8, MPEG2CONVERT_RGB, 8) +DECLARE (mpeg2convert_bgr32, MPEG2CONVERT_BGR, 32) +DECLARE (mpeg2convert_bgr24, MPEG2CONVERT_BGR, 24) +DECLARE (mpeg2convert_bgr16, MPEG2CONVERT_BGR, 16) +DECLARE (mpeg2convert_bgr15, MPEG2CONVERT_BGR, 15) +DECLARE (mpeg2convert_bgr8, MPEG2CONVERT_BGR, 8) + +mpeg2_convert_t * mpeg2convert_rgb (mpeg2convert_rgb_order_t order, + unsigned int bpp) +{ + static mpeg2_convert_t * table[5][2] = + {{mpeg2convert_rgb15, mpeg2convert_bgr15}, + {mpeg2convert_rgb8, mpeg2convert_bgr8}, + {mpeg2convert_rgb16, mpeg2convert_bgr16}, + {mpeg2convert_rgb24, mpeg2convert_bgr24}, + {mpeg2convert_rgb32, mpeg2convert_bgr32}}; + + if (order == MPEG2CONVERT_RGB || order == MPEG2CONVERT_BGR) { + if (bpp == 15) + return table[0][order == MPEG2CONVERT_BGR]; + else if (bpp >= 8 && bpp <= 32 && (bpp & 7) == 0) + return table[bpp >> 3][order == MPEG2CONVERT_BGR]; + } + return (mpeg2_convert_t *) 0; +} diff --git a/k9decmpeg/rgb_mmx.cpp b/k9decmpeg/rgb_mmx.cpp new file mode 100755 index 0000000..957708c --- /dev/null +++ b/k9decmpeg/rgb_mmx.cpp @@ -0,0 +1,310 @@ +/* + * rgb_mmx.c + * Copyright (C) 2000-2003 Silicon Integrated System Corp. + * All Rights Reserved. + * + * Author: Olie Lho + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#ifdef ARCH_X86 +#include "k9common.h" +#include +#include + +#include "mpeg2.h" +#include "mpeg2convert.h" +#include "convert_internal.h" +#include "attributes.h" +#include "mmx.h" + +#define CPU_MMXEXT 0 +#define CPU_MMX 1 + +/* CPU_MMXEXT/CPU_MMX adaptation layer */ + +#define movntq(src,dest) \ +do { \ + if (cpu == CPU_MMXEXT) \ + movntq_r2m (src, dest); \ + else \ + movq_r2m (src, dest); \ +} while (0) + +static inline void mmx_yuv2rgb (uint8_t * py, uint8_t * pu, uint8_t * pv) +{ + static mmx_t mmx_80w = {0x0080008000800080LL}; + static mmx_t mmx_U_green = {0xf37df37df37df37dLL}; + static mmx_t mmx_U_blue = {0x4093409340934093LL}; + static mmx_t mmx_V_red = {0x3312331233123312LL}; + static mmx_t mmx_V_green = {0xe5fce5fce5fce5fcLL}; + static mmx_t mmx_10w = {0x1010101010101010LL}; + static mmx_t mmx_00ffw = {0x00ff00ff00ff00ffLL}; + static mmx_t mmx_Y_coeff = {0x253f253f253f253fLL}; + + movd_m2r (*pu, mm0); /* mm0 = 00 00 00 00 u3 u2 u1 u0 */ + movd_m2r (*pv, mm1); /* mm1 = 00 00 00 00 v3 v2 v1 v0 */ + movq_m2r (*py, mm6); /* mm6 = Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */ + pxor_r2r (mm4, mm4); /* mm4 = 0 */ + /* XXX might do cache preload for image here */ + + /* + * Do the multiply part of the conversion for even and odd pixels + * register usage: + * mm0 -> Cblue, mm1 -> Cred, mm2 -> Cgreen even pixels + * mm3 -> Cblue, mm4 -> Cred, mm5 -> Cgreen odd pixels + * mm6 -> Y even, mm7 -> Y odd + */ + + punpcklbw_r2r (mm4, mm0); /* mm0 = u3 u2 u1 u0 */ + punpcklbw_r2r (mm4, mm1); /* mm1 = v3 v2 v1 v0 */ + psubsw_m2r (mmx_80w, mm0); /* u -= 128 */ + psubsw_m2r (mmx_80w, mm1); /* v -= 128 */ + psllw_i2r (3, mm0); /* promote precision */ + psllw_i2r (3, mm1); /* promote precision */ + movq_r2r (mm0, mm2); /* mm2 = u3 u2 u1 u0 */ + movq_r2r (mm1, mm3); /* mm3 = v3 v2 v1 v0 */ + pmulhw_m2r (mmx_U_green, mm2); /* mm2 = u * u_green */ + pmulhw_m2r (mmx_V_green, mm3); /* mm3 = v * v_green */ + pmulhw_m2r (mmx_U_blue, mm0); /* mm0 = chroma_b */ + pmulhw_m2r (mmx_V_red, mm1); /* mm1 = chroma_r */ + paddsw_r2r (mm3, mm2); /* mm2 = chroma_g */ + + psubusb_m2r (mmx_10w, mm6); /* Y -= 16 */ + movq_r2r (mm6, mm7); /* mm7 = Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */ + pand_m2r (mmx_00ffw, mm6); /* mm6 = Y6 Y4 Y2 Y0 */ + psrlw_i2r (8, mm7); /* mm7 = Y7 Y5 Y3 Y1 */ + psllw_i2r (3, mm6); /* promote precision */ + psllw_i2r (3, mm7); /* promote precision */ + pmulhw_m2r (mmx_Y_coeff, mm6); /* mm6 = luma_rgb even */ + pmulhw_m2r (mmx_Y_coeff, mm7); /* mm7 = luma_rgb odd */ + + /* + * Do the addition part of the conversion for even and odd pixels + * register usage: + * mm0 -> Cblue, mm1 -> Cred, mm2 -> Cgreen even pixels + * mm3 -> Cblue, mm4 -> Cred, mm5 -> Cgreen odd pixels + * mm6 -> Y even, mm7 -> Y odd + */ + + movq_r2r (mm0, mm3); /* mm3 = chroma_b */ + movq_r2r (mm1, mm4); /* mm4 = chroma_r */ + movq_r2r (mm2, mm5); /* mm5 = chroma_g */ + paddsw_r2r (mm6, mm0); /* mm0 = B6 B4 B2 B0 */ + paddsw_r2r (mm7, mm3); /* mm3 = B7 B5 B3 B1 */ + paddsw_r2r (mm6, mm1); /* mm1 = R6 R4 R2 R0 */ + paddsw_r2r (mm7, mm4); /* mm4 = R7 R5 R3 R1 */ + paddsw_r2r (mm6, mm2); /* mm2 = G6 G4 G2 G0 */ + paddsw_r2r (mm7, mm5); /* mm5 = G7 G5 G3 G1 */ + packuswb_r2r (mm0, mm0); /* saturate to 0-255 */ + packuswb_r2r (mm1, mm1); /* saturate to 0-255 */ + packuswb_r2r (mm2, mm2); /* saturate to 0-255 */ + packuswb_r2r (mm3, mm3); /* saturate to 0-255 */ + packuswb_r2r (mm4, mm4); /* saturate to 0-255 */ + packuswb_r2r (mm5, mm5); /* saturate to 0-255 */ + punpcklbw_r2r (mm3, mm0); /* mm0 = B7 B6 B5 B4 B3 B2 B1 B0 */ + punpcklbw_r2r (mm4, mm1); /* mm1 = R7 R6 R5 R4 R3 R2 R1 R0 */ + punpcklbw_r2r (mm5, mm2); /* mm2 = G7 G6 G5 G4 G3 G2 G1 G0 */ +} + +static inline void mmx_unpack_16rgb (uint8_t * image, const int cpu) +{ + static mmx_t mmx_bluemask = {0xf8f8f8f8f8f8f8f8LL}; + static mmx_t mmx_greenmask = {0xfcfcfcfcfcfcfcfcLL}; + static mmx_t mmx_redmask = {0xf8f8f8f8f8f8f8f8LL}; + + /* + * convert RGB plane to RGB 16 bits + * mm0 -> B, mm1 -> R, mm2 -> G + * mm4 -> GB, mm5 -> AR pixel 4-7 + * mm6 -> GB, mm7 -> AR pixel 0-3 + */ + + pand_m2r (mmx_bluemask, mm0); /* mm0 = b7b6b5b4b3______ */ + pand_m2r (mmx_greenmask, mm2); /* mm2 = g7g6g5g4g3g2____ */ + pand_m2r (mmx_redmask, mm1); /* mm1 = r7r6r5r4r3______ */ + psrlq_i2r (3, mm0); /* mm0 = ______b7b6b5b4b3 */ + pxor_r2r (mm4, mm4); /* mm4 = 0 */ + movq_r2r (mm0, mm5); /* mm5 = ______b7b6b5b4b3 */ + movq_r2r (mm2, mm7); /* mm7 = g7g6g5g4g3g2____ */ + + punpcklbw_r2r (mm4, mm2); + punpcklbw_r2r (mm1, mm0); + psllq_i2r (3, mm2); + por_r2r (mm2, mm0); + movntq (mm0, *image); + + punpckhbw_r2r (mm4, mm7); + punpckhbw_r2r (mm1, mm5); + psllq_i2r (3, mm7); + por_r2r (mm7, mm5); + movntq (mm5, *(image+8)); +} + +static inline void mmx_unpack_32rgb (uint8_t * image, const int cpu) +{ + /* + * convert RGB plane to RGB packed format, + * mm0 -> B, mm1 -> R, mm2 -> G, mm3 -> 0, + * mm4 -> GB, mm5 -> AR pixel 4-7, + * mm6 -> GB, mm7 -> AR pixel 0-3 + */ + + pxor_r2r (mm3, mm3); + movq_r2r (mm0, mm6); + movq_r2r (mm1, mm7); + movq_r2r (mm0, mm4); + movq_r2r (mm1, mm5); + punpcklbw_r2r (mm2, mm6); + punpcklbw_r2r (mm3, mm7); + punpcklwd_r2r (mm7, mm6); + movntq (mm6, *image); + movq_r2r (mm0, mm6); + punpcklbw_r2r (mm2, mm6); + punpckhwd_r2r (mm7, mm6); + movntq (mm6, *(image+8)); + punpckhbw_r2r (mm2, mm4); + punpckhbw_r2r (mm3, mm5); + punpcklwd_r2r (mm5, mm4); + movntq (mm4, *(image+16)); + movq_r2r (mm0, mm4); + punpckhbw_r2r (mm2, mm4); + punpckhwd_r2r (mm5, mm4); + movntq (mm4, *(image+24)); +} + +static inline void rgb16 (void * const _id, uint8_t * const * src, + const unsigned int v_offset, const int cpu) +{ + convert_rgb_t * const id = (convert_rgb_t *) _id; + uint8_t * dst; + uint8_t * py, * pu, * pv; + int i, j; + + dst = id->rgb_ptr + id->rgb_stride * v_offset; + py = src[0]; pu = src[1]; pv = src[2]; + + i = 16; + do { + j = id->width; + do { + mmx_yuv2rgb (py, pu, pv); + mmx_unpack_16rgb (dst, cpu); + py += 8; + pu += 4; + pv += 4; + dst += 16; + } while (--j); + + dst += id->rgb_increm; + py += id->y_increm; + if (! (--i & id->chroma420)) { + pu += id->uv_increm; + pv += id->uv_increm; + } else { + pu -= id->uv_stride_frame; + pv -= id->uv_stride_frame; + } + } while (i); +} + +static inline void argb32 (void * const _id, uint8_t * const * src, + const unsigned int v_offset, const int cpu) +{ + convert_rgb_t * const id = (convert_rgb_t *) _id; + uint8_t * dst; + uint8_t * py, * pu, * pv; + int i, j; + + dst = id->rgb_ptr + id->rgb_stride * v_offset; + py = src[0]; pu = src[1]; pv = src[2]; + + i = 16; + do { + j = id->width; + do { + mmx_yuv2rgb (py, pu, pv); + mmx_unpack_32rgb (dst, cpu); + py += 8; + pu += 4; + pv += 4; + dst += 32; + } while (--j); + + dst += id->rgb_increm; + py += id->y_increm; + if (! (--i & id->chroma420)) { + pu += id->uv_increm; + pv += id->uv_increm; + } else { + pu -= id->uv_stride_frame; + pv -= id->uv_stride_frame; + } + } while (i); +} + +static void mmxext_rgb16 (void * id, uint8_t * const * src, + unsigned int v_offset) +{ + rgb16 (id, src, v_offset, CPU_MMXEXT); +} + +static void mmxext_argb32 (void * id, uint8_t * const * src, + unsigned int v_offset) +{ + argb32 (id, src, v_offset, CPU_MMXEXT); +} + +static void mmx_rgb16 (void * id, uint8_t * const * src, unsigned int v_offset) +{ + rgb16 (id, src, v_offset, CPU_MMX); +} + +static void mmx_argb32 (void * id, uint8_t * const * src, + unsigned int v_offset) +{ + argb32 (id, src, v_offset, CPU_MMX); +} + +mpeg2convert_copy_t * mpeg2convert_rgb_mmxext (int order, int bpp, + const mpeg2_sequence_t * seq) +{ + if (order == MPEG2CONVERT_RGB && seq->chroma_width < seq->width) { + if (bpp == 16) + return mmxext_rgb16; + else if (bpp == 32) + return mmxext_argb32; + } + return NULL; /* Fallback to C */ +} + +mpeg2convert_copy_t * mpeg2convert_rgb_mmx (int order, int bpp, + const mpeg2_sequence_t * seq) +{ + if (order == MPEG2CONVERT_RGB && seq->chroma_width < seq->width) { + if (bpp == 16) + return mmx_rgb16; + else if (bpp == 32) + return mmx_argb32; + } + return NULL; /* Fallback to C */ +} +#endif diff --git a/k9decmpeg/rgb_vis.cpp b/k9decmpeg/rgb_vis.cpp new file mode 100755 index 0000000..0b23d70 --- /dev/null +++ b/k9decmpeg/rgb_vis.cpp @@ -0,0 +1,384 @@ +/* + * rgb_vis.c + * Copyright (C) 2003 David S. Miller + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#ifdef ARCH_SPARC + +#include "k9common.h" +#include + +#include "mpeg2.h" +#include "mpeg2convert.h" +#include "convert_internal.h" +#include "attributes.h" +#include "vis.h" + +/* Based partially upon the MMX yuv2rgb code, see there for credits. + * + * The difference here is that since we have enough registers we + * process both even and odd scanlines in one pass. + */ + +static const uint16_t const_2048[] ATTR_ALIGN(8) = {2048, 2048, 2048, 2048}; +static const uint16_t const_1024[] ATTR_ALIGN(8) = {1024, 1024, 1024, 1024}; +static const uint16_t const_128[] ATTR_ALIGN(8) = {128, 128, 128, 128}; +static const uint8_t const_Ugreen[] ATTR_ALIGN(8) = + {0xf3, 0x00, 0xf3, 0x00, 0xf3, 0x00, 0xf3, 0x00}; +static const uint8_t const_Vgreen[] ATTR_ALIGN(8) = + {0xe6, 0x00, 0xe6, 0x00, 0xe6, 0x00, 0xe6, 0x00}; +static const uint8_t const_Ublue_Vred[] ATTR_ALIGN(8) = + {0x41, 0x41, 0x41, 0x41, 0x33, 0x33, 0x33, 0x33}; +static const uint8_t const_Ycoeff[] ATTR_ALIGN(4) = {0x25, 0x25, 0x25, 0x25}; + +#define TMP0 0 +#define TMP1 1 +#define TMP2 2 +#define TMP3 3 +#define TMP4 4 +#define TMP5 5 +#define TMP6 6 +#define TMP7 7 +#define TMP8 8 +#define TMP9 9 +#define TMP10 10 +#define TMP11 11 +#define TMP12 12 +#define TMP13 13 + +#define CONST_UBLUE 14 +#define CONST_VRED 15 +#define CONST_2048 16 + +#define BLUE8_EVEN 18 +#define BLUE8_ODD 19 +#define RED8_EVEN 20 +#define RED8_ODD 21 +#define GREEN8_EVEN 22 +#define GREEN8_ODD 23 + +#define BLUE8_2_EVEN 24 +#define BLUE8_2_ODD 25 +#define RED8_2_EVEN 26 +#define RED8_2_ODD 27 +#define GREEN8_2_EVEN 28 +#define GREEN8_2_ODD 29 + +#define CONST_YCOEFF 30 +#define ZEROS 31 + +#define PU_0 32 +#define PU_2 34 +#define PV_0 36 +#define PV_2 38 +#define PY_0 40 +#define PY_2 42 +#define PY_4 44 +#define PY_6 46 + +#define CONST_128 56 +#define CONST_1024 58 +#define CONST_VGREEN 60 +#define CONST_UGREEN 62 + +static inline void vis_init_consts(void) +{ + vis_set_gsr(7 << VIS_GSR_SCALEFACT_SHIFT); + + vis_ld64(const_2048[0], CONST_2048); + vis_ld64(const_1024[0], CONST_1024); + vis_ld64(const_Ugreen[0], CONST_UGREEN); + vis_ld64(const_Vgreen[0], CONST_VGREEN); + vis_fzeros(ZEROS); + vis_ld64(const_Ublue_Vred[0], CONST_UBLUE); + vis_ld32(const_Ycoeff[0], CONST_YCOEFF); + vis_ld64(const_128[0], CONST_128); +} + +static inline void vis_yuv2rgb(uint8_t *py, uint8_t *pu, uint8_t *pv, + int y_stride) +{ + vis_ld32(pu[0], TMP0); + + vis_ld32(pv[0], TMP2); + + vis_ld64(py[0], TMP4); + vis_mul8x16au(TMP0, CONST_2048, PU_0); + + vis_ld64_2(py, y_stride, TMP8); + vis_mul8x16au(TMP2, CONST_2048, PV_0); + + vis_pmerge(TMP4, TMP5, TMP6); + + vis_pmerge(TMP6, TMP7, TMP4); + + vis_pmerge(TMP8, TMP9, TMP10); + + vis_pmerge(TMP10, TMP11, TMP8); + vis_mul8x16au(TMP4, CONST_2048, PY_0); + + vis_psub16(PU_0, CONST_1024, PU_0); + vis_mul8x16au(TMP5, CONST_2048, PY_2); + + vis_psub16(PV_0, CONST_1024, PV_0); + vis_mul8x16au(TMP8, CONST_2048, PY_4); + + vis_psub16(PY_0, CONST_128, PY_0); + vis_mul8x16au(TMP9, CONST_2048, PY_6); + + vis_psub16(PY_2, CONST_128, PY_2); + vis_mul8x16(CONST_YCOEFF, PY_0, PY_0); + + vis_psub16(PY_4, CONST_128, PY_4); + vis_mul8x16(CONST_YCOEFF, PY_2, PY_2); + + vis_psub16(PY_6, CONST_128, PY_6); + vis_mul8x16(CONST_YCOEFF, PY_4, PY_4); + + vis_mul8x16(CONST_YCOEFF, PY_6, PY_6); + + vis_mul8sux16(CONST_UGREEN, PU_0, TMP0); + + vis_mul8sux16(CONST_VGREEN, PV_0, TMP2); + + vis_mul8x16(CONST_UBLUE, PU_0, TMP4); + + vis_mul8x16(CONST_VRED, PV_0, TMP6); + vis_padd16(TMP0, TMP2, TMP10); + + vis_padd16(PY_0, TMP4, TMP0); + + vis_padd16(PY_2, TMP4, TMP2); + vis_pack16(TMP0, BLUE8_EVEN); + + vis_padd16(PY_4, TMP4, TMP0); + vis_pack16(TMP2, BLUE8_ODD); + + vis_padd16(PY_6, TMP4, TMP2); + vis_pack16(TMP0, BLUE8_2_EVEN); + + vis_padd16(PY_0, TMP6, TMP0); + vis_pack16(TMP2, BLUE8_2_ODD); + + vis_padd16(PY_2, TMP6, TMP2); + vis_pack16(TMP0, RED8_EVEN); + + vis_padd16(PY_4, TMP6, TMP0); + vis_pack16(TMP2, RED8_ODD); + + vis_padd16(PY_6, TMP6, TMP2); + vis_pack16(TMP0, RED8_2_EVEN); + + vis_padd16(PY_0, TMP10, TMP0); + vis_pack16(TMP2, RED8_2_ODD); + + vis_padd16(PY_2, TMP10, TMP2); + vis_pack16(TMP0, GREEN8_EVEN); + + vis_padd16(PY_4, TMP10, TMP0); + vis_pack16(TMP2, GREEN8_ODD); + + vis_padd16(PY_6, TMP10, TMP2); + vis_pack16(TMP0, GREEN8_2_EVEN); + + vis_pack16(TMP2, GREEN8_2_ODD); + vis_pmerge(BLUE8_EVEN, BLUE8_ODD, BLUE8_EVEN); + + vis_pmerge(BLUE8_2_EVEN, BLUE8_2_ODD, BLUE8_2_EVEN); + + vis_pmerge(RED8_EVEN, RED8_ODD, RED8_EVEN); + + vis_pmerge(RED8_2_EVEN, RED8_2_ODD, RED8_2_EVEN); + + vis_pmerge(GREEN8_EVEN, GREEN8_ODD, GREEN8_EVEN); + + vis_pmerge(GREEN8_2_EVEN, GREEN8_2_ODD, GREEN8_2_EVEN); +} + +static inline void vis_unpack_32rgb(uint8_t *image, int stride) +{ + vis_pmerge(ZEROS, GREEN8_EVEN, TMP0); + vis_pmerge(RED8_EVEN, BLUE8_EVEN, TMP2); + + vis_pmerge(TMP0, TMP2, TMP4); + vis_st64(TMP4, image[0]); + + vis_pmerge(TMP1, TMP3, TMP6); + vis_st64_2(TMP6, image, 8); + + vis_pmerge(ZEROS, GREEN8_ODD, TMP8); + vis_pmerge(RED8_ODD, BLUE8_ODD, TMP10); + + vis_pmerge(TMP8, TMP10, TMP0); + vis_st64_2(TMP0, image, 16); + + vis_pmerge(TMP9, TMP11, TMP2); + vis_st64_2(TMP2, image, 24); + + image += stride; + + vis_pmerge(ZEROS, GREEN8_2_EVEN, TMP0); + vis_pmerge(RED8_2_EVEN, BLUE8_2_EVEN, TMP2); + + vis_pmerge(TMP0, TMP2, TMP4); + vis_st64(TMP4, image[0]); + + vis_pmerge(TMP1, TMP3, TMP6); + vis_st64_2(TMP6, image, 8); + + vis_pmerge(ZEROS, GREEN8_2_ODD, TMP8); + vis_pmerge(RED8_2_ODD, BLUE8_2_ODD, TMP10); + + vis_pmerge(TMP8, TMP10, TMP0); + vis_st64_2(TMP0, image, 16); + + vis_pmerge(TMP9, TMP11, TMP2); + vis_st64_2(TMP2, image, 24); +} + +static inline void vis_unpack_32bgr(uint8_t *image, int stride) +{ + vis_pmerge(ZEROS, GREEN8_EVEN, TMP0); + vis_pmerge(BLUE8_EVEN, RED8_EVEN, TMP2); + + vis_pmerge(TMP0, TMP2, TMP4); + vis_st64(TMP4, image[0]); + + vis_pmerge(TMP1, TMP3, TMP6); + vis_st64_2(TMP6, image, 8); + + vis_pmerge(ZEROS, GREEN8_ODD, TMP8); + vis_pmerge(BLUE8_ODD, RED8_ODD, TMP10); + + vis_pmerge(TMP8, TMP10, TMP0); + vis_st64_2(TMP0, image, 16); + + vis_pmerge(TMP9, TMP11, TMP2); + vis_st64_2(TMP2, image, 24); + + image += stride; + + vis_pmerge(ZEROS, GREEN8_2_EVEN, TMP0); + vis_pmerge(BLUE8_2_EVEN, RED8_2_EVEN, TMP2); + + vis_pmerge(TMP0, TMP2, TMP4); + vis_st64(TMP4, image[0]); + + vis_pmerge(TMP1, TMP3, TMP6); + vis_st64_2(TMP6, image, 8); + + vis_pmerge(ZEROS, GREEN8_2_ODD, TMP8); + vis_pmerge(BLUE8_2_ODD, RED8_2_ODD, TMP10); + + vis_pmerge(TMP8, TMP10, TMP0); + vis_st64_2(TMP0, image, 16); + + vis_pmerge(TMP9, TMP11, TMP2); + vis_st64_2(TMP2, image, 24); +} + +static inline void vis_yuv420_argb32(uint8_t *image, + uint8_t *py, uint8_t *pu, uint8_t *pv, + int width, int height, int rgb_stride, + int y_stride, int uv_stride) +{ + height >>= 1; + uv_stride -= width >> 1; + do { + int i = width >> 3; + do { + vis_yuv2rgb(py, pu, pv, y_stride); + vis_unpack_32rgb(image, rgb_stride); + py += 8; + pu += 4; + pv += 4; + image += 32; + } while (--i); + + py += (y_stride << 1) - width; + image += (rgb_stride << 1) - 4 * width; + pu += uv_stride; + pv += uv_stride; + } while (--height); +} + +static inline void vis_yuv420_abgr32(uint8_t *image, + uint8_t *py, uint8_t *pu, uint8_t *pv, + int width, int height, int rgb_stride, + int y_stride, int uv_stride) +{ + height >>= 1; + uv_stride -= width >> 1; + do { + int i = width >> 3; + do { + vis_yuv2rgb(py, pu, pv, y_stride); + vis_unpack_32bgr(image, rgb_stride); + py += 8; + pu += 4; + pv += 4; + image += 32; + } while (--i); + + py += (y_stride << 1) - width; + image += (rgb_stride << 1) - 4 * width; + pu += uv_stride; + pv += uv_stride; + } while (--height); +} + +static void vis_argb32(void *_id, uint8_t * const *src, + unsigned int v_offset) +{ + convert_rgb_t *id = (convert_rgb_t *) _id; + + vis_init_consts(); + vis_yuv420_argb32(id->rgb_ptr + id->rgb_stride * v_offset, + src[0], src[1], src[2], id->width, 16, + id->rgb_stride, id->y_stride, id->y_stride >> 1); +} + +static void vis_abgr32(void *_id, uint8_t * const *src, + unsigned int v_offset) +{ + convert_rgb_t *id = (convert_rgb_t *) _id; + + vis_init_consts(); + vis_yuv420_abgr32(id->rgb_ptr + id->rgb_stride * v_offset, + src[0], src[1], src[2], id->width, 16, + id->rgb_stride, id->y_stride, id->y_stride >> 1); +} + +mpeg2convert_copy_t *mpeg2convert_rgb_vis(int order, int bpp, + const mpeg2_sequence_t * seq) +{ + if (bpp == 32 && seq->chroma_height < seq->height) { + if (order == MPEG2CONVERT_RGB) + return vis_argb32; + if (order == MPEG2CONVERT_BGR) + return vis_abgr32; + } + + return NULL; /* Fallback to C */ +} + +#endif /* ARCH_SPARC */ diff --git a/k9decmpeg/slice.cpp b/k9decmpeg/slice.cpp new file mode 100755 index 0000000..2c25bb1 --- /dev/null +++ b/k9decmpeg/slice.cpp @@ -0,0 +1,2058 @@ +/* + * slice.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 2003 Peter Gubanov + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#include "k9common.h" + +#include "mpeg2.h" +#include "attributes.h" +#include "mpeg2_internal.h" + +extern mpeg2_mc_t mpeg2_mc; +extern void (* mpeg2_idct_copy) (int16_t * block, uint8_t * dest, int stride); +extern void (* mpeg2_idct_add) (int last, int16_t * block, + uint8_t * dest, int stride); +extern void (* mpeg2_cpu_state_save) (cpu_state_t * state); +extern void (* mpeg2_cpu_state_restore) (cpu_state_t * state); + +#include "vlc.h" + +static inline int get_macroblock_modes (mpeg2_decoder_t * const decoder) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + int macroblock_modes; + const MBtab * tab; + + switch (decoder->coding_type) { + case I_TYPE: + + tab = MB_I + UBITS (bit_buf, 1); + DUMPBITS (bit_buf, bits, tab->len); + macroblock_modes = tab->modes; + + if ((! (decoder->frame_pred_frame_dct)) && + (decoder->picture_structure == FRAME_PICTURE)) { + macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED; + DUMPBITS (bit_buf, bits, 1); + } + + return macroblock_modes; + + case P_TYPE: + + tab = MB_P + UBITS (bit_buf, 5); + DUMPBITS (bit_buf, bits, tab->len); + macroblock_modes = tab->modes; + + if (decoder->picture_structure != FRAME_PICTURE) { + if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) { + macroblock_modes |= UBITS (bit_buf, 2) << MOTION_TYPE_SHIFT; + DUMPBITS (bit_buf, bits, 2); + } + return macroblock_modes | MACROBLOCK_MOTION_FORWARD; + } else if (decoder->frame_pred_frame_dct) { + if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) + macroblock_modes |= MC_FRAME << MOTION_TYPE_SHIFT; + return macroblock_modes | MACROBLOCK_MOTION_FORWARD; + } else { + if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) { + macroblock_modes |= UBITS (bit_buf, 2) << MOTION_TYPE_SHIFT; + DUMPBITS (bit_buf, bits, 2); + } + if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) { + macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED; + DUMPBITS (bit_buf, bits, 1); + } + return macroblock_modes | MACROBLOCK_MOTION_FORWARD; + } + + case B_TYPE: + + tab = MB_B + UBITS (bit_buf, 6); + DUMPBITS (bit_buf, bits, tab->len); + macroblock_modes = tab->modes; + + if (decoder->picture_structure != FRAME_PICTURE) { + if (! (macroblock_modes & MACROBLOCK_INTRA)) { + macroblock_modes |= UBITS (bit_buf, 2) << MOTION_TYPE_SHIFT; + DUMPBITS (bit_buf, bits, 2); + } + return macroblock_modes; + } else if (decoder->frame_pred_frame_dct) { + /* if (! (macroblock_modes & MACROBLOCK_INTRA)) */ + macroblock_modes |= MC_FRAME << MOTION_TYPE_SHIFT; + return macroblock_modes; + } else { + if (macroblock_modes & MACROBLOCK_INTRA) + goto intra; + macroblock_modes |= UBITS (bit_buf, 2) << MOTION_TYPE_SHIFT; + DUMPBITS (bit_buf, bits, 2); + if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) { + intra: + macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED; + DUMPBITS (bit_buf, bits, 1); + } + return macroblock_modes; + } + + case D_TYPE: + + DUMPBITS (bit_buf, bits, 1); + return MACROBLOCK_INTRA; + + default: + return 0; + } +#undef bit_buf +#undef bits +#undef bit_ptr +} + +static inline void get_quantizer_scale (mpeg2_decoder_t * const decoder) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + + int quantizer_scale_code; + + quantizer_scale_code = UBITS (bit_buf, 5); + DUMPBITS (bit_buf, bits, 5); + + decoder->quantizer_matrix[0] = + decoder->quantizer_prescale[0][quantizer_scale_code]; + decoder->quantizer_matrix[1] = + decoder->quantizer_prescale[1][quantizer_scale_code]; + decoder->quantizer_matrix[2] = + decoder->chroma_quantizer[0][quantizer_scale_code]; + decoder->quantizer_matrix[3] = + decoder->chroma_quantizer[1][quantizer_scale_code]; +#undef bit_buf +#undef bits +#undef bit_ptr +} + +static inline int get_motion_delta (mpeg2_decoder_t * const decoder, + const int f_code) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + + int delta; + int sign; + const MVtab * tab; + + if (bit_buf & 0x80000000) { + DUMPBITS (bit_buf, bits, 1); + return 0; + } else if (bit_buf >= 0x0c000000) { + + tab = MV_4 + UBITS (bit_buf, 4); + delta = (tab->delta << f_code) + 1; + bits += tab->len + f_code + 1; + bit_buf <<= tab->len; + + sign = SBITS (bit_buf, 1); + bit_buf <<= 1; + + if (f_code) + delta += UBITS (bit_buf, f_code); + bit_buf <<= f_code; + + return (delta ^ sign) - sign; + + } else { + + tab = MV_10 + UBITS (bit_buf, 10); + delta = (tab->delta << f_code) + 1; + bits += tab->len + 1; + bit_buf <<= tab->len; + + sign = SBITS (bit_buf, 1); + bit_buf <<= 1; + + if (f_code) { + NEEDBITS (bit_buf, bits, bit_ptr); + delta += UBITS (bit_buf, f_code); + DUMPBITS (bit_buf, bits, f_code); + } + + return (delta ^ sign) - sign; + + } +#undef bit_buf +#undef bits +#undef bit_ptr +} + +static inline int bound_motion_vector (const int vector, const int f_code) +{ + return ((int32_t)vector << (27 - f_code)) >> (27 - f_code); +} + +static inline int get_dmv (mpeg2_decoder_t * const decoder) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + + const DMVtab * tab; + + tab = DMV_2 + UBITS (bit_buf, 2); + DUMPBITS (bit_buf, bits, tab->len); + return tab->dmv; +#undef bit_buf +#undef bits +#undef bit_ptr +} + +static inline int get_coded_block_pattern (mpeg2_decoder_t * const decoder) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + + const CBPtab * tab; + + NEEDBITS (bit_buf, bits, bit_ptr); + + if (bit_buf >= 0x20000000) { + + tab = CBP_7 + (UBITS (bit_buf, 7) - 16); + DUMPBITS (bit_buf, bits, tab->len); + return tab->cbp; + + } else { + + tab = CBP_9 + UBITS (bit_buf, 9); + DUMPBITS (bit_buf, bits, tab->len); + return tab->cbp; + } + +#undef bit_buf +#undef bits +#undef bit_ptr +} + +static inline int get_luma_dc_dct_diff (mpeg2_decoder_t * const decoder) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + const DCtab * tab; + int size; + int dc_diff; + + if (bit_buf < 0xf8000000) { + tab = DC_lum_5 + UBITS (bit_buf, 5); + size = tab->size; + if (size) { + bits += tab->len + size; + bit_buf <<= tab->len; + dc_diff = + UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size); + bit_buf <<= size; + return dc_diff << decoder->intra_dc_precision; + } else { + DUMPBITS (bit_buf, bits, 3); + return 0; + } + } else { + tab = DC_long + (UBITS (bit_buf, 9) - 0x1e0); + size = tab->size; + DUMPBITS (bit_buf, bits, tab->len); + NEEDBITS (bit_buf, bits, bit_ptr); + dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size); + DUMPBITS (bit_buf, bits, size); + return dc_diff << decoder->intra_dc_precision; + } +#undef bit_buf +#undef bits +#undef bit_ptr +} + +static inline int get_chroma_dc_dct_diff (mpeg2_decoder_t * const decoder) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + const DCtab * tab; + int size; + int dc_diff; + + if (bit_buf < 0xf8000000) { + tab = DC_chrom_5 + UBITS (bit_buf, 5); + size = tab->size; + if (size) { + bits += tab->len + size; + bit_buf <<= tab->len; + dc_diff = + UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size); + bit_buf <<= size; + return dc_diff << decoder->intra_dc_precision; + } else { + DUMPBITS (bit_buf, bits, 2); + return 0; + } + } else { + tab = DC_long + (UBITS (bit_buf, 10) - 0x3e0); + size = tab->size; + DUMPBITS (bit_buf, bits, tab->len + 1); + NEEDBITS (bit_buf, bits, bit_ptr); + dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size); + DUMPBITS (bit_buf, bits, size); + return dc_diff << decoder->intra_dc_precision; + } +#undef bit_buf +#undef bits +#undef bit_ptr +} + +#define SATURATE(val) \ +do { \ + val <<= 4; \ + if (unlikely (val != (int16_t) val)) \ + val = (SBITS (val, 1) ^ 2047) << 4; \ +} while (0) + +static void get_intra_block_B14 (mpeg2_decoder_t * const decoder, + const uint16_t * const quant_matrix) +{ + int i; + int j; + int val; + const uint8_t * const scan = decoder->scan; + int mismatch; + const DCTtab * tab; + uint32_t bit_buf; + int bits; + const uint8_t * bit_ptr; + int16_t * const dest = decoder->DCTblock; + + i = 0; + mismatch = ~dest[0]; + + bit_buf = decoder->bitstream_buf; + bits = decoder->bitstream_bits; + bit_ptr = decoder->bitstream_ptr; + + NEEDBITS (bit_buf, bits, bit_ptr); + + while (1) { + if (bit_buf >= 0x28000000) { + + tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5); + + i += tab->run; + if (i >= 64) + break; /* end of block */ + + normal_code: + j = scan[i]; + bit_buf <<= tab->len; + bits += tab->len + 1; + val = (tab->level * quant_matrix[j]) >> 4; + + /* if (bitstream_get (1)) val = -val; */ + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + + SATURATE (val); + dest[j] = val; + mismatch ^= val; + + bit_buf <<= 1; + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } else if (bit_buf >= 0x04000000) { + + tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) + goto normal_code; + + /* escape code */ + + i += UBITS (bit_buf << 6, 6) - 64; + if (i >= 64) + break; /* illegal, check needed to avoid buffer overflow */ + + j = scan[i]; + + DUMPBITS (bit_buf, bits, 12); + NEEDBITS (bit_buf, bits, bit_ptr); + val = (SBITS (bit_buf, 12) * quant_matrix[j]) / 16; + + SATURATE (val); + dest[j] = val; + mismatch ^= val; + + DUMPBITS (bit_buf, bits, 12); + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } else if (bit_buf >= 0x02000000) { + tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00800000) { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00200000) { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else { + tab = DCT_16 + UBITS (bit_buf, 16); + bit_buf <<= 16; + GETWORD (bit_buf, bits + 16, bit_ptr); + i += tab->run; + if (i < 64) + goto normal_code; + } + break; /* illegal, check needed to avoid buffer overflow */ + } + dest[63] ^= mismatch & 16; + DUMPBITS (bit_buf, bits, 2); /* dump end of block code */ + decoder->bitstream_buf = bit_buf; + decoder->bitstream_bits = bits; + decoder->bitstream_ptr = bit_ptr; +} + +static void get_intra_block_B15 (mpeg2_decoder_t * const decoder, + const uint16_t * const quant_matrix) +{ + int i; + int j; + int val; + const uint8_t * const scan = decoder->scan; + int mismatch; + const DCTtab * tab; + uint32_t bit_buf; + int bits; + const uint8_t * bit_ptr; + int16_t * const dest = decoder->DCTblock; + + i = 0; + mismatch = ~dest[0]; + + bit_buf = decoder->bitstream_buf; + bits = decoder->bitstream_bits; + bit_ptr = decoder->bitstream_ptr; + + NEEDBITS (bit_buf, bits, bit_ptr); + + while (1) { + if (bit_buf >= 0x04000000) { + + tab = DCT_B15_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) { + + normal_code: + j = scan[i]; + bit_buf <<= tab->len; + bits += tab->len + 1; + val = (tab->level * quant_matrix[j]) >> 4; + + /* if (bitstream_get (1)) val = -val; */ + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + + SATURATE (val); + dest[j] = val; + mismatch ^= val; + + bit_buf <<= 1; + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } else { + + /* end of block. I commented out this code because if we */ + /* dont exit here we will still exit at the later test :) */ + + /* if (i >= 128) break; */ /* end of block */ + + /* escape code */ + + i += UBITS (bit_buf << 6, 6) - 64; + if (i >= 64) + break; /* illegal, check against buffer overflow */ + + j = scan[i]; + + DUMPBITS (bit_buf, bits, 12); + NEEDBITS (bit_buf, bits, bit_ptr); + val = (SBITS (bit_buf, 12) * quant_matrix[j]) / 16; + + SATURATE (val); + dest[j] = val; + mismatch ^= val; + + DUMPBITS (bit_buf, bits, 12); + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } + } else if (bit_buf >= 0x02000000) { + tab = DCT_B15_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00800000) { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00200000) { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else { + tab = DCT_16 + UBITS (bit_buf, 16); + bit_buf <<= 16; + GETWORD (bit_buf, bits + 16, bit_ptr); + i += tab->run; + if (i < 64) + goto normal_code; + } + break; /* illegal, check needed to avoid buffer overflow */ + } + dest[63] ^= mismatch & 16; + DUMPBITS (bit_buf, bits, 4); /* dump end of block code */ + decoder->bitstream_buf = bit_buf; + decoder->bitstream_bits = bits; + decoder->bitstream_ptr = bit_ptr; +} + +static int get_non_intra_block (mpeg2_decoder_t * const decoder, + const uint16_t * const quant_matrix) +{ + int i; + int j; + int val; + const uint8_t * const scan = decoder->scan; + int mismatch; + const DCTtab * tab; + uint32_t bit_buf; + int bits; + const uint8_t * bit_ptr; + int16_t * const dest = decoder->DCTblock; + + i = -1; + mismatch = -1; + + bit_buf = decoder->bitstream_buf; + bits = decoder->bitstream_bits; + bit_ptr = decoder->bitstream_ptr; + + NEEDBITS (bit_buf, bits, bit_ptr); + if (bit_buf >= 0x28000000) { + tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5); + goto entry_1; + } else + goto entry_2; + + while (1) { + if (bit_buf >= 0x28000000) { + + tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5); + + entry_1: + i += tab->run; + if (i >= 64) + break; /* end of block */ + + normal_code: + j = scan[i]; + bit_buf <<= tab->len; + bits += tab->len + 1; + val = ((2 * tab->level + 1) * quant_matrix[j]) >> 5; + + /* if (bitstream_get (1)) val = -val; */ + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + + SATURATE (val); + dest[j] = val; + mismatch ^= val; + + bit_buf <<= 1; + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } + + entry_2: + if (bit_buf >= 0x04000000) { + + tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) + goto normal_code; + + /* escape code */ + + i += UBITS (bit_buf << 6, 6) - 64; + if (i >= 64) + break; /* illegal, check needed to avoid buffer overflow */ + + j = scan[i]; + + DUMPBITS (bit_buf, bits, 12); + NEEDBITS (bit_buf, bits, bit_ptr); + val = 2 * (SBITS (bit_buf, 12) + SBITS (bit_buf, 1)) + 1; + val = (val * quant_matrix[j]) / 32; + + SATURATE (val); + dest[j] = val; + mismatch ^= val; + + DUMPBITS (bit_buf, bits, 12); + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } else if (bit_buf >= 0x02000000) { + tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00800000) { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00200000) { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else { + tab = DCT_16 + UBITS (bit_buf, 16); + bit_buf <<= 16; + GETWORD (bit_buf, bits + 16, bit_ptr); + i += tab->run; + if (i < 64) + goto normal_code; + } + break; /* illegal, check needed to avoid buffer overflow */ + } + dest[63] ^= mismatch & 16; + DUMPBITS (bit_buf, bits, 2); /* dump end of block code */ + decoder->bitstream_buf = bit_buf; + decoder->bitstream_bits = bits; + decoder->bitstream_ptr = bit_ptr; + return i; +} + +static void get_mpeg1_intra_block (mpeg2_decoder_t * const decoder) +{ + int i; + int j; + int val; + const uint8_t * const scan = decoder->scan; + const uint16_t * const quant_matrix = decoder->quantizer_matrix[0]; + const DCTtab * tab; + uint32_t bit_buf; + int bits; + const uint8_t * bit_ptr; + int16_t * const dest = decoder->DCTblock; + + i = 0; + + bit_buf = decoder->bitstream_buf; + bits = decoder->bitstream_bits; + bit_ptr = decoder->bitstream_ptr; + + NEEDBITS (bit_buf, bits, bit_ptr); + + while (1) { + if (bit_buf >= 0x28000000) { + + tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5); + + i += tab->run; + if (i >= 64) + break; /* end of block */ + + normal_code: + j = scan[i]; + bit_buf <<= tab->len; + bits += tab->len + 1; + val = (tab->level * quant_matrix[j]) >> 4; + + /* oddification */ + val = (val - 1) | 1; + + /* if (bitstream_get (1)) val = -val; */ + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + + SATURATE (val); + dest[j] = val; + + bit_buf <<= 1; + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } else if (bit_buf >= 0x04000000) { + + tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) + goto normal_code; + + /* escape code */ + + i += UBITS (bit_buf << 6, 6) - 64; + if (i >= 64) + break; /* illegal, check needed to avoid buffer overflow */ + + j = scan[i]; + + DUMPBITS (bit_buf, bits, 12); + NEEDBITS (bit_buf, bits, bit_ptr); + val = SBITS (bit_buf, 8); + if (! (val & 0x7f)) { + DUMPBITS (bit_buf, bits, 8); + val = UBITS (bit_buf, 8) + 2 * val; + } + val = (val * quant_matrix[j]) / 16; + + /* oddification */ + val = (val + ~SBITS (val, 1)) | 1; + + SATURATE (val); + dest[j] = val; + + DUMPBITS (bit_buf, bits, 8); + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } else if (bit_buf >= 0x02000000) { + tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00800000) { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00200000) { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else { + tab = DCT_16 + UBITS (bit_buf, 16); + bit_buf <<= 16; + GETWORD (bit_buf, bits + 16, bit_ptr); + i += tab->run; + if (i < 64) + goto normal_code; + } + break; /* illegal, check needed to avoid buffer overflow */ + } + DUMPBITS (bit_buf, bits, 2); /* dump end of block code */ + decoder->bitstream_buf = bit_buf; + decoder->bitstream_bits = bits; + decoder->bitstream_ptr = bit_ptr; +} + +static int get_mpeg1_non_intra_block (mpeg2_decoder_t * const decoder) +{ + int i; + int j; + int val; + const uint8_t * const scan = decoder->scan; + const uint16_t * const quant_matrix = decoder->quantizer_matrix[1]; + const DCTtab * tab; + uint32_t bit_buf; + int bits; + const uint8_t * bit_ptr; + int16_t * const dest = decoder->DCTblock; + + i = -1; + + bit_buf = decoder->bitstream_buf; + bits = decoder->bitstream_bits; + bit_ptr = decoder->bitstream_ptr; + + NEEDBITS (bit_buf, bits, bit_ptr); + if (bit_buf >= 0x28000000) { + tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5); + goto entry_1; + } else + goto entry_2; + + while (1) { + if (bit_buf >= 0x28000000) { + + tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5); + + entry_1: + i += tab->run; + if (i >= 64) + break; /* end of block */ + + normal_code: + j = scan[i]; + bit_buf <<= tab->len; + bits += tab->len + 1; + val = ((2 * tab->level + 1) * quant_matrix[j]) >> 5; + + /* oddification */ + val = (val - 1) | 1; + + /* if (bitstream_get (1)) val = -val; */ + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + + SATURATE (val); + dest[j] = val; + + bit_buf <<= 1; + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } + + entry_2: + if (bit_buf >= 0x04000000) { + + tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) + goto normal_code; + + /* escape code */ + + i += UBITS (bit_buf << 6, 6) - 64; + if (i >= 64) + break; /* illegal, check needed to avoid buffer overflow */ + + j = scan[i]; + + DUMPBITS (bit_buf, bits, 12); + NEEDBITS (bit_buf, bits, bit_ptr); + val = SBITS (bit_buf, 8); + if (! (val & 0x7f)) { + DUMPBITS (bit_buf, bits, 8); + val = UBITS (bit_buf, 8) + 2 * val; + } + val = 2 * (val + SBITS (val, 1)) + 1; + val = (val * quant_matrix[j]) / 32; + + /* oddification */ + val = (val + ~SBITS (val, 1)) | 1; + + SATURATE (val); + dest[j] = val; + + DUMPBITS (bit_buf, bits, 8); + NEEDBITS (bit_buf, bits, bit_ptr); + + continue; + + } else if (bit_buf >= 0x02000000) { + tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00800000) { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else if (bit_buf >= 0x00200000) { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) + goto normal_code; + } else { + tab = DCT_16 + UBITS (bit_buf, 16); + bit_buf <<= 16; + GETWORD (bit_buf, bits + 16, bit_ptr); + i += tab->run; + if (i < 64) + goto normal_code; + } + break; /* illegal, check needed to avoid buffer overflow */ + } + DUMPBITS (bit_buf, bits, 2); /* dump end of block code */ + decoder->bitstream_buf = bit_buf; + decoder->bitstream_bits = bits; + decoder->bitstream_ptr = bit_ptr; + return i; +} + +static inline void slice_intra_DCT (mpeg2_decoder_t * const decoder, + const int cc, + uint8_t * const dest, const int stride) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + NEEDBITS (bit_buf, bits, bit_ptr); + /* Get the intra DC coefficient and inverse quantize it */ + if (cc == 0) + decoder->DCTblock[0] = + decoder->dc_dct_pred[0] += get_luma_dc_dct_diff (decoder); + else + decoder->DCTblock[0] = + decoder->dc_dct_pred[cc] += get_chroma_dc_dct_diff (decoder); + + if (decoder->mpeg1) { + if (decoder->coding_type != D_TYPE) + get_mpeg1_intra_block (decoder); + } else if (decoder->intra_vlc_format) + get_intra_block_B15 (decoder, decoder->quantizer_matrix[cc ? 2 : 0]); + else + get_intra_block_B14 (decoder, decoder->quantizer_matrix[cc ? 2 : 0]); + mpeg2_idct_copy (decoder->DCTblock, dest, stride); +#undef bit_buf +#undef bits +#undef bit_ptr +} + +static inline void slice_non_intra_DCT (mpeg2_decoder_t * const decoder, + const int cc, + uint8_t * const dest, const int stride) +{ + int last; + + if (decoder->mpeg1) + last = get_mpeg1_non_intra_block (decoder); + else + last = get_non_intra_block (decoder, + decoder->quantizer_matrix[cc ? 3 : 1]); + mpeg2_idct_add (last, decoder->DCTblock, dest, stride); +} + +#define MOTION_420(table,ref,motion_x,motion_y,size,y) \ + pos_x = 2 * decoder->offset + motion_x; \ + pos_y = 2 * decoder->v_offset + motion_y + 2 * y; \ + if (unlikely (pos_x > decoder->limit_x)) { \ + pos_x = ((int)pos_x < 0) ? 0 : decoder->limit_x; \ + motion_x = pos_x - 2 * decoder->offset; \ + } \ + if (unlikely (pos_y > decoder->limit_y_ ## size)) { \ + pos_y = ((int)pos_y < 0) ? 0 : decoder->limit_y_ ## size; \ + motion_y = pos_y - 2 * decoder->v_offset - 2 * y; \ + } \ + xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \ + table[xy_half] (decoder->dest[0] + y * decoder->stride + decoder->offset, \ + ref[0] + (pos_x >> 1) + (pos_y >> 1) * decoder->stride, \ + decoder->stride, size); \ + motion_x /= 2; motion_y /= 2; \ + xy_half = ((motion_y & 1) << 1) | (motion_x & 1); \ + offset = (((decoder->offset + motion_x) >> 1) + \ + ((((decoder->v_offset + motion_y) >> 1) + y/2) * \ + decoder->uv_stride)); \ + table[4+xy_half] (decoder->dest[1] + y/2 * decoder->uv_stride + \ + (decoder->offset >> 1), ref[1] + offset, \ + decoder->uv_stride, size/2); \ + table[4+xy_half] (decoder->dest[2] + y/2 * decoder->uv_stride + \ + (decoder->offset >> 1), ref[2] + offset, \ + decoder->uv_stride, size/2) + +#define MOTION_FIELD_420(table,ref,motion_x,motion_y,dest_field,op,src_field) \ + pos_x = 2 * decoder->offset + motion_x; \ + pos_y = decoder->v_offset + motion_y; \ + if (unlikely (pos_x > decoder->limit_x)) { \ + pos_x = ((int)pos_x < 0) ? 0 : decoder->limit_x; \ + motion_x = pos_x - 2 * decoder->offset; \ + } \ + if (unlikely (pos_y > decoder->limit_y)) { \ + pos_y = ((int)pos_y < 0) ? 0 : decoder->limit_y; \ + motion_y = pos_y - decoder->v_offset; \ + } \ + xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \ + table[xy_half] (decoder->dest[0] + dest_field * decoder->stride + \ + decoder->offset, \ + (ref[0] + (pos_x >> 1) + \ + ((pos_y op) + src_field) * decoder->stride), \ + 2 * decoder->stride, 8); \ + motion_x /= 2; motion_y /= 2; \ + xy_half = ((motion_y & 1) << 1) | (motion_x & 1); \ + offset = (((decoder->offset + motion_x) >> 1) + \ + (((decoder->v_offset >> 1) + (motion_y op) + src_field) * \ + decoder->uv_stride)); \ + table[4+xy_half] (decoder->dest[1] + dest_field * decoder->uv_stride + \ + (decoder->offset >> 1), ref[1] + offset, \ + 2 * decoder->uv_stride, 4); \ + table[4+xy_half] (decoder->dest[2] + dest_field * decoder->uv_stride + \ + (decoder->offset >> 1), ref[2] + offset, \ + 2 * decoder->uv_stride, 4) + +#define MOTION_DMV_420(table,ref,motion_x,motion_y) \ + pos_x = 2 * decoder->offset + motion_x; \ + pos_y = decoder->v_offset + motion_y; \ + if (unlikely (pos_x > decoder->limit_x)) { \ + pos_x = ((int)pos_x < 0) ? 0 : decoder->limit_x; \ + motion_x = pos_x - 2 * decoder->offset; \ + } \ + if (unlikely (pos_y > decoder->limit_y)) { \ + pos_y = ((int)pos_y < 0) ? 0 : decoder->limit_y; \ + motion_y = pos_y - decoder->v_offset; \ + } \ + xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \ + offset = (pos_x >> 1) + (pos_y & ~1) * decoder->stride; \ + table[xy_half] (decoder->dest[0] + decoder->offset, \ + ref[0] + offset, 2 * decoder->stride, 8); \ + table[xy_half] (decoder->dest[0] + decoder->stride + decoder->offset, \ + ref[0] + decoder->stride + offset, \ + 2 * decoder->stride, 8); \ + motion_x /= 2; motion_y /= 2; \ + xy_half = ((motion_y & 1) << 1) | (motion_x & 1); \ + offset = (((decoder->offset + motion_x) >> 1) + \ + (((decoder->v_offset >> 1) + (motion_y & ~1)) * \ + decoder->uv_stride)); \ + table[4+xy_half] (decoder->dest[1] + (decoder->offset >> 1), \ + ref[1] + offset, 2 * decoder->uv_stride, 4); \ + table[4+xy_half] (decoder->dest[1] + decoder->uv_stride + \ + (decoder->offset >> 1), \ + ref[1] + decoder->uv_stride + offset, \ + 2 * decoder->uv_stride, 4); \ + table[4+xy_half] (decoder->dest[2] + (decoder->offset >> 1), \ + ref[2] + offset, 2 * decoder->uv_stride, 4); \ + table[4+xy_half] (decoder->dest[2] + decoder->uv_stride + \ + (decoder->offset >> 1), \ + ref[2] + decoder->uv_stride + offset, \ + 2 * decoder->uv_stride, 4) + +#define MOTION_ZERO_420(table,ref) \ + table[0] (decoder->dest[0] + decoder->offset, \ + (ref[0] + decoder->offset + \ + decoder->v_offset * decoder->stride), decoder->stride, 16); \ + offset = ((decoder->offset >> 1) + \ + (decoder->v_offset >> 1) * decoder->uv_stride); \ + table[4] (decoder->dest[1] + (decoder->offset >> 1), \ + ref[1] + offset, decoder->uv_stride, 8); \ + table[4] (decoder->dest[2] + (decoder->offset >> 1), \ + ref[2] + offset, decoder->uv_stride, 8) + +#define MOTION_422(table,ref,motion_x,motion_y,size,y) \ + pos_x = 2 * decoder->offset + motion_x; \ + pos_y = 2 * decoder->v_offset + motion_y + 2 * y; \ + if (unlikely (pos_x > decoder->limit_x)) { \ + pos_x = ((int)pos_x < 0) ? 0 : decoder->limit_x; \ + motion_x = pos_x - 2 * decoder->offset; \ + } \ + if (unlikely (pos_y > decoder->limit_y_ ## size)) { \ + pos_y = ((int)pos_y < 0) ? 0 : decoder->limit_y_ ## size; \ + motion_y = pos_y - 2 * decoder->v_offset - 2 * y; \ + } \ + xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \ + offset = (pos_x >> 1) + (pos_y >> 1) * decoder->stride; \ + table[xy_half] (decoder->dest[0] + y * decoder->stride + decoder->offset, \ + ref[0] + offset, decoder->stride, size); \ + offset = (offset + (motion_x & (motion_x < 0))) >> 1; \ + motion_x /= 2; \ + xy_half = ((pos_y & 1) << 1) | (motion_x & 1); \ + table[4+xy_half] (decoder->dest[1] + y * decoder->uv_stride + \ + (decoder->offset >> 1), ref[1] + offset, \ + decoder->uv_stride, size); \ + table[4+xy_half] (decoder->dest[2] + y * decoder->uv_stride + \ + (decoder->offset >> 1), ref[2] + offset, \ + decoder->uv_stride, size) + +#define MOTION_FIELD_422(table,ref,motion_x,motion_y,dest_field,op,src_field) \ + pos_x = 2 * decoder->offset + motion_x; \ + pos_y = decoder->v_offset + motion_y; \ + if (unlikely (pos_x > decoder->limit_x)) { \ + pos_x = ((int)pos_x < 0) ? 0 : decoder->limit_x; \ + motion_x = pos_x - 2 * decoder->offset; \ + } \ + if (unlikely (pos_y > decoder->limit_y)) { \ + pos_y = ((int)pos_y < 0) ? 0 : decoder->limit_y; \ + motion_y = pos_y - decoder->v_offset; \ + } \ + xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \ + offset = (pos_x >> 1) + ((pos_y op) + src_field) * decoder->stride; \ + table[xy_half] (decoder->dest[0] + dest_field * decoder->stride + \ + decoder->offset, ref[0] + offset, \ + 2 * decoder->stride, 8); \ + offset = (offset + (motion_x & (motion_x < 0))) >> 1; \ + motion_x /= 2; \ + xy_half = ((pos_y & 1) << 1) | (motion_x & 1); \ + table[4+xy_half] (decoder->dest[1] + dest_field * decoder->uv_stride + \ + (decoder->offset >> 1), ref[1] + offset, \ + 2 * decoder->uv_stride, 8); \ + table[4+xy_half] (decoder->dest[2] + dest_field * decoder->uv_stride + \ + (decoder->offset >> 1), ref[2] + offset, \ + 2 * decoder->uv_stride, 8) + +#define MOTION_DMV_422(table,ref,motion_x,motion_y) \ + pos_x = 2 * decoder->offset + motion_x; \ + pos_y = decoder->v_offset + motion_y; \ + if (unlikely (pos_x > decoder->limit_x)) { \ + pos_x = ((int)pos_x < 0) ? 0 : decoder->limit_x; \ + motion_x = pos_x - 2 * decoder->offset; \ + } \ + if (unlikely (pos_y > decoder->limit_y)) { \ + pos_y = ((int)pos_y < 0) ? 0 : decoder->limit_y; \ + motion_y = pos_y - decoder->v_offset; \ + } \ + xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \ + offset = (pos_x >> 1) + (pos_y & ~1) * decoder->stride; \ + table[xy_half] (decoder->dest[0] + decoder->offset, \ + ref[0] + offset, 2 * decoder->stride, 8); \ + table[xy_half] (decoder->dest[0] + decoder->stride + decoder->offset, \ + ref[0] + decoder->stride + offset, \ + 2 * decoder->stride, 8); \ + offset = (offset + (motion_x & (motion_x < 0))) >> 1; \ + motion_x /= 2; \ + xy_half = ((pos_y & 1) << 1) | (motion_x & 1); \ + table[4+xy_half] (decoder->dest[1] + (decoder->offset >> 1), \ + ref[1] + offset, 2 * decoder->uv_stride, 8); \ + table[4+xy_half] (decoder->dest[1] + decoder->uv_stride + \ + (decoder->offset >> 1), \ + ref[1] + decoder->uv_stride + offset, \ + 2 * decoder->uv_stride, 8); \ + table[4+xy_half] (decoder->dest[2] + (decoder->offset >> 1), \ + ref[2] + offset, 2 * decoder->uv_stride, 8); \ + table[4+xy_half] (decoder->dest[2] + decoder->uv_stride + \ + (decoder->offset >> 1), \ + ref[2] + decoder->uv_stride + offset, \ + 2 * decoder->uv_stride, 8) + +#define MOTION_ZERO_422(table,ref) \ + offset = decoder->offset + decoder->v_offset * decoder->stride; \ + table[0] (decoder->dest[0] + decoder->offset, \ + ref[0] + offset, decoder->stride, 16); \ + offset >>= 1; \ + table[4] (decoder->dest[1] + (decoder->offset >> 1), \ + ref[1] + offset, decoder->uv_stride, 16); \ + table[4] (decoder->dest[2] + (decoder->offset >> 1), \ + ref[2] + offset, decoder->uv_stride, 16) + +#define MOTION_444(table,ref,motion_x,motion_y,size,y) \ + pos_x = 2 * decoder->offset + motion_x; \ + pos_y = 2 * decoder->v_offset + motion_y + 2 * y; \ + if (unlikely (pos_x > decoder->limit_x)) { \ + pos_x = ((int)pos_x < 0) ? 0 : decoder->limit_x; \ + motion_x = pos_x - 2 * decoder->offset; \ + } \ + if (unlikely (pos_y > decoder->limit_y_ ## size)) { \ + pos_y = ((int)pos_y < 0) ? 0 : decoder->limit_y_ ## size; \ + motion_y = pos_y - 2 * decoder->v_offset - 2 * y; \ + } \ + xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \ + offset = (pos_x >> 1) + (pos_y >> 1) * decoder->stride; \ + table[xy_half] (decoder->dest[0] + y * decoder->stride + decoder->offset, \ + ref[0] + offset, decoder->stride, size); \ + table[xy_half] (decoder->dest[1] + y * decoder->stride + decoder->offset, \ + ref[1] + offset, decoder->stride, size); \ + table[xy_half] (decoder->dest[2] + y * decoder->stride + decoder->offset, \ + ref[2] + offset, decoder->stride, size) + +#define MOTION_FIELD_444(table,ref,motion_x,motion_y,dest_field,op,src_field) \ + pos_x = 2 * decoder->offset + motion_x; \ + pos_y = decoder->v_offset + motion_y; \ + if (unlikely (pos_x > decoder->limit_x)) { \ + pos_x = ((int)pos_x < 0) ? 0 : decoder->limit_x; \ + motion_x = pos_x - 2 * decoder->offset; \ + } \ + if (unlikely (pos_y > decoder->limit_y)) { \ + pos_y = ((int)pos_y < 0) ? 0 : decoder->limit_y; \ + motion_y = pos_y - decoder->v_offset; \ + } \ + xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \ + offset = (pos_x >> 1) + ((pos_y op) + src_field) * decoder->stride; \ + table[xy_half] (decoder->dest[0] + dest_field * decoder->stride + \ + decoder->offset, ref[0] + offset, \ + 2 * decoder->stride, 8); \ + table[xy_half] (decoder->dest[1] + dest_field * decoder->stride + \ + decoder->offset, ref[1] + offset, \ + 2 * decoder->stride, 8); \ + table[xy_half] (decoder->dest[2] + dest_field * decoder->stride + \ + decoder->offset, ref[2] + offset, \ + 2 * decoder->stride, 8) + +#define MOTION_DMV_444(table,ref,motion_x,motion_y) \ + pos_x = 2 * decoder->offset + motion_x; \ + pos_y = decoder->v_offset + motion_y; \ + if (unlikely (pos_x > decoder->limit_x)) { \ + pos_x = ((int)pos_x < 0) ? 0 : decoder->limit_x; \ + motion_x = pos_x - 2 * decoder->offset; \ + } \ + if (unlikely (pos_y > decoder->limit_y)) { \ + pos_y = ((int)pos_y < 0) ? 0 : decoder->limit_y; \ + motion_y = pos_y - decoder->v_offset; \ + } \ + xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \ + offset = (pos_x >> 1) + (pos_y & ~1) * decoder->stride; \ + table[xy_half] (decoder->dest[0] + decoder->offset, \ + ref[0] + offset, 2 * decoder->stride, 8); \ + table[xy_half] (decoder->dest[0] + decoder->stride + decoder->offset, \ + ref[0] + decoder->stride + offset, \ + 2 * decoder->stride, 8); \ + table[xy_half] (decoder->dest[1] + decoder->offset, \ + ref[1] + offset, 2 * decoder->stride, 8); \ + table[xy_half] (decoder->dest[1] + decoder->stride + decoder->offset, \ + ref[1] + decoder->stride + offset, \ + 2 * decoder->stride, 8); \ + table[xy_half] (decoder->dest[2] + decoder->offset, \ + ref[2] + offset, 2 * decoder->stride, 8); \ + table[xy_half] (decoder->dest[2] + decoder->stride + decoder->offset, \ + ref[2] + decoder->stride + offset, \ + 2 * decoder->stride, 8) + +#define MOTION_ZERO_444(table,ref) \ + offset = decoder->offset + decoder->v_offset * decoder->stride; \ + table[0] (decoder->dest[0] + decoder->offset, \ + ref[0] + offset, decoder->stride, 16); \ + table[4] (decoder->dest[1] + decoder->offset, \ + ref[1] + offset, decoder->stride, 16); \ + table[4] (decoder->dest[2] + (decoder->offset >> 1), \ + ref[2] + offset, decoder->stride, 16) + +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + +static void motion_mp1 (mpeg2_decoder_t * const decoder, + motion_t * const motion, + mpeg2_mc_fct * const * const table) +{ + int motion_x, motion_y; + unsigned int pos_x, pos_y, xy_half, offset; + + NEEDBITS (bit_buf, bits, bit_ptr); + motion_x = (motion->pmv[0][0] + + (get_motion_delta (decoder, + motion->f_code[0]) << motion->f_code[1])); + motion_x = bound_motion_vector (motion_x, + motion->f_code[0] + motion->f_code[1]); + motion->pmv[0][0] = motion_x; + + NEEDBITS (bit_buf, bits, bit_ptr); + motion_y = (motion->pmv[0][1] + + (get_motion_delta (decoder, + motion->f_code[0]) << motion->f_code[1])); + motion_y = bound_motion_vector (motion_y, + motion->f_code[0] + motion->f_code[1]); + motion->pmv[0][1] = motion_y; + + MOTION_420 (table, motion->ref[0], motion_x, motion_y, 16, 0); +} + +#define MOTION_FUNCTIONS(FORMAT,MOTION,MOTION_FIELD,MOTION_DMV,MOTION_ZERO) \ + \ +static void motion_fr_frame_##FORMAT (mpeg2_decoder_t * const decoder, \ + motion_t * const motion, \ + mpeg2_mc_fct * const * const table) \ +{ \ + int motion_x, motion_y; \ + unsigned int pos_x, pos_y, xy_half, offset; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \ + motion->f_code[0]); \ + motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \ + motion->pmv[1][0] = motion->pmv[0][0] = motion_x; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \ + motion->f_code[1]); \ + motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \ + motion->pmv[1][1] = motion->pmv[0][1] = motion_y; \ + \ + MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0); \ +} \ + \ +static void motion_fr_field_##FORMAT (mpeg2_decoder_t * const decoder, \ + motion_t * const motion, \ + mpeg2_mc_fct * const * const table) \ +{ \ + int motion_x, motion_y, field; \ + unsigned int pos_x, pos_y, xy_half, offset; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + field = UBITS (bit_buf, 1); \ + DUMPBITS (bit_buf, bits, 1); \ + \ + motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \ + motion->f_code[0]); \ + motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \ + motion->pmv[0][0] = motion_x; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + motion_y = ((motion->pmv[0][1] >> 1) + \ + get_motion_delta (decoder, motion->f_code[1])); \ + /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */ \ + motion->pmv[0][1] = motion_y << 1; \ + \ + MOTION_FIELD (table, motion->ref[0], motion_x, motion_y, 0, & ~1, field); \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + field = UBITS (bit_buf, 1); \ + DUMPBITS (bit_buf, bits, 1); \ + \ + motion_x = motion->pmv[1][0] + get_motion_delta (decoder, \ + motion->f_code[0]); \ + motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \ + motion->pmv[1][0] = motion_x; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + motion_y = ((motion->pmv[1][1] >> 1) + \ + get_motion_delta (decoder, motion->f_code[1])); \ + /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */ \ + motion->pmv[1][1] = motion_y << 1; \ + \ + MOTION_FIELD (table, motion->ref[0], motion_x, motion_y, 1, & ~1, field); \ +} \ + \ +static void motion_fr_dmv_##FORMAT (mpeg2_decoder_t * const decoder, \ + motion_t * const motion, \ + mpeg2_mc_fct * const * const table) \ +{ \ + int motion_x, motion_y, dmv_x, dmv_y, m, other_x, other_y; \ + unsigned int pos_x, pos_y, xy_half, offset; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \ + motion->f_code[0]); \ + motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \ + motion->pmv[1][0] = motion->pmv[0][0] = motion_x; \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + dmv_x = get_dmv (decoder); \ + \ + motion_y = ((motion->pmv[0][1] >> 1) + \ + get_motion_delta (decoder, motion->f_code[1])); \ + /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */ \ + motion->pmv[1][1] = motion->pmv[0][1] = motion_y << 1; \ + dmv_y = get_dmv (decoder); \ + \ + m = decoder->top_field_first ? 1 : 3; \ + other_x = ((motion_x * m + (motion_x > 0)) >> 1) + dmv_x; \ + other_y = ((motion_y * m + (motion_y > 0)) >> 1) + dmv_y - 1; \ + MOTION_FIELD (mpeg2_mc.put, motion->ref[0], other_x, other_y, 0, | 1, 0); \ + \ + m = decoder->top_field_first ? 3 : 1; \ + other_x = ((motion_x * m + (motion_x > 0)) >> 1) + dmv_x; \ + other_y = ((motion_y * m + (motion_y > 0)) >> 1) + dmv_y + 1; \ + MOTION_FIELD (mpeg2_mc.put, motion->ref[0], other_x, other_y, 1, & ~1, 0);\ + \ + MOTION_DMV (mpeg2_mc.avg, motion->ref[0], motion_x, motion_y); \ +} \ + \ +static void motion_reuse_##FORMAT (mpeg2_decoder_t * const decoder, \ + motion_t * const motion, \ + mpeg2_mc_fct * const * const table) \ +{ \ + int motion_x, motion_y; \ + unsigned int pos_x, pos_y, xy_half, offset; \ + \ + motion_x = motion->pmv[0][0]; \ + motion_y = motion->pmv[0][1]; \ + \ + MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0); \ +} \ + \ +static void motion_zero_##FORMAT (mpeg2_decoder_t * const decoder, \ + motion_t * const motion, \ + mpeg2_mc_fct * const * const table) \ +{ \ + unsigned int offset; \ + \ + motion->pmv[0][0] = motion->pmv[0][1] = 0; \ + motion->pmv[1][0] = motion->pmv[1][1] = 0; \ + \ + MOTION_ZERO (table, motion->ref[0]); \ +} \ + \ +static void motion_fi_field_##FORMAT (mpeg2_decoder_t * const decoder, \ + motion_t * const motion, \ + mpeg2_mc_fct * const * const table) \ +{ \ + int motion_x, motion_y; \ + uint8_t ** ref_field; \ + unsigned int pos_x, pos_y, xy_half, offset; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + ref_field = motion->ref2[UBITS (bit_buf, 1)]; \ + DUMPBITS (bit_buf, bits, 1); \ + \ + motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \ + motion->f_code[0]); \ + motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \ + motion->pmv[1][0] = motion->pmv[0][0] = motion_x; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \ + motion->f_code[1]); \ + motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \ + motion->pmv[1][1] = motion->pmv[0][1] = motion_y; \ + \ + MOTION (table, ref_field, motion_x, motion_y, 16, 0); \ +} \ + \ +static void motion_fi_16x8_##FORMAT (mpeg2_decoder_t * const decoder, \ + motion_t * const motion, \ + mpeg2_mc_fct * const * const table) \ +{ \ + int motion_x, motion_y; \ + uint8_t ** ref_field; \ + unsigned int pos_x, pos_y, xy_half, offset; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + ref_field = motion->ref2[UBITS (bit_buf, 1)]; \ + DUMPBITS (bit_buf, bits, 1); \ + \ + motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \ + motion->f_code[0]); \ + motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \ + motion->pmv[0][0] = motion_x; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \ + motion->f_code[1]); \ + motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \ + motion->pmv[0][1] = motion_y; \ + \ + MOTION (table, ref_field, motion_x, motion_y, 8, 0); \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + ref_field = motion->ref2[UBITS (bit_buf, 1)]; \ + DUMPBITS (bit_buf, bits, 1); \ + \ + motion_x = motion->pmv[1][0] + get_motion_delta (decoder, \ + motion->f_code[0]); \ + motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \ + motion->pmv[1][0] = motion_x; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + motion_y = motion->pmv[1][1] + get_motion_delta (decoder, \ + motion->f_code[1]); \ + motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \ + motion->pmv[1][1] = motion_y; \ + \ + MOTION (table, ref_field, motion_x, motion_y, 8, 8); \ +} \ + \ +static void motion_fi_dmv_##FORMAT (mpeg2_decoder_t * const decoder, \ + motion_t * const motion, \ + mpeg2_mc_fct * const * const table) \ +{ \ + int motion_x, motion_y, other_x, other_y; \ + unsigned int pos_x, pos_y, xy_half, offset; \ + \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + motion_x = motion->pmv[0][0] + get_motion_delta (decoder, \ + motion->f_code[0]); \ + motion_x = bound_motion_vector (motion_x, motion->f_code[0]); \ + motion->pmv[1][0] = motion->pmv[0][0] = motion_x; \ + NEEDBITS (bit_buf, bits, bit_ptr); \ + other_x = ((motion_x + (motion_x > 0)) >> 1) + get_dmv (decoder); \ + \ + motion_y = motion->pmv[0][1] + get_motion_delta (decoder, \ + motion->f_code[1]); \ + motion_y = bound_motion_vector (motion_y, motion->f_code[1]); \ + motion->pmv[1][1] = motion->pmv[0][1] = motion_y; \ + other_y = (((motion_y + (motion_y > 0)) >> 1) + get_dmv (decoder) + \ + decoder->dmv_offset); \ + \ + MOTION (mpeg2_mc.put, motion->ref[0], motion_x, motion_y, 16, 0); \ + MOTION (mpeg2_mc.avg, motion->ref[1], other_x, other_y, 16, 0); \ +} \ + +MOTION_FUNCTIONS (420, MOTION_420, MOTION_FIELD_420, MOTION_DMV_420, + MOTION_ZERO_420) +MOTION_FUNCTIONS (422, MOTION_422, MOTION_FIELD_422, MOTION_DMV_422, + MOTION_ZERO_422) +MOTION_FUNCTIONS (444, MOTION_444, MOTION_FIELD_444, MOTION_DMV_444, + MOTION_ZERO_444) + +/* like motion_frame, but parsing without actual motion compensation */ +static void motion_fr_conceal (mpeg2_decoder_t * const decoder) +{ + int tmp; + + NEEDBITS (bit_buf, bits, bit_ptr); + tmp = (decoder->f_motion.pmv[0][0] + + get_motion_delta (decoder, decoder->f_motion.f_code[0])); + tmp = bound_motion_vector (tmp, decoder->f_motion.f_code[0]); + decoder->f_motion.pmv[1][0] = decoder->f_motion.pmv[0][0] = tmp; + + NEEDBITS (bit_buf, bits, bit_ptr); + tmp = (decoder->f_motion.pmv[0][1] + + get_motion_delta (decoder, decoder->f_motion.f_code[1])); + tmp = bound_motion_vector (tmp, decoder->f_motion.f_code[1]); + decoder->f_motion.pmv[1][1] = decoder->f_motion.pmv[0][1] = tmp; + + DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */ +} + +static void motion_fi_conceal (mpeg2_decoder_t * const decoder) +{ + int tmp; + + NEEDBITS (bit_buf, bits, bit_ptr); + DUMPBITS (bit_buf, bits, 1); /* remove field_select */ + + tmp = (decoder->f_motion.pmv[0][0] + + get_motion_delta (decoder, decoder->f_motion.f_code[0])); + tmp = bound_motion_vector (tmp, decoder->f_motion.f_code[0]); + decoder->f_motion.pmv[1][0] = decoder->f_motion.pmv[0][0] = tmp; + + NEEDBITS (bit_buf, bits, bit_ptr); + tmp = (decoder->f_motion.pmv[0][1] + + get_motion_delta (decoder, decoder->f_motion.f_code[1])); + tmp = bound_motion_vector (tmp, decoder->f_motion.f_code[1]); + decoder->f_motion.pmv[1][1] = decoder->f_motion.pmv[0][1] = tmp; + + DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */ +} + +#undef bit_buf +#undef bits +#undef bit_ptr + +#define MOTION_CALL(routine,direction) \ +do { \ + if ((direction) & MACROBLOCK_MOTION_FORWARD) \ + routine (decoder, &(decoder->f_motion), mpeg2_mc.put); \ + if ((direction) & MACROBLOCK_MOTION_BACKWARD) \ + routine (decoder, &(decoder->b_motion), \ + ((direction) & MACROBLOCK_MOTION_FORWARD ? \ + mpeg2_mc.avg : mpeg2_mc.put)); \ +} while (0) + +#define NEXT_MACROBLOCK \ +do { \ + decoder->offset += 16; \ + if (decoder->offset == decoder->width) { \ + do { /* just so we can use the break statement */ \ + if (decoder->convert) { \ + decoder->convert (decoder->convert_id, decoder->dest, \ + decoder->v_offset); \ + if (decoder->coding_type == B_TYPE) \ + break; \ + } \ + decoder->dest[0] += decoder->slice_stride; \ + decoder->dest[1] += decoder->slice_uv_stride; \ + decoder->dest[2] += decoder->slice_uv_stride; \ + } while (0); \ + decoder->v_offset += 16; \ + if (decoder->v_offset > decoder->limit_y) { \ + if (mpeg2_cpu_state_restore) \ + mpeg2_cpu_state_restore (&cpu_state); \ + return; \ + } \ + decoder->offset = 0; \ + } \ +} while (0) + +void mpeg2_init_fbuf (mpeg2_decoder_t * decoder, uint8_t * current_fbuf[3], + uint8_t * forward_fbuf[3], uint8_t * backward_fbuf[3]) +{ + int offset, stride, height, bottom_field; + + stride = decoder->stride_frame; + bottom_field = (decoder->picture_structure == BOTTOM_FIELD); + offset = bottom_field ? stride : 0; + height = decoder->height; + + decoder->picture_dest[0] = current_fbuf[0] + offset; + decoder->picture_dest[1] = current_fbuf[1] + (offset >> 1); + decoder->picture_dest[2] = current_fbuf[2] + (offset >> 1); + + decoder->f_motion.ref[0][0] = forward_fbuf[0] + offset; + decoder->f_motion.ref[0][1] = forward_fbuf[1] + (offset >> 1); + decoder->f_motion.ref[0][2] = forward_fbuf[2] + (offset >> 1); + + decoder->b_motion.ref[0][0] = backward_fbuf[0] + offset; + decoder->b_motion.ref[0][1] = backward_fbuf[1] + (offset >> 1); + decoder->b_motion.ref[0][2] = backward_fbuf[2] + (offset >> 1); + + if (decoder->picture_structure != FRAME_PICTURE) { + decoder->dmv_offset = bottom_field ? 1 : -1; + decoder->f_motion.ref2[0] = decoder->f_motion.ref[bottom_field]; + decoder->f_motion.ref2[1] = decoder->f_motion.ref[!bottom_field]; + decoder->b_motion.ref2[0] = decoder->b_motion.ref[bottom_field]; + decoder->b_motion.ref2[1] = decoder->b_motion.ref[!bottom_field]; + offset = stride - offset; + + if (decoder->second_field && (decoder->coding_type != B_TYPE)) + forward_fbuf = current_fbuf; + + decoder->f_motion.ref[1][0] = forward_fbuf[0] + offset; + decoder->f_motion.ref[1][1] = forward_fbuf[1] + (offset >> 1); + decoder->f_motion.ref[1][2] = forward_fbuf[2] + (offset >> 1); + + decoder->b_motion.ref[1][0] = backward_fbuf[0] + offset; + decoder->b_motion.ref[1][1] = backward_fbuf[1] + (offset >> 1); + decoder->b_motion.ref[1][2] = backward_fbuf[2] + (offset >> 1); + + stride <<= 1; + height >>= 1; + } + + decoder->stride = stride; + decoder->uv_stride = stride >> 1; + decoder->slice_stride = 16 * stride; + decoder->slice_uv_stride = + decoder->slice_stride >> (2 - decoder->chroma_format); + decoder->limit_x = 2 * decoder->width - 32; + decoder->limit_y_16 = 2 * height - 32; + decoder->limit_y_8 = 2 * height - 16; + decoder->limit_y = height - 16; + + if (decoder->mpeg1) { + decoder->motion_parser[0] = motion_zero_420; + decoder->motion_parser[MC_FRAME] = motion_mp1; + decoder->motion_parser[4] = motion_reuse_420; + } else if (decoder->picture_structure == FRAME_PICTURE) { + if (decoder->chroma_format == 0) { + decoder->motion_parser[0] = motion_zero_420; + decoder->motion_parser[MC_FIELD] = motion_fr_field_420; + decoder->motion_parser[MC_FRAME] = motion_fr_frame_420; + decoder->motion_parser[MC_DMV] = motion_fr_dmv_420; + decoder->motion_parser[4] = motion_reuse_420; + } else if (decoder->chroma_format == 1) { + decoder->motion_parser[0] = motion_zero_422; + decoder->motion_parser[MC_FIELD] = motion_fr_field_422; + decoder->motion_parser[MC_FRAME] = motion_fr_frame_422; + decoder->motion_parser[MC_DMV] = motion_fr_dmv_422; + decoder->motion_parser[4] = motion_reuse_422; + } else { + decoder->motion_parser[0] = motion_zero_444; + decoder->motion_parser[MC_FIELD] = motion_fr_field_444; + decoder->motion_parser[MC_FRAME] = motion_fr_frame_444; + decoder->motion_parser[MC_DMV] = motion_fr_dmv_444; + decoder->motion_parser[4] = motion_reuse_444; + } + } else { + if (decoder->chroma_format == 0) { + decoder->motion_parser[0] = motion_zero_420; + decoder->motion_parser[MC_FIELD] = motion_fi_field_420; + decoder->motion_parser[MC_16X8] = motion_fi_16x8_420; + decoder->motion_parser[MC_DMV] = motion_fi_dmv_420; + decoder->motion_parser[4] = motion_reuse_420; + } else if (decoder->chroma_format == 1) { + decoder->motion_parser[0] = motion_zero_422; + decoder->motion_parser[MC_FIELD] = motion_fi_field_422; + decoder->motion_parser[MC_16X8] = motion_fi_16x8_422; + decoder->motion_parser[MC_DMV] = motion_fi_dmv_422; + decoder->motion_parser[4] = motion_reuse_422; + } else { + decoder->motion_parser[0] = motion_zero_444; + decoder->motion_parser[MC_FIELD] = motion_fi_field_444; + decoder->motion_parser[MC_16X8] = motion_fi_16x8_444; + decoder->motion_parser[MC_DMV] = motion_fi_dmv_444; + decoder->motion_parser[4] = motion_reuse_444; + } + } +} + +static inline int slice_init (mpeg2_decoder_t * const decoder, int code) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + int offset; + const MBAtab * mba; + + decoder->dc_dct_pred[0] = decoder->dc_dct_pred[1] = + decoder->dc_dct_pred[2] = 16384; + + decoder->f_motion.pmv[0][0] = decoder->f_motion.pmv[0][1] = 0; + decoder->f_motion.pmv[1][0] = decoder->f_motion.pmv[1][1] = 0; + decoder->b_motion.pmv[0][0] = decoder->b_motion.pmv[0][1] = 0; + decoder->b_motion.pmv[1][0] = decoder->b_motion.pmv[1][1] = 0; + + if (decoder->vertical_position_extension) { + code += UBITS (bit_buf, 3) << 7; + DUMPBITS (bit_buf, bits, 3); + } + decoder->v_offset = (code - 1) * 16; + offset = 0; + if (!(decoder->convert) || decoder->coding_type != B_TYPE) + offset = (code - 1) * decoder->slice_stride; + + decoder->dest[0] = decoder->picture_dest[0] + offset; + offset >>= (2 - decoder->chroma_format); + decoder->dest[1] = decoder->picture_dest[1] + offset; + decoder->dest[2] = decoder->picture_dest[2] + offset; + + get_quantizer_scale (decoder); + + /* ignore intra_slice and all the extra data */ + while (bit_buf & 0x80000000) { + DUMPBITS (bit_buf, bits, 9); + NEEDBITS (bit_buf, bits, bit_ptr); + } + + /* decode initial macroblock address increment */ + offset = 0; + while (1) { + if (bit_buf >= 0x08000000) { + mba = MBA_5 + (UBITS (bit_buf, 6) - 2); + break; + } else if (bit_buf >= 0x01800000) { + mba = MBA_11 + (UBITS (bit_buf, 12) - 24); + break; + } else switch (UBITS (bit_buf, 12)) { + case 8: /* macroblock_escape */ + offset += 33; + DUMPBITS (bit_buf, bits, 11); + NEEDBITS (bit_buf, bits, bit_ptr); + continue; + case 15: /* macroblock_stuffing (MPEG1 only) */ + bit_buf &= 0xfffff; + DUMPBITS (bit_buf, bits, 11); + NEEDBITS (bit_buf, bits, bit_ptr); + continue; + default: /* error */ + return 1; + } + } + DUMPBITS (bit_buf, bits, mba->len + 1); + decoder->offset = (offset + mba->mba) << 4; + + while (decoder->offset - decoder->width >= 0) { + decoder->offset -= decoder->width; + if (!(decoder->convert) || decoder->coding_type != B_TYPE) { + decoder->dest[0] += decoder->slice_stride; + decoder->dest[1] += decoder->slice_uv_stride; + decoder->dest[2] += decoder->slice_uv_stride; + } + decoder->v_offset += 16; + } + if (decoder->v_offset > decoder->limit_y) + return 1; + + return 0; +#undef bit_buf +#undef bits +#undef bit_ptr +} + +void mpeg2_slice (mpeg2_decoder_t * const decoder, const int code, + const uint8_t * const buffer) +{ +#define bit_buf (decoder->bitstream_buf) +#define bits (decoder->bitstream_bits) +#define bit_ptr (decoder->bitstream_ptr) + cpu_state_t cpu_state; + + bitstream_init (decoder, buffer); + + if (slice_init (decoder, code)) + return; + + if (mpeg2_cpu_state_save) + mpeg2_cpu_state_save (&cpu_state); + + while (1) { + int macroblock_modes; + int mba_inc; + const MBAtab * mba; + + NEEDBITS (bit_buf, bits, bit_ptr); + + macroblock_modes = get_macroblock_modes (decoder); + + /* maybe integrate MACROBLOCK_QUANT test into get_macroblock_modes ? */ + if (macroblock_modes & MACROBLOCK_QUANT) + get_quantizer_scale (decoder); + + if (macroblock_modes & MACROBLOCK_INTRA) { + + int DCT_offset, DCT_stride; + int offset; + uint8_t * dest_y; + + if (decoder->concealment_motion_vectors) { + if (decoder->picture_structure == FRAME_PICTURE) + motion_fr_conceal (decoder); + else + motion_fi_conceal (decoder); + } else { + decoder->f_motion.pmv[0][0] = decoder->f_motion.pmv[0][1] = 0; + decoder->f_motion.pmv[1][0] = decoder->f_motion.pmv[1][1] = 0; + decoder->b_motion.pmv[0][0] = decoder->b_motion.pmv[0][1] = 0; + decoder->b_motion.pmv[1][0] = decoder->b_motion.pmv[1][1] = 0; + } + + if (macroblock_modes & DCT_TYPE_INTERLACED) { + DCT_offset = decoder->stride; + DCT_stride = decoder->stride * 2; + } else { + DCT_offset = decoder->stride * 8; + DCT_stride = decoder->stride; + } + + offset = decoder->offset; + dest_y = decoder->dest[0] + offset; + slice_intra_DCT (decoder, 0, dest_y, DCT_stride); + slice_intra_DCT (decoder, 0, dest_y + 8, DCT_stride); + slice_intra_DCT (decoder, 0, dest_y + DCT_offset, DCT_stride); + slice_intra_DCT (decoder, 0, dest_y + DCT_offset + 8, DCT_stride); + if (likely (decoder->chroma_format == 0)) { + slice_intra_DCT (decoder, 1, decoder->dest[1] + (offset >> 1), + decoder->uv_stride); + slice_intra_DCT (decoder, 2, decoder->dest[2] + (offset >> 1), + decoder->uv_stride); + if (decoder->coding_type == D_TYPE) { + NEEDBITS (bit_buf, bits, bit_ptr); + DUMPBITS (bit_buf, bits, 1); + } + } else if (likely (decoder->chroma_format == 1)) { + uint8_t * dest_u = decoder->dest[1] + (offset >> 1); + uint8_t * dest_v = decoder->dest[2] + (offset >> 1); + DCT_stride >>= 1; + DCT_offset >>= 1; + slice_intra_DCT (decoder, 1, dest_u, DCT_stride); + slice_intra_DCT (decoder, 2, dest_v, DCT_stride); + slice_intra_DCT (decoder, 1, dest_u + DCT_offset, DCT_stride); + slice_intra_DCT (decoder, 2, dest_v + DCT_offset, DCT_stride); + } else { + uint8_t * dest_u = decoder->dest[1] + offset; + uint8_t * dest_v = decoder->dest[2] + offset; + slice_intra_DCT (decoder, 1, dest_u, DCT_stride); + slice_intra_DCT (decoder, 2, dest_v, DCT_stride); + slice_intra_DCT (decoder, 1, dest_u + DCT_offset, DCT_stride); + slice_intra_DCT (decoder, 2, dest_v + DCT_offset, DCT_stride); + slice_intra_DCT (decoder, 1, dest_u + 8, DCT_stride); + slice_intra_DCT (decoder, 2, dest_v + 8, DCT_stride); + slice_intra_DCT (decoder, 1, dest_u + DCT_offset + 8, + DCT_stride); + slice_intra_DCT (decoder, 2, dest_v + DCT_offset + 8, + DCT_stride); + } + } else { + + motion_parser_t * parser; + + parser = + decoder->motion_parser[macroblock_modes >> MOTION_TYPE_SHIFT]; + MOTION_CALL (parser, macroblock_modes); + + if (macroblock_modes & MACROBLOCK_PATTERN) { + int coded_block_pattern; + int DCT_offset, DCT_stride; + + if (macroblock_modes & DCT_TYPE_INTERLACED) { + DCT_offset = decoder->stride; + DCT_stride = decoder->stride * 2; + } else { + DCT_offset = decoder->stride * 8; + DCT_stride = decoder->stride; + } + + coded_block_pattern = get_coded_block_pattern (decoder); + + if (likely (decoder->chroma_format == 0)) { + int offset = decoder->offset; + uint8_t * dest_y = decoder->dest[0] + offset; + if (coded_block_pattern & 1) + slice_non_intra_DCT (decoder, 0, dest_y, DCT_stride); + if (coded_block_pattern & 2) + slice_non_intra_DCT (decoder, 0, dest_y + 8, + DCT_stride); + if (coded_block_pattern & 4) + slice_non_intra_DCT (decoder, 0, dest_y + DCT_offset, + DCT_stride); + if (coded_block_pattern & 8) + slice_non_intra_DCT (decoder, 0, + dest_y + DCT_offset + 8, + DCT_stride); + if (coded_block_pattern & 16) + slice_non_intra_DCT (decoder, 1, + decoder->dest[1] + (offset >> 1), + decoder->uv_stride); + if (coded_block_pattern & 32) + slice_non_intra_DCT (decoder, 2, + decoder->dest[2] + (offset >> 1), + decoder->uv_stride); + } else if (likely (decoder->chroma_format == 1)) { + int offset; + uint8_t * dest_y; + + coded_block_pattern |= bit_buf & (3 << 30); + DUMPBITS (bit_buf, bits, 2); + + offset = decoder->offset; + dest_y = decoder->dest[0] + offset; + if (coded_block_pattern & 1) + slice_non_intra_DCT (decoder, 0, dest_y, DCT_stride); + if (coded_block_pattern & 2) + slice_non_intra_DCT (decoder, 0, dest_y + 8, + DCT_stride); + if (coded_block_pattern & 4) + slice_non_intra_DCT (decoder, 0, dest_y + DCT_offset, + DCT_stride); + if (coded_block_pattern & 8) + slice_non_intra_DCT (decoder, 0, + dest_y + DCT_offset + 8, + DCT_stride); + + DCT_stride >>= 1; + DCT_offset = (DCT_offset + offset) >> 1; + if (coded_block_pattern & 16) + slice_non_intra_DCT (decoder, 1, + decoder->dest[1] + (offset >> 1), + DCT_stride); + if (coded_block_pattern & 32) + slice_non_intra_DCT (decoder, 2, + decoder->dest[2] + (offset >> 1), + DCT_stride); + if (coded_block_pattern & (2 << 30)) + slice_non_intra_DCT (decoder, 1, + decoder->dest[1] + DCT_offset, + DCT_stride); + if (coded_block_pattern & (1 << 30)) + slice_non_intra_DCT (decoder, 2, + decoder->dest[2] + DCT_offset, + DCT_stride); + } else { + int offset; + uint8_t * dest_y, * dest_u, * dest_v; + + coded_block_pattern |= bit_buf & (63 << 26); + DUMPBITS (bit_buf, bits, 6); + + offset = decoder->offset; + dest_y = decoder->dest[0] + offset; + dest_u = decoder->dest[1] + offset; + dest_v = decoder->dest[2] + offset; + + if (coded_block_pattern & 1) + slice_non_intra_DCT (decoder, 0, dest_y, DCT_stride); + if (coded_block_pattern & 2) + slice_non_intra_DCT (decoder, 0, dest_y + 8, + DCT_stride); + if (coded_block_pattern & 4) + slice_non_intra_DCT (decoder, 0, dest_y + DCT_offset, + DCT_stride); + if (coded_block_pattern & 8) + slice_non_intra_DCT (decoder, 0, + dest_y + DCT_offset + 8, + DCT_stride); + + if (coded_block_pattern & 16) + slice_non_intra_DCT (decoder, 1, dest_u, DCT_stride); + if (coded_block_pattern & 32) + slice_non_intra_DCT (decoder, 2, dest_v, DCT_stride); + if (coded_block_pattern & (32 << 26)) + slice_non_intra_DCT (decoder, 1, dest_u + DCT_offset, + DCT_stride); + if (coded_block_pattern & (16 << 26)) + slice_non_intra_DCT (decoder, 2, dest_v + DCT_offset, + DCT_stride); + if (coded_block_pattern & (8 << 26)) + slice_non_intra_DCT (decoder, 1, dest_u + 8, + DCT_stride); + if (coded_block_pattern & (4 << 26)) + slice_non_intra_DCT (decoder, 2, dest_v + 8, + DCT_stride); + if (coded_block_pattern & (2 << 26)) + slice_non_intra_DCT (decoder, 1, + dest_u + DCT_offset + 8, + DCT_stride); + if (coded_block_pattern & (1 << 26)) + slice_non_intra_DCT (decoder, 2, + dest_v + DCT_offset + 8, + DCT_stride); + } + } + + decoder->dc_dct_pred[0] = decoder->dc_dct_pred[1] = + decoder->dc_dct_pred[2] = 16384; + } + + NEXT_MACROBLOCK; + + NEEDBITS (bit_buf, bits, bit_ptr); + mba_inc = 0; + while (1) { + if (bit_buf >= 0x10000000) { + mba = MBA_5 + (UBITS (bit_buf, 5) - 2); + break; + } else if (bit_buf >= 0x03000000) { + mba = MBA_11 + (UBITS (bit_buf, 11) - 24); + break; + } else switch (UBITS (bit_buf, 11)) { + case 8: /* macroblock_escape */ + mba_inc += 33; + /* pass through */ + case 15: /* macroblock_stuffing (MPEG1 only) */ + DUMPBITS (bit_buf, bits, 11); + NEEDBITS (bit_buf, bits, bit_ptr); + continue; + default: /* end of slice, or error */ + if (mpeg2_cpu_state_restore) + mpeg2_cpu_state_restore (&cpu_state); + return; + } + } + DUMPBITS (bit_buf, bits, mba->len); + mba_inc += mba->mba; + + if (mba_inc) { + decoder->dc_dct_pred[0] = decoder->dc_dct_pred[1] = + decoder->dc_dct_pred[2] = 16384; + + if (decoder->coding_type == P_TYPE) { + do { + MOTION_CALL (decoder->motion_parser[0], + MACROBLOCK_MOTION_FORWARD); + NEXT_MACROBLOCK; + } while (--mba_inc); + } else { + do { + MOTION_CALL (decoder->motion_parser[4], macroblock_modes); + NEXT_MACROBLOCK; + } while (--mba_inc); + } + } + } +#undef bit_buf +#undef bits +#undef bit_ptr +} diff --git a/k9decmpeg/tendra.h b/k9decmpeg/tendra.h new file mode 100755 index 0000000..7dd1179 --- /dev/null +++ b/k9decmpeg/tendra.h @@ -0,0 +1,35 @@ +/* + * tendra.h + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#pragma TenDRA begin +#pragma TenDRA longlong type warning + +#ifdef TenDRA_check + +#pragma TenDRA conversion analysis (pointer-int explicit) off +#pragma TenDRA implicit function declaration off + +/* avoid the "No declarations in translation unit" problem */ +int TenDRA; + +#endif /* TenDRA_check */ diff --git a/k9decmpeg/uyvy.cpp b/k9decmpeg/uyvy.cpp new file mode 100755 index 0000000..287e29a --- /dev/null +++ b/k9decmpeg/uyvy.cpp @@ -0,0 +1,127 @@ +/* + * uyvy.c + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 2003 Regis Duchesne + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +#include "config.h" + +#include "k9common.h" + +#include "mpeg2.h" +#include "mpeg2convert.h" + +typedef struct { + int width; + int stride; + int chroma420; + uint8_t * out; +} convert_uyvy_t; + +static void uyvy_start (void * _id, const mpeg2_fbuf_t * fbuf, + const mpeg2_picture_t * picture, + const mpeg2_gop_t * gop) +{ + convert_uyvy_t * instance = (convert_uyvy_t *) _id; + + instance->out = fbuf->buf[0]; + instance->stride = instance->width; + if (picture->nb_fields == 1) { + if (! (picture->flags & PIC_FLAG_TOP_FIELD_FIRST)) + instance->out += 2 * instance->stride; + instance->stride <<= 1; + } +} + +#ifdef WORDS_BIGENDIAN +#define PACK(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) +#else +#define PACK(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a)) +#endif + +static void uyvy_line (uint8_t * py, uint8_t * pu, uint8_t * pv, void * _dst, + int width) +{ + uint32_t * dst = (uint32_t *) _dst; + + width >>= 4; + do { + dst[0] = PACK (pu[0], py[0], pv[0], py[1]); + dst[1] = PACK (pu[1], py[2], pv[1], py[3]); + dst[2] = PACK (pu[2], py[4], pv[2], py[5]); + dst[3] = PACK (pu[3], py[6], pv[3], py[7]); + dst[4] = PACK (pu[4], py[8], pv[4], py[9]); + dst[5] = PACK (pu[5], py[10], pv[5], py[11]); + dst[6] = PACK (pu[6], py[12], pv[6], py[13]); + dst[7] = PACK (pu[7], py[14], pv[7], py[15]); + py += 16; + pu += 8; + pv += 8; + dst += 8; + } while (--width); +} + +static void uyvy_copy (void * id, uint8_t * const * src, unsigned int v_offset) +{ + const convert_uyvy_t * instance = (convert_uyvy_t *) id; + uint8_t * py; + uint8_t * pu; + uint8_t * pv; + uint8_t * dst; + int height; + + dst = instance->out + 2 * instance->stride * v_offset; + py = src[0]; pu = src[1]; pv = src[2]; + + height = 16; + do { + uyvy_line (py, pu, pv, dst, instance->width); + dst += 2 * instance->stride; + py += instance->stride; + if (! (--height & instance->chroma420)) { + pu += instance->stride >> 1; + pv += instance->stride >> 1; + } + } while (height); +} + +int mpeg2convert_uyvy (int stage, void * _id, const mpeg2_sequence_t * seq, + int stride, uint32_t accel, void * arg, + mpeg2_convert_init_t * result) +{ + convert_uyvy_t * instance = (convert_uyvy_t *) _id; + + if (seq->chroma_width == seq->width) + return 1; + + if (instance) { + instance->width = seq->width; + instance->chroma420 = (seq->chroma_height < seq->height); + result->buf_size[0] = seq->width * seq->height * 2; + result->buf_size[1] = result->buf_size[2] = 0; + result->start = uyvy_start; + result->copy = uyvy_copy; + } else { + result->id_size = sizeof (convert_uyvy_t); + } + + return 0; +} diff --git a/k9decmpeg/video_out.h b/k9decmpeg/video_out.h new file mode 100755 index 0000000..8962726 --- /dev/null +++ b/k9decmpeg/video_out.h @@ -0,0 +1,58 @@ +/* + * video_out.h + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +struct mpeg2_sequence_s; +struct mpeg2_convert_init_s; +typedef struct { + int (* convert) (int stage, void * id, + const struct mpeg2_sequence_s * sequence, + int stride, uint32_t accel, void * arg, + struct mpeg2_convert_init_s * result); +} vo_setup_result_t; + +typedef struct vo_instance_s vo_instance_t; +struct vo_instance_s { + int (* setup) (vo_instance_t * instance, unsigned int width, + unsigned int height, unsigned int chroma_width, + unsigned int chroma_height, vo_setup_result_t * result); + void (* setup_fbuf) (vo_instance_t * instance, uint8_t ** buf, void ** id); + void (* set_fbuf) (vo_instance_t * instance, uint8_t ** buf, void ** id); + void (* start_fbuf) (vo_instance_t * instance, + uint8_t * const * buf, void * id); + void (* draw) (vo_instance_t * instance, uint8_t * const * buf, void * id); + void (* discard) (vo_instance_t * instance, + uint8_t * const * buf, void * id); + void (* close) (vo_instance_t * instance); +}; + +typedef vo_instance_t * vo_open_t (void); + +typedef struct { + char * name; + vo_open_t * open; +} vo_driver_t; + +void vo_accel (uint32_t accel); + +/* return NULL terminated array of all drivers */ +vo_driver_t const * vo_drivers (void); diff --git a/k9decmpeg/vis.h b/k9decmpeg/vis.h new file mode 100755 index 0000000..f2cbb6b --- /dev/null +++ b/k9decmpeg/vis.h @@ -0,0 +1,328 @@ +/* + * vis.h + * Copyright (C) 2003 David S. Miller + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that 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 + */ + +/* You may be asking why I hard-code the instruction opcodes and don't + * use the normal VIS assembler mnenomics for the VIS instructions. + * + * The reason is that Sun, in their infinite wisdom, decided that a binary + * using a VIS instruction will cause it to be marked (in the ELF headers) + * as doing so, and this prevents the OS from loading such binaries if the + * current cpu doesn't have VIS. There is no way to easily override this + * behavior of the assembler that I am aware of. + * + * This totally defeats what libmpeg2 is trying to do which is allow a + * single binary to be created, and then detect the availability of VIS + * at runtime. + * + * I'm not saying that tainting the binary by default is bad, rather I'm + * saying that not providing a way to override this easily unnecessarily + * ties people's hands. + * + * Thus, we do the opcode encoding by hand and output 32-bit words in + * the assembler to keep the binary from becoming tainted. + */ + +#define vis_opc_base ((0x1 << 31) | (0x36 << 19)) +#define vis_opf(X) ((X) << 5) +#define vis_sreg(X) (X) +#define vis_dreg(X) (((X)&0x1f)|((X)>>5)) +#define vis_rs1_s(X) (vis_sreg(X) << 14) +#define vis_rs1_d(X) (vis_dreg(X) << 14) +#define vis_rs2_s(X) (vis_sreg(X) << 0) +#define vis_rs2_d(X) (vis_dreg(X) << 0) +#define vis_rd_s(X) (vis_sreg(X) << 25) +#define vis_rd_d(X) (vis_dreg(X) << 25) + +#define vis_ss2s(opf,rs1,rs2,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs1_s(rs1) | \ + vis_rs2_s(rs2) | \ + vis_rd_s(rd))) + +#define vis_dd2d(opf,rs1,rs2,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs1_d(rs1) | \ + vis_rs2_d(rs2) | \ + vis_rd_d(rd))) + +#define vis_ss2d(opf,rs1,rs2,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs1_s(rs1) | \ + vis_rs2_s(rs2) | \ + vis_rd_d(rd))) + +#define vis_sd2d(opf,rs1,rs2,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs1_s(rs1) | \ + vis_rs2_d(rs2) | \ + vis_rd_d(rd))) + +#define vis_d2s(opf,rs2,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs2_d(rs2) | \ + vis_rd_s(rd))) + +#define vis_s2d(opf,rs2,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs2_s(rs2) | \ + vis_rd_d(rd))) + +#define vis_d12d(opf,rs1,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs1_d(rs1) | \ + vis_rd_d(rd))) + +#define vis_d22d(opf,rs2,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs2_d(rs2) | \ + vis_rd_d(rd))) + +#define vis_s12s(opf,rs1,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs1_s(rs1) | \ + vis_rd_s(rd))) + +#define vis_s22s(opf,rs2,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rs2_s(rs2) | \ + vis_rd_s(rd))) + +#define vis_s(opf,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rd_s(rd))) + +#define vis_d(opf,rd) \ + __asm__ __volatile__ (".word %0" \ + : : "i" (vis_opc_base | vis_opf(opf) | \ + vis_rd_d(rd))) + +#define vis_r2m(op,rd,mem) \ + __asm__ __volatile__ (#op "\t%%f" #rd ", [%0]" : : "r" (&(mem)) ) + +#define vis_r2m_2(op,rd,mem1,mem2) \ + __asm__ __volatile__ (#op "\t%%f" #rd ", [%0 + %1]" : : "r" (mem1), "r" (mem2) ) + +#define vis_m2r(op,mem,rd) \ + __asm__ __volatile__ (#op "\t[%0], %%f" #rd : : "r" (&(mem)) ) + +#define vis_m2r_2(op,mem1,mem2,rd) \ + __asm__ __volatile__ (#op "\t[%0 + %1], %%f" #rd : : "r" (mem1), "r" (mem2) ) + +static inline void vis_set_gsr(unsigned int _val) +{ + register unsigned int val asm("g1"); + + val = _val; + __asm__ __volatile__(".word 0xa7804000" + : : "r" (val)); +} + +#define VIS_GSR_ALIGNADDR_MASK 0x0000007 +#define VIS_GSR_ALIGNADDR_SHIFT 0 +#define VIS_GSR_SCALEFACT_MASK 0x0000078 +#define VIS_GSR_SCALEFACT_SHIFT 3 + +#define vis_ld32(mem,rs1) vis_m2r(ld, mem, rs1) +#define vis_ld32_2(mem1,mem2,rs1) vis_m2r_2(ld, mem1, mem2, rs1) +#define vis_st32(rs1,mem) vis_r2m(st, rs1, mem) +#define vis_st32_2(rs1,mem1,mem2) vis_r2m_2(st, rs1, mem1, mem2) +#define vis_ld64(mem,rs1) vis_m2r(ldd, mem, rs1) +#define vis_ld64_2(mem1,mem2,rs1) vis_m2r_2(ldd, mem1, mem2, rs1) +#define vis_st64(rs1,mem) vis_r2m(std, rs1, mem) +#define vis_st64_2(rs1,mem1,mem2) vis_r2m_2(std, rs1, mem1, mem2) + +#define vis_ldblk(mem, rd) \ +do { register void *__mem asm("g1"); \ + __mem = &(mem); \ + __asm__ __volatile__(".word 0xc1985e00 | %1" \ + : \ + : "r" (__mem), \ + "i" (vis_rd_d(rd)) \ + : "memory"); \ +} while (0) + +#define vis_stblk(rd, mem) \ +do { register void *__mem asm("g1"); \ + __mem = &(mem); \ + __asm__ __volatile__(".word 0xc1b85e00 | %1" \ + : \ + : "r" (__mem), \ + "i" (vis_rd_d(rd)) \ + : "memory"); \ +} while (0) + +#define vis_membar_storestore() \ + __asm__ __volatile__(".word 0x8143e008" : : : "memory") + +#define vis_membar_sync() \ + __asm__ __volatile__(".word 0x8143e040" : : : "memory") + +/* 16 and 32 bit partitioned addition and subtraction. The normal + * versions perform 4 16-bit or 2 32-bit additions or subtractions. + * The 's' versions perform 2 16-bit or 2 32-bit additions or + * subtractions. + */ + +#define vis_padd16(rs1,rs2,rd) vis_dd2d(0x50, rs1, rs2, rd) +#define vis_padd16s(rs1,rs2,rd) vis_ss2s(0x51, rs1, rs2, rd) +#define vis_padd32(rs1,rs2,rd) vis_dd2d(0x52, rs1, rs2, rd) +#define vis_padd32s(rs1,rs2,rd) vis_ss2s(0x53, rs1, rs2, rd) +#define vis_psub16(rs1,rs2,rd) vis_dd2d(0x54, rs1, rs2, rd) +#define vis_psub16s(rs1,rs2,rd) vis_ss2s(0x55, rs1, rs2, rd) +#define vis_psub32(rs1,rs2,rd) vis_dd2d(0x56, rs1, rs2, rd) +#define vis_psub32s(rs1,rs2,rd) vis_ss2s(0x57, rs1, rs2, rd) + +/* Pixel formatting instructions. */ + +#define vis_pack16(rs2,rd) vis_d2s( 0x3b, rs2, rd) +#define vis_pack32(rs1,rs2,rd) vis_dd2d(0x3a, rs1, rs2, rd) +#define vis_packfix(rs2,rd) vis_d2s( 0x3d, rs2, rd) +#define vis_expand(rs2,rd) vis_s2d( 0x4d, rs2, rd) +#define vis_pmerge(rs1,rs2,rd) vis_ss2d(0x4b, rs1, rs2, rd) + +/* Partitioned multiply instructions. */ + +#define vis_mul8x16(rs1,rs2,rd) vis_sd2d(0x31, rs1, rs2, rd) +#define vis_mul8x16au(rs1,rs2,rd) vis_ss2d(0x33, rs1, rs2, rd) +#define vis_mul8x16al(rs1,rs2,rd) vis_ss2d(0x35, rs1, rs2, rd) +#define vis_mul8sux16(rs1,rs2,rd) vis_dd2d(0x36, rs1, rs2, rd) +#define vis_mul8ulx16(rs1,rs2,rd) vis_dd2d(0x37, rs1, rs2, rd) +#define vis_muld8sux16(rs1,rs2,rd) vis_ss2d(0x38, rs1, rs2, rd) +#define vis_muld8ulx16(rs1,rs2,rd) vis_ss2d(0x39, rs1, rs2, rd) + +/* Alignment instructions. */ + +static inline void *vis_alignaddr(void *_ptr) +{ + register void *ptr asm("g1"); + + ptr = _ptr; + + __asm__ __volatile__(".word %2" + : "=&r" (ptr) + : "0" (ptr), + "i" (vis_opc_base | vis_opf(0x18) | + vis_rs1_s(1) | + vis_rs2_s(0) | + vis_rd_s(1))); + + return ptr; +} + +static inline void vis_alignaddr_g0(void *_ptr) +{ + register void *ptr asm("g1"); + + ptr = _ptr; + + __asm__ __volatile__(".word %2" + : "=&r" (ptr) + : "0" (ptr), + "i" (vis_opc_base | vis_opf(0x18) | + vis_rs1_s(1) | + vis_rs2_s(0) | + vis_rd_s(0))); +} + +static inline void *vis_alignaddrl(void *_ptr) +{ + register void *ptr asm("g1"); + + ptr = _ptr; + + __asm__ __volatile__(".word %2" + : "=&r" (ptr) + : "0" (ptr), + "i" (vis_opc_base | vis_opf(0x19) | + vis_rs1_s(1) | + vis_rs2_s(0) | + vis_rd_s(1))); + + return ptr; +} + +static inline void vis_alignaddrl_g0(void *_ptr) +{ + register void *ptr asm("g1"); + + ptr = _ptr; + + __asm__ __volatile__(".word %2" + : "=&r" (ptr) + : "0" (ptr), + "i" (vis_opc_base | vis_opf(0x19) | + vis_rs1_s(1) | + vis_rs2_s(0) | + vis_rd_s(0))); +} + +#define vis_faligndata(rs1,rs2,rd) vis_dd2d(0x48, rs1, rs2, rd) + +/* Logical operate instructions. */ + +#define vis_fzero(rd) vis_d( 0x60, rd) +#define vis_fzeros(rd) vis_s( 0x61, rd) +#define vis_fone(rd) vis_d( 0x7e, rd) +#define vis_fones(rd) vis_s( 0x7f, rd) +#define vis_src1(rs1,rd) vis_d12d(0x74, rs1, rd) +#define vis_src1s(rs1,rd) vis_s12s(0x75, rs1, rd) +#define vis_src2(rs2,rd) vis_d22d(0x78, rs2, rd) +#define vis_src2s(rs2,rd) vis_s22s(0x79, rs2, rd) +#define vis_not1(rs1,rd) vis_d12d(0x6a, rs1, rd) +#define vis_not1s(rs1,rd) vis_s12s(0x6b, rs1, rd) +#define vis_not2(rs2,rd) vis_d22d(0x66, rs2, rd) +#define vis_not2s(rs2,rd) vis_s22s(0x67, rs2, rd) +#define vis_or(rs1,rs2,rd) vis_dd2d(0x7c, rs1, rs2, rd) +#define vis_ors(rs1,rs2,rd) vis_ss2s(0x7d, rs1, rs2, rd) +#define vis_nor(rs1,rs2,rd) vis_dd2d(0x62, rs1, rs2, rd) +#define vis_nors(rs1,rs2,rd) vis_ss2s(0x63, rs1, rs2, rd) +#define vis_and(rs1,rs2,rd) vis_dd2d(0x70, rs1, rs2, rd) +#define vis_ands(rs1,rs2,rd) vis_ss2s(0x71, rs1, rs2, rd) +#define vis_nand(rs1,rs2,rd) vis_dd2d(0x6e, rs1, rs2, rd) +#define vis_nands(rs1,rs2,rd) vis_ss2s(0x6f, rs1, rs2, rd) +#define vis_xor(rs1,rs2,rd) vis_dd2d(0x6c, rs1, rs2, rd) +#define vis_xors(rs1,rs2,rd) vis_ss2s(0x6d, rs1, rs2, rd) +#define vis_xnor(rs1,rs2,rd) vis_dd2d(0x72, rs1, rs2, rd) +#define vis_xnors(rs1,rs2,rd) vis_ss2s(0x73, rs1, rs2, rd) +#define vis_ornot1(rs1,rs2,rd) vis_dd2d(0x7a, rs1, rs2, rd) +#define vis_ornot1s(rs1,rs2,rd) vis_ss2s(0x7b, rs1, rs2, rd) +#define vis_ornot2(rs1,rs2,rd) vis_dd2d(0x76, rs1, rs2, rd) +#define vis_ornot2s(rs1,rs2,rd) vis_ss2s(0x77, rs1, rs2, rd) +#define vis_andnot1(rs1,rs2,rd) vis_dd2d(0x68, rs1, rs2, rd) +#define vis_andnot1s(rs1,rs2,rd) vis_ss2s(0x69, rs1, rs2, rd) +#define vis_andnot2(rs1,rs2,rd) vis_dd2d(0x64, rs1, rs2, rd) +#define vis_andnot2s(rs1,rs2,rd) vis_ss2s(0x65, rs1, rs2, rd) + +/* Pixel component distance. */ + +#define vis_pdist(rs1,rs2,rd) vis_dd2d(0x3e, rs1, rs2, rd) diff --git a/k9decmpeg/vlc.h b/k9decmpeg/vlc.h new file mode 100755 index 0000000..f82e595 --- /dev/null +++ b/k9decmpeg/vlc.h @@ -0,0 +1,429 @@ +/* + * vlc.h + * Copyright (C) 2000-2003 Michel Lespinasse + * Copyright (C) 1999-2000 Aaron Holtzman + * + * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. + * See http://libmpeg2.sourceforge.net/ for updates. + * + * mpeg2dec 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. + * + * mpeg2dec is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define GETWORD(bit_buf,shift,bit_ptr) \ +do { \ + bit_buf |= ((bit_ptr[0] << 8) | bit_ptr[1]) << (shift); \ + bit_ptr += 2; \ +} while (0) + +static inline void bitstream_init (mpeg2_decoder_t * decoder, + const uint8_t * start) +{ + decoder->bitstream_buf = + (start[0] << 24) | (start[1] << 16) | (start[2] << 8) | start[3]; + decoder->bitstream_ptr = start + 4; + decoder->bitstream_bits = -16; +} + +/* make sure that there are at least 16 valid bits in bit_buf */ +#define NEEDBITS(bit_buf,bits,bit_ptr) \ +do { \ + if (unlikely (bits > 0)) { \ + GETWORD (bit_buf, bits, bit_ptr); \ + bits -= 16; \ + } \ +} while (0) + +/* remove num valid bits from bit_buf */ +#define DUMPBITS(bit_buf,bits,num) \ +do { \ + bit_buf <<= (num); \ + bits += (num); \ +} while (0) + +/* take num bits from the high part of bit_buf and zero extend them */ +#define UBITS(bit_buf,num) (((uint32_t)(bit_buf)) >> (32 - (num))) + +/* take num bits from the high part of bit_buf and sign extend them */ +#define SBITS(bit_buf,num) (((int32_t)(bit_buf)) >> (32 - (num))) + +typedef struct { + uint8_t modes; + uint8_t len; +} MBtab; + +typedef struct { + uint8_t delta; + uint8_t len; +} MVtab; + +typedef struct { + int8_t dmv; + uint8_t len; +} DMVtab; + +typedef struct { + uint8_t cbp; + uint8_t len; +} CBPtab; + +typedef struct { + uint8_t size; + uint8_t len; +} DCtab; + +typedef struct { + uint8_t run; + uint8_t level; + uint8_t len; +} DCTtab; + +typedef struct { + uint8_t mba; + uint8_t len; +} MBAtab; + + +#define INTRA MACROBLOCK_INTRA +#define QUANT MACROBLOCK_QUANT + +static const MBtab MB_I [] = { + {INTRA|QUANT, 2}, {INTRA, 1} +}; + +#define MC MACROBLOCK_MOTION_FORWARD +#define CODED MACROBLOCK_PATTERN + +static const MBtab MB_P [] = { + {INTRA|QUANT, 6}, {CODED|QUANT, 5}, {MC|CODED|QUANT, 5}, {INTRA, 5}, + {MC, 3}, {MC, 3}, {MC, 3}, {MC, 3}, + {CODED, 2}, {CODED, 2}, {CODED, 2}, {CODED, 2}, + {CODED, 2}, {CODED, 2}, {CODED, 2}, {CODED, 2}, + {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, + {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, + {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, + {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1} +}; + +#define FWD MACROBLOCK_MOTION_FORWARD +#define BWD MACROBLOCK_MOTION_BACKWARD +#define INTER MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD + +static const MBtab MB_B [] = { + {0, 0}, {INTRA|QUANT, 6}, + {BWD|CODED|QUANT, 6}, {FWD|CODED|QUANT, 6}, + {INTER|CODED|QUANT, 5}, {INTER|CODED|QUANT, 5}, + {INTRA, 5}, {INTRA, 5}, + {FWD, 4}, {FWD, 4}, {FWD, 4}, {FWD, 4}, + {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, + {BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3}, + {BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3}, + {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, + {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, + {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2}, + {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2}, + {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2}, + {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2}, + {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, + {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, + {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, + {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2} +}; + +#undef INTRA +#undef QUANT +#undef MC +#undef CODED +#undef FWD +#undef BWD +#undef INTER + + +static const MVtab MV_4 [] = { + { 3, 6}, { 2, 4}, { 1, 3}, { 1, 3}, { 0, 2}, { 0, 2}, { 0, 2}, { 0, 2} +}; + +static const MVtab MV_10 [] = { + { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, + { 0,10}, { 0,10}, { 0,10}, { 0,10}, {15,10}, {14,10}, {13,10}, {12,10}, + {11,10}, {10,10}, { 9, 9}, { 9, 9}, { 8, 9}, { 8, 9}, { 7, 9}, { 7, 9}, + { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, + { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, + { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7} +}; + + +static const DMVtab DMV_2 [] = { + { 0, 1}, { 0, 1}, { 1, 2}, {-1, 2} +}; + + +static const CBPtab CBP_7 [] = { + {0x11, 7}, {0x12, 7}, {0x14, 7}, {0x18, 7}, + {0x21, 7}, {0x22, 7}, {0x24, 7}, {0x28, 7}, + {0x3f, 6}, {0x3f, 6}, {0x30, 6}, {0x30, 6}, + {0x09, 6}, {0x09, 6}, {0x06, 6}, {0x06, 6}, + {0x1f, 5}, {0x1f, 5}, {0x1f, 5}, {0x1f, 5}, + {0x10, 5}, {0x10, 5}, {0x10, 5}, {0x10, 5}, + {0x2f, 5}, {0x2f, 5}, {0x2f, 5}, {0x2f, 5}, + {0x20, 5}, {0x20, 5}, {0x20, 5}, {0x20, 5}, + {0x07, 5}, {0x07, 5}, {0x07, 5}, {0x07, 5}, + {0x0b, 5}, {0x0b, 5}, {0x0b, 5}, {0x0b, 5}, + {0x0d, 5}, {0x0d, 5}, {0x0d, 5}, {0x0d, 5}, + {0x0e, 5}, {0x0e, 5}, {0x0e, 5}, {0x0e, 5}, + {0x05, 5}, {0x05, 5}, {0x05, 5}, {0x05, 5}, + {0x0a, 5}, {0x0a, 5}, {0x0a, 5}, {0x0a, 5}, + {0x03, 5}, {0x03, 5}, {0x03, 5}, {0x03, 5}, + {0x0c, 5}, {0x0c, 5}, {0x0c, 5}, {0x0c, 5}, + {0x01, 4}, {0x01, 4}, {0x01, 4}, {0x01, 4}, + {0x01, 4}, {0x01, 4}, {0x01, 4}, {0x01, 4}, + {0x02, 4}, {0x02, 4}, {0x02, 4}, {0x02, 4}, + {0x02, 4}, {0x02, 4}, {0x02, 4}, {0x02, 4}, + {0x04, 4}, {0x04, 4}, {0x04, 4}, {0x04, 4}, + {0x04, 4}, {0x04, 4}, {0x04, 4}, {0x04, 4}, + {0x08, 4}, {0x08, 4}, {0x08, 4}, {0x08, 4}, + {0x08, 4}, {0x08, 4}, {0x08, 4}, {0x08, 4}, + {0x0f, 3}, {0x0f, 3}, {0x0f, 3}, {0x0f, 3}, + {0x0f, 3}, {0x0f, 3}, {0x0f, 3}, {0x0f, 3}, + {0x0f, 3}, {0x0f, 3}, {0x0f, 3}, {0x0f, 3}, + {0x0f, 3}, {0x0f, 3}, {0x0f, 3}, {0x0f, 3} +}; + +static const CBPtab CBP_9 [] = { + {0, 0}, {0x00, 9}, {0x39, 9}, {0x36, 9}, + {0x37, 9}, {0x3b, 9}, {0x3d, 9}, {0x3e, 9}, + {0x17, 8}, {0x17, 8}, {0x1b, 8}, {0x1b, 8}, + {0x1d, 8}, {0x1d, 8}, {0x1e, 8}, {0x1e, 8}, + {0x27, 8}, {0x27, 8}, {0x2b, 8}, {0x2b, 8}, + {0x2d, 8}, {0x2d, 8}, {0x2e, 8}, {0x2e, 8}, + {0x19, 8}, {0x19, 8}, {0x16, 8}, {0x16, 8}, + {0x29, 8}, {0x29, 8}, {0x26, 8}, {0x26, 8}, + {0x35, 8}, {0x35, 8}, {0x3a, 8}, {0x3a, 8}, + {0x33, 8}, {0x33, 8}, {0x3c, 8}, {0x3c, 8}, + {0x15, 8}, {0x15, 8}, {0x1a, 8}, {0x1a, 8}, + {0x13, 8}, {0x13, 8}, {0x1c, 8}, {0x1c, 8}, + {0x25, 8}, {0x25, 8}, {0x2a, 8}, {0x2a, 8}, + {0x23, 8}, {0x23, 8}, {0x2c, 8}, {0x2c, 8}, + {0x31, 8}, {0x31, 8}, {0x32, 8}, {0x32, 8}, + {0x34, 8}, {0x34, 8}, {0x38, 8}, {0x38, 8} +}; + + +static const DCtab DC_lum_5 [] = { + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {0, 3}, {0, 3}, {0, 3}, {0, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, + {4, 3}, {4, 3}, {4, 3}, {4, 3}, {5, 4}, {5, 4}, {6, 5} +}; + +static const DCtab DC_chrom_5 [] = { + {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {3, 3}, {3, 3}, {3, 3}, {3, 3}, {4, 4}, {4, 4}, {5, 5} +}; + +static const DCtab DC_long [] = { + {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, { 6, 5}, { 6, 5}, + {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, { 6, 5}, { 6, 5}, + {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, { 7, 6}, { 7, 6}, + {8, 7}, {8, 7}, {8, 7}, {8, 7}, {9, 8}, {9, 8}, {10, 9}, {11, 9} +}; + + +static const DCTtab DCT_16 [] = { + {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, + {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, + {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, + {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, + { 2,18, 0}, { 2,17, 0}, { 2,16, 0}, { 2,15, 0}, + { 7, 3, 0}, { 17, 2, 0}, { 16, 2, 0}, { 15, 2, 0}, + { 14, 2, 0}, { 13, 2, 0}, { 12, 2, 0}, { 32, 1, 0}, + { 31, 1, 0}, { 30, 1, 0}, { 29, 1, 0}, { 28, 1, 0} +}; + +static const DCTtab DCT_15 [] = { + { 1,40,15}, { 1,39,15}, { 1,38,15}, { 1,37,15}, + { 1,36,15}, { 1,35,15}, { 1,34,15}, { 1,33,15}, + { 1,32,15}, { 2,14,15}, { 2,13,15}, { 2,12,15}, + { 2,11,15}, { 2,10,15}, { 2, 9,15}, { 2, 8,15}, + { 1,31,14}, { 1,31,14}, { 1,30,14}, { 1,30,14}, + { 1,29,14}, { 1,29,14}, { 1,28,14}, { 1,28,14}, + { 1,27,14}, { 1,27,14}, { 1,26,14}, { 1,26,14}, + { 1,25,14}, { 1,25,14}, { 1,24,14}, { 1,24,14}, + { 1,23,14}, { 1,23,14}, { 1,22,14}, { 1,22,14}, + { 1,21,14}, { 1,21,14}, { 1,20,14}, { 1,20,14}, + { 1,19,14}, { 1,19,14}, { 1,18,14}, { 1,18,14}, + { 1,17,14}, { 1,17,14}, { 1,16,14}, { 1,16,14} +}; + +static const DCTtab DCT_13 [] = { + { 11, 2,13}, { 10, 2,13}, { 6, 3,13}, { 4, 4,13}, + { 3, 5,13}, { 2, 7,13}, { 2, 6,13}, { 1,15,13}, + { 1,14,13}, { 1,13,13}, { 1,12,13}, { 27, 1,13}, + { 26, 1,13}, { 25, 1,13}, { 24, 1,13}, { 23, 1,13}, + { 1,11,12}, { 1,11,12}, { 9, 2,12}, { 9, 2,12}, + { 5, 3,12}, { 5, 3,12}, { 1,10,12}, { 1,10,12}, + { 3, 4,12}, { 3, 4,12}, { 8, 2,12}, { 8, 2,12}, + { 22, 1,12}, { 22, 1,12}, { 21, 1,12}, { 21, 1,12}, + { 1, 9,12}, { 1, 9,12}, { 20, 1,12}, { 20, 1,12}, + { 19, 1,12}, { 19, 1,12}, { 2, 5,12}, { 2, 5,12}, + { 4, 3,12}, { 4, 3,12}, { 1, 8,12}, { 1, 8,12}, + { 7, 2,12}, { 7, 2,12}, { 18, 1,12}, { 18, 1,12} +}; + +static const DCTtab DCT_B14_10 [] = { + { 17, 1,10}, { 6, 2,10}, { 1, 7,10}, { 3, 3,10}, + { 2, 4,10}, { 16, 1,10}, { 15, 1,10}, { 5, 2,10} +}; + +static const DCTtab DCT_B14_8 [] = { + { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, + { 3, 2, 7}, { 3, 2, 7}, { 10, 1, 7}, { 10, 1, 7}, + { 1, 4, 7}, { 1, 4, 7}, { 9, 1, 7}, { 9, 1, 7}, + { 8, 1, 6}, { 8, 1, 6}, { 8, 1, 6}, { 8, 1, 6}, + { 7, 1, 6}, { 7, 1, 6}, { 7, 1, 6}, { 7, 1, 6}, + { 2, 2, 6}, { 2, 2, 6}, { 2, 2, 6}, { 2, 2, 6}, + { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, + { 14, 1, 8}, { 1, 6, 8}, { 13, 1, 8}, { 12, 1, 8}, + { 4, 2, 8}, { 2, 3, 8}, { 1, 5, 8}, { 11, 1, 8} +}; + +static const DCTtab DCT_B14AC_5 [] = { + { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, + { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, + {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2} +}; + +static const DCTtab DCT_B14DC_5 [] = { + { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, + { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, + { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, + { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, + { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1} +}; + +static const DCTtab DCT_B15_10 [] = { + { 6, 2, 9}, { 6, 2, 9}, { 15, 1, 9}, { 15, 1, 9}, + { 3, 4,10}, { 17, 1,10}, { 16, 1, 9}, { 16, 1, 9} +}; + +static const DCTtab DCT_B15_8 [] = { + { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, + { 8, 1, 7}, { 8, 1, 7}, { 9, 1, 7}, { 9, 1, 7}, + { 7, 1, 7}, { 7, 1, 7}, { 3, 2, 7}, { 3, 2, 7}, + { 1, 7, 6}, { 1, 7, 6}, { 1, 7, 6}, { 1, 7, 6}, + { 1, 6, 6}, { 1, 6, 6}, { 1, 6, 6}, { 1, 6, 6}, + { 5, 1, 6}, { 5, 1, 6}, { 5, 1, 6}, { 5, 1, 6}, + { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, + { 2, 5, 8}, { 12, 1, 8}, { 1,11, 8}, { 1,10, 8}, + { 14, 1, 8}, { 13, 1, 8}, { 4, 2, 8}, { 2, 4, 8}, + { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, + { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, + { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, + { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, + { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, + { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, + {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, + {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, + {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, + { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, + { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, + { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, + { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, + { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, + { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, + { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, + { 10, 1, 7}, { 10, 1, 7}, { 2, 3, 7}, { 2, 3, 7}, + { 11, 1, 7}, { 11, 1, 7}, { 1, 8, 7}, { 1, 8, 7}, + { 1, 9, 7}, { 1, 9, 7}, { 1,12, 8}, { 1,13, 8}, + { 3, 3, 8}, { 5, 2, 8}, { 1,14, 8}, { 1,15, 8} +}; + + +static const MBAtab MBA_5 [] = { + {6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4}, + {2, 3}, {2, 3}, {2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, + {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, + {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1} +}; + +static const MBAtab MBA_11 [] = { + {32, 11}, {31, 11}, {30, 11}, {29, 11}, + {28, 11}, {27, 11}, {26, 11}, {25, 11}, + {24, 11}, {23, 11}, {22, 11}, {21, 11}, + {20, 10}, {20, 10}, {19, 10}, {19, 10}, + {18, 10}, {18, 10}, {17, 10}, {17, 10}, + {16, 10}, {16, 10}, {15, 10}, {15, 10}, + {14, 8}, {14, 8}, {14, 8}, {14, 8}, + {14, 8}, {14, 8}, {14, 8}, {14, 8}, + {13, 8}, {13, 8}, {13, 8}, {13, 8}, + {13, 8}, {13, 8}, {13, 8}, {13, 8}, + {12, 8}, {12, 8}, {12, 8}, {12, 8}, + {12, 8}, {12, 8}, {12, 8}, {12, 8}, + {11, 8}, {11, 8}, {11, 8}, {11, 8}, + {11, 8}, {11, 8}, {11, 8}, {11, 8}, + {10, 8}, {10, 8}, {10, 8}, {10, 8}, + {10, 8}, {10, 8}, {10, 8}, {10, 8}, + { 9, 8}, { 9, 8}, { 9, 8}, { 9, 8}, + { 9, 8}, { 9, 8}, { 9, 8}, { 9, 8}, + { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7}, + { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7}, + { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7}, + { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7}, + { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7}, + { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7}, + { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7}, + { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7} +}; diff --git a/k9devices/Makefile.am b/k9devices/Makefile.am new file mode 100644 index 0000000..c939086 --- /dev/null +++ b/k9devices/Makefile.am @@ -0,0 +1,10 @@ +INCLUDES = -I$(top_srcdir)/dvdread -I$(top_srcdir)/libk9copy $(DBUS_INCS) \ + $(HAL_INCS) $(K3B_INCS) $(all_includes) +METASOURCES = AUTO +libk9devices_la_LDFLAGS = $(all_libraries) +noinst_LTLIBRARIES = libk9devices.la +noinst_HEADERS = k9halconnection.h k9haldevice.h k9cddrive.h k9dbusdispatch.h +libk9devices_la_SOURCES = k9halconnection.cpp k9haldevice.cpp k9cddrive.cpp \ + k9dbusdispatch.cpp + +libk9devices_la_LIBADD = $(K3B_LIBS) $(HAL_DBUS_LIBS) diff --git a/k9devices/configure.in.in b/k9devices/configure.in.in new file mode 100644 index 0000000..b4092e6 --- /dev/null +++ b/k9devices/configure.in.in @@ -0,0 +1,134 @@ + have_hal=no + AC_MSG_CHECKING(for the HAL) + + AC_ARG_ENABLE([k3bdevices], + AC_HELP_STRING([--enable-k3bdevices], + [do not activate hal/dbus support (use k3bdevice instead)]), + [enable_hal=no], + [enable_hal=yes]) + + + if test x"$enable_hal" = xyes; then + hal_inc=NOTFOUND + hal_lib=NOTFOUND + hal=NOTFOUND + + search_incs="$kde_includes /usr/include /usr/include/hal /usr/local/include /usr/local/include/hal" + AC_FIND_FILE(libhal.h libhal-storage.h, $search_incs, hal_incdir) + + if [test -r $hal_incdir/libhal.h] ; then + HAL_INCS="-I$hal_incdir" + hal_inc=FOUND + fi + + if test -r $hal_incdir/libhal-storage.h ; then + hal_storage_version=4 + grep LibHalVolume $hal_incdir/libhal-storage.h \ + > /dev/null 2>&1 && hal_storage_version=5 + if test $hal_storage_version = 4 ; then + AC_DEFINE(HAL_0_4, , [HAL API version 0.4]) + fi + fi + + search_libs="$kde_libraries /usr/lib64 /usr/lib /usr/local/lib /lib /lib64" + AC_FIND_FILE(libhal.so, $search_libs, hal_libdir) + + if [test -r $hal_libdir/libhal.so] ; then + HAL_LIBS="-L$hal_libdir -lhal" + hal_lib=FOUND + fi + + if [test -r $hal_libdir/libhal-storage.so] ; then + HAL_LIBS_STORAGE="-L$hal_libdir -lhal-storage" + hal_lib_storage=FOUND + fi + + if [test $hal_inc = FOUND] && [test $hal_lib = FOUND] ; then + AC_MSG_RESULT(headers $hal_incdir libraries $hal_libdir) + hal=FOUND + else + AC_MSG_RESULT(searched but not found) + AC_MSG_ERROR(libhal may be missing) + fi + + AC_SUBST(HAL_INCS) + AC_SUBST(HAL_LIBS) + + + ########### Check for DBus + + AC_MSG_CHECKING(for DBus) + + dbus_inc=NOTFOUND + dbus_lib=NOTFOUND + dbus=NOTFOUND + + search_incs="$kde_includes /usr/include /usr/include/dbus-1.0 /usr/local/include /usr/local/include/dbus-1.0" + AC_FIND_FILE(dbus/dbus.h, $search_incs, dbus_incdir) + + search_incs_arch_deps="$kde_includes /usr/lib64/dbus-1.0/include /usr/lib/dbus-1.0/include /usr/local/lib/dbus-1.0/include" + AC_FIND_FILE(dbus/dbus-arch-deps.h, $search_incs_arch_deps, dbus_incdir_arch_deps) + + if [test -r $dbus_incdir/dbus/dbus.h] && [test -r $dbus_incdir_arch_deps/dbus/dbus-arch-deps.h] ; then + DBUS_INCS="-I$dbus_incdir -I$dbus_incdir_arch_deps" + dbus_inc=FOUND + fi + + search_libs="$kde_libraries /usr/lib64 /usr/lib /usr/local/lib /lib /lib64" + AC_FIND_FILE(libdbus-1.so, $search_libs, dbus_libdir) + + if test -r $dbus_libdir/libdbus-1.so ; then + DBUS_LIBS="-L$dbus_libdir -ldbus-1" + dbus_lib=FOUND + fi + + if [test $dbus_inc = FOUND] && [test $dbus_lib = FOUND] ; then + AC_MSG_RESULT(headers $dbus_incdir $dbus_incdir_arch_deps libraries $dbus_libdir) + dbus=FOUND + else + AC_MSG_RESULT(searched but not found) + AC_MSG_ERROR(dbus may be missing) + fi + + AC_SUBST(DBUS_INCS) + AC_SUBST(DBUS_LIBS) + + + ########### Check if media HAL backend should be compiled + + HAL_DBUS_LIBS="" + if [test "x$hal" = "xFOUND"] && [test "x$dbus" = "xFOUND"] && [ test $hal_storage_version = 5 ] ; then + AC_DEFINE(HAVE_HAL, , [compile in HAL support]) + have_hal=yes + HAL_DBUS_LIBS="$HAL_LIBS $HAL_LIBS_STORAGE $DBUS_LIBS" + fi + + AC_SUBST(HAL_DBUS_LIBS) +else + search_incs="$kde_includes /usr/include /usr/local/include" + AC_FIND_FILE(k3bdevice.h, $search_incs, k3b_incdir) + + if [test -r $k3b_incdir/k3bdevice.h] ; then + k3b_inc=FOUND + fi + + search_libs="$kde_libraries /usr/lib64 /usr/lib /usr/local/lib /lib /lib64" + AC_FIND_FILE(libk3bdevice.so, $search_libs, k3b_libdir) + + if [test -r $k3b_libdir/libk3bdevice.so] ; then + K3B_LIBS="-lk3bdevice" + k3b_lib=FOUND + fi + + if [test $k3b_inc = FOUND] && [test $k3b_lib = FOUND] ; then + AC_MSG_RESULT(headers $k3b_incdir libraries $k3b_libdir) + k3b=FOUND + else + AC_MSG_RESULT(libk3bdevice searched but not found) + AC_MSG_ERROR(libk3bdevice may be missing) + fi + + AC_SUBST(K3B_LIBS) + +fi + diff --git a/k9devices/k9cddrive.cpp b/k9devices/k9cddrive.cpp new file mode 100644 index 0000000..0a47b70 --- /dev/null +++ b/k9devices/k9cddrive.cpp @@ -0,0 +1,199 @@ +// +// C++ Implementation: k9cddrive +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9common.h" +#include "k9cddrive.h" +#include "k9config.h" +#include "k9tools.h" + +#ifdef HAVE_HAL +#include "k9halconnection.h" +#include "k9haldevice.h" +#else +#include +#include +#endif + +#include +k9CdDrive::k9CdDrive() { + canReadDVD=false; + canWriteCDR=false; + canWriteDVD=false; + device=""; + name=""; + #ifdef HAVE_HAL + m_Device=NULL; + #endif +} +k9CdDrive::~k9CdDrive() {} + +k9CdDrives::k9CdDrives():QObject( 0,0) { + drives.setAutoDelete(true); + #ifdef HAVE_HAL + m_connection=k9HalConnection::getInstance(); + connect(m_connection,SIGNAL(deviceAdded( k9HalDevice* )),this,SLOT(deviceAdded( k9HalDevice* ))); + connect(m_connection,SIGNAL(deviceRemoved( k9HalDevice* )),this,SLOT(deviceRemoved( k9HalDevice*))); + #else + m_devMgr=new K3bDevice::DeviceManager(this); + + #endif + scanDrives(); +} +k9CdDrives::~k9CdDrives() { + #ifdef HAVE_HAL + m_connection->end(); + #else + delete m_devMgr; + #endif +} + +void k9CdDrives::deviceAdded( k9HalDevice *_device) { +#ifdef HAVE_HAL + addDrive( _device); +#endif +} + +void k9CdDrives::deviceRemoved(k9HalDevice *_device) { +#ifdef HAVE_HAL + for (k9CdDrive *d=drives.first();d;d=drives.next()) { + if (d->getDevice()==_device) { + emit deviceRemoved( d); + drives.remove(d); + break; + } + } +#endif +} +#ifdef HAVE_HAL +void k9CdDrives::addDrive(k9HalDevice *_device) { + k9CdDrive *drive=new k9CdDrive; + drive->setDevice( _device); + drive->canReadDVD=_device->getCanReadDvd(); + drive->canWriteDVD=_device->getCanBurnDvd(); + drive->canWriteCDR=_device->getCanBurnCd(); + drive->device=_device->getDeviceName(); + drive->name=_device->getModel(); + QValueList writeSpeeds; + for (int i=2;i <=_device->getMaxWriteSpeed()/1385;i+=2) + writeSpeeds.append( i); + drive->setWriteSpeeds(writeSpeeds); + drives.append(drive); + emit deviceAdded( drive); + +} +#endif + +/** No descriptions */ +void k9CdDrives::scanDrives() { + drives.clear(); + + #ifdef HAVE_HAL + QPtrList list=m_connection->getDevices(); + + for (k9HalDevice *hdrive=list.first();hdrive;hdrive=list.next()) { + addDrive(hdrive); + } + #else + m_devMgr->scanBus(); + int row=0; + QPtrList lDev=m_devMgr->allDevices(); + for (K3bDevice::Device *dev=lDev.first();dev;dev=lDev.next()) { + k9CdDrive *drive=new k9CdDrive; + drive->device=dev->blockDeviceName(); + drive->name=dev->description(); + drive->canReadDVD=dev->readsDvd(); + drive->canWriteCDR=dev->writesCd(); + drive->canWriteDVD=dev->writesDvd(); + QValueList writeSpeeds; + for (int i=2;i <=dev->determineMaximalWriteSpeed()/1385;i+=2) + writeSpeeds.append( i); + drive->setWriteSpeeds(writeSpeeds); + + drive->num=row; + drives.append(drive); + row++; + emit deviceAdded(drive); + } + + #endif + readConfig(); +} + +void k9CdDrives::eject(const QString & device) { + KProcess *process =new KProcess(); + if (k9Tools::checkProgram("kdeeject")) + *process <<"kdeeject" << device; + else + *process <<"eject" << device; + process->start(); + process->wait(); + delete process; +} + + +/** reads devices that was entered manually **/ +void k9CdDrives::readConfig() { + QStringList ldev; + QStringList llabels; + QStringList lIO; + k9Config config; + ldev=config.getDevices(); + llabels=config.getDevicesLabels(); + lIO=config.getDevicesIO(); + int row=count(); + int i=0; + for ( QStringList::Iterator it = ldev.begin(); it != ldev.end(); ++it ) { + k9CdDrive *drive=new k9CdDrive; + drive->device=(*it); + QStringList::Iterator it2=llabels.at(i); + QStringList::Iterator it3=lIO.at(i); + drive->name=(*it2); + QString c=(*it3); + if (c.contains("I")) { + drive->canReadDVD=true; + } + if (c.contains("O")) { + drive->canWriteCDR=true; + drive->canWriteDVD=true; + } + drive->num=row; + drives.append(drive); + row++; + i++; + emit deviceAdded(drive); + } +} + + + +/** No descriptions */ +int k9CdDrives::count() { + return drives.count(); +} + +/** No descriptions */ +k9CdDrive * k9CdDrives::getDrive(int num) { + return (k9CdDrive *)drives.at(num); +} + + +QValueList< int > k9CdDrive::getWriteSpeeds() const { + return writeSpeeds; +} + + +void k9CdDrive::setWriteSpeeds(const QValueList< int >& _value) { + writeSpeeds = _value; +} + + + +#include "k9cddrive.moc" diff --git a/k9devices/k9cddrive.h b/k9devices/k9cddrive.h new file mode 100644 index 0000000..e64bc0f --- /dev/null +++ b/k9devices/k9cddrive.h @@ -0,0 +1,87 @@ +// +// C++ Interface: k9cddrive +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9CDDRIVE_H +#define K9CDDRIVE_H +#include "k9common.h" + +#include + +#include +#include +#include +#ifndef HAVE_HAL +#include +#include +#endif + + +/** + *@author + */ +class k9HalDevice; +class k9HalConnection; + +class k9CdDrive : public QObject { + Q_OBJECT +public: + k9CdDrive(); + ~k9CdDrive(); + int num; + QString name; + QString device; + bool canWriteCDR; + bool canReadDVD; + bool canWriteDVD; + + void setWriteSpeeds(const QValueList< int >& _value); + QValueList< int > getWriteSpeeds() const; + + #ifdef HAVE_HAL + void setDevice(k9HalDevice* _value) { m_Device = _value;} + + k9HalDevice* getDevice() { return m_Device;} + #endif +private: + QValueList writeSpeeds; + #ifdef HAVE_HAL + k9HalDevice *m_Device; + #endif +}; + +class k9CdDrives : public QObject { + Q_OBJECT +public: + k9CdDrives(); + ~k9CdDrives(); + /** No descriptions */ + int count(); + /** No descriptions */ + k9CdDrive * getDrive(int num); + void eject(const QString & device); + void scanDrives(); +public slots: + void deviceAdded(k9HalDevice *device); + void deviceRemoved(k9HalDevice *device); +signals: + void deviceAdded(k9CdDrive *drive); + void deviceRemoved(k9CdDrive *drive); +private: // Private methods + #ifdef HAVE_HAL + k9HalConnection *m_connection; + void addDrive(k9HalDevice *_device); + #else + K3bDevice::DeviceManager *m_devMgr; + #endif + void readConfig(); + QPtrList drives; +}; +#endif diff --git a/k9devices/k9dbusdispatch.cpp b/k9devices/k9dbusdispatch.cpp new file mode 100644 index 0000000..71d8a2f --- /dev/null +++ b/k9devices/k9dbusdispatch.cpp @@ -0,0 +1,231 @@ +// +// C++ Implementation: k9dbusdispatch +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9dbusdispatch.h" +#ifdef HAVE_HAL +#include + +//==============================callbacks ======================================== + + +static dbus_bool_t qDBusAddWatch(DBusWatch *watch, void *data) +{ + + int flags = dbus_watch_get_flags(watch); + int fd = dbus_watch_get_fd(watch); + + K9DBusDispatch *d=(K9DBusDispatch*)data; + + k9Watcher watcher; + if (flags & DBUS_WATCH_READABLE) { + bool enabled = dbus_watch_get_enabled(watch); + //qDebug("addReadWatch %d %s", fd, (enabled ? "enabled" : "disabled")); + watcher.watch = watch; + watcher.read = new QSocketNotifier(fd, QSocketNotifier::Read, d); + if (!enabled) watcher.read->setEnabled(false); + d->connect(watcher.read, SIGNAL(activated(int)), SLOT(socketRead(int))); + } + if (flags & DBUS_WATCH_WRITABLE) { + bool enabled = dbus_watch_get_enabled(watch); + //qDebug("addWriteWatch %d %s", fd, (enabled ? "enabled" : "disabled")); + watcher.watch = watch; + watcher.write = new QSocketNotifier(fd, QSocketNotifier::Write, d); + if (!enabled) watcher.write->setEnabled(false); + d->connect(watcher.write, SIGNAL(activated(int)), SLOT(socketWrite(int))); + } + // FIXME-QT4 d->watchers.insertMulti(fd, watcher); + K9DBusDispatch::WatcherHash::iterator it = d->watchers.find(fd); + if (it == d->watchers.end()) + { + it = d->watchers.insert(fd, K9DBusDispatch::WatcherList()); + } + it.data().append(watcher); + + return true; +} + +static void qDBusRemoveWatch(DBusWatch *watch, void *data) +{ + K9DBusDispatch *d = (K9DBusDispatch*)data; + + int fd = dbus_watch_get_fd(watch); + + K9DBusDispatch::WatcherHash::iterator it = d->watchers.find(fd); + if (it != d->watchers.end()) + { + K9DBusDispatch::WatcherList& list = *it; + for (K9DBusDispatch::WatcherList::iterator wit = list.begin(); + wit != list.end(); ++wit) + { + if ((*wit).watch == watch) + { + // migth be called from a function triggered by a socket listener + // so just disconnect them and schedule their delayed deletion. + + d->removedWatches.append(*wit); + if ((*wit).read) + { + (*wit).read->disconnect(d); + (*wit).read = 0; + } + if ((*wit).write) + { + (*wit).write->disconnect(d); + (*wit).write = 0; + } + (*wit).watch = 0; + } + } + } + + if (d->removedWatches.count() > 0) + QTimer::singleShot(0, d, SLOT(purgeRemovedWatches())); + +} + +static void qDBusToggleWatch(DBusWatch *watch, void *data) +{ + K9DBusDispatch *d=(K9DBusDispatch*)data; + int fd = dbus_watch_get_fd(watch); + + K9DBusDispatch::WatcherHash::iterator it = d->watchers.find(fd); + if (it != d->watchers.end()) { + K9DBusDispatch::WatcherList& list = *it; + for (K9DBusDispatch::WatcherList::iterator wit = list.begin(); wit != list.end(); + ++wit) + { + if ((*wit).watch == watch) { + bool enabled = dbus_watch_get_enabled(watch); + int flags = dbus_watch_get_flags(watch); + +// qDebug("toggle watch %d to %d (write: %d, read: %d)", +// dbus_watch_get_fd(watch), enabled, +// flags & DBUS_WATCH_WRITABLE, flags & DBUS_WATCH_READABLE); + + if (flags & DBUS_WATCH_READABLE && (*wit).read) + (*wit).read->setEnabled(enabled); + if (flags & DBUS_WATCH_WRITABLE && (*wit).write) + (*wit).write->setEnabled(enabled); + return; + } + } + } +} + + +void K9DBusDispatch::purgeRemovedWatches() +{ + if (removedWatches.isEmpty()) return; + + WatcherList::iterator listIt = removedWatches.begin(); + for (; listIt != removedWatches.end(); ++listIt) + { + delete (*listIt).read; + delete (*listIt).write; + } + removedWatches.clear(); + + uint count = 0; + WatcherHash::iterator it = watchers.begin(); + while (it != watchers.end()) + { + WatcherList& list = *it; + listIt = list.begin(); + while (listIt != list.end()) + { + if (!((*listIt).read) && !((*listIt).write)) + { + listIt = list.erase(listIt); + ++count; + } + } + + if (list.isEmpty()) + { + WatcherHash::iterator copyIt = it; + ++it; + watchers.erase(copyIt); + } + else + ++it; + } +} +//============================================================================== + +void K9DBusDispatch::socketRead(int fd) +{ + // FIXME-QT4 QHashIterator it(watchers); + WatcherHash::const_iterator it = watchers.find(fd); + if (it != watchers.end()) { + const WatcherList& list = *it; + for (WatcherList::const_iterator wit = list.begin(); wit != list.end(); ++wit) { + if ((*wit).read && (*wit).read->isEnabled()) { + if (!dbus_watch_handle((*wit).watch, DBUS_WATCH_READABLE)) + qDebug("OUT OF MEM"); + } + } + } + scheduleDispatch(); +} + +void K9DBusDispatch::socketWrite(int fd) +{ + // FIXME-QT4 QHashIterator it(watchers); + WatcherHash::const_iterator it = watchers.find(fd); + if (it != watchers.end()) { + const WatcherList& list = *it; + for (WatcherList::const_iterator wit = list.begin(); wit != list.end(); ++wit) { + if ((*wit).write && (*wit).write->isEnabled()) { + if (!dbus_watch_handle((*wit).watch, DBUS_WATCH_WRITABLE)) + qDebug("OUT OF MEM"); + } + } + } +} + +void K9DBusDispatch::scheduleDispatch() +{ + m_dispatcher->start(0); +} + +void K9DBusDispatch::dispatch() +{ + if (dbus_connection_dispatch(m_connection) != DBUS_DISPATCH_DATA_REMAINS) + { + // stop dispatch timer + m_dispatcher->stop(); + } +} + +K9DBusDispatch::K9DBusDispatch(QObject *parent, const char *name) + : QObject(parent, name) +{ + m_dispatcher = new QTimer(this); + QObject::connect(m_dispatcher, SIGNAL(timeout()), this, SLOT(dispatch())); +} + + +K9DBusDispatch::~K9DBusDispatch() +{ +} + + +void K9DBusDispatch::setConnection(DBusConnection* _value) { + m_connection = _value; + + dbus_connection_set_exit_on_disconnect(m_connection, false); + dbus_connection_set_watch_functions(m_connection, qDBusAddWatch, qDBusRemoveWatch, + qDBusToggleWatch, this, 0); +} + +#include "k9dbusdispatch.moc" +#endif + diff --git a/k9devices/k9dbusdispatch.h b/k9devices/k9dbusdispatch.h new file mode 100644 index 0000000..a93c2b0 --- /dev/null +++ b/k9devices/k9dbusdispatch.h @@ -0,0 +1,66 @@ +// +// C++ Interface: k9dbusdispatch +// +// Description: the main goal of this class is to dispatch dbus messages so that libhal can +// detect changes on devices. +// This code is based on QDBusConnectionPrivate from the new Qt DBus bindings +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9DBUSDISPATCH_H +#define K9DBUSDISPATCH_H +#include "k9common.h" + +#ifdef HAVE_HAL + +#include +#include +#define DBUS_API_SUBJECT_TO_CHANGE +#include +#include +#include +#include + +/** + @author Jean-Michel PETIT +*/ + +class k9Watcher { +public: + k9Watcher() { read=write=0; watch=0;}; + DBusWatch *watch; + QSocketNotifier *read,*write; +}; + +class K9DBusDispatch : public QObject +{ +Q_OBJECT +public: + K9DBusDispatch(QObject *parent = 0, const char *name = 0); + + ~K9DBusDispatch(); + void setConnection(DBusConnection* _value); + typedef QValueList WatcherList; + WatcherList removedWatches; + typedef QMap WatcherHash; + WatcherHash watchers; + +private: + QTimer *m_dispatcher; + DBusConnection *m_connection; + + void purgeRemovedWatches(); + void scheduleDispatch(); +private slots: + void socketRead(int fd); + void socketWrite(int fd); + void dispatch(); + + +}; +#endif +#endif diff --git a/k9devices/k9halconnection.cpp b/k9devices/k9halconnection.cpp new file mode 100644 index 0000000..4de67ac --- /dev/null +++ b/k9devices/k9halconnection.cpp @@ -0,0 +1,159 @@ +// +// C++ Implementation: k9halconnection +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9common.h" +#ifdef HAVE_HAL + +#include "k9halconnection.h" +#define DBUS_API_SUBJECT_TO_CHANGE +#include "k9haldevice.h" +#include +#include +k9HalConnection *Hinstance=NULL; + +void halDeviceAdded (LibHalContext *ctx, const char *udi) { + Hinstance->addDevice(udi); + Hinstance->testVolumeChanged( udi); + +} + +void halDeviceRemoved (LibHalContext *ctx, const char *udi) { + Hinstance->removeDevice( udi); + Hinstance->testVolumeChanged( udi); +} + + +k9HalConnection::k9HalConnection(QObject *parent, const char *name) + : QObject(parent, name) +{ + m_devices.setAutoDelete(true); + m_context =(void*) libhal_ctx_new(); + + DBusError error; + dbus_error_init( &error ); + m_dbusConnect = dbus_bus_get( DBUS_BUS_SYSTEM, &error ); + if( dbus_error_is_set(&error) ) { + qDebug(QString("Error connecting to DBUS : %1").arg(error.message)); + return; + } + + m_dbusDispatch=new K9DBusDispatch(this,0); + m_dbusDispatch->setConnection(m_dbusConnect); + + libhal_ctx_set_dbus_connection((LibHalContext*) m_context,m_dbusConnect ); + + libhal_ctx_set_device_added( (LibHalContext*)m_context, halDeviceAdded ); + libhal_ctx_set_device_removed( (LibHalContext*)m_context, halDeviceRemoved ); + + if( !libhal_ctx_init((LibHalContext*) m_context, 0 ) ) { + qDebug("HAL init failed"); + return; + } + + int numDevices; + char** halDeviceList = libhal_get_all_devices((LibHalContext*) m_context, &numDevices, 0 ); + for( int i = 0; i < numDevices; ++i ) + //qDebug(halDeviceList[i]); + addDevice( halDeviceList[i] ); +} + +void k9HalConnection::removeDevice( const char* udi ) { + k9HalDevice *device=findDevice( udi); + if (device !=NULL) { + emit deviceRemoved( device); + m_devices.remove(device); + } +} + +void k9HalConnection::addDevice( const char* udi ) +{ + // ignore devices that have no property "info.capabilities" to suppress error messages + if( !libhal_device_property_exists( (LibHalContext*) m_context, udi, "info.capabilities", 0 ) ) + return; + + if( libhal_device_query_capability( (LibHalContext*) m_context, udi, "storage.cdrom", 0 ) ) { + char* dev = libhal_device_get_property_string( (LibHalContext*) m_context, udi, "block.device", 0 ); + if( dev ) { + QString s( dev ); + libhal_free_string( dev ); + + if( !s.isEmpty() ) { + k9HalDevice *device=new k9HalDevice(this,udi); + m_devices.append( device); + emit deviceAdded( device); + } + } + } +} + + +void k9HalConnection::testVolumeChanged( const char * udi) { + // ignore devices that have no property "info.capabilities" to suppress error messages + if( !libhal_device_property_exists( (LibHalContext*) m_context, udi, "info.capabilities", 0 ) ){ + k9HalDevice *device=findDeviceByVolume( udi); + if (device != NULL) + device->updateVolumeName(); + } + else + if( libhal_device_query_capability( (LibHalContext*) m_context, udi, "volume", 0 ) ) { + char* udiParent = libhal_device_get_property_string( (LibHalContext*) m_context, udi, "info.parent", 0 ); + if( udiParent ) { + k9HalDevice *device=findDevice( udiParent); + libhal_free_string( udiParent ); + if (device) + device->updateVolumeName(); + } + } + } + + +k9HalConnection::~k9HalConnection() +{ + libhal_ctx_shutdown((LibHalContext*)m_context, 0 ); + libhal_ctx_free ((LibHalContext*)m_context); + #ifdef DBUS_QT3 + //QDBusConnection::closeConnection("sbus"); + #else + //delete m_dBusQtConnect; + #endif +} + + +k9HalConnection * k9HalConnection::getInstance() { + if (Hinstance==NULL) + Hinstance=new k9HalConnection(NULL,NULL); + return Hinstance; +} + +k9HalDevice *k9HalConnection::findDevice( const char *udi) { + for (k9HalDevice *dev= m_devices.first();dev;dev=m_devices.next()) { + if (dev->name()==QString(udi)) + return dev; + } + return NULL; +} + +k9HalDevice *k9HalConnection::findDeviceByVolume( const char *udi) { + for (k9HalDevice *dev= m_devices.first();dev;dev=m_devices.next()) { + if (dev->getVolumeUdi()==QString(udi)) + return dev; + } + return NULL; +} + +void k9HalConnection::end() { + if (Hinstance !=NULL){ + delete Hinstance; + } + Hinstance=NULL; +} +#include "k9halconnection.moc" +#endif diff --git a/k9devices/k9halconnection.h b/k9devices/k9halconnection.h new file mode 100644 index 0000000..27119a5 --- /dev/null +++ b/k9devices/k9halconnection.h @@ -0,0 +1,66 @@ +// +// C++ Interface: k9halconnection +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9common.h" +#ifdef HAVE_HAL +#ifndef K9HALCONNECTION_H +#define K9HALCONNECTION_H + +#include +#include +#include "k9dbusdispatch.h" +/** + @author Jean-Michel PETIT +*/ + +class k9HalDevice; +class DBusConnection; +#ifdef DBUS_QT3 +class QDBusConnection; +#else +namespace DBusQt { + class Connection; +}; +#endif + +class k9HalConnection : public QObject +{ +Q_OBJECT +friend class k9HalDevice; +public: + static k9HalConnection* getInstance(); + static void end(); + + QPtrList< k9HalDevice > getDevices() const { return m_devices;} + void addDevice( const char* udi ); + void removeDevice( const char* udi ); + void testVolumeChanged( const char * udi); + k9HalDevice *findDevice (const char* udi); + k9HalDevice *findDeviceByVolume (const char* udi); +signals: + void deviceAdded(k9HalDevice *); + void deviceRemoved(k9HalDevice*); +private: + QPtrList m_devices; + void *m_context; + DBusConnection * m_dbusConnect; + K9DBusDispatch *m_dbusDispatch; +private: + + k9HalConnection(QObject *parent = 0, const char *name = 0); + + ~k9HalConnection(); + + +}; + +#endif +#endif diff --git a/k9devices/k9haldevice.cpp b/k9devices/k9haldevice.cpp new file mode 100644 index 0000000..0f70c42 --- /dev/null +++ b/k9devices/k9haldevice.cpp @@ -0,0 +1,112 @@ +// +// C++ Implementation: k9haldevice +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9haldevice.h" +#ifdef HAVE_HAL +#include "k9halconnection.h" +#define DBUS_API_SUBJECT_TO_CHANGE +#include +#include +#include + +k9HalDevice::k9HalDevice(QObject *parent, const char *udi) + : QObject(parent, udi) { + + m_connection=(k9HalConnection*)parent; + getDriveProperties(); +} + +k9HalDevice::~k9HalDevice() {} + +QString k9HalDevice::volumeName() { + QString sVol(""); + LibHalDrive *drive= libhal_drive_from_udi ((LibHalContext *)m_connection->m_context, name()); + int num_volumes; + if (drive !=NULL) { + char** volumes = libhal_drive_find_all_volumes ((LibHalContext *)m_connection->m_context, drive, &num_volumes); + if (volumes != NULL) { + for (int i = 0; i < num_volumes; i++) { + char *volume_udi; + LibHalVolume *volume; + volume_udi = volumes[i]; + QString s(volume_udi); + m_volumeUdi=s; + volume = libhal_volume_from_udi ((LibHalContext *)m_connection->m_context, volume_udi); + if (volume != NULL) { + sVol=QString(libhal_volume_get_label (volume)); + libhal_volume_free (volume); + } + } + if (num_volumes >0) + libhal_free_string_array (volumes); + } + libhal_drive_free(drive); + } + return sVol; +} + +QString k9HalDevice::mountPoint() { + QString sMountPoint(""); + LibHalDrive *drive= libhal_drive_from_udi ((LibHalContext *)m_connection->m_context, name()); + if (drive !=NULL) { + int num_volumes; + char** volumes = libhal_drive_find_all_volumes ((LibHalContext *)m_connection->m_context, drive, &num_volumes); + if (volumes != NULL) { + for (int i = 0; i < num_volumes; i++) { + char *volume_udi; + LibHalVolume *volume; + volume_udi = volumes[i]; + volume = libhal_volume_from_udi ((LibHalContext *)m_connection->m_context, volume_udi); + if (volume != NULL) { + sMountPoint=QString(libhal_volume_get_mount_point (volume)); + libhal_volume_free (volume); + } + } + if (num_volumes >0) + libhal_free_string_array (volumes); + } + libhal_drive_free(drive); + } + return sMountPoint; +} + + +void k9HalDevice::updateVolumeName() { + m_volumeName=volumeName(); + emit volumeChanged(this->getDeviceName(),m_volumeName); +} + +void k9HalDevice::getDriveProperties() { + LibHalContext *context=(LibHalContext *)m_connection->m_context; + LibHalDrive *drive= libhal_drive_from_udi (context, name()); + LibHalDriveCdromCaps caps; + caps= libhal_drive_get_cdrom_caps (drive); + m_canReadCd=m_canReadDvd=m_canBurnCd=m_canBurnDvd=false; + m_canReadCd= (caps & LIBHAL_DRIVE_CDROM_CAPS_CDROM)==LIBHAL_DRIVE_CDROM_CAPS_CDROM; + m_canBurnCd= (caps & LIBHAL_DRIVE_CDROM_CAPS_CDR)==LIBHAL_DRIVE_CDROM_CAPS_CDR; + m_canReadDvd=(caps & LIBHAL_DRIVE_CDROM_CAPS_DVDROM)==LIBHAL_DRIVE_CDROM_CAPS_DVDROM; + m_canBurnDvd=(caps & LIBHAL_DRIVE_CDROM_CAPS_DVDR)==LIBHAL_DRIVE_CDROM_CAPS_DVDR; + m_model=QString(libhal_drive_get_model(drive)); + // qDebug(QString("canReadDvd:%1 canBurnDvd:%2 model:%3").arg(m_canReadDvd).arg(m_canBurnDvd).arg(m_model)); + + + libhal_drive_free(drive); + if (libhal_device_property_exists( (LibHalContext*) m_connection->m_context, name(), "storage.cdrom.write_speed", 0 )) { + m_maxWriteSpeed= libhal_device_get_property_int( (LibHalContext*)m_connection->m_context, name(), "storage.cdrom.write_speed", 0 ); + } + char* dev = libhal_device_get_property_string( (LibHalContext*) m_connection->m_context, name(), "block.device", 0 ); + m_deviceName=QString ( dev ); + libhal_free_string( dev ); + + m_volumeName=volumeName(); +} +#include "k9haldevice.moc" +#endif diff --git a/k9devices/k9haldevice.h b/k9devices/k9haldevice.h new file mode 100644 index 0000000..e7c25f1 --- /dev/null +++ b/k9devices/k9haldevice.h @@ -0,0 +1,86 @@ +// +// C++ Interface: k9haldevice +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9HALDEVICE_H +#define K9HALDEVICE_H +#include "k9common.h" +#ifdef HAVE_HAL + +#include +/** + @author Jean-Michel PETIT +*/ +class k9HalConnection; +class k9HalDevice : public QObject +{ +Q_OBJECT +public: + + k9HalDevice(QObject *parent = 0, const char *name = 0); + + ~k9HalDevice(); + + bool getCanReadCd() const { + return m_canReadCd; + } + + bool getCanReadDvd() const { + return m_canReadDvd; + } + + bool getCanBurnCd() const { + return m_canBurnCd; + } + + bool getCanBurnDvd() const { + return m_canBurnDvd; + } + + QString getModel() const { + return m_model; + } + + int getMaxWriteSpeed() const { + return m_maxWriteSpeed; + } + + QString getDeviceName() const { + return m_deviceName; + } + void updateVolumeName(); + + QString getVolumeUdi() const { + return m_volumeUdi; + } + + QString getVolumeName() const { + return m_volumeName; + } + + QString mountPoint(); +signals: + void volumeChanged(const QString &device,const QString &volumeName); + +private: + QString m_volumeName; + QString m_volumeUdi; + k9HalConnection *m_connection; + bool m_canReadCd,m_canReadDvd,m_canBurnCd,m_canBurnDvd; + QString m_model; + QString m_deviceName; + int m_maxWriteSpeed; + void getDriveProperties(); + QString volumeName(); +}; + +#endif +#endif diff --git a/k9vamps/Makefile.am b/k9vamps/Makefile.am new file mode 100644 index 0000000..d432954 --- /dev/null +++ b/k9vamps/Makefile.am @@ -0,0 +1,12 @@ +AM_CPPFLAGS= -I$(srcdir) $(all_includes) + +KDE_CXXFLAGS = $(ENABLE_PERMISSIVE_FLAG) + +METASOURCES = AUTO +libk9vamps_la_LDFLAGS = $(all_libraries) +noinst_LTLIBRARIES = libk9vamps.la +libk9vamps_la_SOURCES = cputest.cpp getvlc.h k9fifo.cpp k9requant.cpp \ + k9vamps.cpp k9vamps.h putvlc.h qTable.h tcmemcpy.cpp +INCLUDES = -I$(top_srcdir)/dvdread -I$(top_srcdir)/k9vamps \ + -I$(top_srcdir)/libk9copy +noinst_HEADERS = k9requant.h ac.h k9fifo.h diff --git a/k9vamps/ac.h b/k9vamps/ac.h new file mode 100644 index 0000000..c79100f --- /dev/null +++ b/k9vamps/ac.h @@ -0,0 +1,83 @@ +/* + * ac.h + * + * Copyright (C) Thomas Östreich - November 2002 + * + * This file is part of transcode, a video stream processing tool + * + * transcode 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, or (at your option) + * any later version. + * + * transcode is distributed in the hope that 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifndef _AC_H +#define _AC_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "k9common.h" + +#include + +// #include "libtc/libtc.h" + +#ifdef __bsdi__ +typedef unsigned int uint32_t; +#endif + +//mm_support +#define MM_C 0x0000 //plain C (default) +#define MM_IA32ASM 0x0001 //32-bit assembler optimized code (non-MMX) +#define MM_AMD64ASM 0x0002 //64-bit assembler optimized code (non-MMX) +#define MM_CMOVE 0x0004 //CMOVcc instruction +#define MM_MMX 0x0008 //standard MMX +#define MM_MMXEXT 0x0010 //SSE integer functions or AMD MMX ext +#define MM_3DNOW 0x0020 //AMD 3DNOW +#define MM_SSE 0x0040 //SSE functions +#define MM_SSE2 0x0080 //PIV SSE2 functions +#define MM_3DNOWEXT 0x0100 //AMD 3DNow! ext. +#define MM_SSE3 0x0200 //Prescott SSE3 + +extern void * (*tc_memcpy)(void *, const void *, size_t); +extern void tc_memcpy_init(int verbose, int mmflags); + +extern int mm_flag; +int ac_mmflag(); +void ac_mmtest(); +char *ac_mmstr(int flag, int mode); + +//ac_memcpy +void * ac_memcpy_mmx(void *dest, const void *src, size_t bytes); +void * ac_memcpy_amdmmx(void *dest, const void *src, size_t bytes); +void * ac_memcpy_amd64(void *dest, const void *src, size_t bytes); + +//average (simple average over 2 rows) +int ac_average_mmx(char *row1, char *row2, char *out, int bytes); +int ac_average_sse(char *row1, char *row2, char *out, int bytes); +int ac_average_sse2(char *row1, char *row2, char *out, int bytes); + +//swap +int ac_swap_rgb2bgr_asm(char *im, int bytes); +int ac_swap_rgb2bgr_asm64(char *im, int pixels); + +//rescale +int ac_rescale_mmxext(char *row1, char *row2, char *out, int bytes, + unsigned long weight1, unsigned long weight2); +int ac_rescale_sse(char *row1, char *row2, char *out, int bytes, + unsigned long weight1, unsigned long weight2); +int ac_rescale_sse2(char *row1, char *row2, char *out, int bytes, + unsigned long weight1, unsigned long weight2); + +#endif diff --git a/k9vamps/cputest.cpp b/k9vamps/cputest.cpp new file mode 100644 index 0000000..643742b --- /dev/null +++ b/k9vamps/cputest.cpp @@ -0,0 +1,274 @@ +/* Cpu detection code, extracted from mmx.h ((c)1997-99 by H. Dietz + and R. Fisher). Converted to C and improved by Fabrice Bellard */ + +#include +#include +#include "ac.h" + +#ifdef HAVE_STRING_H +# include +#endif + +#ifdef ARCH_X86_64 +# define REG_b "rbx" +# define REG_S "rsi" +#else +# define REG_b "ebx" +# define REG_S "esi" +#endif + +//exported + int mm_flag; + +/* ebx saving is necessary for PIC. gcc seems unable to see it alone */ +#define cpuid(index,eax,ebx,ecx,edx)\ + __asm __volatile\ + ("mov %%"REG_b", %%"REG_S"\n\t"\ + "cpuid\n\t"\ + "xchg %%"REG_b", %%"REG_S\ + : "=a" (eax), "=S" (ebx),\ + "=c" (ecx), "=d" (edx)\ + : "0" (index)); + +#define CPUID_STD_MMX 0x00800000 +#define CPUID_STD_SSE 0x02000000 +#define CPUID_STD_SSE2 0x04000000 +#define CPUID_STD_SSE3 0x00000001 // ECX! +#define CPUID_EXT_AMD_3DNOW 0x80000000 +#define CPUID_EXT_AMD_3DNOWEXT 0x40000000 +#define CPUID_EXT_AMD_MMXEXT 0x00400000 +#define CPUID_EXT_CYR_MMX 0x00800000 +#define CPUID_EXT_CYR_MMXEXT 0x01000000 + +/* Function to test if multimedia instructions are supported... */ +static int mm_support(void) +{ + int rval = 0; +#if defined(ARCH_X86) || defined(ARCH_X86_64) + int eax, ebx, ecx, edx; + int max_std_level, max_ext_level, std_caps=0, std_caps2=0, ext_caps=0; + long a, c; + + char vendor[13] = "UnknownVndr"; + + __asm__ __volatile__ ( + /* See if CPUID instruction is supported ... */ + /* ... Get copies of EFLAGS into eax and ecx */ + "pushf\n\t" + "pop %0\n\t" + "mov %0, %1\n\t" + + /* ... Toggle the ID bit in one copy and store */ + /* to the EFLAGS reg */ + "xor $0x200000, %0\n\t" + "push %0\n\t" + "popf\n\t" + + /* ... Get the (hopefully modified) EFLAGS */ + "pushf\n\t" + "pop %0\n\t" + : "=a" (a), "=c" (c) + : + : "cc" + ); + + if (a == c) + return 0; /* CPUID not supported */ + + cpuid(0, max_std_level, ebx, ecx, edx); + + /* highest cpuid is 0, no standard features */ + if (max_std_level == 0) + return rval; + + /* save the vendor string */ + *(int *)vendor = ebx; + *(int *)&vendor[4] = edx; + *(int *)&vendor[8] = ecx; + + if (max_std_level >= 1){ + cpuid(1, eax, ebx, std_caps2, std_caps); + if (std_caps & (1<<15)) + rval |= MM_CMOVE; + if (std_caps & (1<<23)) + rval |= MM_MMX; + if (std_caps & (1<<25)) + rval |= MM_MMXEXT | MM_SSE; + if (std_caps & (1<<26)) + rval |= MM_SSE2; + } + + cpuid(0x80000000, max_ext_level, ebx, ecx, edx); + + if (max_ext_level >= 0x80000001) { + cpuid(0x80000001, eax, ebx, ecx, ext_caps); + } + + cpuid(0, eax, ebx, ecx, edx); + if (strcmp(vendor, "AuthenticAMD") == 0) { + /* AMD */ + if (ext_caps & (1<<22)) + rval |= MM_MMXEXT; + if (ext_caps & (1<<31)) + rval |= MM_3DNOW; + if (ext_caps & (1<<30)) + rval |= MM_3DNOWEXT; + if (std_caps2 & (1<<0)) + rval |= MM_SSE3; + } else if (strcmp(vendor, "CentaurHauls") == 0) { + /* VIA C3 */ + if (ext_caps & (1<<24)) + rval |= MM_MMXEXT; + } else if (strcmp(vendor, "CyrixInstead") == 0) { + /* Cyrix */ + if (ext_caps & (1<<24)) + rval |= MM_MMXEXT; + } +#if 0 + av_log(NULL, AV_LOG_DEBUG, "%s%s%s%s%s%s\n", + (rval&MM_MMX) ? "MMX ":"", + (rval&MM_MMXEXT) ? "MMX2 ":"", + (rval&MM_SSE) ? "SSE ":"", + (rval&MM_SSE2) ? "SSE2 ":"", + (rval&MM_3DNOW) ? "3DNow ":"", + (rval&MM_3DNOWEXT) ? "3DNowExt ":""); +#endif +#endif /* ARCH_X86(_64) */ + return rval; +} + + +int ac_mmflag(void) +{ + //if (mm_flag==-1) { + mm_flag = mm_support(); +#ifdef ARCH_X86 + mm_flag |= MM_IA32ASM; +#endif +#ifdef ARCH_X86_64 + mm_flag |= MM_AMD64ASM; +#endif + //} + return(mm_flag); +} + +void ac_mmtest() +{ + mm_flag=-1; + int cc=ac_mmflag(); + return; + printf("(%s) available multimedia extensions:", __FILE__); + + if(cc & MM_SSE3) { + printf(" sse3\n"); + return; + } else if(cc & MM_SSE2) { + printf(" sse2\n"); + return; + } else if(cc & MM_SSE) { + printf(" sse\n"); + return; + } else if(cc & MM_3DNOWEXT) { + printf(" 3dnowext\n"); + return; + } else if(cc & MM_3DNOW) { + printf(" 3dnow\n"); + return; + } else if(cc & MM_MMXEXT) { + printf(" mmxext\n"); + return; + } else if(cc & MM_MMX) { + printf(" mmx\n"); + return; + } else if(cc & MM_AMD64ASM) { + printf(" 64asm\n"); + return; + } else if(cc & MM_IA32ASM) { + printf(" 32asm\n"); + return; + } else printf(" C\n"); +} + +/* + * Appends src to string dst of size siz (unlike strncat, siz is the + * full size of dst, not space left). At most siz-1 characters + * will be copied. Always NUL terminates (unless siz <= strlen(dst)). + * Returns strlen(src) + MIN(siz, strlen(initial dst)). + * If retval >= siz, truncation occurred. + */ +size_t +strlcat(char *dst, const char *src, size_t siz) +{ + char *d = dst; + const char *s = src; + size_t n = siz; + size_t dlen; + + /* Find the end of dst and adjust bytes left but don't go past end */ + while (n-- != 0 && *d != '\0') + d++; + dlen = d - dst; + n = siz - dlen; + + if (n == 0) + return(dlen + strlen(s)); + while (*s != '\0') { + if (n != 1) { + *d++ = *s; + n--; + } + s++; + } + *d = '\0'; + + return(dlen + (s - src)); /* count does not include NUL */ +} + +char *ac_mmstr(int flag, int mode) +{ + static char mmstr[64]=""; + int cc; + + if(flag==-1) + //get full mm caps + cc=ac_mmflag(); + else + cc=flag; + + //return max supported mm extensions, or str for user provided flag + if(mode==0) { + if(cc & MM_SSE3) { + return("sse3"); + } else if(cc & MM_SSE2) { + return("sse2"); + } else if(cc & MM_SSE) { + return("sse"); + } else if(cc & MM_3DNOWEXT) { + return("3dnowext"); + } else if(cc & MM_3DNOW) { + return("3dnow"); + } else if(cc & MM_MMXEXT) { + return("mmxext"); + } else if(cc & MM_MMX) { + return("mmx"); + } else if(cc & (MM_AMD64ASM|MM_IA32ASM)) { + return("asm"); + } else return("C"); + } + + //return full capability list + if(mode==1) { + if(cc & MM_SSE3) strlcat(mmstr, "sse3 ", sizeof(mmstr)); + if(cc & MM_SSE2) strlcat(mmstr, "sse2 ", sizeof(mmstr)); + if(cc & MM_SSE) strlcat(mmstr, "sse ", sizeof(mmstr)); + if(cc & MM_3DNOWEXT) strlcat(mmstr, "3dnowext ", sizeof(mmstr)); + if(cc & MM_3DNOW) strlcat(mmstr, "3dnow ", sizeof(mmstr)); + if(cc & MM_MMXEXT) strlcat(mmstr, "mmxext ", sizeof(mmstr)); + if(cc & MM_MMX) strlcat(mmstr, "mmx ", sizeof(mmstr)); + if(cc & (MM_AMD64ASM|MM_IA32ASM)) strlcat(mmstr, "asm ", sizeof(mmstr)); + strlcat(mmstr, "C", sizeof(mmstr)); + return(mmstr); + } + + return(""); +} diff --git a/k9vamps/getvlc.h b/k9vamps/getvlc.h new file mode 100644 index 0000000..bcf82c0 --- /dev/null +++ b/k9vamps/getvlc.h @@ -0,0 +1,401 @@ + +/* macroblock modes */ +#define MACROBLOCK_INTRA 1 +#define MACROBLOCK_PATTERN 2 +#define MACROBLOCK_MOTION_BACKWARD 4 +#define MACROBLOCK_MOTION_FORWARD 8 +#define MACROBLOCK_QUANT 16 +#define DCT_TYPE_INTERLACED 32 + +/* motion_type */ +#define MOTION_TYPE_MASK (3*64) +#define MOTION_TYPE_BASE 64 +#define MC_FIELD (1*64) +#define MC_FRAME (2*64) +#define MC_16X8 (2*64) +#define MC_DMV (3*64) + +/* picture structure */ +#define TOP_FIELD 1 +#define BOTTOM_FIELD 2 +#define FRAME_PICTURE 3 + +/* remove num valid bits from bit_buf */ +#define DUMPBITS(bit_buf,bits,num) Flush_Bits(num) +#define COPYBITS(bit_buf,bits,num) Copy_Bits(num) + +/* take num bits from the high part of bit_buf and zero extend them */ +#define UBITS(bit_buf,num) (((uint32_t)(inbitbuf)) >> (32 - (num))) + +/* take num bits from the high part of bit_buf and sign extend them */ +#define SBITS(bit_buf,num) (((int32_t)(inbitbuf)) >> (32 - (num))) + +typedef struct { + uint8_t modes; + uint8_t len; +} MBtab; + +typedef struct { + uint8_t delta; + uint8_t len; +} MVtab; + +typedef struct { + int8_t dmv; + uint8_t len; +} DMVtab; + +typedef struct { + uint8_t cbp; + uint8_t len; +} CBPtab; + +typedef struct { + uint8_t size; + uint8_t len; +} DCtab; + +typedef struct { + uint8_t run; + uint8_t level; + uint8_t len; +} DCTtab; + +typedef struct { + uint8_t mba; + uint8_t len; +} MBAtab; + + +#define INTRA MACROBLOCK_INTRA +#define QUANT MACROBLOCK_QUANT + +static const MBtab MB_I [] = { + {INTRA|QUANT, 2}, {INTRA, 1} +}; + +#define MC MACROBLOCK_MOTION_FORWARD +#define CODED MACROBLOCK_PATTERN + +static const MBtab MB_P [] = { + {INTRA|QUANT, 6}, {CODED|QUANT, 5}, {MC|CODED|QUANT, 5}, {INTRA, 5}, + {MC, 3}, {MC, 3}, {MC, 3}, {MC, 3}, + {CODED, 2}, {CODED, 2}, {CODED, 2}, {CODED, 2}, + {CODED, 2}, {CODED, 2}, {CODED, 2}, {CODED, 2}, + {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, + {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, + {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, + {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1} +}; + +#define FWD MACROBLOCK_MOTION_FORWARD +#define BWD MACROBLOCK_MOTION_BACKWARD +#define INTER MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD + +static const MBtab MB_B [] = { + {0, 0}, {INTRA|QUANT, 6}, + {BWD|CODED|QUANT, 6}, {FWD|CODED|QUANT, 6}, + {INTER|CODED|QUANT, 5}, {INTER|CODED|QUANT, 5}, + {INTRA, 5}, {INTRA, 5}, + {FWD, 4}, {FWD, 4}, {FWD, 4}, {FWD, 4}, + {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, + {BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3}, + {BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3}, + {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, + {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, + {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2}, + {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2}, + {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2}, + {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2}, + {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, + {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, + {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, + {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2} +}; + +#undef INTRA +#undef QUANT +#undef MC +#undef CODED +#undef FWD +#undef BWD +#undef INTER + + +static const MVtab MV_4 [] = { + { 3, 6}, { 2, 4}, { 1, 3}, { 1, 3}, { 0, 2}, { 0, 2}, { 0, 2}, { 0, 2} +}; + +static const MVtab MV_10 [] = { + { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, + { 0,10}, { 0,10}, { 0,10}, { 0,10}, {15,10}, {14,10}, {13,10}, {12,10}, + {11,10}, {10,10}, { 9, 9}, { 9, 9}, { 8, 9}, { 8, 9}, { 7, 9}, { 7, 9}, + { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, + { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, + { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7} +}; + + +static const DMVtab DMV_2 [] = { + { 0, 1}, { 0, 1}, { 1, 2}, {-1, 2} +}; + + +static const CBPtab CBP_7 [] = { + {0x22, 7}, {0x12, 7}, {0x0a, 7}, {0x06, 7}, + {0x21, 7}, {0x11, 7}, {0x09, 7}, {0x05, 7}, + {0x3f, 6}, {0x3f, 6}, {0x03, 6}, {0x03, 6}, + {0x24, 6}, {0x24, 6}, {0x18, 6}, {0x18, 6}, + {0x3e, 5}, {0x3e, 5}, {0x3e, 5}, {0x3e, 5}, + {0x02, 5}, {0x02, 5}, {0x02, 5}, {0x02, 5}, + {0x3d, 5}, {0x3d, 5}, {0x3d, 5}, {0x3d, 5}, + {0x01, 5}, {0x01, 5}, {0x01, 5}, {0x01, 5}, + {0x38, 5}, {0x38, 5}, {0x38, 5}, {0x38, 5}, + {0x34, 5}, {0x34, 5}, {0x34, 5}, {0x34, 5}, + {0x2c, 5}, {0x2c, 5}, {0x2c, 5}, {0x2c, 5}, + {0x1c, 5}, {0x1c, 5}, {0x1c, 5}, {0x1c, 5}, + {0x28, 5}, {0x28, 5}, {0x28, 5}, {0x28, 5}, + {0x14, 5}, {0x14, 5}, {0x14, 5}, {0x14, 5}, + {0x30, 5}, {0x30, 5}, {0x30, 5}, {0x30, 5}, + {0x0c, 5}, {0x0c, 5}, {0x0c, 5}, {0x0c, 5}, + {0x20, 4}, {0x20, 4}, {0x20, 4}, {0x20, 4}, + {0x20, 4}, {0x20, 4}, {0x20, 4}, {0x20, 4}, + {0x10, 4}, {0x10, 4}, {0x10, 4}, {0x10, 4}, + {0x10, 4}, {0x10, 4}, {0x10, 4}, {0x10, 4}, + {0x08, 4}, {0x08, 4}, {0x08, 4}, {0x08, 4}, + {0x08, 4}, {0x08, 4}, {0x08, 4}, {0x08, 4}, + {0x04, 4}, {0x04, 4}, {0x04, 4}, {0x04, 4}, + {0x04, 4}, {0x04, 4}, {0x04, 4}, {0x04, 4}, + {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, + {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, + {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, + {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, {0x3c, 3} +}; + +static const CBPtab CBP_9 [] = { + {0, 0}, {0x00, 9}, {0x27, 9}, {0x1b, 9}, + {0x3b, 9}, {0x37, 9}, {0x2f, 9}, {0x1f, 9}, + {0x3a, 8}, {0x3a, 8}, {0x36, 8}, {0x36, 8}, + {0x2e, 8}, {0x2e, 8}, {0x1e, 8}, {0x1e, 8}, + {0x39, 8}, {0x39, 8}, {0x35, 8}, {0x35, 8}, + {0x2d, 8}, {0x2d, 8}, {0x1d, 8}, {0x1d, 8}, + {0x26, 8}, {0x26, 8}, {0x1a, 8}, {0x1a, 8}, + {0x25, 8}, {0x25, 8}, {0x19, 8}, {0x19, 8}, + {0x2b, 8}, {0x2b, 8}, {0x17, 8}, {0x17, 8}, + {0x33, 8}, {0x33, 8}, {0x0f, 8}, {0x0f, 8}, + {0x2a, 8}, {0x2a, 8}, {0x16, 8}, {0x16, 8}, + {0x32, 8}, {0x32, 8}, {0x0e, 8}, {0x0e, 8}, + {0x29, 8}, {0x29, 8}, {0x15, 8}, {0x15, 8}, + {0x31, 8}, {0x31, 8}, {0x0d, 8}, {0x0d, 8}, + {0x23, 8}, {0x23, 8}, {0x13, 8}, {0x13, 8}, + {0x0b, 8}, {0x0b, 8}, {0x07, 8}, {0x07, 8} +}; + + +static const DCtab DC_lum_5 [] = { + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {0, 3}, {0, 3}, {0, 3}, {0, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, + {4, 3}, {4, 3}, {4, 3}, {4, 3}, {5, 4}, {5, 4}, {6, 5} +}; + +static const DCtab DC_chrom_5 [] = { + {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {3, 3}, {3, 3}, {3, 3}, {3, 3}, {4, 4}, {4, 4}, {5, 5} +}; + +static const DCtab DC_long [] = { + {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, { 6, 5}, { 6, 5}, + {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, { 6, 5}, { 6, 5}, + {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, { 7, 6}, { 7, 6}, + {8, 7}, {8, 7}, {8, 7}, {8, 7}, {9, 8}, {9, 8}, {10, 9}, {11, 9} +}; + + +static const DCTtab DCT_16 [] = { + {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, + {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, + {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, + {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, + { 2,18, 0}, { 2,17, 0}, { 2,16, 0}, { 2,15, 0}, + { 7, 3, 0}, { 17, 2, 0}, { 16, 2, 0}, { 15, 2, 0}, + { 14, 2, 0}, { 13, 2, 0}, { 12, 2, 0}, { 32, 1, 0}, + { 31, 1, 0}, { 30, 1, 0}, { 29, 1, 0}, { 28, 1, 0} +}; + +static const DCTtab DCT_15 [] = { + { 1,40,15}, { 1,39,15}, { 1,38,15}, { 1,37,15}, + { 1,36,15}, { 1,35,15}, { 1,34,15}, { 1,33,15}, + { 1,32,15}, { 2,14,15}, { 2,13,15}, { 2,12,15}, + { 2,11,15}, { 2,10,15}, { 2, 9,15}, { 2, 8,15}, + { 1,31,14}, { 1,31,14}, { 1,30,14}, { 1,30,14}, + { 1,29,14}, { 1,29,14}, { 1,28,14}, { 1,28,14}, + { 1,27,14}, { 1,27,14}, { 1,26,14}, { 1,26,14}, + { 1,25,14}, { 1,25,14}, { 1,24,14}, { 1,24,14}, + { 1,23,14}, { 1,23,14}, { 1,22,14}, { 1,22,14}, + { 1,21,14}, { 1,21,14}, { 1,20,14}, { 1,20,14}, + { 1,19,14}, { 1,19,14}, { 1,18,14}, { 1,18,14}, + { 1,17,14}, { 1,17,14}, { 1,16,14}, { 1,16,14} +}; + +static const DCTtab DCT_13 [] = { + { 11, 2,13}, { 10, 2,13}, { 6, 3,13}, { 4, 4,13}, + { 3, 5,13}, { 2, 7,13}, { 2, 6,13}, { 1,15,13}, + { 1,14,13}, { 1,13,13}, { 1,12,13}, { 27, 1,13}, + { 26, 1,13}, { 25, 1,13}, { 24, 1,13}, { 23, 1,13}, + { 1,11,12}, { 1,11,12}, { 9, 2,12}, { 9, 2,12}, + { 5, 3,12}, { 5, 3,12}, { 1,10,12}, { 1,10,12}, + { 3, 4,12}, { 3, 4,12}, { 8, 2,12}, { 8, 2,12}, + { 22, 1,12}, { 22, 1,12}, { 21, 1,12}, { 21, 1,12}, + { 1, 9,12}, { 1, 9,12}, { 20, 1,12}, { 20, 1,12}, + { 19, 1,12}, { 19, 1,12}, { 2, 5,12}, { 2, 5,12}, + { 4, 3,12}, { 4, 3,12}, { 1, 8,12}, { 1, 8,12}, + { 7, 2,12}, { 7, 2,12}, { 18, 1,12}, { 18, 1,12} +}; + +static const DCTtab DCT_B14_10 [] = { + { 17, 1,10}, { 6, 2,10}, { 1, 7,10}, { 3, 3,10}, + { 2, 4,10}, { 16, 1,10}, { 15, 1,10}, { 5, 2,10} +}; + +static const DCTtab DCT_B14_8 [] = { + { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, + { 3, 2, 7}, { 3, 2, 7}, { 10, 1, 7}, { 10, 1, 7}, + { 1, 4, 7}, { 1, 4, 7}, { 9, 1, 7}, { 9, 1, 7}, + { 8, 1, 6}, { 8, 1, 6}, { 8, 1, 6}, { 8, 1, 6}, + { 7, 1, 6}, { 7, 1, 6}, { 7, 1, 6}, { 7, 1, 6}, + { 2, 2, 6}, { 2, 2, 6}, { 2, 2, 6}, { 2, 2, 6}, + { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, + { 14, 1, 8}, { 1, 6, 8}, { 13, 1, 8}, { 12, 1, 8}, + { 4, 2, 8}, { 2, 3, 8}, { 1, 5, 8}, { 11, 1, 8} +}; + +static const DCTtab DCT_B14AC_5 [] = { + { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, + { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, + {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2} +}; + +static const DCTtab DCT_B14DC_5 [] = { + { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5}, + { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, + { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, + { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, + { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1} +}; + +static const DCTtab DCT_B15_10 [] = { + { 6, 2, 9}, { 6, 2, 9}, { 15, 1, 9}, { 15, 1, 9}, + { 3, 4,10}, { 17, 1,10}, { 16, 1, 9}, { 16, 1, 9} +}; + +static const DCTtab DCT_B15_8 [] = { + { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, + { 8, 1, 7}, { 8, 1, 7}, { 9, 1, 7}, { 9, 1, 7}, + { 7, 1, 7}, { 7, 1, 7}, { 3, 2, 7}, { 3, 2, 7}, + { 1, 7, 6}, { 1, 7, 6}, { 1, 7, 6}, { 1, 7, 6}, + { 1, 6, 6}, { 1, 6, 6}, { 1, 6, 6}, { 1, 6, 6}, + { 5, 1, 6}, { 5, 1, 6}, { 5, 1, 6}, { 5, 1, 6}, + { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, + { 2, 5, 8}, { 12, 1, 8}, { 1,11, 8}, { 1,10, 8}, + { 14, 1, 8}, { 13, 1, 8}, { 4, 2, 8}, { 2, 4, 8}, + { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, + { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, + { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, + { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, + { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, + { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, + {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, + {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, + {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, + {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, + { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, + { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, + { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, + { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, + { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, + { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, + { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, + { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, + { 10, 1, 7}, { 10, 1, 7}, { 2, 3, 7}, { 2, 3, 7}, + { 11, 1, 7}, { 11, 1, 7}, { 1, 8, 7}, { 1, 8, 7}, + { 1, 9, 7}, { 1, 9, 7}, { 1,12, 8}, { 1,13, 8}, + { 3, 3, 8}, { 5, 2, 8}, { 1,14, 8}, { 1,15, 8} +}; + + +static const MBAtab MBA_5 [] = { + {6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4}, + {2, 3}, {2, 3}, {2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, + {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, + {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1} +}; + +static const MBAtab MBA_11 [] = { + {32, 11}, {31, 11}, {30, 11}, {29, 11}, + {28, 11}, {27, 11}, {26, 11}, {25, 11}, + {24, 11}, {23, 11}, {22, 11}, {21, 11}, + {20, 10}, {20, 10}, {19, 10}, {19, 10}, + {18, 10}, {18, 10}, {17, 10}, {17, 10}, + {16, 10}, {16, 10}, {15, 10}, {15, 10}, + {14, 8}, {14, 8}, {14, 8}, {14, 8}, + {14, 8}, {14, 8}, {14, 8}, {14, 8}, + {13, 8}, {13, 8}, {13, 8}, {13, 8}, + {13, 8}, {13, 8}, {13, 8}, {13, 8}, + {12, 8}, {12, 8}, {12, 8}, {12, 8}, + {12, 8}, {12, 8}, {12, 8}, {12, 8}, + {11, 8}, {11, 8}, {11, 8}, {11, 8}, + {11, 8}, {11, 8}, {11, 8}, {11, 8}, + {10, 8}, {10, 8}, {10, 8}, {10, 8}, + {10, 8}, {10, 8}, {10, 8}, {10, 8}, + { 9, 8}, { 9, 8}, { 9, 8}, { 9, 8}, + { 9, 8}, { 9, 8}, { 9, 8}, { 9, 8}, + { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7}, + { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7}, + { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7}, + { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7}, + { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7}, + { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7}, + { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7}, + { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7} +}; diff --git a/k9vamps/k9fifo.cpp b/k9vamps/k9fifo.cpp new file mode 100644 index 0000000..7c32de7 --- /dev/null +++ b/k9vamps/k9fifo.cpp @@ -0,0 +1,54 @@ +// +// C++ Implementation: k9fifo +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9fifo.h" +#include "ac.h" + +uint32_t k9fifo::count() { + return m_count; +} + +void k9fifo::enqueue (uchar *_buffer, uint32_t _size) { + mutex.lock(); + if (_size+queue > INPUT_SIZE) { + uint32_t s1,s2; + s1=INPUT_SIZE-queue; + tc_memcpy(array+queue,_buffer,s1); + s2=_size-s1; + tc_memcpy(array,_buffer+s1,s2); + } else + tc_memcpy(array+queue,_buffer,_size); + queue=(queue+_size) %INPUT_SIZE; + m_count+=_size; + mutex.unlock(); +} + +void k9fifo::dequeue(uchar *_buffer,uint32_t _size) { + mutex.lock(); + if ( _size+head >INPUT_SIZE) { + uint32_t s1,s2; + s1=INPUT_SIZE - head; + tc_memcpy(_buffer,array+head,s1); + s2=_size-s1; + tc_memcpy(_buffer+s1,array,s2); + } else + tc_memcpy(_buffer,array+head,_size); + head =(head+_size)%INPUT_SIZE; + m_count -=_size; + mutex.unlock(); +} + +void k9fifo::clear() { + mutex.lock(); + head=queue; + m_count=0; + mutex.unlock(); +} diff --git a/k9vamps/k9fifo.h b/k9vamps/k9fifo.h new file mode 100644 index 0000000..42fbbef --- /dev/null +++ b/k9vamps/k9fifo.h @@ -0,0 +1,39 @@ +// +// C++ Interface: k9fifo +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9FIFO_H +#define K9FIFO_H + +#include "k9common.h" +#include +/** + @author Jean-Michel PETIT +*/ + +#define INPUT_SIZE ( 0x2000*1024) + +class k9fifo { +private: + uint32_t head,queue; + uchar *array; + uint32_t m_count; + QMutex mutex; +public: + k9fifo () { head=queue=m_count=0;array= new uchar[INPUT_SIZE];}; + uint32_t count(); // { return (queue-head)%INPUT_SIZE ;} + uint32_t freespace() {return INPUT_SIZE-count();}; + void enqueue (uchar *_buffer, uint32_t _size) ; + void dequeue(uchar *_buffer,uint32_t _size) ; + void clear(); + ~k9fifo() { delete[] array;}; +}; + +#endif diff --git a/k9vamps/k9requant.cpp b/k9vamps/k9requant.cpp new file mode 100644 index 0000000..009f76c --- /dev/null +++ b/k9vamps/k9requant.cpp @@ -0,0 +1,2481 @@ +// +// C++ Implementation: k9requant +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9requant.h" +#include "getvlc.h" +#include "putvlc.h" +#include "ac.h" +// Code from libmpeg2 and mpeg2enc copyright by their respective owners +// New code and modifications copyright Antoine Missout +// Thanks to Sven Goethel for error resilience patches +// Released under GPL license, see gnu.org + +// toggles: + +#define THREAD +// #define LOG_RATE_CONTROL // some stats +// #define DEMO // demo mode +// #define STAT // print stats on exit +// #define USE_FD // use 2 lasts args for input/output paths + +#define NDEBUG // turns off asserts +#define REMOVE_BYTE_STUFFING // removes series of 0x00 +// #define USE_GLOBAL_REGISTER // assign registers to bit buffers +#define MAX_ERRORS 0 // if above copy slice + +//#define CHANGE_BRIGHTNESS //add a param to command line, changing brightness: _will_not_recompress_, disables max_errors +//#define WIN // for windows fixes, use with USE_FD + +// params: + +// if not defined, non intra block in p frames are requantised +// if defined and >= 0, we keep coeff. in pos 0..n-1 in scan order +// and coeff which would have been non-null if requantised +// if defined and < 0 we drop max 1/x coeffs. +// experimental, looks better when undefined +// #define P_FRAME_NON_INTRA_DROP 8 + +// params for fact = 1.0, fact = 3.0 and fact = 10.0 +// we'll make a linear interpolation between +static const int i_factors[3] = { 5, 15, 65 }; +static const int p_factors[3] = { 5, 25, 85 }; +static const int b_factors[3] = { 25, 45, 105 }; + + +static const double i_min_stresses[3] = { 0.70, 0.40, 0.00 }; +static const double p_min_stresses[3] = { 0.60, 0.35, 0.00 }; +static const double b_min_stresses[3] = { 0.00, 0.00, 0.00 }; + + +// factor up to which alt table will be used +// (though alt_table gives better psnr up to factor around ~2.5 +// the result is less pleasing to watch than normal table +// so this is disabled) +static const double max_alt_table = 0.0; + +// includes +#include +#include +#include +#include +#include + +#ifndef USE_FD +#include +#include +#endif + +// quant table +#include "qTable.h" + +// useful constants +#define I_TYPE 1 +#define P_TYPE 2 +#define B_TYPE 3 + +// gcc +#ifdef HAVE_BUILTIN_EXPECT + #define likely(x) __builtin_expect ((x) != 0, 1) + #define unlikely(x) __builtin_expect ((x) != 0, 0) +#else + #define likely(x) (x) + #define unlikely(x) (x) +#endif + +#ifndef NDEBUG + #define DEB(msg) fprintf (stderr, "%s:%d " msg, __FILE__, __LINE__) + #define DEBF(format, args...) fprintf (stderr, "%s:%d " format, __FILE__, __LINE__, args) +#else + #define DEB(msg) + #ifdef WIN + #define DEBF(format, args) + #else + #define DEBF(format, args...) + #endif +#endif + +#ifndef THREAD +#define LOG(msg) fprintf (stderr, msg) +#ifdef WIN + #define LOGF(format, arg1) fprintf (stderr, format, arg1) +#else + #define LOGF(format, args...) fprintf (stderr, format, args) +#endif +#endif + + + +/*#define MOV_READ \ + mloka1 = rbuf - cbuf; if (mloka1) memmove(orbuf, cbuf, mloka1);\ + cbuf = rbuf = orbuf; rbuf += mloka1; +*/ + +#ifdef STAT + +#define RETURN \ + assert(rbuf >= cbuf);\ + mloka1 = rbuf - cbuf;\ + if (mloka1) { COPY(mloka1); }\ + WRITE \ + free(orbuf); \ + free(owbuf); \ + \ + LOG("Stats:\n");\ + \ + LOGF("Wanted fact_x: %.1f\n", fact_x);\ + \ + LOGF("cnt_i: %.0f ", (float)cnt_i); \ + if (cnt_i) LOGF("ori_i: %.0f new_i: %.0f fact_i: %.1f\n", (float)ori_i, (float)new_i, (float)ori_i/(float)new_i); \ + else LOG("\n");\ + \ + LOGF("cnt_p: %.0f ", (float)cnt_p); \ + if (cnt_p) LOGF("ori_p: %.0f new_p: %.0f fact_p: %.1f cnt_p_i: %.0f cnt_p_ni: %.0f propor: %.1f i\n", \ + (float)ori_p, (float)new_p, (float)ori_p/(float)new_p, (float)cnt_p_i, (float)cnt_p_ni, (float)cnt_p_i/((float)cnt_p_i+(float)cnt_p_ni)); \ + else LOG("\n");\ + \ + LOGF("cnt_b: %.0f ", (float)cnt_b); \ + if (cnt_b) LOGF("ori_b: %.0f new_b: %.0f fact_b: %.1f cnt_b_i: %.0f cnt_b_ni: %.0f propor: %.1f i\n", \ + (float)ori_b, (float)new_b, (float)ori_b/(float)new_b, (float)cnt_b_i, (float)cnt_b_ni, (float)cnt_b_i/((float)cnt_b_i+(float)cnt_b_ni)); \ + else LOG("\n");\ + \ + LOGF("Final fact_x: %.1f\n", (float)inbytecnt/(float)outbytecnt);\ + exit(0); + +#else + +#define RETURN \ + assert(rbuf >= cbuf);\ + mloka1 = rbuf - cbuf;\ + if (mloka1) { COPY(mloka1); }\ + WRITE \ + free(orbuf); \ + free(owbuf); \ + exit(0); + +#endif + #define MOTION_CALL(routine,direction) \ +do { \ + if ((direction) & MACROBLOCK_MOTION_FORWARD) \ + routine (f_code[0]); \ + if ((direction) & MACROBLOCK_MOTION_BACKWARD) \ + routine (f_code[1]); \ +} while (0) + +#define NEXT_MACROBLOCK \ +do { \ + h_offset += 16; \ + if (h_offset == horizontal_size_value) \ + { \ + v_offset += 16; \ + if (v_offset > (vertical_size_value - 16)) return; \ + h_offset = 0; \ + } \ +} while (0) + +#ifdef P_FRAME_NON_INTRA_DROP + #if (P_FRAME_NON_INTRA_DROP < 0) + #undef UPDATE_VAL + #define UPDATE_VAL + #define SAVE_VAL + #define WRITE_VAL \ + blk->level = val; \ + blk->run = i - li - 1; \ + li = i; \ + blk++; + #else + #define SAVE_VAL oval = val; + #define WRITE_VAL \ + if ((val) || (i < P_FRAME_NON_INTRA_DROP)) \ + { \ + blk->level = oval; \ + blk->run = i - li - 1; \ + li = i; \ + blk++; \ + } + #endif +#else + #define SAVE_VAL + #define WRITE_VAL \ + if (val) \ + { \ + blk->level = val; \ + blk->run = i - li - 1; \ + li = i; \ + blk++; \ + } +#endif + +#define UPDATE_VAL \ + val = curTable[val]; + +int quantisers[42] = + { + 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, + 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 72, 80, + 88, 96, 104, 112 + }; + +int non_linear_quantizer_scale [] = + { + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 10, 12, 14, 16, 18, 20, 22, + 24, 28, 32, 36, 40, 44, 48, 52, + 56, 64, 72, 80, 88, 96, 104, 112 + }; + + +const uint8 non_linear_mquant_table[32] = + { + 0, 1, 2, 3, 4, 5, 6, 7, + 8,10,12,14,16,18,20,22, + 24,28,32,36,40,44,48,52, + 56,64,72,80,88,96,104,112 + }; +const uint8 map_non_linear_mquant[113] = + { + 0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16, + 16,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22, + 22,22,23,23,23,23,24,24,24,24,24,24,24,25,25,25,25,25,25,25,26,26, + 26,26,26,26,26,26,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,29, + 29,29,29,29,29,29,29,29,29,30,30,30,30,30,30,30,31,31,31,31,31 + }; + + +k9requant::k9requant() +{ + + cbuf=rbuf=orbuf=wbuf=NULL; + quant_table_id = &quant_table_id_data[2048]; + rqt_run=false; + initvar(); +} +void k9requant::putbits(uint val, int n) +{ + assert(n < 32); + assert(!(val & (0xffffffffU << n))); + + while (unlikely(n >= outbitcnt)) + { + wbuf[0] = (outbitbuf << outbitcnt ) | (val >> (n - outbitcnt)); + SEEKW(1); + n -= outbitcnt; + outbitbuf = 0; + val &= ~(0xffffffffU << n); + outbitcnt = BITS_IN_BUF; + } + + if (likely(n)) + { + outbitbuf = (outbitbuf << n) | val; + outbitcnt -= n; + } + + assert(outbitcnt > 0); + assert(outbitcnt <= BITS_IN_BUF); +} + +void k9requant::Refill_bits(void) +{ + assert((rbuf - cbuf) >= 1); + inbitbuf |= cbuf[0] << (24 - inbitcnt); + inbitcnt += 8; + SEEKR(1) +} + +void k9requant::Flush_Bits(uint n) +{ + assert(inbitcnt >= n); + + inbitbuf <<= n; + inbitcnt -= n; + + assert( (!n) || ((n>0) && !(inbitbuf & 0x1)) ); + + while (unlikely(inbitcnt < 24)) Refill_bits(); +} + +uint k9requant::Show_Bits(uint n) +{ + return ((unsigned int)inbitbuf) >> (32 - n); +} + +uint k9requant::Get_Bits(uint n) +{ + uint Val = Show_Bits(n); + Flush_Bits(n); + return Val; +} + +uint k9requant::Copy_Bits(uint n) +{ + uint Val = Get_Bits(n); + putbits(Val, n); + return Val; +} + +void k9requant::flush_read_buffer() +{ + int i = inbitcnt & 0x7; + if (i) + { + if (inbitbuf >> (32 - i)) + { + DEBF("illegal inbitbuf: 0x%08X, %i, 0x%02X, %i\n", inbitbuf, inbitcnt, (inbitbuf >> (32 - i)), i); + sliceError++; + } + + inbitbuf <<= i; + inbitcnt -= i; + } + SEEKR(-1 * (inbitcnt >> 3)); + inbitcnt = 0; +} + +void k9requant::flush_write_buffer() +{ + if (outbitcnt != 8) putbits(0, outbitcnt); +} + +/////---- begin ext mpeg code +int k9requant::scale_quant(double quant ) +{ + int iquant; +#ifdef DEMO + if ((gopCount & 0x7F) < 10) // gop is ~ 0.5 sec, so 5 sec every ~minute (127 * 0.5 = 63.5 sec) + { + if (q_scale_type) return 112; + else return 62; + } +#endif + if (q_scale_type) + { + iquant = (int) floor(quant+0.5); + /* clip mquant to legal (linear) range */ + if (iquant<1) iquant = 1; + if (iquant>112) iquant = 112; + iquant = non_linear_mquant_table[map_non_linear_mquant[iquant]]; + } + else + { + /* clip mquant to legal (linear) range */ + iquant = (int)floor(quant+0.5); + if (iquant<2) iquant = 2; + if (iquant>62) iquant = 62; + iquant = (iquant/2)*2; // Must be *even* + } + return iquant; +} + +int k9requant::increment_quant(int quant) +{ +#ifdef DEMO + if ((gopCount & 0x7F) < 10) + { + if (q_scale_type) return 112; + else return 62; + } +#endif + if (q_scale_type) + { + if (quant < 1 || quant > 112) + { + DEBF("illegal quant: %d\n", quant); + if (quant > 112) quant = 112; + else if (quant < 1) quant = 1; + DEBF("illegal quant changed to : %d\n", quant); + sliceError++; + } + quant = map_non_linear_mquant[quant] + 1; + if (quant > 31) quant = 31; + quant = non_linear_mquant_table[quant]; + } + else + { + if ((quant & 1) || (quant < 2) || (quant > 62)) + { + DEBF("illegal quant: %d\n", quant); + if (quant & 1) quant--; + if (quant > 62) quant = 62; + else if (quant < 2) quant = 2; + DEBF("illegal quant changed to : %d\n", quant); + sliceError++; + } + quant += 2; + if (quant > 62) quant = 62; + } + return quant; +} + +int k9requant::intmax( register int x, register int y ) +{ return x < y ? y : x; } + +int k9requant::intmin( register int x, register int y ) +{ return x < y ? x : y; } + + +int k9requant::getNewQuant(int curQuant, int intra) +{ +#ifdef CHANGE_BRIGHTNESS + return curQuant; +#else + int mquant = 0; + double cStress; + + switch (picture_coding_type) + { + case I_TYPE: + cStress = (stress_factor - i_min_stress) / (1.0 - i_min_stress); + mquant = intmax(scale_quant(curQuant + i_factor*cStress), increment_quant(curQuant)); + break; + + case P_TYPE: + cStress = (stress_factor - p_min_stress) / (1.0 - p_min_stress); + if (intra) // since it might be used as a ref, treat it as an I frame block + mquant = intmax(scale_quant(curQuant + i_factor*cStress), increment_quant(curQuant)); + else + mquant = intmax(scale_quant(curQuant + p_factor*cStress), increment_quant(curQuant)); + break; + + case B_TYPE: + cStress = (stress_factor - b_min_stress) / (1.0 - b_min_stress); + mquant = intmax(scale_quant(curQuant + b_factor*cStress), increment_quant(curQuant)); + break; + + default: + assert(0); + break; + } + + assert(mquant >= curQuant); + + return mquant; +#endif +} + +int k9requant::isNotEmpty(RunLevel *blk) +{ + return (blk->level); +} + + +// return != 0 if error +int k9requant::putAC(int run, int signed_level, int vlcformat) +{ + int level, len; + const VLCtable *ptab = NULL; + + level = (signed_level<0) ? -signed_level : signed_level; /* abs(signed_level) */ + + // assert(!(run<0 || run>63 || level==0 || level>2047)); + if(run<0 || run>63) + { + DEBF("illegal run: %d\n", run); + sliceError++; + return 1; + } + if(level==0 || level>2047) + { + DEBF("illegal level: %d\n", level); + sliceError++; + return 1; + } + + len = 0; + + if (run<2 && level<41) + { + if (vlcformat) ptab = &dct_code_tab1a[run][level-1]; + else ptab = &dct_code_tab1[run][level-1]; + len = ptab->len; + } + else if (run<32 && level<6) + { + if (vlcformat) ptab = &dct_code_tab2a[run-2][level-1]; + else ptab = &dct_code_tab2[run-2][level-1]; + len = ptab->len; + } + + if (len) /* a VLC code exists */ + { + putbits(ptab->code, len); + putbits(signed_level<0, 1); /* sign */ + } + else + { + putbits(1l, 6); /* Escape */ + putbits(run, 6); /* 6 bit code for run */ + putbits(((uint)signed_level) & 0xFFF, 12); + } + + return 0; +} + +// return != 0 if error +int k9requant::putACfirst(int run, int val) +{ + if (run==0 && (val==1 || val==-1)) + { + putbits(2|((val<0) ? 1 : 0), 2); + return 0; + } + else return putAC(run,val,0); +} + +void k9requant::putnonintrablk(RunLevel *blk) +{ + assert(blk->level); + + if (putACfirst(blk->run, blk->level)) return; + blk++; + + while(blk->level) + { + if (putAC(blk->run, blk->level, 0)) return; + blk++; + } + + putbits(2,2); +} + +void k9requant::putcbp(int cbp) +{ + assert(cbp > 0 && cbp < 64); + putbits(cbptable[cbp].code,cbptable[cbp].len); +} + +void k9requant::putmbtype(int mb_type) +{ + putbits(mbtypetab[picture_coding_type-1][mb_type].code, + mbtypetab[picture_coding_type-1][mb_type].len); +} + +int k9requant::get_macroblock_modes () +{ + int macroblock_modes; + const MBtab * tab; + + switch (picture_coding_type) + { + case I_TYPE: + + tab = MB_I + UBITS (bit_buf, 1); + DUMPBITS (bit_buf, bits, tab->len); + macroblock_modes = tab->modes; + + if ((! (frame_pred_frame_dct)) && (picture_structure == FRAME_PICTURE)) + { + macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED; + DUMPBITS (bit_buf, bits, 1); + } + + return macroblock_modes; + + case P_TYPE: + + tab = MB_P + UBITS (bit_buf, 5); + DUMPBITS (bit_buf, bits, tab->len); + macroblock_modes = tab->modes; + + if (picture_structure != FRAME_PICTURE) + { + if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) + { + macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE; + DUMPBITS (bit_buf, bits, 2); + } + return macroblock_modes; + } + else if (frame_pred_frame_dct) + { + if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) + macroblock_modes |= MC_FRAME; + return macroblock_modes; + } + else + { + if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) + { + macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE; + DUMPBITS (bit_buf, bits, 2); + } + if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) + { + macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED; + DUMPBITS (bit_buf, bits, 1); + } + return macroblock_modes; + } + + case B_TYPE: + + tab = MB_B + UBITS (bit_buf, 6); + DUMPBITS (bit_buf, bits, tab->len); + macroblock_modes = tab->modes; + + if (picture_structure != FRAME_PICTURE) + { + if (! (macroblock_modes & MACROBLOCK_INTRA)) + { + macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE; + DUMPBITS (bit_buf, bits, 2); + } + return macroblock_modes; + } + else if (frame_pred_frame_dct) + { + /* if (! (macroblock_modes & MACROBLOCK_INTRA)) */ + macroblock_modes |= MC_FRAME; + return macroblock_modes; + } + else + { + if (macroblock_modes & MACROBLOCK_INTRA) goto intra; + macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE; + DUMPBITS (bit_buf, bits, 2); + if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) + { + intra: + macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED; + DUMPBITS (bit_buf, bits, 1); + } + return macroblock_modes; + } + + default: + return 0; + } + +} + +int k9requant::get_quantizer_scale () +{ + int quantizer_scale_code; + + quantizer_scale_code = UBITS (bit_buf, 5); + DUMPBITS (bit_buf, bits, 5); + + if (!quantizer_scale_code) + { + DEBF("illegal quant scale code: %d\n", quantizer_scale_code); + sliceError++; + quantizer_scale_code++; + } + + if (q_scale_type) return non_linear_quantizer_scale[quantizer_scale_code]; + else return quantizer_scale_code << 1; +} + +void k9requant::get_motion_delta (const int f_code) +{ +#define bit_buf (inbitbuf) + const MVtab * tab; + + if (bit_buf & 0x80000000) + { + COPYBITS (bit_buf, bits, 1); + return; + } + else if (bit_buf >= 0x0c000000) + { + + tab = MV_4 + UBITS (bit_buf, 4); + COPYBITS (bit_buf, bits, tab->len + 1); + if (f_code) COPYBITS (bit_buf, bits, f_code); + return; + } + else + { + + tab = MV_10 + UBITS (bit_buf, 10); + COPYBITS (bit_buf, bits, tab->len + 1); + if (f_code) COPYBITS (bit_buf, bits, f_code); + return; + } +} + + +void k9requant::get_dmv () +{ + const DMVtab * tab; + tab = DMV_2 + UBITS (bit_buf, 2); + COPYBITS (bit_buf, bits, tab->len); + return; +} + +int k9requant::get_coded_block_pattern () +{ +#define bit_buf (inbitbuf) + const CBPtab * tab; + + if (bit_buf >= 0x20000000) + { + tab = CBP_7 + (UBITS (bit_buf, 7) - 16); + DUMPBITS (bit_buf, bits, tab->len); + return tab->cbp; + } + else + { + tab = CBP_9 + UBITS (bit_buf, 9); + DUMPBITS (bit_buf, bits, tab->len); + return tab->cbp; + } +} + +int k9requant::get_luma_dc_dct_diff () +{ +#define bit_buf (inbitbuf) +#ifdef CHANGE_BRIGHTNESS + #define DOBITS(x, y, z) DUMPBITS(x, y, z) +#else + #define DOBITS(x, y, z) COPYBITS(x, y, z) +#endif + const DCtab * tab; + int size; + int dc_diff; + + if (bit_buf < 0xf8000000) + { + tab = DC_lum_5 + UBITS (bit_buf, 5); + size = tab->size; + if (size) + { + DOBITS (bit_buf, bits, tab->len); + //dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size); + dc_diff = UBITS (bit_buf, size); if (!(dc_diff >> (size - 1))) dc_diff = (dc_diff + 1) - (1 << size); + DOBITS (bit_buf, bits, size); + return dc_diff; + } + else + { + DOBITS (bit_buf, bits, 3); + return 0; + } + } + else + { + tab = DC_long + (UBITS (bit_buf, 9) - 0x1e0); + size = tab->size; + DOBITS (bit_buf, bits, tab->len); + //dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size); + dc_diff = UBITS (bit_buf, size); if (!(dc_diff >> (size - 1))) dc_diff = (dc_diff + 1) - (1 << size); + DOBITS (bit_buf, bits, size); + return dc_diff; + } +} + +int k9requant::get_chroma_dc_dct_diff () +{ +#define bit_buf (inbitbuf) + + const DCtab * tab; + int size; + int dc_diff; + + if (bit_buf < 0xf8000000) + { + tab = DC_chrom_5 + UBITS (bit_buf, 5); + size = tab->size; + if (size) + { + COPYBITS (bit_buf, bits, tab->len); + //dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size); + dc_diff = UBITS (bit_buf, size); if (!(dc_diff >> (size - 1))) dc_diff = (dc_diff + 1) - (1 << size); + COPYBITS (bit_buf, bits, size); + return dc_diff; + } + else + { + COPYBITS (bit_buf, bits, 2); + return 0; + } + } + else + { + tab = DC_long + (UBITS (bit_buf, 10) - 0x3e0); + size = tab->size; + COPYBITS (bit_buf, bits, tab->len + 1); + //dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size); + dc_diff = UBITS (bit_buf, size); if (!(dc_diff >> (size - 1))) dc_diff = (dc_diff + 1) - (1 << size); + COPYBITS (bit_buf, bits, size); + return dc_diff; + } +} + + +void k9requant::get_intra_block_B14 () +{ +#define bit_buf (inbitbuf) + int i, li; + int val; + const DCTtab * tab; + + li = i = 0; + + while (1) + { + if (bit_buf >= 0x28000000) + { + tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5); + + i += tab->run; + if (i >= 64) break; /* end of block */ + + normal_code: + DUMPBITS (bit_buf, bits, tab->len); + val = tab->level; + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + UPDATE_VAL + if (val) + { + if (putAC(i - li - 1, val, 0)) break; + li = i; + } + + DUMPBITS (bit_buf, bits, 1); + + continue; + } + else if (bit_buf >= 0x04000000) + { + tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) goto normal_code; + + /* escape code */ + i += (UBITS (bit_buf, 12) & 0x3F) - 64; + if (i >= 64) + { + sliceError++; + break; /* illegal, check needed to avoid buffer overflow */ + } + + DUMPBITS (bit_buf, bits, 12); + val = SBITS (bit_buf, 12); + UPDATE_VAL + if (val) + { + if (putAC(i - li - 1, val, 0)) break; + li = i; + } + + DUMPBITS (bit_buf, bits, 12); + + continue; + } + else if (bit_buf >= 0x02000000) + { + tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00800000) + { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00200000) + { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else + { + tab = DCT_16 + UBITS (bit_buf, 16); + DUMPBITS (bit_buf, bits, 16); + i += tab->run; + if (i < 64) goto normal_code; + } + sliceError++; + break; /* illegal, check needed to avoid buffer overflow */ + } + + COPYBITS (bit_buf, bits, 2); /* end of block code */ +} + +void k9requant::get_intra_block_B15 () +{ +#define bit_buf (inbitbuf) + int i, li; + int val; + const DCTtab * tab; + + li = i = 0; + + while (1) + { + if (bit_buf >= 0x04000000) + { + tab = DCT_B15_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) + { + normal_code: + DUMPBITS (bit_buf, bits, tab->len); + + val = tab->level; + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + UPDATE_VAL + if (val) + { + if (putAC(i - li - 1, val, 1)) break; + li = i; + } + + DUMPBITS (bit_buf, bits, 1); + + continue; + } + else + { + if (i >= 128) break; /* end of block */ + + i += (UBITS (bit_buf, 12) & 0x3F) - 64; + + if (i >= 64) + { + sliceError++; + break; /* illegal, check against buffer overflow */ + } + + DUMPBITS (bit_buf, bits, 12); + val = SBITS (bit_buf, 12); + UPDATE_VAL + if (val) + { + if (putAC(i - li - 1, val, 1)) break; + li = i; + } + + DUMPBITS (bit_buf, bits, 12); + + continue; + } + } + else if (bit_buf >= 0x02000000) + { + tab = DCT_B15_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00800000) + { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00200000) + { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else + { + tab = DCT_16 + UBITS (bit_buf, 16); + DUMPBITS (bit_buf, bits, 16); + i += tab->run; + if (i < 64) goto normal_code; + } + sliceError++; + break; /* illegal, check needed to avoid buffer overflow */ + } + + COPYBITS (bit_buf, bits, 4); /* end of block code */ +} + +int k9requant::get_non_intra_block_rq (RunLevel *blk) +{ +#define bit_buf (inbitbuf) + //int q = quantizer_scale; + //int nq = new_quantizer_scale, tst = (nq / q) + ((nq % q) ? 1 : 0); + int i, li; + int val; + const DCTtab * tab; + + li = i = -1; + + if (bit_buf >= 0x28000000) + { + tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5); + goto entry_1; + } + else goto entry_2; + + while (1) + { + if (bit_buf >= 0x28000000) + { + tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5); + + entry_1: + i += tab->run; + if (i >= 64) + break; /* end of block */ + + normal_code: + + DUMPBITS (bit_buf, bits, tab->len); + val = tab->level; + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + UPDATE_VAL + if (val) + { + blk->level = val; + blk->run = i - li - 1; + li = i; + blk++; + } + + DUMPBITS (bit_buf, bits, 1); + + continue; + } + + entry_2: + if (bit_buf >= 0x04000000) + { + tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) goto normal_code; + + /* escape code */ + + i += (UBITS (bit_buf, 12) & 0x3F) - 64; + + if (i >= 64) + { + sliceError++; + break; /* illegal, check needed to avoid buffer overflow */ + } + + DUMPBITS (bit_buf, bits, 12); + val = SBITS (bit_buf, 12); + UPDATE_VAL + if (val) + { + blk->level = val; + blk->run = i - li - 1; + li = i; + blk++; + } + + DUMPBITS (bit_buf, bits, 12); + + continue; + } + else if (bit_buf >= 0x02000000) + { + tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00800000) + { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00200000) + { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else + { + tab = DCT_16 + UBITS (bit_buf, 16); + DUMPBITS (bit_buf, bits, 16); + + i += tab->run; + if (i < 64) goto normal_code; + } + + sliceError++; + break; /* illegal, check needed to avoid buffer overflow */ + } + DUMPBITS (bit_buf, bits, 2); /* dump end of block code */ + + blk->level = 0; + + return i; +} + + +int k9requant::get_non_intra_block_sav (RunLevel *blk, int cc) +{ +#define bit_buf (inbitbuf) + int i, li; + int val; + const DCTtab * tab; + +#ifdef P_FRAME_NON_INTRA_DROP + #if (P_FRAME_NON_INTRA_DROP < 0) + RunLevel *oblk = blk; +#else + int oval; +#endif +#endif + + li = i = -1; + + if (bit_buf >= 0x28000000) + { + tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5); + goto entry_1; + } + else goto entry_2; + + while (1) + { + if (bit_buf >= 0x28000000) + { + tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5); + + entry_1: + i += tab->run; + if (i >= 64) + break; /* end of block */ + + normal_code: + + DUMPBITS (bit_buf, bits, tab->len); + val = tab->level; + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + SAVE_VAL + if (li == -1) + { + if (abs(val) < abs(mb_sav_lev)) + { + mb_sav_c = cc; + mb_sav_lev = val; + mb_sav_run = i - li - 1; + } + } + UPDATE_VAL + WRITE_VAL + + DUMPBITS (bit_buf, bits, 1); + + continue; + } + + entry_2: + if (bit_buf >= 0x04000000) + { + tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) goto normal_code; + + /* escape code */ + + i += (UBITS (bit_buf, 12) & 0x3F) - 64; + + if (i >= 64) + { + sliceError++; + break; /* illegal, check needed to avoid buffer overflow */ + } + + DUMPBITS (bit_buf, bits, 12); + val = SBITS (bit_buf, 12); + SAVE_VAL + if (li == -1) + { + if (abs(val) < abs(mb_sav_lev)) + { + mb_sav_c = cc; + mb_sav_lev = val; + mb_sav_run = i - li - 1; + } + } + UPDATE_VAL + WRITE_VAL + + DUMPBITS (bit_buf, bits, 12); + + continue; + } + else if (bit_buf >= 0x02000000) + { + tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00800000) + { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00200000) + { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else + { + tab = DCT_16 + UBITS (bit_buf, 16); + DUMPBITS (bit_buf, bits, 16); + + i += tab->run; + if (i < 64) goto normal_code; + } + + sliceError++; + break; /* illegal, check needed to avoid buffer overflow */ + } + DUMPBITS (bit_buf, bits, 2); /* dump end of block code */ + +#ifdef P_FRAME_NON_INTRA_DROP + #if (P_FRAME_NON_INTRA_DROP < 0) + blk -= (int)((blk - oblk) * (stress_factor / P_FRAME_NON_INTRA_DROP)); +#ifdef DEMO + if ((gopCount & 0x7F) < 10) blk = oblk; +#endif + #endif +#endif + + blk->level = 0; + + return i; +} + +#ifdef P_FRAME_NON_INTRA_DROP +int k9requant::get_non_intra_block_drop (RunLevel *blk, int cc) +{ +#define bit_buf (inbitbuf) + int i, li; + int val; + const DCTtab * tab; +#if (P_FRAME_NON_INTRA_DROP < 0) + RunLevel *oblk = blk; +#else + int oval; +#endif + + li = i = -1; + + if (bit_buf >= 0x28000000) + { + tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5); + goto entry_1; + } + else goto entry_2; + + while (1) + { + if (bit_buf >= 0x28000000) + { + tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5); + + entry_1: + i += tab->run; + if (i >= 64) + break; /* end of block */ + + normal_code: + + DUMPBITS (bit_buf, bits, tab->len); + val = tab->level; + val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1); + SAVE_VAL + UPDATE_VAL + WRITE_VAL + + DUMPBITS (bit_buf, bits, 1); + + continue; + } + + entry_2: + if (bit_buf >= 0x04000000) + { + tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4); + + i += tab->run; + if (i < 64) goto normal_code; + + /* escape code */ + + i += (UBITS (bit_buf, 12) & 0x3F) - 64; + + if (i >= 64) + { + sliceError++; + break; /* illegal, check needed to avoid buffer overflow */ + } + + DUMPBITS (bit_buf, bits, 12); + val = SBITS (bit_buf, 12); + SAVE_VAL + UPDATE_VAL + WRITE_VAL + + DUMPBITS (bit_buf, bits, 12); + + continue; + } + else if (bit_buf >= 0x02000000) + { + tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00800000) + { + tab = DCT_13 + (UBITS (bit_buf, 13) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else if (bit_buf >= 0x00200000) + { + tab = DCT_15 + (UBITS (bit_buf, 15) - 16); + i += tab->run; + if (i < 64) goto normal_code; + } + else + { + tab = DCT_16 + UBITS (bit_buf, 16); + DUMPBITS (bit_buf, bits, 16); + + i += tab->run; + if (i < 64) goto normal_code; + } + + sliceError++; + break; /* illegal, check needed to avoid buffer overflow */ + } + DUMPBITS (bit_buf, bits, 2); /* dump end of block code */ + +#if (P_FRAME_NON_INTRA_DROP < 0) + blk -= (int)((blk - oblk) * (stress_factor / P_FRAME_NON_INTRA_DROP)); +#ifdef DEMO + if ((gopCount & 0x7F) < 10) blk = oblk; +#endif + #endif + + blk->level = 0; + + return i; +} +#endif + +#ifdef CHANGE_BRIGHTNESS +void k9requant::putDC(const sVLCtable *tab, int val) +{ + int absval, size; + absval = abs(val); + size = 0; + while (absval) + { + absval >>= 1; + size++; + } + putbits(tab[size].code,tab[size].len); + if (size!=0) + { + if (val>=0) absval = val; + else absval = val + (1< (255 << intra_dc_precision)) val = 255 << intra_dc_precision; + else if (val < 0) val = 0; + + bri = val - (128 << intra_dc_precision); + new_dc_pred = val; + + dc_reset = 0; + } + else + { + val = bri + old_dc_pred; + old_dc_pred = val; + + val += delta_bright << intra_dc_precision; + if (val > (255 << intra_dc_precision)) val = 255 << intra_dc_precision; + else if (val < 0) val = 0; + + bri = val - new_dc_pred; + new_dc_pred = val; + } + putDC(DClumtab, bri); + } +#else + if (cc == 0) get_luma_dc_dct_diff (); +#endif + else get_chroma_dc_dct_diff (); + + if (intra_vlc_format) get_intra_block_B15 (); + else get_intra_block_B14 (); +} + +void k9requant::slice_non_intra_DCT (int cur_block) +{ +#ifdef P_FRAME_NON_INTRA_DROP + if (picture_coding_type == P_TYPE) + { + if ((h_offset == 0) || (h_offset == horizontal_size_value - 16)) + get_non_intra_block_sav(block[cur_block], cur_block); + else + get_non_intra_block_drop(block[cur_block], cur_block); + } + else + get_non_intra_block_rq(block[cur_block]); +#else + if ((picture_coding_type == P_TYPE) && ((h_offset == 0) || (h_offset == horizontal_size_value - 16))) + get_non_intra_block_sav(block[cur_block], cur_block); + else + get_non_intra_block_rq(block[cur_block]); +#endif +} + +void k9requant::motion_fr_frame ( uint f_code[2] ) +{ + get_motion_delta (f_code[0]); + get_motion_delta (f_code[1]); +} + +void k9requant::motion_fr_field ( uint f_code[2] ) +{ + COPYBITS (bit_buf, bits, 1); + get_motion_delta (f_code[0]); + get_motion_delta (f_code[1]); + + COPYBITS (bit_buf, bits, 1); + get_motion_delta (f_code[0]); + get_motion_delta (f_code[1]); +} + +void k9requant::motion_fr_dmv ( uint f_code[2] ) +{ + get_motion_delta (f_code[0]); + get_dmv (); + + get_motion_delta (f_code[1]); + get_dmv (); +} + +void k9requant::motion_fr_conceal ( ) +{ + get_motion_delta (f_code[0][0]); + get_motion_delta (f_code[0][1]); + + COPYBITS (bit_buf, bits, 1); +} + +void k9requant::motion_fi_field ( uint f_code[2] ) +{ + COPYBITS (bit_buf, bits, 1); + + get_motion_delta (f_code[0]); + get_motion_delta (f_code[1]); +} + +void k9requant::motion_fi_16x8 ( uint f_code[2] ) +{ + COPYBITS (bit_buf, bits, 1); + + get_motion_delta (f_code[0]); + get_motion_delta (f_code[1]); + + COPYBITS (bit_buf, bits, 1); + + get_motion_delta (f_code[0]); + get_motion_delta (f_code[1]); +} + +void k9requant::motion_fi_dmv ( uint f_code[2] ) +{ + get_motion_delta (f_code[0]); + get_dmv (); + + get_motion_delta (f_code[1]); + get_dmv (); +} + +void k9requant::motion_fi_conceal () +{ + COPYBITS (bit_buf, bits, 1); + + get_motion_delta (f_code[0][0]); + get_motion_delta (f_code[0][1]); + + COPYBITS (bit_buf, bits, 1); +} + + +void k9requant::putmbdata(int macroblock_modes) +{ + putmbtype(macroblock_modes & 0x1F); + + /*switch (picture_coding_type) + { + case I_TYPE: + if ((! (frame_pred_frame_dct)) && (picture_structure == FRAME_PICTURE)) + putbits(macroblock_modes & DCT_TYPE_INTERLACED ? 1 : 0, 1); + break; + + case P_TYPE: + if (picture_structure != FRAME_PICTURE) + { + if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) + putbits((macroblock_modes & MOTION_TYPE_MASK) / MOTION_TYPE_BASE, 2); + break; + } + else if (frame_pred_frame_dct) break; + else + { + if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) + putbits((macroblock_modes & MOTION_TYPE_MASK) / MOTION_TYPE_BASE, 2); + if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) + putbits(macroblock_modes & DCT_TYPE_INTERLACED ? 1 : 0, 1); + break; + } + + case B_TYPE: + if (picture_structure != FRAME_PICTURE) + { + if (! (macroblock_modes & MACROBLOCK_INTRA)) + putbits((macroblock_modes & MOTION_TYPE_MASK) / MOTION_TYPE_BASE, 2); + break; + } + else if (frame_pred_frame_dct) break; + else + { + if (macroblock_modes & MACROBLOCK_INTRA) goto intra; + putbits((macroblock_modes & MOTION_TYPE_MASK) / MOTION_TYPE_BASE, 2); + if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) + { + intra: + putbits(macroblock_modes & DCT_TYPE_INTERLACED ? 1 : 0, 1); + } + break; + } + }*/ + + if (macroblock_modes & (MACROBLOCK_MOTION_FORWARD | MACROBLOCK_MOTION_BACKWARD)) + { + if (picture_structure == FRAME_PICTURE) + { + if (frame_pred_frame_dct == 0) + { + putbits((macroblock_modes & MOTION_TYPE_MASK) / MOTION_TYPE_BASE, 2); + } + } + else + { + putbits((macroblock_modes & MOTION_TYPE_MASK) / MOTION_TYPE_BASE, 2); + } + } + if ((picture_structure == FRAME_PICTURE) && (frame_pred_frame_dct == 0) && (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN))) + { + putbits(macroblock_modes & DCT_TYPE_INTERLACED ? 1 : 0, 1); + } +} + +void k9requant::put_quantiser(int quantiser) +{ + putbits(q_scale_type ? map_non_linear_mquant[quantiser] : quantiser >> 1, 5); + last_coded_scale = quantiser; +} + +void k9requant::putaddrinc(int addrinc) +{ + mb_out += addrinc; + //LOGF("mb_out: %i\n", mb_out); + if (mb_out > (horizontal_size_value >> 4)) + { + sliceError++; + //LOGF("mb_out: %i, hsv: %i, curo: %i\n", mb_out, horizontal_size_value, (int)outbytecnt + (wbuf - owbuf)); + } + while (addrinc>33) + { + putbits(0x08,11); /* macroblock_escape */ + addrinc-= 33; + } + assert( addrinc >= 1 && addrinc <= 33 ); + putbits(addrinctab[addrinc-1].code,addrinctab[addrinc-1].len); +} + +int k9requant::slice_init (int code) +{ +#define bit_buf (inbitbuf) + + int offset; + const MBAtab * mba; + + mb_out = 0; + v_offset = (code - 1) * 16; + + quantizer_scale = get_quantizer_scale (); + new_quantizer_scale = getNewQuant(quantizer_scale, 0); + put_quantiser(new_quantizer_scale); + + + /* ignore intra_slice and all the extra data */ + while (bit_buf & 0x80000000) + { + DUMPBITS (bit_buf, bits, 9); + } + + /* decode initial macroblock address increment */ + offset = 0; + while (1) + { + if (bit_buf >= 0x08000000) + { + mba = MBA_5 + (UBITS (bit_buf, 6) - 2); + break; + } + else if (bit_buf >= 0x01800000) + { + mba = MBA_11 + (UBITS (bit_buf, 12) - 24); + break; + } + else switch (UBITS (bit_buf, 12)) + { + case 8: /* macroblock_escape */ + offset += 33; + DUMPBITS (bit_buf, bits, 11); + continue; + default: /* error */ + sliceError++; + return 1; + } + } + mb_add = offset + mba->mba + 1; + mb_skip = 0; + COPYBITS (bit_buf, bits, 1); + DUMPBITS(bit_buf, bits, mba->len); + + h_offset = (offset + mba->mba) << 4; + + while (h_offset - (int)horizontal_size_value >= 0) + { + h_offset -= horizontal_size_value; + v_offset += 16; + } + + if (v_offset > (vertical_size_value - 16)) return 1; + + return 0; + +} + +void k9requant::mpeg2_slice ( const int code ) +{ +#define bit_buf (inbitbuf) + +#ifdef CHANGE_BRIGHTNESS + dc_reset = 1; +#endif + + if (slice_init (code)) return; + + while (1) + { + int macroblock_modes; + int mba_inc; + const MBAtab * mba; + + macroblock_modes = get_macroblock_modes (); + if (macroblock_modes & MACROBLOCK_QUANT) quantizer_scale = get_quantizer_scale (); + + if (macroblock_modes & MACROBLOCK_INTRA) + { +#ifdef STAT + if (picture_coding_type == P_TYPE) cnt_p_i++; + else if (picture_coding_type == B_TYPE) cnt_b_i++; +#endif + + new_quantizer_scale = getNewQuant(quantizer_scale, 1); + if (last_coded_scale == new_quantizer_scale) macroblock_modes &= 0xFFFFFFEF; // remove MACROBLOCK_QUANT + else macroblock_modes |= MACROBLOCK_QUANT; //add MACROBLOCK_QUANT + + putaddrinc(mb_add + mb_skip); mb_skip = 0; + putmbdata(macroblock_modes); + if (macroblock_modes & MACROBLOCK_QUANT) put_quantiser(new_quantizer_scale); + + if (concealment_motion_vectors) + { + if (picture_structure == FRAME_PICTURE) motion_fr_conceal (); + else motion_fi_conceal (); + } + + curTable = quant_tables[quant_equ[quantizer_scale]][quant_equ[new_quantizer_scale]]; + if (!curTable) + { + /*DEBF("Inv. curTable: qs: %i nqs: %i qe_qs: %i qe_nqs: %i\n", + quantizer_scale, new_quantizer_scale, + quant_equ[quantizer_scale], quant_equ[new_quantizer_scale]);*/ + curTable = quant_table_id; + } + + slice_intra_DCT ( 0); + slice_intra_DCT ( 0); + slice_intra_DCT ( 0); + slice_intra_DCT ( 0); + slice_intra_DCT ( 1); + slice_intra_DCT ( 2); + } + else + { + int new_coded_block_pattern = 0; + + // begin saving data + int batb; + uint8 n_owbuf[32], *n_wbuf, *o_owbuf, *o_wbuf; + uint32 n_outbitcnt, n_outbitbuf, o_outbitcnt, o_outbitbuf; + +#ifdef CHANGE_BRIGHTNESS + dc_reset = 1; +#endif + +#define PUSH_BIT_IO \ + o_owbuf = owbuf; o_wbuf = wbuf; \ + o_outbitcnt = outbitcnt; o_outbitbuf = outbitbuf; \ + owbuf = wbuf = n_owbuf; \ + outbitcnt = BITS_IN_BUF; outbitbuf = 0; + +#define POP_BIT_IO \ + n_wbuf = wbuf; \ + n_outbitcnt = outbitcnt; n_outbitbuf = outbitbuf; \ + owbuf = o_owbuf; wbuf = o_wbuf; \ + outbitcnt = o_outbitcnt; outbitbuf = o_outbitbuf; + + PUSH_BIT_IO + + if (picture_structure == FRAME_PICTURE) + switch (macroblock_modes & MOTION_TYPE_MASK) + { + case MC_FRAME: MOTION_CALL (motion_fr_frame, macroblock_modes); break; + case MC_FIELD: MOTION_CALL (motion_fr_field, macroblock_modes); break; + case MC_DMV: MOTION_CALL (motion_fr_dmv, MACROBLOCK_MOTION_FORWARD); break; + } + else + switch (macroblock_modes & MOTION_TYPE_MASK) + { + case MC_FIELD: MOTION_CALL (motion_fi_field, macroblock_modes); break; + case MC_16X8: MOTION_CALL (motion_fi_16x8, macroblock_modes); break; + case MC_DMV: MOTION_CALL (motion_fi_dmv, MACROBLOCK_MOTION_FORWARD); break; + } + + POP_BIT_IO + + // end saving data + +#ifdef STAT + if (picture_coding_type == P_TYPE) cnt_p_ni++; + else if (picture_coding_type == B_TYPE) cnt_b_ni++; +#endif + new_quantizer_scale = getNewQuant(quantizer_scale, 0); + + if (macroblock_modes & MACROBLOCK_PATTERN) + { + int coded_block_pattern = get_coded_block_pattern (); + + mb_sav_lev = 0xFFFF; + curTable = quant_tables[quant_equ[quantizer_scale]][quant_equ[new_quantizer_scale]]; + if (!curTable) + { + /*DEBF("Inv. curTable: qs: %i nqs: %i qe_qs: %i qe_nqs: %i\n", + quantizer_scale, new_quantizer_scale, + quant_equ[quantizer_scale], quant_equ[new_quantizer_scale]);*/ + curTable = quant_table_id; + } + + if (coded_block_pattern & 0x20) { slice_non_intra_DCT(0); if (isNotEmpty(block[0])) new_coded_block_pattern |= 0x20; } + if (coded_block_pattern & 0x10) { slice_non_intra_DCT(1); if (isNotEmpty(block[1])) new_coded_block_pattern |= 0x10; } + if (coded_block_pattern & 0x08) { slice_non_intra_DCT(2); if (isNotEmpty(block[2])) new_coded_block_pattern |= 0x08; } + if (coded_block_pattern & 0x04) { slice_non_intra_DCT(3); if (isNotEmpty(block[3])) new_coded_block_pattern |= 0x04; } + if (coded_block_pattern & 0x02) { slice_non_intra_DCT(4); if (isNotEmpty(block[4])) new_coded_block_pattern |= 0x02; } + if (coded_block_pattern & 0x01) { slice_non_intra_DCT(5); if (isNotEmpty(block[5])) new_coded_block_pattern |= 0x01; } +#ifdef P_FRAME_NON_INTRA_DROP + if (picture_coding_type == P_TYPE) new_quantizer_scale = quantizer_scale; +#endif + if (!new_coded_block_pattern) + { + macroblock_modes &= 0xFFFFFFED; // remove MACROBLOCK_PATTERN and MACROBLOCK_QUANT flag + if ( (picture_coding_type == P_TYPE) + && !(macroblock_modes & MACROBLOCK_MOTION_FORWARD)) + { + assert(n_wbuf == n_owbuf); + assert(n_outbitcnt == BITS_IN_BUF); + + if ((h_offset == 0) || (h_offset == horizontal_size_value - 16)) // can't skip last mb + { + // we can't transmit mv (0,0) since PMV could be different than 0 for last block + // so we transmit the single smallest coeff. instead unrequantised + // anyway this is likely to take no more bit than transmiting a null mv.... + + assert((mb_sav_lev) && (mb_sav_lev != 0xFFFF)); + + new_coded_block_pattern = 1 << (5 - mb_sav_c); + macroblock_modes |= MACROBLOCK_PATTERN; + new_quantizer_scale = quantizer_scale; + block[mb_sav_c][0].run = mb_sav_run; block[mb_sav_c][0].level = mb_sav_lev; + block[mb_sav_c][1].run = 0; block[mb_sav_c][1].level = 0; + } + else + { + mb_skip += mb_add; + goto skip_mb; + } + } + } + } + + if (last_coded_scale == new_quantizer_scale) macroblock_modes &= 0xFFFFFFEF; // remove MACROBLOCK_QUANT + else if (macroblock_modes & MACROBLOCK_PATTERN) macroblock_modes |= MACROBLOCK_QUANT; //add MACROBLOCK_QUANT + assert( (macroblock_modes & MACROBLOCK_PATTERN) || !(macroblock_modes & MACROBLOCK_QUANT) ); + + putaddrinc(mb_add + mb_skip); mb_skip = 0; + putmbdata(macroblock_modes); + if (macroblock_modes & MACROBLOCK_QUANT) put_quantiser(new_quantizer_scale); + + // put saved motion data... + for (batb = 0; batb < (n_wbuf - n_owbuf); batb++) putbits(n_owbuf[batb], 8); + putbits(n_outbitbuf, BITS_IN_BUF - n_outbitcnt); + // end saved motion data... + + if (macroblock_modes & MACROBLOCK_PATTERN) + { + putcbp(new_coded_block_pattern); + + if (new_coded_block_pattern & 0x20) putnonintrablk(block[0]); + if (new_coded_block_pattern & 0x10) putnonintrablk(block[1]); + if (new_coded_block_pattern & 0x08) putnonintrablk(block[2]); + if (new_coded_block_pattern & 0x04) putnonintrablk(block[3]); + if (new_coded_block_pattern & 0x02) putnonintrablk(block[4]); + if (new_coded_block_pattern & 0x01) putnonintrablk(block[5]); + } + } + + skip_mb: + + NEXT_MACROBLOCK; + + mba_inc = 0; + while (1) + { + if (bit_buf >= 0x10000000) + { + mba = MBA_5 + (UBITS (bit_buf, 5) - 2); + break; + } + else if (bit_buf >= 0x03000000) + { + mba = MBA_11 + (UBITS (bit_buf, 11) - 24); + break; + } + else + switch (UBITS (bit_buf, 11)) + { + case 8: /* macroblock_escape */ + mba_inc += 33; + DUMPBITS (bit_buf, bits, 11); + continue; + default: /* end of slice, or error */ + //LOGF("hoffset: %i, hsv: %i, curo: %i\n", h_offset, horizontal_size_value, (int)outbytecnt + (wbuf - owbuf)); + if (h_offset != 0) + sliceError++; + return; + } + } + DUMPBITS (bit_buf, bits, mba->len); //PPP + + mba_inc += mba->mba; + mb_add = mba_inc + 1; + +#ifdef CHANGE_BRIGHTNESS + if (mba_inc) dc_reset = 1; +#endif + + if (mba_inc) do { NEXT_MACROBLOCK; } + while (--mba_inc); + } + +} + +/////---- end ext mpeg code + +void k9requant::run () +{ + uint8 ID, found; + int64 greedyFactor, greedyFactor2; + int i; + +#ifdef DEMO + gopCount = 0; +#endif + +#ifdef LOG_RATE_CONTROL + LOG_FILE = fopen("Logfile.txt", "w"); +#endif + +#ifdef STAT + ori_i = ori_p = ori_b = 0; + new_i = new_p = new_b = 0; + cnt_i = cnt_p = cnt_b = 0; + cnt_p_i = cnt_p_ni = 0; + cnt_b_i = cnt_b_ni = 0; +#endif + +#ifdef USE_FD + if (argc < 3) { USAGE } + ifd = fopen(argv[argc - 2], "rb"); + ofd = fopen(argv[argc - 1], "wb"); + if (!ifd) + { + LOGF("Bad input path! (%s)\n", argv[argc - 2]); + return 2; + } + if (!ofd) + { + LOGF("Bad output path! (%s)\n", argv[argc - 1]); + return 2; + } + argc -= 2; +#endif + +#ifndef THREAD + rbuf = cbuf = orbuf = malloc(BUF_SIZE); + wbuf = owbuf = malloc(BUF_SIZE); + inbytecnt = outbytecnt = 0; + eof = 0; +#endif + + validPicHeader = 0; + validSeqHeader = 0; + validExtHeader = 0; + +#ifndef THREAD + // argument parsing +#ifdef CHANGE_BRIGHTNESS + if (argc < 5) { USAGE } + delta_bright = atoi(argv[4]); +#else + if (argc < 4) { USAGE } +#endif + fact_x = atof(argv[1]); + sscanf(argv[3], "%lld", &orim2vsize); +#endif + +#ifdef THREAD + orim2vsize=rqt_visize; + fact_x = rqt_fact; +#endif + + greedyFactor = orim2vsize / 100; + greedyFactor2 = orim2vsize / 50; + +#ifndef THREAD + if (fact_x <= 1.0) + { + unsigned char buf[4096]; + + while(1) + { + int i = read(0, buf, 4096); + if (i > 0) write(1, buf, i); + else return 0; + } + } + +#endif + if (fact_x > 10.0) fact_x = 10.0; + + // factor and stresses setting + initRequant(); + + // fill quant table + // id table + for (i = -2048; i <= 2047; i++) quant_table_id[i] = i; + + // other tables + for (i = 0; i < 42; i++) + { + int q = quantisers[i]; + int j; + + for (j = i + 1; j < 42; j++) + { + int nq = quantisers[j]; + int k; + short *cTab = quant_tables[quant_equ[q]][quant_equ[nq]]; + + for (k = -2048; k <= 2047; k++) + { + int ov = k*q; + int t = ov / nq; + + if (fact_x <= max_alt_table) + { + int t2, t3; + int d, d2, d3; + int nv, nv2, nv3; + + t2 = t + 1; + t3 = t - 1; + + nv = t * nq; + nv2 = t2 * nq; + nv3 = t3 * nq; + + d = abs(nv - ov); + d2 = abs(nv2 - ov); + d3 = abs(nv3 - ov); + + if (d2 < d) { d = d2; t = t2; } + if (d3 < d) t = t3; + } + + if (t > 2047) t = 2047; + else if (t < -2048) t = -2048; + + cTab[k] = t; + } + } + } + +#ifndef THREAD + LOG("M2VRequantiser by Makira.\n"); +#ifdef WIN + fprintf(stderr, "Using %f as factor, %lld as m2v size.\n", fact_x, orim2vsize); +#else + LOGF("Using %f as factor, %lld as m2v size.\n", fact_x, orim2vsize); +#endif +#endif + + // recoding + while(1) + { + // get next start code prefix + found = 0; + while (!found) + { +#ifndef REMOVE_BYTE_STUFFING + LOCK(3) +#else + LOCK(8) + if ( (cbuf[7] == 0) && (cbuf[6] == 0) && (cbuf[5] == 0) && (cbuf[4] == 0) + && (cbuf[3] == 0) && (cbuf[2] == 0) && (cbuf[1] == 0) && (cbuf[0] == 0) ) { SEEKR(1) } + else +#endif + if ( (cbuf[0] == 0) && (cbuf[1] == 0) && (cbuf[2] == 1) ) found = 1; // start code ! + else { COPY(1) } // continue search + } + COPY(3) + + // get start code + LOCK(1) + ID = cbuf[0]; + COPY(1) + + if (ID == 0x00) // pic header + { + LOCK(4) + picture_coding_type = (cbuf[1] >> 3) & 0x7; + if (picture_coding_type < 1 || picture_coding_type > 3) + { + DEBF("illegal picture_coding_type: %i\n", picture_coding_type); + validPicHeader = 0; + } + else + { + validPicHeader = 1; + cbuf[1] |= 0x7; cbuf[2] = 0xFF; cbuf[3] |= 0xF8; // vbv_delay is now 0xFFFF + } + + validExtHeader = 0; + + COPY(4) + } + else if (ID == 0xB3) // seq header + { + LOCK(8) + horizontal_size_value = (cbuf[0] << 4) | (cbuf[1] >> 4); + vertical_size_value = ((cbuf[1] & 0xF) << 8) | cbuf[2]; + if ( horizontal_size_value > 720 || horizontal_size_value < 352 + || vertical_size_value > 576 || vertical_size_value < 480 + || (horizontal_size_value & 0xF) || (vertical_size_value & 0xF)) + { + DEBF("illegal size, hori: %i verti: %i\n", horizontal_size_value, vertical_size_value); + validSeqHeader = 0; + } + else + validSeqHeader = 1; + + validPicHeader = 0; + validExtHeader = 0; + + COPY(8) + } + else if (ID == 0xB5) // extension + { + LOCK(1) + if ((cbuf[0] >> 4) == 0x8) // pic coding ext + { + LOCK(5) + + f_code[0][0] = (cbuf[0] & 0xF) - 1; + f_code[0][1] = (cbuf[1] >> 4) - 1; + f_code[1][0] = (cbuf[1] & 0xF) - 1; + f_code[1][1] = (cbuf[2] >> 4) - 1; + + intra_dc_precision = (cbuf[2] >> 2) & 0x3; + picture_structure = cbuf[2] & 0x3; + frame_pred_frame_dct = (cbuf[3] >> 6) & 0x1; + concealment_motion_vectors = (cbuf[3] >> 5) & 0x1; + q_scale_type = (cbuf[3] >> 4) & 0x1; + intra_vlc_format = (cbuf[3] >> 3) & 0x1; + alternate_scan = (cbuf[3] >> 2) & 0x1; + + if ( (f_code[0][0] > 8 && f_code[0][0] < 14) + || (f_code[0][1] > 8 && f_code[0][1] < 14) + || (f_code[1][0] > 8 && f_code[1][0] < 14) + || (f_code[1][1] > 8 && f_code[1][1] < 14) + || picture_structure == 0) + { + DEBF("illegal ext, f_code[0][0]: %i f_code[0][1]: %i f_code[1][0]: %i f_code[1][1]: %i picture_structure:%i\n", + f_code[0][0], f_code[0][1], f_code[1][0], f_code[1][1], picture_structure); + validExtHeader = 0; + } + else + validExtHeader = 1; + COPY(5) + } + else + { + COPY(1) + } + } + else if (ID == 0xB8) // gop header + { + LOCK(4) + COPY(4) + +#ifdef DEMO + gopCount++; +#endif + } + else if ((ID >= 0x01) && (ID <= 0xAF) && validPicHeader && validSeqHeader && validExtHeader) // slice + { + uint8 *outTemp = wbuf, *inTemp = cbuf; + int64 threshold; + + bytediff = (outbytecnt + (wbuf - owbuf)) - ((inbytecnt - (rbuf - cbuf)) / fact_x); + + + if (inbytecnt < greedyFactor2) threshold = inbytecnt >> 1; + else if (orim2vsize - inbytecnt < greedyFactor2) threshold = (orim2vsize - inbytecnt) >> 1; + else threshold = greedyFactor; + + if (threshold < 1024) threshold = 1024; + + stress_factor = (float)(bytediff + threshold) / (float)(threshold << 1); + if (stress_factor > 1.0f) stress_factor = 1.0f; + else if (stress_factor < 0.0f) stress_factor = 0.0f; + + +#ifdef LOG_RATE_CONTROL + /*fprintf(LOG_FILE, "%f%%: Requested: %f Current: %f Delta: %lld Threshold: %f Stress: %f\n", + (float)(100.0f*inbytecnt)/orim2vsize, // percent + (float)fact_x, // requested + (float)(inbytecnt - (rbuf - cbuf))/(float)(outbytecnt + (wbuf - owbuf)), // current + (long long)bytediff, // delta + (float)threshold, // threshold + stress_factor // Stress + );*/ + fprintf(LOG_FILE, "inb: %.0f inb_c: %.0f oub: %.0f oub_c: %.0f cur: %.3f dif: %.0f thr: %.0f str: %.03f\n", + (float)inbytecnt, + (float)(inbytecnt - (rbuf - cbuf)), + (float)outbytecnt, + (float)(outbytecnt + (wbuf - owbuf)), + (float)(inbytecnt - (rbuf - cbuf))/(float)(outbytecnt + (wbuf - owbuf)), + (float)bytediff, + (float)threshold, + (float)stress_factor ); +#endif + + +#ifndef CHANGE_BRIGHTNESS + if ( ((picture_coding_type == I_TYPE) && ( stress_factor > i_min_stress)) + || ((picture_coding_type == P_TYPE) && ( stress_factor > p_min_stress)) + || ((picture_coding_type == B_TYPE) && ( stress_factor > b_min_stress)) +#ifdef DEMO + || ((gopCount & 0x7F) < 10) +#endif + ) +#endif + { + // init error + sliceError = 0; + + // init bit buffer + inbitbuf = 0; inbitcnt = 0; + outbitbuf = 0; outbitcnt = BITS_IN_BUF; + + // get 32 bits + Refill_bits(); + Refill_bits(); + Refill_bits(); + Refill_bits(); + + // begin bit level recoding + mpeg2_slice(ID); + flush_read_buffer(); + flush_write_buffer(); + // end bit level recoding + +#ifndef CHANGE_BRIGHTNESS + if ((wbuf - outTemp > cbuf - inTemp) || (sliceError > MAX_ERRORS)) // yes that might happen, rarely + { +#ifndef NDEBUG + if (sliceError > MAX_ERRORS) + { + DEBF("sliceError (%i) > MAX_ERRORS (%i)\n", sliceError, MAX_ERRORS); + } +#endif + + // in this case, we'll just use the original slice ! + tc_memcpy(outTemp, inTemp, cbuf - inTemp); + wbuf = outTemp + (cbuf - inTemp); + + // adjust outbytecnt + outbytecnt -= (wbuf - outTemp) - (cbuf - inTemp); + } +#endif + +#ifdef STAT + #ifdef LOG_RATE_CONTROL + if (picture_coding_type == I_TYPE) fprintf(LOG_FILE, "-I-\n"); +#endif + switch(picture_coding_type) + { + case I_TYPE: + ori_i += cbuf - inTemp; + new_i += (wbuf - outTemp > cbuf - inTemp) ? (cbuf - inTemp) : (wbuf - outTemp); + cnt_i ++; + break; + + case P_TYPE: + ori_p += cbuf - inTemp; + new_p += (wbuf - outTemp > cbuf - inTemp) ? (cbuf - inTemp) : (wbuf - outTemp); + cnt_p ++; + break; + + case B_TYPE: + ori_b += cbuf - inTemp; + new_b += (wbuf - outTemp > cbuf - inTemp) ? (cbuf - inTemp) : (wbuf - outTemp); + cnt_b ++; + break; + + default: + assert(0); + break; + } +#endif + } + } + +#ifndef NDEBUG + if ((ID >= 0x01) && (ID <= 0xAF) && (!validPicHeader || !validSeqHeader || !validExtHeader)) + { + if (!validPicHeader) DEBF("missing pic header (%02X)\n", ID); + if (!validSeqHeader) DEBF("missing seq header (%02X)\n", ID); + if (!validExtHeader) DEBF("missing ext header (%02X)\n", ID); + } +#endif +if (rbuf - orbuf > MAX_READ) { MOV_READ } + if (wbuf - owbuf > MIN_WRITE) { WRITE } + } + + +#ifdef LOG_RATE_CONTROL + fclose(LOG_FILE); +#endif + rqt_run=false; + // keeps gcc happy + return ; +} + +void k9requant::initvar() +{ + cbuf = NULL; + rbuf = NULL; + wbuf = NULL; + orbuf = NULL; + owbuf = NULL; + inbitcnt = outbitcnt = 0; + inbitbuf = outbitbuf = 0; + inbytecnt = outbytecnt = 0; + fact_x = 0; + mloka1 = mloka2 = eof = 0; + orim2vsize = 0; + bytediff = 0; + stress_factor = 0; + i_factor = 0; + p_factor = 0; + b_factor = 0; + i_min_stress = 0; + p_min_stress = 0; + b_min_stress = 0; + quant_table_id = &quant_table_id_data[2048]; + horizontal_size_value = 0; + vertical_size_value = 0; + + picture_coding_type = 0; + + memset( f_code,0 , sizeof(f_code)); + intra_dc_precision = 0; + picture_structure = 0; + frame_pred_frame_dct = 0; + concealment_motion_vectors = 0; + q_scale_type = 0; + intra_vlc_format = 0; + alternate_scan = 0; + + validPicHeader = 0; + validSeqHeader = 0; + validExtHeader = 0; + sliceError = 0; + + quantizer_scale = 0; + new_quantizer_scale = 0; + last_coded_scale = 0; + h_offset = v_offset = 0; + mb_skip = mb_add = 0; + mb_out = 0; + + mb_sav_run = mb_sav_lev = mb_sav_c = 0; + curTable = NULL; + memset( block, 0, sizeof(block)); +} + + + +void k9requant::initRequant() { + int i; + if (fact_x <= 1.0) + { + i_factor = i_factors[0]; + p_factor = p_factors[0]; + b_factor = b_factors[0]; + i_min_stress = i_min_stresses[0]; + p_min_stress = p_min_stresses[0]; + b_min_stress = b_min_stresses[0]; + } + else if (fact_x >= 10.0) + { + i_factor = i_factors[2]; + p_factor = p_factors[2]; + b_factor = b_factors[2]; + i_min_stress = i_min_stresses[2]; + p_min_stress = p_min_stresses[2]; + b_min_stress = b_min_stresses[2]; + } + else if (fact_x <= 3.0) // 1.0 .. 3.0 + { + double inter = (fact_x - 1.0)/(3.0 - 1.0); + i_factor = i_factors[0] + inter * (i_factors[1] - i_factors[0]); + p_factor = p_factors[0] + inter * (p_factors[1] - p_factors[0]); + b_factor = b_factors[0] + inter * (b_factors[1] - b_factors[0]); + i_min_stress = i_min_stresses[0] + inter * (i_min_stresses[1] - i_min_stresses[0]); + p_min_stress = p_min_stresses[0] + inter * (p_min_stresses[1] - p_min_stresses[0]); + b_min_stress = b_min_stresses[0] + inter * (b_min_stresses[1] - b_min_stresses[0]); + } + else // 3.0 .. 10.0 + { + double inter = (fact_x - 3.0)/(10.0 - 3.0); + i_factor = i_factors[1] + inter * (i_factors[2] - i_factors[1]); + p_factor = p_factors[1] + inter * (p_factors[2] - p_factors[1]); + b_factor = b_factors[1] + inter * (b_factors[2] - b_factors[1]); + i_min_stress = i_min_stresses[1] + inter * (i_min_stresses[2] - i_min_stresses[1]); + p_min_stress = p_min_stresses[1] + inter * (p_min_stresses[2] - p_min_stresses[1]); + b_min_stress = b_min_stresses[1] + inter * (b_min_stresses[2] - b_min_stresses[1]); + } + + /*LOGF( "i_factor: %i p_factor: %i b_factor: %i\n" + "i_min_stress: %.02f p_min_stress: %.02f b_min_stress: %.02f\n", + i_factor, p_factor, b_factor, + i_min_stress, p_min_stress, b_min_stress);*/ + + + +} + +bool k9requant::lock( int64 x) { + if (unlikely ((x) > (rbuf - cbuf))) + { + if (likely (wbuf)) + { + QMutexLocker locker( &mutw ); + //mutw.lock(); + rqt_wcnt = wbuf - owbuf; + condw.wakeAll(); + //mutw.unlock(); + } + //mutr.lock(); + QMutexLocker locker( &mutr ); + while (!rqt_rcnt) + { + condr.wait( &mutr); + if (rqt_stop==true) { + //mutr.unlock(); + return false; + } + } + cbuf = rqt_rptr; //src buffer + rbuf =orbuf = cbuf; + rbuf += rqt_rcnt + 3; // end of src buffer + rqt_rcnt = 0; + owbuf = rqt_wptr; // dest buffer + inbytecnt = rqt_inbytes; + outbytecnt = rqt_outbytes; + orim2vsize = rqt_visize; + //mutr.unlock(); + wbuf = owbuf; + if ( fact_x < rqt_fact) { + fact_x=rqt_fact; + initRequant(); + } + fact_x=rqt_fact; + } + + return true; + +} + + + diff --git a/k9vamps/k9requant.h b/k9vamps/k9requant.h new file mode 100644 index 0000000..2832c06 --- /dev/null +++ b/k9vamps/k9requant.h @@ -0,0 +1,278 @@ +// +// C++ Interface: k9requant +// +// Description: A transcription from m2vrequantizer in C++ +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9REQUANT_H +#define K9REQUANT_H +#include "k9common.h" + + +#include +#include +#include + + +// user defined types +//typedef unsigned int uint; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; +typedef unsigned long long uint64; + +typedef char int8; +typedef short int16; +typedef int int32; +typedef long long int64; + + +typedef signed int sint; +typedef signed char sint8; +typedef signed short sint16; +typedef signed int sint32; +#ifdef WIN +typedef __int64 sint64; +#else +typedef signed long long sint64; +#endif + +#define BITS_IN_BUF (8) + +// block data +typedef struct { + uint8 run; + short level; +} +RunLevel; +/* +#define BUF_SIZE (16*1024*1024) +#define MIN_READ (4*1024*1024) +#define MIN_WRITE (8*1024*1024) +#define MAX_READ (10*1024*1024) +*/ + + +// keep gcc happy +#define WRITE \ + orbuf = orbuf; \ + mloka1 = mloka1; \ + mloka2 = mloka2; \ + eof = eof; + +// meaningless +#define MIN_WRITE 0 +#define MAX_READ 0 +#define MOV_READ + +// this is where we switch threads +#define LOCK(x) if (! lock(x)) {rqt_run=false;return;} + +#define COPY(x) \ + tc_memcpy (wbuf, cbuf, x); \ + cbuf += x; \ + wbuf += x; + +#define SEEKR(x) cbuf += x; + +#define SEEKW(x) wbuf += x; + + +/** + @author Jean-Michel PETIT +*/ +class k9requant : public QThread { +private: + + int inbitcnt, outbitcnt; + uint32 inbitbuf, outbitbuf; + uint64 inbytecnt, outbytecnt; + float fact_x; + int mloka1, mloka2, eof; + + int64 orim2vsize; + int64 bytediff; + double stress_factor; // from 0.0 to 1.0 + + int i_factor; + int p_factor; + int b_factor; + double i_min_stress; + double p_min_stress; + double b_min_stress; + + short quant_table_id_data[4096]; + short *quant_table_id ; + +#ifdef USE_FD + + FILE *ifd, *ofd; +#endif + +#ifdef STAT + + uint64 ori_i, ori_p, ori_b; + uint64 new_i, new_p, new_b; + uint64 cnt_i, cnt_p, cnt_b; + uint64 cnt_p_i, cnt_p_ni; + uint64 cnt_b_i, cnt_b_ni; +#endif + +#ifdef DEMO + + int gopCount; +#endif + +#ifdef LOG_RATE_CONTROL + + FILE* LOG_FILE; +#endif + +#ifdef CHANGE_BRIGHTNESS + + int delta_bright; + int dc_reset; + int old_dc_pred, new_dc_pred; +#endif + + // mpeg2 state + // seq header + uint horizontal_size_value; + uint vertical_size_value; + + // pic header + uint picture_coding_type; + + // pic code ext + uint f_code[2][2]; + uint intra_dc_precision; + uint picture_structure; + uint frame_pred_frame_dct; + uint concealment_motion_vectors; + uint q_scale_type; + uint intra_vlc_format; + uint alternate_scan; + + // error + int validPicHeader; + int validSeqHeader; + int validExtHeader; + int sliceError; + + // slice or mb + uint quantizer_scale; + uint new_quantizer_scale; + uint last_coded_scale; + int h_offset, v_offset; + int mb_skip, mb_add; + int mb_out; + + int mb_sav_run, mb_sav_lev, mb_sav_c; + short *curTable; + + RunLevel block[6][65]; // terminated by level = 0, so we need 64+1 +private: + void putbits(uint val, int n); + void Refill_bits(void); + + void Flush_Bits(uint n); + uint Show_Bits(uint n); + uint Get_Bits(uint n); + + uint Copy_Bits(uint n); + void flush_read_buffer(); + void flush_write_buffer(); + int scale_quant(double quant ); + int increment_quant(int quant); + int intmax( register int x, register int y ); + + int intmin( register int x, register int y ); + void putmbtype(int mb_type); + + int getNewQuant(int curQuant, int intra); + + int isNotEmpty(RunLevel *blk); + + + // return != 0 if error + int putAC(int run, int signed_level, int vlcformat); + // return != 0 if error + int putACfirst(int run, int val); + void putnonintrablk(RunLevel *blk); + void putcbp(int cbp); + + int get_macroblock_modes (); + int get_quantizer_scale (); + void get_motion_delta (const int f_code); + void get_dmv (); + int get_coded_block_pattern (); + int get_luma_dc_dct_diff (); + int get_chroma_dc_dct_diff (); + void get_intra_block_B14 (); + void get_intra_block_B15 (); + int get_non_intra_block_rq (RunLevel *blk); + int get_non_intra_block_sav (RunLevel *blk, int cc); + +#ifdef P_FRAME_NON_INTRA_DROP + + int get_non_intra_block_drop (RunLevel *blk, int cc); +#endif + +#ifdef CHANGE_BRIGHTNESS + + void putDC(const sVLCtable *tab, int val); +#endif + + void slice_intra_DCT (const int cc); + void slice_non_intra_DCT (int cur_block); + void motion_fr_frame ( uint f_code[2] ); + void motion_fr_field ( uint f_code[2] ); + void motion_fr_dmv ( uint f_code[2] ); + void motion_fr_conceal ( ); + void motion_fi_field ( uint f_code[2] ); + void motion_fi_16x8 ( uint f_code[2] ); + void motion_fi_dmv ( uint f_code[2] ); + void motion_fi_conceal (); + void putmbdata(int macroblock_modes); + void put_quantiser(int quantiser); + void putaddrinc(int addrinc); + int slice_init (int code); + void mpeg2_slice ( const int code ); + void initRequant(); + bool lock(int64 x); + +protected: + void run (); + +public: + uint8 *cbuf, *rbuf, *wbuf, *orbuf, *owbuf; + // global data for inter thread com + float rqt_fact; + uint32_t rqt_rcnt; + uint32_t rqt_wcnt; + uint64_t rqt_inbytes; + uint64_t rqt_outbytes; + uint64_t rqt_visize; + uchar *rqt_rptr; + uchar *rqt_wptr; + QWaitCondition condr; + QWaitCondition condw; + QMutex mutr; + QMutex mutw; + bool rqt_stop; + bool rqt_run; + + +public: + k9requant(); + void initvar(); +}; + + + +#endif diff --git a/k9vamps/k9requant2.h b/k9vamps/k9requant2.h new file mode 100755 index 0000000..e28336f --- /dev/null +++ b/k9vamps/k9requant2.h @@ -0,0 +1,126 @@ +#include +#include "k9fifo.h" + +#ifndef K9REQUANT2_H +#define K9REQUANT2_H + + +class k9Requant2 +{ +public: + void setInput(char *data,int size); + void setOutput(char*data,int size); + uint64_t getOutByteCnt() { return outbytecnt-outbytecnt1;}; + void setFactor(float fact); + void run(); + k9Requant2(); + ~k9Requant2(); +private: + QBuffer m_buffIn,m_buffOut; + QByteArray m_baIn,m_baOut; + + char *m_dataIn,*m_dataOut; + int m_sizeIn,m_sizeOut; + + // mpeg2 state + // seq header + uint horizontal_size_value; + uint vertical_size_value; + + // pic header + uint picture_coding_type; + + // pic code ext + uint f_code[2][2]; + uint intra_dc_precision; + uint picture_structure; + uint frame_pred_frame_dct; + uint concealment_motion_vectors; + uint q_scale_type; + uint intra_vlc_format; + uint alternate_scan; + + // error + int validPicHeader; + int validSeqHeader; + int validExtHeader; + int sliceError; + + // slice or mb + uint quantizer_scale; + uint new_quantizer_scale; + uint last_coded_scale; + int h_offset, v_offset; + + // rate + double quant_corr; + + // block data + typedef struct + { + uint8_t run; + short level; + } RunLevel; + RunLevel block[6][65]; // terminated by level = 0, so we need 64+1 + // end mpeg2 state + // global variables + uint8_t *cbuf, *rbuf, *wbuf, *orbuf, *owbuf; + int inbitcnt, outbitcnt; + uint32_t inbitbuf, outbitbuf; + uint64_t inbytecnt, outbytecnt,outbytecnt1; + float fact_x; + int mloka1; + + /////---- begin ext mpeg code + +private: + void putbits(uint val, int n); + void Refill_bits(void); + uint Show_Bits(uint n); + uint Get_Bits(uint n); + uint Copy_Bits(uint n); + void flush_read_buffer(); + void flush_write_buffer(); + int scale_quant(double quant); + int increment_quant(int quant); + int intmax( register int x, register int y ); + int intmin( register int x, register int y ); + int getNewQuant(int curQuant); + int isNotEmpty(RunLevel *blk); + int putAC(int run, int signed_level, int vlcformat); + int putACfirst(int run, int val); + void putnonintrablk(RunLevel *blk); + void putcbp(int cbp); + void putmbtype(int mb_type); + int get_macroblock_modes (); + int get_quantizer_scale (); + int get_motion_delta (const int f_code); + int get_dmv (); + int get_coded_block_pattern (); + int get_luma_dc_dct_diff (); + int get_chroma_dc_dct_diff (); + void get_intra_block_B14 (); + void get_intra_block_B15 (); + int get_non_intra_block_drop (RunLevel *blk); + int get_non_intra_block_rq (RunLevel *blk); + void slice_intra_DCT (const int cc); + void slice_non_intra_DCT (int cur_block); + void motion_fr_frame ( uint f_code[2] ); + void motion_fr_field ( uint f_code[2] ); + void motion_fr_dmv ( uint f_code[2] ); + void motion_fr_conceal ( ); + void motion_fi_field ( uint f_code[2] ); + void motion_fi_16x8 ( uint f_code[2] ); + void motion_fi_dmv ( uint f_code[2] ); + void motion_fi_conceal (); + + void putmbdata(int macroblock_modes); + void put_quantiser(int quantiser); + int slice_init (int code); + void mpeg2_slice ( const int code ); + void Flush_Bits(uint); + void init(); +protected: +}; + +#endif diff --git a/k9vamps/k9vamps.cpp b/k9vamps/k9vamps.cpp new file mode 100755 index 0000000..b077fb8 --- /dev/null +++ b/k9vamps/k9vamps.cpp @@ -0,0 +1,1100 @@ +// +// C++ Interface: k9vamps +// +// Description: A transcription from Vamps in C++ +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "k9vamps.h" +#include +#include "ac.h" + + +void k9vamps::setNoData() { + noData=true; + wDataRead.wakeAll(); + wDataReady.wakeAll(); +} + +void k9vamps::addData(uchar *data,uint size) { + while (1) { + if (m_fifo.freespace()>=size) { + m_fifo.enqueue(data,size); + wDataReady.wakeAll(); + break; + } else + wDataRead.wait(); + } +} + + +int k9vamps::readData(uchar * data,uint size) { + uint size2=size; + uint32_t readSize=0,s=0; + + while (1) { + // is there data in the buffer? + if (m_fifo.count() >0) { + // s= size of data that we will read (maximum = size) + s=(m_fifo.count()) =size2)) { + break; + } else + wDataReady.wait(); + } + // if there's datas in input buffer and we did not get all what we wanted, we take them. + s= (m_fifo.count()) 0 ) + m_fifo.dequeue(data,s); + + wDataRead.wakeAll(); + return readSize; +} + +void k9vamps::addSubpicture(uint id) { + int cpt=1; + for (uint i=0;i<32;i++) + if (spu_track_map[i]!=0) cpt++; + spu_track_map[id-1]=cpt; +} + +void k9vamps::addAudio(uint id) { + int cpt=1; + for (uint i=0;i <8;i++) + if (audio_track_map[i] !=0) cpt++; + + audio_track_map[id-1]=cpt; +} + +void k9vamps::addAudio(uint id,uint newId) { + if (newId==0) + addAudio(id); + else + audio_track_map[id-1]=newId; +} + + +void k9vamps::setInputSize(uint64_t size) { + ps_size=size; +} + +void k9vamps::setVapFactor(float factor) { + vap_fact=factor; +} + +void k9vamps::setSaveImage(k9SaveImage *m_save) { + m_saveImage=m_save; +} + +void k9vamps::reset() { + m_preserve=true; + bytes_read =0; + bytes_written=0; + padding_bytes=0; + total_packs=0; + video_packs=0; + skipped_video_packs=0; + aux_packs=0; + skipped_aux_packs=0; + sequence_headers=0; + nav_packs=0; + + rptr = rbuf; + rhwp = rbuf; + wptr = wbuf; + vbuf_size = VBUF_SIZE; + vap_fact= 1.0f; + + // inbuffw=inbuff; + for (uint i=0; i<8;i++) { + audio_track_map[i]=0; + } + for (uint i=0; i<32;i++) { + spu_track_map[i]=0; + } + + calc_ps_vap = 1; + vap_fact=1.0; + ps_size=0; + noData=false; + + avgdiff=1; + m_totfact=m_nbfact=m_avgfact=0; + + vin_bytes=0; + vout_bytes=0; + +} + +k9vamps::k9vamps(k9DVDBackup *dvdbackup) { + m_saveImage=NULL; + m_dvdbackup=dvdbackup; + reset(); + m_requant=NULL; + if (dvdbackup !=NULL) + m_bgUpdate = new k9bgUpdate(dvdbackup); + else + m_bgUpdate=NULL; + rbuf_size= RBUF_SIZE; + rbuf = (uchar*) malloc(rbuf_size);; + m_output=NULL; +} + + +void k9vamps::setPreserve(bool _value) { + m_preserve = _value; +} +void k9vamps::setOutput(QFile *_output) { + m_output=_output; +} + +k9vamps::~k9vamps() { + if (m_bgUpdate !=NULL) + delete m_bgUpdate; + free (rbuf); +} + + +void k9vamps::run () { + m_error=false; + m_errMsg=""; + m_requant=new k9requant(); + eof=0; + + // allocate video buffers + vibuf =(uchar*) malloc (vbuf_size); + vobuf = (uchar*) malloc (vbuf_size); + + if (vibuf == NULL || vobuf == NULL) + fatal (QString("Allocation of video buffers failed: %1").arg(strerror (errno))); + + + // actually do vaporization + vaporize (); + + + flush(); + + if (m_requant !=NULL) { + m_requant->rqt_stop=true; + while(m_requant->running()) { + m_requant->condr.wakeAll(); + m_requant->condw.wakeAll(); + m_requant->wait(10); + } +// m_requant->mutr.unlock(); +// m_requant->mutw.unlock(); + } + delete m_requant; + m_requant=NULL; + free (vibuf); + free(vobuf); + if (m_bgUpdate!=NULL) + m_bgUpdate->wait(); + //mutex.unlock(); +} + + + +// lock `size' bytes in read buffer +// i.e. ensure the next `size' input bytes are available in buffer +// returns nonzero on EOF +int k9vamps::lock (int size) { + int avail, n; + + avail = rhwp - rptr; + + if (avail >= size) + return 0; + + if (avail) { + tc_memcpy (rbuf, rptr, avail); + rptr = rbuf; + rhwp = rptr + avail; + } + + if (rbuf_size -avail <=0) { + uchar *buffer =(uchar*) malloc (rbuf_size+20480); + tc_memcpy (buffer,rbuf,rbuf_size); + rptr = buffer +(rptr-rbuf); + rhwp=buffer+(rhwp-rbuf); + rbuf_size+=20480; + free(rbuf); + rbuf=buffer; + } + + n = readData(rhwp,rbuf_size - avail); + + if (n % SECT_SIZE) + fatal ("Premature EOF"); + + rhwp += n; + bytes_read += n; + + return !n; +} + + +// copy `size' bytes from rbuf to wbuf +void k9vamps::copy (int size) { + if (!size) + return; + + if ((wptr - wbuf) + size > WBUF_SIZE) + fatal ("Write buffer overflow"); + + tc_memcpy (wptr, rptr, size); + rptr += size; + wptr += size; +} + + +// skip `size' bytes in rbuf +void k9vamps::skip (int size) { + rptr += size; +} + + +// flush wbuf +void k9vamps::flush (void) { + int size; + mutex.lock(); + size = wptr - wbuf; + + if (!size) { + mutex.unlock(); + return; + } + //m_dvdbackup->getOutput(wbuf,size); + // wait for a preceding update to finish + if (m_bgUpdate!=NULL) { + m_bgUpdate->wait(); + m_bgUpdate->update( wbuf,size); + } + if (m_output != NULL) + m_output->writeBlock((const char*) wbuf,size); + if (m_saveImage !=NULL) + m_saveImage->addData(wbuf,size); + wptr = wbuf; + bytes_written += size; + mutex.unlock(); +} + + +// returns no. bytes read up to where `ptr' points +uint64_t k9vamps::rtell (uchar *ptr) { + return bytes_read - (rhwp - ptr); +} + + +// returns no. bytes written up to where `ptr' points +// (including those in buffer which are not actually written yet) +uint64_t k9vamps::wtell (uchar *ptr) { + return bytes_written + (ptr - wbuf); +} + + +// some pack header consistency checking +bool k9vamps::check_pack (uchar *ptr) { + uint32_t pack_start_code; + int pack_stuffing_length; + + pack_start_code = (uint32_t) (ptr [0]) << 24; + pack_start_code |= (uint32_t) (ptr [1]) << 16; + pack_start_code |= (uint32_t) (ptr [2]) << 8; + pack_start_code |= (uint32_t) (ptr [3]); + + if (pack_start_code != 0x000001ba) { +// fatal ("Bad pack start code at %llu: %08lx", rtell (ptr), pack_start_code); + return false; + } + + if ((ptr [4] & 0xc0) != 0x40) { + // fatal ("Not an MPEG2 program stream pack at %llu", rtell (ptr)); + return false; + } + + // we rely on a fixed pack header size of 14 + // so better to ensure this is true + pack_stuffing_length = ptr [13] & 7; + + if (pack_stuffing_length) { + //fatal ("Non-zero pack stuffing length at %llu: %d\n", rtell (ptr), pack_stuffing_length); + return false; + } + + return true; +} + + +// video packet consistency checking +int k9vamps::check_video_packet (uchar *ptr) { + int vid_packet_length, pad_packet_length, rc = 0; + uint32_t vid_packet_start_code, pad_packet_start_code, sequence_header_code; + + vid_packet_start_code = (uint32_t) (ptr [0]) << 24; + vid_packet_start_code |= (uint32_t) (ptr [1]) << 16; + vid_packet_start_code |= (uint32_t) (ptr [2]) << 8; + vid_packet_start_code |= (uint32_t) (ptr [3]); + + if (vid_packet_start_code != 0x000001e0) + fatal(QString ("Bad video packet start code at %1: %2").arg(rtell(ptr)).arg(vid_packet_start_code,0,16)); + + vid_packet_length = ptr [4] << 8; + vid_packet_length |= ptr [5]; + vid_packet_length += 6; + + if ((ptr [6] & 0xc0) != 0x80) + fatal (QString("Not an MPEG2 video packet at %1").arg(rtell (ptr))); + + if (ptr [7]) { + if ((ptr [7] & 0xc0) != 0xc0) + qDebug (QString("First video packet in sequence starting at %1 misses PTS or DTS, flags=%2").arg(rtell (ptr)).arg(ptr [7])); + else { + sequence_header_code = (uint32_t) (ptr [6 + 3 + ptr [8] + 0]) << 24; + sequence_header_code |= (uint32_t) (ptr [6 + 3 + ptr [8] + 1]) << 16; + sequence_header_code |= (uint32_t) (ptr [6 + 3 + ptr [8] + 2]) << 8; + sequence_header_code |= (uint32_t) (ptr [6 + 3 + ptr [8] + 3]); + + if (sequence_header_code == 0x000001b3) { + rc = 1; + } else { + //fprintf (stderr, "Start of GOP at %llu not on sector boundary\n", + // rtell (ptr + 6 + 3 + ptr [8])); + sequence_headers++; + } + } + + } + + pad_packet_length = 0; + + if (14 + vid_packet_length < SECT_SIZE - 6) { + // video packet does not fill whole sector + // check for padding packet + ptr += vid_packet_length; + + pad_packet_start_code = (uint32_t) (ptr [0]) << 24; + pad_packet_start_code |= (uint32_t) (ptr [1]) << 16; + pad_packet_start_code |= (uint32_t) (ptr [2]) << 8; + pad_packet_start_code |= (uint32_t) (ptr [3]); + + if (pad_packet_start_code != 0x000001be) + qDebug (QString("Bad padding packet start code at %1: %2").arg(rtell (ptr + vid_packet_length)).arg(pad_packet_start_code)); + else { + pad_packet_length = ptr [4] << 8; + pad_packet_length |= ptr [5]; + pad_packet_length += 6; + } + } + + // length of video packet plus padding packet must always match sector size + if (14 + vid_packet_length + pad_packet_length != SECT_SIZE) + qDebug (QString("Bad video packet length at %1: %2").arg(rtell (ptr)).arg(vid_packet_length)); + + return rc; +} + + +// here we go +// this is where we switch to the requantization thread +// note that this and the requant thread never run concurrently (apart +// from a very short time) so a dual CPU box does not give an advantage +// returns size of evaporated GOP +int k9vamps::requant (uchar *dst, uchar *src, int n, float fact) { + if (n==0) return 0; + int rv; + if (! m_requant->running()) { + m_requant->initvar(); + } + m_requant->rqt_stop=false; + // this ensures for the requant thread to stop at this GOP's end + tc_memcpy (src + n, "\0\0\1", 3); + + m_requant->mutr.lock(); + + m_requant->rqt_rptr = src; + m_requant->rqt_wptr = dst; + m_requant->rqt_rcnt = n; + m_requant->rqt_wcnt = 0; + m_requant->rqt_fact = fact ; + m_requant->rqt_inbytes = vin_bytes; + m_requant->rqt_outbytes = vout_bytes; + m_requant->rqt_visize = (uint64_t) ((float) ps_size * (float) vin_bytes / ((float) total_packs * (float) SECT_SIZE)); + + // create requantization thread + if (! m_requant->running()) { + m_requant->start(); + m_requant->rqt_run=true; + } + + m_requant->condr.wakeAll(); + m_requant->mutr.unlock(); + + // now the requant thread should be running + + m_requant->mutw.lock(); + + // wait for requant thread to finish + while (!m_requant->rqt_wcnt) + m_requant->condw.wait( &m_requant->mutw); + + rv = m_requant->rqt_wcnt; + + m_requant->mutw.unlock(); +/* if ((m_requant->rbuf-m_requant->cbuf -3) >0 ) { + tc_memcpy(dst+m_requant->rqt_wcnt,m_requant->cbuf,m_requant->rbuf-m_requant->cbuf -3); + rv +=m_requant->rbuf-m_requant->cbuf -3; + } +/*/ + if ((m_requant->rbuf-m_requant->cbuf -2) >0 ) { + tc_memcpy(dst+m_requant->rqt_wcnt,m_requant->cbuf,m_requant->rbuf-m_requant->cbuf -2); + rv +=m_requant->rbuf-m_requant->cbuf -2; + } + + + +// if (rv>n) +// qDebug("requant error"); + + double realrqtfact=(double)(vin_bytes) / (double)(vout_bytes+rv); + avgdiff = ((m_avgfact) /realrqtfact); + + //qDebug ("factor : " +QString::number(m_avgfact) +" --> " +QString::number((float)n/(float)rv) +" avgdiff : " + QString::number(avgdiff) +" rqt_visize :" +QString::number(m_requant->rqt_visize) +" ps_size :" +QString::number(ps_size) + " vin_bytes :" + QString::number(vin_bytes)) ; + + return rv; + +} + + +// translate type of private stream 1 packet +// according to the track translation maps +// returns new track type (e.g. 0x80 for first AC3 audio +// track in cmd line) or zero if track is not to be copied +int k9vamps::new_private_1_type (uchar *ptr) { + int type, track, abase; + + type = ptr [6 + 3 + ptr [8]]; + //fprintf (stderr, "type=%02x\n", type); + + if (type >= 0x20 && type <= 0x3f) { + // subpicture + + track = spu_track_map [type - 0x20]; + + return track ? track - 1 + 0x20 : 0; + } + + if (type >= 0x80 && type <= 0x87) { + // AC3 audio + abase = 0x80; + } else if (type >= 0x88 && type <= 0x8f) { + // DTS audio + abase = 0x88; + } else if (type >= 0xa0 && type <= 0xa7) { + // LPCM audio + abase = 0xa0; + } else { +// fatal ("Unknown private stream 1 type at %llu: %02x", rtell (ptr), type); + abase = 0; + } + + track = audio_track_map [type - abase]; + + return track ? track - 1 + abase : 0; +} + + +// selectivly copy private stream 1 packs +// patches track type to reflect new track +// mapping unless user opted to preserve them +void k9vamps::copy_private_1 (uchar *ptr) { + int type; + + type = new_private_1_type (ptr); + + if (type) { + if (!m_preserve) + ptr [6 + 3 + ptr [8]] = type; + + copy (SECT_SIZE); + + return; + } + + skip (SECT_SIZE); +} + + +// translate ID of MPEG audio packet +// according to the audio track translation map +// returns new ID (e.g. 0xc0 for first MPEG audio +// track in cmd line) or zero if track is not to be copied +int k9vamps::new_mpeg_audio_id (int id) { + int track; + + track = audio_track_map [id - 0xc0]; + + return track ? track - 1 + 0xc0 : 0; +} + + +// selectivly copy MPEG audio packs +// patches ID to reflect new track mapping unless user opted to preserve them +void k9vamps::copy_mpeg_audio (uchar *ptr) { + int id; + + id = new_mpeg_audio_id (ptr [3]); + + if (id) { + if (!m_preserve) + ptr [3] = id; + + copy (SECT_SIZE); + + return; + } + + skip (SECT_SIZE); +} + + +// process beginning of program stream up to +// - but not including - first sequence header +// this PS leader is NOT shrunk since the PS may not +// necessarily begin at a GOP boundary (although it should?) +// nevertheless the unwanted private stream 1 and MPEG audio +// packs are skipped since some players could get confused otherwise +void k9vamps::vap_leader () { + uchar *ptr; + int id, data_length; + + while (!lock (SECT_SIZE)) { + ptr = rptr; + if (check_pack (ptr)) { + ptr += 14; + id = ptr [3]; + } else { + ptr +=14; + id = 0; + } + + switch (id) { + case 0xe0: + // video + if (check_video_packet (ptr)) + // sequence header + return; + + copy (SECT_SIZE); + break; + + case 0xbd: + // private 1: audio/subpicture + copy_private_1 (ptr); + break; + + case 0xc0: + case 0xc1: + case 0xc2: + case 0xc3: + case 0xc4: + case 0xc5: + case 0xc6: + case 0xc7: + // MPEG audio + copy_mpeg_audio (ptr); + break; + + case 0xbb: + // system header/private 2: PCI/DSI + copy (SECT_SIZE); + break; + + case 0xbe: + // padding + data_length = ptr [4] << 8; + data_length |= ptr [5]; + + if (14 + data_length != SECT_SIZE - 6) + fatal (QString("Bad padding packet length at %1: %2").arg(rtell (ptr)).arg(data_length)); + //JMP:à vérifier + skip (SECT_SIZE); + + break; + + default: + // fatal("Encountered stream ID %02x at %llu, " + // "probably bad MPEG2 program stream", id, rtell (ptr)); + copy (SECT_SIZE); + } + + if (wptr == wbuf + WBUF_SIZE) + flush (); + } + + eof = 1; + flush (); + + return; +} + + +// process end of program stream +// the same counts here as for the PS' beginning +void k9vamps::vap_trailer (int length) { + uchar *ptr; + int i, id, data_length; + + for (i = 0; i < length; i += SECT_SIZE) { + ptr = rptr + 14; + id = ptr [3]; + + if (id == 0xbd) { + // private 1: audio/subpicture + copy_private_1 (ptr); + } else if (id >= 0xc0 && id <= 0xc7) { + // MPEG audio + copy_mpeg_audio (ptr); + } else if (id == 0xbe) { + // padding + data_length = ptr [4] << 8; + data_length |= ptr [5]; + + if (14 + data_length != SECT_SIZE - 6) + fatal (QString("Bad padding packet length at %1: %2").arg(rtell (ptr)).arg(data_length)); + skip (SECT_SIZE); + } else { + copy (SECT_SIZE); + } + + if (wptr == wbuf + WBUF_SIZE) + flush (); + } + + flush (); +} + + +// vaporization is split in two phases - this is phase 1 +// PS packs are read into rbuf until a sequence header is found. +// All video packs are unpacketized and the contained video ES +// GOP copied to vibuf. In the same course the private stream 1 +// and MPEG audio packs are inspected and the number of packs +// not to be copied are counted. This is to forecast the video +// vaporization factor in case the user specified a PS shrink factor. +// returns GOP length in bytes +int k9vamps::vap_phase1 (void) { + uchar *ptr, *viptr = vibuf; + int seq_length, id, data_length, opt_length, seqhdr; + + for (seq_length = 0; + !lock (seq_length + SECT_SIZE); seq_length += SECT_SIZE) { + ptr = rptr + seq_length; + if (check_pack (ptr)) { + ptr += 14; + id = ptr [3]; + } else { + ptr += 14; + id = 0; + } + + + // avoid duplicate counts for sequence headers + if (seq_length) + total_packs++; + + switch (id) { + case 0xe0: + // video + seqhdr = check_video_packet (ptr); + + if (seq_length) { + video_packs++; + + if (seqhdr) { + sequence_headers++; + vilen = viptr - vibuf; + + return seq_length; + } + } + + // copy contained video ES fragment to vibuf + data_length = ptr [4] << 8; + data_length |= ptr [5]; + opt_length = 3 + ptr [8]; + data_length -= opt_length; + + if ((viptr - vibuf) + data_length > vbuf_size - 3) { + // reallocate video buffers + int i = viptr - vibuf; + + // grow by another VBUF_SIZE bytes + vbuf_size += VBUF_SIZE; + vibuf = (uchar*)realloc (vibuf, vbuf_size); + vobuf = (uchar*)realloc (vobuf, vbuf_size); + + if (vibuf == NULL || vobuf == NULL) + fatal ("Reallocation of video buffers failed"); + + viptr = vibuf + i; + } + + //fprintf (stderr, "data_length=%d\n", data_length); + tc_memcpy (viptr, ptr + 6 + opt_length, data_length); + viptr += data_length; + break; + + case 0xbd: + // private 1: audio/subpicture + aux_packs++; + + if (!new_private_1_type (ptr)) + skipped_aux_packs++; + + break; + + case 0xc0: + case 0xc1: + case 0xc2: + case 0xc3: + case 0xc4: + case 0xc5: + case 0xc6: + case 0xc7: + // MPEG audio + aux_packs++; + + if (!new_mpeg_audio_id (id)) + skipped_aux_packs++; + + break; + + case 0xbb: + // system header/private 2: PCI/DSI + nav_packs++; + break; + + case 0xbe: + // padding + skipped_aux_packs++; + data_length = ptr [4] << 8; + data_length |= ptr [5]; + + if (14 + data_length != SECT_SIZE - 6) + fatal (QString("Bad padding packet length at %1: %2").arg(rtell (ptr)).arg(data_length)); + + break; + + default: +// fatal("Encountered stream ID %02x at %llu, " +// "probably bad MPEG2 program stream", id, rtell (ptr)); + break; + } + + } + + eof = 1; + + return seq_length; +} + + +// re-packetize the video ES +// `ptr' points to original PES packet where to put the video data +// `voptr' points to first unpacketized byte in vobuf +// `avail' specifies number of bytes remaining in vobuf +// returns number of ES bytes in generated PES packet +int k9vamps::gen_video_packet (uchar *ptr, uchar *voptr, int avail) { + int i, header_data_length, data_length, padding_length; + + // if original PES holds optional data (e.g. DTS/PTS) we must keep it + header_data_length = (ptr [7] & 0xc0) == 0xc0 ? ptr [8] : 0; + data_length = SECT_SIZE - (14 + 6 + 3 + header_data_length); + + if (avail >= data_length) { + // write out a full video packet (usually 2025 byte) + tc_memcpy (ptr + 6 + 3 + header_data_length, voptr, data_length); + ptr [4] = (SECT_SIZE - (14 + 6)) >> 8; + ptr [5] = (SECT_SIZE - (14 + 6)) & 0xff; + ptr [8] = header_data_length; + + return data_length; + } + + if (avail < data_length - 6) { + // write a short video packet and a padding packet + tc_memcpy (ptr + 6 + 3 + header_data_length, voptr, avail); + ptr [4] = (3 + header_data_length + avail) >> 8; + ptr [5] = 3 + header_data_length + avail; + ptr [8] = header_data_length; + + // generate padding packet + ptr += 6 + 3 + header_data_length + avail; + padding_length = data_length - (avail + 6); + padding_bytes += padding_length + 6; + ptr [0] = 0; + ptr [1] = 0; + ptr [2] = 1; + ptr [3] = 0xbe; + ptr [4] = padding_length >> 8; + ptr [5] = padding_length; + + for (i = 0; i < padding_length; i++) + ptr [6+i] = 0xff; + + return avail; + } + + // write a padded video packet (1 to 6 padding bytes) + padding_length = data_length - avail; + padding_bytes += padding_length; + memset (ptr + 6 + 3 + header_data_length, 0xff, padding_length); + header_data_length += padding_length; + tc_memcpy (ptr + 6 + 3 + header_data_length, voptr, avail); + ptr [4] = (SECT_SIZE - (14 + 6)) >> 8; + ptr [5] = (SECT_SIZE - (14 + 6)) & 0xff; + ptr [8] = header_data_length; + + return avail; +} + + +// this is phase 2 of vaporization +// the shrunk video ES is re-packetized by using the source PES packets +// unused PS packs are skipped +// only wanted private stream 1 and MPEG audio packs are copied +// all nav packs are copied +void k9vamps::vap_phase2 (int seq_length) { + int i, id, avail, data_length; + uchar *ptr, *voptr = vobuf, *vohwp = vobuf + volen; + + for (i = 0; i < seq_length; i += SECT_SIZE) { + ptr = rptr + 14; + id = ptr [3]; + + switch (id) { + case 0xe0: + // video + avail = vohwp - voptr; + + if (avail) { + // still some video output data left + voptr += gen_video_packet (ptr, voptr, avail); + copy (SECT_SIZE); + } else { + // no video output data left - skip input sector + skip (SECT_SIZE); + skipped_video_packs++; + } + + break; + + case 0xbd: + // private 1: audio/subpicture + copy_private_1 (ptr); + break; + + case 0xc0: + case 0xc1: + case 0xc2: + case 0xc3: + case 0xc4: + case 0xc5: + case 0xc6: + case 0xc7: + // MPEG audio + copy_mpeg_audio (ptr); + break; + + case 0xbb: + // system header/private 2: PCI/DSI + copy (SECT_SIZE); + break; + + case 0xbe: + // padding + data_length = ptr [4] << 8; + data_length |= ptr [5]; + + if (14 + data_length != SECT_SIZE - 6) + fatal (QString("Bad padding packet length at %1: %2").arg(rtell (ptr)).arg(data_length)); + //JMP: à vérifier + skip (SECT_SIZE); + break; + + default: + copy (SECT_SIZE); +// fatal("Encountered stream ID %02x at %llu, " +// "probably bad MPEG2 program stream", id, rtell (ptr)); + } + + if (wptr == wbuf + WBUF_SIZE) + // end of write buffer reached --> flush it to disk + flush (); + } +} + +QString & k9vamps::geterrMsg() { + return m_errMsg; +} + +bool k9vamps::geterror() { + return m_error; +} + +// entry point from main() +// the requant thread already has been started +void k9vamps::vaporize (void) { + int seq_length; + float fact = vap_fact; + + // process PS up to but not including first sequence header + vap_leader (); + + // just in case - maybe should spit out a warning/error here + if (eof) + return; + + total_packs++; + nav_packs++; + total_packs++; + video_packs++; + + // main loop + while (1) { + // do phase 1 of vaporization + seq_length = vap_phase1 (); + + if (eof) { + // EOF on source PS + // process packs after and including last sequence header + vap_trailer (seq_length); + + // only exit point from main loop + return; + } + + //fprintf (stderr, "seq_length=%d\n", seq_length); + + if (calc_ps_vap && vap_fact > 1.0f) { + // forecast video ES vaporization factor + // the basic formulars look like: + // vap_fact = total_packs/(restpacks+vop) + // restpacks = total_packs-(video_packs+skipped_aux_packs) + // fact = (video_packs*net-(gops*net/2+10))/(vop*net-(gops*net/2+10)) + // net = SECT_SIZE-(14+9) + // 14: pack header size + // 9: PES header size + // 10: PTS+DTS size in PES header of sequence header + // You are welcome to double check everything here! + float vop, net; + net = (float) (SECT_SIZE - (14+9)); + vop = video_packs + skipped_aux_packs - + (float) total_packs * (1.0f-1.0f/vap_fact); + fact = ((float) video_packs * net - + ((float) sequence_headers * net/2.0f + 10.0f)) / + (vop * net - ((float) sequence_headers * net/2.0f + 10.0f)); + + //JMP + m_totfact+=fact ; + m_nbfact++; + m_avgfact=m_totfact/m_nbfact; + + // requant seems to get stuck on factors < 1 + if (fact < 1.0f) + fact = 1.0f; + + if (verbose >= 2) + fprintf (stderr, "Info: Target video ES vaporization factor: %.3f\n", + fact); + } + + vin_bytes += vilen; + + if (fact > 1.0f) { + // do requantization + volen = requant (vobuf, vibuf, vilen, fact); + } else { + // don't do requantization + tc_memcpy (vobuf, vibuf, vilen); + volen = vilen; + } + + vout_bytes += volen; + + // do phase 2 of vaporization + vap_phase2 (seq_length); + + //fprintf (stderr, + // "tot=%d, vid=%d, ps1=%d, nav=%d, sv=%d, sp1=%d, fact=%.3f\n", + // total_packs, video_packs, aux_packs, nav_packs, + // skipped_video_packs, skipped_aux_packs, fact); + } +} + +uint64_t k9vamps::getOutputBytes() { + return bytes_written; +} + +void k9vamps::abort() { + //fatal("vamps stopped"); + setNoData(); + if (m_requant !=NULL) + m_requant->wait(); + if (m_bgUpdate!=NULL) + m_bgUpdate->wait(); +} + +// this is a *very* sophisticated kind of error handling :-) +void +k9vamps::fatal (QString msg) { + m_errMsg=msg; + m_error=true; + if (m_requant !=NULL) + m_requant->terminate(); + if (m_bgUpdate !=NULL) + m_bgUpdate->terminate(); + terminate(); +} + +/**************************** BACKGROUND UPDATE **********************/ + +k9bgUpdate::k9bgUpdate(k9DVDBackup * _backup) { + m_backup = _backup; + +} + +void k9bgUpdate::update(uchar *_buffer,uint32_t _size) { + mutex.lock(); + m_buffer=(uchar*)malloc(_size); + tc_memcpy(m_buffer,_buffer,_size); + m_size=_size; + start(); + mutex.unlock(); +} + +void k9bgUpdate::run() { + m_backup->getOutput(m_buffer,m_size); + free(m_buffer); +} diff --git a/k9vamps/k9vamps.h b/k9vamps/k9vamps.h new file mode 100755 index 0000000..8f0b945 --- /dev/null +++ b/k9vamps/k9vamps.h @@ -0,0 +1,168 @@ +// +// C++ Interface: k9vamps +// +// Description: A transcription from Vamps in C++ +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9VAMPS_H +#define K9VAMPS_H + +#include "k9common.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "k9dvdbackup.h" +#include "k9requant.h" +#include "k9fifo.h" +#include "k9saveimage.h" + +// DVD sector size +#define SECT_SIZE 2048 + +// read buffer size (4MB) +#define RBUF_SIZE (0x1000*1024) + +// write buffer size (4MB) +#define WBUF_SIZE (0x1000*1024) + +// initial video buffer size (1MB) +#define VBUF_SIZE (1024*1024) + + + + +class k9bgUpdate : public QThread +{ +private: + uchar * m_buffer; + k9DVDBackup *m_backup; + uint32_t m_size; + QMutex mutex; +public: + k9bgUpdate(k9DVDBackup * _backup); + void update(uchar *_buffer, uint32_t size); +protected: + void run(); + +}; + + + + +class k9vamps:public QThread +{ +private: + uchar *rbuf;// [RBUF_SIZE]; // the PS read buffer + uchar wbuf [WBUF_SIZE]; // the PS write buffer + uchar *vibuf; // the video ES requant input buffer + uchar *vobuf; // the video ES requant output buffer + uchar *rptr ; // pointer to current char in read buf + uchar *rhwp ; // read buffer high water pointer + uchar *wptr ; // pointer to first unused char in wbuf + uint64_t bytes_read; // total PS bytes read + uint64_t bytes_written; // total PS bytes written + uint64_t padding_bytes; // total padding bytes written + uint64_t vin_bytes; // total unshrinked video ES bytes + uint64_t vout_bytes; // total shrinked video ES bytes + uint64_t ps_size; // total PS size in bytes + uint32_t vbuf_size; // the video ES requant buffers' size + uint32_t rbuf_size; + uint32_t vilen; // current GOP's unshrinked vidES bytes + uint32_t volen; // current GOP's shrinked vidES bytes + int total_packs; // total no. PS packs + int video_packs; // no. video packs in PS + int skipped_video_packs; // skipped thereof + int aux_packs; // no. audio and subpicture packs in PS + int skipped_aux_packs; // skipped thereof + int sequence_headers; // no. sequence headers (== #GOPs) + int nav_packs; // no. nav packs + int eof; // end of file flag + int spu_track_map [32]; // subpicture track# translation map + int audio_track_map [8]; // audio track# translation map + int verbose; // level of verbosity + int calc_ps_vap; // calc vaporization based on PS size + bool m_preserve; // preserve audio/spu track numbers + float vap_fact; // vaporization factor from cmd line + bool noData; + QMutex mutex; + + k9bgUpdate *m_bgUpdate; + k9fifo m_fifo; + QString m_errMsg; + bool m_error; + + double avgdiff; + double m_totfact,m_nbfact,m_avgfact; + QFile *m_output; +private: + // prototypes + void vaporize (void); + void fatal (QString _msg); + int lock(int size); + void copy(int size); + void skip (int size); + void flush(); + uint64_t wtell (uchar *ptr); + + uint64_t rtell (uchar *ptr); + bool check_pack (uchar *ptr); + int check_video_packet (uchar *ptr); + int requant (uchar *dst, uchar *src, int n, float fact); + int new_private_1_type (uchar *ptr); + void copy_private_1 (uchar *ptr); + int new_mpeg_audio_id (int id); + void copy_mpeg_audio (uchar *ptr); + void vap_leader (); + void vap_trailer (int length); + int vap_phase1 (void); + int gen_video_packet (uchar *ptr, uchar *voptr, int avail); + void vap_phase2 (int seq_length); + pthread_t thread; + + int readData(uchar *data,uint size); + + QWaitCondition wDataRead; + QWaitCondition wDataReady; + k9DVDBackup *m_dvdbackup; + k9requant *m_requant; + k9SaveImage *m_saveImage; +protected: + void run(); +public: + k9vamps(k9DVDBackup *dvdbackup); + void addData(uchar* data,uint size); + void setNoData(); + void addSubpicture(uint id); + void addAudio(uint id); + void addAudio(uint id,uint newId); + void reset(); + void setInputSize(uint64_t size); + void setVapFactor(float factor); + void setSaveImage(k9SaveImage*); + void setOutput(QFile *_output); + uint64_t getOutputBytes(); + QString & geterrMsg(); + bool geterror(); + void abort(); + void setPreserve(bool _value); + ~k9vamps(); +}; + + +#endif diff --git a/k9vamps/putvlc.h b/k9vamps/putvlc.h new file mode 100644 index 0000000..d5af62a --- /dev/null +++ b/k9vamps/putvlc.h @@ -0,0 +1,250 @@ +// put blk + +/* type definitions for variable length code table entries */ + +typedef struct +{ + unsigned char code; /* right justified */ + char len; +} VLCtable; + +/* for codes longer than 8 bits (excluding leading zeroes) */ +typedef struct +{ + unsigned short code; /* right justified */ + char len; +} sVLCtable; + + +/* Table B-2, B-3, B-4 variable length codes for macroblock_type + * + * indexed by [macroblock_type] + */ + +const static VLCtable mbtypetab[3][32]= +{ + /* I */ + { + {0,0}, {1,1}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, + {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, + {0,0}, {1,2}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, + {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0} + }, + /* P */ + { + {0,0}, {3,5}, {1,2}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, + {1,3}, {0,0}, {1,1}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, + {0,0}, {1,6}, {1,5}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, + {0,0}, {0,0}, {2,5}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0} + }, + /* B */ + { + {0,0}, {3,5}, {0,0}, {0,0}, {2,3}, {0,0}, {3,3}, {0,0}, + {2,4}, {0,0}, {3,4}, {0,0}, {2,2}, {0,0}, {3,2}, {0,0}, + {0,0}, {1,6}, {0,0}, {0,0}, {0,0}, {0,0}, {2,6}, {0,0}, + {0,0}, {0,0}, {3,6}, {0,0}, {0,0}, {0,0}, {2,5}, {0,0} + } +}; + + +/* Table B-5 ... B-8 variable length codes for macroblock_type in + * scalable sequences + * + * not implemented + */ + +/* Table B-9, variable length codes for coded_block_pattern + * + * indexed by [coded_block_pattern] + */ + +const static VLCtable cbptable[64]= +{ + {0x01,9}, {0x0b,5}, {0x09,5}, {0x0d,6}, + {0x0d,4}, {0x17,7}, {0x13,7}, {0x1f,8}, + {0x0c,4}, {0x16,7}, {0x12,7}, {0x1e,8}, + {0x13,5}, {0x1b,8}, {0x17,8}, {0x13,8}, + {0x0b,4}, {0x15,7}, {0x11,7}, {0x1d,8}, + {0x11,5}, {0x19,8}, {0x15,8}, {0x11,8}, + {0x0f,6}, {0x0f,8}, {0x0d,8}, {0x03,9}, + {0x0f,5}, {0x0b,8}, {0x07,8}, {0x07,9}, + {0x0a,4}, {0x14,7}, {0x10,7}, {0x1c,8}, + {0x0e,6}, {0x0e,8}, {0x0c,8}, {0x02,9}, + {0x10,5}, {0x18,8}, {0x14,8}, {0x10,8}, + {0x0e,5}, {0x0a,8}, {0x06,8}, {0x06,9}, + {0x12,5}, {0x1a,8}, {0x16,8}, {0x12,8}, + {0x0d,5}, {0x09,8}, {0x05,8}, {0x05,9}, + {0x0c,5}, {0x08,8}, {0x04,8}, {0x04,9}, + {0x07,3}, {0x0a,5}, {0x08,5}, {0x0c,6} +}; + + + +/* Table B-14, DCT coefficients table zero + * + * indexed by [run][level-1] + * split into two tables (dct_code_tab1, dct_code_tab2) to reduce size + * 'first DCT coefficient' condition and 'End of Block' are treated elsewhere + * codes do not include s (sign bit) + */ + +const static VLCtable dct_code_tab1[2][40]= +{ + /* run = 0, level = 1...40 */ + { + {0x03, 2}, {0x04, 4}, {0x05, 5}, {0x06, 7}, + {0x26, 8}, {0x21, 8}, {0x0a,10}, {0x1d,12}, + {0x18,12}, {0x13,12}, {0x10,12}, {0x1a,13}, + {0x19,13}, {0x18,13}, {0x17,13}, {0x1f,14}, + {0x1e,14}, {0x1d,14}, {0x1c,14}, {0x1b,14}, + {0x1a,14}, {0x19,14}, {0x18,14}, {0x17,14}, + {0x16,14}, {0x15,14}, {0x14,14}, {0x13,14}, + {0x12,14}, {0x11,14}, {0x10,14}, {0x18,15}, + {0x17,15}, {0x16,15}, {0x15,15}, {0x14,15}, + {0x13,15}, {0x12,15}, {0x11,15}, {0x10,15} + }, + /* run = 1, level = 1...18 */ + { + {0x03, 3}, {0x06, 6}, {0x25, 8}, {0x0c,10}, + {0x1b,12}, {0x16,13}, {0x15,13}, {0x1f,15}, + {0x1e,15}, {0x1d,15}, {0x1c,15}, {0x1b,15}, + {0x1a,15}, {0x19,15}, {0x13,16}, {0x12,16}, + {0x11,16}, {0x10,16}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0} + } +}; + +const static VLCtable dct_code_tab2[30][5]= +{ + /* run = 2...31, level = 1...5 */ + {{0x05, 4}, {0x04, 7}, {0x0b,10}, {0x14,12}, {0x14,13}}, + {{0x07, 5}, {0x24, 8}, {0x1c,12}, {0x13,13}, {0x00, 0}}, + {{0x06, 5}, {0x0f,10}, {0x12,12}, {0x00, 0}, {0x00, 0}}, + {{0x07, 6}, {0x09,10}, {0x12,13}, {0x00, 0}, {0x00, 0}}, + {{0x05, 6}, {0x1e,12}, {0x14,16}, {0x00, 0}, {0x00, 0}}, + {{0x04, 6}, {0x15,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x07, 7}, {0x11,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x05, 7}, {0x11,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x27, 8}, {0x10,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x23, 8}, {0x1a,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x22, 8}, {0x19,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x20, 8}, {0x18,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x0e,10}, {0x17,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x0d,10}, {0x16,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x08,10}, {0x15,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1f,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1a,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x19,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x17,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x16,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1f,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1e,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1d,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1c,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1b,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1f,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1e,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1d,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1c,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1b,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}} +}; + + +/* Table B-15, DCT coefficients table one + * + * indexed by [run][level-1] + * split into two tables (dct_code_tab1a, dct_code_tab2a) to reduce size + * 'End of Block' is treated elsewhere + * codes do not include s (sign bit) + */ + +const static VLCtable dct_code_tab1a[2][40]= +{ + /* run = 0, level = 1...40 */ + { + {0x02, 2}, {0x06, 3}, {0x07, 4}, {0x1c, 5}, + {0x1d, 5}, {0x05, 6}, {0x04, 6}, {0x7b, 7}, + {0x7c, 7}, {0x23, 8}, {0x22, 8}, {0xfa, 8}, + {0xfb, 8}, {0xfe, 8}, {0xff, 8}, {0x1f,14}, + {0x1e,14}, {0x1d,14}, {0x1c,14}, {0x1b,14}, + {0x1a,14}, {0x19,14}, {0x18,14}, {0x17,14}, + {0x16,14}, {0x15,14}, {0x14,14}, {0x13,14}, + {0x12,14}, {0x11,14}, {0x10,14}, {0x18,15}, + {0x17,15}, {0x16,15}, {0x15,15}, {0x14,15}, + {0x13,15}, {0x12,15}, {0x11,15}, {0x10,15} + }, + /* run = 1, level = 1...18 */ + { + {0x02, 3}, {0x06, 5}, {0x79, 7}, {0x27, 8}, + {0x20, 8}, {0x16,13}, {0x15,13}, {0x1f,15}, + {0x1e,15}, {0x1d,15}, {0x1c,15}, {0x1b,15}, + {0x1a,15}, {0x19,15}, {0x13,16}, {0x12,16}, + {0x11,16}, {0x10,16}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}, + {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0} + } +}; + +const static VLCtable dct_code_tab2a[30][5]= +{ + /* run = 2...31, level = 1...5 */ + {{0x05, 5}, {0x07, 7}, {0xfc, 8}, {0x0c,10}, {0x14,13}}, + {{0x07, 5}, {0x26, 8}, {0x1c,12}, {0x13,13}, {0x00, 0}}, + {{0x06, 6}, {0xfd, 8}, {0x12,12}, {0x00, 0}, {0x00, 0}}, + {{0x07, 6}, {0x04, 9}, {0x12,13}, {0x00, 0}, {0x00, 0}}, + {{0x06, 7}, {0x1e,12}, {0x14,16}, {0x00, 0}, {0x00, 0}}, + {{0x04, 7}, {0x15,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x05, 7}, {0x11,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x78, 7}, {0x11,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x7a, 7}, {0x10,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x21, 8}, {0x1a,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x25, 8}, {0x19,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x24, 8}, {0x18,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x05, 9}, {0x17,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x07, 9}, {0x16,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x0d,10}, {0x15,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1f,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1a,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x19,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x17,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x16,12}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1f,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1e,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1d,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1c,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1b,13}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1f,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1e,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1d,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1c,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}}, + {{0x1b,16}, {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}} +}; + + +const static VLCtable addrinctab[33]= +{ + {0x01,1}, {0x03,3}, {0x02,3}, {0x03,4}, + {0x02,4}, {0x03,5}, {0x02,5}, {0x07,7}, + {0x06,7}, {0x0b,8}, {0x0a,8}, {0x09,8}, + {0x08,8}, {0x07,8}, {0x06,8}, {0x17,10}, + {0x16,10}, {0x15,10}, {0x14,10}, {0x13,10}, + {0x12,10}, {0x23,11}, {0x22,11}, {0x21,11}, + {0x20,11}, {0x1f,11}, {0x1e,11}, {0x1d,11}, + {0x1c,11}, {0x1b,11}, {0x1a,11}, {0x19,11}, + {0x18,11} +}; + +const static sVLCtable DClumtab[12]= +{ + {0x0004,3}, {0x0000,2}, {0x0001,2}, {0x0005,3}, {0x0006,3}, {0x000e,4}, + {0x001e,5}, {0x003e,6}, {0x007e,7}, {0x00fe,8}, {0x01fe,9}, {0x01ff,9} +}; + + diff --git a/k9vamps/qTable.h b/k9vamps/qTable.h new file mode 100644 index 0000000..8b0741f --- /dev/null +++ b/k9vamps/qTable.h @@ -0,0 +1,1141 @@ +static short quant_equ[113] = { + 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, + 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, + 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, + 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, + 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, + 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, + 34, 34, 35, 35, 36, 36, 36, 36, 36, 36, + 36, 36, 37, 37, 37, 37, 37, 37, 37, 37, + 38, 38, 38, 38, 38, 38, 38, 38, 39, 39, + 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, + 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, + 41, 41 +}; + +static short quant_table_1_to_2[4096]; +static short quant_table_1_to_3[4096]; +static short quant_table_1_to_4[4096]; +static short quant_table_1_to_5[4096]; +static short quant_table_1_to_6[4096]; +static short quant_table_1_to_7[4096]; +static short quant_table_1_to_8[4096]; +static short quant_table_1_to_10[4096]; +static short quant_table_1_to_12[4096]; +static short quant_table_1_to_14[4096]; +static short quant_table_1_to_16[4096]; +static short quant_table_1_to_18[4096]; +static short quant_table_1_to_20[4096]; +static short quant_table_1_to_22[4096]; +static short quant_table_1_to_24[4096]; +static short quant_table_1_to_26[4096]; +static short quant_table_1_to_28[4096]; +static short quant_table_1_to_30[4096]; +static short quant_table_1_to_32[4096]; +static short quant_table_1_to_34[4096]; +static short quant_table_1_to_36[4096]; +static short quant_table_1_to_38[4096]; +static short quant_table_1_to_40[4096]; +static short quant_table_1_to_42[4096]; +static short quant_table_1_to_44[4096]; +static short quant_table_1_to_46[4096]; +static short quant_table_1_to_48[4096]; +static short quant_table_1_to_50[4096]; +static short quant_table_1_to_52[4096]; +static short quant_table_1_to_54[4096]; +static short quant_table_1_to_56[4096]; +static short quant_table_1_to_58[4096]; +static short quant_table_1_to_60[4096]; +static short quant_table_1_to_62[4096]; +static short quant_table_1_to_64[4096]; +static short quant_table_1_to_72[4096]; +static short quant_table_1_to_80[4096]; +static short quant_table_1_to_88[4096]; +static short quant_table_1_to_96[4096]; +static short quant_table_1_to_104[4096]; +static short quant_table_1_to_112[4096]; +static short quant_table_2_to_3[4096]; +static short quant_table_2_to_4[4096]; +static short quant_table_2_to_5[4096]; +static short quant_table_2_to_6[4096]; +static short quant_table_2_to_7[4096]; +static short quant_table_2_to_8[4096]; +static short quant_table_2_to_10[4096]; +static short quant_table_2_to_12[4096]; +static short quant_table_2_to_14[4096]; +static short quant_table_2_to_16[4096]; +static short quant_table_2_to_18[4096]; +static short quant_table_2_to_20[4096]; +static short quant_table_2_to_22[4096]; +static short quant_table_2_to_24[4096]; +static short quant_table_2_to_26[4096]; +static short quant_table_2_to_28[4096]; +static short quant_table_2_to_30[4096]; +static short quant_table_2_to_32[4096]; +static short quant_table_2_to_34[4096]; +static short quant_table_2_to_36[4096]; +static short quant_table_2_to_38[4096]; +static short quant_table_2_to_40[4096]; +static short quant_table_2_to_42[4096]; +static short quant_table_2_to_44[4096]; +static short quant_table_2_to_46[4096]; +static short quant_table_2_to_48[4096]; +static short quant_table_2_to_50[4096]; +static short quant_table_2_to_52[4096]; +static short quant_table_2_to_54[4096]; +static short quant_table_2_to_56[4096]; +static short quant_table_2_to_58[4096]; +static short quant_table_2_to_60[4096]; +static short quant_table_2_to_62[4096]; +static short quant_table_2_to_64[4096]; +static short quant_table_2_to_72[4096]; +static short quant_table_2_to_80[4096]; +static short quant_table_2_to_88[4096]; +static short quant_table_2_to_96[4096]; +static short quant_table_2_to_104[4096]; +static short quant_table_2_to_112[4096]; +static short quant_table_3_to_4[4096]; +static short quant_table_3_to_5[4096]; +static short quant_table_3_to_6[4096]; +static short quant_table_3_to_7[4096]; +static short quant_table_3_to_8[4096]; +static short quant_table_3_to_10[4096]; +static short quant_table_3_to_12[4096]; +static short quant_table_3_to_14[4096]; +static short quant_table_3_to_16[4096]; +static short quant_table_3_to_18[4096]; +static short quant_table_3_to_20[4096]; +static short quant_table_3_to_22[4096]; +static short quant_table_3_to_24[4096]; +static short quant_table_3_to_26[4096]; +static short quant_table_3_to_28[4096]; +static short quant_table_3_to_30[4096]; +static short quant_table_3_to_32[4096]; +static short quant_table_3_to_34[4096]; +static short quant_table_3_to_36[4096]; +static short quant_table_3_to_38[4096]; +static short quant_table_3_to_40[4096]; +static short quant_table_3_to_42[4096]; +static short quant_table_3_to_44[4096]; +static short quant_table_3_to_46[4096]; +static short quant_table_3_to_48[4096]; +static short quant_table_3_to_50[4096]; +static short quant_table_3_to_52[4096]; +static short quant_table_3_to_54[4096]; +static short quant_table_3_to_56[4096]; +static short quant_table_3_to_58[4096]; +static short quant_table_3_to_60[4096]; +static short quant_table_3_to_62[4096]; +static short quant_table_3_to_64[4096]; +static short quant_table_3_to_72[4096]; +static short quant_table_3_to_80[4096]; +static short quant_table_3_to_88[4096]; +static short quant_table_3_to_96[4096]; +static short quant_table_3_to_104[4096]; +static short quant_table_3_to_112[4096]; +static short quant_table_4_to_5[4096]; +static short quant_table_4_to_6[4096]; +static short quant_table_4_to_7[4096]; +static short quant_table_4_to_8[4096]; +static short quant_table_4_to_10[4096]; +static short quant_table_4_to_12[4096]; +static short quant_table_4_to_14[4096]; +static short quant_table_4_to_16[4096]; +static short quant_table_4_to_18[4096]; +static short quant_table_4_to_20[4096]; +static short quant_table_4_to_22[4096]; +static short quant_table_4_to_24[4096]; +static short quant_table_4_to_26[4096]; +static short quant_table_4_to_28[4096]; +static short quant_table_4_to_30[4096]; +static short quant_table_4_to_32[4096]; +static short quant_table_4_to_34[4096]; +static short quant_table_4_to_36[4096]; +static short quant_table_4_to_38[4096]; +static short quant_table_4_to_40[4096]; +static short quant_table_4_to_42[4096]; +static short quant_table_4_to_44[4096]; +static short quant_table_4_to_46[4096]; +static short quant_table_4_to_48[4096]; +static short quant_table_4_to_50[4096]; +static short quant_table_4_to_52[4096]; +static short quant_table_4_to_54[4096]; +static short quant_table_4_to_56[4096]; +static short quant_table_4_to_58[4096]; +static short quant_table_4_to_60[4096]; +static short quant_table_4_to_62[4096]; +static short quant_table_4_to_64[4096]; +static short quant_table_4_to_72[4096]; +static short quant_table_4_to_80[4096]; +static short quant_table_4_to_88[4096]; +static short quant_table_4_to_96[4096]; +static short quant_table_4_to_104[4096]; +static short quant_table_4_to_112[4096]; +static short quant_table_5_to_6[4096]; +static short quant_table_5_to_7[4096]; +static short quant_table_5_to_8[4096]; +static short quant_table_5_to_10[4096]; +static short quant_table_5_to_12[4096]; +static short quant_table_5_to_14[4096]; +static short quant_table_5_to_16[4096]; +static short quant_table_5_to_18[4096]; +static short quant_table_5_to_20[4096]; +static short quant_table_5_to_22[4096]; +static short quant_table_5_to_24[4096]; +static short quant_table_5_to_26[4096]; +static short quant_table_5_to_28[4096]; +static short quant_table_5_to_30[4096]; +static short quant_table_5_to_32[4096]; +static short quant_table_5_to_34[4096]; +static short quant_table_5_to_36[4096]; +static short quant_table_5_to_38[4096]; +static short quant_table_5_to_40[4096]; +static short quant_table_5_to_42[4096]; +static short quant_table_5_to_44[4096]; +static short quant_table_5_to_46[4096]; +static short quant_table_5_to_48[4096]; +static short quant_table_5_to_50[4096]; +static short quant_table_5_to_52[4096]; +static short quant_table_5_to_54[4096]; +static short quant_table_5_to_56[4096]; +static short quant_table_5_to_58[4096]; +static short quant_table_5_to_60[4096]; +static short quant_table_5_to_62[4096]; +static short quant_table_5_to_64[4096]; +static short quant_table_5_to_72[4096]; +static short quant_table_5_to_80[4096]; +static short quant_table_5_to_88[4096]; +static short quant_table_5_to_96[4096]; +static short quant_table_5_to_104[4096]; +static short quant_table_5_to_112[4096]; +static short quant_table_6_to_7[4096]; +static short quant_table_6_to_8[4096]; +static short quant_table_6_to_10[4096]; +static short quant_table_6_to_12[4096]; +static short quant_table_6_to_14[4096]; +static short quant_table_6_to_16[4096]; +static short quant_table_6_to_18[4096]; +static short quant_table_6_to_20[4096]; +static short quant_table_6_to_22[4096]; +static short quant_table_6_to_24[4096]; +static short quant_table_6_to_26[4096]; +static short quant_table_6_to_28[4096]; +static short quant_table_6_to_30[4096]; +static short quant_table_6_to_32[4096]; +static short quant_table_6_to_34[4096]; +static short quant_table_6_to_36[4096]; +static short quant_table_6_to_38[4096]; +static short quant_table_6_to_40[4096]; +static short quant_table_6_to_42[4096]; +static short quant_table_6_to_44[4096]; +static short quant_table_6_to_46[4096]; +static short quant_table_6_to_48[4096]; +static short quant_table_6_to_50[4096]; +static short quant_table_6_to_52[4096]; +static short quant_table_6_to_54[4096]; +static short quant_table_6_to_56[4096]; +static short quant_table_6_to_58[4096]; +static short quant_table_6_to_60[4096]; +static short quant_table_6_to_62[4096]; +static short quant_table_6_to_64[4096]; +static short quant_table_6_to_72[4096]; +static short quant_table_6_to_80[4096]; +static short quant_table_6_to_88[4096]; +static short quant_table_6_to_96[4096]; +static short quant_table_6_to_104[4096]; +static short quant_table_6_to_112[4096]; +static short quant_table_7_to_8[4096]; +static short quant_table_7_to_10[4096]; +static short quant_table_7_to_12[4096]; +static short quant_table_7_to_14[4096]; +static short quant_table_7_to_16[4096]; +static short quant_table_7_to_18[4096]; +static short quant_table_7_to_20[4096]; +static short quant_table_7_to_22[4096]; +static short quant_table_7_to_24[4096]; +static short quant_table_7_to_26[4096]; +static short quant_table_7_to_28[4096]; +static short quant_table_7_to_30[4096]; +static short quant_table_7_to_32[4096]; +static short quant_table_7_to_34[4096]; +static short quant_table_7_to_36[4096]; +static short quant_table_7_to_38[4096]; +static short quant_table_7_to_40[4096]; +static short quant_table_7_to_42[4096]; +static short quant_table_7_to_44[4096]; +static short quant_table_7_to_46[4096]; +static short quant_table_7_to_48[4096]; +static short quant_table_7_to_50[4096]; +static short quant_table_7_to_52[4096]; +static short quant_table_7_to_54[4096]; +static short quant_table_7_to_56[4096]; +static short quant_table_7_to_58[4096]; +static short quant_table_7_to_60[4096]; +static short quant_table_7_to_62[4096]; +static short quant_table_7_to_64[4096]; +static short quant_table_7_to_72[4096]; +static short quant_table_7_to_80[4096]; +static short quant_table_7_to_88[4096]; +static short quant_table_7_to_96[4096]; +static short quant_table_7_to_104[4096]; +static short quant_table_7_to_112[4096]; +static short quant_table_8_to_10[4096]; +static short quant_table_8_to_12[4096]; +static short quant_table_8_to_14[4096]; +static short quant_table_8_to_16[4096]; +static short quant_table_8_to_18[4096]; +static short quant_table_8_to_20[4096]; +static short quant_table_8_to_22[4096]; +static short quant_table_8_to_24[4096]; +static short quant_table_8_to_26[4096]; +static short quant_table_8_to_28[4096]; +static short quant_table_8_to_30[4096]; +static short quant_table_8_to_32[4096]; +static short quant_table_8_to_34[4096]; +static short quant_table_8_to_36[4096]; +static short quant_table_8_to_38[4096]; +static short quant_table_8_to_40[4096]; +static short quant_table_8_to_42[4096]; +static short quant_table_8_to_44[4096]; +static short quant_table_8_to_46[4096]; +static short quant_table_8_to_48[4096]; +static short quant_table_8_to_50[4096]; +static short quant_table_8_to_52[4096]; +static short quant_table_8_to_54[4096]; +static short quant_table_8_to_56[4096]; +static short quant_table_8_to_58[4096]; +static short quant_table_8_to_60[4096]; +static short quant_table_8_to_62[4096]; +static short quant_table_8_to_64[4096]; +static short quant_table_8_to_72[4096]; +static short quant_table_8_to_80[4096]; +static short quant_table_8_to_88[4096]; +static short quant_table_8_to_96[4096]; +static short quant_table_8_to_104[4096]; +static short quant_table_8_to_112[4096]; +static short quant_table_10_to_12[4096]; +static short quant_table_10_to_14[4096]; +static short quant_table_10_to_16[4096]; +static short quant_table_10_to_18[4096]; +static short quant_table_10_to_20[4096]; +static short quant_table_10_to_22[4096]; +static short quant_table_10_to_24[4096]; +static short quant_table_10_to_26[4096]; +static short quant_table_10_to_28[4096]; +static short quant_table_10_to_30[4096]; +static short quant_table_10_to_32[4096]; +static short quant_table_10_to_34[4096]; +static short quant_table_10_to_36[4096]; +static short quant_table_10_to_38[4096]; +static short quant_table_10_to_40[4096]; +static short quant_table_10_to_42[4096]; +static short quant_table_10_to_44[4096]; +static short quant_table_10_to_46[4096]; +static short quant_table_10_to_48[4096]; +static short quant_table_10_to_50[4096]; +static short quant_table_10_to_52[4096]; +static short quant_table_10_to_54[4096]; +static short quant_table_10_to_56[4096]; +static short quant_table_10_to_58[4096]; +static short quant_table_10_to_60[4096]; +static short quant_table_10_to_62[4096]; +static short quant_table_10_to_64[4096]; +static short quant_table_10_to_72[4096]; +static short quant_table_10_to_80[4096]; +static short quant_table_10_to_88[4096]; +static short quant_table_10_to_96[4096]; +static short quant_table_10_to_104[4096]; +static short quant_table_10_to_112[4096]; +static short quant_table_12_to_14[4096]; +static short quant_table_12_to_16[4096]; +static short quant_table_12_to_18[4096]; +static short quant_table_12_to_20[4096]; +static short quant_table_12_to_22[4096]; +static short quant_table_12_to_24[4096]; +static short quant_table_12_to_26[4096]; +static short quant_table_12_to_28[4096]; +static short quant_table_12_to_30[4096]; +static short quant_table_12_to_32[4096]; +static short quant_table_12_to_34[4096]; +static short quant_table_12_to_36[4096]; +static short quant_table_12_to_38[4096]; +static short quant_table_12_to_40[4096]; +static short quant_table_12_to_42[4096]; +static short quant_table_12_to_44[4096]; +static short quant_table_12_to_46[4096]; +static short quant_table_12_to_48[4096]; +static short quant_table_12_to_50[4096]; +static short quant_table_12_to_52[4096]; +static short quant_table_12_to_54[4096]; +static short quant_table_12_to_56[4096]; +static short quant_table_12_to_58[4096]; +static short quant_table_12_to_60[4096]; +static short quant_table_12_to_62[4096]; +static short quant_table_12_to_64[4096]; +static short quant_table_12_to_72[4096]; +static short quant_table_12_to_80[4096]; +static short quant_table_12_to_88[4096]; +static short quant_table_12_to_96[4096]; +static short quant_table_12_to_104[4096]; +static short quant_table_12_to_112[4096]; +static short quant_table_14_to_16[4096]; +static short quant_table_14_to_18[4096]; +static short quant_table_14_to_20[4096]; +static short quant_table_14_to_22[4096]; +static short quant_table_14_to_24[4096]; +static short quant_table_14_to_26[4096]; +static short quant_table_14_to_28[4096]; +static short quant_table_14_to_30[4096]; +static short quant_table_14_to_32[4096]; +static short quant_table_14_to_34[4096]; +static short quant_table_14_to_36[4096]; +static short quant_table_14_to_38[4096]; +static short quant_table_14_to_40[4096]; +static short quant_table_14_to_42[4096]; +static short quant_table_14_to_44[4096]; +static short quant_table_14_to_46[4096]; +static short quant_table_14_to_48[4096]; +static short quant_table_14_to_50[4096]; +static short quant_table_14_to_52[4096]; +static short quant_table_14_to_54[4096]; +static short quant_table_14_to_56[4096]; +static short quant_table_14_to_58[4096]; +static short quant_table_14_to_60[4096]; +static short quant_table_14_to_62[4096]; +static short quant_table_14_to_64[4096]; +static short quant_table_14_to_72[4096]; +static short quant_table_14_to_80[4096]; +static short quant_table_14_to_88[4096]; +static short quant_table_14_to_96[4096]; +static short quant_table_14_to_104[4096]; +static short quant_table_14_to_112[4096]; +static short quant_table_16_to_18[4096]; +static short quant_table_16_to_20[4096]; +static short quant_table_16_to_22[4096]; +static short quant_table_16_to_24[4096]; +static short quant_table_16_to_26[4096]; +static short quant_table_16_to_28[4096]; +static short quant_table_16_to_30[4096]; +static short quant_table_16_to_32[4096]; +static short quant_table_16_to_34[4096]; +static short quant_table_16_to_36[4096]; +static short quant_table_16_to_38[4096]; +static short quant_table_16_to_40[4096]; +static short quant_table_16_to_42[4096]; +static short quant_table_16_to_44[4096]; +static short quant_table_16_to_46[4096]; +static short quant_table_16_to_48[4096]; +static short quant_table_16_to_50[4096]; +static short quant_table_16_to_52[4096]; +static short quant_table_16_to_54[4096]; +static short quant_table_16_to_56[4096]; +static short quant_table_16_to_58[4096]; +static short quant_table_16_to_60[4096]; +static short quant_table_16_to_62[4096]; +static short quant_table_16_to_64[4096]; +static short quant_table_16_to_72[4096]; +static short quant_table_16_to_80[4096]; +static short quant_table_16_to_88[4096]; +static short quant_table_16_to_96[4096]; +static short quant_table_16_to_104[4096]; +static short quant_table_16_to_112[4096]; +static short quant_table_18_to_20[4096]; +static short quant_table_18_to_22[4096]; +static short quant_table_18_to_24[4096]; +static short quant_table_18_to_26[4096]; +static short quant_table_18_to_28[4096]; +static short quant_table_18_to_30[4096]; +static short quant_table_18_to_32[4096]; +static short quant_table_18_to_34[4096]; +static short quant_table_18_to_36[4096]; +static short quant_table_18_to_38[4096]; +static short quant_table_18_to_40[4096]; +static short quant_table_18_to_42[4096]; +static short quant_table_18_to_44[4096]; +static short quant_table_18_to_46[4096]; +static short quant_table_18_to_48[4096]; +static short quant_table_18_to_50[4096]; +static short quant_table_18_to_52[4096]; +static short quant_table_18_to_54[4096]; +static short quant_table_18_to_56[4096]; +static short quant_table_18_to_58[4096]; +static short quant_table_18_to_60[4096]; +static short quant_table_18_to_62[4096]; +static short quant_table_18_to_64[4096]; +static short quant_table_18_to_72[4096]; +static short quant_table_18_to_80[4096]; +static short quant_table_18_to_88[4096]; +static short quant_table_18_to_96[4096]; +static short quant_table_18_to_104[4096]; +static short quant_table_18_to_112[4096]; +static short quant_table_20_to_22[4096]; +static short quant_table_20_to_24[4096]; +static short quant_table_20_to_26[4096]; +static short quant_table_20_to_28[4096]; +static short quant_table_20_to_30[4096]; +static short quant_table_20_to_32[4096]; +static short quant_table_20_to_34[4096]; +static short quant_table_20_to_36[4096]; +static short quant_table_20_to_38[4096]; +static short quant_table_20_to_40[4096]; +static short quant_table_20_to_42[4096]; +static short quant_table_20_to_44[4096]; +static short quant_table_20_to_46[4096]; +static short quant_table_20_to_48[4096]; +static short quant_table_20_to_50[4096]; +static short quant_table_20_to_52[4096]; +static short quant_table_20_to_54[4096]; +static short quant_table_20_to_56[4096]; +static short quant_table_20_to_58[4096]; +static short quant_table_20_to_60[4096]; +static short quant_table_20_to_62[4096]; +static short quant_table_20_to_64[4096]; +static short quant_table_20_to_72[4096]; +static short quant_table_20_to_80[4096]; +static short quant_table_20_to_88[4096]; +static short quant_table_20_to_96[4096]; +static short quant_table_20_to_104[4096]; +static short quant_table_20_to_112[4096]; +static short quant_table_22_to_24[4096]; +static short quant_table_22_to_26[4096]; +static short quant_table_22_to_28[4096]; +static short quant_table_22_to_30[4096]; +static short quant_table_22_to_32[4096]; +static short quant_table_22_to_34[4096]; +static short quant_table_22_to_36[4096]; +static short quant_table_22_to_38[4096]; +static short quant_table_22_to_40[4096]; +static short quant_table_22_to_42[4096]; +static short quant_table_22_to_44[4096]; +static short quant_table_22_to_46[4096]; +static short quant_table_22_to_48[4096]; +static short quant_table_22_to_50[4096]; +static short quant_table_22_to_52[4096]; +static short quant_table_22_to_54[4096]; +static short quant_table_22_to_56[4096]; +static short quant_table_22_to_58[4096]; +static short quant_table_22_to_60[4096]; +static short quant_table_22_to_62[4096]; +static short quant_table_22_to_64[4096]; +static short quant_table_22_to_72[4096]; +static short quant_table_22_to_80[4096]; +static short quant_table_22_to_88[4096]; +static short quant_table_22_to_96[4096]; +static short quant_table_22_to_104[4096]; +static short quant_table_22_to_112[4096]; +static short quant_table_24_to_26[4096]; +static short quant_table_24_to_28[4096]; +static short quant_table_24_to_30[4096]; +static short quant_table_24_to_32[4096]; +static short quant_table_24_to_34[4096]; +static short quant_table_24_to_36[4096]; +static short quant_table_24_to_38[4096]; +static short quant_table_24_to_40[4096]; +static short quant_table_24_to_42[4096]; +static short quant_table_24_to_44[4096]; +static short quant_table_24_to_46[4096]; +static short quant_table_24_to_48[4096]; +static short quant_table_24_to_50[4096]; +static short quant_table_24_to_52[4096]; +static short quant_table_24_to_54[4096]; +static short quant_table_24_to_56[4096]; +static short quant_table_24_to_58[4096]; +static short quant_table_24_to_60[4096]; +static short quant_table_24_to_62[4096]; +static short quant_table_24_to_64[4096]; +static short quant_table_24_to_72[4096]; +static short quant_table_24_to_80[4096]; +static short quant_table_24_to_88[4096]; +static short quant_table_24_to_96[4096]; +static short quant_table_24_to_104[4096]; +static short quant_table_24_to_112[4096]; +static short quant_table_26_to_28[4096]; +static short quant_table_26_to_30[4096]; +static short quant_table_26_to_32[4096]; +static short quant_table_26_to_34[4096]; +static short quant_table_26_to_36[4096]; +static short quant_table_26_to_38[4096]; +static short quant_table_26_to_40[4096]; +static short quant_table_26_to_42[4096]; +static short quant_table_26_to_44[4096]; +static short quant_table_26_to_46[4096]; +static short quant_table_26_to_48[4096]; +static short quant_table_26_to_50[4096]; +static short quant_table_26_to_52[4096]; +static short quant_table_26_to_54[4096]; +static short quant_table_26_to_56[4096]; +static short quant_table_26_to_58[4096]; +static short quant_table_26_to_60[4096]; +static short quant_table_26_to_62[4096]; +static short quant_table_26_to_64[4096]; +static short quant_table_26_to_72[4096]; +static short quant_table_26_to_80[4096]; +static short quant_table_26_to_88[4096]; +static short quant_table_26_to_96[4096]; +static short quant_table_26_to_104[4096]; +static short quant_table_26_to_112[4096]; +static short quant_table_28_to_30[4096]; +static short quant_table_28_to_32[4096]; +static short quant_table_28_to_34[4096]; +static short quant_table_28_to_36[4096]; +static short quant_table_28_to_38[4096]; +static short quant_table_28_to_40[4096]; +static short quant_table_28_to_42[4096]; +static short quant_table_28_to_44[4096]; +static short quant_table_28_to_46[4096]; +static short quant_table_28_to_48[4096]; +static short quant_table_28_to_50[4096]; +static short quant_table_28_to_52[4096]; +static short quant_table_28_to_54[4096]; +static short quant_table_28_to_56[4096]; +static short quant_table_28_to_58[4096]; +static short quant_table_28_to_60[4096]; +static short quant_table_28_to_62[4096]; +static short quant_table_28_to_64[4096]; +static short quant_table_28_to_72[4096]; +static short quant_table_28_to_80[4096]; +static short quant_table_28_to_88[4096]; +static short quant_table_28_to_96[4096]; +static short quant_table_28_to_104[4096]; +static short quant_table_28_to_112[4096]; +static short quant_table_30_to_32[4096]; +static short quant_table_30_to_34[4096]; +static short quant_table_30_to_36[4096]; +static short quant_table_30_to_38[4096]; +static short quant_table_30_to_40[4096]; +static short quant_table_30_to_42[4096]; +static short quant_table_30_to_44[4096]; +static short quant_table_30_to_46[4096]; +static short quant_table_30_to_48[4096]; +static short quant_table_30_to_50[4096]; +static short quant_table_30_to_52[4096]; +static short quant_table_30_to_54[4096]; +static short quant_table_30_to_56[4096]; +static short quant_table_30_to_58[4096]; +static short quant_table_30_to_60[4096]; +static short quant_table_30_to_62[4096]; +static short quant_table_30_to_64[4096]; +static short quant_table_30_to_72[4096]; +static short quant_table_30_to_80[4096]; +static short quant_table_30_to_88[4096]; +static short quant_table_30_to_96[4096]; +static short quant_table_30_to_104[4096]; +static short quant_table_30_to_112[4096]; +static short quant_table_32_to_34[4096]; +static short quant_table_32_to_36[4096]; +static short quant_table_32_to_38[4096]; +static short quant_table_32_to_40[4096]; +static short quant_table_32_to_42[4096]; +static short quant_table_32_to_44[4096]; +static short quant_table_32_to_46[4096]; +static short quant_table_32_to_48[4096]; +static short quant_table_32_to_50[4096]; +static short quant_table_32_to_52[4096]; +static short quant_table_32_to_54[4096]; +static short quant_table_32_to_56[4096]; +static short quant_table_32_to_58[4096]; +static short quant_table_32_to_60[4096]; +static short quant_table_32_to_62[4096]; +static short quant_table_32_to_64[4096]; +static short quant_table_32_to_72[4096]; +static short quant_table_32_to_80[4096]; +static short quant_table_32_to_88[4096]; +static short quant_table_32_to_96[4096]; +static short quant_table_32_to_104[4096]; +static short quant_table_32_to_112[4096]; +static short quant_table_34_to_36[4096]; +static short quant_table_34_to_38[4096]; +static short quant_table_34_to_40[4096]; +static short quant_table_34_to_42[4096]; +static short quant_table_34_to_44[4096]; +static short quant_table_34_to_46[4096]; +static short quant_table_34_to_48[4096]; +static short quant_table_34_to_50[4096]; +static short quant_table_34_to_52[4096]; +static short quant_table_34_to_54[4096]; +static short quant_table_34_to_56[4096]; +static short quant_table_34_to_58[4096]; +static short quant_table_34_to_60[4096]; +static short quant_table_34_to_62[4096]; +static short quant_table_34_to_64[4096]; +static short quant_table_34_to_72[4096]; +static short quant_table_34_to_80[4096]; +static short quant_table_34_to_88[4096]; +static short quant_table_34_to_96[4096]; +static short quant_table_34_to_104[4096]; +static short quant_table_34_to_112[4096]; +static short quant_table_36_to_38[4096]; +static short quant_table_36_to_40[4096]; +static short quant_table_36_to_42[4096]; +static short quant_table_36_to_44[4096]; +static short quant_table_36_to_46[4096]; +static short quant_table_36_to_48[4096]; +static short quant_table_36_to_50[4096]; +static short quant_table_36_to_52[4096]; +static short quant_table_36_to_54[4096]; +static short quant_table_36_to_56[4096]; +static short quant_table_36_to_58[4096]; +static short quant_table_36_to_60[4096]; +static short quant_table_36_to_62[4096]; +static short quant_table_36_to_64[4096]; +static short quant_table_36_to_72[4096]; +static short quant_table_36_to_80[4096]; +static short quant_table_36_to_88[4096]; +static short quant_table_36_to_96[4096]; +static short quant_table_36_to_104[4096]; +static short quant_table_36_to_112[4096]; +static short quant_table_38_to_40[4096]; +static short quant_table_38_to_42[4096]; +static short quant_table_38_to_44[4096]; +static short quant_table_38_to_46[4096]; +static short quant_table_38_to_48[4096]; +static short quant_table_38_to_50[4096]; +static short quant_table_38_to_52[4096]; +static short quant_table_38_to_54[4096]; +static short quant_table_38_to_56[4096]; +static short quant_table_38_to_58[4096]; +static short quant_table_38_to_60[4096]; +static short quant_table_38_to_62[4096]; +static short quant_table_38_to_64[4096]; +static short quant_table_38_to_72[4096]; +static short quant_table_38_to_80[4096]; +static short quant_table_38_to_88[4096]; +static short quant_table_38_to_96[4096]; +static short quant_table_38_to_104[4096]; +static short quant_table_38_to_112[4096]; +static short quant_table_40_to_42[4096]; +static short quant_table_40_to_44[4096]; +static short quant_table_40_to_46[4096]; +static short quant_table_40_to_48[4096]; +static short quant_table_40_to_50[4096]; +static short quant_table_40_to_52[4096]; +static short quant_table_40_to_54[4096]; +static short quant_table_40_to_56[4096]; +static short quant_table_40_to_58[4096]; +static short quant_table_40_to_60[4096]; +static short quant_table_40_to_62[4096]; +static short quant_table_40_to_64[4096]; +static short quant_table_40_to_72[4096]; +static short quant_table_40_to_80[4096]; +static short quant_table_40_to_88[4096]; +static short quant_table_40_to_96[4096]; +static short quant_table_40_to_104[4096]; +static short quant_table_40_to_112[4096]; +static short quant_table_42_to_44[4096]; +static short quant_table_42_to_46[4096]; +static short quant_table_42_to_48[4096]; +static short quant_table_42_to_50[4096]; +static short quant_table_42_to_52[4096]; +static short quant_table_42_to_54[4096]; +static short quant_table_42_to_56[4096]; +static short quant_table_42_to_58[4096]; +static short quant_table_42_to_60[4096]; +static short quant_table_42_to_62[4096]; +static short quant_table_42_to_64[4096]; +static short quant_table_42_to_72[4096]; +static short quant_table_42_to_80[4096]; +static short quant_table_42_to_88[4096]; +static short quant_table_42_to_96[4096]; +static short quant_table_42_to_104[4096]; +static short quant_table_42_to_112[4096]; +static short quant_table_44_to_46[4096]; +static short quant_table_44_to_48[4096]; +static short quant_table_44_to_50[4096]; +static short quant_table_44_to_52[4096]; +static short quant_table_44_to_54[4096]; +static short quant_table_44_to_56[4096]; +static short quant_table_44_to_58[4096]; +static short quant_table_44_to_60[4096]; +static short quant_table_44_to_62[4096]; +static short quant_table_44_to_64[4096]; +static short quant_table_44_to_72[4096]; +static short quant_table_44_to_80[4096]; +static short quant_table_44_to_88[4096]; +static short quant_table_44_to_96[4096]; +static short quant_table_44_to_104[4096]; +static short quant_table_44_to_112[4096]; +static short quant_table_46_to_48[4096]; +static short quant_table_46_to_50[4096]; +static short quant_table_46_to_52[4096]; +static short quant_table_46_to_54[4096]; +static short quant_table_46_to_56[4096]; +static short quant_table_46_to_58[4096]; +static short quant_table_46_to_60[4096]; +static short quant_table_46_to_62[4096]; +static short quant_table_46_to_64[4096]; +static short quant_table_46_to_72[4096]; +static short quant_table_46_to_80[4096]; +static short quant_table_46_to_88[4096]; +static short quant_table_46_to_96[4096]; +static short quant_table_46_to_104[4096]; +static short quant_table_46_to_112[4096]; +static short quant_table_48_to_50[4096]; +static short quant_table_48_to_52[4096]; +static short quant_table_48_to_54[4096]; +static short quant_table_48_to_56[4096]; +static short quant_table_48_to_58[4096]; +static short quant_table_48_to_60[4096]; +static short quant_table_48_to_62[4096]; +static short quant_table_48_to_64[4096]; +static short quant_table_48_to_72[4096]; +static short quant_table_48_to_80[4096]; +static short quant_table_48_to_88[4096]; +static short quant_table_48_to_96[4096]; +static short quant_table_48_to_104[4096]; +static short quant_table_48_to_112[4096]; +static short quant_table_50_to_52[4096]; +static short quant_table_50_to_54[4096]; +static short quant_table_50_to_56[4096]; +static short quant_table_50_to_58[4096]; +static short quant_table_50_to_60[4096]; +static short quant_table_50_to_62[4096]; +static short quant_table_50_to_64[4096]; +static short quant_table_50_to_72[4096]; +static short quant_table_50_to_80[4096]; +static short quant_table_50_to_88[4096]; +static short quant_table_50_to_96[4096]; +static short quant_table_50_to_104[4096]; +static short quant_table_50_to_112[4096]; +static short quant_table_52_to_54[4096]; +static short quant_table_52_to_56[4096]; +static short quant_table_52_to_58[4096]; +static short quant_table_52_to_60[4096]; +static short quant_table_52_to_62[4096]; +static short quant_table_52_to_64[4096]; +static short quant_table_52_to_72[4096]; +static short quant_table_52_to_80[4096]; +static short quant_table_52_to_88[4096]; +static short quant_table_52_to_96[4096]; +static short quant_table_52_to_104[4096]; +static short quant_table_52_to_112[4096]; +static short quant_table_54_to_56[4096]; +static short quant_table_54_to_58[4096]; +static short quant_table_54_to_60[4096]; +static short quant_table_54_to_62[4096]; +static short quant_table_54_to_64[4096]; +static short quant_table_54_to_72[4096]; +static short quant_table_54_to_80[4096]; +static short quant_table_54_to_88[4096]; +static short quant_table_54_to_96[4096]; +static short quant_table_54_to_104[4096]; +static short quant_table_54_to_112[4096]; +static short quant_table_56_to_58[4096]; +static short quant_table_56_to_60[4096]; +static short quant_table_56_to_62[4096]; +static short quant_table_56_to_64[4096]; +static short quant_table_56_to_72[4096]; +static short quant_table_56_to_80[4096]; +static short quant_table_56_to_88[4096]; +static short quant_table_56_to_96[4096]; +static short quant_table_56_to_104[4096]; +static short quant_table_56_to_112[4096]; +static short quant_table_58_to_60[4096]; +static short quant_table_58_to_62[4096]; +static short quant_table_58_to_64[4096]; +static short quant_table_58_to_72[4096]; +static short quant_table_58_to_80[4096]; +static short quant_table_58_to_88[4096]; +static short quant_table_58_to_96[4096]; +static short quant_table_58_to_104[4096]; +static short quant_table_58_to_112[4096]; +static short quant_table_60_to_62[4096]; +static short quant_table_60_to_64[4096]; +static short quant_table_60_to_72[4096]; +static short quant_table_60_to_80[4096]; +static short quant_table_60_to_88[4096]; +static short quant_table_60_to_96[4096]; +static short quant_table_60_to_104[4096]; +static short quant_table_60_to_112[4096]; +static short quant_table_62_to_64[4096]; +static short quant_table_62_to_72[4096]; +static short quant_table_62_to_80[4096]; +static short quant_table_62_to_88[4096]; +static short quant_table_62_to_96[4096]; +static short quant_table_62_to_104[4096]; +static short quant_table_62_to_112[4096]; +static short quant_table_64_to_72[4096]; +static short quant_table_64_to_80[4096]; +static short quant_table_64_to_88[4096]; +static short quant_table_64_to_96[4096]; +static short quant_table_64_to_104[4096]; +static short quant_table_64_to_112[4096]; +static short quant_table_72_to_80[4096]; +static short quant_table_72_to_88[4096]; +static short quant_table_72_to_96[4096]; +static short quant_table_72_to_104[4096]; +static short quant_table_72_to_112[4096]; +static short quant_table_80_to_88[4096]; +static short quant_table_80_to_96[4096]; +static short quant_table_80_to_104[4096]; +static short quant_table_80_to_112[4096]; +static short quant_table_88_to_96[4096]; +static short quant_table_88_to_104[4096]; +static short quant_table_88_to_112[4096]; +static short quant_table_96_to_104[4096]; +static short quant_table_96_to_112[4096]; +static short quant_table_104_to_112[4096]; +static short *quant_tables[42][42] = { +{ 0, &quant_table_1_to_2[2048], &quant_table_1_to_3[2048], &quant_table_1_to_4[2048], &quant_table_1_to_5[2048], + &quant_table_1_to_6[2048], &quant_table_1_to_7[2048], &quant_table_1_to_8[2048], &quant_table_1_to_10[2048], + &quant_table_1_to_12[2048], &quant_table_1_to_14[2048], &quant_table_1_to_16[2048], &quant_table_1_to_18[2048], + &quant_table_1_to_20[2048], &quant_table_1_to_22[2048], &quant_table_1_to_24[2048], &quant_table_1_to_26[2048], + &quant_table_1_to_28[2048], &quant_table_1_to_30[2048], &quant_table_1_to_32[2048], &quant_table_1_to_34[2048], + &quant_table_1_to_36[2048], &quant_table_1_to_38[2048], &quant_table_1_to_40[2048], &quant_table_1_to_42[2048], + &quant_table_1_to_44[2048], &quant_table_1_to_46[2048], &quant_table_1_to_48[2048], &quant_table_1_to_50[2048], + &quant_table_1_to_52[2048], &quant_table_1_to_54[2048], &quant_table_1_to_56[2048], &quant_table_1_to_58[2048], + &quant_table_1_to_60[2048], &quant_table_1_to_62[2048], &quant_table_1_to_64[2048], &quant_table_1_to_72[2048], + &quant_table_1_to_80[2048], &quant_table_1_to_88[2048], &quant_table_1_to_96[2048], &quant_table_1_to_104[2048], + &quant_table_1_to_112[2048]}, +{ 0,0, &quant_table_2_to_3[2048], &quant_table_2_to_4[2048], &quant_table_2_to_5[2048], + &quant_table_2_to_6[2048], &quant_table_2_to_7[2048], &quant_table_2_to_8[2048], &quant_table_2_to_10[2048], + &quant_table_2_to_12[2048], &quant_table_2_to_14[2048], &quant_table_2_to_16[2048], &quant_table_2_to_18[2048], + &quant_table_2_to_20[2048], &quant_table_2_to_22[2048], &quant_table_2_to_24[2048], &quant_table_2_to_26[2048], + &quant_table_2_to_28[2048], &quant_table_2_to_30[2048], &quant_table_2_to_32[2048], &quant_table_2_to_34[2048], + &quant_table_2_to_36[2048], &quant_table_2_to_38[2048], &quant_table_2_to_40[2048], &quant_table_2_to_42[2048], + &quant_table_2_to_44[2048], &quant_table_2_to_46[2048], &quant_table_2_to_48[2048], &quant_table_2_to_50[2048], + &quant_table_2_to_52[2048], &quant_table_2_to_54[2048], &quant_table_2_to_56[2048], &quant_table_2_to_58[2048], + &quant_table_2_to_60[2048], &quant_table_2_to_62[2048], &quant_table_2_to_64[2048], &quant_table_2_to_72[2048], + &quant_table_2_to_80[2048], &quant_table_2_to_88[2048], &quant_table_2_to_96[2048], &quant_table_2_to_104[2048], + &quant_table_2_to_112[2048]}, +{ 0,0,0, &quant_table_3_to_4[2048], &quant_table_3_to_5[2048], + &quant_table_3_to_6[2048], &quant_table_3_to_7[2048], &quant_table_3_to_8[2048], &quant_table_3_to_10[2048], + &quant_table_3_to_12[2048], &quant_table_3_to_14[2048], &quant_table_3_to_16[2048], &quant_table_3_to_18[2048], + &quant_table_3_to_20[2048], &quant_table_3_to_22[2048], &quant_table_3_to_24[2048], &quant_table_3_to_26[2048], + &quant_table_3_to_28[2048], &quant_table_3_to_30[2048], &quant_table_3_to_32[2048], &quant_table_3_to_34[2048], + &quant_table_3_to_36[2048], &quant_table_3_to_38[2048], &quant_table_3_to_40[2048], &quant_table_3_to_42[2048], + &quant_table_3_to_44[2048], &quant_table_3_to_46[2048], &quant_table_3_to_48[2048], &quant_table_3_to_50[2048], + &quant_table_3_to_52[2048], &quant_table_3_to_54[2048], &quant_table_3_to_56[2048], &quant_table_3_to_58[2048], + &quant_table_3_to_60[2048], &quant_table_3_to_62[2048], &quant_table_3_to_64[2048], &quant_table_3_to_72[2048], + &quant_table_3_to_80[2048], &quant_table_3_to_88[2048], &quant_table_3_to_96[2048], &quant_table_3_to_104[2048], + &quant_table_3_to_112[2048]}, +{ 0,0,0,0, &quant_table_4_to_5[2048], + &quant_table_4_to_6[2048], &quant_table_4_to_7[2048], &quant_table_4_to_8[2048], &quant_table_4_to_10[2048], + &quant_table_4_to_12[2048], &quant_table_4_to_14[2048], &quant_table_4_to_16[2048], &quant_table_4_to_18[2048], + &quant_table_4_to_20[2048], &quant_table_4_to_22[2048], &quant_table_4_to_24[2048], &quant_table_4_to_26[2048], + &quant_table_4_to_28[2048], &quant_table_4_to_30[2048], &quant_table_4_to_32[2048], &quant_table_4_to_34[2048], + &quant_table_4_to_36[2048], &quant_table_4_to_38[2048], &quant_table_4_to_40[2048], &quant_table_4_to_42[2048], + &quant_table_4_to_44[2048], &quant_table_4_to_46[2048], &quant_table_4_to_48[2048], &quant_table_4_to_50[2048], + &quant_table_4_to_52[2048], &quant_table_4_to_54[2048], &quant_table_4_to_56[2048], &quant_table_4_to_58[2048], + &quant_table_4_to_60[2048], &quant_table_4_to_62[2048], &quant_table_4_to_64[2048], &quant_table_4_to_72[2048], + &quant_table_4_to_80[2048], &quant_table_4_to_88[2048], &quant_table_4_to_96[2048], &quant_table_4_to_104[2048], + &quant_table_4_to_112[2048]}, +{ 0,0,0,0,0, &quant_table_5_to_6[2048], &quant_table_5_to_7[2048], &quant_table_5_to_8[2048], &quant_table_5_to_10[2048], + &quant_table_5_to_12[2048], &quant_table_5_to_14[2048], &quant_table_5_to_16[2048], &quant_table_5_to_18[2048], + &quant_table_5_to_20[2048], &quant_table_5_to_22[2048], &quant_table_5_to_24[2048], &quant_table_5_to_26[2048], + &quant_table_5_to_28[2048], &quant_table_5_to_30[2048], &quant_table_5_to_32[2048], &quant_table_5_to_34[2048], + &quant_table_5_to_36[2048], &quant_table_5_to_38[2048], &quant_table_5_to_40[2048], &quant_table_5_to_42[2048], + &quant_table_5_to_44[2048], &quant_table_5_to_46[2048], &quant_table_5_to_48[2048], &quant_table_5_to_50[2048], + &quant_table_5_to_52[2048], &quant_table_5_to_54[2048], &quant_table_5_to_56[2048], &quant_table_5_to_58[2048], + &quant_table_5_to_60[2048], &quant_table_5_to_62[2048], &quant_table_5_to_64[2048], &quant_table_5_to_72[2048], + &quant_table_5_to_80[2048], &quant_table_5_to_88[2048], &quant_table_5_to_96[2048], &quant_table_5_to_104[2048], + &quant_table_5_to_112[2048]}, +{ 0,0,0,0,0,0, &quant_table_6_to_7[2048], &quant_table_6_to_8[2048], &quant_table_6_to_10[2048], + &quant_table_6_to_12[2048], &quant_table_6_to_14[2048], &quant_table_6_to_16[2048], &quant_table_6_to_18[2048], + &quant_table_6_to_20[2048], &quant_table_6_to_22[2048], &quant_table_6_to_24[2048], &quant_table_6_to_26[2048], + &quant_table_6_to_28[2048], &quant_table_6_to_30[2048], &quant_table_6_to_32[2048], &quant_table_6_to_34[2048], + &quant_table_6_to_36[2048], &quant_table_6_to_38[2048], &quant_table_6_to_40[2048], &quant_table_6_to_42[2048], + &quant_table_6_to_44[2048], &quant_table_6_to_46[2048], &quant_table_6_to_48[2048], &quant_table_6_to_50[2048], + &quant_table_6_to_52[2048], &quant_table_6_to_54[2048], &quant_table_6_to_56[2048], &quant_table_6_to_58[2048], + &quant_table_6_to_60[2048], &quant_table_6_to_62[2048], &quant_table_6_to_64[2048], &quant_table_6_to_72[2048], + &quant_table_6_to_80[2048], &quant_table_6_to_88[2048], &quant_table_6_to_96[2048], &quant_table_6_to_104[2048], + &quant_table_6_to_112[2048]}, +{ 0,0,0,0,0,0,0, &quant_table_7_to_8[2048], &quant_table_7_to_10[2048], + &quant_table_7_to_12[2048], &quant_table_7_to_14[2048], &quant_table_7_to_16[2048], &quant_table_7_to_18[2048], + &quant_table_7_to_20[2048], &quant_table_7_to_22[2048], &quant_table_7_to_24[2048], &quant_table_7_to_26[2048], + &quant_table_7_to_28[2048], &quant_table_7_to_30[2048], &quant_table_7_to_32[2048], &quant_table_7_to_34[2048], + &quant_table_7_to_36[2048], &quant_table_7_to_38[2048], &quant_table_7_to_40[2048], &quant_table_7_to_42[2048], + &quant_table_7_to_44[2048], &quant_table_7_to_46[2048], &quant_table_7_to_48[2048], &quant_table_7_to_50[2048], + &quant_table_7_to_52[2048], &quant_table_7_to_54[2048], &quant_table_7_to_56[2048], &quant_table_7_to_58[2048], + &quant_table_7_to_60[2048], &quant_table_7_to_62[2048], &quant_table_7_to_64[2048], &quant_table_7_to_72[2048], + &quant_table_7_to_80[2048], &quant_table_7_to_88[2048], &quant_table_7_to_96[2048], &quant_table_7_to_104[2048], + &quant_table_7_to_112[2048]}, +{ 0,0,0,0,0,0,0,0, &quant_table_8_to_10[2048], + &quant_table_8_to_12[2048], &quant_table_8_to_14[2048], &quant_table_8_to_16[2048], &quant_table_8_to_18[2048], + &quant_table_8_to_20[2048], &quant_table_8_to_22[2048], &quant_table_8_to_24[2048], &quant_table_8_to_26[2048], + &quant_table_8_to_28[2048], &quant_table_8_to_30[2048], &quant_table_8_to_32[2048], &quant_table_8_to_34[2048], + &quant_table_8_to_36[2048], &quant_table_8_to_38[2048], &quant_table_8_to_40[2048], &quant_table_8_to_42[2048], + &quant_table_8_to_44[2048], &quant_table_8_to_46[2048], &quant_table_8_to_48[2048], &quant_table_8_to_50[2048], + &quant_table_8_to_52[2048], &quant_table_8_to_54[2048], &quant_table_8_to_56[2048], &quant_table_8_to_58[2048], + &quant_table_8_to_60[2048], &quant_table_8_to_62[2048], &quant_table_8_to_64[2048], &quant_table_8_to_72[2048], + &quant_table_8_to_80[2048], &quant_table_8_to_88[2048], &quant_table_8_to_96[2048], &quant_table_8_to_104[2048], + &quant_table_8_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0, &quant_table_10_to_12[2048], &quant_table_10_to_14[2048], &quant_table_10_to_16[2048], &quant_table_10_to_18[2048], + &quant_table_10_to_20[2048], &quant_table_10_to_22[2048], &quant_table_10_to_24[2048], &quant_table_10_to_26[2048], + &quant_table_10_to_28[2048], &quant_table_10_to_30[2048], &quant_table_10_to_32[2048], &quant_table_10_to_34[2048], + &quant_table_10_to_36[2048], &quant_table_10_to_38[2048], &quant_table_10_to_40[2048], &quant_table_10_to_42[2048], + &quant_table_10_to_44[2048], &quant_table_10_to_46[2048], &quant_table_10_to_48[2048], &quant_table_10_to_50[2048], + &quant_table_10_to_52[2048], &quant_table_10_to_54[2048], &quant_table_10_to_56[2048], &quant_table_10_to_58[2048], + &quant_table_10_to_60[2048], &quant_table_10_to_62[2048], &quant_table_10_to_64[2048], &quant_table_10_to_72[2048], + &quant_table_10_to_80[2048], &quant_table_10_to_88[2048], &quant_table_10_to_96[2048], &quant_table_10_to_104[2048], + &quant_table_10_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0, &quant_table_12_to_14[2048], &quant_table_12_to_16[2048], &quant_table_12_to_18[2048], + &quant_table_12_to_20[2048], &quant_table_12_to_22[2048], &quant_table_12_to_24[2048], &quant_table_12_to_26[2048], + &quant_table_12_to_28[2048], &quant_table_12_to_30[2048], &quant_table_12_to_32[2048], &quant_table_12_to_34[2048], + &quant_table_12_to_36[2048], &quant_table_12_to_38[2048], &quant_table_12_to_40[2048], &quant_table_12_to_42[2048], + &quant_table_12_to_44[2048], &quant_table_12_to_46[2048], &quant_table_12_to_48[2048], &quant_table_12_to_50[2048], + &quant_table_12_to_52[2048], &quant_table_12_to_54[2048], &quant_table_12_to_56[2048], &quant_table_12_to_58[2048], + &quant_table_12_to_60[2048], &quant_table_12_to_62[2048], &quant_table_12_to_64[2048], &quant_table_12_to_72[2048], + &quant_table_12_to_80[2048], &quant_table_12_to_88[2048], &quant_table_12_to_96[2048], &quant_table_12_to_104[2048], + &quant_table_12_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0, &quant_table_14_to_16[2048], &quant_table_14_to_18[2048], + &quant_table_14_to_20[2048], &quant_table_14_to_22[2048], &quant_table_14_to_24[2048], &quant_table_14_to_26[2048], + &quant_table_14_to_28[2048], &quant_table_14_to_30[2048], &quant_table_14_to_32[2048], &quant_table_14_to_34[2048], + &quant_table_14_to_36[2048], &quant_table_14_to_38[2048], &quant_table_14_to_40[2048], &quant_table_14_to_42[2048], + &quant_table_14_to_44[2048], &quant_table_14_to_46[2048], &quant_table_14_to_48[2048], &quant_table_14_to_50[2048], + &quant_table_14_to_52[2048], &quant_table_14_to_54[2048], &quant_table_14_to_56[2048], &quant_table_14_to_58[2048], + &quant_table_14_to_60[2048], &quant_table_14_to_62[2048], &quant_table_14_to_64[2048], &quant_table_14_to_72[2048], + &quant_table_14_to_80[2048], &quant_table_14_to_88[2048], &quant_table_14_to_96[2048], &quant_table_14_to_104[2048], + &quant_table_14_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_16_to_18[2048], + &quant_table_16_to_20[2048], &quant_table_16_to_22[2048], &quant_table_16_to_24[2048], &quant_table_16_to_26[2048], + &quant_table_16_to_28[2048], &quant_table_16_to_30[2048], &quant_table_16_to_32[2048], &quant_table_16_to_34[2048], + &quant_table_16_to_36[2048], &quant_table_16_to_38[2048], &quant_table_16_to_40[2048], &quant_table_16_to_42[2048], + &quant_table_16_to_44[2048], &quant_table_16_to_46[2048], &quant_table_16_to_48[2048], &quant_table_16_to_50[2048], + &quant_table_16_to_52[2048], &quant_table_16_to_54[2048], &quant_table_16_to_56[2048], &quant_table_16_to_58[2048], + &quant_table_16_to_60[2048], &quant_table_16_to_62[2048], &quant_table_16_to_64[2048], &quant_table_16_to_72[2048], + &quant_table_16_to_80[2048], &quant_table_16_to_88[2048], &quant_table_16_to_96[2048], &quant_table_16_to_104[2048], + &quant_table_16_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_18_to_20[2048], &quant_table_18_to_22[2048], &quant_table_18_to_24[2048], &quant_table_18_to_26[2048], + &quant_table_18_to_28[2048], &quant_table_18_to_30[2048], &quant_table_18_to_32[2048], &quant_table_18_to_34[2048], + &quant_table_18_to_36[2048], &quant_table_18_to_38[2048], &quant_table_18_to_40[2048], &quant_table_18_to_42[2048], + &quant_table_18_to_44[2048], &quant_table_18_to_46[2048], &quant_table_18_to_48[2048], &quant_table_18_to_50[2048], + &quant_table_18_to_52[2048], &quant_table_18_to_54[2048], &quant_table_18_to_56[2048], &quant_table_18_to_58[2048], + &quant_table_18_to_60[2048], &quant_table_18_to_62[2048], &quant_table_18_to_64[2048], &quant_table_18_to_72[2048], + &quant_table_18_to_80[2048], &quant_table_18_to_88[2048], &quant_table_18_to_96[2048], &quant_table_18_to_104[2048], + &quant_table_18_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_20_to_22[2048], &quant_table_20_to_24[2048], &quant_table_20_to_26[2048], + &quant_table_20_to_28[2048], &quant_table_20_to_30[2048], &quant_table_20_to_32[2048], &quant_table_20_to_34[2048], + &quant_table_20_to_36[2048], &quant_table_20_to_38[2048], &quant_table_20_to_40[2048], &quant_table_20_to_42[2048], + &quant_table_20_to_44[2048], &quant_table_20_to_46[2048], &quant_table_20_to_48[2048], &quant_table_20_to_50[2048], + &quant_table_20_to_52[2048], &quant_table_20_to_54[2048], &quant_table_20_to_56[2048], &quant_table_20_to_58[2048], + &quant_table_20_to_60[2048], &quant_table_20_to_62[2048], &quant_table_20_to_64[2048], &quant_table_20_to_72[2048], + &quant_table_20_to_80[2048], &quant_table_20_to_88[2048], &quant_table_20_to_96[2048], &quant_table_20_to_104[2048], + &quant_table_20_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_22_to_24[2048], &quant_table_22_to_26[2048], + &quant_table_22_to_28[2048], &quant_table_22_to_30[2048], &quant_table_22_to_32[2048], &quant_table_22_to_34[2048], + &quant_table_22_to_36[2048], &quant_table_22_to_38[2048], &quant_table_22_to_40[2048], &quant_table_22_to_42[2048], + &quant_table_22_to_44[2048], &quant_table_22_to_46[2048], &quant_table_22_to_48[2048], &quant_table_22_to_50[2048], + &quant_table_22_to_52[2048], &quant_table_22_to_54[2048], &quant_table_22_to_56[2048], &quant_table_22_to_58[2048], + &quant_table_22_to_60[2048], &quant_table_22_to_62[2048], &quant_table_22_to_64[2048], &quant_table_22_to_72[2048], + &quant_table_22_to_80[2048], &quant_table_22_to_88[2048], &quant_table_22_to_96[2048], &quant_table_22_to_104[2048], + &quant_table_22_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_24_to_26[2048], + &quant_table_24_to_28[2048], &quant_table_24_to_30[2048], &quant_table_24_to_32[2048], &quant_table_24_to_34[2048], + &quant_table_24_to_36[2048], &quant_table_24_to_38[2048], &quant_table_24_to_40[2048], &quant_table_24_to_42[2048], + &quant_table_24_to_44[2048], &quant_table_24_to_46[2048], &quant_table_24_to_48[2048], &quant_table_24_to_50[2048], + &quant_table_24_to_52[2048], &quant_table_24_to_54[2048], &quant_table_24_to_56[2048], &quant_table_24_to_58[2048], + &quant_table_24_to_60[2048], &quant_table_24_to_62[2048], &quant_table_24_to_64[2048], &quant_table_24_to_72[2048], + &quant_table_24_to_80[2048], &quant_table_24_to_88[2048], &quant_table_24_to_96[2048], &quant_table_24_to_104[2048], + &quant_table_24_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_26_to_28[2048], &quant_table_26_to_30[2048], &quant_table_26_to_32[2048], &quant_table_26_to_34[2048], + &quant_table_26_to_36[2048], &quant_table_26_to_38[2048], &quant_table_26_to_40[2048], &quant_table_26_to_42[2048], + &quant_table_26_to_44[2048], &quant_table_26_to_46[2048], &quant_table_26_to_48[2048], &quant_table_26_to_50[2048], + &quant_table_26_to_52[2048], &quant_table_26_to_54[2048], &quant_table_26_to_56[2048], &quant_table_26_to_58[2048], + &quant_table_26_to_60[2048], &quant_table_26_to_62[2048], &quant_table_26_to_64[2048], &quant_table_26_to_72[2048], + &quant_table_26_to_80[2048], &quant_table_26_to_88[2048], &quant_table_26_to_96[2048], &quant_table_26_to_104[2048], + &quant_table_26_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_28_to_30[2048], &quant_table_28_to_32[2048], &quant_table_28_to_34[2048], + &quant_table_28_to_36[2048], &quant_table_28_to_38[2048], &quant_table_28_to_40[2048], &quant_table_28_to_42[2048], + &quant_table_28_to_44[2048], &quant_table_28_to_46[2048], &quant_table_28_to_48[2048], &quant_table_28_to_50[2048], + &quant_table_28_to_52[2048], &quant_table_28_to_54[2048], &quant_table_28_to_56[2048], &quant_table_28_to_58[2048], + &quant_table_28_to_60[2048], &quant_table_28_to_62[2048], &quant_table_28_to_64[2048], &quant_table_28_to_72[2048], + &quant_table_28_to_80[2048], &quant_table_28_to_88[2048], &quant_table_28_to_96[2048], &quant_table_28_to_104[2048], + &quant_table_28_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_30_to_32[2048], &quant_table_30_to_34[2048], + &quant_table_30_to_36[2048], &quant_table_30_to_38[2048], &quant_table_30_to_40[2048], &quant_table_30_to_42[2048], + &quant_table_30_to_44[2048], &quant_table_30_to_46[2048], &quant_table_30_to_48[2048], &quant_table_30_to_50[2048], + &quant_table_30_to_52[2048], &quant_table_30_to_54[2048], &quant_table_30_to_56[2048], &quant_table_30_to_58[2048], + &quant_table_30_to_60[2048], &quant_table_30_to_62[2048], &quant_table_30_to_64[2048], &quant_table_30_to_72[2048], + &quant_table_30_to_80[2048], &quant_table_30_to_88[2048], &quant_table_30_to_96[2048], &quant_table_30_to_104[2048], + &quant_table_30_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_32_to_34[2048], + &quant_table_32_to_36[2048], &quant_table_32_to_38[2048], &quant_table_32_to_40[2048], &quant_table_32_to_42[2048], + &quant_table_32_to_44[2048], &quant_table_32_to_46[2048], &quant_table_32_to_48[2048], &quant_table_32_to_50[2048], + &quant_table_32_to_52[2048], &quant_table_32_to_54[2048], &quant_table_32_to_56[2048], &quant_table_32_to_58[2048], + &quant_table_32_to_60[2048], &quant_table_32_to_62[2048], &quant_table_32_to_64[2048], &quant_table_32_to_72[2048], + &quant_table_32_to_80[2048], &quant_table_32_to_88[2048], &quant_table_32_to_96[2048], &quant_table_32_to_104[2048], + &quant_table_32_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_34_to_36[2048], &quant_table_34_to_38[2048], &quant_table_34_to_40[2048], &quant_table_34_to_42[2048], + &quant_table_34_to_44[2048], &quant_table_34_to_46[2048], &quant_table_34_to_48[2048], &quant_table_34_to_50[2048], + &quant_table_34_to_52[2048], &quant_table_34_to_54[2048], &quant_table_34_to_56[2048], &quant_table_34_to_58[2048], + &quant_table_34_to_60[2048], &quant_table_34_to_62[2048], &quant_table_34_to_64[2048], &quant_table_34_to_72[2048], + &quant_table_34_to_80[2048], &quant_table_34_to_88[2048], &quant_table_34_to_96[2048], &quant_table_34_to_104[2048], + &quant_table_34_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_36_to_38[2048], &quant_table_36_to_40[2048], &quant_table_36_to_42[2048], + &quant_table_36_to_44[2048], &quant_table_36_to_46[2048], &quant_table_36_to_48[2048], &quant_table_36_to_50[2048], + &quant_table_36_to_52[2048], &quant_table_36_to_54[2048], &quant_table_36_to_56[2048], &quant_table_36_to_58[2048], + &quant_table_36_to_60[2048], &quant_table_36_to_62[2048], &quant_table_36_to_64[2048], &quant_table_36_to_72[2048], + &quant_table_36_to_80[2048], &quant_table_36_to_88[2048], &quant_table_36_to_96[2048], &quant_table_36_to_104[2048], + &quant_table_36_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_38_to_40[2048], &quant_table_38_to_42[2048], + &quant_table_38_to_44[2048], &quant_table_38_to_46[2048], &quant_table_38_to_48[2048], &quant_table_38_to_50[2048], + &quant_table_38_to_52[2048], &quant_table_38_to_54[2048], &quant_table_38_to_56[2048], &quant_table_38_to_58[2048], + &quant_table_38_to_60[2048], &quant_table_38_to_62[2048], &quant_table_38_to_64[2048], &quant_table_38_to_72[2048], + &quant_table_38_to_80[2048], &quant_table_38_to_88[2048], &quant_table_38_to_96[2048], &quant_table_38_to_104[2048], + &quant_table_38_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_40_to_42[2048], + &quant_table_40_to_44[2048], &quant_table_40_to_46[2048], &quant_table_40_to_48[2048], &quant_table_40_to_50[2048], + &quant_table_40_to_52[2048], &quant_table_40_to_54[2048], &quant_table_40_to_56[2048], &quant_table_40_to_58[2048], + &quant_table_40_to_60[2048], &quant_table_40_to_62[2048], &quant_table_40_to_64[2048], &quant_table_40_to_72[2048], + &quant_table_40_to_80[2048], &quant_table_40_to_88[2048], &quant_table_40_to_96[2048], &quant_table_40_to_104[2048], + &quant_table_40_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_42_to_44[2048], &quant_table_42_to_46[2048], &quant_table_42_to_48[2048], &quant_table_42_to_50[2048], + &quant_table_42_to_52[2048], &quant_table_42_to_54[2048], &quant_table_42_to_56[2048], &quant_table_42_to_58[2048], + &quant_table_42_to_60[2048], &quant_table_42_to_62[2048], &quant_table_42_to_64[2048], &quant_table_42_to_72[2048], + &quant_table_42_to_80[2048], &quant_table_42_to_88[2048], &quant_table_42_to_96[2048], &quant_table_42_to_104[2048], + &quant_table_42_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_44_to_46[2048], &quant_table_44_to_48[2048], &quant_table_44_to_50[2048], + &quant_table_44_to_52[2048], &quant_table_44_to_54[2048], &quant_table_44_to_56[2048], &quant_table_44_to_58[2048], + &quant_table_44_to_60[2048], &quant_table_44_to_62[2048], &quant_table_44_to_64[2048], &quant_table_44_to_72[2048], + &quant_table_44_to_80[2048], &quant_table_44_to_88[2048], &quant_table_44_to_96[2048], &quant_table_44_to_104[2048], + &quant_table_44_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_46_to_48[2048], &quant_table_46_to_50[2048], + &quant_table_46_to_52[2048], &quant_table_46_to_54[2048], &quant_table_46_to_56[2048], &quant_table_46_to_58[2048], + &quant_table_46_to_60[2048], &quant_table_46_to_62[2048], &quant_table_46_to_64[2048], &quant_table_46_to_72[2048], + &quant_table_46_to_80[2048], &quant_table_46_to_88[2048], &quant_table_46_to_96[2048], &quant_table_46_to_104[2048], + &quant_table_46_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_48_to_50[2048], + &quant_table_48_to_52[2048], &quant_table_48_to_54[2048], &quant_table_48_to_56[2048], &quant_table_48_to_58[2048], + &quant_table_48_to_60[2048], &quant_table_48_to_62[2048], &quant_table_48_to_64[2048], &quant_table_48_to_72[2048], + &quant_table_48_to_80[2048], &quant_table_48_to_88[2048], &quant_table_48_to_96[2048], &quant_table_48_to_104[2048], + &quant_table_48_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_50_to_52[2048], &quant_table_50_to_54[2048], &quant_table_50_to_56[2048], &quant_table_50_to_58[2048], + &quant_table_50_to_60[2048], &quant_table_50_to_62[2048], &quant_table_50_to_64[2048], &quant_table_50_to_72[2048], + &quant_table_50_to_80[2048], &quant_table_50_to_88[2048], &quant_table_50_to_96[2048], &quant_table_50_to_104[2048], + &quant_table_50_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_52_to_54[2048], &quant_table_52_to_56[2048], &quant_table_52_to_58[2048], + &quant_table_52_to_60[2048], &quant_table_52_to_62[2048], &quant_table_52_to_64[2048], &quant_table_52_to_72[2048], + &quant_table_52_to_80[2048], &quant_table_52_to_88[2048], &quant_table_52_to_96[2048], &quant_table_52_to_104[2048], + &quant_table_52_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_54_to_56[2048], &quant_table_54_to_58[2048], + &quant_table_54_to_60[2048], &quant_table_54_to_62[2048], &quant_table_54_to_64[2048], &quant_table_54_to_72[2048], + &quant_table_54_to_80[2048], &quant_table_54_to_88[2048], &quant_table_54_to_96[2048], &quant_table_54_to_104[2048], + &quant_table_54_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_56_to_58[2048], + &quant_table_56_to_60[2048], &quant_table_56_to_62[2048], &quant_table_56_to_64[2048], &quant_table_56_to_72[2048], + &quant_table_56_to_80[2048], &quant_table_56_to_88[2048], &quant_table_56_to_96[2048], &quant_table_56_to_104[2048], + &quant_table_56_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_58_to_60[2048], &quant_table_58_to_62[2048], &quant_table_58_to_64[2048], &quant_table_58_to_72[2048], + &quant_table_58_to_80[2048], &quant_table_58_to_88[2048], &quant_table_58_to_96[2048], &quant_table_58_to_104[2048], + &quant_table_58_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_60_to_62[2048], &quant_table_60_to_64[2048], &quant_table_60_to_72[2048], + &quant_table_60_to_80[2048], &quant_table_60_to_88[2048], &quant_table_60_to_96[2048], &quant_table_60_to_104[2048], + &quant_table_60_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_62_to_64[2048], &quant_table_62_to_72[2048], + &quant_table_62_to_80[2048], &quant_table_62_to_88[2048], &quant_table_62_to_96[2048], &quant_table_62_to_104[2048], + &quant_table_62_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_64_to_72[2048], + &quant_table_64_to_80[2048], &quant_table_64_to_88[2048], &quant_table_64_to_96[2048], &quant_table_64_to_104[2048], + &quant_table_64_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_72_to_80[2048], &quant_table_72_to_88[2048], &quant_table_72_to_96[2048], &quant_table_72_to_104[2048], + &quant_table_72_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_80_to_88[2048], &quant_table_80_to_96[2048], &quant_table_80_to_104[2048], + &quant_table_80_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_88_to_96[2048], &quant_table_88_to_104[2048], + &quant_table_88_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_96_to_104[2048], + &quant_table_96_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, &quant_table_104_to_112[2048]}, +{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} +}; + diff --git a/k9vamps/tcmemcpy.cpp b/k9vamps/tcmemcpy.cpp new file mode 100644 index 0000000..ceb7c69 --- /dev/null +++ b/k9vamps/tcmemcpy.cpp @@ -0,0 +1,483 @@ +/* + * tcmemcpy.c - optimized memcpy() routines for transcode + * Written by Andrew Church + */ + +#include +#include +#include "ac.h" + +/*************************************************************************/ + +#if defined(ARCH_X86) + +/* MMX-optimized routine, intended for PMMX/PII processors. + * Nonstandard instructions used: + * (CPUID.MMX) MOVQ + */ + +void *ac_memcpy_mmx(void *dest, const void *src, size_t bytes) +{ + asm("\ +PENTIUM_LINE_SIZE = 32 # PMMX/PII cache line size \n\ +PENTIUM_CACHE_SIZE = 8192 # PMMX/PII total cache size \n\ +# Use only half because writes may touch the cache too (PII) \n\ +PENTIUM_CACHE_BLOCK = (PENTIUM_CACHE_SIZE/2 - PENTIUM_LINE_SIZE) \n\ + \n\ + push %%ebx # Save PIC register \n\ + push %%edi # Save destination for return value \n\ + cld # MOVS* should ascend \n\ + \n\ + mov $64, %%ebx # Constant \n\ + \n\ + cmp %%ebx, %%ecx \n\ + jb mmx.memcpy_last # Just use movs if <64 bytes \n\ + \n\ + # First align destination address to a multiple of 8 bytes \n\ + mov $8, %%eax # EAX <- (8-dest) & 7 \n\ + sub %%edi, %%eax \n\ + and $0b111, %%eax # ... which is the number of bytes to copy\n\ + lea 0f, %%edx # Use a computed jump--faster than a loop\n\ + sub %%eax, %%edx \n\ + jmp *%%edx # Execute 0-7 MOVSB's \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ +0: sub %%eax, %%ecx # Update count \n\ + \n\ + # Now copy data in blocks \n\ +0: mov %%ecx, %%edx # EDX <- ECX >> 6 (cache lines to copy) \n\ + shr $6, %%edx \n\ + jz mmx.memcpy_last # <64 bytes left? Skip to end \n\ + cmp $PENTIUM_CACHE_BLOCK/64, %%edx \n\ + jb 1f # Limit size of block \n\ + mov $PENTIUM_CACHE_BLOCK/64, %%edx \n\ +1: mov %%edx, %%eax # EAX <- EDX << 6 (bytes to copy) \n\ + shl $6, %%eax \n\ + sub %%eax, %%ecx # Update remaining count \n\ + add %%eax, %%esi # Point to end of region to be block-copied\n\ +2: test %%eax, -32(%%esi) # Touch each cache line in reverse order\n\ + test %%eax, -64(%%esi) \n\ + sub %%ebx, %%esi # Update pointer \n\ + sub %%ebx, %%eax # And loop \n\ + jnz 2b \n\ + # Note that ESI now points to the beginning of the block \n\ +3: movq (%%esi), %%mm0 # Do the actual copy, 64 bytes at a time\n\ + movq 8(%%esi), %%mm1 \n\ + movq 16(%%esi), %%mm2 \n\ + movq 24(%%esi), %%mm3 \n\ + movq 32(%%esi), %%mm4 \n\ + movq 40(%%esi), %%mm5 \n\ + movq 48(%%esi), %%mm6 \n\ + movq 56(%%esi), %%mm7 \n\ + movq %%mm0, (%%edi) \n\ + movq %%mm1, 8(%%edi) \n\ + movq %%mm2, 16(%%edi) \n\ + movq %%mm3, 24(%%edi) \n\ + movq %%mm4, 32(%%edi) \n\ + movq %%mm5, 40(%%edi) \n\ + movq %%mm6, 48(%%edi) \n\ + movq %%mm7, 56(%%edi) \n\ + add %%ebx, %%esi # Update pointers \n\ + add %%ebx, %%edi \n\ + dec %%edx # And loop \n\ + jnz 3b \n\ + jmp 0b \n\ + \n\ +mmx.memcpy_last: \n\ + # Copy last <64 bytes, using the computed jump trick \n\ + mov %%ecx, %%eax # EAX <- ECX>>2 \n\ + shr $2, %%eax \n\ + lea 0f, %%edx \n\ + sub %%eax, %%edx \n\ + jmp *%%edx # Execute 0-15 MOVSD's \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ +0: and $0b11, %%ecx # ECX <- ECX & 3 \n\ + lea 0f, %%edx \n\ + sub %%ecx, %%edx \n\ + jmp *%%edx # Execute 0-3 MOVSB's \n\ + movsb \n\ + movsb \n\ + movsb \n\ +0: \n\ + # All done! \n\ + emms # Clean up MMX state \n\ + pop %%edi # Restore destination (return value) \n\ + pop %%ebx # Restore PIC register \n\ + " : /* no outputs */ + : "D" (dest), "S" (src), "c" (bytes) + : "%eax", "%edx" + ); + return dest; +} + +#endif /* ARCH_X86 */ + +/*************************************************************************/ + +#if defined(ARCH_X86) + +/* SSE-optimized routine. Backported from AMD64 routine below. + * Nonstandard instructions used: + * (CPUID.CMOVE) CMOVA + * (CPUID.MMX) MOVQ + * (CPUID.SSE) MOVNTQ + */ + +void *ac_memcpy_sse(void *dest, const void *src, size_t bytes) +{ + asm("\ + push %%ebx # Save PIC register \n\ + push %%edi # Save destination for return value \n\ + cld # MOVS* should ascend \n\ + \n\ + cmp $64, %%ecx # Skip block copy for small blocks \n\ + jb sse.memcpy_last \n\ + \n\ + mov $128, %%ebx # Constant used later \n\ + \n\ + # First align destination address to a multiple of 8 bytes \n\ + mov $8, %%eax # EAX <- (8-dest) & 7 \n\ + sub %%edi, %%eax \n\ + and $0b111, %%eax # ... which is the number of bytes to copy\n\ + lea 0f, %%edx # Use a computed jump--faster than a loop\n\ + sub %%eax, %%edx \n\ + jmp *%%edx # Execute 0-7 MOVSB's \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ +0: sub %%eax, %%ecx # Update count \n\ + \n\ + cmp $0x10040, %%ecx # Is this a large block? (0x10040 is an \n\ + # arbitrary value where prefetching and \n\ + # write combining seem to start becoming\n\ + # faster) \n\ + jae sse.memcpy_bp # Yup, use prefetch copy \n\ + \n\ +sse.memcpy_small: # Small block copy routine--no prefetch \n" +#if 0 +" mov %%ecx, %%edx # EDX <- bytes to copy / 8 \n\ + shr $3, %%edx \n\ + mov %%edx, %%eax # Leave remainder in ECX for later \n\ + shl $3, %%eax \n\ + sub %%eax, %%ecx \n\ + .align 16 \n\ +0: movq (%%esi), %%mm0 # Copy 8 bytes of data \n\ + movq %%mm0, (%%edi) \n\ + add $8, %%esi # Update pointers \n\ + add $8, %%edi \n\ + dec %%edx # And loop \n\ + jg 0b \n\ + jmp sse.memcpy_last # Copy any remaining bytes \n\ + \n\ + nop # Align loops below \n" +#else +" # It appears that a simple rep movs is faster than cleverness \n\ + # with movq... \n\ + mov %%ecx, %%edx # EDX <- ECX & 3 \n\ + and $0b11, %%edx \n\ + shr $2, %%ecx # ECX <- ECX >> 2 \n\ + rep movsl # Copy away! \n\ + mov %%edx, %%ecx # Take care of last 0-3 bytes \n\ + rep movsb \n\ + jmp sse.memcpy_end # And exit \n\ + \n\ + .align 16 \n\ + nop \n\ + nop \n" +#endif +"sse.memcpy_bp: # Block prefetch copy routine \n\ +0: mov %%ecx, %%edx # EDX: temp counter \n\ + shr $6, %%edx # Divide by cache line size (64 bytes) \n\ + cmp %%ebx, %%edx # ... and cap at 128 (8192 bytes) \n\ + cmova %%ebx, %%edx \n\ + shl $3, %%edx # EDX <- cache lines to copy * 8 \n\ + mov %%edx, %%eax # EAX <- cache lines to preload * 8 \n\ + # (also used as memory offset) \n\ +1: test %%eax, -64(%%esi,%%eax,8) # Preload cache lines in pairs \n\ + test %%eax, -128(%%esi,%%eax,8) # (going backwards) \n\ + # (note that test %%eax,... seems to be faster than prefetchnta \n\ + # on x86) \n\ + sub $16, %%eax # And loop \n\ + jg 1b \n\ + \n\ + # Then copy--forward, which seems to be faster than reverse for \n\ + # certain alignments \n\ + xor %%eax, %%eax \n\ +2: movq (%%esi,%%eax,8), %%mm0 # Copy 8 bytes and loop \n\ + movntq %%mm0, (%%edi,%%eax,8) \n\ + inc %%eax \n\ + cmp %%edx, %%eax \n\ + jb 2b \n\ + \n\ + # Finally, update pointers and count, and loop \n\ + shl $3, %%edx # EDX <- bytes copied \n\ + add %%edx, %%esi \n\ + add %%edx, %%edi \n\ + sub %%edx, %%ecx \n\ + cmp $64, %%ecx # At least one cache line left? \n\ + jae 0b # Yup, loop \n\ + \n\ +sse.memcpy_last: \n\ + # Copy last <64 bytes, using the computed jump trick \n\ + mov %%ecx, %%eax # EAX <- ECX>>2 \n\ + shr $2, %%eax \n\ + lea 0f, %%edx \n\ + sub %%eax, %%edx \n\ + jmp *%%edx # Execute 0-15 MOVSD's \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ + movsd \n\ +0: and $0b11, %%ecx # ECX <- ECX & 3 \n\ + lea sse.memcpy_end, %%edx \n\ + sub %%ecx, %%edx \n\ + jmp *%%edx # Execute 0-3 MOVSB's \n\ + movsb \n\ + movsb \n\ + movsb \n\ + \n\ +sse.memcpy_end: \n\ + # All done! \n\ + emms # Clean up after MMX instructions \n\ + sfence # Flush the write buffer \n\ + pop %%edi # Restore destination (return value) \n\ + pop %%ebx # Restore PIC register \n\ + " : /* no outputs */ + : "D" (dest), "S" (src), "c" (bytes) + : "%eax", "%edx" + ); + return dest; +} + +#endif /* ARCH_X86 */ + +/*************************************************************************/ + +#if defined(ARCH_X86_64) + +/* AMD64-optimized routine, using SSE2. Derived from AMD64 optimization + * guide section 5.13: Appropriate Memory Copying Routines. + * Nonstandard instructions used: + * (CPUID.CMOVE) CMOVA + * (CPUID.SSE2) MOVDQA, MOVDQU, MOVNTDQ + * + * Note that this routine will also run more or less as-is (modulo register + * names and label(%%rip) references) on x86 CPUs, but tests have shown the + * SSE1 version above to be faster. + */ + +/* The block copying code--macroized because we use two versions of it + * depending on whether the source is 16-byte-aligned or not. Pass either + * movdqa or movdqu (unquoted) for the parameter. */ +#define AMD64_BLOCK_MEMCPY(movdq) \ +" # First prefetch (note that if we end on an odd number of cache \n\ + # lines, we skip prefetching the last one--faster that way than \n\ + # prefetching line by line or treating it as a special case) \n\ +0: mov %%ecx, %%edx # EDX: temp counter (always <32 bits) \n\ + shr $6, %%edx # Divide by cache line size (64 bytes) \n\ + cmp %%ebx, %%edx # ... and cap at 128 (8192 bytes) \n\ + cmova %%ebx, %%edx \n\ + shl $3, %%edx # EDX <- cache lines to copy * 8 \n\ + mov %%edx, %%eax # EAX <- cache lines to preload * 8 \n\ + # (also used as memory offset) \n\ +1: prefetchnta -64(%%rsi,%%rax,8) # Preload cache lines in pairs \n\ + prefetchnta -128(%%rsi,%%rax,8) # (going backwards) \n\ + sub $16, %%eax # And loop \n\ + jg 1b \n\ + \n\ + # Then copy--forward, which seems to be faster than reverse for \n\ + # certain alignments \n\ + xor %%eax, %%eax \n\ +2: " #movdq " (%%rsi,%%rax,8), %%xmm0 # Copy 16 bytes and loop \n\ + movntdq %%xmm0, (%%rdi,%%rax,8) \n\ + add $2, %%eax \n\ + cmp %%edx, %%eax \n\ + jb 2b \n\ + \n\ + # Finally, update pointers and count, and loop \n\ + shl $3, %%edx # EDX <- bytes copied \n\ + add %%rdx, %%rsi \n\ + add %%rdx, %%rdi \n\ + sub %%rdx, %%rcx \n\ + cmp $64, %%rcx # At least one cache line left? \n\ + jae 0b # Yup, loop \n" + +void *ac_memcpy_amd64(void *dest, const void *src, size_t bytes) +{ + asm("\ + push %%rdi # Save destination for return value \n\ + cld # MOVS* should ascend \n\ + \n\ + cmp $64, %%rcx # Skip block copy for small blocks \n\ + jb amd64.memcpy_last \n\ + \n\ + mov $128, %%ebx # Constant used later \n\ + \n\ + # First align destination address to a multiple of 16 bytes \n\ + mov $8, %%eax # EAX <- (8-dest) & 7 \n\ + sub %%edi, %%eax # (we don't care about the top 32 bits) \n\ + and $0b111, %%eax # ... which is the number of bytes to copy\n\ + lea 0f(%%rip), %%rdx # Use a computed jump--faster than a loop\n\ + sub %%rax, %%rdx \n\ + jmp *%%rdx # Execute 0-7 MOVSB's \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ +0: sub %%rax, %%rcx # Update count \n\ + test $0b1000, %%edi # Is destination not 16-byte aligned? \n\ + je 1f \n\ + movsq # Then move 8 bytes to align it \n\ + sub $8, %%rcx \n\ + \n\ +1: cmp $0x38000, %%rcx # Is this a large block? (0x38000 is an \n\ + # arbitrary value where prefetching and \n\ + # write combining seem to start becoming\n\ + # faster) \n\ + jb amd64.memcpy_small # Nope, use small copy (no prefetch/WC) \n\ + test $0b1111, %%esi # Is source also 16-byte aligned? \n\ + # (use ESI to save a REX prefix byte) \n\ + jnz amd64.memcpy_normal_bp # Nope, use slow copy \n\ + jmp amd64.memcpy_fast_bp # Yup, use fast copy \n\ + \n\ +amd64.memcpy_small: # Small block copy routine--no prefetch \n\ + mov %%ecx, %%edx # EDX <- bytes to copy / 16 \n\ + shr $4, %%edx # (count known to fit in 32 bits) \n\ + mov %%edx, %%eax # Leave remainder in ECX for later \n\ + shl $4, %%eax \n\ + sub %%eax, %%ecx \n\ + .align 16 \n\ +0: movdqu (%%rsi), %%xmm0 # Copy 16 bytes of data \n\ + movdqa %%xmm0, (%%rdi) \n\ + add $16, %%rsi # Update pointers \n\ + add $16, %%rdi \n\ + dec %%edx # And loop \n\ + jnz 0b \n\ + jmp amd64.memcpy_last # Copy any remaining bytes \n\ + \n\ + .align 16 \n\ + nop \n\ + nop \n\ +amd64.memcpy_fast_bp: # Fast block prefetch loop \n" +AMD64_BLOCK_MEMCPY(movdqa) +" jmp amd64.memcpy_last # Copy any remaining bytes \n\ + \n\ + .align 16 \n\ + nop \n\ + nop \n\ +amd64.memcpy_normal_bp: # Normal (unaligned) block prefetch loop\n" +AMD64_BLOCK_MEMCPY(movdqu) +" \n\ +amd64.memcpy_last: \n\ + # Copy last <64 bytes, using the computed jump trick \n\ + mov %%ecx, %%eax # EAX <- ECX>>3 \n\ + shr $3, %%eax \n\ + lea 0f(%%rip), %%rdx \n\ + add %%eax, %%eax # Watch out, MOVSQ is 2 bytes! \n\ + sub %%rax, %%rdx \n\ + jmp *%%rdx # Execute 0-7 MOVSQ's \n\ + movsq \n\ + movsq \n\ + movsq \n\ + movsq \n\ + movsq \n\ + movsq \n\ + movsq \n\ +0: and $0b111, %%ecx # ECX <- ECX & 7 \n\ + lea 0f(%%rip), %%rdx \n\ + sub %%rcx, %%rdx \n\ + jmp *%%rdx # Execute 0-7 MOVSB's \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ + movsb \n\ +0: \n\ + # All done! \n\ + emms # Clean up after MMX instructions \n\ + sfence # Flush the write buffer \n\ + pop %%rdi # Restore destination (return value) \n\ + " : /* no outputs */ + : "D" (dest), "S" (src), "c" (bytes) + : "%rax", "%rbx", "%rdx" + ); + return dest; +} + +#endif /* ARCH_X86_64 */ + +/*************************************************************************/ + +void * (*tc_memcpy)(void *, const void *, size_t) = memcpy; + +void tc_memcpy_init(int verbose, int mmflags) +{ + const char * method = "libc"; + +#if defined(ARCH_X86) || defined(ARCH_X86_64) + int accel = mmflags == -1 ? ac_mmflag() : mmflags; +#endif + +#if defined(ARCH_X86) + if((accel & MM_CMOVE) && (accel & MM_SSE)) + { + method = "sse"; + tc_memcpy = ac_memcpy_sse; + } + else if(accel & MM_MMX) + { + method = "mmx"; + tc_memcpy = ac_memcpy_mmx; + } +#endif + +#if defined(ARCH_X86_64) + if((accel & MM_CMOVE) && (accel & MM_SSE2)) + { + method = "amd64"; + tc_memcpy = ac_memcpy_amd64; + } +#endif + + if(verbose) + fprintf(stderr, "tc_memcpy: using %s for memcpy\n", method); +} diff --git a/libdvdnav/Makefile.am b/libdvdnav/Makefile.am new file mode 100644 index 0000000..13baa2d --- /dev/null +++ b/libdvdnav/Makefile.am @@ -0,0 +1,14 @@ + +METASOURCES = AUTO + +noinst_LTLIBRARIES = libk9dvdnav.la +libk9dvdnav_la_SOURCES = decoder.c decoder.h dvdnav.c dvdnav_events.h dvdnav.h \ + dvdnav_internal.h highlight.c navigation.c read_cache.c read_cache.h remap.c remap.h \ + searching.c settings.c vm.c vmcmd.c vmcmd.h vm.h compat.h dvd_types.h + + +noinst_HEADERS = common.h dvdread.h + + + +INCLUDES = -I$(top_srcdir)/dvdread diff --git a/libdvdnav/common.h b/libdvdnav/common.h new file mode 100644 index 0000000..c54924e --- /dev/null +++ b/libdvdnav/common.h @@ -0,0 +1,16 @@ +#include "config.h" +#ifndef __STDC_LIMIT_MACROS + #define __STDC_LIMIT_MACROS +#endif + +#if defined(HAVE_INTTYPES_H) + #include +#elif defined( HAVE_STDINT_H) + #include +#endif + +#include "ifo_types.h" +#include "dvd_reader.h" +#include "ifo_read.h" +#include "nav_read.h" +#include "nav_types.h" diff --git a/libdvdnav/compat.h b/libdvdnav/compat.h new file mode 100644 index 0000000..08b2957 --- /dev/null +++ b/libdvdnav/compat.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2000-2001 the xine project + * + * This file is part of xine, a unix video player. + * + * xine 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. + * + * xine is distributed in the hope that 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 + * + * $Id: compat.h,v 1.3 2003/04/20 21:13:26 guenter Exp $ + * + */ + +#ifndef XINE_COMPAT_H +#define XINE_COMPAT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined _MSC_VER +#define __XINE_FUNCTION__ __FILE__ +#elif defined __GNUC__ +#define __XINE_FUNCTION__ __FUNCTION__ +#else +#define __XINE_FUNCTION__ __func__ +#endif + +#ifndef NAME_MAX +#define XINE_NAME_MAX 256 +#else +#define XINE_NAME_MAX NAME_MAX +#endif + +#ifndef PATH_MAX +#define XINE_PATH_MAX 768 +#else +#define XINE_PATH_MAX PATH_MAX +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libdvdnav/decoder.c b/libdvdnav/decoder.c new file mode 100644 index 0000000..1c21f60 --- /dev/null +++ b/libdvdnav/decoder.c @@ -0,0 +1,777 @@ +/* + * Copyright (C) 2000, 2001 Martin Norb�k, H�an Hjort + * 2002-2004 the dvdnav project + * + * This file is part of libdvdnav, a DVD navigation library. It is modified + * from a file originally part of the Ogle DVD player. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: decoder.c,v 1.14 2004/03/16 11:43:38 mroi Exp $ + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "common.h" +#include +#include +#include /* For memset */ + +#include "dvdnav_internal.h" + +uint32_t vm_getbits(command_t *command, int32_t start, int32_t count) { + uint64_t result = 0; + uint64_t bit_mask = 0; + uint64_t examining = 0; + int32_t bits; + + if (count == 0) return 0; + + if ( ((start - count) < -1) || + (count > 32) || + (start > 63) || + (count < 0) || + (start < 0) ) { + fprintf(MSG_OUT, "libdvdnav: Bad call to vm_getbits. Parameter out of range\n"); + abort(); + } + /* all ones, please */ + bit_mask = ~bit_mask; + bit_mask >>= 63 - start; + bits = start + 1 - count; + examining = ((bit_mask >> bits) << bits ); + command->examined |= examining; + result = (command->instruction & bit_mask) >> bits; + return (uint32_t) result; +} + +static uint16_t get_GPRM(registers_t* registers, uint8_t reg) { + if (registers->GPRM_mode[reg] & 0x01) { + struct timeval current_time, time_offset; + uint16_t result; + /* Counter mode */ + /* fprintf(MSG_OUT, "libdvdnav: Getting counter %d\n",reg);*/ + gettimeofday(¤t_time, NULL); + time_offset.tv_sec = current_time.tv_sec - registers->GPRM_time[reg].tv_sec; + time_offset.tv_usec = current_time.tv_usec - registers->GPRM_time[reg].tv_usec; + if (time_offset.tv_usec < 0) { + time_offset.tv_sec--; + time_offset.tv_usec += 1000000; + } + result = (uint16_t) (time_offset.tv_sec & 0xffff); + registers->GPRM[reg]=result; + return result; + + } else { + /* Register mode */ + return registers->GPRM[reg]; + } + +} + +static void set_GPRM(registers_t* registers, uint8_t reg, uint16_t value) { + if (registers->GPRM_mode[reg] & 0x01) { + struct timeval current_time; + /* Counter mode */ + /* fprintf(MSG_OUT, "libdvdnav: Setting counter %d\n",reg); */ + gettimeofday(¤t_time, NULL); + registers->GPRM_time[reg] = current_time; + registers->GPRM_time[reg].tv_sec -= value; + } + registers->GPRM[reg] = value; +} + +/* Eval register code, can either be system or general register. + SXXX_XXXX, where S is 1 if it is system register. */ +static uint16_t eval_reg(command_t* command, uint8_t reg) { + if(reg & 0x80) { + if ((reg & 0x1f) == 20) { + fprintf(MSG_OUT, "libdvdnav: Suspected RCE Region Protection!!!\n"); + } + return command->registers->SPRM[reg & 0x1f]; /* FIXME max 24 not 32 */ + } else { + return get_GPRM(command->registers, reg & 0x0f) ; + } +} + +/* Eval register or immediate data. + AAAA_AAAA BBBB_BBBB, if immediate use all 16 bits for data else use + lower eight bits for the system or general purpose register. */ +static uint16_t eval_reg_or_data(command_t* command, int32_t imm, int32_t start) { + if(imm) { /* immediate */ + return vm_getbits(command, start, 16); + } else { + return eval_reg(command, vm_getbits(command, (start - 8), 8)); + } +} + +/* Eval register or immediate data. + xBBB_BBBB, if immediate use all 7 bits for data else use + lower four bits for the general purpose register number. */ +/* Evaluates gprm or data depending on bit, data is in byte n */ +static uint16_t eval_reg_or_data_2(command_t* command, + int32_t imm, int32_t start) { + if(imm) /* immediate */ + return vm_getbits(command, (start - 1), 7); + else + return get_GPRM(command->registers, (vm_getbits(command, (start - 4), 4)) ); +} + + +/* Compare data using operation, return result from comparison. + Helper function for the different if functions. */ +static int32_t eval_compare(uint8_t operation, uint16_t data1, uint16_t data2) { + switch(operation) { + case 1: + return data1 & data2; + case 2: + return data1 == data2; + case 3: + return data1 != data2; + case 4: + return data1 >= data2; + case 5: + return data1 > data2; + case 6: + return data1 <= data2; + case 7: + return data1 < data2; + } + fprintf(MSG_OUT, "libdvdnav: eval_compare: Invalid comparison code\n"); + return 0; +} + + +/* Evaluate if version 1. + Has comparison data in byte 3 and 4-5 (immediate or register) */ +static int32_t eval_if_version_1(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + if(op) { + return eval_compare(op, eval_reg(command, vm_getbits(command, 39, 8)), + eval_reg_or_data(command, vm_getbits(command, 55, 1), 31)); + } + return 1; +} + +/* Evaluate if version 2. + This version only compares register which are in byte 6 and 7 */ +static int32_t eval_if_version_2(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + if(op) { + return eval_compare(op, eval_reg(command, vm_getbits(command, 15, 8)), + eval_reg(command, vm_getbits(command, 7, 8))); + } + return 1; +} + +/* Evaluate if version 3. + Has comparison data in byte 2 and 6-7 (immediate or register) */ +static int32_t eval_if_version_3(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + if(op) { + return eval_compare(op, eval_reg(command, vm_getbits(command, 47, 8)), + eval_reg_or_data(command, vm_getbits(command, 55, 1), 15)); + } + return 1; +} + +/* Evaluate if version 4. + Has comparison data in byte 1 and 4-5 (immediate or register) + The register in byte 1 is only the lowe nibble (4 bits) */ +static int32_t eval_if_version_4(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + if(op) { + return eval_compare(op, eval_reg(command, vm_getbits(command, 51, 4)), + eval_reg_or_data(command, vm_getbits(command, 55, 1), 31)); + } + return 1; +} + +/* Evaluate special instruction.... returns the new row/line number, + 0 if no new row and 256 if Break. */ +static int32_t eval_special_instruction(command_t* command, int32_t cond) { + int32_t line, level; + + switch(vm_getbits(command, 51, 4)) { + case 0: /* NOP */ + line = 0; + return cond ? line : 0; + case 1: /* Goto line */ + line = vm_getbits(command, 7, 8); + return cond ? line : 0; + case 2: /* Break */ + /* max number of rows < 256, so we will end this set */ + line = 256; + return cond ? 256 : 0; + case 3: /* Set temporary parental level and goto */ + line = vm_getbits(command, 7, 8); + level = vm_getbits(command, 11, 4); + if(cond) { + /* This always succeeds now, if we want real parental protection */ + /* we need to ask the user and have passwords and stuff. */ + command->registers->SPRM[13] = level; + } + return cond ? line : 0; + } + return 0; +} + +/* Evaluate link by subinstruction. + Return 1 if link, or 0 if no link + Actual link instruction is in return_values parameter */ +static int32_t eval_link_subins(command_t* command, int32_t cond, link_t *return_values) { + uint16_t button = vm_getbits(command, 15, 6); + uint8_t linkop = vm_getbits(command, 4, 5); + + if(linkop > 0x10) + return 0; /* Unknown Link by Sub-Instruction command */ + + /* Assumes that the link_cmd_t enum has the same values as the LinkSIns codes */ + return_values->command = linkop; + return_values->data1 = button; + return cond; +} + + +/* Evaluate link instruction. + Return 1 if link, or 0 if no link + Actual link instruction is in return_values parameter */ +static int32_t eval_link_instruction(command_t* command, int32_t cond, link_t *return_values) { + uint8_t op = vm_getbits(command, 51, 4); + + switch(op) { + case 1: + return eval_link_subins(command, cond, return_values); + case 4: + return_values->command = LinkPGCN; + return_values->data1 = vm_getbits(command, 14, 15); + return cond; + case 5: + return_values->command = LinkPTTN; + return_values->data1 = vm_getbits(command, 9, 10); + return_values->data2 = vm_getbits(command, 15, 6); + return cond; + case 6: + return_values->command = LinkPGN; + return_values->data1 = vm_getbits(command, 6, 7); + return_values->data2 = vm_getbits(command, 15, 6); + return cond; + case 7: + return_values->command = LinkCN; + return_values->data1 = vm_getbits(command, 7, 8); + return_values->data2 = vm_getbits(command, 15, 6); + return cond; + } + return 0; +} + + +/* Evaluate a jump instruction. + returns 1 if jump or 0 if no jump + actual jump instruction is in return_values parameter */ +static int32_t eval_jump_instruction(command_t* command, int32_t cond, link_t *return_values) { + + switch(vm_getbits(command, 51, 4)) { + case 1: + return_values->command = Exit; + return cond; + case 2: + return_values->command = JumpTT; + return_values->data1 = vm_getbits(command, 22, 7); + return cond; + case 3: + return_values->command = JumpVTS_TT; + return_values->data1 = vm_getbits(command, 22, 7); + return cond; + case 5: + return_values->command = JumpVTS_PTT; + return_values->data1 = vm_getbits(command, 22, 7); + return_values->data2 = vm_getbits(command, 41, 10); + return cond; + case 6: + switch(vm_getbits(command, 23, 2)) { + case 0: + return_values->command = JumpSS_FP; + return cond; + case 1: + return_values->command = JumpSS_VMGM_MENU; + return_values->data1 = vm_getbits(command, 19, 4); + return cond; + case 2: + return_values->command = JumpSS_VTSM; + return_values->data1 = vm_getbits(command, 31, 8); + return_values->data2 = vm_getbits(command, 39, 8); + return_values->data3 = vm_getbits(command, 19, 4); + return cond; + case 3: + return_values->command = JumpSS_VMGM_PGC; + return_values->data1 = vm_getbits(command, 46, 15); + return cond; + } + break; + case 8: + switch(vm_getbits(command, 23, 2)) { + case 0: + return_values->command = CallSS_FP; + return_values->data1 = vm_getbits(command, 31, 8); + return cond; + case 1: + return_values->command = CallSS_VMGM_MENU; + return_values->data1 = vm_getbits(command, 19, 4); + return_values->data2 = vm_getbits(command, 31, 8); + return cond; + case 2: + return_values->command = CallSS_VTSM; + return_values->data1 = vm_getbits(command, 19, 4); + return_values->data2 = vm_getbits(command, 31, 8); + return cond; + case 3: + return_values->command = CallSS_VMGM_PGC; + return_values->data1 = vm_getbits(command, 46, 15); + return_values->data2 = vm_getbits(command, 31, 8); + return cond; + } + break; + } + return 0; +} + +/* Evaluate a set sytem register instruction + May contain a link so return the same as eval_link */ +static int32_t eval_system_set(command_t* command, int32_t cond, link_t *return_values) { + int32_t i; + uint16_t data, data2; + + switch(vm_getbits(command, 59, 4)) { + case 1: /* Set system reg 1 &| 2 &| 3 (Audio, Subp. Angle) */ + for(i = 1; i <= 3; i++) { + if(vm_getbits(command, 63 - ((2 + i)*8), 1)) { + data = eval_reg_or_data_2(command, vm_getbits(command, 60, 1), (47 - (i*8))); + if(cond) { + command->registers->SPRM[i] = data; + } + } + } + break; + case 2: /* Set system reg 9 & 10 (Navigation timer, Title PGC number) */ + data = eval_reg_or_data(command, vm_getbits(command, 60, 1), 47); + data2 = vm_getbits(command, 23, 8); /* ?? size */ + if(cond) { + command->registers->SPRM[9] = data; /* time */ + command->registers->SPRM[10] = data2; /* pgcN */ + } + break; + case 3: /* Mode: Counter / Register + Set */ + data = eval_reg_or_data(command, vm_getbits(command, 60, 1), 47); + data2 = vm_getbits(command, 19, 4); + if(vm_getbits(command, 23, 1)) { + command->registers->GPRM_mode[data2] |= 1; /* Set bit 0 */ + } else { + command->registers->GPRM_mode[data2] &= ~ 0x01; /* Reset bit 0 */ + } + if(cond) { + set_GPRM(command->registers, data2, data); + } + break; + case 6: /* Set system reg 8 (Highlighted button) */ + data = eval_reg_or_data(command, vm_getbits(command, 60, 1), 31); /* Not system reg!! */ + if(cond) { + command->registers->SPRM[8] = data; + } + break; + } + if(vm_getbits(command, 51, 4)) { + return eval_link_instruction(command, cond, return_values); + } + return 0; +} + + +/* Evaluate set operation + Sets the register given to the value indicated by op and data. + For the swap case the contents of reg is stored in reg2. +*/ +static void eval_set_op(command_t* command, int32_t op, int32_t reg, int32_t reg2, int32_t data) { + const int32_t shortmax = 0xffff; + int32_t tmp; + switch(op) { + case 1: + set_GPRM(command->registers, reg, data); + break; + case 2: /* SPECIAL CASE - SWAP! */ + set_GPRM(command->registers, reg2, get_GPRM(command->registers, reg)); + set_GPRM(command->registers, reg, data); + break; + case 3: + tmp = get_GPRM(command->registers, reg) + data; + if(tmp > shortmax) tmp = shortmax; + set_GPRM(command->registers, reg, (uint16_t)tmp); + break; + case 4: + tmp = get_GPRM(command->registers, reg) - data; + if(tmp < 0) tmp = 0; + set_GPRM(command->registers, reg, (uint16_t)tmp); + break; + case 5: + tmp = get_GPRM(command->registers, reg) * data; + if(tmp > shortmax) tmp = shortmax; + set_GPRM(command->registers, reg, (uint16_t)tmp); + break; + case 6: + if (data != 0) { + set_GPRM(command->registers, reg, (get_GPRM(command->registers, reg) / data) ); + } else { + set_GPRM(command->registers, reg, 0xffff); /* Avoid that divide by zero! */ + } + break; + case 7: + if (data != 0) { + set_GPRM(command->registers, reg, (get_GPRM(command->registers, reg) % data) ); + } else { + set_GPRM(command->registers, reg, 0xffff); /* Avoid that divide by zero! */ + } + break; + case 8: /* SPECIAL CASE - RND! Return numbers between 1 and data. */ + set_GPRM(command->registers, reg, 1 + ((uint16_t) ((float) data * rand()/(RAND_MAX+1.0))) ); + break; + case 9: + set_GPRM(command->registers, reg, (get_GPRM(command->registers, reg) & data) ); + break; + case 10: + set_GPRM(command->registers, reg, (get_GPRM(command->registers, reg) | data) ); + break; + case 11: + set_GPRM(command->registers, reg, (get_GPRM(command->registers, reg) ^ data) ); + break; + } +} + +/* Evaluate set instruction, combined with either Link or Compare. */ +static void eval_set_version_1(command_t* command, int32_t cond) { + uint8_t op = vm_getbits(command, 59, 4); + uint8_t reg = vm_getbits(command, 35, 4); /* FIXME: This is different from vmcmd.c!!! */ + uint8_t reg2 = vm_getbits(command, 19, 4); + uint16_t data = eval_reg_or_data(command, vm_getbits(command, 60, 1), 31); + + if(cond) { + eval_set_op(command, op, reg, reg2, data); + } +} + + +/* Evaluate set instruction, combined with both Link and Compare. */ +static void eval_set_version_2(command_t* command, int32_t cond) { + uint8_t op = vm_getbits(command, 59, 4); + uint8_t reg = vm_getbits(command, 51, 4); + uint8_t reg2 = vm_getbits(command, 35, 4); /* FIXME: This is different from vmcmd.c!!! */ + uint16_t data = eval_reg_or_data(command, vm_getbits(command, 60, 1), 47); + + if(cond) { + eval_set_op(command, op, reg, reg2, data); + } +} + + +/* Evaluate a command + returns row number of goto, 0 if no goto, -1 if link. + Link command in return_values */ +static int32_t eval_command(uint8_t *bytes, registers_t* registers, link_t *return_values) { + int32_t cond, res = 0; + command_t command; + command.instruction =( (uint64_t) bytes[0] << 56 ) | + ( (uint64_t) bytes[1] << 48 ) | + ( (uint64_t) bytes[2] << 40 ) | + ( (uint64_t) bytes[3] << 32 ) | + ( (uint64_t) bytes[4] << 24 ) | + ( (uint64_t) bytes[5] << 16 ) | + ( (uint64_t) bytes[6] << 8 ) | + (uint64_t) bytes[7] ; + command.examined = 0; + command.registers = registers; + memset(return_values, 0, sizeof(link_t)); + + switch(vm_getbits(&command, 63, 3)) { /* three first old_bits */ + case 0: /* Special instructions */ + cond = eval_if_version_1(&command); + res = eval_special_instruction(&command, cond); + if(res == -1) { + fprintf(MSG_OUT, "libdvdnav: Unknown Instruction!\n"); + abort(); + } + break; + case 1: /* Link/jump instructions */ + if(vm_getbits(&command, 60, 1)) { + cond = eval_if_version_2(&command); + res = eval_jump_instruction(&command, cond, return_values); + } else { + cond = eval_if_version_1(&command); + res = eval_link_instruction(&command, cond, return_values); + } + if(res) + res = -1; + break; + case 2: /* System set instructions */ + cond = eval_if_version_2(&command); + res = eval_system_set(&command, cond, return_values); + if(res) + res = -1; + break; + case 3: /* Set instructions, either Compare or Link may be used */ + cond = eval_if_version_3(&command); + eval_set_version_1(&command, cond); + if(vm_getbits(&command, 51, 4)) { + res = eval_link_instruction(&command, cond, return_values); + } + if(res) + res = -1; + break; + case 4: /* Set, Compare -> Link Sub-Instruction */ + eval_set_version_2(&command, /*True*/ 1); + cond = eval_if_version_4(&command); + res = eval_link_subins(&command, cond, return_values); + if(res) + res = -1; + break; + case 5: /* Compare -> (Set and Link Sub-Instruction) */ + /* FIXME: These are wrong. Need to be updated from vmcmd.c */ + cond = eval_if_version_4(&command); + eval_set_version_2(&command, cond); + res = eval_link_subins(&command, cond, return_values); + if(res) + res = -1; + break; + case 6: /* Compare -> Set, allways Link Sub-Instruction */ + /* FIXME: These are wrong. Need to be updated from vmcmd.c */ + cond = eval_if_version_4(&command); + eval_set_version_2(&command, cond); + res = eval_link_subins(&command, /*True*/ 1, return_values); + if(res) + res = -1; + break; + default: /* Unknown command */ + fprintf(MSG_OUT, "libdvdnav: WARNING: Unknown Command=%x\n", vm_getbits(&command, 63, 3)); + abort(); + } + /* Check if there are bits not yet examined */ + + if(command.instruction & ~ command.examined) { + fprintf(MSG_OUT, "libdvdnav: decoder.c: [WARNING, unknown bits:"); + fprintf(MSG_OUT, " %08llx", (command.instruction & ~ command.examined) ); + fprintf(MSG_OUT, "]\n"); + } + + return res; +} + +/* Evaluate a set of commands in the given register set (which is modified) */ +int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands, + registers_t *registers, link_t *return_values) { + int32_t i = 0; + int32_t total = 0; + +#ifdef TRACE + /* DEBUG */ + fprintf(MSG_OUT, "libdvdnav: Registers before transaction\n"); + vm_print_registers( registers ); + fprintf(MSG_OUT, "libdvdnav: Full list of commands to execute\n"); + for(i = 0; i < num_commands; i++) + vm_print_cmd(i, &commands[i]); + fprintf(MSG_OUT, "libdvdnav: --------------------------------------------\n"); + fprintf(MSG_OUT, "libdvdnav: Single stepping commands\n"); +#endif + + i = 0; + while(i < num_commands && total < 100000) { + int32_t line; + +#ifdef TRACE + vm_print_cmd(i, &commands[i]); +#endif + + line = eval_command(&commands[i].bytes[0], registers, return_values); + + if (line < 0) { /* Link command */ +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: Registers after transaction\n"); + vm_print_registers( registers ); + fprintf(MSG_OUT, "libdvdnav: eval: Doing Link/Jump/Call\n"); +#endif + return 1; + } + + if (line > 0) /* Goto command */ + i = line - 1; + else /* Just continue on the next line */ + i++; + + total++; + } + + memset(return_values, 0, sizeof(link_t)); +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: Registers after transaction\n"); + vm_print_registers( registers ); +#endif + return 0; +} + +#ifdef TRACE + +static char *linkcmd2str(link_cmd_t cmd) { + switch(cmd) { + case LinkNoLink: + return "LinkNoLink"; + case LinkTopC: + return "LinkTopC"; + case LinkNextC: + return "LinkNextC"; + case LinkPrevC: + return "LinkPrevC"; + case LinkTopPG: + return "LinkTopPG"; + case LinkNextPG: + return "LinkNextPG"; + case LinkPrevPG: + return "LinkPrevPG"; + case LinkTopPGC: + return "LinkTopPGC"; + case LinkNextPGC: + return "LinkNextPGC"; + case LinkPrevPGC: + return "LinkPrevPGC"; + case LinkGoUpPGC: + return "LinkGoUpPGC"; + case LinkTailPGC: + return "LinkTailPGC"; + case LinkRSM: + return "LinkRSM"; + case LinkPGCN: + return "LinkPGCN"; + case LinkPTTN: + return "LinkPTTN"; + case LinkPGN: + return "LinkPGN"; + case LinkCN: + return "LinkCN"; + case Exit: + return "Exit"; + case JumpTT: + return "JumpTT"; + case JumpVTS_TT: + return "JumpVTS_TT"; + case JumpVTS_PTT: + return "JumpVTS_PTT"; + case JumpSS_FP: + return "JumpSS_FP"; + case JumpSS_VMGM_MENU: + return "JumpSS_VMGM_MENU"; + case JumpSS_VTSM: + return "JumpSS_VTSM"; + case JumpSS_VMGM_PGC: + return "JumpSS_VMGM_PGC"; + case CallSS_FP: + return "CallSS_FP"; + case CallSS_VMGM_MENU: + return "CallSS_VMGM_MENU"; + case CallSS_VTSM: + return "CallSS_VTSM"; + case CallSS_VMGM_PGC: + return "CallSS_VMGM_PGC"; + case PlayThis: + return "PlayThis"; + } + return "*** (bug)"; +} + +void vm_print_link(link_t value) { + char *cmd = linkcmd2str(value.command); + + switch(value.command) { + case LinkNoLink: + case LinkTopC: + case LinkNextC: + case LinkPrevC: + case LinkTopPG: + case LinkNextPG: + case LinkPrevPG: + case LinkTopPGC: + case LinkNextPGC: + case LinkPrevPGC: + case LinkGoUpPGC: + case LinkTailPGC: + case LinkRSM: + fprintf(MSG_OUT, "libdvdnav: %s (button %d)\n", cmd, value.data1); + break; + case LinkPGCN: + case JumpTT: + case JumpVTS_TT: + case JumpSS_VMGM_MENU: /* == 2 -> Title Menu */ + case JumpSS_VMGM_PGC: + fprintf(MSG_OUT, "libdvdnav: %s %d\n", cmd, value.data1); + break; + case LinkPTTN: + case LinkPGN: + case LinkCN: + fprintf(MSG_OUT, "libdvdnav: %s %d (button %d)\n", cmd, value.data1, value.data2); + break; + case Exit: + case JumpSS_FP: + case PlayThis: /* Humm.. should we have this at all.. */ + fprintf(MSG_OUT, "libdvdnav: %s\n", cmd); + break; + case JumpVTS_PTT: + fprintf(MSG_OUT, "libdvdnav: %s %d:%d\n", cmd, value.data1, value.data2); + break; + case JumpSS_VTSM: + fprintf(MSG_OUT, "libdvdnav: %s vts %d title %d menu %d\n", + cmd, value.data1, value.data2, value.data3); + break; + case CallSS_FP: + fprintf(MSG_OUT, "libdvdnav: %s resume cell %d\n", cmd, value.data1); + break; + case CallSS_VMGM_MENU: /* == 2 -> Title Menu */ + case CallSS_VTSM: + fprintf(MSG_OUT, "libdvdnav: %s %d resume cell %d\n", cmd, value.data1, value.data2); + break; + case CallSS_VMGM_PGC: + fprintf(MSG_OUT, "libdvdnav: %s %d resume cell %d\n", cmd, value.data1, value.data2); + break; + } + } + +void vm_print_registers( registers_t *registers ) { + int32_t i; + fprintf(MSG_OUT, "libdvdnav: # "); + for(i = 0; i < 24; i++) + fprintf(MSG_OUT, " %2d |", i); + fprintf(MSG_OUT, "\nlibdvdnav: SRPMS: "); + for(i = 0; i < 24; i++) + fprintf(MSG_OUT, "%04x|", registers->SPRM[i]); + fprintf(MSG_OUT, "\nlibdvdnav: GRPMS: "); + for(i = 0; i < 16; i++) + fprintf(MSG_OUT, "%04x|", get_GPRM(registers, i) ); + fprintf(MSG_OUT, "\nlibdvdnav: Gmode: "); + for(i = 0; i < 16; i++) + fprintf(MSG_OUT, "%04x|", registers->GPRM_mode[i]); + fprintf(MSG_OUT, "\nlibdvdnav: Gtime: "); + for(i = 0; i < 16; i++) + fprintf(MSG_OUT, "%04lx|", registers->GPRM_time[i].tv_sec & 0xffff); + fprintf(MSG_OUT, "\n"); +} + +#endif + diff --git a/libdvdnav/decoder.h b/libdvdnav/decoder.h new file mode 100644 index 0000000..d00ceaa --- /dev/null +++ b/libdvdnav/decoder.h @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2000, 2001 Martin Norb�k, H�an Hjort + * + * This file is part of libdvdnav, a DVD navigation library. It is modified + * from a file originally part of the Ogle DVD player. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: decoder.h,v 1.9 2004/03/16 11:43:38 mroi Exp $ + * + */ + +#ifndef DECODER_H_INCLUDED +#define DECODER_H_INCLUDED + +#include "common.h" +#include + +/* vm_cmd_t */ +#include "dvdnav_internal.h" + +/* link command types */ +typedef enum { + LinkNoLink = 0, + + LinkTopC = 1, + LinkNextC = 2, + LinkPrevC = 3, + + LinkTopPG = 5, + LinkNextPG = 6, + LinkPrevPG = 7, + + LinkTopPGC = 9, + LinkNextPGC = 10, + LinkPrevPGC = 11, + LinkGoUpPGC = 12, + LinkTailPGC = 13, + + LinkRSM = 16, + + LinkPGCN, + LinkPTTN, + LinkPGN, + LinkCN, + + Exit, + + JumpTT, /* 22 */ + JumpVTS_TT, + JumpVTS_PTT, + + JumpSS_FP, + JumpSS_VMGM_MENU, + JumpSS_VTSM, + JumpSS_VMGM_PGC, + + CallSS_FP, /* 29 */ + CallSS_VMGM_MENU, + CallSS_VTSM, + CallSS_VMGM_PGC, + + PlayThis +} link_cmd_t; + +/* a link's data set */ +typedef struct { + link_cmd_t command; + uint16_t data1; + uint16_t data2; + uint16_t data3; +} link_t; + +/* the VM registers */ +typedef struct { + uint16_t SPRM[24]; + uint16_t GPRM[16]; + uint8_t GPRM_mode[16]; /* Need to have some thing to indicate normal/counter mode for every GPRM */ + struct timeval GPRM_time[16]; /* For counter mode */ +} registers_t; + +/* a VM command data set */ +typedef struct { + uint64_t instruction; + uint64_t examined; + registers_t *registers; +} command_t; + +/* the big VM function, executing the given commands and writing + * the link where to continue, the return value indicates if a jump + * has been performed */ +int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands, + registers_t *registers, link_t *return_values); + +/* extracts some bits from the command */ +uint32_t vm_getbits(command_t* command, int32_t start, int32_t count); + +#ifdef TRACE +/* for debugging: prints a link in readable form */ +void vm_print_link(link_t value); + +/* for debugging: dumps VM registers */ +void vm_print_registers( registers_t *registers ); +#endif + +#endif /* DECODER_H_INCLUDED */ diff --git a/libdvdnav/dvd_types.h b/libdvdnav/dvd_types.h new file mode 100644 index 0000000..dc9aeb1 --- /dev/null +++ b/libdvdnav/dvd_types.h @@ -0,0 +1,281 @@ +/* + * Copyright (C) 2000, 2001 Bj�n Englund, H�an Hjort + * + * This file is part of libdvdnav, a DVD navigation library. It is a modified + * file originally part of the Ogle DVD player project. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: dvd_types.h,v 1.4 2003/04/29 15:58:30 jcdutton Exp $ + * + */ + +/* + * Various useful structs and enums for DVDs. + */ + +#ifndef DVD_H_INCLUDED +#define DVD_H_INCLUDED + +#include "common.h" + + +/* + * DVD Menu ID + * (see dvdnav_menu_call()) + */ +typedef enum { + /* When used in VTS domain, DVD_MENU_Escape behaves like DVD_MENU_Root, + * but from within a menu domain, DVD_MENU_Escape resumes playback. */ + DVD_MENU_Escape = 0, + DVD_MENU_Title = 2, + DVD_MENU_Root = 3, + DVD_MENU_Subpicture = 4, + DVD_MENU_Audio = 5, + DVD_MENU_Angle = 6, + DVD_MENU_Part = 7 +} DVDMenuID_t; + + +/* + * Structure containing info on highlight areas + * (see dvdnav_get_highlight_area()) + */ +typedef struct { + uint32_t palette; /* The CLUT entries for the highlight palette + (4-bits per entry -> 4 entries) */ + uint16_t sx,sy,ex,ey; /* The start/end x,y positions */ + uint32_t pts; /* Highlight PTS to match with SPU */ + + /* button number for the SPU decoder/overlaying engine */ + uint32_t buttonN; +} dvdnav_highlight_area_t; + + +/* the following types are currently unused */ + +#if 0 + +/* Domain */ +typedef enum { + DVD_DOMAIN_FirstPlay, /* First Play Domain */ + DVD_DOMAIN_VMG, /* Video Manager Domain */ + DVD_DOMAIN_VTSMenu, /* Video Title Set Menu Domain */ + DVD_DOMAIN_VTSTitle, /* Video Title Set Domain */ + DVD_DOMAIN_Stop /* Stop Domain */ +} DVDDomain_t; + +/* User operation permissions */ +typedef enum { + UOP_FLAG_TitleOrTimePlay = 0x00000001, + UOP_FLAG_ChapterSearchOrPlay = 0x00000002, + UOP_FLAG_TitlePlay = 0x00000004, + UOP_FLAG_Stop = 0x00000008, + UOP_FLAG_GoUp = 0x00000010, + UOP_FLAG_TimeOrChapterSearch = 0x00000020, + UOP_FLAG_PrevOrTopPGSearch = 0x00000040, + UOP_FLAG_NextPGSearch = 0x00000080, + UOP_FLAG_ForwardScan = 0x00000100, + UOP_FLAG_BackwardScan = 0x00000200, + UOP_FLAG_TitleMenuCall = 0x00000400, + UOP_FLAG_RootMenuCall = 0x00000800, + UOP_FLAG_SubPicMenuCall = 0x00001000, + UOP_FLAG_AudioMenuCall = 0x00002000, + UOP_FLAG_AngleMenuCall = 0x00004000, + UOP_FLAG_ChapterMenuCall = 0x00008000, + UOP_FLAG_Resume = 0x00010000, + UOP_FLAG_ButtonSelectOrActivate = 0x00020000, + UOP_FLAG_StillOff = 0x00040000, + UOP_FLAG_PauseOn = 0x00080000, + UOP_FLAG_AudioStreamChange = 0x00100000, + UOP_FLAG_SubPicStreamChange = 0x00200000, + UOP_FLAG_AngleChange = 0x00400000, + UOP_FLAG_KaraokeAudioPresModeChange = 0x00800000, + UOP_FLAG_VideoPresModeChange = 0x01000000 +} DVDUOP_t; + +/* Parental Level */ +typedef enum { + DVD_PARENTAL_LEVEL_1 = 1, + DVD_PARENTAL_LEVEL_2 = 2, + DVD_PARENTAL_LEVEL_3 = 3, + DVD_PARENTAL_LEVEL_4 = 4, + DVD_PARENTAL_LEVEL_5 = 5, + DVD_PARENTAL_LEVEL_6 = 6, + DVD_PARENTAL_LEVEL_7 = 7, + DVD_PARENTAL_LEVEL_8 = 8, + DVD_PARENTAL_LEVEL_None = 15 +} DVDParentalLevel_t; + +/* Language ID (ISO-639 language code) */ +typedef uint16_t DVDLangID_t; + +/* Country ID (ISO-3166 country code) */ +typedef uint16_t DVDCountryID_t; + +/* Register */ +typedef uint16_t DVDRegister_t; +typedef enum { + DVDFalse = 0, + DVDTrue = 1 +} DVDBool_t; +typedef DVDRegister_t DVDGPRMArray_t[16]; +typedef DVDRegister_t DVDSPRMArray_t[24]; + +/* Navigation */ +typedef int DVDStream_t; +typedef int DVDPTT_t; +typedef int DVDTitle_t; + +/* Angle number (1-9 or default?) */ +typedef int DVDAngle_t; + +/* Timecode */ +typedef struct { + uint8_t Hours; + uint8_t Minutes; + uint8_t Seconds; + uint8_t Frames; +} DVDTimecode_t; + +/* Subpicture stream number (0-31,62,63) */ +typedef int DVDSubpictureStream_t; + +/* Audio stream number (0-7, 15(none)) */ +typedef int DVDAudioStream_t; + +/* The audio application mode */ +typedef enum { + DVD_AUDIO_APP_MODE_None = 0, + DVD_AUDIO_APP_MODE_Karaoke = 1, + DVD_AUDIO_APP_MODE_Surround = 2, + DVD_AUDIO_APP_MODE_Other = 3 +} DVDAudioAppMode_t; + +/* The audio format */ +typedef enum { + DVD_AUDIO_FORMAT_AC3 = 0, + DVD_AUDIO_FORMAT_MPEG1 = 1, + DVD_AUDIO_FORMAT_MPEG1_DRC = 2, + DVD_AUDIO_FORMAT_MPEG2 = 3, + DVD_AUDIO_FORMAT_MPEG2_DRC = 4, + DVD_AUDIO_FORMAT_LPCM = 5, + DVD_AUDIO_FORMAT_DTS = 6, + DVD_AUDIO_FORMAT_SDDS = 7, + DVD_AUDIO_FORMAT_Other = 8 +} DVDAudioFormat_t; + +/* Audio language extension */ +typedef enum { + DVD_AUDIO_LANG_EXT_NotSpecified = 0, + DVD_AUDIO_LANG_EXT_NormalCaptions = 1, + DVD_AUDIO_LANG_EXT_VisuallyImpaired = 2, + DVD_AUDIO_LANG_EXT_DirectorsComments1 = 3, + DVD_AUDIO_LANG_EXT_DirectorsComments2 = 4 +} DVDAudioLangExt_t; + +/* Subpicture language extension */ +typedef enum { + DVD_SUBPICTURE_LANG_EXT_NotSpecified = 0, + DVD_SUBPICTURE_LANG_EXT_NormalCaptions = 1, + DVD_SUBPICTURE_LANG_EXT_BigCaptions = 2, + DVD_SUBPICTURE_LANG_EXT_ChildrensCaptions = 3, + DVD_SUBPICTURE_LANG_EXT_NormalCC = 5, + DVD_SUBPICTURE_LANG_EXT_BigCC = 6, + DVD_SUBPICTURE_LANG_EXT_ChildrensCC = 7, + DVD_SUBPICTURE_LANG_EXT_Forced = 9, + DVD_SUBPICTURE_LANG_EXT_NormalDirectorsComments = 13, + DVD_SUBPICTURE_LANG_EXT_BigDirectorsComments = 14, + DVD_SUBPICTURE_LANG_EXT_ChildrensDirectorsComments = 15, +} DVDSubpictureLangExt_t; + +/* Karaoke Downmix mode */ +typedef enum { + DVD_KARAOKE_DOWNMIX_0to0 = 0x0001, + DVD_KARAOKE_DOWNMIX_1to0 = 0x0002, + DVD_KARAOKE_DOWNMIX_2to0 = 0x0004, + DVD_KARAOKE_DOWNMIX_3to0 = 0x0008, + DVD_KARAOKE_DOWNMIX_4to0 = 0x0010, + DVD_KARAOKE_DOWNMIX_Lto0 = 0x0020, + DVD_KARAOKE_DOWNMIX_Rto0 = 0x0040, + DVD_KARAOKE_DOWNMIX_0to1 = 0x0100, + DVD_KARAOKE_DOWNMIX_1to1 = 0x0200, + DVD_KARAOKE_DOWNMIX_2to1 = 0x0400, + DVD_KARAOKE_DOWNMIX_3to1 = 0x0800, + DVD_KARAOKE_DOWNMIX_4to1 = 0x1000, + DVD_KARAOKE_DOWNMIX_Lto1 = 0x2000, + DVD_KARAOKE_DOWNMIX_Rto1 = 0x4000 +} DVDKaraokeDownmix_t; +typedef int DVDKaraokeDownmixMask_t; + +/* Display mode */ +typedef enum { + DVD_DISPLAY_MODE_ContentDefault = 0, + DVD_DISPLAY_MODE_16x9 = 1, + DVD_DISPLAY_MODE_4x3PanScan = 2, + DVD_DISPLAY_MODE_4x3Letterboxed = 3 +} DVDDisplayMode_t; + +/* Audio attributes */ +typedef struct { + DVDAudioAppMode_t AppMode; + DVDAudioFormat_t AudioFormat; + DVDLangID_t Language; + DVDAudioLangExt_t LanguageExtension; + DVDBool_t HasMultichannelInfo; + DVDAudioSampleFreq_t SampleFrequency; + DVDAudioSampleQuant_t SampleQuantization; + DVDChannelNumber_t NumberOfChannels; +} DVDAudioAttributes_t; +typedef int DVDAudioSampleFreq_t; +typedef int DVDAudioSampleQuant_t; +typedef int DVDChannelNumber_t; + +/* Subpicture attributes */ +typedef enum { + DVD_SUBPICTURE_TYPE_NotSpecified = 0, + DVD_SUBPICTURE_TYPE_Language = 1, + DVD_SUBPICTURE_TYPE_Other = 2 +} DVDSubpictureType_t; +typedef enum { + DVD_SUBPICTURE_CODING_RunLength = 0, + DVD_SUBPICTURE_CODING_Extended = 1, + DVD_SUBPICTURE_CODING_Other = 2 +} DVDSubpictureCoding_t; +typedef struct { + DVDSubpictureType_t Type; + DVDSubpictureCoding_t CodingMode; + DVDLangID_t Language; + DVDSubpictureLangExt_t LanguageExtension; +} DVDSubpictureAttributes_t; + +/* Video attributes */ +typedef struct { + DVDBool_t PanscanPermitted; + DVDBool_t LetterboxPermitted; + int AspectX; + int AspectY; + int FrameRate; + int FrameHeight; + DVDVideoCompression_t Compression; + DVDBool_t Line21Field1InGop; + DVDBool_t Line21Field2InGop; + int more_to_come; +} DVDVideoAttributes_t; +typedef int DVDVideoCompression_t; + +#endif + +#endif /* DVD_H_INCLUDED */ diff --git a/libdvdnav/dvdnav.c b/libdvdnav/dvdnav.c new file mode 100644 index 0000000..00ffd7d --- /dev/null +++ b/libdvdnav/dvdnav.c @@ -0,0 +1,1093 @@ +/* + * Copyright (C) 2000 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: dvdnav.c,v 1.34 2005/10/15 14:04:05 jcdutton Exp $ + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* +#define LOG_DEBUG +*/ +#include "common.h" +#include "dvdnav_internal.h" +#include "read_cache.h" + +#include +#include +#include + +#include "remap.h" +#include "dvdread.h" + +static dvdnav_status_t dvdnav_clear(dvdnav_t * this) { + /* clear everything except file, vm, mutex, readahead */ + + if (this->file) DVDCloseFile(this->file); + this->file = NULL; + + memset(&this->pci,0,sizeof(this->pci)); + memset(&this->dsi,0,sizeof(this->dsi)); + this->last_cmd_nav_lbn = SRI_END_OF_CELL; + + /* Set initial values of flags */ + this->position_current.still = 0; + this->skip_still = 0; + this->sync_wait = 0; + this->sync_wait_skip = 0; + this->spu_clut_changed = 0; + this->started = 0; + + dvdnav_read_cache_clear(this->cache); + + return DVDNAV_STATUS_OK; +} + + +dvdnav_status_t dvdnav_open(dvdnav_t** dest, const char *path,dvd_reader_t *dvd) { + dvdnav_t *this; + struct timeval time; + + /* Create a new structure */ + fprintf(MSG_OUT, "libdvdnav: Using dvdnav version %s from http://xine.sf.net\n", VERSION); + + (*dest) = NULL; + this = (dvdnav_t*)malloc(sizeof(dvdnav_t)); + if(!this) + return DVDNAV_STATUS_ERR; + memset(this, 0, (sizeof(dvdnav_t) ) ); /* Make sure this structure is clean */ + + pthread_mutex_init(&this->vm_lock, NULL); + /* Initialise the error string */ + printerr(""); + + /* Initialise the VM */ + this->vm = vm_new_vm(); + if(!this->vm) { + printerr("Error initialising the DVD VM."); + pthread_mutex_destroy(&this->vm_lock); + free(this); + return DVDNAV_STATUS_ERR; + } + this->vm->openedDvd=dvd; + if(!vm_reset(this->vm, path)) { + printerr("Error starting the VM / opening the DVD device."); + pthread_mutex_destroy(&this->vm_lock); + vm_free_vm(this->vm); + free(this); + return DVDNAV_STATUS_ERR; + } + + /* Set the path. FIXME: Is a deep copy 'right' */ + strncpy(this->path, path, MAX_PATH_LEN); + + /* Pre-open and close a file so that the CSS-keys are cached. */ + this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), 0, DVD_READ_MENU_VOBS); + + /* Start the read-ahead cache. */ + this->cache = dvdnav_read_cache_new(this); + + /* Seed the random numbers. So that the DVD VM Command rand() + * gives a different start value each time a DVD is played. */ + gettimeofday(&time, NULL); + srand(time.tv_usec); + + dvdnav_clear(this); + + (*dest) = this; + return DVDNAV_STATUS_OK; +} + + + +dvdnav_status_t dvdnav_close(dvdnav_t *this) { + +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: close:called\n"); +#endif + + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + if (this->file) { + DVDCloseFile(this->file); +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: close:file closing\n"); +#endif + this->file = NULL; + } + + /* Free the VM */ + if(this->vm) + vm_free_vm(this->vm); + + pthread_mutex_destroy(&this->vm_lock); + + /* We leave the final freeing of the entire structure to the cache, + * because we don't know, if there are still buffers out in the wild, + * that must return first. */ + if(this->cache) + dvdnav_read_cache_free(this->cache); + else + free(this); + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_reset(dvdnav_t *this) { + dvdnav_status_t result; + +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: reset:called\n"); +#endif + + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: reseting vm\n"); +#endif + if(!vm_reset(this->vm, NULL)) { + printerr("Error restarting the VM."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: clearing dvdnav\n"); +#endif + result = dvdnav_clear(this); + + pthread_mutex_unlock(&this->vm_lock); + return result; +} + +dvdnav_status_t dvdnav_path(dvdnav_t *this, const char** path) { + + if(!this || !path) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + (*path) = this->path; + + return DVDNAV_STATUS_OK; +} + +const char* dvdnav_err_to_string(dvdnav_t *this) { + + if(!this) + return "Hey! You gave me a NULL pointer you naughty person!"; + + return this->err_str; +} + +/* converts a dvd_time_t to PTS ticks */ +int64_t dvdnav_convert_time(dvd_time_t *time) { + int64_t result; + int64_t frames; + + result = (time->hour >> 4 ) * 10 * 60 * 60 * 90000; + result += (time->hour & 0x0f) * 60 * 60 * 90000; + result += (time->minute >> 4 ) * 10 * 60 * 90000; + result += (time->minute & 0x0f) * 60 * 90000; + result += (time->second >> 4 ) * 10 * 90000; + result += (time->second & 0x0f) * 90000; + + frames = ((time->frame_u & 0x30) >> 4) * 10; + frames += ((time->frame_u & 0x0f) ) ; + + if (time->frame_u & 0x80) + result += frames * 3000; + else + result += frames * 3600; + + return result; +} + +/* + * Returns 1 if block contains NAV packet, 0 otherwise. + * Processes said NAV packet if present. + * + * Most of the code in here is copied from xine's MPEG demuxer + * so any bugs which are found in that should be corrected here also. + */ +static int32_t dvdnav_decode_packet(dvdnav_t *this, uint8_t *p, dsi_t *nav_dsi, pci_t *nav_pci) { + int32_t bMpeg1 = 0; + uint32_t nHeaderLen; + uint32_t nPacketLen; + uint32_t nStreamID; + + if (p[3] == 0xBA) { /* program stream pack header */ + int32_t nStuffingBytes; + + bMpeg1 = (p[4] & 0x40) == 0; + + if (bMpeg1) { + p += 12; + } else { /* mpeg2 */ + nStuffingBytes = p[0xD] & 0x07; + p += 14 + nStuffingBytes; + } + } + + if (p[3] == 0xbb) { /* program stream system header */ + nHeaderLen = (p[4] << 8) | p[5]; + p += 6 + nHeaderLen; + } + + /* we should now have a PES packet here */ + if (p[0] || p[1] || (p[2] != 1)) { + fprintf(MSG_OUT, "libdvdnav: demux error! %02x %02x %02x (should be 0x000001) \n",p[0],p[1],p[2]); + return 0; + } + + nPacketLen = p[4] << 8 | p[5]; + nStreamID = p[3]; + + nHeaderLen = 6; + p += nHeaderLen; + + if (nStreamID == 0xbf) { /* Private stream 2 */ +#if 0 + int32_t i; + fprintf(MSG_OUT, "libdvdnav: nav packet=%u\n",p-p_start-6); + for(i=0;i<80;i++) + fprintf(MSG_OUT, "%02x ",p[i-6]); + fprintf(MSG_OUT, "\n"); +#endif + + if(p[0] == 0x00) { + navRead_PCI(nav_pci, p+1); + } + + p += nPacketLen; + + /* We should now have a DSI packet. */ + if(p[6] == 0x01) { + nPacketLen = p[4] << 8 | p[5]; + p += 6; + navRead_DSI(nav_dsi, p+1); + } + + return 1; + } + return 0; +} + +/* DSI is used for most angle stuff. + * PCI is used for only non-seemless angle stuff + */ +static int32_t dvdnav_get_vobu(dvdnav_t *this, dsi_t *nav_dsi, pci_t *nav_pci, dvdnav_vobu_t *vobu) { + uint32_t next; + int32_t angle, num_angle; + + vobu->vobu_start = nav_dsi->dsi_gi.nv_pck_lbn; /* Absolute offset from start of disk */ + vobu->vobu_length = nav_dsi->dsi_gi.vobu_ea; /* Relative offset from vobu_start */ + + /* + * If we're not at the end of this cell, we can determine the next + * VOBU to display using the VOBU_SRI information section of the + * DSI. Using this value correctly follows the current angle, + * avoiding the doubled scenes in The Matrix, and makes our life + * really happy. + * + * vobu_next is an offset value, 0x3fffffff = SRI_END_OF_CELL + * DVDs are about 6 Gigs, which is only up to 0x300000 blocks + * Should really assert if bit 31 != 1 + */ + +#if 0 + /* Old code -- may still be useful one day */ + if(nav_dsi->vobu_sri.next_vobu != SRI_END_OF_CELL ) { + vobu->vobu_next = ( nav_dsi->vobu_sri.next_vobu & 0x3fffffff ); + } else { + vobu->vobu_next = vobu->vobu_length; + } +#else + /* Relative offset from vobu_start */ + vobu->vobu_next = ( nav_dsi->vobu_sri.next_vobu & 0x3fffffff ); +#endif + + vm_get_angle_info(this->vm, &angle, &num_angle); + + /* FIMXE: The angle reset doesn't work for some reason for the moment */ +#if 0 + if((num_angle < angle) && (angle != 1)) { + fprintf(MSG_OUT, "libdvdnav: angle ends!\n"); + + /* This is to switch back to angle one when we + * finish with angles. */ + dvdnav_angle_change(this, 1); + } +#endif + + if(num_angle != 0) { + + if((next = nav_pci->nsml_agli.nsml_agl_dsta[angle-1]) != 0) { + if((next & 0x3fffffff) != 0) { + if(next & 0x80000000) + vobu->vobu_next = - (int32_t)(next & 0x3fffffff); + else + vobu->vobu_next = + (int32_t)(next & 0x3fffffff); + } + } else if((next = nav_dsi->sml_agli.data[angle-1].address) != 0) { + vobu->vobu_length = nav_dsi->sml_pbi.ilvu_ea; + + if((next & 0x80000000) && (next != 0x7fffffff)) + vobu->vobu_next = - (int32_t)(next & 0x3fffffff); + else + vobu->vobu_next = + (int32_t)(next & 0x3fffffff); + } + } + + return 1; +} + +/* + * These are the main get_next_block function which actually get the media stream video and audio etc. + * + * There are two versions: The second one is using the zero-copy read ahead cache and therefore + * hands out pointers targetting directly into the cache. + * The first one uses a memcopy to fill this cache block into the application provided memory. + * The benefit of this first one is that no special memory management is needed. The application is + * the only one responsible of allocating and freeing the memory associated with the pointer. + * The drawback is the additional memcopy. + */ + +dvdnav_status_t dvdnav_get_next_block(dvdnav_t *this, uint8_t *buf, + int32_t *event, int32_t *len) { + unsigned char *block; + dvdnav_status_t status; + + block = buf; + status = dvdnav_get_next_cache_block(this, &block, event, len); + if (status == DVDNAV_STATUS_OK && block != buf) { + /* we received a block from the cache, copy it, so we can give it back */ + memcpy(buf, block, DVD_VIDEO_LB_LEN); + dvdnav_free_cache_block(this, block); + } + return status; +} + +dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, uint8_t **buf, + int32_t *event, int32_t *len) { + dvd_state_t *state; + int32_t result; + + if(!this || !event || !len || !buf || !*buf) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + + if(!this->started) { + /* Start the VM */ + if (!vm_start(this->vm)) { + printerr("Encrypted or faulty DVD"); + return DVDNAV_STATUS_ERR; + } + this->started = 1; + } + + state = &(this->vm->state); + (*event) = DVDNAV_NOP; + (*len) = 0; + + /* Check the STOP flag */ + if(this->vm->stopped) { + vm_stop(this->vm); + (*event) = DVDNAV_STOP; + this->started = 0; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + vm_position_get(this->vm, &this->position_next); + +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: POS-NEXT "); + vm_position_print(this->vm, &this->position_next); + fprintf(MSG_OUT, "libdvdnav: POS-CUR "); + vm_position_print(this->vm, &this->position_current); +#endif + + /* did we hop? */ + if(this->position_current.hop_channel != this->position_next.hop_channel) { + (*event) = DVDNAV_HOP_CHANNEL; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: HOP_CHANNEL\n"); +#endif + if (this->position_next.hop_channel - this->position_current.hop_channel >= HOP_SEEK) { + int32_t num_angles = 0, current; + + /* we seeked -> check for multiple angles */ + vm_get_angle_info(this->vm, ¤t, &num_angles); + if (num_angles > 1) { + int32_t result, block; + /* we have to skip the first VOBU when seeking in a multiangle feature, + * because it might belong to the wrong angle */ + block = this->position_next.cell_start + this->position_next.block; + result = dvdnav_read_cache_block(this->cache, block, 1, buf); + if(result <= 0) { + printerr("Error reading NAV packet."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + /* Decode nav into pci and dsi. Then get next VOBU info. */ + if(!dvdnav_decode_packet(this, *buf, &this->dsi, &this->pci)) { + printerr("Expected NAV packet but none found."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + dvdnav_get_vobu(this, &this->dsi, &this->pci, &this->vobu); + /* skip to next, if there is a next */ + if (this->vobu.vobu_next != SRI_END_OF_CELL) { + this->vobu.vobu_start += this->vobu.vobu_next; + this->vobu.vobu_next = 0; + } + /* update VM state */ + this->vm->state.blockN = this->vobu.vobu_start - this->position_next.cell_start; + } + } + this->position_current.hop_channel = this->position_next.hop_channel; + /* update VOBU info */ + this->vobu.vobu_start = this->position_next.cell_start + this->position_next.block; + this->vobu.vobu_next = 0; + /* Make blockN == vobu_length to do expected_nav */ + this->vobu.vobu_length = 0; + this->vobu.blockN = 0; + this->sync_wait = 0; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* Check the HIGHLIGHT flag */ + if(this->position_current.button != this->position_next.button) { + dvdnav_highlight_event_t *hevent = (dvdnav_highlight_event_t *)*buf; + + (*event) = DVDNAV_HIGHLIGHT; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: HIGHLIGHT\n"); +#endif + (*len) = sizeof(dvdnav_highlight_event_t); + hevent->display = 1; + hevent->buttonN = this->position_next.button; + this->position_current.button = this->position_next.button; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* Check the WAIT flag */ + if(this->sync_wait) { + (*event) = DVDNAV_WAIT; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: WAIT\n"); +#endif + (*len) = 0; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* Check to see if we need to change the currently opened VOB */ + if((this->position_current.vts != this->position_next.vts) || + (this->position_current.domain != this->position_next.domain)) { + dvd_read_domain_t domain; + int32_t vtsN; + dvdnav_vts_change_event_t *vts_event = (dvdnav_vts_change_event_t *)*buf; + + if(this->file) { + DVDCloseFile(this->file); + this->file = NULL; + } + + vts_event->old_vtsN = this->position_current.vts; + vts_event->old_domain = this->position_current.domain; + + /* Use the DOMAIN to find whether to open menu or title VOBs */ + switch(this->position_next.domain) { + case FP_DOMAIN: + case VMGM_DOMAIN: + domain = DVD_READ_MENU_VOBS; + vtsN = 0; + break; + case VTSM_DOMAIN: + domain = DVD_READ_MENU_VOBS; + vtsN = this->position_next.vts; + break; + case VTS_DOMAIN: + domain = DVD_READ_TITLE_VOBS; + vtsN = this->position_next.vts; + break; + default: + printerr("Unknown domain when changing VTS."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + + this->position_current.vts = this->position_next.vts; + this->position_current.domain = this->position_next.domain; + dvdnav_read_cache_clear(this->cache); + this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), vtsN, domain); + vts_event->new_vtsN = this->position_next.vts; + vts_event->new_domain = this->position_next.domain; + + /* If couldn't open the file for some reason, moan */ + if(this->file == NULL) { + printerrf("Error opening vtsN=%i, domain=%i.", vtsN, domain); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + + /* File opened successfully so return a VTS change event */ + (*event) = DVDNAV_VTS_CHANGE; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: VTS_CHANGE\n"); +#endif + (*len) = sizeof(dvdnav_vts_change_event_t); + + this->spu_clut_changed = 1; + this->position_current.cell = -1; /* Force an update */ + this->position_current.spu_channel = -1; /* Force an update */ + this->position_current.audio_channel = -1; /* Force an update */; + + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* Check if the cell changed */ + if( (this->position_current.cell != this->position_next.cell) || + (this->position_current.cell_restart != this->position_next.cell_restart) || + (this->position_current.cell_start != this->position_next.cell_start) ) { + dvdnav_cell_change_event_t *cell_event = (dvdnav_cell_change_event_t *)*buf; + int32_t first_cell_nr, last_cell_nr, i; + dvd_state_t *state = &this->vm->state; + + (*event) = DVDNAV_CELL_CHANGE; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: CELL_CHANGE\n"); +#endif + (*len) = sizeof(dvdnav_cell_change_event_t); + + cell_event->cellN = state->cellN; + cell_event->pgN = state->pgN; + cell_event->cell_length = + dvdnav_convert_time(&state->pgc->cell_playback[state->cellN-1].playback_time); + + cell_event->pg_length = 0; + /* Find start cell of program. */ + first_cell_nr = state->pgc->program_map[state->pgN-1]; + /* Find end cell of program */ + if(state->pgN < state->pgc->nr_of_programs) + last_cell_nr = state->pgc->program_map[state->pgN] - 1; + else + last_cell_nr = state->pgc->nr_of_cells; + for (i = first_cell_nr; i <= last_cell_nr; i++) + cell_event->pg_length += + dvdnav_convert_time(&state->pgc->cell_playback[i - 1].playback_time); + cell_event->pgc_length = dvdnav_convert_time(&state->pgc->playback_time); + + cell_event->cell_start = 0; + for (i = 1; i < state->cellN; i++) + cell_event->cell_start += + dvdnav_convert_time(&state->pgc->cell_playback[i - 1].playback_time); + + cell_event->pg_start = 0; + for (i = 1; i < state->pgc->program_map[state->pgN-1]; i++) + cell_event->pg_start += + dvdnav_convert_time(&state->pgc->cell_playback[i - 1].playback_time); + + this->position_current.cell = this->position_next.cell; + this->position_current.cell_restart = this->position_next.cell_restart; + this->position_current.cell_start = this->position_next.cell_start; + this->position_current.block = this->position_next.block; + + /* vobu info is used for mid cell resumes */ + this->vobu.vobu_start = this->position_next.cell_start + this->position_next.block; + this->vobu.vobu_next = 0; + /* Make blockN == vobu_length to do expected_nav */ + this->vobu.vobu_length = 0; + this->vobu.blockN = 0; + + /* update the spu palette at least on PGC changes */ + this->spu_clut_changed = 1; + this->position_current.spu_channel = -1; /* Force an update */ + this->position_current.audio_channel = -1; /* Force an update */ + + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* has the CLUT changed? */ + if(this->spu_clut_changed) { + (*event) = DVDNAV_SPU_CLUT_CHANGE; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: SPU_CLUT_CHANGE\n"); +#endif + (*len) = 16 * sizeof(uint32_t); + memcpy(*buf, &(state->pgc->palette), 16 * sizeof(uint32_t)); + this->spu_clut_changed = 0; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* has the SPU channel changed? */ + if(this->position_current.spu_channel != this->position_next.spu_channel) { + dvdnav_spu_stream_change_event_t *stream_change = (dvdnav_spu_stream_change_event_t *)*buf; + + (*event) = DVDNAV_SPU_STREAM_CHANGE; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE\n"); +#endif + (*len) = sizeof(dvdnav_spu_stream_change_event_t); + stream_change->physical_wide = vm_get_subp_active_stream(this->vm, 0); + stream_change->physical_letterbox = vm_get_subp_active_stream(this->vm, 1); + stream_change->physical_pan_scan = vm_get_subp_active_stream(this->vm, 2); + this->position_current.spu_channel = this->position_next.spu_channel; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_wide=%d\n",stream_change->physical_wide); + fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_letterbox=%d\n",stream_change->physical_letterbox); + fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_pan_scan=%d\n",stream_change->physical_pan_scan); + fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE returning DVDNAV_STATUS_OK\n"); +#endif + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* has the audio channel changed? */ + if(this->position_current.audio_channel != this->position_next.audio_channel) { + dvdnav_audio_stream_change_event_t *stream_change = (dvdnav_audio_stream_change_event_t *)*buf; + + (*event) = DVDNAV_AUDIO_STREAM_CHANGE; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: AUDIO_STREAM_CHANGE\n"); +#endif + (*len) = sizeof(dvdnav_audio_stream_change_event_t); + stream_change->physical = vm_get_audio_active_stream( this->vm ); + this->position_current.audio_channel = this->position_next.audio_channel; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: AUDIO_STREAM_CHANGE stream_id=%d returning DVDNAV_STATUS_OK\n",stream_change->physical); +#endif + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* Check the STILLFRAME flag */ + if(this->position_current.still != 0) { + dvdnav_still_event_t *still_event = (dvdnav_still_event_t *)*buf; + + (*event) = DVDNAV_STILL_FRAME; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: STILL_FRAME\n"); +#endif + (*len) = sizeof(dvdnav_still_event_t); + still_event->length = this->position_current.still; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* Have we reached the end of a VOBU? */ + if (this->vobu.blockN >= this->vobu.vobu_length) { + + /* Have we reached the end of a cell? */ + if(this->vobu.vobu_next == SRI_END_OF_CELL) { + /* End of Cell from NAV DSI info */ +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: Still set to %x\n", this->position_next.still); +#endif + this->position_current.still = this->position_next.still; + + /* we are about to leave a cell, so a lot of state changes could occur; + * under certain conditions, the application should get in sync with us before this, + * otherwise it might show stills or menus too shortly */ + if ((this->position_current.still || this->pci.hli.hl_gi.hli_ss) && !this->sync_wait_skip) { + this->sync_wait = 1; + } else { + if( this->position_current.still == 0 || this->skip_still ) { + /* no active cell still -> get us to the next cell */ + vm_get_next_cell(this->vm); + this->position_current.still = 0; /* still gets activated at end of cell */ + this->skip_still = 0; + this->sync_wait_skip = 0; + } + } + /* handle related state changes in next iteration */ + (*event) = DVDNAV_NOP; + (*len) = 0; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* Perform remapping jump if necessary (this is always a + * VOBU boundary). */ + if (this->vm->map) { + this->vobu.vobu_next = remap_block( this->vm->map, + this->vm->state.domain, this->vm->state.TTN_REG, + this->vm->state.pgN, + this->vobu.vobu_start, this->vobu.vobu_next); + } + + /* at the start of the next VOBU -> expecting NAV packet */ + result = dvdnav_read_cache_block(this->cache, this->vobu.vobu_start + this->vobu.vobu_next, 1, buf); + + if(result <= 0) { + printerr("Error reading NAV packet."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + /* Decode nav into pci and dsi. Then get next VOBU info. */ + if(!dvdnav_decode_packet(this, *buf, &this->dsi, &this->pci)) { + printerr("Expected NAV packet but none found."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + /* We need to update the vm state->blockN with which VOBU we are in. + * This is so RSM resumes to the VOBU level and not just the CELL level. + */ + this->vm->state.blockN = this->vobu.vobu_start - this->position_current.cell_start; + + dvdnav_get_vobu(this, &this->dsi, &this->pci, &this->vobu); + this->vobu.blockN = 0; + /* Give the cache a hint about the size of next VOBU. + * This improves pre-caching, because the VOBU will almost certainly be read entirely. + */ + dvdnav_pre_cache_blocks(this->cache, this->vobu.vobu_start+1, this->vobu.vobu_length+1); + + /* release NAV menu filter, when we reach the same NAV packet again */ + if (this->last_cmd_nav_lbn == this->pci.pci_gi.nv_pck_lbn) + this->last_cmd_nav_lbn = SRI_END_OF_CELL; + + /* Successfully got a NAV packet */ + (*event) = DVDNAV_NAV_PACKET; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: NAV_PACKET\n"); +#endif + (*len) = 2048; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + + /* If we've got here, it must just be a normal block. */ + if(!this->file) { + printerr("Attempting to read without opening file."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + + this->vobu.blockN++; + result = dvdnav_read_cache_block(this->cache, this->vobu.vobu_start + this->vobu.blockN, 1, buf); + if(result <= 0) { + printerr("Error reading from DVD."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + (*event) = DVDNAV_BLOCK_OK; + (*len) = 2048; + + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_get_title_string(dvdnav_t *this, const char **title_str) { + + if(!this || !title_str) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + (*title_str) = this->vm->dvd_name; + return DVDNAV_STATUS_OK; +} + +uint8_t dvdnav_get_video_aspect(dvdnav_t *this) { + uint8_t retval; + + if(!this) { + printerr("Passed a NULL pointer."); + return -1; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + retval = (uint8_t)vm_get_video_aspect(this->vm); + pthread_mutex_unlock(&this->vm_lock); + + return retval; +} + +uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) { + uint8_t retval; + + if(!this) { + printerr("Passed a NULL pointer."); + return -1; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + retval = (uint8_t)vm_get_video_scale_permission(this->vm); + pthread_mutex_unlock(&this->vm_lock); + + return retval; +} + +uint16_t dvdnav_audio_stream_to_lang(dvdnav_t *this, uint8_t stream) { + audio_attr_t attr; + + if(!this) { + printerr("Passed a NULL pointer."); + return -1; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + attr = vm_get_audio_attr(this->vm, stream); + pthread_mutex_unlock(&this->vm_lock); + + if(attr.lang_type != 1) + return 0xffff; + + return attr.lang_code; +} + +uint16_t dvdnav_spu_stream_to_lang(dvdnav_t *this, uint8_t stream) { + subp_attr_t attr; + + if(!this) { + printerr("Passed a NULL pointer."); + return -1; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + attr = vm_get_subp_attr(this->vm, stream); + pthread_mutex_unlock(&this->vm_lock); + + if(attr.type != 1) + return 0xffff; + + return attr.lang_code; +} + +int8_t dvdnav_get_audio_logical_stream(dvdnav_t *this, uint8_t audio_num) { + int8_t retval; + + if(!this) { + printerr("Passed a NULL pointer."); + return -1; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return -1; + } + retval = vm_get_audio_stream(this->vm, audio_num); + pthread_mutex_unlock(&this->vm_lock); + + return retval; +} + +int8_t dvdnav_get_spu_logical_stream(dvdnav_t *this, uint8_t subp_num) { + int8_t retval; + + if(!this) { + printerr("Passed a NULL pointer."); + return -1; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return -1; + } + retval = vm_get_subp_stream(this->vm, subp_num, 0); + pthread_mutex_unlock(&this->vm_lock); + + return retval; +} + +int8_t dvdnav_get_active_audio_stream(dvdnav_t *this) { + int8_t retval; + + if(!this) { + printerr("Passed a NULL pointer."); + return -1; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return -1; + } + retval = vm_get_audio_active_stream(this->vm); + pthread_mutex_unlock(&this->vm_lock); + + return retval; +} + +int8_t dvdnav_get_active_spu_stream(dvdnav_t *this) { + int8_t retval; + + if(!this) { + printerr("Passed a NULL pointer."); + return -1; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return -1; + } + retval = vm_get_subp_active_stream(this->vm, 0); + pthread_mutex_unlock(&this->vm_lock); + + return retval; +} + +static int8_t dvdnav_is_domain(dvdnav_t *this, domain_t domain) { + int8_t retval; + + if(!this) { + printerr("Passed a NULL pointer."); + return -1; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + retval = (this->vm->state.domain == domain); + pthread_mutex_unlock(&this->vm_lock); + + return retval; +} + +/* First Play domain. (Menu) */ +int8_t dvdnav_is_domain_fp(dvdnav_t *this) { + return dvdnav_is_domain(this, FP_DOMAIN); +} +/* Video management Menu domain. (Menu) */ +int8_t dvdnav_is_domain_vmgm(dvdnav_t *this) { + return dvdnav_is_domain(this, VMGM_DOMAIN); +} +/* Video Title Menu domain (Menu) */ +int8_t dvdnav_is_domain_vtsm(dvdnav_t *this) { + return dvdnav_is_domain(this, VTSM_DOMAIN); +} +/* Video Title domain (playing movie). */ +int8_t dvdnav_is_domain_vts(dvdnav_t *this) { + return dvdnav_is_domain(this, VTS_DOMAIN); +} + +/* Generally delegate angle information handling to VM */ +dvdnav_status_t dvdnav_angle_change(dvdnav_t *this, int32_t angle) { + int32_t num, current; + + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + vm_get_angle_info(this->vm, ¤t, &num); + /* Set angle SPRM if valid */ + if((angle > 0) && (angle <= num)) { + this->vm->state.AGL_REG = angle; + } else { + printerr("Passed an invalid angle number."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + pthread_mutex_unlock(&this->vm_lock); + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *this, int32_t *current_angle, + int32_t *number_of_angles) { + if(!this || !current_angle || !number_of_angles) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + vm_get_angle_info(this->vm, current_angle, number_of_angles); + pthread_mutex_unlock(&this->vm_lock); + + return DVDNAV_STATUS_OK; +} + +pci_t* dvdnav_get_current_nav_pci(dvdnav_t *this) { + if(!this) return 0; + return &this->pci; +} + +dsi_t* dvdnav_get_current_nav_dsi(dvdnav_t *this) { + if(!this) return 0; + return &this->dsi; +} + +uint32_t dvdnav_get_next_still_flag(dvdnav_t *this) { + if(!this) return -1; + return this->position_next.still; +} + diff --git a/libdvdnav/dvdnav.h b/libdvdnav/dvdnav.h new file mode 100644 index 0000000..1e39d0b --- /dev/null +++ b/libdvdnav/dvdnav.h @@ -0,0 +1,630 @@ +/* + * Copyright (C) 2001 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: dvdnav.h,v 1.15 2005/10/14 21:02:16 miguelfreitas Exp $ + * + */ + +/* + * This is the main header file applications should include if they want + * to access dvdnav functionality. + */ + +#ifndef DVDNAV_H_INCLUDED +#define DVDNAV_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include "common.h" +# include "dvdnav_events.h" +# include "dvd_types.h" + + + + +/********************************************************************* + * dvdnav data types * + *********************************************************************/ + +/* + * Opaque data-type can be viewed as a 'DVD handle'. You should get + * a pointer to a dvdnav_t from the dvdnav_open() function. + * Never call free() on the pointer, you have to give it back with + * dvdnav_close(). + */ +typedef struct dvdnav_s dvdnav_t; + +/* Status as reported by most of libdvdnav's functions */ +typedef int32_t dvdnav_status_t; + +/* + * Unless otherwise stated, all functions return DVDNAV_STATUS_OK if + * they succeeded, otherwise DVDNAV_STATUS_ERR is returned and the error may + * be obtained by calling dvdnav_err_to_string(). + */ +#define DVDNAV_STATUS_ERR 0 +#define DVDNAV_STATUS_OK 1 + + +/********************************************************************* + * initialisation & housekeeping functions * + *********************************************************************/ + +/* + * These functions allow you to open a DVD device and associate it + * with a dvdnav_t. + */ + +/* + * Attempts to open the DVD drive at the specified path and pre-cache + * the CSS-keys. libdvdread is used to access the DVD, so any source + * supported by libdvdread can be given with "path". Currently, + * libdvdread can access: DVD drives, DVD image files, DVD file-by-file + * copies. + * + * The resulting dvdnav_t handle will be written to *dest. + */ +dvdnav_status_t dvdnav_open(dvdnav_t **dest, const char *path,dvd_reader_t *dvd); + +/* + * Closes a dvdnav_t previously opened with dvdnav_open(), freeing any + * memory associated with it. + */ +dvdnav_status_t dvdnav_close(dvdnav_t *self); + +/* + * Resets the DVD virtual machine and cache buffers. + */ +dvdnav_status_t dvdnav_reset(dvdnav_t *self); + +/* + * Fills a pointer with a value pointing to a string describing + * the path associated with an open dvdnav_t. It assigns *path to NULL + * on error. + */ +dvdnav_status_t dvdnav_path(dvdnav_t *self, const char **path); + +/* + * Returns a human-readable string describing the last error. + */ +const char* dvdnav_err_to_string(dvdnav_t *self); + +/* converts a dvd_time_t to PTS ticks */ +int64_t dvdnav_convert_time(dvd_time_t *time); + +/********************************************************************* + * changing and reading DVD player characteristics * + *********************************************************************/ + +/* + * These functions allow you to manipulate the various global characteristics + * of the DVD playback engine. + */ + +/* + * Sets the region mask (bit 0 set implies region 1, bit 1 set implies + * region 2, etc) of the virtual machine. Generally you will only need to set + * this if you are playing RCE discs which query the virtual machine as to its + * region setting. + * + * This has _nothing_ to do with the region setting of the DVD drive. + */ +dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *self, int32_t region_mask); + +/* + * Returns the region mask (bit 0 set implies region 1, bit 1 set implies + * region 2, etc) of the virtual machine. + * + * This has _nothing_ to do with the region setting of the DVD drive. + */ +dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *self, int32_t *region_mask); + +/* + * Specify whether read-ahead caching should be used. You may not want this if your + * decoding engine does its own buffering. + * + * The default read-ahead cache does not use an additional thread for the reading + * (see read_cache.c for a threaded cache, but note that this code is currently + * unmaintained). It prebuffers on VOBU level by reading ahead several buffers + * on every read request. The speed of this prebuffering has been optimized to + * also work on slow DVD drives. + * + * If in addition you want to prevent memcpy's to improve performance, have a look + * at dvdnav_get_next_cache_block(). + */ +dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *self, int32_t read_ahead_flag); + +/* + * Query whether read-ahead caching/buffering will be used. + */ +dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *self, int32_t *read_ahead_flag); + +/* + * Specify whether the positioning works PGC or PG based. + * Programs (PGs) on DVDs are similar to Chapters and a program chain (PGC) + * usually covers a whole feature. This affects the behaviour of the + * functions dvdnav_get_position() and dvdnav_sector_search(). See there. + * Default is PG based positioning. + */ +dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *self, int32_t pgc_based_flag); + +/* + * Query whether positioning is PG or PGC based. + */ +dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *self, int32_t *pgc_based_flag); + + +/********************************************************************* + * reading data * + *********************************************************************/ + +/* + * These functions are used to poll the playback enginge and actually get data + * off the DVD. + */ + +/* + * Attempts to get the next block off the DVD and copies it into the buffer 'buf'. + * If there is any special actions that may need to be performed, the value + * pointed to by 'event' gets set accordingly. + * + * If 'event' is DVDNAV_BLOCK_OK then 'buf' is filled with the next block + * (note that means it has to be at /least/ 2048 bytes big). 'len' is + * then set to 2048. + * + * Otherwise, buf is filled with an appropriate event structure and + * len is set to the length of that structure. + * + * See the dvdnav_events.h header for information on the various events. + */ +dvdnav_status_t dvdnav_get_next_block(dvdnav_t *self, uint8_t *buf, + int32_t *event, int32_t *len); + +/* + * This basically does the same as dvdnav_get_next_block. The only difference is + * that it avoids a memcopy, when the requested block was found in the cache. + * I such a case (cache hit) this function will return a different pointer than + * the one handed in, pointing directly into the relevant block in the cache. + * Those pointers must _never_ be freed but instead returned to the library via + * dvdnav_free_cache_block(). + */ +dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *self, uint8_t **buf, + int32_t *event, int32_t *len); + +/* + * All buffers which came from the internal cache (when dvdnav_get_next_cache_block() + * returned a buffer different from the one handed in) have to be freed with this + * function. Although handing in other buffers not from the cache doesn't cause any harm. + */ +dvdnav_status_t dvdnav_free_cache_block(dvdnav_t *self, unsigned char *buf); + +/* + * If we are currently in a still-frame this function skips it. + * + * See also the DVDNAV_STILL_FRAME event. + */ +dvdnav_status_t dvdnav_still_skip(dvdnav_t *self); + +/* + * If we are currently in WAIT state, that is: the application is required to + * wait for its fifos to become empty, calling this signals libdvdnav that this + * is achieved and that it can continue. + * + * See also the DVDNAV_WAIT event. + */ +dvdnav_status_t dvdnav_wait_skip(dvdnav_t *self); + +/* + * Returns the still time from the currently playing cell. + * The still time is given in seconds with 0xff meaning an indefinite still. + * + * This function can be used to detect still frames before they are reached. + * Some players might need this to prepare for a frame to be shown for a + * longer time than usual. + */ +uint32_t dvdnav_get_next_still_flag(dvdnav_t *self); + +/* + * Stops playback. The next event obtained with one of the get_next_block + * functions will be a DVDNAV_STOP event. + * + * It is not required to call this before dvdnav_close(). + */ +dvdnav_status_t dvdnav_stop(dvdnav_t *self); + + +/********************************************************************* + * title/part navigation * + *********************************************************************/ + +/* + * Returns the number of titles on the disk. + */ +dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *self, int32_t *titles); + +/* + * Returns the number of parts within the given title. + */ +dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *self, int32_t title, int32_t *parts); + +/* + * Plays the specified title of the DVD from its beginning (that is: part 1). + */ +dvdnav_status_t dvdnav_title_play(dvdnav_t *self, int32_t title); + +/* + * Plays the specified title, starting from the specified part. + */ +dvdnav_status_t dvdnav_part_play(dvdnav_t *self, int32_t title, int32_t part); + +/* + * Play the specified amount of parts of the specified title of + * the DVD then STOP. + * + * Currently unimplemented! + */ +dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *self, int32_t title, + int32_t part, int32_t parts_to_play); + +/* + * Play the specified title starting from the specified time. + * + * Currently unimplemented! + */ +dvdnav_status_t dvdnav_time_play(dvdnav_t *self, int32_t title, + uint64_t time); + +/* + * Stop playing the current position and jump to the specified menu. + * + * See also DVDMenuID_t from libdvdread + */ +dvdnav_status_t dvdnav_menu_call(dvdnav_t *self, DVDMenuID_t menu); + +/* + * Return the title number and part currently being played. + * A title of 0 indicates, we are in a menu. In this case, part + * is set to the current menu's ID. + */ +dvdnav_status_t dvdnav_current_title_info(dvdnav_t *self, int32_t *title, + int32_t *part); + +/* + * Return the current position (in blocks) within the current + * title and the length (in blocks) of said title. + * + * Current implementation is wrong and likely to behave unpredictably! + * Use is discouraged! + */ +dvdnav_status_t dvdnav_get_position_in_title(dvdnav_t *self, + uint32_t *pos, + uint32_t *len); + +/* + * This function is only available for compatibility reasons. + * + * Stop playing the current position and start playback of the current title + * from the specified part. + */ +dvdnav_status_t dvdnav_part_search(dvdnav_t *self, int32_t part); + + +/********************************************************************* + * program chain/program navigation * + *********************************************************************/ + +/* + * Stop playing the current position and start playback from the last + * VOBU boundary before the given sector. The sector number is not + * meant to be an absolute physical DVD sector, but a relative sector + * in the current program. This function cannot leave the current + * program and will fail, if asked to do so. + * + * If program chain based positioning is enabled + * (see dvdnav_set_PGC_positioning_flag()), this will seek to the relative + * sector inside the current program chain. + * + * 'origin' can be one of SEEK_SET, SEEK_CUR, SEEK_END as defined in + * fcntl.h. + */ +dvdnav_status_t dvdnav_sector_search(dvdnav_t *self, + uint64_t offset, int32_t origin); + +/* + * Stop playing the current position and start playback of the title + * from the specified timecode. + * + * Currently unimplemented! + */ +dvdnav_status_t dvdnav_time_search(dvdnav_t *self, + uint64_t time); + +/* + * Stop playing current position and play the "GoUp"-program chain. + * (which generally leads to the title menu or a higer-level menu). + */ +dvdnav_status_t dvdnav_go_up(dvdnav_t *self); + +/* + * Stop playing the current position and start playback at the + * previous program (if it exists). + */ +dvdnav_status_t dvdnav_prev_pg_search(dvdnav_t *self); + +/* + * Stop playing the current position and start playback at the + * first program. + */ +dvdnav_status_t dvdnav_top_pg_search(dvdnav_t *self); + +/* + * Stop playing the current position and start playback at the + * next program (if it exists). + */ +dvdnav_status_t dvdnav_next_pg_search(dvdnav_t *self); + +/* + * Return the current position (in blocks) within the current + * program and the length (in blocks) of current program. + * + * If program chain based positioning is enabled + * (see dvdnav_set_PGC_positioning_flag()), this will return the + * relative position in and the length of the current program chain. + */ +dvdnav_status_t dvdnav_get_position(dvdnav_t *self, uint32_t *pos, + uint32_t *len); + + +/********************************************************************* + * menu highlights * + *********************************************************************/ + +/* + * Most functions related to highlights take a NAV PCI packet as a parameter. + * While you can get the such a packet from libdvdnav, for players with internal + * FIFOs, this will result in errors, because due to the FIFO length, libdvdnav will + * be ahead in the stream compared to what the user is seeing on screen. + * Therefore, player applications who have a NAV packet available, which is + * better in sync with the actual playback should always pass this one to these + * functions. + */ + +/* + * Get the currently highlighted button + * number (1..36) or 0 if no button is highlighted. + */ +dvdnav_status_t dvdnav_get_current_highlight(dvdnav_t *self, int32_t *button); + +/* + * Returns the Presentation Control Information (PCI) structure associated + * with the current position. + * + * Read the general notes above. + * See also libdvdreads nav_types.h for definition of pci_t. + */ +pci_t* dvdnav_get_current_nav_pci(dvdnav_t *self); + +/* + * Returns the DSI (data search information) structure associated + * with the current position. + * + * Read the general notes above. + * See also libdvdreads nav_types.h for definition of dsi_t. + */ +dsi_t* dvdnav_get_current_nav_dsi(dvdnav_t *self); + +/* + * Get the area associated with a certain button. + */ +dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32_t mode, + dvdnav_highlight_area_t *highlight); + +/* + * Move button highlight around as suggested by function name (e.g. with arrow keys). + */ +dvdnav_status_t dvdnav_upper_button_select(dvdnav_t *self, pci_t *pci); +dvdnav_status_t dvdnav_lower_button_select(dvdnav_t *self, pci_t *pci); +dvdnav_status_t dvdnav_right_button_select(dvdnav_t *self, pci_t *pci); +dvdnav_status_t dvdnav_left_button_select(dvdnav_t *self, pci_t *pci); + +/* + * Activate ("press") the currently highlighted button. + */ +dvdnav_status_t dvdnav_button_activate(dvdnav_t *self, pci_t *pci); + +/* + * Highlight a specific button. + */ +dvdnav_status_t dvdnav_button_select(dvdnav_t *self, pci_t *pci, int32_t button); + +/* + * Activate ("press") specified button. + */ +dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *self, pci_t *pci, int32_t button); + +/* + * Activate (press) a button and execute specified command. + */ +dvdnav_status_t dvdnav_button_activate_cmd(dvdnav_t *self, int32_t button, vm_cmd_t *cmd); + +/* + * Select button at specified video frame coordinates. + */ +dvdnav_status_t dvdnav_mouse_select(dvdnav_t *self, pci_t *pci, int32_t x, int32_t y); + +/* + * Activate ("press") button at specified video frame coordinates. + */ +dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *self, pci_t *pci, int32_t x, int32_t y); + + +/********************************************************************* + * languages * + *********************************************************************/ + +/* + * The language codes expected by these functions are two character + * codes as defined in ISO639. + */ + +/* + * Set which menu language we should use per default. + */ +dvdnav_status_t dvdnav_menu_language_select(dvdnav_t *self, + char *code); + +/* + * Set which audio language we should use per default. + */ +dvdnav_status_t dvdnav_audio_language_select(dvdnav_t *self, + char *code); + +/* + * Set which spu language we should use per default. + */ +dvdnav_status_t dvdnav_spu_language_select(dvdnav_t *self, + char *code); + + +/********************************************************************* + * obtaining stream attributes * + *********************************************************************/ + +/* + * Return a string describing the title of the DVD. + * This is an ID string encoded on the disc by the author. In many cases + * this is a descriptive string such as `THE_MATRIX' but sometimes is sigularly + * uninformative such as `PDVD-011421'. Some DVD authors even forget to set this, + * so you may also read the default of the authoring software they used, like + * `DVDVolume'. + */ +dvdnav_status_t dvdnav_get_title_string(dvdnav_t *self, const char **title_str); + +/* + * Get video aspect code. + * The aspect code does only change on VTS boundaries. + * See the DVDNAV_VTS_CHANGE event. + * + * 0 -- 4:3, 2 -- 16:9 + */ +uint8_t dvdnav_get_video_aspect(dvdnav_t *self); + +/* + * Get video scaling permissions. + * The scaling permission does only change on VTS boundaries. + * See the DVDNAV_VTS_CHANGE event. + * + * bit0 set = deny letterboxing, bit1 set = deny pan&scan + */ +uint8_t dvdnav_get_video_scale_permission(dvdnav_t *self); + +/* + * Converts a *logical* audio stream id into language code + * (returns 0xffff if no such stream). + */ +uint16_t dvdnav_audio_stream_to_lang(dvdnav_t *self, uint8_t stream); + +/* + * Converts a *logical* subpicture stream id into country code + * (returns 0xffff if no such stream). + */ +uint16_t dvdnav_spu_stream_to_lang(dvdnav_t *self, uint8_t stream); + +/* + * Converts a *physical* (MPEG) audio stream id into a logical stream number. + */ +int8_t dvdnav_get_audio_logical_stream(dvdnav_t *self, uint8_t audio_num); + +/* + * Converts a *physical* (MPEG) subpicture stream id into a logical stream number. + */ +int8_t dvdnav_get_spu_logical_stream(dvdnav_t *self, uint8_t subp_num); + +/* + * Get active audio stream. + */ +int8_t dvdnav_get_active_audio_stream(dvdnav_t *self); + +/* + * Get active spu stream. + */ +int8_t dvdnav_get_active_spu_stream(dvdnav_t *self); + + +/********************************************************************* + * multiple angles * + *********************************************************************/ + +/* + * The libdvdnav library abstracts away the difference between seamless and + * non-seamless angles. From the point of view of the programmer you just set the + * angle number and all is well in the world. You will always see only the + * selected angle coming from the get_next_block functions. + * + * Note: + * It is quite possible that some tremendously strange DVD feature might change the + * angle number from under you. Generally you should always view the results from + * dvdnav_get_angle_info() as definitive only up to the next time you call + * dvdnav_get_next_block(). + */ + +/* + * Sets the current angle. If you try to follow a non existant angle + * the call fails. + */ +dvdnav_status_t dvdnav_angle_change(dvdnav_t *self, int32_t angle); + +/* + * Returns the current angle and number of angles present. + */ +dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *self, int32_t *current_angle, + int32_t *number_of_angles); + +/********************************************************************* + * domain queries * + *********************************************************************/ + +/* + * Are we in the First Play domain? + */ +int8_t dvdnav_is_domain_fp(dvdnav_t *self); + +/* + * Are we in the Video management Menu domain? + */ +int8_t dvdnav_is_domain_vmgm(dvdnav_t *self); + +/* + * Are we in the Video Title Menu domain? + */ +int8_t dvdnav_is_domain_vtsm(dvdnav_t *self); + +/* + * Are we in the Video Title Set domain? + */ +int8_t dvdnav_is_domain_vts(dvdnav_t *self); + + +#ifdef __cplusplus +} +#endif + +#endif /* DVDNAV_H_INCLUDED */ diff --git a/libdvdnav/dvdnav_events.h b/libdvdnav/dvdnav_events.h new file mode 100644 index 0000000..1623277 --- /dev/null +++ b/libdvdnav/dvdnav_events.h @@ -0,0 +1,241 @@ +/* + * Copyright (C) 2001 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: dvdnav_events.h,v 1.11 2003/04/07 18:10:48 mroi Exp $ + * + */ + +/* + * This header defines events and event types + */ + +#ifndef DVDNAV_EVENTS_H_INCLUDED +#define DVDNAV_EVENTS_H_INCLUDED + +#include "common.h" + +/* + * DVDNAV_BLOCK_OK + * + * A regular data block from the DVD has been returned. + * This one should be demuxed and decoded for playback. + */ +#define DVDNAV_BLOCK_OK 0 + + +/* + * DVDNAV_NOP + * + * Just ignore this. + */ +#define DVDNAV_NOP 1 + + +/* + * DVDNAV_STILL_FRAME + * + * We have reached a still frame. The player application should wait + * the amount of time specified by the still's length while still handling + * user input to make menus and other interactive stills work. + * The last delivered frame should be kept showing. + * Once the still has timed out, call dvdnav_skip_still(). + * A length of 0xff means an infinite still which has to be skipped + * indirectly by some user interaction. + */ +#define DVDNAV_STILL_FRAME 2 + +typedef struct { + /* The length (in seconds) the still frame should be displayed for, + * or 0xff if infinite. */ + int length; +} dvdnav_still_event_t; + + +/* + * DVDNAV_SPU_STREAM_CHANGE + * + * Inform the SPU decoding/overlaying engine to switch SPU channels. + */ +#define DVDNAV_SPU_STREAM_CHANGE 3 + +typedef struct { + /* The physical (MPEG) stream number for widescreen SPU display. + * Use this, if you blend the SPU on an anamorphic image before + * unsqueezing it. */ + int physical_wide; + + /* The physical (MPEG) stream number for letterboxed display. + * Use this, if you blend the SPU on an anamorphic image after + * unsqueezing it. */ + int physical_letterbox; + + /* The physical (MPEG) stream number for pan&scan display. + * Use this, if you blend the SPU on an anamorphic image after + * unsqueezing it the pan&scan way. */ + int physical_pan_scan; + + /* The logical (DVD) stream number. */ + int logical; +} dvdnav_spu_stream_change_event_t; + + +/* + * DVDNAV_AUDIO_STREAM_CHANGE + * + * Inform the audio decoder to switch channels. + */ +#define DVDNAV_AUDIO_STREAM_CHANGE 4 + +typedef struct { + /* The physical (MPEG) stream number. */ + int physical; + + /* The logical (DVD) stream number. */ + int logical; +} dvdnav_audio_stream_change_event_t; + + +/* + * DVDNAV_VTS_CHANGE + * + * Some status information like video aspect and video scale permissions do + * not change inside a VTS. Therefore this event can be used to query such + * information only when necessary and update the decoding/displaying + * accordingly. + */ +#define DVDNAV_VTS_CHANGE 5 + +typedef struct { + int old_vtsN; /* the old VTS number */ + dvd_read_domain_t old_domain; /* the old domain */ + int new_vtsN; /* the new VTS number */ + dvd_read_domain_t new_domain; /* the new domain */ +} dvdnav_vts_change_event_t; + + +/* + * DVDNAV_CELL_CHANGE + * + * Some status information like the current Title and Part numbers do not + * change inside a cell. Therefore this event can be used to query such + * information only when necessary and update the decoding/displaying + * accordingly. + * Some useful information for accurate time display is also reported + * together with this event. + */ +#define DVDNAV_CELL_CHANGE 6 + +typedef struct { + int cellN; /* the new cell number */ + int pgN; /* the current program number */ + int64_t cell_length; /* the length of the current cell in PTS ticks */ + int64_t pg_length; /* the length of the current program in PTS ticks */ + int64_t pgc_length; /* the length of the current program chain in PTS ticks */ + int64_t cell_start; /* the start time of the current cell relatively to the PGC in PTS ticks */ + int64_t pg_start; /* the start time of the current PG relatively to the PGC in PTS ticks */ +} dvdnav_cell_change_event_t; + + +/* + * DVDNAV_NAV_PACKET + * + * NAV packets are useful for various purposes. They define the button + * highlight areas and VM commands of DVD menus, so they should in any + * case be sent to the SPU decoder/overlaying engine for the menus to work. + * NAV packets also provide a way to detect PTS discontinuities, because + * they carry the start and end PTS values for the current VOBU. + * (pci.vobu_s_ptm and pci.vobu_e_ptm) Whenever the start PTS of the + * current NAV does not match the end PTS of the previous NAV, a PTS + * discontinuity has occured. + * NAV packets can also be used for time display, because they are + * timestamped relatively to the current Cell. + */ +#define DVDNAV_NAV_PACKET 7 + + +/* + * DVDNAV_STOP + * + * Applications should end playback here. A subsequent dvdnav_get_next_block() + * call will restart the VM from the beginning of the DVD. + */ +#define DVDNAV_STOP 8 + + +/* + * DVDNAV_HIGHLIGHT + * + * The current button highlight changed. Inform the overlaying engine to + * highlight a different button. Please note, that at the moment only mode 1 + * highlights are reported this way. That means, when the button highlight + * has been moved around by some function call, you will receive an event + * telling you the new button. But when a button gets activated, you have + * to handle the mode 2 highlighting (that is some different colour the + * button turns to on activation) in your application. + */ +#define DVDNAV_HIGHLIGHT 9 + +typedef struct { + /* highlight mode: 0 - hide, 1 - show, 2 - activate, currently always 1 */ + int display; + + /* FIXME: these fields are currently not set */ + uint32_t palette; /* The CLUT entries for the highlight palette + (4-bits per entry -> 4 entries) */ + uint16_t sx,sy,ex,ey; /* The start/end x,y positions */ + uint32_t pts; /* Highlight PTS to match with SPU */ + + /* button number for the SPU decoder/overlaying engine */ + uint32_t buttonN; +} dvdnav_highlight_event_t; + + +/* + * DVDNAV_SPU_CLUT_CHANGE + * + * Inform the SPU decoder/overlaying engine to update its colour lookup table. + * The CLUT is given as 16 uint32_t's in the buffer. + */ +#define DVDNAV_SPU_CLUT_CHANGE 10 + + +/* + * DVDNAV_HOP_CHANNEL + * + * A non-seamless operation has been performed. Applications can drop all + * their internal fifo's content, which will speed up the response. + */ +#define DVDNAV_HOP_CHANNEL 12 + + +/* + * DVDNAV_WAIT + * + * We have reached a point in DVD playback, where timing is critical. + * Player application with internal fifos can introduce state + * inconsistencies, because libdvdnav is always the fifo's length + * ahead in the stream compared to what the application sees. + * Such applications should wait until their fifos are empty + * when they receive this type of event. + * Once this is achieved, call dvdnav_skip_wait(). + */ +#define DVDNAV_WAIT 13 + + +#endif /* DVDNAV_EVENTS_H_INCLUDED */ diff --git a/libdvdnav/dvdnav_internal.h b/libdvdnav/dvdnav_internal.h new file mode 100644 index 0000000..efa8708 --- /dev/null +++ b/libdvdnav/dvdnav_internal.h @@ -0,0 +1,199 @@ +/* + * Copyright (C) 2001-2004 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: dvdnav_internal.h,v 1.15 2004/09/20 19:30:04 valtri Exp $ + * + */ + +#ifndef DVDNAV_INTERNAL_H_INCLUDED +#define DVDNAV_INTERNAL_H_INCLUDED + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "common.h" +#include +#include +#include +#include +#include + +#ifdef WIN32 + +/* pthread_mutex_* wrapper for win32 */ +#include +#include +typedef CRITICAL_SECTION pthread_mutex_t; +#define pthread_mutex_init(a, b) InitializeCriticalSection(a) +#define pthread_mutex_lock(a) EnterCriticalSection(a) +#define pthread_mutex_unlock(a) LeaveCriticalSection(a) +#define pthread_mutex_destroy(a) + +/* replacement gettimeofday implementation */ +#include +static inline int _private_gettimeofday( struct timeval *tv, void *tz ) +{ + struct timeb t; + ftime( &t ); + tv->tv_sec = t.time; + tv->tv_usec = t.millitm * 1000; + return 0; +} +#define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ)) +#include /* read() */ +#define lseek64 _lseeki64 + +#else + +#include + +#endif /* WIN32 */ + +/* Uncomment for VM command tracing */ +/* #define TRACE */ + +#include "decoder.h" +#include "dvdnav.h" +#include "vm.h" +#include "vmcmd.h" + +/* where should libdvdnav write its messages (stdout/stderr) */ +#define MSG_OUT stderr + +/* Maximum length of an error string */ +#define MAX_ERR_LEN 255 + +/* Use the POSIX PATH_MAX if available */ +#ifdef PATH_MAX +#define MAX_PATH_LEN PATH_MAX +#else +#define MAX_PATH_LEN 255 /* Arbitrary */ +#endif + +#ifndef DVD_VIDEO_LB_LEN +#define DVD_VIDEO_LB_LEN 2048 +#endif + +typedef struct read_cache_s read_cache_t; + +/* + * These are defined here because they are + * not in ifo_types.h, they maybe one day + */ + +#ifndef audio_status_t +typedef struct { +#ifdef WORDS_BIGENDIAN + unsigned int available : 1; + unsigned int zero1 : 4; + unsigned int stream_number : 3; + uint8_t zero2; +#else + uint8_t zero2; + unsigned int stream_number : 3; + unsigned int zero1 : 4; + unsigned int available : 1; +#endif +} ATTRIBUTE_PACKED audio_status_t; +#endif + +#ifndef spu_status_t +typedef struct { +#ifdef WORDS_BIGENDIAN + unsigned int available : 1; + unsigned int zero1 : 2; + unsigned int stream_number_4_3 : 5; + unsigned int zero2 : 3; + unsigned int stream_number_wide : 5; + unsigned int zero3 : 3; + unsigned int stream_number_letterbox : 5; + unsigned int zero4 : 3; + unsigned int stream_number_pan_scan : 5; +#else + unsigned int stream_number_pan_scan : 5; + unsigned int zero4 : 3; + unsigned int stream_number_letterbox : 5; + unsigned int zero3 : 3; + unsigned int stream_number_wide : 5; + unsigned int zero2 : 3; + unsigned int stream_number_4_3 : 5; + unsigned int zero1 : 2; + unsigned int available : 1; +#endif +} ATTRIBUTE_PACKED spu_status_t; +#endif + +typedef struct dvdnav_vobu_s { + int32_t vobu_start; /* Logical Absolute. MAX needed is 0x300000 */ + int32_t vobu_length; + int32_t blockN; /* Relative offset */ + int32_t vobu_next; /* Relative offset */ +} dvdnav_vobu_t; + +/** The main DVDNAV type **/ + +struct dvdnav_s { + /* General data */ + char path[MAX_PATH_LEN]; /* Path to DVD device/dir */ + dvd_file_t *file; /* Currently opened file */ + + /* Position data */ + vm_position_t position_next; + vm_position_t position_current; + dvdnav_vobu_t vobu; + + /* NAV data */ + pci_t pci; + dsi_t dsi; + uint32_t last_cmd_nav_lbn; /* detects when a command is issued on an already left NAV */ + + /* Flags */ + int skip_still; /* Set when skipping a still */ + int sync_wait; /* applications should wait till they are in sync with us */ + int sync_wait_skip; /* Set when skipping wait state */ + int spu_clut_changed; /* The SPU CLUT changed */ + int started; /* vm_start has been called? */ + int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */ + int pgc_based; /* positioning works PGC based instead of PG based */ + + /* VM */ + vm_t *vm; + pthread_mutex_t vm_lock; + + /* Read-ahead cache */ + read_cache_t *cache; + + /* Errors */ + char err_str[MAX_ERR_LEN]; +}; + +/** USEFUL MACROS **/ + +#ifdef __GNUC__ +#define printerrf(format, args...) snprintf(this->err_str, MAX_ERR_LEN, format, ## args); +#else +#ifdef _MSC_VER +#define printerrf(str) snprintf(this->err_str, MAX_ERR_LEN, str); +#else +#define printerrf(...) snprintf(this->err_str, MAX_ERR_LEN, __VA_ARGS__); +#endif /* WIN32 */ +#endif +#define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN); + +#endif /* DVDNAV_INTERNAL_H_INCLUDED */ diff --git a/libdvdnav/dvdread.c b/libdvdnav/dvdread.c new file mode 100644 index 0000000..9291ff6 --- /dev/null +++ b/libdvdnav/dvdread.c @@ -0,0 +1,74 @@ +#include "dvdread.h" + +#include + +void *libHandle=0; + +DvdreadFunctions_t f_dvdread; + +void loadDvdread() { + libHandle=dlopen("libdvdread.so",RTLD_LAZY | RTLD_GLOBAL); + if (!libHandle) { + libHandle=dlopen("libdvdread.so.3",RTLD_LAZY | RTLD_GLOBAL); + } + if (!libHandle) { + libHandle=dlopen("libdvdread.so.2",RTLD_LAZY | RTLD_GLOBAL); + } + f_dvdread.DVDOpen=dlsym(libHandle,"DVDOpen"); + f_dvdread.DVDOpenFile=dlsym(libHandle,"DVDOpenFile"); + f_dvdread.DVDClose=dlsym(libHandle,"DVDClose"); + f_dvdread.DVDCloseFile=dlsym(libHandle,"DVDCloseFile"); + f_dvdread.DVDReadBlocks=dlsym(libHandle,"DVDReadBlocks"); + f_dvdread.DVDFileSeek=dlsym(libHandle,"DVDFileSeek"); + f_dvdread.DVDReadBytes=dlsym(libHandle,"DVDReadBytes"); + f_dvdread.DVDFileSize=dlsym(libHandle,"DVDFileSize"); + f_dvdread.DVDDiscID=dlsym(libHandle,"DVDDiscID"); + f_dvdread.DVDUDFVolumeInfo=dlsym(libHandle,"DVDUDFVolumeInfo"); + f_dvdread.DVDISOVolumeInfo=dlsym(libHandle,"DVDISOVolumeInfo"); + f_dvdread.DVDUDFCacheLevel=dlsym(libHandle,"DVDUDFCacheLevel"); + f_dvdread.navRead_PCI=dlsym(libHandle,"navRead_PCI"); + f_dvdread.navRead_DSI=dlsym(libHandle,"navRead_DSI"); + + + f_dvdread.ifoOpen=dlsym(libHandle,"ifoOpen"); + f_dvdread.ifoOpenVMGI=dlsym(libHandle,"ifoOpenVMGI"); + f_dvdread.ifoOpenVTSI=dlsym(libHandle,"ifoOpenVTSI"); + f_dvdread.ifoClose=dlsym(libHandle,"ifoClose"); + f_dvdread.ifoRead_PTL_MAIT=dlsym(libHandle,"ifoRead_PTL_MAIT"); + f_dvdread.ifoRead_VTS_ATRT=dlsym(libHandle,"ifoRead_VTS_ATRT"); + f_dvdread.ifoRead_TT_SRPT=dlsym(libHandle,"ifoRead_TT_SRPT"); + f_dvdread.ifoRead_VTS_PTT_SRPT=dlsym(libHandle,"ifoRead_VTS_PTT_SRPT"); + + f_dvdread.ifoRead_FP_PGC=dlsym(libHandle,"ifoRead_FP_PGC"); + f_dvdread.ifoRead_PGCIT=dlsym(libHandle,"ifoRead_PGCIT"); + f_dvdread.ifoRead_PGCI_UT=dlsym(libHandle,"ifoRead_PGCI_UT"); + f_dvdread.ifoRead_VTS_TMAPT=dlsym(libHandle,"ifoRead_VTS_TMAPT"); + f_dvdread.ifoRead_C_ADT=dlsym(libHandle,"ifoRead_C_ADT"); + f_dvdread.ifoRead_TITLE_C_ADT=dlsym(libHandle,"ifoRead_TITLE_C_ADT"); + f_dvdread.ifoRead_VOBU_ADMAP=dlsym(libHandle,"ifoRead_VOBU_ADMAP"); + f_dvdread.ifoRead_TITLE_VOBU_ADMAP=dlsym(libHandle,"ifoRead_TITLE_VOBU_ADMAP"); + f_dvdread.ifoRead_TXTDT_MGI=dlsym(libHandle,"ifoRead_TXTDT_MGI"); + + f_dvdread.ifoFree_PTL_MAIT=dlsym(libHandle,"ifoFree_PTL_MAIT"); + f_dvdread.ifoFree_VTS_ATRT=dlsym(libHandle,"ifoFree_VTS_ATRT"); + f_dvdread.ifoFree_TT_SRPT=dlsym(libHandle,"ifoFree_TT_SRPT"); + f_dvdread.ifoFree_VTS_PTT_SRPT=dlsym(libHandle,"ifoFree_VTS_PTT_SRPT"); + f_dvdread.ifoFree_FP_PGC=dlsym(libHandle,"ifoFree_FP_PGC"); + f_dvdread.ifoFree_PGCIT=dlsym(libHandle,"ifoFree_PGCIT"); + f_dvdread.ifoFree_PGCI_UT=dlsym(libHandle,"ifoFree_PGCI_UT"); + f_dvdread.ifoFree_VTS_TMAPT=dlsym(libHandle,"ifoFree_VTS_TMAPT"); + f_dvdread.ifoFree_C_ADT=dlsym(libHandle,"ifoFree_C_ADT"); + f_dvdread.ifoFree_TITLE_C_ADT=dlsym(libHandle,"ifoFree_TITLE_C_ADT"); + f_dvdread.ifoFree_VOBU_ADMAP=dlsym(libHandle,"ifoFree_VOBU_ADMAP"); + f_dvdread.ifoFree_TITLE_VOBU_ADMAP=dlsym(libHandle,"ifoFree_TITLE_VOBU_ADMAP"); + f_dvdread.ifoFree_TXTDT_MGI=dlsym(libHandle,"ifoFree_TXTDT_MGI"); + +} + +DvdreadFunctions_t *DvdreadF(void) { + return &f_dvdread; +} + +void unloadDvdread() { + dlclose(libHandle); +} diff --git a/libdvdnav/dvdread.h b/libdvdnav/dvdread.h new file mode 100644 index 0000000..8150385 --- /dev/null +++ b/libdvdnav/dvdread.h @@ -0,0 +1,28 @@ +/* +// C++ Interface: dvdread +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +*/ +#ifndef DVDREAD_H_INCLUDED +#define DVDREAD_H_INCLUDED + + + +#ifdef __cplusplus +extern "C" { +#endif + +#include "common.h" + + +#ifdef __cplusplus +} +#endif +#endif diff --git a/libdvdnav/highlight.c b/libdvdnav/highlight.c new file mode 100644 index 0000000..0335c36 --- /dev/null +++ b/libdvdnav/highlight.c @@ -0,0 +1,512 @@ +/* + * Copyright (C) 2000 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: highlight.c,v 1.17 2004/03/16 11:43:38 mroi Exp $ + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "common.h" +#include +#include "dvdnav_internal.h" + +/* +#define BUTTON_TESTING +*/ + +#ifdef BUTTON_TESTING + +#include "nav_print.h" + +static void print_time(dvd_time_t *dtime) { + const char *rate; + + assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa); + assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa); + assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa); + assert((dtime->frame_u&0xf) < 0xa); + + fprintf(MSG_OUT,"%02x:%02x:%02x.%02x", + dtime->hour, + dtime->minute, + dtime->second, + dtime->frame_u & 0x3f); + switch((dtime->frame_u & 0xc0) >> 6) { + case 1: + rate = "25.00"; + break; + case 3: + rate = "29.97"; + break; + default: + rate = "(please send a bug report)"; + break; + } + fprintf(MSG_OUT," @ %s fps", rate); +} + +static void nav_print_PCI_GI(pci_gi_t *pci_gi) { + int32_t i; + + fprintf(MSG_OUT,"libdvdnav: pci_gi:\n"); + fprintf(MSG_OUT,"libdvdnav: nv_pck_lbn 0x%08x\n", pci_gi->nv_pck_lbn); + fprintf(MSG_OUT,"libdvdnav: vobu_cat 0x%04x\n", pci_gi->vobu_cat); + fprintf(MSG_OUT,"libdvdnav: vobu_uop_ctl 0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl); + fprintf(MSG_OUT,"libdvdnav: vobu_s_ptm 0x%08x\n", pci_gi->vobu_s_ptm); + fprintf(MSG_OUT,"libdvdnav: vobu_e_ptm 0x%08x\n", pci_gi->vobu_e_ptm); + fprintf(MSG_OUT,"libdvdnav: vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm); + fprintf(MSG_OUT,"libdvdnav: e_eltm "); + print_time(&pci_gi->e_eltm); + fprintf(MSG_OUT,"\n"); + + fprintf(MSG_OUT,"libdvdnav: vobu_isrc \""); + for(i = 0; i < 32; i++) { + char c = pci_gi->vobu_isrc[i]; + if((c >= ' ') && (c <= '~')) + fprintf(MSG_OUT,"%c", c); + else + fprintf(MSG_OUT,"."); + } + fprintf(MSG_OUT,"\"\n"); +} + +static void nav_print_NSML_AGLI(nsml_agli_t *nsml_agli) { + int32_t i, j = 0; + + for(i = 0; i < 9; i++) + j |= nsml_agli->nsml_agl_dsta[i]; + if(j == 0) + return; + + fprintf(MSG_OUT,"libdvdnav: nsml_agli:\n"); + for(i = 0; i < 9; i++) + if(nsml_agli->nsml_agl_dsta[i]) + fprintf(MSG_OUT,"libdvdnav: nsml_agl_c%d_dsta 0x%08x\n", i + 1, + nsml_agli->nsml_agl_dsta[i]); +} + +static void nav_print_HL_GI(hl_gi_t *hl_gi, int32_t *btngr_ns, int32_t *btn_ns) { + + if((hl_gi->hli_ss & 0x03) == 0) + return; + + fprintf(MSG_OUT,"libdvdnav: hl_gi:\n"); + fprintf(MSG_OUT,"libdvdnav: hli_ss 0x%01x\n", hl_gi->hli_ss & 0x03); + fprintf(MSG_OUT,"libdvdnav: hli_s_ptm 0x%08x\n", hl_gi->hli_s_ptm); + fprintf(MSG_OUT,"libdvdnav: hli_e_ptm 0x%08x\n", hl_gi->hli_e_ptm); + fprintf(MSG_OUT,"libdvdnav: btn_se_e_ptm 0x%08x\n", hl_gi->btn_se_e_ptm); + + *btngr_ns = hl_gi->btngr_ns; + fprintf(MSG_OUT,"libdvdnav: btngr_ns %d\n", hl_gi->btngr_ns); + fprintf(MSG_OUT,"libdvdnav: btngr%d_dsp_ty 0x%02x\n", 1, hl_gi->btngr1_dsp_ty); + fprintf(MSG_OUT,"libdvdnav: btngr%d_dsp_ty 0x%02x\n", 2, hl_gi->btngr2_dsp_ty); + fprintf(MSG_OUT,"libdvdnav: btngr%d_dsp_ty 0x%02x\n", 3, hl_gi->btngr3_dsp_ty); + + fprintf(MSG_OUT,"libdvdnav: btn_ofn %d\n", hl_gi->btn_ofn); + *btn_ns = hl_gi->btn_ns; + fprintf(MSG_OUT,"libdvdnav: btn_ns %d\n", hl_gi->btn_ns); + fprintf(MSG_OUT,"libdvdnav: nsl_btn_ns %d\n", hl_gi->nsl_btn_ns); + fprintf(MSG_OUT,"libdvdnav: fosl_btnn %d\n", hl_gi->fosl_btnn); + fprintf(MSG_OUT,"libdvdnav: foac_btnn %d\n", hl_gi->foac_btnn); +} + +static void nav_print_BTN_COLIT(btn_colit_t *btn_colit) { + int32_t i, j; + + j = 0; + for(i = 0; i < 6; i++) + j |= btn_colit->btn_coli[i/2][i&1]; + if(j == 0) + return; + + fprintf(MSG_OUT,"libdvdnav: btn_colit:\n"); + for(i = 0; i < 3; i++) + for(j = 0; j < 2; j++) + fprintf(MSG_OUT,"libdvdnav: btn_cqoli %d %s_coli: %08x\n", + i, (j == 0) ? "sl" : "ac", + btn_colit->btn_coli[i][j]); +} + +static void nav_print_BTNIT(btni_t *btni_table, int32_t btngr_ns, int32_t btn_ns) { + int32_t i, j, k; + + fprintf(MSG_OUT,"libdvdnav: btnit:\n"); + fprintf(MSG_OUT,"libdvdnav: btngr_ns: %i\n", btngr_ns); + fprintf(MSG_OUT,"libdvdnav: btn_ns: %i\n", btn_ns); + + if(btngr_ns == 0) + return; + + for(i = 0; i < btngr_ns; i++) { + for(j = 0; j < (36 / btngr_ns); j++) { + if(j < btn_ns) { + btni_t *btni = &btni_table[(36 / btngr_ns) * i + j]; + + fprintf(MSG_OUT,"libdvdnav: group %d btni %d: ", i+1, j+1); + fprintf(MSG_OUT,"btn_coln %d, auto_action_mode %d\n", + btni->btn_coln, btni->auto_action_mode); + fprintf(MSG_OUT,"libdvdnav: coords (%d, %d) .. (%d, %d)\n", + btni->x_start, btni->y_start, btni->x_end, btni->y_end); + + fprintf(MSG_OUT,"libdvdnav: up %d, ", btni->up); + fprintf(MSG_OUT,"down %d, ", btni->down); + fprintf(MSG_OUT,"left %d, ", btni->left); + fprintf(MSG_OUT,"right %d\n", btni->right); + for(k = 0; k < 8; k++) { + fprintf(MSG_OUT, "libdvdnav: %02x ", btni->cmd.bytes[k]); + } + fprintf(MSG_OUT, "| "); +#ifdef TRACE + vm_print_mnemonic(&btni->cmd); +#endif + fprintf(MSG_OUT, "\n"); + } + } + } +} + +static void nav_print_HLI(hli_t *hli) { + int32_t btngr_ns = 0, btn_ns = 0; + + fprintf(MSG_OUT,"libdvdnav: hli:\n"); + nav_print_HL_GI(&hli->hl_gi, & btngr_ns, & btn_ns); + nav_print_BTN_COLIT(&hli->btn_colit); + nav_print_BTNIT(hli->btnit, btngr_ns, btn_ns); +} + +void nav_print_PCI(pci_t *pci) { + fprintf(MSG_OUT,"libdvdnav: pci packet:\n"); + nav_print_PCI_GI(&pci->pci_gi); + nav_print_NSML_AGLI(&pci->nsml_agli); + nav_print_HLI(&pci->hli); +} + +#endif + + +/* Highlighting API calls */ + +dvdnav_status_t dvdnav_get_current_highlight(dvdnav_t *this, int32_t *button) { + + if(!this || !button) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + /* Simply return the appropriate value based on the SPRM */ + if(((*button) = this->position_current.button) == -1) + (*button) = this->vm->state.HL_BTNN_REG >> 10; + + return DVDNAV_STATUS_OK; +} + +static btni_t *get_current_button(dvdnav_t *this, pci_t *pci) { + int32_t button = 0; + + if(!this || !pci) { + printerr("Passed a NULL pointer."); + return NULL; + } + if(!pci->hli.hl_gi.hli_ss) { + printerr("Not in a menu."); + return NULL; + } + if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { + printerr("This NAV has already been left."); + return NULL; + } + + button = this->vm->state.HL_BTNN_REG >> 10; +#ifdef BUTTON_TESTING + nav_print_PCI(pci); +#endif + + return &(pci->hli.btnit[button-1]); +} + +static dvdnav_status_t button_auto_action(dvdnav_t *this, pci_t *pci) { + if (get_current_button(this, pci)->auto_action_mode) + return dvdnav_button_activate(this, pci); + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_upper_button_select(dvdnav_t *this, pci_t *pci) { + btni_t *button_ptr; + + if(!(button_ptr = get_current_button(this, pci))) + return DVDNAV_STATUS_ERR; + + dvdnav_button_select(this, pci, button_ptr->up); + return button_auto_action(this, pci); +} + +dvdnav_status_t dvdnav_lower_button_select(dvdnav_t *this, pci_t *pci) { + btni_t *button_ptr; + + if(!(button_ptr = get_current_button(this, pci))) + return DVDNAV_STATUS_ERR; + + dvdnav_button_select(this, pci, button_ptr->down); + return button_auto_action(this, pci); +} + +dvdnav_status_t dvdnav_right_button_select(dvdnav_t *this, pci_t *pci) { + btni_t *button_ptr; + + if(!(button_ptr = get_current_button(this, pci))) + return DVDNAV_STATUS_ERR; + + dvdnav_button_select(this, pci, button_ptr->right); + return button_auto_action(this, pci); +} + +dvdnav_status_t dvdnav_left_button_select(dvdnav_t *this, pci_t *pci) { + btni_t *button_ptr; + + if(!(button_ptr = get_current_button(this, pci))) + return DVDNAV_STATUS_ERR; + + dvdnav_button_select(this, pci, button_ptr->left); + return button_auto_action(this, pci); +} + +dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32_t mode, + dvdnav_highlight_area_t *highlight) { + btni_t *button_ptr; + +#ifdef BUTTON_TESTING + fprintf(MSG_OUT, "libdvdnav: Button get_highlight_area %i\n", button); +#endif + + if(!nav_pci->hli.hl_gi.hli_ss) + return DVDNAV_STATUS_ERR; + if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns)) + return DVDNAV_STATUS_ERR; + + + button_ptr = &nav_pci->hli.btnit[button-1]; + + highlight->sx = button_ptr->x_start; + highlight->sy = button_ptr->y_start; + highlight->ex = button_ptr->x_end; + highlight->ey = button_ptr->y_end; + if(button_ptr->btn_coln != 0) { + highlight->palette = nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode]; + } else { + highlight->palette = 0; + } + highlight->pts = nav_pci->hli.hl_gi.hli_s_ptm; + highlight->buttonN = button; +#ifdef BUTTON_TESTING + fprintf(MSG_OUT, "libdvdnav: highlight: Highlight area is (%u,%u)-(%u,%u), display = %i, button = %u\n", + button_ptr->x_start, button_ptr->y_start, + button_ptr->x_end, button_ptr->y_end, + 1, + button); +#endif + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_button_activate(dvdnav_t *this, pci_t *pci) { + int32_t button; + btni_t *button_ptr = NULL; + + if(!this || !pci) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + if(!pci->hli.hl_gi.hli_ss) { + printerr("Not in a menu."); + return DVDNAV_STATUS_ERR; + } + if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { + printerr("This NAV has already been left."); + return DVDNAV_STATUS_ERR; + } + pthread_mutex_lock(&this->vm_lock); + + button = this->vm->state.HL_BTNN_REG >> 10; + + if((button <= 0) || (button > pci->hli.hl_gi.btn_ns)) { + /* Special code to handle still menus with no buttons. + * The navigation is expected to report to the application that a STILL is + * underway. In turn, the application is supposed to report to the user + * that the playback is paused. The user is then expected to undo the pause, + * ie: hit play. At that point, the navigation should release the still and + * go to the next Cell. + * Explanation by Mathieu Lacage + * Code added by jcdutton. + */ + if (this->position_current.still != 0) { + /* In still, but no buttons. */ + vm_get_next_cell(this->vm); + this->position_current.still = 0; + this->sync_wait = 0; + this->last_cmd_nav_lbn = pci->pci_gi.nv_pck_lbn; + pthread_mutex_unlock(&this->vm_lock); + /* clear error message */ + printerr(""); + return DVDNAV_STATUS_OK; + } + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + + button_ptr = get_current_button(this, pci); + /* Finally, make the VM execute the appropriate code and probably + * scedule a jump */ +#ifdef BUTTON_TESTING + fprintf(MSG_OUT, "libdvdnav: Evaluating Button Activation commands.\n"); +#endif + if(vm_exec_cmd(this->vm, &(button_ptr->cmd)) == 1) { + /* Command caused a jump */ + this->vm->hop_channel++; + this->position_current.still = 0; + this->last_cmd_nav_lbn = pci->pci_gi.nv_pck_lbn; + } + + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_button_activate_cmd(dvdnav_t *this, int32_t button, vm_cmd_t *cmd) +{ + if(!this || !cmd) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + /* make the VM execute the appropriate code and probably + * schedule a jump */ +#ifdef BUTTON_TESTING + fprintf(MSG_OUT, "libdvdnav: dvdnav_button_activate_cmd: Evaluating Button Activation commands.\n"); +#endif + if(button > 0) { + this->vm->state.HL_BTNN_REG = (button << 10); + if(vm_exec_cmd(this->vm, cmd) == 1) { + /* Command caused a jump */ + this->vm->hop_channel++; + } + } + /* Always remove still, because some still menus have no buttons. */ + this->position_current.still = 0; + this->sync_wait = 0; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_button_select(dvdnav_t *this, pci_t *pci, int32_t button) { + + if(!this || !pci) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + if(!pci->hli.hl_gi.hli_ss) { + printerr("Not in a menu."); + return DVDNAV_STATUS_ERR; + } + if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { + printerr("This NAV has already been left."); + return DVDNAV_STATUS_ERR; + } + +#ifdef BUTTON_TESTING + fprintf(MSG_OUT, "libdvdnav: Button select %i\n", button); +#endif + + if((button <= 0) || (button > pci->hli.hl_gi.btn_ns)) { + printerr("Button does not exist."); + return DVDNAV_STATUS_ERR; + } + + this->vm->state.HL_BTNN_REG = (button << 10); + this->position_current.button = -1; /* Force Highligh change */ + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *this, pci_t *pci, + int32_t button) { + /* A trivial function */ + if(dvdnav_button_select(this, pci, button) != DVDNAV_STATUS_ERR) + return dvdnav_button_activate(this, pci); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_mouse_select(dvdnav_t *this, pci_t *pci, int32_t x, int32_t y) { + int32_t button, cur_button; + int32_t best,dist,d; + int32_t mx,my,dx,dy; + + if(!this || !pci) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + if(!pci->hli.hl_gi.hli_ss) { + printerr("Not in a menu."); + return DVDNAV_STATUS_ERR; + } + if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { + printerr("This NAV has already been left."); + return DVDNAV_STATUS_ERR; + } + + cur_button = this->vm->state.HL_BTNN_REG >> 10; + + best = 0; + dist = 0x08000000; /* >> than (720*720)+(567*567); */ + + /* Loop through all buttons */ + for(button = 1; button <= pci->hli.hl_gi.btn_ns; button++) { + btni_t *button_ptr = &(pci->hli.btnit[button-1]); + + if((x >= button_ptr->x_start) && (x <= button_ptr->x_end) && + (y >= button_ptr->y_start) && (y <= button_ptr->y_end)) { + mx = (button_ptr->x_start + button_ptr->x_end)/2; + my = (button_ptr->y_start + button_ptr->y_end)/2; + dx = mx - x; + dy = my - y; + d = (dx*dx) + (dy*dy); + /* If the mouse is within the button and the mouse is closer + * to the center of this button then it is the best choice. */ + if(d < dist) { + dist = d; + best = button; + } + } + } + /* As an efficiency measure, only re-select the button + * if it is different to the previously selected one. */ + if (best != 0 && best != cur_button) + dvdnav_button_select(this, pci, best); + + /* return DVDNAV_STATUS_OK only if we actually found a matching button */ + return best ? DVDNAV_STATUS_OK : DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *this, pci_t *pci, int32_t x, int32_t y) { + /* A trivial function */ + if(dvdnav_mouse_select(this, pci, x,y) != DVDNAV_STATUS_ERR) + return dvdnav_button_activate(this, pci); + return DVDNAV_STATUS_ERR; +} diff --git a/libdvdnav/navigation.c b/libdvdnav/navigation.c new file mode 100644 index 0000000..07d18d7 --- /dev/null +++ b/libdvdnav/navigation.c @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2000 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: navigation.c,v 1.11 2004/06/20 16:59:13 mroi Exp $ + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "dvdnav_internal.h" + +/* Navigation API calls */ + +dvdnav_status_t dvdnav_still_skip(dvdnav_t *this) { + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + this->position_current.still = 0; + this->skip_still = 1; + this->sync_wait = 0; + this->sync_wait_skip = 1; + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_wait_skip(dvdnav_t *this) { + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + this->sync_wait = 0; + this->sync_wait_skip = 1; + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *this, int32_t *titles) { + if(!this || !titles) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + if (!this->vm->vmgi) { + printerr("Bad VM state."); + return DVDNAV_STATUS_ERR; + } + + (*titles) = vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts; + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *this, int32_t title, int32_t *parts) { + if(!this || !parts) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + if (!this->vm->vmgi) { + printerr("Bad VM state."); + return DVDNAV_STATUS_ERR; + } + if ((title < 1) || (title > vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts) ) { + printerr("Passed a title number out of range."); + return DVDNAV_STATUS_ERR; + } + + (*parts) = vm_get_vmgi(this->vm)->tt_srpt->title[title-1].nr_of_ptts; + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_current_title_info(dvdnav_t *this, int32_t *title, int32_t *part) { + int32_t retval; + + if(!this || !title || !part) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->vtsi || !this->vm->vmgi) { + printerr("Bad VM state."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if (!this->started) { + printerr("Virtual DVD machine not started."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if (!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if ( (this->vm->state.domain == VTSM_DOMAIN) + || (this->vm->state.domain == VMGM_DOMAIN) ) { + /* Get current Menu ID: into *part. */ + vm_get_current_menu(this->vm, part); + if (*part > -1) { + *title = 0; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + } + if (this->vm->state.domain == VTS_DOMAIN) { + retval = vm_get_current_title_part(this->vm, title, part); + pthread_mutex_unlock(&this->vm_lock); + return retval ? DVDNAV_STATUS_OK : DVDNAV_STATUS_ERR; + } + printerr("Not in a title or menu."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int32_t title) { + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + return dvdnav_part_play(this, title, 1); +} + +dvdnav_status_t dvdnav_part_play(dvdnav_t *this, int32_t title, int32_t part) { + int32_t retval; + + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->vmgi) { + printerr("Bad VM state."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if (!this->started) { + /* don't report an error but be nice */ + vm_start(this->vm); + this->started = 1; + } + if (!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if((title < 1) || (title > this->vm->vmgi->tt_srpt->nr_of_srpts)) { + printerr("Title out of range."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if((part < 1) || (part > this->vm->vmgi->tt_srpt->title[title-1].nr_of_ptts)) { + printerr("Part out of range."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + + retval = vm_jump_title_part(this->vm, title, part); + if (retval) + this->vm->hop_channel++; + pthread_mutex_unlock(&this->vm_lock); + + return retval ? DVDNAV_STATUS_OK : DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *this, int32_t title, + int32_t part, int32_t parts_to_play) { + /* FIXME: Implement auto-stop */ + if (dvdnav_part_play(this, title, part) == DVDNAV_STATUS_OK) + printerr("Not implemented yet."); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_time_play(dvdnav_t *this, int32_t title, + uint64_t time) { + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + /* FIXME: Implement */ + printerr("Not implemented yet."); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_stop(dvdnav_t *this) { + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + this->vm->stopped = 1; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_go_up(dvdnav_t *this) { + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + /* A nice easy function... delegate to the VM */ + pthread_mutex_lock(&this->vm_lock); + vm_jump_up(this->vm); + pthread_mutex_unlock(&this->vm_lock); + + return DVDNAV_STATUS_OK; +} diff --git a/libdvdnav/read_cache.c b/libdvdnav/read_cache.c new file mode 100644 index 0000000..1941c3c --- /dev/null +++ b/libdvdnav/read_cache.c @@ -0,0 +1,347 @@ +/* + * Copyright (C) 2000 Rich Wareham + * 2001-2004 the dvdnav project + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: read_cache.c,v 1.12 2004/03/16 11:43:38 mroi Exp $ + * + */ +/* + * There was a multithreaded read ahead cache in here for some time, but + * it had only been used for a short time. If you want to have a look at it, + * search the CVS attic. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "dvdnav.h" +#include "dvdnav_internal.h" +#include "read_cache.h" +#include +#include +#include "dvdread.h" +#define READ_CACHE_CHUNKS 10 + +/* all cache chunks must be memory aligned to allow use of raw devices */ +#define ALIGNMENT 2048 + +#define READ_AHEAD_SIZE_MIN 4 +#define READ_AHEAD_SIZE_MAX 512 + +typedef struct read_cache_chunk_s { + uint8_t *cache_buffer; + uint8_t *cache_buffer_base; /* used in malloc and free for alignment */ + int32_t cache_start_sector; /* -1 means cache invalid */ + int32_t cache_read_count; /* this many sectors are already read */ + size_t cache_block_count; /* this many sectors will go in this chunk */ + size_t cache_malloc_size; + int cache_valid; + int usage_count; /* counts how many buffers where issued from this chunk */ +} read_cache_chunk_t; + +struct read_cache_s { + read_cache_chunk_t chunk[READ_CACHE_CHUNKS]; + int current; + int freeing; /* is set to one when we are about to dispose the cache */ + uint32_t read_ahead_size; + int read_ahead_incr; + int last_sector; + pthread_mutex_t lock; + + /* Bit of strange cross-linking going on here :) -- Gotta love C :) */ + dvdnav_t *dvd_self; +}; + +/* +#define READ_CACHE_TRACE 0 +*/ + +#ifdef __GNUC__ +# if READ_CACHE_TRACE +# define dprintf(fmt, args...) fprintf(MSG_OUT, "libdvdnav: %s: "fmt, __func__ , ## args) +# else +# define dprintf(fmt, args...) /* Nowt */ +# endif +#else +# if READ_CACHE_TRACE +# define dprintf(fmt, ...) fprintf(MSG_OUT, "libdvdnav: %s: "fmt, __func__ , __VA_ARGS__) +# else +#ifdef _MSC_VER +# define dprintf(fmt, str) /* Nowt */ +#else +# define dprintf(fmt, ...) /* Nowt */ +#endif /* _MSC_VER */ +# endif +#endif + + +read_cache_t *dvdnav_read_cache_new(dvdnav_t* dvd_self) { + read_cache_t *self; + int i; + + self = (read_cache_t *)malloc(sizeof(read_cache_t)); + + if(self) { + self->current = 0; + self->freeing = 0; + self->dvd_self = dvd_self; + self->last_sector = 0; + self->read_ahead_size = READ_AHEAD_SIZE_MIN; + self->read_ahead_incr = 0; + pthread_mutex_init(&self->lock, NULL); + dvdnav_read_cache_clear(self); + for (i = 0; i < READ_CACHE_CHUNKS; i++) { + self->chunk[i].cache_buffer = NULL; + self->chunk[i].usage_count = 0; + } + } + + return self; +} + +void dvdnav_read_cache_free(read_cache_t* self) { + dvdnav_t *tmp; + int i; + + pthread_mutex_lock(&self->lock); + self->freeing = 1; + for (i = 0; i < READ_CACHE_CHUNKS; i++) + if (self->chunk[i].cache_buffer && self->chunk[i].usage_count == 0) { + free(self->chunk[i].cache_buffer_base); + self->chunk[i].cache_buffer = NULL; + } + pthread_mutex_unlock(&self->lock); + + for (i = 0; i < READ_CACHE_CHUNKS; i++) + if (self->chunk[i].cache_buffer) return; + + /* all buffers returned, free everything */ + tmp = self->dvd_self; + pthread_mutex_destroy(&self->lock); + free(self); + free(tmp); +} + +/* This function MUST be called whenever self->file changes. */ +void dvdnav_read_cache_clear(read_cache_t *self) { + int i; + + if(!self) + return; + + pthread_mutex_lock(&self->lock); + for (i = 0; i < READ_CACHE_CHUNKS; i++) + self->chunk[i].cache_valid = 0; + pthread_mutex_unlock(&self->lock); +} + +/* This function is called just after reading the NAV packet. */ +void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count) { + int i, use; + + if(!self) + return; + + if(!self->dvd_self->use_read_ahead) + return; + + pthread_mutex_lock(&self->lock); + + /* find a free cache chunk that best fits the required size */ + use = -1; + for (i = 0; i < READ_CACHE_CHUNKS; i++) + if (self->chunk[i].usage_count == 0 && self->chunk[i].cache_buffer && + self->chunk[i].cache_malloc_size >= block_count && + (use == -1 || self->chunk[use].cache_malloc_size > self->chunk[i].cache_malloc_size)) + use = i; + + if (use == -1) { + /* we haven't found a cache chunk, so we try to reallocate an existing one */ + for (i = 0; i < READ_CACHE_CHUNKS; i++) + if (self->chunk[i].usage_count == 0 && self->chunk[i].cache_buffer && + (use == -1 || self->chunk[use].cache_malloc_size < self->chunk[i].cache_malloc_size)) + use = i; + if (use >= 0) { + self->chunk[use].cache_buffer_base = realloc(self->chunk[use].cache_buffer_base, + block_count * DVD_VIDEO_LB_LEN + ALIGNMENT); + self->chunk[use].cache_buffer = + (uint8_t *)(((uintptr_t)self->chunk[use].cache_buffer_base & ~((uintptr_t)(ALIGNMENT - 1))) + ALIGNMENT); + dprintf("pre_cache DVD read realloc happened\n"); + self->chunk[use].cache_malloc_size = block_count; + } else { + /* we still haven't found a cache chunk, let's allocate a new one */ + for (i = 0; i < READ_CACHE_CHUNKS; i++) + if (!self->chunk[i].cache_buffer) { + use = i; + break; + } + if (use >= 0) { + /* We start with a sensible figure for the first malloc of 500 blocks. + * Some DVDs I have seen venture to 450 blocks. + * This is so that fewer realloc's happen if at all. + */ + self->chunk[i].cache_buffer_base = + malloc((block_count > 500 ? block_count : 500) * DVD_VIDEO_LB_LEN + ALIGNMENT); + self->chunk[i].cache_buffer = + (uint8_t *)(((uintptr_t)self->chunk[i].cache_buffer_base & ~((uintptr_t)(ALIGNMENT - 1))) + ALIGNMENT); + self->chunk[i].cache_malloc_size = block_count > 500 ? block_count : 500; + dprintf("pre_cache DVD read malloc %d blocks\n", + (block_count > 500 ? block_count : 500 )); + } + } + } + + if (use >= 0) { + self->chunk[use].cache_start_sector = sector; + self->chunk[use].cache_block_count = block_count; + self->chunk[use].cache_read_count = 0; + self->chunk[use].cache_valid = 1; + self->current = use; + } else { + dprintf("pre_caching was impossible, no cache chunk available\n"); + } + pthread_mutex_unlock(&self->lock); +} + +int dvdnav_read_cache_block(read_cache_t *self, int sector, size_t block_count, uint8_t **buf) { + int i, use; + int start; + int size; + int incr; + uint8_t *read_ahead_buf; + int32_t res; + + if(!self) + return 0; + + use = -1; + + if(self->dvd_self->use_read_ahead) { + /* first check, if sector is in current chunk */ + read_cache_chunk_t cur = self->chunk[self->current]; + if (cur.cache_valid && sector >= cur.cache_start_sector && + sector <= (cur.cache_start_sector + cur.cache_read_count) && + sector + block_count <= cur.cache_start_sector + cur.cache_block_count) + use = self->current; + else + for (i = 0; i < READ_CACHE_CHUNKS; i++) + if (self->chunk[i].cache_valid && + sector >= self->chunk[i].cache_start_sector && + sector <= (self->chunk[i].cache_start_sector + self->chunk[i].cache_read_count) && + sector + block_count <= self->chunk[i].cache_start_sector + self->chunk[i].cache_block_count) + use = i; + } + + if (use >= 0) { + read_cache_chunk_t *chunk; + + /* Increment read-ahead size if sector follows the last sector */ + if (sector == (self->last_sector + 1)) { + if (self->read_ahead_incr < READ_AHEAD_SIZE_MAX) + self->read_ahead_incr++; + } else { + self->read_ahead_size = READ_AHEAD_SIZE_MIN; + self->read_ahead_incr = 0; + } + self->last_sector = sector; + + /* The following resources need to be protected by a mutex : + * self->chunk[*].cache_buffer + * self->chunk[*].cache_malloc_size + * self->chunk[*].usage_count + */ + pthread_mutex_lock(&self->lock); + chunk = &self->chunk[use]; + read_ahead_buf = chunk->cache_buffer + chunk->cache_read_count * DVD_VIDEO_LB_LEN; + *buf = chunk->cache_buffer + (sector - chunk->cache_start_sector) * DVD_VIDEO_LB_LEN; + chunk->usage_count++; + pthread_mutex_unlock(&self->lock); + + dprintf("libdvdnav: sector=%d, start_sector=%d, last_sector=%d\n", sector, chunk->cache_start_sector, chunk->cache_start_sector + chunk->cache_block_count); + + /* read_ahead_size */ + incr = self->read_ahead_incr >> 1; + if ((self->read_ahead_size + incr) > READ_AHEAD_SIZE_MAX) { + self->read_ahead_size = READ_AHEAD_SIZE_MAX; + } else { + self->read_ahead_size += incr; + } + + /* real read size */ + start = chunk->cache_start_sector + chunk->cache_read_count; + if (chunk->cache_read_count + self->read_ahead_size > chunk->cache_block_count) { + size = chunk->cache_block_count - chunk->cache_read_count; + } else { + size = self->read_ahead_size; + /* ensure that the sector we want will be read */ + if (sector >= chunk->cache_start_sector + chunk->cache_read_count + size) + size = sector - chunk->cache_start_sector - chunk->cache_read_count; + } + dprintf("libdvdnav: read_ahead_size=%d, size=%d\n", self->read_ahead_size, size); + + if (size) + chunk->cache_read_count += DVDReadBlocks(self->dvd_self->file, + start, + size, + read_ahead_buf); + + res = DVD_VIDEO_LB_LEN * block_count; + + } else { + + if (self->dvd_self->use_read_ahead) + dprintf("cache miss on sector %d\n", sector); + + res = DVDReadBlocks(self->dvd_self->file, + sector, + block_count, + *buf) * DVD_VIDEO_LB_LEN; + } + + return res; + +} + +dvdnav_status_t dvdnav_free_cache_block(dvdnav_t *self, unsigned char *buf) { + read_cache_t *cache; + int i; + + if (!self) + return DVDNAV_STATUS_ERR; + + cache = self->cache; + if (!cache) + return DVDNAV_STATUS_ERR; + + pthread_mutex_lock(&cache->lock); + for (i = 0; i < READ_CACHE_CHUNKS; i++) { + if (cache->chunk[i].cache_buffer && buf >= cache->chunk[i].cache_buffer && + buf < cache->chunk[i].cache_buffer + cache->chunk[i].cache_malloc_size * DVD_VIDEO_LB_LEN) { + cache->chunk[i].usage_count--; + } + } + pthread_mutex_unlock(&cache->lock); + + if (cache->freeing) + /* when we want to dispose the cache, try freeing it now */ + dvdnav_read_cache_free(cache); + + return DVDNAV_STATUS_OK; +} diff --git a/libdvdnav/read_cache.h b/libdvdnav/read_cache.h new file mode 100644 index 0000000..857d676 --- /dev/null +++ b/libdvdnav/read_cache.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2000 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: read_cache.h,v 1.1 2002/08/08 17:49:21 richwareham Exp $ + * + */ + +#ifndef __DVDNAV_READ_CACHE_H +#define __DVDNAV_READ_CACHE_H + +#include "dvdnav_internal.h" + +/* Opaque cache type -- defined in dvdnav_internal.h */ +/* typedef struct read_cache_s read_cache_t; */ + +/* EXPERIMENTAL: Setting the following to 1 will use an experimental multi-threaded + * read-ahead cache. + */ +#define _MULTITHREAD_ 0 + +/* Constructor/destructors */ +read_cache_t *dvdnav_read_cache_new(dvdnav_t* dvd_self); +void dvdnav_read_cache_free(read_cache_t* self); + +/* This function MUST be called whenever self->file changes. */ +void dvdnav_read_cache_clear(read_cache_t *self); +/* This function is called just after reading the NAV packet. */ +void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count); +/* This function will do the cache read. + * The buffer handed in must be malloced to take one dvd block. + * On a cache hit, a different buffer will be returned though. + * Those buffers must _never_ be freed. */ +int dvdnav_read_cache_block(read_cache_t *self, int sector, size_t block_count, uint8_t **buf); + +#endif /* __DVDNAV_READ_CACHE_H */ diff --git a/libdvdnav/remap.c b/libdvdnav/remap.c new file mode 100644 index 0000000..1788b15 --- /dev/null +++ b/libdvdnav/remap.c @@ -0,0 +1,257 @@ +/* + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: remap.c,v 1.4 2003/08/25 21:51:40 f1rmb Exp $ + */ + +#include +#include +#include + +#ifndef _MSC_VER +#include +#include +#else +#ifndef MAXPATHLEN +#define MAXPATHLEN 255 +#endif +#endif /* _MSC_VER */ + +#include +#include "remap.h" +#include "dvdnav_internal.h" + +struct block_s { + int domain; + int title; + int program; + unsigned long start_block; + unsigned long end_block; +}; + +struct remap_s { + char *title; + int maxblocks; + int nblocks; + int debug; + struct block_s *blocks; +}; + +static remap_t* remap_new( char *title) { + remap_t *map = malloc( sizeof(remap_t)); + map->title = strdup(title); + map->maxblocks = 0; + map->nblocks = 0; + map->blocks = NULL; + map->debug = 0; + return map; +} + +static int compare_block( block_t *a, block_t *b) { + /* returns -1 if a precedes b, 1 if a follows b, and 0 if a and b overlap */ + if (a->domain < b->domain) { + return -1; + } else if (a->domain > b->domain) { + return 1; + } + + if (a->title < b->title) { + return -1; + } else if (a->title > b->title) { + return 1; + } + + if (a->program < b->program) { + return -1; + } else if (a->program > b->program) { + return 1; + } + + if (a->end_block < b->start_block) { + return -1; + } else if (a->start_block > b->end_block) { + /* + * if a->start_block == b->end_block then the two regions + * aren't strictly overlapping, but they should be merged + * anyway since there are zero blocks between them + */ + return 1; + } + + return 0; +} + +static block_t *findblock( remap_t *map, block_t *key) { + int lb = 0; + int ub = map->nblocks - 1; + int mid; + int res; + + while (lb <= ub) { + mid = lb + (ub - lb)/2; + res = compare_block( key, &map->blocks[mid]); + if (res < 0) { + ub = mid-1; + } else if (res > 0) { + lb = mid+1; + } else { + return &map->blocks[mid]; + } + } + return NULL; +} + +static void mergeblock( block_t *b, block_t tmp) { + if (tmp.start_block < b->start_block) b->start_block = tmp.start_block; + if (tmp.end_block > b->end_block) b->end_block = tmp.end_block; +} + +static void remap_add_node( remap_t *map, block_t block) { + block_t *b; + int n; + b = findblock( map, &block); + if (b) { + /* overlaps an existing block */ + mergeblock( b, block); + } else { + /* new block */ + if (map->nblocks >= map->maxblocks) { + map->maxblocks += 20; + map->blocks = realloc( map->blocks, sizeof( block_t)*map->maxblocks); + } + n = map->nblocks++; + while (n > 0 && compare_block( &block, &map->blocks[ n-1]) < 0) { + map->blocks[ n] = map->blocks[ n-1]; + n--; + } + map->blocks[ n] = block; + } +} + +static int parseblock(char *buf, int *dom, int *tt, int *pg, + unsigned long *start, unsigned long *end) { + long tmp; + char *tok; + char *epos; + char *marker[]={"domain", "title", "program", "start", "end"}; + int st = 0; + tok = strtok( buf, " "); + while (st < 5) { + if (strcmp(tok, marker[st])) return -st-1000; + tok = strtok( NULL, " "); + if (!tok) return -st-2000; + tmp = strtol( tok, &epos, 0); + if (*epos != 0 && *epos != ',') return -st-3000; + switch (st) { + case 0: + *dom = (int)tmp; + break; + case 1: + *tt = (int)tmp; + break; + case 2: + *pg = (int)tmp; + break; + case 3: + *start = tmp; + break; + case 4: + *end = tmp; + break; + } + st++; + tok = strtok( NULL, " "); + } + return st; +} + +remap_t* remap_loadmap( char *title) { + char buf[160]; + char *fname; + char *home; + int res; + int fname_len=0; + FILE *fp; + block_t tmp; + remap_t *map; + + /* Build the map filename */ + home = getenv("HOME"); assert(home); + /*strncpy(fname, home, sizeof(fname)); + strncat(fname, "/.dvdnav/", sizeof(fname)); + strncat(fname, title, sizeof(fname)); + strncat(fname, ".map", sizeof(fname)); + */ + fname_len = strlen(home)+strlen("/.dvdnav/")+strlen(title)+strlen(".map")+1; + fname = calloc(fname_len, sizeof(char)); + snprintf(fname, fname_len, "%s%s%s%s", home, "/.dvdnav/", title, ".map"); + + /* Open the map file */ + fp = fopen( fname, "r"); + if (!fp) { + fprintf(MSG_OUT, "libdvdnav: Unable to find map file '%s'\n", fname); + return NULL; + } + + /* Load the map file */ + map = remap_new( title); + while (fgets( buf, sizeof(buf), fp) != NULL) { + if (buf[0] == '\n' || buf[0] == '#' || buf[0] == 0) continue; + if (strncasecmp( buf, "debug", 5) == 0) { + map->debug = 1; + } else { + res = parseblock( buf, + &tmp.domain, &tmp.title, &tmp.program, &tmp.start_block, &tmp.end_block); + if (res != 5) { + fprintf(MSG_OUT, "libdvdnav: Ignoring map line (%d): %s\n", res, buf); + continue; + } + remap_add_node( map, tmp); + } + } + + free(fname); + if (map->nblocks == 0 && map->debug == 0) return NULL; + return map; +} + +unsigned long remap_block( + remap_t *map, int domain, int title, int program, + unsigned long cblock, unsigned long offset) +{ + block_t key; + block_t *b; + + if (map->debug) { + fprintf(MSG_OUT, "libdvdnav: %s: domain %d, title %d, program %d, start %lx, next %lx\n", + map->title, domain, title, program, cblock, cblock+offset); + } + + key.domain = domain; + key.title = title; + key.program = program; + key.start_block = key.end_block = cblock + offset; + b = findblock( map, &key); + + if (b) { + if (map->debug) { + fprintf(MSG_OUT, "libdvdnav: Redirected to %lx\n", b->end_block); + } + return b->end_block - cblock; + } + return offset; +} diff --git a/libdvdnav/remap.h b/libdvdnav/remap.h new file mode 100644 index 0000000..88e06d2 --- /dev/null +++ b/libdvdnav/remap.h @@ -0,0 +1,33 @@ +/* + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: remap.h,v 1.2 2003/02/20 16:02:00 mroi Exp $ + */ + +#ifndef __REMAP__H +#define __REMAP__H +typedef struct block_s block_t; + +typedef struct remap_s remap_t; + +remap_t* remap_loadmap( char *title); + +unsigned long remap_block( + remap_t *map, int domain, int title, int program, + unsigned long cblock, unsigned long offset); + +#endif diff --git a/libdvdnav/searching.c b/libdvdnav/searching.c new file mode 100644 index 0000000..a069f51 --- /dev/null +++ b/libdvdnav/searching.c @@ -0,0 +1,567 @@ +/* + * Copyright (C) 2000 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: searching.c,v 1.19 2005/10/14 21:02:16 miguelfreitas Exp $ + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include "dvdnav_internal.h" +#include "dvdnav.h" + +/* +#define LOG_DEBUG +*/ + +/* Searching API calls */ + +/* Scan the ADMAP for a particular block number. */ +/* Return placed in vobu. */ +/* Returns error status */ +/* FIXME: Maybe need to handle seeking outside current cell. */ +static dvdnav_status_t dvdnav_scan_admap(dvdnav_t *this, int32_t domain, uint32_t seekto_block, uint32_t *vobu) { + vobu_admap_t *admap = NULL; + +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: Seeking to target %u ...\n", seekto_block); +#endif + *vobu = -1; + + /* Search through the VOBU_ADMAP for the nearest VOBU + * to the target block */ + switch(domain) { + case FP_DOMAIN: + case VMGM_DOMAIN: + admap = this->vm->vmgi->menu_vobu_admap; + break; + case VTSM_DOMAIN: + admap = this->vm->vtsi->menu_vobu_admap; + break; + case VTS_DOMAIN: + admap = this->vm->vtsi->vts_vobu_admap; + break; + default: + fprintf(MSG_OUT, "libdvdnav: Error: Unknown domain for seeking.\n"); + } + if(admap) { + uint32_t address = 0; + uint32_t vobu_start, next_vobu; + int32_t found = 0; + + /* Search through ADMAP for best sector */ + vobu_start = SRI_END_OF_CELL; + /* FIXME: Implement a faster search algorithm */ + while((!found) && ((address<<2) < admap->last_byte)) { + next_vobu = admap->vobu_start_sectors[address]; + + /* fprintf(MSG_OUT, "libdvdnav: Found block %u\n", next_vobu); */ + + if(vobu_start <= seekto_block && + next_vobu > seekto_block) { + found = 1; + } else { + vobu_start = next_vobu; + } + address ++; + } + if(found) { + *vobu = vobu_start; + return DVDNAV_STATUS_OK; + } else { + fprintf(MSG_OUT, "libdvdnav: Could not locate block\n"); + return DVDNAV_STATUS_ERR; + } + } + fprintf(MSG_OUT, "libdvdnav: admap not located\n"); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_time_search(dvdnav_t *this, + uint64_t time) { + + uint64_t target = time; + uint64_t length = 0; + uint32_t first_cell_nr, last_cell_nr, cell_nr; + int32_t found; + cell_playback_t *cell; + dvd_state_t *state; + dvdnav_status_t result; + + if(this->position_current.still != 0) { + printerr("Cannot seek in a still frame."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + state = &(this->vm->state); + if(!state->pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + + + if (this->pgc_based) { + first_cell_nr = 1; + last_cell_nr = state->pgc->nr_of_cells; + } else { + /* Find start cell of program. */ + first_cell_nr = state->pgc->program_map[state->pgN-1]; + /* Find end cell of program */ + if(state->pgN < state->pgc->nr_of_programs) + last_cell_nr = state->pgc->program_map[state->pgN] - 1; + else + last_cell_nr = state->pgc->nr_of_cells; + } + + found = 0; + for(cell_nr = first_cell_nr; (cell_nr <= last_cell_nr) && !found; cell_nr ++) { + cell = &(state->pgc->cell_playback[cell_nr-1]); + length = dvdnav_convert_time(&cell->playback_time); + if (target >= length) { + target -= length; + } else { + /* FIXME: there must be a better way than interpolation */ + target = target * (cell->last_sector - cell->first_sector + 1) / length; + target += cell->first_sector; + + found = 1; + break; + } + } + + if(found) { + int32_t vobu; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: Seeking to cell %i from choice of %i to %i\n", + cell_nr, first_cell_nr, last_cell_nr); +#endif + if (dvdnav_scan_admap(this, state->domain, target, &vobu) == DVDNAV_STATUS_OK) { + int32_t start = state->pgc->cell_playback[cell_nr-1].first_sector; + + if (vm_jump_cell_block(this->vm, cell_nr, vobu - start)) { +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: After cellN=%u blockN=%u target=%x vobu=%x start=%x\n" , + state->cellN, state->blockN, target, vobu, start); +#endif + this->vm->hop_channel += HOP_SEEK; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + } + } + + fprintf(MSG_OUT, "libdvdnav: Error when seeking\n"); + printerr("Error when seeking."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_sector_search(dvdnav_t *this, + uint64_t offset, int32_t origin) { + uint32_t target = 0; + uint32_t length = 0; + uint32_t first_cell_nr, last_cell_nr, cell_nr; + int32_t found; + cell_playback_t *cell; + dvd_state_t *state; + dvdnav_status_t result; + + if(this->position_current.still != 0) { + printerr("Cannot seek in a still frame."); + return DVDNAV_STATUS_ERR; + } + + result = dvdnav_get_position(this, &target, &length); + if(!result) { + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + state = &(this->vm->state); + if(!state->pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: seeking to offset=%lu pos=%u length=%u\n", offset, target, length); + fprintf(MSG_OUT, "libdvdnav: Before cellN=%u blockN=%u\n", state->cellN, state->blockN); +#endif + + switch(origin) { + case SEEK_SET: + if(offset > length) { + printerr("Request to seek behind end."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + target = offset; + break; + case SEEK_CUR: + if(target + offset > length) { + printerr("Request to seek behind end."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + target += offset; + break; + case SEEK_END: + if(length - offset < 0) { + printerr("Request to seek before start."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + target = length - offset; + break; + default: + /* Error occured */ + printerr("Illegal seek mode."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + + if (this->pgc_based) { + first_cell_nr = 1; + last_cell_nr = state->pgc->nr_of_cells; + } else { + /* Find start cell of program. */ + first_cell_nr = state->pgc->program_map[state->pgN-1]; + /* Find end cell of program */ + if(state->pgN < state->pgc->nr_of_programs) + last_cell_nr = state->pgc->program_map[state->pgN] - 1; + else + last_cell_nr = state->pgc->nr_of_cells; + } + + found = 0; + for(cell_nr = first_cell_nr; (cell_nr <= last_cell_nr) && !found; cell_nr ++) { + cell = &(state->pgc->cell_playback[cell_nr-1]); + length = cell->last_sector - cell->first_sector + 1; + if (target >= length) { + target -= length; + } else { + /* convert the target sector from Cell-relative to absolute physical sector */ + target += cell->first_sector; + found = 1; + break; + } + } + + if(found) { + int32_t vobu; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: Seeking to cell %i from choice of %i to %i\n", + cell_nr, first_cell_nr, last_cell_nr); +#endif + if (dvdnav_scan_admap(this, state->domain, target, &vobu) == DVDNAV_STATUS_OK) { + int32_t start = state->pgc->cell_playback[cell_nr-1].first_sector; + + if (vm_jump_cell_block(this->vm, cell_nr, vobu - start)) { +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: After cellN=%u blockN=%u target=%x vobu=%x start=%x\n" , + state->cellN, state->blockN, target, vobu, start); +#endif + this->vm->hop_channel += HOP_SEEK; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + } + } + + fprintf(MSG_OUT, "libdvdnav: Error when seeking\n"); + fprintf(MSG_OUT, "libdvdnav: FIXME: Implement seeking to location %u\n", target); + printerr("Error when seeking."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_part_search(dvdnav_t *this, int32_t part) { + int32_t title, old_part; + + if (dvdnav_current_title_info(this, &title, &old_part) == DVDNAV_STATUS_OK) + return dvdnav_part_play(this, title, part); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_prev_pg_search(dvdnav_t *this) { + + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if(!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: previous chapter\n"); +#endif + if (!vm_jump_prev_pg(this->vm)) { + fprintf(MSG_OUT, "libdvdnav: previous chapter failed.\n"); + printerr("Skip to previous chapter failed."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + this->position_current.still = 0; + this->vm->hop_channel++; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: previous chapter done\n"); +#endif + pthread_mutex_unlock(&this->vm_lock); + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_top_pg_search(dvdnav_t *this) { + + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if(!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: top chapter\n"); +#endif + if (!vm_jump_top_pg(this->vm)) { + fprintf(MSG_OUT, "libdvdnav: top chapter failed.\n"); + printerr("Skip to top chapter failed."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + this->position_current.still = 0; + this->vm->hop_channel++; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: top chapter done\n"); +#endif + pthread_mutex_unlock(&this->vm_lock); + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_next_pg_search(dvdnav_t *this) { + vm_t *try_vm; + + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if(!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: next chapter\n"); +#endif + /* make a copy of current VM and try to navigate the copy to the next PG */ + try_vm = vm_new_copy(this->vm); + if (!vm_jump_next_pg(try_vm) || try_vm->stopped) { + vm_free_copy(try_vm); + /* next_pg failed, try to jump at least to the next cell */ + try_vm = vm_new_copy(this->vm); + vm_get_next_cell(try_vm); + if (try_vm->stopped) { + vm_free_copy(try_vm); + fprintf(MSG_OUT, "libdvdnav: next chapter failed.\n"); + printerr("Skip to next chapter failed."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + } + /* merge changes on success */ + vm_merge(this->vm, try_vm); + vm_free_copy(try_vm); + this->position_current.still = 0; + this->vm->hop_channel++; +#ifdef LOG_DEBUG + fprintf(MSG_OUT, "libdvdnav: next chapter done\n"); +#endif + pthread_mutex_unlock(&this->vm_lock); + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_menu_call(dvdnav_t *this, DVDMenuID_t menu) { + vm_t *try_vm; + + if(!this) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if(!this->vm->state.pgc) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + + /* make a copy of current VM and try to navigate the copy to the menu */ + try_vm = vm_new_copy(this->vm); + if ( (menu == DVD_MENU_Escape) && (this->vm->state.domain != VTS_DOMAIN)) { + /* Try resume */ + if (vm_jump_resume(try_vm) && !try_vm->stopped) { + /* merge changes on success */ + vm_merge(this->vm, try_vm); + vm_free_copy(try_vm); + this->position_current.still = 0; + this->vm->hop_channel++; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } + } + if (menu == DVD_MENU_Escape) menu = DVD_MENU_Root; + + if (vm_jump_menu(try_vm, menu) && !try_vm->stopped) { + /* merge changes on success */ + vm_merge(this->vm, try_vm); + vm_free_copy(try_vm); + this->position_current.still = 0; + this->vm->hop_channel++; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; + } else { + vm_free_copy(try_vm); + printerr("No such menu or menu not reachable."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } +} + +dvdnav_status_t dvdnav_get_position(dvdnav_t *this, uint32_t *pos, + uint32_t *len) { + uint32_t cur_sector; + int32_t cell_nr, first_cell_nr, last_cell_nr; + cell_playback_t *cell; + dvd_state_t *state; + + if(!this || !pos || !len) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + if(!this->started) { + printerr("Virtual DVD machine not started."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + state = &(this->vm->state); + if(!state->pgc || this->vm->stopped) { + printerr("No current PGC."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if (this->position_current.hop_channel != this->vm->hop_channel || + this->position_current.domain != state->domain || + this->position_current.vts != state->vtsN || + this->position_current.cell_restart != state->cell_restart) { + printerr("New position not yet determined."); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + + /* Get current sector */ + cur_sector = this->vobu.vobu_start + this->vobu.blockN; + + if (this->pgc_based) { + first_cell_nr = 1; + last_cell_nr = state->pgc->nr_of_cells; + } else { + /* Find start cell of program. */ + first_cell_nr = state->pgc->program_map[state->pgN-1]; + /* Find end cell of program */ + if(state->pgN < state->pgc->nr_of_programs) + last_cell_nr = state->pgc->program_map[state->pgN] - 1; + else + last_cell_nr = state->pgc->nr_of_cells; + } + + *pos = -1; + *len = 0; + for (cell_nr = first_cell_nr; cell_nr <= last_cell_nr; cell_nr++) { + cell = &(state->pgc->cell_playback[cell_nr-1]); + if (cell_nr == state->cellN) { + /* the current sector is in this cell, + * pos is length of PG up to here + sector's offset in this cell */ + *pos = *len + cur_sector - cell->first_sector; + } + *len += cell->last_sector - cell->first_sector + 1; + } + + assert((signed)*pos != -1); + + pthread_mutex_unlock(&this->vm_lock); + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_get_position_in_title(dvdnav_t *this, + uint32_t *pos, + uint32_t *len) { + uint32_t cur_sector; + uint32_t first_cell_nr; + uint32_t last_cell_nr; + cell_playback_t *first_cell; + cell_playback_t *last_cell; + dvd_state_t *state; + + if(!this || !pos || !len) { + printerr("Passed a NULL pointer."); + return DVDNAV_STATUS_ERR; + } + + state = &(this->vm->state); + if(!state->pgc) { + printerr("No current PGC."); + return DVDNAV_STATUS_ERR; + } + + /* Get current sector */ + cur_sector = this->vobu.vobu_start + this->vobu.blockN; + + /* Now find first and last cells in title. */ + first_cell_nr = state->pgc->program_map[0]; + first_cell = &(state->pgc->cell_playback[first_cell_nr-1]); + last_cell_nr = state->pgc->nr_of_cells; + last_cell = &(state->pgc->cell_playback[last_cell_nr-1]); + + *pos = cur_sector - first_cell->first_sector; + *len = last_cell->last_sector - first_cell->first_sector; + + return DVDNAV_STATUS_OK; +} diff --git a/libdvdnav/settings.c b/libdvdnav/settings.c new file mode 100644 index 0000000..4af8aea --- /dev/null +++ b/libdvdnav/settings.c @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2000 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: settings.c,v 1.7 2004/03/16 11:43:38 mroi Exp $ + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "dvdnav_internal.h" + +/* Characteristics/setting API calls */ + +dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *this, int32_t *region) { + if(!this || !region) { + printerr("Passed a NULL this pointer."); + return DVDNAV_STATUS_ERR; + } + + (*region) = this->vm->state.registers.SPRM[20]; + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *this, int32_t mask) { + if(!this) { + printerr("Passed a NULL this pointer."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + this->vm->state.registers.SPRM[20] = (mask & 0xff); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *this, int32_t use_readahead) { + if(!this) { + printerr("Passed a NULL this pointer."); + return DVDNAV_STATUS_ERR; + } + + this->use_read_ahead = use_readahead; + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *this, int32_t *flag) { + if(!this || !flag) { + printerr("Passed a NULL this pointer."); + return DVDNAV_STATUS_ERR; + } + + (*flag) = this->use_read_ahead; + return DVDNAV_STATUS_OK; +} + +static dvdnav_status_t set_language_register(dvdnav_t *this, char *code, int reg) { + if(!this || !code) { + printerr("Passed a NULL this pointer."); + return DVDNAV_STATUS_ERR; + } + + if(!code[0] || !code[1]) { + printerr("Passed illegal language code."); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + this->vm->state.registers.SPRM[reg] = (code[0] << 8) | code[1]; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_menu_language_select(dvdnav_t *this, char *code) { + return set_language_register(this, code, 0); +} + +dvdnav_status_t dvdnav_audio_language_select(dvdnav_t *this, char *code) { + return set_language_register(this, code, 16); +} + +dvdnav_status_t dvdnav_spu_language_select(dvdnav_t *this, char *code) { + return set_language_register(this, code, 18); +} + +dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *this, int32_t pgc) { + if(!this) { + printerr("Passed a NULL this pointer."); + return DVDNAV_STATUS_ERR; + } + + this->pgc_based = pgc; + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *this, int32_t *flag) { + if(!this || !flag) { + printerr("Passed a NULL this pointer."); + return DVDNAV_STATUS_ERR; + } + + (*flag) = this->pgc_based; + return DVDNAV_STATUS_OK; +} diff --git a/libdvdnav/vm.c b/libdvdnav/vm.c new file mode 100644 index 0000000..dbebafa --- /dev/null +++ b/libdvdnav/vm.c @@ -0,0 +1,1861 @@ +/* + * Copyright (C) 2000, 2001 H�an Hjort + * Copyright (C) 2001 Rich Wareham + * 2002-2004 the dvdnav project + * + * This file is part of libdvdnav, a DVD navigation library. It is modified + * from a file originally part of the Ogle DVD player. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: vm.c,v 1.32 2004/12/20 19:27:20 mroi Exp $ + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "dvdread.h" + +#include "dvdnav_internal.h" + +#ifdef _MSC_VER +#include /* read() */ +#endif /* _MSC_VER */ + +/* +#define STRICT +*/ + +/* Local prototypes */ + +/* get_XYZ returns a value. + * set_XYZ sets state using passed parameters. + * returns success/failure. + */ + +/* Play */ +static link_t play_PGC(vm_t *vm); +static link_t play_PGC_PG(vm_t *vm, int pgN); +static link_t play_PGC_post(vm_t *vm); +static link_t play_PG(vm_t *vm); +static link_t play_Cell(vm_t *vm); +static link_t play_Cell_post(vm_t *vm); + +/* Process link - returns 1 if a hop has been performed */ +static int process_command(vm_t *vm,link_t link_values); + +/* Set */ +static int set_TT(vm_t *vm, int tt); +static int set_PTT(vm_t *vm, int tt, int ptt); +static int set_VTS_TT(vm_t *vm, int vtsN, int vts_ttn); +static int set_VTS_PTT(vm_t *vm, int vtsN, int vts_ttn, int part); +static int set_FP_PGC(vm_t *vm); +static int set_MENU(vm_t *vm, int menu); +static int set_PGCN(vm_t *vm, int pgcN); +static int set_PGN(vm_t *vm); /* Set PGN based on (vm->state).CellN */ +static void set_RSMinfo(vm_t *vm, int cellN, int blockN); + +/* Get */ +static int get_TT(vm_t *vm, int vtsN, int vts_ttn); +static int get_ID(vm_t *vm, int id); +static int get_PGCN(vm_t *vm); + +static pgcit_t* get_MENU_PGCIT(vm_t *vm, ifo_handle_t *h, uint16_t lang); +static pgcit_t* get_PGCIT(vm_t *vm); + + +/* Helper functions */ + +#ifdef TRACE +static void vm_print_current_domain_state(vm_t *vm) { + switch((vm->state).domain) { + case VTS_DOMAIN: + fprintf(MSG_OUT, "libdvdnav: Video Title Domain: -\n"); + break; + + case VTSM_DOMAIN: + fprintf(MSG_OUT, "libdvdnav: Video Title Menu Domain: -\n"); + break; + + case VMGM_DOMAIN: + fprintf(MSG_OUT, "libdvdnav: Video Manager Menu Domain: -\n"); + break; + + case FP_DOMAIN: + fprintf(MSG_OUT, "libdvdnav: First Play Domain: -\n"); + break; + + default: + fprintf(MSG_OUT, "libdvdnav: Unknown Domain: -\n"); + break; + } + fprintf(MSG_OUT, "libdvdnav: VTS:%d PGC:%d PG:%u CELL:%u BLOCK:%u VTS_TTN:%u TTN:%u TT_PGCN:%u\n", + (vm->state).vtsN, + get_PGCN(vm), + (vm->state).pgN, + (vm->state).cellN, + (vm->state).blockN, + (vm->state).VTS_TTN_REG, + (vm->state).TTN_REG, + (vm->state).TT_PGCN_REG); +} +#endif + +static void dvd_read_name(char *name, const char *device) { + /* Because we are compiling with _FILE_OFFSET_BITS=64 + * all off_t are 64bit. + */ + off_t off; + int fd, i; + uint8_t data[DVD_VIDEO_LB_LEN]; + + /* Read DVD name */ + fd = open(device, O_RDONLY); + if (fd > 0) { + off = lseek( fd, 32 * (off_t) DVD_VIDEO_LB_LEN, SEEK_SET ); + if( off == ( 32 * (off_t) DVD_VIDEO_LB_LEN ) ) { + off = read( fd, data, DVD_VIDEO_LB_LEN ); + close(fd); + if (off == ( (off_t) DVD_VIDEO_LB_LEN )) { + fprintf(MSG_OUT, "libdvdnav: DVD Title: "); + for(i=25; i < 73; i++ ) { + if((data[i] == 0)) break; + if((data[i] > 32) && (data[i] < 127)) { + fprintf(MSG_OUT, "%c", data[i]); + } else { + fprintf(MSG_OUT, " "); + } + } + strncpy(name, &data[25], 48); + name[48] = 0; + fprintf(MSG_OUT, "\nlibdvdnav: DVD Serial Number: "); + for(i=73; i < 89; i++ ) { + if((data[i] == 0)) break; + if((data[i] > 32) && (data[i] < 127)) { + fprintf(MSG_OUT, "%c", data[i]); + } else { + fprintf(MSG_OUT, " "); + } + } + fprintf(MSG_OUT, "\nlibdvdnav: DVD Title (Alternative): "); + for(i=89; i < 128; i++ ) { + if((data[i] == 0)) break; + if((data[i] > 32) && (data[i] < 127)) { + fprintf(MSG_OUT, "%c", data[i]); + } else { + fprintf(MSG_OUT, " "); + } + } + fprintf(MSG_OUT, "\n"); + } else { + fprintf(MSG_OUT, "libdvdnav: Can't read name block. Probably not a DVD-ROM device.\n"); + } + } else { + fprintf(MSG_OUT, "libdvdnav: Can't seek to block %u\n", 32 ); + } + close(fd); + } else { + fprintf(MSG_OUT, "NAME OPEN FAILED\n"); + } +} + +static int ifoOpenNewVTSI(vm_t *vm, dvd_reader_t *dvd, int vtsN) { + if((vm->state).vtsN == vtsN) { + return 1; /* We alread have it */ + } + + if(vm->vtsi != NULL) + ifoClose(vm->vtsi); + + vm->vtsi = ifoOpenVTSI(dvd, vtsN); + if(vm->vtsi == NULL) { + fprintf(MSG_OUT, "libdvdnav: ifoOpenVTSI failed\n"); + return 0; + } + if(!ifoRead_VTS_PTT_SRPT(vm->vtsi)) { + fprintf(MSG_OUT, "libdvdnav: ifoRead_VTS_PTT_SRPT failed\n"); + return 0; + } + if(!ifoRead_PGCIT(vm->vtsi)) { + fprintf(MSG_OUT, "libdvdnav: ifoRead_PGCIT failed\n"); + return 0; + } + if(!ifoRead_PGCI_UT(vm->vtsi)) { + fprintf(MSG_OUT, "libdvdnav: ifoRead_PGCI_UT failed\n"); + return 0; + } + if(!ifoRead_VOBU_ADMAP(vm->vtsi)) { + fprintf(MSG_OUT, "libdvdnav: ifoRead_VOBU_ADMAP vtsi failed\n"); + return 0; + } + if(!ifoRead_TITLE_VOBU_ADMAP(vm->vtsi)) { + fprintf(MSG_OUT, "libdvdnav: ifoRead_TITLE_VOBU_ADMAP vtsi failed\n"); + return 0; + } + (vm->state).vtsN = vtsN; + + return 1; +} + + +/* Initialisation & Destruction */ + +vm_t* vm_new_vm() { + return (vm_t*)calloc(sizeof(vm_t), sizeof(char)); +} + +void vm_free_vm(vm_t *vm) { + vm_stop(vm); + free(vm); +} + + +/* IFO Access */ + +ifo_handle_t *vm_get_vmgi(vm_t *vm) { + return vm->vmgi; +} + +ifo_handle_t *vm_get_vtsi(vm_t *vm) { + return vm->vtsi; +} + + +/* Reader Access */ + +dvd_reader_t *vm_get_dvd_reader(vm_t *vm) { + return vm->dvd; +} + + +/* Basic Handling */ + +int vm_start(vm_t *vm) { + /* Set pgc to FP (First Play) pgc */ + set_FP_PGC(vm); + process_command(vm, play_PGC(vm)); + return !vm->stopped; +} + +void vm_stop(vm_t *vm) { + if(vm->vmgi) { + ifoClose(vm->vmgi); + vm->vmgi=NULL; + } + if(vm->vtsi) { + ifoClose(vm->vtsi); + vm->vtsi=NULL; + } + if(vm->dvd) { + if (!vm->openedDvd) + DVDClose(vm->dvd); + vm->dvd=NULL; + } + vm->stopped = 1; +} + +int vm_reset(vm_t *vm, const char *dvdroot) { + /* Setup State */ + memset((vm->state).registers.SPRM, 0, sizeof((vm->state).registers.SPRM)); + memset((vm->state).registers.GPRM, 0, sizeof((vm->state).registers.GPRM)); + memset((vm->state).registers.GPRM_mode, 0, sizeof((vm->state).registers.GPRM_mode)); + memset((vm->state).registers.GPRM_mode, 0, sizeof((vm->state).registers.GPRM_mode)); + memset((vm->state).registers.GPRM_time, 0, sizeof((vm->state).registers.GPRM_time)); + (vm->state).registers.SPRM[0] = ('e'<<8)|'n'; /* Player Menu Languange code */ + (vm->state).AST_REG = 15; /* 15 why? */ + (vm->state).SPST_REG = 62; /* 62 why? */ + (vm->state).AGL_REG = 1; + (vm->state).TTN_REG = 1; + (vm->state).VTS_TTN_REG = 1; + /* (vm->state).TT_PGCN_REG = 0 */ + (vm->state).PTTN_REG = 1; + (vm->state).HL_BTNN_REG = 1 << 10; + (vm->state).PTL_REG = 15; /* Parental Level */ + (vm->state).registers.SPRM[12] = ('U'<<8)|'S'; /* Parental Management Country Code */ + (vm->state).registers.SPRM[16] = ('e'<<8)|'n'; /* Initial Language Code for Audio */ + (vm->state).registers.SPRM[18] = ('e'<<8)|'n'; /* Initial Language Code for Spu */ + (vm->state).registers.SPRM[20] = 0x1; /* Player Regional Code Mask. Region free! */ + (vm->state).registers.SPRM[14] = 0x100; /* Try Pan&Scan */ + + (vm->state).pgN = 0; + (vm->state).cellN = 0; + (vm->state).cell_restart = 0; + + (vm->state).domain = FP_DOMAIN; + (vm->state).rsm_vtsN = 0; + (vm->state).rsm_cellN = 0; + (vm->state).rsm_blockN = 0; + + (vm->state).vtsN = -1; + + if (vm->dvd && dvdroot) { + /* a new dvd device has been requested */ + vm_stop(vm); + } + + if (!vm->dvd) { + if (vm->openedDvd) /*JMP we use the dvd opened by copy*/ + vm->dvd=vm->openedDvd; + else + vm->dvd = DVDOpen(dvdroot); + if(!vm->dvd) { + fprintf(MSG_OUT, "libdvdnav: vm: faild to open/read the DVD\n"); + return 0; + } + dvd_read_name(vm->dvd_name, dvdroot); + vm->map = remap_loadmap(vm->dvd_name); + vm->vmgi = ifoOpenVMGI(vm->dvd); + if(!vm->vmgi) { + fprintf(MSG_OUT, "libdvdnav: vm: faild to read VIDEO_TS.IFO\n"); + return 0; + } + if(!ifoRead_FP_PGC(vm->vmgi)) { + fprintf(MSG_OUT, "libdvdnav: vm: ifoRead_FP_PGC failed\n"); + return 0; + } + if(!ifoRead_TT_SRPT(vm->vmgi)) { + fprintf(MSG_OUT, "libdvdnav: vm: ifoRead_TT_SRPT failed\n"); + return 0; + } + if(!ifoRead_PGCI_UT(vm->vmgi)) { + fprintf(MSG_OUT, "libdvdnav: vm: ifoRead_PGCI_UT failed\n"); + return 0; + } + if(!ifoRead_PTL_MAIT(vm->vmgi)) { + fprintf(MSG_OUT, "libdvdnav: vm: ifoRead_PTL_MAIT failed\n"); + /* return 0; Not really used for now.. */ + } + if(!ifoRead_VTS_ATRT(vm->vmgi)) { + fprintf(MSG_OUT, "libdvdnav: vm: ifoRead_VTS_ATRT failed\n"); + /* return 0; Not really used for now.. */ + } + if(!ifoRead_VOBU_ADMAP(vm->vmgi)) { + fprintf(MSG_OUT, "libdvdnav: vm: ifoRead_VOBU_ADMAP vgmi failed\n"); + /* return 0; Not really used for now.. */ + } + /* ifoRead_TXTDT_MGI(vmgi); Not implemented yet */ + } + if (vm->vmgi) { + int i, mask; + fprintf(MSG_OUT, "libdvdnav: DVD disk reports itself with Region mask 0x%08x. Regions:", + vm->vmgi->vmgi_mat->vmg_category); + for (i = 1, mask = 1; i <= 8; i++, mask <<= 1) + if (((vm->vmgi->vmgi_mat->vmg_category >> 16) & mask) == 0) + fprintf(MSG_OUT, " %d", i); + fprintf(MSG_OUT, "\n"); + } + return 1; +} + + +/* copying and merging */ + +vm_t *vm_new_copy(vm_t *source) { + vm_t *target = vm_new_vm(); + int vtsN; + int pgcN = get_PGCN(source); + int pgN = (source->state).pgN; + + assert(pgcN); + + memcpy(target, source, sizeof(vm_t)); + + /* open a new vtsi handle, because the copy might switch to another VTS */ + target->vtsi = NULL; + vtsN = (target->state).vtsN; + if (vtsN > 0) { + (target->state).vtsN = 0; + if (!ifoOpenNewVTSI(target, target->dvd, vtsN)) + assert(0); + + /* restore pgc pointer into the new vtsi */ + if (!set_PGCN(target, pgcN)) + assert(0); + (target->state).pgN = pgN; + } + + return target; +} + +void vm_merge(vm_t *target, vm_t *source) { + if(target->vtsi) + ifoClose(target->vtsi); + memcpy(target, source, sizeof(vm_t)); + memset(source, 0, sizeof(vm_t)); +} + +void vm_free_copy(vm_t *vm) { + if(vm->vtsi) + ifoClose(vm->vtsi); + free(vm); +} + + +/* regular playback */ + +void vm_position_get(vm_t *vm, vm_position_t *position) { + position->button = (vm->state).HL_BTNN_REG >> 10; + position->vts = (vm->state).vtsN; + position->domain = (vm->state).domain; + position->spu_channel = (vm->state).SPST_REG; + position->audio_channel = (vm->state).AST_REG; + position->angle_channel = (vm->state).AGL_REG; + position->hop_channel = vm->hop_channel; /* Increases by one on each hop */ + position->cell = (vm->state).cellN; + position->cell_restart = (vm->state).cell_restart; + position->cell_start = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].first_sector; + position->still = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].still_time; + position->block = (vm->state).blockN; + + /* handle PGC stills at PGC end */ + if ((vm->state).cellN == (vm->state).pgc->nr_of_cells) + position->still += (vm->state).pgc->still_time; + /* still already determined */ + if (position->still) + return; + /* This is a rough fix for some strange still situations on some strange DVDs. + * There are discs (like the German "Back to the Future" RC2) where the only + * indication of a still is a cell playback time higher than the time the frames + * in this cell actually take to play (like 1 frame with 1 minute playback time). + * On the said BTTF disc, for these cells last_sector and last_vobu_start_sector + * are equal and the cells are very short, so we abuse these conditions to + * detect such discs. I consider these discs broken, so the fix is somewhat + * broken, too. */ + if (((vm->state).pgc->cell_playback[(vm->state).cellN - 1].last_sector == + (vm->state).pgc->cell_playback[(vm->state).cellN - 1].last_vobu_start_sector) && + ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].last_sector - + (vm->state).pgc->cell_playback[(vm->state).cellN - 1].first_sector < 1024)) { + int time; + int size = (vm->state).pgc->cell_playback[(vm->state).cellN - 1].last_sector - + (vm->state).pgc->cell_playback[(vm->state).cellN - 1].first_sector; + time = ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.hour >> 4 ) * 36000; + time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.hour & 0x0f) * 3600; + time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.minute >> 4 ) * 600; + time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.minute & 0x0f) * 60; + time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.second >> 4 ) * 10; + time += ((vm->state).pgc->cell_playback[(vm->state).cellN - 1].playback_time.second & 0x0f) * 1; + if (!time || size / time > 30) + /* datarate is too high, it might be a very short, but regular cell */ + return; + if (time > 0xff) time = 0xff; + position->still = time; + } +} + +void vm_get_next_cell(vm_t *vm) { + process_command(vm, play_Cell_post(vm)); +} + + +/* Jumping */ + +int vm_jump_pg(vm_t *vm, int pg) { + (vm->state).pgN = pg; + process_command(vm, play_PG(vm)); + return 1; +} + +int vm_jump_cell_block(vm_t *vm, int cell, int block) { + (vm->state).cellN = cell; + process_command(vm, play_Cell(vm)); + /* play_Cell can jump to a different cell in case of angles */ + if ((vm->state).cellN == cell) + (vm->state).blockN = block; + return 1; +} + +int vm_jump_title_part(vm_t *vm, int title, int part) { + link_t link; + + if(!set_PTT(vm, title, part)) + return 0; + /* Some DVDs do not want us to jump directly into a title and have + * PGC pre commands taking us back to some menu. Since we do not like that, + * we do not execute PGC pre commands that would do a jump. */ + /* process_command(vm, play_PGC_PG(vm, (vm->state).pgN)); */ + link = play_PGC_PG(vm, (vm->state).pgN); + if (link.command != PlayThis) + /* jump occured -> ignore it and play the PG anyway */ + process_command(vm, play_PG(vm)); + else + process_command(vm, link); + return 1; +} + +int vm_jump_top_pg(vm_t *vm) { + process_command(vm, play_PG(vm)); + return 1; +} + +int vm_jump_next_pg(vm_t *vm) { + if((vm->state).pgN >= (vm->state).pgc->nr_of_programs) { + /* last program -> move to TailPGC */ + process_command(vm, play_PGC_post(vm)); + return 1; + } else { + vm_jump_pg(vm, (vm->state).pgN + 1); + return 1; + } +} + +int vm_jump_prev_pg(vm_t *vm) { + if ((vm->state).pgN <= 1) { + /* first program -> move to last program of previous PGC */ + if ((vm->state).pgc->prev_pgc_nr && set_PGCN(vm, (vm->state).pgc->prev_pgc_nr)) { + process_command(vm, play_PGC(vm)); + vm_jump_pg(vm, (vm->state).pgc->nr_of_programs); + return 1; + } + return 0; + } else { + vm_jump_pg(vm, (vm->state).pgN - 1); + return 1; + } +} + +int vm_jump_up(vm_t *vm) { + if((vm->state).pgc->goup_pgc_nr && set_PGCN(vm, (vm->state).pgc->goup_pgc_nr)) { + process_command(vm, play_PGC(vm)); + return 1; + } + return 0; +} + +int vm_jump_menu(vm_t *vm, DVDMenuID_t menuid) { + domain_t old_domain = (vm->state).domain; + + switch ((vm->state).domain) { + case VTS_DOMAIN: + set_RSMinfo(vm, 0, (vm->state).blockN); + /* FALL THROUGH */ + case VTSM_DOMAIN: + case VMGM_DOMAIN: + switch(menuid) { + case DVD_MENU_Title: + case DVD_MENU_Escape: + (vm->state).domain = VMGM_DOMAIN; + break; + case DVD_MENU_Root: + case DVD_MENU_Subpicture: + case DVD_MENU_Audio: + case DVD_MENU_Angle: + case DVD_MENU_Part: + (vm->state).domain = VTSM_DOMAIN; + break; + } + if(get_PGCIT(vm) && set_MENU(vm, menuid)) { + process_command(vm, play_PGC(vm)); + return 1; /* Jump */ + } else { + (vm->state).domain = old_domain; + } + break; + case FP_DOMAIN: /* FIXME XXX $$$ What should we do here? */ + break; + } + + return 0; +} + +int vm_jump_resume(vm_t *vm) { + link_t link_values = { LinkRSM, 0, 0, 0 }; + + if (!(vm->state).rsm_vtsN) /* Do we have resume info? */ + return 0; + if (!process_command(vm, link_values)) + return 0; + return 1; +} + +int vm_exec_cmd(vm_t *vm, vm_cmd_t *cmd) { + link_t link_values; + + if(vmEval_CMD(cmd, 1, &(vm->state).registers, &link_values)) + return process_command(vm, link_values); + else + return 0; /* It updated some state thats all... */ +} + + +/* getting information */ + +int vm_get_current_menu(vm_t *vm, int *menuid) { + pgcit_t* pgcit; + int pgcn; + pgcn = (vm->state).pgcN; + pgcit = get_PGCIT(vm); + *menuid = pgcit->pgci_srp[pgcn - 1].entry_id & 0xf ; + return 1; +} + +int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result) { + vts_ptt_srpt_t *vts_ptt_srpt; + int title, part = 0, vts_ttn; + int found; + int16_t pgcN, pgN; + + vts_ptt_srpt = vm->vtsi->vts_ptt_srpt; + pgcN = get_PGCN(vm); + pgN = vm->state.pgN; + + found = 0; + for (vts_ttn = 0; (vts_ttn < vts_ptt_srpt->nr_of_srpts) && !found; vts_ttn++) { + for (part = 0; (part < vts_ptt_srpt->title[vts_ttn].nr_of_ptts) && !found; part++) { + if (vts_ptt_srpt->title[vts_ttn].ptt[part].pgcn == pgcN) { + if (vts_ptt_srpt->title[vts_ttn].ptt[part].pgn == pgN) { + found = 1; + break; + } + if (part > 0 && vts_ptt_srpt->title[vts_ttn].ptt[part].pgn > pgN && + vts_ptt_srpt->title[vts_ttn].ptt[part - 1].pgn < pgN) { + part--; + found = 1; + break; + } + } + } + if (found) break; + } + vts_ttn++; + part++; + + if (!found) { + fprintf(MSG_OUT, "libdvdnav: chapter NOT FOUND!\n"); + return 0; + } + + title = get_TT(vm, vm->state.vtsN, vts_ttn); + +#ifdef TRACE + if (title) { + fprintf(MSG_OUT, "libdvdnav: ************ this chapter FOUND!\n"); + fprintf(MSG_OUT, "libdvdnav: VTS_PTT_SRPT - Title %3i part %3i: PGC: %3i PG: %3i\n", + title, part, + vts_ptt_srpt->title[vts_ttn-1].ptt[part-1].pgcn , + vts_ptt_srpt->title[vts_ttn-1].ptt[part-1].pgn ); + } +#endif + *title_result = title; + *part_result = part; + return 1; +} + +/* Return the substream id for 'logical' audio stream audioN. + * 0 <= audioN < 8 + */ +int vm_get_audio_stream(vm_t *vm, int audioN) { + int streamN = -1; + + if((vm->state).domain != VTS_DOMAIN) + audioN = 0; + + if(audioN < 8) { + /* Is there any control info for this logical stream */ + if((vm->state).pgc->audio_control[audioN] & (1<<15)) { + streamN = ((vm->state).pgc->audio_control[audioN] >> 8) & 0x07; + } + } + + if((vm->state).domain != VTS_DOMAIN && streamN == -1) + streamN = 0; + + /* FIXME: Should also check in vtsi/vmgi status what kind of stream + * it is (ac3/lpcm/dts/sdds...) to find the right (sub)stream id */ + return streamN; +} + +/* Return the substream id for 'logical' subpicture stream subpN and given mode. + * 0 <= subpN < 32 + * mode == 0 - widescreen + * mode == 1 - letterbox + * mode == 2 - pan&scan + */ +int vm_get_subp_stream(vm_t *vm, int subpN, int mode) { + int streamN = -1; + int source_aspect = vm_get_video_aspect(vm); + + if((vm->state).domain != VTS_DOMAIN) + subpN = 0; + + if(subpN < 32) { /* a valid logical stream */ + /* Is this logical stream present */ + if((vm->state).pgc->subp_control[subpN] & (1<<31)) { + if(source_aspect == 0) /* 4:3 */ + streamN = ((vm->state).pgc->subp_control[subpN] >> 24) & 0x1f; + if(source_aspect == 3) /* 16:9 */ + switch (mode) { + case 0: + streamN = ((vm->state).pgc->subp_control[subpN] >> 16) & 0x1f; + break; + case 1: + streamN = ((vm->state).pgc->subp_control[subpN] >> 8) & 0x1f; + break; + case 2: + streamN = (vm->state).pgc->subp_control[subpN] & 0x1f; + } + } + } + + if((vm->state).domain != VTS_DOMAIN && streamN == -1) + streamN = 0; + + /* FIXME: Should also check in vtsi/vmgi status what kind of stream it is. */ + return streamN; +} + +int vm_get_audio_active_stream(vm_t *vm) { + int audioN; + int streamN; + audioN = (vm->state).AST_REG ; + streamN = vm_get_audio_stream(vm, audioN); + + /* If no such stream, then select the first one that exists. */ + if(streamN == -1) { + for(audioN = 0; audioN < 8; audioN++) { + if((vm->state).pgc->audio_control[audioN] & (1<<15)) { + if ((streamN = vm_get_audio_stream(vm, audioN)) >= 0) + break; + } + } + } + + return streamN; +} + +int vm_get_subp_active_stream(vm_t *vm, int mode) { + int subpN; + int streamN; + subpN = (vm->state).SPST_REG & ~0x40; + streamN = vm_get_subp_stream(vm, subpN, mode); + + /* If no such stream, then select the first one that exists. */ + if(streamN == -1) { + for(subpN = 0; subpN < 32; subpN++) { + if((vm->state).pgc->subp_control[subpN] & (1<<31)) { + if ((streamN = vm_get_subp_stream(vm, subpN, mode)) >= 0) + break; + } + } + } + + if((vm->state).domain == VTS_DOMAIN && !((vm->state).SPST_REG & 0x40)) + /* Bit 7 set means hide, and only let Forced display show */ + return (streamN | 0x80); + else + return streamN; +} + +void vm_get_angle_info(vm_t *vm, int *current, int *num_avail) { + *num_avail = 1; + *current = 1; + + if((vm->state).domain == VTS_DOMAIN) { + title_info_t *title; + /* TTN_REG does not allways point to the correct title.. */ + if((vm->state).TTN_REG > vm->vmgi->tt_srpt->nr_of_srpts) + return; + title = &vm->vmgi->tt_srpt->title[(vm->state).TTN_REG - 1]; + if(title->title_set_nr != (vm->state).vtsN || + title->vts_ttn != (vm->state).VTS_TTN_REG) + return; + *num_avail = title->nr_of_angles; + *current = (vm->state).AGL_REG; + } +} + +#if 0 +/* currently unused */ +void vm_get_audio_info(vm_t *vm, int *current, int *num_avail) { + switch ((vm->state).domain) { + case VTS_DOMAIN: + *num_avail = vm->vtsi->vtsi_mat->nr_of_vts_audio_streams; + *current = (vm->state).AST_REG; + break; + case VTSM_DOMAIN: + *num_avail = vm->vtsi->vtsi_mat->nr_of_vtsm_audio_streams; /* 1 */ + *current = 1; + break; + case VMGM_DOMAIN: + case FP_DOMAIN: + *num_avail = vm->vmgi->vmgi_mat->nr_of_vmgm_audio_streams; /* 1 */ + *current = 1; + break; + } +} + +/* currently unused */ +void vm_get_subp_info(vm_t *vm, int *current, int *num_avail) { + switch ((vm->state).domain) { + case VTS_DOMAIN: + *num_avail = vm->vtsi->vtsi_mat->nr_of_vts_subp_streams; + *current = (vm->state).SPST_REG; + break; + case VTSM_DOMAIN: + *num_avail = vm->vtsi->vtsi_mat->nr_of_vtsm_subp_streams; /* 1 */ + *current = 0x41; + break; + case VMGM_DOMAIN: + case FP_DOMAIN: + *num_avail = vm->vmgi->vmgi_mat->nr_of_vmgm_subp_streams; /* 1 */ + *current = 0x41; + break; + } +} + +/* currently unused */ +void vm_get_video_res(vm_t *vm, int *width, int *height) { + video_attr_t attr = vm_get_video_attr(vm); + + if(attr.video_format != 0) + *height = 576; + else + *height = 480; + switch(attr.picture_size) { + case 0: + *width = 720; + break; + case 1: + *width = 704; + break; + case 2: + *width = 352; + break; + case 3: + *width = 352; + *height /= 2; + break; + } +} +#endif + +int vm_get_video_aspect(vm_t *vm) { + int aspect = vm_get_video_attr(vm).display_aspect_ratio; + + assert(aspect == 0 || aspect == 3); + (vm->state).registers.SPRM[14] &= ~(0x3 << 10); + (vm->state).registers.SPRM[14] |= aspect << 10; + + return aspect; +} + +int vm_get_video_scale_permission(vm_t *vm) { + return vm_get_video_attr(vm).permitted_df; +} + +video_attr_t vm_get_video_attr(vm_t *vm) { + switch ((vm->state).domain) { + case VTS_DOMAIN: + return vm->vtsi->vtsi_mat->vts_video_attr; + case VTSM_DOMAIN: + return vm->vtsi->vtsi_mat->vtsm_video_attr; + case VMGM_DOMAIN: + case FP_DOMAIN: + return vm->vmgi->vmgi_mat->vmgm_video_attr; + default: + abort(); + } +} + +audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN) { + switch ((vm->state).domain) { + case VTS_DOMAIN: + return vm->vtsi->vtsi_mat->vts_audio_attr[streamN]; + case VTSM_DOMAIN: + return vm->vtsi->vtsi_mat->vtsm_audio_attr; + case VMGM_DOMAIN: + case FP_DOMAIN: + return vm->vmgi->vmgi_mat->vmgm_audio_attr; + default: + abort(); + } +} + +subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN) { + switch ((vm->state).domain) { + case VTS_DOMAIN: + return vm->vtsi->vtsi_mat->vts_subp_attr[streamN]; + case VTSM_DOMAIN: + return vm->vtsi->vtsi_mat->vtsm_subp_attr; + case VMGM_DOMAIN: + case FP_DOMAIN: + return vm->vmgi->vmgi_mat->vmgm_subp_attr; + default: + abort(); + } +} + + +/* Playback control */ + +static link_t play_PGC(vm_t *vm) { + link_t link_values; + +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: play_PGC:"); + if((vm->state).domain != FP_DOMAIN) { + fprintf(MSG_OUT, " (vm->state).pgcN (%i)\n", get_PGCN(vm)); + } else { + fprintf(MSG_OUT, " first_play_pgc\n"); + } +#endif + + /* This must be set before the pre-commands are executed because they + * might contain a CallSS that will save resume state */ + + /* FIXME: This may be only a temporary fix for something... */ + (vm->state).pgN = 1; + (vm->state).cellN = 0; + (vm->state).blockN = 0; + + /* eval -> updates the state and returns either + - some kind of jump (Jump(TT/SS/VTS_TTN/CallSS/link C/PG/PGC/PTTN) + - just play video i.e first PG + (This is what happens if you fall of the end of the pre_cmds) + - or an error (are there more cases?) */ + if((vm->state).pgc->command_tbl && (vm->state).pgc->command_tbl->nr_of_pre) { + if(vmEval_CMD((vm->state).pgc->command_tbl->pre_cmds, + (vm->state).pgc->command_tbl->nr_of_pre, + &(vm->state).registers, &link_values)) { + /* link_values contains the 'jump' return value */ + return link_values; + } else { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: PGC pre commands didn't do a Jump, Link or Call\n"); +#endif + } + } + return play_PG(vm); +} + +static link_t play_PGC_PG(vm_t *vm, int pgN) { + link_t link_values; + +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: play_PGC_PG:"); + if((vm->state).domain != FP_DOMAIN) { + fprintf(MSG_OUT, " (vm->state).pgcN (%i)\n", get_PGCN(vm)); + } else { + fprintf(MSG_OUT, " first_play_pgc\n"); + } +#endif + + /* This must be set before the pre-commands are executed because they + * might contain a CallSS that will save resume state */ + + /* FIXME: This may be only a temporary fix for something... */ + (vm->state).pgN = pgN; + (vm->state).cellN = 0; + (vm->state).blockN = 0; + + /* eval -> updates the state and returns either + - some kind of jump (Jump(TT/SS/VTS_TTN/CallSS/link C/PG/PGC/PTTN) + - just play video i.e first PG + (This is what happens if you fall of the end of the pre_cmds) + - or an error (are there more cases?) */ + if((vm->state).pgc->command_tbl && (vm->state).pgc->command_tbl->nr_of_pre) { + if(vmEval_CMD((vm->state).pgc->command_tbl->pre_cmds, + (vm->state).pgc->command_tbl->nr_of_pre, + &(vm->state).registers, &link_values)) { + /* link_values contains the 'jump' return value */ + return link_values; + } else { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: PGC pre commands didn't do a Jump, Link or Call\n"); +#endif + } + } + return play_PG(vm); +} + +static link_t play_PGC_post(vm_t *vm) { + link_t link_values; + +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: play_PGC_post:\n"); +#endif + + /* eval -> updates the state and returns either + - some kind of jump (Jump(TT/SS/VTS_TTN/CallSS/link C/PG/PGC/PTTN) + - just go to next PGC + (This is what happens if you fall of the end of the post_cmds) + - or an error (are there more cases?) */ + if((vm->state).pgc->command_tbl && (vm->state).pgc->command_tbl->nr_of_post && + vmEval_CMD((vm->state).pgc->command_tbl->post_cmds, + (vm->state).pgc->command_tbl->nr_of_post, + &(vm->state).registers, &link_values)) { + return link_values; + } + +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: ** Fell of the end of the pgc, continuing in NextPGC\n"); +#endif + /* Should end up in the STOP_DOMAIN if next_pgc is 0. */ + if(!set_PGCN(vm, (vm->state).pgc->next_pgc_nr)) { + link_values.command = Exit; + return link_values; + } + return play_PGC(vm); +} + +static link_t play_PG(vm_t *vm) { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: play_PG: (vm->state).pgN (%i)\n", (vm->state).pgN); +#endif + + assert((vm->state).pgN > 0); + if((vm->state).pgN > (vm->state).pgc->nr_of_programs) { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: play_PG: (vm->state).pgN (%i) > pgc->nr_of_programs (%i)\n", + (vm->state).pgN, (vm->state).pgc->nr_of_programs ); +#endif + assert((vm->state).pgN == (vm->state).pgc->nr_of_programs + 1); + return play_PGC_post(vm); + } + + (vm->state).cellN = (vm->state).pgc->program_map[(vm->state).pgN - 1]; + + return play_Cell(vm); +} + +static link_t play_Cell(vm_t *vm) { + static const link_t play_this = {PlayThis, /* Block in Cell */ 0, 0, 0}; + +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: play_Cell: (vm->state).cellN (%i)\n", (vm->state).cellN); +#endif + + assert((vm->state).cellN > 0); + if((vm->state).cellN > (vm->state).pgc->nr_of_cells) { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: (vm->state).cellN (%i) > pgc->nr_of_cells (%i)\n", + (vm->state).cellN, (vm->state).pgc->nr_of_cells ); +#endif + assert((vm->state).cellN == (vm->state).pgc->nr_of_cells + 1); + return play_PGC_post(vm); + } + + /* Multi angle/Interleaved */ + switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode) { + case 0: /* Normal */ + assert((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type == 0); + break; + case 1: /* The first cell in the block */ + switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type) { + case 0: /* Not part of a block */ + assert(0); + break; + case 1: /* Angle block */ + /* Loop and check each cell instead? So we don't get outside the block? */ + (vm->state).cellN += (vm->state).AGL_REG - 1; +#ifdef STRICT + assert((vm->state).cellN <= (vm->state).pgc->nr_of_cells); + assert((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode != 0); + assert((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type == 1); +#else + if (!((vm->state).cellN <= (vm->state).pgc->nr_of_cells) || + !((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode != 0) || + !((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type == 1)) { + fprintf(MSG_OUT, "libdvdnav: Invalid angle block\n"); + (vm->state).cellN -= (vm->state).AGL_REG - 1; + } +#endif + break; + case 2: /* ?? */ + case 3: /* ?? */ + default: + fprintf(MSG_OUT, "libdvdnav: Invalid? Cell block_mode (%d), block_type (%d)\n", + (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode, + (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type); + assert(0); + } + break; + case 2: /* Cell in the block */ + case 3: /* Last cell in the block */ + /* These might perhaps happen for RSM or LinkC commands? */ + default: + fprintf(MSG_OUT, "libdvdnav: Cell is in block but did not enter at first cell!\n"); + } + + /* Updates (vm->state).pgN and PTTN_REG */ + if(!set_PGN(vm)) { + /* Should not happen */ + assert(0); + return play_PGC_post(vm); + } + (vm->state).cell_restart++; + (vm->state).blockN = 0; +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: Cell should restart here\n"); +#endif + return play_this; +} + +static link_t play_Cell_post(vm_t *vm) { + cell_playback_t *cell; + +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: play_Cell_post: (vm->state).cellN (%i)\n", (vm->state).cellN); +#endif + + cell = &(vm->state).pgc->cell_playback[(vm->state).cellN - 1]; + + /* Still time is already taken care of before we get called. */ + + /* Deal with a Cell command, if any */ + if(cell->cell_cmd_nr != 0) { + link_t link_values; + +/* These asserts are now not needed. + * Some DVDs have no cell commands listed in the PGC, + * but the Cell itself points to a cell command that does not exist. + * For this situation, just ignore the cell command and continue. + * + * assert((vm->state).pgc->command_tbl != NULL); + * assert((vm->state).pgc->command_tbl->nr_of_cell >= cell->cell_cmd_nr); + */ + + if ((vm->state).pgc->command_tbl != NULL && + (vm->state).pgc->command_tbl->nr_of_cell >= cell->cell_cmd_nr) { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: Cell command present, executing\n"); +#endif + if(vmEval_CMD(&(vm->state).pgc->command_tbl->cell_cmds[cell->cell_cmd_nr - 1], 1, + &(vm->state).registers, &link_values)) { + return link_values; + } else { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: Cell command didn't do a Jump, Link or Call\n"); +#endif + } + } else { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: Invalid Cell command\n"); +#endif + } + } + + /* Where to continue after playing the cell... */ + /* Multi angle/Interleaved */ + switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode) { + case 0: /* Normal */ + assert((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type == 0); + (vm->state).cellN++; + break; + case 1: /* The first cell in the block */ + case 2: /* A cell in the block */ + case 3: /* The last cell in the block */ + default: + switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type) { + case 0: /* Not part of a block */ + assert(0); + break; + case 1: /* Angle block */ + /* Skip the 'other' angles */ + (vm->state).cellN++; + while((vm->state).cellN <= (vm->state).pgc->nr_of_cells && + (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode >= 2) { + (vm->state).cellN++; + } + break; + case 2: /* ?? */ + case 3: /* ?? */ + default: + fprintf(MSG_OUT, "libdvdnav: Invalid? Cell block_mode (%d), block_type (%d)\n", + (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode, + (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type); + assert(0); + } + break; + } + + /* Figure out the correct pgN for the new cell */ + if(!set_PGN(vm)) { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: last cell in this PGC\n"); +#endif + return play_PGC_post(vm); + } + return play_Cell(vm); +} + + +/* link processing */ + +static int process_command(vm_t *vm, link_t link_values) { + + while(link_values.command != PlayThis) { + +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: Before printout starts:\n"); + vm_print_link(link_values); + fprintf(MSG_OUT, "libdvdnav: Link values %i %i %i %i\n", link_values.command, + link_values.data1, link_values.data2, link_values.data3); + vm_print_current_domain_state(vm); + fprintf(MSG_OUT, "libdvdnav: Before printout ends.\n"); +#endif + + switch(link_values.command) { + case LinkNoLink: + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + return 0; /* no actual jump */ + + case LinkTopC: + /* Restart playing from the beginning of the current Cell. */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + link_values = play_Cell(vm); + break; + case LinkNextC: + /* Link to Next Cell */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + (vm->state).cellN += 1; + link_values = play_Cell(vm); + break; + case LinkPrevC: + /* Link to Previous Cell */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + assert((vm->state).cellN > 1); + (vm->state).cellN -= 1; + link_values = play_Cell(vm); + break; + + case LinkTopPG: + /* Link to Top of current Program */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + link_values = play_PG(vm); + break; + case LinkNextPG: + /* Link to Next Program */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + (vm->state).pgN += 1; + link_values = play_PG(vm); + break; + case LinkPrevPG: + /* Link to Previous Program */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + assert((vm->state).pgN > 1); + (vm->state).pgN -= 1; + link_values = play_PG(vm); + break; + + case LinkTopPGC: + /* Restart playing from beginning of current Program Chain */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + link_values = play_PGC(vm); + break; + case LinkNextPGC: + /* Link to Next Program Chain */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + assert((vm->state).pgc->next_pgc_nr != 0); + if(set_PGCN(vm, (vm->state).pgc->next_pgc_nr)) + link_values = play_PGC(vm); + else + link_values.command = Exit; + break; + case LinkPrevPGC: + /* Link to Previous Program Chain */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + assert((vm->state).pgc->prev_pgc_nr != 0); + if(set_PGCN(vm, (vm->state).pgc->prev_pgc_nr)) + link_values = play_PGC(vm); + else + link_values.command = Exit; + break; + case LinkGoUpPGC: + /* Link to GoUp Program Chain */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + assert((vm->state).pgc->goup_pgc_nr != 0); + if(set_PGCN(vm, (vm->state).pgc->goup_pgc_nr)) + link_values = play_PGC(vm); + else + link_values.command = Exit; + break; + case LinkTailPGC: + /* Link to Tail of Program Chain */ + /* BUTTON number:data1 */ + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + link_values = play_PGC_post(vm); + break; + + case LinkRSM: + { + /* Link to Resume point */ + int i; + + /* Check and see if there is any rsm info!! */ + if (!(vm->state).rsm_vtsN) { + fprintf(MSG_OUT, "libdvdnav: trying to resume without any resume info set\n"); + link_values.command = Exit; + break; + } + + (vm->state).domain = VTS_DOMAIN; + if (!ifoOpenNewVTSI(vm, vm->dvd, (vm->state).rsm_vtsN)) + assert(0); + set_PGCN(vm, (vm->state).rsm_pgcN); + + /* These should never be set in SystemSpace and/or MenuSpace */ + /* (vm->state).TTN_REG = rsm_tt; ?? */ + /* (vm->state).TT_PGCN_REG = (vm->state).rsm_pgcN; ?? */ + for(i = 0; i < 5; i++) { + (vm->state).registers.SPRM[4 + i] = (vm->state).rsm_regs[i]; + } + + if(link_values.data1 != 0) + (vm->state).HL_BTNN_REG = link_values.data1 << 10; + + if((vm->state).rsm_cellN == 0) { + assert((vm->state).cellN); /* Checking if this ever happens */ + (vm->state).pgN = 1; + link_values = play_PG(vm); + } else { + /* (vm->state).pgN = ?? this gets the right value in set_PGN() below */ + (vm->state).cellN = (vm->state).rsm_cellN; + link_values.command = PlayThis; + link_values.data1 = (vm->state).rsm_blockN & 0xffff; + link_values.data2 = (vm->state).rsm_blockN >> 16; + if(!set_PGN(vm)) { + /* Were at the end of the PGC, should not happen for a RSM */ + assert(0); + link_values.command = LinkTailPGC; + link_values.data1 = 0; /* No button */ + } + } + } + break; + case LinkPGCN: + /* Link to Program Chain Number:data1 */ + if(!set_PGCN(vm, link_values.data1)) + assert(0); + link_values = play_PGC(vm); + break; + case LinkPTTN: + /* Link to Part of current Title Number:data1 */ + /* BUTTON number:data2 */ + /* PGC Pre-Commands are not executed */ + assert((vm->state).domain == VTS_DOMAIN); + if(link_values.data2 != 0) + (vm->state).HL_BTNN_REG = link_values.data2 << 10; + if(!set_VTS_PTT(vm, (vm->state).vtsN, (vm->state).VTS_TTN_REG, link_values.data1)) + assert(0); + link_values = play_PG(vm); + break; + case LinkPGN: + /* Link to Program Number:data1 */ + /* BUTTON number:data2 */ + if(link_values.data2 != 0) + (vm->state).HL_BTNN_REG = link_values.data2 << 10; + /* Update any other state, PTTN perhaps? */ + (vm->state).pgN = link_values.data1; + link_values = play_PG(vm); + break; + case LinkCN: + /* Link to Cell Number:data1 */ + /* BUTTON number:data2 */ + if(link_values.data2 != 0) + (vm->state).HL_BTNN_REG = link_values.data2 << 10; + /* Update any other state, pgN, PTTN perhaps? */ + (vm->state).cellN = link_values.data1; + link_values = play_Cell(vm); + break; + + case Exit: + vm->stopped = 1; + return 0; + + case JumpTT: + /* Jump to VTS Title Domain */ + /* Only allowed from the First Play domain(PGC) */ + /* or the Video Manager domain (VMG) */ + /* Stop SPRM9 Timer */ + /* Set SPRM1 and SPRM2 */ + assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */ + if(set_TT(vm, link_values.data1)) + link_values = play_PGC(vm); + else + link_values.command = Exit; + break; + case JumpVTS_TT: + /* Jump to Title:data1 in same VTS Title Domain */ + /* Only allowed from the VTS Menu Domain(VTSM) */ + /* or the Video Title Set Domain(VTS) */ + /* Stop SPRM9 Timer */ + /* Set SPRM1 and SPRM2 */ + assert((vm->state).domain == VTSM_DOMAIN || (vm->state).domain == VTS_DOMAIN); /* ?? */ + if(!set_VTS_TT(vm, (vm->state).vtsN, link_values.data1)) + assert(0); + link_values = play_PGC(vm); + break; + case JumpVTS_PTT: + /* Jump to Part:data2 of Title:data1 in same VTS Title Domain */ + /* Only allowed from the VTS Menu Domain(VTSM) */ + /* or the Video Title Set Domain(VTS) */ + /* Stop SPRM9 Timer */ + /* Set SPRM1 and SPRM2 */ + assert((vm->state).domain == VTSM_DOMAIN || (vm->state).domain == VTS_DOMAIN); /* ?? */ + if(!set_VTS_PTT(vm, (vm->state).vtsN, link_values.data1, link_values.data2)) + assert(0); + link_values = play_PGC_PG(vm, (vm->state).pgN); + break; + + case JumpSS_FP: + /* Jump to First Play Domain */ + /* Only allowed from the VTS Menu Domain(VTSM) */ + /* or the Video Manager domain (VMG) */ + /* Stop SPRM9 Timer and any GPRM counters */ + assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == VTSM_DOMAIN); /* ?? */ + if (!set_FP_PGC(vm)) + assert(0); + link_values = play_PGC(vm); + break; + case JumpSS_VMGM_MENU: + /* Jump to Video Manger domain - Title Menu:data1 or any PGC in VMG */ + /* Allowed from anywhere except the VTS Title domain */ + /* Stop SPRM9 Timer and any GPRM counters */ + assert((vm->state).domain != VTS_DOMAIN); /* ?? */ + (vm->state).domain = VMGM_DOMAIN; + if(!set_MENU(vm, link_values.data1)) + assert(0); + link_values = play_PGC(vm); + break; + case JumpSS_VTSM: + /* Jump to a menu in Video Title domain, */ + /* or to a Menu is the current VTS */ + /* Stop SPRM9 Timer and any GPRM counters */ + /* ifoOpenNewVTSI:data1 */ + /* VTS_TTN_REG:data2 */ + /* get_MENU:data3 */ + if(link_values.data1 != 0) { + if (link_values.data1 != (vm->state).vtsN) { + /* the normal case */ + assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */ + (vm->state).domain = VTSM_DOMAIN; + if (!ifoOpenNewVTSI(vm, vm->dvd, link_values.data1)) /* Also sets (vm->state).vtsN */ + assert(0); + } else { + /* This happens on some discs like "Captain Scarlet & the Mysterons" or + * the German RC2 of "Anatomie" in VTSM. */ + assert((vm->state).domain == VTSM_DOMAIN || + (vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */ + (vm->state).domain = VTSM_DOMAIN; + } + } else { + /* This happens on 'The Fifth Element' region 2. */ + assert((vm->state).domain == VTSM_DOMAIN); + } + /* I don't know what title is supposed to be used for. */ + /* Alien or Aliens has this != 1, I think. */ + /* assert(link_values.data2 == 1); */ + (vm->state).VTS_TTN_REG = link_values.data2; + /* TTN_REG (SPRM4), VTS_TTN_REG (SPRM5), TT_PGCN_REG (SPRM6) are linked, */ + /* so if one changes, the others must change to match it. */ + (vm->state).TTN_REG = get_TT(vm, (vm->state).vtsN, (vm->state).VTS_TTN_REG); + if(!set_MENU(vm, link_values.data3)) + assert(0); + link_values = play_PGC(vm); + break; + case JumpSS_VMGM_PGC: + /* set_PGCN:data1 */ + /* Stop SPRM9 Timer and any GPRM counters */ + assert((vm->state).domain != VTS_DOMAIN); /* ?? */ + (vm->state).domain = VMGM_DOMAIN; + if(!set_PGCN(vm, link_values.data1)) + assert(0); + link_values = play_PGC(vm); + break; + + case CallSS_FP: + /* set_RSMinfo:data1 */ + assert((vm->state).domain == VTS_DOMAIN); /* ?? */ + /* Must be called before domain is changed */ + set_RSMinfo(vm, link_values.data1, /* We dont have block info */ 0); + set_FP_PGC(vm); + link_values = play_PGC(vm); + break; + case CallSS_VMGM_MENU: + /* set_MENU:data1 */ + /* set_RSMinfo:data2 */ + assert((vm->state).domain == VTS_DOMAIN); /* ?? */ + /* Must be called before domain is changed */ + set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0); + (vm->state).domain = VMGM_DOMAIN; + if(!set_MENU(vm, link_values.data1)) + assert(0); + link_values = play_PGC(vm); + break; + case CallSS_VTSM: + /* set_MENU:data1 */ + /* set_RSMinfo:data2 */ + assert((vm->state).domain == VTS_DOMAIN); /* ?? */ + /* Must be called before domain is changed */ + set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0); + (vm->state).domain = VTSM_DOMAIN; + if(!set_MENU(vm, link_values.data1)) + assert(0); + link_values = play_PGC(vm); + break; + case CallSS_VMGM_PGC: + /* set_PGC:data1 */ + /* set_RSMinfo:data2 */ + assert((vm->state).domain == VTS_DOMAIN); /* ?? */ + /* Must be called before domain is changed */ + set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0); + (vm->state).domain = VMGM_DOMAIN; + if(!set_PGCN(vm, link_values.data1)) + assert(0); + link_values = play_PGC(vm); + break; + case PlayThis: + /* Should never happen. */ + assert(0); + break; + } + +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: After printout starts:\n"); + vm_print_current_domain_state(vm); + fprintf(MSG_OUT, "libdvdnav: After printout ends.\n"); +#endif + + } + (vm->state).blockN = link_values.data1 | (link_values.data2 << 16); + return 1; +} + + +/* Set functions */ + +static int set_TT(vm_t *vm, int tt) { + return set_PTT(vm, tt, 1); +} + +static int set_PTT(vm_t *vm, int tt, int ptt) { + assert(tt <= vm->vmgi->tt_srpt->nr_of_srpts); + return set_VTS_PTT(vm, vm->vmgi->tt_srpt->title[tt - 1].title_set_nr, + vm->vmgi->tt_srpt->title[tt - 1].vts_ttn, ptt); +} + +static int set_VTS_TT(vm_t *vm, int vtsN, int vts_ttn) { + return set_VTS_PTT(vm, vtsN, vts_ttn, 1); +} + +static int set_VTS_PTT(vm_t *vm, int vtsN, int vts_ttn, int part) { + int pgcN, pgN, res; + + (vm->state).domain = VTS_DOMAIN; + + if (vtsN != (vm->state).vtsN) + if (!ifoOpenNewVTSI(vm, vm->dvd, vtsN)) /* Also sets (vm->state).vtsN */ + return 0; + + if ((vts_ttn < 1) || (vts_ttn > vm->vtsi->vts_ptt_srpt->nr_of_srpts) || + (part < 1) || (part > vm->vtsi->vts_ptt_srpt->title[vts_ttn - 1].nr_of_ptts) ) { + return 0; + } + + pgcN = vm->vtsi->vts_ptt_srpt->title[vts_ttn - 1].ptt[part - 1].pgcn; + pgN = vm->vtsi->vts_ptt_srpt->title[vts_ttn - 1].ptt[part - 1].pgn; + + (vm->state).TT_PGCN_REG = pgcN; + (vm->state).PTTN_REG = part; + (vm->state).TTN_REG = get_TT(vm, vtsN, vts_ttn); + assert( (vm->state.TTN_REG) != 0 ); + (vm->state).VTS_TTN_REG = vts_ttn; + (vm->state).vtsN = vtsN; /* Not sure about this one. We can get to it easily from TTN_REG */ + /* Any other registers? */ + + res = set_PGCN(vm, pgcN); /* This clobber's state.pgN (sets it to 1), but we don't want clobbering here. */ + (vm->state).pgN = pgN; + return res; +} + +static int set_FP_PGC(vm_t *vm) { + (vm->state).domain = FP_DOMAIN; + if (!vm->vmgi->first_play_pgc) { + return set_PGCN(vm, 1); + } + (vm->state).pgc = vm->vmgi->first_play_pgc; + (vm->state).pgcN = vm->vmgi->vmgi_mat->first_play_pgc; + return 1; +} + + +static int set_MENU(vm_t *vm, int menu) { + assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == VTSM_DOMAIN); + return set_PGCN(vm, get_ID(vm, menu)); +} + +static int set_PGCN(vm_t *vm, int pgcN) { + pgcit_t *pgcit; + + pgcit = get_PGCIT(vm); + assert(pgcit != NULL); /* ?? Make this return -1 instead */ + + if(pgcN < 1 || pgcN > pgcit->nr_of_pgci_srp) { +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: ** No such pgcN = %d\n", pgcN); +#endif + return 0; + } + + (vm->state).pgc = pgcit->pgci_srp[pgcN - 1].pgc; + (vm->state).pgcN = pgcN; + (vm->state).pgN = 1; + + if((vm->state).domain == VTS_DOMAIN) + (vm->state).TT_PGCN_REG = pgcN; + + return 1; +} + +/* Figure out the correct pgN from the cell and update (vm->state). */ +static int set_PGN(vm_t *vm) { + int new_pgN = 0; + + while(new_pgN < (vm->state).pgc->nr_of_programs + && (vm->state).cellN >= (vm->state).pgc->program_map[new_pgN]) + new_pgN++; + + if(new_pgN == (vm->state).pgc->nr_of_programs) /* We are at the last program */ + if((vm->state).cellN > (vm->state).pgc->nr_of_cells) + return 0; /* We are past the last cell */ + + (vm->state).pgN = new_pgN; + + if((vm->state).domain == VTS_DOMAIN) { + playback_type_t *pb_ty; + if((vm->state).TTN_REG > vm->vmgi->tt_srpt->nr_of_srpts) + return 0; /* ?? */ + pb_ty = &vm->vmgi->tt_srpt->title[(vm->state).TTN_REG - 1].pb_ty; + if(pb_ty->multi_or_random_pgc_title == /* One_Sequential_PGC_Title */ 0) { + int dummy, part; + vm_get_current_title_part(vm, &dummy, &part); + (vm->state).PTTN_REG = part; + } else { + /* FIXME: Handle RANDOM or SHUFFLE titles. */ + fprintf(MSG_OUT, "libdvdnav: RANDOM or SHUFFLE titles are NOT handled yet.\n"); + } + } + return 1; +} + +/* Must be called before domain is changed (set_PGCN()) */ +static void set_RSMinfo(vm_t *vm, int cellN, int blockN) { + int i; + + if(cellN) { + (vm->state).rsm_cellN = cellN; + (vm->state).rsm_blockN = blockN; + } else { + (vm->state).rsm_cellN = (vm->state).cellN; + (vm->state).rsm_blockN = blockN; + } + (vm->state).rsm_vtsN = (vm->state).vtsN; + (vm->state).rsm_pgcN = get_PGCN(vm); + + /* assert((vm->state).rsm_pgcN == (vm->state).TT_PGCN_REG); for VTS_DOMAIN */ + + for(i = 0; i < 5; i++) { + (vm->state).rsm_regs[i] = (vm->state).registers.SPRM[4 + i]; + } +} + + +/* Get functions */ + +/* Searches the TT tables, to find the current TT. + * returns the current TT. + * returns 0 if not found. + */ +static int get_TT(vm_t *vm, int vtsN, int vts_ttn) { + int i; + int tt=0; + + for(i = 1; i <= vm->vmgi->tt_srpt->nr_of_srpts; i++) { + if( vm->vmgi->tt_srpt->title[i - 1].title_set_nr == vtsN && + vm->vmgi->tt_srpt->title[i - 1].vts_ttn == vts_ttn) { + tt=i; + break; + } + } + return tt; +} + +/* Search for entry_id match of the PGC Category in the current VTS PGCIT table. + * Return pgcN based on entry_id match. + */ +static int get_ID(vm_t *vm, int id) { + int pgcN, i; + pgcit_t *pgcit; + + /* Relies on state to get the correct pgcit. */ + pgcit = get_PGCIT(vm); + assert(pgcit != NULL); +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: ** Searching for menu (0x%x) entry PGC\n", id); +#endif + + /* Force high bit set. */ + id |=0x80; + + /* Get menu/title */ + for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { + if( (pgcit->pgci_srp[i].entry_id) == id) { + pgcN = i + 1; +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: Found menu.\n"); +#endif + return pgcN; + } + } +#ifdef TRACE + fprintf(MSG_OUT, "libdvdnav: ** No such id/menu (0x%02x) entry PGC\n", id & 0x7f); + for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { + if ( (pgcit->pgci_srp[i].entry_id & 0x80) == 0x80) { + fprintf(MSG_OUT, "libdvdnav: Available menus: 0x%x\n", + pgcit->pgci_srp[i].entry_id & 0x7f); + } + } +#endif + return 0; /* error */ +} + +/* FIXME: we have a pgcN member in the vm's state now, so this should be obsolete */ +static int get_PGCN(vm_t *vm) { + pgcit_t *pgcit; + int pgcN = 1; + + pgcit = get_PGCIT(vm); + + if (pgcit) { + while(pgcN <= pgcit->nr_of_pgci_srp) { + if(pgcit->pgci_srp[pgcN - 1].pgc == (vm->state).pgc) { + assert((vm->state).pgcN == pgcN); + return pgcN; + } + pgcN++; + } + } + fprintf(MSG_OUT, "libdvdnav: get_PGCN failed. Was trying to find pgcN in domain %d\n", + (vm->state).domain); + return 0; /* error */ +} + +static pgcit_t* get_MENU_PGCIT(vm_t *vm, ifo_handle_t *h, uint16_t lang) { + int i; + + if(h == NULL || h->pgci_ut == NULL) { + fprintf(MSG_OUT, "libdvdnav: *** pgci_ut handle is NULL ***\n"); + return NULL; /* error? */ + } + + i = 0; + while(i < h->pgci_ut->nr_of_lus + && h->pgci_ut->lu[i].lang_code != lang) + i++; + if(i == h->pgci_ut->nr_of_lus) { + fprintf(MSG_OUT, "libdvdnav: Language '%c%c' not found, using '%c%c' instead\n", + (char)(lang >> 8), (char)(lang & 0xff), + (char)(h->pgci_ut->lu[0].lang_code >> 8), + (char)(h->pgci_ut->lu[0].lang_code & 0xff)); + fprintf(MSG_OUT, "libdvdnav: Menu Languages available: "); + for(i = 0; i < h->pgci_ut->nr_of_lus; i++) { + fprintf(MSG_OUT, "%c%c ", + (char)(h->pgci_ut->lu[i].lang_code >> 8), + (char)(h->pgci_ut->lu[i].lang_code & 0xff)); + } + fprintf(MSG_OUT, "\n"); + i = 0; /* error? */ + } + + return h->pgci_ut->lu[i].pgcit; +} + +/* Uses state to decide what to return */ +static pgcit_t* get_PGCIT(vm_t *vm) { + pgcit_t *pgcit; + + switch ((vm->state).domain) { + case VTS_DOMAIN: + pgcit = vm->vtsi->vts_pgcit; + break; + case VTSM_DOMAIN: + pgcit = get_MENU_PGCIT(vm, vm->vtsi, (vm->state).registers.SPRM[0]); + break; + case VMGM_DOMAIN: + case FP_DOMAIN: + pgcit = get_MENU_PGCIT(vm, vm->vmgi, (vm->state).registers.SPRM[0]); + break; + default: + abort(); + } + + return pgcit; +} + + +/* Debug functions */ + +#ifdef TRACE +void vm_position_print(vm_t *vm, vm_position_t *position) { + fprintf(MSG_OUT, "libdvdnav: But=%x Spu=%x Aud=%x Ang=%x Hop=%x vts=%x dom=%x cell=%x cell_restart=%x cell_start=%x still=%x block=%x\n", + position->button, + position->spu_channel, + position->audio_channel, + position->angle_channel, + position->hop_channel, + position->vts, + position->domain, + position->cell, + position->cell_restart, + position->cell_start, + position->still, + position->block); +} +#endif + diff --git a/libdvdnav/vm.h b/libdvdnav/vm.h new file mode 100644 index 0000000..e853182 --- /dev/null +++ b/libdvdnav/vm.h @@ -0,0 +1,181 @@ +/* + * Copyright (C) 2000, 2001 H�an Hjort + * Copyright (C) 2001 Rich Wareham + * + * This file is part of libdvdnav, a DVD navigation library. It is modified + * from a file originally part of the Ogle DVD player. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: vm.h,v 1.11 2004/10/05 19:07:10 hadess Exp $ + * + */ + +#ifndef VM_H_INCLUDED +#define VM_H_INCLUDED + +#include "remap.h" +#include "dvdnav_internal.h" + +/* DOMAIN enum */ + +typedef enum { + FP_DOMAIN = 1, + VTS_DOMAIN = 2, + VMGM_DOMAIN = 4, + VTSM_DOMAIN = 8 +} domain_t; + +/** + * State: SPRM, GPRM, Domain, pgc, pgN, cellN, ? + */ +typedef struct { + registers_t registers; + + domain_t domain; + int vtsN; /* 0 is vmgm? */ + pgc_t *pgc; /* either this or 'int pgcN' is enough? */ + int pgcN; /* but provide pgcN for quick lookup */ + int pgN; /* is this needed? can allways fid pgN from cellN? */ + int cellN; + int32_t cell_restart; /* get cell to restart */ + int blockN; + + /* Resume info */ + int rsm_vtsN; + int rsm_blockN; /* of nav_packet */ + uint16_t rsm_regs[5]; /* system registers 4-8 */ + int rsm_pgcN; + int rsm_cellN; +} dvd_state_t; + +typedef struct vm_position_s { + int16_t button; /* Button highlighted */ + int32_t vts; /* vts number to use */ + domain_t domain; /* domain to use */ + int32_t spu_channel; /* spu channel to use */ + int32_t angle_channel; /* angle channel to use */ + int32_t audio_channel; /* audio channel to use */ + int32_t hop_channel; /* channel hopping. E.g menu button pressed */ +#if 0 + /* currently unused */ + int32_t title; /* title number */ + int32_t chapter; /* chapter number */ +#endif + int32_t cell; /* cell number */ + int32_t cell_restart; /* get cell to restart */ + int32_t cell_start; /* sector number of start of current cell in use */ + int32_t still; /* is cell still */ + int32_t block; /* block number within cell in use */ +} vm_position_t; + +typedef struct { + dvd_reader_t *dvd,*openedDvd; + ifo_handle_t *vmgi; + ifo_handle_t *vtsi; + dvd_state_t state; + int32_t hop_channel; + char dvd_name[50]; + remap_t *map; + int stopped; +} vm_t; + +/* magic number for seeking hops */ +#define HOP_SEEK 0x1000 + + +/* Audio stream number */ +#define AST_REG registers.SPRM[1] +/* Subpicture stream number */ +#define SPST_REG registers.SPRM[2] +/* Angle number */ +#define AGL_REG registers.SPRM[3] +/* Title Track Number */ +#define TTN_REG registers.SPRM[4] +/* VTS Title Track Number */ +#define VTS_TTN_REG registers.SPRM[5] +/* PGC Number for this Title Track */ +#define TT_PGCN_REG registers.SPRM[6] +/* Current Part of Title (PTT) number for (One_Sequential_PGC_Title) */ +#define PTTN_REG registers.SPRM[7] +/* Highlighted Button Number (btn nr 1 == value 1024) */ +#define HL_BTNN_REG registers.SPRM[8] +/* Parental Level */ +#define PTL_REG registers.SPRM[13] + +/* Initialisation & destruction */ +vm_t *vm_new_vm(void); +void vm_free_vm(vm_t *vm); + +/* IFO access */ +ifo_handle_t *vm_get_vmgi(vm_t *vm); +ifo_handle_t *vm_get_vtsi(vm_t *vm); + +/* Reader Access */ +dvd_reader_t *vm_get_dvd_reader(vm_t *vm); + +/* Basic Handling */ +int vm_start(vm_t *vm); +void vm_stop(vm_t *vm); +int vm_reset(vm_t *vm, const char *dvdroot); + +/* copying and merging - useful for try-running an operation */ +vm_t *vm_new_copy(vm_t *vm); +void vm_merge(vm_t *target, vm_t *source); +void vm_free_copy(vm_t *vm); + +/* regular playback */ +void vm_position_get(vm_t *vm, vm_position_t *position); +void vm_get_next_cell(vm_t *vm); + +/* Jumping - all these return 1, if a hop has been performed */ +int vm_jump_pg(vm_t *vm, int pg); +int vm_jump_cell_block(vm_t *vm, int cell, int block); +int vm_jump_title_part(vm_t *vm, int title, int part); +int vm_jump_top_pg(vm_t *vm); +int vm_jump_next_pg(vm_t *vm); +int vm_jump_prev_pg(vm_t *vm); +int vm_jump_up(vm_t *vm); +int vm_jump_menu(vm_t *vm, DVDMenuID_t menuid); +int vm_jump_resume(vm_t *vm); +int vm_exec_cmd(vm_t *vm, vm_cmd_t *cmd); + +/* getting information */ +int vm_get_current_menu(vm_t *vm, int *menuid); +int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result); +int vm_get_audio_stream(vm_t *vm, int audioN); +int vm_get_subp_stream(vm_t *vm, int subpN, int mode); +int vm_get_audio_active_stream(vm_t *vm); +int vm_get_subp_active_stream(vm_t *vm, int mode); +void vm_get_angle_info(vm_t *vm, int *current, int *num_avail); +#if 0 +/* currently unused */ +void vm_get_audio_info(vm_t *vm, int *current, int *num_avail); +void vm_get_subp_info(vm_t *vm, int *current, int *num_avail); +void vm_get_video_res(vm_t *vm, int *width, int *height); +#endif +int vm_get_video_aspect(vm_t *vm); +int vm_get_video_scale_permission(vm_t *vm); +video_attr_t vm_get_video_attr(vm_t *vm); +audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN); +subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN); + +#ifdef TRACE +/* Debug */ +void vm_position_print(vm_t *vm, vm_position_t *position); +#endif + + +#endif /* VM_HV_INCLUDED */ diff --git a/libdvdnav/vmcmd.c b/libdvdnav/vmcmd.c new file mode 100644 index 0000000..76f0a4b --- /dev/null +++ b/libdvdnav/vmcmd.c @@ -0,0 +1,539 @@ +/* + * Copyright (C) 2000, 2001 Martin Norb�k, H�an Hjort + * 2002-2004 the dvdnav project + * + * This file is part of libdvdnav, a DVD navigation library. It is modified + * from a file originally part of the Ogle DVD player. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: vmcmd.c,v 1.6 2004/03/16 11:43:38 mroi Exp $ + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include "dvdnav_internal.h" + +/* freebsd compatibility */ +#ifndef PRIu8 +#define PRIu8 "d" +#endif + +/* freebsd compatibility */ +#ifndef PRIu16 +#define PRIu16 "d" +#endif + +static const char *cmp_op_table[] = { + NULL, "&", "==", "!=", ">=", ">", "<=", "<" +}; +static const char *set_op_table[] = { + NULL, "=", "<->", "+=", "-=", "*=", "/=", "%=", "rnd", "&=", "|=", "^=" +}; + +static const char *link_table[] = { + "LinkNoLink", "LinkTopC", "LinkNextC", "LinkPrevC", + NULL, "LinkTopPG", "LinkNextPG", "LinkPrevPG", + NULL, "LinkTopPGC", "LinkNextPGC", "LinkPrevPGC", + "LinkGoUpPGC", "LinkTailPGC", NULL, NULL, + "RSM" +}; + +static const char *system_reg_table[] = { + "Menu Description Language Code", + "Audio Stream Number", + "Sub-picture Stream Number", + "Angle Number", + "Title Track Number", + "VTS Title Track Number", + "VTS PGC Number", + "PTT Number for One_Sequential_PGC_Title", + "Highlighted Button Number", + "Navigation Timer", + "Title PGC Number for Navigation Timer", + "Audio Mixing Mode for Karaoke", + "Country Code for Parental Management", + "Parental Level", + "Player Configurations for Video", + "Player Configurations for Audio", + "Initial Language Code for Audio", + "Initial Language Code Extension for Audio", + "Initial Language Code for Sub-picture", + "Initial Language Code Extension for Sub-picture", + "Player Regional Code", + "Reserved 21", + "Reserved 22", + "Reserved 23" +}; + +static const char *system_reg_abbr_table[] = { + NULL, + "ASTN", + "SPSTN", + "AGLN", + "TTN", + "VTS_TTN", + "TT_PGCN", + "PTTN", + "HL_BTNN", + "NVTMR", + "NV_PGCN", + NULL, + "CC_PLT", + "PLT", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, +}; + +static void print_system_reg(uint16_t reg) { + if(reg < sizeof(system_reg_abbr_table) / sizeof(char *)) + fprintf(MSG_OUT, "%s (SRPM:%d)", system_reg_table[reg], reg); + else + fprintf(MSG_OUT, " WARNING: Unknown system register ( reg=%d ) ", reg); +} + +static void print_g_reg(uint8_t reg) { + if(reg < 16) + fprintf(MSG_OUT, "g[%" PRIu8 "]", reg); + else + fprintf(MSG_OUT, " WARNING: Unknown general register "); +} + +static void print_reg(uint8_t reg) { + if(reg & 0x80) + print_system_reg(reg & 0x7f); + else + print_g_reg(reg & 0x7f); +} + +static void print_cmp_op(uint8_t op) { + if(op < sizeof(cmp_op_table) / sizeof(char *) && cmp_op_table[op] != NULL) + fprintf(MSG_OUT, " %s ", cmp_op_table[op]); + else + fprintf(MSG_OUT, " WARNING: Unknown compare op "); +} + +static void print_set_op(uint8_t op) { + if(op < sizeof(set_op_table) / sizeof(char *) && set_op_table[op] != NULL) + fprintf(MSG_OUT, " %s ", set_op_table[op]); + else + fprintf(MSG_OUT, " WARNING: Unknown set op "); +} + +static void print_reg_or_data(command_t* command, int immediate, int start) { + if(immediate) { + uint32_t i = vm_getbits(command, start, 16); + + fprintf(MSG_OUT, "0x%x", i); + if(isprint(i & 0xff) && isprint((i>>8) & 0xff)) + fprintf(MSG_OUT, " (\"%c%c\")", (char)((i>>8) & 0xff), (char)(i & 0xff)); + } else { + print_reg(vm_getbits(command, start - 8, 8)); + } +} + +static void print_reg_or_data_2(command_t* command, int immediate, int start) { + if(immediate) + fprintf(MSG_OUT, "0x%x", vm_getbits(command, start - 1, 7)); + else + fprintf(MSG_OUT, "g[%" PRIu8 "]", vm_getbits(command, start - 4, 4)); +} + +static void print_reg_or_data_3(command_t* command, int immediate, int start) { + if(immediate) { + uint32_t i = vm_getbits(command, start, 16); + + fprintf(MSG_OUT, "0x%x", i); + if(isprint(i & 0xff) && isprint((i>>8) & 0xff)) + fprintf(MSG_OUT, " (\"%c%c\")", (char)((i>>8) & 0xff), (char)(i & 0xff)); + } else { + print_reg(vm_getbits(command, start, 8)); + } +} + + +static void print_if_version_1(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + + if(op) { + fprintf(MSG_OUT, "if ("); + print_g_reg(vm_getbits(command,39,8)); + print_cmp_op(op); + print_reg_or_data(command, vm_getbits(command, 55,1), 31); + fprintf(MSG_OUT, ") "); + } +} + +static void print_if_version_2(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + + if(op) { + fprintf(MSG_OUT, "if ("); + print_reg(vm_getbits(command, 15, 8)); + print_cmp_op(op); + print_reg(vm_getbits(command, 7, 8)); + fprintf(MSG_OUT, ") "); + } +} + +static void print_if_version_3(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + + if(op) { + fprintf(MSG_OUT, "if ("); + print_g_reg(vm_getbits(command, 43, 4)); + print_cmp_op(op); + print_reg_or_data(command, vm_getbits(command, 55, 1), 15); + fprintf(MSG_OUT, ") "); + } +} + +static void print_if_version_4(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + + if(op) { + fprintf(MSG_OUT, "if ("); + print_g_reg(vm_getbits(command, 51, 4)); + print_cmp_op(op); + print_reg_or_data(command, vm_getbits(command, 55, 1), 31); + fprintf(MSG_OUT, ") "); + } +} + +static void print_if_version_5(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + int set_immediate = vm_getbits(command, 60, 1); + + if(op) { + if (set_immediate) { + fprintf(MSG_OUT, "if ("); + print_g_reg(vm_getbits(command, 31, 8)); + print_cmp_op(op); + print_reg(vm_getbits(command, 23, 8)); + fprintf(MSG_OUT, ") "); + } else { + fprintf(MSG_OUT, "if ("); + print_g_reg(vm_getbits(command, 39, 8)); + print_cmp_op(op); + print_reg_or_data(command, vm_getbits(command, 55, 1), 31); + fprintf(MSG_OUT, ") "); + } + } +} + +static void print_special_instruction(command_t* command) { + uint8_t op = vm_getbits(command, 51, 4); + + switch(op) { + case 0: /* NOP */ + fprintf(MSG_OUT, "Nop"); + break; + case 1: /* Goto line */ + fprintf(MSG_OUT, "Goto %" PRIu8, vm_getbits(command, 7, 8)); + break; + case 2: /* Break */ + fprintf(MSG_OUT, "Break"); + break; + case 3: /* Parental level */ + fprintf(MSG_OUT, "SetTmpPML %" PRIu8 ", Goto %" PRIu8, + vm_getbits(command, 11, 4), vm_getbits(command, 7, 8)); + break; + default: + fprintf(MSG_OUT, "WARNING: Unknown special instruction (%i)", + vm_getbits(command, 51, 4)); + } +} + +static void print_linksub_instruction(command_t* command) { + uint32_t linkop = vm_getbits(command, 7, 8); + uint32_t button = vm_getbits(command, 15, 6); + + if(linkop < sizeof(link_table)/sizeof(char *) && link_table[linkop] != NULL) + fprintf(MSG_OUT, "%s (button %" PRIu8 ")", link_table[linkop], button); + else + fprintf(MSG_OUT, "WARNING: Unknown linksub instruction (%i)", linkop); +} + +static void print_link_instruction(command_t* command, int optional) { + uint8_t op = vm_getbits(command, 51, 4); + + if(optional && op) + fprintf(MSG_OUT, ", "); + + switch(op) { + case 0: + if(!optional) + fprintf(MSG_OUT, "WARNING: NOP (link)!"); + break; + case 1: + print_linksub_instruction(command); + break; + case 4: + fprintf(MSG_OUT, "LinkPGCN %" PRIu16, vm_getbits(command, 14, 15)); + break; + case 5: + fprintf(MSG_OUT, "LinkPTT %" PRIu16 " (button %" PRIu8 ")", + vm_getbits(command, 9, 10), vm_getbits(command, 15, 6)); + break; + case 6: + fprintf(MSG_OUT, "LinkPGN %" PRIu8 " (button %" PRIu8 ")", + vm_getbits(command, 6, 7), vm_getbits(command, 15, 6)); + break; + case 7: + fprintf(MSG_OUT, "LinkCN %" PRIu8 " (button %" PRIu8 ")", + vm_getbits(command, 7, 8), vm_getbits(command, 15, 6)); + break; + default: + fprintf(MSG_OUT, "WARNING: Unknown link instruction"); + } +} + +static void print_jump_instruction(command_t* command) { + switch(vm_getbits(command, 51, 4)) { + case 1: + fprintf(MSG_OUT, "Exit"); + break; + case 2: + fprintf(MSG_OUT, "JumpTT %" PRIu8, vm_getbits(command, 22, 7)); + break; + case 3: + fprintf(MSG_OUT, "JumpVTS_TT %" PRIu8, vm_getbits(command, 22, 7)); + break; + case 5: + fprintf(MSG_OUT, "JumpVTS_PTT %" PRIu8 ":%" PRIu16, + vm_getbits(command, 22, 7), vm_getbits(command, 41, 10)); + break; + case 6: + switch(vm_getbits(command, 23, 2)) { + case 0: + fprintf(MSG_OUT, "JumpSS FP"); + break; + case 1: + fprintf(MSG_OUT, "JumpSS VMGM (menu %" PRIu8 ")", vm_getbits(command, 19, 4)); + break; + case 2: + fprintf(MSG_OUT, "JumpSS VTSM (vts %" PRIu8 ", title %" PRIu8 + ", menu %" PRIu8 ")", vm_getbits(command, 30, 7), vm_getbits(command, 38, 7), vm_getbits(command, 19, 4)); + break; + case 3: + fprintf(MSG_OUT, "JumpSS VMGM (pgc %" PRIu8 ")", vm_getbits(command, 46, 15)); + break; + } + break; + case 8: + switch(vm_getbits(command, 23, 2)) { + case 0: + fprintf(MSG_OUT, "CallSS FP (rsm_cell %" PRIu8 ")", + vm_getbits(command, 31, 8)); + break; + case 1: + fprintf(MSG_OUT, "CallSS VMGM (menu %" PRIu8 + ", rsm_cell %" PRIu8 ")", vm_getbits(command, 19, 4), vm_getbits(command, 31, 8)); + break; + case 2: + fprintf(MSG_OUT, "CallSS VTSM (menu %" PRIu8 + ", rsm_cell %" PRIu8 ")", vm_getbits(command, 19, 4), vm_getbits(command, 31, 8)); + break; + case 3: + fprintf(MSG_OUT, "CallSS VMGM (pgc %" PRIu8 ", rsm_cell %" PRIu8 ")", + vm_getbits(command, 46, 15), vm_getbits(command, 31, 8)); + break; + } + break; + default: + fprintf(MSG_OUT, "WARNING: Unknown Jump/Call instruction"); + } +} + +static void print_system_set(command_t* command) { + int i; +/* FIXME: What about SPRM11 ? Karaoke */ +/* Surely there must be some system set command for that ? */ + + switch(vm_getbits(command, 59, 4)) { + case 1: /* Set system reg 1 &| 2 &| 3 (Audio, Subp. Angle) */ + for(i = 1; i <= 3; i++) { + if(vm_getbits(command, 47 - (i*8), 1)) { + print_system_reg(i); + fprintf(MSG_OUT, " = "); + print_reg_or_data_2(command, vm_getbits(command, 60, 1), 47 - (i*8) ); + fprintf(MSG_OUT, " "); + } + } + break; + case 2: /* Set system reg 9 & 10 (Navigation timer, Title PGC number) */ + print_system_reg(9); + fprintf(MSG_OUT, " = "); + print_reg_or_data(command, vm_getbits(command, 60, 1), 47); + fprintf(MSG_OUT, " "); + print_system_reg(10); + fprintf(MSG_OUT, " = %" PRIu16, vm_getbits(command, 30, 15)); /* ?? */ + break; + case 3: /* Mode: Counter / Register + Set */ + fprintf(MSG_OUT, "SetMode "); + if(vm_getbits(command, 23, 1)) + fprintf(MSG_OUT, "Counter "); + else + fprintf(MSG_OUT, "Register "); + print_g_reg(vm_getbits(command, 19, 4)); + print_set_op(0x1); /* '=' */ + print_reg_or_data(command, vm_getbits(command, 60, 1), 47); + break; + case 6: /* Set system reg 8 (Highlighted button) */ + print_system_reg(8); + if(vm_getbits(command, 60, 1)) /* immediate */ + fprintf(MSG_OUT, " = 0x%x (button no %d)", vm_getbits(command, 31, 16), vm_getbits(command, 31, 6)); + else + fprintf(MSG_OUT, " = g[%" PRIu8 "]", vm_getbits(command, 19, 4)); + break; + default: + fprintf(MSG_OUT, "WARNING: Unknown system set instruction (%i)", + vm_getbits(command, 59, 4)); + } +} + +static void print_set_version_1(command_t* command) { + uint8_t set_op = vm_getbits(command, 59, 4); + + if(set_op) { + print_g_reg(vm_getbits(command, 35, 4)); + print_set_op(set_op); + print_reg_or_data(command, vm_getbits(command, 60, 1), 31); + } else { + fprintf(MSG_OUT, "NOP"); + } +} + +static void print_set_version_2(command_t* command) { + uint8_t set_op = vm_getbits(command, 59, 4); + + if(set_op) { + print_g_reg(vm_getbits(command, 51, 4)); + print_set_op(set_op); + print_reg_or_data(command, vm_getbits(command, 60, 1), 47); + } else { + fprintf(MSG_OUT, "NOP"); + } +} + +static void print_set_version_3(command_t* command) { + uint8_t set_op = vm_getbits(command, 59, 4); + + if(set_op) { + print_g_reg(vm_getbits(command, 51, 4)); + print_set_op(set_op); + print_reg_or_data_3(command, vm_getbits(command, 60, 1), 47); + } else { + fprintf(MSG_OUT, "NOP"); + } +} + + +void vm_print_mnemonic(vm_cmd_t *vm_command) { + command_t command; + command.instruction =( (uint64_t) vm_command->bytes[0] << 56 ) | + ( (uint64_t) vm_command->bytes[1] << 48 ) | + ( (uint64_t) vm_command->bytes[2] << 40 ) | + ( (uint64_t) vm_command->bytes[3] << 32 ) | + ( (uint64_t) vm_command->bytes[4] << 24 ) | + ( (uint64_t) vm_command->bytes[5] << 16 ) | + ( (uint64_t) vm_command->bytes[6] << 8 ) | + (uint64_t) vm_command->bytes[7] ; + command.examined = 0; + + switch(vm_getbits(&command,63,3)) { /* three first bits */ + case 0: /* Special instructions */ + print_if_version_1(&command); + print_special_instruction(&command); + break; + case 1: /* Jump/Call or Link instructions */ + if(vm_getbits(&command,60,1)) { + print_if_version_2(&command); + print_jump_instruction(&command); + } else { + print_if_version_1(&command); + print_link_instruction(&command, 0); /* must be pressent */ + } + break; + case 2: /* Set System Parameters instructions */ + print_if_version_2(&command); + print_system_set(&command); + print_link_instruction(&command, 1); /* either 'if' or 'link' */ + break; + case 3: /* Set General Parameters instructions */ + print_if_version_3(&command); + print_set_version_1(&command); + print_link_instruction(&command, 1); /* either 'if' or 'link' */ + break; + case 4: /* Set, Compare -> LinkSub instructions */ + print_set_version_2(&command); + fprintf(MSG_OUT, ", "); + print_if_version_4(&command); + print_linksub_instruction(&command); + break; + case 5: /* Compare -> (Set and LinkSub) instructions */ + print_if_version_5(&command); + fprintf(MSG_OUT, "{ "); + print_set_version_3(&command); + fprintf(MSG_OUT, ", "); + print_linksub_instruction(&command); + fprintf(MSG_OUT, " }"); + break; + case 6: /* Compare -> Set, always LinkSub instructions */ + print_if_version_5(&command); + fprintf(MSG_OUT, "{ "); + print_set_version_3(&command); + fprintf(MSG_OUT, " } "); + print_linksub_instruction(&command); + break; + default: + fprintf(MSG_OUT, "WARNING: Unknown instruction type (%i)", vm_getbits(&command, 63, 3)); + } + /* Check if there still are bits set that were not examined */ + + if(command.instruction & ~ command.examined) { + fprintf(MSG_OUT, " libdvdnav: vmcmd.c: [WARNING, unknown bits:"); + fprintf(MSG_OUT, " %08llx", (command.instruction & ~ command.examined) ); + fprintf(MSG_OUT, "]"); + } +} + +void vm_print_cmd(int row, vm_cmd_t *vm_command) { + int i; + + fprintf(MSG_OUT, "(%03d) ", row + 1); + for(i = 0; i < 8; i++) + fprintf(MSG_OUT, "%02x ", vm_command->bytes[i]); + fprintf(MSG_OUT, "| "); + + vm_print_mnemonic(vm_command); + fprintf(MSG_OUT, "\n"); +} + diff --git a/libdvdnav/vmcmd.h b/libdvdnav/vmcmd.h new file mode 100644 index 0000000..2e823f9 --- /dev/null +++ b/libdvdnav/vmcmd.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2000, 2001 Martin Norb�k, H�an Hjort + * + * This file is part of libdvdnav, a DVD navigation library. It is modified + * from a file originally part of the Ogle DVD player. + * + * libdvdnav 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. + * + * libdvdnav is distributed in the hope that 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 + * + * $Id: vmcmd.h,v 1.7 2003/05/11 13:44:05 jcdutton Exp $ + * + */ + +#ifndef VMCMD_H_INCLUDED +#define VMCMD_H_INCLUDED + +#include "common.h" + +void vm_print_mnemonic(vm_cmd_t *command); +void vm_print_cmd(int row, vm_cmd_t *command); + +#endif /* VMCMD_H_INCLUDED */ diff --git a/libk9copy/Makefile.am b/libk9copy/Makefile.am new file mode 100644 index 0000000..bf76bbc --- /dev/null +++ b/libk9copy/Makefile.am @@ -0,0 +1,29 @@ +AM_CPPFLAGS= -I$(srcdir) $(all_includes) + +KDE_CXXFLAGS = $(ENABLE_PERMISSIVE_FLAG) + +METASOURCES = AUTO + +noinst_LTLIBRARIES = libk9copy.la + + +libk9copy_la_SOURCES = backupdlg.ui dvdprogress.ui k9audiocodecs.cpp \ + k9backupdlg.cpp k9burndvd.cpp k9cell.cpp k9cellcopylist.cpp k9config.cpp \ + k9drawimage.cpp k9dvd.cpp k9dvdauthor.cpp k9dvdbackup.cpp k9dvdchapter.cpp \ + k9dvdprogress.cpp k9dvdread.cpp k9dvdsize.cpp k9dvdtitle.cpp k9dvdtitleset.cpp k9ifo2.cpp \ + k9mp4dlg.cpp k9mp4enc.cpp k9process.cpp k9processlist.cpp k9progress.cpp \ + k9saveimage.cpp k9script.cpp k9titleencopt.cpp k9tools.cpp k9videocodecs.cpp mp4dlg.ui \ + processList.ui progress.ui + +include_HEADERS = + +noinst_HEADERS = bswap.h k9audiocodecs.h k9backupdlg.h k9burndvd.h k9cell.h \ + k9cellcopylist.h k9common.h k9config.h k9drawimage.h k9dvd.h k9dvdauthor.h k9dvdbackup.h \ + k9dvdchapter.h k9dvdprogress.h k9dvdread.h k9dvdsize.h k9dvdtitle.h k9dvdtitleset.h \ + k9ifo2.h k9mp4dlg.h k9mp4enc.h k9process.h k9processlist.h k9progress.h \ + k9saveimage.h k9script.h k9titleencopt.h k9tools.h k9videocodecs.h + + +INCLUDES = -I$(top_srcdir)/dvdread -I$(top_srcdir)/k9decmpeg \ + -I$(top_srcdir)/k9vamps -I$(top_srcdir)/libdvdnav +libk9copy_la_LDFLAGS = $(all_libraries) diff --git a/libk9copy/backupdlg.cpp b/libk9copy/backupdlg.cpp new file mode 100644 index 0000000..a124c9f --- /dev/null +++ b/libk9copy/backupdlg.cpp @@ -0,0 +1,174 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './backupdlg.ui' +** +** Created: dim. oct. 26 08:55:58 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "backupdlg.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kpushbutton.h" + +/* + * Constructs a backupDlg as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ +backupDlg::backupDlg( QWidget* parent, const char* name, bool modal, WFlags fl ) + : QDialog( parent, name, modal, fl ) +{ + if ( !name ) + setName( "backupDlg" ); + setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) ); + setMinimumSize( QSize( 0, 0 ) ); + setMaximumSize( QSize( 9999, 9999 ) ); + setBaseSize( QSize( 500, 230 ) ); + setCursor( QCursor( 3 ) ); + setModal( TRUE ); + backupDlgLayout = new QGridLayout( this, 1, 1, 3, 8, "backupDlgLayout"); + + textLabel1 = new QLabel( this, "textLabel1" ); + textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) ); + textLabel1->setCursor( QCursor( 3 ) ); + textLabel1->setFrameShape( QLabel::NoFrame ); + textLabel1->setFrameShadow( QLabel::Raised ); + + backupDlgLayout->addMultiCellWidget( textLabel1, 0, 0, 0, 3 ); + + layout3 = new QVBoxLayout( 0, 0, 6, "layout3"); + + lblStep = new QLabel( this, "lblStep" ); + lblStep->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, lblStep->sizePolicy().hasHeightForWidth() ) ); + QFont lblStep_font( lblStep->font() ); + lblStep_font.setItalic( TRUE ); + lblStep->setFont( lblStep_font ); + lblStep->setCursor( QCursor( 3 ) ); + layout3->addWidget( lblStep ); + + pbStep = new QProgressBar( this, "pbStep" ); + pbStep->setCursor( QCursor( 3 ) ); + layout3->addWidget( pbStep ); + + pbTotal = new QProgressBar( this, "pbTotal" ); + pbTotal->setCursor( QCursor( 3 ) ); + pbTotal->setMargin( 0 ); + pbTotal->setTotalSteps( 4400 ); + pbTotal->setPercentageVisible( TRUE ); + layout3->addWidget( pbTotal ); + + backupDlgLayout->addMultiCellLayout( layout3, 3, 3, 0, 3 ); + + textLabel1_2 = new QLabel( this, "textLabel1_2" ); + textLabel1_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) ); + textLabel1_2->setCursor( QCursor( 3 ) ); + + backupDlgLayout->addWidget( textLabel1_2, 2, 0 ); + + lblTime = new QLabel( this, "lblTime" ); + lblTime->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, lblTime->sizePolicy().hasHeightForWidth() ) ); + lblTime->setCursor( QCursor( 3 ) ); + + backupDlgLayout->addWidget( lblTime, 2, 1 ); + + layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); + spacer1 = new QSpacerItem( 131, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout1->addItem( spacer1 ); + + bAbort = new KPushButton( this, "bAbort" ); + bAbort->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bAbort->sizePolicy().hasHeightForWidth() ) ); + bAbort->setCursor( QCursor( 0 ) ); + bAbort->setProperty( "stdItem", 26 ); + layout1->addWidget( bAbort ); + + backupDlgLayout->addMultiCellLayout( layout1, 4, 4, 0, 3 ); + + lblFactor = new QLabel( this, "lblFactor" ); + lblFactor->setCursor( QCursor( 3 ) ); + + backupDlgLayout->addWidget( lblFactor, 2, 3 ); + + frame3 = new QFrame( this, "frame3" ); + frame3->setCursor( QCursor( 3 ) ); + frame3->setFrameShape( QFrame::StyledPanel ); + frame3->setFrameShadow( QFrame::Raised ); + frame3->setMargin( 1 ); + frame3Layout = new QGridLayout( frame3, 1, 1, 2, 6, "frame3Layout"); + + bPlay = new KPushButton( frame3, "bPlay" ); + bPlay->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, bPlay->sizePolicy().hasHeightForWidth() ) ); + bPlay->setMinimumSize( QSize( 25, 25 ) ); + bPlay->setMaximumSize( QSize( 25, 25 ) ); + bPlay->setCursor( QCursor( 0 ) ); + bPlay->setToggleButton( TRUE ); + bPlay->setOn( TRUE ); + bPlay->setFlat( FALSE ); + + frame3Layout->addWidget( bPlay, 1, 1 ); + spacer4 = new QSpacerItem( 476, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + frame3Layout->addItem( spacer4, 1, 0 ); + + image = new QLabel( frame3, "image" ); + image->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, image->sizePolicy().hasHeightForWidth() ) ); + image->setPaletteBackgroundColor( QColor( 0, 0, 0 ) ); + image->setCursor( QCursor( 3 ) ); + image->setScaledContents( TRUE ); + + frame3Layout->addMultiCellWidget( image, 0, 0, 0, 1 ); + + backupDlgLayout->addMultiCellWidget( frame3, 1, 1, 0, 3 ); + spacer3 = new QSpacerItem( 380, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + backupDlgLayout->addItem( spacer3, 2, 2 ); + languageChange(); + resize( QSize(385, 425).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bAbort, SIGNAL( clicked() ), this, SLOT( bAbortClick() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +backupDlg::~backupDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void backupDlg::languageChange() +{ + setCaption( tr2i18n( "k9Copy - Backup progression" ) ); + textLabel1->setText( tr2i18n( "

DVD Backup

" ) ); + lblStep->setText( tr2i18n( "Current step" ) ); + textLabel1_2->setText( tr2i18n( "Elapsed Time" ) ); + lblTime->setText( tr2i18n( "--:--:--" ) ); + bPlay->setText( QString::null ); +} + +void backupDlg::bAbortClick() +{ + qWarning( "backupDlg::bAbortClick(): Not implemented yet" ); +} + +void backupDlg::bPlayToggled(bool) +{ + qWarning( "backupDlg::bPlayToggled(bool): Not implemented yet" ); +} + +#include "backupdlg.moc" diff --git a/libk9copy/backupdlg.ui b/libk9copy/backupdlg.ui new file mode 100644 index 0000000..1aad864 --- /dev/null +++ b/libk9copy/backupdlg.ui @@ -0,0 +1,383 @@ + +backupDlg + + + backupDlg + + + + 0 + 0 + 385 + 425 + + + + + 5 + 5 + 0 + 0 + + + + + 0 + 0 + + + + + 9999 + 9999 + + + + + 500 + 230 + + + + 3 + + + k9Copy - Backup progression + + + true + + + + unnamed + + + 3 + + + 8 + + + + textLabel1 + + + + 5 + 0 + 0 + 0 + + + + 3 + + + NoFrame + + + Raised + + + <p align="left"><b>DVD Backup</b></p> + + + + + layout3 + + + + unnamed + + + + lblStep + + + + 5 + 0 + 0 + 0 + + + + + 1 + + + + 3 + + + Current step + + + + + pbStep + + + 3 + + + + + pbTotal + + + 3 + + + 0 + + + 4400 + + + true + + + + + + + textLabel1_2 + + + + 5 + 0 + 0 + 0 + + + + 3 + + + Elapsed Time + + + + + lblTime + + + + 0 + 5 + 0 + 0 + + + + 3 + + + --:--:-- + + + + + layout1 + + + 3 + + + + unnamed + + + + spacer1 + + + Horizontal + + + Expanding + + + + 131 + 20 + + + + + + bAbort + + + + 0 + 0 + 0 + 0 + + + + 0 + + + 26 + + + + + + + lblFactor + + + 3 + + + + + frame3 + + + 3 + + + StyledPanel + + + Raised + + + 1 + + + + unnamed + + + 2 + + + + bPlay + + + + 5 + 5 + 0 + 0 + + + + + 25 + 25 + + + + + 25 + 25 + + + + 0 + + + + + + true + + + true + + + false + + + + + spacer4 + + + Horizontal + + + Expanding + + + + 476 + 20 + + + + + + image + + + + 5 + 5 + 0 + 0 + + + + + 0 + 0 + 0 + + + + 3 + + + true + + + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 380 + 20 + + + + + + + + bAbort + clicked() + backupDlg + bAbortClick() + + + + bAbortClick() + bPlayToggled(bool state) + + + + kpushbutton.h + kpushbutton.h + + diff --git a/libk9copy/bswap.h b/libk9copy/bswap.h new file mode 100755 index 0000000..64751ff --- /dev/null +++ b/libk9copy/bswap.h @@ -0,0 +1,98 @@ +#ifndef BSWAP_H_INCLUDED +#define BSWAP_H_INCLUDED + +/* + * Copyright (C) 2000, 2001 Billy Biggs , + * Håkan Hjort + * + * 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 + */ + +#include + +#if defined(WORDS_BIGENDIAN) +/* All bigendian systems are fine, just ignore the swaps. */ +#define B2N_16(x) (void)(x) +#define B2N_32(x) (void)(x) +#define B2N_64(x) (void)(x) + +#else + +/* For __FreeBSD_version */ +#if defined(HAVE_SYS_PARAM_H) +#include +#endif + +#if defined(__linux__) +#include +#define B2N_16(x) x = bswap_16(x) +#define B2N_32(x) x = bswap_32(x) +#define B2N_64(x) x = bswap_64(x) + +#elif defined(__NetBSD__) +#include +#define B2N_16(x) BE16TOH(x) +#define B2N_32(x) BE32TOH(x) +#define B2N_64(x) BE64TOH(x) + +#elif defined(__OpenBSD__) +#include +#define B2N_16(x) x = swap16(x) +#define B2N_32(x) x = swap32(x) +#define B2N_64(x) x = swap64(x) + +#elif defined(__FreeBSD__) && __FreeBSD_version >= 470000 +#include +#define B2N_16(x) x = be16toh(x) +#define B2N_32(x) x = be32toh(x) +#define B2N_64(x) x = be64toh(x) + +/* This is a slow but portable implementation, it has multiple evaluation + * problems so beware. + * Old FreeBSD's and Solaris don't have or any other such + * functionality! + */ + +#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) +#define B2N_16(x) \ + x = ((((x) & 0xff00) >> 8) | \ + (((x) & 0x00ff) << 8)) +#define B2N_32(x) \ + x = ((((x) & 0xff000000) >> 24) | \ + (((x) & 0x00ff0000) >> 8) | \ + (((x) & 0x0000ff00) << 8) | \ + (((x) & 0x000000ff) << 24)) +#define B2N_64(x) \ + x = ((((x) & 0xff00000000000000) >> 56) | \ + (((x) & 0x00ff000000000000) >> 40) | \ + (((x) & 0x0000ff0000000000) >> 24) | \ + (((x) & 0x000000ff00000000) >> 8) | \ + (((x) & 0x00000000ff000000) << 8) | \ + (((x) & 0x0000000000ff0000) << 24) | \ + (((x) & 0x000000000000ff00) << 40) | \ + (((x) & 0x00000000000000ff) << 56)) + +#else + +/* If there isn't a header provided with your system with this functionality + * add the relevant || define( ) to the portable implementation above. + */ +#error "You need to add endian swap macros for you're system" + +#endif + +#endif /* WORDS_BIGENDIAN */ + +#endif /* BSWAP_H_INCLUDED */ diff --git a/libk9copy/dvdprogress.cpp b/libk9copy/dvdprogress.cpp new file mode 100644 index 0000000..273e551 --- /dev/null +++ b/libk9copy/dvdprogress.cpp @@ -0,0 +1,97 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './dvdprogress.ui' +** +** Created: dim. oct. 26 08:55:59 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "dvdprogress.h" + +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a DVDProgress as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ +DVDProgress::DVDProgress( QWidget* parent, const char* name, bool modal, WFlags fl ) + : QDialog( parent, name, modal, fl ) +{ + if ( !name ) + setName( "DVDProgress" ); + setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) ); + setMinimumSize( QSize( 0, 150 ) ); + setMaximumSize( QSize( 400, 150 ) ); + setCursor( QCursor( 3 ) ); + DVDProgressLayout = new QGridLayout( this, 1, 1, 11, 6, "DVDProgressLayout"); + + layout2 = new QVBoxLayout( 0, 0, 6, "layout2"); + + lblTotal = new QLabel( this, "lblTotal" ); + lblTotal->setCursor( QCursor( 3 ) ); + layout2->addWidget( lblTotal ); + + pbTotal = new QProgressBar( this, "pbTotal" ); + pbTotal->setCursor( QCursor( 3 ) ); + pbTotal->setProgress( 100 ); + pbTotal->setPercentageVisible( FALSE ); + layout2->addWidget( pbTotal ); + + DVDProgressLayout->addLayout( layout2, 1, 0 ); + + layout1 = new QVBoxLayout( 0, 0, 6, "layout1"); + + lblTitle = new QLabel( this, "lblTitle" ); + lblTitle->setCursor( QCursor( 3 ) ); + layout1->addWidget( lblTitle ); + + pbTitle = new QProgressBar( this, "pbTitle" ); + pbTitle->setCursor( QCursor( 3 ) ); + pbTitle->setTotalSteps( 100 ); + pbTitle->setProgress( 100 ); + pbTitle->setCenterIndicator( TRUE ); + pbTitle->setPercentageVisible( FALSE ); + layout1->addWidget( pbTitle ); + + DVDProgressLayout->addLayout( layout1, 0, 0 ); + + lblStatus = new QLabel( this, "lblStatus" ); + lblStatus->setCursor( QCursor( 3 ) ); + + DVDProgressLayout->addWidget( lblStatus, 2, 0 ); + languageChange(); + resize( QSize(278, 150).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); +} + +/* + * Destroys the object and frees any allocated resources + */ +DVDProgress::~DVDProgress() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void DVDProgress::languageChange() +{ + setCaption( tr2i18n( "k9Copy - DVD Analyze" ) ); + lblTotal->setText( QString::null ); + lblTitle->setText( QString::null ); + lblStatus->setText( QString::null ); +} + +#include "dvdprogress.moc" diff --git a/libk9copy/dvdprogress.ui b/libk9copy/dvdprogress.ui new file mode 100755 index 0000000..dabdac2 --- /dev/null +++ b/libk9copy/dvdprogress.ui @@ -0,0 +1,141 @@ + +DVDProgress + + + DVDProgress + + + + 0 + 0 + 278 + 150 + + + + + 5 + 5 + 0 + 0 + + + + + 0 + 150 + + + + + 400 + 150 + + + + 3 + + + k9Copy - DVD Analyze + + + + unnamed + + + + layout2 + + + 3 + + + + unnamed + + + + lblTotal + + + 3 + + + + + + + + pbTotal + + + 3 + + + 100 + + + false + + + + + + + layout1 + + + 3 + + + + unnamed + + + + lblTitle + + + 3 + + + + + + + + pbTitle + + + 3 + + + 100 + + + 100 + + + true + + + false + + + + + + + lblStatus + + + 3 + + + + + + + + + diff --git a/libk9copy/k9audiocodecs.cpp b/libk9copy/k9audiocodecs.cpp new file mode 100644 index 0000000..361fbf0 --- /dev/null +++ b/libk9copy/k9audiocodecs.cpp @@ -0,0 +1,118 @@ +// +// C++ Implementation: k9audiocodecs +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9audiocodecs.h" + +#include + +class _k9AudioCodec +{ +public: + _k9AudioCodec():name(""),options(""){}; + _k9AudioCodec(QString _name,QString _options) { + name=_name; + options=_options; + } + QString name; + QString options; +}; + + +k9AudioCodecs::k9AudioCodecs(QObject *parent, const char *name) + : QObject(parent, name) +{ + m_config=new k9Config(); + QStringList slLabels=m_config->getCodecLabelsAudio(); + QStringList slCodecs=m_config->getCodecAudio(); + //adds default codecs + if (slLabels.count()==0) { + reset(); + m_config=new k9Config(); + slLabels=m_config->getCodecLabelsAudio(); + slCodecs=m_config->getCodecAudio(); + } + QStringList::iterator c=slCodecs.begin(); + int cpt=0; + for (QStringList::iterator i=slLabels.begin();i!=slLabels.end() ;++i) { + QString o1=(*c); + c++; + m_codecs[cpt++]=_k9AudioCodec((*i),o1); + } + delete m_config; + +} + +void k9AudioCodecs::reset() { + m_codecs[0]=_k9AudioCodec("copy","-oac copy"); + m_codecs[1]=_k9AudioCodec("mp3","-oac lavc -lavcopts acodec=mp3:abitrate=$AUDBR"); + m_codecs[2]=_k9AudioCodec("mp2","-oac lavc -lavcopts acodec=mp2:abitrate=$AUDBR"); + m_codecs[3]=_k9AudioCodec("ac3","-oac lavc -lavcopts acodec=ac3:abitrate=$AUDBR"); + m_codecs[4]=_k9AudioCodec("IMA Adaptive PCM","-oac lavc -lavcopts acodec=adpcm_ima_wav:abitrate=$AUDBR"); + m_codecs[5]=_k9AudioCodec("sonic","-oac lavc -lavcopts acodec=sonic:abitrate=$AUDBR"); + m_codecs[6]=_k9AudioCodec("aac","-oac faac -faacopts br=$AUDBR"); + m_codecs[7]=_k9AudioCodec("mp3 (lame)","-oac mp3lame -lameopts abr:br=$AUDBR"); + save(); +} + +void k9AudioCodecs::save() { + m_config=new k9Config(); + + QStringList labels; + QStringList options; + for (QMap::iterator i=m_codecs.begin();i!=m_codecs.end();++i) { + labels << i.data().name; + options << i.data().options; + } + m_config->setCodecLabelsAudio(labels); + m_config->setCodecAudio(options); + m_config->save(); + delete m_config; +} + + + + +int k9AudioCodecs::count() { + return m_codecs.count(); +} + +void k9AudioCodecs::setOptions(int _num,QString _value) { + m_codecs[_num].options=_value; +} + +void k9AudioCodecs::setCodecName(int _num,QString _value) { + m_codecs[_num].name=_value; +} + +QString k9AudioCodecs::getOptions(int _num) { + return m_codecs[_num].options; +} + +QString k9AudioCodecs::getCodecName(int _num) { + return m_codecs[_num].name; +} + +void k9AudioCodecs::remove(int _num) { + int nb=count(); + if (nb>0) { + for(int i=_num;i, (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9AUDIOCODECS_H +#define K9AUDIOCODECS_H + +#include "k9common.h" +#include "k9config.h" +#include + +/** + @author Jean-Michel PETIT +*/ + +class _k9AudioCodec; +class k9AudioCodecs : public QObject +{ +Q_OBJECT +public: + k9AudioCodecs(QObject *parent = 0, const char *name = 0); + + ~k9AudioCodecs(); + void save(); + int count(); + void setOptions(int _num,QString _value); + void setCodecName(int _num,QString _value); + QString getOptions(int _num); + QString getCodecName(int _num); + void remove(int _num); + void reset(); +private: + QMap m_codecs; + k9Config *m_config; + +}; + +#endif diff --git a/libk9copy/k9backupdlg.cpp b/libk9copy/k9backupdlg.cpp new file mode 100644 index 0000000..8c101d8 --- /dev/null +++ b/libk9copy/k9backupdlg.cpp @@ -0,0 +1,182 @@ +/*************************************************************************** + * Copyright (C) 2005 by Jean-Michel Petit * + * jm_petit@laposte.net * + * * + * 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. * + ***************************************************************************/ + +#include "k9backupdlg.h" +#include "ac.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "k9drawimage.h" + +k9BackupDlg::k9BackupDlg(QWidget* parent, const char* name, bool modal, WFlags fl) + : backupDlg(parent,name, modal,fl) { + Abort=false; + timer = new QTimer( this ); + time = new QTime(0,0); + time->start(); + connect( timer, SIGNAL(timeout()), this, SLOT(timerDone()) ); + timer->start(500, 0 ); + bAbort->setIconSet(KStdGuiItem::cancel().iconSet()); + bPlay->setIconSet(SmallIcon("player_play")); + totalCopied=0; + m_progressTotal=0; + m_progressLabel=""; + m_totalSteps=0; + m_factor=""; + m_progress=0; + connect(&m_decoder, SIGNAL(pixmapReady(QImage *)), this, SLOT(drawPixmap(QImage *))); + m_stop=false; + m_playmovie=true; + m_cpt=0; + m_wimage=new k9DrawImage(image,0); + QGridLayout *l=new QGridLayout(image,1,1); + l->addWidget(m_wimage,0,0); + m_data=NULL; + m_dataSize=0; +} + +void k9BackupDlg::drawPixmap(QImage *_image) { + m_count++; + if (m_count ==4) { + + m_wimage->setImage(*_image); + + m_stop=true; + } +} + +void k9BackupDlg::bPlayToggled( bool state) { + m_playmovie=bPlay->isOn(); +} + + void k9BackupDlg::playMovie(uchar *_data,uint32_t _size) { + if (!m_playmovie || m_dataSize) + return; + m_count=0; + m_dataSize=_size; + m_data=(uchar*)malloc(_size); + tc_memcpy(m_data,_data,_size); +} + + +k9BackupDlg::~k9BackupDlg() { + delete timer; + delete time; + if (m_data) + free(m_data); +} + +void k9BackupDlg::update(){ + lblStep->setText(m_progressLabel); + pbTotal->setProgress(m_progressTotal); + pbStep->setTotalSteps(m_totalSteps); + lblFactor->setText(m_factor); + pbStep->setProgress(m_progress); + + if (m_data) { + if (m_stop) + m_decoder.start(); + m_stop=false; + for (uint32_t i=0;iisOn(); + } + QTime time2(0,0); + time2=time2.addMSecs(time->elapsed()); + QString remain("--:--:--"); + if (m_progressTotal>0) { + QTime time3(0,0); + time3=time3.addMSecs((time->elapsed()/m_progressTotal)*pbTotal->totalSteps()); + remain=time3.toString("hh:mm:ss"); + } + + lblTime->setText(time2.toString("hh:mm:ss") +" / " +remain); + update(); +} + +void k9BackupDlg::setTotalSteps(uint32_t _totalSteps) { + m_totalSteps=_totalSteps; +} + +void k9BackupDlg::setProgress(uint32_t _position) { + m_progress=_position; +} + +void k9BackupDlg::setTotalMax(uint32_t _max) { + pbTotal->setTotalSteps(_max); +} + +void k9BackupDlg::setProgressTotal(uint32_t _position) { + totalCopied+=_position; + uint64_t total=totalCopied*2048; + total/=(1024*1024); + m_progressTotal=total; + +} + +void k9BackupDlg::setProgressLabel(QString _text) { + m_progressLabel=_text; + update(); +} + +bool k9BackupDlg::getAbort() { + return Abort; +} + +void k9BackupDlg::bAbortClick() { + Abort=true; + reject(); + +} + +void k9BackupDlg::setFactor(QString _factor) { + m_factor=_factor; +} +/*$SPECIALIZATION$*/ + + +#include "k9backupdlg.moc" diff --git a/libk9copy/k9backupdlg.h b/libk9copy/k9backupdlg.h new file mode 100644 index 0000000..dae5b31 --- /dev/null +++ b/libk9copy/k9backupdlg.h @@ -0,0 +1,78 @@ +/*************************************************************************** + * Copyright (C) 2005 by Jean-Michel Petit * + * jm_petit@laposte.net * + * * + * 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. * + ***************************************************************************/ + +#ifndef K9BACKUPDLG_H +#define K9BACKUPDLG_H + +#include "k9common.h" +#include "backupdlg.h" +#include +#include "kdecmpeg2.h" + +class k9DrawImage; + +class k9BackupDlg : public backupDlg +{ + Q_OBJECT + +public: + k9BackupDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ~k9BackupDlg(); + /*$PUBLIC_FUNCTIONS$*/ + void setTotalSteps(uint32_t _totalSteps); + void setProgress(uint32_t _position); + void setProgressLabel(QString _text); + void setProgressTotal(uint32_t _position); + void setTotalMax(uint32_t _max); + void setFactor(QString _factor); + bool getAbort(); + void playMovie(uchar *_data,uint32_t _size); +public slots: + /*$PUBLIC_SLOTS$*/ +private : + bool Abort; + QTimer *timer; + QTime *time; + uint64_t totalCopied,m_progressTotal;; + QString m_progressLabel; + uint32_t m_totalSteps,m_progress; + QString m_factor; + bool m_stop; + void update(); + kDecMPEG2 m_decoder; + uint m_count; + QMutex mutex; + bool m_playmovie; + uint m_cpt; + k9DrawImage *m_wimage; + uchar *m_data; + uint32_t m_dataSize; +protected: + /*$PROTECTED_FUNCTIONS$*/ + void bAbortClick(); + void bPlayToggled(bool state); +protected slots: + /*$PROTECTED_SLOTS$*/ + void timerDone(); + void drawPixmap(QImage *image); +}; + +#endif + diff --git a/libk9copy/k9burndvd.cpp b/libk9copy/k9burndvd.cpp new file mode 100644 index 0000000..7d6f603 --- /dev/null +++ b/libk9copy/k9burndvd.cpp @@ -0,0 +1,381 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#include "k9burndvd.h" +#include "k9burndvd.moc" +#include "k9tools.h" +#include +#include +#include +#include +#include +#include +#include + +k9BurnDVD::k9BurnDVD() + : QObject(NULL,"") { + cancelled=false; + useK3b=false; + autoBurn=false; + volId="K9Copy"; + iso=false; + m_filename=""; + progress=new k9Progress(NULL,"progress",NULL); + QString s= KGlobal::dirs()->findResource( "data", "k9copy/anim.mng"); + progress->setMovie(s); + m_cdrkit=k9Tools::checkProgram("genisoimage") && k9Tools::checkProgram("wodim"); +} + + + +k9BurnDVD::~k9BurnDVD() { +} + +/** Read property of QString burnDevice. */ +const QString& k9BurnDVD::getburnDevice() { + return burnDevice; +} +/** Write property of QString burnDevice. */ +void k9BurnDVD::setburnDevice( const QString& _newVal) { + burnDevice = _newVal; +} +/** Write property of QString workDir. */ +void k9BurnDVD::setworkDir( const QString& _newVal) { + workDir = _newVal; + if (workDir.right(1)!='/') + workDir +='/'; +} + +void k9BurnDVD::makeIso(QString _filename) { + iso=true; + m_filename=_filename; +} + +void k9BurnDVD::setvolId(QString _newVal) { + volId=_newVal.replace(" ","_"); +} + +void k9BurnDVD::setUseK3b(bool _newVal) { + useK3b=_newVal; +} + +void k9BurnDVD::setAutoBurn(bool _newVal) { + autoBurn=_newVal; +} +void k9BurnDVD::burn() { + if (!useK3b) { + if (! m_cdrkit) + burnWithGrowisofs(); + else + burnWithGenisoimage(); + } else + burnWithK3b(); +} + +void k9BurnDVD::burnWithK3b() { + KProcess *k3b = new KProcess(); + + *k3b << "k3b"; + *k3b << QDir::cleanDirPath(workDir +"/dvd/VIDEO_TS"); + *k3b << "-videodvd"; + k3b->start(); + k3b->detach(); + delete k3b; +} + +void k9BurnDVD::mkisoSizeStderr(KProcess *proc, char *buffer, int buflen) { + QString c=QString::fromLatin1( buffer,buflen);// (proc2->readStderr()); + imageSize=c.replace("\n",""); + ; +} + +void k9BurnDVD::mkisoSizeStdout(KProcess *proc, char *buffer, int buflen) { + QString c=QString::fromLatin1(buffer,buflen);// (proc2->readStdout()); + imageSize=c.replace("\n",""); + ; +} + +const QString &k9BurnDVD::getImageSize() { + QString c; + c="mkisofs"; + proc2=new k9Process; + *proc2 << c; + *proc2 <<"-quiet"; + *proc2 <<"-print-size"; + *proc2 <<"-dvd-video"; + *proc2 <<"-udf"; + *proc2 <<"-r"; + *proc2 <<"-V "+volId; + *proc2 << QDir::cleanDirPath(workDir +"/dvd"); + + connect( proc2, SIGNAL(receivedStderr(KProcess *, char *, int )),this, SLOT(mkisoSizeStderr(KProcess *, char *, int)) ); + connect( proc2, SIGNAL(receivedStdout(KProcess *, char *, int)),this, SLOT(mkisoSizeStdout(KProcess *, char *, int)) ); + if (proc2->start(KProcess::NotifyOnExit,KProcess::All)) { +// while (proc2->isRunning()) { +// qApp->processEvents(); +// } + proc2->sync(); + if (proc2->exitStatus()==0) { + delete proc2; + return imageSize; + } + } + delete proc2; + return ""; +} + +void k9BurnDVD::getGenisoimageCmd(k9Process *proc,QString _fileName,bool _printSize) { + QString progname="genisoimage"; + *proc << progname; + *proc << "-gui"; + *proc << "-graft-points"; + *proc << "-volid" << volId; + *proc <<"-appid" << "k9copy"; + *proc << "-volset-size" << "1"; + *proc << "-volset-seqno" << "1"; + *proc << "-no-cache-inodes" << "-udf"; + *proc << "-iso-level" << "1"; + *proc << "-dvd-video"; + if (!_printSize) { + if (_fileName !="") { + *proc <<"-o"; + *proc <<_fileName; + } + connect( proc, SIGNAL(receivedStderr(KProcess *, char *, int)),this, SLOT(growisoStderr(KProcess *, char *, int)) ); + connect( proc, SIGNAL(receivedStdout(KProcess *, char *, int)),this, SLOT(growisoStdout(KProcess *, char *, int)) ); + } else { + *proc << "-print-size" << "-quiet"; + connect( proc, SIGNAL(receivedStderr(KProcess *, char *, int )),this, SLOT(mkisoSizeStderr(KProcess *, char *, int)) ); + connect( proc, SIGNAL(receivedStdout(KProcess *, char *, int)),this, SLOT(mkisoSizeStdout(KProcess *, char *, int)) ); + } + *proc <start(); + progress->setCaption(i18n("k9Copy - Burning DVD")); + progress->setTitle(i18n("Burning DVD")); + proc=progress->getProcess(); + + bool bok=false; + + while (!cancelled && !bok) { + burnSpeed=0; + QString fileName=""; + if (iso) { + fileName=m_filename; + if (fileName =="") + fileName=KFileDialog::getSaveFileName (QDir::homeDirPath(),"*.iso", 0,i18n("Save image to disk")); + if (fileName =="") { + cancelled=true; + } + } + proc->clearArguments(); + getGenisoimageCmd(proc,fileName,false); + if (!iso) { + k9Process *proc2=new k9Process(NULL,NULL); + getGenisoimageCmd(proc2,"",true); + proc2->start(KProcess::NotifyOnExit,KProcess::All); + proc2->sync(); + getWodimCmd(proc); + proc->setUseShell(true); + if (!autoBurn) { + if ( KMessageBox::warningContinueCancel ( 0,i18n("Insert a recordable DVD"), i18n("DVD burning"))!=KMessageBox::Continue) + cancelled=true; + } + qDebug(proc->debug()); + } + + + if (!cancelled) { + int res=progress->execute(); + if ( res==-1 ) { + KMessageBox::error( 0, i18n("Error burning DVD :\n")+i18n("Unable to run %1").arg("genisoimage"), i18n("DVD burning") ); + cancelled=true; + } else { + if (proc->exitStatus()==0) { + bok=true; + KMessageBox::information( 0, i18n("DVD Burning finished"), i18n("DVD burning") ); + //delete temporary files + // clearOutput(workDir+"dvd"); + } else { + QString c; + + c=i18n("An error occured while Burning DVD: %1").arg(lastMsg) +"\n" +i18n("Insert an other DVD"); + if ( KMessageBox::warningContinueCancel ( 0,c, i18n("authoring"))!=KMessageBox::Continue) { + cancelled=true; + } + } + } + } + } +} + +void k9BurnDVD::burnWithGrowisofs() { + time = new QTime(0,0); + time->start(); + + //KLibFactory *factory; + //factory = KLibLoader::self()->factory("libk9copy"); + +// progress=static_cast(factory->create(qApp->mainWidget(),"progress", "k9Progress")); + + progress->setCaption(i18n("k9Copy - Burning DVD")); + progress->setTitle(i18n("Burning DVD")); + bool bok=false; + + + while (!cancelled && !bok) { + burnSpeed=0; + QString c,progname; + if (iso) + progname="mkisofs"; + else + progname="growisofs"; + proc=progress->getProcess(); + *proc << progname; + + if (!iso) { + *proc <<"-overburn"; + *proc <<"-Z"; + *proc <execute(); + if ( res==-1 ) { + KMessageBox::error( 0, i18n("Error burning DVD :\n")+i18n("Unable to run %1").arg(progname), i18n("DVD burning") ); + cancelled=true; + } else { + if (proc->exitStatus()==0) { + bok=true; + KMessageBox::information( 0, i18n("DVD Burning finished"), i18n("DVD burning") ); + //delete temporary files + // clearOutput(workDir+"dvd"); + } else { + QString c; + + c=i18n("An error occured while Burning DVD: %1").arg(lastMsg) +"\n" +i18n("Insert an other DVD"); + if ( KMessageBox::warningContinueCancel ( 0,c, i18n("authoring"))!=KMessageBox::Continue) { + cancelled=true; + } + } + } + } + } + delete time; + +} + +/** No descriptions */ +void k9BurnDVD::growisoStderr(KProcess *proc, char *buffer, int buflen) { + QString c=QString::fromLatin1( buffer,buflen);// (proc->readStderr()); + char s[255]; + int a,b; + int pos; + lastMsg=c; + if (c.contains("Current Write Speed")) { + sscanf(c.latin1(),"%s \"Current Write Speed\" is %d.%d",s,&a,&b); + burnSpeed=a+b/10; + } + if (c.contains("Speed set to")) { + sscanf(c.latin1(),"Speed set to %d",&a); + burnSpeed=a/1385; + } + + progress->setTitle(i18n("Burning DVD")); + progress->setLabelText(i18n("Current write speed :%1 x").arg(burnSpeed)); + if (c.contains("% done")) { + pos=c.find("%"); + if (pos!=-1) { + c=c.mid(1,pos-4); + //progress->setLabelText(c); + progress->setProgress(c.toInt(),100); + float m_percent=c.toFloat()/100; + QTime time2(0,0); + time2=time2.addMSecs(time->elapsed()); + if (m_percent>0) { + QTime time3(0,0); + QString m_remain; + time3=time3.addMSecs((uint32_t)(time->elapsed()*(1/m_percent))); + m_remain=time3.toString("hh:mm:ss"); + progress->setElapsed(time2.toString("hh:mm:ss") +" / " +m_remain); + + } + + + + } + } +} +void k9BurnDVD::growisoStdout(KProcess *proc, char *buffer, int buflen) { + QString c=QString::fromLatin1( buffer,buflen);// (proc->readStdout()); + int pos; + pos=c.find("STAT"); + if (pos!=-1) { + c=c.mid(pos); + progress->setLabelText(c); + } +} diff --git a/libk9copy/k9burndvd.h b/libk9copy/k9burndvd.h new file mode 100644 index 0000000..6d9948c --- /dev/null +++ b/libk9copy/k9burndvd.h @@ -0,0 +1,83 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#ifndef k9BurnDVD_H +#define k9BurnDVD_H + +#include "k9common.h" +#include "k9progress.h" + +#include +#include + +/** +@author Jean-Michel PETIT +*/ +class k9BurnDVD: public QObject +{ +Q_OBJECT +public: + k9BurnDVD(); + + ~k9BurnDVD(); + virtual void setburnDevice( const QString& _newVal); + virtual const QString& getburnDevice(); + virtual QWidget* getDialog() {return progress;}; + void setworkDir( const QString& _newVal); + void setvolId(QString _newVal); + void setUseK3b(bool _newVal); + void setAutoBurn (bool _newVal); + void burn(); + void makeIso(QString _filename); + + void setSpeed(const QString& _value) { m_speed = _value;} + +private: + QTime *time; + k9Progress *progress; + k9Process *proc; + k9Process *proc2; + QString volId; + float burnSpeed; + QString burnDevice; + QString lastMsg; + QString workDir; + QString m_filename; + bool cancelled; + bool useK3b; + bool autoBurn; + bool iso; + bool m_cdrkit; + void burnWithGrowisofs(); + void burnWithGenisoimage(); + void getGenisoimageCmd(k9Process *proc,QString _fileName,bool _printSize); + void getWodimCmd(k9Process *proc); + + void burnWithK3b(); + const QString &getImageSize(); + QString imageSize; + QString m_speed; +private slots: // Private slots + void growisoStderr(KProcess *proc, char *buffer, int buflen); + void growisoStdout(KProcess *proc, char *buffer, int buflen); + void mkisoSizeStderr(KProcess *proc, char *buffer, int buflen); + void mkisoSizeStdout(KProcess *proc, char *buffer, int buflen); +}; + +#endif diff --git a/libk9copy/k9cell.cpp b/libk9copy/k9cell.cpp new file mode 100755 index 0000000..d757e26 --- /dev/null +++ b/libk9copy/k9cell.cpp @@ -0,0 +1,443 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#include "k9cell.h" +#include "k9dvdtitleset.h" + +int k9VobuList::compareItems ( QPtrCollection::Item item1, QPtrCollection::Item item2 ) { + return(((k9Vobu*)item1)->oldSector- ((k9Vobu*)item2)->oldSector); +} + +k9Vobu * k9VobuList::findVobu(uint32_t sector) { + //int c=count(); + //if (c >0) { + k9Vobu *v1,*v2; + v1=first(); + v2=last(); + if (v1==NULL) + return NULL; + + if (sector >= v1->oldSector && sector <= v2->oldSector) + return findVobu(sector,0,count()-1); + else + return NULL; + //} +} + +k9Vobu * k9VobuList::findVobu(uint32_t sector, uint32_t start, uint32_t end) { + + long lstart=start; + long lend=end; + + + while (lstart <=lend) { + long m =(lstart+lend)/2; + k9Vobu *v = (k9Vobu *)at(m); + if ( v->oldSector == sector) { + return v; + } else if ( v->oldSector >sector) { + lend = m-1; + } else { + lstart=m+1; + } + } + return NULL; +} + +uint32_t k9Cell::getnewSize() { + uint32_t size=0; + //for (k9Vobu * vobu=vobus.first();vobu;vobu=vobus.next()) + for (uint i=0; isize; + } + return size; +} + +int k9Cell::getStreamID(int type) { + int abase=0; + if (type >= 0x80 && type <= 0x87) { + // AC3 audio + abase = 0x80; + } else if (type >= 0x88 && type <= 0x8f) { + // DTS audio + abase = 0x88; + } else if (type >= 0xa0 && type <= 0xbf) { + // LPCM audio + abase = 0xa0; + } else if (type >= 0xc0 && type <= 0xdf) { + // MPEG audio + abase = 0xc0; + } else if (type >=0x20 && type <=0x3f) { + //subpicture; + abase =0x20; + } + return (type-abase ); + +} + + +streamType_t k9Cell::identifyStream( uchar *buffer,int *packetType ) { + *packetType = buffer[17]; + + if( (*packetType >= 0xE0) && (*packetType <= 0xEF) ) { // video streams + return stVideo; + } else if( *packetType == 0xBB ) { // system header + return stOther; + } else if( *packetType == 0xBE ) { // padding + return stOther; + } else if( *packetType == 0xBF ) { // nav pack + return stOther; + } else if( (*packetType >= 0xC0) && (*packetType <= 0xDF) ) { // mpeg audio + return stAudio; + } else if( *packetType == 0xBD ) { // private stream, check content + *packetType = buffer[23+buffer[22]]; + if (( (*packetType >=0x80) && (*packetType <=0x8f)) || ((*packetType >=0xa0) && (*packetType <=0xa7)) || ((*packetType >=0xc0) && (*packetType <=0xdf))) + return stAudio; + if ( (*packetType >=0x20) && (*packetType <=0x3f)) + return stSubpicture; + return stOther; + } else + return stOther; + +} + + + +int k9Cell::isNavPack (uchar *_ptr) { + uint32_t start_code; + uchar *ptr=_ptr; + if ((ptr [0]!=0) || (ptr [1] !=0) || (ptr [2] != 0x01) || (ptr [3] != 0xba)) + return 0; + + if ((ptr [4] & 0xc0) != 0x40) + return 0; + + // ptr += 14; + + start_code = (uint32_t) (ptr [14]) << 24; + start_code |= (uint32_t) (ptr [15]) << 16; + start_code |= (uint32_t) (ptr [16]) << 8; + start_code |= (uint32_t) (ptr [17]); + + if (start_code != 0x000001bb) + return 0; + + // ptr += 24; + + start_code = (uint32_t) (ptr [0x26]) << 24; + start_code |= (uint32_t) (ptr [0x27]) << 16; + start_code |= (uint32_t) (ptr [0x28]) << 8; + start_code |= (uint32_t) (ptr [0x29]); + + if (start_code != 0x000001bf) + return 0; + + // ptr += 986; + + start_code = (uint32_t) (ptr [0x400]) << 24; + start_code |= (uint32_t) (ptr [0x401]) << 16; + start_code |= (uint32_t) (ptr [0x402]) << 8; + start_code |= (uint32_t) (ptr [0x403]); + + if (start_code != 0x000001bf) + return 0; + + return 1; +} + + + +k9Cell::k9Cell(QObject *parent, const char *name) + : QObject(parent, name) { + vobus.setAutoDelete(true); + numVobu=0; + + vts=0; + pgc=0; + vob=0; + startSector=0; + lastSector=0; + //TO REMOVE oldStartSector=0; + //TO REMOVE oldLastSector=0; + //TO REMOVE newSize=0; + id=0; + selected=false; + copied=false; + //TO REMOVE nbVideoNew=0; + //TO REMOVE nbVideoOld=0; + angleBlock=angleNone; +} + + +k9Cell::~k9Cell() {} + +//add a title in the title list (titles using this cell) +void k9Cell::addTitle( k9DVDTitle *_title) { + m_titles.append( _title); +} + +bool k9Cell::getforceFactor() { + bool m_forced=false; + for (uint i=0; i< m_titles.count() && !m_forced ;i++) { + k9DVDTitle *title=m_titles.at(i); + if (title->getforceFactor()) + m_forced=true; + } + return m_forced; +} + +// returns the shrink factor. +float k9Cell::getFactor() { + float factor=0; + for (uint i=0; i< m_titles.count() ;i++) { + k9DVDTitle *title=m_titles.at(i); + if ((title->getfactor()< factor || factor==0 ) && title->getforceFactor() ) + factor=title->getfactor(); + } + return factor; +} + + +//looking for the end reference frame adress block +void k9Cell::addRefStream(k9Vobu *_vobu,uchar *_buffer,uint32_t _position) { + if (_vobu->firstRefOk && _vobu->secondRefOk && _vobu->thirdRefOk) + return; + //offset of frame + uint start=0x16+_buffer[0x16]+1; + //PES Length + uint length=_buffer[0x12]; + length=(length <<8 ) + _buffer[0x13]; + + //end of PES + uint end=0x14+length; + + if ( _vobu->frameType!=0x18) { + if (!_vobu->firstRefOk) + _vobu->firstRef=_position; + else if (!_vobu->secondRefOk) + _vobu->secondRef=_position; + else if (!_vobu->thirdRefOk) + _vobu->thirdRef=_position; + } + + for (uint i=start;i frameType!=0x18) && (_vobu->frameType!=0)) { + if (!_vobu->firstRefOk) { + _vobu->firstRefOk=true; + _vobu->firstRef=_position; + } else if (!_vobu->secondRefOk) { + _vobu->secondRefOk=true; + _vobu->secondRef=_position; + } else if (!_vobu->thirdRefOk) { + _vobu->thirdRefOk=true; + _vobu->thirdRef=_position; + } + } + //keep the current frame type + _vobu->frameType=frameType; + } + } + +} + +k9Vobu * k9Cell::addVobu(uint32_t _sector) { + k9Vobu * vobu = new k9Vobu(this,_sector); + vobus.append(vobu); + return vobu; +} + + +void k9Cell::addNewVobus(char *_buffer,uint32_t _len,uint32_t _position,int _vobNum,long _vobPos) { + uint32_t start= _position ;//lastSector - _len ; + k9Vobu *vobu; + for (uint32_t i= 0 ; i<_len ;i+=DVD_BLOCK_LEN) { + if (isNavPack((uchar*)_buffer+i)) { + vobu=(k9Vobu*)vobus.at(numVobu); + vobu->newSector=i/DVD_BLOCK_LEN +start; + numVobu++; + vobu->vobNum=_vobNum; + vobu->vobPos=_vobPos; + //QString c; + //c.sprintf("vobu : %d old: %d new :%d",numVobu-1,vobu->oldSector,vobu->newSector); + //qDebug (c.latin1()); + + } else { + streamType_t st; + int packetType,id; + st=k9Cell::identifyStream((uchar*)_buffer+i,&packetType); + vobu=(k9Vobu*)vobus.at(numVobu-1); + switch (st) { + case stAudio: + id=k9Cell::getStreamID(packetType); + if (vobu->firstAudio[id]==-1) { + vobu->firstAudio[id]= ((i/ DVD_BLOCK_LEN) + start) - vobu->newSector; + } + break; + case stSubpicture: + id=k9Cell::getStreamID(packetType); + if ((id >=0) && (id<32)) { + if (vobu->firstSubp[id]==-1) { + vobu->firstSubp[id]= ((i / DVD_BLOCK_LEN)+start) - vobu->newSector; + } + } + break; + case stVideo: + addRefStream(vobu,(uchar*)_buffer+i,(i/DVD_BLOCK_LEN +start) - vobu->newSector); + if (vobu->firstVideo==-1) { + vobu->firstVideo = ((i / DVD_BLOCK_LEN)+start) - vobu->newSector; + } + //TO REMOVE nbVideoNew++; + break; + } + + } + vobu->size= _position-vobu->newSector; + // �v�ifier + lastSector=_position; + } + +} + +k9Vobu::k9Vobu(k9Cell *_parent,uint32_t _oldSector) + : QObject(_parent,"") { + parent=_parent; + oldSector = _oldSector; + newSector = 0; + size=0; + for (int i=0;i<8;i++) + firstAudio[i]=-1; + for (int i=0;i<32;i++) + firstSubp[i]=-1; + firstVideo=-1; + empty=false; + vobPos=0; + vobNum=0; + frameType=0; + firstRef=0; + secondRef=0; + thirdRef=0; + firstRefOk=false; + secondRefOk=false; + thirdRefOk=false; +} + + +/*! +\fn k9Cell::findVobu(int _oldSector) +*/ +k9Vobu * k9Cell::findVobu(uint32_t _oldSector) { + return vobus.findVobu(_oldSector) ; +} + + +k9Vobu::~k9Vobu() {} + + +k9Cell* k9CellList::addCell(int _vts,int _pgc, int _vob) { + k9Cell* cell=new k9Cell; + cell->cellList=this; + cell->vts=_vts; + cell->vob=_vob; + cell->pgc=_pgc; + + if (count()!=0) { + k9Cell *prev=(k9Cell*)getLast(); + if (prev->vts==_vts) { + cell->startSector= prev->lastSector +1; + if (_pgc!=prev->pgc) + cell->id=1; + else + cell->id=prev->id+1; + } + } else { + cell->startSector = 0; + cell->id=1; + } + append (cell); + return(cell); + +} + +k9Vobu *k9CellList::findVobu(uint32_t sector) { + k9Vobu *vobu=NULL; + k9Cell *cell=findCell(sector); + if (cell==NULL) + return NULL; + else + return cell->findVobu(sector); + + int nbCells=count(); + for (int i=0;i findVobu(sector); + if (vobu !=NULL) { + return vobu; + } + cell = (k9Cell*)at(nbCells-1-i); + vobu = cell->findVobu(sector); + if (vobu !=NULL) { + return vobu; + } + + + } + return vobu; +} + +k9Cell * k9CellList::findCell(uint32_t sector) { + return findCell(sector,0,count()-1); +} + +k9Cell * k9CellList::findCell(uint32_t sector, uint32_t start, uint32_t end) { + + long lstart=start; + long lend=end; + + while (lstart <=lend) { + long m =(lstart+lend)/2; + k9Cell *cell = (k9Cell *)at(m); + k9Vobu *fv=cell->vobus.first(); + k9Vobu *lv=cell->vobus.last(); + + + if ( sector >=fv->oldSector && sector<= lv->oldSector) { + return cell; + } else if ( fv->oldSector >sector) { + lend = m-1; + } else { + lstart=m+1; + } + } + return NULL; +} + +k9DVDTitleset * k9Cell::getTitleset() { + k9DVDTitle *title=m_titles.at(0); + return title->gettitleset(); +} + + +#include "k9cell.moc" diff --git a/libk9copy/k9cell.h b/libk9copy/k9cell.h new file mode 100755 index 0000000..c253415 --- /dev/null +++ b/libk9copy/k9cell.h @@ -0,0 +1,129 @@ +/*************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#ifndef K9CELL_H +#define K9CELL_H + +#include "k9common.h" +#include "k9dvdtitle.h" + + +enum streamType_t {stAudio,stVideo,stSubpicture,stOther}; +/** +@author Jean-Michel Petit +*/ +class k9CellList; +class k9Cell; +class k9DVDTitleset; +class k9Vobu : public QObject { + Q_OBJECT +public: + k9Vobu(k9Cell * parent,uint32_t _oldSector); + ~k9Vobu(); + uint32_t newSector; + uint32_t oldSector; + uint32_t size; + int firstAudio[8]; + int firstSubp[32]; + int firstVideo; + bool empty; + k9Cell *parent; + long vobPos; + int vobNum; + uchar frameType; + uint32_t firstRef,secondRef,thirdRef; + bool firstRefOk,secondRefOk,thirdRefOk; +}; + +class k9VobuList : public QPtrList { +public: + k9Vobu *findVobu(uint32_t sector); +private: + k9Vobu * findVobu(uint32_t sector, uint32_t start, uint32_t end); +protected: + int compareItems ( QPtrCollection::Item item1, QPtrCollection::Item item2 ) ; +}; + +class k9Cell : public QObject { + Q_OBJECT +public: + k9Cell(QObject *parent = 0, const char *name = 0); + ~k9Cell(); + k9Vobu * addVobu(uint32_t _sector); + void addNewVobus(char *_buffer,uint32_t _len,uint32_t _position,int _vobNum,long _vobPos); + static int isNavPack (uchar *ptr); + static streamType_t identifyStream( uchar *buffer,int * packetType ); + static int getStreamID(int type); + k9Vobu * findVobu(uint32_t _oldSector); + uint32_t getnewSize(); + void addTitle(k9DVDTitle *_title); + k9DVDTitleset * getTitleset(); + bool getforceFactor(); + float getFactor(); +public: + k9VobuList vobus; + int vts; + int pgc; + int vob; + uint32_t startSector; + uint32_t lastSector; + //TO REMOVE uint32_t ; + //TO REMOVE uint32_t ; + //TO REMOVE uint32_t newSize; + uchar angleBlock; + //TO REMOVE int nbVideoNew,nbVideoOld; + int id; + bool selected; + bool copied; + QValueList audio; + QValueList subpicture; + k9CellList *cellList; +private: + int numVobu; + void addRefStream(k9Vobu *_vobu,uchar *_buffer,uint32_t _position); + QPtrList m_titles; +}; + + + +class k9CellList : public QPtrList { +private: + uint32_t m_position; + k9Cell * findCell(uint32_t sector); + k9Cell * findCell(uint32_t sector, uint32_t start, uint32_t end); + +public: + k9CellList() { + m_position=0; + }; + k9Cell *addCell(int _vts, int _pgc,int _vob); + k9Vobu *findVobu(uint32_t sector); + + void setPosition(const uint32_t& _value) { + m_position = _value; + } + + uint32_t getPosition() const { + return m_position; + } + +}; + + +#endif diff --git a/libk9copy/k9cellcopylist.cpp b/libk9copy/k9cellcopylist.cpp new file mode 100644 index 0000000..656da5f --- /dev/null +++ b/libk9copy/k9cellcopylist.cpp @@ -0,0 +1,373 @@ +/*************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#include "k9cellcopylist.h" +#include "k9dvdtitle.h" +#include "k9ifo2.h" + +#include + +int k9CellVTSList::compareItems ( QPtrCollection::Item item1, QPtrCollection::Item item2 ) { + k9CellCopyVTS * it1,*it2; + it1=(k9CellCopyVTS *) item1; + it2=(k9CellCopyVTS *)item2; + if (it1->getsize() >it2->getsize()) + return 1; + else if (it1->getsize() getsize()) + return -1; + else { + if (it1->getnum()>it2->getnum()) + return 1; + else + return -1; + } +} + +uint k9CellCopyVTS::getnum() { + return num; +} +void k9CellCopyVTS::addsize(uint32_t _size) { + size+=_size; +} +uint64_t k9CellCopyVTS::getsize() { + return size; +} + +k9CellCopyList::k9CellCopyList(k9DVDRead * _dvdHandle,k9DVD *_DVD) + : QObjectList() { + setAutoDelete(true); + DVD=_DVD; + dvdHandle=_dvdHandle; + fill(); + + +} + +k9CellCopyList::~k9CellCopyList() {} + +/*! + \fn k9CellCopyList::fill() + */ +void k9CellCopyList::fill() { +// k9Ifo2 kifo(dvdHandle) ,kifoZero(dvdHandle); + ifo_handle_t *hifo,*hifoZero; + k9Ifo2 *kifo,*kifoZero; + kifoZero=dvdHandle->getIfo(0); + hifoZero=kifoZero->getIFO(); + +// kifoZero.openIFO( 0); + + int nrTS= hifoZero->vmgi_mat->vmg_nr_of_title_sets; + + for (int iTS=1 ; iTS<=nrTS;iTS++) { + //kifo.openIFO( iTS); + kifo=dvdHandle->getIfo(iTS); + hifo=kifo->getIFO(); + c_adt_t *c_adt = hifo->vts_c_adt; + uint32_t length = c_adt->last_byte + 1 - C_ADT_SIZE; + cell_adr_t *ptr; + ptr= c_adt->cell_adr_table; + uint32_t imax=length/sizeof(cell_adr_t); + + for(uint32_t i = 0; i startSector ==startSector && cell->vts==_VTS) { + bFound=true; + if (cell->lastSector!=lastSector ) + qDebug("last sector doesn't match","DVD Backup"); + + } + if (!bFound && (_VTS vts || (startSectorstartSector && cell->vts ==_VTS ) )) { + bInsert=true; + position=i; + } + + } + + if (!bFound) { + cell = new k9Cell(); + cell->vts=_VTS; + cell->startSector=startSector; + cell->lastSector=lastSector; + cell->pgc=_pgc; + cell->id=_id; + cell->angleBlock=_angleBlock; + cell->selected=checkSelected(cell); + + if (bInsert) + insert(position,cell); + else + append(cell); + + uint32_t isize; + isize= cell->selected ? ((lastSector-startSector)*2048):2; + setVTS(_VTS,isize); + } + return(cell); +} +void k9CellCopyList::setVTS(uint _numVTS,uint32_t _size) { + bool bfound=false; + for (uint iVTS=0; iVTSgetnum()==_numVTS) { + VTS->addsize(_size); + bfound=true; + } + } + if (!bfound) { + k9CellCopyVTS * VTS= new k9CellCopyVTS(_numVTS); + VTS->addsize(_size); + VTSList.append(VTS); + } +} + +void k9CellCopyList::sortVTSList() { + VTSList.sort(); +} + + +void k9CellCopyList::addStreams(k9DVDTitle *_title,k9Cell *_cell) { + k9DVDSubtitle *l_sub; + k9DVDAudioStream *l_auds; + for (int i=0;i<_title->getaudioStreamCount();i++) { + l_auds=_title->getaudioStream(i); + if (l_auds->getselected()) { + QValueList::iterator it; + bool found=false; + for ( it = _cell->audio.begin(); it != _cell->audio.end(); ++it ) { + if (*it == l_auds->getID()) + found=true; + } + if (!found) + _cell->audio.append(l_auds->getID()); + } + } + + for (int i=0;i<_title->getsubPictureCount();i++) { + QString c; + l_sub=_title->getsubtitle(i); + if (l_sub->getselected()) { + QValueList::iterator it; + bool found=false; + for ( it = _cell->subpicture.begin(); it != _cell->subpicture.end(); ++it ) { + if (l_sub->getID().contains(*it)) + found=true; + } + if (!found) + _cell->subpicture+=l_sub->getID(); + } + } +} + +/*! + \fn k9CellCopyList::checkSelected(k9Cell *_cell) + */ +bool k9CellCopyList::checkSelected(k9Cell *_cell) { + bool selected=false; + for (int i=0; i< DVD->gettitleCount();i++) { + k9DVDTitle *title=DVD->gettitle(i); +//FACTOR if ( title->getVTS()==_cell->vts && title ->isSelected()) { + if ( title->getVTS()==_cell->vts) { // { && title ->isSelected()) { + for (int j=0; j getchapterCount();j++) { + k9DVDChapter * chapter= title->getChapter(j); + if (_cell->startSector >= chapter->getstartSector() && _cell->startSector<=chapter->getendSector()) { + //add a reference to the title in the titles list from the cell + _cell->addTitle( title); //FACTOR +// if (title->isSelected()) { + if (chapter->getSelected()) { + addStreams (title,_cell); + selected=true; + } + } + } + } + } + return selected; +} + +double k9CellCopyList::gettotalSize() { + double totalSize=0; + for (uint iCell=0;iCellcopied) { + if (cell->selected) { + if (cell->angleBlock==angleNone) + totalSize += cell->lastSector-cell->startSector; + else if (cell->angleBlock==angleStart) { + uint32_t start=0,end=0; + start=cell->startSector; + // loop inside the angle block to find the last sector. + while (((k9Cell*)at(iCell))->angleBlock !=angleNone) { + end=((k9Cell*)at(iCell))->lastSector; + iCell++; + } + iCell--; + totalSize += end-start; + } + } else + totalSize += 1; + // } + } + return (totalSize*2048); + ; + +} + +//gives the final size of cells with a forced shrink factor +double k9CellCopyList::getforcedSize(bool _withFactor) { + double totalSize=0; + for (uint iCell=0;iCellgetFactor():1; + double size=0; +// if (!cell->copied) { + if (cell->selected && cell->getforceFactor() ) { + if (cell->angleBlock==angleNone) + size = cell->lastSector-cell->startSector; + else if (cell->angleBlock==angleStart) { + uint32_t start=0,end=0; + start=cell->startSector; + // loop inside the angle block to find the last sector. + while (((k9Cell*)at(iCell))->angleBlock !=angleNone) { + end=((k9Cell*)at(iCell))->lastSector; + iCell++; + } + iCell--; + size += end-start; + } + totalSize += (size/factor); + } + // } + } + return (totalSize*2048); + +} + +double k9CellCopyList::getMinFactor(bool _withMenus) { + + double fforced=getforcedSize( false); + double MaxSize=k9DVDSize::getMaxSize(); + MaxSize*=1024*1024; + double menuSize=0; + + if (_withMenus) + menuSize=DVD->getmenuSize(); + + menuSize= menuSize*2048; + //totalSize=part of dvd with auto shrink factor/2.5 + //double totalSize=gettotalSize()+menuSize - (fforced-m_frcinbytes) -m_inbytes; + double totalSize=gettotalSize()+menuSize - (fforced) -m_inbytes; + totalSize/=2.50; + +qDebug(QString("totalSize(%1)=gettotalSize()(%2)+menuSize(%3) -(fforced(%4))-m_inbytes(%6)").arg(totalSize).arg(gettotalSize()).arg(menuSize).arg(fforced).arg(m_frcinbytes).arg(m_inbytes)); + + double minFactor=(fforced-m_frcinbytes) /(MaxSize- (totalSize +m_outbytes) - m_frcoutbytes) ; + qDebug(QString("minfactor(%1)=(fforced(%2) -m_frinbytes(%3))/(MacSize(%4)-totalSize(%5)-m_outbytes(%6) - m_frcoutbytes(%7))").arg(minFactor).arg(fforced).arg(m_frcinbytes).arg(MaxSize).arg(totalSize).arg(m_outbytes).arg(m_frcoutbytes)); + + if (minFactor<1) + minFactor=1; + return minFactor; +} + + +double k9CellCopyList::getfactor(bool _withMenus,bool _streams) { + + double totalSize=gettotalSize(); + + if (_streams) { + double unsel=0; + for (int i=0;igettitleCount();i++) { + k9DVDTitle *track=DVD->gettitle(i); + for (int j=0; jgetaudioStreamCount();j++) { + k9DVDAudioStream *audio=track->getaudioStream(j); + if (! audio->getselected()) + unsel+=audio->getsize_mb(); + } + for (int j=0; jgetsubPictureCount();j++) { + k9DVDSubtitle *sub=track->getsubtitle(j); + if (! sub->getselected()) + unsel+=sub->getsize_mb(); + } + } + unsel*=1024*1024; + totalSize-=unsel; + } + + double menuSize=0; + + if (_withMenus) + menuSize=DVD->getmenuSize(); + + menuSize= menuSize*2048; + + double dvdSize=k9DVDSize::getMaxSize() ; + dvdSize*=1024*1024; + + double factor; + + double fforced=getforcedSize(false)-m_frcinbytes; + double fforcedsh=getforcedSize(true)-m_frcoutbytes; + double dvdSize2=dvdSize-m_outbytes -fforcedsh; + // dvdSize2 -=menuSize; + + if (dvdSize2 <0) { + factor=2.5; + //qDebug(QString("dvdSize (%1)- _outbytes(%2) - fforcedsh(%3)=%4").arg(dvdSize).arg(m_outbytes).arg(fforcedsh).arg(dvdSize2)); + } + else { + factor=(totalSize +menuSize - fforced -m_inbytes)/ dvdSize2 ; + + factor = (int)(factor*100); + factor /=100; + factor+=0.01; + // } + + uint64_t o=m_outbytes; + uint64_t i=m_inbytes; + //if (o==0) + // o=1; + //qDebug(QString("factor : %1 realise : %2").arg(factor).arg((double)i/(double)o)); + + if (factor<=1) + factor=1; + else if (factor>3) + factor=3; + } + + return (factor); +} diff --git a/libk9copy/k9cellcopylist.h b/libk9copy/k9cellcopylist.h new file mode 100644 index 0000000..c338567 --- /dev/null +++ b/libk9copy/k9cellcopylist.h @@ -0,0 +1,97 @@ +/*************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#ifndef K9CELLCOPYLIST_H +#define K9CELLCOPYLIST_H + +#include "k9common.h" +#include "k9dvd.h" +#include "k9cell.h" +#include "k9dvdread.h" + +class k9CellCopyVTS { +private: + uint num; + uint64_t size; +public: + k9CellCopyVTS (int _num) { + num=_num; + size=0; + }; + uint getnum() ; + void addsize(uint32_t _size) ; + uint64_t getsize() ; +}; + + +/** +@author Jean-Michel PETIT +*/ + +class k9CellVTSList : public QPtrList { +protected: + int compareItems ( QPtrCollection::Item item1, QPtrCollection::Item item2 ); +}; + + +class k9CellCopyList : public QObjectList { +public: + k9CellCopyList(k9DVDRead * _dvdHandle,k9DVD *_DVD); + double getfactor(bool _withMenus,bool _streams); + double gettotalSize(); + double getforcedSize(bool _withFactor); + double getMinFactor(bool _withMenus); + k9CellVTSList VTSList; + ~k9CellCopyList(); + + void addInbytes(const uint64_t& _value) { + m_inbytes += _value; + } + + + void addOutbytes(const uint64_t& _value) { + m_outbytes += _value; + } + + void addFrcinbytes(const uint64_t& _value) { + m_frcinbytes += _value; + } + + void addFrcoutbytes(const uint64_t& _value) { + m_frcoutbytes += _value; + } + +private: + k9DVD *DVD; + k9DVDRead *dvdHandle; + uint64_t m_inbytes,m_outbytes; + uint64_t m_frcinbytes,m_frcoutbytes; + + void fill(); + k9Cell *addCell(int _VTS,int _pgc,int _id,uint32_t startSector,uint32_t lastSector,uchar _angleBlock); + bool checkSelected(k9Cell *_cell); + void addStreams(k9DVDTitle *_title,k9Cell *_cell); + void setVTS(uint _numVTS,uint32_t _size); + + //QPtrList VTSList; + void sortVTSList(); + +}; + +#endif diff --git a/libk9copy/k9common.h b/libk9copy/k9common.h new file mode 100644 index 0000000..633e8d6 --- /dev/null +++ b/libk9copy/k9common.h @@ -0,0 +1,48 @@ +// +// C++ Interface: k9common +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "config.h" +#ifndef __STDC_LIMIT_MACROS + #define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_CONSTANT_MACROS + #define __STDC_CONSTANT_MACROS +#endif + +#if defined(HAVE_INTTYPES_H) + #include +#elif defined( HAVE_STDINT_H) + #include +#endif + + +#ifdef __FreeBSD__ + #include +#endif +#include "ifo_types.h" +#include "dvd_reader.h" +#include "ifo_read.h" +#include "nav_read.h" +#include "nav_types.h" + +#include +#include +#include + +#ifndef DVD_BLOCK_LEN +#define DVD_BLOCK_LEN 2048 +#endif + +#include "k9dvdsize.h" +#ifndef NDEBUG + #define NDEBUG +#endif diff --git a/libk9copy/k9config.cpp b/libk9copy/k9config.cpp new file mode 100644 index 0000000..2824c37 --- /dev/null +++ b/libk9copy/k9config.cpp @@ -0,0 +1,157 @@ +// +// C++ Implementation: k9config +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9config.h" + +k9Config::k9Config() { + m_config=NULL; + read(); +} + +void k9Config::read() { + // if (! m_config->hasGroup( "options")) + // readOldConfig(); + if (m_config!=NULL) + delete m_config; + m_config=new KSimpleConfig("K9Copy"); + + + m_config->setGroup( "dir"); + m_prefOutput=m_config->readEntry("output",locateLocal("tmp","k9copy/",true)); + + m_config->setGroup("devices"); + m_InputDev=m_config->readNumEntry("input",0); + m_OutputDev=m_config->readNumEntry("output",0); + + m_config->setGroup("options"); + m_prefK3b=m_config->readBoolEntry("usek3b",false); + m_prefAutoBurn=m_config->readBoolEntry("autoburn",false); + m_quickScan=m_config->readBoolEntry("quickscan",true); + m_prefSize=m_config->readNumEntry("dvdsize",4400); + m_useDvdAuthor=m_config->readBoolEntry("useDvdAuthor",true); + m_keepMenus=m_config->readBoolEntry("keepMenus",true); + m_prefDelTmpFiles=m_config->readBoolEntry("deltmpfiles",false); + + m_config->setGroup("mp4"); + m_prefMp4Codec=m_config->readNumEntry("codec",0); + m_prefMp4Size=m_config->readNumEntry("size",700); + m_prefMp4NumberCD=m_config->readNumEntry("numberCD",1); + m_prefMp4Width=m_config->readEntry("width","640"); + m_prefMp4Height=m_config->readEntry("height",""); + m_prefMp4AspectRatio=m_config->readBoolEntry("aspectRatio",true); + m_prefMp42Passes=m_config->readBoolEntry("2passes",false); + m_prefMp4AudioBitrate=m_config->readEntry("audiobitrate","128"); + m_prefMp4VideoBitrate=m_config->readEntry("videobitrate" ""); + m_prefMp4AudioCodec=m_config->readNumEntry("audiocodec",0); + m_prefMp4AudioGain=m_config->readNumEntry("audiogain",7); + m_prefUseCellCache=m_config->readBoolEntry("usecellcache",true); + + m_config->setGroup("mencoder"); + m_prefVersion=m_config->readEntry("version",""); + m_codecAudio=m_config->readListEntry("audio"); + m_codecLabels=m_config->readListEntry("labels"); + m_codecLabelsAudio=m_config->readListEntry("audiolabels"); + + + m_codecVideo=m_config->readListEntry("video"); + + m_config->setGroup("devices"); + m_devices=m_config->readListEntry("dev"); + m_devicesLabels=m_config->readListEntry("labels"); + m_devicesIO=m_config->readListEntry("IO"); + + m_config->setGroup("preview"); + m_useMplayer=m_config->readBoolEntry("useMplayer",false); + m_useGL=m_config->readBoolEntry("useGL",false); + m_MplayerVout=m_config->readNumEntry("MplayerVout",0); + m_MplayerAout=m_config->readNumEntry("MplayerAout",0); + + m_config->setGroup("authoring"); + m_prefAudioFormat=m_config->readEntry("audioFormat","AC3"); + m_prefAudioBitrate=m_config->readNumEntry("audioBitrate",192); + m_prefButtonWidth=m_config->readNumEntry("buttonWidth",50); + m_prefButtonHeight=m_config->readNumEntry("buttonHeight",40); + m_prefButtonHiliteColor=m_config->readColorEntry("buttonHiliteColor",&QColor(Qt::yellow)); + m_prefButtonTextColor=m_config->readColorEntry("buttonTextColor",&QColor(Qt::yellow)); + + m_prefButtonFont=m_config->readFontEntry("buttonFont"); + + +} + +void k9Config::save() { + m_config->setGroup( "dir"); + m_config->writeEntry("output",m_prefOutput); + + m_config->setGroup("devices"); + m_config->writeEntry("input", m_InputDev); + m_config->writeEntry("output",m_OutputDev); + + m_config->setGroup("options"); + m_config->writeEntry("usek3b",m_prefK3b); + m_config->writeEntry("autoburn",m_prefAutoBurn); + m_config->writeEntry("quickscan",m_quickScan); + m_config->writeEntry("dvdsize",m_prefSize); + m_config->writeEntry("useDvdAuthor",m_useDvdAuthor); + m_config->writeEntry("keepMenus",m_keepMenus); + m_config->writeEntry("deltmpfiles",m_prefDelTmpFiles); + + m_config->setGroup("mp4"); + m_config->writeEntry("codec",m_prefMp4Codec); + m_config->writeEntry("size",m_prefMp4Size); + m_config->writeEntry("numberCD",m_prefMp4NumberCD); + m_config->writeEntry("width",m_prefMp4Width); + m_config->writeEntry("height",m_prefMp4Height); + m_config->writeEntry("audiobitrate",m_prefMp4AudioBitrate); + m_config->writeEntry("videobitrate",m_prefMp4VideoBitrate); + m_config->writeEntry("aspectRatio",m_prefMp4AspectRatio); + m_config->writeEntry("2passes",m_prefMp42Passes); + m_config->writeEntry("audiogain",m_prefMp4AudioGain); + m_config->writeEntry("audiocodec", m_prefMp4AudioCodec); + m_config->writeEntry("usecellcache",m_prefUseCellCache); + + + m_config->setGroup("mencoder"); + m_config->writeEntry("version",m_prefVersion); + m_config->writeEntry("audio",m_codecAudio); + m_config->writeEntry("labels",m_codecLabels); + m_config->writeEntry("audiolabels",m_codecLabelsAudio); + m_config->writeEntry("video",m_codecVideo); + + m_config->setGroup("devices"); + m_config->writeEntry("dev",m_devices); + m_config->writeEntry("labels",m_devicesLabels); + m_config->writeEntry("IO",m_devicesIO); + + m_config->setGroup("preview"); + m_config->writeEntry("useMplayer",m_useMplayer); + m_config->writeEntry("useGL",m_useGL); + m_config->writeEntry("MplayerVout",m_MplayerVout); + m_config->writeEntry("MplayerAout",m_MplayerAout); + + m_config->setGroup("authoring"); + m_config->writeEntry("audioFormat",m_prefAudioFormat); + m_config->writeEntry("audioBitrate",m_prefAudioBitrate); + m_config->writeEntry("buttonWidth",m_prefButtonWidth); + m_config->writeEntry("buttonHeight",m_prefButtonHeight); + m_config->writeEntry("buttonHiliteColor",m_prefButtonHiliteColor); + m_config->writeEntry("buttonTextColor",m_prefButtonTextColor); + m_config->writeEntry("buttonFont",m_prefButtonFont); + +} + + +k9Config::~k9Config(){ + delete m_config; + +} + + diff --git a/libk9copy/k9config.h b/libk9copy/k9config.h new file mode 100644 index 0000000..13af407 --- /dev/null +++ b/libk9copy/k9config.h @@ -0,0 +1,453 @@ +// +// C++ Interface: k9config +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9CONFIG_H +#define K9CONFIG_H +#include "k9common.h" + +#include +#include + +/** + @author Jean-Michel PETIT +*/ +class k9Config { +private: + KSimpleConfig *m_config; + int m_InputDev; + int m_OutputDev; + bool m_keepMenus; + QString m_prefOutput; + QString m_prefVersion; + bool m_useDvdAuthor; + bool m_quickScan; + int m_prefSize; + bool m_prefK3b; + bool m_prefMenu; + bool m_prefAutoBurn; + int m_prefMp4Codec; + int m_prefMp4AudioCodec; + int m_prefMp4AudioGain; + int m_prefMp4Size; + int m_prefMp4NumberCD; + int m_prefAudioBitrate; + int m_prefButtonWidth; + int m_prefButtonHeight; + bool m_prefMp4AspectRatio; + bool m_prefMp42Passes; + bool m_prefDelTmpFiles; + bool m_prefUseCellCache; + QString m_prefMp4Width; + QString m_prefMp4Height; + QString m_prefMp4AudioBitrate; + QString m_prefMp4VideoBitrate; + QString m_prefAudioFormat; + QStringList m_codecAudio; + QStringList m_codecLabelsAudio; + QStringList m_codecLabels; + QStringList m_codecVideo; + QString m_prefCodecAudio,m_prefCodecVideo,m_prefCodecLabel; + + QStringList m_devices; + QStringList m_devicesLabels; + QStringList m_devicesIO; + + QColor m_prefButtonHiliteColor; + QColor m_prefButtonTextColor; + QFont m_prefButtonFont; + + bool m_useMplayer; + bool m_useGL; + int m_MplayerVout; + int m_MplayerAout; +public: + k9Config(); + void read(); + void save(); + ~k9Config(); + + void setInputDev(const int& _value) { + m_InputDev = _value; + } + + + int getInputDev() const { + return m_InputDev; + } + + void setOutputDev(const int& _value) { + m_OutputDev = _value; + } + + + int getOutputDev() const { + return m_OutputDev; + } + + void setKeepMenus(bool _value) { + m_keepMenus = _value; + } + + + bool getKeepMenus() const { + return m_keepMenus; + } + + void setPrefOutput(const QString& _value) { + m_prefOutput = _value; + } + + QString getPrefOutput() const { + return m_prefOutput; + } + + void setPrefAudioFormat( const QString &_value) { + m_prefAudioFormat=_value; + } + + QString getPrefAudioFormat() const { + return m_prefAudioFormat; + } + + void setPrefVersion(const QString& _value) { + m_prefVersion = _value; + } + + QString getPrefVersion() const { + return m_prefVersion; + } + + void setUseDvdAuthor(bool _value) { + m_useDvdAuthor = _value; + } + + + bool getUseDvdAuthor() const { + return m_useDvdAuthor; + } + + void setPrefDelTmpFiles( bool _value) { + m_prefDelTmpFiles=_value; + } + + bool getPrefDelTmpFiles() const { + return m_prefDelTmpFiles; + } + + void setPrefUseCellCache( bool _value) { + m_prefUseCellCache=_value; + } + + bool getPrefUseCellCache() const { + return m_prefUseCellCache; + } + void setQuickScan(bool _value) { + m_quickScan = _value; + } + + + bool getQuickScan() const { + return m_quickScan; + } + + void setPrefSize(const int& _value) { + m_prefSize = _value; + } + + + int getPrefSize() const { + return m_prefSize; + } + + void setPrefK3b(bool _value) { + m_prefK3b = _value; + } + + + bool getPrefK3b() const { + return m_prefK3b; + } + + void setPrefMenu(bool _value) { + m_prefMenu = _value; + } + + + bool getPrefMenu() const { + return m_prefMenu; + } + + void setPrefAutoBurn(bool _value) { + m_prefAutoBurn = _value; + } + + + bool getPrefAutoBurn() const { + return m_prefAutoBurn; + } + + void setPrefMp4Codec(const int& _value) { + m_prefMp4Codec = _value; + } + + int getPrefMp4Codec() const { + return m_prefMp4Codec; + } + + void setPrefMp4AudioCodec(const int& _value) { + m_prefMp4AudioCodec = _value; + } + + int getPrefMp4AudioCodec() const { + return m_prefMp4AudioCodec; + } + + + void setPrefMp4Size(const int& _value) { + m_prefMp4Size = _value; + } + + + int getPrefMp4Size() const { + return m_prefMp4Size; + } + + void setPrefMp4AudioGain(const int& _value) { + m_prefMp4AudioGain = _value; + } + + + int getPrefMp4AudioGain() const { + return m_prefMp4AudioGain; + } + + void setPrefMp4NumberCD(const int& _value) { + m_prefMp4NumberCD = _value; + } + + + int getPrefMp4NumberCD() const { + return m_prefMp4NumberCD; + } + + void setPrefMp4Width(const QString& _value) { + m_prefMp4Width = _value; + } + + + QString getPrefMp4Width() const { + return m_prefMp4Width; + } + + void setPrefMp4Height(const QString& _value) { + m_prefMp4Height = _value; + } + + + QString getPrefMp4Height() const { + return m_prefMp4Height; + } + + void setPrefMp4AudioBitrate(const QString& _value) { + m_prefMp4AudioBitrate = _value; + } + + + QString getPrefMp4AudioBitrate() const { + return m_prefMp4AudioBitrate; + } + + void setPrefMp4VideoBitrate(const QString& _value) { + m_prefMp4VideoBitrate = _value; + } + + + QString getPrefMp4VideoBitrate() const { + return m_prefMp4VideoBitrate; + } + + void setCodecAudio(const QStringList& _value) { + m_codecAudio = _value; + } + + + QStringList getCodecAudio() const { + return m_codecAudio; + } + + void setCodecLabels(const QStringList& _value) { + m_codecLabels = _value; + } + + + QStringList getCodecLabels() const { + return m_codecLabels; + } + + void setCodecVideo(const QStringList& _value) { + m_codecVideo = _value; + } + + + QStringList getCodecVideo() const { + return m_codecVideo; + } + + + void setCodecLabelsAudio(const QStringList& _value) { + m_codecLabelsAudio = _value; + } + + + QStringList getCodecLabelsAudio() const { + return m_codecLabelsAudio; + } + + + void setDevices(const QStringList& _value) { + m_devices = _value; + } + + + QStringList getDevices() const { + return m_devices; + } + + void setDevicesLabels(const QStringList& _value) { + m_devicesLabels = _value; + } + + + QStringList getDevicesLabels() const { + return m_devicesLabels; + } + + void setDevicesIO(const QStringList& _value) { + m_devicesIO = _value; + } + + + QStringList getDevicesIO() const { + return m_devicesIO; + } + + void setUseMplayer(bool _value) { + m_useMplayer = _value; + } + + + bool getUseMplayer() const { + return m_useMplayer; + } + + void setUseGL(bool _value) { + m_useGL = _value; + } + + + bool getUseGL() const { + return m_useGL; + } + + void setPrefMp4AspectRatio(bool _value) { + m_prefMp4AspectRatio = _value; + } + + + bool getPrefMp4AspectRatio() const { + return m_prefMp4AspectRatio; + } + + void setPrefMp42Passes(bool _value) { + m_prefMp42Passes = _value; + } + + + bool getPrefMp42Passes() const { + return m_prefMp42Passes; + } + + void setMplayerVout(const int& _value) { + m_MplayerVout = _value; + } + + + int getMplayerVout() const { + return m_MplayerVout; + } + + void setMplayerAout(const int& _value) { + m_MplayerAout = _value; + } + + + int getMplayerAout() const { + return m_MplayerAout; + } + + void setPrefAudioBitrate(int _value) { + m_prefAudioBitrate = _value; + } + + + int getPrefAudioBitrate() const { + return m_prefAudioBitrate; + } + + void setPrefButtonWidth(int _value) { + m_prefButtonWidth = _value; + } + + + int getPrefButtonWidth() const { + return m_prefButtonWidth; + } + + void setPrefButtonHeight(int _value) { + m_prefButtonHeight = _value; + } + + + int getPrefButtonHeight() const { + return m_prefButtonHeight; + } + + void setPrefButtonHiliteColor(const QColor& _value) { + m_prefButtonHiliteColor = _value; + } + + + QColor getPrefButtonHiliteColor() const { + return m_prefButtonHiliteColor; + } + + void setPrefButtonTextColor(const QColor& _value) { + m_prefButtonTextColor = _value; + } + + + QColor getPrefButtonTextColor() const { + return m_prefButtonTextColor; + } + + + void setPrefButtonFont(const QFont& _value) { + m_prefButtonFont = _value; + } + + + QFont getPrefButtonFont() const { + return m_prefButtonFont; + } + +}; + +#endif diff --git a/libk9copy/k9drawimage.cpp b/libk9copy/k9drawimage.cpp new file mode 100644 index 0000000..89aba8f --- /dev/null +++ b/libk9copy/k9drawimage.cpp @@ -0,0 +1,49 @@ +// +// C++ Implementation: k9drawimage +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9drawimage.h" +#include + +k9DrawImage::k9DrawImage(QWidget *parent, const char *name) + : QWidget(parent, name) +{ +} + + +k9DrawImage::~k9DrawImage() +{ +} + +void k9DrawImage::setImage(const QImage &_image){ + m_pixmap =_image; + repaint(); +} + +void k9DrawImage::setImage(QString _fileName) { + m_pixmap.load(_fileName); + repaint(); +} + +void k9DrawImage::paintEvent ( QPaintEvent * ) { + int top,left; + QPainter p(this); + + double wratio=(double)width()/(double)m_pixmap.width(); + double hratio=(double)height()/(double)m_pixmap.height(); + double ratio= wratio < hratio ? wratio:hratio; + + top =(int) (height() -m_pixmap.height()*ratio)/2+1; + left =(int) (width() -m_pixmap.width()*ratio)/2 ; + + p.scale(ratio,ratio); + p.drawPixmap((int)(left/ratio),(int)(top/ratio),m_pixmap); + } +#include "k9drawimage.moc" diff --git a/libk9copy/k9drawimage.h b/libk9copy/k9drawimage.h new file mode 100644 index 0000000..87c8f9b --- /dev/null +++ b/libk9copy/k9drawimage.h @@ -0,0 +1,36 @@ +// +// C++ Interface: k9drawimage +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9DRAWIMAGE_H +#define K9DRAWIMAGE_H + +#include +#include + +/** + @author Jean-Michel PETIT +*/ +class k9DrawImage : public QWidget +{ +Q_OBJECT +public: + k9DrawImage(QWidget *parent = 0, const char *name = 0); + void setImage(QString _fileName); + void setImage(const QImage &_image); + ~k9DrawImage(); +private: + QPixmap m_pixmap; + +protected: + void paintEvent ( QPaintEvent *); +}; + +#endif diff --git a/libk9copy/k9dvd.cpp b/libk9copy/k9dvd.cpp new file mode 100755 index 0000000..7ef0098 --- /dev/null +++ b/libk9copy/k9dvd.cpp @@ -0,0 +1,1095 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#include "k9dvd.h" +#include "k9dvdtitle.h" +#include "k9dvdtitleset.h" +#include "k9cellcopylist.h" +#include "k9dvdprogress.h" +#include "k9ifo2.h" +#include +#include +#include + +#include + + +k9DVDTitle* k9DVD::gettitle(int num) { + return ((k9DVDTitle*)m_titles.at(num)); +} + +k9DVDTitle* k9DVD::gettitleByNum(int num) { + int j=-1; + for (uint i=0; i < m_titles.count();i++) { + k9DVDTitle *track=(k9DVDTitle*)m_titles.at(i); + if (track->getIndexed()) { + j++; + if (j==num) + return track; + } + } + return (NULL); +} + + +/** Read property of int longestTitle. */ +k9DVDTitle *k9DVD::getlongestTitle() { + return m_longestTitle; +} + +/** Read property of QString title. */ +const QString& k9DVD::getDVDTitle() { + return m_title; +} + +void k9DVD::setDVDTitle(const QString &_newVal) { + m_title=_newVal; +} + +/** Read property of int titleCount. */ +const int& k9DVD::gettitleCount() { + return m_titleCount; +} + +/** Read property of int titlesetCount. */ +const int& k9DVD::gettitlesetCount() { + return m_titlesetCount; +} + +k9DVDTitleset *k9DVD::gettitleset(int num) { + return m_titlesets.at(num); +} + +int k9DVD::getmenuSize() { + return m_menuSize; +} + +k9DVD::k9DVD(QObject *parent, const char *name,const QStringList args) { + m_error=false; + m_opened=false; + m_titles.setAutoDelete(true); + m_titlesets.setAutoDelete(true); + m_lvideoFormat.append("NTSC"); + m_lvideoFormat.append("PAL"); + + m_laspectRatio.append("4:3"); + m_laspectRatio.append("16:9"); + m_laspectRatio.append("?:?"); + m_laspectRatio.append("16:9"); + + m_lquantization.append("16bps"); + m_lquantization.append("20bps"); + m_lquantization.append("24bps"); + m_lquantization.append("drc"); + + m_lmpegVersion.append("mpeg1"); + m_lmpegVersion.append("mpeg2"); + + m_lvideoHeight.append("480"); + m_lvideoHeight.append("576"); + m_lvideoHeight.append("???"); + m_lvideoHeight.append("576"); + + m_lvideoWidth.append("720"); + m_lvideoWidth.append("704"); + m_lvideoWidth.append("352"); + m_lvideoWidth.append("352"); + + m_lpermittedDf.append(""); + m_lpermittedDf.append("noletterbox"); + m_lpermittedDf.append("nopanscan"); + m_lpermittedDf.append("noletterbox & nopanscan"); + + m_laudioFormat.append("ac3"); + m_laudioFormat.append("?"); + m_laudioFormat.append("mp2"); + m_laudioFormat.append("mp2"); + m_laudioFormat.append("pcm"); + m_laudioFormat.append("sdds"); + m_laudioFormat.append("dts"); + + m_lsampleFreq.append("48kHz"); + m_lsampleFreq.append("48kHz"); + + m_laudioType.append(""); + m_laudioType.append("Normal"); + m_laudioType.append(i18n("for visually impaired")); + m_laudioType.append(i18n("director's comments")); + m_laudioType.append(i18n("alternate director's comments")); + + m_lsubpType.append(""); + m_lsubpType.append("Normal"); + m_lsubpType.append(i18n("Large")); + m_lsubpType.append(i18n("Children")); + m_lsubpType.append(i18n("reserved")); + m_lsubpType.append(i18n("Normal captions")); + m_lsubpType.append(i18n("Large captions")); + m_lsubpType.append(i18n("Children captions")); + m_lsubpType.append(""); + m_lsubpType.append(i18n("Forced")); + m_lsubpType.append(i18n("reserved")); + m_lsubpType.append(i18n("reserved")); + m_lsubpType.append(i18n("reserved")); + m_lsubpType.append(i18n("Director's comments")); + m_lsubpType.append(i18n("Large director's comments")); + m_lsubpType.append(i18n("Director's comments for children")); + + + m_frames_per_s[0]=-1.0; + m_frames_per_s[1]=25.00; + m_frames_per_s[2]=-1.0; + m_frames_per_s[3]=29.97; + + m_start=NULL; +} +k9DVD::~k9DVD() { + if (m_dvd.opened()) + m_dvd.close(); +} + +int k9DVD::dvdtime2msec(dvd_time_t *dt) { + double fps = m_frames_per_s[(dt->frame_u & 0xc0) >> 6]; + long ms; + ms = (((dt->hour & 0xf0) >> 3) * 5 + (dt->hour & 0x0f)) * 3600000; + ms += (((dt->minute & 0xf0) >> 3) * 5 + (dt->minute & 0x0f)) * 60000; + ms += (((dt->second & 0xf0) >> 3) * 5 + (dt->second & 0x0f)) * 1000; + + if(fps > 0) + ms +=(long)( ((dt->frame_u & 0x30) >> 3) * 5 + (dt->frame_u & 0x0f) * 1000.0 / fps); + + return ms; +} + +/* +* The following method is based on code from vobcopy, by Robos, with thanks. +*/ + +int k9DVD::get_title_name(const char* dvd_device, char* title) { + FILE *filehandle = 0; + int i; + QString c; + if (! (filehandle = fopen(dvd_device, "r"))) { + c=i18n("Couldn't open %1 for title\n").arg(dvd_device); + // setError(c ); + strcpy(title, i18n("unknown").latin1()); + return -1; + } + + if ( fseek(filehandle, 32808, SEEK_SET )) { + fclose(filehandle); + c=i18n("Couldn't seek in %1 for title\n").arg( dvd_device); + setError(c); + strcpy(title, i18n("unknown").latin1()); + return -1; + } + + if ( 32 != (i = fread(title, 1, 32, filehandle)) ) { + fclose(filehandle); + // c=tr2i18n("Couldn't read enough bytes for title.\n"); + // setError(c); + strcpy(title, i18n("unknown").latin1()); + return 0; + } + + fclose (filehandle); + + title[32] = '\0'; + while(i-- > 2) + if(title[i] == ' ') + title[i] = '\0'; + return 0; +} + +QString k9DVD::lang_name(const QString& code,const QString & name) { + QString c; + int i=0; + lng arrLng[] = { + { " ", i18n("Not Specified") }, { "aa", i18n("Afar") }, { "ab", i18n("Abkhazian") }, { "af", i18n("Afrikaans") }, { "am", i18n("Amharic")}, + { "ar", i18n("Arabic") }, { "as", i18n("Assamese") }, { "ay", i18n("Aymara") }, { "az", i18n("Azerbaijani") }, { "ba", i18n("Bashkir") }, + { "be", i18n("Byelorussian") }, { "bg", i18n("Bulgarian") }, { "bh", i18n("Bihari") }, { "bi", i18n("Bislama") }, { "bn", i18n("Bengali; Bangla") }, + { "bo", i18n("Tibetan") }, { "br", i18n("Breton") }, { "ca", i18n("Catalan") }, { "co", i18n("Corsican") }, { "cs", i18n("Czech") }, + { "cy", i18n("Welsh") }, { "da", i18n("Dansk") }, { "de", i18n("Deutsch") }, { "dz", i18n("Bhutani") }, { "el", i18n("Greek") }, { "en", i18n("English") }, + { "eo", i18n("Esperanto") }, { "es", i18n("Espanol") }, { "et", i18n("Estonian") }, { "eu", i18n("Basque") }, { "fa", i18n("Persian") }, + { "fi", i18n("Suomi") }, { "fj", i18n("Fiji") }, { "fo", i18n("Faroese") }, { "fr", i18n("Francais") }, { "fy", i18n("Frisian") }, { "ga", i18n("Gaelic") }, + { "gd", i18n("Scots Gaelic") }, { "gl", i18n("Galician") }, { "gn", i18n("Guarani") }, { "gu", i18n("Gujarati") }, { "ha", i18n("Hausa") }, + { "he", i18n("Hebrew") }, { "hi", i18n("Hindi") }, { "hr", i18n("Hrvatski") }, { "hu", i18n("Magyar") }, { "hy", i18n("Armenian") }, + { "ia", i18n("Interlingua") }, { "id", i18n("Indonesian") }, { "ie", i18n("Interlingue") }, { "ik", i18n("Inupiak") }, { "in", i18n("Indonesian") }, + { "is", i18n("Islenska") }, { "it", i18n("Italiano") }, { "iu", i18n("Inuktitut") }, { "iw", i18n("Hebrew") }, { "ja", i18n("Japanese") }, + { "ji", i18n("Yiddish") }, { "jw", i18n("Javanese") }, { "ka", i18n("Georgian") }, { "kk", i18n("Kazakh") }, { "kl", i18n("Greenlandic") }, + { "km", i18n("Cambodian") }, { "kn", i18n("Kannada") }, { "ko", i18n("Korean") }, { "ks", i18n("Kashmiri") }, { "ku", i18n("Kurdish") }, + { "ky", i18n("Kirghiz") }, { "la", i18n("Latin") }, { "ln", i18n("Lingala") }, { "lo", i18n("Laothian") }, { "lt", i18n("Lithuanian") }, + { "lv", i18n("Latvian, Lettish") }, { "mg", i18n("Malagasy") }, { "mi", i18n("Maori") }, { "mk", i18n("Macedonian") }, { "ml", i18n("Malayalam") }, + { "mn", i18n("Mongolian") }, { "mo", i18n("Moldavian") }, { "mr", i18n("Marathi") }, { "ms", i18n("Malay") }, { "mt", i18n("Maltese") }, + { "my", i18n("Burmese") }, { "na", i18n("Nauru") }, { "ne", i18n("Nepali") }, { "nl", i18n("Nederlands") }, { "no", i18n("Norsk") }, { "oc", i18n("Occitan") }, + { "om", i18n("Oromo") }, { "or", i18n("Oriya") }, { "pa", i18n("Punjabi") }, { "pl", i18n("Polish") }, { "ps", i18n("Pashto, Pushto") }, + { "pt", i18n("Portugues") }, { "qu", i18n("Quechua") }, { "rm", i18n("Rhaeto-Romance") }, { "rn", i18n("Kirundi") }, { "ro", i18n("Romanian") }, + { "ru", i18n("Russian") }, { "rw", i18n("Kinyarwanda") }, { "sa", i18n("Sanskrit") }, { "sd", i18n("Sindhi") }, { "sg", i18n("Sangho") }, + { "sh", i18n("Serbo-Croatian") }, { "si", i18n("Sinhalese") }, { "sk", i18n("Slovak") }, { "sl", i18n("Slovenian") }, { "sm",i18n( "Samoan") }, + { "sn", i18n("Shona") }, { "so", i18n("Somali") }, { "sq", i18n("Albanian") }, { "sr", i18n("Serbian") }, { "ss", i18n("Siswati") }, + { "st", i18n("Sesotho") }, { "su", i18n("Sundanese") }, { "sv", i18n("Svenska") }, { "sw", i18n("Swahili") }, { "ta", i18n("Tamil") }, + { "te", i18n("Telugu") }, { "tg", i18n("Tajik") }, { "th", i18n("Thai") }, { "ti", i18n("Tigrinya") }, { "tk", i18n("Turkmen") }, { "tl", i18n("Tagalog") }, + { "tn", i18n("Setswana") }, { "to", i18n("Tonga") }, { "tr", i18n("Turkish") }, { "ts", i18n("Tsonga") }, { "tt", i18n("Tatar") }, { "tw", i18n("Twi") }, + { "ug", i18n("Uighur") }, { "uk", i18n("Ukrainian") }, { "ur", i18n("Urdu") }, { "uz", i18n("Uzbek") }, { "vi", i18n("Vietnamese") }, + { "vo", i18n("Volapuk") }, { "wo", i18n("Wolof") }, { "xh", i18n("Xhosa") }, { "yi", i18n("Yiddish") }, { "yo", i18n("Yoruba") }, { "za", i18n("Zhuang") }, + { "zh", i18n("Chinese") }, { "zu", i18n("Zulu") }, { "xx", i18n("Unknown") }, { "\0", i18n("Unknown") } }; + c=i18n("Unknown"); + for (i=0 ; arrLng[i].code[0]!=0;i++) { + lng l =arrLng[i]; + if (name=="") { + if (strcmp(code.latin1(),l.code)==0) { + c = l.name; + } + } else { + if (strcmp(name.latin1(),l.name)==0) { + c = l.code; + } + + } + } + return c; +} + + +int k9DVD::calcNumTitle(ifo_handle_t *ifo,int _vts,int _ttn) { + for (int i=0; i< ifo->tt_srpt->nr_of_srpts;i++) { + if (ifo->tt_srpt->title[i].title_set_nr==_vts && ifo->tt_srpt->title[i].vts_ttn == _ttn) + return (i+1); + } + return 0; + +} + +int k9DVD::scandvd (const QString & device,bool _quickScan) { + char ctitle[255]; + k9DVDChapter::setcptChapter(0); + ifo_handle_t *ifo_zero, *ifo; + pgcit_t *vts_pgcit; + vtsi_mat_t *vtsi_mat; + vmgi_mat_t *vmgi_mat; + audio_attr_t *audio_attr; + video_attr_t *video_attr; + subp_attr_t *subp_attr; + pgc_t *pgc; + int i, j, ltitles, cell, vts_ttn, title_set_nr; + char lang_code[3]; + int has_title = 0; + int max_length = 0; + bool ok; + tt_srpt_t *tt_srpt; + QString txt,c; + + m_start=NULL; + int menuSizes[100]; + for ( j=0; j<100;j++) + menuSizes[j]=0; + + m_titles.clear(); + m_Device=device; + + m_error=false; + m_errMsg=""; + + if (!_quickScan) { + m_progressDlg= new k9DVDProgress(qApp->mainWidget(),"progress",true); + m_progressDlg->setpbTitleStep(0); + m_progressDlg->setpbTotalStep(0); + + connect(this, SIGNAL(sigVobProgress(unsigned int,unsigned int)), this, SLOT(slotVobProgress(unsigned int,unsigned int))); + connect(this, SIGNAL(sigTitleProgress(unsigned int,unsigned int)), this, SLOT(slotTitleProgress(unsigned int,unsigned int))); + connect(this, SIGNAL(sigTitleText(QString&)), this, SLOT(slotTitleText(QString&))); + connect(this, SIGNAL(sigTotalText(QString&)), this, SLOT(slotTotalText(QString&))); + m_progressDlg->show(); + } else + m_progressDlg=NULL; + + qApp->processEvents(); + + k9DVDTitle *l_track; + k9DVDAudioStream *l_auds; + k9DVDChapter *l_chap; + k9DVDSubtitle *l_sub; + QString sh,sm,ss; + /* + ret = stat(device.latin1(), &dvd_stat); + if ( ret < 0 ) { + c=i18n("Can't find device %1\n").arg( device); + setError(c); + return 1; + } + */ + + if (m_dvd.opened()) + m_dvd.close(); + m_dvd.openDevice(device); + if( !m_dvd.opened() ) { + c=i18n("Can't open disc %1!\n").arg(device); + setError(c); + return 2; + } + +// k9Ifo2 kifo_zero(&m_dvd),kifo(&m_dvd); +// kifo_zero.openIFO( 0); + k9Ifo2 *kifo_zero= m_dvd.getIfo(0); + k9Ifo2 *kifo; + + ifo_zero = kifo_zero->getIFO(); + if ( !ifo_zero ) { + c=tr2i18n("Can't open main ifo!\n"); + setError(c); + return 3; + } + + ltitles = ifo_zero->tt_srpt->nr_of_srpts; + m_titleCount = 0; + has_title = get_title_name(device.utf8(), ctitle); + + vmgi_mat = ifo_zero->vmgi_mat; + m_titlesetCount = vmgi_mat->vmg_nr_of_title_sets; + + menuSizes[0]=vmgi_mat->vmg_last_sector; + + m_title=( has_title ? tr2i18n("unknown") : ctitle); + + for (int ts=1;ts <=m_titlesetCount;ts++) { + tt_srpt = ifo_zero->tt_srpt; + kifo=m_dvd.getIfo(ts); + ifo = kifo->getIFO(); + if (ifo==NULL) + continue; + //add the titleset in the titleset list + k9DVDTitleset *titleset = new k9DVDTitleset(ts,ifo->vtsi_mat->vts_last_sector -ifo->vtsi_mat->vtstt_vobs-1); + m_titlesets.append(titleset); + + for (j=0; j < ifo->vts_pgcit->nr_of_pgci_srp; j++) { + // tt_srpt->title[j].title_set_nr); + // GENERAL + vtsi_mat = ifo->vtsi_mat; + vts_pgcit = ifo->vts_pgcit; + pgc = vts_pgcit->pgci_srp[j].pgc; + //retrieve the ttn + int ttn=(vts_pgcit->pgci_srp[j].entry_id) & 0x7F; + bool entryPgc= (vts_pgcit->pgci_srp[j].entry_id & 0x80)==0x80; + int numTitle=calcNumTitle(ifo_zero,ts,ttn); + //JMP : vérifier la numérotation des titres ...... + if (vtsi_mat && (pgc->nr_of_cells >0)) { + m_titleCount++; + vts_ttn = ttn;//ifo->vts_ptt_srpt->title[j].ptt[0].pgcn; //ifo_zero->tt_srpt->title[j].vts_ttn; + + //JMPtxt=i18n("Title %1").arg(indexedCount); + txt=i18n("Title %1").arg(numTitle); + emit sigTotalText (txt); + emit sigTitleProgress(numTitle,ltitles); + video_attr = &vtsi_mat->vts_video_attr; + + vmgi_mat = ifo_zero->vmgi_mat; + title_set_nr = ts; //ifo_zero->tt_srpt->title[j].title_set_nr; + menuSizes[title_set_nr]=vtsi_mat->vtstt_vobs + vtsi_mat->vtsi_last_sector +1; + + //vts_pgcit->pgci_srp[ifo->vts_ptt_srpt->title[vts_ttn - 1].ptt[0].pgcn - 1].pgc; + + int titleStartSector=pgc->cell_playback[0].first_sector; + //l_track=addTitle(j+1,title_set_nr,ifo->vts_ptt_srpt->title[vts_ttn - 1].ptt[0].pgcn - 1,titleStartSector,isTitleIndex(ifo_zero,ts,vts_ttn)); + l_track=addTitle(titleset,m_titleCount, numTitle,title_set_nr,j,titleStartSector, entryPgc); + titleset->add + (l_track); + + sh.sprintf("%02x",pgc->playback_time.hour); + sm.sprintf("%02x",pgc->playback_time.minute); + ss.sprintf("%02x",pgc->playback_time.second); + l_track->length.setHMS(sh.toInt(&ok,10),sm.toInt(&ok,10),ss.toInt(&ok,10)); + + //printf(tr2i18n("Title: %02d, Length: %02x:%02x:%02x "), j+1, pgc->playback_time.hour, pgc->playback_time.minute, pgc->playback_time.second); + + if (dvdtime2msec(&pgc->playback_time) > max_length && entryPgc) { + max_length = dvdtime2msec(&pgc->playback_time); + m_longestTitle = l_track; + } + + l_track->chapterCount = pgc->nr_of_programs;// ifo_zero->tt_srpt->title[j].nr_of_ptts; + l_track->audioStreamCount = vtsi_mat->nr_of_vts_audio_streams; + l_track->subPictureCount = vtsi_mat->nr_of_vts_subp_streams; + l_track->VTS = ts;// ifo_zero->tt_srpt->title[j].title_set_nr; + l_track->TTN = ttn; // ifo_zero->tt_srpt->title[j].vts_ttn; + l_track->FPS = m_frames_per_s[(pgc->playback_time.frame_u & 0xc0) >> 6]; + l_track->format= (*m_lvideoFormat.at(video_attr->video_format)); + m_format = l_track->format; + /* QStringList::Iterator it; + it= videoFormat.at(video_attr->video_format); + c= (*it).latin1(); + */ + + l_track->aspectRatio = (*m_laspectRatio.at(video_attr->display_aspect_ratio)); + l_track->width = (*m_lvideoWidth.at(video_attr->picture_size)); + ; + l_track->height = (*m_lvideoHeight.at(video_attr->video_format)); + l_track->DF = (*m_lpermittedDf.at(video_attr->permitted_df)); + + for (i=0; i<16; i++) { + QString pal; + pal.sprintf("%08x",pgc->palette[i]); + l_track->palette.append(pal); + } + + // ANGLES + l_track->angleCount = ifo_zero->tt_srpt->title[j].nr_of_angles; + + // AUDIO + // for (i=0; inr_of_vts_audio_streams; i++) { + l_track->audioStreamCount=0; + for (i=0; inr_of_vts_audio_streams; i++) { + if (pgc->audio_control[i]>>8 !=0) { + l_track->audioStreamCount++; + l_auds=l_track->addAudioStream(); + l_auds->id = 1+ ((pgc->audio_control[i]>>8) & 0x7) ; + //this only true for AC3 streams + l_auds->m_streamId = (pgc->audio_control[i]>>8); + audio_attr = &vtsi_mat->vts_audio_attr[i]; + //dts stream starts at 0x88 + if (audio_attr->audio_format==6) + l_auds->m_streamId +=8; + //JMPaudio_attr = &vtsi_mat->vts_audio_attr[l_auds->id-1]; + snprintf(lang_code,3, "%c%c", audio_attr->lang_code>>8, audio_attr->lang_code & 0xff); + if (!lang_code[0]) { + lang_code[0] = 'x'; + lang_code[1] = 'x'; + } + l_auds->langCod=lang_code; + l_auds->language=lang_name(l_auds->langCod,""); + if (l_auds->language==i18n("Unknown")) + l_auds->langCod="xx"; + + l_auds->format= (*m_laudioFormat.at(audio_attr->audio_format)); + l_auds->frequency = (*m_lsampleFreq.at(audio_attr->sample_frequency)); + l_auds->quantization = (*m_lquantization.at(audio_attr->quantization)); + l_auds->channels = audio_attr->channels+1; + l_auds->appMode = audio_attr->application_mode; + l_auds->content = (*m_laudioType.at(audio_attr->code_extension)); + //if (((pgc->audio_control[i]>>8) & 0x80) ==0x80) { + //} else { + // l_auds->id=1; + //} + } + } + l_track->m_defAudio=NULL; + l_track->m_defSubtitle=NULL; + // CHAPTERS + cell = 0; + unsigned long total_sectors = 0; + + l_track->chapterCount= pgc->nr_of_programs; + for (i=0;i < l_track->chapterCount;i++) + l_track->addChapter(i+1); + + k9DVDChapter *l_pchap=NULL; + for (i=0; inr_of_programs; i++) { + int second=0, minute=0, hour=0, tmp; + char hex[3]; + int next = pgc->program_map[i+1]; + unsigned long sectors = 0; + l_chap = l_track->getChapter(i); + //first sector + l_chap->startSector=pgc->cell_playback[cell].first_sector; + ; + l_chap->endSector=0; + if (i == pgc->nr_of_programs - 1) + next = pgc->nr_of_cells + 1; + + int iangleStart=-1,iangleEnd=-1; + while (cell < next - 1) { + //using c2 otherwise the value of cell were lost + //int c2=cell; + //l_chap->cells.append(c2); + int startSect=pgc->cell_playback[cell].first_sector; + l_chap->startSectors.append(startSect); + + snprintf(hex,3, "%02x", pgc->cell_playback[cell].playback_time.second); + tmp = second + atoi(hex); + minute = minute + (tmp / 60); + second = tmp % 60; + snprintf(hex,3, "%02x", pgc->cell_playback[cell].playback_time.minute); + tmp = minute + atoi(hex); + hour = hour + (tmp / 60); + minute = tmp % 60; + + l_chap->endSector= pgc->cell_playback[cell].last_sector; + //last sector + + /* Check if we're entering an angle block. (vamp_play-title) */ + int cell2=cell; + if ( pgc->cell_playback[ cell ].block_type + == BLOCK_TYPE_ANGLE_BLOCK && cell>iangleEnd ) { + iangleStart=cell; + for( int idc = 0;; ++idc ) { + k9ChapterCell * chapterCell=new k9ChapterCell(cell2+idc,idc+1); + l_chap->cells.append(chapterCell); + chapterCell->setstartSector(pgc->cell_playback[cell2+idc].first_sector); + chapterCell->setlastSector(pgc->cell_playback[cell2+idc].last_sector); + if (idc==0) + chapterCell->setangleBlock(angleStart); + else + chapterCell->setangleBlock(angleInside); + if( pgc->cell_playback[ cell2 + idc ].block_mode + == BLOCK_MODE_LAST_CELL ) { + iangleEnd=cell2+idc; + chapterCell->setangleBlock(angleEnd); + sectors += pgc->cell_playback[iangleEnd].last_sector - pgc->cell_playback[iangleStart].first_sector + 1; + + break; + } + } + } else { + if (!(cell>=iangleStart && cell <=iangleEnd)) { + k9ChapterCell * chapterCell=new k9ChapterCell(cell,1); + l_chap->cells.append(chapterCell); + chapterCell->setstartSector(pgc->cell_playback[cell].first_sector); + chapterCell->setlastSector(pgc->cell_playback[cell].last_sector); + + sectors += pgc->cell_playback[cell].last_sector - pgc->cell_playback[cell].first_sector + 1; + + } + } + cell++; + + } + + l_track->vobusize_mb += calcVobuSize(ifo,l_chap); + total_sectors += sectors; + l_chap->length.setHMS(hour,minute,second); + l_chap->sectors=sectors; + if (l_pchap!=NULL) { + QTime t; + int position; + t.setHMS(0,0,0); + position=t.secsTo(l_chap->length); + t=l_pchap->time.addSecs(position); + l_chap->time=t; + } + l_pchap=l_chap; + } + l_track->size_mb =((float)total_sectors *2048)/(1024*1024); + l_track->m_sectors= total_sectors; + // SUBTITLES + l_track->subPictureCount=0; + for (i=0; inr_of_vts_subp_streams; i++) { + if (pgc->subp_control[i]>>24 !=0) { + l_sub=l_track->addSubtitle(i+1); + unsigned char subpc; + subpc=pgc->subp_control[i]>>24; + if ((subpc & 0x80)==0x80) { + if (l_track->aspectRatio=="4:3") { + l_sub->id.append(1+ (subpc & 0x1F)); + } else { + subpc=(pgc->subp_control[i]>>16) & 0x1F; + l_sub->id.append(1+ subpc); + subpc=(pgc->subp_control[i]>>8) & 0x1F; + if (! l_sub->id.contains(1+ subpc) && ! l_track->DF.contains("noletterbox")) + l_sub->id.append(1+ subpc); + subpc=pgc->subp_control[i] & 0x1F; + if (! l_sub->id.contains(1+ subpc) && ! l_track->DF.contains("nopanscan")) + l_sub->id.append(1+ subpc); + } + kdDebug() << "VTS: " << l_track->VTS << " TTN: " << l_track->TTN << \ + " Subtitle " << i+1 << ": " << l_sub->id << " " << l_sub->language << \ + " " << l_sub->content << endl; + } + l_track->subPictureCount++; + subp_attr = &vtsi_mat->vts_subp_attr[i]; + snprintf(lang_code,3, "%c%c", subp_attr->lang_code>>8, subp_attr->lang_code & 0xff); + if (!lang_code[0]) { + lang_code[0] = 'x'; + lang_code[1] = 'x'; + } + //JMP : l_sub->setselected(!titleIndexed); + l_sub->langCod=lang_code; + l_sub->language=lang_name(lang_code,""); + l_sub->content= (*m_lsubpType.at(subp_attr->code_extension)); + } + } + if (entryPgc && !_quickScan) + calcStreamSize(*l_track); + } + + } + //kifo.closeIFO(); + } + m_menuSize=0; + for (j=0;j<100;j++) + m_menuSize+=menuSizes[j]; + //kifo_zero.closeIFO(); + + if (!_quickScan) + delete m_progressDlg; + + m_progressDlg=0; + m_opened=true; + //m_dvd.close(); + return 0; +} + +float k9DVD::calcVobuSize(ifo_handle_t *_ifo,k9DVDChapter *_chapter) { + vobu_admap_t * vobu_admap = _ifo->vts_vobu_admap; + int length = vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE; + float total=0; + for(uint32_t i = 0; i < length/sizeof(uint32_t); i++) { + if(vobu_admap->vobu_start_sectors[i] >= _chapter->startSector + &&vobu_admap->vobu_start_sectors[i] <= _chapter->endSector) + total++; + } + + total=total*2048; + total=total/(1024*1024); + return total; + +} + +/** Adds a new track in the titles list the list is sorted by VTS and pgc*/ +k9DVDTitle* k9DVD::addTitle(k9DVDTitleset *_titleset,int id,int num,int _VTS,int _pgc,uint32_t _startSector,bool _indexed) { + k9DVDTitle *track,*tmp; + track = new k9DVDTitle; + track->numTitle=num; + track->indexed=_indexed; + track->id=id; + track->m_titleset=_titleset; + //JMP : modification + track->forceSelection = false; // !_indexed; + + track->ts_nr=_VTS; + track->pgc=_pgc; + bool bappend=true; + for (uint i=0;igetChapter(0); + + if (tmp->ts_nr >_VTS) { + bappend=false; + } else if ( (tmp->ts_nr==_VTS) && ((tmp->pgc >_pgc) || (chap->getstartSector() > _startSector)) ) { + bappend=false; + } + if (!bappend) { + m_titles.insert(i,track); + break; + } + + } + if (bappend) + m_titles.append(track); + track->name=i18n("Title %1").arg(num); + + if (!_indexed) { + for (uint i=0;inumTitle==num && tmp->indexed) + tmp->m_titles.append(track); + } + } + + return(track); + +} + +void k9DVD::calcStreamSize(k9DVDTitle & track) { + struct stream_counter streams[64]; + int stream_count; + int start = 0; + int stop = 0; + k9DVDChapter *c_start,*c_stop; + struct streamSize streamList[64]; + int c, x; + QString pg; + + for( x=0 ; x<64 ; x++ ) { // init stream usage list + streams[x].id = 0; + streams[x].count = 0; + streams[x].size_mb = 0; + streams[x].percent = 0; + streamList[x].id=0; + streamList[x].percent=0; + streamList[x].size_mb=0; + } + + x = 0; + c = 0; + + if( track.chapterCount == 2 ) { // select which chapters to probe for stream sizes + start=0; + stop=1; + } + if (track.chapterCount == 1) { + start=0; + stop=0; + } + if (track.chapterCount >2) { + start=0; + stop=(int)(track.chapterCount-1); + } + c_start=(k9DVDChapter*)track.chapters.at(start); + c_stop=(k9DVDChapter*)track.chapters.at(stop); + pg=tr2i18n("reading title"); + emit sigTitleText(pg); + + //probe stream usage + c = stream_vob( track.ts_nr,c_start->startSector, c_stop->endSector, streams); + + for( x=0 ; x<64 ; x++ ) { + if( streams[x].id == 0 ) + break; + streams[x].percent = (float)streams[x].count / (float)(c / 100.); // calc usage in percent + } + // create streamlist with all streams + stream_count=0; + for( c=0 ; c<64 ; c++ ) { + if( streams[c].id == 0 ) + break; + streamList[stream_count].id = streams[c].id; + if( stream_count >= 64 ) + break; + stream_count++; + x++; + } + + // other_streams_mb = 0; // calc size of all selected streams + for( x=0 ; xvideosize_mb = streamList[x].size_mb; + } + + for (i=0;iaudioStreamCount;i++) { + l_auds=(k9DVDAudioStream*)l_track->audioStreams.at(i); + for (x=0;x<64;x++) { + if (streamList[x].id==0) + break; + int id=streamList[x].id; + if (( (id >=0x80) && (id <=0x8f)) || ((id >=0xa0) && (id <=0xa7)) || ((id >=0xc0) && (id <=0xdf))) { + if ( getVampsID(id) == l_auds->id) { + l_auds->size_mb = streamList[x].size_mb; + //stop the loop, go to next audio stream + break; + } + } + + } + } + for (i=0;isubPictureCount;i++) { + l_sub=(k9DVDSubtitle*)l_track->subtitles.at(i); + for (x=0;x<64;x++) { + if (streamList[x].id==0) + break; + int id=streamList[x].id; + if ( (id >=0x20) && (id <=0x3f)) { + if ( l_sub->id.contains(id - 0x20 +1) ) { + l_sub->size_mb = streamList[x].size_mb; + break; + } + } + } + } + + +} + +int k9DVD::identify_stream( unsigned char *buffer ) { + uint8_t packet_type = buffer[17]; + + if( (packet_type >= 0xE0) && (packet_type <= 0xEF) ) { // video streams + ; + } else if( packet_type == 0xBB ) { // system header + ; + } else if( packet_type == 0xBE ) { // padding + ; + } else if( packet_type == 0xBF ) { // nav pack + ; + } else if( (packet_type >= 0xC0) && (packet_type <= 0xDF) ) { // mpeg audio + ; + } else if( packet_type == 0xBD ) { // private stream, check content + packet_type = buffer[23+buffer[22]]; + } + + return packet_type; +} + +long k9DVD::stream_vob( int title, unsigned long startblock, unsigned long lastblock, struct stream_counter *sc) { + + k9DVDFile *dvdfile; + //JMP unsigned char buffer[DVD_VIDEO_LB_LEN]; + unsigned char buffer[DVD_VIDEO_LB_LEN*800]; + unsigned char *ptrbuff; + int blocksize=800,y; + int step=(int)((lastblock-startblock)/800) / 10;// * 0.05; + if (step==0) + step=1; + unsigned char stream_id; + long total=0; + unsigned long i, x ,nbread=0; + ssize_t size; + QString c; + dvdfile =m_dvd.openTitle( title); + if( !dvdfile ) { + c=i18n("Error opening vobs for title %1\n").arg( title); + setError(c); + return 0; + } + + i = startblock; + while( (i >= startblock) && (i <= lastblock) && (blocksize>0)) { // read blocks + size= dvdfile->readBlocks( i,blocksize , buffer); + emit sigVobProgress(i-startblock,lastblock-startblock); + total+=size; + if( !size ) { + c=i18n("ERROR reading block %1\n").arg(i); + setError(c); + break; + } + ptrbuff=buffer; + for (y=0;y lastblock) + blocksize=lastblock-i; + + } + + dvdfile->close(); + return total; +} + + + +uint64_t k9DVD::getsizeSelected(bool _streams) { + uint64_t selstreams=0,vidstreams=0; + int i,x; + k9DVDTitle *l_track; + k9DVDAudioStream *l_auds; + k9DVDSubtitle *l_sub; + bool withvideo; + + for (i=0;iisSelected() && l_track->getIndexed(); + + if ( withvideo) { + vidstreams +=l_track->getsectors(); + if (_streams) { + for (x=0;xaudioStreamCount;x++) { + l_auds=l_track->getaudioStream(x); + if (!l_auds->selected) + selstreams += l_auds->size_mb*512; + } + for (x=0;xsubPictureCount;x++) { + l_sub=l_track->getsubtitle(x); + if (!l_sub->selected) + selstreams += l_sub->size_mb*512; + } + } + } + } + vidstreams -=selstreams; + + return (vidstreams ); +} + + +float k9DVD::getfactor(bool _withMenus,bool _streams,bool _useDvdAuthor) { + if (!_useDvdAuthor || _withMenus) { + //m_dvd.openDevice(Device); + k9CellCopyList *cellCopyList =new k9CellCopyList(&m_dvd,this); + double factor=cellCopyList->getfactor(_withMenus,_streams); + //m_dvd.close(); + return (factor); + } else { + float selstreams=0,vidstreams=0,l_factor; + int i,x; + k9DVDTitle *l_track; + k9DVDAudioStream *l_auds; + k9DVDSubtitle *l_sub; + bool withvideo; + double forced=0,forcedsh=0; + for (i=0;iisSelected() && l_track->getIndexed(); + + if ( withvideo) { + //size_mb = size of titles - size of unselected chapters + float size_mb=l_track->gettotalsize_mb()-l_track->getChaptersSize_mb( false) ; //gettotalsize_mb does include parts of titles + vidstreams +=size_mb ; + if (l_track->getforceFactor()) { + forced+=size_mb; + forcedsh+=(size_mb/l_track->getfactor()); + } + if (_streams) { + for (x=0;xaudioStreamCount;x++) { + l_auds=l_track->getaudioStream(x); + if (!l_auds->selected) + selstreams += l_auds->size_mb; + } + for (x=0;xsubPictureCount;x++) { + l_sub=l_track->getsubtitle(x); + if (!l_sub->selected) + selstreams += l_sub->size_mb; + } + } + } + } + vidstreams -=selstreams; + + l_factor = ((float) vidstreams - forced) / (k9DVDSize::getMaxSize() - forcedsh); + l_factor = (int)((l_factor+0.01)*100); + l_factor /=100; + if (l_factor <1) + l_factor=1; + + return(l_factor); + } +} +void k9DVD::slotVobProgress(unsigned int position,unsigned int total) { + m_progressDlg->setpbTitleStep(position); + m_progressDlg->setpbTitleTotalSteps(total); + qApp->processEvents(); +} + +void k9DVD::slotTitleProgress(unsigned int position,unsigned int total) { + m_progressDlg->setpbTotalStep(position); + m_progressDlg->setpbTotalTotalSteps(total); + qApp->processEvents(); +} + +void k9DVD::slotTitleText(QString& text) { + m_progressDlg->setlblTitle(text); + qApp->processEvents(); +} + +void k9DVD::slotTotalText(QString& text) { + m_progressDlg->setlblTotal(text); + qApp->processEvents(); +} + +const QString& k9DVD::getDevice() { + return m_Device; +} + +const bool& k9DVD::geterror() { + return m_error; +} + +const QString& k9DVD::geterrMsg() { + return m_errMsg; +} + +void k9DVD::setError(const QString & err) { + m_error=true; + m_errMsg=err; + if (m_progressDlg !=NULL) + m_progressDlg->hide(); +} + +const bool& k9DVD::getopened() { + return m_opened; +} + + +QString &k9DVD::getFormat() { + return (m_format); +} + +int k9DVD::getVampsID(int type) { + int abase; + if (type >= 0x80 && type <= 0x87) { + // AC3 audio + abase = 0x80; + } else if (type >= 0x88 && type <= 0x8f) { + // DTS audio + abase = 0x88; + } else if (type >= 0xa0 && type <= 0xbf) { + // LPCM audio + abase = 0xa0; + } else if (type >= 0xc0 && type <= 0xdf) { + // MPEG audio + abase = 0xc0; + } + + return (type-abase +1); + +} + + +k9DVDTitle* k9DVD::getstart() { + return m_start; +} + +void k9DVD::setstart(k9DVDTitle* title) { + m_start=title; +} + +// returns the title number in the reauthored DVD +int k9DVD::getnewTitleNum(k9DVDTitle *title) { + int num=0; + k9DVDTitle *tr; + for (int i=0 ;i < m_titleCount;i++) { + tr=gettitle(i); + if (tr->isSelected() && tr->getIndexed()) { + ++num; + if (tr->getnumTitle() == title->getnumTitle()) + return(num); + } + } + + return(-1); +} + + +void k9DVD::close() { + m_opened=false; + if (m_dvd.opened()) + m_dvd.close(); + m_titles.clear(); + m_titlesets.clear(); +} diff --git a/libk9copy/k9dvd.h b/libk9copy/k9dvd.h new file mode 100755 index 0000000..55182df --- /dev/null +++ b/libk9copy/k9dvd.h @@ -0,0 +1,174 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#ifndef K9DVD_H +#define K9DVD_H +#include "k9common.h" +#include "k9dvdread.h" +#include +#include +#include + + +struct streamSize { + unsigned char id; + float size_mb; + float percent; +}; + +struct stream_counter { + unsigned char id; + int count; + float size_mb; + float percent; +}; + +class k9DVDProgress; +class k9DVDChapter; +class k9DVDTitle; +class k9DVDTitleset; + +/** get the DVD structure with titles lengths and streams lengths. + *@author + */ + +class k9DVD : public QObject { +Q_OBJECT +private: + QObjectList m_titles; + QPtrList m_titlesets; + QString m_title; + int m_titleCount; + k9DVDTitle *m_longestTitle; + QStringList m_lvideoFormat; + QStringList m_laspectRatio; + QStringList m_lquantization; + QStringList m_lmpegVersion; + QStringList m_lvideoHeight; + QStringList m_lvideoWidth; + QStringList m_lpermittedDf; + QStringList m_laudioFormat; + QStringList m_lsampleFreq; + QStringList m_laudioType; + QStringList m_lsubpType; + QStringList m_langCode; + QStringList m_langName; + double m_frames_per_s[4]; + uint m_menuSize; + k9DVDProgress *m_progressDlg; + QString m_Device; + bool m_error; + QString m_errMsg; + bool m_opened; + QString m_format; + k9DVDTitle* m_start; + int m_titlesetCount; +public: + k9DVD(QObject *parent=0,const char *name=0,const QStringList args=0) ; + ~k9DVD(); + + /** + * Opens and estimates the size of each stream + * @param device input device + * @return return code (0=ok) + */ + virtual int scandvd (const QString & device,bool _quickScan); + + /** + * gets the title of the DVD + * @return DVD title + */ + virtual const QString& getDVDTitle(); + + /** + * set the title of the DVD + * @param _newVal the new DVD title + */ + virtual void setDVDTitle(const QString &_newVal); + + /** + * + * @return returns the number of titles + */ + virtual const int& gettitleCount(); + + /** + * + * @return returns the number of titlesets + */ + virtual const int& gettitlesetCount(); + + + /** + * returns a title of the DVD + * @param num the title number + * @return the title + */ + virtual k9DVDTitle* gettitle(int num); + + /** + * returns a title (which is in tt_srpt) + * @param num the title number + * @return the title + */ + virtual k9DVDTitle* gettitleByNum(int num); + virtual k9DVDTitle *getlongestTitle(); + virtual float getfactor(bool withMenus,bool _streams,bool _useDvdAuthor); + virtual const QString& getDevice(); + virtual const bool& geterror(); + virtual const QString& geterrMsg(); + virtual const bool& getopened(); + virtual uint64_t getsizeSelected(bool _streams); + virtual QString &getFormat(); + virtual k9DVDTitle* getstart(); + virtual void setstart(k9DVDTitle* title); + virtual int getnewTitleNum(k9DVDTitle *title); + virtual int getmenuSize(); + virtual void close(); + virtual k9DVDTitleset *gettitleset(int num); + virtual k9DVDRead * getdvd() {return &m_dvd;} + static QString lang_name(const QString & code,const QString & name); +private: // Private methods + k9DVDRead m_dvd; + k9DVDTitle* addTitle(k9DVDTitleset *titleset,int id,int num,int _VTS,int _pgc,uint32_t _startSector, bool _indexed); + float calcVobuSize(ifo_handle_t *_ifo,k9DVDChapter *_chapter); + long stream_vob( int title, unsigned long startblock, unsigned long lastblock, struct stream_counter *sc); + int identify_stream( unsigned char *buffer ) ; + int dvdtime2msec(dvd_time_t *dt); + int get_title_name(const char* dvd_device, char* title); + void calcStreamSize(k9DVDTitle & title); + void setError(const QString &err); + int getVampsID(int type); + int calcNumTitle(ifo_handle_t *ifo,int _vts,int _ttn); +public slots: // Public slots + void slotVobProgress(unsigned int position,unsigned int total); + void slotTitleProgress(unsigned int position,unsigned int total); + void slotTitleText(QString &text); + void slotTotalText(QString &text); +signals: // Signals + void sigVobProgress(unsigned int position,unsigned int total); + void sigTitleProgress(unsigned int position,unsigned int total); + void sigTitleText(QString &text); + void sigTotalText(QString &text); +}; + +typedef struct lng { char code[3]; QString name;}; + +#endif + diff --git a/libk9copy/k9dvdauthor.cpp b/libk9copy/k9dvdauthor.cpp new file mode 100755 index 0000000..8ee4959 --- /dev/null +++ b/libk9copy/k9dvdauthor.cpp @@ -0,0 +1,591 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#include "k9dvdauthor.h" +#include "k9dvdtitle.h" +#include "k9dvdbackup.h" +#include "kmessagebox.h" +#include "k9tools.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +class k9Progress; + +k9DVDAuthor::k9DVDAuthor(QObject *DVDStruct,const char* name,const QStringList& args) { + DVD=(k9DVD*)DVDStruct; + xml=NULL; + cancelled=false; + error=false; + progress = new k9Progress(qApp->mainWidget(),"progress",NULL); + files.setAutoDelete(true); + +} +k9DVDAuthor::~k9DVDAuthor() { + QPtrListIterator it (files); + KTempFile *file; + while ( (file = it.current()) != 0 ) { + ++it; + file->file()->remove(); + } + if (xml!=NULL) + delete xml; + +} +/** No descriptions */ +void k9DVDAuthor::createXML() { + int i; + if (xml!=NULL) + delete xml; + xml=new QDomDocument(); + + QDomElement root = xml->createElement( "dvdauthor" ); + root.setAttribute ("dest",workDir+"dvd"); + xml->appendChild( root ); + + // Create vmgm menu + QDomElement vmgm = xml->createElement("vmgm"); + root.appendChild(vmgm); + addMenus(vmgm); + + m_totalPartSize=0; + + m_forced=0; + m_forcedsh=0; + uint64_t chapterssize=0; + //computes the size of related titles + for (int iTitle=0; iTitle < DVD->gettitleCount();iTitle++) { + k9DVDTitle *title=DVD->gettitle(iTitle); + if (title->isSelected() && title->getIndexed()) { + chapterssize+= title->getChaptersSize(false); + for (int iTitle2=0;iTitle2getTitles().count() ;iTitle2++) { + k9DVDTitle *title2=title->getTitles().at(iTitle2); + m_totalPartSize+= title2->getsize_mb() *1024*1024; + if (title->getforceFactor()) { + m_forced+=title2->getsectors()*2048; + m_forcedsh+=(title2->getsectors()/title->getfactor())*2048; + } + chapterssize+= title2->getChaptersSize(false); + } + } + //total size of forced titles + if (title->isSelected() && title->getforceFactor()) { + m_forced+=title->getsectors()*2048; + m_forcedsh+=(title->getsectors()/title->getfactor())*2048; + } + + } + + //total size of titles to copy + m_totalSize=((uint64_t)DVD->getsizeSelected(false))*DVD_VIDEO_LB_LEN + m_totalPartSize -chapterssize*DVD_VIDEO_LB_LEN; + + m_firsttitle=true; + + for (i=0;i< DVD->gettitleCount();i++) { + k9DVDTitle *tmp = DVD->gettitle(i); + addTitle(root,tmp); + } + + QString x = xml->toString(); + + //QFile file( locateLocal("tmp", "k9copy/k9author.xml" )); + + // if ( file.open( IO_WriteOnly ) ) { + QTextStream stream( m_xml->file() ); + xml->save(stream,1); + m_xml->file()->close(); + // } +} + +void k9DVDAuthor::addMenus(QDomElement &titleSet) { + int i; + QDomElement menu,video,pgc,pre,vob,button; + QDomText precmd; + QDomText buttonText; + QTime max(0,0); + QString c,start; + + k9DVDTitle * l_track= DVD->getstart(); + if (l_track==NULL) { + start="call vmgm menu;"; + } else { + if( DVD->getnewTitleNum(l_track)==-1) { + error=true; + QString sMsg; + //sMsg.QString::sprintf(tr2i18n("'%s' not selected"),l_track->getname().latin1()); + sMsg=i18n("'%1' not selected").arg(l_track->getname()); + KMessageBox::error( 0,sMsg, tr2i18n("authoring")); + } + start.sprintf("jump titleset %d menu;",DVD->getnewTitleNum(l_track)); + } + factor=DVD->getfactor(false,false,true); + menu=xml->createElement("menus"); + titleSet.appendChild(menu); + pgc=xml->createElement("pgc"); + pgc.setAttribute("entry","title"); + menu.appendChild(pgc); + pre=xml->createElement("pre"); + pgc.appendChild(pre); + precmd=xml->createTextNode(""); + QString cmd="if (g0==0) \n { \n subtitle=0; \n g0=1;\n "+start+"\n}\n"; + pre.appendChild(precmd); + int numt=0; + + for (i=0;i < DVD->gettitleCount();i++) { + if (DVD->gettitle(i)->isSelected() && DVD->gettitle(i)->getIndexed()) { + ++numt; + cmd+=c.sprintf("if (g1==%d) {jump titleset %d menu;}\n", numt,numt); + } + } + + precmd.setNodeValue(cmd); +} + +/** No descriptions */ +void k9DVDAuthor::addTitle(QDomElement &root, k9DVDTitle *title) { + int i,j; + + k9DVDSubtitle *l_sub; + k9DVDAudioStream *l_auds; + k9DVDTitle *l_track= title; + QDomElement e,t,pgc; + QString caud="",csub="",c,palette; + + if (l_track->isSelected() && l_track->getIndexed()) { + double titleFactor; + if (l_track->getforceFactor()) + titleFactor=l_track->getfactor(); + else + titleFactor=factor; + QDomElement titleSet = xml->createElement("titleset"); + root.appendChild(titleSet); + QDomElement titleMenu = xml->createElement("menus"); + titleSet.appendChild(titleMenu); + QDomElement pgc = xml->createElement("pgc"); + titleMenu.appendChild(pgc); + QDomElement pre = xml->createElement("pre"); + pgc.appendChild(pre); + QDomText precmd=xml->createTextNode(""); + + int subtitle=0,audio=-1; + if (l_track->getDefSubtitle() != NULL) { + for (int isub=0;isubgetsubPictureCount();isub++) { + if (l_track->getsubtitle(isub)->getselected()) { + subtitle++; + } + if (l_track->getsubtitle(isub)==l_track->getDefSubtitle()) + break; + } + } + if (l_track->getDefAudio() != NULL) { + for (int iaud=0;iaud < l_track->getaudioStreamCount();iaud++) { + if (l_track->getaudioStream(iaud)->getselected()) { + audio++; + } + if(l_track->getaudioStream(iaud)==l_track->getDefAudio()) + break; + } + } + + QString txtcmd; + if (audio !=-1) { + txtcmd="subtitle=%1;\n audio=%2;\n g1=0;jump title 1;"; + txtcmd=txtcmd.arg(subtitle+63).arg(audio); + } else { + txtcmd="subtitle=%1;\n g1=0;jump title 1;"; + txtcmd=txtcmd.arg(subtitle+63); + } + + precmd.setNodeValue(txtcmd); + pre.appendChild(precmd); + + //create palette for subpictures + KTempFile *paletteFile=new KTempFile(locateLocal("tmp", "k9copy/k9p"), ".yuv"); + files.append(paletteFile); + paletteFile->setAutoDelete(false); + palette=paletteFile->name(); + + //palette.sprintf("palette%d.yuv",l_track->getnumTitle()); + //palette= locateLocal("tmp", "k9copy/k9" +palette); + QTextStream stream( paletteFile->file() ); + for (j=0;j<16;j++) { + l_track->getpalette(j,c); + stream << c+"\n"; + } + paletteFile->file()->close(); + + t=xml->createElement("titles"); + titleSet.appendChild(t); + e=xml->createElement("video"); + e.setAttribute("aspect",l_track->getaspectRatio()); + e.setAttribute("format",l_track->getformat().lower()); + if (l_track->getaspectRatio()!="4:3") { + e.setAttribute("widescreen","nopanscan"); + } + t.appendChild(e); + + for (i=0;igetaudioStreamCount();i++) { + l_auds=l_track->getaudioStream(i); + if (l_auds->getselected()) { + e=xml->createElement("audio"); + e.setAttribute("format",l_auds->getformat()); + e.setAttribute("channels",l_auds->getchannels()); + e.setAttribute("quant",l_auds->getquantization()); + e.setAttribute("lang",l_auds->getlangCod()); + t.appendChild(e); + if (caud != "") + caud+=','; + caud+=c.sprintf("%d",l_auds->getID()); + } + } + + for (i=0;igetsubPictureCount();i++) { + l_sub=l_track->getsubtitle(i); + if (l_sub->getselected()) { + e=xml->createElement("subpicture"); + e.setAttribute("lang",l_sub->getlangCod()); + t.appendChild(e); + if (csub !="") + csub+=','; + csub+=c.sprintf("%d",(l_sub->getID()).first()); + } + } + + pgc=xml->createElement("pgc"); + pgc.setAttribute("palette",palette); + t.appendChild(pgc); +/* + for (i=0;igetaudioStreamCount();i++) { + l_auds=l_track->getaudioStream(i); + if (l_auds->getselected()) { + e=xml->createElement("audio"); + e.setAttribute("id",l_auds->getID()-1); + t.appendChild(e); + if (caud != "") + caud+=','; + caud+=c.sprintf("%d",l_auds->getID()); + } + } + + for (i=0;igetsubPictureCount();i++) { + l_sub=l_track->getsubtitle(i); + if (l_sub->getselected()) { + e=xml->createElement("subpicture"); + e.setAttribute("id",(l_sub->getID()).first()-1); + t.appendChild(e); + if (csub !="") + csub+=','; + csub+=c.sprintf("%d",(l_sub->getID()).first()); + } + } +*/ + if (caud !="") + caud="--audiofilter "+caud; + if (csub !="") + csub="--subpicturefilter "+csub; + + int numPart=0; + + for (int iTitle=0;iTitle<=l_track->getTitles().count();iTitle++) { + k9DVDTitle *title; + if (iTitle==0) + title=l_track; + else + title=l_track->getTitles().at(iTitle-1); + + for (i=0;igetchapterCount();i++) { + numPart++; + uint icell=0; + k9DVDChapter *l_chap=title->getChapter(i); + if (!l_chap->getSelected()) + continue; + + bool first=true; + uint32_t chapterSize= (l_chap->getendSector()-l_chap->getstartSector())*DVD_VIDEO_LB_LEN; + QString sChapter,sCell; + + for (k9ChapterCell *cell =l_chap->cells.first();cell ;cell =l_chap->cells.next() ) { + icell++; + + sCell = QString("--cell %1").arg(icell); + sChapter=QString("--chapter %1").arg(numPart); + + //test + uint32_t itotSize = (cell->getlastSector()-cell->getstartSector())* DVD_VIDEO_LB_LEN; + QString file; + e=xml->createElement("vob"); + file=QString("k9copy --play --input %1 --dvdtitle %2 %3 %4 %5 %6 --vampsfactor %7 --inputsize %8 --chaptersize %9 ") + .arg(DVD->getDevice()) + .arg(title->getnumTitle()) + .arg(sChapter) + .arg(sCell) + .arg(caud) + .arg(csub) + .arg(titleFactor,0,'f',2) + .arg(itotSize,0,'f',0) + .arg(chapterSize,0,'f',0); + if (m_firsttitle) { + file +=" --initstatus "; + m_firsttitle=false; + } + if (l_track->getforceFactor()) { + file +=" --ffactor "; + } + file +=QString(" --inject %1 --totalsize %2 --dvdsize %3 |") + .arg(inject) + .arg(m_totalSize -m_forced ,0,'f',0) + .arg(((uint64_t)k9DVDSize::getMaxSize() *1024 *1024) - m_forcedsh,0,'f',0); + + e.setAttribute("file",file); + if (first) + e.setAttribute("chapters",l_chap->gettime().toString("0")); + pgc.appendChild(e); + first=false; + } + // } + } + + } + QDomElement post = xml->createElement("post"); + pgc.appendChild(post); + QDomText postcmd=xml->createTextNode(""); + + k9DVDTitle * l_next=l_track->getnextTitle(); + if (l_next!=NULL) { + c.sprintf("g1=%d;\ncall vmgm menu;",DVD->getnewTitleNum(l_next)); + if( DVD->getnewTitleNum(l_next)==-1) { + error=true; + c=i18n("'%1' not selected").arg(l_next->getname()); + KMessageBox::error( 0, c, tr2i18n("authoring")); + } + + postcmd.setNodeValue(c); + } + post.appendChild(postcmd); + } + +} + + +const QString& k9DVDAuthor::getworkDir() { + return workDir; +} +void k9DVDAuthor::setworkDir( const QString& _newVal) { + workDir = _newVal; + if (workDir.right(1)!='/') + workDir +='/'; +} + +void k9DVDAuthor::author() { + + if ( ! k9Tools::checkProgram("dvdauthor")) { + KMessageBox::error (qApp->mainWidget(),i18n("Unable to run %1").arg("dvdauthor") , i18n("authoring")); + error = TRUE; + return; + } + + + bool burnOk=false; + //nettoyage du répertoire de sortie + k9Tools::clearOutput(workDir+"dvd"); + + time = new QTime(0,0); + time->start(); + + progress->setTitle(i18n("Authoring")); + progress->setCaption(i18n("k9Copy - Backup progression")); + progress->setProgress(0,100); + //progress->show(); + + m_xml=new KTempFile(locateLocal("tmp", "k9copy/k9a"),".xml"); + + m_inject=new KTempFile(locateLocal("tmp", "k9copy/k9v"),".inj"); + inject=m_inject->name(); + + if (!cancelled && !error) + createXML(); +// if (error || cancelled) +// delete progress; + + //run dvdauthor + if (!cancelled && !error) { + QString c("dvdauthor"); + proc=progress->getProcess();// new QProcess(c,0); + *proc << c << "-x" << m_xml->name(); //locateLocal("tmp", "k9copy/k9author.xml"); + connect( proc, SIGNAL(receivedStderr(KProcess *, char *, int)), + this, SLOT(DVDAuthorStderr(KProcess *, char *, int )) ); + connect( proc, SIGNAL(receivedStdout(KProcess *, char *, int )), + this, SLOT(DVDAuthorStdout(KProcess *, char *, int)) ); + // connect(progress, SIGNAL(cancelled()), this, SLOT(stopProcess())); + + m_copied=0; + m_lastPos=0; + //if (m_totalSize >k9DVDSize::getMaxSize()) + // m_totalSize=k9DVDSize::getMaxSize(); + proc-> setWorkingDirectory(workDir); + int result=progress->execute(); + if ( result==-1 ) { + KMessageBox::error( 0, tr2i18n("Dvdauthor error :\n") + lastMsg,tr2i18n("authoring")); + + } else { + cancelled=(result==0); + if ((proc->exitStatus()==0) && (proc->normalExit()) && !cancelled && !error) { + burnOk=true; + } else { + if (cancelled) { + //QMessageBox::critical( 0, tr2i18n("authoring"), tr2i18n("Authoring canceled")); + KMessageBox::error( 0, tr2i18n("Authoring cancelled"),tr2i18n("authoring")); + + } else + KMessageBox::error( 0, tr2i18n("An error occured while running DVDAuthor:\n")+lastMsg ,tr2i18n("authoring")); + + } + } + // delete proc; + // delete progress; + if (!burnOk) + error=true; + } + + delete time; + m_xml->file()->remove(); + m_inject->file()->remove(); + delete m_inject; + delete m_xml; +} + + +/** No descriptions */ +void k9DVDAuthor::DVDAuthorStderr(KProcess *proc, char *buffer, int buflen ) { + + //QString m_stderr(proc->readStderr()); + QString m_stderr=QString::fromLatin1(buffer, buflen); + float m_percent; + QString m_remain; + + int pos=m_stderr.find("INFOPOS:"); + if (pos!=-1) { + progress->setTitle(i18n("Authoring")); + QString tmp=m_stderr.mid(pos); + uint32_t totalBytes,totalSize; + sscanf(tmp.latin1(),"INFOPOS: %d %d",&totalBytes,&totalSize); + //if (totalBytes>m_lastPos) + // m_copied+=totalBytes - m_lastPos; + m_copied=totalBytes; + m_lastPos=totalBytes; + //qDebug(QString("copied : %1 totalSize : %2").arg(m_copied).arg(m_totalSize*512)); + m_percent=(float)m_copied / (float)(m_totalSize/DVD_VIDEO_LB_LEN ); + + + QTime time2(0,0); + time2=time2.addMSecs(time->elapsed()); + if (m_percent>0) { + QTime time3(0,0); + time3=time3.addMSecs((uint32_t)(time->elapsed()*(1/m_percent))); + m_remain=time3.toString("hh:mm:ss"); + } + + m_percent*=100; + progress->setLabelText(""); + + progress->setProgress(m_percent,100); + progress->setElapsed(time2.toString("hh:mm:ss") +" / " +m_remain); + + } + /* else { + if (!m_stderr.startsWith("libdvdread") && m_stderr.startsWith("libdvdnav")) + qDebug(m_stderr); + } + */ + int end; + lastMsg=m_stderr; + + if (m_stderr.contains("STAT:")) { + pos=m_stderr.find("fixing VOBU"); + if (pos!=-1) { + progress->setTitle(i18n("Authoring")); + progress->setLabelText(i18n("Fixing VOBUS")); + end=m_stderr.find("%"); + if (end!=-1) { + pos =end -2; + m_stderr=m_stderr.mid(pos,end-pos); + m_stderr=m_stderr.stripWhiteSpace(); + //progress->setLabelText(c); + progress->setProgress(m_stderr.toInt(),100); + } + } + } + + pos=m_stderr.find("INFOIMAGE:"); + if (pos!=-1) { + progress->setImage(m_stderr.mid(pos+10)); + } + + + +} + +void k9DVDAuthor::DVDAuthorStdout(KProcess *proc, char *buffer, int buflen) { + QString c=QString::fromLatin1( buffer,buflen); + //(proc->readStdout()); + int pos; + pos=c.find("STAT"); + if (pos!=-1) { + c=c.mid(pos); + progress->setLabelText(c); + qApp->processEvents(); + } +} + +/** No descriptions */ +void k9DVDAuthor::stopProcess() { + proc->kill(); + cancelled=true; +} + +/** Read property of bool burnDVD. */ +const bool& k9DVDAuthor::getburnDVD() { + return burnDVD; +} +/** Write property of bool burnDVD. */ +void k9DVDAuthor::setburnDVD( const bool& _newVal) { + burnDVD = _newVal; +} + + + +bool k9DVDAuthor::getError() { + return error; +} diff --git a/libk9copy/k9dvdauthor.h b/libk9copy/k9dvdauthor.h new file mode 100755 index 0000000..83a5265 --- /dev/null +++ b/libk9copy/k9dvdauthor.h @@ -0,0 +1,85 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#ifndef K9DVDAUTHOR_H +#define K9DVDAUTHOR_H + +#include "k9common.h" +#include "k9dvd.h" +#include "k9progress.h" + +#include +#include "k9process.h" +#include +#include +#include +#include +/** + *@author + */ + +class k9DVDAuthor : public QObject { +Q_OBJECT +public: + k9DVDAuthor(QObject *DVDStruct,const char* name=0,const QStringList& args=0) ; + ~k9DVDAuthor(); + virtual void setworkDir( const QString& _newVal); + virtual const QString& getworkDir(); + virtual bool getError(); + virtual void author(); + virtual void setburnDVD( const bool& _newVal); + virtual const bool& getburnDVD(); + virtual QWidget *getDialog(){return progress;}; +private: // Private attributes + /** */ + QTime *time; + k9DVD* DVD; + double factor; + QDomDocument *xml; + QString lastMsg,totSize,inject; + k9Process *proc; + QString workDir; + k9Progress *progress; + bool cancelled; + bool error; + bool burnDVD; + bool m_firsttitle; + uint64_t m_totalSize; + uint64_t m_forced,m_forcedsh; + uint32_t m_copied,m_lastPos; + uint64_t m_totalPartSize; + KTempFile *m_xml,*m_inject; + QPtrList files; + void createXML(); + void addTitle(QDomElement &root, k9DVDTitle *title); + void createMenus(bool preview); + void addMenus(QDomElement &titleSet); + void processMenu(); + void spumux(); +private slots: // Private slots + /** No descriptions */ + void DVDAuthorStderr(KProcess *proc, char *buffer, int buflen); + void DVDAuthorStdout(KProcess *proc, char *buffer, int buflen); + + /** No descriptions */ + void stopProcess(); +}; + +#endif + diff --git a/libk9copy/k9dvdbackup.cpp b/libk9copy/k9dvdbackup.cpp new file mode 100755 index 0000000..a651475 --- /dev/null +++ b/libk9copy/k9dvdbackup.cpp @@ -0,0 +1,1776 @@ +/*************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#include "k9dvdbackup.h" +#include "k9dvd.h" +#include "bswap.h" +#include "k9ifo2.h" +#include "k9vamps.h" +#include "ac.h" +#include "k9dvdtitleset.h" +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "k9backupdlg.h" +#include "dvdread.h" +#include "k9script.h" +#include "k9tools.h" + +#define BUF_SECS 1024 + + +#include "k9dvdbackup.moc" + +int k9CadtList::compareItems(QPtrCollection::Item item1,QPtrCollection::Item item2) { + cell_adr_t * it1=(cell_adr_t*)item1; + cell_adr_t * it2=(cell_adr_t*)item2; + return it1->start_sector - it2->start_sector; +}; + +int k9TitleSetList::compareItems ( QPtrCollection::Item item1, QPtrCollection::Item item2 ) { + k9TitleSet * it1,*it2; + it1=(k9TitleSet *) item1; + it2=(k9TitleSet *)item2; + return it1->VTS - it2->VTS; +} + +/*void k9TitleSet::clearCells() { + while (!cells.isEmpty()) delete cells.take(); + //qDeleteAll(cells); + cells.clear(); +} + */ + +k9TitleSet::k9TitleSet(int _VTS):QObject(NULL,"") { + startSector=0; + lastSector=0; + VTS=_VTS; + cells.setAutoDelete(true); + ifoTitle=NULL; +} + +k9TitleSet::~k9TitleSet() { + //ifoTitle->closeIFO(); + //delete ifoTitle; +} + +k9Cell* k9TitleSet::addCell(int _vts,int _pgc, int _vob) { + return cells.addCell(_vts,_pgc,_vob); + +} + +uint32_t k9TitleSet::getSize() { + return (lastSector +1) ; +} + + +k9DVDBackup::k9DVDBackup(QObject* _dvd,const char* name,const QStringList& ) + : QObject(NULL, name) { + DVD = (k9DVD*)_dvd; + m_dvdread=DVD->getdvd(); + currVTS=0; + outputFile=NULL; + currTS=NULL; + errMsg=""; + error=false; + backupDlg = new k9BackupDlg(qApp->mainWidget(),"",true); + // cells.setAutoDelete(true); + vamps=new k9vamps(this); + m_withMenu=false; + m_forcedFactor=false; + m_preserve=true; +} + + +k9DVDBackup::~k9DVDBackup() { + if (outputFile !=NULL) { + outputFile->close(); + delete outputFile; + } + delete backupDlg; + delete vamps; +} + +void k9DVDBackup::setWithMenus(bool _value) { + m_withMenu=_value; +} + +bool k9DVDBackup::geterror() { + return error; +} + +void k9DVDBackup::seterror(const QString &_msg) { + error=true; + errMsg=_msg; +} + + +QString k9DVDBackup::getErrMsg() { + return(errMsg); +} + +void k9DVDBackup::prepareVTS(int _VTS) { + if (error) + return; + ifo_handle_t *hifo; + + cellSize=0; + if (currTS==NULL) { + currVTS=0; + m_vmgSize=copyMenu2(0); + calcFactor(); + if (outputFile != NULL) { + outputFile->close(); + delete outputFile; + outputFile=NULL; + } + } + if (backupDlg->getAbort()) { + seterror(tr2i18n("DVD backup cancelled")); + return; + } + //creation of output file + if (currVTS != _VTS) { + if (outputFile != NULL) { + outputFile->close(); + delete outputFile; + outputFile=NULL; + updateIfo(); + updateVob(&currTS->cells); + } + + if (backupDlg->getAbort()) { + seterror(tr2i18n("DVD backup cancelled")); + return; + } + + uint32_t startSector=0; + + if (currTS != NULL) { + startSector = currTS->startSector + currTS->getSize(); + } else { + k9Ifo2 *kifo; + kifo=m_dvdread->getIfo(0); + hifo = kifo->getIFO(); + if (!hifo) { + seterror( tr2i18n("unable to open VIDEO_TS.IFO")); + return; + } + startSector= hifo->vmgi_mat->vmg_last_sector+1 ; + } + + currTS = new k9TitleSet(_VTS); + currVOB=0; + currVTS=_VTS; + + calcFactor(); //menus are always shrinked + currTS->menuSize=copyMenu2(_VTS); + if (outputFile != NULL) { + outputFile->close(); + delete outputFile; + } + + QString filename; + filename.sprintf("/VTS_%02d_1.VOB",_VTS); + filename=output+filename; + outputFile=new QFile(filename); + if (! outputFile->open(IO_WriteOnly)) { + seterror(tr2i18n("Unable to open file ") + filename); + return; + } + + currVOB=1; + + currTS->startSector=startSector; + currTS->lastSector += currTS->menuSize ; + titleSets.append(currTS); + + k9Ifo2 *kifo; + kifo=m_dvdread->getIfo(_VTS); + currTS->ifoTitle=kifo; + + m_position=0; + m_copyMenu=false; + calcFactor(); + } + + currVTS=_VTS; + +} + + +void k9DVDBackup::copyCell(int _VTS,k9Cell * _cell,bool _empty) { + if (error) + return; + + prepareVTS(_VTS); + if (error) + return; + + if (_cell->getforceFactor()) + forceFactor( _cell->getFactor()); + + + mutex.lock(); + k9Cell *cell= currTS->addCell(_VTS,0,0); + //JMP cell->startSector=m_position; + cell->startSector=cell->cellList->getPosition(); + currCell=cell; + //start cell copy + mutex.unlock(); + if (!_empty) { + if (!vamps->running()) { + vamps->reset(); + vamps->setPreserve(true); + vamps->setInputSize(argSize); + QValueList::iterator it; + for ( it = _cell->audio.begin(); it != _cell->audio.end(); ++it ) { + if (m_preserve) + vamps->addAudio(*it); + else + vamps->addAudio(*it,_cell->getTitleset()->getNewAudioStreamId(*it)); + } + + for ( it = _cell->subpicture.begin(); it != _cell->subpicture.end(); ++it ) { + vamps->addSubpicture(*it); + } + + vamps->setVapFactor(argFactor); + vamps->start(QThread::NormalPriority); + } + playCell(_VTS,_cell,_empty); + } else + copyEmptyPgc(_VTS,_cell); + qApp->processEvents(); +} + +void k9DVDBackup::copyEmptyPgc(int _vts,k9Cell *_cell) { + if (error) + return; + + ifo_handle_t *vts_handle=currTS->ifoTitle->getIFO(); + ; + + k9DVDFile *dvdfile; + if ((dvdfile = m_dvdread->openTitle( _vts))== 0) { + QString stmp; + stmp=i18n("Unable to open titleset %1").arg(_vts); + seterror(stmp); + return ; + } + backupDlg->setTotalSteps(vts_handle->vtsi_mat->vts_last_sector-vts_handle->vtsi_mat->vtstt_vobs -1); + QString c; + c=i18n("Extracting titleset %1").arg(_vts); + backupDlg->setProgressLabel(c); + backupDlg->show(); + + + uint32_t sector; + int32_t len=0; + uchar buffer[DVD_VIDEO_LB_LEN]; + sector = _cell->startSector; + backupDlg->setProgress(sector); + dsi_t dsi_pack; + uint32_t nsectors; + + len=dvdfile->readBlocks (sector, 1, buffer); + //JMP : D V C + if (!k9Cell::isNavPack( buffer) || len==-1) + setDummyNavPack( buffer,sector); + + k9Vobu * vobu=currCell->addVobu(sector); + vobu->empty=true; + currCell->addNewVobus((char*)buffer,DVD_VIDEO_LB_LEN,currCell->cellList->getPosition(),currVOB,outputFile->at()); + outputFile->writeBlock((char*)buffer,DVD_VIDEO_LB_LEN); + + /* parse contained DSI pack */ + navRead_DSI (&dsi_pack, buffer + DSI_START_BYTE); + currCell->vob = dsi_pack.dsi_gi.vobu_vob_idn; + + //dummy video pack + setDummyPack( buffer); + currCell->addNewVobus((char*)buffer,DVD_VIDEO_LB_LEN,currCell->cellList->getPosition()+1,currVOB,outputFile->at()); + outputFile->writeBlock((char*)buffer,DVD_VIDEO_LB_LEN); + + nsectors=1; + len=1; + + //vobu->size +=nsectors; + currCell->lastSector=currCell->startSector+ len; + currCell->cellList->setPosition(currCell->cellList->getPosition()+1+len); + currTS->lastSector+=len+1; + dvdfile->close(); + backupDlg->setProgressTotal(len+1); + if (!m_forcedFactor) { + m_cellCopyList->addInbytes( DVD_VIDEO_LB_LEN *2); + m_cellCopyList->addOutbytes( DVD_VIDEO_LB_LEN *2); + } else { + m_cellCopyList->addFrcinbytes(DVD_VIDEO_LB_LEN *2); + m_cellCopyList->addFrcoutbytes( DVD_VIDEO_LB_LEN *2); + + } +} + + +void k9DVDBackup::getOutput(uchar * buffer, uint32_t buflen) { + if (error) + return; + mutex.lock(); + backupDlg->playMovie(buffer,buflen); + mutex.unlock(); + + if (!m_forcedFactor) + m_cellCopyList->addOutbytes( buflen); + else + m_cellCopyList->addFrcoutbytes( buflen); + + uchar *temp =buffer; + QString sName; + if ((buflen %2048) !=0) + qDebug("getOutput, buffer : %u",buflen); + uint end=0; + + for (uint itemp=0;itempsize(); + end=itemp+DVD_VIDEO_LB_LEN; + if (k9Cell::isNavPack(temp+itemp)) { + + k9Vobu * vobu = vobuQueue.dequeue(); + + cellOut=vobu->parent; + dsi_t dsiPack; + navRead_DSI (&dsiPack, (uchar*)(temp+itemp) + DSI_START_BYTE); + + cellOut->vob = dsiPack.dsi_gi.vobu_vob_idn; + if ((dsiPack.dsi_gi.vobu_ea * DVD_VIDEO_LB_LEN) + fileSize >= (1024*1024*1024)) { + outputFile->close(); + delete outputFile; + currVOB++; + if (currVTS==0) + sName = "/VIDEO_TS.VOB"; + else + sName.sprintf("/VTS_%02d_%d.VOB",(int)currVTS,(int)currVOB); + sName=output+sName; + outputFile=new QFile(sName); + if ( !outputFile->open(IO_WriteOnly)) { + seterror(tr2i18n("Unable to open file ") + sName); + mutex.unlock(); + return; + } + } + } + cellOut->addNewVobus((char*)(temp+itemp),DVD_VIDEO_LB_LEN,cellOut->cellList->getPosition() ,currVOB,outputFile->at()); + outputFile->writeBlock((char*)(temp+itemp),DVD_VIDEO_LB_LEN); + + backupDlg->setProgressTotal(1); + cellOut->cellList->setPosition( cellOut->cellList->getPosition()+1); + if (!m_copyMenu) + currTS->lastSector++; + mutex.unlock(); + } +} + + +/*! +\fn k9DVDBackup::setDevice(QString _device) +*/ +void k9DVDBackup::setDevice(QString _device) { + device=_device; +} + + +/*! +\fn k9DVDBackup::setOutput(QString _output) +*/ +void k9DVDBackup::setOutput(QString _output) { + output=QDir::cleanDirPath(_output); +} + + +uint32_t k9DVDBackup::copyMenu2(int _vts) { + if (error || !m_withMenu ) + return 0; + k9Ifo2 *kifo; + kifo=m_dvdread->getIfo( _vts); + ifo_handle_t *hifo =kifo->getIFO(); + m_ifo=hifo; + uint32_t msize=0; + uint32_t menuLastSector; + if (_vts==0) + msize=hifo->vmgi_mat->vmg_last_sector -1 - 2* hifo->vmgi_mat->vmgi_last_sector; + else + msize=hifo->vtsi_mat->vtstt_vobs - hifo->vtsi_mat->vtsi_last_sector -1; + + if (msize==0) { + //kifo.closeIFO(); + return 0; + } + menuLastSector=msize-1; + + + m_position=0; + m_copyMenu=true; + QString targetName; + if (_vts == 0) { + targetName="VIDEO_TS.VOB"; + } else { + targetName.sprintf("VTS_%02i_0.VOB",_vts); + } + targetName=output+"/"+targetName; + + outputFile=new QFile(targetName); + if (! outputFile->open(IO_WriteOnly)) { + seterror(tr2i18n("Unable to open file ") + targetName); + return 0; + } + + k9DVDFile *dvdfile; + if ((dvdfile = m_dvdread->openMenu( _vts))== 0) { + QString stmp; + stmp=i18n("Unable to open menu for titleset %1").arg(_vts); + seterror (stmp); + return 0; + } + + k9CellList *lstCell; + if (_vts==0) + lstCell = &vmgCells; + else + lstCell = &currTS->menuCells; + + lstCell->setAutoDelete(true); + + + c_adt_t *c_adt = hifo->menu_c_adt; + // c_adt shouldn't be null. It would say that the menu doesn't contain video !? + if (c_adt==NULL) + return 0; + + uint32_t length = c_adt->last_byte + 1 - C_ADT_SIZE; + cell_adr_t *ptr; + ptr= c_adt->cell_adr_table; + + uint32_t sector, dsi_next_vobu = 0; + uint32_t imax=length/sizeof(cell_adr_t); + QString c; + c=i18n("Extracting menu for titleset %1").arg(_vts); + backupDlg->setProgressLabel(c); + + backupDlg->show(); + backupDlg->setTotalSteps(ptr[imax-1].last_sector); + + k9CadtList cadr; + + uint32_t nbCells=0; + for (uint32_t i=0;ilast_sector > menuLastSector) + (ptr+i)->last_sector=menuLastSector; + + if ((ptr+i)->start_sector <= menuLastSector) { + cadr.append(ptr+i); + nbCells++; + } + //else + //qDebug() << QString("cell start sector (%1) exceed menu size (%2)").arg((ptr+i)->start_sector).arg(menuLastSector); + } + cadr.sort(); + vamps->reset(); + vamps->setPreserve(true); + for (uint i=1;i<=8;i++) + vamps->addAudio(i); + + for (uint i=1;i<=32;i++) + vamps->addSubpicture(i); + + vamps->setVapFactor(argFactor); + vamps->setInputSize(msize*2048); + + vamps->start(QThread::NormalPriority); + // while(!vamps->running() && !vamps->finished()); + + for(uint32_t i = 0; i < nbCells; i++) { + currCell=lstCell->addCell(_vts,1,1); + dsi_next_vobu=0; + cell_adr_t * cellAdr=cadr.at(i); + for (sector = cellAdr->start_sector; + sector <= cellAdr->last_sector; sector += dsi_next_vobu & 0x7fffffff) { + backupDlg->setProgress(sector); + if (backupDlg->getAbort()) { + seterror(tr2i18n("DVD backup cancelled")); + } + + if (error) { + vamps->abort(); + break; + } else if (vamps->geterror()) { + seterror( vamps->geterrMsg()); + break; + } + dsi_next_vobu= copyVobu(dvdfile,sector,NULL); + } + } + vamps->setNoData(); + vamps->wait(); + uint32_t size=0; + + //JMP size=m_position; + size =lstCell->getPosition(); + + dvdfile->close(); + outputFile->close(); + delete outputFile; + outputFile=NULL; + //kifo.closeIFO(); + + updateVob(lstCell); + + m_copyMenu=false; + return size; +} + + + + +void k9DVDBackup::playCell (int vts_num, k9Cell *_cell,bool _empty) { + + if (error) + return; + + ifo_handle_t *vts_handle; + k9DVDFile *dvdfile; + uint32_t sector, dsi_next_vobu = 0; + /* open disc */ + if (m_dvdread->opened()) { + /* load information for the given VTS */ + // vts_handle = ifoOpen (dvd_handle, vts_num); + vts_handle=currTS->ifoTitle->getIFO(); + if (!vts_handle) { + QString stmp; + stmp=i18n("Unable to open ifo file for titleset %1").arg(vts_num); + seterror (stmp); + //JMP vamps->setNoData(); + return; + } + + backupDlg->setTotalSteps( vts_handle->vtsi_mat->vts_last_sector-vts_handle->vtsi_mat->vtstt_vobs -1); + QString c; + c=i18n("Extracting titleset %1").arg(vts_num); + backupDlg->setProgressLabel(c); + backupDlg->show(); + } else { + seterror(tr2i18n("Unable to open DVD")); + //JMP vamps->setNoData(); + return; + } + + + /* open VTS data */ + dvdfile = m_dvdread->openTitle (vts_num); + if (! dvdfile) { + QString stmp; + stmp=i18n("Unable to open vobs for titleset %1").arg(vts_num); + seterror( stmp); + //JMP vamps->setNoData(); + return; + } + + + /* loop until out of the cell */ +//TO REMOVE currCell->oldStartSector=_cell->startSector; + for (sector = _cell->startSector; + sector <= _cell->lastSector; sector += dsi_next_vobu & 0x7fffffff) { + + backupDlg->setProgress(sector); + if (backupDlg->getAbort()) { + seterror(tr2i18n("DVD backup cancelled")); + } + + if (error) { + vamps->abort(); + break; + } else if (vamps->geterror()) { + seterror( vamps->geterrMsg()); + break; + } + dsi_next_vobu= copyVobu(dvdfile,sector,NULL,_empty); + } + dvdfile->close(); +} + +void k9DVDBackup::setDummyNavPack(uchar *buf,uint32_t _sector) +{ + int8_t *ptr = (int8_t*)buf; + static uint8_t nav_pack1 [] = + { + /* pack header: SCR=0, mux rate=10080000bps, stuffing length=0 */ + 0, 0, 1, 0xba, 0x44, 0x00, 0x04, 0x00, 0x04, 0x01, 0x01, 0x89, 0xc3, 0xf8, + /* system header */ + 0, 0, 1, 0xbb, 0x00, 0x12, + /* contents of system header filled in at run time (18 bytes) */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /* PES header for first private stream 2 packet */ + 0, 0, 1, 0xbf, 0x03, 0xd4 + }; + static uint8_t nav_pack2 [] = + { + /* PES header for second private stream 2 packet */ + 0, 0, 1, 0xbf, 0x03, 0xfa + }; + + tc_memcpy (ptr, nav_pack1, sizeof (nav_pack1)); + ptr += sizeof (nav_pack1); + memset (ptr, 0, DVD_VIDEO_LB_LEN/2 - sizeof (nav_pack1)); + ptr = (int8_t*)buf + DVD_VIDEO_LB_LEN/2; + tc_memcpy (ptr, nav_pack2, sizeof (nav_pack2)); + ptr += sizeof (nav_pack2); + memset (ptr, 0, DVD_VIDEO_LB_LEN/2 - sizeof (nav_pack2)); + + dsi_t dsiPack; + pci_t pciPack; + navRead_DSI (&dsiPack, buf + DSI_START_BYTE); + k9Ifo2::navRead_PCI (&pciPack, buf+0x2d); + dsiPack.dsi_gi.nv_pck_lbn=_sector; + dsiPack.dsi_gi.vobu_ea = 1; + + navRead_DSI((dsi_t*)(buf + DSI_START_BYTE),(uchar*)&dsiPack); + pciPack.pci_gi.nv_pck_lbn =dsiPack.dsi_gi.nv_pck_lbn; + k9Ifo2::navRead_PCI((pci_t*)(buf+0x2d),(uchar*)&pciPack); +} + + +void k9DVDBackup::setDummyPack(uchar *_buffer) { + int8_t *ptr = (int8_t*)_buffer; + uint8_t dummy_pack [] = + { + /* pack header: SCR=0, mux rate=10080000bps, stuffing length=0 */ + 0, 0, 1, 0xba, 0x44, 0x00, 0x04, 0x00, 0x04, 0x01, 0x01, 0x89, 0xc3, 0xf8, + /* PES header for dummy video packet */ + 0, 0, 1, 0xe0, 0x07, 0xec, 0x81, 0x00, 0x00 + }; + + tc_memcpy (ptr, dummy_pack, sizeof (dummy_pack)); + ptr += sizeof (dummy_pack); + memset (ptr, 0xff, DVD_VIDEO_LB_LEN - sizeof (dummy_pack)); + +} + + +uint32_t k9DVDBackup::findNextVobu(uint32_t _sector) { + k9Ifo2 *ifo; + ifo = m_dvdread->getIfo(currVTS); + m_ifo=ifo->getIFO(); + vobu_admap_t * vobu_admap; + if (m_copyMenu) + vobu_admap = m_ifo->menu_vobu_admap; + else + vobu_admap = m_ifo->vts_vobu_admap; + uint32_t length = vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE; + for(uint32_t i = 0; i < length/sizeof(uint32_t); i++) { + if (vobu_admap->vobu_start_sectors[i] >= _sector) { + uint32_t nextVobu=vobu_admap->vobu_start_sectors[i+1]; + //ifo.closeIFO(); + return nextVobu; + } + } + //ifo.closeIFO(); + return 0; + +} + + + +uint32_t k9DVDBackup::copyVobu(k9DVDFile *_fileHandle,uint32_t _startSector,k9Vobu * _vobu,bool _empty) { + dsi_t dsi_pack; + k9Vobu * currVobu; + bool badNavPack=false; + + uint32_t nsectors, nextVobu=0; + int32_t len=0; + uchar *buf; + uint32_t sector=_startSector; + /* read nav pack */ + buf=(uchar*) malloc(DVD_VIDEO_LB_LEN); + len = _fileHandle->readBlocks ( sector, 1, buf); + /* parse contained DSI pack */ + + //test if nav pack is ok + if (len !=-1) { + navRead_DSI (&dsi_pack, buf + DSI_START_BYTE); + if (dsi_pack.dsi_gi.nv_pck_lbn != sector) { + len=-1; + } + } + + if (len==-1) { + setDummyNavPack(buf,sector); + nextVobu=findNextVobu(sector); + qDebug ("VOBU : %u Read Error !!!! ==> %u",sector,nextVobu); + badNavPack=true; + } + currVobu=_vobu; + + mutex.lock(); + if (k9Cell::isNavPack(buf)) { +//TO REMOVE currCell->oldLastSector=sector; + if (currVobu==NULL) { + currVobu =currCell->addVobu(sector); + vobuQueue.enqueue(currVobu); + } + } + mutex.unlock(); + /* generate an MPEG2 program stream (including nav packs) */ + wrote=false; + + vamps->addData(buf,DVD_VIDEO_LB_LEN); + + + + if (!m_forcedFactor) + m_cellCopyList->addInbytes( DVD_VIDEO_LB_LEN); + else + m_cellCopyList->addFrcinbytes(DVD_VIDEO_LB_LEN); + uint32_t end; + + if (badNavPack) { + setDummyPack(buf); + nsectors=1; + if (nextVobu !=0) end=nextVobu-_startSector-1; + + } else { + if (!_empty) + nsectors = dsi_pack.dsi_gi.vobu_ea; + else + nsectors = 1; + + //uint32_t dsi_next_vobu = dsi_pack.vobu_sri.next_vobu; + + buf=(uchar*) realloc(buf,nsectors*DVD_VIDEO_LB_LEN); + + end=dsi_pack.dsi_gi.vobu_ea; + + if (_empty) + setDummyPack(buf); + /* read VOBU */ + else + for (uint32_t i=0;i< nsectors;i++) { + len = _fileHandle->readBlocks ( (sector + 1)+i, 1, buf +(i*DVD_VIDEO_LB_LEN)); + if (len==-1) { + qDebug ("VOBU : %u Read Error !!!!",sector); + //setDummyPack(buf + (i*DVD_VIDEO_LB_LEN)); + setDummyPack(buf); + nsectors=1; + break; + } + } + } + + /* write VOBU */ + for (uint32_t i=0;iaddData(buf + (i*DVD_VIDEO_LB_LEN), DVD_VIDEO_LB_LEN); + } + free(buf); + + if (! m_forcedFactor) + m_cellCopyList->addInbytes( nsectors*DVD_VIDEO_LB_LEN); + else + m_cellCopyList->addFrcinbytes( nsectors*DVD_VIDEO_LB_LEN); + + mutex.lock(); + qApp->processEvents(); + mutex.unlock(); + + return (end+1); +} + + + +k9Vobu * k9DVDBackup::remapVobu(uint32_t *value) { + k9Vobu *vobu=NULL; + uint32_t sector,mask; + if ( (*value & 0x80000000) == 0x80000000) { + sector = *value & 0x7FFFFFFF; + mask=0x80000000; + } else { + sector =*value; + mask=0; + } + *value=0; + k9CellList *lstCell; + if(! m_copyMenu) { + lstCell=&(currTS->cells); + } else { + if (currVTS==0) + lstCell=&vmgCells; + else + lstCell=&(currTS->menuCells); + } + vobu=lstCell->findVobu(sector); + if (vobu !=NULL) { + *value = vobu->newSector | mask; + return vobu; + } + + *value=0; + return vobu; + +} + + +k9Vobu * k9DVDBackup::remapOffset(uint32_t _sector,uint32_t *_offset,int _dir) { + k9Vobu *vobu1=NULL, *vobu2=NULL; + uint32_t offset,sector; + uint32_t maskOffset1=0,maskOffset2=0,maskSector=0; + + if ((*_offset!= 0xbfffffff) && (*_offset!=0x3fffffff) && (*_offset!=0x7fffffff)) { + + if ( (*_offset & 0x80000000) == 0x80000000) + maskOffset1= 0x80000000; + if ( (*_offset & 0x40000000) == 0x40000000) + maskOffset2= 0x40000000; + offset = *_offset & 0x3FFFFFFF; + + if ( (_sector & 0x80000000) == 0x80000000) { + sector = _sector & 0x7FFFFFFF; + maskSector=0x80000000; + } else { + sector =_sector; + maskSector=0; + } + + k9CellList *lstCell; + if(! m_copyMenu) { + lstCell=&(currTS->cells); + } else { + if (currVTS==0) + lstCell=&vmgCells; + else + lstCell=&(currTS->menuCells); + } + vobu1 = lstCell->findVobu(sector); + vobu2 = lstCell->findVobu(sector+_dir*offset); + + + + if ((vobu1 !=NULL) && (vobu2!=NULL)) { + *_offset = abs(vobu1->newSector - vobu2->newSector) | maskOffset1 ; + *_offset |= maskOffset2; + return vobu2; + } + + if (vobu1==NULL && vobu2==NULL) + qDebug ("remapOffset : sector not found"); + } + return vobu2; +} + + +void k9DVDBackup::updateMainIfo() { + + if (error) + return; + + k9Ifo2 ifo(m_dvdread); + ifo.setOutput(output); + ifo.setDevice(device); + + ifo.openIFO(0); + ifo_handle_t *hifo =ifo.getIFO(); + + hifo->vmgi_mat->vmg_last_sector= 1+ m_vmgSize+hifo->vmgi_mat->vmgi_last_sector*2; + if (m_vmgSize >0) { + if (hifo->vmgi_mat->vmgm_vobs != hifo->vmgi_mat->vmgi_last_sector +1) + qDebug ("error in ifo file : vmgm_vobs %u -> %u)",hifo->vmgi_mat->vmgm_vobs,hifo->vmgi_mat->vmgi_last_sector +1); + hifo->vmgi_mat->vmgm_vobs=hifo->vmgi_mat->vmgi_last_sector +1; + } + + currVTS=0; + + k9Vobu* vobu2=NULL; + uint32_t newPos=0; + //update first play PGC + if (hifo->first_play_pgc !=NULL ) { + m_copyMenu=true; + pgc_t *pgc=hifo->first_play_pgc; + if (! m_withMenu && pgc->command_tbl!=0 ) { + pgc->command_tbl->nr_of_pre=0; + pgc->command_tbl->nr_of_post=0; + pgc->command_tbl->nr_of_cell=0; + } + + + cell_playback_t *cell_playback =pgc->cell_playback; + uint32_t nr= pgc->nr_of_cells; + + vobu2=NULL; + cell_playback_t cell; + newPos=0; + for( uint32_t j = 0; j < nr; j++) { + k9Vobu *vobu=remapVobu(&cell_playback[j].first_sector); + vobu2=vobu; + + remapVobu(&cell_playback[j].first_ilvu_end_sector); + if (vobu !=NULL) { + vobu=remapVobu(&cell_playback[j].last_vobu_start_sector); + if (vobu==NULL) { + cell_playback[j].last_vobu_start_sector=cell_playback[j].first_sector; + vobu=vobu2; + pgc->playback_time.hour=0; + pgc->playback_time.minute=0; + pgc->playback_time.second=0; + + cell_playback[j].playback_time.hour=0; + cell_playback[j].playback_time.minute=0; + cell_playback[j].playback_time.second=0; + } + cell_playback[j].last_sector = vobu->newSector+vobu->size;// -1 ; + cell_playback[newPos]=cell_playback[j]; + cell=cell_playback[newPos]; + newPos++; + } else { + cell_playback[newPos]=cell; + newPos++; + } + } + for (uint32_t j=newPos;jnr_of_cells=newPos; + m_copyMenu=false; + } + + + + updatePgci_ut(hifo); + update4Menu(hifo); + + //mise �jour des startSectors + k9TitleSet *TSp=NULL; + titleSets.sort(); + for (uint iTS=0;iTS < titleSets.count();iTS++) { + k9TitleSet *TS=titleSets.at(iTS); + uint32_t startSector; + if (TSp!=NULL) + startSector = TSp->startSector + TSp->getSize(); + else + startSector=hifo->vmgi_mat->vmg_last_sector+1 ; + TS->startSector=startSector; + TSp=TS; + } + + hifo->vmgi_mat->vmg_category=0; + bool found=false; + for (uint32_t i=0 ; i< hifo->tt_srpt->nr_of_srpts;i++) { + for (uint iTS=0;iTSVTS == hifo->tt_srpt->title[i].title_set_nr ) { + hifo->tt_srpt->title[i].title_set_sector = TS->startSector; + found=true; + } + } + found=false; + } + + ifo.saveIFO(); + ifo.closeIFO(); + +} + +void k9DVDBackup::updatePgci_ut(ifo_handle_t *_hifo) { + pgci_ut_t *pgci_ut=_hifo->pgci_ut; + k9Vobu* vobu2=NULL; + uint newPos=0; + //update pgci_ut + + if (pgci_ut !=0 && m_withMenu) { + m_copyMenu=true; + for (uint i=0; i nr_of_lus;i++) { + pgci_lu_t *pgci_lu= &pgci_ut->lu[i]; + pgcit_t * pgcit= pgci_lu->pgcit; + for (uint i2=0 ; i2 nr_of_pgci_srp;i2++) { + pgci_srp_t * pgci_srp=&pgcit->pgci_srp[i2]; + pgc_t *pgc=pgci_srp->pgc; + + + if (! m_withMenu && pgc->command_tbl!=0) { + pgc->command_tbl->nr_of_pre=0; + pgc->command_tbl->nr_of_post=0; + pgc->command_tbl->nr_of_cell=0; + } + + cell_playback_t *cell_playback =pgc->cell_playback; + uint32_t nr= pgc->nr_of_cells; + + vobu2=NULL; + cell_playback_t cell; + newPos=0; + for( uint32_t j = 0; j < nr; j++) { + k9Vobu *vobu=remapVobu(&cell_playback[j].first_sector); + vobu2=vobu; + + if (cell_playback[j].first_ilvu_end_sector !=0) { + uint32_t tmp=cell_playback[j].first_ilvu_end_sector+1; + remapVobu(&tmp); + if (tmp!=0) + cell_playback[j].first_ilvu_end_sector=tmp-1; + } + if (vobu !=NULL) { + vobu=remapVobu(&cell_playback[j].last_vobu_start_sector); + if (vobu !=NULL) + cell_playback[j].last_sector = vobu->newSector+vobu->size;// -1 ; + cell_playback[newPos]=cell_playback[j]; + cell=cell_playback[newPos]; + newPos++; + } else { + cell_playback[newPos]=cell; + newPos++; + } + } + for (uint32_t j=newPos;jnr_of_cells=newPos; + } + } + m_copyMenu=false; + } + + if (!m_withMenu ) { + k9Script *script=new k9Script(_hifo,DVD); + script->updatePGCIUT(); + script->updateFPPGC(); + delete script; + if (_hifo->vmgi_mat) { + _hifo->vmgi_mat->vmgm_c_adt=0; + _hifo->vmgi_mat->vmgm_vobu_admap=0; + } else { + _hifo->vtsi_mat->vtsm_c_adt=0; + _hifo->vtsi_mat->vtsm_vobu_admap=0; + } + } + + +} + +void k9DVDBackup::update4Menu(ifo_handle_t *_hifo) { + if (!m_withMenu) + return; + // Mise �jour vtsm_c_adt pour le menu + m_copyMenu=true; //indispensable pour remapvobu + c_adt_t *c_adt = _hifo->menu_c_adt; + uint32_t length; + if (c_adt!=NULL) { + length = c_adt->last_byte + 1 - C_ADT_SIZE; + cell_adr_t *ptr= c_adt->cell_adr_table; + for(uint32_t i = 0; i < length/sizeof(cell_adr_t); i++) { + uint32_t startSect=ptr[i].start_sector; + // last sector of a vobu = start sector of next vobu -1 + uint32_t lastSect= ptr[i].last_sector +1; + k9Vobu *vobu=remapVobu(&startSect); + if (vobu == NULL) + qDebug ("Error : could not find startSector"); + else { + if (remapVobu(&lastSect)==NULL) + lastSect=vobu->parent->lastSector; + else + lastSect--; + ptr[i].start_sector = startSect; + ptr[i].last_sector = lastSect; + } + + } + } + + vobu_admap_t * vobu_admap = _hifo->menu_vobu_admap; + if (vobu_admap != NULL) { + length = vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE; + uint newPos=0; + for(uint32_t i = 0; i < length/sizeof(uint32_t); i++) { + if (remapVobu(&vobu_admap->vobu_start_sectors[i])!= NULL) { + vobu_admap->vobu_start_sectors[newPos]=vobu_admap->vobu_start_sectors[i]; + newPos++; + } + } + for (uint32_t i=newPos ; i < length/sizeof(uint32_t);i++) + vobu_admap->vobu_start_sectors[i]=0; + + vobu_admap->last_byte = newPos * sizeof(uint32_t) -1 +VOBU_ADMAP_SIZE; + } + m_copyMenu=false; + +} + +void k9DVDBackup::updateIfo() { + + if (error) + return; + + k9Ifo2 ifo(m_dvdread); + ifo.setOutput(output); + ifo.setDevice(device); + + ifo.openIFO(currVTS); + + ifo_handle_t *hifo =ifo.getIFO(); + + pgcit_t * pgcit = hifo->vts_pgcit; + + //update total VTS size with IFO size + currTS->lastSector += 2 *(hifo->vtsi_mat->vtsi_last_sector ) +1; + + hifo->vtsi_mat->vts_last_sector = currTS->lastSector ; + + hifo->vtsi_mat->vtstt_vobs = hifo->vtsi_mat->vtsi_last_sector + 1 + currTS->menuSize; + //JMP + if (currTS->menuSize >0) { + if (hifo->vtsi_mat->vtsm_vobs != hifo->vtsi_mat->vtsi_last_sector +1) + qDebug ("error in ifo file %u : vtsm_vobs %u -> %u",currTS->VTS,hifo->vtsi_mat->vtsm_vobs,hifo->vtsi_mat->vtsi_last_sector +1); + hifo->vtsi_mat->vtsm_vobs= hifo->vtsi_mat->vtsi_last_sector +1 ; + + }else + hifo->vtsi_mat->vtsm_vobs=0; + + updatePgci_ut(hifo); + + k9Vobu* vobu2=NULL; + uint32_t newPos=0; + //update first play PGC + if (hifo->first_play_pgc !=NULL ) { + pgc_t *pgc=hifo->first_play_pgc; + if (! m_withMenu && pgc->command_tbl!=0) { + pgc->command_tbl->nr_of_pre=0; + pgc->command_tbl->nr_of_post=0; + pgc->command_tbl->nr_of_cell=0; + } + cell_playback_t *cell_playback =pgc->cell_playback; + uint32_t nr= pgc->nr_of_cells; + + vobu2=NULL; + cell_playback_t cell; + newPos=0; + for( uint j = 0; j < nr; j++) { + k9Vobu *vobu=remapVobu(&cell_playback[j].first_sector); + vobu2=vobu; + + remapVobu(&cell_playback[j].first_ilvu_end_sector); + if (vobu !=NULL) { + vobu=remapVobu(&cell_playback[j].last_vobu_start_sector); + if (vobu==NULL) { + cell_playback[j].last_vobu_start_sector=cell_playback[j].first_sector; + vobu=vobu2; + pgc->playback_time.hour=0; + pgc->playback_time.minute=0; + pgc->playback_time.second=0; + + cell_playback[j].playback_time.hour=0; + cell_playback[j].playback_time.minute=0; + cell_playback[j].playback_time.second=0; + } + cell_playback[j].last_sector = vobu->newSector+vobu->size;// -1 ; + cell_playback[newPos]=cell_playback[j]; + cell=cell_playback[newPos]; + newPos++; + } else { + cell_playback[newPos]=cell; + newPos++; + } + } + for (uint32_t j=newPos;jnr_of_cells=newPos; + } + + newPos=0; + + + audio_attr_t vts_audio_attr[8]; + + //update each PGC + bool bUpdateAudioAttr=true; + + if (!m_preserve) { + memcpy (vts_audio_attr, hifo->vtsi_mat->vts_audio_attr,sizeof(audio_attr_t)*8); + memset(hifo->vtsi_mat->vts_audio_attr,0,sizeof(audio_attr_t)*8); + } + + for(uint32_t i = 0; i < pgcit->nr_of_pgci_srp; i++) { + pgc_t *pgc=pgcit->pgci_srp[i].pgc; + int numTitle=pgcit->pgci_srp[i].entry_id & 0x7F; + + if (! m_withMenu) { + k9Script *script=new k9Script(hifo,DVD); + script->updatePGC(pgc,currTS->VTS,numTitle); + delete script; + } + + //shift audio streams; + if (!m_preserve) { + int idx=0; + uint16_t audio_control [8]; + memcpy(audio_control,pgc->audio_control,sizeof(uint16_t) *8); + memset(pgc->audio_control,0,sizeof(uint16_t) *8); + for (int istr=0; istr< 8; istr++) { + uint16_t ctrl=audio_control[istr] & 0xF8FF; + int streamId = 1+ ((audio_control[istr]>>8) & 0x7) ; + int newStreamId = DVD->gettitleset(currTS->VTS-1)->getNewAudioStreamId(streamId); + if (newStreamId !=0) { + pgc->audio_control[idx]=ctrl | ((newStreamId-1)<<8); + if (bUpdateAudioAttr) { + hifo->vtsi_mat->vts_audio_attr[idx]=vts_audio_attr[istr]; + } + idx++; + } + } + if (bUpdateAudioAttr) + hifo->vtsi_mat->nr_of_vts_audio_streams=idx; + bUpdateAudioAttr=false; + } + + cell_playback_t *cell_playback =pgc->cell_playback; + uint32_t nr= pgc->nr_of_cells; + + vobu2=NULL; + cell_playback_t cell; + newPos=0; + for( uint32_t j = 0; j < nr; j++) { + k9Vobu *vobu=remapVobu(&cell_playback[j].first_sector); + vobu2=vobu; + + if (cell_playback[j].first_ilvu_end_sector !=0) { + uint32_t tmp=cell_playback[j].first_ilvu_end_sector+1; + remapVobu(&tmp); + if (tmp!=0) + cell_playback[j].first_ilvu_end_sector=tmp-1; + } + if (vobu !=NULL) { + vobu=remapVobu(&cell_playback[j].last_vobu_start_sector); + if (vobu==NULL) { + cell_playback[j].last_vobu_start_sector=cell_playback[j].first_sector; + vobu=vobu2; + pgc->playback_time.hour=0; + pgc->playback_time.minute=0; + pgc->playback_time.second=0; + + cell_playback[j].playback_time.hour=0; + cell_playback[j].playback_time.minute=0; + cell_playback[j].playback_time.second=0; + + } + cell_playback[j].last_sector = vobu->newSector+vobu->size;// -1 ; + cell_playback[newPos]=cell_playback[j]; + cell=cell_playback[newPos]; + newPos++; + } else { + cell_playback[newPos]=cell; + newPos++; + } + } + for (uint32_t j=newPos;jnr_of_cells=newPos; + } + + + c_adt_t *c_adt = hifo->vts_c_adt; + uint32_t length = c_adt->last_byte + 1 - C_ADT_SIZE; + cell_adr_t *ptr= c_adt->cell_adr_table; + newPos=0; + for(uint32_t i = 0; i < length/sizeof(cell_adr_t); i++) { + uint32_t startSect=ptr[i].start_sector; + // last sector of a vobu = start sector of next vobu -1 + uint32_t lastSect= ptr[i].last_sector +1; + k9Vobu *vobu=remapVobu(&startSect); + if (vobu == NULL) + qDebug ("Error : could not find startSector"); + else { + if (remapVobu(&lastSect)==NULL) + lastSect= vobu->parent->lastSector; + else + lastSect--; + ptr[i].start_sector = startSect; + ptr[i].last_sector = lastSect; + } + } + + + vobu_admap_t * vobu_admap = hifo->vts_vobu_admap; + length = vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE; + newPos=0; + for(uint32_t i = 0; i < length/sizeof(uint32_t); i++) { + if (remapVobu(&vobu_admap->vobu_start_sectors[i])!= NULL) { + vobu_admap->vobu_start_sectors[newPos]=vobu_admap->vobu_start_sectors[i]; + newPos++; + } + } + for (uint32_t i=newPos ; i < length/sizeof(uint32_t);i++) + vobu_admap->vobu_start_sectors[i]=0; + + vobu_admap->last_byte = newPos * sizeof(uint32_t) -1 +VOBU_ADMAP_SIZE; + + + //update VTS_TMAP + vts_tmapt_t *vts_tmapt=hifo->vts_tmapt; + if (vts_tmapt) { + for(uint32_t i = 0; i < vts_tmapt->nr_of_tmaps; i++) { + if(vts_tmapt->tmap[i].nr_of_entries == 0) { // Early out if zero entries + continue; + } + map_ent_t * map_ent=vts_tmapt->tmap[i].map_ent; + newPos=0; + for(uint32_t j = 0; j < vts_tmapt->tmap[i].nr_of_entries; j++) { + //bit 31 indicates whether VOBU time codes are discontinous with previous + uint32_t mask=map_ent[j] & 0x80000000 ; + uint32_t value=map_ent[j] & 0x7FFFFFFF; + if (remapVobu(&value) !=NULL) { + map_ent[j]=value | mask; + map_ent[newPos]=map_ent[j]; + newPos++; + } else + map_ent[j]=0; + } + for (int j = newPos; j < vts_tmapt->tmap[i].nr_of_entries;j++) + map_ent[j]=0; + vts_tmapt->tmap[i].nr_of_entries=newPos; + } + } + + update4Menu(hifo); + + ifo.saveIFO(); +} + +void k9DVDBackup::updateVob(k9CellList *cellLst) { + int nbVobuUpdated=0; + + uchar buffer[DVD_VIDEO_LB_LEN]; + QFile *file=NULL; + QString dbg; + int pVobNum=-1; + //for (uint iCell=0;iCellcells.count();iCell++) { + // k9Cell *cell=currTS->cells.at(iCell); + for (uint iCell=0;iCell< cellLst->count();iCell++) { + k9Cell *cell=cellLst->at(iCell); + for (uint ivobu=0; ivobuvobus.count();ivobu++) { + qApp->processEvents(); + k9Vobu * vobu = cell->vobus.at(ivobu); + int VobNum=vobu->vobNum; + if (error) + return; + if (pVobNum !=VobNum) { + if (file !=NULL){ + file->close(); + delete file; + } + //fclose(file); + QString sName; + if (currVTS==0) + sName="VIDEO_TS.VOB"; + else + sName.sprintf("VTS_%02d_%d.VOB",(int)currVTS,(int)VobNum); + dbg=i18n("Updating vob %1").arg(sName); + sName=output+"/"+sName; + QFileInfo finfo(sName); + long fileSize=finfo.size(); + + backupDlg->setTotalSteps(fileSize); + backupDlg->setProgressLabel(dbg); + file =new QFile(sName); + file->open( IO_ReadWrite); + //file=fopen(sName,"r+b"); + pVobNum=VobNum; + } + if( file !=NULL) { + uint32_t sector=0; + long pos=vobu->vobPos; + backupDlg->setProgress(pos); + if (backupDlg->getAbort()) { + seterror(tr2i18n("DVD backup canceled")); + break; + } + + bool emptyPgc=false; + /* long currpos=ftell(file); + long offset=pos-currpos; + fseek(file,offset,SEEK_CUR); + */ + //fseek(file,pos,SEEK_SET); + file->at(pos); + //fread(buffer,DVD_VIDEO_LB_LEN,1,file); + file->readBlock((char*)buffer,DVD_VIDEO_LB_LEN); + if (k9Cell::isNavPack((uchar*)buffer)) { + dsi_t dsiPack; + pci_t pciPack; + nbVobuUpdated++; + navRead_DSI (&dsiPack, buffer + DSI_START_BYTE); + k9Ifo2::navRead_PCI (&pciPack, buffer+0x2d); + sector=dsiPack.dsi_gi.nv_pck_lbn; //JMP : pour debug + //vobu=remapVobu(&dsiPack.dsi_gi.nv_pck_lbn ); + sector=vobu->oldSector; + dsiPack.dsi_gi.nv_pck_lbn=vobu->newSector; + if (vobu != NULL) { + dsiPack.dsi_gi.vobu_ea = vobu->size; + emptyPgc=vobu->empty; + } else { + dbg.sprintf("remapVobu failed for %d",dsiPack.dsi_gi.nv_pck_lbn); + } + + if (!emptyPgc) { + remapOffset(sector, &dsiPack.vobu_sri.next_video,1 ); + for (int i =0;i<19;i++) { + remapOffset(sector,&dsiPack.vobu_sri.fwda[i],1); + } + remapOffset(sector,&dsiPack.vobu_sri.next_vobu,1); + remapOffset(sector,&dsiPack.vobu_sri.prev_vobu,-1); + for (int i =0;i<19;i++) { + remapOffset(sector,&dsiPack.vobu_sri.bwda[i],-1); + } + + remapOffset(sector,&dsiPack.vobu_sri.prev_video,-1); + + //1st audio packet + for (int i =0 ;i <8 ;i++) { + //if (((dsiPack.synci.a_synca[i] & 0x8000) != 0x8000 ) && (dsiPack.synci.a_synca[i] !=0x3FFF) && (dsiPack.synci.a_synca[i] !=0x0)) { + if ( (dsiPack.synci.a_synca[i] !=0x3FFF) && (dsiPack.synci.a_synca[i] !=0x0)) { + if (vobu->firstAudio[i] !=-1) { + dsiPack.synci.a_synca[i]=vobu->firstAudio [i]; + } else { + //JMP dsiPack.synci.a_synca[i] =0; + dsiPack.synci.a_synca[i] =0x3FFF; + } + } + } + //1st subpicture packet + for (int i =0 ;i <32 ;i++) { + // if (((dsiPack.synci.sp_synca[i] & 0x80000000) != 0x80000000) && + // (dsiPack.synci.sp_synca[i] != 0x3FFFFFFF) && (dsiPack.synci.sp_synca[i] != 0x7FFFFFFF) && (dsiPack.synci.sp_synca[i] != 0x0)) { + if ((dsiPack.synci.sp_synca[i] != 0x3FFFFFFF) && (dsiPack.synci.sp_synca[i] != 0x0)) { + if (vobu->firstSubp[i] !=-1) { + dsiPack.synci.sp_synca[i]=vobu->firstSubp [i]; + } else { + //JMP dsiPack.synci.sp_synca[i] =0; + dsiPack.synci.sp_synca[i] =0x3FFFFFFF; + } + } + } + //ILVU + + for (int i=0;i<9;i++) { + if (dsiPack.sml_agli.data[i].address !=0 && dsiPack.sml_agli.data[i].address !=0x7FFFFFFF) { + uint32_t tmpAdr=dsiPack.sml_agli.data[i].address; + uint32_t tmpSize=(dsiPack.sml_agli.data[i].address & 0x7FFFFFFF) + dsiPack.sml_agli.data[i].size; + int dir; + if ((tmpAdr & 0x80000000) ==0x80000000) + dir=-1; + else + dir=1; + remapOffset(sector,&tmpAdr,dir); + remapOffset(sector,&tmpSize,1); + dsiPack.sml_agli.data[i].address=tmpAdr; + dsiPack.sml_agli.data[i].size=tmpSize-(tmpAdr &0x7FFFFFFF); + } + } + + + if (dsiPack.sml_pbi.ilvu_ea !=0) { + uint32_t tmp=dsiPack.sml_pbi.ilvu_ea+1; + remapOffset(sector,&tmp,1); + if (tmp!=0) + tmp--; + dsiPack.sml_pbi.ilvu_ea=tmp; + } + if (dsiPack.sml_pbi.ilvu_sa !=0) { + k9Vobu *vobu2=remapOffset(sector,&dsiPack.sml_pbi.ilvu_sa,1); + if (vobu2!= NULL) { + QFile *file2; + if ( vobu2->vobNum != VobNum) { + QString sName; + sName.sprintf("/VTS_%02d_%d.VOB",(int)currVTS,(int)vobu2->vobNum); + sName=output+sName; + file2=new QFile(sName); + file2->open(IO_ReadWrite); + //file2=fopen(sName,"rb"); + } else + file2=file; + //fseek(file2,vobu2->vobPos,SEEK_SET); + file2->at(vobu2->vobPos); + uchar *tmpbuff=(uchar*)malloc(2048); + //fread(tmpbuff,DVD_VIDEO_LB_LEN,1,file2); + file2->readBlock( (char*)tmpbuff,DVD_VIDEO_LB_LEN); + dsi_t dsiNext; + navRead_DSI (&dsiNext, tmpbuff + DSI_START_BYTE); + uint32_t sectmp= dsiNext.sml_pbi.ilvu_ea+1; + remapOffset(dsiNext.dsi_gi.nv_pck_lbn,§mp,1); + dsiPack.sml_pbi.size=sectmp; + free (tmpbuff); + if (vobu2->vobNum!=VobNum) { + file2->close(); + delete file2; + } + + } + } + // end block reference frames + dsiPack.dsi_gi.vobu_1stref_ea = vobu->firstRef; + dsiPack.dsi_gi.vobu_2ndref_ea=vobu->secondRef; + dsiPack.dsi_gi.vobu_3rdref_ea=vobu->thirdRef; + + + // update pci pack + for (int i=0; i<9;i++) { + if ((pciPack.nsml_agli.nsml_agl_dsta[i] & 0x80000000) != 0x80000000) + remapOffset(sector,&pciPack.nsml_agli.nsml_agl_dsta[i],1); + } + + } else { + dsiPack.vobu_sri.next_video= 0xbfffffff; + for (int i =0;i<19;i++) + dsiPack.vobu_sri.fwda[i] = 0x3fffffff; + dsiPack.vobu_sri.next_vobu=0x3fffffff; + dsiPack.vobu_sri.prev_vobu=0x3fffffff; + for (int i =0;i<19;i++) + dsiPack.vobu_sri.bwda[i] = 0x3fffffff; + dsiPack.vobu_sri.prev_video=0xbfffffff; + for (int i =0 ;i <8 ;i++) + dsiPack.synci.a_synca[i]=0x3fff; + for (int i =0 ;i <32 ;i++) + dsiPack.synci.sp_synca[i] =0x3FFFFFFF; + // end block reference frames + dsiPack.dsi_gi.vobu_1stref_ea = 0; + dsiPack.dsi_gi.vobu_2ndref_ea=0; + dsiPack.dsi_gi.vobu_3rdref_ea=0; + //JMP for tests + pciPack.pci_gi.vobu_s_ptm=0; + pciPack.pci_gi.vobu_e_ptm=0; + pciPack.pci_gi.vobu_se_e_ptm=0; + pciPack.pci_gi.e_eltm.hour = pciPack.pci_gi.e_eltm.minute =pciPack.pci_gi.e_eltm.second=0; + dsiPack.dsi_gi.c_eltm.hour=dsiPack.dsi_gi.c_eltm.minute=dsiPack.dsi_gi.c_eltm.second=0; + + for (int i=0;i<9;i++) { + dsiPack.sml_agli.data[i].address=0x7FFFFFFF; + dsiPack.sml_agli.data[i].size=0; + } + dsiPack.sml_pbi.ilvu_ea=0; + dsiPack.sml_pbi.ilvu_sa=0; + dsiPack.sml_pbi.size=0; + + dsiPack.dsi_gi.vobu_1stref_ea = 0; + dsiPack.dsi_gi.vobu_2ndref_ea=0; + dsiPack.dsi_gi.vobu_3rdref_ea=0; + + } + // mise en place des donnees modifi�s dans le buffer de sortie + navRead_DSI((dsi_t*)(buffer + DSI_START_BYTE),(uchar*)&dsiPack); + pciPack.pci_gi.nv_pck_lbn =dsiPack.dsi_gi.nv_pck_lbn; + k9Ifo2::navRead_PCI((pci_t*)(buffer+0x2d),(uchar*)&pciPack); + //mise �jour du fichier + //fseek(file,pos,SEEK_SET); + file->at(pos); + //fwrite(buffer,DVD_VIDEO_LB_LEN,1,file); + file->writeBlock((const char*)buffer,DVD_VIDEO_LB_LEN); + } + + } else { + qDebug ("erreur positionning"); + } + } + } + if (file!=NULL) { + file->close(); + delete file; + } +} + + +uint k9DVDBackup::getLastCell(k9CellCopyList *_cellCopyList, uint _index) { + + k9Cell *orig=(k9Cell*)_cellCopyList->at(_index); + uint result=_index; + + uint64_t dsize=1+orig->lastSector-orig->startSector; + + uchar audioOrig[8]; + uchar subpOrig[32]; + memset(audioOrig,0,sizeof(uchar)*8); + memset(subpOrig,0,sizeof(uchar)*32); + + ; + QValueList::iterator it; + for ( it = orig->audio.begin(); it != orig->audio.end(); ++it ) + audioOrig[*it -1]=1; + + for ( it = orig->subpicture.begin(); it != orig->subpicture.end(); ++it ) + subpOrig[*it -1]=1; + + float factor=-1; + + for (uint iCell=_index+1;(iCell<_cellCopyList->count()) ;iCell++) { + k9Cell *cell=(k9Cell*)_cellCopyList->at(iCell); + if ((cell->vts== orig->vts) && ( cell->selected)) { + //if the cell factor changed, it's a new group of cells + if (factor==-1) + factor=cell->getFactor(); + else { + if (cell->getFactor()!=factor) + break; + } + + uchar audio[8]; + uchar subp[32]; + memset(audio,0,sizeof(uchar)*8); + memset(subp,0,sizeof(uchar)*32); + ; + QValueList::iterator it; + for ( it = cell->audio.begin(); it != cell->audio.end(); ++it ) + audio[*it -1]=1; + + for ( it = cell->subpicture.begin(); it != cell->subpicture.end(); ++it ) + subp[*it -1]=1; + + if ( (memcmp(audioOrig,audio,sizeof(uchar)*8) ==0) && (memcmp(subpOrig,subp,sizeof(uchar)*32) ==0)) { + result=iCell; + dsize+=1+cell->lastSector-cell->startSector; + } else + break; + } else + break; + } + + dsize*=DVD_BLOCK_LEN; + argSize=dsize; + return result; +} + +void k9DVDBackup::calcFactor() { + double factor=m_cellCopyList->getfactor(m_withMenu,false); + QString sFactor; + sFactor.sprintf("%.2f",factor); + backupDlg->setFactor(sFactor); + argFactor = factor; + m_forcedFactor=false; +} + +void k9DVDBackup::forceFactor(double _factor) { + double factor=_factor; + double minFactor=m_cellCopyList->getMinFactor( m_withMenu); + if (factorsetFactor(sFactor); + argFactor = factor; + m_forcedFactor=true; + qDebug("force factor : %f min:%f",factor,minFactor); +} + + +void k9DVDBackup::execute() { + QString sOutput=output; + + output=QDir::cleanDirPath(output +"/dvd"); + + QDir root("/"); + root.mkdir(output); + k9Tools::clearOutput(output); + + QDir dir(output); + dir.mkdir("VIDEO_TS"); + dir.mkdir("AUDIO_TS"); + + output=QDir::cleanDirPath(output +"/VIDEO_TS"); + + m_dvdread->openDevice(device); + if (!m_dvdread->opened()) { + seterror(tr2i18n("Unable to open DVD")); + return; + } + + k9CellCopyList *cellCopyList =new k9CellCopyList(m_dvdread,DVD); + m_cellCopyList=cellCopyList; + + double totalSize=cellCopyList->gettotalSize(); + if (m_withMenu) + totalSize+=DVD->getmenuSize() *2048 ; + + totalSize/=(1024*1024); + totalSize = (totalSize >k9DVDSize::getMaxSize()) ? k9DVDSize::getMaxSize():totalSize; + + backupDlg->setTotalMax((uint32_t)totalSize); + + int lastCell; + calcFactor(); + + //VTSList is sorted by size, so it is easier to ajust the compression factor + for(uint iTS=0;iTSVTSList.count() &&(!error);iTS++) { + k9CellCopyVTS *VTS=cellCopyList->VTSList.at(iTS); + //loop on each cell from the titleset + lastCell=-1; + for (uint iCell=0;(iCellcount()) ;iCell++) { + k9Cell *cell=(k9Cell*)cellCopyList->at(iCell); + if (cell->vts==(int) VTS->getnum() && (!cell->copied)) { + // currCopyCell=cell; + if (lastCell < (int)iCell) { + lastCell=getLastCell( cellCopyList,iCell); + //adjusting factor of compression + if ( cell->getforceFactor()) + forceFactor( cell->getFactor()); + else + calcFactor(); + } + copyCell(cell->vts,cell,! cell->selected); + if (!error) { + cell->copied=true; + } + // } + if (lastCell==(int)iCell) { + vamps->setNoData(); + vamps->wait(); + } + if (error) + break; + } + } + vamps->setNoData(); + vamps->wait(); + } + delete cellCopyList; + + if (!error) { + updateIfo(); + updateVob(&currTS->cells); + updateMainIfo(); + } + output=sOutput; + backupDlg->hide(); + + if (error) + KMessageBox::error(0,errMsg,"DVD Backup"); + //m_dvdread->close(); +} diff --git a/libk9copy/k9dvdbackup.h b/libk9copy/k9dvdbackup.h new file mode 100755 index 0000000..36349ef --- /dev/null +++ b/libk9copy/k9dvdbackup.h @@ -0,0 +1,140 @@ +/*************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#ifndef K9DVDBACKUP_H +#define K9DVDBACKUP_H + +#include "k9common.h" +#include "k9cell.h" +#include "k9cellcopylist.h" +#include "k9dvdread.h" +#include +#include +#include +/** +@author Jean-Michel Petit +*/ + +class k9BackupDlg; +class k9Ifo2; + +class k9TitleSet : public QObject { + Q_OBJECT +public: + k9TitleSet(int _VTS); + ~k9TitleSet(); + uint32_t startSector; + uint32_t lastSector; + int VTS; + uint32_t menuSize; + k9CellList cells,menuCells; + k9Cell*addCell(int _vts,int _pgc, int _vob); + uint32_t getSize(); + k9Ifo2 *ifoTitle; +private: +}; + +class k9TitleSetList:public QPtrList { +protected: + int compareItems ( QPtrCollection::Item item1, QPtrCollection::Item item2 ); +}; + +class k9CadtList:public QPtrList { +protected: + int compareItems(QPtrCollection::Item item1,QPtrCollection::Item item2); +}; + +class k9vamps; + +class k9DVDBackup : public QObject { + Q_OBJECT +public: + k9DVDBackup(QObject *_dvd,const char* name=0,const QStringList& args=0) ; + + ~k9DVDBackup(); + virtual void setDevice(QString _device); + virtual void setOutput(QString _output); + virtual QString getErrMsg(); + virtual void execute(); + virtual bool geterror(); + virtual void setWithMenus(bool _value); + virtual QWidget *getDialog() {return (QWidget*)backupDlg;}; +public slots: + void getOutput(uchar *buffer,uint32_t size); + +protected: + QString device; + QString output; + bool wrote; +private: + k9DVDRead *m_dvdread; + bool m_copyMenu; + bool m_withMenu; + bool m_forcedFactor; + k9DVD *DVD; + QString errMsg; + QString vampsMsg; + QFile* outputFile; + long cellSize; + long currVTS; + k9TitleSet *currTS; + int currVOB; + ifo_handle_t *m_ifo; + k9Cell *currCell,*cellOut;//,*currCopyCell; + k9CellCopyList *m_cellCopyList; + uint32_t m_position,m_vmgSize; + bool m_preserve; + //uint64_t m_inbytes,m_outbytes; + k9TitleSetList titleSets; + float argFactor; + uint64_t argSize; + void prepareVTS(int VTS); + void playCell (int vts_num, k9Cell *_cell,bool _empty=false); + uint32_t findNextVobu(uint32_t _sector); + uint32_t copyVobu(k9DVDFile *_fileHandle,uint32_t _startSector,k9Vobu *_vobu,bool _empty=false); + void copyCell(int VTS, k9Cell *_cell,bool _empty); +// void copyAngleBlock(k9CellCopyList *_list,uint _num); + void copyEmptyPgc(int _vts,k9Cell *_cell); + void updateVob(k9CellList *_cells); + + void updateIfo(); + void updateMainIfo(); + void updatePgci_ut(ifo_handle_t *_hifo); + void update4Menu(ifo_handle_t *_hifo); + void setDummyPack(uchar *_buffer); + void setDummyNavPack(uchar *_buffer,uint32_t _sector); + uint32_t copyMenu2(int _vts); + k9CellList vmgCells; + + k9Vobu * remapVobu(uint32_t *value); + k9Vobu * remapOffset(uint32_t _sector,uint32_t *offset,int dir); + k9BackupDlg *backupDlg; + uint getLastCell(k9CellCopyList *_cellCopyList,uint _index); + void calcFactor(); + void forceFactor(double _factor); + bool error; + void seterror(const QString &_msg); + k9vamps *vamps; + QPtrQueue vobuQueue; + QMutex mutex; +}; + + + +#endif diff --git a/libk9copy/k9dvdchapter.cpp b/libk9copy/k9dvdchapter.cpp new file mode 100644 index 0000000..e96385e --- /dev/null +++ b/libk9copy/k9dvdchapter.cpp @@ -0,0 +1,69 @@ +// +// C++ Implementation: k9dvdchapter +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9dvdchapter.h" +#include "k9dvdtitle.h" + +//************************* k9DVDChapter************************ +/** Read property of int num. */ +const int& k9DVDChapter::getnum() +{ + return num; +} +/** Read property of QTime length. */ +const QTime& k9DVDChapter::getlength() +{ + return length; +} + +/** Read property of int sectors. */ +const int& k9DVDChapter::getsectors() +{ + return sectors; +} + +const QTime& k9DVDChapter::gettime() +{ + return time; +} +k9DVDTitle *k9DVDChapter::getTitle() +{ + return m_title; +} + +k9DVDChapter::k9DVDChapter() +{ + length.setHMS(0,0,0); + num=0; + sectors=0; + startSector=0; + endSector=0; + m_selected=false; + time.setHMS(0,0,0); + cells.setAutoDelete(true); +} + + +bool k9DVDChapter::getSelected() const +{ + return m_selected; +} + + +void k9DVDChapter::setSelected(bool _value) +{ + if (_value && !m_title->isSelected() ) { + m_title->setforceSelection( true); + m_title->selectChapters( false); + } + m_selected = _value; + +} diff --git a/libk9copy/k9dvdchapter.h b/libk9copy/k9dvdchapter.h new file mode 100644 index 0000000..b7e2826 --- /dev/null +++ b/libk9copy/k9dvdchapter.h @@ -0,0 +1,88 @@ +// +// C++ Interface: k9dvdchapter +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9DVDCHAPTER_H +#define K9DVDCHAPTER_H + +#include "k9common.h" +#include "k9dvd.h" +#include + +static int cptChapter=0; + + +enum angleBlock_t {angleNone=0,angleInside=1,angleStart=3,angleEnd=5}; + +class k9DVDTitle; +class k9ChapterCell :public QObject +{ + Q_OBJECT +public: + k9ChapterCell(uint _id,uint _angle){ m_id=_id;m_angle=_angle;m_angleBlock=angleNone;}; + virtual uint getid() {return m_id;}; + virtual uint getangle(){return m_angle;}; + virtual uchar getangleBlock() {return m_angleBlock;}; + virtual void setangleBlock(uchar _angleBlock) {m_angleBlock=_angleBlock;}; + virtual void setstartSector(uint32_t _value) { m_startSector=_value;}; + virtual uint32_t getstartSector() { return m_startSector;}; + virtual void setlastSector(uint32_t _value) { m_lastSector=_value;}; + virtual uint32_t getlastSector() { return m_lastSector;}; + +private: + uint m_id; + uint m_angle; + uchar m_angleBlock; + uint32_t m_startSector,m_lastSector; +}; + +class k9DVDChapter : public QObject +{ + Q_OBJECT + friend class k9DVDTitle; + friend class k9DVD; +private: // Private attributes + /** */ + int num; + int id; + /** */ + QTime length; + QTime time; + /** */ + int sectors; + unsigned long startSector; + unsigned long endSector; + k9DVDTitle *m_title; + bool m_selected; + static int getcptChapter() { cptChapter ++; return cptChapter;}; + static void setcptChapter(int _newValue) { cptChapter=_newValue;}; +public: // Public methods + k9DVDChapter(); + /** Read property of int num. */ + virtual const int& getnum(); + /** Read property of QTime length. */ + virtual const QTime& getlength(); + /** Read property of int sectors. */ + virtual const int& getsectors(); + QPtrList cells; + QValueList startSectors; + virtual const QTime & gettime(); + virtual k9DVDTitle * getTitle(); + unsigned long getstartSector() { return startSector;}; + unsigned long getendSector() {return endSector;}; + + void setSelected(bool _value); + + + bool getSelected() const; + +}; + +#endif diff --git a/libk9copy/k9dvdprogress.cpp b/libk9copy/k9dvdprogress.cpp new file mode 100755 index 0000000..43c3ad8 --- /dev/null +++ b/libk9copy/k9dvdprogress.cpp @@ -0,0 +1,62 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#include "k9dvdprogress.h" +#include +#include + +k9DVDProgress::k9DVDProgress(QWidget* parent, const char* name, bool modal, WFlags fl) + : DVDProgress( parent, name, modal, fl ) +{ +} + +k9DVDProgress::~k9DVDProgress(){ +} +/** No descriptions */ +void k9DVDProgress::setpbTitleTotalSteps(unsigned int total){ +pbTitle->setTotalSteps(total); + +} +/** No descriptions */ +void k9DVDProgress::setpbTitleStep(unsigned int position){ +pbTitle->setProgress(position); +} +/** No descriptions */ +void k9DVDProgress::setpbTotalTotalSteps(int total){ + pbTotal->setTotalSteps(total); +} +/** No descriptions */ +void k9DVDProgress::setpbTotalStep(int position){ + pbTotal->setProgress(position); +} +/** No descriptions */ +void k9DVDProgress::setlblTitle(QString & text){ +lblTitle->setText(text); +} +/** No descriptions */ +void k9DVDProgress::setlblTotal(QString& text){ +lblTotal->setText(text); +} + +void k9DVDProgress::closeEvent( QCloseEvent* ce ) +{ + ce->ignore(); + return; +} diff --git a/libk9copy/k9dvdprogress.h b/libk9copy/k9dvdprogress.h new file mode 100755 index 0000000..3458278 --- /dev/null +++ b/libk9copy/k9dvdprogress.h @@ -0,0 +1,51 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#ifndef K9DVDPROGRESS_H +#define K9DVDPROGRESS_H + +#include "dvdprogress.h" + +/** + *@author + */ + +class k9DVDProgress : public DVDProgress { +Q_OBJECT +public: + k9DVDProgress(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ~k9DVDProgress(); + /** No descriptions */ + void setpbTitleTotalSteps(unsigned int total); + /** No descriptions */ + void setpbTitleStep(unsigned int position); + /** No descriptions */ + void setpbTotalTotalSteps(int total); + /** No descriptions */ + void setpbTotalStep(int position); + /** No descriptions */ + void setlblTitle(QString & text); + /** No descriptions */ + void setlblTotal(QString& text); +protected: + void closeEvent( QCloseEvent* ce ); +}; + +#endif diff --git a/libk9copy/k9dvdread.cpp b/libk9copy/k9dvdread.cpp new file mode 100644 index 0000000..1ec173d --- /dev/null +++ b/libk9copy/k9dvdread.cpp @@ -0,0 +1,171 @@ +// +// C++ Implementation: k9dvdread +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9dvdread.h" +#include "dvdread.h" +#include "k9ifo2.h" + +k9DVDRead::k9DVDRead(){ + m_dvd=NULL; + ifos.setAutoDelete(true); + files.setAutoDelete(true); +} + + +k9DVDRead::~k9DVDRead() { + if (m_dvd !=NULL) + close(); +} + +k9DVDFile::k9DVDFile(k9DVDRead *_dvd) { + m_file=NULL; + m_dvd=_dvd; +} + +k9DVDFile::~k9DVDFile() { + if (m_file != NULL) + close(); +} + +/*! + \fn k9DVDRead::openDevice(const QString & _device) + */ +void k9DVDRead::openDevice(const QString & _device) { + m_dvd=DVDOpen(_device.utf8()); + //turn UDF cache off + //DVDUDFCacheLevel(m_dvd, 0 ); + if (m_dvd) { + k9Ifo2 *ifoz=new k9Ifo2(this); + ifoz->openIFO(0); + ifos.append(ifoz); + ifo_handle_t *hifoz=ifoz->getIFO(); + int nrTS= hifoz->vmgi_mat->vmg_nr_of_title_sets; + + for (int iTS=1 ; iTS<=nrTS;iTS++) { + k9Ifo2 *ifo=new k9Ifo2(this); + ifo->openIFO(iTS); + ifos.append(ifo); + } + } +} + +k9Ifo2 *k9DVDRead::getIfo(int _num) { + k9Ifo2 *ifo=ifos.at(_num); + + return ifo; +} + +QString k9DVDRead::getDiscId() { +uchar ID[17]; +QString id=""; +if (DVDDiscID(m_dvd,ID) !=-1) { + ID[16]=0; + id=QString::fromLatin1((const char*)ID); +} +return id; +} +/*! + \fn k9DVDRead::close() + */ +void k9DVDRead::close() +{ + DVDClose(m_dvd); + ifos.clear(); + files.clear(); + m_dvd=NULL; +} + +bool k9DVDRead::opened() { + return (m_dvd !=NULL); +} + + +k9DVDFile * k9DVDRead::openIfo(uint _vts) { + k9DVDFile *file =new k9DVDFile(this); + file->openIfo(_vts); + files.append(file); + return file; +} + +k9DVDFile *k9DVDRead::openMenu(uint _vts) { + k9DVDFile *file =new k9DVDFile(this); + file->openMenu(_vts); + files.append(file); + return file; +} + +k9DVDFile *k9DVDRead::openTitle(uint _vts) { + k9DVDFile *file =new k9DVDFile(this); + file->openTitle(_vts); + files.append(file); + return file; +} + +/*! + \fn k9DVDFile::openIfo(uint _vts) + */ +void k9DVDFile::openIfo(uint _vts) { + m_file=DVDOpenFile(m_dvd->getDvd(),_vts,DVD_READ_INFO_FILE); +} + + +/*! + \fn k9DVDFile::openMenu(uint _vts) + */ +void k9DVDFile::openMenu(uint _vts) +{ + m_file=DVDOpenFile(m_dvd->getDvd() ,_vts,DVD_READ_MENU_VOBS); +} + + +/*! + \fn k9DVDFile::openTitle(uint _vts) + */ +void k9DVDFile::openTitle(uint _vts) +{ + m_file=DVDOpenFile(m_dvd->getDvd(),_vts,DVD_READ_TITLE_VOBS); +} + + +/*! + \fn k9DVDFile::close() + */ +void k9DVDFile::close() +{ + if (m_file !=NULL) { + DVDCloseFile(m_file); + m_file=NULL; + } +} + + +/*! + \fn k9DVDFile::read(uchar *_buffer,uint32_t _size) + */ +int k9DVDFile::readBytes(uchar *_buffer,uint32_t _size) +{ + if (m_file !=NULL) + return DVDReadBytes(m_file,_buffer,_size); + else + return -1; +} + +int k9DVDFile::readBlocks(uint32_t _sector,uint32_t _size,uchar*_buffer) { + if (m_file !=NULL) { + return DVDReadBlocks(m_file,_sector,_size,_buffer); + } + else + return -1; +} + + + + diff --git a/libk9copy/k9dvdread.h b/libk9copy/k9dvdread.h new file mode 100644 index 0000000..b962c12 --- /dev/null +++ b/libk9copy/k9dvdread.h @@ -0,0 +1,70 @@ +// +// C++ Interface: k9dvdread +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9DVDREAD_H +#define K9DVDREAD_H + +#include "k9common.h" +#include + +/** + @author Jean-Michel PETIT +*/ + +class k9DVDRead; +class k9Ifo2; + +class k9DVDFile { +friend class k9DVDRead; +private: + dvd_file_t *m_file; + k9DVDRead *m_dvd; + QLibrary *m_library; + void openIfo(uint _vts); + void openMenu(uint _vts); + void openTitle(uint _vts); + +public: + k9DVDFile(k9DVDRead *_dvd); + ~k9DVDFile(); + void close(); + int readBytes(uchar *_buffer,uint32_t _size); + int readBlocks(uint32_t _sector,uint32_t _size,uchar*_buffer); +}; + + +class k9DVDRead{ +friend class k9DVDTitle; +private: + dvd_reader_t *m_dvd; + QPtrList files; + QPtrList ifos; +public: + k9DVDRead(); + ~k9DVDRead(); + void openDevice(const QString & _device); + k9DVDFile *openIfo(uint _vts); + k9DVDFile *openMenu(uint _vts); + k9DVDFile *openTitle(uint _vts); + k9Ifo2 *getIfo(int _num); + QString getDiscId(); + void close(); + bool opened(); + + dvd_reader_t* getDvd() const { + return m_dvd; + } + + +}; + + +#endif diff --git a/libk9copy/k9dvdsize.cpp b/libk9copy/k9dvdsize.cpp new file mode 100644 index 0000000..41360cc --- /dev/null +++ b/libk9copy/k9dvdsize.cpp @@ -0,0 +1,43 @@ +// +// C++ Implementation: k9dvdsize +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9dvdsize.h" + +int DVD_MAX_SIZE=4400; + +k9DVDSize::k9DVDSize(QObject *parent,const char *name,const QStringList args) +{ +} + +int k9DVDSize::getMaxSize(){ + return DVD_MAX_SIZE; +} + +void k9DVDSize::setMaxSize(int _size){ + DVD_MAX_SIZE=_size; + +} + +int k9DVDSize::getMaxSizeDyn(){ + return DVD_MAX_SIZE; +} + +void k9DVDSize::setMaxSizeDyn(int _size){ + DVD_MAX_SIZE=_size; + +} + + +k9DVDSize::~k9DVDSize() +{ +} + + diff --git a/libk9copy/k9dvdsize.h b/libk9copy/k9dvdsize.h new file mode 100644 index 0000000..fee2278 --- /dev/null +++ b/libk9copy/k9dvdsize.h @@ -0,0 +1,34 @@ +// +// C++ Interface: k9dvdsize +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9DVDSIZE_H +#define K9DVDSIZE_H + +#include +#include +/** +@author Jean-Michel PETIT +*/ +class k9DVDSize:public QObject { +Q_OBJECT +private: + static int m_size; +public: + k9DVDSize(QObject *parent=0,const char *name=0,const QStringList args=0) ; + static int getMaxSize(); + static void setMaxSize(int _size); + virtual int getMaxSizeDyn(); + virtual void setMaxSizeDyn(int _size); + ~k9DVDSize(); + +}; + +#endif diff --git a/libk9copy/k9dvdtitle.cpp b/libk9copy/k9dvdtitle.cpp new file mode 100644 index 0000000..acd2bdb --- /dev/null +++ b/libk9copy/k9dvdtitle.cpp @@ -0,0 +1,503 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#include "k9dvdtitle.h" + +#include + +#include +#include +#include +#include +#include +#include +#include "k9dvdtitleset.h" +#include "k9titleencopt.h" + +//*******************k9DVDAudioStream************** +k9DVDAudioStream::k9DVDAudioStream() { + size_mb=0; + selected=false; +} + +/** Read property of QString format. */ +const QString& k9DVDAudioStream::getformat() { + return format; +} + +/** Read property of QString frequency. */ +const QString& k9DVDAudioStream::getfrequency() { + return frequency; +} +/** Read property of QString quantization. */ +const QString& k9DVDAudioStream::getquantization() { + return quantization; +} +/** Read property of int channels. */ +const int& k9DVDAudioStream::getchannels() { + return channels; +} +/** Read property of int appMode. */ +const int& k9DVDAudioStream::getappMode() { + return appMode; +} +/** Read property of QString content. */ +const QString& k9DVDAudioStream::getcontent() { + return content; +} + +/** Read property of float size_mb. */ +const float& k9DVDAudioStream::getsize_mb() { + return size_mb; +} + + +/** Read property of bool selected. */ +const bool& k9DVDAudioStream::getselected() { + return selected; +} +/** Write property of bool selected. */ +void k9DVDAudioStream::setselected( const bool& _newVal) { + bool before=title->isSelected(); + selected = _newVal; + title->gettitleset()->setAudio(getID(),_newVal); + title->gettitleset()->updateSelection(); + bool after=title->isSelected(); + if (after!=before) + title->selectChapters( after); +} + +/** Read property of QString langCod. */ +const QString& k9DVDAudioStream::getlangCod() { + return langCod; +} +/** Read property of QString language. */ +const QString& k9DVDAudioStream::getlanguage() { + return language; +} + +k9DVDTitle * k9DVDAudioStream::gettitle() { + return title; +} + +int k9DVDAudioStream::getID() { + return(id); +} + +//*******************k9DVDSubtitle ******************* + +k9DVDSubtitle::k9DVDSubtitle() { + size_mb=0; + selected=false; +} + + +/** Read property of QString langCod. */ +const QString& k9DVDSubtitle::getlangCod() { + return langCod; +} +/** Read property of QString language. */ +const QString& k9DVDSubtitle::getlanguage() { + return language; +} +/** Read property of int num. */ +const int& k9DVDSubtitle::getnum() { + return num; +} +/** Read property of QString content. */ +const QString& k9DVDSubtitle::getcontent() { + return content; +} + +/** Read property of bool selected. */ +const bool& k9DVDSubtitle::getselected() { + return selected; +} +/** Write property of bool selected. */ +void k9DVDSubtitle::setselected( const bool& _newVal) { + bool before=title->isSelected(); + selected = _newVal; + title->gettitleset()->updateSelection(); + bool after=title->isSelected(); + if (after!=before) + title->selectChapters(after); +} + +/** Read property of float size_mb. */ +const float& k9DVDSubtitle::getsize_mb() { + return size_mb; +} + +k9DVDTitle * k9DVDSubtitle::gettitle() { + return title; +} + + +/*! +\fn k9DVDSubtitle::getID() +*/ +QValueList& k9DVDSubtitle::getID() { + return id; +} + + +//************************* k9DVDTitle *************************** + +/** No descriptions */ +k9DVDAudioStream* k9DVDTitle::addAudioStream() { + k9DVDAudioStream *auds; + auds = new k9DVDAudioStream; + auds->title=this; + audioStreams.append(auds); + return(auds); +} + +/** No descriptions */ +k9DVDSubtitle* k9DVDTitle::addSubtitle(int num) { + k9DVDSubtitle *subt; + subt = new k9DVDSubtitle; + subt->title=this; + subt->num=num; + subtitles.append(subt); + return(subt); +} + +/** No descriptions */ +k9DVDChapter* k9DVDTitle::addChapter(int num) { + k9DVDChapter *chap; + chap = new k9DVDChapter; + chap->m_title=this; + chap->num = num; + chap->id=k9DVDChapter::getcptChapter(); + chapters.append(chap); + return(chap); +} + +k9DVDChapter* k9DVDTitle::getChapter(int num) { + return (k9DVDChapter*)chapters.at(num); +} + +/** No descriptions */ +k9DVDAudioStream *k9DVDTitle::getaudioStream(int num) { + return (k9DVDAudioStream*)audioStreams.at(num); +} + + +/** Read property of int chapterCount. */ +const int& k9DVDTitle::getchapterCount() { + return chapterCount; +} +/** Read property of int streamCount. */ +const int& k9DVDTitle::getstreamCount() { + return streamCount; +} + +/** Read property of int audioStreamCount. */ +const int& k9DVDTitle::getaudioStreamCount() { + return audioStreamCount; +} + +/** Read property of int audioStreamCount. */ +const int& k9DVDTitle::getsubPictureCount() { + return subPictureCount; +} +/** Read property of int streamCount. */ +const QTime& k9DVDTitle::getlength() { + return length; +} + +/** Read property of int streamCount. */ +const int& k9DVDTitle::getnumTitle() { + return numTitle; +} + +/** No descriptions */ +k9DVDSubtitle *k9DVDTitle::getsubtitle(int num) { + return (k9DVDSubtitle*)subtitles.at(num); +} + +/** Read property of float size_mb. */ +const float& k9DVDTitle::getsize_mb() { + return size_mb; +} + +const float k9DVDTitle::gettotalsize_mb() { + float size =size_mb; + for (uint i=0;igetsize_mb(); + } + return size; + +} + +//If _selected=true, returns the size of selected chapters, otherwise returns size of +//unselected ones +const float k9DVDTitle::getChaptersSize_mb(bool _selected){ + return (getChaptersSize(_selected)/512); +} + +//If _selected=true, returns the size of selected chapters, otherwise returns size of +//unselected ones +const uint64_t k9DVDTitle::getChaptersSize(bool _selected){ + uint64_t total=0; + for (int i=0;igetSelected()==_selected) { + total+= chap->getsectors(); + } + } + for (uint i=0;igetChaptersSize(_selected); + } + return total; + +} + +const float k9DVDTitle::gettotalvideosize_mb() { + float size =videosize_mb; + for (uint i=0;igetvideosize_mb(); + } + return size; + +} + + +QTime k9DVDTitle::gettotallength() { + QTime totalTime=getlength(); + for (uint i=0;igetlength()); + totalTime=totalTime.addMSecs(msecs); + } + return totalTime; + +} + +QTime k9DVDTitle::getSelectedLength() { + QTime totalTime(0,0); + for (k9DVDChapter *chapter=chapters.first();chapter;chapter=chapters.next()) { + if (chapter->getSelected()) { + QTime t; + int msecs= t.msecsTo(chapter->getlength()); + totalTime=totalTime.addMSecs(msecs); + } + } + + + for (uint i=0;i tchapters=tmp->getChapters(); + for (k9DVDChapter *chapter=tchapters.first();chapter;chapter=tchapters.next()) { + if (chapter->getSelected()) { + QTime t; + int msecs= t.msecsTo(chapter->getlength()); + totalTime=totalTime.addMSecs(msecs); + } + } + } + return totalTime; + +} + + +/** Read property of float videosize_mb. */ +const float& k9DVDTitle::getvideosize_mb() { + return videosize_mb; +} + + +/** Read property of int VTS. */ +const int& k9DVDTitle::getVTS() { + return VTS; +} +/** Read property of int TTN. */ +const int& k9DVDTitle::getTTN() { + return TTN; +} +/** Read property of float FPS. */ +const float& k9DVDTitle::getFPS() { + return FPS; +} +/** Read property of QString format. */ +const QString& k9DVDTitle::getformat() { + return format; +} +/** Read property of QString aspectRatio. */ +const QString& k9DVDTitle::getaspectRatio() { + return aspectRatio; +} +/** Read property of QString width. */ +const QString& k9DVDTitle::getwidth() { + return width; +} +/** Read property of QString height. */ +const QString& k9DVDTitle::getheight() { + return height; +} +/** Read property of QString palette. */ +void k9DVDTitle::getpalette(int i,QString & c) { + c=*palette.at(i); +} +/** Read property of QString DF. */ +const QString& k9DVDTitle::getDF() { + return DF; +} +/** Read property of int angleCount. */ +const int& k9DVDTitle::getangleCount() { + return angleCount; +} + + +bool k9DVDTitle::isSelected() { + k9DVDAudioStream *l_auds; + k9DVDSubtitle *l_sub; + uint i; + + if (forceSelection) + return true; + + for (i=0;igetselected()) { + return(true); + } + } + + for (i=0;igetselected()) { + return(true); + } + } + return(false); +} + + void k9DVDTitle::setforceSelection(bool _state) { + bool before=isSelected(); + forceSelection = _state; + gettitleset()->updateSelection(); + bool after=isSelected(); + if (after!=before) { + selectChapters(after); + emit selectionChanged(); + } +} + + +/** Read property of QString name. */ +const QString& k9DVDTitle::getname() { + return name; +} +/** Write property of QString name. */ +void k9DVDTitle::setname( const QString& _newVal) { + name = _newVal; +} + +/*! +\fn k9DVDTitle::getpgc() +*/ +int k9DVDTitle::getpgc() { + return(pgc); +} + + +/*! +\fn k9DVDTitle::setNextTitle(k9DVDTitle * nextTitle) +*/ +void k9DVDTitle::setnextTitle(k9DVDTitle * nTitle) { + nextTitle=nTitle; +} + + +/*! +\fn k9DVDTitle::getnextTitle() +*/ +k9DVDTitle* k9DVDTitle::getnextTitle() { + return nextTitle; +} + + +k9DVDAudioStream* k9DVDTitle::getDefAudio() const { + return m_defAudio; +} + + +void k9DVDTitle::setDefAudio(k9DVDAudioStream* _value) { + m_defAudio = _value; + m_defAudioSet = true; +} + + +k9DVDSubtitle* k9DVDTitle::getDefSubtitle() const { + return m_defSubtitle; +} + + +void k9DVDTitle::setDefSubtitle(k9DVDSubtitle* _value) { + m_defSubtitle = _value; + m_defSubtitleSet=true; +} + + +k9DVDTitle::k9DVDTitle() { + audioStreams.setAutoDelete(true); + chapters.setAutoDelete(true); + subtitles.setAutoDelete(true); + size_mb=0; + videosize_mb=0; + vobusize_mb=0; + nextTitle=NULL; + m_defAudio=NULL; + m_defSubtitle=NULL; + m_defAudioSet=false; + m_defSubtitleSet=false; + forceSelection=false; + m_forceFactor=false; + m_factor=0; + m_encOpt=NULL; +} + +k9TitleEncOpt* k9DVDTitle::getEncOpt() { + if (!m_encOpt) + m_encOpt=new k9TitleEncOpt(this); + return m_encOpt; + +} + + +void k9DVDTitle::selectChapters(bool _state) { + for (int i=0;i < chapterCount;i++) { + getChapter(i)->setSelected( _state); + } + + for (uint iTitle=0;iTitleselectChapters(_state); + } +} + + + + diff --git a/libk9copy/k9dvdtitle.h b/libk9copy/k9dvdtitle.h new file mode 100644 index 0000000..9b29f53 --- /dev/null +++ b/libk9copy/k9dvdtitle.h @@ -0,0 +1,259 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#ifndef K9DVDTITLE_H +#define K9DVDTITLE_H + +#include "k9common.h" +#include "k9dvd.h" +#include "k9dvdchapter.h" +#include +#include +#include + +class k9DVDTitleSet; + +class k9DVDVideoStream : public QObject{ +Q_OBJECT +friend class k9DVDTitle; +private: // Private attributes +public: // Public methods + +}; + +class k9DVDAudioStream : public QObject{ +Q_OBJECT +friend class k9DVDTitle; +friend class k9DVD; +private: // Private attributes + /** */ + QString langCod; + /** */ + QString language; + /** */ + QString format; + /** */ + QString frequency; + /** */ + QString quantization; + /** */ + int channels; + /** */ + int appMode; + /** */ + QString content; + /** */ + float size_mb; + /** */ + bool selected; + int id; + k9DVDTitle *title; + int m_streamId; +public: // Public methods + k9DVDAudioStream(); + /** Read property of QString langCod. */ + virtual const QString& getlangCod(); + /** Read property of QString language. */ + virtual const QString& getlanguage(); + /** Read property of QString format. */ + virtual const QString& getformat(); + /** Read property of QString frequency. */ + virtual const QString& getfrequency(); + /** Read property of QString quantization. */ + virtual const QString& getquantization(); + /** Read property of int channels. */ + virtual const int& getchannels(); + /** Read property of int appMode. */ + virtual const int& getappMode(); + /** Read property of QString content. */ + virtual const QString& getcontent(); + /** Read property of float size_mb. */ + virtual const float& getsize_mb(); + /** Write property of bool selected. */ + virtual void setselected( const bool& _newVal); + /** Read property of bool selected. */ + virtual const bool& getselected(); + + virtual k9DVDTitle* gettitle(); + virtual int getID(); + + virtual int getStreamId() const {return m_streamId;}; + +}; + +class k9DVDSubtitle : public QObject{ +Q_OBJECT +friend class k9DVDTitle; +friend class k9DVD; +private: // Private attributes + /** */ + QString langCod; + /** */ + QString language; + /** */ + int num; + /** */ + QString content; + /** */ + float size_mb; + /** */ + bool selected; + QValueList id; + k9DVDTitle *title; +public: // Public methods + k9DVDSubtitle(); + /** Read property of QString langCod. */ + virtual const QString& getlangCod(); + /** Read property of QString language. */ + virtual const QString& getlanguage(); + /** Read property of int num. */ + virtual const int& getnum(); + /** Read property of QString content. */ + virtual const QString& getcontent(); + /** Read property of float size_mb. */ + virtual const float& getsize_mb(); + /** Write property of bool selected. */ + virtual void setselected( const bool& _newVal); + /** Read property of bool selected. */ + virtual const bool& getselected(); + virtual k9DVDTitle* gettitle(); + virtual QValueList& getID(); +}; + + +class k9TitleEncOpt; + + +class k9DVDTitle : public QObject{ +Q_OBJECT +friend class k9DVD; +private: // Public attributes + unsigned int ts_nr; + int chapterCount; + int streamCount; + int audioStreamCount; + int subPictureCount; + QTime length; + k9DVDVideoStream videoStream; + QObjectList audioStreams; + QObjectList subtitles; + int VTS; + int TTN; + float FPS; + QString format; + QString aspectRatio; + int numTitle; + QString width; + QString height; + QStringList palette; + QString DF; + float size_mb; + int angleCount; + float videosize_mb; + float vobusize_mb; + QString name; + k9DVDTitle* nextTitle; + int id; + k9DVDTitleset *m_titleset; + k9DVDAudioStream *m_defAudio; + k9DVDSubtitle *m_defSubtitle; + bool m_defAudioSet; + bool m_defSubtitleSet; + QPtrList m_titles; + uint32_t m_sectors; + bool m_forceFactor; + float m_factor; + k9TitleEncOpt *m_encOpt; +public: // Public methods + k9DVDTitle(); + virtual k9DVDTitleset *gettitleset() {return m_titleset;}; + virtual const int& getchapterCount(); + virtual const int& getstreamCount(); + virtual const int& getaudioStreamCount(); + virtual const int& getsubPictureCount(); + virtual const QTime& getlength(); + virtual QTime gettotallength(); + virtual QTime getSelectedLength(); + + virtual const int& getVTS(); + virtual const int& getTTN(); + virtual const float& getFPS(); + virtual const QString& getformat(); + virtual const QString& getaspectRatio(); + virtual const QString& getwidth(); + virtual const QString& getheight(); + virtual void getpalette(int i,QString & c); + virtual const QString& getDF(); + virtual const int& getangleCount(); + virtual const int& getnumTitle(); + virtual k9DVDAudioStream *getaudioStream(int num); + virtual k9DVDSubtitle *getsubtitle(int num); + virtual const float& getsize_mb(); + virtual const float gettotalsize_mb(); + virtual const float gettotalvideosize_mb(); + virtual const float getChaptersSize_mb(bool _selected); + virtual const uint64_t getChaptersSize(bool _selected); + virtual const float& getvideosize_mb(); + virtual bool isSelected(); + virtual void setname( const QString& _newVal); + virtual const QString& getname(); + virtual int getpgc(); + virtual void setnextTitle(k9DVDTitle * nTitle); + virtual k9DVDTitle* getnextTitle(); + virtual k9DVDChapter *getChapter(int num); + virtual bool getIndexed() {return indexed;}; + virtual void setforceSelection(bool _state); + virtual int getId() {return id;}; + virtual void setDefAudio(k9DVDAudioStream* _value); + virtual k9DVDAudioStream* getDefAudio() const; + virtual void setDefSubtitle(k9DVDSubtitle* _value); + virtual k9DVDSubtitle* getDefSubtitle() const; + virtual bool getDefAudioSet() const {return m_defAudioSet;}; + virtual bool getDefSubtitleSet() const {return m_defSubtitleSet;}; + virtual QPtrList< k9DVDTitle > getTitles() const {return m_titles;}; + virtual uint32_t getsectors() { return m_sectors;}; + virtual float getfactor() { return m_factor;}; + virtual bool getforceFactor() { return m_forceFactor;}; + virtual void selectChapters(bool _state); + virtual QPtrList< k9DVDChapter > getChapters() const {return chapters;}; + virtual k9TitleEncOpt* getEncOpt() ; + +public slots: + virtual void setfactor(float _value) {m_factor=_value;}; + virtual void setforceFactor(bool _value) {m_forceFactor=_value;}; + +signals: + void selectionChanged(); +private: // Private methods + k9DVDAudioStream* addAudioStream(); + k9DVDChapter* addChapter(int num); + k9DVDSubtitle* addSubtitle(int num); + QPtrList chapters; + bool indexed; + bool forceSelection; + int pgc; + +public: // Public attributes +}; + + + + +#endif + diff --git a/libk9copy/k9dvdtitleset.cpp b/libk9copy/k9dvdtitleset.cpp new file mode 100644 index 0000000..cfa445a --- /dev/null +++ b/libk9copy/k9dvdtitleset.cpp @@ -0,0 +1,138 @@ +// +// C++ Implementation: k9dvdtitleset +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "k9dvdtitleset.h" +#include +#include +#include +#include +#include +#include + +k9DVDTitleset::k9DVDTitleset( uint _num,uint32_t _size) { + m_num=_num; + m_size=_size; + m_selected=false; + m_updating=false; + for (uint i=0;i<8;i++) + m_audioStreams[i]=false; +}; + + +const QString k9DVDTitleset::getsize_mb() +{ + double size_mb=(double)m_size /512; + QString c; + c.sprintf("%.2f",size_mb); + return c; +} + +int k9DVDTitleset::getnum() +{ + return m_num; +} + +void k9DVDTitleset::add(k9DVDTitle * _title) +{ + titles.append(_title); +} + +int k9DVDTitleset::count() +{ + return titles.count(); +} + +k9DVDTitle * k9DVDTitleset::gettitle(uint _pos) +{ + return titles.at(_pos); +} + +uint32_t k9DVDTitleset::getsize() +{ + return m_size; +} + +bool k9DVDTitleset::getselected() +{ + return m_selected; +} + +void k9DVDTitleset::setselected(bool _state) +{ + // selectionner / d�electionner tous les titres + for (int i=0; igetaudioStreamCount();j++) + title->getaudioStream(j)->setselected(_state); + for (int j=0;jgetsubPictureCount();j++) + title->getsubtitle(j)->setselected(_state); + title->setforceSelection(_state); + } + m_selected=_state;; +} + +void k9DVDTitleset::updateSelection() +{ + if (m_updating) + return; + m_updating=true; + + + bool selected=m_selected; + m_selected=false; + //check if at least on title is selected + for (int i=0; iisSelected() && title->getIndexed()) + m_selected=true; + } + + //if titleset selected, we select all features. otherwise they are unselected + if (selected !=m_selected) + for (int i=0; igetIndexed() && title->isSelected()) + for (uint iTitle=0;iTitle getTitles().count();iTitle++) + { + k9DVDTitle *title2=title->getTitles().at(iTitle); + for (int j=0; j getaudioStreamCount();j++) + title2->getaudioStream(j)->setselected(title->getaudioStream(j)->getselected()); + for (int j=0;jgetsubPictureCount();j++) + title2->getsubtitle(j)->setselected(title2->getsubtitle(j)->getselected()); + title2->setforceSelection(true); + } + } + m_updating=false; +} + +void k9DVDTitleset::setAudio(int _id,bool _selected) { + m_audioStreams[_id -1]=_selected; +} + +int k9DVDTitleset::getNewAudioStreamId(int _oldId) { + int newId=0; + //Returns the new stream Id, only if the stream is selected. Otherwise, returns 0 + if (m_audioStreams[_oldId-1]) { +/* for (int i=0; i<_oldId;i++) { + if (m_audioStreams[i]) + newId++; + } +*/ + return _oldId; + } + return newId; +} + diff --git a/libk9copy/k9dvdtitleset.h b/libk9copy/k9dvdtitleset.h new file mode 100644 index 0000000..7e42522 --- /dev/null +++ b/libk9copy/k9dvdtitleset.h @@ -0,0 +1,48 @@ +// +// C++ Interface: k9dvdtitleset +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9DVDTITLESET_H +#define K9DVDTITLESET_H + +#include "k9common.h" +#include "k9dvd.h" +#include +#include +#include +#include "k9dvdtitle.h" + +class k9DVDTitleset :public QObject +{ + Q_OBJECT +private: + int m_num; + uint32_t m_size; + QPtrList titles; + bool m_selected; + bool m_updating; + bool m_audioStreams[8]; +public: + k9DVDTitleset( uint _num,uint32_t _size); + virtual void add(k9DVDTitle *_title); + virtual int count(); + virtual k9DVDTitle *gettitle(uint _pos); + virtual uint32_t getsize(); + virtual const QString getsize_mb(); + virtual bool getselected(); + virtual void setselected(bool state); + virtual void updateSelection(); + virtual int getnum(); + virtual void setAudio(int _id,bool _selected); + virtual int getNewAudioStreamId(int _oldId); +} +; + +#endif diff --git a/libk9copy/k9ifo2.cpp b/libk9copy/k9ifo2.cpp new file mode 100644 index 0000000..56ba072 --- /dev/null +++ b/libk9copy/k9ifo2.cpp @@ -0,0 +1,933 @@ +/*************************************************************************** + * Copyright (C) 2005 by Jean-Michel Petit * + * jm_petit@laposte.net * + * * + * 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. * + ***************************************************************************/ +#include "k9ifo2.h" +#include "bswap.h" +#include "dvdread.h" + + +k9Ifo2::k9Ifo2(k9DVDRead *_dvdread) + : QObject(NULL,"") { + _ifo=NULL; + m_dvd=_dvdread; +} + + +k9Ifo2::~k9Ifo2() { + closeIFO(); + + +} + +/*! + \fn k9Ifo2::setDevice(QString &_device) + */ +void k9Ifo2::setDevice(QString &_device) { + device=_device; +} + + +/*! + \fn k9Ifo2::setOutput(QString &_output) + */ +void k9Ifo2::setOutput(QString &_output) { + output=_output; +} + + +/*! + \fn k9Ifo2::openIFO(int _num) + */ +ifo_handle_t * k9Ifo2::openIFO(int _num) { + _ifo = ifoOpen(m_dvd->getDvd(), _num); + numIfo=_num; + return _ifo; + +} + + +/*! + \fn k9Ifo2::IFOClose( ifo_handle_t* _ifo) + */ +void k9Ifo2::closeIFO() { + if(_ifo!=NULL) { + ifoClose(_ifo); + _ifo=NULL; + } +} + +ifo_handle_t * k9Ifo2::getIFO() { + return _ifo; +} + +/*! + \fn k9Ifo2::saveIFO(ifo_handle_t* _ifo) + */ +void k9Ifo2::saveIFO() { + uint32_t size; + /* DVD handler */ + k9DVDFile *dvdfile; + bool mainIfo = (numIfo==0); + + QString filename,filename2; + if (mainIfo) { + filename="/VIDEO_TS/VIDEO_TS.IFO"; + } else { + filename.sprintf("/VIDEO_TS/VTS_%02d_0.IFO",numIfo); + } + if (numIfo==0) + size=_ifo->vmgi_mat->vmgi_last_sector +1; + else + size=_ifo->vtsi_mat->vtsi_last_sector +1; + + size*=DVD_BLOCK_LEN; + // if (k9UDFFindFile(dvd,(char*) filename.latin1(), &size)) { + if (size > 0) { + uchar *buffer ; + buffer=new uchar[size]; + bufCopy=new uchar[size]; + m_buffer=new uchar[size*2]; + memset(buffer,0,size); + memset(bufCopy,0,size); + memset(m_buffer,0,size*2); + //Lecture du fichier IFO original et sauvegarde dans buffer + if ((dvdfile = m_dvd->openIfo(numIfo))== 0) { + fprintf(stderr, "Failed opening IFO for titleset %d\n", 0); + free(buffer); + return; + } + + /* if(DVDFileSeek(dvd_file, 0)!=0) { + return; + } + */ + + if (dvdfile->readBytes(buffer,size) != size) { + fprintf(stderr, "Error reading IFO for titleset %d\n", 0); + free(buffer); + dvdfile->close(); + return; + } + + memcpy(bufCopy,buffer,size); + bufCopySize=size; + dvdfile->close(); + if (mainIfo) { + m_position=0; + updateVMG(buffer); + m_position=1024; //sizeof(vmgi_mat_t); + updateFP_PGC(buffer); + _ifo->vmgi_mat->vmgi_last_byte=m_position -1; + + updateTT_SRPT(buffer); + updatePGCI_UT(buffer); + + updateVTS_ATRT(buffer); + updateTXTDT_MGI(buffer); + updateC_ADT(buffer,true); + updateVOBU_ADMAP(buffer,true); + + updateVMG(buffer); + + } else { + m_position=0; + updateVTS(buffer); + m_position=sizeof(vtsi_mat_t); + //_ifo->vtsi_mat->vtsi_last_byte=m_position -1; + updateVTS_PTT_SRPT(buffer); + updatePGCIT(buffer); + updatePGCI_UT(buffer); + updateVTS_TMAPT(buffer); + updateC_ADT(buffer,true); + updateVOBU_ADMAP(buffer,true); + updateC_ADT(buffer, false); + updateVOBU_ADMAP(buffer,false); + updateVTS(buffer); + } + m_position=round(m_position); + + //sauvegarder buffer dans fichier + if (mainIfo) { + filename=output + "/VIDEO_TS.IFO"; + filename2=output + "/VIDEO_TS.BUP"; + } else { + filename.sprintf("/VTS_%02d_0.IFO",numIfo); + filename=output + filename; + + filename2.sprintf("/VTS_%02d_0.BUP",numIfo); + filename2=output + filename2; + } + + QFile ifofile (filename); + ifofile.open(IO_WriteOnly); + if (ifofile.writeBlock((char*)m_buffer,m_position) == -1) { + QString sError("erreur"); + } + ifofile.close(); + + QFile ifofile2 (filename2); + ifofile2.open(IO_WriteOnly); + if (ifofile2.writeBlock((char*)m_buffer,m_position) == -1) { + QString sError("erreur"); + } + ifofile2.close(); + + + delete buffer; + delete bufCopy; + delete m_buffer; + } +} + + +/*! + \fn k9Ifo2::updateVMG(uchar * _buffer) + */ +void k9Ifo2::updateVMG(uchar * _buffer) { + vmgi_mat_t vmgi_mat; + memcpy(&vmgi_mat,_ifo->vmgi_mat,sizeof(vmgi_mat_t)); + uint32_t lastSector=vmgi_mat.vmgi_last_sector; + uint32_t lastByte=vmgi_mat.vmgi_last_byte; + //JMP : à vérifier + if (m_position !=0) { + lastSector=(round(m_position) - DVD_BLOCK_LEN) / DVD_BLOCK_LEN; + //lastByte=vmgi_mat.vmgi_last_sector * DVD_BLOCK_LEN +DVD_BLOCK_LEN -1; + vmgi_mat.vmg_last_sector+=2*(lastSector-vmgi_mat.vmgi_last_sector); + } + + vmgi_mat.vmgi_last_sector=lastSector; + if (vmgi_mat.vmgm_vobs !=0) + vmgi_mat.vmgm_vobs=vmgi_mat.vmgi_last_sector +1; + + B2N_32(vmgi_mat.vmg_last_sector); + B2N_32(vmgi_mat.vmgi_last_sector); + B2N_32(vmgi_mat.vmg_category); + B2N_16(vmgi_mat.vmg_nr_of_volumes); + B2N_16(vmgi_mat.vmg_this_volume_nr); + B2N_16(vmgi_mat.vmg_nr_of_title_sets); + B2N_64(vmgi_mat.vmg_pos_code); + B2N_32(vmgi_mat.vmgi_last_byte); + B2N_32(vmgi_mat.first_play_pgc); + B2N_32(vmgi_mat.vmgm_vobs); + B2N_32(vmgi_mat.tt_srpt); + B2N_32(vmgi_mat.vmgm_pgci_ut); + B2N_32(vmgi_mat.ptl_mait); + B2N_32(vmgi_mat.vts_atrt); + B2N_32(vmgi_mat.txtdt_mgi); + B2N_32(vmgi_mat.vmgm_c_adt); + B2N_32(vmgi_mat.vmgm_vobu_admap); + B2N_16(vmgi_mat.vmgm_audio_attr.lang_code); + B2N_16(vmgi_mat.vmgm_subp_attr.lang_code); + + memcpy(m_buffer,&vmgi_mat,sizeof(vmgi_mat_t)); +} + + +/*! + \fn k9Ifo2::updateFP_PGC(uchar * _buffer) + */ +void k9Ifo2::updateFP_PGC(uchar * _buffer) { + //int offset=_ifo->vmgi_mat->first_play_pgc; + _ifo->vmgi_mat->first_play_pgc=m_position; + return updatePGC(_buffer,_ifo->first_play_pgc,m_position); + + +} + +/*! + \fn k9Ifo2::updatePGC(uchar *_buffer,pgc_t *_pgc,int _offset) + */ +void k9Ifo2::updatePGC(uchar *_buffer,pgc_t *_pgc,int _offset) { + pgc_t pgc; + memcpy(&pgc,_pgc,sizeof(pgc_t)); + uint start=m_position; + m_position+=PGC_SIZE; + + if(pgc.command_tbl_offset != 0) { + pgc.command_tbl_offset=PGC_SIZE; + updatePGC_COMMAND_TBL(_buffer ,pgc.command_tbl ,m_position); + } + if(pgc.program_map_offset != 0) { + pgc.program_map_offset=m_position-start; + updatePGC_PROGRAM_MAP(_buffer, pgc.program_map,pgc.nr_of_programs ,m_position); + } + if(pgc.cell_playback_offset != 0) { + pgc.cell_playback_offset=m_position-start; + updatePGC_CELL_PLAYBACK_TBL(_buffer ,pgc.cell_playback,pgc.nr_of_cells,m_position); + } + + if(pgc.cell_position_offset != 0) { + pgc.cell_position_offset=m_position-start; + updatePGC_CELL_POSITION_TBL(_buffer,pgc.cell_position,pgc.nr_of_cells,m_position); + } + + B2N_16(pgc.command_tbl_offset); + B2N_16(pgc.next_pgc_nr); + B2N_16(pgc.prev_pgc_nr); + B2N_16(pgc.goup_pgc_nr); + B2N_16(pgc.program_map_offset); + B2N_16(pgc.cell_playback_offset); + B2N_16(pgc.cell_position_offset); + + int i; + for(i = 0; i < 8; i++) + B2N_16(pgc.audio_control[i]); + for(i = 0; i < 32; i++) + B2N_32(pgc.subp_control[i]); + for(i = 0; i < 16; i++) + B2N_32(pgc.palette[i]); + + memcpy(m_buffer+_offset,&pgc,PGC_SIZE); +} + + + +/*! + \fn k9Ifo2::updatePGC_COMMAND_TBL(uchar *_buffer,pgc_command_tbl_t *_cmd_tbl,int offset) + */ +void k9Ifo2::updatePGC_COMMAND_TBL(uchar *_buffer,pgc_command_tbl_t *_cmd_tbl,int _offset) { + struct { + uint16_t nr_of_pre; + uint16_t nr_of_post; + uint16_t nr_of_cell; + uint16_t last_byte; + } + ATTRIBUTE_PACKED cmd_tbl; + + memcpy(&cmd_tbl,_cmd_tbl,sizeof(cmd_tbl)); + + //moves the offset to save vm_cmd + m_position+=sizeof(cmd_tbl); + + if(_cmd_tbl->nr_of_pre != 0) { + unsigned int pre_cmds_size = _cmd_tbl->nr_of_pre * COMMAND_DATA_SIZE; + memcpy(m_buffer + m_position,_cmd_tbl->pre_cmds,pre_cmds_size); + m_position+=pre_cmds_size; + } + if(_cmd_tbl->nr_of_post != 0) { + unsigned int post_cmds_size = _cmd_tbl->nr_of_post * COMMAND_DATA_SIZE; + memcpy(m_buffer + m_position,_cmd_tbl->post_cmds,post_cmds_size); + m_position+=post_cmds_size; + } + if(_cmd_tbl->nr_of_cell != 0) { + unsigned int cell_cmds_size = _cmd_tbl->nr_of_cell * COMMAND_DATA_SIZE; + memcpy(m_buffer +m_position,_cmd_tbl->cell_cmds,cell_cmds_size); + m_position+=cell_cmds_size; + } + B2N_16(cmd_tbl.nr_of_pre); + B2N_16(cmd_tbl.nr_of_post); + B2N_16(cmd_tbl.nr_of_cell); + cmd_tbl.last_byte=m_position-_offset-1; + B2N_16(cmd_tbl.last_byte); + memcpy(m_buffer+_offset,&cmd_tbl,sizeof(cmd_tbl)); + + +} + + +/*! + \fn k9Ifo2::updatePGC_PROGRAM_MAP(uchar *_buffer, pgc_program_map_t *_program_map, int _nr, int_offset + */ +void k9Ifo2::updatePGC_PROGRAM_MAP(uchar *_buffer, pgc_program_map_t *_program_map, int _nr, int _offset) { + int size = _nr * sizeof(pgc_program_map_t); + memcpy(m_buffer+_offset, _program_map, size); + // pad to word boundary + size += size % 2; + m_position += size; +} + + +/*! + \fn k9Ifo2::updatePGC_CELL_PLAYBACK_TBL(uchar *_buffer, cell_playback_t *_cell_playback,int _nr, int _offset) + */ +void k9Ifo2::updatePGC_CELL_PLAYBACK_TBL(uchar *_buffer, cell_playback_t *_cell_playback,int _nr, int _offset) { + cell_playback_t *cell_playback; + int size = _nr * sizeof(cell_playback_t); + cell_playback=(cell_playback_t*) malloc(size); + memcpy(cell_playback,_cell_playback,size); + + for( int i = 0; i < _nr; i++) { + B2N_32(cell_playback[i].first_sector); + B2N_32(cell_playback[i].first_ilvu_end_sector); + B2N_32(cell_playback[i].last_vobu_start_sector); + B2N_32(cell_playback[i].last_sector); + } + + memcpy(m_buffer + _offset,cell_playback,size); + m_position+=size; + + free(cell_playback); +} + + +/*! + \fn k9Ifo2::updatePGC_CELL_POSITION_TBL(uchar *_buffer,cell_position_t *_cell_position,int _nr, int _offset) + */ +void k9Ifo2::updatePGC_CELL_POSITION_TBL(uchar *_buffer,cell_position_t *_cell_position,int _nr, int _offset) { + cell_position_t * cell_position; + int size = _nr * sizeof(cell_position_t); + cell_position=(cell_position_t*)malloc(size); + memcpy(cell_position,_cell_position,size); + for( int i = 0; i < _nr; i++) { + B2N_16(cell_position[i].vob_id_nr); + } + memcpy(m_buffer + _offset,cell_position,size); + m_position+=size; + free(cell_position); +} + +int k9Ifo2::round(int _value) { + return ((_value-1)|(DVD_BLOCK_LEN-1))+1; // DVD_BLOCK_LEN-1 = 0x7FF +} + +/*! + \fn k9Ifo2::updateTT_SRPT(uchar *_buffer) + */ +void k9Ifo2::updateTT_SRPT(uchar *_buffer) { + if(_ifo->vmgi_mat->tt_srpt != 0) { + tt_srpt_t * tt_srpt; + tt_srpt=(tt_srpt_t*) malloc(sizeof(tt_srpt_t)); + // int offset= _ifo->vmgi_mat->tt_srpt * DVD_BLOCK_LEN; + + m_position=round(m_position); + int offset=m_position; + _ifo->vmgi_mat->tt_srpt=m_position/DVD_BLOCK_LEN; + + memcpy (tt_srpt,_ifo->tt_srpt,sizeof(tt_srpt_t)); + + + int info_length = tt_srpt->last_byte + 1 - TT_SRPT_SIZE; + title_info_t * title_info; + title_info =(title_info_t*) malloc(info_length); + memcpy(title_info, tt_srpt->title,info_length); + + for(int i = 0; i < tt_srpt->nr_of_srpts; i++) { + B2N_16(title_info[i].nr_of_ptts); + B2N_16(title_info[i].parental_id); + B2N_32(title_info[i].title_set_sector); + } + memcpy(m_buffer+offset+TT_SRPT_SIZE,title_info,info_length); + + free(title_info); + m_position +=info_length; + + B2N_16(tt_srpt->nr_of_srpts); + B2N_32(tt_srpt->last_byte); + memcpy(m_buffer+offset,tt_srpt,TT_SRPT_SIZE); + free (tt_srpt); + } + +} + + +void k9Ifo2::updatePGCI_UT(uchar *_buffer) { + int sector,sector2; + if(_ifo->vmgi_mat) { + if(_ifo->vmgi_mat->vmgm_pgci_ut == 0) + return; + m_position=round(m_position); + _ifo->vmgi_mat->vmgm_pgci_ut=m_position/DVD_BLOCK_LEN; + } else if(_ifo->vtsi_mat) { + if(_ifo->vtsi_mat->vtsm_pgci_ut == 0) + return; + m_position=round(m_position); + _ifo->vtsi_mat->vtsm_pgci_ut=m_position/DVD_BLOCK_LEN; + } else { + return; + } + + + sector2=sector=m_position; + if (_ifo->pgci_ut !=NULL) { + pgci_ut_t * pgci_ut; + pgci_ut = (pgci_ut_t*) malloc( sizeof(pgci_ut_t)); + memcpy (pgci_ut,_ifo->pgci_ut,sizeof(pgci_ut_t)); + m_position+=PGCI_UT_SIZE; + sector2=m_position; + + pgci_lu_t pgci_lu[_ifo->pgci_ut->nr_of_lus]; + m_position+=_ifo->pgci_ut->nr_of_lus*PGCI_LU_SIZE; + memcpy(pgci_lu,_ifo->pgci_ut->lu,_ifo->pgci_ut->nr_of_lus*sizeof(pgci_lu_t)); + + for(int i = 0; i < _ifo->pgci_ut->nr_of_lus; i++) { + B2N_16(pgci_lu[i].lang_code); + pgci_lu[i].lang_start_byte=m_position - sector; + B2N_32(pgci_lu[i].lang_start_byte); + updatePGCIT_internal(_buffer,_ifo->pgci_ut->lu[i].pgcit,m_position); + } + for (int i=0;i <_ifo->pgci_ut->nr_of_lus;i++) + memcpy(m_buffer+sector2+i*PGCI_LU_SIZE ,&(pgci_lu[i]),PGCI_LU_SIZE); + + B2N_16(pgci_ut->nr_of_lus); + pgci_ut->last_byte=m_position-sector-1; + B2N_32(pgci_ut->last_byte); + memcpy(m_buffer+sector,pgci_ut,PGCI_UT_SIZE); + free(pgci_ut); + + + } + +} + +void k9Ifo2::updatePGCIT(uchar *_buffer) { + if(!_ifo->vtsi_mat) + return ; + + if(_ifo->vtsi_mat->vts_pgcit == 0) /* mandatory */ + return ; + m_position=round(m_position); + _ifo->vtsi_mat->vts_pgcit=m_position / DVD_BLOCK_LEN; + updatePGCIT_internal(_buffer,_ifo->vts_pgcit,_ifo->vtsi_mat->vts_pgcit * DVD_BLOCK_LEN); +} + + +void k9Ifo2::updatePGCIT_internal(uchar *_buffer, pgcit_t *_pgcit, int _offset) { + pgcit_t * pgcit; + pgcit=(pgcit_t*)malloc(sizeof(pgcit_t)); + memcpy(pgcit,_pgcit,sizeof(pgcit_t)); + + int offset=m_position+PGCIT_SIZE; + m_position+=PGCIT_SIZE; + + pgci_srp_t pgci_srp[_pgcit->nr_of_pgci_srp]; + memcpy(pgci_srp,_pgcit->pgci_srp,sizeof(pgci_srp_t)*_pgcit->nr_of_pgci_srp); + + m_position+=_pgcit->nr_of_pgci_srp*PGCI_SRP_SIZE; + + for(int i = 0; i < _pgcit->nr_of_pgci_srp; i++) { + B2N_16(pgci_srp[i].ptl_id_mask); + pgci_srp[i].pgc_start_byte=m_position-_offset; + B2N_32(pgci_srp[i].pgc_start_byte); //JMP:faux + updatePGC(_buffer,_pgcit->pgci_srp[i].pgc,m_position); + } + + for(int i = 0; i < _pgcit->nr_of_pgci_srp; i++) + memcpy(m_buffer+offset+i*PGCI_SRP_SIZE,&(pgci_srp[i]),PGCI_SRP_SIZE); + + B2N_16(pgcit->nr_of_pgci_srp); + pgcit->last_byte=m_position-_offset-1; + B2N_32(pgcit->last_byte); + memcpy(m_buffer+_offset ,pgcit,PGCIT_SIZE); + free(pgcit); + +} + + +void k9Ifo2::updatePTL_MAIT(uchar *_buffer) { + if(!_ifo->vmgi_mat) + return; + + _ifo->vmgi_mat->ptl_mait = 0; + return; +} + +void k9Ifo2::updateVTS_ATRT(uchar *_buffer) { + if(_ifo->vmgi_mat->vts_atrt == 0) + return; + uint32_t orig=_ifo->vmgi_mat->vts_atrt * DVD_BLOCK_LEN; + m_position=round(m_position); + _ifo->vmgi_mat->vts_atrt=m_position/DVD_BLOCK_LEN; + + memcpy(m_buffer+m_position,_buffer+orig,_ifo->vts_atrt->last_byte+1); + + m_position+=_ifo->vts_atrt->last_byte+1; + /* + int sector = _ifo->vmgi_mat->vts_atrt * DVD_BLOCK_LEN; + vts_atrt_t *vts_atrt; + vts_atrt = (vts_atrt_t*)malloc(sizeof(vts_atrt_t)); + memcpy(vts_atrt,_ifo->vts_atrt,VTS_ATRT_SIZE); + B2N_16(vts_atrt->nr_of_vtss); + B2N_32(vts_atrt->last_byte); + memcpy(m_buffer+sector,vts_atrt,VTS_ATRT_SIZE); + free(vts_atrt); + m_position+=VTS_ATRT_SIZE; + + sector += VTS_ATRT_SIZE; + + memcpy(m_buffer+sector,_buffer +orig+VTS_ATRT_SIZE ,VTS_ATTRIBUTES_SIZE*_ifo->vts_atrt->nr_of_vtss); + + m_position+=VTS_ATTRIBUTES_SIZE*_ifo->vts_atrt->nr_of_vtss; + */ +} + +void k9Ifo2::updateTXTDT_MGI(uchar * _buffer) { + if(_ifo->vmgi_mat->txtdt_mgi == 0) + return; + + struct { + char disc_name[15]; + char nr_of_language_units; + uint32_t last_byte; + txtdt_lu_t *lu; + } ATTRIBUTE_PACKED txtdtmgi; + + + m_position=round(m_position); + int orig=_ifo->vmgi_mat->txtdt_mgi*DVD_BLOCK_LEN; + int offset=m_position; + _ifo->vmgi_mat->txtdt_mgi =m_position/ DVD_BLOCK_LEN; + memcpy(&txtdtmgi,_buffer+orig,sizeof(txtdtmgi)); + + B2N_32(txtdtmgi.last_byte); + memcpy(m_buffer+offset,_buffer+orig ,txtdtmgi.last_byte+1); + m_position+=txtdtmgi.last_byte+1; +} + +void k9Ifo2::updateC_ADT(uchar * _buffer, bool _isMenu) { + if(_ifo->vmgi_mat) { + if(_ifo->vmgi_mat->vmgm_c_adt != 0) { + m_position =round(m_position); // + _ifo->vmgi_mat->vmgm_c_adt=m_position/ DVD_BLOCK_LEN; + updateC_ADT_Internal(_buffer,_ifo->menu_c_adt,m_position); + } + } else if(_ifo->vtsi_mat) { + if(_ifo->vtsi_mat->vtsm_c_adt != 0 && _isMenu) { + m_position=round(m_position); //sector = + _ifo->vtsi_mat->vtsm_c_adt=m_position / DVD_BLOCK_LEN; + updateC_ADT_Internal(_buffer,_ifo->menu_c_adt,m_position); + } + if (_ifo->vtsi_mat->vts_c_adt !=0 && !_isMenu) { + m_position=round(m_position); //sector = + _ifo->vtsi_mat->vts_c_adt=m_position / DVD_BLOCK_LEN; + updateC_ADT_Internal(_buffer,_ifo->vts_c_adt,m_position); + } + } else { + return ; + } + +} + +void k9Ifo2::updateC_ADT_Internal(uchar *_buffer,c_adt_t *_c_adt,int _sector) { + c_adt_t * c_adt; + c_adt =(c_adt_t*) malloc (sizeof(c_adt_t)); + memcpy(c_adt,_c_adt,sizeof(c_adt_t)); + + + int offset =_sector + C_ADT_SIZE; + m_position+=C_ADT_SIZE; + + int info_length = _c_adt->last_byte + 1 - C_ADT_SIZE; + + cell_adr_t *cell_adr,*ptr; + cell_adr=(cell_adr_t*) malloc(sizeof(cell_adr_t)); + + ptr= _c_adt->cell_adr_table; + for(int i = 0; i < info_length/sizeof(cell_adr_t); i++) { + memcpy(cell_adr,&(ptr[i]),sizeof(cell_adr_t)); + B2N_16(cell_adr->vob_id); + B2N_32(cell_adr->start_sector); + B2N_32(cell_adr->last_sector); + memcpy(m_buffer+offset,cell_adr,sizeof(cell_adr_t)); + offset+=sizeof(cell_adr_t); + //ptr+=sizeof(cell_adr_t); + } + + m_position+=info_length; + free(cell_adr); + + B2N_16(c_adt->nr_of_vobs); + c_adt->last_byte=m_position-_sector-1; + B2N_32(c_adt->last_byte); + memcpy(m_buffer+_sector,c_adt,C_ADT_SIZE); + free(c_adt); +} + +void k9Ifo2::updateVOBU_ADMAP(uchar * _buffer, bool _isMenu) { + int sector; + if(_ifo->vmgi_mat) { + + if(_ifo->vmgi_mat->vmgm_vobu_admap == 0) + return ; + sector = m_position=round(m_position);//_ifo->vmgi_mat->vmgm_vobu_admap * DVD_BLOCK_LEN; + _ifo->vmgi_mat->vmgm_vobu_admap=m_position/DVD_BLOCK_LEN; + updateVOBU_ADMAP_Internal(_buffer,_ifo->menu_vobu_admap,sector); + + } else if(_ifo->vtsi_mat) { + + if(_ifo->vtsi_mat->vtsm_vobu_admap != 0 && _isMenu) { + sector = m_position=round(m_position);//sector = _ifo->vtsi_mat->vtsm_vobu_admap * DVD_BLOCK_LEN; + _ifo->vtsi_mat->vtsm_vobu_admap=m_position/DVD_BLOCK_LEN; + updateVOBU_ADMAP_Internal(_buffer,_ifo->menu_vobu_admap,sector); + } + if (_ifo->vtsi_mat->vts_vobu_admap !=0 && !_isMenu) { + sector = m_position=round(m_position);//sector = _ifo->vtsi_mat->vts_vobu_admap * DVD_BLOCK_LEN; + _ifo->vtsi_mat->vts_vobu_admap=m_position/DVD_BLOCK_LEN; + updateVOBU_ADMAP_Internal(_buffer,_ifo->vts_vobu_admap,sector); + } + } else { + return ; + } +} + +void k9Ifo2::updateVOBU_ADMAP_Internal(uchar *_buffer,vobu_admap_t *_vobu_admap,int _sector) { + vobu_admap_t *vobu_admap; + vobu_admap=(vobu_admap_t*)malloc(sizeof(vobu_admap_t)); + memcpy(vobu_admap,_vobu_admap,sizeof(vobu_admap_t)); + + int offset = _sector + VOBU_ADMAP_SIZE; + m_position+=VOBU_ADMAP_SIZE; + + int info_length = _vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE; + uint32_t *vobu_start_sectors; + vobu_start_sectors=(uint32_t*)malloc(info_length); + memcpy(vobu_start_sectors,_vobu_admap->vobu_start_sectors,info_length); + + for(int i = 0; i < info_length/sizeof(uint32_t); i++) + B2N_32(vobu_start_sectors[i]); + + memcpy(m_buffer+offset,vobu_start_sectors,info_length); + + m_position+=info_length; + free(vobu_start_sectors); + vobu_admap->last_byte=m_position-_sector-1; + B2N_32(vobu_admap->last_byte); + memcpy(m_buffer+_sector,vobu_admap,VOBU_ADMAP_SIZE); + free(vobu_admap); + +} + +void k9Ifo2::updateVTS(uchar *_buffer) { + vtsi_mat_t *vtsi_mat; + vtsi_mat = (vtsi_mat_t *)malloc(sizeof(vtsi_mat_t)); + memcpy(vtsi_mat,_ifo->vtsi_mat,sizeof(vtsi_mat_t)); + + uint32_t lastSector=vtsi_mat->vtsi_last_sector; + //uint32_t lastByte=vtsi_mat->vtsi_last_byte; + //JMP : à vérifier + if (m_position >0) { + lastSector=(round(m_position)-DVD_BLOCK_LEN) /DVD_BLOCK_LEN; + //lastByte=vtsi_mat->vtsi_last_sector*DVD_BLOCK_LEN +DVD_BLOCK_LEN-1; + vtsi_mat->vts_last_sector+=2*(lastSector-vtsi_mat->vtsi_last_sector); + vtsi_mat->vtstt_vobs+=lastSector-vtsi_mat->vtsi_last_sector; + } + + vtsi_mat->vtsi_last_sector=lastSector; + //vtsi_mat->vtsi_last_byte=lastByte; + if (vtsi_mat->vtsm_vobs !=0) + vtsi_mat->vtsm_vobs= vtsi_mat->vtsi_last_sector +1 ; + + B2N_32(vtsi_mat->vts_last_sector); + B2N_32(vtsi_mat->vtsi_last_sector); + B2N_32(vtsi_mat->vts_category); + + B2N_32(vtsi_mat->vtsi_last_byte); + B2N_32(vtsi_mat->vtsm_vobs); + B2N_32(vtsi_mat->vtstt_vobs); + B2N_32(vtsi_mat->vts_ptt_srpt); + B2N_32(vtsi_mat->vts_pgcit); + B2N_32(vtsi_mat->vtsm_pgci_ut); + B2N_32(vtsi_mat->vts_tmapt); + B2N_32(vtsi_mat->vtsm_c_adt); + B2N_32(vtsi_mat->vtsm_vobu_admap); + B2N_32(vtsi_mat->vts_c_adt); + B2N_32(vtsi_mat->vts_vobu_admap); + B2N_16(vtsi_mat->vtsm_audio_attr.lang_code); + B2N_16(vtsi_mat->vtsm_subp_attr.lang_code); + for(int i = 0; i < 8; i++) + B2N_16(vtsi_mat->vts_audio_attr[i].lang_code); + for(int i = 0; i < 32; i++) + B2N_16(vtsi_mat->vts_subp_attr[i].lang_code); + + memcpy(m_buffer,vtsi_mat,sizeof(vtsi_mat_t)); + + free(vtsi_mat); +} + +void k9Ifo2::updateVTS_PTT_SRPT(uchar *_buffer) { + if(!_ifo->vtsi_mat) + return ; + + if(_ifo->vtsi_mat->vts_ptt_srpt == 0) /* mandatory */ + return ; + + vts_ptt_srpt_t * vts_ptt_srpt; + vts_ptt_srpt = (vts_ptt_srpt_t *)malloc(sizeof(vts_ptt_srpt_t)); + memcpy(vts_ptt_srpt,_ifo->vts_ptt_srpt,sizeof(vts_ptt_srpt_t)); + int orig=_ifo->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN; + int offset = m_position=round(m_position);//_ifo->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN; + _ifo->vtsi_mat->vts_ptt_srpt=m_position/DVD_BLOCK_LEN; + + B2N_16(vts_ptt_srpt->nr_of_srpts); + B2N_32(vts_ptt_srpt->last_byte); + + memcpy(m_buffer+offset,vts_ptt_srpt,VTS_PTT_SRPT_SIZE); + free(vts_ptt_srpt); + m_position+=VTS_PTT_SRPT_SIZE; + + int info_length = _ifo->vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE; + + memcpy(m_buffer+m_position,_buffer+orig+VTS_PTT_SRPT_SIZE, info_length); + m_position+=info_length; +} + + +/*! + \fn k9Ifo2::checkBuffer() + */ + + +void k9Ifo2::updateVTS_TMAPT(uchar *_buffer) { + if(!_ifo->vtsi_mat) + return ; + + if(_ifo->vtsi_mat->vts_tmapt == 0) { /* optional(?) */ + return ; + } + + vts_tmapt_t *vts_tmapt1,*vts_tmapt; + vts_tmapt=_ifo->vts_tmapt; + int info_length = vts_tmapt->nr_of_tmaps * 4; + + uint32_t offsets[vts_tmapt->nr_of_tmaps]; + + vts_tmapt1 = (vts_tmapt_t *)malloc(VTS_TMAPT_SIZE); + memcpy(vts_tmapt1,_ifo->vts_tmapt,VTS_TMAPT_SIZE); + uint32_t offset = m_position=round(m_position); + + _ifo->vtsi_mat->vts_tmapt =m_position / DVD_BLOCK_LEN; + + int offset0=offset; + offset+=VTS_TMAPT_SIZE; + m_position +=VTS_TMAPT_SIZE; + + + offset += info_length; + m_position+=info_length; + + info_length=0; + vts_tmap_t *tmap=vts_tmapt->tmap; + //loop on tmaps to compute total size + for (int i=0;i nr_of_tmaps;i++) { + int tmapSize=VTS_TMAP_SIZE+tmap[i].nr_of_entries*sizeof(map_ent_t); + info_length+=tmapSize+4; + } + + tmap = (vts_tmap_t *)malloc(sizeof(vts_tmap_t)* vts_tmapt->nr_of_tmaps); + memcpy(tmap,vts_tmapt->tmap,sizeof(vts_tmap_t)* vts_tmapt->nr_of_tmaps); + + vts_tmapt1->last_byte=VTS_TMAPT_SIZE+info_length-1; + for(int i = 0; i < vts_tmapt->nr_of_tmaps; i++) { + int tmapSize=VTS_TMAP_SIZE+tmap[i].nr_of_entries*sizeof(map_ent_t); + int nr_map_ent=tmap[i].nr_of_entries; + B2N_16(tmap[i].nr_of_entries); + offsets[i]=m_position-offset0; + B2N_32(offsets[i]); + memcpy(m_buffer+m_position,&(tmap[i]),VTS_TMAP_SIZE); + m_position+=VTS_TMAP_SIZE; + offset+=VTS_TMAP_SIZE; + + if(nr_map_ent == 0) { // Early out if zero entries + continue; + } + int info_length2 = tmapSize-VTS_TMAP_SIZE; + map_ent_t *map_ent = (map_ent_t *)malloc(info_length2); + memcpy(map_ent,tmap[i].map_ent,info_length2); + for(int j = 0; j < nr_map_ent; j++) { + B2N_32(map_ent[j]); + memcpy(m_buffer+m_position,&(map_ent[j]),sizeof(map_ent_t)); + offset+=sizeof(map_ent_t); + m_position+=sizeof(map_ent_t); + } + free(map_ent); + } + + free(tmap); + B2N_16(vts_tmapt1->nr_of_tmaps); + B2N_32(vts_tmapt1->last_byte); + memcpy(m_buffer+offset0,vts_tmapt1,VTS_TMAPT_SIZE); + memcpy(m_buffer+offset0+VTS_TMAPT_SIZE,offsets,vts_tmapt->nr_of_tmaps*4); + free(vts_tmapt1); + + +} +void k9Ifo2::checkBuffer(QString lib,uchar* _buffer) { + /* for (int j=0;jpci_gi.nv_pck_lbn); + B2N_16(pci->pci_gi.vobu_cat); + B2N_32(pci->pci_gi.vobu_s_ptm); + B2N_32(pci->pci_gi.vobu_e_ptm); + B2N_32(pci->pci_gi.vobu_se_e_ptm); + + /* pci nsml_agli */ + for(i = 0; i < 9; i++) + B2N_32(pci->nsml_agli.nsml_agl_dsta[i]); + + /* pci hli hli_gi */ + B2N_16(pci->hli.hl_gi.hli_ss); + B2N_32(pci->hli.hl_gi.hli_s_ptm); + B2N_32(pci->hli.hl_gi.hli_e_ptm); + B2N_32(pci->hli.hl_gi.btn_se_e_ptm); + + /* pci hli btn_colit */ + for(i = 0; i < 3; i++) + for(j = 0; j < 2; j++) + B2N_32(pci->hli.btn_colit.btn_coli[i][j]); + + /* NOTE: I've had to change the structure from the disk layout to get + * the packing to work with Sun's Forte C compiler. */ + + /* pci hli btni */ + for(i = 0; i < 36; i++) { + char tmp[sizeof(pci->hli.btnit[i])], swap; + memcpy(tmp, &(pci->hli.btnit[i]), sizeof(pci->hli.btnit[i])); + /* Byte 4 to 7 are 'rotated' was: ABCD EFGH IJ is: ABCG DEFH IJ */ + swap = tmp[6]; + tmp[6] = tmp[5]; + tmp[5] = tmp[4]; + tmp[4] = tmp[3]; + tmp[3] = swap; + + /* Then there are the two B2N_24(..) calls */ +#ifndef WORDS_BIGENDIAN + swap = tmp[0]; + tmp[0] = tmp[2]; + tmp[2] = swap; + + swap = tmp[4]; + tmp[4] = tmp[6]; + tmp[6] = swap; +#endif + memcpy(&(pci->hli.btnit[i]), tmp, sizeof(pci->hli.btnit[i])); + } + +} diff --git a/libk9copy/k9ifo2.h b/libk9copy/k9ifo2.h new file mode 100644 index 0000000..da04944 --- /dev/null +++ b/libk9copy/k9ifo2.h @@ -0,0 +1,85 @@ +/*************************************************************************** + * Copyright (C) 2005 by Jean-Michel Petit * + * jm_petit@laposte.net * + * * + * 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. * + ***************************************************************************/ +#ifndef K9IFO2_H +#define K9IFO2_H +#include "k9common.h" +#include "k9dvdread.h" +#include +#include +/** +@author Jean-Michel Petit +*/ +class k9Ifo2 : public QObject { + Q_OBJECT +public: + k9Ifo2(k9DVDRead *_dvdread); + + ~k9Ifo2(); + + void setDevice(QString &_device); + void setOutput(QString &_output); + ifo_handle_t * openIFO(int _num); + void closeIFO(); + void saveIFO(); + ifo_handle_t * getIFO(); + static void navRead_PCI(pci_t *pci, uchar *buffer); + int test; + + +protected: + QString device; + QString output; + ifo_handle_t *_ifo; + int numIfo; +private: + QFile* outputFile; + long cellSize; + uchar * bufCopy,*m_buffer; + int bufCopySize; + k9DVDRead *m_dvd; + uint m_position; +private: + int round(int); + void updateVMG(uchar * _buffer); + void updateFP_PGC(uchar * _buffer); + void updatePGC_COMMAND_TBL(uchar *_buffer,pgc_command_tbl_t *_cmd_tbl,int offset); + void updatePGC_PROGRAM_MAP(uchar *_buffer,pgc_program_map_t *_program_map, int _nr,int _offset); + void updatePGC_CELL_PLAYBACK_TBL(uchar *_buffer, cell_playback_t *_cell_playback,int _nr, int _offset); + void updatePGC_CELL_POSITION_TBL(uchar *_buffer,cell_position_t *_cell_position,int _nr, int _offset); + void updatePGC(uchar *_buffer,pgc_t *_pgc,int _offset); + void updateTT_SRPT(uchar *_buffer); + void updatePGCI_UT(uchar *_buffer); + void updatePTL_MAIT(uchar *_buffer); + void updateVTS_ATRT(uchar *_buffer); + void updateTXTDT_MGI(uchar * _buffer); + void updateC_ADT(uchar * _buffer, bool _isMenu); + void updateVOBU_ADMAP(uchar * _buffer, bool _isMenu); + void updatePGCIT(uchar *_buffer); + void updatePGCIT_internal(uchar *_buffer, pgcit_t *_pgcit, int offset); + void updateVTS(uchar *_buffer); + void updateVTS_PTT_SRPT(uchar *_buffer); + void updateVTS_TMAPT(uchar *_buffer) ; + void updateC_ADT_Internal(uchar *_buffer,c_adt_t *_c_adt,int _sector); + void updateVOBU_ADMAP_Internal(uchar *_buffer,vobu_admap_t *_vobu_admap,int _sector); + void checkBuffer(QString lib,uchar *_buffer); +}; + + +#endif diff --git a/libk9copy/k9mp4dlg.cpp b/libk9copy/k9mp4dlg.cpp new file mode 100644 index 0000000..d8b5bda --- /dev/null +++ b/libk9copy/k9mp4dlg.cpp @@ -0,0 +1,80 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9mp4dlg.h" +#include +#include +#include +#include +#include +#include "k9drawimage.h" + + +k9MP4Dlg::k9MP4Dlg(QWidget* parent, const char* name) +: MP4Dlg(parent,name, true) +{ + m_wimage=new k9DrawImage(image,0); + QGridLayout *l=new QGridLayout(image,1,1); + l->addWidget(m_wimage,0,0); + m_timer.start(); +} + +k9MP4Dlg::~k9MP4Dlg() +{ +} + +/*$SPECIALIZATION$*/ + +void k9MP4Dlg::Cancel() { + //QDialog::accept(); + emit sigCancel(); +} + +void k9MP4Dlg::setTitleLabel(QString _titleLabel) { + lblTitle->setText(_titleLabel); +} + + +void k9MP4Dlg::setfps(QString _fps) { + lblfps->setText(_fps); +} + +void k9MP4Dlg::setremain(QString _remain) { + if (m_timer.elapsed() >=1000) { + lblRemain->setText(_remain); + m_timer.restart(); + } +} + +void k9MP4Dlg::setProgress(int _progress) { + pbProgress->setProgress(_progress); + +} + +void k9MP4Dlg::setbitrate(QString _bitrate) { + lblbitrate->setText(_bitrate); +} + +void k9MP4Dlg::setsize( QString _size) { + lblsize->setText(_size); +} + + +void k9MP4Dlg::setImage(QString _fileName) { + m_wimage->setImage(_fileName); +} + + + +#include "k9mp4dlg.moc" + diff --git a/libk9copy/k9mp4dlg.h b/libk9copy/k9mp4dlg.h new file mode 100644 index 0000000..266ed47 --- /dev/null +++ b/libk9copy/k9mp4dlg.h @@ -0,0 +1,49 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9MP4DLG_H +#define K9MP4DLG_H +#include "mp4dlg.h" +#include +#include + +class k9DrawImage; + +class k9MP4Dlg : public MP4Dlg +{ + Q_OBJECT + +public: + k9MP4Dlg(QWidget* parent = 0, const char* name = 0); + ~k9MP4Dlg(); + /*$PUBLIC_FUNCTIONS$*/ + void setfps(QString _fps); + void setsize(QString _size); + void setbitrate(QString _bitrate); + void setremain(QString _remain); + void setProgress(int _progress); + void setTitleLabel(QString _titleLabel); + void Cancel(); + void setImage(QString _fileName) ; + +signals: + /*$PUBLIC_SLOTS$*/ + void sigCancel(); +private: + k9DrawImage *m_wimage; + QTime m_timer; +protected: + /*$PROTECTED_FUNCTIONS$*/ +}; + +#endif + diff --git a/libk9copy/k9mp4enc.cpp b/libk9copy/k9mp4enc.cpp new file mode 100644 index 0000000..7d82c4f --- /dev/null +++ b/libk9copy/k9mp4enc.cpp @@ -0,0 +1,571 @@ +// +// C++ Implementation: k9mp4enc +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9mp4enc.h" +#include "k9mp4dlg.h" +#include "k9config.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "k9tools.h" +#include "k9audiocodecs.h" +#include "k9videocodecs.h" +#include + +k9MP4Enc::k9MP4Enc ( QObject *parent, const char *name,const QStringList& ) + : QObject ( parent, name ) +{ + m_fourcc=m_height=m_width=m_audioBitrate=m_videoBitrate=m_filename=""; + m_codec=0; //lavc_mp4; + m_audioCodec=0; + m_cpt=-1; + m_parts=1; + + QStringList laudio; + QStringList llabels; + QStringList lvideo; + + k9Config config; + m_lstAudio=config.getCodecAudio(); + m_lstCodecs=config.getCodecLabels(); + m_lstVideo=config.getCodecVideo(); + + timer = new QTimer ( this ); + connect ( timer, SIGNAL ( timeout() ), this, SLOT ( timerDone() ) ); + m_progress=new k9MP4Dlg ( qApp->mainWidget(),0 ); + +} + +QString k9MP4Enc::round16 ( QString _wh ) +{ + if ( _wh !="" ) + { + int value=_wh.toInt() /16; + return QString::number ( value*16 ); + + } + else + return _wh; + + +} + +QString k9MP4Enc::getChapterList ( k9DVDTitle *_title ) +{ + QString res=""; + QPtrList chapters=_title->getChapters(); + for ( k9DVDChapter *chapter=chapters.first();chapter;chapter=chapters.next() ) + { + if ( chapter->getSelected() ) + { + res+=res=="" ? QString::number ( chapter->getnum() ) : ","+QString::number ( chapter->getnum() ); + } + } + QPtrList titles=_title->getTitles(); + + for ( k9DVDTitle *title=titles.first();title;title=titles.next() ) + { + chapters=title->getChapters(); + for ( k9DVDChapter *chapter=chapters.first();chapter;chapter=chapters.next() ) + { + if ( chapter->getSelected() ) + { + res+=res=="" ? QString::number ( chapter->getnum() ) : ","+QString::number ( chapter->getnum() ); + } + } + } + return res; + +} + + +int k9MP4Enc::getselectedSubp ( k9DVDTitle *_title ) +{ + for ( int i=0;i< _title->getsubPictureCount();i++ ) + { + if ( _title->getsubtitle ( i )->getselected() ) + { + return _title->getsubtitle ( i )->getID().first()-1; + } + } + //nos subtitle selected + return -1; +} + + + +void k9MP4Enc::execute ( k9DVDTitle *_title ) +{ + bool error=false; + + if ( m_mpeg2 ) + { + m_parts=1; + m_2pass=false; + } + + if ( ! k9Tools::checkProgram ( "mencoder" ) && ! m_mpeg2 ) + { + KMessageBox::error ( qApp->mainWidget(),i18n ( "Unable to run %1" ).arg ( "mencoder" ) , i18n ( "Encoding error" ) ); + error = TRUE; + return; + } + + time = new QTime ( 0,0 ); + m_percent=0; + m_remain="--:--:--"; + + m_totalSize=_title->getChaptersSize ( true ); + + QString injectName; + KTempFile injectFile ( locateLocal ( "tmp", "k9copy/k9v" ), "" ); + injectFile.setAutoDelete ( true ); + injectFile.close(); + injectName=injectFile.name(); + + + int maxPass=0; + int pass=0; + + //build the cell list for mpeg2 extraction + QMap chapterCells; + QMap::iterator ichapterCells; + QStringList chapters; + if ( m_mpeg2 && m_mpegChapters ) + { + m_parts=0; + chapters=QStringList::split ( ",", getChapterList ( _title ) ); + for ( unsigned int idxChap = 0; idxChap < chapters.size(); idxChap++ ) + { + QString chapter = chapters[idxChap]; + //foreach (QString chapter,chapters) { + int iCell=0; + k9DVDChapter *chap=_title->getChapter ( chapter.toInt()-1 ); + //foreach(k9ChapterCell *cell ,chap->cells) { + iCell++; + chapterCells.insert ( chapter,iCell ); + m_parts++; + //} + } + ichapterCells = chapterCells.begin(); + } + + for ( int m_part =1 ; ( m_part <=m_parts ) && !error ;m_part++ ) + { + if ( m_2pass ) + { + maxPass=2; + pass=1; + } + KTempFile passLogFile ( locateLocal ( "tmp", "k9copy/k9v" ), "" ); + passLogFile.setAutoDelete ( true ); + passLogFile.close(); + + do + { + uint32_t nbSectors= m_totalSize / m_parts ; + + uint32_t startSector= nbSectors* ( m_part-1 ); + uint32_t endSector= startSector+nbSectors; + + //calculer le bitrate en faisant la somme des cells compris entre startSector et endSector + //FIXME Mettre en place la sélection par chapitres + m_stderr=""; + m_title=_title; + if ( m_height=="" || m_height=="0" ) + m_height="-2"; + if ( m_width=="" ) + m_width="640"; + if ( m_audioBitrate=="" ) + m_audioBitrate="128"; + if ( m_size=="" ) + m_size="700"; + if ( m_filename=="" ) + m_filename=KFileDialog::getSaveFileName ( QDir::homeDirPath(),"*.avi", 0,i18n ( "Save file to disk" ) ); + if ( m_filename =="" ) + return; + + QDir d=QDir::root(); + if ( d.exists ( m_filename ) ) + d.remove ( m_filename ); + + m_progress->setbitrate ( QString::number ( getBitRate ( _title ) ) ); + if ( !m_mpeg2 ) + m_progress->setsize ( m_size +i18n ( "MB" ) +" X " +QString::number ( m_parts ) ); + else + m_progress->setsize ( m_size +i18n ( "MB" ) +" X " ); + + m_process=new k9Process ( this,0 ); + m_process->setUseShell ( true ); + *m_process << "k9copy" << "--play" << "--endsector" << QString::number ( endSector ) ; + *m_process << "--inject" << injectName; //"/tmp/kde-jmp/inject"; + *m_process << "--input" << "'"+m_device+"'"; + *m_process << "--dvdtitle" << QString::number ( _title->getnumTitle() ); + + if ( m_mpegChapters && m_mpeg2 ) + { + *m_process << "--chapter" << ichapterCells.key();//chapters.at(m_part-1); + //*m_process << "--cell" << QString::number(ichapterCells.value()); + } + else + *m_process << "--chapterlist" << getChapterList ( _title ); + + if ( m_part==1 || m_mpeg2 ) + *m_process << "--initstatus"; + else + *m_process << "--continue"; + + if ( pass==1 ) + *m_process << "--firstpass"; + + for ( int i=0;i<_title->getaudioStreamCount();i++ ) + { + if ( _title->getaudioStream ( i )->getselected() ) + { + *m_process << "--audiofilter" << QString::number ( _title->getaudioStream ( i )->getID() ); + break; + } + } + + if ( getselectedSubp ( _title ) !=-1 ) + { + *m_process << "--subpicturefilter" ; + QString s=""; + for ( int i=1; i<=_title->getsubPictureCount();i++ ) + s+= ( i>1?",":"" ) + QString::number ( i ); + *m_process << s; + } + + if ( m_usecache ) + *m_process << "--usecache"; + + if ( m_mpeg2 ) + { + m_progress->setbitrate ( "--" ); + double size; + + if ( _title->getforceFactor() ) + { + size = _title->getChaptersSize_mb ( true ) /_title->getfactor(); + *m_process << "--vampsfactor" << QString::number ( _title->getfactor() ) << "--ffactor"; + } + else + size = _title->getChaptersSize_mb ( true ); + m_progress->setsize ( QString::number ( size ) +i18n ( "MB" ) ); + QString path=m_filename; + if ( m_parts>1 ) + { + QString ext=m_filename.section ( ".",-1 ); + if ( ext!="" ) + ext="."+ext; + path=m_filename.left ( m_filename.length()-ext.length() ); + //path=QString("%1-chapter%2-cell%3%4").arg(path).arg(ichapterCells.key()).arg(ichapterCells.value()).arg(ext); + path=QString ( "%1-chapter%2%3" ).arg ( path ).arg ( ichapterCells.key() ).arg ( ext ); + ++ichapterCells; + } + *m_process << "> "+path; + } + else + { + *m_process << "| mencoder" << "/dev/stdin"; + *m_process << "-passlogfile" << passLogFile.name(); + + bool audio=false; + QString sPass=""; + QString sCodec=""; + + k9AudioCodecs *audioCodecs=new k9AudioCodecs ( 0,0 ); + k9VideoCodecs *videoCodecs=new k9VideoCodecs ( 0,0 ); + + QString sVOption; + m_pass=pass; + switch ( pass ) + { + case 1: + sVOption=replaceParams ( videoCodecs->getOptions1 ( m_codec ) ); + break; + case 2: + sVOption=replaceParams ( videoCodecs->getOptions2 ( m_codec ) ); + break; + default: + sVOption=replaceParams ( videoCodecs->getOptions0 ( m_codec ) ); + break; + } + sCodec=videoCodecs->getCodecName ( m_codec ); + sVOption=sVOption.simplifyWhiteSpace(); + int pos; + //*m_process << "-ovc" << sVOption; + /* int pos=sVOption.find("-vf"); + if (pos==-1) + *m_process <<"-vf" << QString("scale=%1:%2").arg(m_width).arg(m_height); + else + sVOption=sVOption.insert(pos+4,QString("scale=%1:%2,").arg(m_width).arg(m_height)); + */ + *m_process << sVOption; + + QString sAOption=replaceParams ( audioCodecs->getOptions ( m_audioCodec ) ).simplifyWhiteSpace(); + + + + if ( pass >0 ) + m_progress->setTitleLabel ( i18n ( "Encoding %1" ).arg ( sCodec ) +" - "+i18n ( "pass %1" ).arg ( pass ) ); + else + m_progress->setTitleLabel ( i18n ( "Encoding %1" ).arg ( sCodec ) ); + + if ( m_fourcc !="" ) + *m_process << "-ffourcc" << m_fourcc; + else if ( videoCodecs->getFourcc ( m_codec ) !="" ) + *m_process << "-ffourcc" << videoCodecs->getFourcc ( m_codec ); + + delete audioCodecs; + delete videoCodecs; + + //looking for first audio selected + for ( int i=0;i<_title->getaudioStreamCount();i++ ) + { + if ( _title->getaudioStream ( i )->getselected() ) + { + //*m_process << "-oac" << sAOption; + pos=sAOption.find ( "-af" ); + if ( pos==-1 ) + *m_process << QString ( "-af volume=%1" ).arg ( m_audioGain ); + else + sAOption=sAOption.insert ( pos+4,QString ( "volume=%1," ).arg ( m_audioGain ) ); + *m_process << sAOption; + + audio=true; + break; + } + } + + if ( getselectedSubp ( _title ) !=-1 ) + { + *m_process << "-sid" << QString::number ( getselectedSubp ( _title ) ); + } + if ( !audio ) + *m_process << "-nosound"; + + QString path=m_filename; + + if ( m_parts>1 ) + { + QString ext=m_filename.section ( ".",-1 ); + if ( ext!="" ) + ext="."+ext; + path=m_filename.left ( m_filename.length()-ext.length() ); + path=path+QString::number ( m_part ) +ext; + } + if ( pass==1 ) + *m_process << "-o" << "/dev/null"; + else + *m_process <<"-o" << "'"+path+"'"; + if ( path.upper().endsWith ( "MPEG" ) || path.upper().endsWith ( "MPG" ) ) + *m_process << "-of" << "mpeg"; + else if ( path.upper().endsWith ( "AVI" ) ) + *m_process << "-of" << "avi"; + else + { + *m_process << "-of" << "lavf"; + *m_process << "-lavfopts" << "i_certify_that_my_video_stream_does_not_use_b_frames"; + } + //*m_process << "-of" << "avi"; + + } + QString s=""; + for ( uint i=0; i< m_process->args().count();i++ ) + { + QCString str=* ( m_process->args().at ( i ) ); + s +=QString ( str ) +" "; + } + qDebug ( s ); + time->start(); + m_timer3.start(); + connect ( m_process, SIGNAL ( receivedStdout ( KProcess *, char *, int ) ),this, SLOT ( getStdout ( KProcess *, char *, int ) ) ); + connect ( m_process, SIGNAL ( receivedStderr ( KProcess *, char *, int ) ),this, SLOT ( getStderr ( KProcess *, char *, int ) ) ); + //connect(m_process, SIGNAL(processExited(KProcess*)),this,SLOT(exited(KProcess*))); + connect ( m_progress,SIGNAL ( sigCancel() ),this,SLOT ( slotCancel() ) ); + m_canceled=false; + m_progress->show(); + m_process->start ( KProcess::OwnGroup, KProcess::All ); + timer->start ( 500, 0 ); + m_process->sync(); + //if application is exiting, kill the encoding process + if ( m_process->isRunning() ) + { + m_process->kill(); + return; + } + if ( m_canceled ) + { + KMessageBox::information ( qApp->mainWidget(),i18n ( "MPEG-4 Encoding cancelled" ), i18n ( "MPEG-4 Encoding" ) ); + error=true; + } + else if ( !m_process->normalExit() ) + { + KMessageBox::error ( qApp->mainWidget(),""+i18n ( "Error while running mencoder :" ) +"
"+m_stderr, i18n ( "Encoding error" ) ); + error=true; + } + if ( maxPass >0 ) + pass++; + } + while ( pass<=maxPass && !error && m_2pass ); + + } +} + + +void k9MP4Enc::slotCancel() +{ + m_canceled=true; + m_process->kill(); +} + + +QString k9MP4Enc::replaceParams ( QString _value ) +{ + QString str=_value; + str.replace ( "$PASS",QString::number ( m_pass ) ); + str.replace ( "$WIDTH",m_width ); + str.replace ( "$HEIGHT",m_height ); + str.replace ( "$VIDBR",QString::number ( getBitRate ( m_title ) ) ); + str.replace ( "$AUDBR",m_audioBitrate ); + return str; +} + + +int k9MP4Enc::getBitRate ( k9DVDTitle *_title ) +{ + // bitrate video = (MB *8388.608) /SEC - bitrate audio + + if ( m_videoBitrate!="" ) + { + return m_videoBitrate.toInt(); + } + else + { + int size=m_size.toInt(); + float titleSize=_title->getChaptersSize_mb ( true ); + if ( titleSize< ( float ) size ) + size= ( int ) ( titleSize/m_parts ) ; + m_progress->setsize ( QString::number ( size ) +i18n ( "MB" ) +" X " +QString::number ( m_parts ) ); + QTime t1 ( 0,0 ); + int sec=t1.secsTo ( _title->getSelectedLength() ); + //int bitrate=(int)( ((size*m_parts) * 8388.608)/sec - m_audioBitrate.toInt()); + int bitrate=8* ( ( ( size*m_parts*1024 )- ( m_audioBitrate.toInt() *sec/8 ) ) /sec ); + + return bitrate; + } +} + + +void k9MP4Enc::getStdout ( KProcess *, char *buffer, int buflen ) +{ + QCString tmp ( buffer,buflen ); + m_cpt++; + if ( m_cpt==100 ) + m_cpt=0; + + if ( m_cpt!=0 ) + return; + + int pos=tmp.find ( "Pos:" ); + if ( pos!=-1 ) + { + QString tmp2=tmp.mid ( pos ); + float t; + int frame; + int fps; + sscanf ( tmp2.latin1(),"Pos: %f%*s%d",&t,&frame ); + tmp2=tmp2.mid ( tmp2.find ( "(" ) +1 ); + tmp2=tmp2.mid ( tmp2.find ( ")" ) +1 ); + sscanf ( tmp2.latin1(),"%d",&fps ); + + m_progress->setfps ( QString::number ( fps ) ); + } + + +} + +void k9MP4Enc::getStderr ( KProcess *proc, char *buffer, int buflen ) +{ + //m_stderr=QString::fromLatin1(buffer,buflen); + QCString cstderr ( buffer,buflen+1 ); + + if ( cstderr.find ( "FATAL:" ) !=-1 ) + { + proc->kill(); + } + + int pos=cstderr.find ( "INFOPOS:" ); + if ( pos!=-1 ) + { + if ( m_timer3.elapsed() >500 ) + { + m_timer3.restart(); + QString tmp=cstderr.mid ( pos ); + uint32_t totalBytes,totalSize; + sscanf ( tmp.latin1(),"INFOPOS: %d %d",&totalBytes,&totalSize ); + if ( totalSize !=0 ) + m_percent= ( float ) totalBytes / ( float ) m_totalSize; + + + QTime time2 ( 0,0 ); + time2=time2.addMSecs ( time->elapsed() ); + if ( m_percent>0 ) + { + QTime time3 ( 0,0 ); + time3=time3.addMSecs ( ( uint32_t ) ( time->elapsed() * ( 1/m_percent ) ) ); + m_remain=time3.toString ( "hh:mm:ss" ); + } + + m_percent*=100; + m_progress->setProgress ( ( int ) m_percent ); + m_progress->setremain ( time2.toString ( "hh:mm:ss" ) +" / " +m_remain ); + } + } + else + { + pos=cstderr.find ( "INFOIMAGE:" ); + if ( pos!=-1 ) + { + m_progress->setImage ( cstderr.mid ( pos+10 ) ); + } + else + qDebug ( "[%s]",buffer ); + } + m_stderr=cstderr; +} + +void k9MP4Enc::timerDone() +{ + QTime time2 ( 0,0 ); + time2=time2.addMSecs ( time->elapsed() ); + m_progress->setremain ( time2.toString ( "hh:mm:ss" ) +" / " +m_remain ); + +} + +bool k9MP4Enc::isCanceled() +{ + return m_canceled; +} + + +k9MP4Enc::~k9MP4Enc() {} + + +#include "k9mp4enc.moc" diff --git a/libk9copy/k9mp4enc.h b/libk9copy/k9mp4enc.h new file mode 100644 index 0000000..91a80a2 --- /dev/null +++ b/libk9copy/k9mp4enc.h @@ -0,0 +1,131 @@ +// +// C++ Interface: k9mp4enc +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9MP4ENC_H +#define K9MP4ENC_H +#include "k9common.h" +#include "k9dvdtitle.h" + +#include +#include +#include +#include +class k9MP4Dlg; +/** + @author Jean-Michel PETIT +*/ +class k9MP4Enc : public QObject { + Q_OBJECT +private: + k9Process *m_process; + k9MP4Dlg *m_progress; + k9DVDTitle *m_title; + int getBitRate(k9DVDTitle *_title); + QString m_txt; + QString m_device; + QString m_filename; + QString m_height; + QString m_width; + QString m_size; + QString m_audioBitrate; + QString m_videoBitrate; + QString m_audioGain; + QString m_fourcc; + QString m_stderr; + int m_parts; + float m_percent; + QTimer *timer; + QString m_remain; + uint32_t m_totalSize; + bool m_2pass; + int m_pass; + bool m_canceled; + int m_codec; + int m_audioCodec; + bool m_usecache; + bool m_mpeg2; + bool m_mpegChapters; + + QStringList m_lstVideo,m_lstAudio,m_lstCodecs; + int m_cpt; + QTime *time,m_timer3; + QString replaceParams(QString _input); + QString round16(QString _wh); + QString getChapterList(k9DVDTitle *_title); + int getselectedSubp(k9DVDTitle *_title); + +private slots: + void getStdout(KProcess *proc, char *buffer, int buflen); + void getStderr(KProcess *proc, char *buffer, int buflen); + void timerDone(); + void slotCancel(); + +public: + k9MP4Enc(QObject *parent = 0, const char *name = 0,const QStringList& args=0); + ~k9MP4Enc(); + + virtual void execute(k9DVDTitle *_title ); + + virtual void setNumberCD(const QString & _value) { + m_parts = _value.toInt(); + if (m_parts==0) m_parts=1; + } + + virtual void setDevice(const QString& _value) { + m_device = _value.stripWhiteSpace(); + }; + virtual void setFilename(const QString& _value) { + m_filename = _value.stripWhiteSpace(); + }; + virtual void setHeight(const QString& _value) { + m_height = _value.stripWhiteSpace(); + }; + virtual void setWidth(const QString& _value) { + m_width = _value.stripWhiteSpace(); + }; + virtual void setSize(const QString& _value) { + m_size = _value.stripWhiteSpace(); + }; + virtual void setAudioBitrate(const QString& _value) { + m_audioBitrate = _value.stripWhiteSpace(); + }; + virtual void setVideoBitrate(const QString& _value) { + m_videoBitrate = _value.stripWhiteSpace(); + }; + virtual void setAudioGain(const QString& _value) { + m_audioGain = _value.stripWhiteSpace(); + }; + virtual void setfourcc(const QString& _value) { + m_fourcc = _value.stripWhiteSpace(); + }; + + virtual void set2Passes(bool _value) { + m_2pass=_value; + } + + virtual void setUseCache(bool _value) { + m_usecache=_value; + } + + virtual void setMpeg2(bool _value) { + m_mpeg2=_value; + } + + virtual void setCodec(const int& _value) {m_codec = _value;}; + + virtual void setAudioCodec(const int& _value) {m_audioCodec = _value;}; + + virtual QWidget *getDialog() {return (QWidget*)m_progress;}; + + virtual bool isCanceled(); +}; + +#endif diff --git a/libk9copy/k9process.cpp b/libk9copy/k9process.cpp new file mode 100644 index 0000000..5b17545 --- /dev/null +++ b/libk9copy/k9process.cpp @@ -0,0 +1,59 @@ +// +// C++ Implementation: k9process +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9process.h" +#include +#include +#include + +k9Process::k9Process(QObject *parent, const char *name) + : KProcess(parent, name),m_waitSync(false) +{ + connect(this,SIGNAL(processExited( KProcess* )),this,SLOT(slotProcessExited( KProcess* ))); + +} + + +k9Process::~k9Process() +{ +} + +void k9Process::sync() { + m_waitSync=true; + QApplication::eventLoop()->enterLoop(); +} + + +void k9Process::slotProcessExited( KProcess * proc) { + if (m_waitSync) { + QApplication::eventLoop()->exitLoop(); + m_waitSync=false; + } +} + +const QString & k9Process::debug() { + m_debug=""; + for (int i=0;i, (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9PROCESS_H +#define K9PROCESS_H + +#include +#include +/** + @author Jean-Michel PETIT +*/ +class k9Process : public KProcess +{ +Q_OBJECT +public: + k9Process(QObject *parent = 0, const char *name = 0); + void sync(); + const QString & debug(); + ~k9Process(); + int getElapsed() const; + virtual bool start (RunMode runmode=NotifyOnExit, Communication comm=NoCommunication); +private: + bool m_waitSync; + QString m_debug; + QTime m_elapsed; +private slots: + void slotProcessExited(KProcess *proc); +}; + +#endif diff --git a/libk9copy/k9processlist.cpp b/libk9copy/k9processlist.cpp new file mode 100644 index 0000000..8947cc5 --- /dev/null +++ b/libk9copy/k9processlist.cpp @@ -0,0 +1,192 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9processlist.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class _k9ProcessListItem : public QListViewItem { +public: + _k9ProcessListItem(QListView *_listview,const QString & _text):QListViewItem(_listview,_text) { + m_fileName=""; + m_pos=0; + m_num=_listview->childCount(); + } + void setFileName(const QString &_fileName) { m_fileName=_fileName;} + void setPos(double _pos) { m_pos=_pos;} + + QString getFileName() const { return m_fileName;} + + double getPos() const { return m_pos;} + int compare ( QListViewItem * i, int col, bool ascending ) const { + return m_num-((_k9ProcessListItem*)i)->m_num; + } +private: + QString m_fileName; + double m_pos; + int m_num; +}; + + +k9ProcessList::k9ProcessList(QWidget* parent, const char* name, WFlags fl) : processList(parent,name,fl) +{ + m_processes.setAutoDelete(true); + m_maxProcess=4; + connect(&m_timer,SIGNAL(timeout()),this,SLOT(timeout())); + bCancel->setEnabled(false); +} + +k9ProcessList::~k9ProcessList() +{ +} +/*$SPECIALIZATION$*/ +void k9ProcessList::timeout() { + if (m_waitSync) { + QApplication::eventLoop()->exitLoop(); + m_waitSync=false; + } +} + +void k9ProcessList::bCancelClick() { + m_cancel=true; + for (k9Process *p=m_processes.first();p;p=m_processes.next()) { + if (p->isRunning()) + p->kill(); + } + +} + +void k9ProcessList::wait(int _msec) { + m_waitSync=true; + m_timer.start(_msec,true); + QApplication::eventLoop()->enterLoop(); +} + +int k9ProcessList::getNbRunning() { + int res=0; + for (int i=0;iisRunning()) + res++; + } + return res; +} + + +void k9ProcessList::execute() { + bCancel->setEnabled(true); + m_cancel=false; + m_error=false; + k9Process *p=NULL; + for (QPtrListStdIterator it=m_processes.begin() ;it!=m_processes.end() ;++it ) { + p=(*it); + while (getNbRunning() >=m_maxProcess && ! m_cancel) { + wait(1000); + } + if (m_cancel) + break; + if (!p->start(KProcess::OwnGroup,KProcess::All)) + m_error=true; + } + //waiting for processes + for (p=m_processes.first();p;p=m_processes.next()) { + if (p->isRunning()) + p->sync(); + } + bCancel->setEnabled(false); +} + +void k9ProcessList::addProgress(const QString &_text) { + QListViewItem *item = new _k9ProcessListItem(lProcess,_text); + QProgressBar b(this); + b.setProgress(100,100); + b.resize(100,40); + item->setPixmap(0,QPixmap::grabWidget(&b,0,0,b.width(),b.height())); +} + +void k9ProcessList::setProgress (k9Process * _process,int _position, int _total) { + QProgressBar b(this); + b.setProgress(_position,_total); + b.resize(100,40); + QListViewItem *it =m_items[_process]; + it->setPixmap(0,QPixmap::grabWidget(&b,0,0,b.width(),b.height())); +} + +void k9ProcessList::setText(k9Process *_process, const QString &_text,int _col) { + QListViewItem *it =m_items[_process]; + it->setText(_col,_text); +} + +void k9ProcessList::setFileName(k9Process *_process,const QString &_fileName) { + _k9ProcessListItem *it = (_k9ProcessListItem*)m_items[_process]; + it->setFileName(_fileName); + +} + +void k9ProcessList::setPos(k9Process *_process,double _pos) { + _k9ProcessListItem *it = (_k9ProcessListItem*)m_items[_process]; + it->setPos(_pos); +} + +k9Process *k9ProcessList::addProcess(const QString &label) { + QString name=QString("process%1").arg(m_items.count()) ; + k9Process *process=new k9Process(this,name.latin1()); + m_processes.append(process); + QListViewItem *item = new _k9ProcessListItem(lProcess,label); + m_items[process]=item; + setProgress(process,0,100); + connect(process,SIGNAL(processExited( KProcess* )),this,SLOT(processExited(KProcess*))); + return process; +} + +void k9ProcessList::processExited(KProcess *_process){ + if (!_process->normalExit()) + m_cancel=true; + else if (_process->exitStatus() !=0 ) + m_error=true; + +} + +#include "k9processlist.moc" + +void k9ProcessList::clear() { + m_processes.clear(); + m_items.clear(); +} + +int k9ProcessList::getMaxProcess() const { + return m_maxProcess; +} + + +void k9ProcessList::setMaxProcess(int _value) { + m_maxProcess = _value; +} + + +bool k9ProcessList::getCancel() const { + return m_cancel; +} + + +bool k9ProcessList::getError() const { + return m_error; +} diff --git a/libk9copy/k9processlist.h b/libk9copy/k9processlist.h new file mode 100644 index 0000000..cbcc754 --- /dev/null +++ b/libk9copy/k9processlist.h @@ -0,0 +1,65 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9PROCESSLIST_H +#define K9PROCESSLIST_H +#include "k9common.h" +#include "../libk9copy/processList.h" +#include "k9process.h" +#include +#include +class k9ProcessList : public processList { + Q_OBJECT + +public: + k9ProcessList(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9ProcessList(); + /*$PUBLIC_FUNCTIONS$*/ + void execute(); + void addProgress(const QString &_text); + void setProgress (k9Process * _process,int _position, int _total); + void setText(k9Process *_process, const QString &_text,int _col); + void setFileName(k9Process *_process,const QString &_fileName); + void setPos(k9Process *_process,double _pos); + k9Process *addProcess(const QString &label); + + void setMaxProcess(int _value); + int getMaxProcess() const; + bool getCancel() const; + void clear(); + + bool getError() const; + +public slots: + /*$PUBLIC_SLOTS$*/ + +protected: + /*$PROTECTED_FUNCTIONS$*/ + int m_maxProcess; + QMap m_items; + QPtrList m_processes; + QTimer m_timer; + bool m_cancel; + bool m_error; + bool m_waitSync; + int getNbRunning(); + void wait(int _msec); + +protected slots: + /*$PROTECTED_SLOTS$*/ + void timeout(); + virtual void bCancelClick(); + virtual void processExited(KProcess *); +}; + +#endif + diff --git a/libk9copy/k9progress.cpp b/libk9copy/k9progress.cpp new file mode 100644 index 0000000..d2c46ac --- /dev/null +++ b/libk9copy/k9progress.cpp @@ -0,0 +1,116 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9progress.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +k9Progress::k9Progress(QWidget* parent, const char* name,const QStringList &args) + : Progress(parent,name,0) { + m_process=new k9Process(this,0); + m_wimage=new k9DrawImage(image,0); + QGridLayout *l=new QGridLayout(image,1,1); + l->addWidget(m_wimage,0,0); + + +} + + +k9Progress::~k9Progress() { + delete m_process; +} + + +void k9Progress::setElapsed(const QString _text) { + lblElapsed->setText(_text); +} + +void k9Progress::setTitle(const QString _text) { + lblTitle->setText(_text); +} + + +void k9Progress::setLabelText(const QString _text) { + LabelText->setText(_text); +} + +void k9Progress::setProgress(long _position,long _total) { + ProgressBar->setRange(0,_total); + ProgressBar->setProgress(_position); +} + +int k9Progress::execute() { + if (! m_process->isRunning()) { + if (!m_process->start(KProcess::NotifyOnExit,KProcess::All )) + return -1; + } + +// m_timer.start(200,FALSE); + show(); + m_canceled=false; + //the sync method allows to wait for the process end while receiving stdout. + m_process->sync(); + +// m_timer.stop(); + if (!m_canceled && m_process->normalExit()) + return 1; + else + return 0; +} + + +void k9Progress::bCancelClick() { + m_process->kill(); + m_canceled=true; +} + +k9Process* k9Progress::getProcess() const { + return m_process; +} + +/*$SPECIALIZATION$*/ + + +void k9Progress::setImage(QString _fileName) { + m_wimage->setImage(_fileName); +} + +void k9Progress::setImage(const QImage &_image) { + m_wimage->setImage(_image); +} + + +void k9Progress::setMovie(QString _fileName) { + image->setPaletteBackgroundColor(this->paletteBackgroundColor()); + QMovie mv(_fileName,2048); + mv.setBackgroundColor(this->paletteBackgroundColor()); + image->setMovie(mv); + m_wimage->hide(); +} + + +#include "k9progress.moc" + + +bool k9Progress::getCanceled() const { + return m_canceled; +} diff --git a/libk9copy/k9progress.h b/libk9copy/k9progress.h new file mode 100644 index 0000000..9c88490 --- /dev/null +++ b/libk9copy/k9progress.h @@ -0,0 +1,58 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9PROGRESS_H +#define K9PROGRESS_H + +#include "k9common.h" +#include "../libk9copy/progress.h" +#include +#include +#include +#include "k9drawimage.h" + +class k9Progress : public Progress { + Q_OBJECT + +public: + k9Progress(QWidget* parent = 0, const char* name = 0, const QStringList &args=0); + ~k9Progress(); + virtual k9Process * getProcess() const; + virtual void setProgress(long _position,long _total); + virtual void setLabelText(const QString _text); + virtual void setElapsed(const QString _text); + virtual void setTitle(const QString _text); + virtual void setImage(QString _fileName) ; + virtual void setImage(const QImage &_image); + virtual void setMovie(QString _fileName); + + virtual int execute(); + + bool getCanceled() const; + + /*$PUBLIC_FUNCTIONS$*/ + +public slots: + /*$PUBLIC_SLOTS$*/ + +protected: + /*$PROTECTED_FUNCTIONS$*/ + k9Process *m_process; + k9DrawImage *m_wimage; + void bCancelClick(); + bool m_canceled; +protected slots: + /*$PROTECTED_SLOTS$*/ +}; + +#endif + diff --git a/libk9copy/k9saveimage.cpp b/libk9copy/k9saveimage.cpp new file mode 100644 index 0000000..b919510 --- /dev/null +++ b/libk9copy/k9saveimage.cpp @@ -0,0 +1,84 @@ +// +// C++ Implementation: k9saveimage +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9saveimage.h" +#include "kdecmpeg2.h" +#include + +#include +#include + +void k9SaveImage::drawImage(QImage *_image) { + m_cpt++; + if (m_cpt ==20) { + m_image=*_image; + m_decoder->pause(); + } +} + + +k9SaveImage::k9SaveImage() + : QObject(),QThread() +{ + m_tempFile= new KTempFile(locateLocal("tmp", "k9copy/k9p"), ""); + m_tempFile->setAutoDelete(true); + m_decoder=new kDecMPEG2(); + connect(m_decoder, SIGNAL(pixmapReady(QImage *)), this, SLOT(drawImage(QImage *))); +} + + +k9SaveImage::~k9SaveImage() +{ + delete m_decoder; + delete m_tempFile; +} + +void k9SaveImage::play() { + m_cpt=0; + m_stop=false; + m_timer.start(); + m_decoder->start(); +} +void k9SaveImage::stop() { + m_stop=true; + wait(); + m_decoder->stop(); +} + +void k9SaveImage::addData(uchar *_buffer, uint32_t _size) { + if (m_timer.elapsed() >=7000 ) { + if (m_mutex.tryLock()) { + m_size=_size; + + m_buffer=new uchar[m_size]; + tc_memcpy(m_buffer,_buffer,m_size); + m_mutex.unlock(); + start(LowestPriority); + } + m_timer.restart(); + } +} + + +void k9SaveImage::run() { + m_mutex.lock(); + m_cpt=0; + m_decoder->decode(m_buffer ,m_buffer+m_size,0); + delete m_buffer; + QString sFileName=m_tempFile->name(); + m_image.save(sFileName,"PNG"); + sFileName="\rINFOIMAGE:"+sFileName; + fprintf(stderr,sFileName.utf8()); + + m_mutex.unlock(); +} + +#include "k9saveimage.moc" diff --git a/libk9copy/k9saveimage.h b/libk9copy/k9saveimage.h new file mode 100644 index 0000000..9733577 --- /dev/null +++ b/libk9copy/k9saveimage.h @@ -0,0 +1,60 @@ +// +// C++ Interface: k9saveimage +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9SAVEIMAGE_H +#define K9SAVEIMAGE_H + +#include "k9common.h" +#include +#include +#include + +#include "k9fifo.h" +#include +#include + + +/** + @author Jean-Michel PETIT +*/ +typedef enum { FrameType_B=0x18,FrameType_I=0x08,FrameType_P=0x10,FrameType_D=0x20} eFrameType; + +class kDecMPEG2; + +class k9SaveImage : public QObject,QThread +{ +Q_OBJECT +public: + k9SaveImage(); + ~k9SaveImage(); + + void play(); + void stop(); + void addData(uchar *_buffer, uint32_t _size); +protected: + void run(); +public slots: + void drawImage(QImage*); + +private: + kDecMPEG2 *m_decoder; + k9fifo m_fifo; + bool m_stop; + QTime m_timer; + uint m_cpt; + KTempFile *m_tempFile; + uchar *m_buffer; + uint32_t m_size; + QMutex m_mutex; + QImage m_image; +}; + +#endif diff --git a/libk9copy/k9script.cpp b/libk9copy/k9script.cpp new file mode 100644 index 0000000..f42e8db --- /dev/null +++ b/libk9copy/k9script.cpp @@ -0,0 +1,391 @@ +// +// C++ Implementation: k9script +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9script.h" +#include "k9dvd.h" +#include "k9dvdtitle.h" +#include "bswap.h" +#include "dvdread.h" +#include + +k9Script::k9Script(ifo_handle_t *_ifo, k9DVD *_dvd ) +{ + m_ifo=_ifo; + m_dvd=_dvd; + +} + + +k9Script::~k9Script() +{} + + +vm_cmd_t *k9Script::GOTO(char line,char register1,char value) +{ + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0;cmd[1]=0xA1;cmd[2]=0;cmd[3]=register1;cmd[4]=0; + cmd[5]=value; + cmd[6]=0; + cmd[7]=line; + return &m_cmd; +} + +vm_cmd_t *k9Script::GOTO(char line) +{ + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0;cmd[1]=0x01;cmd[2]=0;cmd[3]=0;cmd[4]=0; + cmd[5]=0; + cmd[6]=0; + cmd[7]=line; + return &m_cmd; +} + +vm_cmd_t *k9Script::JUMPTT(char title,char register1,char register2) +{ + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0x30;cmd[1]=0x22;cmd[2]=0;cmd[3]=0;cmd[4]=0; + cmd[5]=title; + cmd[6]=register1; + cmd[7]=register2; + return &m_cmd; +} + +vm_cmd_t *k9Script::JUMPVMGM_MENU() +{ + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0x30;cmd[1]=0x06;cmd[2]=0;cmd[3]=0;cmd[4]=0; + cmd[5]=0x42; + cmd[6]=0; + cmd[7]=0; + return &m_cmd; +} + +vm_cmd_t *k9Script::CALLVMGM_MENU() +{ + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0x30;cmd[1]=0x08;cmd[2]=0;cmd[3]=0;cmd[4]=0x01; + cmd[5]=0x42; + cmd[6]=0; + cmd[7]=0; + return &m_cmd; +} + + +vm_cmd_t *k9Script::EXIT(char register1,char register2) +{ + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0x30;cmd[1]=0x21;cmd[2]=0;cmd[3]=0;cmd[4]=0; + cmd[5]=0;cmd[6]=register1;cmd[7]=register2; + return &m_cmd; +} + + +vm_cmd_t *k9Script::setGPRM(char numReg,uint16_t value) { + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0x71;cmd[1]=0;cmd[2]=0; + cmd[3]=numReg; + B2N_16(value); + memcpy(cmd+4,&value,sizeof(uint16_t)); + cmd[6]=0; + cmd[7]=0; + return &m_cmd; + +} +vm_cmd_t *k9Script::setGPRMREG(char numReg,uint16_t value) { + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0x61;cmd[1]=0;cmd[2]=0; + cmd[3]=numReg; + B2N_16(value); + memcpy(cmd+4,&value,sizeof(uint16_t)); + cmd[6]=0; + cmd[7]=0; + return &m_cmd; + +} + + +vm_cmd_t *k9Script::setSTN(char numAudio,char numSubpicture) { + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0x51;cmd[1]=0;cmd[2]=0; + cmd[3]=numAudio==0 ? 0 : 0x80+numAudio-1; + cmd[4]=numSubpicture==0 ? 0 : 0xC0+numSubpicture-1; + cmd[5]=0; + cmd[6]=0; + cmd[7]=0; + return &m_cmd; + +} + +vm_cmd_t *k9Script::setSTN(char numAngle) { + uchar* cmd=(uchar*) &m_cmd; + cmd[0]=0x51;cmd[1]=0;cmd[2]=0; + cmd[3]=0; + cmd[4]=0; + cmd[5]=numAngle==0 ? 0 : 0x80+numAngle-1; + cmd[6]=0; + cmd[7]=0; + return &m_cmd; +} + +void k9Script::updatePGCIUT() { + //first, free the old PGCIUT + ifoFree_PGCI_UT(m_ifo); + + m_ifo->pgci_ut = (pgci_ut_t*) malloc(sizeof(pgci_ut_t)); + pgci_ut_t* pgci_ut = m_ifo->pgci_ut; + pgci_ut->zero_1=0; + pgci_ut->nr_of_lus=1; + + pgci_ut->lu = (pgci_lu_t*) malloc(sizeof(pgci_lu_t)); + pgci_lu_t *lu =pgci_ut->lu; + uchar * lng=(uchar*) &(lu->lang_code); + lng[0]='n'; lng[1]='e'; + lu->lang_extension=0; + lu->exists=0x80; + + pgcit_t *pgcit=(pgcit_t*) malloc(sizeof(pgcit_t)); + lu->pgcit=pgcit; + memset(pgcit,0,sizeof(pgcit_t)); + pgcit->nr_of_pgci_srp=1; + pgci_srp_t * srp=(pgci_srp_t*)malloc(sizeof(pgci_srp_t)); + memset(srp,0,sizeof(pgci_srp_t)); + pgcit->pgci_srp=srp; + srp->entry_id=0x82; + + pgc_t *pgc=(pgc_t*)malloc(sizeof(pgc_t)); + srp->pgc=pgc; + memset(pgc,0,sizeof(pgc_t)); + + pgc_command_tbl_t * command_tbl=(pgc_command_tbl_t*) malloc(sizeof(pgc_command_tbl_t)); + pgc->command_tbl=command_tbl; + pgc->command_tbl_offset=1; + memset(command_tbl,0,sizeof(pgc_command_tbl_t)); + + if (m_ifo->vmgi_mat != NULL) + updatePGCIUT_VMG(command_tbl); + else + updatePGCIUT_VTS(command_tbl); +} + +void k9Script::updateFPPGC() { + ifoFree_FP_PGC(m_ifo); + pgc_t*pgc=(pgc_t*)malloc(sizeof(pgc_t)); + m_ifo->first_play_pgc=pgc; + memset(pgc,0,sizeof(pgc_t)); + + pgc_command_tbl_t * command_tbl=(pgc_command_tbl_t*) malloc(sizeof(pgc_command_tbl_t)); + pgc->command_tbl=command_tbl; + pgc->command_tbl_offset=1; + memset(command_tbl,0,sizeof(pgc_command_tbl_t)); + // set GRPM(0)= First Title + addPreCmd(command_tbl,JUMPTT(m_dvd->getstart()->getnumTitle(),0,0)); + // jump VMGM Menu + //addPreCmd(command_tbl,JUMPVMGM_MENU()); + +} + +void k9Script::updatePGC(pgc_t *_pgc ,int numVTS,int numPGC) { + k9DVDTitle *title=NULL; + for (int i=0; i gettitleCount();i++) { + title=m_dvd->gettitle(i); + if (title->getVTS()== numVTS && title->getTTN()==numPGC && title->getIndexed()) + break; + } + + pgc_command_tbl_t *command_tbl=_pgc->command_tbl; + if (command_tbl ==NULL) { + command_tbl=(pgc_command_tbl_t*) malloc(sizeof(pgc_command_tbl_t)); + _pgc->command_tbl=command_tbl; + _pgc->command_tbl_offset=1; + memset(command_tbl,0,sizeof(pgc_command_tbl_t)); + } + + if (numPGC==0) + return; + + for (int i=0; i < command_tbl->nr_of_pre;i++) { + //replace all JUMPs by a goto to the last line of cell commands ( link to next title) + char *cmd=(char*)&(command_tbl->pre_cmds[i]); + if (cmd[0]==0x30) { + char NOP[8]={0,0,0,0,0,0,0,0}; + memcpy(cmd,NOP,8); + } + + } + if (title->isSelected()) { + char numSubP=0,numAudio=0; + if (title->getDefSubtitle() !=NULL) + numSubP=title->getDefSubtitle()->getnum(); + if (title->getDefAudio() !=NULL) + numAudio=title->getDefAudio()->getID(); + if (numSubP+numAudio >0) { + char *c=(char*)command_tbl->pre_cmds; + bool binsert=false; + if (c==NULL) + binsert=true; + else if ( *c==0x51) + binsert=true; + if (binsert) + memcpy(command_tbl->pre_cmds,setSTN( numAudio,numSubP),8); + else + insertPreCmd(command_tbl,setSTN( numAudio,numSubP)); + } + } + + for (int i=0; i < command_tbl->nr_of_cell;i++) { + //replace all JUMPs by a goto to the last line of cell commands ( link to next title) + JumpVmg(&(command_tbl->cell_cmds[i])); + + } + for (int i=0; i < command_tbl->nr_of_post;i++) { + //replace all JUMPs by a goto to the last line of cell commands ( link to next title) + JumpVmg(&(command_tbl->post_cmds[i])); + } + + + bool insertCall=true; + if (command_tbl->nr_of_post !=0) { + vm_cmd_t *cmd=&command_tbl->post_cmds[command_tbl->nr_of_post -1]; + if (memcmp(cmd,CALLVMGM_MENU(),8)==0) + insertCall=false; + } + + if (insertCall) + for (int i=0; i gettitleCount();i++) { + k9DVDTitle *title=m_dvd->gettitle(i); + if (title->getVTS()== numVTS && title->getTTN()==numPGC && title->isSelected() && title->getIndexed()) { + addPostCmd(command_tbl,CALLVMGM_MENU()); + break; + } + } +} + +// replace the actual jump by a jump to he vmgm menu +void k9Script::JumpVmg(vm_cmd_t * command) { + char *cmd=(char*) command; + if (cmd[0]==0x30) { + cmd[1]=cmd[1] & 0xF0 + 0x08; //0x20 =conditionnal jump + cmd[2]=cmd[3]=0; + cmd[4]=0x01; + cmd[5]=0x42; + } + +} + + +void k9Script::updatePGCIUT_VTS(pgc_command_tbl_t *command_tbl) { + addPreCmd( command_tbl, JUMPVMGM_MENU()); +} + + +void k9Script::updatePGCIUT_VMG(pgc_command_tbl_t *command_tbl) +{ + command_tbl->nr_of_pre=0; + command_tbl->pre_cmds=NULL; + + //initialisation of the registers + for (int i=0;i<=15;i++) + if (i!=1) + addPreCmd( command_tbl,setGPRM( i,0)); + + addTitles(command_tbl); +} + +void k9Script::addTitles(pgc_command_tbl_t *command_tbl) { + char NOP[8]={0,0,0,0,0,0,0,0}; + + //Set GPRM(1) = current title (SPRM(4)) + addPreCmd(command_tbl,setGPRMREG(1,0x84)); + + int nbSelected=0; + for (int i=0;igettitleCount();i++) { + k9DVDTitle *title=m_dvd->gettitle(i); + if (title->isSelected() && title->getIndexed()) + nbSelected++; + } + int a=0; + for (int i=0;igettitleCount();i++) { + k9DVDTitle *title=m_dvd->gettitle(i); + if (title->isSelected() && title->getIndexed()) { + //SI GPRM1=numTitle, GOTO i*3 + addPreCmd(command_tbl,GOTO(16+nbSelected+a*3+2,1,title->getnumTitle())); + a++; + } + } + addPreCmd( command_tbl,EXIT(0,0)); + + for (int i=0;igettitleCount();i++) { + k9DVDTitle *title=m_dvd->gettitle(i); + if (title->isSelected() && title->getIndexed()) { + //initialization of register 1 + addPreCmd(command_tbl,setGPRM(1,0)); + //set default subtitle and audio stream + addPreCmd(command_tbl,(vm_cmd_t*)NOP); + //jump to title + if (title->getnextTitle()!=NULL) + addPreCmd(command_tbl,JUMPTT(title->getnextTitle()->getnumTitle(),0,0)); + else + addPreCmd(command_tbl,EXIT(0,0)); + } + } + + +} + +void k9Script::addPreCmd(pgc_command_tbl_t *command_tbl,vm_cmd_t *cmd) { + command_tbl->nr_of_pre++; + if (command_tbl->pre_cmds == NULL) + command_tbl->pre_cmds=(vm_cmd_t*)malloc(sizeof(vm_cmd_t)); + else + command_tbl->pre_cmds=(vm_cmd_t*) realloc(command_tbl->pre_cmds,sizeof(vm_cmd_t)*command_tbl->nr_of_pre); + + memcpy(&(command_tbl->pre_cmds[command_tbl->nr_of_pre-1]),cmd,sizeof(vm_cmd_t)); +} + +void k9Script::insertPreCmd(pgc_command_tbl_t *command_tbl,vm_cmd_t *cmd) { + command_tbl->nr_of_pre++; + if (command_tbl->pre_cmds == NULL) + command_tbl->pre_cmds=(vm_cmd_t*)malloc(sizeof(vm_cmd_t)); + else + command_tbl->pre_cmds=(vm_cmd_t*) realloc(command_tbl->pre_cmds,sizeof(vm_cmd_t)*command_tbl->nr_of_pre); + + for (int i=command_tbl->nr_of_pre-2;i>=0;i--) { + memcpy(&(command_tbl->pre_cmds[i+1]),&(command_tbl->pre_cmds[i]),sizeof(vm_cmd_t)); + char *cmd=(char*)&(command_tbl->pre_cmds[i+1]); + if (cmd[0]==0 && cmd[1]&0x01==0x01) + cmd[7]++; + + } + + memcpy(&(command_tbl->pre_cmds[0]),cmd,sizeof(vm_cmd_t)); +} + + + +void k9Script::addPostCmd(pgc_command_tbl_t *command_tbl,vm_cmd_t *cmd) { + command_tbl->nr_of_post++; + if (command_tbl->post_cmds == NULL) + command_tbl->post_cmds=(vm_cmd_t*)malloc(sizeof(vm_cmd_t)); + else + command_tbl->post_cmds=(vm_cmd_t*) realloc(command_tbl->post_cmds,sizeof(vm_cmd_t)*command_tbl->nr_of_post); + + memcpy(&(command_tbl->post_cmds[command_tbl->nr_of_post-1]),cmd,sizeof(vm_cmd_t)); +} + +void k9Script::addCellCmd(pgc_command_tbl_t *command_tbl,vm_cmd_t *cmd) { + command_tbl->nr_of_cell++; + if (command_tbl->cell_cmds == NULL) + command_tbl->cell_cmds=(vm_cmd_t*)malloc(sizeof(vm_cmd_t)); + else + command_tbl->cell_cmds=(vm_cmd_t*) realloc(command_tbl->cell_cmds,sizeof(vm_cmd_t)*command_tbl->nr_of_cell); + + memcpy(&(command_tbl->cell_cmds[command_tbl->nr_of_cell-1]),cmd,sizeof(vm_cmd_t)); +} diff --git a/libk9copy/k9script.h b/libk9copy/k9script.h new file mode 100644 index 0000000..853e3cb --- /dev/null +++ b/libk9copy/k9script.h @@ -0,0 +1,55 @@ +// +// C++ Interface: k9script +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9SCRIPT_H +#define K9SCRIPT_H +#include "k9common.h" +/** + @author Jean-Michel PETIT +*/ + +class k9DVD; + +class k9Script{ +private: + ifo_handle_t *m_ifo; + k9DVD *m_dvd; + vm_cmd_t m_cmd; +protected: + vm_cmd_t *JUMPTT(char title,char register1,char register2); + vm_cmd_t *JUMPVMGM_MENU(); + vm_cmd_t *GOTO(char line,char register1,char value); + vm_cmd_t *GOTO(char line); + vm_cmd_t *setGPRM(char numReg,uint16_t value); + vm_cmd_t *setGPRMREG(char numReg,uint16_t value); + + vm_cmd_t *CALLVMGM_MENU(); + vm_cmd_t *setSTN(char numAudio,char numSubpicture); + vm_cmd_t *setSTN(char numAngle); + + vm_cmd_t *EXIT(char register1,char register2); + void addPreCmd(pgc_command_tbl_t *command_tbl,vm_cmd_t *cmd); + void insertPreCmd(pgc_command_tbl_t *command_tbl,vm_cmd_t *cmd); + void addPostCmd(pgc_command_tbl_t *command_tbl,vm_cmd_t *cmd); + void addCellCmd(pgc_command_tbl_t *command_tbl,vm_cmd_t *cmd); + void updatePGCIUT_VMG(pgc_command_tbl_t *command_tbl); + void updatePGCIUT_VTS(pgc_command_tbl_t *command_tbl); + void JumpVmg(vm_cmd_t * cmd) ; + void addTitles(pgc_command_tbl_t *command_tbl); +public: + k9Script(ifo_handle_t *_ifo,k9DVD *_dvd); + void updatePGCIUT(); + void updateFPPGC(); + void updatePGC(pgc_t *_pgc,int numVTS,int numPGC); + ~k9Script(); +}; + +#endif diff --git a/libk9copy/k9titleencopt.cpp b/libk9copy/k9titleencopt.cpp new file mode 100644 index 0000000..8e75919 --- /dev/null +++ b/libk9copy/k9titleencopt.cpp @@ -0,0 +1,159 @@ +// +// C++ Implementation: k9titleencopt +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9common.h" +#include "k9titleencopt.h" +#include "k9config.h" +#include "k9dvdtitle.h" + +k9TitleEncOpt::k9TitleEncOpt(k9DVDTitle *parent) + : QObject(parent, "") +{ + connect (parent,SIGNAL(selectionChanged()),this,SLOT(load())); + load(); +} + + +k9TitleEncOpt::~k9TitleEncOpt() +{ +} + + +void k9TitleEncOpt::load() { + //KSimpleConfig settings("K9Copy"); + k9Config config; + + int size_mb=(int)getTitle()->gettotalsize_mb(); + + m_maxSize=config.getPrefMp4Size(); + if(m_maxSize > size_mb) + m_maxSize=size_mb ; + + m_numParts=config.getPrefMp4NumberCD(); + + m_width=config.getPrefMp4Width(); + m_height=config.getPrefMp4Height(); + + m_keepAspectRatio=config.getPrefMp4AspectRatio(); + + m_2Passes=config.getPrefMp42Passes(); + + m_audioBr=config.getPrefMp4AudioBitrate(); + + m_codec=config.getPrefMp4Codec(); + + m_audioCodec=config.getPrefMp4AudioCodec (); + + m_audioGain=config.getPrefMp4AudioGain(); + + m_videoBr=config.getPrefMp4VideoBitrate(); + + m_useCache=config.getPrefUseCellCache(); + +} + +int k9TitleEncOpt::getMaxSize() { + return m_maxSize; +} + +void k9TitleEncOpt::setMaxSize(int _value) { + m_maxSize=_value; +} + + +int k9TitleEncOpt::getNumParts() { + return m_numParts; +} + +void k9TitleEncOpt::setNumParts(int _value) { + m_numParts=_value; +} + +int k9TitleEncOpt::getAudioGain() { + return m_audioGain; +} + +void k9TitleEncOpt::setAudioGain(int _value) { + m_audioGain=_value; +} + +const QString & k9TitleEncOpt::getWidth() { + return m_width; +} + +void k9TitleEncOpt::setWidth(QString _value) { + m_width=_value; +} + + +const QString & k9TitleEncOpt::getHeight() { + return m_height; +} + +void k9TitleEncOpt::setHeight(QString _value) { + m_height=_value; +} + +const QString & k9TitleEncOpt::getAudioBr() { + return m_audioBr; +} +void k9TitleEncOpt::setAudioBr(QString _value) { + m_audioBr=_value; +} + +const QString & k9TitleEncOpt::getVideoBr() { + return m_videoBr; +} +void k9TitleEncOpt::setVideoBr(QString _value) { + m_videoBr=_value; +} + +bool k9TitleEncOpt::getKeepAspectRatio() { + return m_keepAspectRatio; +} +void k9TitleEncOpt::setKeepAspectRatio(bool _value) { + m_keepAspectRatio=_value; +} + +bool k9TitleEncOpt::get2Passes() { + return m_2Passes; +} +void k9TitleEncOpt::set2Passes(bool _value) { + m_2Passes=_value; +} + +int k9TitleEncOpt::getCodec() { + return m_codec; +} +void k9TitleEncOpt::setCodec(int _value) { + m_codec=_value; +} + +int k9TitleEncOpt::getAudioCodec() { + return m_audioCodec; +} +void k9TitleEncOpt::setAudioCodec(int _value) { + m_audioCodec=_value; +} + +bool k9TitleEncOpt::getUseCache() { + k9Config config; + m_useCache=config.getPrefUseCellCache(); + return m_useCache; +} + +void k9TitleEncOpt::setUseCache(bool _value) { + m_useCache=_value; +} + + + +#include "k9titleencopt.moc" diff --git a/libk9copy/k9titleencopt.h b/libk9copy/k9titleencopt.h new file mode 100644 index 0000000..cb4cde3 --- /dev/null +++ b/libk9copy/k9titleencopt.h @@ -0,0 +1,87 @@ +// +// C++ Interface: k9titleencopt +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9TITLEENCOPT_H +#define K9TITLEENCOPT_H + +#include + + +/** + @author Jean-Michel PETIT +*/ + +class k9DVDTitle; + +class k9TitleEncOpt : public QObject +{ +Q_OBJECT +public: + k9TitleEncOpt(k9DVDTitle *parent ); + ~k9TitleEncOpt(); + k9DVDTitle *getTitle() { return (k9DVDTitle*)parent();}; + +public: + int getMaxSize(); + void setMaxSize(int); + + int getNumParts(); + void setNumParts(int); + + int getAudioGain(); + void setAudioGain(int); + + const QString & getWidth(); + void setWidth(QString); + + const QString & getHeight(); + void setHeight(QString); + + const QString & getAudioBr(); + void setAudioBr(QString); + + const QString & getVideoBr(); + void setVideoBr(QString); + + bool getKeepAspectRatio(); + void setKeepAspectRatio(bool); + + bool get2Passes(); + void set2Passes(bool); + + bool getUseCache(); + void setUseCache(bool); + + int getCodec(); + void setCodec(int); + + int getAudioCodec(); + void setAudioCodec(int); + + +private: + int m_maxSize; + int m_numParts; + QString m_width; + QString m_height; + bool m_keepAspectRatio; + bool m_2Passes; + QString m_audioBr,m_videoBr; + int m_codec,m_audioCodec; + int m_audioGain; + bool m_useCache; + +public slots: + void load(); + +}; + +#endif diff --git a/libk9copy/k9tools.cpp b/libk9copy/k9tools.cpp new file mode 100644 index 0000000..1464553 --- /dev/null +++ b/libk9copy/k9tools.cpp @@ -0,0 +1,38 @@ +// +// C++ Implementation: k9tools +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9tools.h" +#include +#include + +bool k9Tools::checkProgram(QString _progName) { + return KStandardDirs::findExe( _progName,NULL,false) !=NULL ; +} + +void k9Tools::clearOutput(QString name) { + QDir dir(name); + //delete files in directory + QStringList lst = dir.entryList( "*",QDir::Files |QDir::Hidden ); + for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + //QString c(( *it ).latin1() ); + dir.remove (*it); + } + //scanning subdir + QStringList lstdir = dir.entryList( "*",QDir::Dirs ); + for ( QStringList::Iterator it = lstdir.begin(); it != lstdir.end(); ++it ) { + QString c=*it; + if ((c!=".") && c!="..") { + clearOutput(dir.absFilePath(c)); + dir.rmdir(c); + } + } + +} diff --git a/libk9copy/k9tools.h b/libk9copy/k9tools.h new file mode 100644 index 0000000..9548511 --- /dev/null +++ b/libk9copy/k9tools.h @@ -0,0 +1,29 @@ +// +// C++ Interface: k9tools +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9TOOLS_H +#define K9TOOLS_H + +#include + +/** + @author Jean-Michel PETIT +*/ +class k9Tools{ +private: + k9Tools() {}; + ~k9Tools(){}; +public: + static bool checkProgram(QString _progName); + static void clearOutput(QString name); +}; + +#endif diff --git a/libk9copy/k9videocodecs.cpp b/libk9copy/k9videocodecs.cpp new file mode 100644 index 0000000..8e91793 --- /dev/null +++ b/libk9copy/k9videocodecs.cpp @@ -0,0 +1,174 @@ +// +// C++ Implementation: k9videocodecs +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9videocodecs.h" +#include + +class _k9VideoCodec +{ +public: + _k9VideoCodec():name(""),fourcc(""),optPass1(""),optPass2(""),optOnePass(""){}; + _k9VideoCodec(QString _name,QString _fourcc,QString _optOnePass,QString _optPass1,QString _optPass2) { + name=_name; + fourcc=_fourcc; + optOnePass=_optOnePass; + optPass1=_optPass1; + optPass2=_optPass2; + } + QString name; + QString fourcc; + QString optOnePass; + QString optPass1; + QString optPass2; +}; + + +k9VideoCodecs::k9VideoCodecs(QObject *parent, const char *name) + : QObject(parent, name) +{ + m_config=new k9Config(); + QStringList slLabels=m_config->getCodecLabels(); + QStringList slCodecs=m_config->getCodecVideo(); + bool bReset; + bReset=slLabels.count()==0; + if (!bReset) + bReset=slCodecs.count() != slLabels.count()*4; + //adds default codecs + if (bReset) { + reset(); + m_config=new k9Config(); + slLabels=m_config->getCodecLabels(); + slCodecs=m_config->getCodecVideo(); + } + + QStringList::iterator c=slCodecs.begin(); + int cpt=0; + for (QStringList::iterator i=slLabels.begin();i!=slLabels.end() ;++i) { + QString fourcc=(*c); + c++; + QString o1=(*c); + c++; + QString o2=(*c); + c++; + QString o3=(*c); + c++; + + m_codecs[cpt++]=_k9VideoCodec((*i),fourcc,o1,o2,o3); + } + delete m_config; + +} + +void k9VideoCodecs::reset() { + m_codecs[0]=_k9VideoCodec("copy","","-ovc copy","-ovc copy","-ovc copy"); + m_codecs[1]=_k9VideoCodec("XviD","","-ovc xvid -xvidencopts bitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc xvid -xvidencopts bitrate=$VIDBR:turbo:pass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc xvid -xvidencopts bitrate=$VIDBR:turbo:pass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[2]=_k9VideoCodec("x264","","-ovc x264 -x264encopts bitrate=$VIDBR:threads=0 -vf scale=$WIDTH:$HEIGHT","-ovc x264 -x264encopts bitrate=$VIDBR:turbo=1:pass=$PASS:threads=0 -vf scale=$WIDTH:$HEIGHT","-ovc x264 -x264encopts bitrate=$VIDBR:turbo=1:pass=$PASS:threads=0 -vf scale=$WIDTH:$HEIGHT"); + m_codecs[3]=_k9VideoCodec("MJPEG","","-ovc lavc -lavcopts vcodec=mjpeg:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mjpeg:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mjpeg:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[4]=_k9VideoCodec("LJPEG","","-ovc lavc -lavcopts vcodec=ljpeg:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=ljpeg:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=ljpeg:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[5]=_k9VideoCodec("H261","","-ovc lavc -lavcopts vcodec=h261:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h261:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h261:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[6]=_k9VideoCodec("H263","","-ovc lavc -lavcopts vcodec=h263:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h263:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h263:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[7]=_k9VideoCodec("H263+","","-ovc lavc -lavcopts vcodec=h263p:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h263p:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h263p:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[8]=_k9VideoCodec("MPEG-4 (DivX 4/5)","DIVX","-ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[9]=_k9VideoCodec("MS MPEG-4 (DivX 3)","DIVX","-ovc lavc -lavcopts vcodec=msmpeg4:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=msmpeg4:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=msmpeg4:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[10]=_k9VideoCodec("MS MPEG-4 v2","","-ovc lavc -lavcopts vcodec=msmpeg4v2:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=msmpeg4v2:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=msmpeg4v2:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[11]=_k9VideoCodec("WMV7","","-ovc lavc -lavcopts vcodec=wmv1:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=wmv1:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=wmv1:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[12]=_k9VideoCodec("WMV8","","-ovc lavc -lavcopts vcodec=wmv2:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=wmv2:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=wmv2:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + + m_codecs[13]=_k9VideoCodec("RealVideo","","-ovc lavc -lavcopts vcodec=rv10:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=rv10:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=rv10:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[14]=_k9VideoCodec("MPEG-1 Video","","-ovc lavc -lavcopts vcodec=mpeg1video:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg1video:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg1video:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[15]=_k9VideoCodec("MPEG-2 Video","","-ovc lavc -lavcopts vcodec=mpeg2video:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg2video:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg2video:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[16]=_k9VideoCodec("Huffmann yuv","","-ovc lavc -lavcopts vcodec=huffyuv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:format=422p -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=huffyuv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR::format=422p:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=huffyuv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR::format=422p:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[17]=_k9VideoCodec("ffv Huffmann","","-ovc lavc -lavcopts vcodec=ffvhuff:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=ffvhuff:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=ffvhuff:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[18]=_k9VideoCodec("ASUS v1","","-ovc lavc -lavcopts vcodec=asv1:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=asv1:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=asv1:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[19]=_k9VideoCodec("ASUS v2","","-ovc lavc -lavcopts vcodec=asv2:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=asv2:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=asv2:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + m_codecs[20]=_k9VideoCodec("flv","","-ovc lavc -lavcopts vcodec=flv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=flv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=flv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT"); + save(); + +} + +void k9VideoCodecs::save() { + m_config=new k9Config(); + + QStringList labels; + QStringList options; + for (QMap::iterator i=m_codecs.begin();i!=m_codecs.end();++i) { + labels << i.data().name; + options << i.data().fourcc; + options << i.data().optOnePass; + options << i.data().optPass1; + options << i.data().optPass2; + } + m_config->setCodecLabels(labels); + m_config->setCodecVideo(options); + m_config->save(); + delete m_config; +} + + + + +int k9VideoCodecs::count() { + return m_codecs.count(); +} + +void k9VideoCodecs::setFourcc(int _num,QString _value) { + m_codecs[_num].fourcc=_value; +} +void k9VideoCodecs::setOptions0(int _num,QString _value) { + m_codecs[_num].optOnePass=_value; +} +void k9VideoCodecs::setOptions1(int _num,QString _value) { + m_codecs[_num].optPass1=_value; +} +void k9VideoCodecs::setOptions2(int _num,QString _value) { + m_codecs[_num].optPass2=_value; +} + +void k9VideoCodecs::setCodecName(int _num,QString _value) { + m_codecs[_num].name=_value; +} + +QString k9VideoCodecs::getFourcc(int _num) { + return m_codecs[_num].fourcc; +} + +QString k9VideoCodecs::getOptions0(int _num) { + return m_codecs[_num].optOnePass; +} + +QString k9VideoCodecs::getOptions1(int _num) { + return m_codecs[_num].optPass1; +} + +QString k9VideoCodecs::getOptions2(int _num) { + return m_codecs[_num].optPass2; +} +QString k9VideoCodecs::getCodecName(int _num) { + return m_codecs[_num].name; +} + +void k9VideoCodecs::remove(int _num) { + int nb=count(); + if (nb>0) { + for(int i=_num;i, (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9VIDEOCODECS_H +#define K9VIDEOCODECS_H + +#include "k9common.h" +#include +#include +#include "k9config.h" + +/** + @author Jean-Michel PETIT +*/ +class _k9VideoCodec; + +class k9VideoCodecs : public QObject +{ +Q_OBJECT +public: + k9VideoCodecs(QObject *parent = 0, const char *name = 0); + + ~k9VideoCodecs(); + void save(); + void setFourcc(int _num,QString _value); + void setOptions0(int _num,QString _value); + void setOptions1(int _num,QString _value); + void setOptions2(int _num,QString _value); + void setCodecName(int _num,QString _value); + void remove(int _num); + QString getFourcc(int _num); + QString getOptions0(int _num); + QString getOptions1(int _num); + QString getOptions2(int _num); + QString getCodecName(int _num); + + int count(); + void reset(); +private: + QMap m_codecs; + k9Config *m_config; + + +}; + +#endif diff --git a/libk9copy/mp4dlg.cpp b/libk9copy/mp4dlg.cpp new file mode 100644 index 0000000..a5854d7 --- /dev/null +++ b/libk9copy/mp4dlg.cpp @@ -0,0 +1,159 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './mp4dlg.ui' +** +** Created: dim. oct. 26 08:55:59 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "mp4dlg.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kprogress.h" +#include "kpushbutton.h" + +/* + * Constructs a MP4Dlg as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +MP4Dlg::MP4Dlg( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "MP4Dlg" ); + setCursor( QCursor( 3 ) ); + MP4DlgLayout = new QGridLayout( this, 1, 1, 11, 6, "MP4DlgLayout"); + + lblTitle = new QLabel( this, "lblTitle" ); + lblTitle->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)4, 0, 0, lblTitle->sizePolicy().hasHeightForWidth() ) ); + QFont lblTitle_font( lblTitle->font() ); + lblTitle_font.setBold( TRUE ); + lblTitle->setFont( lblTitle_font ); + lblTitle->setCursor( QCursor( 3 ) ); + + MP4DlgLayout->addWidget( lblTitle, 0, 0 ); + + pbProgress = new KProgress( this, "pbProgress" ); + pbProgress->setCursor( QCursor( 3 ) ); + + MP4DlgLayout->addMultiCellWidget( pbProgress, 3, 3, 0, 2 ); + + frame3 = new QFrame( this, "frame3" ); + frame3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, frame3->sizePolicy().hasHeightForWidth() ) ); + frame3->setCursor( QCursor( 3 ) ); + frame3->setFrameShape( QFrame::NoFrame ); + frame3->setFrameShadow( QFrame::Raised ); + frame3Layout = new QGridLayout( frame3, 1, 1, 11, 6, "frame3Layout"); + + lblfps = new QLabel( frame3, "lblfps" ); + lblfps->setCursor( QCursor( 3 ) ); + lblfps->setAlignment( int( QLabel::AlignVCenter ) ); + + frame3Layout->addWidget( lblfps, 2, 1 ); + + lblRemain = new QLabel( frame3, "lblRemain" ); + lblRemain->setCursor( QCursor( 3 ) ); + lblRemain->setAlignment( int( QLabel::AlignVCenter ) ); + + frame3Layout->addWidget( lblRemain, 3, 1 ); + + lblsize = new QLabel( frame3, "lblsize" ); + lblsize->setCursor( QCursor( 3 ) ); + + frame3Layout->addWidget( lblsize, 0, 1 ); + + lblbitrate = new QLabel( frame3, "lblbitrate" ); + lblbitrate->setCursor( QCursor( 3 ) ); + + frame3Layout->addWidget( lblbitrate, 1, 1 ); + + textLabel2 = new QLabel( frame3, "textLabel2" ); + textLabel2->setCursor( QCursor( 3 ) ); + + frame3Layout->addWidget( textLabel2, 2, 0 ); + + textLabel2_2 = new QLabel( frame3, "textLabel2_2" ); + textLabel2_2->setCursor( QCursor( 3 ) ); + + frame3Layout->addWidget( textLabel2_2, 3, 0 ); + + textLabel1 = new QLabel( frame3, "textLabel1" ); + textLabel1->setCursor( QCursor( 3 ) ); + + frame3Layout->addWidget( textLabel1, 1, 0 ); + + textLabel3 = new QLabel( frame3, "textLabel3" ); + textLabel3->setCursor( QCursor( 3 ) ); + + frame3Layout->addWidget( textLabel3, 0, 0 ); + + MP4DlgLayout->addMultiCellWidget( frame3, 2, 2, 0, 2 ); + + bCancel = new KPushButton( this, "bCancel" ); + bCancel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bCancel->sizePolicy().hasHeightForWidth() ) ); + bCancel->setCursor( QCursor( 0 ) ); + bCancel->setProperty( "stdItem", 26 ); + + MP4DlgLayout->addWidget( bCancel, 5, 2 ); + spacer1 = new QSpacerItem( 225, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + MP4DlgLayout->addMultiCell( spacer1, 5, 5, 0, 1 ); + spacer2 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Fixed ); + MP4DlgLayout->addItem( spacer2, 4, 1 ); + + image = new QLabel( this, "image" ); + image->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, image->sizePolicy().hasHeightForWidth() ) ); + image->setMinimumSize( QSize( 0, 250 ) ); + image->setPaletteBackgroundColor( QColor( 0, 0, 0 ) ); + image->setCursor( QCursor( 3 ) ); + image->setScaledContents( TRUE ); + + MP4DlgLayout->addMultiCellWidget( image, 1, 1, 0, 2 ); + languageChange(); + resize( QSize(416, 475).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bCancel, SIGNAL( clicked() ), this, SLOT( Cancel() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MP4Dlg::~MP4Dlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void MP4Dlg::languageChange() +{ + setCaption( tr2i18n( "k9Copy - transcoding" ) ); + lblTitle->setText( tr2i18n( "Encoding" ) ); + lblfps->setText( QString::null ); + lblRemain->setText( QString::null ); + lblsize->setText( QString::null ); + lblbitrate->setText( QString::null ); + textLabel2->setText( tr2i18n( "fps" ) ); + textLabel2_2->setText( tr2i18n( "Elapsed Time" ) ); + textLabel1->setText( tr2i18n( "Bitrate" ) ); + textLabel3->setText( tr2i18n( "Size" ) ); +} + +void MP4Dlg::Cancel() +{ + qWarning( "MP4Dlg::Cancel(): Not implemented yet" ); +} + +#include "mp4dlg.moc" diff --git a/libk9copy/mp4dlg.ui b/libk9copy/mp4dlg.ui new file mode 100644 index 0000000..87390ed --- /dev/null +++ b/libk9copy/mp4dlg.ui @@ -0,0 +1,281 @@ + +MP4Dlg + + + MP4Dlg + + + + 0 + 0 + 416 + 475 + + + + 3 + + + k9Copy - transcoding + + + + unnamed + + + + lblTitle + + + + 4 + 4 + 0 + 0 + + + + + 1 + + + + 3 + + + Encoding + + + + + pbProgress + + + 3 + + + + + frame3 + + + + 5 + 0 + 0 + 0 + + + + 3 + + + NoFrame + + + Raised + + + + unnamed + + + + lblfps + + + 3 + + + + + + AlignVCenter + + + + + lblRemain + + + 3 + + + + + + AlignVCenter + + + + + lblsize + + + 3 + + + + + + + + lblbitrate + + + 3 + + + + + + + + textLabel2 + + + 3 + + + fps + + + + + textLabel2_2 + + + 3 + + + Elapsed Time + + + + + textLabel1 + + + 3 + + + Bitrate + + + + + textLabel3 + + + 3 + + + Size + + + + + + + bCancel + + + + 0 + 0 + 0 + 0 + + + + 0 + + + 26 + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 225 + 21 + + + + + + spacer2 + + + Vertical + + + Fixed + + + + 20 + 16 + + + + + + image + + + + 5 + 7 + 0 + 0 + + + + + 0 + 250 + + + + + 0 + 0 + 0 + + + + 3 + + + true + + + + + + + bCancel + clicked() + MP4Dlg + Cancel() + + + + Cancel() + + + + kprogress.h + kpushbutton.h + + diff --git a/libk9copy/processList.cpp b/libk9copy/processList.cpp new file mode 100644 index 0000000..b5aa5e0 --- /dev/null +++ b/libk9copy/processList.cpp @@ -0,0 +1,81 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './processList.ui' +** +** Created: dim. oct. 26 08:55:59 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "processList.h" + +#include +#include +#include +#include +#include +#include +#include +#include "kpushbutton.h" + +/* + * Constructs a processList as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +processList::processList( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "processList" ); + processListLayout = new QGridLayout( this, 1, 1, 11, 6, "processListLayout"); + + lProcess = new QListView( this, "lProcess" ); + lProcess->addColumn( tr2i18n( "Processes" ) ); + lProcess->addColumn( tr2i18n( "Elapsed" ) ); + lProcess->addColumn( tr2i18n( "..." ) ); + + processListLayout->addMultiCellWidget( lProcess, 0, 0, 0, 1 ); + + bCancel = new KPushButton( this, "bCancel" ); + bCancel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bCancel->sizePolicy().hasHeightForWidth() ) ); + bCancel->setProperty( "stdItem", 2 ); + + processListLayout->addWidget( bCancel, 1, 1 ); + spacer1 = new QSpacerItem( 361, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + processListLayout->addItem( spacer1, 1, 0 ); + languageChange(); + resize( QSize(600, 480).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bCancel, SIGNAL( clicked() ), this, SLOT( bCancelClick() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +processList::~processList() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void processList::languageChange() +{ + setCaption( tr2i18n( "Process List" ) ); + lProcess->header()->setLabel( 0, tr2i18n( "Processes" ) ); + lProcess->header()->setLabel( 1, tr2i18n( "Elapsed" ) ); + lProcess->header()->setLabel( 2, tr2i18n( "..." ) ); + bCancel->setText( tr2i18n( "&Cancel" ) ); + bCancel->setAccel( QKeySequence( tr2i18n( "Alt+C" ) ) ); +} + +void processList::bCancelClick() +{ + qWarning( "processList::bCancelClick(): Not implemented yet" ); +} + +#include "processList.moc" diff --git a/libk9copy/processList.ui b/libk9copy/processList.ui new file mode 100644 index 0000000..efd924c --- /dev/null +++ b/libk9copy/processList.ui @@ -0,0 +1,116 @@ + +processList + + + processList + + + + 0 + 0 + 600 + 480 + + + + Process List + + + + unnamed + + + + + Processes + + + true + + + true + + + + + Elapsed + + + true + + + true + + + + + ... + + + true + + + true + + + + lProcess + + + + + bCancel + + + + 0 + 0 + 0 + 0 + + + + &Cancel + + + Alt+C + + + 2 + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 361 + 20 + + + + + + + + bCancel + clicked() + processList + bCancelClick() + + + + bCancelClick() + + + + kpushbutton.h + + diff --git a/libk9copy/progress.cpp b/libk9copy/progress.cpp new file mode 100644 index 0000000..f4794a6 --- /dev/null +++ b/libk9copy/progress.cpp @@ -0,0 +1,127 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './progress.ui' +** +** Created: dim. oct. 26 08:55:59 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "progress.h" + +#include +#include +#include +#include +#include +#include +#include +#include "kpushbutton.h" +#include "kprogress.h" + +/* + * Constructs a Progress as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +Progress::Progress( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "Progress" ); + setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) ); + setMinimumSize( QSize( 0, 0 ) ); + setCursor( QCursor( 3 ) ); + setMouseTracking( FALSE ); + ProgressLayout = new QGridLayout( this, 1, 1, 11, 6, "ProgressLayout"); + + lblTitle = new QLabel( this, "lblTitle" ); + lblTitle->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, lblTitle->sizePolicy().hasHeightForWidth() ) ); + QFont lblTitle_font( lblTitle->font() ); + lblTitle_font.setBold( TRUE ); + lblTitle->setFont( lblTitle_font ); + lblTitle->setCursor( QCursor( 3 ) ); + + ProgressLayout->addMultiCellWidget( lblTitle, 0, 0, 0, 2 ); + + bCancel = new KPushButton( this, "bCancel" ); + bCancel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bCancel->sizePolicy().hasHeightForWidth() ) ); + bCancel->setCursor( QCursor( 0 ) ); + bCancel->setProperty( "stdItem", 26 ); + + ProgressLayout->addWidget( bCancel, 6, 2 ); + spacer1 = new QSpacerItem( 161, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + ProgressLayout->addMultiCell( spacer1, 6, 6, 0, 1 ); + + ProgressBar = new KProgress( this, "ProgressBar" ); + ProgressBar->setCursor( QCursor( 3 ) ); + + ProgressLayout->addMultiCellWidget( ProgressBar, 4, 4, 0, 2 ); + spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed ); + ProgressLayout->addItem( spacer2, 5, 1 ); + + image = new QLabel( this, "image" ); + image->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, image->sizePolicy().hasHeightForWidth() ) ); + image->setMinimumSize( QSize( 0, 250 ) ); + image->setPaletteBackgroundColor( QColor( 0, 0, 0 ) ); + image->setFrameShape( QLabel::NoFrame ); + image->setFrameShadow( QLabel::Plain ); + image->setAlignment( int( QLabel::AlignCenter ) ); + + ProgressLayout->addMultiCellWidget( image, 1, 1, 0, 2 ); + + textLabel1 = new QLabel( this, "textLabel1" ); + textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) ); + textLabel1->setCursor( QCursor( 3 ) ); + + ProgressLayout->addWidget( textLabel1, 2, 0 ); + + lblElapsed = new QLabel( this, "lblElapsed" ); + lblElapsed->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, lblElapsed->sizePolicy().hasHeightForWidth() ) ); + lblElapsed->setCursor( QCursor( 3 ) ); + + ProgressLayout->addMultiCellWidget( lblElapsed, 2, 2, 1, 2 ); + + LabelText = new QLabel( this, "LabelText" ); + LabelText->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, LabelText->sizePolicy().hasHeightForWidth() ) ); + QFont LabelText_font( LabelText->font() ); + LabelText_font.setItalic( TRUE ); + LabelText->setFont( LabelText_font ); + LabelText->setCursor( QCursor( 3 ) ); + LabelText->setAlignment( int( QLabel::AlignVCenter ) ); + + ProgressLayout->addMultiCellWidget( LabelText, 3, 3, 0, 2 ); + languageChange(); + resize( QSize(473, 467).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bCancel, SIGNAL( clicked() ), this, SLOT( bCancelClick() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +Progress::~Progress() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void Progress::languageChange() +{ + setCaption( tr2i18n( "k9Copy" ) ); + lblTitle->setText( QString::null ); + textLabel1->setText( tr2i18n( "Elapsed Time" ) ); + lblElapsed->setText( QString::null ); + LabelText->setText( QString::null ); +} + +void Progress::bCancelClick() +{ + qWarning( "Progress::bCancelClick(): Not implemented yet" ); +} + +#include "progress.moc" diff --git a/libk9copy/progress.ui b/libk9copy/progress.ui new file mode 100644 index 0000000..21ee06b --- /dev/null +++ b/libk9copy/progress.ui @@ -0,0 +1,245 @@ + +Progress + + + Progress + + + + 0 + 0 + 473 + 467 + + + + + 5 + 5 + 0 + 0 + + + + + 0 + 0 + + + + 3 + + + k9Copy + + + false + + + + unnamed + + + + lblTitle + + + + 5 + 0 + 0 + 0 + + + + + 1 + + + + 3 + + + + + + + + bCancel + + + + 0 + 0 + 0 + 0 + + + + 0 + + + 26 + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 161 + 21 + + + + + + ProgressBar + + + 3 + + + + + spacer2 + + + Vertical + + + Fixed + + + + 20 + 20 + + + + + + image + + + + 5 + 7 + 0 + 0 + + + + + 0 + 250 + + + + + 0 + 0 + 0 + + + + NoFrame + + + Plain + + + AlignCenter + + + + + textLabel1 + + + + 5 + 0 + 0 + 0 + + + + 3 + + + Elapsed Time + + + + + lblElapsed + + + + 5 + 0 + 0 + 0 + + + + 3 + + + + + + + + LabelText + + + + 5 + 0 + 0 + 0 + + + + + 1 + + + + 3 + + + + + + AlignVCenter + + + + + + + bCancel + clicked() + Progress + bCancelClick() + + + + bCancelClick() + + + + kpushbutton.h + kprogress.h + + diff --git a/po/Makefile.am b/po/Makefile.am new file mode 100644 index 0000000..2d58303 --- /dev/null +++ b/po/Makefile.am @@ -0,0 +1,4 @@ +POFILES = AUTO + +noinst_HEADERS = ca.po cs.po de.po el.po es.po es_AR.po fr.po it.po \ + pl.po pt_BR.po ru.po sr.po zh_TW.po tr.po sr@latin.po diff --git a/po/ca.po b/po/ca.po new file mode 100755 index 0000000..30a5c70 --- /dev/null +++ b/po/ca.po @@ -0,0 +1,1325 @@ +# translation of ca.po to Català +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Daniel Balagué Guardia , 2006. +msgid "" +msgstr "" +"Project-Id-Version: ca\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-03-31 23:50+0200\n" +"PO-Revision-Date: 2006-09-06 19:13+0200\n" +"Last-Translator: Daniel Balagué Guardia \n" +"Language-Team: Català \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.2\n" + +#: libk3bdevice/k3bdeviceglobals.cpp:30 libk3bdevice/k3bdeviceglobals.cpp:132 +msgid "CD-R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:32 libk3bdevice/k3bdeviceglobals.cpp:134 +msgid "CD-RW" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:34 libk3bdevice/k3bdeviceglobals.cpp:130 +msgid "CD-ROM" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:36 libk3bdevice/k3bdeviceglobals.cpp:101 +msgid "DVD-ROM" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:38 libk3bdevice/k3bdeviceglobals.cpp:115 +msgid "DVD-RAM" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:40 libk3bdevice/k3bdeviceglobals.cpp:104 +msgid "DVD-R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:42 libk3bdevice/k3bdeviceglobals.cpp:118 +msgid "DVD-RW" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:44 +msgid "DVD-R DL" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:46 libk3bdevice/k3bdeviceglobals.cpp:126 +msgid "DVD+R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:48 libk3bdevice/k3bdeviceglobals.cpp:124 +msgid "DVD+RW" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:50 +msgid "DVD+R DL" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:53 libk3bdevice/k3bdeviceglobals.cpp:137 +msgid "Error" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:63 +msgid "SAO" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:65 +msgid "TAO" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:67 +msgid "RAW" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:69 +msgid "SAO/R96P" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:71 +msgid "SAO/R96R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:73 +msgid "RAW/R16" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:75 +msgid "RAW/R96P" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:77 +msgid "RAW/R96R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:79 +msgid "Incremental Sequential" +msgstr "Seqüencia Incremental" + +#: libk3bdevice/k3bdeviceglobals.cpp:81 +msgid "Restricted Overwrite" +msgstr "Sobreescriptura Limitada" + +#: libk3bdevice/k3bdeviceglobals.cpp:83 +msgid "Layer Jump" +msgstr "Salt de capa" + +#: libk3bdevice/k3bdeviceglobals.cpp:86 +msgid "None" +msgstr "Cap" + +#: libk3bdevice/k3bdeviceglobals.cpp:95 libk9copy/k9dvd.cpp:254 +#: libk9copy/k9dvd.cpp:256 +msgid "Unknown" +msgstr "Desconegut" + +#: libk3bdevice/k3bdeviceglobals.cpp:99 +msgid "No media" +msgstr "No hi ha suport" + +#: libk3bdevice/k3bdeviceglobals.cpp:106 +msgid "DVD-R Sequential" +msgstr "DVD-R Seqüencial" + +#: libk3bdevice/k3bdeviceglobals.cpp:109 +msgid "DVD-R Dual Layer" +msgstr "DVD-R Doble Capa (Dual Layer)" + +#: libk3bdevice/k3bdeviceglobals.cpp:111 +msgid "DVD-R Dual Layer Sequential" +msgstr "DVD-R Doble Capa Seqüencial (Dual Layer Sequencial)" + +#: libk3bdevice/k3bdeviceglobals.cpp:113 +msgid "DVD-R Dual Layer Jump" +msgstr "DVD-R Doble Capa amb Salt (Dual Layer Jump)" + +#: libk3bdevice/k3bdeviceglobals.cpp:120 +msgid "DVD-RW Restricted Overwrite" +msgstr "DVD-RW Sobreescriptura limitada" + +#: libk3bdevice/k3bdeviceglobals.cpp:122 +msgid "DVD-RW Sequential" +msgstr "DVD-RW Seqüencial" + +#: libk3bdevice/k3bdeviceglobals.cpp:128 +msgid "DVD+R Double Layer" +msgstr "DVD+R Doble Capa (Double Layer)" + +#: src/k9copy.cpp:66 +msgid "Play title" +msgstr "Reprodueix títol" + +#: src/k9copy.cpp:73 +msgid "Copy" +msgstr "Copia" + +#: src/kburndvd.cpp:137 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - Còpia de seguretat de DVD" + +#: src/kburndvd.cpp:138 src/kburndvd.cpp:224 +msgid "Burning DVD" +msgstr "Gravant DVD" + +#: src/kburndvd.cpp:160 src/k9main.cpp:1092 src/k9mainw.cpp:324 +#: debug/src/k9mainw.cpp:324 rc.cpp:85 +#, no-c-format +msgid "default" +msgstr "Per defecte" + +#: src/kburndvd.cpp:166 src/k9main.cpp:316 +msgid "Save image to disk" +msgstr "Desa una imatge al disc" + +#: src/kburndvd.cpp:185 +msgid "Insert a recordable DVD" +msgstr "Itrodueix un DVD gravable" + +#: src/kburndvd.cpp:186 src/kburndvd.cpp:203 libk9copy/k9dvdauthor.cpp:109 +#: libk9copy/k9dvdauthor.cpp:249 libk9copy/k9dvdauthor.cpp:306 +#: libk9copy/k9dvdauthor.cpp:315 libk9copy/k9dvdauthor.cpp:318 +msgid "authoring" +msgstr "Creant menús" + +#: src/kburndvd.cpp:192 +msgid "Error burning DVD :\n" +msgstr "Error gravant el DVD :\n" + +#: src/kburndvd.cpp:192 src/kburndvd.cpp:196 +msgid "DVD burning" +msgstr "gravant DVD" + +#: src/kburndvd.cpp:196 +msgid "DVD Burning finished" +msgstr "Gravació del DVD finalitzada" + +#: src/kburndvd.cpp:202 +msgid "An error occured while Burning DVD: %1" +msgstr "Ha sorgit un error mentre es gravava el DVD" + +#: src/kburndvd.cpp:202 +msgid "Insert an other DVD" +msgstr "Introdueix un altre DVD" + +#: src/kburndvd.cpp:224 +msgid "Current write speed :%1 x" +msgstr "Velocitat d'escriptura actual :%1 x" + +#: src/kviewmpeg2.cpp:100 +msgid "Can't find device %1\n" +msgstr "No es pot trobar el dispositiu %1\n" + +#: src/kviewmpeg2.cpp:107 libk9copy/k9dvd.cpp:330 +msgid "Can't open disc %1!\n" +msgstr "No es pot obrir el disc %1!\n" + +#: src/kviewmpeg2.cpp:135 libk9copy/k9dvd.cpp:829 +msgid "Error opening vobs for title %1\n" +msgstr "Error carregant els VOBS del títol\n" + +#: src/kviewmpeg2.cpp:149 libk9copy/k9dvd.cpp:840 +msgid "ERROR reading block %1\n" +msgstr "ERROR llegint el bloc %1\n" + +#: src/main.cpp:29 +msgid "A DVD Backup tool for KDE" +msgstr "Eina per realitzar còpies de DVD pel KDE" + +#: src/main.cpp:35 +msgid "input device" +msgstr "Dispositiu d'entrada" + +#: src/main.cpp:36 +msgid "output device" +msgstr "Dispositiu de sortida" + +#: src/main.cpp:43 +msgid "k9copy" +msgstr "" + +#: src/main.cpp:46 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "Daniel Balagué Guardia" + +#: src/main.cpp:47 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "bullet@k-demar.org" + +#: src/k9main.cpp:309 +msgid "DVD is not opened" +msgstr "No hi ha cap DVD obert" + +#: src/k9main.cpp:309 src/k9main.cpp:322 +msgid "DVD Copy" +msgstr "Copia DVD" + +#: src/k9main.cpp:322 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"No hi ha prou espai a %1\n" +"Es necessiten %2 mb. (Si esteu segurs que teniu espai podeu continuar)" + +#: src/k9main.cpp:381 src/k9main.cpp:891 +msgid "ISO Image" +msgstr "Imatge ISO" + +#: src/k9main.cpp:417 +msgid "Open DVD" +msgstr "Obre DVD" + +#: src/k9main.cpp:436 +msgid "Titleset %1" +msgstr "Títol %1" + +#: src/k9main.cpp:522 +msgid "video %1 " +msgstr "" + +#: src/k9main.cpp:534 +msgid "audio %1 " +msgstr "àudio %1 " + +#: src/k9main.cpp:551 +msgid "subpicture %1 " +msgstr "Subtítol %1 " + +#: src/k9main.cpp:916 +msgid "Next title" +msgstr "Títol següent" + +#: src/k9main.cpp:1061 +msgid "Audio" +msgstr "Àudio" + +#: src/k9main.cpp:1072 +msgid "Subtitles" +msgstr "Subtítols" + +#: src/k9main.cpp:1100 +msgid "Open ISO Image" +msgstr "Obrir imatge ISO" + +#: src/k9main.cpp:1107 +msgid "Open DVD folder" +msgstr "Obrir directori del DVD" + +#: src/menupreview.cpp:1084 debug/src/menupreview.cpp:1084 rc.cpp:3 +#, no-c-format +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Previsualització del menú" + +#: src/menupreview.cpp:1085 src/configDlg.cpp:118 +#: debug/src/menupreview.cpp:1085 debug/src/configDlg.cpp:118 rc.cpp:6 +#: rc.cpp:99 +#, no-c-format +msgid "&OK" +msgstr "" + +#: src/viewmpeg2.cpp:631 debug/src/viewmpeg2.cpp:631 rc.cpp:10 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Previsualització del Títol" + +#: src/configDlg.cpp:62 src/configDlg.cpp:122 debug/src/configDlg.cpp:62 +#: debug/src/configDlg.cpp:122 rc.cpp:107 +#, no-c-format +msgid "device" +msgstr "Dispositiu" + +#: src/configDlg.cpp:64 src/configDlg.cpp:123 debug/src/configDlg.cpp:64 +#: debug/src/configDlg.cpp:123 rc.cpp:110 +#, no-c-format +msgid "label" +msgstr "etiqueta" + +#: src/configDlg.cpp:66 src/configDlg.cpp:124 debug/src/configDlg.cpp:66 +#: debug/src/configDlg.cpp:124 rc.cpp:113 +#, no-c-format +msgid "Input" +msgstr "Entrada" + +#: src/configDlg.cpp:68 src/configDlg.cpp:125 debug/src/configDlg.cpp:68 +#: debug/src/configDlg.cpp:125 rc.cpp:116 +#, no-c-format +msgid "Output" +msgstr "Sortida" + +#: src/configDlg.cpp:116 debug/src/configDlg.cpp:116 rc.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Dispositius" + +#: src/configDlg.cpp:117 debug/src/configDlg.cpp:117 rc.cpp:96 +#, no-c-format +msgid "

Devices not detected by k9copy

" +msgstr "

Dispositius no detectats per k9copy

" + +#: src/configDlg.cpp:120 libk9copy/progress.cpp:80 +#: debug/libk9copy/progress.cpp:79 debug/src/configDlg.cpp:120 rc.cpp:103 +#: rc.cpp:163 +#, no-c-format +msgid "&Cancel" +msgstr "&Cancel·la" + +#: src/configDlg.cpp:126 debug/src/configDlg.cpp:126 rc.cpp:119 +#, no-c-format +msgid "&Add" +msgstr "&Afegeix" + +#: src/configDlg.cpp:127 debug/src/configDlg.cpp:127 rc.cpp:122 +#, no-c-format +msgid "Alt+A" +msgstr "" + +#: src/configDlg.cpp:128 debug/src/configDlg.cpp:128 rc.cpp:125 +#, no-c-format +msgid "&Remove" +msgstr "&Elimina" + +#: src/configDlg.cpp:129 debug/src/configDlg.cpp:129 rc.cpp:128 +#, no-c-format +msgid "Alt+R" +msgstr "Alt+E" + +#: src/k9mainw.cpp:50 src/k9mainw.cpp:300 debug/src/k9mainw.cpp:50 +#: debug/src/k9mainw.cpp:300 rc.cpp:21 +#, no-c-format +msgid "Title" +msgstr "Títol" + +#: src/k9mainw.cpp:51 src/k9mainw.cpp:301 debug/src/k9mainw.cpp:51 +#: debug/src/k9mainw.cpp:301 rc.cpp:24 +#, no-c-format +msgid "Size" +msgstr "Mida" + +#: src/k9mainw.cpp:112 src/k9mainw.cpp:305 debug/src/k9mainw.cpp:112 +#: debug/src/k9mainw.cpp:305 rc.cpp:36 +#, no-c-format +msgid "Languages" +msgstr "Idiomes" + +#: src/k9mainw.cpp:299 debug/src/k9mainw.cpp:299 rc.cpp:15 +#, no-c-format +msgid "MainDlg" +msgstr "Quadre Principal" + +#: src/k9mainw.cpp:302 debug/src/k9mainw.cpp:302 rc.cpp:27 +#, no-c-format +msgid "At title end" +msgstr "Quan acabi segueix amb " + +#: src/k9mainw.cpp:303 debug/src/k9mainw.cpp:303 rc.cpp:30 +#, no-c-format +msgid "At start" +msgstr "Comença amb" + +#: src/k9mainw.cpp:304 debug/src/k9mainw.cpp:304 rc.cpp:33 +#, no-c-format +msgid "DVD playback options" +msgstr "Opcions de reproducció" + +#: src/k9mainw.cpp:306 debug/src/k9mainw.cpp:306 rc.cpp:39 +#, no-c-format +msgid "&Keep original menus" +msgstr "&Mantenir els menús originals" + +#: src/k9mainw.cpp:307 debug/src/k9mainw.cpp:307 rc.cpp:42 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+M" + +#: src/k9mainw.cpp:308 debug/src/k9mainw.cpp:308 rc.cpp:18 +#, no-c-format +msgid "D&VD" +msgstr "" + +#: src/k9mainw.cpp:310 debug/src/k9mainw.cpp:310 rc.cpp:49 +#, no-c-format +msgid "&Save" +msgstr "&Desa" + +#: src/k9mainw.cpp:311 debug/src/k9mainw.cpp:311 rc.cpp:52 +#, no-c-format +msgid "Alt+S" +msgstr "Alt+D" + +#: src/k9mainw.cpp:312 debug/src/k9mainw.cpp:312 rc.cpp:55 +#, no-c-format +msgid "Output directory" +msgstr "Directori de sortida" + +#: src/k9mainw.cpp:313 debug/src/k9mainw.cpp:313 rc.cpp:58 +#, no-c-format +msgid "DVD size" +msgstr "Mida del DVD" + +#: src/k9mainw.cpp:314 debug/src/k9mainw.cpp:314 rc.cpp:61 +#, no-c-format +msgid "Burn with k3b" +msgstr "Grava amb k3b" + +#: src/k9mainw.cpp:315 debug/src/k9mainw.cpp:315 rc.cpp:64 +#, no-c-format +msgid "Quick scan" +msgstr "Lectura ràpida" + +#: src/k9mainw.cpp:316 debug/src/k9mainw.cpp:316 rc.cpp:67 +#, no-c-format +msgid "Auto burn" +msgstr "Gravació automàtica" + +#: src/k9mainw.cpp:317 debug/src/k9mainw.cpp:317 rc.cpp:70 +#, no-c-format +msgid "mb" +msgstr "" + +#: src/k9mainw.cpp:318 debug/src/k9mainw.cpp:318 rc.cpp:45 +#, no-c-format +msgid "Se&ttings" +msgstr "Arran&jaments" + +#: src/k9mainw.cpp:319 debug/src/k9mainw.cpp:319 rc.cpp:73 +#, no-c-format +msgid "Output device " +msgstr "Dispositiu de sortida" + +#: src/k9mainw.cpp:320 debug/src/k9mainw.cpp:320 rc.cpp:76 +#, no-c-format +msgid "@" +msgstr "" + +#: src/k9mainw.cpp:321 debug/src/k9mainw.cpp:321 rc.cpp:79 +#, no-c-format +msgid "X" +msgstr "" + +#: src/k9mainw.cpp:322 debug/src/k9mainw.cpp:322 rc.cpp:82 +#, no-c-format +msgid "Input device " +msgstr "Dispositiu d'entrada" + +#: src/k9mainw.cpp:327 debug/src/k9mainw.cpp:327 rc.cpp:90 +#, no-c-format +msgid "..." +msgstr "" + +#: src/kviewmpeg2.moc.cpp:34 src/kviewmpeg2.moc.cpp:42 +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "kViewMPEG2" +msgstr "" + +#: src/k9copy.moc.cpp:34 src/k9copy.moc.cpp:42 libk9copy/progress.cpp:78 +#: debug/libk9copy/progress.cpp:77 debug/src/k9copy.moc.cpp:34 +#: debug/src/k9copy.moc.cpp:42 rc.cpp:159 +#, no-c-format +msgid "k9Copy" +msgstr "" + +#: src/k9main.moc.cpp:34 src/k9main.moc.cpp:42 debug/src/k9main.moc.cpp:34 +#: debug/src/k9main.moc.cpp:42 +msgid "k9DVDListItem" +msgstr "" + +#: src/k9main.moc.cpp:107 src/k9main.moc.cpp:115 debug/src/k9main.moc.cpp:107 +#: debug/src/k9main.moc.cpp:115 +msgid "k9Main" +msgstr "" + +#: src/kcddrive.moc.cpp:34 src/kcddrive.moc.cpp:42 +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "" + +#: src/kcddrive.moc.cpp:107 src/kcddrive.moc.cpp:115 +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "" + +#: libk9copy/k9dvdauthor.cpp:108 libk9copy/k9dvdauthor.cpp:248 +msgid "'%1' not selected" +msgstr "No està seleccionat '%1'" + +#: libk9copy/k9dvdauthor.cpp:276 +msgid "Authoring" +msgstr "Creant menús" + +#: libk9copy/k9dvdauthor.cpp:306 +msgid "Dvdauthor error :\n" +msgstr "Error de Dvdauthor:\n" + +#: libk9copy/k9dvdauthor.cpp:315 +msgid "Authoring cancelled" +msgstr "Creació de menús cancel·lada" + +#: libk9copy/k9dvdauthor.cpp:318 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Ha sorgit un error mentre s'executava DVDAuthor:\n" + +#: libk9copy/k9dvdbackup.cpp:135 libk9copy/k9dvdbackup.cpp:149 +#: libk9copy/k9dvdbackup.cpp:486 libk9copy/k9dvdbackup.cpp:643 +msgid "DVD backup cancelled" +msgstr "Còpia de seguretat del DVD cancel·lada" + +#: libk9copy/k9dvdbackup.cpp:162 +msgid "unable to open VIDEO_TS.IFO" +msgstr "No és possible obrir VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:184 libk9copy/k9dvdbackup.cpp:360 +#: libk9copy/k9dvdbackup.cpp:424 +msgid "Unable to open file " +msgstr "No és possible obrir el fitxer" + +#: libk9copy/k9dvdbackup.cpp:253 +msgid "Unable to open titleset %1" +msgstr "No és possible obrir el Títol %1" + +#: libk9copy/k9dvdbackup.cpp:259 libk9copy/k9dvdbackup.cpp:615 +msgid "Extracting titleset %1" +msgstr "Extraient el títol %1" + +#: libk9copy/k9dvdbackup.cpp:431 libk9copy/k9dvdbackup.cpp:559 +msgid "Unable to open menu for titleset %1" +msgstr "No és possible obrir el menú del títol %1" + +#: libk9copy/k9dvdbackup.cpp:453 libk9copy/k9dvdbackup.cpp:566 +msgid "Extracting menu for titleset %1" +msgstr "Extraient menú pel títol %1" + +#: libk9copy/k9dvdbackup.cpp:552 +msgid "Unable to open " +msgstr "No és possible obrir" + +#: libk9copy/k9dvdbackup.cpp:607 +msgid "Unable to open ifo file for titleset %1" +msgstr "No és possible obrir el fitxer IFO pel títol %1" + +#: libk9copy/k9dvdbackup.cpp:619 libk9copy/k9dvdbackup.cpp:1420 +msgid "Unable to open DVD" +msgstr "No és possible obrir el DVD" + +#: libk9copy/k9dvdbackup.cpp:629 +msgid "Unable to open vobs for titleset %1" +msgstr "No és possible obrir els VOBS pel títol %1" + +#: libk9copy/k9dvdbackup.cpp:1151 +msgid "Updating vob %1" +msgstr "Actualitzant vob %1" + +#: libk9copy/k9dvdbackup.cpp:1167 +msgid "DVD backup canceled" +msgstr "Còpia de seguretat del DVD cancel·lada" + +#: libk9copy/k9dvd.cpp:192 +msgid "Couldn't open %1 for title\n" +msgstr "No es pot obrir %1 pel títol\n" + +#: libk9copy/k9dvd.cpp:200 +msgid "Couldn't seek in %1 for title\n" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Not Specified" +msgstr "Cap especificació" + +#: libk9copy/k9dvd.cpp:227 +msgid "Afar" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Abkhazian" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Afrikaans" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Amharic" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Arabic" +msgstr "Àrab" + +#: libk9copy/k9dvd.cpp:228 +msgid "Assamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Aymara" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Azerbaijani" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bashkir" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Byelorussian" +msgstr "Bielorús" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bulgarian" +msgstr "Búlgar" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bihari" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bislama" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bengali; Bangla" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Tibetan" +msgstr "Tibetà" + +#: libk9copy/k9dvd.cpp:230 +msgid "Breton" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Catalan" +msgstr "Català" + +#: libk9copy/k9dvd.cpp:230 +msgid "Corsican" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Czech" +msgstr "Txec" + +#: libk9copy/k9dvd.cpp:231 +msgid "Welsh" +msgstr "Gal" + +#: libk9copy/k9dvd.cpp:231 +msgid "Dansk" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Deutsch" +msgstr "Alemany" + +#: libk9copy/k9dvd.cpp:231 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Greek" +msgstr "Grec" + +#: libk9copy/k9dvd.cpp:231 +msgid "English" +msgstr "Anglès" + +#: libk9copy/k9dvd.cpp:232 +msgid "Esperanto" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Espanol" +msgstr "Castellà" + +#: libk9copy/k9dvd.cpp:232 +msgid "Estonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Basque" +msgstr "Basc" + +#: libk9copy/k9dvd.cpp:232 +msgid "Persian" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Suomi" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Fiji" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Faroese" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Francais" +msgstr "Francès" + +#: libk9copy/k9dvd.cpp:233 +msgid "Frisian" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Gaelic" +msgstr "Gaèlic" + +#: libk9copy/k9dvd.cpp:234 +msgid "Scots Gaelic" +msgstr "Gaèlic escocès" + +#: libk9copy/k9dvd.cpp:234 +msgid "Galician" +msgstr "Gallec" + +#: libk9copy/k9dvd.cpp:234 +msgid "Guarani" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Gujarati" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hausa" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:237 +msgid "Hebrew" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Hindi" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Hrvatski" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Magyar" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Armenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Interlingua" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Indonesian" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Interlingue" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Italiano" +msgstr "Italià" + +#: libk9copy/k9dvd.cpp:237 +msgid "Inuktitut" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Japanese" +msgstr "Japonès" + +#: libk9copy/k9dvd.cpp:238 libk9copy/k9dvd.cpp:253 +msgid "Yiddish" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Javanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Georgian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kazakh" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Greenlandic" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Cambodian" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kannada" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Korean" +msgstr "Coreà" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kashmiri" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kurdish" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Kirghiz" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Latin" +msgstr "Llatí" + +#: libk9copy/k9dvd.cpp:240 +msgid "Lingala" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Lithuanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Maori" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Macedonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Mongolian" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Moldavian" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Nepali" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Nederlands" +msgstr "Holandès" + +#: libk9copy/k9dvd.cpp:243 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Occitan" +msgstr "Occità" + +#: libk9copy/k9dvd.cpp:244 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Polish" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Portugues" +msgstr "Portuguès" + +#: libk9copy/k9dvd.cpp:245 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Romanian" +msgstr "Romanès" + +#: libk9copy/k9dvd.cpp:246 +msgid "Russian" +msgstr "Rús" + +#: libk9copy/k9dvd.cpp:246 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Serbo-Croatian" +msgstr "Serbocroat" + +#: libk9copy/k9dvd.cpp:247 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Slovak" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Slovenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Albanian" +msgstr "Albanès" + +#: libk9copy/k9dvd.cpp:248 +msgid "Serbian" +msgstr "Serbi" + +#: libk9copy/k9dvd.cpp:248 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tamil" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Thai" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Turkish" +msgstr "Turc" + +#: libk9copy/k9dvd.cpp:251 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Ukrainian" +msgstr "Ucraïnès" + +#: libk9copy/k9dvd.cpp:252 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Vietnamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:254 +msgid "Chinese" +msgstr "Xinès" + +#: libk9copy/k9dvd.cpp:254 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:340 +msgid "Can't open main ifo!\n" +msgstr "No es pot obrir l'IFO principal!\n" + +#: libk9copy/k9dvd.cpp:355 +msgid "unknown" +msgstr "Desconegut" + +#: libk9copy/k9dvd.cpp:379 libk9copy/k9dvd.cpp:656 +msgid "Title %1" +msgstr "Títol %1" + +#: libk9copy/k9dvd.cpp:704 +msgid "reading title" +msgstr "Llegint el títol" + +#: libk9copy/backupdlg.cpp:150 debug/libk9copy/backupdlg.cpp:150 rc.cpp:131 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Progressió de la còpia de seguretat" + +#: libk9copy/backupdlg.cpp:151 debug/libk9copy/backupdlg.cpp:151 rc.cpp:134 +#, no-c-format +msgid "A&bort" +msgstr "A&vortar" + +#: libk9copy/backupdlg.cpp:152 debug/libk9copy/backupdlg.cpp:152 rc.cpp:137 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+V" + +#: libk9copy/backupdlg.cpp:153 debug/libk9copy/backupdlg.cpp:153 rc.cpp:140 +#, no-c-format +msgid "--:--:--" +msgstr "" + +#: libk9copy/backupdlg.cpp:154 debug/libk9copy/backupdlg.cpp:154 rc.cpp:143 +#, no-c-format +msgid "Current step" +msgstr "Pas actual" + +#: libk9copy/backupdlg.cpp:155 debug/libk9copy/backupdlg.cpp:155 rc.cpp:146 +#, no-c-format +msgid "Elapsed Time" +msgstr "Temps transcorregut" + +#: libk9copy/backupdlg.cpp:156 debug/libk9copy/backupdlg.cpp:156 rc.cpp:149 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

Còpia de seguretat de DVD

" + +#: libk9copy/dvdprogress.cpp:86 debug/libk9copy/dvdprogress.cpp:86 rc.cpp:153 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - Anàlisi del DVD" + +#: libk9copy/progress.cpp:81 debug/libk9copy/progress.cpp:80 rc.cpp:166 +#, no-c-format +msgid "Alt+C" +msgstr "" + +#: libk9copy/k9dvdprogress.moc.cpp:34 libk9copy/k9dvdprogress.moc.cpp:42 +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "" + +#: libk9copy/k9dvdauthor.moc.cpp:34 libk9copy/k9dvdauthor.moc.cpp:42 +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "" + +#: libk9copy/k9dvdsize.moc.cpp:34 libk9copy/k9dvdsize.moc.cpp:42 +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:34 libk9copy/k9dvdtitle.moc.cpp:42 +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:107 libk9copy/k9dvdtitle.moc.cpp:115 +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:180 libk9copy/k9dvdtitle.moc.cpp:188 +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDVideoStream" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:253 libk9copy/k9dvdtitle.moc.cpp:261 +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDAudioStream" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:326 libk9copy/k9dvdtitle.moc.cpp:334 +#: debug/libk9copy/k9dvdtitle.moc.cpp:326 +#: debug/libk9copy/k9dvdtitle.moc.cpp:334 +msgid "k9DVDSubtitle" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:399 libk9copy/k9dvdtitle.moc.cpp:407 +#: debug/libk9copy/k9dvdtitle.moc.cpp:399 +#: debug/libk9copy/k9dvdtitle.moc.cpp:407 +msgid "k9DVDTitle" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:472 libk9copy/k9dvdtitle.moc.cpp:480 +#: debug/libk9copy/k9dvdtitle.moc.cpp:472 +#: debug/libk9copy/k9dvdtitle.moc.cpp:480 +msgid "k9DVDTitleset" +msgstr "" + +#: libk9copy/k9dvd.moc.cpp:34 libk9copy/k9dvd.moc.cpp:42 +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "" + +#: k9decmpeg/kdecmpeg2.moc.cpp:34 k9decmpeg/kdecmpeg2.moc.cpp:42 +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "" + +#: rc.cpp:169 +#, no-c-format +msgid "A&ctions" +msgstr "A&ccions" + +#: rc.cpp:172 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Barra d'accions" + diff --git a/po/cs.po b/po/cs.po new file mode 100644 index 0000000..7035da3 --- /dev/null +++ b/po/cs.po @@ -0,0 +1,1511 @@ +# translation of cs.po to czech +# translation of k9copy.po to czech +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER, 2005. +# ZdenÄ›k Å tÄ›pánek , 2006 +msgid "" +msgstr "" +"Project-Id-Version: k9copy\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-06-21 09:09+0200\n" +"PO-Revision-Date: 2007-10-17 09:40+0100\n" +"Last-Translator: ZdenÄ›k Å tÄ›pánek \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.10.2\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: libk3bdevice/k3bdeviceglobals.cpp:30 libk3bdevice/k3bdeviceglobals.cpp:132 +#: libk3bdevice.new/k3bdeviceglobals.cpp:30 +#: libk3bdevice.new/k3bdeviceglobals.cpp:132 +msgid "CD-R" +msgstr "CD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:32 libk3bdevice/k3bdeviceglobals.cpp:134 +#: libk3bdevice.new/k3bdeviceglobals.cpp:32 +#: libk3bdevice.new/k3bdeviceglobals.cpp:134 +msgid "CD-RW" +msgstr "CD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:34 libk3bdevice/k3bdeviceglobals.cpp:130 +#: libk3bdevice.new/k3bdeviceglobals.cpp:34 +#: libk3bdevice.new/k3bdeviceglobals.cpp:130 +msgid "CD-ROM" +msgstr "CD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:36 libk3bdevice/k3bdeviceglobals.cpp:101 +#: libk3bdevice.new/k3bdeviceglobals.cpp:36 +#: libk3bdevice.new/k3bdeviceglobals.cpp:101 +msgid "DVD-ROM" +msgstr "DVD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:38 libk3bdevice/k3bdeviceglobals.cpp:115 +#: libk3bdevice.new/k3bdeviceglobals.cpp:38 +#: libk3bdevice.new/k3bdeviceglobals.cpp:115 +msgid "DVD-RAM" +msgstr "DVD-RAM" + +#: libk3bdevice/k3bdeviceglobals.cpp:40 libk3bdevice/k3bdeviceglobals.cpp:104 +#: libk3bdevice.new/k3bdeviceglobals.cpp:40 +#: libk3bdevice.new/k3bdeviceglobals.cpp:104 +msgid "DVD-R" +msgstr "DVD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:42 libk3bdevice/k3bdeviceglobals.cpp:118 +#: libk3bdevice.new/k3bdeviceglobals.cpp:42 +#: libk3bdevice.new/k3bdeviceglobals.cpp:118 +msgid "DVD-RW" +msgstr "DVD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:44 +#: libk3bdevice.new/k3bdeviceglobals.cpp:44 +msgid "DVD-R DL" +msgstr "DVD-R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:46 libk3bdevice/k3bdeviceglobals.cpp:126 +#: libk3bdevice.new/k3bdeviceglobals.cpp:46 +#: libk3bdevice.new/k3bdeviceglobals.cpp:126 +msgid "DVD+R" +msgstr "DVD+R" + +#: libk3bdevice/k3bdeviceglobals.cpp:48 libk3bdevice/k3bdeviceglobals.cpp:124 +#: libk3bdevice.new/k3bdeviceglobals.cpp:48 +#: libk3bdevice.new/k3bdeviceglobals.cpp:124 +msgid "DVD+RW" +msgstr "DVD+RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:50 +#: libk3bdevice.new/k3bdeviceglobals.cpp:50 +msgid "DVD+R DL" +msgstr "DVD+R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:63 +#: libk3bdevice.new/k3bdeviceglobals.cpp:63 +msgid "SAO" +msgstr "SAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:65 +#: libk3bdevice.new/k3bdeviceglobals.cpp:65 +msgid "TAO" +msgstr "TAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:67 +#: libk3bdevice.new/k3bdeviceglobals.cpp:67 +msgid "RAW" +msgstr "RAW" + +#: libk3bdevice/k3bdeviceglobals.cpp:69 +#: libk3bdevice.new/k3bdeviceglobals.cpp:69 +msgid "SAO/R96P" +msgstr "SAO/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:71 +#: libk3bdevice.new/k3bdeviceglobals.cpp:71 +msgid "SAO/R96R" +msgstr "SAO/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:73 +#: libk3bdevice.new/k3bdeviceglobals.cpp:73 +msgid "RAW/R16" +msgstr "RAW/R16" + +#: libk3bdevice/k3bdeviceglobals.cpp:75 +#: libk3bdevice.new/k3bdeviceglobals.cpp:75 +msgid "RAW/R96P" +msgstr "RAW/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:77 +#: libk3bdevice.new/k3bdeviceglobals.cpp:77 +msgid "RAW/R96R" +msgstr "RAW/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:79 +#: libk3bdevice.new/k3bdeviceglobals.cpp:79 +msgid "Incremental Sequential" +msgstr "PostupnÄ› sekvenÄní" + +#: libk3bdevice/k3bdeviceglobals.cpp:81 +#: libk3bdevice.new/k3bdeviceglobals.cpp:81 +msgid "Restricted Overwrite" +msgstr "Omezený pÅ™epis" + +#: libk3bdevice/k3bdeviceglobals.cpp:83 +#: libk3bdevice.new/k3bdeviceglobals.cpp:83 +msgid "Layer Jump" +msgstr "Skok na vrstvu" + +#: libk3bdevice/k3bdeviceglobals.cpp:86 +#: libk3bdevice.new/k3bdeviceglobals.cpp:86 +msgid "None" +msgstr "Žádný" + +#: libk3bdevice/k3bdeviceglobals.cpp:95 libk9copy/k9dvd.cpp:253 +#: libk9copy/k9dvd.cpp:255 libk3bdevice.new/k3bdeviceglobals.cpp:95 +msgid "Unknown" +msgstr "Neznámý" + +#: libk3bdevice/k3bdeviceglobals.cpp:99 +#: libk3bdevice.new/k3bdeviceglobals.cpp:99 +msgid "No media" +msgstr "Žádné médium" + +#: libk3bdevice/k3bdeviceglobals.cpp:106 +#: libk3bdevice.new/k3bdeviceglobals.cpp:106 +msgid "DVD-R Sequential" +msgstr "DVD-R sekvenÄní" + +#: libk3bdevice/k3bdeviceglobals.cpp:109 +#: libk3bdevice.new/k3bdeviceglobals.cpp:109 +msgid "DVD-R Dual Layer" +msgstr "DVD-R dvouvrstvé" + +#: libk3bdevice/k3bdeviceglobals.cpp:111 +#: libk3bdevice.new/k3bdeviceglobals.cpp:111 +msgid "DVD-R Dual Layer Sequential" +msgstr "DVD-R dvouvrstvé sekvenÄní" + +#: libk3bdevice/k3bdeviceglobals.cpp:113 +#: libk3bdevice.new/k3bdeviceglobals.cpp:113 +msgid "DVD-R Dual Layer Jump" +msgstr "DVD-R dvouvrstvé skokové" + +#: libk3bdevice/k3bdeviceglobals.cpp:120 +#: libk3bdevice.new/k3bdeviceglobals.cpp:120 +msgid "DVD-RW Restricted Overwrite" +msgstr "DVD-RW omezený zápis" + +#: libk3bdevice/k3bdeviceglobals.cpp:122 +#: libk3bdevice.new/k3bdeviceglobals.cpp:122 +msgid "DVD-RW Sequential" +msgstr "DVD-RW sekvenÄní" + +#: libk3bdevice/k3bdeviceglobals.cpp:128 +#: libk3bdevice.new/k3bdeviceglobals.cpp:128 +msgid "DVD+R Double Layer" +msgstr "DVD+R dvouvrstvé" + +#: src/k9copy.cpp:66 +msgid "Play title" +msgstr "PÅ™ehrát stopu" + +#: src/k9copy.cpp:80 +msgid "Create MPEG-4" +msgstr "VytvoÅ™it MPEG-4" + +#: src/k9copy.cpp:94 +msgid "Settings" +msgstr "Nastavení" + +#: src/kviewmpeg2.cpp:100 +msgid "Can't find device %1\n" +msgstr "Nelze nalézt zařízení %1\n" + +#: src/kviewmpeg2.cpp:107 libk9copy/k9dvd.cpp:339 +msgid "Can't open disc %1!\n" +msgstr "Nelze otevřít disk %1!\n" + +#: src/kviewmpeg2.cpp:135 libk9copy/k9dvd.cpp:848 +msgid "Error opening vobs for title %1\n" +msgstr "Nemohu otevřít VOBy pro stopu %1\n" + +#: src/kviewmpeg2.cpp:149 libk9copy/k9dvd.cpp:859 +msgid "ERROR reading block %1\n" +msgstr "Chyba pÅ™i Ätení bloku %1\n" + +#: src/main.cpp:30 +msgid "A DVD Backup tool for KDE" +msgstr "ZálohovaÄ DVD pro prostÅ™edí KDE" + +#: src/main.cpp:35 +msgid "input device" +msgstr "vstupní zařízení" + +#: src/main.cpp:37 +msgid "output device" +msgstr "výstupní zařízení" + +#: src/main.cpp:38 +msgid "title to play" +msgstr "stopa k pÅ™ehrání" + +#: src/main.cpp:39 +msgid "play title to stdout" +msgstr "pÅ™ehrát stopu na stdout" + +#: src/main.cpp:40 +msgid "start sector" +msgstr "start sektor" + +#: src/main.cpp:41 +msgid "end sector" +msgstr "stop sektor" + +#: src/main.cpp:42 +msgid "list of audio streams" +msgstr "seznam audio proudů" + +#: src/main.cpp:43 +msgid "list of spu streams" +msgstr "seznam spu proudů" + +#: src/main.cpp:44 +msgid "shrink factor" +msgstr "kompresní faktor" + +#: src/main.cpp:45 +msgid "size of the cell to be copied" +msgstr "velikost buňky ke kopírování" + +#: src/main.cpp:46 +msgid "total size of selected titles" +msgstr "celková velikost vybraných stop" + +#: src/main.cpp:47 +msgid "size of the chapters being copied" +msgstr "velikost kapitol ke kopírování" + +#: src/main.cpp:48 +msgid "new dvd size" +msgstr "nová velikost DVD" + +#: src/main.cpp:49 +msgid "selected chapter" +msgstr "vybrané kapitoly" + +#: src/main.cpp:50 +msgid "cell number in selected chapter" +msgstr "Äíslo buňky ve vybrané kapitole" + +#: src/main.cpp:51 +msgid "status file name" +msgstr "status - jméno souboru" + +#: src/main.cpp:52 +msgid "initialize status file" +msgstr "iicializovat status soubor" + +#: src/main.cpp:53 +msgid "continue playing from last sector" +msgstr "pokraÄovat v pÅ™ehrávání od posledního sektoru" + +#: src/main.cpp:62 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:65 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "ZdenÄ›k Å tÄ›pánek" + +#: src/main.cpp:66 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "zdenek@gavanet.org" + +#: src/k9main.cpp:315 src/k9main.cpp:919 +msgid "DVD is not opened" +msgstr "DVD není otevÅ™eno" + +#: src/k9main.cpp:315 src/k9main.cpp:328 +msgid "DVD Copy" +msgstr "Kopírování DVD" + +#: src/k9main.cpp:322 libk9copy/k9burndvd.cpp:173 +msgid "Save image to disk" +msgstr "Uložit obraz na disk" + +#: src/k9main.cpp:328 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "Nedostatek místa na %1\n." +"Je potÅ™eba %2 mb." + +#: src/k9main.cpp:385 src/k9main.cpp:951 +msgid "ISO Image" +msgstr "ISO obraz" + +#: src/k9main.cpp:422 +msgid "Open DVD" +msgstr "Otevřít DVD" + +#: src/k9main.cpp:441 +msgid "Titleset %1" +msgstr "Seznam stop %1" + +#: src/k9main.cpp:514 +msgid "video %1 " +msgstr "video %1 " + +#: src/k9main.cpp:526 +msgid "audio %1 " +msgstr "zvuk %1 " + +#: src/k9main.cpp:543 +msgid "subpicture %1 " +msgstr "subpicture %1 " + +#: src/k9main.cpp:919 src/k9settings.cpp:40 libk9copy/k9mp4enc.cpp:195 +msgid "MPEG-4 Encoding" +msgstr "MPEG-4 Kódování" + +#: src/k9main.cpp:1091 debug/src/k9mainw.cpp:304 debug/src/prefMencoder.cpp:37 +#: debug/src/prefMencoder.cpp:87 rc.cpp:50 rc.cpp:161 +#, no-c-format +msgid "Audio" +msgstr "Zvuk" + +#: src/k9main.cpp:1102 +msgid "Subtitles" +msgstr "Titulky" + +#: src/k9main.cpp:1123 src/k9main.cpp:1245 libk9copy/k9burndvd.cpp:167 +#: debug/src/k9mainw.cpp:296 rc.cpp:20 +#, no-c-format +msgid "default" +msgstr "výchozí" + +#: src/k9main.cpp:1131 +msgid "Open ISO Image" +msgstr "Otevřít ISO obraz" + +#: src/k9main.cpp:1138 +msgid "Open DVD folder" +msgstr "Otevřít adresář DVD" + +#: src/k9main.cpp:1247 +msgid "none" +msgstr "žádný" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "Zařízení" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "Zařízení nebylo detekováno prostÅ™ednictvím k9Copy" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 +msgid "DVD Backup" +msgstr "DVD Záloha" + +#: src/k9settings.cpp:40 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:46 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:46 +msgid "MPEG-4 Codecs" +msgstr "MPEG-4 Kodeky" + +#: src/k9prefmpeg4.cpp:33 src/k9prefdvd.cpp:33 libk9copy/k9mp4enc.cpp:94 +msgid "mb" +msgstr "mb" + +#: src/menupreview.cpp:1084 debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Náhled menu" + +#: libk9copy/k9dvdauthor.cpp:107 libk9copy/k9dvdauthor.cpp:294 +msgid "'%1' not selected" +msgstr "'%1' není vybrán" + +#: libk9copy/k9dvdauthor.cpp:108 libk9copy/k9dvdauthor.cpp:295 +#: libk9copy/k9dvdauthor.cpp:355 libk9copy/k9dvdauthor.cpp:364 +#: libk9copy/k9dvdauthor.cpp:367 libk9copy/k9burndvd.cpp:193 +#: libk9copy/k9burndvd.cpp:210 +msgid "authoring" +msgstr "tvorba DVD" + +#: libk9copy/k9dvdauthor.cpp:325 libk9copy/k9dvdauthor.cpp:391 +#: libk9copy/k9dvdauthor.cpp:429 +msgid "Authoring" +msgstr "Tvorba DVD" + +#: libk9copy/k9dvdauthor.cpp:326 debug/libk9copy/backupdlg.cpp:162 rc.cpp:172 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - PrůbÄ›h zálohování" + +#: libk9copy/k9dvdauthor.cpp:355 +msgid "Dvdauthor error :\n" +msgstr "Chyba dvdauthor :\n" + +#: libk9copy/k9dvdauthor.cpp:364 +msgid "Authoring cancelled" +msgstr "Tvorba DVD zruÅ¡ena" + +#: libk9copy/k9dvdauthor.cpp:367 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Chyba ve spuÅ¡tÄ›ném DVDAuthor:\n" + +#: libk9copy/k9dvdauthor.cpp:430 +msgid "Fixing VOBUS" +msgstr "Fixuji VOBUS" + +#: libk9copy/k9dvdbackup.cpp:137 libk9copy/k9dvdbackup.cpp:151 +#: libk9copy/k9dvdbackup.cpp:491 libk9copy/k9dvdbackup.cpp:648 +msgid "DVD backup cancelled" +msgstr "Zálohování DVD zruÅ¡eno" + +#: libk9copy/k9dvdbackup.cpp:164 +msgid "unable to open VIDEO_TS.IFO" +msgstr "nelze otevřít VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:186 libk9copy/k9dvdbackup.cpp:364 +#: libk9copy/k9dvdbackup.cpp:429 +msgid "Unable to open file " +msgstr "Nelze otevřít soubor" + +#: libk9copy/k9dvdbackup.cpp:257 +msgid "Unable to open titleset %1" +msgstr "Nelze otevřít seznam stop %1" + +#: libk9copy/k9dvdbackup.cpp:263 libk9copy/k9dvdbackup.cpp:620 +msgid "Extracting titleset %1" +msgstr "Extrahuji seznam stop %1" + +#: libk9copy/k9dvdbackup.cpp:436 libk9copy/k9dvdbackup.cpp:564 +msgid "Unable to open menu for titleset %1" +msgstr "Nelze otevřít menu pro seznam stop %1" + +#: libk9copy/k9dvdbackup.cpp:458 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting menu for titleset %1" +msgstr "Extrahuji menu pro seznam stop %1" + +#: libk9copy/k9dvdbackup.cpp:557 +msgid "Unable to open " +msgstr "Nelze otevřít" + +#: libk9copy/k9dvdbackup.cpp:612 +msgid "Unable to open ifo file for titleset %1" +msgstr "Nelze otevřít \"ifo\" soubor pro seznam stop %1" + +#: libk9copy/k9dvdbackup.cpp:624 libk9copy/k9dvdbackup.cpp:1595 +msgid "Unable to open DVD" +msgstr "Nelze otevřít DVD" + +#: libk9copy/k9dvdbackup.cpp:634 +msgid "Unable to open vobs for titleset %1" +msgstr "Nelze otevřít voby pro seznam stop %1" + +#: libk9copy/k9dvdbackup.cpp:1318 +msgid "Updating vob %1" +msgstr "Aktualizuji vob %1" + +#: libk9copy/k9dvdbackup.cpp:1334 +msgid "DVD backup canceled" +msgstr "Zálohování DVD zruÅ¡eno" + +#: libk9copy/k9dvd.cpp:191 +msgid "Couldn't open %1 for title\n" +msgstr "Nelze otevřít %1 pro stopu\n" + +#: libk9copy/k9dvd.cpp:199 +msgid "Couldn't seek in %1 for title\n" +msgstr "Nelze vyhledat stopu v %1\n" + +#: libk9copy/k9dvd.cpp:226 +msgid "Not Specified" +msgstr "Není specifikováno" + +#: libk9copy/k9dvd.cpp:226 +msgid "Afar" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Abkhazian" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Afrikaans" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Amharic" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Arabic" +msgstr "ArabÅ¡tina" + +#: libk9copy/k9dvd.cpp:227 +msgid "Assamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Aymara" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Azerbaijani" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Bashkir" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Byelorussian" +msgstr "BÄ›loruÅ¡tina" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bulgarian" +msgstr "BulharÅ¡tina" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bihari" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bislama" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bengali; Bangla" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Tibetan" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Breton" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Catalan" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Corsican" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Czech" +msgstr "ÄŒeÅ¡tina" + +#: libk9copy/k9dvd.cpp:230 +msgid "Welsh" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Dansk" +msgstr "DánÅ¡tina" + +#: libk9copy/k9dvd.cpp:230 +msgid "Deutsch" +msgstr "NÄ›mÄina" + +#: libk9copy/k9dvd.cpp:230 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Greek" +msgstr "ŘeÄtina" + +#: libk9copy/k9dvd.cpp:230 +msgid "English" +msgstr "AngliÄtina" + +#: libk9copy/k9dvd.cpp:231 +msgid "Esperanto" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Espanol" +msgstr "Å panÄ›lÅ¡tina" + +#: libk9copy/k9dvd.cpp:231 +msgid "Estonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Basque" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Persian" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Suomi" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Fiji" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Faroese" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Francais" +msgstr "Francoužština" + +#: libk9copy/k9dvd.cpp:232 +msgid "Frisian" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Gaelic" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Scots Gaelic" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Galician" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Guarani" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Gujarati" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Hausa" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 libk9copy/k9dvd.cpp:236 +msgid "Hebrew" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hindi" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hrvatski" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Magyar" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Armenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Interlingua" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Indonesian" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Interlingue" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Italiano" +msgstr "ItalÅ¡tina" + +#: libk9copy/k9dvd.cpp:236 +msgid "Inuktitut" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Japanese" +msgstr "JaponÅ¡tina" + +#: libk9copy/k9dvd.cpp:237 libk9copy/k9dvd.cpp:252 +msgid "Yiddish" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Javanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Georgian" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kazakh" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Greenlandic" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Cambodian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kannada" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Korean" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kashmiri" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kurdish" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kirghiz" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Latin" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Lingala" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Lithuanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Maori" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Macedonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Mongolian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Moldavian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nepali" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nederlands" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Occitan" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Polish" +msgstr "PolÅ¡tina" + +#: libk9copy/k9dvd.cpp:243 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Portugues" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Romanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Russian" +msgstr "RuÅ¡tina" + +#: libk9copy/k9dvd.cpp:245 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Serbo-Croatian" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Slovak" +msgstr "SlovÄ›nÅ¡tina" + +#: libk9copy/k9dvd.cpp:246 +msgid "Slovenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Albanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Serbian" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tamil" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Thai" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Turkish" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Ukrainian" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Vietnamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Chinese" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:349 +msgid "Can't open main ifo!\n" +msgstr "Nelze otevřít hlavní \"ifo\"!\n" + +#: libk9copy/k9dvd.cpp:364 +msgid "unknown" +msgstr "není známo" + +#: libk9copy/k9dvd.cpp:388 libk9copy/k9dvd.cpp:675 +msgid "Title %1" +msgstr "Stopa %1" + +#: libk9copy/k9dvd.cpp:723 +msgid "reading title" +msgstr "Ätení stopy" + +#: libk9copy/k9mp4enc.cpp:84 +msgid "Save file to disk" +msgstr "Uložit soubor na disk" + +#: libk9copy/k9mp4enc.cpp:124 libk9copy/k9mp4enc.cpp:131 +#: libk9copy/k9mp4enc.cpp:149 +msgid "Encoding %1" +msgstr "Kóduji %1" + +#: libk9copy/k9mp4enc.cpp:195 +msgid "MPEG-4 Encoding cancelled" +msgstr "Kódování MPEG-4 zruÅ¡eno" + +#: libk9copy/k9mp4enc.cpp:198 +msgid "Error while running mencoder :" +msgstr "Chyba ve spuÅ¡tÄ›ném mencoderu :" + +#: libk9copy/k9mp4enc.cpp:198 +msgid "Encoding error" +msgstr "Chyba pÅ™i kódování" + +#: libk9copy/k9burndvd.cpp:144 +msgid "k9Copy - Burning DVD" +msgstr "k9copy - Vypalování DVD" + +#: libk9copy/k9burndvd.cpp:145 libk9copy/k9burndvd.cpp:233 +msgid "Burning DVD" +msgstr "Vypalování DVD" + +#: libk9copy/k9burndvd.cpp:192 +msgid "Insert a recordable DVD" +msgstr "Vložte zapisovatelné DVD" + +#: libk9copy/k9burndvd.cpp:199 +msgid "Error burning DVD :\n" +msgstr "Chyba pÅ™i vypalování DVD :\n" + +#: libk9copy/k9burndvd.cpp:199 libk9copy/k9burndvd.cpp:203 +msgid "DVD burning" +msgstr "Vypalování DVD" + +#: libk9copy/k9burndvd.cpp:203 +msgid "DVD Burning finished" +msgstr "Vypalování DVD dokonÄeno" + +#: libk9copy/k9burndvd.cpp:209 +msgid "An error occured while Burning DVD: %1" +msgstr "Chyba pÅ™i vypalování DVD: %1" + +#: libk9copy/k9burndvd.cpp:209 +msgid "Insert an other DVD" +msgstr "Vložte jiné DVD" + +#: libk9copy/k9burndvd.cpp:234 +msgid "Current write speed :%1 x" +msgstr "Vypalovací rychlost: %1 x" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "kDecMPEG2" + +#: debug/libk9copy/backupdlg.cpp:163 rc.cpp:175 +#, no-c-format +msgid "A&bort" +msgstr "ZruÅ¡it" + +#: debug/libk9copy/backupdlg.cpp:164 rc.cpp:178 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+B" + +#: debug/libk9copy/backupdlg.cpp:165 rc.cpp:181 +#, no-c-format +msgid "--:--:--" +msgstr "--:--:--" + +#: debug/libk9copy/backupdlg.cpp:166 rc.cpp:184 +#, no-c-format +msgid "Current step" +msgstr "Aktuální krok" + +#: debug/libk9copy/backupdlg.cpp:167 debug/libk9copy/progress.cpp:107 +#: debug/libk9copy/mp4dlg.cpp:129 rc.cpp:187 rc.cpp:210 rc.cpp:234 +#, no-c-format +msgid "Elapsed Time" +msgstr "Uplynulý Äas" + +#: debug/libk9copy/backupdlg.cpp:168 rc.cpp:190 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

Zálohování DVD

" + +#: debug/libk9copy/dvdprogress.cpp:92 rc.cpp:194 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - Analýza DVD" + +#: debug/libk9copy/progress.cpp:103 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 rc.cpp:200 +#, no-c-format +msgid "k9Copy" +msgstr "k9Copy" + +#: debug/libk9copy/progress.cpp:106 debug/src/progress.cpp:81 rc.cpp:207 +#, no-c-format +msgid "Alt+C" +msgstr "Alt+C" + +#: debug/libk9copy/mp4dlg.cpp:120 rc.cpp:215 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9copy - překódování" + +#: debug/libk9copy/mp4dlg.cpp:121 rc.cpp:218 +#, no-c-format +msgid "Encoding" +msgstr "Kódování" + +#: debug/libk9copy/mp4dlg.cpp:122 rc.cpp:221 +#, no-c-format +msgid "Annu&ler" +msgstr "Zrušit" + +#: debug/libk9copy/mp4dlg.cpp:123 rc.cpp:224 +#, no-c-format +msgid "Alt+L" +msgstr "Alt+L" + +#: debug/libk9copy/mp4dlg.cpp:128 rc.cpp:231 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: debug/libk9copy/mp4dlg.cpp:130 rc.cpp:237 +#, no-c-format +msgid "Bitrate" +msgstr "Bitrate" + +#: debug/libk9copy/mp4dlg.cpp:131 debug/src/k9mainw.cpp:106 +#: debug/src/k9mainw.cpp:299 rc.cpp:32 rc.cpp:240 +#, no-c-format +msgid "Size" +msgstr "Velikost" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "k9DVDProgress" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "k9DVDAuthor" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "k9DVDSize" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "k9ChapterCell" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "k9DVDChapter" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDVideoStream" +msgstr "k9DVDVideoStream" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDAudioStream" +msgstr "k9DVDAudioStream" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:326 +#: debug/libk9copy/k9dvdtitle.moc.cpp:334 +msgid "k9DVDSubtitle" +msgstr "k9DVDSubtitle" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:399 +#: debug/libk9copy/k9dvdtitle.moc.cpp:407 +msgid "k9DVDTitle" +msgstr "k9DVDTitle" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:472 +#: debug/libk9copy/k9dvdtitle.moc.cpp:480 +msgid "k9DVDTitleset" +msgstr "k9DVDTitleset" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "k9DVD" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "k9BurnDVD" + +#: debug/src/viewmpeg2.cpp:631 rc.cpp:3 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Náhled stopy" + +#: debug/src/configDlg.cpp:42 debug/src/configDlg.cpp:96 rc.cpp:69 +#, no-c-format +msgid "device" +msgstr "zařízení" + +#: debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:97 rc.cpp:72 +#, no-c-format +msgid "label" +msgstr "popisek" + +#: debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:98 rc.cpp:75 +#, no-c-format +msgid "Input" +msgstr "Vstup" + +#: debug/src/configDlg.cpp:48 debug/src/configDlg.cpp:99 rc.cpp:78 +#, no-c-format +msgid "Output" +msgstr "Výstup" + +#: debug/src/configDlg.cpp:95 rc.cpp:66 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Zařízení" + +#: debug/src/k9mainw.cpp:105 debug/src/k9mainw.cpp:298 rc.cpp:29 +#, no-c-format +msgid "Title" +msgstr "Stopa" + +#: debug/src/k9mainw.cpp:212 debug/src/k9mainw.cpp:309 rc.cpp:61 +#, no-c-format +msgid "Languages" +msgstr "Jazyky" + +#: debug/src/k9mainw.cpp:291 rc.cpp:8 +#, no-c-format +msgid "MainDlg" +msgstr "Hlavní dialog" + +#: debug/src/k9mainw.cpp:292 rc.cpp:11 +#, no-c-format +msgid "Output device " +msgstr "Výstupní zařízení" + +#: debug/src/k9mainw.cpp:293 rc.cpp:14 +#, no-c-format +msgid "@" +msgstr "@" + +#: debug/src/k9mainw.cpp:294 rc.cpp:17 +#, no-c-format +msgid "Input device " +msgstr "Vstupní zařízení" + +#: debug/src/k9mainw.cpp:297 debug/src/prefMPEG4.cpp:158 rc.cpp:23 rc.cpp:143 +#, no-c-format +msgid "X" +msgstr "X" + +#: debug/src/k9mainw.cpp:300 rc.cpp:38 +#, no-c-format +msgid "&Keep original menus" +msgstr "Zachovat původní menu" + +#: debug/src/k9mainw.cpp:301 debug/src/prefMPEG4.cpp:157 rc.cpp:41 rc.cpp:140 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: debug/src/k9mainw.cpp:302 rc.cpp:44 +#, no-c-format +msgid "Default language" +msgstr "Výchozí jazyk" + +#: debug/src/k9mainw.cpp:303 rc.cpp:47 +#, no-c-format +msgid "Subtitle" +msgstr "Titulky" + +#: debug/src/k9mainw.cpp:307 rc.cpp:55 +#, no-c-format +msgid "Selected Titles" +msgstr "Vybrané Stopy" + +#: debug/src/k9mainw.cpp:308 rc.cpp:35 +#, no-c-format +msgid "DVD playback options" +msgstr "Možnosti přehrávání DVD" + +#: debug/src/k9mainw.cpp:310 rc.cpp:58 +#, no-c-format +msgid "Selection" +msgstr "Výběr" + +#: debug/src/k9mainw.cpp:311 rc.cpp:26 +#, no-c-format +msgid "D&VD" +msgstr "DVD" + +#: debug/src/prefDVD.cpp:89 rc.cpp:89 +#, no-c-format +msgid "prefDVD" +msgstr "prefDVD" + +#: debug/src/prefDVD.cpp:90 rc.cpp:92 +#, no-c-format +msgid "Output directory" +msgstr "Výstupní adresář" + +#: debug/src/prefDVD.cpp:91 rc.cpp:95 +#, no-c-format +msgid "Burn with k3b" +msgstr "Vypálit pomocí K3b" + +#: debug/src/prefDVD.cpp:93 rc.cpp:99 +#, no-c-format +msgid "Auto burn" +msgstr "Automaticky vypálit" + +#: debug/src/prefDVD.cpp:95 rc.cpp:103 +#, no-c-format +msgid "Quick scan" +msgstr "Jednoduché hledání" + +#: debug/src/prefDVD.cpp:97 rc.cpp:107 +#, no-c-format +msgid "DVD size" +msgstr "Velikost DVD" + +#: debug/src/prefMPEG4.cpp:145 debug/src/prefMencoder.cpp:84 rc.cpp:110 +#: rc.cpp:152 +#, no-c-format +msgid "Form1" +msgstr "" + +#: debug/src/prefMPEG4.cpp:146 rc.cpp:113 +#, no-c-format +msgid "Video Codec" +msgstr "Video kodek" + +#: debug/src/prefMPEG4.cpp:147 rc.cpp:116 +#, no-c-format +msgid "Audio bitrate" +msgstr "Bitrate zvuku" + +#: debug/src/prefMPEG4.cpp:149 rc.cpp:122 +#, no-c-format +msgid "File size" +msgstr "Velikost souboru" + +#: debug/src/prefMPEG4.cpp:151 rc.cpp:128 +#, no-c-format +msgid " mb" +msgstr " mb" + +#: debug/src/prefMPEG4.cpp:152 rc.cpp:131 +#, no-c-format +msgid "640" +msgstr "640" + +#: debug/src/prefMPEG4.cpp:156 rc.cpp:137 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "Zachovat poměr stran" + +#: debug/src/prefMPEG4.cpp:160 rc.cpp:146 +#, no-c-format +msgid "XviD" +msgstr "XviD" + +#: debug/src/prefMPEG4.cpp:161 rc.cpp:149 +#, no-c-format +msgid "lavc MPEG4" +msgstr "lavc MPEG4" + +#: debug/src/prefMencoder.cpp:33 debug/src/prefMencoder.cpp:85 rc.cpp:155 +#, no-c-format +msgid "Label" +msgstr "Popisek" + +#: debug/src/prefMencoder.cpp:35 debug/src/prefMencoder.cpp:86 rc.cpp:158 +#, no-c-format +msgid "Video" +msgstr "Video" + +#: debug/src/k9main.moc.cpp:34 debug/src/k9main.moc.cpp:42 +msgid "k9DVDListItem" +msgstr "k9DVDListItem" + +#: debug/src/k9main.moc.cpp:107 debug/src/k9main.moc.cpp:115 +msgid "k9Main" +msgstr "k9Main" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "kCDDrive" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "kCDDrives" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "kViewMPEG2" +msgstr "kViewMPEG2" + +#: rc.cpp:243 +#, no-c-format +msgid "A&ctions" +msgstr "Akce" + +#: rc.cpp:246 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Nástrojová lišta akcí" diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..eae6cb1 --- /dev/null +++ b/po/de.po @@ -0,0 +1,1531 @@ +# translation of de.po to +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Jan Berndt , 2006, 2007. +# Jan Berndt , 2007. +msgid "" +msgstr "" +"Project-Id-Version: de\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-06-21 09:09+0200\n" +"PO-Revision-Date: 2007-04-02 19:58+0200\n" +"Last-Translator: Jan Berndt \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: libk3bdevice/k3bdeviceglobals.cpp:30 libk3bdevice/k3bdeviceglobals.cpp:132 +#: libk3bdevice.new/k3bdeviceglobals.cpp:30 +#: libk3bdevice.new/k3bdeviceglobals.cpp:132 +msgid "CD-R" +msgstr "CD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:32 libk3bdevice/k3bdeviceglobals.cpp:134 +#: libk3bdevice.new/k3bdeviceglobals.cpp:32 +#: libk3bdevice.new/k3bdeviceglobals.cpp:134 +msgid "CD-RW" +msgstr "CD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:34 libk3bdevice/k3bdeviceglobals.cpp:130 +#: libk3bdevice.new/k3bdeviceglobals.cpp:34 +#: libk3bdevice.new/k3bdeviceglobals.cpp:130 +msgid "CD-ROM" +msgstr "CD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:36 libk3bdevice/k3bdeviceglobals.cpp:101 +#: libk3bdevice.new/k3bdeviceglobals.cpp:36 +#: libk3bdevice.new/k3bdeviceglobals.cpp:101 +msgid "DVD-ROM" +msgstr "DVD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:38 libk3bdevice/k3bdeviceglobals.cpp:115 +#: libk3bdevice.new/k3bdeviceglobals.cpp:38 +#: libk3bdevice.new/k3bdeviceglobals.cpp:115 +msgid "DVD-RAM" +msgstr "DVD-RAM" + +#: libk3bdevice/k3bdeviceglobals.cpp:40 libk3bdevice/k3bdeviceglobals.cpp:104 +#: libk3bdevice.new/k3bdeviceglobals.cpp:40 +#: libk3bdevice.new/k3bdeviceglobals.cpp:104 +msgid "DVD-R" +msgstr "DVD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:42 libk3bdevice/k3bdeviceglobals.cpp:118 +#: libk3bdevice.new/k3bdeviceglobals.cpp:42 +#: libk3bdevice.new/k3bdeviceglobals.cpp:118 +msgid "DVD-RW" +msgstr "DVD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:44 +#: libk3bdevice.new/k3bdeviceglobals.cpp:44 +msgid "DVD-R DL" +msgstr "DVD-R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:46 libk3bdevice/k3bdeviceglobals.cpp:126 +#: libk3bdevice.new/k3bdeviceglobals.cpp:46 +#: libk3bdevice.new/k3bdeviceglobals.cpp:126 +msgid "DVD+R" +msgstr "DVD+R" + +#: libk3bdevice/k3bdeviceglobals.cpp:48 libk3bdevice/k3bdeviceglobals.cpp:124 +#: libk3bdevice.new/k3bdeviceglobals.cpp:48 +#: libk3bdevice.new/k3bdeviceglobals.cpp:124 +msgid "DVD+RW" +msgstr "DVD+RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:50 +#: libk3bdevice.new/k3bdeviceglobals.cpp:50 +msgid "DVD+R DL" +msgstr "DVD+R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:63 +#: libk3bdevice.new/k3bdeviceglobals.cpp:63 +msgid "SAO" +msgstr "SAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:65 +#: libk3bdevice.new/k3bdeviceglobals.cpp:65 +msgid "TAO" +msgstr "TAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:67 +#: libk3bdevice.new/k3bdeviceglobals.cpp:67 +msgid "RAW" +msgstr "RAW" + +#: libk3bdevice/k3bdeviceglobals.cpp:69 +#: libk3bdevice.new/k3bdeviceglobals.cpp:69 +msgid "SAO/R96P" +msgstr "SAO/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:71 +#: libk3bdevice.new/k3bdeviceglobals.cpp:71 +msgid "SAO/R96R" +msgstr "SAO/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:73 +#: libk3bdevice.new/k3bdeviceglobals.cpp:73 +msgid "RAW/R16" +msgstr "RAW/R16" + +#: libk3bdevice/k3bdeviceglobals.cpp:75 +#: libk3bdevice.new/k3bdeviceglobals.cpp:75 +msgid "RAW/R96P" +msgstr "RAW/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:77 +#: libk3bdevice.new/k3bdeviceglobals.cpp:77 +msgid "RAW/R96R" +msgstr "RAW/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:79 +#: libk3bdevice.new/k3bdeviceglobals.cpp:79 +msgid "Incremental Sequential" +msgstr "Inkrementell Sequentiell" + +#: libk3bdevice/k3bdeviceglobals.cpp:81 +#: libk3bdevice.new/k3bdeviceglobals.cpp:81 +msgid "Restricted Overwrite" +msgstr "Eingeschränktes Überschreiben" + +#: libk3bdevice/k3bdeviceglobals.cpp:83 +#: libk3bdevice.new/k3bdeviceglobals.cpp:83 +msgid "Layer Jump" +msgstr "Sprung zwischen DVD-Schichten" + +#: libk3bdevice/k3bdeviceglobals.cpp:86 +#: libk3bdevice.new/k3bdeviceglobals.cpp:86 +msgid "None" +msgstr "Keine" + +#: libk3bdevice/k3bdeviceglobals.cpp:95 libk9copy/k9dvd.cpp:253 +#: libk9copy/k9dvd.cpp:255 libk3bdevice.new/k3bdeviceglobals.cpp:95 +msgid "Unknown" +msgstr "Unbekannt" + +#: libk3bdevice/k3bdeviceglobals.cpp:99 +#: libk3bdevice.new/k3bdeviceglobals.cpp:99 +msgid "No media" +msgstr "Kein Medium" + +#: libk3bdevice/k3bdeviceglobals.cpp:106 +#: libk3bdevice.new/k3bdeviceglobals.cpp:106 +msgid "DVD-R Sequential" +msgstr "DVD-R Sequentiell" + +#: libk3bdevice/k3bdeviceglobals.cpp:109 +#: libk3bdevice.new/k3bdeviceglobals.cpp:109 +msgid "DVD-R Dual Layer" +msgstr "Zweischichtige DVD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:111 +#: libk3bdevice.new/k3bdeviceglobals.cpp:111 +msgid "DVD-R Dual Layer Sequential" +msgstr "Zweischichtige DVD-R Sequentiell" + +#: libk3bdevice/k3bdeviceglobals.cpp:113 +#: libk3bdevice.new/k3bdeviceglobals.cpp:113 +msgid "DVD-R Dual Layer Jump" +msgstr "Zweischicht-DVD-R Sprung" + +#: libk3bdevice/k3bdeviceglobals.cpp:120 +#: libk3bdevice.new/k3bdeviceglobals.cpp:120 +msgid "DVD-RW Restricted Overwrite" +msgstr "DVD-RW Eingeschränktes Überbrennen" + +#: libk3bdevice/k3bdeviceglobals.cpp:122 +#: libk3bdevice.new/k3bdeviceglobals.cpp:122 +msgid "DVD-RW Sequential" +msgstr "DVD-RW Sequentiell" + +#: libk3bdevice/k3bdeviceglobals.cpp:128 +#: libk3bdevice.new/k3bdeviceglobals.cpp:128 +msgid "DVD+R Double Layer" +msgstr "DVD+R Doppelschicht" + +#: src/k9copy.cpp:66 +msgid "Play title" +msgstr "Wiedergabe" + +#: src/k9copy.cpp:80 +msgid "Create MPEG-4" +msgstr "MPEG-4 erstellen" + +#: src/k9copy.cpp:94 +msgid "Settings" +msgstr "Eins&tellungen" + +#: src/kviewmpeg2.cpp:100 +msgid "Can't find device %1\n" +msgstr "Kann Gerät %1 nicht finden\n" + +#: src/kviewmpeg2.cpp:107 libk9copy/k9dvd.cpp:339 +msgid "Can't open disc %1!\n" +msgstr "Kann Medium %1 nicht öffnen\n" + +#: src/kviewmpeg2.cpp:135 libk9copy/k9dvd.cpp:848 +msgid "Error opening vobs for title %1\n" +msgstr "Fehler beim Öffnen der Vobs für Titel %1\n" + +#: src/kviewmpeg2.cpp:149 libk9copy/k9dvd.cpp:859 +msgid "ERROR reading block %1\n" +msgstr "Fehler beim Lesen von Block %1\n" + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "Ein DVD-Backup-Werkzeug für KDE" + +#: src/main.cpp:37 +msgid "input device" +msgstr "Quelllaufwerk " + +#: src/main.cpp:39 +msgid "output device" +msgstr "Ziellaufwerk" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "zu spielender Titel" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "Wiedergabe nach stdout" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "Anfangssektor" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "Endsektor" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "Liste mit Audiospuren" + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "Liste mit Untertiteln" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "Verkleinerungsfaktor" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "erzwungener Verkleinerungsfaktor" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "Größe der zu kopierenden Zellen" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "Gesamtgröße der ausgewählten Titel" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "Größe der zu kopierenden Kapitel" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "Liste mit ausgewählten Kapiteln" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "Größe der neuen DVD" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "ausgewähltes Kapitel" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "Zellennummer im ausgewählten Kapitel" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "Statusdateiname" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "Statusdatei initialisieren" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "Wiedergabe beim letzten Sektor fortsetzen" + +#: src/main.cpp:58 +msgid "don't save status at end" +msgstr "Status beim Beenden nicht speichern" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "Zelle vor dem Encodieren in einer temporären Datei speichern" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "für den internen Gebrauch" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:69 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "Jan Berndt" + +#: src/main.cpp:70 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "Jan.Berndt@gmx.de" + +#: src/k9main.cpp:315 src/k9main.cpp:919 +msgid "DVD is not opened" +msgstr "DVD nicht geöffnet" + +#: src/k9main.cpp:315 src/k9main.cpp:328 +msgid "DVD Copy" +msgstr "DVD kopieren" + +#: src/k9main.cpp:322 libk9copy/k9burndvd.cpp:173 +msgid "Save image to disk" +msgstr "Abbild auf Festplatte speichern" + +#: src/k9main.cpp:328 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "Unzureichender Speicherplatz auf %1.
Es werden %2 MB benötigt." + +#: src/k9main.cpp:385 src/k9main.cpp:951 +msgid "ISO Image" +msgstr "ISO-Abbild" + +#: src/k9main.cpp:422 +msgid "Open DVD" +msgstr "&Oeffnen" + +#: src/k9main.cpp:441 +msgid "Titleset %1" +msgstr "Titel %1" + +#: src/k9main.cpp:514 +msgid "video %1 " +msgstr "Video %1 " + +#: src/k9main.cpp:526 +msgid "audio %1 " +msgstr "Audio %1 " + +#: src/k9main.cpp:543 +msgid "subpicture %1 " +msgstr "Untertitel %1 " + +#: src/k9main.cpp:919 src/k9settings.cpp:40 libk9copy/k9mp4enc.cpp:195 +msgid "MPEG-4 Encoding" +msgstr "MPEG-4 Encoding" + +#: src/k9main.cpp:1091 debug/src/k9mainw.cpp:304 debug/src/prefMencoder.cpp:37 +#: debug/src/prefMencoder.cpp:87 rc.cpp:50 rc.cpp:161 +#, no-c-format +msgid "Audio" +msgstr "Audio" + +#: src/k9main.cpp:1102 +msgid "Subtitles" +msgstr "Untertitel" + +#: src/k9main.cpp:1123 src/k9main.cpp:1245 libk9copy/k9burndvd.cpp:167 +#: debug/src/k9mainw.cpp:296 rc.cpp:20 +#, no-c-format +msgid "default" +msgstr "Standard" + +#: src/k9main.cpp:1131 +msgid "Open ISO Image" +msgstr "ISO-Abbild öffnen" + +#: src/k9main.cpp:1138 +msgid "Open DVD folder" +msgstr "&Oeffnen" + +#: src/k9main.cpp:1247 +msgid "none" +msgstr "Keine" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "Gerät" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "Geräte von k9copy nicht erkannt." + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 +msgid "DVD Backup" +msgstr "DVD Backup" + +#: src/k9settings.cpp:40 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:46 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:46 +msgid "MPEG-4 Codecs" +msgstr "MPEG-4 Codecs" + +#: src/k9prefmpeg4.cpp:33 src/k9prefdvd.cpp:33 libk9copy/k9mp4enc.cpp:94 +msgid "mb" +msgstr "MB" + +#: src/menupreview.cpp:1084 debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Menüvorschau" + +#: libk9copy/k9dvdauthor.cpp:107 libk9copy/k9dvdauthor.cpp:294 +msgid "'%1' not selected" +msgstr "'%1' nicht ausgewählt" + +#: libk9copy/k9dvdauthor.cpp:108 libk9copy/k9dvdauthor.cpp:295 +#: libk9copy/k9dvdauthor.cpp:355 libk9copy/k9dvdauthor.cpp:364 +#: libk9copy/k9dvdauthor.cpp:367 libk9copy/k9burndvd.cpp:193 +#: libk9copy/k9burndvd.cpp:210 +msgid "authoring" +msgstr "Authoring" + +#: libk9copy/k9dvdauthor.cpp:325 libk9copy/k9dvdauthor.cpp:391 +#: libk9copy/k9dvdauthor.cpp:429 +msgid "Authoring" +msgstr "Authoring" + +#: libk9copy/k9dvdauthor.cpp:326 debug/libk9copy/backupdlg.cpp:162 rc.cpp:172 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Backup-Fortschritt" + +#: libk9copy/k9dvdauthor.cpp:355 +msgid "Dvdauthor error :\n" +msgstr "Dvdauthor Fehler :\n" + +#: libk9copy/k9dvdauthor.cpp:364 +msgid "Authoring cancelled" +msgstr "Authoring abgebrochen" + +#: libk9copy/k9dvdauthor.cpp:367 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Ein Fehler ist während der Ausführung von DVDAuthor aufgetreten:\n" + +#: libk9copy/k9dvdauthor.cpp:430 +msgid "Fixing VOBUS" +msgstr "VOBUS reparieren" + +#: libk9copy/k9dvdbackup.cpp:137 libk9copy/k9dvdbackup.cpp:151 +#: libk9copy/k9dvdbackup.cpp:491 libk9copy/k9dvdbackup.cpp:648 +msgid "DVD backup cancelled" +msgstr "DVD-Backup abgebrochen" + +#: libk9copy/k9dvdbackup.cpp:164 +msgid "unable to open VIDEO_TS.IFO" +msgstr "VIDEO_TS.IFO kann nicht geöffnet werden " + +#: libk9copy/k9dvdbackup.cpp:186 libk9copy/k9dvdbackup.cpp:364 +#: libk9copy/k9dvdbackup.cpp:429 +msgid "Unable to open file " +msgstr "Die Datei kann nicht geöffnet werden " + +#: libk9copy/k9dvdbackup.cpp:257 +msgid "Unable to open titleset %1" +msgstr "Kann Titelset %1 nicht öffnen" + +#: libk9copy/k9dvdbackup.cpp:263 libk9copy/k9dvdbackup.cpp:620 +msgid "Extracting titleset %1" +msgstr "Auslesen von Titelset %1" + +#: libk9copy/k9dvdbackup.cpp:436 libk9copy/k9dvdbackup.cpp:564 +msgid "Unable to open menu for titleset %1" +msgstr "Kann Menü für Titelset %1 nicht öffnen" + +#: libk9copy/k9dvdbackup.cpp:458 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting menu for titleset %1" +msgstr "Auslesen des Menüs für Titelset %1" + +#: libk9copy/k9dvdbackup.cpp:557 +msgid "Unable to open " +msgstr "Öffnen fehlgeschlagen" + +#: libk9copy/k9dvdbackup.cpp:612 +msgid "Unable to open ifo file for titleset %1" +msgstr "Kann IFO-Datei für Titelset %1 nicht öffnen" + +#: libk9copy/k9dvdbackup.cpp:624 libk9copy/k9dvdbackup.cpp:1595 +msgid "Unable to open DVD" +msgstr "Kann DVD nicht öffnen" + +#: libk9copy/k9dvdbackup.cpp:634 +msgid "Unable to open vobs for titleset %1" +msgstr "Kann Vobs für Titelset %1 nicht öffnen" + +#: libk9copy/k9dvdbackup.cpp:1318 +msgid "Updating vob %1" +msgstr "Ändere Vob %1" + +#: libk9copy/k9dvdbackup.cpp:1334 +msgid "DVD backup canceled" +msgstr "DVD-Backup abgebrochen" + +#: libk9copy/k9dvd.cpp:191 +msgid "Couldn't open %1 for title\n" +msgstr "Kann %1 für Titel nicht öffnen\n" + +#: libk9copy/k9dvd.cpp:199 +msgid "Couldn't seek in %1 for title\n" +msgstr "Kann in %1 für Titel nicht suchen\n" + +#: libk9copy/k9dvd.cpp:226 +msgid "Not Specified" +msgstr "Unbekannt" + +#: libk9copy/k9dvd.cpp:226 +msgid "Afar" +msgstr "Afar" + +#: libk9copy/k9dvd.cpp:226 +msgid "Abkhazian" +msgstr "Abkhazian" + +#: libk9copy/k9dvd.cpp:226 +msgid "Afrikaans" +msgstr "Afrikaans" + +#: libk9copy/k9dvd.cpp:226 +msgid "Amharic" +msgstr "Amharic" + +#: libk9copy/k9dvd.cpp:227 +msgid "Arabic" +msgstr "Arabic" + +#: libk9copy/k9dvd.cpp:227 +msgid "Assamese" +msgstr "Assamese" + +#: libk9copy/k9dvd.cpp:227 +msgid "Aymara" +msgstr "Aymara" + +#: libk9copy/k9dvd.cpp:227 +msgid "Azerbaijani" +msgstr "Azerbaijani" + +#: libk9copy/k9dvd.cpp:227 +msgid "Bashkir" +msgstr "Bashkir" + +#: libk9copy/k9dvd.cpp:228 +msgid "Byelorussian" +msgstr "Byelorussian" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bulgarian" +msgstr "Bulgarian" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bihari" +msgstr "Bihari" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bislama" +msgstr "Bislama" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bengali; Bangla" +msgstr "Bengali; Bangla" + +#: libk9copy/k9dvd.cpp:229 +msgid "Tibetan" +msgstr "Tibetan" + +#: libk9copy/k9dvd.cpp:229 +msgid "Breton" +msgstr "Breton" + +#: libk9copy/k9dvd.cpp:229 +msgid "Catalan" +msgstr "Catalan" + +#: libk9copy/k9dvd.cpp:229 +msgid "Corsican" +msgstr "Corsican" + +#: libk9copy/k9dvd.cpp:229 +msgid "Czech" +msgstr "Czech" + +#: libk9copy/k9dvd.cpp:230 +msgid "Welsh" +msgstr "Welsh" + +#: libk9copy/k9dvd.cpp:230 +msgid "Dansk" +msgstr "Dansk" + +#: libk9copy/k9dvd.cpp:230 +msgid "Deutsch" +msgstr "Deutsch" + +#: libk9copy/k9dvd.cpp:230 +msgid "Bhutani" +msgstr "Bhutani" + +#: libk9copy/k9dvd.cpp:230 +msgid "Greek" +msgstr "Greek" + +#: libk9copy/k9dvd.cpp:230 +msgid "English" +msgstr "Englisch" + +#: libk9copy/k9dvd.cpp:231 +msgid "Esperanto" +msgstr "Esperanto" + +#: libk9copy/k9dvd.cpp:231 +msgid "Espanol" +msgstr "Espanol" + +#: libk9copy/k9dvd.cpp:231 +msgid "Estonian" +msgstr "Estonian" + +#: libk9copy/k9dvd.cpp:231 +msgid "Basque" +msgstr "Basque" + +#: libk9copy/k9dvd.cpp:231 +msgid "Persian" +msgstr "Persian" + +#: libk9copy/k9dvd.cpp:232 +msgid "Suomi" +msgstr "Suomi" + +#: libk9copy/k9dvd.cpp:232 +msgid "Fiji" +msgstr "Fiji" + +#: libk9copy/k9dvd.cpp:232 +msgid "Faroese" +msgstr "Faroese" + +#: libk9copy/k9dvd.cpp:232 +msgid "Francais" +msgstr "Francais" + +#: libk9copy/k9dvd.cpp:232 +msgid "Frisian" +msgstr "Frisian" + +#: libk9copy/k9dvd.cpp:232 +msgid "Gaelic" +msgstr "Gaelic" + +#: libk9copy/k9dvd.cpp:233 +msgid "Scots Gaelic" +msgstr "Scots Gaelic" + +#: libk9copy/k9dvd.cpp:233 +msgid "Galician" +msgstr "Galician" + +#: libk9copy/k9dvd.cpp:233 +msgid "Guarani" +msgstr "Guarani" + +#: libk9copy/k9dvd.cpp:233 +msgid "Gujarati" +msgstr "Gujarati" + +#: libk9copy/k9dvd.cpp:233 +msgid "Hausa" +msgstr "Hausa" + +#: libk9copy/k9dvd.cpp:234 libk9copy/k9dvd.cpp:236 +msgid "Hebrew" +msgstr "Hebrew" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hindi" +msgstr "Hindi" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hrvatski" +msgstr "Hrvatski" + +#: libk9copy/k9dvd.cpp:234 +msgid "Magyar" +msgstr "Magyar" + +#: libk9copy/k9dvd.cpp:234 +msgid "Armenian" +msgstr "Armenian" + +#: libk9copy/k9dvd.cpp:235 +msgid "Interlingua" +msgstr "Interlingua" + +#: libk9copy/k9dvd.cpp:235 +msgid "Indonesian" +msgstr "Indonesian" + +#: libk9copy/k9dvd.cpp:235 +msgid "Interlingue" +msgstr "Interlingue" + +#: libk9copy/k9dvd.cpp:235 +msgid "Inupiak" +msgstr "Inupiak" + +#: libk9copy/k9dvd.cpp:236 +msgid "Islenska" +msgstr "Islenska" + +#: libk9copy/k9dvd.cpp:236 +msgid "Italiano" +msgstr "Italiano" + +#: libk9copy/k9dvd.cpp:236 +msgid "Inuktitut" +msgstr "Inuktitut" + +#: libk9copy/k9dvd.cpp:236 +msgid "Japanese" +msgstr "Japanese" + +#: libk9copy/k9dvd.cpp:237 libk9copy/k9dvd.cpp:252 +msgid "Yiddish" +msgstr "Yiddish" + +#: libk9copy/k9dvd.cpp:237 +msgid "Javanese" +msgstr "Javanese" + +#: libk9copy/k9dvd.cpp:237 +msgid "Georgian" +msgstr "Georgian" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kazakh" +msgstr "Kazakh" + +#: libk9copy/k9dvd.cpp:237 +msgid "Greenlandic" +msgstr "Greenlandic" + +#: libk9copy/k9dvd.cpp:238 +msgid "Cambodian" +msgstr "Cambodian" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kannada" +msgstr "Kannada" + +#: libk9copy/k9dvd.cpp:238 +msgid "Korean" +msgstr "Korean" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kashmiri" +msgstr "Kashmiri" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kurdish" +msgstr "Kurdish" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kirghiz" +msgstr "Kirghiz" + +#: libk9copy/k9dvd.cpp:239 +msgid "Latin" +msgstr "Latin" + +#: libk9copy/k9dvd.cpp:239 +msgid "Lingala" +msgstr "Lingala" + +#: libk9copy/k9dvd.cpp:239 +msgid "Laothian" +msgstr "Laothian" + +#: libk9copy/k9dvd.cpp:239 +msgid "Lithuanian" +msgstr "Lithuanian" + +#: libk9copy/k9dvd.cpp:240 +msgid "Latvian, Lettish" +msgstr "Latvian, Lettish" + +#: libk9copy/k9dvd.cpp:240 +msgid "Malagasy" +msgstr "Malagasy" + +#: libk9copy/k9dvd.cpp:240 +msgid "Maori" +msgstr "Maori" + +#: libk9copy/k9dvd.cpp:240 +msgid "Macedonian" +msgstr "Macedonian" + +#: libk9copy/k9dvd.cpp:240 +msgid "Malayalam" +msgstr "Malayalam" + +#: libk9copy/k9dvd.cpp:241 +msgid "Mongolian" +msgstr "Mongolian" + +#: libk9copy/k9dvd.cpp:241 +msgid "Moldavian" +msgstr "Moldavian" + +#: libk9copy/k9dvd.cpp:241 +msgid "Marathi" +msgstr "Marathi" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malay" +msgstr "Malay" + +#: libk9copy/k9dvd.cpp:241 +msgid "Maltese" +msgstr "Maltese" + +#: libk9copy/k9dvd.cpp:242 +msgid "Burmese" +msgstr "Burmese" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nauru" +msgstr "Nauru" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nepali" +msgstr "Nepali" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nederlands" +msgstr "Nederlands" + +#: libk9copy/k9dvd.cpp:242 +msgid "Norsk" +msgstr "Norsk" + +#: libk9copy/k9dvd.cpp:242 +msgid "Occitan" +msgstr "Occitan" + +#: libk9copy/k9dvd.cpp:243 +msgid "Oromo" +msgstr "Oromo" + +#: libk9copy/k9dvd.cpp:243 +msgid "Oriya" +msgstr "Oriya" + +#: libk9copy/k9dvd.cpp:243 +msgid "Punjabi" +msgstr "Punjabi" + +#: libk9copy/k9dvd.cpp:243 +msgid "Polish" +msgstr "Polish" + +#: libk9copy/k9dvd.cpp:243 +msgid "Pashto, Pushto" +msgstr "Pashto, Pushto" + +#: libk9copy/k9dvd.cpp:244 +msgid "Portugues" +msgstr "Portugues" + +#: libk9copy/k9dvd.cpp:244 +msgid "Quechua" +msgstr "Quechua" + +#: libk9copy/k9dvd.cpp:244 +msgid "Rhaeto-Romance" +msgstr "Rhaeto-Romance" + +#: libk9copy/k9dvd.cpp:244 +msgid "Kirundi" +msgstr "Kirundi" + +#: libk9copy/k9dvd.cpp:244 +msgid "Romanian" +msgstr "Romanian" + +#: libk9copy/k9dvd.cpp:245 +msgid "Russian" +msgstr "Russian" + +#: libk9copy/k9dvd.cpp:245 +msgid "Kinyarwanda" +msgstr "Kinyarwanda" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sanskrit" +msgstr "Sanskrit" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sindhi" +msgstr "Sindhi" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sangho" +msgstr "Sangho" + +#: libk9copy/k9dvd.cpp:246 +msgid "Serbo-Croatian" +msgstr "Serbo-Croatian" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sinhalese" +msgstr "Sinhalese" + +#: libk9copy/k9dvd.cpp:246 +msgid "Slovak" +msgstr "Slovak" + +#: libk9copy/k9dvd.cpp:246 +msgid "Slovenian" +msgstr "Slovenian" + +#: libk9copy/k9dvd.cpp:246 +msgid "Samoan" +msgstr "Samoan" + +#: libk9copy/k9dvd.cpp:247 +msgid "Shona" +msgstr "Shona" + +#: libk9copy/k9dvd.cpp:247 +msgid "Somali" +msgstr "Somali" + +#: libk9copy/k9dvd.cpp:247 +msgid "Albanian" +msgstr "Albanian" + +#: libk9copy/k9dvd.cpp:247 +msgid "Serbian" +msgstr "Serbian" + +#: libk9copy/k9dvd.cpp:247 +msgid "Siswati" +msgstr "Siswati" + +#: libk9copy/k9dvd.cpp:248 +msgid "Sesotho" +msgstr "Sesotho" + +#: libk9copy/k9dvd.cpp:248 +msgid "Sundanese" +msgstr "Sundanese" + +#: libk9copy/k9dvd.cpp:248 +msgid "Svenska" +msgstr "Svenska" + +#: libk9copy/k9dvd.cpp:248 +msgid "Swahili" +msgstr "Swahili" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tamil" +msgstr "Tamil" + +#: libk9copy/k9dvd.cpp:249 +msgid "Telugu" +msgstr "Telugu" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tajik" +msgstr "Tajik" + +#: libk9copy/k9dvd.cpp:249 +msgid "Thai" +msgstr "Thai" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tigrinya" +msgstr "Tigrinya" + +#: libk9copy/k9dvd.cpp:249 +msgid "Turkmen" +msgstr "Turkmen" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tagalog" +msgstr "Tagalog" + +#: libk9copy/k9dvd.cpp:250 +msgid "Setswana" +msgstr "Setswana" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tonga" +msgstr "Tonga" + +#: libk9copy/k9dvd.cpp:250 +msgid "Turkish" +msgstr "Turkish" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tsonga" +msgstr "Tsonga" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tatar" +msgstr "Tatar" + +#: libk9copy/k9dvd.cpp:250 +msgid "Twi" +msgstr "Twi" + +#: libk9copy/k9dvd.cpp:251 +msgid "Uighur" +msgstr "Uighur" + +#: libk9copy/k9dvd.cpp:251 +msgid "Ukrainian" +msgstr "Ukrainian" + +#: libk9copy/k9dvd.cpp:251 +msgid "Urdu" +msgstr "Urdu" + +#: libk9copy/k9dvd.cpp:251 +msgid "Uzbek" +msgstr "Uzbek" + +#: libk9copy/k9dvd.cpp:251 +msgid "Vietnamese" +msgstr "Vietnamese" + +#: libk9copy/k9dvd.cpp:252 +msgid "Volapuk" +msgstr "Volapuk" + +#: libk9copy/k9dvd.cpp:252 +msgid "Wolof" +msgstr "Wolof" + +#: libk9copy/k9dvd.cpp:252 +msgid "Xhosa" +msgstr "Xhosa" + +#: libk9copy/k9dvd.cpp:252 +msgid "Yoruba" +msgstr "Yoruba" + +#: libk9copy/k9dvd.cpp:252 +msgid "Zhuang" +msgstr "Zhuang" + +#: libk9copy/k9dvd.cpp:253 +msgid "Chinese" +msgstr "Chinese" + +#: libk9copy/k9dvd.cpp:253 +msgid "Zulu" +msgstr "Zulu" + +#: libk9copy/k9dvd.cpp:349 +msgid "Can't open main ifo!\n" +msgstr "Kann Haupt-IFO nicht öffnen!\n" + +#: libk9copy/k9dvd.cpp:364 +msgid "unknown" +msgstr "unbekannt" + +#: libk9copy/k9dvd.cpp:388 libk9copy/k9dvd.cpp:675 +msgid "Title %1" +msgstr "Titel %1" + +#: libk9copy/k9dvd.cpp:723 +msgid "reading title" +msgstr "lese Titel" + +#: libk9copy/k9mp4enc.cpp:84 +msgid "Save file to disk" +msgstr "Abbild auf Festplatte speichern" + +#: libk9copy/k9mp4enc.cpp:124 libk9copy/k9mp4enc.cpp:131 +#: libk9copy/k9mp4enc.cpp:149 +msgid "Encoding %1" +msgstr "Encodiere %1" + +#: libk9copy/k9mp4enc.cpp:195 +msgid "MPEG-4 Encoding cancelled" +msgstr "Authoring abgebrochen" + +#: libk9copy/k9mp4enc.cpp:198 +msgid "Error while running mencoder :" +msgstr "Während der Ausführung von mencoder ist ein Fehler aufgetreten:" + +#: libk9copy/k9mp4enc.cpp:198 +msgid "Encoding error" +msgstr "Encodierungsfehler" + +#: libk9copy/k9burndvd.cpp:144 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - Burning DVD" + +#: libk9copy/k9burndvd.cpp:145 libk9copy/k9burndvd.cpp:233 +msgid "Burning DVD" +msgstr "DVD brennen" + +#: libk9copy/k9burndvd.cpp:192 +msgid "Insert a recordable DVD" +msgstr "Beschreibbare DVD einlegen" + +#: libk9copy/k9burndvd.cpp:199 +msgid "Error burning DVD :\n" +msgstr "Fehler beim Brennen der DVD :\n" + +#: libk9copy/k9burndvd.cpp:199 libk9copy/k9burndvd.cpp:203 +msgid "DVD burning" +msgstr "DVD-Brennen" + +#: libk9copy/k9burndvd.cpp:203 +msgid "DVD Burning finished" +msgstr "DVD Brennvorgang abgeschlossen" + +#: libk9copy/k9burndvd.cpp:209 +msgid "An error occured while Burning DVD: %1" +msgstr "Während des Brennvorganges ist folgender Fehler aufgetreten: %1" + +#: libk9copy/k9burndvd.cpp:209 +msgid "Insert an other DVD" +msgstr "Andere DVD einlegen" + +#: libk9copy/k9burndvd.cpp:234 +msgid "Current write speed :%1 x" +msgstr "Aktuelle Schrebgeschwindigkeit :%1 x" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "kDecMPEG2" + +#: debug/libk9copy/backupdlg.cpp:163 rc.cpp:175 +#, no-c-format +msgid "A&bort" +msgstr "A&bbrechen" + +#: debug/libk9copy/backupdlg.cpp:164 rc.cpp:178 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+B" + +#: debug/libk9copy/backupdlg.cpp:165 rc.cpp:181 +#, no-c-format +msgid "--:--:--" +msgstr "--:--:--" + +#: debug/libk9copy/backupdlg.cpp:166 rc.cpp:184 +#, no-c-format +msgid "Current step" +msgstr "Aktueller Schritt" + +#: debug/libk9copy/backupdlg.cpp:167 debug/libk9copy/progress.cpp:107 +#: debug/libk9copy/mp4dlg.cpp:129 rc.cpp:187 rc.cpp:210 rc.cpp:234 +#, no-c-format +msgid "Elapsed Time" +msgstr "Vergangene Zeit" + +#: debug/libk9copy/backupdlg.cpp:168 rc.cpp:190 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

DVD Backup

" + +#: debug/libk9copy/dvdprogress.cpp:92 rc.cpp:194 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - DVD Analyze" + +#: debug/libk9copy/progress.cpp:103 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 rc.cpp:200 +#, no-c-format +msgid "k9Copy" +msgstr "k9Copy" + +#: debug/libk9copy/progress.cpp:106 debug/src/progress.cpp:81 rc.cpp:207 +#, no-c-format +msgid "Alt+C" +msgstr "Alt+B" + +#: debug/libk9copy/mp4dlg.cpp:120 rc.cpp:215 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - transcoding" + +#: debug/libk9copy/mp4dlg.cpp:121 rc.cpp:218 +#, no-c-format +msgid "Encoding" +msgstr "Encodieren" + +#: debug/libk9copy/mp4dlg.cpp:122 rc.cpp:221 +#, no-c-format +msgid "Annu&ler" +msgstr "Annu&ler" + +#: debug/libk9copy/mp4dlg.cpp:123 rc.cpp:224 +#, no-c-format +msgid "Alt+L" +msgstr "Alt+A" + +#: debug/libk9copy/mp4dlg.cpp:128 rc.cpp:231 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: debug/libk9copy/mp4dlg.cpp:130 rc.cpp:237 +#, no-c-format +msgid "Bitrate" +msgstr "Bitrate" + +#: debug/libk9copy/mp4dlg.cpp:131 debug/src/k9mainw.cpp:106 +#: debug/src/k9mainw.cpp:299 rc.cpp:32 rc.cpp:240 +#, no-c-format +msgid "Size" +msgstr "Größe" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "k9DVDProgress" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "k9DVDAuthor" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "k9DVDGröße" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "k9ChapterCell" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "k9DVDChapter" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDVideoStream" +msgstr "k9DVDVideoStream" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDAudioStream" +msgstr "k9DVDAudioStream" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:326 +#: debug/libk9copy/k9dvdtitle.moc.cpp:334 +msgid "k9DVDSubtitle" +msgstr "k9DVDSubtitle" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:399 +#: debug/libk9copy/k9dvdtitle.moc.cpp:407 +msgid "k9DVDTitle" +msgstr "k9DVDTitle" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:472 +#: debug/libk9copy/k9dvdtitle.moc.cpp:480 +msgid "k9DVDTitleset" +msgstr "k9DVDTitle" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "k9DVD" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "k9DVD" + +#: debug/src/viewmpeg2.cpp:631 rc.cpp:3 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Titelvorschau" + +#: debug/src/configDlg.cpp:42 debug/src/configDlg.cpp:96 rc.cpp:69 +#, no-c-format +msgid "device" +msgstr "Gerät" + +#: debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:97 rc.cpp:72 +#, no-c-format +msgid "label" +msgstr "Datenträgerbezeichnung" + +#: debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:98 rc.cpp:75 +#, no-c-format +msgid "Input" +msgstr "Quelle" + +#: debug/src/configDlg.cpp:48 debug/src/configDlg.cpp:99 rc.cpp:78 +#, no-c-format +msgid "Output" +msgstr "Ziel" + +#: debug/src/configDlg.cpp:95 rc.cpp:66 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Geräte" + +#: debug/src/k9mainw.cpp:105 debug/src/k9mainw.cpp:298 rc.cpp:29 +#, no-c-format +msgid "Title" +msgstr "Titel" + +#: debug/src/k9mainw.cpp:212 debug/src/k9mainw.cpp:309 rc.cpp:61 +#, no-c-format +msgid "Languages" +msgstr "Sprachen" + +#: debug/src/k9mainw.cpp:291 rc.cpp:8 +#, no-c-format +msgid "MainDlg" +msgstr "MainDlg" + +#: debug/src/k9mainw.cpp:292 rc.cpp:11 +#, no-c-format +msgid "Output device " +msgstr "Ziellaufwerk" + +#: debug/src/k9mainw.cpp:293 rc.cpp:14 +#, no-c-format +msgid "@" +msgstr "@" + +#: debug/src/k9mainw.cpp:294 rc.cpp:17 +#, no-c-format +msgid "Input device " +msgstr "Quelllaufwerk " + +#: debug/src/k9mainw.cpp:297 debug/src/prefMPEG4.cpp:158 rc.cpp:23 rc.cpp:143 +#, no-c-format +msgid "X" +msgstr "X" + +#: debug/src/k9mainw.cpp:300 rc.cpp:38 +#, no-c-format +msgid "&Keep original menus" +msgstr "&Originalmenüs beibehalten" + +#: debug/src/k9mainw.cpp:301 debug/src/prefMPEG4.cpp:157 rc.cpp:41 rc.cpp:140 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: debug/src/k9mainw.cpp:302 rc.cpp:44 +#, no-c-format +msgid "Default language" +msgstr "Voreingestellte Sprache" + +#: debug/src/k9mainw.cpp:303 rc.cpp:47 +#, no-c-format +msgid "Subtitle" +msgstr "Untertitel" + +#: debug/src/k9mainw.cpp:307 rc.cpp:55 +#, no-c-format +msgid "Selected Titles" +msgstr "Ausgewählte Titel" + +#: debug/src/k9mainw.cpp:308 rc.cpp:35 +#, no-c-format +msgid "DVD playback options" +msgstr "DVD-Wiedergabe Optionen" + +#: debug/src/k9mainw.cpp:310 rc.cpp:58 +#, no-c-format +msgid "Selection" +msgstr "Auswahl" + +#: debug/src/k9mainw.cpp:311 rc.cpp:26 +#, no-c-format +msgid "D&VD" +msgstr "D&VD" + +#: debug/src/prefDVD.cpp:89 rc.cpp:89 +#, no-c-format +msgid "prefDVD" +msgstr "prefDVD" + +#: debug/src/prefDVD.cpp:90 rc.cpp:92 +#, no-c-format +msgid "Output directory" +msgstr "Ausgabeverzeichnis" + +#: debug/src/prefDVD.cpp:91 rc.cpp:95 +#, no-c-format +msgid "Burn with k3b" +msgstr "Mit K3B brennen" + +#: debug/src/prefDVD.cpp:93 rc.cpp:99 +#, no-c-format +msgid "Auto burn" +msgstr "Automatisch brennen" + +#: debug/src/prefDVD.cpp:95 rc.cpp:103 +#, no-c-format +msgid "Quick scan" +msgstr "Schnelles Scannen" + +#: debug/src/prefDVD.cpp:97 rc.cpp:107 +#, no-c-format +msgid "DVD size" +msgstr "DVD-Größe" + +#: debug/src/prefMPEG4.cpp:145 debug/src/prefMencoder.cpp:84 rc.cpp:110 +#: rc.cpp:152 +#, no-c-format +msgid "Form1" +msgstr "Form1" + +#: debug/src/prefMPEG4.cpp:146 rc.cpp:113 +#, no-c-format +msgid "Video Codec" +msgstr "Video Codec" + +#: debug/src/prefMPEG4.cpp:147 rc.cpp:116 +#, no-c-format +msgid "Audio bitrate" +msgstr "Audio Bitrate" + +#: debug/src/prefMPEG4.cpp:149 rc.cpp:122 +#, no-c-format +msgid "File size" +msgstr "Dateigröße" + +#: debug/src/prefMPEG4.cpp:151 rc.cpp:128 +#, no-c-format +msgid " mb" +msgstr "MB" + +#: debug/src/prefMPEG4.cpp:152 rc.cpp:131 +#, no-c-format +msgid "640" +msgstr "640" + +#: debug/src/prefMPEG4.cpp:156 rc.cpp:137 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "Seitenverhältnis beibehalten" + +#: debug/src/prefMPEG4.cpp:160 rc.cpp:146 +#, no-c-format +msgid "XviD" +msgstr "XviD" + +#: debug/src/prefMPEG4.cpp:161 rc.cpp:149 +#, no-c-format +msgid "lavc MPEG4" +msgstr "lavc MPEG4" + +#: debug/src/prefMencoder.cpp:33 debug/src/prefMencoder.cpp:85 rc.cpp:155 +#, no-c-format +msgid "Label" +msgstr "Datenträgerbezeichnung" + +#: debug/src/prefMencoder.cpp:35 debug/src/prefMencoder.cpp:86 rc.cpp:158 +#, no-c-format +msgid "Video" +msgstr "Video" + +#: debug/src/k9main.moc.cpp:34 debug/src/k9main.moc.cpp:42 +msgid "k9DVDListItem" +msgstr "k9DVDListItem" + +#: debug/src/k9main.moc.cpp:107 debug/src/k9main.moc.cpp:115 +msgid "k9Main" +msgstr "k9Main" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "kCDDrive" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "kCDDrives" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "kViewMPEG2" +msgstr "kViewMPEG2" + +#: rc.cpp:243 +#, no-c-format +msgid "A&ctions" +msgstr "A&ctions" + +#: rc.cpp:246 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Actions ToolBar" + diff --git a/po/el.po b/po/el.po new file mode 100644 index 0000000..4deb026 --- /dev/null +++ b/po/el.po @@ -0,0 +1,1512 @@ +# translation of el.po to Greek +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Spiros Georgaras , 2006. +# Spiros Georgaras , 2007. +msgid "" +msgstr "" +"Project-Id-Version: el\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-06-21 09:09+0200\n" +"PO-Revision-Date: 2007-10-17 11:33+0300\n" +"Last-Translator: Spiros Georgaras \n" +"Language-Team: Greek \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: libk3bdevice/k3bdeviceglobals.cpp:30 libk3bdevice/k3bdeviceglobals.cpp:132 +#: libk3bdevice.new/k3bdeviceglobals.cpp:30 +#: libk3bdevice.new/k3bdeviceglobals.cpp:132 +msgid "CD-R" +msgstr "CD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:32 libk3bdevice/k3bdeviceglobals.cpp:134 +#: libk3bdevice.new/k3bdeviceglobals.cpp:32 +#: libk3bdevice.new/k3bdeviceglobals.cpp:134 +msgid "CD-RW" +msgstr "CD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:34 libk3bdevice/k3bdeviceglobals.cpp:130 +#: libk3bdevice.new/k3bdeviceglobals.cpp:34 +#: libk3bdevice.new/k3bdeviceglobals.cpp:130 +msgid "CD-ROM" +msgstr "CD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:36 libk3bdevice/k3bdeviceglobals.cpp:101 +#: libk3bdevice.new/k3bdeviceglobals.cpp:36 +#: libk3bdevice.new/k3bdeviceglobals.cpp:101 +msgid "DVD-ROM" +msgstr "DVD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:38 libk3bdevice/k3bdeviceglobals.cpp:115 +#: libk3bdevice.new/k3bdeviceglobals.cpp:38 +#: libk3bdevice.new/k3bdeviceglobals.cpp:115 +msgid "DVD-RAM" +msgstr "DVD-RAM" + +#: libk3bdevice/k3bdeviceglobals.cpp:40 libk3bdevice/k3bdeviceglobals.cpp:104 +#: libk3bdevice.new/k3bdeviceglobals.cpp:40 +#: libk3bdevice.new/k3bdeviceglobals.cpp:104 +msgid "DVD-R" +msgstr "DVD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:42 libk3bdevice/k3bdeviceglobals.cpp:118 +#: libk3bdevice.new/k3bdeviceglobals.cpp:42 +#: libk3bdevice.new/k3bdeviceglobals.cpp:118 +msgid "DVD-RW" +msgstr "DVD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:44 +#: libk3bdevice.new/k3bdeviceglobals.cpp:44 +msgid "DVD-R DL" +msgstr "DVD-R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:46 libk3bdevice/k3bdeviceglobals.cpp:126 +#: libk3bdevice.new/k3bdeviceglobals.cpp:46 +#: libk3bdevice.new/k3bdeviceglobals.cpp:126 +msgid "DVD+R" +msgstr "DVD+R" + +#: libk3bdevice/k3bdeviceglobals.cpp:48 libk3bdevice/k3bdeviceglobals.cpp:124 +#: libk3bdevice.new/k3bdeviceglobals.cpp:48 +#: libk3bdevice.new/k3bdeviceglobals.cpp:124 +msgid "DVD+RW" +msgstr "DVD+RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:50 +#: libk3bdevice.new/k3bdeviceglobals.cpp:50 +msgid "DVD+R DL" +msgstr "DVD+R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:63 +#: libk3bdevice.new/k3bdeviceglobals.cpp:63 +msgid "SAO" +msgstr "SAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:65 +#: libk3bdevice.new/k3bdeviceglobals.cpp:65 +msgid "TAO" +msgstr "TAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:67 +#: libk3bdevice.new/k3bdeviceglobals.cpp:67 +msgid "RAW" +msgstr "RAW" + +#: libk3bdevice/k3bdeviceglobals.cpp:69 +#: libk3bdevice.new/k3bdeviceglobals.cpp:69 +msgid "SAO/R96P" +msgstr "SAO/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:71 +#: libk3bdevice.new/k3bdeviceglobals.cpp:71 +msgid "SAO/R96R" +msgstr "SAO/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:73 +#: libk3bdevice.new/k3bdeviceglobals.cpp:73 +msgid "RAW/R16" +msgstr "RAW/R16" + +#: libk3bdevice/k3bdeviceglobals.cpp:75 +#: libk3bdevice.new/k3bdeviceglobals.cpp:75 +msgid "RAW/R96P" +msgstr "RAW/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:77 +#: libk3bdevice.new/k3bdeviceglobals.cpp:77 +msgid "RAW/R96R" +msgstr "RAW/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:79 +#: libk3bdevice.new/k3bdeviceglobals.cpp:79 +msgid "Incremental Sequential" +msgstr "ΠÏοσθετική μέθοδος" + +#: libk3bdevice/k3bdeviceglobals.cpp:81 +#: libk3bdevice.new/k3bdeviceglobals.cpp:81 +msgid "Restricted Overwrite" +msgstr "ΠεÏιοÏισμένη αντικατάσταση" + +#: libk3bdevice/k3bdeviceglobals.cpp:83 +#: libk3bdevice.new/k3bdeviceglobals.cpp:83 +msgid "Layer Jump" +msgstr "Άλμα στÏώσης" + +#: libk3bdevice/k3bdeviceglobals.cpp:86 +#: libk3bdevice.new/k3bdeviceglobals.cpp:86 +msgid "None" +msgstr "Κανένα" + +#: libk3bdevice/k3bdeviceglobals.cpp:95 libk9copy/k9dvd.cpp:253 +#: libk9copy/k9dvd.cpp:255 libk3bdevice.new/k3bdeviceglobals.cpp:95 +msgid "Unknown" +msgstr "Άγνωστο" + +#: libk3bdevice/k3bdeviceglobals.cpp:99 +#: libk3bdevice.new/k3bdeviceglobals.cpp:99 +msgid "No media" +msgstr "ΧωÏίς μέσο" + +#: libk3bdevice/k3bdeviceglobals.cpp:106 +#: libk3bdevice.new/k3bdeviceglobals.cpp:106 +msgid "DVD-R Sequential" +msgstr "DVD-R συνεχές" + +#: libk3bdevice/k3bdeviceglobals.cpp:109 +#: libk3bdevice.new/k3bdeviceglobals.cpp:109 +msgid "DVD-R Dual Layer" +msgstr "DVD-R διπλής στÏώσης" + +#: libk3bdevice/k3bdeviceglobals.cpp:111 +#: libk3bdevice.new/k3bdeviceglobals.cpp:111 +msgid "DVD-R Dual Layer Sequential" +msgstr "DVD-R συνεχές διπλής στÏώσης" + +#: libk3bdevice/k3bdeviceglobals.cpp:113 +#: libk3bdevice.new/k3bdeviceglobals.cpp:113 +msgid "DVD-R Dual Layer Jump" +msgstr "DVD-R διπλής στÏώσης με άλμα" + +#: libk3bdevice/k3bdeviceglobals.cpp:120 +#: libk3bdevice.new/k3bdeviceglobals.cpp:120 +msgid "DVD-RW Restricted Overwrite" +msgstr "DVD-RW πεÏιοÏισμένης αντικατάστασης" + +#: libk3bdevice/k3bdeviceglobals.cpp:122 +#: libk3bdevice.new/k3bdeviceglobals.cpp:122 +msgid "DVD-RW Sequential" +msgstr "DVD-RW συνεχές" + +#: libk3bdevice/k3bdeviceglobals.cpp:128 +#: libk3bdevice.new/k3bdeviceglobals.cpp:128 +msgid "DVD+R Double Layer" +msgstr "DVD+R διπλής στÏώσης" + +#: src/k9copy.cpp:66 +msgid "Play title" +msgstr "ΑναπαÏαγωγή τίτλου" + +#: src/k9copy.cpp:80 +msgid "Create MPEG-4" +msgstr "ΔημιουÏγία MPEG-4" + +#: src/k9copy.cpp:94 +msgid "Settings" +msgstr "Ρυθμίσεις" + +#: src/kviewmpeg2.cpp:100 +msgid "Can't find device %1\n" +msgstr "Δε βÏέθηκε η συσκευή %1\n" + +#: src/kviewmpeg2.cpp:107 libk9copy/k9dvd.cpp:339 +msgid "Can't open disc %1!\n" +msgstr "ΑδÏνατο το άνοιγμα του δίσκου %1!\n" + +#: src/kviewmpeg2.cpp:135 libk9copy/k9dvd.cpp:848 +msgid "Error opening vobs for title %1\n" +msgstr "Σφάλμα ανοίγματος των αÏχείων vob για τον τίτλο %1\n" + +#: src/kviewmpeg2.cpp:149 libk9copy/k9dvd.cpp:859 +msgid "ERROR reading block %1\n" +msgstr "Σφάλμα ανάγνωσης του μπλοκ %1\n" + +#: src/main.cpp:30 +msgid "A DVD Backup tool for KDE" +msgstr "Ένα εÏγαλείο δημιουÏγίας αντιγÏάφων ασφαλείας DVD για το KDE" + +#: src/main.cpp:35 +msgid "input device" +msgstr "Συσκευή εισόδου" + +#: src/main.cpp:37 +msgid "output device" +msgstr "Συσκευή εξόδου" + +#: src/main.cpp:38 +msgid "title to play" +msgstr "Τίτλος για αναπαÏαγωγή" + +#: src/main.cpp:39 +msgid "play title to stdout" +msgstr "ΑναπαÏαγωγή τίτλου στο stdout" + +#: src/main.cpp:40 +msgid "start sector" +msgstr "ΑÏχικός σέκτοÏας" + +#: src/main.cpp:41 +msgid "end sector" +msgstr "Τελικός σέκτοÏας" + +#: src/main.cpp:42 +msgid "list of audio streams" +msgstr "Λίστα Ïοών ήχου" + +#: src/main.cpp:43 +msgid "list of spu streams" +msgstr "Λίστα Ïοών spu" + +#: src/main.cpp:44 +msgid "shrink factor" +msgstr "ΠαÏάγοντας συμπίεσης" + +#: src/main.cpp:45 +msgid "size of the cell to be copied" +msgstr "Μέγεθος του ÎºÎµÎ»Î¹Î¿Ï Ï€Î¿Ï… θα αντιγÏαφεί" + +#: src/main.cpp:46 +msgid "total size of selected titles" +msgstr "Συνολικό μέγεθος των επιλεγμένων τίτλων" + +#: src/main.cpp:47 +msgid "size of the chapters being copied" +msgstr "Μέγεθος των κεφαλαίων που αντιγÏάφονται" + +#: src/main.cpp:48 +msgid "new dvd size" +msgstr "Îέο μέγεθος του DVD" + +#: src/main.cpp:49 +msgid "selected chapter" +msgstr "Επιλεγμένο κεφάλαιο" + +#: src/main.cpp:50 +msgid "cell number in selected chapter" +msgstr "ΑÏιθμός ÎºÎµÎ»Î¹Î¿Ï ÏƒÏ„Î¿ επιλεγμένο κεφάλαιο" + +#: src/main.cpp:51 +msgid "status file name" +msgstr "Όνομα αÏχείου κατάστασης" + +#: src/main.cpp:52 +msgid "initialize status file" +msgstr "ΑÏχικοποίηση αÏχείου κατάστασης" + +#: src/main.cpp:53 +msgid "continue playing from last sector" +msgstr "Συνέχιση αναπαÏαγωγής από τον τελευταίο σέκτοÏα" + +#: src/main.cpp:62 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:65 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "sng@hellug.gr" + +#: src/main.cpp:66 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "ΣπÏÏος ΓεωÏγαÏάς" + +#: src/k9main.cpp:315 src/k9main.cpp:919 +msgid "DVD is not opened" +msgstr "Το DVD δεν είναι ανοικτό" + +#: src/k9main.cpp:315 src/k9main.cpp:328 +msgid "DVD Copy" +msgstr "ΑντιγÏαφή DVD" + +#: src/k9main.cpp:322 libk9copy/k9burndvd.cpp:173 +msgid "Save image to disk" +msgstr "Αποθήκευση εικόνας στο δίσκο" + +#: src/k9main.cpp:328 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"Δεν υπάÏχει αÏκετός χώÏος στο %1\n" +"Υπολείπεται κατά %2 ΜΒ." + +#: src/k9main.cpp:385 src/k9main.cpp:951 +msgid "ISO Image" +msgstr "Εικόνα ISO" + +#: src/k9main.cpp:422 +msgid "Open DVD" +msgstr "Άνοιγμα DVD" + +#: src/k9main.cpp:441 +msgid "Titleset %1" +msgstr "Τίτλοι %1" + +#: src/k9main.cpp:514 +msgid "video %1 " +msgstr "Bίντεο %1 " + +#: src/k9main.cpp:526 +msgid "audio %1 " +msgstr "Ήχος %1 " + +#: src/k9main.cpp:543 +msgid "subpicture %1 " +msgstr "Υπότιτλος %1 " + +#: src/k9main.cpp:919 src/k9settings.cpp:40 libk9copy/k9mp4enc.cpp:195 +msgid "MPEG-4 Encoding" +msgstr "Κωδικοποίηση MPEG-4" + +#: src/k9main.cpp:1091 debug/src/k9mainw.cpp:304 debug/src/prefMencoder.cpp:37 +#: debug/src/prefMencoder.cpp:87 rc.cpp:50 rc.cpp:161 +#, no-c-format +msgid "Audio" +msgstr "Ήχος" + +#: src/k9main.cpp:1102 +msgid "Subtitles" +msgstr "Υπότιτλοι" + +#: src/k9main.cpp:1123 src/k9main.cpp:1245 libk9copy/k9burndvd.cpp:167 +#: debug/src/k9mainw.cpp:296 rc.cpp:20 +#, no-c-format +msgid "default" +msgstr "ΠÏοκαθοÏισμένο" + +#: src/k9main.cpp:1131 +msgid "Open ISO Image" +msgstr "Άνοιγμα εικόνας ISO" + +#: src/k9main.cpp:1138 +msgid "Open DVD folder" +msgstr "Άνοιγμα φακέλου DVD" + +#: src/k9main.cpp:1247 +msgid "none" +msgstr "κανένα" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "Συσκευές" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "Συσκευές που δεν εντοπίστηκαν από το k9copy" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 +msgid "DVD Backup" +msgstr "ΑντίγÏαφο DVD" + +#: src/k9settings.cpp:40 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:46 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:46 +msgid "MPEG-4 Codecs" +msgstr "Κωδικοποιητές MPEG-4" + +#: src/k9prefmpeg4.cpp:33 src/k9prefdvd.cpp:33 libk9copy/k9mp4enc.cpp:94 +msgid "mb" +msgstr "mb" + +#: src/menupreview.cpp:1084 debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - ΠÏοεπισκόπηση μενοÏ" + +#: libk9copy/k9dvdauthor.cpp:107 libk9copy/k9dvdauthor.cpp:294 +msgid "'%1' not selected" +msgstr "Το '%1' δεν έχει επιλεγεί" + +#: libk9copy/k9dvdauthor.cpp:108 libk9copy/k9dvdauthor.cpp:295 +#: libk9copy/k9dvdauthor.cpp:355 libk9copy/k9dvdauthor.cpp:364 +#: libk9copy/k9dvdauthor.cpp:367 libk9copy/k9burndvd.cpp:193 +#: libk9copy/k9burndvd.cpp:210 +msgid "authoring" +msgstr "ΣÏνταξη" + +#: libk9copy/k9dvdauthor.cpp:325 libk9copy/k9dvdauthor.cpp:391 +#: libk9copy/k9dvdauthor.cpp:429 +msgid "Authoring" +msgstr "ΣÏνταξη" + +#: libk9copy/k9dvdauthor.cpp:326 debug/libk9copy/backupdlg.cpp:162 rc.cpp:172 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - ΠÏόοδος δημιουÏγίας αντιγÏάφου" + +#: libk9copy/k9dvdauthor.cpp:355 +msgid "Dvdauthor error :\n" +msgstr "Σφάλμα του Dvdauthor:\n" + +#: libk9copy/k9dvdauthor.cpp:364 +msgid "Authoring cancelled" +msgstr "Η σÏνταξη ακυÏώθηκε" + +#: libk9copy/k9dvdauthor.cpp:367 +msgid "An error occured while running DVDAuthor:\n" +msgstr "ΠαÏουσιάστηκε ένα σφάλμα κατά την εκτέλεση του DVDAuthor:\n" + +#: libk9copy/k9dvdauthor.cpp:430 +msgid "Fixing VOBUS" +msgstr "ΔιόÏθωση VOBUS" + +#: libk9copy/k9dvdbackup.cpp:137 libk9copy/k9dvdbackup.cpp:151 +#: libk9copy/k9dvdbackup.cpp:491 libk9copy/k9dvdbackup.cpp:648 +msgid "DVD backup cancelled" +msgstr "Η δημιουÏγία αντιγÏάφου του DVD ακυÏώθηκε" + +#: libk9copy/k9dvdbackup.cpp:164 +msgid "unable to open VIDEO_TS.IFO" +msgstr "ΑδÏνατο το άνοιγμα του VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:186 libk9copy/k9dvdbackup.cpp:364 +#: libk9copy/k9dvdbackup.cpp:429 +msgid "Unable to open file " +msgstr "ΑδÏνατο το άνοιγμα του αÏχείου " + +#: libk9copy/k9dvdbackup.cpp:257 +msgid "Unable to open titleset %1" +msgstr "ΑδÏνατο το άνοιγμα των τίτλων %1" + +#: libk9copy/k9dvdbackup.cpp:263 libk9copy/k9dvdbackup.cpp:620 +msgid "Extracting titleset %1" +msgstr "Εξαγωγή των τίτλων %1" + +#: libk9copy/k9dvdbackup.cpp:436 libk9copy/k9dvdbackup.cpp:564 +msgid "Unable to open menu for titleset %1" +msgstr "ΑδÏνατο το άνοιγμα του Î¼ÎµÎ½Î¿Ï Î³Î¹Î± το %1" + +#: libk9copy/k9dvdbackup.cpp:458 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting menu for titleset %1" +msgstr "Εξαγωγή Î¼ÎµÎ½Î¿Ï Î³Î¹Î± τους τίτλους %1" + +#: libk9copy/k9dvdbackup.cpp:557 +msgid "Unable to open " +msgstr "ΑδÏνατο το άνοιγμα του " + +#: libk9copy/k9dvdbackup.cpp:612 +msgid "Unable to open ifo file for titleset %1" +msgstr "ΑδÏνατο το άνοιγμα του αÏχείου ifo για τους τίτλους %1" + +#: libk9copy/k9dvdbackup.cpp:624 libk9copy/k9dvdbackup.cpp:1595 +msgid "Unable to open DVD" +msgstr "ΑδÏνατο το άνοιγμα του DVD" + +#: libk9copy/k9dvdbackup.cpp:634 +msgid "Unable to open vobs for titleset %1" +msgstr "ΑδÏνατο το άνοιγμα των αÏχείων vob για τους τίτλους %1" + +#: libk9copy/k9dvdbackup.cpp:1318 +msgid "Updating vob %1" +msgstr "ΕνημέÏωση του vob %1" + +#: libk9copy/k9dvdbackup.cpp:1334 +msgid "DVD backup canceled" +msgstr "Η δημιουÏγία αντιγÏάφου του DVD ακυÏώθηκε" + +#: libk9copy/k9dvd.cpp:191 +msgid "Couldn't open %1 for title\n" +msgstr "ΑδÏνατο το άνοιγμα του %1 για τον τίτλο\n" + +#: libk9copy/k9dvd.cpp:199 +msgid "Couldn't seek in %1 for title\n" +msgstr "ΑδÏνατη η αναζήτηση στο %1 για τον τίτλο\n" + +#: libk9copy/k9dvd.cpp:226 +msgid "Not Specified" +msgstr "Mη καθοÏισμένο" + +#: libk9copy/k9dvd.cpp:226 +msgid "Afar" +msgstr "ΑφάÏ" + +#: libk9copy/k9dvd.cpp:226 +msgid "Abkhazian" +msgstr "Απκαζιανά" + +#: libk9copy/k9dvd.cpp:226 +msgid "Afrikaans" +msgstr "ΑφÏικανικά" + +#: libk9copy/k9dvd.cpp:226 +msgid "Amharic" +msgstr "ΑμαÏικανά" + +#: libk9copy/k9dvd.cpp:227 +msgid "Arabic" +msgstr "ΑÏαβικά" + +#: libk9copy/k9dvd.cpp:227 +msgid "Assamese" +msgstr "Ασαμίγια" + +#: libk9copy/k9dvd.cpp:227 +msgid "Aymara" +msgstr "ΑϊμάÏα" + +#: libk9copy/k9dvd.cpp:227 +msgid "Azerbaijani" +msgstr "ΑζεÏμπαϊτζανικά" + +#: libk9copy/k9dvd.cpp:227 +msgid "Bashkir" +msgstr "ΜπασκίÏ" + +#: libk9copy/k9dvd.cpp:228 +msgid "Byelorussian" +msgstr "ΛευκοÏωσικά" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bulgarian" +msgstr "ΒουλγαÏικά" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bihari" +msgstr "ΜπιχάÏι" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bislama" +msgstr "Μπισλάμα" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bengali; Bangla" +msgstr "Bengali; Bangla" + +#: libk9copy/k9dvd.cpp:229 +msgid "Tibetan" +msgstr "Θιβετιανά" + +#: libk9copy/k9dvd.cpp:229 +msgid "Breton" +msgstr "ΜπÏετόν" + +#: libk9copy/k9dvd.cpp:229 +msgid "Catalan" +msgstr "Καταλανικά" + +#: libk9copy/k9dvd.cpp:229 +msgid "Corsican" +msgstr "ΚοÏσικανικά" + +#: libk9copy/k9dvd.cpp:229 +msgid "Czech" +msgstr "Τσέχικα" + +#: libk9copy/k9dvd.cpp:230 +msgid "Welsh" +msgstr "Ουαλικά" + +#: libk9copy/k9dvd.cpp:230 +msgid "Dansk" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Deutsch" +msgstr "ΓεÏμανικά" + +#: libk9copy/k9dvd.cpp:230 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Greek" +msgstr "Ελληνικά" + +#: libk9copy/k9dvd.cpp:230 +msgid "English" +msgstr "Αγγλικά" + +#: libk9copy/k9dvd.cpp:231 +msgid "Esperanto" +msgstr "ΕσπεÏάντο" + +#: libk9copy/k9dvd.cpp:231 +msgid "Espanol" +msgstr "Ισπανικά" + +#: libk9copy/k9dvd.cpp:231 +msgid "Estonian" +msgstr "Εσθονικά" + +#: libk9copy/k9dvd.cpp:231 +msgid "Basque" +msgstr "Βασκικά" + +#: libk9copy/k9dvd.cpp:231 +msgid "Persian" +msgstr "ΠεÏσικά" + +#: libk9copy/k9dvd.cpp:232 +msgid "Suomi" +msgstr "Σουόμι" + +#: libk9copy/k9dvd.cpp:232 +msgid "Fiji" +msgstr "Φίτζι" + +#: libk9copy/k9dvd.cpp:232 +msgid "Faroese" +msgstr "Faroese" + +#: libk9copy/k9dvd.cpp:232 +msgid "Francais" +msgstr "Γαλλικά" + +#: libk9copy/k9dvd.cpp:232 +msgid "Frisian" +msgstr "ΦÏυγικά" + +#: libk9copy/k9dvd.cpp:232 +msgid "Gaelic" +msgstr "Κελτικά" + +#: libk9copy/k9dvd.cpp:233 +msgid "Scots Gaelic" +msgstr "Κελτικά Σκωτίας" + +#: libk9copy/k9dvd.cpp:233 +msgid "Galician" +msgstr "Γαλικιανικά" + +#: libk9copy/k9dvd.cpp:233 +msgid "Guarani" +msgstr "ΓκουαÏάνι" + +#: libk9copy/k9dvd.cpp:233 +msgid "Gujarati" +msgstr "Gujarati" + +#: libk9copy/k9dvd.cpp:233 +msgid "Hausa" +msgstr "ΧαοÏζα" + +#: libk9copy/k9dvd.cpp:234 libk9copy/k9dvd.cpp:236 +msgid "Hebrew" +msgstr "ΕβÏαϊκά" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hindi" +msgstr "Hindi" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hrvatski" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Magyar" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Armenian" +msgstr "ΑÏμενικά" + +#: libk9copy/k9dvd.cpp:235 +msgid "Interlingua" +msgstr "Interlingua" + +#: libk9copy/k9dvd.cpp:235 +msgid "Indonesian" +msgstr "Ινδονησιακά" + +#: libk9copy/k9dvd.cpp:235 +msgid "Interlingue" +msgstr "διεθνής" + +#: libk9copy/k9dvd.cpp:235 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Italiano" +msgstr "1Ιταλικά" + +#: libk9copy/k9dvd.cpp:236 +msgid "Inuktitut" +msgstr "Inuktitut" + +#: libk9copy/k9dvd.cpp:236 +msgid "Japanese" +msgstr "Ιαπωνικά" + +#: libk9copy/k9dvd.cpp:237 libk9copy/k9dvd.cpp:252 +msgid "Yiddish" +msgstr "Γίντις" + +#: libk9copy/k9dvd.cpp:237 +msgid "Javanese" +msgstr "Ιαβανικά" + +#: libk9copy/k9dvd.cpp:237 +msgid "Georgian" +msgstr "ΓεωÏγιανά" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kazakh" +msgstr "Κοζάκικη" + +#: libk9copy/k9dvd.cpp:237 +msgid "Greenlandic" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Cambodian" +msgstr "Καμποτζίανά" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kannada" +msgstr "Καναδικά" + +#: libk9copy/k9dvd.cpp:238 +msgid "Korean" +msgstr "ΚοÏεάτικα" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kashmiri" +msgstr "ΚασμιÏικά" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kurdish" +msgstr "ΚουÏδικά" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kirghiz" +msgstr "ΚιÏγκιζιστανά" + +#: libk9copy/k9dvd.cpp:239 +msgid "Latin" +msgstr "Λατινικά" + +#: libk9copy/k9dvd.cpp:239 +msgid "Lingala" +msgstr "Λινγκάλα" + +#: libk9copy/k9dvd.cpp:239 +msgid "Laothian" +msgstr "Λιθουανικά" + +#: libk9copy/k9dvd.cpp:239 +msgid "Lithuanian" +msgstr "Λιθουανικά" + +#: libk9copy/k9dvd.cpp:240 +msgid "Latvian, Lettish" +msgstr "Λιθουανικά" + +#: libk9copy/k9dvd.cpp:240 +msgid "Malagasy" +msgstr "Μαλαγάσι" + +#: libk9copy/k9dvd.cpp:240 +msgid "Maori" +msgstr "ΜαοÏί" + +#: libk9copy/k9dvd.cpp:240 +msgid "Macedonian" +msgstr "Σλαβομακεδονικά" + +#: libk9copy/k9dvd.cpp:240 +msgid "Malayalam" +msgstr "Malayalam" + +#: libk9copy/k9dvd.cpp:241 +msgid "Mongolian" +msgstr "Μογγολικά" + +#: libk9copy/k9dvd.cpp:241 +msgid "Moldavian" +msgstr "Μολδαβικά" + +#: libk9copy/k9dvd.cpp:241 +msgid "Marathi" +msgstr "ΜαÏάτι" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malay" +msgstr "Μαλαισιανά" + +#: libk9copy/k9dvd.cpp:241 +msgid "Maltese" +msgstr "Μαλτέζικα" + +#: libk9copy/k9dvd.cpp:242 +msgid "Burmese" +msgstr "ΒιÏμανικά" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nauru" +msgstr "ÎαουÏοÏ" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nepali" +msgstr "Îεπαλικά" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nederlands" +msgstr "Ολανδικά" + +#: libk9copy/k9dvd.cpp:242 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Occitan" +msgstr "Οκιτάν" + +#: libk9copy/k9dvd.cpp:243 +msgid "Oromo" +msgstr "ΟÏόμο" + +#: libk9copy/k9dvd.cpp:243 +msgid "Oriya" +msgstr "Oriya" + +#: libk9copy/k9dvd.cpp:243 +msgid "Punjabi" +msgstr "Παντσάμπι" + +#: libk9copy/k9dvd.cpp:243 +msgid "Polish" +msgstr "Πολωνικά" + +#: libk9copy/k9dvd.cpp:243 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Portugues" +msgstr "ΠοÏτογαλικά" + +#: libk9copy/k9dvd.cpp:244 +msgid "Quechua" +msgstr "ΚουετσοÏα" + +#: libk9copy/k9dvd.cpp:244 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Romanian" +msgstr "Ρουμάνικα" + +#: libk9copy/k9dvd.cpp:245 +msgid "Russian" +msgstr "Ρωσικά" + +#: libk9copy/k9dvd.cpp:245 +msgid "Kinyarwanda" +msgstr "ΚινγιαÏουάντα" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sanskrit" +msgstr "ΣανσκÏιτικά" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sindhi" +msgstr "Σίντχι" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Serbo-Croatian" +msgstr "ΣεÏβοκÏοάτικα" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sinhalese" +msgstr "Σινχαλεζικά" + +#: libk9copy/k9dvd.cpp:246 +msgid "Slovak" +msgstr "Σλοβακικά" + +#: libk9copy/k9dvd.cpp:246 +msgid "Slovenian" +msgstr "Σλοβενικά" + +#: libk9copy/k9dvd.cpp:246 +msgid "Samoan" +msgstr "Σαμοάν" + +#: libk9copy/k9dvd.cpp:247 +msgid "Shona" +msgstr "Σόνα" + +#: libk9copy/k9dvd.cpp:247 +msgid "Somali" +msgstr "Σομάλι" + +#: libk9copy/k9dvd.cpp:247 +msgid "Albanian" +msgstr "Αλβανικά" + +#: libk9copy/k9dvd.cpp:247 +msgid "Serbian" +msgstr "ΣεÏβικά" + +#: libk9copy/k9dvd.cpp:247 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Sundanese" +msgstr "Σουντανέζ" + +#: libk9copy/k9dvd.cpp:248 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Swahili" +msgstr "Σουαχίλι" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tamil" +msgstr "Ταμίλ" + +#: libk9copy/k9dvd.cpp:249 +msgid "Telugu" +msgstr "Telugu" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tajik" +msgstr "Τατζικικά" + +#: libk9copy/k9dvd.cpp:249 +msgid "Thai" +msgstr "Ταϊλανδικά" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tigrinya" +msgstr "ΤιγÏίνια" + +#: libk9copy/k9dvd.cpp:249 +msgid "Turkmen" +msgstr "ΤουÏκμενικά" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tagalog" +msgstr "Ταγκαλόγκ" + +#: libk9copy/k9dvd.cpp:250 +msgid "Setswana" +msgstr "Setswana" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tonga" +msgstr "Τόνγκα" + +#: libk9copy/k9dvd.cpp:250 +msgid "Turkish" +msgstr "ΤουÏκικά" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tsonga" +msgstr "Τσόνγκα" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tatar" +msgstr "ΤαταÏικά" + +#: libk9copy/k9dvd.cpp:250 +msgid "Twi" +msgstr "Τβι" + +#: libk9copy/k9dvd.cpp:251 +msgid "Uighur" +msgstr "ΟυιγκοÏÏ" + +#: libk9copy/k9dvd.cpp:251 +msgid "Ukrainian" +msgstr "ΟυκÏανικά" + +#: libk9copy/k9dvd.cpp:251 +msgid "Urdu" +msgstr "ΟυÏντοÏ" + +#: libk9copy/k9dvd.cpp:251 +msgid "Uzbek" +msgstr "Ουζμπεκικά" + +#: libk9copy/k9dvd.cpp:251 +msgid "Vietnamese" +msgstr "Βιετναμέζικα" + +#: libk9copy/k9dvd.cpp:252 +msgid "Volapuk" +msgstr "Volapuk" + +#: libk9copy/k9dvd.cpp:252 +msgid "Wolof" +msgstr "Ουόλοφ" + +#: libk9copy/k9dvd.cpp:252 +msgid "Xhosa" +msgstr "Ξόσα" + +#: libk9copy/k9dvd.cpp:252 +msgid "Yoruba" +msgstr "ΓιοÏοÏμπα" + +#: libk9copy/k9dvd.cpp:252 +msgid "Zhuang" +msgstr "Χουάνγκ" + +#: libk9copy/k9dvd.cpp:253 +msgid "Chinese" +msgstr "Κινέζικα" + +#: libk9copy/k9dvd.cpp:253 +msgid "Zulu" +msgstr "ΖουλοÏ" + +#: libk9copy/k9dvd.cpp:349 +msgid "Can't open main ifo!\n" +msgstr "ΑδÏνατο το άνοιγμα του κÏÏιου αÏχείου ifo!\n" + +#: libk9copy/k9dvd.cpp:364 +msgid "unknown" +msgstr "Άγνωστο" + +#: libk9copy/k9dvd.cpp:388 libk9copy/k9dvd.cpp:675 +msgid "Title %1" +msgstr "Τίτλος %1" + +#: libk9copy/k9dvd.cpp:723 +msgid "reading title" +msgstr "Ανάγνωση τίτλου" + +#: libk9copy/k9mp4enc.cpp:84 +msgid "Save file to disk" +msgstr "Αποθήκευση αÏχείου στο δίσκο" + +#: libk9copy/k9mp4enc.cpp:124 libk9copy/k9mp4enc.cpp:131 +#: libk9copy/k9mp4enc.cpp:149 +msgid "Encoding %1" +msgstr "Κωδικοποίηση του %1" + +#: libk9copy/k9mp4enc.cpp:195 +msgid "MPEG-4 Encoding cancelled" +msgstr "Η κωδικοποίηση MPEG-4 ακυÏώθηκε" + +#: libk9copy/k9mp4enc.cpp:198 +msgid "Error while running mencoder :" +msgstr "ΠαÏουσιάστηκε ένα σφάλμα κατά την εκτέλεση του mencoder:" + +#: libk9copy/k9mp4enc.cpp:198 +msgid "Encoding error" +msgstr "Σφάλμα κωδικοποίησης" + +#: libk9copy/k9burndvd.cpp:144 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - ΕγγÏαφή DVD" + +#: libk9copy/k9burndvd.cpp:145 libk9copy/k9burndvd.cpp:233 +msgid "Burning DVD" +msgstr "ΕγγÏαφή DVD" + +#: libk9copy/k9burndvd.cpp:192 +msgid "Insert a recordable DVD" +msgstr "Εισάγετε ένα εγγÏάψιμο DVD" + +#: libk9copy/k9burndvd.cpp:199 +msgid "Error burning DVD :\n" +msgstr "Σφάλμα εγγÏαφής DVD :\n" + +#: libk9copy/k9burndvd.cpp:199 libk9copy/k9burndvd.cpp:203 +msgid "DVD burning" +msgstr "ΕγγÏαφή DVD" + +#: libk9copy/k9burndvd.cpp:203 +msgid "DVD Burning finished" +msgstr "Η εγγÏαφή του DVD ολοκληÏώθηκε" + +#: libk9copy/k9burndvd.cpp:209 +msgid "An error occured while Burning DVD: %1" +msgstr "ΠαÏουσιάστηκε σφάλμα κατά την εγγÏαφή του DVD: %1" + +#: libk9copy/k9burndvd.cpp:209 +msgid "Insert an other DVD" +msgstr "Εισάγετε ένα άλλο DVD" + +#: libk9copy/k9burndvd.cpp:234 +msgid "Current write speed :%1 x" +msgstr "ΤÏέχουσα ταχÏτητα εγγÏαφής: %1 x" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "kDecMPEG2" + +#: debug/libk9copy/backupdlg.cpp:163 rc.cpp:175 +#, no-c-format +msgid "A&bort" +msgstr "Εγ&κατάλειψη" + +#: debug/libk9copy/backupdlg.cpp:164 rc.cpp:178 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+Κ" + +#: debug/libk9copy/backupdlg.cpp:165 rc.cpp:181 +#, no-c-format +msgid "--:--:--" +msgstr "--:--:--" + +#: debug/libk9copy/backupdlg.cpp:166 rc.cpp:184 +#, no-c-format +msgid "Current step" +msgstr "ΤÏέχον βήμα" + +#: debug/libk9copy/backupdlg.cpp:167 debug/libk9copy/progress.cpp:107 +#: debug/libk9copy/mp4dlg.cpp:129 rc.cpp:187 rc.cpp:210 rc.cpp:234 +#, no-c-format +msgid "Elapsed Time" +msgstr "ΧÏόνος που πέÏασε" + +#: debug/libk9copy/backupdlg.cpp:168 rc.cpp:190 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

ΑντίγÏαφο DVD

" + +#: debug/libk9copy/dvdprogress.cpp:92 rc.cpp:194 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - Ανάλυση DVD" + +#: debug/libk9copy/progress.cpp:103 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 rc.cpp:200 +#, no-c-format +msgid "k9Copy" +msgstr "k9Copy" + +#: debug/libk9copy/progress.cpp:106 debug/src/progress.cpp:81 rc.cpp:207 +#, fuzzy, no-c-format +msgid "Alt+C" +msgstr "Alt+C" + +#: debug/libk9copy/mp4dlg.cpp:120 rc.cpp:215 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - Κωδικοποίηση" + +#: debug/libk9copy/mp4dlg.cpp:121 rc.cpp:218 +#, no-c-format +msgid "Encoding" +msgstr "Κωδικοποίηση" + +#: debug/libk9copy/mp4dlg.cpp:122 rc.cpp:221 +#, no-c-format +msgid "Annu&ler" +msgstr "&ΑκÏÏωση" + +#: debug/libk9copy/mp4dlg.cpp:123 rc.cpp:224 +#, no-c-format +msgid "Alt+L" +msgstr "Alt+Α" + +#: debug/libk9copy/mp4dlg.cpp:128 rc.cpp:231 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: debug/libk9copy/mp4dlg.cpp:130 rc.cpp:237 +#, no-c-format +msgid "Bitrate" +msgstr "Ρυθμός bit" + +#: debug/libk9copy/mp4dlg.cpp:131 debug/src/k9mainw.cpp:106 +#: debug/src/k9mainw.cpp:299 rc.cpp:32 rc.cpp:240 +#, no-c-format +msgid "Size" +msgstr "Μέγεθος" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDVideoStream" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDAudioStream" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:326 +#: debug/libk9copy/k9dvdtitle.moc.cpp:334 +msgid "k9DVDSubtitle" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:399 +#: debug/libk9copy/k9dvdtitle.moc.cpp:407 +msgid "k9DVDTitle" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:472 +#: debug/libk9copy/k9dvdtitle.moc.cpp:480 +msgid "k9DVDTitleset" +msgstr "" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "" + +#: debug/src/viewmpeg2.cpp:631 rc.cpp:3 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - ΠÏοεπισκόπηση τίτλου" + +#: debug/src/configDlg.cpp:42 debug/src/configDlg.cpp:96 rc.cpp:69 +#, no-c-format +msgid "device" +msgstr "Συσκευή" + +#: debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:97 rc.cpp:72 +#, no-c-format +msgid "label" +msgstr "Ετικέτα" + +#: debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:98 rc.cpp:75 +#, no-c-format +msgid "Input" +msgstr "Είσοδος" + +#: debug/src/configDlg.cpp:48 debug/src/configDlg.cpp:99 rc.cpp:78 +#, no-c-format +msgid "Output" +msgstr "Έξοδος" + +#: debug/src/configDlg.cpp:95 rc.cpp:66 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Συσκευές" + +#: debug/src/k9mainw.cpp:105 debug/src/k9mainw.cpp:298 rc.cpp:29 +#, no-c-format +msgid "Title" +msgstr "Τίτλος" + +#: debug/src/k9mainw.cpp:212 debug/src/k9mainw.cpp:309 rc.cpp:61 +#, no-c-format +msgid "Languages" +msgstr "Γλώσσες" + +#: debug/src/k9mainw.cpp:291 rc.cpp:8 +#, no-c-format +msgid "MainDlg" +msgstr "" + +#: debug/src/k9mainw.cpp:292 rc.cpp:11 +#, no-c-format +msgid "Output device " +msgstr "Συσκευή εξόδου " + +#: debug/src/k9mainw.cpp:293 rc.cpp:14 +#, no-c-format +msgid "@" +msgstr "@" + +#: debug/src/k9mainw.cpp:294 rc.cpp:17 +#, no-c-format +msgid "Input device " +msgstr "Συσκευή εισόδου " + +#: debug/src/k9mainw.cpp:297 debug/src/prefMPEG4.cpp:158 rc.cpp:23 rc.cpp:143 +#, no-c-format +msgid "X" +msgstr "X" + +#: debug/src/k9mainw.cpp:300 rc.cpp:38 +#, no-c-format +msgid "&Keep original menus" +msgstr "&ΔιατήÏηση των αÏχικών μενοÏ" + +#: debug/src/k9mainw.cpp:301 debug/src/prefMPEG4.cpp:157 rc.cpp:41 rc.cpp:140 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+Δ" + +#: debug/src/k9mainw.cpp:302 rc.cpp:44 +#, no-c-format +msgid "Default language" +msgstr "ΠÏοκαθοÏισμένη γλώσσα" + +#: debug/src/k9mainw.cpp:303 rc.cpp:47 +#, no-c-format +msgid "Subtitle" +msgstr "Υπότιτλοι" + +#: debug/src/k9mainw.cpp:307 rc.cpp:55 +#, no-c-format +msgid "Selected Titles" +msgstr "Επιλεγμένοι τίτλοι" + +#: debug/src/k9mainw.cpp:308 rc.cpp:35 +#, no-c-format +msgid "DVD playback options" +msgstr "Επιλογές αναπαÏαγωγής DVD" + +#: debug/src/k9mainw.cpp:310 rc.cpp:58 +#, no-c-format +msgid "Selection" +msgstr "Επιλογή" + +#: debug/src/k9mainw.cpp:311 rc.cpp:26 +#, no-c-format +msgid "D&VD" +msgstr "D&VD" + +#: debug/src/prefDVD.cpp:89 rc.cpp:89 +#, no-c-format +msgid "prefDVD" +msgstr "" + +#: debug/src/prefDVD.cpp:90 rc.cpp:92 +#, no-c-format +msgid "Output directory" +msgstr "Κατάλογος εξόδου" + +#: debug/src/prefDVD.cpp:91 rc.cpp:95 +#, no-c-format +msgid "Burn with k3b" +msgstr "ΕγγÏαφή με το k3b" + +#: debug/src/prefDVD.cpp:93 rc.cpp:99 +#, no-c-format +msgid "Auto burn" +msgstr "Αυτόματη εγγÏαφή" + +#: debug/src/prefDVD.cpp:95 rc.cpp:103 +#, no-c-format +msgid "Quick scan" +msgstr "ΓÏήγοÏη σάÏωση" + +#: debug/src/prefDVD.cpp:97 rc.cpp:107 +#, no-c-format +msgid "DVD size" +msgstr "Μέγεθος DVD" + +#: debug/src/prefMPEG4.cpp:145 debug/src/prefMencoder.cpp:84 rc.cpp:110 +#: rc.cpp:152 +#, no-c-format +msgid "Form1" +msgstr "ΦόÏμα1" + +#: debug/src/prefMPEG4.cpp:146 rc.cpp:113 +#, no-c-format +msgid "Video Codec" +msgstr "Kωδικοποιητής βίντεο" + +#: debug/src/prefMPEG4.cpp:147 rc.cpp:116 +#, no-c-format +msgid "Audio bitrate" +msgstr "Ρυθμός bit ήχου" + +#: debug/src/prefMPEG4.cpp:149 rc.cpp:122 +#, no-c-format +msgid "File size" +msgstr "Μέγεθος αÏχείου" + +#: debug/src/prefMPEG4.cpp:151 rc.cpp:128 +#, no-c-format +msgid " mb" +msgstr "" + +#: debug/src/prefMPEG4.cpp:152 rc.cpp:131 +#, no-c-format +msgid "640" +msgstr "" + +#: debug/src/prefMPEG4.cpp:156 rc.cpp:137 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "&ΔιατήÏηση λόγου διαστάσεων" + +#: debug/src/prefMPEG4.cpp:160 rc.cpp:146 +#, no-c-format +msgid "XviD" +msgstr "XviD" + +#: debug/src/prefMPEG4.cpp:161 rc.cpp:149 +#, no-c-format +msgid "lavc MPEG4" +msgstr "" + +#: debug/src/prefMencoder.cpp:33 debug/src/prefMencoder.cpp:85 rc.cpp:155 +#, no-c-format +msgid "Label" +msgstr "Ετικέτα" + +#: debug/src/prefMencoder.cpp:35 debug/src/prefMencoder.cpp:86 rc.cpp:158 +#, no-c-format +msgid "Video" +msgstr "Βίντεο" + +#: debug/src/k9main.moc.cpp:34 debug/src/k9main.moc.cpp:42 +msgid "k9DVDListItem" +msgstr "" + +#: debug/src/k9main.moc.cpp:107 debug/src/k9main.moc.cpp:115 +msgid "k9Main" +msgstr "" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "kViewMPEG2" +msgstr "" + +#: rc.cpp:243 +#, no-c-format +msgid "A&ctions" +msgstr "&ΕνέÏγειες" + +#: rc.cpp:246 +#, no-c-format +msgid "Actions ToolBar" +msgstr "ΓÏαμμή ενεÏγειών" + diff --git a/po/es.po b/po/es.po new file mode 100644 index 0000000..3faf05c --- /dev/null +++ b/po/es.po @@ -0,0 +1,1325 @@ +# translation of es.po to Català +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Daniel Balagué Guardia , 2006. +msgid "" +msgstr "" +"Project-Id-Version: es\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-03-31 23:50+0200\n" +"PO-Revision-Date: 2006-09-06 19:11+0200\n" +"Last-Translator: Daniel Balagué Guardia \n" +"Language-Team: Català \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.2\n" + +#: libk3bdevice/k3bdeviceglobals.cpp:30 libk3bdevice/k3bdeviceglobals.cpp:132 +msgid "CD-R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:32 libk3bdevice/k3bdeviceglobals.cpp:134 +msgid "CD-RW" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:34 libk3bdevice/k3bdeviceglobals.cpp:130 +msgid "CD-ROM" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:36 libk3bdevice/k3bdeviceglobals.cpp:101 +msgid "DVD-ROM" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:38 libk3bdevice/k3bdeviceglobals.cpp:115 +msgid "DVD-RAM" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:40 libk3bdevice/k3bdeviceglobals.cpp:104 +msgid "DVD-R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:42 libk3bdevice/k3bdeviceglobals.cpp:118 +msgid "DVD-RW" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:44 +msgid "DVD-R DL" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:46 libk3bdevice/k3bdeviceglobals.cpp:126 +msgid "DVD+R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:48 libk3bdevice/k3bdeviceglobals.cpp:124 +msgid "DVD+RW" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:50 +msgid "DVD+R DL" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:53 libk3bdevice/k3bdeviceglobals.cpp:137 +msgid "Error" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:63 +msgid "SAO" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:65 +msgid "TAO" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:67 +msgid "RAW" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:69 +msgid "SAO/R96P" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:71 +msgid "SAO/R96R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:73 +msgid "RAW/R16" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:75 +msgid "RAW/R96P" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:77 +msgid "RAW/R96R" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:79 +msgid "Incremental Sequential" +msgstr "Secuencia Incremental" + +#: libk3bdevice/k3bdeviceglobals.cpp:81 +msgid "Restricted Overwrite" +msgstr "Sobreescritura limitada" + +#: libk3bdevice/k3bdeviceglobals.cpp:83 +msgid "Layer Jump" +msgstr "Salto de capa" + +#: libk3bdevice/k3bdeviceglobals.cpp:86 +msgid "None" +msgstr "Ninguno" + +#: libk3bdevice/k3bdeviceglobals.cpp:95 libk9copy/k9dvd.cpp:254 +#: libk9copy/k9dvd.cpp:256 +msgid "Unknown" +msgstr "Desconocido" + +#: libk3bdevice/k3bdeviceglobals.cpp:99 +msgid "No media" +msgstr "Ningún soporte" + +#: libk3bdevice/k3bdeviceglobals.cpp:106 +msgid "DVD-R Sequential" +msgstr "DVD-R Secuencial" + +#: libk3bdevice/k3bdeviceglobals.cpp:109 +msgid "DVD-R Dual Layer" +msgstr "DVD-R Doble Capa (Dual Layer)" + +#: libk3bdevice/k3bdeviceglobals.cpp:111 +msgid "DVD-R Dual Layer Sequential" +msgstr "DVD-R Doble Capa Secuencial (Dual Layer Sequential)" + +#: libk3bdevice/k3bdeviceglobals.cpp:113 +msgid "DVD-R Dual Layer Jump" +msgstr "DVD-R Doble Capa con Salto (Dual Layer Jump)" + +#: libk3bdevice/k3bdeviceglobals.cpp:120 +msgid "DVD-RW Restricted Overwrite" +msgstr "DVD-RW Sobreescritura Limitada" + +#: libk3bdevice/k3bdeviceglobals.cpp:122 +msgid "DVD-RW Sequential" +msgstr "DVD-RW Secuencial" + +#: libk3bdevice/k3bdeviceglobals.cpp:128 +msgid "DVD+R Double Layer" +msgstr "DVD+R Doble Capa (Double Layer)" + +#: src/k9copy.cpp:66 +msgid "Play title" +msgstr "Reproducir título" + +#: src/k9copy.cpp:73 +msgid "Copy" +msgstr "Copia" + +#: src/kburndvd.cpp:137 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - Grabando DVD" + +#: src/kburndvd.cpp:138 src/kburndvd.cpp:224 +msgid "Burning DVD" +msgstr "Gravando DVD" + +#: src/kburndvd.cpp:160 src/k9main.cpp:1092 src/k9mainw.cpp:324 +#: debug/src/k9mainw.cpp:324 rc.cpp:85 +#, no-c-format +msgid "default" +msgstr "Por defecto" + +#: src/kburndvd.cpp:166 src/k9main.cpp:316 +msgid "Save image to disk" +msgstr "Guardar imagen en disco" + +#: src/kburndvd.cpp:185 +msgid "Insert a recordable DVD" +msgstr "Introduzca un DVD grabable" + +#: src/kburndvd.cpp:186 src/kburndvd.cpp:203 libk9copy/k9dvdauthor.cpp:109 +#: libk9copy/k9dvdauthor.cpp:249 libk9copy/k9dvdauthor.cpp:306 +#: libk9copy/k9dvdauthor.cpp:315 libk9copy/k9dvdauthor.cpp:318 +msgid "authoring" +msgstr "creando menús" + +#: src/kburndvd.cpp:192 +msgid "Error burning DVD :\n" +msgstr "Error gravando DVD :\n" + +#: src/kburndvd.cpp:192 src/kburndvd.cpp:196 +msgid "DVD burning" +msgstr "gravando DVD" + +#: src/kburndvd.cpp:196 +msgid "DVD Burning finished" +msgstr "Grabación de DVD finalizada" + +#: src/kburndvd.cpp:202 +msgid "An error occured while Burning DVD: %1" +msgstr "Ha ocurrido un error mientras se grababa el DVD: %1" + +#: src/kburndvd.cpp:202 +msgid "Insert an other DVD" +msgstr "Inserte otro DVD" + +#: src/kburndvd.cpp:224 +msgid "Current write speed :%1 x" +msgstr "Velocidad de escritura actual :%1 x" + +#: src/kviewmpeg2.cpp:100 +msgid "Can't find device %1\n" +msgstr "No se puede encontrar el dispositivo %1\n" + +#: src/kviewmpeg2.cpp:107 libk9copy/k9dvd.cpp:330 +msgid "Can't open disc %1!\n" +msgstr "No se puede abrir el disco %1!\n" + +#: src/kviewmpeg2.cpp:135 libk9copy/k9dvd.cpp:829 +msgid "Error opening vobs for title %1\n" +msgstr "Error abriendo los vobs del título %1\n" + +#: src/kviewmpeg2.cpp:149 libk9copy/k9dvd.cpp:840 +msgid "ERROR reading block %1\n" +msgstr "ERROR leyendo el bloque %1\n" + +#: src/main.cpp:29 +msgid "A DVD Backup tool for KDE" +msgstr "Herramienta para copias de seguridad de DVD para KDE" + +#: src/main.cpp:35 +msgid "input device" +msgstr "Dispositivo de entrada" + +#: src/main.cpp:36 +msgid "output device" +msgstr "Dispositivo de salida" + +#: src/main.cpp:43 +msgid "k9copy" +msgstr "" + +#: src/main.cpp:46 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "Daniel Balagué Guardia" + +#: src/main.cpp:47 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "bullet@k-demar.org" + +#: src/k9main.cpp:309 +msgid "DVD is not opened" +msgstr "No hay ningún DVD abierto" + +#: src/k9main.cpp:309 src/k9main.cpp:322 +msgid "DVD Copy" +msgstr "Copia DVD" + +#: src/k9main.cpp:322 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"No hay espacio suficiente en %1\n" +"Se esperaban %2 mb." + +#: src/k9main.cpp:381 src/k9main.cpp:891 +msgid "ISO Image" +msgstr "Imagen ISO" + +#: src/k9main.cpp:417 +msgid "Open DVD" +msgstr "Abrir DVD" + +#: src/k9main.cpp:436 +msgid "Titleset %1" +msgstr "Título %1" + +#: src/k9main.cpp:522 +msgid "video %1 " +msgstr "vídeo %1 " + +#: src/k9main.cpp:534 +msgid "audio %1 " +msgstr "" + +#: src/k9main.cpp:551 +msgid "subpicture %1 " +msgstr "Subtítulo %1 " + +#: src/k9main.cpp:916 +msgid "Next title" +msgstr "Título siguiente" + +#: src/k9main.cpp:1061 +msgid "Audio" +msgstr "" + +#: src/k9main.cpp:1072 +msgid "Subtitles" +msgstr "Subtítulos" + +#: src/k9main.cpp:1100 +msgid "Open ISO Image" +msgstr "Abrir imagen ISO" + +#: src/k9main.cpp:1107 +msgid "Open DVD folder" +msgstr "Abrir ruta del DVD" + +#: src/menupreview.cpp:1084 debug/src/menupreview.cpp:1084 rc.cpp:3 +#, no-c-format +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Previsualización del Menú" + +#: src/menupreview.cpp:1085 src/configDlg.cpp:118 +#: debug/src/menupreview.cpp:1085 debug/src/configDlg.cpp:118 rc.cpp:6 +#: rc.cpp:99 +#, no-c-format +msgid "&OK" +msgstr "&Aceptar" + +#: src/viewmpeg2.cpp:631 debug/src/viewmpeg2.cpp:631 rc.cpp:10 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Previsualización del Título" + +#: src/configDlg.cpp:62 src/configDlg.cpp:122 debug/src/configDlg.cpp:62 +#: debug/src/configDlg.cpp:122 rc.cpp:107 +#, no-c-format +msgid "device" +msgstr "Dispositivo" + +#: src/configDlg.cpp:64 src/configDlg.cpp:123 debug/src/configDlg.cpp:64 +#: debug/src/configDlg.cpp:123 rc.cpp:110 +#, no-c-format +msgid "label" +msgstr "Etiqueta" + +#: src/configDlg.cpp:66 src/configDlg.cpp:124 debug/src/configDlg.cpp:66 +#: debug/src/configDlg.cpp:124 rc.cpp:113 +#, no-c-format +msgid "Input" +msgstr "Entrada" + +#: src/configDlg.cpp:68 src/configDlg.cpp:125 debug/src/configDlg.cpp:68 +#: debug/src/configDlg.cpp:125 rc.cpp:116 +#, no-c-format +msgid "Output" +msgstr "Salida" + +#: src/configDlg.cpp:116 debug/src/configDlg.cpp:116 rc.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Dispositivos" + +#: src/configDlg.cpp:117 debug/src/configDlg.cpp:117 rc.cpp:96 +#, no-c-format +msgid "

Devices not detected by k9copy

" +msgstr "

Dispositivos no detectados por k9copy

" + +#: src/configDlg.cpp:120 libk9copy/progress.cpp:80 +#: debug/libk9copy/progress.cpp:79 debug/src/configDlg.cpp:120 rc.cpp:103 +#: rc.cpp:163 +#, no-c-format +msgid "&Cancel" +msgstr "&Cancelar" + +#: src/configDlg.cpp:126 debug/src/configDlg.cpp:126 rc.cpp:119 +#, no-c-format +msgid "&Add" +msgstr "&Añadir" + +#: src/configDlg.cpp:127 debug/src/configDlg.cpp:127 rc.cpp:122 +#, no-c-format +msgid "Alt+A" +msgstr "" + +#: src/configDlg.cpp:128 debug/src/configDlg.cpp:128 rc.cpp:125 +#, no-c-format +msgid "&Remove" +msgstr "&Eliminar" + +#: src/configDlg.cpp:129 debug/src/configDlg.cpp:129 rc.cpp:128 +#, no-c-format +msgid "Alt+R" +msgstr "Alt+E" + +#: src/k9mainw.cpp:50 src/k9mainw.cpp:300 debug/src/k9mainw.cpp:50 +#: debug/src/k9mainw.cpp:300 rc.cpp:21 +#, no-c-format +msgid "Title" +msgstr "Título" + +#: src/k9mainw.cpp:51 src/k9mainw.cpp:301 debug/src/k9mainw.cpp:51 +#: debug/src/k9mainw.cpp:301 rc.cpp:24 +#, no-c-format +msgid "Size" +msgstr "Tamaño" + +#: src/k9mainw.cpp:112 src/k9mainw.cpp:305 debug/src/k9mainw.cpp:112 +#: debug/src/k9mainw.cpp:305 rc.cpp:36 +#, no-c-format +msgid "Languages" +msgstr "Idiomas" + +#: src/k9mainw.cpp:299 debug/src/k9mainw.cpp:299 rc.cpp:15 +#, no-c-format +msgid "MainDlg" +msgstr "Quadro Principal" + +#: src/k9mainw.cpp:302 debug/src/k9mainw.cpp:302 rc.cpp:27 +#, no-c-format +msgid "At title end" +msgstr "Al final del título" + +#: src/k9mainw.cpp:303 debug/src/k9mainw.cpp:303 rc.cpp:30 +#, no-c-format +msgid "At start" +msgstr "Empezar con" + +#: src/k9mainw.cpp:304 debug/src/k9mainw.cpp:304 rc.cpp:33 +#, no-c-format +msgid "DVD playback options" +msgstr "Opciones de reproducción" + +#: src/k9mainw.cpp:306 debug/src/k9mainw.cpp:306 rc.cpp:39 +#, no-c-format +msgid "&Keep original menus" +msgstr "&Mantener los menús originales" + +#: src/k9mainw.cpp:307 debug/src/k9mainw.cpp:307 rc.cpp:42 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+M" + +#: src/k9mainw.cpp:308 debug/src/k9mainw.cpp:308 rc.cpp:18 +#, no-c-format +msgid "D&VD" +msgstr "" + +#: src/k9mainw.cpp:310 debug/src/k9mainw.cpp:310 rc.cpp:49 +#, no-c-format +msgid "&Save" +msgstr "&Guardar" + +#: src/k9mainw.cpp:311 debug/src/k9mainw.cpp:311 rc.cpp:52 +#, no-c-format +msgid "Alt+S" +msgstr "Alt+G" + +#: src/k9mainw.cpp:312 debug/src/k9mainw.cpp:312 rc.cpp:55 +#, no-c-format +msgid "Output directory" +msgstr "Ruta de salida" + +#: src/k9mainw.cpp:313 debug/src/k9mainw.cpp:313 rc.cpp:58 +#, no-c-format +msgid "DVD size" +msgstr "Tamaño del DVD" + +#: src/k9mainw.cpp:314 debug/src/k9mainw.cpp:314 rc.cpp:61 +#, no-c-format +msgid "Burn with k3b" +msgstr "Grabar con k3b" + +#: src/k9mainw.cpp:315 debug/src/k9mainw.cpp:315 rc.cpp:64 +#, no-c-format +msgid "Quick scan" +msgstr "Lectura rápida" + +#: src/k9mainw.cpp:316 debug/src/k9mainw.cpp:316 rc.cpp:67 +#, no-c-format +msgid "Auto burn" +msgstr "Grabación automática" + +#: src/k9mainw.cpp:317 debug/src/k9mainw.cpp:317 rc.cpp:70 +#, no-c-format +msgid "mb" +msgstr "" + +#: src/k9mainw.cpp:318 debug/src/k9mainw.cpp:318 rc.cpp:45 +#, no-c-format +msgid "Se&ttings" +msgstr "&Opciones" + +#: src/k9mainw.cpp:319 debug/src/k9mainw.cpp:319 rc.cpp:73 +#, no-c-format +msgid "Output device " +msgstr "Dispositivo de Salida" + +#: src/k9mainw.cpp:320 debug/src/k9mainw.cpp:320 rc.cpp:76 +#, no-c-format +msgid "@" +msgstr "" + +#: src/k9mainw.cpp:321 debug/src/k9mainw.cpp:321 rc.cpp:79 +#, no-c-format +msgid "X" +msgstr "" + +#: src/k9mainw.cpp:322 debug/src/k9mainw.cpp:322 rc.cpp:82 +#, no-c-format +msgid "Input device " +msgstr "Dispositivo de entrada" + +#: src/k9mainw.cpp:327 debug/src/k9mainw.cpp:327 rc.cpp:90 +#, no-c-format +msgid "..." +msgstr "" + +#: src/kviewmpeg2.moc.cpp:34 src/kviewmpeg2.moc.cpp:42 +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "kViewMPEG2" +msgstr "" + +#: src/k9copy.moc.cpp:34 src/k9copy.moc.cpp:42 libk9copy/progress.cpp:78 +#: debug/libk9copy/progress.cpp:77 debug/src/k9copy.moc.cpp:34 +#: debug/src/k9copy.moc.cpp:42 rc.cpp:159 +#, no-c-format +msgid "k9Copy" +msgstr "" + +#: src/k9main.moc.cpp:34 src/k9main.moc.cpp:42 debug/src/k9main.moc.cpp:34 +#: debug/src/k9main.moc.cpp:42 +msgid "k9DVDListItem" +msgstr "" + +#: src/k9main.moc.cpp:107 src/k9main.moc.cpp:115 debug/src/k9main.moc.cpp:107 +#: debug/src/k9main.moc.cpp:115 +msgid "k9Main" +msgstr "" + +#: src/kcddrive.moc.cpp:34 src/kcddrive.moc.cpp:42 +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "" + +#: src/kcddrive.moc.cpp:107 src/kcddrive.moc.cpp:115 +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "" + +#: libk9copy/k9dvdauthor.cpp:108 libk9copy/k9dvdauthor.cpp:248 +msgid "'%1' not selected" +msgstr "'%1' no seleccionado" + +#: libk9copy/k9dvdauthor.cpp:276 +msgid "Authoring" +msgstr "Crando Menús" + +#: libk9copy/k9dvdauthor.cpp:306 +msgid "Dvdauthor error :\n" +msgstr "Error de Dvdauthor :\n" + +#: libk9copy/k9dvdauthor.cpp:315 +msgid "Authoring cancelled" +msgstr "Creación de menús cancelada" + +#: libk9copy/k9dvdauthor.cpp:318 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Ha ocurrido un error mientras se ejecutaba DVDAuthor:\n" + +#: libk9copy/k9dvdbackup.cpp:135 libk9copy/k9dvdbackup.cpp:149 +#: libk9copy/k9dvdbackup.cpp:486 libk9copy/k9dvdbackup.cpp:643 +msgid "DVD backup cancelled" +msgstr "Copia de seguridad del DVD cancelada" + +#: libk9copy/k9dvdbackup.cpp:162 +msgid "unable to open VIDEO_TS.IFO" +msgstr "No es posible abrir VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:184 libk9copy/k9dvdbackup.cpp:360 +#: libk9copy/k9dvdbackup.cpp:424 +msgid "Unable to open file " +msgstr "No es posible abrir el archivo" + +#: libk9copy/k9dvdbackup.cpp:253 +msgid "Unable to open titleset %1" +msgstr "No es posible abrir el título %1" + +#: libk9copy/k9dvdbackup.cpp:259 libk9copy/k9dvdbackup.cpp:615 +msgid "Extracting titleset %1" +msgstr "Extrayendo título %1" + +#: libk9copy/k9dvdbackup.cpp:431 libk9copy/k9dvdbackup.cpp:559 +msgid "Unable to open menu for titleset %1" +msgstr "no es possible arir el menú del título %1" + +#: libk9copy/k9dvdbackup.cpp:453 libk9copy/k9dvdbackup.cpp:566 +msgid "Extracting menu for titleset %1" +msgstr "Extrayendo menú para el título %1" + +#: libk9copy/k9dvdbackup.cpp:552 +msgid "Unable to open " +msgstr "No es posible abrir" + +#: libk9copy/k9dvdbackup.cpp:607 +msgid "Unable to open ifo file for titleset %1" +msgstr "No es posible abrir el archivo IFO del título %1" + +#: libk9copy/k9dvdbackup.cpp:619 libk9copy/k9dvdbackup.cpp:1420 +msgid "Unable to open DVD" +msgstr "No es posible abrir el DVD" + +#: libk9copy/k9dvdbackup.cpp:629 +msgid "Unable to open vobs for titleset %1" +msgstr "No es posible abrir los vobs del título %1" + +#: libk9copy/k9dvdbackup.cpp:1151 +msgid "Updating vob %1" +msgstr "Actualizando vob %1" + +#: libk9copy/k9dvdbackup.cpp:1167 +msgid "DVD backup canceled" +msgstr "Copia de seguridad del DVD cancelada" + +#: libk9copy/k9dvd.cpp:192 +msgid "Couldn't open %1 for title\n" +msgstr "No se pudo abrir %1 del título\n" + +#: libk9copy/k9dvd.cpp:200 +msgid "Couldn't seek in %1 for title\n" +msgstr "No se pudo acceder a %1 del título\n" + +#: libk9copy/k9dvd.cpp:227 +msgid "Not Specified" +msgstr "No especificado" + +#: libk9copy/k9dvd.cpp:227 +msgid "Afar" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Abkhazian" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Afrikaans" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Amharic" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Arabic" +msgstr "Ãrabe" + +#: libk9copy/k9dvd.cpp:228 +msgid "Assamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Aymara" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Azerbaijani" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bashkir" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Byelorussian" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bulgarian" +msgstr "Búlgaro" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bihari" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bislama" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bengali; Bangla" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Tibetan" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Breton" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Catalan" +msgstr "Catalán" + +#: libk9copy/k9dvd.cpp:230 +msgid "Corsican" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Czech" +msgstr "Checo" + +#: libk9copy/k9dvd.cpp:231 +msgid "Welsh" +msgstr "Galo" + +#: libk9copy/k9dvd.cpp:231 +msgid "Dansk" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Deutsch" +msgstr "Alemán" + +#: libk9copy/k9dvd.cpp:231 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Greek" +msgstr "Griego" + +#: libk9copy/k9dvd.cpp:231 +msgid "English" +msgstr "Inglés" + +#: libk9copy/k9dvd.cpp:232 +msgid "Esperanto" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Espanol" +msgstr "Español" + +#: libk9copy/k9dvd.cpp:232 +msgid "Estonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Basque" +msgstr "Basco" + +#: libk9copy/k9dvd.cpp:232 +msgid "Persian" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Suomi" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Fiji" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Faroese" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Francais" +msgstr "Francés" + +#: libk9copy/k9dvd.cpp:233 +msgid "Frisian" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Gaelic" +msgstr "Gaélico" + +#: libk9copy/k9dvd.cpp:234 +msgid "Scots Gaelic" +msgstr "Gaélico escocés" + +#: libk9copy/k9dvd.cpp:234 +msgid "Galician" +msgstr "Gallego" + +#: libk9copy/k9dvd.cpp:234 +msgid "Guarani" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Gujarati" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hausa" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:237 +msgid "Hebrew" +msgstr "Hebreo" + +#: libk9copy/k9dvd.cpp:235 +msgid "Hindi" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Hrvatski" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Magyar" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Armenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Interlingua" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Indonesian" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Interlingue" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Italiano" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Inuktitut" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Japanese" +msgstr "Japonés" + +#: libk9copy/k9dvd.cpp:238 libk9copy/k9dvd.cpp:253 +msgid "Yiddish" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Javanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Georgian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kazakh" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Greenlandic" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Cambodian" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kannada" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Korean" +msgstr "Coreano" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kashmiri" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kurdish" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Kirghiz" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Latin" +msgstr "Latín" + +#: libk9copy/k9dvd.cpp:240 +msgid "Lingala" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Lithuanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Maori" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Macedonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Mongolian" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Moldavian" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Nepali" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Nederlands" +msgstr "Holandés" + +#: libk9copy/k9dvd.cpp:243 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Occitan" +msgstr "Occitano" + +#: libk9copy/k9dvd.cpp:244 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Polish" +msgstr "Polaco" + +#: libk9copy/k9dvd.cpp:244 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Portugues" +msgstr "Portugués" + +#: libk9copy/k9dvd.cpp:245 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Romanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Russian" +msgstr "Ruso" + +#: libk9copy/k9dvd.cpp:246 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Serbo-Croatian" +msgstr "Serbocroata" + +#: libk9copy/k9dvd.cpp:247 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Slovak" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Slovenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Albanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Serbian" +msgstr "Serbio" + +#: libk9copy/k9dvd.cpp:248 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tamil" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Thai" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Turkish" +msgstr "Turco" + +#: libk9copy/k9dvd.cpp:251 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Ukrainian" +msgstr "Ucraniano" + +#: libk9copy/k9dvd.cpp:252 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Vietnamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:254 +msgid "Chinese" +msgstr "Chino" + +#: libk9copy/k9dvd.cpp:254 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:340 +msgid "Can't open main ifo!\n" +msgstr "No se puede abrir ifo principal!\n" + +#: libk9copy/k9dvd.cpp:355 +msgid "unknown" +msgstr "desconocido" + +#: libk9copy/k9dvd.cpp:379 libk9copy/k9dvd.cpp:656 +msgid "Title %1" +msgstr "Título %1" + +#: libk9copy/k9dvd.cpp:704 +msgid "reading title" +msgstr "Leyendo título" + +#: libk9copy/backupdlg.cpp:150 debug/libk9copy/backupdlg.cpp:150 rc.cpp:131 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Progreso de la copia de seguridad" + +#: libk9copy/backupdlg.cpp:151 debug/libk9copy/backupdlg.cpp:151 rc.cpp:134 +#, no-c-format +msgid "A&bort" +msgstr "A&bortar" + +#: libk9copy/backupdlg.cpp:152 debug/libk9copy/backupdlg.cpp:152 rc.cpp:137 +#, no-c-format +msgid "Alt+B" +msgstr "" + +#: libk9copy/backupdlg.cpp:153 debug/libk9copy/backupdlg.cpp:153 rc.cpp:140 +#, no-c-format +msgid "--:--:--" +msgstr "" + +#: libk9copy/backupdlg.cpp:154 debug/libk9copy/backupdlg.cpp:154 rc.cpp:143 +#, no-c-format +msgid "Current step" +msgstr "Paso actual" + +#: libk9copy/backupdlg.cpp:155 debug/libk9copy/backupdlg.cpp:155 rc.cpp:146 +#, no-c-format +msgid "Elapsed Time" +msgstr "Tiempo transcurrido" + +#: libk9copy/backupdlg.cpp:156 debug/libk9copy/backupdlg.cpp:156 rc.cpp:149 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

Copia de seguridad de DVD

" + +#: libk9copy/dvdprogress.cpp:86 debug/libk9copy/dvdprogress.cpp:86 rc.cpp:153 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - Análisis del DVD" + +#: libk9copy/progress.cpp:81 debug/libk9copy/progress.cpp:80 rc.cpp:166 +#, no-c-format +msgid "Alt+C" +msgstr "" + +#: libk9copy/k9dvdprogress.moc.cpp:34 libk9copy/k9dvdprogress.moc.cpp:42 +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "" + +#: libk9copy/k9dvdauthor.moc.cpp:34 libk9copy/k9dvdauthor.moc.cpp:42 +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "" + +#: libk9copy/k9dvdsize.moc.cpp:34 libk9copy/k9dvdsize.moc.cpp:42 +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:34 libk9copy/k9dvdtitle.moc.cpp:42 +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:107 libk9copy/k9dvdtitle.moc.cpp:115 +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:180 libk9copy/k9dvdtitle.moc.cpp:188 +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDVideoStream" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:253 libk9copy/k9dvdtitle.moc.cpp:261 +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDAudioStream" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:326 libk9copy/k9dvdtitle.moc.cpp:334 +#: debug/libk9copy/k9dvdtitle.moc.cpp:326 +#: debug/libk9copy/k9dvdtitle.moc.cpp:334 +msgid "k9DVDSubtitle" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:399 libk9copy/k9dvdtitle.moc.cpp:407 +#: debug/libk9copy/k9dvdtitle.moc.cpp:399 +#: debug/libk9copy/k9dvdtitle.moc.cpp:407 +msgid "k9DVDTitle" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:472 libk9copy/k9dvdtitle.moc.cpp:480 +#: debug/libk9copy/k9dvdtitle.moc.cpp:472 +#: debug/libk9copy/k9dvdtitle.moc.cpp:480 +msgid "k9DVDTitleset" +msgstr "" + +#: libk9copy/k9dvd.moc.cpp:34 libk9copy/k9dvd.moc.cpp:42 +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "" + +#: k9decmpeg/kdecmpeg2.moc.cpp:34 k9decmpeg/kdecmpeg2.moc.cpp:42 +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "" + +#: rc.cpp:169 +#, no-c-format +msgid "A&ctions" +msgstr "A&cciones" + +#: rc.cpp:172 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Barra de Acciones" + diff --git a/po/es_AR.po b/po/es_AR.po new file mode 100644 index 0000000..e48c96c --- /dev/null +++ b/po/es_AR.po @@ -0,0 +1,1550 @@ +# translation of es_AR.po to Español (Argentina) +# Header entry was created by KBabel! +# +#: libk3bdevice/k3bdeviceglobals.cpp:30 libk3bdevice/k3bdeviceglobals.cpp:132 +#: libk3bdevice.new/k3bdeviceglobals.cpp:30 +#: libk3bdevice.new/k3bdeviceglobals.cpp:132 +# Fernando Toledo , 2007. +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Last-Translator: Fernando Toledo \n" +"PO-Revision-Date: 2007-05-04 11:05-0300\n" +"Project-Id-Version: es_AR\n" +"Language-Team: Español (Argentina) \n" +"X-Generator: KBabel 1.11.4\n" +"MIME-Version: 1.0\n" + +#: libk3bdevice/k3bdeviceglobals.cpp:30 libk3bdevice/k3bdeviceglobals.cpp:132 +#: libk3bdevice.new/k3bdeviceglobals.cpp:30 +#: libk3bdevice.new/k3bdeviceglobals.cpp:132 +msgid "CD-R" +msgstr "CD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:32 libk3bdevice/k3bdeviceglobals.cpp:134 +#: libk3bdevice.new/k3bdeviceglobals.cpp:32 +#: libk3bdevice.new/k3bdeviceglobals.cpp:134 +msgid "CD-RW" +msgstr "CD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:34 libk3bdevice/k3bdeviceglobals.cpp:130 +#: libk3bdevice.new/k3bdeviceglobals.cpp:34 +#: libk3bdevice.new/k3bdeviceglobals.cpp:130 +msgid "CD-ROM" +msgstr "CD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:36 libk3bdevice/k3bdeviceglobals.cpp:101 +#: libk3bdevice.new/k3bdeviceglobals.cpp:36 +#: libk3bdevice.new/k3bdeviceglobals.cpp:101 +msgid "DVD-ROM" +msgstr "DVD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:38 libk3bdevice/k3bdeviceglobals.cpp:115 +#: libk3bdevice.new/k3bdeviceglobals.cpp:38 +#: libk3bdevice.new/k3bdeviceglobals.cpp:115 +msgid "DVD-RAM" +msgstr "DVD-RAM" + +#: libk3bdevice/k3bdeviceglobals.cpp:40 libk3bdevice/k3bdeviceglobals.cpp:104 +#: libk3bdevice.new/k3bdeviceglobals.cpp:40 +#: libk3bdevice.new/k3bdeviceglobals.cpp:104 +#, fuzzy +msgid "DVD-R" +msgstr "DVD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:42 libk3bdevice/k3bdeviceglobals.cpp:118 +#: libk3bdevice.new/k3bdeviceglobals.cpp:42 +#: libk3bdevice.new/k3bdeviceglobals.cpp:118 +#, fuzzy +msgid "DVD-RW" +msgstr "DVD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:44 +#: libk3bdevice.new/k3bdeviceglobals.cpp:44 +msgid "DVD-R DL" +msgstr "DVD-R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:46 libk3bdevice/k3bdeviceglobals.cpp:126 +#: libk3bdevice.new/k3bdeviceglobals.cpp:46 +#: libk3bdevice.new/k3bdeviceglobals.cpp:126 +#, fuzzy +msgid "DVD+R" +msgstr "DVD+R" + +#: libk3bdevice/k3bdeviceglobals.cpp:48 libk3bdevice/k3bdeviceglobals.cpp:124 +#: libk3bdevice.new/k3bdeviceglobals.cpp:48 +#: libk3bdevice.new/k3bdeviceglobals.cpp:124 +#, fuzzy +msgid "DVD+RW" +msgstr "DVD+RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:50 +#: libk3bdevice.new/k3bdeviceglobals.cpp:50 +msgid "DVD+R DL" +msgstr "DVD+R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:63 +#: libk3bdevice.new/k3bdeviceglobals.cpp:63 +msgid "SAO" +msgstr "SAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:65 +#: libk3bdevice.new/k3bdeviceglobals.cpp:65 +msgid "TAO" +msgstr "TAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:67 +#: libk3bdevice.new/k3bdeviceglobals.cpp:67 +msgid "RAW" +msgstr "RAW" + +#: libk3bdevice/k3bdeviceglobals.cpp:69 +#: libk3bdevice.new/k3bdeviceglobals.cpp:69 +msgid "SAO/R96P" +msgstr "SAO/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:71 +#: libk3bdevice.new/k3bdeviceglobals.cpp:71 +msgid "SAO/R96R" +msgstr "SAO/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:73 +#: libk3bdevice.new/k3bdeviceglobals.cpp:73 +msgid "RAW/R16" +msgstr "RAW/R16" + +#: libk3bdevice/k3bdeviceglobals.cpp:75 +#: libk3bdevice.new/k3bdeviceglobals.cpp:75 +msgid "RAW/R96P" +msgstr "RAW/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:77 +#: libk3bdevice.new/k3bdeviceglobals.cpp:77 +msgid "RAW/R96R" +msgstr "RAW/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:79 +#: libk3bdevice.new/k3bdeviceglobals.cpp:79 +msgid "Incremental Sequential" +msgstr "Sequencial Incremental" + +#: libk3bdevice/k3bdeviceglobals.cpp:81 +#: libk3bdevice.new/k3bdeviceglobals.cpp:81 +msgid "Restricted Overwrite" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:83 +#: libk3bdevice.new/k3bdeviceglobals.cpp:83 +msgid "Layer Jump" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:86 +#: libk3bdevice.new/k3bdeviceglobals.cpp:86 +msgid "None" +msgstr "Ninguno" + +#: libk3bdevice/k3bdeviceglobals.cpp:95 libk9copy/k9dvd.cpp:253 +#: libk9copy/k9dvd.cpp:255 libk3bdevice.new/k3bdeviceglobals.cpp:95 +#, fuzzy +msgid "Unknown" +msgstr "Desconocido" + +#: libk3bdevice/k3bdeviceglobals.cpp:99 +#: libk3bdevice.new/k3bdeviceglobals.cpp:99 +msgid "No media" +msgstr "No hay medio" + +#: libk3bdevice/k3bdeviceglobals.cpp:106 +#: libk3bdevice.new/k3bdeviceglobals.cpp:106 +msgid "DVD-R Sequential" +msgstr "DVD-R Sequencial" + +#: libk3bdevice/k3bdeviceglobals.cpp:109 +#: libk3bdevice.new/k3bdeviceglobals.cpp:109 +msgid "DVD-R Dual Layer" +msgstr "DVD-R Doble Capa" + +#: libk3bdevice/k3bdeviceglobals.cpp:111 +#: libk3bdevice.new/k3bdeviceglobals.cpp:111 +msgid "DVD-R Dual Layer Sequential" +msgstr "DVD-R Doble Capa Sequencial" + +#: libk3bdevice/k3bdeviceglobals.cpp:113 +#: libk3bdevice.new/k3bdeviceglobals.cpp:113 +msgid "DVD-R Dual Layer Jump" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:120 +#: libk3bdevice.new/k3bdeviceglobals.cpp:120 +msgid "DVD-RW Restricted Overwrite" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:122 +#: libk3bdevice.new/k3bdeviceglobals.cpp:122 +msgid "DVD-RW Sequential" +msgstr "DVD-RW Sequencial" + +#: libk3bdevice/k3bdeviceglobals.cpp:128 +#: libk3bdevice.new/k3bdeviceglobals.cpp:128 +msgid "DVD+R Double Layer" +msgstr "DVD+R Doble Capa" + +#: src/k9copy.cpp:66 +msgid "Play title" +msgstr "Reproducir título" + +#: src/k9copy.cpp:80 +msgid "Create MPEG-4" +msgstr "Crear MPEG-4" + +#: src/k9copy.cpp:94 +#, fuzzy +msgid "Settings" +msgstr "&Opciones" + +#: src/kviewmpeg2.cpp:100 +#, fuzzy +msgid "Can't find device %1\n" +msgstr "No se encuentra el dispositivo %1\n" + +#: src/kviewmpeg2.cpp:107 libk9copy/k9dvd.cpp:339 +msgid "Can't open disc %1!\n" +msgstr "No se puede abrir el disco %1!\n" + +#: src/kviewmpeg2.cpp:135 libk9copy/k9dvd.cpp:848 +#, fuzzy +msgid "Error opening vobs for title %1\n" +msgstr "Error al abrir vobs del t�ulo %1\n" + +#: src/kviewmpeg2.cpp:149 libk9copy/k9dvd.cpp:859 +#, fuzzy +msgid "ERROR reading block %1\n" +msgstr "ERROR leyendo bloque %1\n" + +#: src/main.cpp:30 +msgid "A DVD Backup tool for KDE" +msgstr "Una herramienta de Backup para KDE" + +#: src/main.cpp:35 +#, fuzzy +msgid "input device" +msgstr "Dispositivo de entrada" + +#: src/main.cpp:37 +#, fuzzy +msgid "output device" +msgstr "Dispositivo de salida" + +#: src/main.cpp:38 +msgid "title to play" +msgstr "título a reproducir" + +#: src/main.cpp:39 +msgid "play title to stdout" +msgstr "Reproducir título" + +#: src/main.cpp:40 +msgid "start sector" +msgstr "sector de inicio" + +#: src/main.cpp:41 +msgid "end sector" +msgstr "sector de fin" + +#: src/main.cpp:42 +msgid "list of audio streams" +msgstr "lista de flujos de audio" + +#: src/main.cpp:43 +msgid "list of spu streams" +msgstr "lista de flujos de spu" + +#: src/main.cpp:44 +msgid "shrink factor" +msgstr "factor de encogimiento" + +#: src/main.cpp:45 +msgid "size of the cell to be copied" +msgstr "tamaño de las celdas a copiar" + +#: src/main.cpp:46 +msgid "total size of selected titles" +msgstr "tamaño total de los títulos seleccionados" + +#: src/main.cpp:47 +msgid "size of the chapters being copied" +msgstr "tamaño de los capítulos a copiar" + +#: src/main.cpp:48 +msgid "new dvd size" +msgstr "nuevo tamaño de dvd" + +#: src/main.cpp:49 +msgid "selected chapter" +msgstr "capítulo seleccionado" + +#: src/main.cpp:50 +msgid "cell number in selected chapter" +msgstr "número de celdas en el capítulo seleccionado" + +#: src/main.cpp:51 +msgid "status file name" +msgstr "nombre de archivo de estado" + +#: src/main.cpp:52 +msgid "initialize status file" +msgstr "inicializando archivo de estado" + +#: src/main.cpp:53 +msgid "continue playing from last sector" +msgstr "continuar reproducción desde el último sector" + +#: src/main.cpp:62 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:65 +#, fuzzy +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "" +"_: NOMBRE DE LOS TRADUCTORES\n" +"Fernando Toledo" + +#: src/main.cpp:66 +#, fuzzy +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "" +"_: EMAIL DE LOS TRADUCTORES\n" +"ftoledo@docksud.com.ar" + +#: src/k9main.cpp:315 src/k9main.cpp:919 +msgid "DVD is not opened" +msgstr "El DVD no está abierto" + +#: src/k9main.cpp:315 src/k9main.cpp:328 +msgid "DVD Copy" +msgstr "Copiar DVD" + +#: src/k9main.cpp:322 libk9copy/k9burndvd.cpp:173 +msgid "Save image to disk" +msgstr "Guardar imágen al disco" + +#: src/k9main.cpp:328 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"Espacio insuficiente en %1\n" +"se esperaba %2 mb." + +#: src/k9main.cpp:385 src/k9main.cpp:951 +msgid "ISO Image" +msgstr "Imágen ISO" + +#: src/k9main.cpp:422 +#, fuzzy +msgid "Open DVD" +msgstr "Abrir DVD" + +#: src/k9main.cpp:441 +msgid "Titleset %1" +msgstr "Título %1" + +#: src/k9main.cpp:514 +msgid "video %1 " +msgstr "video %1 " + +#: src/k9main.cpp:526 +msgid "audio %1 " +msgstr "audio %1 " + +#: src/k9main.cpp:543 +msgid "subpicture %1 " +msgstr "subimágen %1 " + +#: src/k9main.cpp:919 src/k9settings.cpp:40 libk9copy/k9mp4enc.cpp:195 +msgid "MPEG-4 Encoding" +msgstr "Condificando MPEG-4" + +#: src/k9main.cpp:1091 debug/src/k9mainw.cpp:304 debug/src/prefMencoder.cpp:37 +#: debug/src/prefMencoder.cpp:87 rc.cpp:50 rc.cpp:161 +#, no-c-format +msgid "Audio" +msgstr "Audio" + +#: src/k9main.cpp:1102 +msgid "Subtitles" +msgstr "Subtítulos" + +#: src/k9main.cpp:1123 src/k9main.cpp:1245 libk9copy/k9burndvd.cpp:167 +#: debug/src/k9mainw.cpp:296 rc.cpp:20 +#, no-c-format +msgid "default" +msgstr "predeterminado" + +#: src/k9main.cpp:1131 +msgid "Open ISO Image" +msgstr "Abrir Imágen ISO" + +#: src/k9main.cpp:1138 +#, fuzzy +msgid "Open DVD folder" +msgstr "Abrir carpeda DVD" + +#: src/k9main.cpp:1247 +msgid "none" +msgstr "ningnuno" + +#: src/k9settings.cpp:27 +#, fuzzy +msgid "Devices" +msgstr "Dispositivos" + +#: src/k9settings.cpp:27 +#, fuzzy +msgid "Devices not detected by k9copy" +msgstr "Dispositivos no detectados por k9copy" + +#: src/k9settings.cpp:34 +#, fuzzy +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 +#, fuzzy +msgid "DVD Backup" +msgstr "Copia de Seguridad DVD" + +#: src/k9settings.cpp:40 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:46 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:46 +msgid "MPEG-4 Codecs" +msgstr "MPEG-4 Codecs" + +#: src/k9prefmpeg4.cpp:33 src/k9prefdvd.cpp:33 libk9copy/k9mp4enc.cpp:94 +msgid "mb" +msgstr "mb" + +#: src/menupreview.cpp:1084 debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Previa del menú" + +#: libk9copy/k9dvdauthor.cpp:107 libk9copy/k9dvdauthor.cpp:294 +#, fuzzy +msgid "'%1' not selected" +msgstr "'%1' no seleccionado" + +#: libk9copy/k9dvdauthor.cpp:108 libk9copy/k9dvdauthor.cpp:295 +#: libk9copy/k9dvdauthor.cpp:355 libk9copy/k9dvdauthor.cpp:364 +#: libk9copy/k9dvdauthor.cpp:367 libk9copy/k9burndvd.cpp:193 +#: libk9copy/k9burndvd.cpp:210 +msgid "authoring" +msgstr "generando menús" + +#: libk9copy/k9dvdauthor.cpp:325 libk9copy/k9dvdauthor.cpp:391 +#: libk9copy/k9dvdauthor.cpp:429 +msgid "Authoring" +msgstr "Generando menús" + +#: libk9copy/k9dvdauthor.cpp:326 debug/libk9copy/backupdlg.cpp:162 rc.cpp:172 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Copia de seguridad en progreso" + +#: libk9copy/k9dvdauthor.cpp:355 +msgid "Dvdauthor error :\n" +msgstr "Error de Dvdauthor :\n" + +#: libk9copy/k9dvdauthor.cpp:364 +msgid "Authoring cancelled" +msgstr "Generación de menús cancelada" + +#: libk9copy/k9dvdauthor.cpp:367 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Un error ha ocurrido mientras se ejecutaba DVDAuthor:\n" + +#: libk9copy/k9dvdauthor.cpp:430 +msgid "Fixing VOBUS" +msgstr "Arreglando VOBUS" + +#: libk9copy/k9dvdbackup.cpp:137 libk9copy/k9dvdbackup.cpp:151 +#: libk9copy/k9dvdbackup.cpp:491 libk9copy/k9dvdbackup.cpp:648 +msgid "DVD backup cancelled" +msgstr "Copia de seguridad de DVD cancelada" + +#: libk9copy/k9dvdbackup.cpp:164 +msgid "unable to open VIDEO_TS.IFO" +msgstr "No es posible abrir VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:186 libk9copy/k9dvdbackup.cpp:364 +#: libk9copy/k9dvdbackup.cpp:429 +msgid "Unable to open file " +msgstr "No es posible abrir el archivo" + +#: libk9copy/k9dvdbackup.cpp:257 +msgid "Unable to open titleset %1" +msgstr "No es posible abrir el título %1" + +#: libk9copy/k9dvdbackup.cpp:263 libk9copy/k9dvdbackup.cpp:620 +msgid "Extracting titleset %1" +msgstr "Extrayendo el título %1" + +#: libk9copy/k9dvdbackup.cpp:436 libk9copy/k9dvdbackup.cpp:564 +msgid "Unable to open menu for titleset %1" +msgstr "No se posible abrir el menú del título %1" + +#: libk9copy/k9dvdbackup.cpp:458 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting menu for titleset %1" +msgstr "Extrayendo el menú del título %1" + +#: libk9copy/k9dvdbackup.cpp:557 +msgid "Unable to open " +msgstr "No es posible abrir " + +#: libk9copy/k9dvdbackup.cpp:612 +msgid "Unable to open ifo file for titleset %1" +msgstr "No es posible abrir el archivo ifo del título %1" + +#: libk9copy/k9dvdbackup.cpp:624 libk9copy/k9dvdbackup.cpp:1595 +msgid "Unable to open DVD" +msgstr "No es posible abrir el DVD" + +#: libk9copy/k9dvdbackup.cpp:634 +msgid "Unable to open vobs for titleset %1" +msgstr "No es posible abrir los archivos vobs del título %1" + +#: libk9copy/k9dvdbackup.cpp:1318 +#, fuzzy +msgid "Updating vob %1" +msgstr "Actualizando vob %1" + +#: libk9copy/k9dvdbackup.cpp:1334 +msgid "DVD backup canceled" +msgstr "Copia de seguridad de DVD cancelada" + +#: libk9copy/k9dvd.cpp:191 +msgid "Couldn't open %1 for title\n" +msgstr "No se puede abrir %1 del título\n" + +#: libk9copy/k9dvd.cpp:199 +msgid "Couldn't seek in %1 for title\n" +msgstr "No se puede buscar %1 en los títulos\n" + +#: libk9copy/k9dvd.cpp:226 +msgid "Not Specified" +msgstr "No Especificado" + +#: libk9copy/k9dvd.cpp:226 +msgid "Afar" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Abkhazian" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Afrikaans" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Amharic" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Arabic" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Assamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Aymara" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Azerbaijani" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Bashkir" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Byelorussian" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bulgarian" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bihari" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bislama" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bengali; Bangla" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Tibetan" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Breton" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Catalan" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Corsican" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Czech" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Welsh" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Dansk" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Deutsch" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Greek" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "English" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Esperanto" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Espanol" +msgstr "Español" + +#: libk9copy/k9dvd.cpp:231 +msgid "Estonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Basque" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Persian" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Suomi" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Fiji" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Faroese" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Francais" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Frisian" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Gaelic" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Scots Gaelic" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Galician" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Guarani" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Gujarati" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Hausa" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 libk9copy/k9dvd.cpp:236 +msgid "Hebrew" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hindi" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hrvatski" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Magyar" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Armenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Interlingua" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Indonesian" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Interlingue" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Italiano" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Inuktitut" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Japanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 libk9copy/k9dvd.cpp:252 +msgid "Yiddish" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Javanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Georgian" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kazakh" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Greenlandic" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Cambodian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kannada" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Korean" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kashmiri" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kurdish" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kirghiz" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Latin" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Lingala" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Lithuanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Maori" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Macedonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Mongolian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Moldavian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nepali" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Nederlands" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Occitan" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Polish" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Portugues" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Romanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Russian" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Serbo-Croatian" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Slovak" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Slovenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Albanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Serbian" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tamil" +msgstr "Título" + +#: libk9copy/k9dvd.cpp:249 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Thai" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Turkish" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Ukrainian" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Vietnamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Chinese" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:349 +msgid "Can't open main ifo!\n" +msgstr "No se puede abrir el ifo principal!\n" + +#: libk9copy/k9dvd.cpp:364 +msgid "unknown" +msgstr "desconocido" + +#: libk9copy/k9dvd.cpp:388 libk9copy/k9dvd.cpp:675 +msgid "Title %1" +msgstr "Título %1" + +#: libk9copy/k9dvd.cpp:723 +msgid "reading title" +msgstr "leyendo título" + +#: libk9copy/k9mp4enc.cpp:84 +msgid "Save file to disk" +msgstr "Guardar imágen al disco" + +#: libk9copy/k9mp4enc.cpp:124 libk9copy/k9mp4enc.cpp:131 +#: libk9copy/k9mp4enc.cpp:149 +msgid "Encoding %1" +msgstr "Codificando %1" + +#: libk9copy/k9mp4enc.cpp:195 +msgid "MPEG-4 Encoding cancelled" +msgstr "Generación de menús cancelada" + +#: libk9copy/k9mp4enc.cpp:198 +#, fuzzy +msgid "Error while running mencoder :" +msgstr "Error mientras se ejecutaba mencoder :" + +#: libk9copy/k9mp4enc.cpp:198 +msgid "Encoding error" +msgstr "Error en la codificación" + +#: libk9copy/k9burndvd.cpp:144 +msgid "k9Copy - Burning DVD" +msgstr "k9copy - Grabando DVD" + +#: libk9copy/k9burndvd.cpp:145 libk9copy/k9burndvd.cpp:233 +msgid "Burning DVD" +msgstr "Grabando DVD" + +#: libk9copy/k9burndvd.cpp:192 +msgid "Insert a recordable DVD" +msgstr "Inserte un DVD grabable" + +#: libk9copy/k9burndvd.cpp:199 +msgid "Error burning DVD :\n" +msgstr "Error al grabar el DVD :\n" + +#: libk9copy/k9burndvd.cpp:199 libk9copy/k9burndvd.cpp:203 +msgid "DVD burning" +msgstr "Grabando DVD" + +#: libk9copy/k9burndvd.cpp:203 +msgid "DVD Burning finished" +msgstr "Grabado de DVD finalizado" + +#: libk9copy/k9burndvd.cpp:209 +#, fuzzy +msgid "An error occured while Burning DVD: %1" +msgstr "Un error ha ocurrido mientras se Grababa el DVD: %1" + +#: libk9copy/k9burndvd.cpp:209 +msgid "Insert an other DVD" +msgstr "Inserte otro DVD" + +#: libk9copy/k9burndvd.cpp:234 +#, fuzzy +msgid "Current write speed :%1 x" +msgstr "Velocidad de escritura actual :%1 x" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "" + +#: debug/libk9copy/backupdlg.cpp:163 rc.cpp:175 +#, no-c-format +msgid "A&bort" +msgstr "A&bortar" + +#: debug/libk9copy/backupdlg.cpp:164 rc.cpp:178 +#, fuzzy, no-c-format +msgid "Alt+B" +msgstr "Alt+B" + +#: debug/libk9copy/backupdlg.cpp:165 rc.cpp:181 +#, no-c-format +msgid "--:--:--" +msgstr "--:--:--" + +#: debug/libk9copy/backupdlg.cpp:166 rc.cpp:184 +#, no-c-format +msgid "Current step" +msgstr "Paso actual" + +#: debug/libk9copy/backupdlg.cpp:167 debug/libk9copy/progress.cpp:107 +#: debug/libk9copy/mp4dlg.cpp:129 rc.cpp:187 rc.cpp:210 rc.cpp:234 +#, no-c-format +msgid "Elapsed Time" +msgstr "Tiempo Transcurrido" + +#: debug/libk9copy/backupdlg.cpp:168 rc.cpp:190 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

Copia de seguridad de DVD

" + +#: debug/libk9copy/dvdprogress.cpp:92 rc.cpp:194 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9copy - Analizando DVD" + +#: debug/libk9copy/progress.cpp:103 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 rc.cpp:200 +#, fuzzy, no-c-format +msgid "k9Copy" +msgstr "k9copy" + +#: debug/libk9copy/progress.cpp:106 debug/src/progress.cpp:81 rc.cpp:207 +#, fuzzy, no-c-format +msgid "Alt+C" +msgstr "Alt+C" + +#: debug/libk9copy/mp4dlg.cpp:120 rc.cpp:215 +#, fuzzy, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9copy - Grabando DVD" + +#: debug/libk9copy/mp4dlg.cpp:121 rc.cpp:218 +#, no-c-format +msgid "Encoding" +msgstr "Codificando" + +#: debug/libk9copy/mp4dlg.cpp:122 rc.cpp:221 +#, no-c-format +msgid "Annu&ler" +msgstr "Anu&lar" + +#: debug/libk9copy/mp4dlg.cpp:123 rc.cpp:224 +#, fuzzy, no-c-format +msgid "Alt+L" +msgstr "Alt+L" + +#: debug/libk9copy/mp4dlg.cpp:128 rc.cpp:231 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: debug/libk9copy/mp4dlg.cpp:130 rc.cpp:237 +#, no-c-format +msgid "Bitrate" +msgstr "Bitrate" + +#: debug/libk9copy/mp4dlg.cpp:131 debug/src/k9mainw.cpp:106 +#: debug/src/k9mainw.cpp:299 rc.cpp:32 rc.cpp:240 +#, no-c-format +msgid "Size" +msgstr "Tamaño" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "k9DVDProgress" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +#, fuzzy +msgid "k9DVDAuthor" +msgstr "k9DVDAuthor" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +#, fuzzy +msgid "k9DVDSize" +msgstr "k9DVDSize" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "k9ChapterCell" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +#, fuzzy +msgid "k9DVDChapter" +msgstr "k9DVDChapter" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +#, fuzzy +msgid "k9DVDVideoStream" +msgstr "k9DVDVideoStream" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +#, fuzzy +msgid "k9DVDAudioStream" +msgstr "k9DVDAudioStream" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:326 +#: debug/libk9copy/k9dvdtitle.moc.cpp:334 +#, fuzzy +msgid "k9DVDSubtitle" +msgstr "k9DVDSubtitle" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:399 +#: debug/libk9copy/k9dvdtitle.moc.cpp:407 +#, fuzzy +msgid "k9DVDTitle" +msgstr "k9DVDTitle" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:472 +#: debug/libk9copy/k9dvdtitle.moc.cpp:480 +#, fuzzy +msgid "k9DVDTitleset" +msgstr "k9DVDTitleset" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +#, fuzzy +msgid "k9DVD" +msgstr "k9DVD" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +#, fuzzy +msgid "k9BurnDVD" +msgstr "k9BurnDVD" + +#: debug/src/viewmpeg2.cpp:631 rc.cpp:3 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Previa del Título" + +#: debug/src/configDlg.cpp:42 debug/src/configDlg.cpp:96 rc.cpp:69 +#, no-c-format +msgid "device" +msgstr "dispositivo" + +#: debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:97 rc.cpp:72 +#, no-c-format +msgid "label" +msgstr "etiqueta" + +#: debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:98 rc.cpp:75 +#, no-c-format +msgid "Input" +msgstr "Entrada" + +#: debug/src/configDlg.cpp:48 debug/src/configDlg.cpp:99 rc.cpp:78 +#, no-c-format +msgid "Output" +msgstr "Salida" + +#: debug/src/configDlg.cpp:95 rc.cpp:66 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Dispositivos" + +#: debug/src/k9mainw.cpp:105 debug/src/k9mainw.cpp:298 rc.cpp:29 +#, no-c-format +msgid "Title" +msgstr "Título" + +#: debug/src/k9mainw.cpp:212 debug/src/k9mainw.cpp:309 rc.cpp:61 +#, no-c-format +msgid "Languages" +msgstr "Lenguajes" + +#: debug/src/k9mainw.cpp:291 rc.cpp:8 +#, no-c-format +msgid "MainDlg" +msgstr "MainDlg" + +#: debug/src/k9mainw.cpp:292 rc.cpp:11 +#, no-c-format +msgid "Output device " +msgstr "Dispositivo de salida " + +#: debug/src/k9mainw.cpp:293 rc.cpp:14 +#, no-c-format +msgid "@" +msgstr "@" + +#: debug/src/k9mainw.cpp:294 rc.cpp:17 +#, no-c-format +msgid "Input device " +msgstr "Dispositivo de entrada " + +#: debug/src/k9mainw.cpp:297 debug/src/prefMPEG4.cpp:158 rc.cpp:23 rc.cpp:143 +#, no-c-format +msgid "X" +msgstr "X" + +#: debug/src/k9mainw.cpp:300 rc.cpp:38 +#, no-c-format +msgid "&Keep original menus" +msgstr "&Mantener menús originales" + +#: debug/src/k9mainw.cpp:301 debug/src/prefMPEG4.cpp:157 rc.cpp:41 rc.cpp:140 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: debug/src/k9mainw.cpp:302 rc.cpp:44 +#, no-c-format +msgid "Default language" +msgstr "Lenguaje predeterminado" + +#: debug/src/k9mainw.cpp:303 rc.cpp:47 +#, no-c-format +msgid "Subtitle" +msgstr "Subtítulo" + +#: debug/src/k9mainw.cpp:307 rc.cpp:55 +#, no-c-format +msgid "Selected Titles" +msgstr "Títulos Seleccionados" + +#: debug/src/k9mainw.cpp:308 rc.cpp:35 +#, no-c-format +msgid "DVD playback options" +msgstr "Opciones de reproducción de DVD" + +#: debug/src/k9mainw.cpp:310 rc.cpp:58 +#, no-c-format +msgid "Selection" +msgstr "Selección" + +#: debug/src/k9mainw.cpp:311 rc.cpp:26 +#, no-c-format +msgid "D&VD" +msgstr "D&VD" + +#: debug/src/prefDVD.cpp:89 rc.cpp:89 +#, fuzzy, no-c-format +msgid "prefDVD" +msgstr "prefDVD" + +#: debug/src/prefDVD.cpp:90 rc.cpp:92 +#, no-c-format +msgid "Output directory" +msgstr "Directorio de salida" + +#: debug/src/prefDVD.cpp:91 rc.cpp:95 +#, no-c-format +msgid "Burn with k3b" +msgstr "Grabar con k3b" + +#: debug/src/prefDVD.cpp:93 rc.cpp:99 +#, no-c-format +msgid "Auto burn" +msgstr "Auto grabado" + +#: debug/src/prefDVD.cpp:95 rc.cpp:103 +#, no-c-format +msgid "Quick scan" +msgstr "Búsqueda rápida" + +#: debug/src/prefDVD.cpp:97 rc.cpp:107 +#, no-c-format +msgid "DVD size" +msgstr "Tamaño DVD" + +#: debug/src/prefMPEG4.cpp:145 debug/src/prefMencoder.cpp:84 rc.cpp:110 +#: rc.cpp:152 +#, no-c-format +msgid "Form1" +msgstr "Form1" + +#: debug/src/prefMPEG4.cpp:146 rc.cpp:113 +#, no-c-format +msgid "Video Codec" +msgstr "Codificador de Video" + +#: debug/src/prefMPEG4.cpp:147 rc.cpp:116 +#, no-c-format +msgid "Audio bitrate" +msgstr "Audio bitrate" + +#: debug/src/prefMPEG4.cpp:149 rc.cpp:122 +#, no-c-format +msgid "File size" +msgstr "Tamaño de archivo" + +#: debug/src/prefMPEG4.cpp:151 rc.cpp:128 +#, no-c-format +msgid " mb" +msgstr " mb" + +#: debug/src/prefMPEG4.cpp:152 rc.cpp:131 +#, no-c-format +msgid "640" +msgstr "640" + +#: debug/src/prefMPEG4.cpp:156 rc.cpp:137 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "&mantener relación de aspecto" + +#: debug/src/prefMPEG4.cpp:160 rc.cpp:146 +#, no-c-format +msgid "XviD" +msgstr "XviD" + +#: debug/src/prefMPEG4.cpp:161 rc.cpp:149 +#, no-c-format +msgid "lavc MPEG4" +msgstr "lavc MPEG4" + +#: debug/src/prefMencoder.cpp:33 debug/src/prefMencoder.cpp:85 rc.cpp:155 +#, fuzzy, no-c-format +msgid "Label" +msgstr "Etiqueta" + +#: debug/src/prefMencoder.cpp:35 debug/src/prefMencoder.cpp:86 rc.cpp:158 +#, no-c-format +msgid "Video" +msgstr "Video" + +#: debug/src/k9main.moc.cpp:34 debug/src/k9main.moc.cpp:42 +#, fuzzy +msgid "k9DVDListItem" +msgstr "k9DVDListItem" + +#: debug/src/k9main.moc.cpp:107 debug/src/k9main.moc.cpp:115 +msgid "k9Main" +msgstr "k9Main" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "kCDDrive" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "kCDDrives" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "kViewMPEG2" +msgstr "kViewMPEG2" + +#: rc.cpp:243 +#, no-c-format +msgid "A&ctions" +msgstr "A&cciones" + +#: rc.cpp:246 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Barra de Herramientas de Acciones" + diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..859d9a0 --- /dev/null +++ b/po/fr.po @@ -0,0 +1,2187 @@ +# translation of fr.po to Francais +# Jean-Michel Petit , 2004, 2005. +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-10-14 09:03+0200\n" +"PO-Revision-Date: 2007-07-24 09:24+0200\n" +"Last-Translator: Jean-Michel Petit \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.9.1\n" + +#: rc.cpp:3 debug/libk9copy/backupdlg.cpp:156 libk9copy/k9dvdauthor.cpp:404 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9copy - progression du backup" + +#: rc.cpp:6 debug/libk9copy/backupdlg.cpp:157 +#, no-c-format +msgid "

DVD Backup

" +msgstr "" + +#: rc.cpp:9 debug/libk9copy/backupdlg.cpp:158 +#, no-c-format +msgid "Current step" +msgstr "Etape en cours" + +#: rc.cpp:12 rc.cpp:47 rc.cpp:65 debug/libk9copy/backupdlg.cpp:159 +#: debug/libk9copy/mp4dlg.cpp:148 debug/libk9copy/progress.cpp:116 +#, no-c-format +msgid "Elapsed Time" +msgstr "Temps écoulé" + +#: rc.cpp:15 rc.cpp:612 rc.cpp:640 rc.cpp:666 +#: debug/libk9copy/backupdlg.cpp:160 debug/k9author/newTitle.cpp:131 +#: debug/k9author/chapterEdit.cpp:154 debug/k9author/import.cpp:111 +#, no-c-format +msgid "--:--:--" +msgstr "" + +#: rc.cpp:19 debug/libk9copy/dvdprogress.cpp:92 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9copy - Analyse du DVD" + +#: rc.cpp:25 debug/libk9copy/processList.cpp:68 +msgid "Process List" +msgstr "Liste des processus" + +#: rc.cpp:28 debug/libk9copy/processList.cpp:33 +#: debug/libk9copy/processList.cpp:69 +msgid "Processes" +msgstr "Processus" + +#: rc.cpp:31 debug/libk9copy/processList.cpp:34 +#: debug/libk9copy/processList.cpp:70 +msgid "Elapsed" +msgstr "Ecoulé" + +#: rc.cpp:34 rc.cpp:603 debug/libk9copy/processList.cpp:35 +#: debug/libk9copy/processList.cpp:71 debug/k9author/import.cpp:46 +#: debug/k9author/import.cpp:107 +#, no-c-format +msgid "..." +msgstr "" + +#: rc.cpp:40 debug/libk9copy/processList.cpp:73 debug/src/progress.cpp:81 +#, no-c-format +msgid "Alt+C" +msgstr "" + +#: rc.cpp:43 debug/libk9copy/progress.cpp:114 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 +#, no-c-format +msgid "k9Copy" +msgstr "k9copy" + +#: rc.cpp:52 debug/libk9copy/mp4dlg.cpp:141 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - transcodage" + +#: rc.cpp:55 debug/libk9copy/mp4dlg.cpp:142 +#, no-c-format +msgid "Encoding" +msgstr "Encodage" + +#: rc.cpp:62 debug/libk9copy/mp4dlg.cpp:147 k9author/k9newdvd.cpp:344 +#, no-c-format +msgid "fps" +msgstr "" + +#: rc.cpp:68 rc.cpp:154 rc.cpp:181 rc.cpp:284 debug/libk9copy/mp4dlg.cpp:149 +#: debug/src/prefAuthor.cpp:147 debug/src/prefMPEG4.cpp:337 +#: debug/src/prefMPEG4.cpp:347 +#, no-c-format +msgid "Bitrate" +msgstr "" + +#: rc.cpp:71 rc.cpp:215 rc.cpp:232 debug/libk9copy/mp4dlg.cpp:150 +#: debug/src/k9mainw.cpp:66 debug/src/k9mainw.cpp:161 +#, no-c-format +msgid "Size" +msgstr "Taille" + +#: rc.cpp:74 debug/src/mencoderCmdGen.cpp:98 src/k9mencodercmdgen.cpp:55 +#, no-c-format +msgid "MEncoder options" +msgstr "Options de MEncoder" + +#: rc.cpp:78 debug/src/mencoderCmdGen.cpp:108 src/k9mencodercmdgen.cpp:68 +#, no-c-format +msgid "Audio Codec" +msgstr "Codec Audio" + +#: rc.cpp:81 rc.cpp:169 debug/src/prefMPEG4.cpp:343 +#: debug/src/mencoderCmdGen.cpp:104 +#, no-c-format +msgid "faac" +msgstr "" + +#: rc.cpp:84 rc.cpp:96 debug/src/mencoderCmdGen.cpp:107 +#: debug/src/mencoderCmdGen.cpp:119 +#, no-c-format +msgid "lavc" +msgstr "" + +#: rc.cpp:87 debug/src/mencoderCmdGen.cpp:120 src/k9mencodercmdgen.cpp:84 +#, no-c-format +msgid "Video Codec" +msgstr "Codec Vidéo" + +#: rc.cpp:90 rc.cpp:121 rc.cpp:388 debug/src/prefMPEG4.cpp:323 +#: debug/src/prefMencoder.cpp:299 debug/src/mencoderCmdGen.cpp:113 +#, no-c-format +msgid "x264" +msgstr "" + +#: rc.cpp:93 debug/src/mencoderCmdGen.cpp:116 +#, no-c-format +msgid "xvid" +msgstr "" + +#: rc.cpp:99 rc.cpp:313 rc.cpp:365 debug/src/prefMPEG4.cpp:315 +#: debug/src/prefMencoder.cpp:286 debug/src/prefpreview.cpp:140 +#, no-c-format +msgid "Form1" +msgstr "" + +#: rc.cpp:103 debug/src/prefMPEG4.cpp:339 +#, no-c-format +msgid "Video" +msgstr "Vidéo" + +#: rc.cpp:106 debug/src/prefMPEG4.cpp:317 +#, no-c-format +msgid "2 pass" +msgstr "2 passes" + +#: rc.cpp:109 debug/src/prefMPEG4.cpp:318 +#, no-c-format +msgid "Alt+2" +msgstr "" + +#: rc.cpp:112 rc.cpp:163 debug/src/prefMPEG4.cpp:319 +#: debug/src/prefMPEG4.cpp:340 +#, no-c-format +msgid "Codec" +msgstr "Codec" + +#: rc.cpp:115 rc.cpp:385 debug/src/prefMPEG4.cpp:321 +#: debug/src/prefMencoder.cpp:298 +#, no-c-format +msgid "XviD" +msgstr "" + +#: rc.cpp:118 debug/src/prefMPEG4.cpp:322 +#, no-c-format +msgid "lavc MPEG4" +msgstr "" + +#: rc.cpp:130 debug/src/prefMPEG4.cpp:327 +#, no-c-format +msgid "640" +msgstr "" + +#: rc.cpp:134 debug/src/prefMPEG4.cpp:329 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "Conserver les proportions" + +#: rc.cpp:137 rc.cpp:493 debug/src/playbackoptionsw.cpp:230 +#: debug/src/prefMPEG4.cpp:330 +#, no-c-format +msgid "Alt+K" +msgstr "" + +#: rc.cpp:141 rc.cpp:206 rc.cpp:238 debug/src/prefMPEG4.cpp:332 +#: debug/src/k9mainw.cpp:163 +#, no-c-format +msgid "X" +msgstr "" + +#: rc.cpp:145 debug/src/prefMPEG4.cpp:334 +#, no-c-format +msgid "File size" +msgstr "Taille du fichier" + +#: rc.cpp:148 debug/src/prefMPEG4.cpp:335 +#, no-c-format +msgid "Alt+S" +msgstr "" + +#: rc.cpp:151 debug/src/prefMPEG4.cpp:336 +#, no-c-format +msgid " MB" +msgstr " Mo" + +#: rc.cpp:157 rc.cpp:519 debug/src/prefMPEG4.cpp:338 debug/src/prefDVD.cpp:100 +#, no-c-format +msgid "Alt+B" +msgstr "" + +#: rc.cpp:160 rc.cpp:263 rc.cpp:507 rc.cpp:575 +#: debug/src/playbackoptionsw.cpp:236 debug/src/prefAuthor.cpp:138 +#: debug/src/prefMPEG4.cpp:350 debug/k9Mplayer/mplayer.cpp:594 +#: src/k9langselect.cpp:79 +#, no-c-format +msgid "Audio" +msgstr "Audio" + +#: rc.cpp:166 debug/src/prefMPEG4.cpp:342 +#, no-c-format +msgid "mp3" +msgstr "" + +#: rc.cpp:172 debug/src/prefMPEG4.cpp:344 +#, no-c-format +msgid "mp2" +msgstr "" + +#: rc.cpp:175 debug/src/prefMPEG4.cpp:345 +#, no-c-format +msgid "ac3" +msgstr "" + +#: rc.cpp:178 debug/src/prefMPEG4.cpp:346 +#, no-c-format +msgid "adpcm ima" +msgstr "" + +#: rc.cpp:185 debug/src/prefMPEG4.cpp:349 +#, no-c-format +msgid "Gain" +msgstr "Gain" + +#: rc.cpp:188 debug/src/prefMPEG4.cpp:351 +#, no-c-format +msgid "use cell cache" +msgstr "mise en cache des cellules" + +#: rc.cpp:191 rc.cpp:220 debug/src/k9mainw.cpp:157 +#, no-c-format +msgid "MainDlg" +msgstr "" + +#: rc.cpp:194 rc.cpp:223 debug/src/k9mainw.cpp:158 +#, no-c-format +msgid "Output device " +msgstr "Graveur" + +#: rc.cpp:197 rc.cpp:244 debug/src/k9mainw.cpp:166 +#, no-c-format +msgid "@" +msgstr "" + +#: rc.cpp:200 +#, no-c-format +msgid "Input device " +msgstr "Lecteur source" + +#: rc.cpp:203 rc.cpp:241 debug/src/k9mainw.cpp:165 libk9copy/k9burndvd.cpp:178 +#: libk9copy/k9burndvd.cpp:278 src/k9main.cpp:1344 +#: src/k9playbackoptions.cpp:147 k9author/k9import.cpp:207 +#, no-c-format +msgid "default" +msgstr "défaut" + +#: rc.cpp:209 +#, no-c-format +msgid "D&VD" +msgstr "DVD" + +#: rc.cpp:212 rc.cpp:229 debug/src/k9mainw.cpp:65 debug/src/k9mainw.cpp:160 +#, no-c-format +msgid "Title" +msgstr "Titre" + +#: rc.cpp:226 debug/src/k9mainw.cpp:159 src/main.cpp:37 +#, no-c-format +msgid "input device" +msgstr "Lecteur source" + +#: rc.cpp:235 debug/src/k9mainw.cpp:68 debug/src/k9mainw.cpp:162 +#, no-c-format +msgid "Content" +msgstr "Contenu" + +#: rc.cpp:248 debug/src/k9mainw.cpp:168 +#, no-c-format +msgid "Open a folder" +msgstr "Ouvrir le DVD" + +#: rc.cpp:252 debug/src/k9mainw.cpp:170 +#, no-c-format +msgid "Open an iso image" +msgstr "Ouvrir l'image ISO" + +#: rc.cpp:255 debug/src/viewmpeg2.cpp:205 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9copy - Aperçu du Titre" + +#: rc.cpp:260 debug/src/prefAuthor.cpp:137 +msgid "Authoring options" +msgstr "Options d'authoring" + +#: rc.cpp:266 debug/src/prefAuthor.cpp:140 +#, no-c-format +msgid "AC3" +msgstr "" + +#: rc.cpp:269 debug/src/prefAuthor.cpp:141 +#, no-c-format +msgid "MP2" +msgstr "" + +#: rc.cpp:272 debug/src/prefAuthor.cpp:143 +#, no-c-format +msgid "128" +msgstr "" + +#: rc.cpp:275 debug/src/prefAuthor.cpp:144 +#, no-c-format +msgid "192" +msgstr "" + +#: rc.cpp:278 debug/src/prefAuthor.cpp:145 +#, no-c-format +msgid "320" +msgstr "" + +#: rc.cpp:281 debug/src/prefAuthor.cpp:146 +#, no-c-format +msgid "Format" +msgstr "" + +#: rc.cpp:287 debug/src/prefAuthor.cpp:148 +#, no-c-format +msgid "Buttons" +msgstr "Boutons" + +#: rc.cpp:299 debug/src/prefAuthor.cpp:152 +#, no-c-format +msgid "Hilite color" +msgstr "Surbrillance" + +#: rc.cpp:303 debug/src/prefAuthor.cpp:154 +#, no-c-format +msgid "Text color" +msgstr "Couleur du texte" + +#: rc.cpp:307 debug/src/langselectw.cpp:120 src/k9copy.cpp:120 +#, no-c-format +msgid "Selection" +msgstr "Sélection" + +#: rc.cpp:310 debug/src/langselectw.cpp:93 debug/src/langselectw.cpp:121 +#, no-c-format +msgid "Languages" +msgstr "Langues" + +#: rc.cpp:317 debug/src/prefpreview.cpp:142 +#, no-c-format +msgid "&Internal Player" +msgstr "Lecteur interne" + +#: rc.cpp:320 debug/src/prefpreview.cpp:143 +#, no-c-format +msgid "Alt+I" +msgstr "" + +#: rc.cpp:323 debug/src/prefpreview.cpp:144 +#, no-c-format +msgid "MPlayer" +msgstr "MPlayer" + +#: rc.cpp:326 debug/src/prefpreview.cpp:145 +#, no-c-format +msgid "Alt+M" +msgstr "" + +#: rc.cpp:329 debug/src/prefpreview.cpp:146 +#, no-c-format +msgid "Internal viewer options" +msgstr "Options du lecteur interne" + +#: rc.cpp:332 debug/src/prefpreview.cpp:147 +#, no-c-format +msgid "use OpenGL" +msgstr "utiliser OpenGL" + +#: rc.cpp:335 debug/src/prefpreview.cpp:148 +#, no-c-format +msgid "Video output" +msgstr "Sortie vidéo" + +#: rc.cpp:338 debug/src/prefpreview.cpp:149 +#, no-c-format +msgid "Audio output" +msgstr "Sortie Audio" + +#: rc.cpp:341 debug/src/prefpreview.cpp:151 +#, no-c-format +msgid "X11" +msgstr "" + +#: rc.cpp:344 debug/src/prefpreview.cpp:152 +#, no-c-format +msgid "Xv" +msgstr "" + +#: rc.cpp:347 debug/src/prefpreview.cpp:153 +#, no-c-format +msgid "OpenGL" +msgstr "" + +#: rc.cpp:350 rc.cpp:359 debug/src/prefpreview.cpp:154 +#: debug/src/prefpreview.cpp:158 +#, no-c-format +msgid "SDL" +msgstr "" + +#: rc.cpp:353 debug/src/prefpreview.cpp:156 +#, no-c-format +msgid "ALSA" +msgstr "" + +#: rc.cpp:356 debug/src/prefpreview.cpp:157 +#, no-c-format +msgid "OSS" +msgstr "" + +#: rc.cpp:362 debug/src/prefpreview.cpp:159 +#, no-c-format +msgid "MPlayer options" +msgstr "Options de MPlayer" + +#: rc.cpp:368 debug/src/prefMencoder.cpp:287 +#, no-c-format +msgid "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" +msgstr "" + +#: rc.cpp:375 debug/src/prefMencoder.cpp:292 +#, no-c-format +msgid "" +"pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" +msgstr "" +"numéro de la passe\n" +"largeur de la vidéo\n" +"hauteur de la vidéo\n" +"bitrate vidéo\n" +"bitrate audio" + +#: rc.cpp:382 debug/src/prefMencoder.cpp:326 +#, no-c-format +msgid "Video codecs" +msgstr "Codecs Vidéo" + +#: rc.cpp:391 debug/src/prefMencoder.cpp:300 +#, no-c-format +msgid "MJPEG" +msgstr "" + +#: rc.cpp:394 debug/src/prefMencoder.cpp:301 +#, no-c-format +msgid "LJPEG" +msgstr "" + +#: rc.cpp:397 debug/src/prefMencoder.cpp:302 +#, no-c-format +msgid "H.261" +msgstr "" + +#: rc.cpp:400 debug/src/prefMencoder.cpp:303 +#, no-c-format +msgid "H.263" +msgstr "" + +#: rc.cpp:403 debug/src/prefMencoder.cpp:304 +#, no-c-format +msgid "MPEG-4 (DivX 4/5)" +msgstr "" + +#: rc.cpp:406 debug/src/prefMencoder.cpp:305 +#, no-c-format +msgid "DivX 3" +msgstr "" + +#: rc.cpp:409 debug/src/prefMencoder.cpp:306 +#, no-c-format +msgid "MS MPEG-4 v2" +msgstr "" + +#: rc.cpp:412 debug/src/prefMencoder.cpp:307 +#, no-c-format +msgid "WMV7" +msgstr "" + +#: rc.cpp:415 debug/src/prefMencoder.cpp:308 +#, no-c-format +msgid "WMV8" +msgstr "" + +#: rc.cpp:418 debug/src/prefMencoder.cpp:309 +#, no-c-format +msgid "RealVideo" +msgstr "" + +#: rc.cpp:421 debug/src/prefMencoder.cpp:310 +#, no-c-format +msgid "MPEG-1" +msgstr "" + +#: rc.cpp:424 debug/src/prefMencoder.cpp:311 +#, no-c-format +msgid "MPEG-2" +msgstr "" + +#: rc.cpp:427 debug/src/prefMencoder.cpp:312 +#, no-c-format +msgid "HuffYUV" +msgstr "" + +#: rc.cpp:430 debug/src/prefMencoder.cpp:313 +#, no-c-format +msgid "ffvHuff" +msgstr "" + +#: rc.cpp:433 debug/src/prefMencoder.cpp:314 +#, no-c-format +msgid "ASUS v1" +msgstr "" + +#: rc.cpp:436 debug/src/prefMencoder.cpp:315 +#, no-c-format +msgid "ASUS v2" +msgstr "" + +#: rc.cpp:440 rc.cpp:465 rc.cpp:555 debug/src/configDlg.cpp:42 +#: debug/src/configDlg.cpp:95 debug/src/prefMencoder.cpp:317 +#: debug/src/prefMencoder.cpp:329 +#, no-c-format +msgid "label" +msgstr "libellé" + +#: rc.cpp:443 debug/src/prefMencoder.cpp:318 +#, no-c-format +msgid "fourcc" +msgstr "" + +#: rc.cpp:446 debug/src/prefMencoder.cpp:319 +#, no-c-format +msgid "first pass" +msgstr "première passe" + +#: rc.cpp:451 debug/src/prefMencoder.cpp:322 +#, no-c-format +msgid "one pass" +msgstr "une passe" + +#: rc.cpp:456 debug/src/prefMencoder.cpp:325 +#, no-c-format +msgid "second pass" +msgstr "deuxième passe" + +#: rc.cpp:459 debug/src/prefMencoder.cpp:332 +#, no-c-format +msgid "Audio codecs" +msgstr "Codecs Audio" + +#: rc.cpp:462 debug/src/prefMencoder.cpp:328 +#, no-c-format +msgid "New Item" +msgstr "Nouvel élément" + +#: rc.cpp:469 debug/src/prefMencoder.cpp:331 +#, no-c-format +msgid "options" +msgstr "options" + +#: rc.cpp:472 debug/src/prefMencoder.cpp:333 +#, no-c-format +msgid "Available variables" +msgstr "variables disponibles" + +#: rc.cpp:475 debug/src/titlefactor.cpp:321 +#, no-c-format +msgid "Shrink Factors" +msgstr "Facteurs de compression" + +#: rc.cpp:478 debug/src/titlefactor.cpp:322 +#, no-c-format +msgid "Shrink Factor for Title %1" +msgstr "Facteur de compression pour le Titre %1" + +#: rc.cpp:481 debug/src/titlefactor.cpp:323 +#, no-c-format +msgid "Change Factor" +msgstr "Modifier le facteur" + +#: rc.cpp:484 debug/src/titlefactor.cpp:324 +#, no-c-format +msgid "0.00" +msgstr "" + +#: rc.cpp:487 debug/src/playbackoptionsw.cpp:228 src/k9copy.cpp:114 +#, no-c-format +msgid "DVD playback options" +msgstr "Options de lecture du DVD" + +#: rc.cpp:490 debug/src/playbackoptionsw.cpp:229 +#, no-c-format +msgid "&Keep original menus" +msgstr "Conserver les menus originaux" + +#: rc.cpp:498 debug/src/playbackoptionsw.cpp:233 +#, no-c-format +msgid "Selected Titles" +msgstr "Titres sélectionnés" + +#: rc.cpp:501 debug/src/playbackoptionsw.cpp:234 +#, no-c-format +msgid "Default language" +msgstr "Langue par défaut" + +#: rc.cpp:504 debug/src/playbackoptionsw.cpp:235 +#, no-c-format +msgid "Subtitle" +msgstr "Sous-titre" + +#: rc.cpp:510 debug/src/prefDVD.cpp:97 +#, no-c-format +msgid "prefDVD" +msgstr "" + +#: rc.cpp:513 debug/src/prefDVD.cpp:98 +#, no-c-format +msgid "Output directory" +msgstr "Répertoire de sortie" + +#: rc.cpp:516 debug/src/prefDVD.cpp:99 +#, no-c-format +msgid "Burn with k3b" +msgstr "Graver avec k3b" + +#: rc.cpp:522 debug/src/prefDVD.cpp:101 +#, no-c-format +msgid "Auto burn" +msgstr "Gravure auto" + +#: rc.cpp:525 debug/src/prefDVD.cpp:102 +#, no-c-format +msgid "Alt+T" +msgstr "" + +#: rc.cpp:528 debug/src/prefDVD.cpp:103 +#, no-c-format +msgid "DVD size" +msgstr "Taille du DVD" + +#: rc.cpp:531 debug/src/prefDVD.cpp:104 +#, no-c-format +msgid "Quick scan" +msgstr "Scan rapide" + +#: rc.cpp:534 debug/src/prefDVD.cpp:105 +#, no-c-format +msgid "Alt+Q" +msgstr "" + +#: rc.cpp:537 debug/src/prefDVD.cpp:106 +#, no-c-format +msgid "use dvdAuthor for copy without menus" +msgstr "utiliser dvdAuthor pour la copie sans menus" + +#: rc.cpp:540 debug/src/prefDVD.cpp:107 +#, no-c-format +msgid "Alt+D" +msgstr "" + +#: rc.cpp:543 debug/src/prefDVD.cpp:108 +#, no-c-format +msgid "Clear output directory on exit" +msgstr "Vider le répertoire de sortie en quittant" + +#: rc.cpp:546 debug/src/prefDVD.cpp:109 +#, no-c-format +msgid "Alt+Y" +msgstr "" + +#: rc.cpp:549 debug/src/configDlg.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Lecteurs" + +#: rc.cpp:552 debug/src/configDlg.cpp:40 debug/src/configDlg.cpp:94 +#, no-c-format +msgid "device" +msgstr "périphérique" + +#: rc.cpp:558 debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:96 +#, no-c-format +msgid "Input" +msgstr "Entrée" + +#: rc.cpp:561 rc.cpp:597 debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:97 +#: debug/k9author/import.cpp:105 +#, no-c-format +msgid "Output" +msgstr "Sortie" + +#: rc.cpp:572 debug/k9Mplayer/mplayer.cpp:593 src/k9settings.cpp:57 +#: src/k9copy.cpp:128 src/k9copy.cpp:390 k9Mplayer/k9mplayer.cpp:97 +#, no-c-format +msgid "Preview" +msgstr "Aperçu" + +#: rc.cpp:578 debug/k9Mplayer/mplayer.cpp:595 +#, no-c-format +msgid "Subpicture" +msgstr "Sous-titre" + +#: rc.cpp:585 debug/k9Mplayer/mplayer.cpp:600 +#, no-c-format +msgid "-" +msgstr "" + +#: rc.cpp:589 debug/k9Mplayer/mplayer.cpp:602 +#, no-c-format +msgid "+" +msgstr "" + +#: rc.cpp:594 debug/k9author/import.cpp:104 +#, no-c-format +msgid "import" +msgstr "" + +#: rc.cpp:600 debug/k9author/import.cpp:44 debug/k9author/import.cpp:106 +msgid "Video files" +msgstr "Fichiers vidéo" + +#: rc.cpp:606 debug/k9author/import.cpp:109 +#, no-c-format +msgid "PAL" +msgstr "" + +#: rc.cpp:609 debug/k9author/import.cpp:110 +#, no-c-format +msgid "NTSC" +msgstr "" + +#: rc.cpp:615 debug/k9author/chapterEdit.cpp:145 src/k9copy.cpp:211 +#: k9author/k9importfiles.cpp:34 +#, no-c-format +msgid "Chapter properties" +msgstr "Propriétés du chapitre" + +#: rc.cpp:618 debug/k9author/chapterEdit.cpp:146 +#, no-c-format +msgid "start" +msgstr "début" + +#: rc.cpp:621 debug/k9author/chapterEdit.cpp:147 +msgid "video" +msgstr "vidéo" + +#: rc.cpp:624 debug/k9author/chapterEdit.cpp:148 +#, no-c-format +msgid "" +"*.avi\n" +"*.mpeg" +msgstr "" + +#: rc.cpp:628 rc.cpp:643 debug/k9author/chapterEdit.cpp:150 +#: debug/k9author/chapterEdit.cpp:155 +msgid "set Current Frame" +msgstr "Image courante" + +#: rc.cpp:631 rc.cpp:637 debug/k9author/chapterEdit.cpp:151 +#: debug/k9author/chapterEdit.cpp:153 +#, no-c-format +msgid "break continuity" +msgstr "rupture de continuité" + +#: rc.cpp:634 debug/k9author/chapterEdit.cpp:152 +#, no-c-format +msgid "end" +msgstr "fin" + +#: rc.cpp:646 debug/k9author/chapterEdit.cpp:156 +#, no-c-format +msgid "set Title button" +msgstr "définir le bouton du titre" + +#: rc.cpp:649 debug/k9author/newTitle.cpp:124 src/k9copy.cpp:204 +#: k9author/k9importfiles.cpp:40 k9author/k9newtitle.cpp:55 +msgid "Add title" +msgstr "Ajouter un titre" + +#: rc.cpp:653 debug/k9author/newTitle.cpp:126 +msgid "number of chapters" +msgstr "nombre de chapitres" + +#: rc.cpp:656 debug/k9author/newTitle.cpp:127 +msgid "chapter length" +msgstr "longueur du chapitre" + +#: rc.cpp:663 debug/k9author/newTitle.cpp:130 +msgid "Video file" +msgstr "Fichier vidéo" + +#: rc.cpp:669 debug/k9author/menuEdit.cpp:146 src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +#, no-c-format +msgid "Edit Menu" +msgstr "Editer le menu" + +#: rc.cpp:672 debug/k9author/menuEdit.cpp:147 +#, no-c-format +msgid "Text" +msgstr "Texte" + +#: rc.cpp:675 debug/k9author/menuEdit.cpp:148 +#, no-c-format +msgid "Background picture" +msgstr "Image de fond" + +#: rc.cpp:690 debug/k9author/menuEdit.cpp:156 k9author/k9menuedit.cpp:286 +#: k9author/k9import.cpp:45 +#, no-c-format +msgid "Root Menu" +msgstr "Menu Racine" + +#: rc.cpp:693 debug/k9author/menuEdit.cpp:157 +#, no-c-format +msgid "At start" +msgstr "Au démarrage" + +#: rc.cpp:696 debug/k9author/menuEdit.cpp:159 +msgid "Play menu" +msgstr "Jouer le menu" + +#: rc.cpp:699 rc.cpp:711 debug/k9author/menuEdit.cpp:160 +#: debug/k9author/menuEdit.cpp:165 +msgid "Play title 1" +msgstr "Lecture du titre 1" + +#: rc.cpp:702 debug/k9author/menuEdit.cpp:161 +#, no-c-format +msgid "At End" +msgstr "A la fin" + +#: rc.cpp:705 debug/k9author/menuEdit.cpp:163 +#, no-c-format +msgid "Play root menu" +msgstr "Jouer le menu racine" + +#: rc.cpp:708 debug/k9author/menuEdit.cpp:164 +msgid "Play title menu" +msgstr "Lecture du &titre" + +#: rc.cpp:717 +#, no-c-format +msgid "A&ctions" +msgstr "A&ctions" + +#: rc.cpp:720 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Barre d'outils Actions" + +#: debug/libk9copy/k9ifo2.moc.cpp:34 debug/libk9copy/k9ifo2.moc.cpp:42 +msgid "k9Ifo2" +msgstr "" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:34 +#: debug/libk9copy/k9dvdchapter.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:107 +#: debug/libk9copy/k9dvdchapter.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9DVDVideoStream" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDAudioStream" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDSubtitle" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDTitle" +msgstr "" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "" + +#: debug/libk9copy/k9dvdtitleset.moc.cpp:34 +#: debug/libk9copy/k9dvdtitleset.moc.cpp:42 +msgid "k9DVDTitleset" +msgstr "" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "" + +#: debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9copy - Aperçu du Menu " + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "k9Widget" +msgstr "" + +#: debug/src/kviewmpeg2.moc.cpp:107 debug/src/kviewmpeg2.moc.cpp:115 +msgid "kViewMPEG2" +msgstr "" + +#: debug/k9Mplayer/k9mplayer.moc.cpp:34 debug/k9Mplayer/k9mplayer.moc.cpp:42 +msgid "K9Mplayer" +msgstr "" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "" + +#: libk9copy/k9dvd.cpp:133 +msgid "for visually impaired" +msgstr "pour déficients visuels" + +#: libk9copy/k9dvd.cpp:134 +msgid "director's comments" +msgstr "commentaires du réalisateur" + +#: libk9copy/k9dvd.cpp:135 +msgid "alternate director's comments" +msgstr "commentaires du réalisateurs alternatifs" + +#: libk9copy/k9dvd.cpp:139 +msgid "Large" +msgstr "Large" + +#: libk9copy/k9dvd.cpp:140 +msgid "Children" +msgstr "Enfants" + +#: libk9copy/k9dvd.cpp:141 libk9copy/k9dvd.cpp:147 libk9copy/k9dvd.cpp:148 +#: libk9copy/k9dvd.cpp:149 +msgid "reserved" +msgstr "réservé" + +#: libk9copy/k9dvd.cpp:142 +msgid "Normal captions" +msgstr "Sous-titres normaux" + +#: libk9copy/k9dvd.cpp:143 +msgid "Large captions" +msgstr "Sous-titres larges" + +#: libk9copy/k9dvd.cpp:144 +msgid "Children captions" +msgstr "Sous-titres pour enfants" + +#: libk9copy/k9dvd.cpp:146 +msgid "Forced" +msgstr "Forcé" + +#: libk9copy/k9dvd.cpp:150 +msgid "Director's comments" +msgstr "Commentaires du réalisateur" + +#: libk9copy/k9dvd.cpp:151 +msgid "Large director's comments" +msgstr "Commentaires du réalisateur larges" + +#: libk9copy/k9dvd.cpp:152 +msgid "Director's comments for children" +msgstr "Commentaires du réalisateur pour les enfants" + +#: libk9copy/k9dvd.cpp:189 +msgid "Couldn't open %1 for title\n" +msgstr "Ne peut ouvrir %1 pour lecture du titre\n" + +#: libk9copy/k9dvd.cpp:191 libk9copy/k9dvd.cpp:199 libk9copy/k9dvd.cpp:207 +#: libk9copy/k9dvd.cpp:368 src/k9main.cpp:563 +msgid "unknown" +msgstr "inconnu" + +#: libk9copy/k9dvd.cpp:197 +msgid "Couldn't seek in %1 for title\n" +msgstr "Ne peut accéder à %1 pour lecture du titre\n" + +#: libk9copy/k9dvd.cpp:224 +msgid "Not Specified" +msgstr "Non spécifié" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afar" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Abkhazian" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afrikaans" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Amharic" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Arabic" +msgstr "Arabe" + +#: libk9copy/k9dvd.cpp:225 +msgid "Assamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Aymara" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Azerbaijani" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Bashkir" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Byelorussian" +msgstr "Biélorusse" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bulgarian" +msgstr "Bulgare" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bihari" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bislama" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bengali; Bangla" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Tibetan" +msgstr "Tibétain" + +#: libk9copy/k9dvd.cpp:227 +msgid "Breton" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Catalan" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Corsican" +msgstr "Corse" + +#: libk9copy/k9dvd.cpp:227 +msgid "Czech" +msgstr "Tchèque" + +#: libk9copy/k9dvd.cpp:228 +msgid "Welsh" +msgstr "Gallois" + +#: libk9copy/k9dvd.cpp:228 +msgid "Dansk" +msgstr "Danois" + +#: libk9copy/k9dvd.cpp:228 +msgid "Deutsch" +msgstr "Allemand" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Greek" +msgstr "Grèque" + +#: libk9copy/k9dvd.cpp:228 +msgid "English" +msgstr "Anglais" + +#: libk9copy/k9dvd.cpp:229 +msgid "Esperanto" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Espanol" +msgstr "Espagnol" + +#: libk9copy/k9dvd.cpp:229 +msgid "Estonian" +msgstr "Estonien" + +#: libk9copy/k9dvd.cpp:229 +msgid "Basque" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Persian" +msgstr "Perse" + +#: libk9copy/k9dvd.cpp:230 +msgid "Suomi" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Fiji" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Faroese" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Francais" +msgstr "Français" + +#: libk9copy/k9dvd.cpp:230 +msgid "Frisian" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Gaelic" +msgstr "Gaélique" + +#: libk9copy/k9dvd.cpp:231 +msgid "Scots Gaelic" +msgstr "Gaélique Ecossais" + +#: libk9copy/k9dvd.cpp:231 +msgid "Galician" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Guarani" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Gujarati" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Hausa" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 libk9copy/k9dvd.cpp:234 +msgid "Hebrew" +msgstr "Hébreux" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hindi" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hrvatski" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Magyar" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Armenian" +msgstr "Arménien" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingua" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Indonesian" +msgstr "Indonésien" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingue" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Islenska" +msgstr "Islandais" + +#: libk9copy/k9dvd.cpp:234 +msgid "Italiano" +msgstr "Italien" + +#: libk9copy/k9dvd.cpp:234 +msgid "Inuktitut" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Japanese" +msgstr "Japonais" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:250 +msgid "Yiddish" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Javanese" +msgstr "Javanais" + +#: libk9copy/k9dvd.cpp:235 +msgid "Georgian" +msgstr "Géorgien" + +#: libk9copy/k9dvd.cpp:235 +msgid "Kazakh" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Greenlandic" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Cambodian" +msgstr "Cambodgien" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kannada" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Korean" +msgstr "Coréen" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kashmiri" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kurdish" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kirghiz" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Latin" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lingala" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Laothian" +msgstr "Laotien" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lithuanian" +msgstr "Lithuanien" + +#: libk9copy/k9dvd.cpp:238 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Maori" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Macedonian" +msgstr "Macédonien" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Mongolian" +msgstr "Mongolien" + +#: libk9copy/k9dvd.cpp:239 +msgid "Moldavian" +msgstr "Moldave" + +#: libk9copy/k9dvd.cpp:239 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nepali" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nederlands" +msgstr "Néerlandais" + +#: libk9copy/k9dvd.cpp:240 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Occitan" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Polish" +msgstr "Polonais" + +#: libk9copy/k9dvd.cpp:241 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Portugues" +msgstr "Portugais" + +#: libk9copy/k9dvd.cpp:242 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Romanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Russian" +msgstr "Russe" + +#: libk9copy/k9dvd.cpp:243 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Serbo-Croatian" +msgstr "Serbo-Croate" + +#: libk9copy/k9dvd.cpp:244 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovak" +msgstr "Slovaque" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovenian" +msgstr "Slovène" + +#: libk9copy/k9dvd.cpp:244 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Albanian" +msgstr "Albanais" + +#: libk9copy/k9dvd.cpp:245 +msgid "Serbian" +msgstr "Serbe" + +#: libk9copy/k9dvd.cpp:245 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Tamil" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Thai" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Turkish" +msgstr "Turque" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Ukrainian" +msgstr "Ukrainien" + +#: libk9copy/k9dvd.cpp:249 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Vietnamese" +msgstr "Vietnamien" + +#: libk9copy/k9dvd.cpp:250 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Chinese" +msgstr "Chinois" + +#: libk9copy/k9dvd.cpp:251 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 libk9copy/k9dvd.cpp:252 libk9copy/k9dvd.cpp:475 +msgid "Unknown" +msgstr "Inconnu" + +#: libk9copy/k9dvd.cpp:342 +msgid "Can't open disc %1!\n" +msgstr "Ne peut ouvrir le disque %1!\n" + +#: libk9copy/k9dvd.cpp:354 +msgid "Can't open main ifo!\n" +msgstr "Ne peut ouvrir le fichier ifo principal!\n" + +#: libk9copy/k9dvd.cpp:396 libk9copy/k9dvd.cpp:691 +msgid "Title %1" +msgstr "Titre %1" + +#: libk9copy/k9dvd.cpp:742 +msgid "reading title" +msgstr "lecture du titre" + +#: libk9copy/k9dvd.cpp:859 +msgid "Error opening vobs for title %1\n" +msgstr "Erreur d'ouverture des vobs pour le titre %1\n" + +#: libk9copy/k9dvd.cpp:870 +msgid "ERROR reading block %1\n" +msgstr "Erreur de lecture du bloc %1\n" + +#: libk9copy/k9dvdauthor.cpp:148 libk9copy/k9dvdauthor.cpp:366 +msgid "'%1' not selected" +msgstr "'%1' non sélectionné" + +#: libk9copy/k9dvdauthor.cpp:149 libk9copy/k9dvdauthor.cpp:367 +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9dvdauthor.cpp:436 +#: libk9copy/k9dvdauthor.cpp:445 libk9copy/k9dvdauthor.cpp:448 +#: libk9copy/k9burndvd.cpp:237 libk9copy/k9burndvd.cpp:321 +#: k9author/k9newdvd.cpp:122 +msgid "authoring" +msgstr "authoring" + +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +#: k9Mplayer/k9mplayer.cpp:97 +msgid "Unable to run %1" +msgstr "Impossible d'exécuter %1" + +#: libk9copy/k9dvdauthor.cpp:403 libk9copy/k9dvdauthor.cpp:476 +#: libk9copy/k9dvdauthor.cpp:514 src/k9settings.cpp:63 +#: k9author/k9newdvd.cpp:143 +msgid "Authoring" +msgstr "Authoring" + +#: libk9copy/k9dvdauthor.cpp:436 +msgid "Dvdauthor error :\n" +msgstr "Erreur dans DVDAuthor :\n" + +#: libk9copy/k9dvdauthor.cpp:445 +msgid "Authoring cancelled" +msgstr "L'authoring a été annulé" + +#: libk9copy/k9dvdauthor.cpp:448 k9author/k9newdvd.cpp:136 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Un erreur est survenue lors de l'exécution de DVDAuthor\n" + +#: libk9copy/k9dvdauthor.cpp:515 +msgid "Fixing VOBUS" +msgstr "Correction des VOBUS" + +#: libk9copy/k9mp4enc.cpp:103 libk9copy/k9mp4enc.cpp:312 +msgid "Encoding error" +msgstr "Erreur d'encodage" + +#: libk9copy/k9mp4enc.cpp:152 src/k9main.cpp:1155 +msgid "Save file to disk" +msgstr "Enregister le fichier sur le disque" + +#: libk9copy/k9mp4enc.cpp:161 libk9copy/k9mp4enc.cpp:350 +#: src/k9prefmpeg4.cpp:34 src/k9mp4title.cpp:49 src/k9main.cpp:290 +#: src/k9main.cpp:300 src/k9main.cpp:310 src/k9main.cpp:330 src/k9main.cpp:588 +#: src/k9main.cpp:689 src/k9main.cpp:703 src/k9prefdvd.cpp:35 +msgid "MB" +msgstr "Mo" + +#: libk9copy/k9mp4enc.cpp:233 libk9copy/k9mp4enc.cpp:235 +#: k9author/k9newdvd.cpp:247 +msgid "Encoding %1" +msgstr "Encodage %1" + +#: libk9copy/k9mp4enc.cpp:233 +msgid "pass %1" +msgstr "passe %1" + +#: libk9copy/k9mp4enc.cpp:309 +msgid "MPEG-4 Encoding cancelled" +msgstr "L'encodage MPEG-4 a été annulé" + +#: libk9copy/k9mp4enc.cpp:309 src/k9settings.cpp:48 src/k9main.cpp:1141 +msgid "MPEG-4 Encoding" +msgstr "Encodage MPEG-4" + +#: libk9copy/k9mp4enc.cpp:312 +msgid "Error while running mencoder :" +msgstr "Un erreur est survenue lors de l'exécution de MEncoder :" + +#: libk9copy/k9burndvd.cpp:188 libk9copy/k9burndvd.cpp:255 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - Gravure du DVD" + +#: libk9copy/k9burndvd.cpp:189 libk9copy/k9burndvd.cpp:256 +#: libk9copy/k9burndvd.cpp:348 src/k9main.cpp:435 +msgid "Burning DVD" +msgstr "Gravure du DVD" + +#: libk9copy/k9burndvd.cpp:200 libk9copy/k9burndvd.cpp:284 src/k9main.cpp:384 +#: k9author/k9import.cpp:178 +msgid "Save image to disk" +msgstr "Enregister l'image sur le disque" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:302 +msgid "Insert a recordable DVD" +msgstr "Insérer un DVD enregistrable" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:303 +#: libk9copy/k9burndvd.cpp:309 libk9copy/k9burndvd.cpp:314 +msgid "DVD burning" +msgstr "Gravure du DVD" + +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +msgid "Error burning DVD :\n" +msgstr "Erreur lors de lors de la gravure du DVD :\n" + +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:314 +msgid "DVD Burning finished" +msgstr "Gravure du DVD terminée" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "An error occured while Burning DVD: %1" +msgstr "Un erreur est survenue pendant la gravure du DVD : %1" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "Insert an other DVD" +msgstr "Insérer un autre DVD" + +#: libk9copy/k9burndvd.cpp:349 +msgid "Current write speed :%1 x" +msgstr "Vitesse d'écriture :%1 x" + +#: libk9copy/k9dvdbackup.cpp:149 libk9copy/k9dvdbackup.cpp:163 +#: libk9copy/k9dvdbackup.cpp:513 libk9copy/k9dvdbackup.cpp:599 +msgid "DVD backup cancelled" +msgstr "Le Backup du DVD a été annulé" + +#: libk9copy/k9dvdbackup.cpp:176 +msgid "unable to open VIDEO_TS.IFO" +msgstr "impossible d'ouvrir VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:198 libk9copy/k9dvdbackup.cpp:381 +#: libk9copy/k9dvdbackup.cpp:446 +msgid "Unable to open file " +msgstr "Impossible d'ouvrir le fichier " + +#: libk9copy/k9dvdbackup.cpp:277 +msgid "Unable to open titleset %1" +msgstr "Impossible d'ouvrir le titleset %1" + +#: libk9copy/k9dvdbackup.cpp:283 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting titleset %1" +msgstr "lecture du titleset %1" + +#: libk9copy/k9dvdbackup.cpp:453 +msgid "Unable to open menu for titleset %1" +msgstr "Impossible d'ouvrir le menu pour le titleset %1" + +#: libk9copy/k9dvdbackup.cpp:479 +msgid "Extracting menu for titleset %1" +msgstr "Extraction du menu pour le titleset %1" + +#: libk9copy/k9dvdbackup.cpp:563 +msgid "Unable to open ifo file for titleset %1" +msgstr "Impossible d'ouvrir le fichier ifo pour le titre %1" + +#: libk9copy/k9dvdbackup.cpp:575 libk9copy/k9dvdbackup.cpp:1694 +msgid "Unable to open DVD" +msgstr "Impossible d'ouvrir le DVD" + +#: libk9copy/k9dvdbackup.cpp:585 +msgid "Unable to open vobs for titleset %1" +msgstr "Erreur d'ouverture des vobs pour le titre %1" + +#: libk9copy/k9dvdbackup.cpp:1381 +msgid "Updating vob %1" +msgstr "Mise à jour du vob %1" + +#: libk9copy/k9dvdbackup.cpp:1398 +msgid "DVD backup canceled" +msgstr "Le backup du DVD a été annulé" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "Périphériques" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "Périphériques non détectés par k9copy" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 src/k9copy.cpp:294 +msgid "DVD Backup" +msgstr "Sauvegarde de DVD" + +#: src/k9settings.cpp:42 +msgid "MEncoder" +msgstr "" + +#: src/k9settings.cpp:42 +msgid "MPEG-4 Codecs" +msgstr "Codecs MPEG-4" + +#: src/k9settings.cpp:48 +msgid "MPEG-4" +msgstr "" + +#: src/k9settings.cpp:57 +msgid "Title preview" +msgstr "Aperçu du Titre" + +#: src/k9mp4title.cpp:36 src/k9mp4title.cpp:109 src/k9titlefactor.cpp:99 +msgid "Select a Title in the treeview..." +msgstr "Sélectionner un titre dans l'arborescence..." + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "Un utilitaire de Backup de DVD pour KDE" + +#: src/main.cpp:39 +msgid "output device" +msgstr "Graveur" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "titre à jouer" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "Lecture du titre vers stdout" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "secteur de départ" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "secteur de fin" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "liste des flux audio" + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "liste des sous-titres" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "facteur de compression" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "facteur de compression forcé" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "taille de la cellule à copier" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "taille totale des titres sélectionnés" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "taille des chapitres copiés" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "chapitres sélectionnés" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "taille du nouveau dvd" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "chapitre sélectionné" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "numéro de cellule dans le chapitre sélectionné" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "nom du fichier d'état" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "initialisation du fichier d'état" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "continuer la lecture depuis le dernier secteur" + +#: src/main.cpp:58 +msgid "don't save status at end" +msgstr "Ne pas conserver l'état à la fin" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "sauvegarde de la cellule dans un fichier temporaire avant l'encodage" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:69 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "Jean-Michel Petit" + +#: src/main.cpp:70 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "jm_petit@laposte.net" + +#: src/k9prefmencoder.cpp:105 src/k9prefmencoder.cpp:109 +#: src/k9prefmencoder.cpp:120 src/k9prefmencoder.cpp:122 +msgid "new profile" +msgstr "nouveau profil" + +#: src/k9copy.cpp:137 +msgid "Shrink Factor" +msgstr "Facteur de compression" + +#: src/k9copy.cpp:194 k9author/k9importfiles.cpp:31 +msgid "Edit menu" +msgstr "" + +#: src/k9copy.cpp:263 +msgid "Play title" +msgstr "Lecture du &titre" + +#: src/k9copy.cpp:279 +msgid "Create MPEG-4" +msgstr "Encoder au format MPEG-4" + +#: src/k9copy.cpp:286 +msgid "Eject" +msgstr "Ejecter" + +#: src/k9copy.cpp:300 +msgid "DVD Author" +msgstr "Création de DVD" + +#: src/k9copy.cpp:306 +msgid "Create DVD" +msgstr "Créer le DVD" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding options" +msgstr "Options d'encodage MPEG-4" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding Options" +msgstr "Options d'encodage MPEG-4" + +#: src/k9copy.cpp:375 +msgid "Settings" +msgstr "Paramètres" + +#: src/k9langselect.cpp:90 +msgid "Subtitles" +msgstr "Sous-titres" + +#: src/k9main.cpp:373 src/k9main.cpp:1141 +msgid "DVD is not opened" +msgstr "Le DVD n'est pas ouvert" + +#: src/k9main.cpp:373 src/k9main.cpp:395 +msgid "DVD Copy" +msgstr "Copie de DVD" + +#: src/k9main.cpp:395 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"Espace disque insuffisant sur %1\n" +"%2 mb attendus." + +#: src/k9main.cpp:399 +msgid "Backup in progress" +msgstr "Backup en cours" + +#: src/k9main.cpp:459 src/k9main.cpp:608 src/k9main.cpp:1194 +msgid "Ready" +msgstr "Prêt" + +#: src/k9main.cpp:464 k9author/k9import.cpp:156 +msgid "processing" +msgstr "traitement en cours" + +#: src/k9main.cpp:499 src/k9main.cpp:1247 k9author/k9import.cpp:63 +msgid "ISO Image" +msgstr "Image ISO" + +#: src/k9main.cpp:560 +msgid "Open DVD" +msgstr "Ouvrir le DVD" + +#: src/k9main.cpp:586 +msgid "Titleset %1" +msgstr "" + +#: src/k9main.cpp:636 +msgid "chapters" +msgstr "chapitres" + +#: src/k9main.cpp:644 src/k9main.cpp:657 k9author/k9newtitle.cpp:117 +#: k9author/k9newtitle.cpp:139 +msgid "chapter %1" +msgstr "chapitre %1" + +#: src/k9main.cpp:645 src/k9main.cpp:660 src/k9main.cpp:719 src/k9main.cpp:737 +msgid "%1 MB" +msgstr "%1 Mo" + +#: src/k9main.cpp:699 +msgid "video %1 " +msgstr "" + +#: src/k9main.cpp:710 +msgid "audio %1 " +msgstr "" + +#: src/k9main.cpp:730 +msgid "subpicture %1 " +msgstr "Sous-titre %1 " + +#: src/k9main.cpp:1149 +msgid "Transcoding title : %1" +msgstr "Transcodification du titre : %1" + +#: src/k9main.cpp:1248 k9author/k9import.cpp:64 +msgid "Folder" +msgstr "Dossier" + +#: src/k9main.cpp:1355 +msgid "Open ISO Image" +msgstr "Ouvrir l'image ISO" + +#: src/k9main.cpp:1366 +msgid "Open DVD folder" +msgstr "Ouvrir le DVD" + +#: src/k9mencodercmdgen.cpp:103 +msgid "Filters" +msgstr "Filtres" + +#: src/k9playbackoptions.cpp:149 +msgid "none" +msgstr "aucun" + +#: src/k9titlefactor.cpp:110 +msgid "Shrink Factor for %1" +msgstr "Facteur de compression pour %1" + +#: k9author/k9newdvd.cpp:94 +msgid "Creating root menu" +msgstr "Création du menu racine" + +#: k9author/k9newdvd.cpp:134 +msgid "The dvd authoring was canceled" +msgstr "L'authoring du DVD a été annulé" + +#: k9author/k9newdvd.cpp:160 +msgid "Creating menu for title %1" +msgstr "Création du menu pour le titre %1" + +#: k9author/k9newdvd.cpp:381 k9author/k9newtitle.cpp:63 +msgid "title %1" +msgstr "titre %1" + +#: k9author/k9avidecode.cpp:31 k9author/k9avidecode.cpp:35 +msgid "Cannot open then library %1" +msgstr "Impossible d'ouvrir la librairie %1" + +#: k9author/k9avidecode.cpp:88 +msgid "Couldn't open the file %1" +msgstr "Ne peut ouvrir le fichier %1" + +#: k9author/k9avidecode.cpp:93 +msgid "Couldn't find stream information" +msgstr "Ne peut trouver les informations du flux" + +#: k9author/k9avidecode.cpp:106 +msgid "The file doesn't contain any video stream" +msgstr "Le fichier ne contient pas de flux vidéo" + +#: k9author/k9avidecode.cpp:117 +msgid "Unsupported codec" +msgstr "Codec non supporté" + +#: k9author/k9avidecode.cpp:122 +msgid "Could'nt open the codec" +msgstr "Ne peut ouvrir le codec" + +#: k9author/k9avidecode.cpp:133 +msgid "Unable to allocate memory for frames" +msgstr "Impossible d'allouer la mémoire pour les images" + +#: k9author/k9menuedit.cpp:245 +msgid "Title %1 Menu" +msgstr "Menu du titre %1" + +#: k9author/k9menuedit.cpp:254 k9author/k9menuedit.cpp:291 +msgid "Play Menu" +msgstr "Lecture du menu" + +#: k9author/k9menuedit.cpp:256 +msgid "Play Title" +msgstr "Lecture du titre" + +#: k9author/k9menuedit.cpp:262 +msgid "Play Root Menu" +msgstr "Lecture du menu racine" + +#: k9author/k9menuedit.cpp:264 +msgid "Play Title Menu" +msgstr "Lecture du menu du titre" + +#: k9author/k9menuedit.cpp:269 k9author/k9menuedit.cpp:295 +msgid "Play Title %1" +msgstr "Lecture du titre %1" + +#: k9author/k9importfiles.cpp:24 +msgid "Create new DVD" +msgstr "Créer un nouveau DVD" + +#~ msgid "mb" +#~ msgstr "mo" + +#~ msgid "A&bort" +#~ msgstr "A&bandonner" + +#~ msgid "Audio bitrate" +#~ msgstr "bitrate Audio" + +#~ msgid "Label" +#~ msgstr "libellé" + +#~ msgid "Unable to open " +#~ msgstr "Impossible d'ouvrir " + +#~ msgid "Can't find device %1\n" +#~ msgstr "Périphérique %1 introuvable\n" diff --git a/po/it.po b/po/it.po new file mode 100644 index 0000000..6c308bc --- /dev/null +++ b/po/it.po @@ -0,0 +1,2202 @@ +# traduzione di it.po in italian +# traduzione di it.po in +# translation of it.po to +# translation of k9copy.po to +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER, 2006. +# +# FiNeX , 2006, 2007. +msgid "" +msgstr "" +"Project-Id-Version: it\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-10-14 09:03+0200\n" +"PO-Revision-Date: 2007-10-22 11:40+0200\n" +"Last-Translator: FiNeX \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Language-Team: italian \n" + +#: rc.cpp:3 debug/libk9copy/backupdlg.cpp:156 libk9copy/k9dvdauthor.cpp:404 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Backup in corso" + +#: rc.cpp:6 debug/libk9copy/backupdlg.cpp:157 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

DVD Backup

" + +#: rc.cpp:9 debug/libk9copy/backupdlg.cpp:158 +#, no-c-format +msgid "Current step" +msgstr "Prossimo Passo" + +#: rc.cpp:12 rc.cpp:47 rc.cpp:65 debug/libk9copy/backupdlg.cpp:159 +#: debug/libk9copy/mp4dlg.cpp:148 debug/libk9copy/progress.cpp:116 +#, no-c-format +msgid "Elapsed Time" +msgstr "Tempo trascorso" + +#: rc.cpp:15 rc.cpp:612 rc.cpp:640 rc.cpp:666 +#: debug/libk9copy/backupdlg.cpp:160 debug/k9author/newTitle.cpp:131 +#: debug/k9author/chapterEdit.cpp:154 debug/k9author/import.cpp:111 +#, no-c-format +msgid "--:--:--" +msgstr "-:-:-" + +#: rc.cpp:19 debug/libk9copy/dvdprogress.cpp:92 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - Esamina DVD " + +#: rc.cpp:25 debug/libk9copy/processList.cpp:68 +#, no-c-format +msgid "Process List" +msgstr "Lista processi" + +#: rc.cpp:28 debug/libk9copy/processList.cpp:33 +#: debug/libk9copy/processList.cpp:69 +#, no-c-format +msgid "Processes" +msgstr "Processi" + +#: rc.cpp:31 debug/libk9copy/processList.cpp:34 +#: debug/libk9copy/processList.cpp:70 +#, no-c-format +msgid "Elapsed" +msgstr "Tempo trascorso" + +#: rc.cpp:34 rc.cpp:603 debug/libk9copy/processList.cpp:35 +#: debug/libk9copy/processList.cpp:71 debug/k9author/import.cpp:46 +#: debug/k9author/import.cpp:107 +#, no-c-format +msgid "..." +msgstr "... " + +#: rc.cpp:40 debug/libk9copy/processList.cpp:73 debug/src/progress.cpp:81 +#, no-c-format +msgid "Alt+C" +msgstr "Alt+C" + +#: rc.cpp:43 debug/libk9copy/progress.cpp:114 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 +#, no-c-format +msgid "k9Copy" +msgstr "k9copy" + +#: rc.cpp:52 debug/libk9copy/mp4dlg.cpp:141 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - transcodifica" + +#: rc.cpp:55 debug/libk9copy/mp4dlg.cpp:142 +#, no-c-format +msgid "Encoding" +msgstr "Codifica" + +#: rc.cpp:62 debug/libk9copy/mp4dlg.cpp:147 k9author/k9newdvd.cpp:344 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: rc.cpp:68 rc.cpp:154 rc.cpp:181 rc.cpp:284 debug/libk9copy/mp4dlg.cpp:149 +#: debug/src/prefAuthor.cpp:147 debug/src/prefMPEG4.cpp:337 +#: debug/src/prefMPEG4.cpp:347 +#, no-c-format +msgid "Bitrate" +msgstr "Bitrate" + +#: rc.cpp:71 rc.cpp:215 rc.cpp:232 debug/libk9copy/mp4dlg.cpp:150 +#: debug/src/k9mainw.cpp:66 debug/src/k9mainw.cpp:161 +#, no-c-format +msgid "Size" +msgstr "Dimensione" + +#: rc.cpp:74 debug/src/mencoderCmdGen.cpp:98 src/k9mencodercmdgen.cpp:55 +#, no-c-format +msgid "MEncoder options" +msgstr "Opzioni di MEncoder" + +#: rc.cpp:78 debug/src/mencoderCmdGen.cpp:108 src/k9mencodercmdgen.cpp:68 +#, no-c-format +msgid "Audio Codec" +msgstr "Codec audio" + +#: rc.cpp:81 rc.cpp:169 debug/src/prefMPEG4.cpp:343 +#: debug/src/mencoderCmdGen.cpp:104 +#, no-c-format +msgid "faac" +msgstr "faac" + +#: rc.cpp:84 rc.cpp:96 debug/src/mencoderCmdGen.cpp:107 +#: debug/src/mencoderCmdGen.cpp:119 +#, no-c-format +msgid "lavc" +msgstr "lavc" + +#: rc.cpp:87 debug/src/mencoderCmdGen.cpp:120 src/k9mencodercmdgen.cpp:84 +#, no-c-format +msgid "Video Codec" +msgstr "Codec video" + +#: rc.cpp:90 rc.cpp:121 rc.cpp:388 debug/src/prefMPEG4.cpp:323 +#: debug/src/prefMencoder.cpp:299 debug/src/mencoderCmdGen.cpp:113 +#, no-c-format +msgid "x264" +msgstr "x264" + +#: rc.cpp:93 debug/src/mencoderCmdGen.cpp:116 +#, no-c-format +msgid "xvid" +msgstr "xvid" + +#: rc.cpp:99 rc.cpp:313 rc.cpp:365 debug/src/prefMPEG4.cpp:315 +#: debug/src/prefMencoder.cpp:286 debug/src/prefpreview.cpp:140 +#, no-c-format +msgid "Form1" +msgstr "Form1" + +#: rc.cpp:103 debug/src/prefMPEG4.cpp:339 +#, no-c-format +msgid "Video" +msgstr "Video" + +#: rc.cpp:106 debug/src/prefMPEG4.cpp:317 +#, no-c-format +msgid "2 pass" +msgstr "2 passaggi" + +#: rc.cpp:109 debug/src/prefMPEG4.cpp:318 +#, no-c-format +msgid "Alt+2" +msgstr "Alt+2" + +#: rc.cpp:112 rc.cpp:163 debug/src/prefMPEG4.cpp:319 +#: debug/src/prefMPEG4.cpp:340 +#, no-c-format +msgid "Codec" +msgstr "Codec" + +#: rc.cpp:115 rc.cpp:385 debug/src/prefMPEG4.cpp:321 +#: debug/src/prefMencoder.cpp:298 +#, no-c-format +msgid "XviD" +msgstr "XviD" + +#: rc.cpp:118 debug/src/prefMPEG4.cpp:322 +#, no-c-format +msgid "lavc MPEG4" +msgstr "lavc MPEG4" + +#: rc.cpp:130 debug/src/prefMPEG4.cpp:327 +#, no-c-format +msgid "640" +msgstr "640" + +#: rc.cpp:134 debug/src/prefMPEG4.cpp:329 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "&mantieni le proporzioni" + +#: rc.cpp:137 rc.cpp:493 debug/src/playbackoptionsw.cpp:230 +#: debug/src/prefMPEG4.cpp:330 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: rc.cpp:141 rc.cpp:206 rc.cpp:238 debug/src/prefMPEG4.cpp:332 +#: debug/src/k9mainw.cpp:163 +#, no-c-format +msgid "X" +msgstr "X" + +#: rc.cpp:145 debug/src/prefMPEG4.cpp:334 +#, no-c-format +msgid "File size" +msgstr "Dimensione file" + +#: rc.cpp:148 debug/src/prefMPEG4.cpp:335 +#, no-c-format +msgid "Alt+S" +msgstr "Alt+S" + +#: rc.cpp:151 debug/src/prefMPEG4.cpp:336 +#, no-c-format +msgid " MB" +msgstr "MB" + +#: rc.cpp:157 rc.cpp:519 debug/src/prefMPEG4.cpp:338 debug/src/prefDVD.cpp:100 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+B" + +#: rc.cpp:160 rc.cpp:263 rc.cpp:507 rc.cpp:575 +#: debug/src/playbackoptionsw.cpp:236 debug/src/prefAuthor.cpp:138 +#: debug/src/prefMPEG4.cpp:350 debug/k9Mplayer/mplayer.cpp:594 +#: src/k9langselect.cpp:79 +#, no-c-format +msgid "Audio" +msgstr "Audio" + +#: rc.cpp:166 debug/src/prefMPEG4.cpp:342 +#, no-c-format +msgid "mp3" +msgstr "mp3" + +#: rc.cpp:172 debug/src/prefMPEG4.cpp:344 +#, no-c-format +msgid "mp2" +msgstr "mp2" + +#: rc.cpp:175 debug/src/prefMPEG4.cpp:345 +#, no-c-format +msgid "ac3" +msgstr "ac3" + +#: rc.cpp:178 debug/src/prefMPEG4.cpp:346 +#, no-c-format +msgid "adpcm ima" +msgstr "adpcm ima" + +#: rc.cpp:185 debug/src/prefMPEG4.cpp:349 +#, no-c-format +msgid "Gain" +msgstr "Guadagno" + +#: rc.cpp:188 debug/src/prefMPEG4.cpp:351 +#, no-c-format +msgid "use cell cache" +msgstr "copia celle nel disco" + +#: rc.cpp:191 rc.cpp:220 debug/src/k9mainw.cpp:157 +#, no-c-format +msgid "MainDlg" +msgstr "DlgPrincipale" + +#: rc.cpp:194 rc.cpp:223 debug/src/k9mainw.cpp:158 +#, no-c-format +msgid "Output device " +msgstr "Destinazione" + +#: rc.cpp:197 rc.cpp:244 debug/src/k9mainw.cpp:166 +#, no-c-format +msgid "@" +msgstr "@" + +#: rc.cpp:200 +#, no-c-format +msgid "Input device " +msgstr "Origine" + +#: rc.cpp:203 rc.cpp:241 debug/src/k9mainw.cpp:165 libk9copy/k9burndvd.cpp:178 +#: libk9copy/k9burndvd.cpp:278 src/k9main.cpp:1344 +#: src/k9playbackoptions.cpp:147 k9author/k9import.cpp:207 +#, no-c-format +msgid "default" +msgstr "predefinito" + +#: rc.cpp:209 +#, no-c-format +msgid "D&VD" +msgstr "D&VD" + +#: rc.cpp:212 rc.cpp:229 debug/src/k9mainw.cpp:65 debug/src/k9mainw.cpp:160 +#, no-c-format +msgid "Title" +msgstr "Titolo" + +#: rc.cpp:226 debug/src/k9mainw.cpp:159 src/main.cpp:37 +#, no-c-format +msgid "input device" +msgstr "Origine" + +#: rc.cpp:235 debug/src/k9mainw.cpp:68 debug/src/k9mainw.cpp:162 +#, no-c-format +msgid "Content" +msgstr "Contenuto" + +#: rc.cpp:248 debug/src/k9mainw.cpp:168 +#, no-c-format +msgid "Open a folder" +msgstr "Apri cartella" + +#: rc.cpp:252 debug/src/k9mainw.cpp:170 +#, no-c-format +msgid "Open an iso image" +msgstr "Apri immagine ISO" + +#: rc.cpp:255 debug/src/viewmpeg2.cpp:205 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Anteprima Titolo" + +#: rc.cpp:260 debug/src/prefAuthor.cpp:137 +#, no-c-format +msgid "Authoring options" +msgstr "Opzioni authoring\n(Creazione menù)" + +#: rc.cpp:266 debug/src/prefAuthor.cpp:140 +#, no-c-format +msgid "AC3" +msgstr "AC3" + +#: rc.cpp:269 debug/src/prefAuthor.cpp:141 +#, no-c-format +msgid "MP2" +msgstr "MP2" + +#: rc.cpp:272 debug/src/prefAuthor.cpp:143 +#, no-c-format +msgid "128" +msgstr "128" + +#: rc.cpp:275 debug/src/prefAuthor.cpp:144 +#, no-c-format +msgid "192" +msgstr "192" + +#: rc.cpp:278 debug/src/prefAuthor.cpp:145 +#, no-c-format +msgid "320" +msgstr "320" + +#: rc.cpp:281 debug/src/prefAuthor.cpp:146 +#, no-c-format +msgid "Format" +msgstr "Formato" + +#: rc.cpp:287 debug/src/prefAuthor.cpp:148 +#, no-c-format +msgid "Buttons" +msgstr "Pulsanti" + +#: rc.cpp:299 debug/src/prefAuthor.cpp:152 +#, no-c-format +msgid "Hilite color" +msgstr "Colore testo evidenziato" + +#: rc.cpp:303 debug/src/prefAuthor.cpp:154 +#, no-c-format +msgid "Text color" +msgstr "Colore testo" + +#: rc.cpp:307 debug/src/langselectw.cpp:120 src/k9copy.cpp:120 +#, no-c-format +msgid "Selection" +msgstr "Selezione" + +#: rc.cpp:310 debug/src/langselectw.cpp:93 debug/src/langselectw.cpp:121 +#, no-c-format +msgid "Languages" +msgstr "Lingue" + +#: rc.cpp:317 debug/src/prefpreview.cpp:142 +#, no-c-format +msgid "&Internal Player" +msgstr "Riproduttore &interno" + +#: rc.cpp:320 debug/src/prefpreview.cpp:143 +#, no-c-format +msgid "Alt+I" +msgstr "Alt+I" + +#: rc.cpp:323 debug/src/prefpreview.cpp:144 +#, no-c-format +msgid "MPlayer" +msgstr "MPlayer" + +#: rc.cpp:326 debug/src/prefpreview.cpp:145 +#, no-c-format +msgid "Alt+M" +msgstr "Alt+M" + +#: rc.cpp:329 debug/src/prefpreview.cpp:146 +#, no-c-format +msgid "Internal viewer options" +msgstr "Opzioni visualizzatore interno" + +#: rc.cpp:332 debug/src/prefpreview.cpp:147 +#, no-c-format +msgid "use OpenGL" +msgstr "usa OpenGL" + +#: rc.cpp:335 debug/src/prefpreview.cpp:148 +#, no-c-format +msgid "Video output" +msgstr "Uscita video" + +#: rc.cpp:338 debug/src/prefpreview.cpp:149 +#, no-c-format +msgid "Audio output" +msgstr "Uscita audio" + +#: rc.cpp:341 debug/src/prefpreview.cpp:151 +#, no-c-format +msgid "X11" +msgstr "X11" + +#: rc.cpp:344 debug/src/prefpreview.cpp:152 +#, no-c-format +msgid "Xv" +msgstr "XvX" + +#: rc.cpp:347 debug/src/prefpreview.cpp:153 +#, no-c-format +msgid "OpenGL" +msgstr "OpenGL" + +#: rc.cpp:350 rc.cpp:359 debug/src/prefpreview.cpp:154 +#: debug/src/prefpreview.cpp:158 +#, no-c-format +msgid "SDL" +msgstr "SDL" + +#: rc.cpp:353 debug/src/prefpreview.cpp:156 +#, no-c-format +msgid "ALSA" +msgstr "ALSA" + +#: rc.cpp:356 debug/src/prefpreview.cpp:157 +#, no-c-format +msgid "OSS" +msgstr "OSS" + +#: rc.cpp:362 debug/src/prefpreview.cpp:159 +#, no-c-format +msgid "MPlayer options" +msgstr "Opzioni di MPlayer" + +#: rc.cpp:368 debug/src/prefMencoder.cpp:287 +#, no-c-format +msgid "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" +msgstr "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" + +#: rc.cpp:375 debug/src/prefMencoder.cpp:292 +#, no-c-format +msgid "" +"pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" +msgstr "" +"numbero passaggi\n" +"larghezza video\n" +"altezza video\n" +"bitrate video\n" +"bitrate audio" + +#: rc.cpp:382 debug/src/prefMencoder.cpp:326 +#, no-c-format +msgid "Video codecs" +msgstr "Codec video" + +#: rc.cpp:391 debug/src/prefMencoder.cpp:300 +#, no-c-format +msgid "MJPEG" +msgstr "MJPEG" + +#: rc.cpp:394 debug/src/prefMencoder.cpp:301 +#, no-c-format +msgid "LJPEG" +msgstr "LJPEG" + +#: rc.cpp:397 debug/src/prefMencoder.cpp:302 +#, no-c-format +msgid "H.261" +msgstr "H.261" + +#: rc.cpp:400 debug/src/prefMencoder.cpp:303 +#, no-c-format +msgid "H.263" +msgstr "H.263" + +#: rc.cpp:403 debug/src/prefMencoder.cpp:304 +#, no-c-format +msgid "MPEG-4 (DivX 4/5)" +msgstr "MPEG-4 (DivX 4/5)" + +#: rc.cpp:406 debug/src/prefMencoder.cpp:305 +#, no-c-format +msgid "DivX 3" +msgstr "MPEG-4 (DivX 4/5)" + +#: rc.cpp:409 debug/src/prefMencoder.cpp:306 +#, no-c-format +msgid "MS MPEG-4 v2" +msgstr "MS MPEG-4 v2" + +#: rc.cpp:412 debug/src/prefMencoder.cpp:307 +#, no-c-format +msgid "WMV7" +msgstr "WMV7" + +#: rc.cpp:415 debug/src/prefMencoder.cpp:308 +#, no-c-format +msgid "WMV8" +msgstr "WMV8" + +#: rc.cpp:418 debug/src/prefMencoder.cpp:309 +#, no-c-format +msgid "RealVideo" +msgstr "RealVideo" + +#: rc.cpp:421 debug/src/prefMencoder.cpp:310 +#, no-c-format +msgid "MPEG-1" +msgstr "MPEG-1" + +#: rc.cpp:424 debug/src/prefMencoder.cpp:311 +#, no-c-format +msgid "MPEG-2" +msgstr "MPEG-2" + +#: rc.cpp:427 debug/src/prefMencoder.cpp:312 +#, no-c-format +msgid "HuffYUV" +msgstr "HuffYUV" + +#: rc.cpp:430 debug/src/prefMencoder.cpp:313 +#, no-c-format +msgid "ffvHuff" +msgstr "ffvHuff" + +#: rc.cpp:433 debug/src/prefMencoder.cpp:314 +#, no-c-format +msgid "ASUS v1" +msgstr "ASUS v1" + +#: rc.cpp:436 debug/src/prefMencoder.cpp:315 +#, no-c-format +msgid "ASUS v2" +msgstr "ASUS v2" + +#: rc.cpp:440 rc.cpp:465 rc.cpp:555 debug/src/configDlg.cpp:42 +#: debug/src/configDlg.cpp:95 debug/src/prefMencoder.cpp:317 +#: debug/src/prefMencoder.cpp:329 +#, no-c-format +msgid "label" +msgstr "nome" + +#: rc.cpp:443 debug/src/prefMencoder.cpp:318 +#, no-c-format +msgid "fourcc" +msgstr "fourcc" + +#: rc.cpp:446 debug/src/prefMencoder.cpp:319 +#, no-c-format +msgid "first pass" +msgstr "primo passaggio" + +#: rc.cpp:451 debug/src/prefMencoder.cpp:322 +#, no-c-format +msgid "one pass" +msgstr "un passaggio" + +#: rc.cpp:456 debug/src/prefMencoder.cpp:325 +#, no-c-format +msgid "second pass" +msgstr "secondo passaggio" + +#: rc.cpp:459 debug/src/prefMencoder.cpp:332 +#, no-c-format +msgid "Audio codecs" +msgstr "Codec audio" + +#: rc.cpp:462 debug/src/prefMencoder.cpp:328 +#, no-c-format +msgid "New Item" +msgstr "Nuovo elemento" + +#: rc.cpp:469 debug/src/prefMencoder.cpp:331 +#, no-c-format +msgid "options" +msgstr "opzioni" + +#: rc.cpp:472 debug/src/prefMencoder.cpp:333 +#, no-c-format +msgid "Available variables" +msgstr "Variabili disponibili" + +#: rc.cpp:475 debug/src/titlefactor.cpp:321 +#, no-c-format +msgid "Shrink Factors" +msgstr "Fattori di riduzione" + +#: rc.cpp:478 debug/src/titlefactor.cpp:322 +#, no-c-format +msgid "Shrink Factor for Title %1" +msgstr "Fattore di riduzione per il Titolo %1" + +#: rc.cpp:481 debug/src/titlefactor.cpp:323 +#, no-c-format +msgid "Change Factor" +msgstr "Cambia fattore" + +#: rc.cpp:484 debug/src/titlefactor.cpp:324 +#, no-c-format +msgid "0.00" +msgstr "0.00" + +#: rc.cpp:487 debug/src/playbackoptionsw.cpp:228 src/k9copy.cpp:114 +#, no-c-format +msgid "DVD playback options" +msgstr "Opzioni riproduzione DVD" + +#: rc.cpp:490 debug/src/playbackoptionsw.cpp:229 +#, no-c-format +msgid "&Keep original menus" +msgstr "&Mantieni i menù originali" + +#: rc.cpp:498 debug/src/playbackoptionsw.cpp:233 +#, no-c-format +msgid "Selected Titles" +msgstr "Titoli selezionati" + +#: rc.cpp:501 debug/src/playbackoptionsw.cpp:234 +#, no-c-format +msgid "Default language" +msgstr "Lingua predefinita" + +#: rc.cpp:504 debug/src/playbackoptionsw.cpp:235 +#, no-c-format +msgid "Subtitle" +msgstr "Sottotitolo" + +#: rc.cpp:510 debug/src/prefDVD.cpp:97 +#, no-c-format +msgid "prefDVD" +msgstr "prefDVD" + +#: rc.cpp:513 debug/src/prefDVD.cpp:98 +#, no-c-format +msgid "Output directory" +msgstr "Cartella di lavoro" + +#: rc.cpp:516 debug/src/prefDVD.cpp:99 +#, no-c-format +msgid "Burn with k3b" +msgstr "Scrivi con k3b" + +#: rc.cpp:522 debug/src/prefDVD.cpp:101 +#, no-c-format +msgid "Auto burn" +msgstr "Masterizza al termine" + +#: rc.cpp:525 debug/src/prefDVD.cpp:102 +#, no-c-format +msgid "Alt+T" +msgstr "Alt+T" + +#: rc.cpp:528 debug/src/prefDVD.cpp:103 +#, no-c-format +msgid "DVD size" +msgstr "Dimensione DVD" + +#: rc.cpp:531 debug/src/prefDVD.cpp:104 +#, no-c-format +msgid "Quick scan" +msgstr "Scansione veloce" + +#: rc.cpp:534 debug/src/prefDVD.cpp:105 +#, no-c-format +msgid "Alt+Q" +msgstr "Alt+Q" + +#: rc.cpp:537 debug/src/prefDVD.cpp:106 +#, no-c-format +msgid "use dvdAuthor for copy without menus" +msgstr "usa dvdAuthor per copiare senza i menu" + +#: rc.cpp:540 debug/src/prefDVD.cpp:107 +#, no-c-format +msgid "Alt+D" +msgstr "Alt+D" + +#: rc.cpp:543 debug/src/prefDVD.cpp:108 +#, no-c-format +msgid "Clear output directory on exit" +msgstr "Svuota cartella di lavoro all'uscita" + +#: rc.cpp:546 debug/src/prefDVD.cpp:109 +#, no-c-format +msgid "Alt+Y" +msgstr "Alt+Y" + +#: rc.cpp:549 debug/src/configDlg.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Periferiche" + +#: rc.cpp:552 debug/src/configDlg.cpp:40 debug/src/configDlg.cpp:94 +#, no-c-format +msgid "device" +msgstr "periferica" + +#: rc.cpp:558 debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:96 +#, no-c-format +msgid "Input" +msgstr "Ingresso" + +#: rc.cpp:561 rc.cpp:597 debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:97 +#: debug/k9author/import.cpp:105 +#, no-c-format +msgid "Output" +msgstr "Uscita" + +#: rc.cpp:572 debug/k9Mplayer/mplayer.cpp:593 src/k9settings.cpp:57 +#: src/k9copy.cpp:128 src/k9copy.cpp:390 k9Mplayer/k9mplayer.cpp:97 +#, no-c-format +msgid "Preview" +msgstr "Anteprima" + +#: rc.cpp:578 debug/k9Mplayer/mplayer.cpp:595 +#, no-c-format +msgid "Subpicture" +msgstr "fotogramma" + +#: rc.cpp:585 debug/k9Mplayer/mplayer.cpp:600 +#, no-c-format +msgid "-" +msgstr "-" + +#: rc.cpp:589 debug/k9Mplayer/mplayer.cpp:602 +#, no-c-format +msgid "+" +msgstr "+" + +#: rc.cpp:594 debug/k9author/import.cpp:104 +#, no-c-format +msgid "import" +msgstr "importa" + +#: rc.cpp:600 debug/k9author/import.cpp:44 debug/k9author/import.cpp:106 +#, no-c-format +msgid "Video files" +msgstr "File video" + +#: rc.cpp:606 debug/k9author/import.cpp:109 +#, no-c-format +msgid "PAL" +msgstr "PAL" + +#: rc.cpp:609 debug/k9author/import.cpp:110 +#, no-c-format +msgid "NTSC" +msgstr "NTSC" + +#: rc.cpp:615 debug/k9author/chapterEdit.cpp:145 src/k9copy.cpp:211 +#: k9author/k9importfiles.cpp:34 +#, no-c-format +msgid "Chapter properties" +msgstr "Proprietà capitolo" + +#: rc.cpp:618 debug/k9author/chapterEdit.cpp:146 +#, no-c-format +msgid "start" +msgstr "inizio" + +#: rc.cpp:621 debug/k9author/chapterEdit.cpp:147 +#, no-c-format +msgid "video" +msgstr "video" + +#: rc.cpp:624 debug/k9author/chapterEdit.cpp:148 +#, no-c-format +msgid "" +"*.avi\n" +"*.mpeg" +msgstr "" +"*.avi\n" +"*.mpeg" + +#: rc.cpp:628 rc.cpp:643 debug/k9author/chapterEdit.cpp:150 +#: debug/k9author/chapterEdit.cpp:155 +#, no-c-format +msgid "set Current Frame" +msgstr "imposta fotogramma corrente" + +#: rc.cpp:631 rc.cpp:637 debug/k9author/chapterEdit.cpp:151 +#: debug/k9author/chapterEdit.cpp:153 +#, no-c-format +msgid "break continuity" +msgstr "interrompi continuità" + +#: rc.cpp:634 debug/k9author/chapterEdit.cpp:152 +#, no-c-format +msgid "end" +msgstr "fine" + +#: rc.cpp:646 debug/k9author/chapterEdit.cpp:156 +#, no-c-format +msgid "set Title button" +msgstr "imposta Titolo pulsante " + +#: rc.cpp:649 debug/k9author/newTitle.cpp:124 src/k9copy.cpp:204 +#: k9author/k9importfiles.cpp:40 k9author/k9newtitle.cpp:55 +#, no-c-format +msgid "Add title" +msgstr "Aggiungi titolo" + +#: rc.cpp:653 debug/k9author/newTitle.cpp:126 +#, no-c-format +msgid "number of chapters" +msgstr "numero di capitoli" + +#: rc.cpp:656 debug/k9author/newTitle.cpp:127 +#, no-c-format +msgid "chapter length" +msgstr "lunghezza capitolo" + +#: rc.cpp:663 debug/k9author/newTitle.cpp:130 +#, no-c-format +msgid "Video file" +msgstr "File video" + +#: rc.cpp:669 debug/k9author/menuEdit.cpp:146 src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +#, no-c-format +msgid "Edit Menu" +msgstr "Modifica Menu" + +#: rc.cpp:672 debug/k9author/menuEdit.cpp:147 +#, no-c-format +msgid "Text" +msgstr "Testo" + +#: rc.cpp:675 debug/k9author/menuEdit.cpp:148 +#, no-c-format +msgid "Background picture" +msgstr "Immagine di sfondo" + +#: rc.cpp:690 debug/k9author/menuEdit.cpp:156 k9author/k9menuedit.cpp:286 +#: k9author/k9import.cpp:45 +#, no-c-format +msgid "Root Menu" +msgstr "Menu principale" + +#: rc.cpp:693 debug/k9author/menuEdit.cpp:157 +#, no-c-format +msgid "At start" +msgstr "All'inizio" + +#: rc.cpp:696 debug/k9author/menuEdit.cpp:159 +#, no-c-format +msgid "Play menu" +msgstr "Riproduci menu" + +#: rc.cpp:699 rc.cpp:711 debug/k9author/menuEdit.cpp:160 +#: debug/k9author/menuEdit.cpp:165 +#, no-c-format +msgid "Play title 1" +msgstr "Riproduci Titolo 1" + +#: rc.cpp:702 debug/k9author/menuEdit.cpp:161 +#, no-c-format +msgid "At End" +msgstr "Alla fine" + +#: rc.cpp:705 debug/k9author/menuEdit.cpp:163 +#, no-c-format +msgid "Play root menu" +msgstr "Riproduci menu principale" + +#: rc.cpp:708 debug/k9author/menuEdit.cpp:164 +#, no-c-format +msgid "Play title menu" +msgstr "Riproducu menu del Titolo" + +#: rc.cpp:717 +#, no-c-format +msgid "A&ctions" +msgstr "A&zioni" + +#: rc.cpp:720 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Barra delle Azioni" + +#: debug/libk9copy/k9ifo2.moc.cpp:34 debug/libk9copy/k9ifo2.moc.cpp:42 +msgid "k9Ifo2" +msgstr "k9Ifo2" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:34 +#: debug/libk9copy/k9dvdchapter.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "k9CellaCapitolo" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:107 +#: debug/libk9copy/k9dvdchapter.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "k9DVDCapitolo" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "k9MasterizzaDVD" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "k9DVD" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9DVDVideoStream" +msgstr "k9DVDFlussoVideo" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDAudioStream" +msgstr "k9DVDFlussoAudio" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDSubtitle" +msgstr "k9DVDSottotitolo" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDTitle" +msgstr "k9DVDTitolo" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "k9DVDProgresso" + +#: debug/libk9copy/k9dvdtitleset.moc.cpp:34 +#: debug/libk9copy/k9dvdtitleset.moc.cpp:42 +msgid "k9DVDTitleset" +msgstr "k9DVDTitleset" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "k9DVDAuthor" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "k9DVDDimensione" + +#: debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Anteprima Menù" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "kPerifericaCD" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "kPerifericheCD" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "k9Widget" +msgstr "k9Widget" + +#: debug/src/kviewmpeg2.moc.cpp:107 debug/src/kviewmpeg2.moc.cpp:115 +msgid "kViewMPEG2" +msgstr "KViewMPEG2" + +#: debug/k9Mplayer/k9mplayer.moc.cpp:34 debug/k9Mplayer/k9mplayer.moc.cpp:42 +msgid "K9Mplayer" +msgstr "K9Mplayer" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "kDecMPEG2" + +#: libk9copy/k9dvd.cpp:133 +msgid "for visually impaired" +msgstr "per chi ha difficoltà visive" + +#: libk9copy/k9dvd.cpp:134 +msgid "director's comments" +msgstr "commenti del regista" + +#: libk9copy/k9dvd.cpp:135 +msgid "alternate director's comments" +msgstr "commenti del regista alternativi" + +#: libk9copy/k9dvd.cpp:139 +msgid "Large" +msgstr "Largo" + +#: libk9copy/k9dvd.cpp:140 +msgid "Children" +msgstr "Figli" + +#: libk9copy/k9dvd.cpp:141 libk9copy/k9dvd.cpp:147 libk9copy/k9dvd.cpp:148 +#: libk9copy/k9dvd.cpp:149 +msgid "reserved" +msgstr "riservato" + +#: libk9copy/k9dvd.cpp:142 +msgid "Normal captions" +msgstr "Didascalia normale" + +#: libk9copy/k9dvd.cpp:143 +msgid "Large captions" +msgstr "Didascalia larga" + +#: libk9copy/k9dvd.cpp:144 +msgid "Children captions" +msgstr "Didascalia figli" + +#: libk9copy/k9dvd.cpp:146 +msgid "Forced" +msgstr "Forzato" + +#: libk9copy/k9dvd.cpp:150 +msgid "Director's comments" +msgstr "Commenti del regista" + +#: libk9copy/k9dvd.cpp:151 +msgid "Large director's comments" +msgstr "Commenti del regista, larghi" + +#: libk9copy/k9dvd.cpp:152 +msgid "Director's comments for children" +msgstr "Commenti del registra per i figli" + +#: libk9copy/k9dvd.cpp:189 +msgid "Couldn't open %1 for title\n" +msgstr "Non posso aprire %1 per il titolo\n" + +#: libk9copy/k9dvd.cpp:191 libk9copy/k9dvd.cpp:199 libk9copy/k9dvd.cpp:207 +#: libk9copy/k9dvd.cpp:368 src/k9main.cpp:563 +msgid "unknown" +msgstr "sconosciuto" + +#: libk9copy/k9dvd.cpp:197 +msgid "Couldn't seek in %1 for title\n" +msgstr "Non posso cercare it %1 per il titolo\n" + +#: libk9copy/k9dvd.cpp:224 +msgid "Not Specified" +msgstr "Non specificato" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afar" +msgstr "Afar" + +#: libk9copy/k9dvd.cpp:224 +msgid "Abkhazian" +msgstr "Abkhazian" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afrikaans" +msgstr "Afrikaans" + +#: libk9copy/k9dvd.cpp:224 +msgid "Amharic" +msgstr "Amharic" + +#: libk9copy/k9dvd.cpp:225 +msgid "Arabic" +msgstr "Arabic" + +#: libk9copy/k9dvd.cpp:225 +msgid "Assamese" +msgstr "Assamese" + +#: libk9copy/k9dvd.cpp:225 +msgid "Aymara" +msgstr "Aymara" + +#: libk9copy/k9dvd.cpp:225 +msgid "Azerbaijani" +msgstr "Azerbaijani" + +#: libk9copy/k9dvd.cpp:225 +msgid "Bashkir" +msgstr "Bashkir" + +#: libk9copy/k9dvd.cpp:226 +msgid "Byelorussian" +msgstr "Byelorussian" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bulgarian" +msgstr "Bulgarian" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bihari" +msgstr "Bihari" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bislama" +msgstr "Bislama" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bengali; Bangla" +msgstr "Bengali; Bangla" + +#: libk9copy/k9dvd.cpp:227 +msgid "Tibetan" +msgstr "Tibetan" + +#: libk9copy/k9dvd.cpp:227 +msgid "Breton" +msgstr "Breton" + +#: libk9copy/k9dvd.cpp:227 +msgid "Catalan" +msgstr "Catalan" + +#: libk9copy/k9dvd.cpp:227 +msgid "Corsican" +msgstr "Corsican" + +#: libk9copy/k9dvd.cpp:227 +msgid "Czech" +msgstr "Czech" + +#: libk9copy/k9dvd.cpp:228 +msgid "Welsh" +msgstr "Welsh" + +#: libk9copy/k9dvd.cpp:228 +msgid "Dansk" +msgstr "Dansk" + +#: libk9copy/k9dvd.cpp:228 +msgid "Deutsch" +msgstr "Deutsch" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bhutani" +msgstr "Bhutani" + +#: libk9copy/k9dvd.cpp:228 +msgid "Greek" +msgstr "Greek" + +#: libk9copy/k9dvd.cpp:228 +msgid "English" +msgstr "English" + +#: libk9copy/k9dvd.cpp:229 +msgid "Esperanto" +msgstr "Esperanto" + +#: libk9copy/k9dvd.cpp:229 +msgid "Espanol" +msgstr "Espanol" + +#: libk9copy/k9dvd.cpp:229 +msgid "Estonian" +msgstr "Estonian" + +#: libk9copy/k9dvd.cpp:229 +msgid "Basque" +msgstr "Basque" + +#: libk9copy/k9dvd.cpp:229 +msgid "Persian" +msgstr "Persian" + +#: libk9copy/k9dvd.cpp:230 +msgid "Suomi" +msgstr "Suomi" + +#: libk9copy/k9dvd.cpp:230 +msgid "Fiji" +msgstr "Fiji" + +#: libk9copy/k9dvd.cpp:230 +msgid "Faroese" +msgstr "Faroese" + +#: libk9copy/k9dvd.cpp:230 +msgid "Francais" +msgstr "Francais" + +#: libk9copy/k9dvd.cpp:230 +msgid "Frisian" +msgstr "Frisian" + +#: libk9copy/k9dvd.cpp:230 +msgid "Gaelic" +msgstr "Gaelic" + +#: libk9copy/k9dvd.cpp:231 +msgid "Scots Gaelic" +msgstr "Scots Gaelic" + +#: libk9copy/k9dvd.cpp:231 +msgid "Galician" +msgstr "Galician" + +#: libk9copy/k9dvd.cpp:231 +msgid "Guarani" +msgstr "Guarani" + +#: libk9copy/k9dvd.cpp:231 +msgid "Gujarati" +msgstr "Gujarati" + +#: libk9copy/k9dvd.cpp:231 +msgid "Hausa" +msgstr "Hausa" + +#: libk9copy/k9dvd.cpp:232 libk9copy/k9dvd.cpp:234 +msgid "Hebrew" +msgstr "Hebrew" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hindi" +msgstr "Hindi" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hrvatski" +msgstr "Hrvatski" + +#: libk9copy/k9dvd.cpp:232 +msgid "Magyar" +msgstr "Magyar" + +#: libk9copy/k9dvd.cpp:232 +msgid "Armenian" +msgstr "Armenian" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingua" +msgstr "Interlingua" + +#: libk9copy/k9dvd.cpp:233 +msgid "Indonesian" +msgstr "Indonesian" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingue" +msgstr "Interlingue" + +#: libk9copy/k9dvd.cpp:233 +msgid "Inupiak" +msgstr "Inupiak" + +#: libk9copy/k9dvd.cpp:234 +msgid "Islenska" +msgstr "Islenska" + +#: libk9copy/k9dvd.cpp:234 +msgid "Italiano" +msgstr "Italiano" + +#: libk9copy/k9dvd.cpp:234 +msgid "Inuktitut" +msgstr "Inuktitut" + +#: libk9copy/k9dvd.cpp:234 +msgid "Japanese" +msgstr "Japanese" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:250 +msgid "Yiddish" +msgstr "Yiddish" + +#: libk9copy/k9dvd.cpp:235 +msgid "Javanese" +msgstr "Javanese" + +#: libk9copy/k9dvd.cpp:235 +msgid "Georgian" +msgstr "Georgian" + +#: libk9copy/k9dvd.cpp:235 +msgid "Kazakh" +msgstr "Kazakh" + +#: libk9copy/k9dvd.cpp:235 +msgid "Greenlandic" +msgstr "Greenlandic" + +#: libk9copy/k9dvd.cpp:236 +msgid "Cambodian" +msgstr "Cambodian" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kannada" +msgstr "Kannada" + +#: libk9copy/k9dvd.cpp:236 +msgid "Korean" +msgstr "Korean" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kashmiri" +msgstr "Kashmiri" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kurdish" +msgstr "Kurdish" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kirghiz" +msgstr "Kirghiz" + +#: libk9copy/k9dvd.cpp:237 +msgid "Latin" +msgstr "Latin" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lingala" +msgstr "Lingala" + +#: libk9copy/k9dvd.cpp:237 +msgid "Laothian" +msgstr "Laothian" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lithuanian" +msgstr "Lithuanian" + +#: libk9copy/k9dvd.cpp:238 +msgid "Latvian, Lettish" +msgstr "Latvian, Lettish" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malagasy" +msgstr "Malagasy" + +#: libk9copy/k9dvd.cpp:238 +msgid "Maori" +msgstr "Maori" + +#: libk9copy/k9dvd.cpp:238 +msgid "Macedonian" +msgstr "Macedonian" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malayalam" +msgstr "Malayalam" + +#: libk9copy/k9dvd.cpp:239 +msgid "Mongolian" +msgstr "Mongolian" + +#: libk9copy/k9dvd.cpp:239 +msgid "Moldavian" +msgstr "Moldavian" + +#: libk9copy/k9dvd.cpp:239 +msgid "Marathi" +msgstr "Marathi" + +#: libk9copy/k9dvd.cpp:239 +msgid "Malay" +msgstr "Malay" + +#: libk9copy/k9dvd.cpp:239 +msgid "Maltese" +msgstr "Maltese" + +#: libk9copy/k9dvd.cpp:240 +msgid "Burmese" +msgstr "Burmese" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nauru" +msgstr "Nauru" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nepali" +msgstr "Nepali" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nederlands" +msgstr "Nederlands" + +#: libk9copy/k9dvd.cpp:240 +msgid "Norsk" +msgstr "Norsk" + +#: libk9copy/k9dvd.cpp:240 +msgid "Occitan" +msgstr "Occitan" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oromo" +msgstr "Oromo" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oriya" +msgstr "Oriya" + +#: libk9copy/k9dvd.cpp:241 +msgid "Punjabi" +msgstr "Punjabi" + +#: libk9copy/k9dvd.cpp:241 +msgid "Polish" +msgstr "Polish" + +#: libk9copy/k9dvd.cpp:241 +msgid "Pashto, Pushto" +msgstr "Pashto, Pushto" + +#: libk9copy/k9dvd.cpp:242 +msgid "Portugues" +msgstr "Portugues" + +#: libk9copy/k9dvd.cpp:242 +msgid "Quechua" +msgstr "Quechua" + +#: libk9copy/k9dvd.cpp:242 +msgid "Rhaeto-Romance" +msgstr "Rhaeto-Romance" + +#: libk9copy/k9dvd.cpp:242 +msgid "Kirundi" +msgstr "Kirundi" + +#: libk9copy/k9dvd.cpp:242 +msgid "Romanian" +msgstr "Romanian" + +#: libk9copy/k9dvd.cpp:243 +msgid "Russian" +msgstr "Russian" + +#: libk9copy/k9dvd.cpp:243 +msgid "Kinyarwanda" +msgstr "Kinyarwanda" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sanskrit" +msgstr "Sanskrit" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sindhi" +msgstr "Sindhi" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sangho" +msgstr "Sangho" + +#: libk9copy/k9dvd.cpp:244 +msgid "Serbo-Croatian" +msgstr "Serbo-Croatian" + +#: libk9copy/k9dvd.cpp:244 +msgid "Sinhalese" +msgstr "Sinhalese" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovak" +msgstr "Slovak" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovenian" +msgstr "Slovenian" + +#: libk9copy/k9dvd.cpp:244 +msgid "Samoan" +msgstr "Samoan" + +#: libk9copy/k9dvd.cpp:245 +msgid "Shona" +msgstr "Shona" + +#: libk9copy/k9dvd.cpp:245 +msgid "Somali" +msgstr "Somali" + +#: libk9copy/k9dvd.cpp:245 +msgid "Albanian" +msgstr "Albanian" + +#: libk9copy/k9dvd.cpp:245 +msgid "Serbian" +msgstr "Serbian" + +#: libk9copy/k9dvd.cpp:245 +msgid "Siswati" +msgstr "Siswati" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sesotho" +msgstr "Sesotho" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sundanese" +msgstr "Sundanese" + +#: libk9copy/k9dvd.cpp:246 +msgid "Svenska" +msgstr "Svenska" + +#: libk9copy/k9dvd.cpp:246 +msgid "Swahili" +msgstr "Swahili" + +#: libk9copy/k9dvd.cpp:246 +msgid "Tamil" +msgstr "Tamil" + +#: libk9copy/k9dvd.cpp:247 +msgid "Telugu" +msgstr "Telugu" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tajik" +msgstr "Tajik" + +#: libk9copy/k9dvd.cpp:247 +msgid "Thai" +msgstr "Thai" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tigrinya" +msgstr "Tigrinya" + +#: libk9copy/k9dvd.cpp:247 +msgid "Turkmen" +msgstr "Turkmen" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tagalog" +msgstr "Tagalog" + +#: libk9copy/k9dvd.cpp:248 +msgid "Setswana" +msgstr "Setswana" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tonga" +msgstr "Tonga" + +#: libk9copy/k9dvd.cpp:248 +msgid "Turkish" +msgstr "Turkish" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tsonga" +msgstr "Tsonga" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tatar" +msgstr "Tatar" + +#: libk9copy/k9dvd.cpp:248 +msgid "Twi" +msgstr "Twi" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uighur" +msgstr "Uighur" + +#: libk9copy/k9dvd.cpp:249 +msgid "Ukrainian" +msgstr "Ukrainian" + +#: libk9copy/k9dvd.cpp:249 +msgid "Urdu" +msgstr "Urdu" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uzbek" +msgstr "Uzbek" + +#: libk9copy/k9dvd.cpp:249 +msgid "Vietnamese" +msgstr "Vietnamese" + +#: libk9copy/k9dvd.cpp:250 +msgid "Volapuk" +msgstr "Volapuk" + +#: libk9copy/k9dvd.cpp:250 +msgid "Wolof" +msgstr "Wolof" + +#: libk9copy/k9dvd.cpp:250 +msgid "Xhosa" +msgstr "Xhosa" + +#: libk9copy/k9dvd.cpp:250 +msgid "Yoruba" +msgstr "Yoruba" + +#: libk9copy/k9dvd.cpp:250 +msgid "Zhuang" +msgstr "Zhuang" + +#: libk9copy/k9dvd.cpp:251 +msgid "Chinese" +msgstr "Chinese" + +#: libk9copy/k9dvd.cpp:251 +msgid "Zulu" +msgstr "Zulu" + +#: libk9copy/k9dvd.cpp:251 libk9copy/k9dvd.cpp:252 libk9copy/k9dvd.cpp:475 +msgid "Unknown" +msgstr "Sconosciuto" + +#: libk9copy/k9dvd.cpp:342 +msgid "Can't open disc %1!\n" +msgstr "Non posso aprire il disco %1!\n" + +#: libk9copy/k9dvd.cpp:354 +msgid "Can't open main ifo!\n" +msgstr "Non posso aprire l'ifo principale!\n" + +#: libk9copy/k9dvd.cpp:396 libk9copy/k9dvd.cpp:691 +msgid "Title %1" +msgstr "Titolo %1" + +#: libk9copy/k9dvd.cpp:742 +msgid "reading title" +msgstr "lettura del titolo in corso" + +#: libk9copy/k9dvd.cpp:859 +msgid "Error opening vobs for title %1\n" +msgstr "Errore di apertura dei vob per il titolo %1\n" + +#: libk9copy/k9dvd.cpp:870 +msgid "ERROR reading block %1\n" +msgstr "ERRORE nella lettura del blocco %1\n" + +#: libk9copy/k9dvdauthor.cpp:148 libk9copy/k9dvdauthor.cpp:366 +msgid "'%1' not selected" +msgstr "'%1' non selezionato" + +#: libk9copy/k9dvdauthor.cpp:149 libk9copy/k9dvdauthor.cpp:367 +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9dvdauthor.cpp:436 +#: libk9copy/k9dvdauthor.cpp:445 libk9copy/k9dvdauthor.cpp:448 +#: libk9copy/k9burndvd.cpp:237 libk9copy/k9burndvd.cpp:321 +#: k9author/k9newdvd.cpp:122 +msgid "authoring" +msgstr "authoring\n(creazione menù)" + +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +#: k9Mplayer/k9mplayer.cpp:97 +msgid "Unable to run %1" +msgstr "Impossibile eseguire %1" + +#: libk9copy/k9dvdauthor.cpp:403 libk9copy/k9dvdauthor.cpp:476 +#: libk9copy/k9dvdauthor.cpp:514 src/k9settings.cpp:63 +#: k9author/k9newdvd.cpp:143 +msgid "Authoring" +msgstr "Authoring\n(Creazione menù)" + +#: libk9copy/k9dvdauthor.cpp:436 +msgid "Dvdauthor error :\n" +msgstr "Errore di Dvdauthor:\n" + +#: libk9copy/k9dvdauthor.cpp:445 +msgid "Authoring cancelled" +msgstr "Autoring (Creazione dei menù) annullata" + +#: libk9copy/k9dvdauthor.cpp:448 k9author/k9newdvd.cpp:136 +msgid "An error occured while running DVDAuthor:\n" +msgstr "C'è stato un errore durante l'esecuzione di DVDAutor\n" + +#: libk9copy/k9dvdauthor.cpp:515 +msgid "Fixing VOBUS" +msgstr "Riparazione VOBUS" + +#: libk9copy/k9mp4enc.cpp:103 libk9copy/k9mp4enc.cpp:312 +msgid "Encoding error" +msgstr "Errore durante la codifica" + +#: libk9copy/k9mp4enc.cpp:152 src/k9main.cpp:1155 +msgid "Save file to disk" +msgstr "Salva file sul disco" + +#: libk9copy/k9mp4enc.cpp:161 libk9copy/k9mp4enc.cpp:350 +#: src/k9prefmpeg4.cpp:34 src/k9mp4title.cpp:49 src/k9main.cpp:290 +#: src/k9main.cpp:300 src/k9main.cpp:310 src/k9main.cpp:330 src/k9main.cpp:588 +#: src/k9main.cpp:689 src/k9main.cpp:703 src/k9prefdvd.cpp:35 +msgid "MB" +msgstr "MB" + +#: libk9copy/k9mp4enc.cpp:233 libk9copy/k9mp4enc.cpp:235 +#: k9author/k9newdvd.cpp:247 +msgid "Encoding %1" +msgstr "Codifica %1" + +#: libk9copy/k9mp4enc.cpp:233 +msgid "pass %1" +msgstr "passaggio %1" + +#: libk9copy/k9mp4enc.cpp:309 +msgid "MPEG-4 Encoding cancelled" +msgstr "Codifica MPEG-4 annullata" + +#: libk9copy/k9mp4enc.cpp:309 src/k9settings.cpp:48 src/k9main.cpp:1141 +msgid "MPEG-4 Encoding" +msgstr "Codifica MPEG4" + +#: libk9copy/k9mp4enc.cpp:312 +msgid "Error while running mencoder :" +msgstr "C'è stato un errore nella esecuzione di mencoder:" + +#: libk9copy/k9burndvd.cpp:188 libk9copy/k9burndvd.cpp:255 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - Masterizza DVD" + +#: libk9copy/k9burndvd.cpp:189 libk9copy/k9burndvd.cpp:256 +#: libk9copy/k9burndvd.cpp:348 src/k9main.cpp:435 +msgid "Burning DVD" +msgstr "Masterizza DVD" + +#: libk9copy/k9burndvd.cpp:200 libk9copy/k9burndvd.cpp:284 src/k9main.cpp:384 +#: k9author/k9import.cpp:178 +msgid "Save image to disk" +msgstr "Salva l'immagine sul disco" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:302 +msgid "Insert a recordable DVD" +msgstr "Inserisci un DVD scrivibile" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:303 +#: libk9copy/k9burndvd.cpp:309 libk9copy/k9burndvd.cpp:314 +msgid "DVD burning" +msgstr "Masterizzazione DVD in corso" + +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +msgid "Error burning DVD :\n" +msgstr "Errore durante la masterizzazione del DVD:\n" + +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:314 +msgid "DVD Burning finished" +msgstr "Scrittura del DVD terminata" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "An error occured while Burning DVD: %1" +msgstr "C'è stato un errore nella masterizzazione del DVD: %1" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "Insert an other DVD" +msgstr "Inserisci un'altro DVD" + +#: libk9copy/k9burndvd.cpp:349 +msgid "Current write speed :%1 x" +msgstr "Velocità di scrittura attuale: %1 x" + +#: libk9copy/k9dvdbackup.cpp:149 libk9copy/k9dvdbackup.cpp:163 +#: libk9copy/k9dvdbackup.cpp:513 libk9copy/k9dvdbackup.cpp:599 +msgid "DVD backup cancelled" +msgstr "Backup del DVD annullato" + +#: libk9copy/k9dvdbackup.cpp:176 +msgid "unable to open VIDEO_TS.IFO" +msgstr "Impossibile aprire VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:198 libk9copy/k9dvdbackup.cpp:381 +#: libk9copy/k9dvdbackup.cpp:446 +msgid "Unable to open file " +msgstr "Impossibile aprire il file" + +#: libk9copy/k9dvdbackup.cpp:277 +msgid "Unable to open titleset %1" +msgstr "Impossibile aprire il contenuto del capitolo %1" + +#: libk9copy/k9dvdbackup.cpp:283 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting titleset %1" +msgstr "Estrazione contenuto del capitolo %1 in corso" + +#: libk9copy/k9dvdbackup.cpp:453 +msgid "Unable to open menu for titleset %1" +msgstr "Impossibile aprire il menù per il capitolo %1" + +#: libk9copy/k9dvdbackup.cpp:479 +msgid "Extracting menu for titleset %1" +msgstr "Estrazione del menù contenuto nel capitolo %1" + +#: libk9copy/k9dvdbackup.cpp:563 +msgid "Unable to open ifo file for titleset %1" +msgstr "Impossibile aprire il file ifo del capitolo %1" + +#: libk9copy/k9dvdbackup.cpp:575 libk9copy/k9dvdbackup.cpp:1694 +msgid "Unable to open DVD" +msgstr "Impossibile aprire il DVD" + +#: libk9copy/k9dvdbackup.cpp:585 +msgid "Unable to open vobs for titleset %1" +msgstr "Impossibile aprire i vob del capitolo %1" + +#: libk9copy/k9dvdbackup.cpp:1381 +msgid "Updating vob %1" +msgstr "Aggiornamento vob %1" + +#: libk9copy/k9dvdbackup.cpp:1398 +msgid "DVD backup canceled" +msgstr "Backup del DVD annullato" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "Periferiche" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "Periferiche non trovate da k9copy" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 src/k9copy.cpp:294 +msgid "DVD Backup" +msgstr "Backup DVD" + +#: src/k9settings.cpp:42 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:42 +msgid "MPEG-4 Codecs" +msgstr "MPEG-4 Codec" + +#: src/k9settings.cpp:48 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:57 +msgid "Title preview" +msgstr "Anteprima Titolo" + +#: src/k9mp4title.cpp:36 src/k9mp4title.cpp:109 src/k9titlefactor.cpp:99 +msgid "Select a Title in the treeview..." +msgstr "Seleziona un Titolo nella vista ad albero" + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "Un programma per il backup dei DVD per KDE" + +#: src/main.cpp:39 +msgid "output device" +msgstr "Destinazione" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "titolo da riprodurre" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "riproduci titolo su stdout" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "inizio settore" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "fine settore" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "lista dei flussi audio" + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "lista dei flussi spu" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "fattore di riduzione" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "fattore di riduzione forzato" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "dimensione della cella da copiare" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "dimensione totale dei titoli selezionati" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "dimensione dei capitoli in copia" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "capitoli selezionati" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "nuova dimensione del dvd" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "capitolo selezionato" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "numero celle nel capitolo selezionato" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "nome del file di stato" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "inizializza il file di stato" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "continua la riproduzione dall'ultimo settore" + +#: src/main.cpp:58 +msgid "don't save status at end" +msgstr "non salvare lo stato alla fine" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "salva la cella in un file temporaneo prima della codifica" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "per uso interno" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:69 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "" +"TRADUTTORI:\n" +" Leonardo Finetti\n" +" Paolo Rampino" + +#: src/main.cpp:70 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "" +"finex@finex.org\n" +"paolo@clickma.it" + +#: src/k9prefmencoder.cpp:105 src/k9prefmencoder.cpp:109 +#: src/k9prefmencoder.cpp:120 src/k9prefmencoder.cpp:122 +msgid "new profile" +msgstr "nuovo profilo" + +#: src/k9copy.cpp:137 +msgid "Shrink Factor" +msgstr "Fattore di riduzione" + +#: src/k9copy.cpp:194 k9author/k9importfiles.cpp:31 +msgid "Edit menu" +msgstr "Modifica menu" + +#: src/k9copy.cpp:263 +msgid "Play title" +msgstr "Riproduci titolo" + +#: src/k9copy.cpp:279 +msgid "Create MPEG-4" +msgstr "Crea MPEG-4 " + +#: src/k9copy.cpp:286 +msgid "Eject" +msgstr "Espelli" + +#: src/k9copy.cpp:300 +msgid "DVD Author" +msgstr "DVD Author" + +#: src/k9copy.cpp:306 +msgid "Create DVD" +msgstr "Crea DVD" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding options" +msgstr "Opzioni codifica MPEG4" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding Options" +msgstr "Opzioni codifica MPEG4" + +#: src/k9copy.cpp:375 +msgid "Settings" +msgstr "Impostazioni" + +#: src/k9langselect.cpp:90 +msgid "Subtitles" +msgstr "Sottotitoli" + +#: src/k9main.cpp:373 src/k9main.cpp:1141 +msgid "DVD is not opened" +msgstr "Il DVD non è stato aperto" + +#: src/k9main.cpp:373 src/k9main.cpp:395 +msgid "DVD Copy" +msgstr "Copia DVD" + +#: src/k9main.cpp:395 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"Spazio su disco insufficiente in %1\n" +"necessari %2 Mb." + +#: src/k9main.cpp:399 +msgid "Backup in progress" +msgstr "Backup in corso" + +#: src/k9main.cpp:459 src/k9main.cpp:608 src/k9main.cpp:1194 +msgid "Ready" +msgstr "Pronto" + +#: src/k9main.cpp:464 k9author/k9import.cpp:156 +msgid "processing" +msgstr "elaborazione" + +#: src/k9main.cpp:499 src/k9main.cpp:1247 k9author/k9import.cpp:63 +msgid "ISO Image" +msgstr "Immagine ISO" + +#: src/k9main.cpp:560 +msgid "Open DVD" +msgstr "Apri DVD" + +#: src/k9main.cpp:586 +msgid "Titleset %1" +msgstr "Titleset %1" + +#: src/k9main.cpp:636 +msgid "chapters" +msgstr "capitoli" + +#: src/k9main.cpp:644 src/k9main.cpp:657 k9author/k9newtitle.cpp:117 +#: k9author/k9newtitle.cpp:139 +msgid "chapter %1" +msgstr "capitolo %1" + +#: src/k9main.cpp:645 src/k9main.cpp:660 src/k9main.cpp:719 src/k9main.cpp:737 +msgid "%1 MB" +msgstr "%1 Mb" + +#: src/k9main.cpp:699 +msgid "video %1 " +msgstr "video %1" + +#: src/k9main.cpp:710 +msgid "audio %1 " +msgstr "audio %1" + +#: src/k9main.cpp:730 +msgid "subpicture %1 " +msgstr "fotogramma %1" + +#: src/k9main.cpp:1149 +msgid "Transcoding title : %1" +msgstr "Transcodifica titolo : %1" + +#: src/k9main.cpp:1248 k9author/k9import.cpp:64 +msgid "Folder" +msgstr "Cartella" + +#: src/k9main.cpp:1355 +msgid "Open ISO Image" +msgstr "Apri immagine ISO" + +#: src/k9main.cpp:1366 +msgid "Open DVD folder" +msgstr "Apri cartella DVD" + +#: src/k9mencodercmdgen.cpp:103 +msgid "Filters" +msgstr "Filtri" + +#: src/k9playbackoptions.cpp:149 +msgid "none" +msgstr "nessuno" + +#: src/k9titlefactor.cpp:110 +msgid "Shrink Factor for %1" +msgstr "Fattore di riduzione per %1" + +#: k9author/k9newdvd.cpp:94 +msgid "Creating root menu" +msgstr "Creazione menu principale" + +#: k9author/k9newdvd.cpp:134 +msgid "The dvd authoring was canceled" +msgstr "Autoring (Creazione dei menù) annullata" + +#: k9author/k9newdvd.cpp:160 +msgid "Creating menu for title %1" +msgstr "Craezione del menù per il titolo %1" + +#: k9author/k9newdvd.cpp:381 k9author/k9newtitle.cpp:63 +msgid "title %1" +msgstr "titolo %1" + +#: k9author/k9avidecode.cpp:31 k9author/k9avidecode.cpp:35 +msgid "Cannot open then library %1" +msgstr "Impossibile aprire la libreria %1" + +#: k9author/k9avidecode.cpp:88 +msgid "Couldn't open the file %1" +msgstr "Non posso aprire il file %1" + +#: k9author/k9avidecode.cpp:93 +msgid "Couldn't find stream information" +msgstr "Impossibile trovare le informazioni del flusso" + +#: k9author/k9avidecode.cpp:106 +msgid "The file doesn't contain any video stream" +msgstr "Il file non contiene nessun flusso video" + +#: k9author/k9avidecode.cpp:117 +msgid "Unsupported codec" +msgstr "Codec non supportato" + +#: k9author/k9avidecode.cpp:122 +msgid "Could'nt open the codec" +msgstr "Non posso aprire il codec" + +#: k9author/k9avidecode.cpp:133 +msgid "Unable to allocate memory for frames" +msgstr "Impossibile allocare memoria per i fotogrammi" + +#: k9author/k9menuedit.cpp:245 +msgid "Title %1 Menu" +msgstr "Menu Titolo %1" + +#: k9author/k9menuedit.cpp:254 k9author/k9menuedit.cpp:291 +msgid "Play Menu" +msgstr "Riproduci Menu" + +#: k9author/k9menuedit.cpp:256 +msgid "Play Title" +msgstr "Riproduci Titolo" + +#: k9author/k9menuedit.cpp:262 +msgid "Play Root Menu" +msgstr "Riproduci Menu Principale" + +#: k9author/k9menuedit.cpp:264 +msgid "Play Title Menu" +msgstr "Riproduci Menu Titolo" + +#: k9author/k9menuedit.cpp:269 k9author/k9menuedit.cpp:295 +msgid "Play Title %1" +msgstr "Riproduci Titolo %1" + +#: k9author/k9importfiles.cpp:24 +msgid "Create new DVD" +msgstr "Crea nuovo DVD" + diff --git a/po/nl.po b/po/nl.po new file mode 100644 index 0000000..f587457 --- /dev/null +++ b/po/nl.po @@ -0,0 +1,1327 @@ +# translation of nl.po to +# translation of ca.po to +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Daniel Balagué Guardia , 2006. +# Kenny Verstraete , 2008. +msgid "" +msgstr "" +"Project-Id-Version: nl\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-03-31 23:50+0200\n" +"PO-Revision-Date: 2008-01-31 12:54+0100\n" +"Last-Translator: Kenny Verstraete \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: libk3bdevice/k3bdeviceglobals.cpp:30 libk3bdevice/k3bdeviceglobals.cpp:132 +msgid "CD-R" +msgstr "CD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:32 libk3bdevice/k3bdeviceglobals.cpp:134 +msgid "CD-RW" +msgstr "CD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:34 libk3bdevice/k3bdeviceglobals.cpp:130 +msgid "CD-ROM" +msgstr "CD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:36 libk3bdevice/k3bdeviceglobals.cpp:101 +msgid "DVD-ROM" +msgstr "DVD-ROM" + +#: libk3bdevice/k3bdeviceglobals.cpp:38 libk3bdevice/k3bdeviceglobals.cpp:115 +msgid "DVD-RAM" +msgstr "DVD-RAM" + +#: libk3bdevice/k3bdeviceglobals.cpp:40 libk3bdevice/k3bdeviceglobals.cpp:104 +msgid "DVD-R" +msgstr "DVD-R" + +#: libk3bdevice/k3bdeviceglobals.cpp:42 libk3bdevice/k3bdeviceglobals.cpp:118 +msgid "DVD-RW" +msgstr "DVD-RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:44 +msgid "DVD-R DL" +msgstr "DVD-R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:46 libk3bdevice/k3bdeviceglobals.cpp:126 +msgid "DVD+R" +msgstr "DVD+R" + +#: libk3bdevice/k3bdeviceglobals.cpp:48 libk3bdevice/k3bdeviceglobals.cpp:124 +msgid "DVD+RW" +msgstr "DVD+RW" + +#: libk3bdevice/k3bdeviceglobals.cpp:50 +msgid "DVD+R DL" +msgstr "DVD+R DL" + +#: libk3bdevice/k3bdeviceglobals.cpp:53 libk3bdevice/k3bdeviceglobals.cpp:137 +msgid "Error" +msgstr "Fout" + +#: libk3bdevice/k3bdeviceglobals.cpp:63 +msgid "SAO" +msgstr "SAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:65 +msgid "TAO" +msgstr "TAO" + +#: libk3bdevice/k3bdeviceglobals.cpp:67 +msgid "RAW" +msgstr "RAW" + +#: libk3bdevice/k3bdeviceglobals.cpp:69 +msgid "SAO/R96P" +msgstr "SAO/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:71 +msgid "SAO/R96R" +msgstr "SAO/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:73 +msgid "RAW/R16" +msgstr "RAW/R16" + +#: libk3bdevice/k3bdeviceglobals.cpp:75 +msgid "RAW/R96P" +msgstr "RAW/R96P" + +#: libk3bdevice/k3bdeviceglobals.cpp:77 +msgid "RAW/R96R" +msgstr "RAW/R96R" + +#: libk3bdevice/k3bdeviceglobals.cpp:79 +msgid "Incremental Sequential" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:81 +msgid "Restricted Overwrite" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:83 +msgid "Layer Jump" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:86 +msgid "None" +msgstr "Geen" + +#: libk3bdevice/k3bdeviceglobals.cpp:95 libk9copy/k9dvd.cpp:254 +#: libk9copy/k9dvd.cpp:256 +msgid "Unknown" +msgstr "Onbekend" + +#: libk3bdevice/k3bdeviceglobals.cpp:99 +msgid "No media" +msgstr "Geen media" + +#: libk3bdevice/k3bdeviceglobals.cpp:106 +msgid "DVD-R Sequential" +msgstr "" + +#: libk3bdevice/k3bdeviceglobals.cpp:109 +msgid "DVD-R Dual Layer" +msgstr "DVD-R Dual Layer" + +#: libk3bdevice/k3bdeviceglobals.cpp:111 +msgid "DVD-R Dual Layer Sequential" +msgstr "DVD-R Dual Layer Sequential" + +#: libk3bdevice/k3bdeviceglobals.cpp:113 +msgid "DVD-R Dual Layer Jump" +msgstr "DVD-R Dual Layer Jump" + +#: libk3bdevice/k3bdeviceglobals.cpp:120 +msgid "DVD-RW Restricted Overwrite" +msgstr "DVD-RW Restricted Overwrite" + +#: libk3bdevice/k3bdeviceglobals.cpp:122 +msgid "DVD-RW Sequential" +msgstr "DVD-RW Sequential" + +#: libk3bdevice/k3bdeviceglobals.cpp:128 +msgid "DVD+R Double Layer" +msgstr "DVD+R Double Layer" + +#: src/k9copy.cpp:66 +msgid "Play title" +msgstr "Hoofdstuk afspelen" + +#: src/k9copy.cpp:73 +msgid "Copy" +msgstr "Kopiëren" + +#: src/kburndvd.cpp:137 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - DVD Branden" + +#: src/kburndvd.cpp:138 src/kburndvd.cpp:224 +msgid "Burning DVD" +msgstr "DVD Branden" + +#: src/kburndvd.cpp:160 src/k9main.cpp:1092 src/k9mainw.cpp:324 +#: debug/src/k9mainw.cpp:324 rc.cpp:85 +#, no-c-format +msgid "default" +msgstr "standaard" + +#: src/kburndvd.cpp:166 src/k9main.cpp:316 +msgid "Save image to disk" +msgstr "Image opslaan naar schijf" + +#: src/kburndvd.cpp:185 +msgid "Insert a recordable DVD" +msgstr "Plaats een beschrijfbare DVD" + +#: src/kburndvd.cpp:186 src/kburndvd.cpp:203 libk9copy/k9dvdauthor.cpp:109 +#: libk9copy/k9dvdauthor.cpp:249 libk9copy/k9dvdauthor.cpp:306 +#: libk9copy/k9dvdauthor.cpp:315 libk9copy/k9dvdauthor.cpp:318 +msgid "authoring" +msgstr "" + +#: src/kburndvd.cpp:192 +msgid "Error burning DVD :\n" +msgstr "Fout bij het branden van DVD :\n" + +#: src/kburndvd.cpp:192 src/kburndvd.cpp:196 +msgid "DVD burning" +msgstr "DVD branden" + +#: src/kburndvd.cpp:196 +msgid "DVD Burning finished" +msgstr "DVD branden voltooid" + +#: src/kburndvd.cpp:202 +msgid "An error occured while Burning DVD: %1" +msgstr "Er is een fout opgetreden tijdens het branden van de DVD: %1" + +#: src/kburndvd.cpp:202 +msgid "Insert an other DVD" +msgstr "Plaats een andere DVD" + +#: src/kburndvd.cpp:224 +msgid "Current write speed :%1 x" +msgstr "Momentele schrijfsnelheid :%1 x" + +#: src/kviewmpeg2.cpp:100 +msgid "Can't find device %1\n" +msgstr "Kan het apparaat niet vinden %1\n" + +#: src/kviewmpeg2.cpp:107 libk9copy/k9dvd.cpp:330 +msgid "Can't open disc %1!\n" +msgstr "Kan schijf niet openen %1!\n" + +#: src/kviewmpeg2.cpp:135 libk9copy/k9dvd.cpp:829 +msgid "Error opening vobs for title %1\n" +msgstr "Fout bij het openen van vobs voor hoofdstuk %1\n" + +#: src/kviewmpeg2.cpp:149 libk9copy/k9dvd.cpp:840 +msgid "ERROR reading block %1\n" +msgstr "Fout bij het lezen van blok %1\n" + +#: src/main.cpp:29 +msgid "A DVD Backup tool for KDE" +msgstr "Een DVD backup tool voor KDE" + +#: src/main.cpp:35 +msgid "input device" +msgstr "invoerlocatie" + +#: src/main.cpp:36 +msgid "output device" +msgstr "Uitvoerlocatie" + +#: src/main.cpp:43 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:46 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "Kenny Verstraete" + +#: src/main.cpp:47 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "verstraete_kenny@skynet.be" + +#: src/k9main.cpp:309 +msgid "DVD is not opened" +msgstr "DVD is niet geopend" + +#: src/k9main.cpp:309 src/k9main.cpp:322 +msgid "DVD Copy" +msgstr "DVD kopiëren" + +#: src/k9main.cpp:322 +msgid "" +"Insuffisant disk space on %1\n" +"%2 mb expected." +msgstr "" +"er is onvoldoende schijfruimte op %1\n" +"Er is %2 mb nodig." + +#: src/k9main.cpp:381 src/k9main.cpp:891 +msgid "ISO Image" +msgstr "ISO image" + +#: src/k9main.cpp:417 +msgid "Open DVD" +msgstr "Open DVD" + +#: src/k9main.cpp:436 +msgid "Titleset %1" +msgstr "Hoofdstuk %1" + +#: src/k9main.cpp:522 +msgid "video %1 " +msgstr "video %1 " + +#: src/k9main.cpp:534 +msgid "audio %1 " +msgstr "audio %1 " + +#: src/k9main.cpp:551 +msgid "subpicture %1 " +msgstr "Ondertitel %1 " + +#: src/k9main.cpp:916 +msgid "Next title" +msgstr "Volgend hoofdstuk" + +#: src/k9main.cpp:1061 +msgid "Audio" +msgstr "Audio" + +#: src/k9main.cpp:1072 +msgid "Subtitles" +msgstr "Ondertitels" + +#: src/k9main.cpp:1100 +msgid "Open ISO Image" +msgstr "Open ISO Image" + +#: src/k9main.cpp:1107 +msgid "Open DVD folder" +msgstr "Open DVD map" + +#: src/menupreview.cpp:1084 debug/src/menupreview.cpp:1084 rc.cpp:3 +#, no-c-format +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Voorbeeldweergave" + +#: src/menupreview.cpp:1085 src/configDlg.cpp:118 +#: debug/src/menupreview.cpp:1085 debug/src/configDlg.cpp:118 rc.cpp:6 +#: rc.cpp:99 +#, no-c-format +msgid "&OK" +msgstr "&OK" + +#: src/viewmpeg2.cpp:631 debug/src/viewmpeg2.cpp:631 rc.cpp:10 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Voorbeeldweergave hoofdstuk" + +#: src/configDlg.cpp:62 src/configDlg.cpp:122 debug/src/configDlg.cpp:62 +#: debug/src/configDlg.cpp:122 rc.cpp:107 +#, no-c-format +msgid "device" +msgstr "apparaat" + +#: src/configDlg.cpp:64 src/configDlg.cpp:123 debug/src/configDlg.cpp:64 +#: debug/src/configDlg.cpp:123 rc.cpp:110 +#, no-c-format +msgid "label" +msgstr "Label" + +#: src/configDlg.cpp:66 src/configDlg.cpp:124 debug/src/configDlg.cpp:66 +#: debug/src/configDlg.cpp:124 rc.cpp:113 +#, no-c-format +msgid "Input" +msgstr "Invoer" + +#: src/configDlg.cpp:68 src/configDlg.cpp:125 debug/src/configDlg.cpp:68 +#: debug/src/configDlg.cpp:125 rc.cpp:116 +#, no-c-format +msgid "Output" +msgstr "Uitvoer" + +#: src/configDlg.cpp:116 debug/src/configDlg.cpp:116 rc.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Apparaten" + +#: src/configDlg.cpp:117 debug/src/configDlg.cpp:117 rc.cpp:96 +#, no-c-format +msgid "

Devices not detected by k9copy

" +msgstr "

Apparaten niet gedetecteerd door k9copy

" + +#: src/configDlg.cpp:120 libk9copy/progress.cpp:80 +#: debug/libk9copy/progress.cpp:79 debug/src/configDlg.cpp:120 rc.cpp:103 +#: rc.cpp:163 +#, no-c-format +msgid "&Cancel" +msgstr "&Annuleren" + +#: src/configDlg.cpp:126 debug/src/configDlg.cpp:126 rc.cpp:119 +#, no-c-format +msgid "&Add" +msgstr "&Toevoegen" + +#: src/configDlg.cpp:127 debug/src/configDlg.cpp:127 rc.cpp:122 +#, no-c-format +msgid "Alt+A" +msgstr "Alt+A" + +#: src/configDlg.cpp:128 debug/src/configDlg.cpp:128 rc.cpp:125 +#, no-c-format +msgid "&Remove" +msgstr "&Verwijderen" + +#: src/configDlg.cpp:129 debug/src/configDlg.cpp:129 rc.cpp:128 +#, no-c-format +msgid "Alt+R" +msgstr "Alt+R" + +#: src/k9mainw.cpp:50 src/k9mainw.cpp:300 debug/src/k9mainw.cpp:50 +#: debug/src/k9mainw.cpp:300 rc.cpp:21 +#, no-c-format +msgid "Title" +msgstr "Hoofdstuk" + +#: src/k9mainw.cpp:51 src/k9mainw.cpp:301 debug/src/k9mainw.cpp:51 +#: debug/src/k9mainw.cpp:301 rc.cpp:24 +#, no-c-format +msgid "Size" +msgstr "Grootte" + +#: src/k9mainw.cpp:112 src/k9mainw.cpp:305 debug/src/k9mainw.cpp:112 +#: debug/src/k9mainw.cpp:305 rc.cpp:36 +#, no-c-format +msgid "Languages" +msgstr "Talen" + +#: src/k9mainw.cpp:299 debug/src/k9mainw.cpp:299 rc.cpp:15 +#, no-c-format +msgid "MainDlg" +msgstr "Hoofdvenster" + +#: src/k9mainw.cpp:302 debug/src/k9mainw.cpp:302 rc.cpp:27 +#, no-c-format +msgid "At title end" +msgstr "" + +#: src/k9mainw.cpp:303 debug/src/k9mainw.cpp:303 rc.cpp:30 +#, no-c-format +msgid "At start" +msgstr "" + +#: src/k9mainw.cpp:304 debug/src/k9mainw.cpp:304 rc.cpp:33 +#, no-c-format +msgid "DVD playback options" +msgstr "DVD afspeel opties" + +#: src/k9mainw.cpp:306 debug/src/k9mainw.cpp:306 rc.cpp:39 +#, no-c-format +msgid "&Keep original menus" +msgstr "&Originele menu's behouden" + +#: src/k9mainw.cpp:307 debug/src/k9mainw.cpp:307 rc.cpp:42 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: src/k9mainw.cpp:308 debug/src/k9mainw.cpp:308 rc.cpp:18 +#, no-c-format +msgid "D&VD" +msgstr "D&VD" + +#: src/k9mainw.cpp:310 debug/src/k9mainw.cpp:310 rc.cpp:49 +#, no-c-format +msgid "&Save" +msgstr "&Opslaan" + +#: src/k9mainw.cpp:311 debug/src/k9mainw.cpp:311 rc.cpp:52 +#, no-c-format +msgid "Alt+S" +msgstr "Alt+S" + +#: src/k9mainw.cpp:312 debug/src/k9mainw.cpp:312 rc.cpp:55 +#, no-c-format +msgid "Output directory" +msgstr "Uitvoerlocatie" + +#: src/k9mainw.cpp:313 debug/src/k9mainw.cpp:313 rc.cpp:58 +#, no-c-format +msgid "DVD size" +msgstr "DVD grootte" + +#: src/k9mainw.cpp:314 debug/src/k9mainw.cpp:314 rc.cpp:61 +#, no-c-format +msgid "Burn with k3b" +msgstr "Branden met k3b" + +#: src/k9mainw.cpp:315 debug/src/k9mainw.cpp:315 rc.cpp:64 +#, no-c-format +msgid "Quick scan" +msgstr "Snelle scan" + +#: src/k9mainw.cpp:316 debug/src/k9mainw.cpp:316 rc.cpp:67 +#, no-c-format +msgid "Auto burn" +msgstr "Automatisch branden" + +#: src/k9mainw.cpp:317 debug/src/k9mainw.cpp:317 rc.cpp:70 +#, no-c-format +msgid "mb" +msgstr "mb" + +#: src/k9mainw.cpp:318 debug/src/k9mainw.cpp:318 rc.cpp:45 +#, no-c-format +msgid "Se&ttings" +msgstr "Instell&ingen" + +#: src/k9mainw.cpp:319 debug/src/k9mainw.cpp:319 rc.cpp:73 +#, no-c-format +msgid "Output device " +msgstr "Uitvoerlocatie" + +#: src/k9mainw.cpp:320 debug/src/k9mainw.cpp:320 rc.cpp:76 +#, no-c-format +msgid "@" +msgstr "@" + +#: src/k9mainw.cpp:321 debug/src/k9mainw.cpp:321 rc.cpp:79 +#, no-c-format +msgid "X" +msgstr "X" + +#: src/k9mainw.cpp:322 debug/src/k9mainw.cpp:322 rc.cpp:82 +#, no-c-format +msgid "Input device " +msgstr "Invoerapparaat" + +#: src/k9mainw.cpp:327 debug/src/k9mainw.cpp:327 rc.cpp:90 +#, no-c-format +msgid "..." +msgstr "..." + +#: src/kviewmpeg2.moc.cpp:34 src/kviewmpeg2.moc.cpp:42 +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "kViewMPEG2" +msgstr "" + +#: src/k9copy.moc.cpp:34 src/k9copy.moc.cpp:42 libk9copy/progress.cpp:78 +#: debug/libk9copy/progress.cpp:77 debug/src/k9copy.moc.cpp:34 +#: debug/src/k9copy.moc.cpp:42 rc.cpp:159 +#, no-c-format +msgid "k9Copy" +msgstr "" + +#: src/k9main.moc.cpp:34 src/k9main.moc.cpp:42 debug/src/k9main.moc.cpp:34 +#: debug/src/k9main.moc.cpp:42 +msgid "k9DVDListItem" +msgstr "" + +#: src/k9main.moc.cpp:107 src/k9main.moc.cpp:115 debug/src/k9main.moc.cpp:107 +#: debug/src/k9main.moc.cpp:115 +msgid "k9Main" +msgstr "" + +#: src/kcddrive.moc.cpp:34 src/kcddrive.moc.cpp:42 +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "" + +#: src/kcddrive.moc.cpp:107 src/kcddrive.moc.cpp:115 +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "" + +#: libk9copy/k9dvdauthor.cpp:108 libk9copy/k9dvdauthor.cpp:248 +msgid "'%1' not selected" +msgstr "'%1' niet geselecteerd" + +#: libk9copy/k9dvdauthor.cpp:276 +msgid "Authoring" +msgstr "Authoring" + +#: libk9copy/k9dvdauthor.cpp:306 +msgid "Dvdauthor error :\n" +msgstr "Dvdauthor fout :\n" + +#: libk9copy/k9dvdauthor.cpp:315 +msgid "Authoring cancelled" +msgstr "Authoring geannuleerd" + +#: libk9copy/k9dvdauthor.cpp:318 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Er is een fout opgetreden tijdens het uitvoeren van DVDAuthor:\n" + +#: libk9copy/k9dvdbackup.cpp:135 libk9copy/k9dvdbackup.cpp:149 +#: libk9copy/k9dvdbackup.cpp:486 libk9copy/k9dvdbackup.cpp:643 +msgid "DVD backup cancelled" +msgstr "DVD backup geannuleerd" + +#: libk9copy/k9dvdbackup.cpp:162 +msgid "unable to open VIDEO_TS.IFO" +msgstr "kan VIDEO_TS.IFO niet openen" + +#: libk9copy/k9dvdbackup.cpp:184 libk9copy/k9dvdbackup.cpp:360 +#: libk9copy/k9dvdbackup.cpp:424 +msgid "Unable to open file " +msgstr "Kan bestand niet openen" + +#: libk9copy/k9dvdbackup.cpp:253 +msgid "Unable to open titleset %1" +msgstr "Kan hoofdstuk %1 niet openen" + +#: libk9copy/k9dvdbackup.cpp:259 libk9copy/k9dvdbackup.cpp:615 +msgid "Extracting titleset %1" +msgstr "Uitpakken hoofdstuk %1" + +#: libk9copy/k9dvdbackup.cpp:431 libk9copy/k9dvdbackup.cpp:559 +msgid "Unable to open menu for titleset %1" +msgstr "Kan het menu voor hoofdstuk %1 niet openen" + +#: libk9copy/k9dvdbackup.cpp:453 libk9copy/k9dvdbackup.cpp:566 +msgid "Extracting menu for titleset %1" +msgstr "Uitpakken menu voor hoofdstuk %1" + +#: libk9copy/k9dvdbackup.cpp:552 +msgid "Unable to open " +msgstr "Kan niet openen" + +#: libk9copy/k9dvdbackup.cpp:607 +msgid "Unable to open ifo file for titleset %1" +msgstr "Kan ifo bastand voor hoofdstuk %1 niet openen" + +#: libk9copy/k9dvdbackup.cpp:619 libk9copy/k9dvdbackup.cpp:1420 +msgid "Unable to open DVD" +msgstr "Kan DVD niet openen" + +#: libk9copy/k9dvdbackup.cpp:629 +msgid "Unable to open vobs for titleset %1" +msgstr "Kan vobs voor hoofdstuk %1 niet openen" + +#: libk9copy/k9dvdbackup.cpp:1151 +msgid "Updating vob %1" +msgstr "Actualiseren van vob %1" + +#: libk9copy/k9dvdbackup.cpp:1167 +msgid "DVD backup canceled" +msgstr "DVD backup geannuleerd" + +#: libk9copy/k9dvd.cpp:192 +msgid "Couldn't open %1 for title\n" +msgstr "Kon %1 voor hoofdstuk niet openen\n" + +#: libk9copy/k9dvd.cpp:200 +msgid "Couldn't seek in %1 for title\n" +msgstr "Kon niet zoeken in %1 voor hoofdstuk\n" + +#: libk9copy/k9dvd.cpp:227 +msgid "Not Specified" +msgstr "Niet opgegeven" + +#: libk9copy/k9dvd.cpp:227 +msgid "Afar" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Abkhazian" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Afrikaans" +msgstr "Afrikaans" + +#: libk9copy/k9dvd.cpp:227 +msgid "Amharic" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Arabic" +msgstr "Arabisch" + +#: libk9copy/k9dvd.cpp:228 +msgid "Assamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Aymara" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Azerbaijani" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bashkir" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Byelorussian" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bulgarian" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bihari" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bislama" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Bengali; Bangla" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Tibetan" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Breton" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Catalan" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Corsican" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Czech" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Welsh" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Dansk" +msgstr "Deens" + +#: libk9copy/k9dvd.cpp:231 +msgid "Deutsch" +msgstr "Duits" + +#: libk9copy/k9dvd.cpp:231 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Greek" +msgstr "Grieks" + +#: libk9copy/k9dvd.cpp:231 +msgid "English" +msgstr "Engels" + +#: libk9copy/k9dvd.cpp:232 +msgid "Esperanto" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Espanol" +msgstr "Spaans" + +#: libk9copy/k9dvd.cpp:232 +msgid "Estonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Basque" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Persian" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Suomi" +msgstr "Suomi" + +#: libk9copy/k9dvd.cpp:233 +msgid "Fiji" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Faroese" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Francais" +msgstr "Frans" + +#: libk9copy/k9dvd.cpp:233 +msgid "Frisian" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Gaelic" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Scots Gaelic" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Galician" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Guarani" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Gujarati" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Hausa" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:237 +msgid "Hebrew" +msgstr "Hebreeuws" + +#: libk9copy/k9dvd.cpp:235 +msgid "Hindi" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Hrvatski" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Magyar" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Armenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Interlingua" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Indonesian" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Interlingue" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Italiano" +msgstr "Italiaans" + +#: libk9copy/k9dvd.cpp:237 +msgid "Inuktitut" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Japanese" +msgstr "Japanees" + +#: libk9copy/k9dvd.cpp:238 libk9copy/k9dvd.cpp:253 +msgid "Yiddish" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Javanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Georgian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Kazakh" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Greenlandic" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Cambodian" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kannada" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Korean" +msgstr "Koreaans" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kashmiri" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Kurdish" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Kirghiz" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Latin" +msgstr "Latijn" + +#: libk9copy/k9dvd.cpp:240 +msgid "Lingala" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Lithuanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Maori" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Macedonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Mongolian" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Moldavian" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Nepali" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Nederlands" +msgstr "Nederlands" + +#: libk9copy/k9dvd.cpp:243 +msgid "Norsk" +msgstr "Noors" + +#: libk9copy/k9dvd.cpp:243 +msgid "Occitan" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Polish" +msgstr "Pools" + +#: libk9copy/k9dvd.cpp:244 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Portugues" +msgstr "Portugees" + +#: libk9copy/k9dvd.cpp:245 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Romanian" +msgstr "Roemeens" + +#: libk9copy/k9dvd.cpp:246 +msgid "Russian" +msgstr "Russisch" + +#: libk9copy/k9dvd.cpp:246 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Serbo-Croatian" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Slovak" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Slovenian" +msgstr "Sloveens" + +#: libk9copy/k9dvd.cpp:247 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Albanian" +msgstr "Albanees" + +#: libk9copy/k9dvd.cpp:248 +msgid "Serbian" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Swahili" +msgstr "Swahili" + +#: libk9copy/k9dvd.cpp:249 +msgid "Tamil" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Thai" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Turkish" +msgstr "Turks" + +#: libk9copy/k9dvd.cpp:251 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Ukrainian" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:252 +msgid "Vietnamese" +msgstr "Viëtnamees" + +#: libk9copy/k9dvd.cpp:253 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:253 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:254 +msgid "Chinese" +msgstr "Chinees" + +#: libk9copy/k9dvd.cpp:254 +msgid "Zulu" +msgstr "Zulu" + +#: libk9copy/k9dvd.cpp:340 +msgid "Can't open main ifo!\n" +msgstr "No es pot obrir l'IFO principal!\n" + +#: libk9copy/k9dvd.cpp:355 +msgid "unknown" +msgstr "Onbekend" + +#: libk9copy/k9dvd.cpp:379 libk9copy/k9dvd.cpp:656 +msgid "Title %1" +msgstr "Títol %1" + +#: libk9copy/k9dvd.cpp:704 +msgid "reading title" +msgstr "Llegint el títol" + +#: libk9copy/backupdlg.cpp:150 debug/libk9copy/backupdlg.cpp:150 rc.cpp:131 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Progressió de la còpia de seguretat" + +#: libk9copy/backupdlg.cpp:151 debug/libk9copy/backupdlg.cpp:151 rc.cpp:134 +#, no-c-format +msgid "A&bort" +msgstr "A&fbreken" + +#: libk9copy/backupdlg.cpp:152 debug/libk9copy/backupdlg.cpp:152 rc.cpp:137 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+V" + +#: libk9copy/backupdlg.cpp:153 debug/libk9copy/backupdlg.cpp:153 rc.cpp:140 +#, no-c-format +msgid "--:--:--" +msgstr "" + +#: libk9copy/backupdlg.cpp:154 debug/libk9copy/backupdlg.cpp:154 rc.cpp:143 +#, no-c-format +msgid "Current step" +msgstr "Pas actual" + +#: libk9copy/backupdlg.cpp:155 debug/libk9copy/backupdlg.cpp:155 rc.cpp:146 +#, no-c-format +msgid "Elapsed Time" +msgstr "Verstreken Tijd" + +#: libk9copy/backupdlg.cpp:156 debug/libk9copy/backupdlg.cpp:156 rc.cpp:149 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

Còpia de seguretat de DVD

" + +#: libk9copy/dvdprogress.cpp:86 debug/libk9copy/dvdprogress.cpp:86 rc.cpp:153 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - Anàlisi del DVD" + +#: libk9copy/progress.cpp:81 debug/libk9copy/progress.cpp:80 rc.cpp:166 +#, no-c-format +msgid "Alt+C" +msgstr "" + +#: libk9copy/k9dvdprogress.moc.cpp:34 libk9copy/k9dvdprogress.moc.cpp:42 +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "" + +#: libk9copy/k9dvdauthor.moc.cpp:34 libk9copy/k9dvdauthor.moc.cpp:42 +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "" + +#: libk9copy/k9dvdsize.moc.cpp:34 libk9copy/k9dvdsize.moc.cpp:42 +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:34 libk9copy/k9dvdtitle.moc.cpp:42 +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:107 libk9copy/k9dvdtitle.moc.cpp:115 +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:180 libk9copy/k9dvdtitle.moc.cpp:188 +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDVideoStream" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:253 libk9copy/k9dvdtitle.moc.cpp:261 +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDAudioStream" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:326 libk9copy/k9dvdtitle.moc.cpp:334 +#: debug/libk9copy/k9dvdtitle.moc.cpp:326 +#: debug/libk9copy/k9dvdtitle.moc.cpp:334 +msgid "k9DVDSubtitle" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:399 libk9copy/k9dvdtitle.moc.cpp:407 +#: debug/libk9copy/k9dvdtitle.moc.cpp:399 +#: debug/libk9copy/k9dvdtitle.moc.cpp:407 +msgid "k9DVDTitle" +msgstr "" + +#: libk9copy/k9dvdtitle.moc.cpp:472 libk9copy/k9dvdtitle.moc.cpp:480 +#: debug/libk9copy/k9dvdtitle.moc.cpp:472 +#: debug/libk9copy/k9dvdtitle.moc.cpp:480 +msgid "k9DVDTitleset" +msgstr "" + +#: libk9copy/k9dvd.moc.cpp:34 libk9copy/k9dvd.moc.cpp:42 +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "" + +#: k9decmpeg/kdecmpeg2.moc.cpp:34 k9decmpeg/kdecmpeg2.moc.cpp:42 +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "" + +#: rc.cpp:169 +#, no-c-format +msgid "A&ctions" +msgstr "A&cties" + +#: rc.cpp:172 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Werkbalk opties" + diff --git a/po/pl.po b/po/pl.po new file mode 100644 index 0000000..973263e --- /dev/null +++ b/po/pl.po @@ -0,0 +1,2548 @@ +# translation of pl.po to Polish +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Wojciech Nawrocki , 2006. +# Tomasz Argasiński , 2008. +msgid "" +msgstr "" +"Project-Id-Version: pl\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-10-14 09:03+0200\n" +"PO-Revision-Date: 2008-07-29 00:06+0200\n" +"Last-Translator: Tomasz Argasiński \n" +"Language-Team: Polish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: rc.cpp:3 +#: debug/libk9copy/backupdlg.cpp:156 +#: libk9copy/k9dvdauthor.cpp:404 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Trwa kopiowanie" + +#: rc.cpp:6 +#: debug/libk9copy/backupdlg.cpp:157 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

Kopiowanie DVD

" + +#: rc.cpp:9 +#: debug/libk9copy/backupdlg.cpp:158 +#, no-c-format +msgid "Current step" +msgstr "Aktualny krok" + +#: rc.cpp:12 +#: rc.cpp:47 +#: rc.cpp:65 +#: debug/libk9copy/backupdlg.cpp:159 +#: debug/libk9copy/mp4dlg.cpp:148 +#: debug/libk9copy/progress.cpp:116 +#, no-c-format +msgid "Elapsed Time" +msgstr "Czas do koÅ„ca" + +#: rc.cpp:15 +#: rc.cpp:612 +#: rc.cpp:640 +#: rc.cpp:666 +#: debug/libk9copy/backupdlg.cpp:160 +#: debug/k9author/newTitle.cpp:131 +#: debug/k9author/chapterEdit.cpp:154 +#: debug/k9author/import.cpp:111 +#, no-c-format +msgid "--:--:--" +msgstr "--:--:--" + +#: rc.cpp:19 +#: debug/libk9copy/dvdprogress.cpp:92 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - Analiza DVD" + +#: rc.cpp:25 +#: debug/libk9copy/processList.cpp:68 +#, no-c-format +msgid "Process List" +msgstr "Lista " + +#: rc.cpp:28 +#: debug/libk9copy/processList.cpp:33 +#: debug/libk9copy/processList.cpp:69 +#, no-c-format +msgid "Processes" +msgstr "Procesy" + +#: rc.cpp:31 +#: debug/libk9copy/processList.cpp:34 +#: debug/libk9copy/processList.cpp:70 +#, no-c-format +msgid "Elapsed" +msgstr "Czas do koÅ„ca" + +#: rc.cpp:34 +#: rc.cpp:603 +#: debug/libk9copy/processList.cpp:35 +#: debug/libk9copy/processList.cpp:71 +#: debug/k9author/import.cpp:46 +#: debug/k9author/import.cpp:107 +#, no-c-format +msgid "..." +msgstr "..." + +#: rc.cpp:40 +#: debug/libk9copy/processList.cpp:73 +#: debug/src/progress.cpp:81 +#, no-c-format +msgid "Alt+C" +msgstr "Alt-C" + +#: rc.cpp:43 +#: debug/libk9copy/progress.cpp:114 +#: debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 +#: debug/src/k9copy.moc.cpp:42 +#, no-c-format +msgid "k9Copy" +msgstr "k9Copy" + +#: rc.cpp:52 +#: debug/libk9copy/mp4dlg.cpp:141 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - konwersja" + +#: rc.cpp:55 +#: debug/libk9copy/mp4dlg.cpp:142 +#, no-c-format +msgid "Encoding" +msgstr "Kodowanie" + +#: rc.cpp:62 +#: debug/libk9copy/mp4dlg.cpp:147 +#: k9author/k9newdvd.cpp:344 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: rc.cpp:68 +#: rc.cpp:154 +#: rc.cpp:181 +#: rc.cpp:284 +#: debug/libk9copy/mp4dlg.cpp:149 +#: debug/src/prefAuthor.cpp:147 +#: debug/src/prefMPEG4.cpp:337 +#: debug/src/prefMPEG4.cpp:347 +#, no-c-format +msgid "Bitrate" +msgstr "Szybkość transmisji" + +#: rc.cpp:71 +#: rc.cpp:215 +#: rc.cpp:232 +#: debug/libk9copy/mp4dlg.cpp:150 +#: debug/src/k9mainw.cpp:66 +#: debug/src/k9mainw.cpp:161 +#, no-c-format +msgid "Size" +msgstr "Rozmiar" + +#: rc.cpp:74 +#: debug/src/mencoderCmdGen.cpp:98 +#: src/k9mencodercmdgen.cpp:55 +#, no-c-format +msgid "MEncoder options" +msgstr "Opcje MEncodera" + +#: rc.cpp:78 +#: debug/src/mencoderCmdGen.cpp:108 +#: src/k9mencodercmdgen.cpp:68 +#, no-c-format +msgid "Audio Codec" +msgstr "Kodek dzwiÄ™ku" + +#: rc.cpp:81 +#: rc.cpp:169 +#: debug/src/prefMPEG4.cpp:343 +#: debug/src/mencoderCmdGen.cpp:104 +#, no-c-format +msgid "faac" +msgstr "faac" + +#: rc.cpp:84 +#: rc.cpp:96 +#: debug/src/mencoderCmdGen.cpp:107 +#: debug/src/mencoderCmdGen.cpp:119 +#, no-c-format +msgid "lavc" +msgstr "lavc" + +#: rc.cpp:87 +#: debug/src/mencoderCmdGen.cpp:120 +#: src/k9mencodercmdgen.cpp:84 +#, no-c-format +msgid "Video Codec" +msgstr "Kodek obrazu" + +#: rc.cpp:90 +#: rc.cpp:121 +#: rc.cpp:388 +#: debug/src/prefMPEG4.cpp:323 +#: debug/src/prefMencoder.cpp:299 +#: debug/src/mencoderCmdGen.cpp:113 +#, no-c-format +msgid "x264" +msgstr "x264" + +#: rc.cpp:93 +#: debug/src/mencoderCmdGen.cpp:116 +#, no-c-format +msgid "xvid" +msgstr "xvid" + +#: rc.cpp:99 +#: rc.cpp:313 +#: rc.cpp:365 +#: debug/src/prefMPEG4.cpp:315 +#: debug/src/prefMencoder.cpp:286 +#: debug/src/prefpreview.cpp:140 +#, no-c-format +msgid "Form1" +msgstr "Form1" + +#: rc.cpp:103 +#: debug/src/prefMPEG4.cpp:339 +#, no-c-format +msgid "Video" +msgstr "Wideo" + +#: rc.cpp:106 +#: debug/src/prefMPEG4.cpp:317 +#, no-c-format +msgid "2 pass" +msgstr "2 przebiegi" + +#: rc.cpp:109 +#: debug/src/prefMPEG4.cpp:318 +#, no-c-format +msgid "Alt+2" +msgstr "Alt+2" + +#: rc.cpp:112 +#: rc.cpp:163 +#: debug/src/prefMPEG4.cpp:319 +#: debug/src/prefMPEG4.cpp:340 +#, no-c-format +msgid "Codec" +msgstr "Kodek" + +#: rc.cpp:115 +#: rc.cpp:385 +#: debug/src/prefMPEG4.cpp:321 +#: debug/src/prefMencoder.cpp:298 +#, no-c-format +msgid "XviD" +msgstr "XviD" + +#: rc.cpp:118 +#: debug/src/prefMPEG4.cpp:322 +#, no-c-format +msgid "lavc MPEG4" +msgstr "lavc MPEG4" + +#: rc.cpp:130 +#: debug/src/prefMPEG4.cpp:327 +#, no-c-format +msgid "640" +msgstr "640" + +#: rc.cpp:134 +#: debug/src/prefMPEG4.cpp:329 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "&Zachowaj proporcje" + +#: rc.cpp:137 +#: rc.cpp:493 +#: debug/src/playbackoptionsw.cpp:230 +#: debug/src/prefMPEG4.cpp:330 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: rc.cpp:141 +#: rc.cpp:206 +#: rc.cpp:238 +#: debug/src/prefMPEG4.cpp:332 +#: debug/src/k9mainw.cpp:163 +#, no-c-format +msgid "X" +msgstr "X" + +#: rc.cpp:145 +#: debug/src/prefMPEG4.cpp:334 +#, no-c-format +msgid "File size" +msgstr "Rozmiar pliku" + +#: rc.cpp:148 +#: debug/src/prefMPEG4.cpp:335 +#, no-c-format +msgid "Alt+S" +msgstr "Alt+S" + +#: rc.cpp:151 +#: debug/src/prefMPEG4.cpp:336 +#, no-c-format +msgid " MB" +msgstr " MB" + +#: rc.cpp:157 +#: rc.cpp:519 +#: debug/src/prefMPEG4.cpp:338 +#: debug/src/prefDVD.cpp:100 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+B" + +#: rc.cpp:160 +#: rc.cpp:263 +#: rc.cpp:507 +#: rc.cpp:575 +#: debug/src/playbackoptionsw.cpp:236 +#: debug/src/prefAuthor.cpp:138 +#: debug/src/prefMPEG4.cpp:350 +#: debug/k9Mplayer/mplayer.cpp:594 +#: src/k9langselect.cpp:79 +#, no-c-format +msgid "Audio" +msgstr "Audio" + +#: rc.cpp:166 +#: debug/src/prefMPEG4.cpp:342 +#, no-c-format +msgid "mp3" +msgstr "mp3" + +#: rc.cpp:172 +#: debug/src/prefMPEG4.cpp:344 +#, no-c-format +msgid "mp2" +msgstr "mp2" + +#: rc.cpp:175 +#: debug/src/prefMPEG4.cpp:345 +#, no-c-format +msgid "ac3" +msgstr "ac3" + +#: rc.cpp:178 +#: debug/src/prefMPEG4.cpp:346 +#, no-c-format +msgid "adpcm ima" +msgstr "adpcm ima" + +#: rc.cpp:185 +#: debug/src/prefMPEG4.cpp:349 +#, no-c-format +msgid "Gain" +msgstr "Wzmocnienie" + +#: rc.cpp:188 +#: debug/src/prefMPEG4.cpp:351 +#, no-c-format +msgid "use cell cache" +msgstr "" + +#: rc.cpp:191 +#: rc.cpp:220 +#: debug/src/k9mainw.cpp:157 +#, no-c-format +msgid "MainDlg" +msgstr "" + +#: rc.cpp:194 +#: rc.cpp:223 +#: debug/src/k9mainw.cpp:158 +#, no-c-format +msgid "Output device " +msgstr "UrzÄ…dzenie wyjÅ›ciowe" + +#: rc.cpp:197 +#: rc.cpp:244 +#: debug/src/k9mainw.cpp:166 +#, no-c-format +msgid "@" +msgstr "@" + +#: rc.cpp:200 +#, no-c-format +msgid "Input device " +msgstr "UrzÄ…dzenie wejÅ›ciowe" + +#: rc.cpp:203 +#: rc.cpp:241 +#: debug/src/k9mainw.cpp:165 +#: libk9copy/k9burndvd.cpp:178 +#: libk9copy/k9burndvd.cpp:278 +#: src/k9main.cpp:1344 +#: src/k9playbackoptions.cpp:147 +#: k9author/k9import.cpp:207 +#, no-c-format +msgid "default" +msgstr "domyÅ›lne" + +#: rc.cpp:209 +#, no-c-format +msgid "D&VD" +msgstr "D&VD" + +#: rc.cpp:212 +#: rc.cpp:229 +#: debug/src/k9mainw.cpp:65 +#: debug/src/k9mainw.cpp:160 +#, no-c-format +msgid "Title" +msgstr "TytuÅ‚" + +#: rc.cpp:226 +#: debug/src/k9mainw.cpp:159 +#: src/main.cpp:37 +#, no-c-format +msgid "input device" +msgstr "UrzÄ…dzenie wejÅ›ciowe" + +#: rc.cpp:235 +#: debug/src/k9mainw.cpp:68 +#: debug/src/k9mainw.cpp:162 +#, no-c-format +msgid "Content" +msgstr "Zawartość" + +#: rc.cpp:248 +#: debug/src/k9mainw.cpp:168 +#, no-c-format +msgid "Open a folder" +msgstr "Otwórz katalog z zawartoÅ›ciÄ… DVD" + +#: rc.cpp:252 +#: debug/src/k9mainw.cpp:170 +#, no-c-format +msgid "Open an iso image" +msgstr "Otwórz obraz ISO" + +#: rc.cpp:255 +#: debug/src/viewmpeg2.cpp:205 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - PodglÄ…d elementu" + +#: rc.cpp:260 +#: debug/src/prefAuthor.cpp:137 +#, no-c-format +msgid "Authoring options" +msgstr "Opcje authoringu" + +#: rc.cpp:266 +#: debug/src/prefAuthor.cpp:140 +#, no-c-format +msgid "AC3" +msgstr "AC3" + +#: rc.cpp:269 +#: debug/src/prefAuthor.cpp:141 +#, no-c-format +msgid "MP2" +msgstr "MP2" + +#: rc.cpp:272 +#: debug/src/prefAuthor.cpp:143 +#, no-c-format +msgid "128" +msgstr "128" + +#: rc.cpp:275 +#: debug/src/prefAuthor.cpp:144 +#, no-c-format +msgid "192" +msgstr "192" + +#: rc.cpp:278 +#: debug/src/prefAuthor.cpp:145 +#, no-c-format +msgid "320" +msgstr "320" + +#: rc.cpp:281 +#: debug/src/prefAuthor.cpp:146 +#, no-c-format +msgid "Format" +msgstr "Format" + +#: rc.cpp:287 +#: debug/src/prefAuthor.cpp:148 +#, no-c-format +msgid "Buttons" +msgstr "Przyciski" + +#: rc.cpp:299 +#: debug/src/prefAuthor.cpp:152 +#, no-c-format +msgid "Hilite color" +msgstr "Kolor podÅ›wietlenia" + +#: rc.cpp:303 +#: debug/src/prefAuthor.cpp:154 +#, no-c-format +msgid "Text color" +msgstr "Kolor tekstu" + +#: rc.cpp:307 +#: debug/src/langselectw.cpp:120 +#: src/k9copy.cpp:120 +#, no-c-format +msgid "Selection" +msgstr "Zaznaczenie" + +#: rc.cpp:310 +#: debug/src/langselectw.cpp:93 +#: debug/src/langselectw.cpp:121 +#, no-c-format +msgid "Languages" +msgstr "JÄ™zyki" + +#: rc.cpp:317 +#: debug/src/prefpreview.cpp:142 +#, no-c-format +msgid "&Internal Player" +msgstr "&Wbudowany odtwarzacz" + +#: rc.cpp:320 +#: debug/src/prefpreview.cpp:143 +#, no-c-format +msgid "Alt+I" +msgstr "Alt+I" + +#: rc.cpp:323 +#: debug/src/prefpreview.cpp:144 +#, no-c-format +msgid "MPlayer" +msgstr "MPlayer" + +#: rc.cpp:326 +#: debug/src/prefpreview.cpp:145 +#, no-c-format +msgid "Alt+M" +msgstr "Alt+M" + +#: rc.cpp:329 +#: debug/src/prefpreview.cpp:146 +#, no-c-format +msgid "Internal viewer options" +msgstr "Ustawienia wbudowanego odtwarzacza" + +#: rc.cpp:332 +#: debug/src/prefpreview.cpp:147 +#, no-c-format +msgid "use OpenGL" +msgstr "Użyj OpenGL" + +#: rc.cpp:335 +#: debug/src/prefpreview.cpp:148 +#, no-c-format +msgid "Video output" +msgstr "" + +#: rc.cpp:338 +#: debug/src/prefpreview.cpp:149 +#, no-c-format +msgid "Audio output" +msgstr "WyjÅ›cie audio" + +#: rc.cpp:341 +#: debug/src/prefpreview.cpp:151 +#, no-c-format +msgid "X11" +msgstr "X11" + +#: rc.cpp:344 +#: debug/src/prefpreview.cpp:152 +#, no-c-format +msgid "Xv" +msgstr "Xv" + +#: rc.cpp:347 +#: debug/src/prefpreview.cpp:153 +#, no-c-format +msgid "OpenGL" +msgstr "OpenGL" + +#: rc.cpp:350 +#: rc.cpp:359 +#: debug/src/prefpreview.cpp:154 +#: debug/src/prefpreview.cpp:158 +#, no-c-format +msgid "SDL" +msgstr "SDL" + +#: rc.cpp:353 +#: debug/src/prefpreview.cpp:156 +#, no-c-format +msgid "ALSA" +msgstr "ALSA" + +#: rc.cpp:356 +#: debug/src/prefpreview.cpp:157 +#, no-c-format +msgid "OSS" +msgstr "OSS" + +#: rc.cpp:362 +#: debug/src/prefpreview.cpp:159 +#, no-c-format +msgid "MPlayer options" +msgstr "Opcje MPlayera" + +#: rc.cpp:368 +#: debug/src/prefMencoder.cpp:287 +#, no-c-format +msgid "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" +msgstr "" + +#: rc.cpp:375 +#: debug/src/prefMencoder.cpp:292 +#, no-c-format +msgid "" +"pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" +msgstr "" +"liczba przebiegów\n" +"szerokoÅ›c obrazu\n" +"wysokoÅ›c obrazu\n" +"szybkoÅ›c transmisji obrazu\n" +"szybkość transmisji dźwiÄ™ku" + +#: rc.cpp:382 +#: debug/src/prefMencoder.cpp:326 +#, no-c-format +msgid "Video codecs" +msgstr "Kodeki video" + +#: rc.cpp:391 +#: debug/src/prefMencoder.cpp:300 +#, no-c-format +msgid "MJPEG" +msgstr "MJPEG" + +#: rc.cpp:394 +#: debug/src/prefMencoder.cpp:301 +#, no-c-format +msgid "LJPEG" +msgstr "LJPEG" + +#: rc.cpp:397 +#: debug/src/prefMencoder.cpp:302 +#, no-c-format +msgid "H.261" +msgstr "H.261" + +#: rc.cpp:400 +#: debug/src/prefMencoder.cpp:303 +#, no-c-format +msgid "H.263" +msgstr "H.263" + +#: rc.cpp:403 +#: debug/src/prefMencoder.cpp:304 +#, no-c-format +msgid "MPEG-4 (DivX 4/5)" +msgstr "MPEG-4 (DivX 4/5)" + +#: rc.cpp:406 +#: debug/src/prefMencoder.cpp:305 +#, no-c-format +msgid "DivX 3" +msgstr "DivX 3" + +#: rc.cpp:409 +#: debug/src/prefMencoder.cpp:306 +#, no-c-format +msgid "MS MPEG-4 v2" +msgstr "MS MPEG-4 v2" + +#: rc.cpp:412 +#: debug/src/prefMencoder.cpp:307 +#, no-c-format +msgid "WMV7" +msgstr "WMV7" + +#: rc.cpp:415 +#: debug/src/prefMencoder.cpp:308 +#, no-c-format +msgid "WMV8" +msgstr "WMV8" + +#: rc.cpp:418 +#: debug/src/prefMencoder.cpp:309 +#, no-c-format +msgid "RealVideo" +msgstr "RealVideo" + +#: rc.cpp:421 +#: debug/src/prefMencoder.cpp:310 +#, no-c-format +msgid "MPEG-1" +msgstr "MPEG-1" + +#: rc.cpp:424 +#: debug/src/prefMencoder.cpp:311 +#, no-c-format +msgid "MPEG-2" +msgstr "MPEG-2" + +#: rc.cpp:427 +#: debug/src/prefMencoder.cpp:312 +#, no-c-format +msgid "HuffYUV" +msgstr "HuffYUV" + +#: rc.cpp:430 +#: debug/src/prefMencoder.cpp:313 +#, no-c-format +msgid "ffvHuff" +msgstr "ffvHuff" + +#: rc.cpp:433 +#: debug/src/prefMencoder.cpp:314 +#, no-c-format +msgid "ASUS v1" +msgstr "ASUS v1" + +#: rc.cpp:436 +#: debug/src/prefMencoder.cpp:315 +#, no-c-format +msgid "ASUS v2" +msgstr "ASUS v2" + +#: rc.cpp:440 +#: rc.cpp:465 +#: rc.cpp:555 +#: debug/src/configDlg.cpp:42 +#: debug/src/configDlg.cpp:95 +#: debug/src/prefMencoder.cpp:317 +#: debug/src/prefMencoder.cpp:329 +#, no-c-format +msgid "label" +msgstr "Etykieta" + +#: rc.cpp:443 +#: debug/src/prefMencoder.cpp:318 +#, no-c-format +msgid "fourcc" +msgstr "fourcc" + +#: rc.cpp:446 +#: debug/src/prefMencoder.cpp:319 +#, no-c-format +msgid "first pass" +msgstr "pierwszy przebieg" + +#: rc.cpp:451 +#: debug/src/prefMencoder.cpp:322 +#, no-c-format +msgid "one pass" +msgstr "pojedynczy przebieg" + +#: rc.cpp:456 +#: debug/src/prefMencoder.cpp:325 +#, no-c-format +msgid "second pass" +msgstr "drugi przebieg" + +#: rc.cpp:459 +#: debug/src/prefMencoder.cpp:332 +#, no-c-format +msgid "Audio codecs" +msgstr "Kodeki audio" + +#: rc.cpp:462 +#: debug/src/prefMencoder.cpp:328 +#, no-c-format +msgid "New Item" +msgstr "Nowy element" + +#: rc.cpp:469 +#: debug/src/prefMencoder.cpp:331 +#, no-c-format +msgid "options" +msgstr "Opcje" + +#: rc.cpp:472 +#: debug/src/prefMencoder.cpp:333 +#, no-c-format +msgid "Available variables" +msgstr "DostÄ™pne zmienne" + +#: rc.cpp:475 +#: debug/src/titlefactor.cpp:321 +#, no-c-format +msgid "Shrink Factors" +msgstr "StopieÅ„ kompresji" + +#: rc.cpp:478 +#: debug/src/titlefactor.cpp:322 +#, no-c-format +msgid "Shrink Factor for Title %1" +msgstr "StopieÅ„ kompresji dla tytuÅ‚u %1" + +#: rc.cpp:481 +#: debug/src/titlefactor.cpp:323 +#, no-c-format +msgid "Change Factor" +msgstr "ZmieÅ„ stopieÅ„ kompresji" + +#: rc.cpp:484 +#: debug/src/titlefactor.cpp:324 +#, no-c-format +msgid "0.00" +msgstr "0.00" + +#: rc.cpp:487 +#: debug/src/playbackoptionsw.cpp:228 +#: src/k9copy.cpp:114 +#, no-c-format +msgid "DVD playback options" +msgstr "Opcje odtwarzania DVD" + +#: rc.cpp:490 +#: debug/src/playbackoptionsw.cpp:229 +#, no-c-format +msgid "&Keep original menus" +msgstr "Z&achowaj oryginalne menu" + +#: rc.cpp:498 +#: debug/src/playbackoptionsw.cpp:233 +#, no-c-format +msgid "Selected Titles" +msgstr "Wybrany TytuÅ‚y" + +#: rc.cpp:501 +#: debug/src/playbackoptionsw.cpp:234 +#, no-c-format +msgid "Default language" +msgstr "JÄ™zyk domyÅ›lny" + +#: rc.cpp:504 +#: debug/src/playbackoptionsw.cpp:235 +#, no-c-format +msgid "Subtitle" +msgstr "Napisy" + +#: rc.cpp:510 +#: debug/src/prefDVD.cpp:97 +#, no-c-format +msgid "prefDVD" +msgstr "" + +#: rc.cpp:513 +#: debug/src/prefDVD.cpp:98 +#, no-c-format +msgid "Output directory" +msgstr "Katalog docelowy" + +#: rc.cpp:516 +#: debug/src/prefDVD.cpp:99 +#, no-c-format +msgid "Burn with k3b" +msgstr "Nagraj w k3b" + +#: rc.cpp:522 +#: debug/src/prefDVD.cpp:101 +#, no-c-format +msgid "Auto burn" +msgstr "Zapis automatyczny" + +#: rc.cpp:525 +#: debug/src/prefDVD.cpp:102 +#, no-c-format +msgid "Alt+T" +msgstr "Alt+T" + +#: rc.cpp:528 +#: debug/src/prefDVD.cpp:103 +#, no-c-format +msgid "DVD size" +msgstr "Rozmiar (pojemność) DVD" + +#: rc.cpp:531 +#: debug/src/prefDVD.cpp:104 +#, no-c-format +msgid "Quick scan" +msgstr "Szybkie skanowanie" + +#: rc.cpp:534 +#: debug/src/prefDVD.cpp:105 +#, no-c-format +msgid "Alt+Q" +msgstr "Alt+Q" + +#: rc.cpp:537 +#: debug/src/prefDVD.cpp:106 +#, no-c-format +msgid "use dvdAuthor for copy without menus" +msgstr "Użyj dvdAythor by skopiować bez menu" + +#: rc.cpp:540 +#: debug/src/prefDVD.cpp:107 +#, no-c-format +msgid "Alt+D" +msgstr "Alt+D" + +#: rc.cpp:543 +#: debug/src/prefDVD.cpp:108 +#, no-c-format +msgid "Clear output directory on exit" +msgstr "Opróżnij katalog docelowy przy wyjÅ›ciu" + +#: rc.cpp:546 +#: debug/src/prefDVD.cpp:109 +#, no-c-format +msgid "Alt+Y" +msgstr "Alt+Y" + +#: rc.cpp:549 +#: debug/src/configDlg.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - UrzÄ…dzenia" + +#: rc.cpp:552 +#: debug/src/configDlg.cpp:40 +#: debug/src/configDlg.cpp:94 +#, no-c-format +msgid "device" +msgstr "NapÄ™d" + +#: rc.cpp:558 +#: debug/src/configDlg.cpp:44 +#: debug/src/configDlg.cpp:96 +#, no-c-format +msgid "Input" +msgstr "Odczyt" + +#: rc.cpp:561 +#: rc.cpp:597 +#: debug/src/configDlg.cpp:46 +#: debug/src/configDlg.cpp:97 +#: debug/k9author/import.cpp:105 +#, no-c-format +msgid "Output" +msgstr "Zapis" + +#: rc.cpp:572 +#: debug/k9Mplayer/mplayer.cpp:593 +#: src/k9settings.cpp:57 +#: src/k9copy.cpp:128 +#: src/k9copy.cpp:390 +#: k9Mplayer/k9mplayer.cpp:97 +#, no-c-format +msgid "Preview" +msgstr "PodglÄ…d" + +#: rc.cpp:578 +#: debug/k9Mplayer/mplayer.cpp:595 +#, no-c-format +msgid "Subpicture" +msgstr "Napisy" + +#: rc.cpp:585 +#: debug/k9Mplayer/mplayer.cpp:600 +#, no-c-format +msgid "-" +msgstr "-" + +#: rc.cpp:589 +#: debug/k9Mplayer/mplayer.cpp:602 +#, no-c-format +msgid "+" +msgstr "+" + +#: rc.cpp:594 +#: debug/k9author/import.cpp:104 +#, no-c-format +msgid "import" +msgstr "Importuj" + +#: rc.cpp:600 +#: debug/k9author/import.cpp:44 +#: debug/k9author/import.cpp:106 +#, no-c-format +msgid "Video files" +msgstr "Pliki wideo" + +#: rc.cpp:606 +#: debug/k9author/import.cpp:109 +#, no-c-format +msgid "PAL" +msgstr "PAL" + +#: rc.cpp:609 +#: debug/k9author/import.cpp:110 +#, no-c-format +msgid "NTSC" +msgstr "NTSC" + +#: rc.cpp:615 +#: debug/k9author/chapterEdit.cpp:145 +#: src/k9copy.cpp:211 +#: k9author/k9importfiles.cpp:34 +#, no-c-format +msgid "Chapter properties" +msgstr "WÅ‚aÅ›ciwoÅ›ci rozdziaÅ‚u" + +#: rc.cpp:618 +#: debug/k9author/chapterEdit.cpp:146 +#, no-c-format +msgid "start" +msgstr "Rozpocznij" + +#: rc.cpp:621 +#: debug/k9author/chapterEdit.cpp:147 +#, no-c-format +msgid "video" +msgstr "Wideo" + +#: rc.cpp:624 +#: debug/k9author/chapterEdit.cpp:148 +#, no-c-format +msgid "" +"*.avi\n" +"*.mpeg" +msgstr "" +"*.avi\n" +"*.mpeg" + +#: rc.cpp:628 +#: rc.cpp:643 +#: debug/k9author/chapterEdit.cpp:150 +#: debug/k9author/chapterEdit.cpp:155 +#, no-c-format +#, fuzzy +msgid "set Current Frame" +msgstr "ustaw bieżacÄ… klatkÄ™" + +#: rc.cpp:631 +#: rc.cpp:637 +#: debug/k9author/chapterEdit.cpp:151 +#: debug/k9author/chapterEdit.cpp:153 +#, no-c-format +msgid "break continuity" +msgstr "" + +#: rc.cpp:634 +#: debug/k9author/chapterEdit.cpp:152 +#, no-c-format +msgid "end" +msgstr "koniec" + +#: rc.cpp:646 +#: debug/k9author/chapterEdit.cpp:156 +#, no-c-format +msgid "set Title button" +msgstr "" + +#: rc.cpp:649 +#: debug/k9author/newTitle.cpp:124 +#: src/k9copy.cpp:204 +#: k9author/k9importfiles.cpp:40 +#: k9author/k9newtitle.cpp:55 +#, no-c-format +msgid "Add title" +msgstr "Dodaj tytuÅ‚" + +#: rc.cpp:653 +#: debug/k9author/newTitle.cpp:126 +#, no-c-format +msgid "number of chapters" +msgstr "Ilość rozdziałów" + +#: rc.cpp:656 +#: debug/k9author/newTitle.cpp:127 +#, no-c-format +msgid "chapter length" +msgstr "DÅ‚ugość rozdziaÅ‚u" + +#: rc.cpp:663 +#: debug/k9author/newTitle.cpp:130 +#, no-c-format +msgid "Video file" +msgstr "Plik wideo" + +#: rc.cpp:669 +#: debug/k9author/menuEdit.cpp:146 +#: src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +#, no-c-format +msgid "Edit Menu" +msgstr "Edytuj menu" + +#: rc.cpp:672 +#: debug/k9author/menuEdit.cpp:147 +#, no-c-format +msgid "Text" +msgstr "Tekst" + +#: rc.cpp:675 +#: debug/k9author/menuEdit.cpp:148 +#, no-c-format +msgid "Background picture" +msgstr "Obrazek tÅ‚a" + +#: rc.cpp:690 +#: debug/k9author/menuEdit.cpp:156 +#: k9author/k9menuedit.cpp:286 +#: k9author/k9import.cpp:45 +#, no-c-format +msgid "Root Menu" +msgstr "KorzeÅ„" + +#: rc.cpp:693 +#: debug/k9author/menuEdit.cpp:157 +#, no-c-format +msgid "At start" +msgstr "Na poczÄ…tku" + +#: rc.cpp:696 +#: debug/k9author/menuEdit.cpp:159 +#, no-c-format +msgid "Play menu" +msgstr "Odtwarzaj menu" + +#: rc.cpp:699 +#: rc.cpp:711 +#: debug/k9author/menuEdit.cpp:160 +#: debug/k9author/menuEdit.cpp:165 +#, no-c-format +msgid "Play title 1" +msgstr "Odtwarzaj tytuÅ‚ 1" + +#: rc.cpp:702 +#: debug/k9author/menuEdit.cpp:161 +#, no-c-format +msgid "At End" +msgstr "Na koÅ„cu" + +#: rc.cpp:705 +#: debug/k9author/menuEdit.cpp:163 +#, no-c-format +msgid "Play root menu" +msgstr "Odtrwórz korzeÅ„" + +#: rc.cpp:708 +#: debug/k9author/menuEdit.cpp:164 +#, no-c-format +msgid "Play title menu" +msgstr "Odtwarzaj menu tytułów" + +#: rc.cpp:717 +#, no-c-format +msgid "A&ctions" +msgstr "&DziaÅ‚ania" + +#: rc.cpp:720 +#, no-c-format +msgid "Actions ToolBar" +msgstr "DziaÅ‚ania: pasek narzÄ™dzi" + +#: debug/libk9copy/k9ifo2.moc.cpp:34 +#: debug/libk9copy/k9ifo2.moc.cpp:42 +msgid "k9Ifo2" +msgstr "640" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:34 +#: debug/libk9copy/k9dvdchapter.moc.cpp:42 +#, fuzzy +msgid "k9ChapterCell" +msgstr "k9KomórkaRozdziaÅ‚u" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:107 +#: debug/libk9copy/k9dvdchapter.moc.cpp:115 +#, fuzzy +msgid "k9DVDChapter" +msgstr "k9DVDRozdziaÅ‚" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 +#: debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "" + +#: debug/libk9copy/k9dvd.moc.cpp:34 +#: debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "k9DVD" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 +#: debug/libk9copy/k9dvdtitle.moc.cpp:42 +#, fuzzy +msgid "k9DVDVideoStream" +msgstr "k9DVDStrumieÅ„Video" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +#, fuzzy +msgid "k9DVDAudioStream" +msgstr "k9DVDStrumieÅ„Audio" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +#, fuzzy +msgid "k9DVDSubtitle" +msgstr "k9DVDNapisy" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +#, fuzzy +msgid "k9DVDTitle" +msgstr "k9DVDElement" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +#, fuzzy +msgid "k9DVDProgress" +msgstr "k9DVDPostÄ™p" + +#: debug/libk9copy/k9dvdtitleset.moc.cpp:34 +#: debug/libk9copy/k9dvdtitleset.moc.cpp:42 +#, fuzzy +msgid "k9DVDTitleset" +msgstr "k9DVDZestawElementów" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +#, fuzzy +msgid "k9DVDAuthor" +msgstr "k9DVDAuthor" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 +#: debug/libk9copy/k9dvdsize.moc.cpp:42 +#, fuzzy +msgid "k9DVDSize" +msgstr "k9DVDRozmiar" + +#: debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - PodglÄ…d menu" + +#: debug/src/kcddrive.moc.cpp:34 +#: debug/src/kcddrive.moc.cpp:42 +#, fuzzy +msgid "kCDDrive" +msgstr "kCDNapÄ™d" + +#: debug/src/kcddrive.moc.cpp:107 +#: debug/src/kcddrive.moc.cpp:115 +#, fuzzy +msgid "kCDDrives" +msgstr "kCDNapÄ™dy" + +#: debug/src/kviewmpeg2.moc.cpp:34 +#: debug/src/kviewmpeg2.moc.cpp:42 +msgid "k9Widget" +msgstr "" + +#: debug/src/kviewmpeg2.moc.cpp:107 +#: debug/src/kviewmpeg2.moc.cpp:115 +msgid "kViewMPEG2" +msgstr "kViewMPEG2" + +#: debug/k9Mplayer/k9mplayer.moc.cpp:34 +#: debug/k9Mplayer/k9mplayer.moc.cpp:42 +msgid "K9Mplayer" +msgstr "" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "" + +#: libk9copy/k9dvd.cpp:133 +msgid "for visually impaired" +msgstr "" + +#: libk9copy/k9dvd.cpp:134 +msgid "director's comments" +msgstr "Komentarze reżysera" + +#: libk9copy/k9dvd.cpp:135 +msgid "alternate director's comments" +msgstr "Alternatywne komentarze reżysera" + +#: libk9copy/k9dvd.cpp:139 +msgid "Large" +msgstr "Duży" + +#: libk9copy/k9dvd.cpp:140 +msgid "Children" +msgstr "Dzieci" + +#: libk9copy/k9dvd.cpp:141 +#: libk9copy/k9dvd.cpp:147 +#: libk9copy/k9dvd.cpp:148 +#: libk9copy/k9dvd.cpp:149 +msgid "reserved" +msgstr "Zarezerwowany" + +#: libk9copy/k9dvd.cpp:142 +#, fuzzy +msgid "Normal captions" +msgstr "Normalne nagłówki" + +#: libk9copy/k9dvd.cpp:143 +msgid "Large captions" +msgstr "Duże nagłówki" + +#: libk9copy/k9dvd.cpp:144 +#, fuzzy +msgid "Children captions" +msgstr "Napisy dla dzieci" + +#: libk9copy/k9dvd.cpp:146 +msgid "Forced" +msgstr "Wymuszony" + +#: libk9copy/k9dvd.cpp:150 +msgid "Director's comments" +msgstr "Komentarze reżysera" + +#: libk9copy/k9dvd.cpp:151 +msgid "Large director's comments" +msgstr "" + +#: libk9copy/k9dvd.cpp:152 +msgid "Director's comments for children" +msgstr "Komentarze reżysera dla dzieci" + +#: libk9copy/k9dvd.cpp:189 +msgid "Couldn't open %1 for title\n" +msgstr "Nie mogÄ™ otworzyć %1 dla tytuÅ‚u\n" + +#: libk9copy/k9dvd.cpp:191 +#: libk9copy/k9dvd.cpp:199 +#: libk9copy/k9dvd.cpp:207 +#: libk9copy/k9dvd.cpp:368 +#: src/k9main.cpp:563 +msgid "unknown" +msgstr "Nieznane" + +#: libk9copy/k9dvd.cpp:197 +msgid "Couldn't seek in %1 for title\n" +msgstr "Nie mogÄ™ przeszukać %1 w tytule tytuÅ‚u\n" + +#: libk9copy/k9dvd.cpp:224 +msgid "Not Specified" +msgstr "NieokreÅ›lony" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afar" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Abkhazian" +msgstr "Abhazki" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afrikaans" +msgstr "Afrikaans" + +#: libk9copy/k9dvd.cpp:224 +msgid "Amharic" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Arabic" +msgstr "Arabski" + +#: libk9copy/k9dvd.cpp:225 +msgid "Assamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Aymara" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Azerbaijani" +msgstr "Azerski" + +#: libk9copy/k9dvd.cpp:225 +msgid "Bashkir" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Byelorussian" +msgstr "BiaÅ‚oruski" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bulgarian" +msgstr "BuÅ‚garski" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bihari" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bislama" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bengali; Bangla" +msgstr "Bengalski" + +#: libk9copy/k9dvd.cpp:227 +msgid "Tibetan" +msgstr "TybetaÅ„ski" + +#: libk9copy/k9dvd.cpp:227 +msgid "Breton" +msgstr "BretoÅ„ski" + +#: libk9copy/k9dvd.cpp:227 +msgid "Catalan" +msgstr "KataloÅ„ski" + +#: libk9copy/k9dvd.cpp:227 +msgid "Corsican" +msgstr "KoryskaÅ„ski" + +#: libk9copy/k9dvd.cpp:227 +msgid "Czech" +msgstr "Czeski" + +#: libk9copy/k9dvd.cpp:228 +msgid "Welsh" +msgstr "Walijski" + +#: libk9copy/k9dvd.cpp:228 +msgid "Dansk" +msgstr "DuÅ„ski" + +#: libk9copy/k9dvd.cpp:228 +msgid "Deutsch" +msgstr "Niemiecki" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Greek" +msgstr "Grecki" + +#: libk9copy/k9dvd.cpp:228 +msgid "English" +msgstr "Angielski" + +#: libk9copy/k9dvd.cpp:229 +msgid "Esperanto" +msgstr "Esperanto" + +#: libk9copy/k9dvd.cpp:229 +msgid "Espanol" +msgstr "HiszpaÅ„ski" + +#: libk9copy/k9dvd.cpp:229 +msgid "Estonian" +msgstr "EstoÅ„ski" + +#: libk9copy/k9dvd.cpp:229 +msgid "Basque" +msgstr "Baskijski" + +#: libk9copy/k9dvd.cpp:229 +msgid "Persian" +msgstr "Perski" + +#: libk9copy/k9dvd.cpp:230 +msgid "Suomi" +msgstr "FiÅ„ski" + +#: libk9copy/k9dvd.cpp:230 +msgid "Fiji" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Faroese" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Francais" +msgstr "Francuski" + +#: libk9copy/k9dvd.cpp:230 +msgid "Frisian" +msgstr "Fryzyski" + +#: libk9copy/k9dvd.cpp:230 +msgid "Gaelic" +msgstr "Galijski" + +#: libk9copy/k9dvd.cpp:231 +msgid "Scots Gaelic" +msgstr "Szkocki" + +#: libk9copy/k9dvd.cpp:231 +msgid "Galician" +msgstr "Galicyjski (HiszpaÅ„ski)" + +#: libk9copy/k9dvd.cpp:231 +msgid "Guarani" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Gujarati" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Hausa" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +#: libk9copy/k9dvd.cpp:234 +msgid "Hebrew" +msgstr "Hebrajski" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hindi" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hrvatski" +msgstr "Chorwacki" + +#: libk9copy/k9dvd.cpp:232 +msgid "Magyar" +msgstr "WÄ™gierski" + +#: libk9copy/k9dvd.cpp:232 +msgid "Armenian" +msgstr "ArmeÅ„ski" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingua" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Indonesian" +msgstr "Indonezyjski" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingue" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Italiano" +msgstr "WÅ‚oski" + +#: libk9copy/k9dvd.cpp:234 +msgid "Inuktitut" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Japanese" +msgstr "JapoÅ„ski" + +#: libk9copy/k9dvd.cpp:235 +#: libk9copy/k9dvd.cpp:250 +#, fuzzy +msgid "Yiddish" +msgstr "Yiddish" + +#: libk9copy/k9dvd.cpp:235 +#, fuzzy +msgid "Javanese" +msgstr "Jawajski" + +#: libk9copy/k9dvd.cpp:235 +#, fuzzy +msgid "Georgian" +msgstr "GruźiÅ„ski" + +#: libk9copy/k9dvd.cpp:235 +msgid "Kazakh" +msgstr "Kazachski" + +#: libk9copy/k9dvd.cpp:235 +msgid "Greenlandic" +msgstr "Grenlandzki" + +#: libk9copy/k9dvd.cpp:236 +msgid "Cambodian" +msgstr "KambodżaÅ„ski" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kannada" +msgstr "Kanadyjski" + +#: libk9copy/k9dvd.cpp:236 +msgid "Korean" +msgstr "KoreaÅ„ski" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kashmiri" +msgstr "Kaszmirski" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kurdish" +msgstr "Kurdyjski" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kirghiz" +msgstr "Kirgizki" + +#: libk9copy/k9dvd.cpp:237 +msgid "Latin" +msgstr "Åacina" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lingala" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lithuanian" +msgstr "Litewski" + +#: libk9copy/k9dvd.cpp:238 +msgid "Latvian, Lettish" +msgstr "Åotewski" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Maori" +msgstr "Maoryski" + +#: libk9copy/k9dvd.cpp:238 +msgid "Macedonian" +msgstr "MacedoÅ„ski" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Mongolian" +msgstr "Mongolski" + +#: libk9copy/k9dvd.cpp:239 +msgid "Moldavian" +msgstr "MoÅ‚dawski" + +#: libk9copy/k9dvd.cpp:239 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Malay" +msgstr "Malajski" + +#: libk9copy/k9dvd.cpp:239 +msgid "Maltese" +msgstr "MaltaÅ„ski" + +#: libk9copy/k9dvd.cpp:240 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nepali" +msgstr "Nepalski" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nederlands" +msgstr "Holenderski" + +#: libk9copy/k9dvd.cpp:240 +msgid "Norsk" +msgstr "Norweski" + +#: libk9copy/k9dvd.cpp:240 +msgid "Occitan" +msgstr "OksytaÅ„ski" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Polish" +msgstr "Polski" + +#: libk9copy/k9dvd.cpp:241 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Portugues" +msgstr "Portugalski" + +#: libk9copy/k9dvd.cpp:242 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Romanian" +msgstr "RumuÅ„ski" + +#: libk9copy/k9dvd.cpp:243 +msgid "Russian" +msgstr "Rosykski" + +#: libk9copy/k9dvd.cpp:243 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sanskrit" +msgstr "Sanskryt" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Serbo-Croatian" +msgstr "Serbsko-Chorwacki" + +#: libk9copy/k9dvd.cpp:244 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovak" +msgstr "SÅ‚owacki" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovenian" +msgstr "SÅ‚oweÅ„ski" + +#: libk9copy/k9dvd.cpp:244 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Albanian" +msgstr "AlbaÅ„ski" + +#: libk9copy/k9dvd.cpp:245 +msgid "Serbian" +msgstr "Serbski" + +#: libk9copy/k9dvd.cpp:245 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Svenska" +msgstr "Szwedzki" + +#: libk9copy/k9dvd.cpp:246 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Tamil" +msgstr "Tamilski" + +#: libk9copy/k9dvd.cpp:247 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tajik" +msgstr "Tadżycki" + +#: libk9copy/k9dvd.cpp:247 +msgid "Thai" +msgstr "Tajski" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Turkish" +msgstr "Turecki" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tatar" +msgstr "Tatarski" + +#: libk9copy/k9dvd.cpp:248 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Ukrainian" +msgstr "UkraiÅ„ski" + +#: libk9copy/k9dvd.cpp:249 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uzbek" +msgstr "Uzbecki" + +#: libk9copy/k9dvd.cpp:249 +msgid "Vietnamese" +msgstr "Wietnamski" + +#: libk9copy/k9dvd.cpp:250 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Chinese" +msgstr "ChiÅ„ski" + +#: libk9copy/k9dvd.cpp:251 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +#: libk9copy/k9dvd.cpp:252 +#: libk9copy/k9dvd.cpp:475 +msgid "Unknown" +msgstr "Nieznane" + +#: libk9copy/k9dvd.cpp:342 +msgid "Can't open disc %1!\n" +msgstr "Nie można odczytać pÅ‚yty %1!\n" + +#: libk9copy/k9dvd.cpp:354 +msgid "Can't open main ifo!\n" +msgstr "Nie można otworzyć głównego pliku IFO\n" + +#: libk9copy/k9dvd.cpp:396 +#: libk9copy/k9dvd.cpp:691 +msgid "Title %1" +msgstr "TytuÅ‚ %1" + +#: libk9copy/k9dvd.cpp:742 +msgid "reading title" +msgstr "Odczytywanie tytuÅ‚u" + +#: libk9copy/k9dvd.cpp:859 +msgid "Error opening vobs for title %1\n" +msgstr "BÅ‚Ä…d otwarcia plików vob dla tytuÅ‚u %1\n" + +#: libk9copy/k9dvd.cpp:870 +msgid "ERROR reading block %1\n" +msgstr "BÅ‚Ä…d odczytu bloku %1\n" + +#: libk9copy/k9dvdauthor.cpp:148 +#: libk9copy/k9dvdauthor.cpp:366 +msgid "'%1' not selected" +msgstr "'%1' nie wybrane" + +#: libk9copy/k9dvdauthor.cpp:149 +#: libk9copy/k9dvdauthor.cpp:367 +#: libk9copy/k9dvdauthor.cpp:390 +#: libk9copy/k9dvdauthor.cpp:436 +#: libk9copy/k9dvdauthor.cpp:445 +#: libk9copy/k9dvdauthor.cpp:448 +#: libk9copy/k9burndvd.cpp:237 +#: libk9copy/k9burndvd.cpp:321 +#: k9author/k9newdvd.cpp:122 +#, fuzzy +msgid "authoring" +msgstr "authoring" + +#: libk9copy/k9dvdauthor.cpp:390 +#: libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:309 +#: k9Mplayer/k9mplayer.cpp:97 +msgid "Unable to run %1" +msgstr "Nie można uruchomić %1" + +#: libk9copy/k9dvdauthor.cpp:403 +#: libk9copy/k9dvdauthor.cpp:476 +#: libk9copy/k9dvdauthor.cpp:514 +#: src/k9settings.cpp:63 +#: k9author/k9newdvd.cpp:143 +msgid "Authoring" +msgstr "Authoring" + +#: libk9copy/k9dvdauthor.cpp:436 +msgid "Dvdauthor error :\n" +msgstr "BÅ‚Ä…d programu DVDauthor:\n" + +#: libk9copy/k9dvdauthor.cpp:445 +msgid "Authoring cancelled" +msgstr "Authoring przerwany" + +#: libk9copy/k9dvdauthor.cpp:448 +#: k9author/k9newdvd.cpp:136 +msgid "An error occured while running DVDAuthor:\n" +msgstr "WystÄ…piÅ‚ bÅ‚Ä…d podczas pracy programu DVDAuthor:\n" + +#: libk9copy/k9dvdauthor.cpp:515 +msgid "Fixing VOBUS" +msgstr "Naprawa VOBUS" + +#: libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9mp4enc.cpp:312 +msgid "Encoding error" +msgstr "BÅ‚Ä…d kodowania" + +#: libk9copy/k9mp4enc.cpp:152 +#: src/k9main.cpp:1155 +msgid "Save file to disk" +msgstr "Zapisz plik na dysku" + +#: libk9copy/k9mp4enc.cpp:161 +#: libk9copy/k9mp4enc.cpp:350 +#: src/k9prefmpeg4.cpp:34 +#: src/k9mp4title.cpp:49 +#: src/k9main.cpp:290 +#: src/k9main.cpp:300 +#: src/k9main.cpp:310 +#: src/k9main.cpp:330 +#: src/k9main.cpp:588 +#: src/k9main.cpp:689 +#: src/k9main.cpp:703 +#: src/k9prefdvd.cpp:35 +msgid "MB" +msgstr "MB" + +#: libk9copy/k9mp4enc.cpp:233 +#: libk9copy/k9mp4enc.cpp:235 +#: k9author/k9newdvd.cpp:247 +msgid "Encoding %1" +msgstr "Kodowanie %1" + +#: libk9copy/k9mp4enc.cpp:233 +msgid "pass %1" +msgstr "przebieg %1" + +#: libk9copy/k9mp4enc.cpp:309 +msgid "MPEG-4 Encoding cancelled" +msgstr "Kodowanie MPEG-4 anulowane" + +#: libk9copy/k9mp4enc.cpp:309 +#: src/k9settings.cpp:48 +#: src/k9main.cpp:1141 +msgid "MPEG-4 Encoding" +msgstr "Kodowanie MPEG-4" + +#: libk9copy/k9mp4enc.cpp:312 +msgid "Error while running mencoder :" +msgstr "BÅ‚Ä…d programu mencoder:" + +#: libk9copy/k9burndvd.cpp:188 +#: libk9copy/k9burndvd.cpp:255 +#, fuzzy +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - Wypalanie DVD" + +#: libk9copy/k9burndvd.cpp:189 +#: libk9copy/k9burndvd.cpp:256 +#: libk9copy/k9burndvd.cpp:348 +#: src/k9main.cpp:435 +msgid "Burning DVD" +msgstr "Nagrywanie DVD" + +#: libk9copy/k9burndvd.cpp:200 +#: libk9copy/k9burndvd.cpp:284 +#: src/k9main.cpp:384 +#: k9author/k9import.cpp:178 +msgid "Save image to disk" +msgstr "Zapisz obraz na dysk" + +#: libk9copy/k9burndvd.cpp:215 +#: libk9copy/k9burndvd.cpp:302 +msgid "Insert a recordable DVD" +msgstr "Włóż pustÄ… pÅ‚ytÄ™ DVD" + +#: libk9copy/k9burndvd.cpp:215 +#: libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:230 +#: libk9copy/k9burndvd.cpp:303 +#: libk9copy/k9burndvd.cpp:309 +#: libk9copy/k9burndvd.cpp:314 +msgid "DVD burning" +msgstr "Nagrywanie DVD" + +#: libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:309 +msgid "Error burning DVD :\n" +msgstr "BÅ‚Ä…d zapisu DVD:\n" + +#: libk9copy/k9burndvd.cpp:230 +#: libk9copy/k9burndvd.cpp:314 +msgid "DVD Burning finished" +msgstr "Nagrywanie DVD zakoÅ„czone" + +#: libk9copy/k9burndvd.cpp:236 +#: libk9copy/k9burndvd.cpp:320 +msgid "An error occured while Burning DVD: %1" +msgstr "BÅ‚Ä…d w trakcie nagrywania DVD: %1" + +#: libk9copy/k9burndvd.cpp:236 +#: libk9copy/k9burndvd.cpp:320 +msgid "Insert an other DVD" +msgstr "Włóż innÄ… pÅ‚ytÄ™ DVD" + +#: libk9copy/k9burndvd.cpp:349 +msgid "Current write speed :%1 x" +msgstr "Aktualna prÄ™dkość zapisu :%1 x" + +#: libk9copy/k9dvdbackup.cpp:149 +#: libk9copy/k9dvdbackup.cpp:163 +#: libk9copy/k9dvdbackup.cpp:513 +#: libk9copy/k9dvdbackup.cpp:599 +msgid "DVD backup cancelled" +msgstr "Kopiowanie DVD przerwane" + +#: libk9copy/k9dvdbackup.cpp:176 +msgid "unable to open VIDEO_TS.IFO" +msgstr "Nie można otworzyć VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:198 +#: libk9copy/k9dvdbackup.cpp:381 +#: libk9copy/k9dvdbackup.cpp:446 +msgid "Unable to open file " +msgstr "Nie można otworzyć pliku " + +#: libk9copy/k9dvdbackup.cpp:277 +msgid "Unable to open titleset %1" +msgstr "Nie można otworzyć tytułów %1" + +#: libk9copy/k9dvdbackup.cpp:283 +#: libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting titleset %1" +msgstr "Zgrywanie %1 tytułów" + +#: libk9copy/k9dvdbackup.cpp:453 +msgid "Unable to open menu for titleset %1" +msgstr "Nie można otworzyć menu dla tytułów %1" + +#: libk9copy/k9dvdbackup.cpp:479 +msgid "Extracting menu for titleset %1" +msgstr "Zgrywanie menu dla tytułów %1" + +#: libk9copy/k9dvdbackup.cpp:563 +msgid "Unable to open ifo file for titleset %1" +msgstr "Nie można otworzyć pliku ifo dla tytułów %1" + +#: libk9copy/k9dvdbackup.cpp:575 +#: libk9copy/k9dvdbackup.cpp:1694 +msgid "Unable to open DVD" +msgstr "Nie można otworzyć DVD" + +#: libk9copy/k9dvdbackup.cpp:585 +msgid "Unable to open vobs for titleset %1" +msgstr "Nie można otworzyć plików vob dla tytułów %1" + +#: libk9copy/k9dvdbackup.cpp:1381 +msgid "Updating vob %1" +msgstr "Aktualizacja pliku vob %1" + +#: libk9copy/k9dvdbackup.cpp:1398 +msgid "DVD backup canceled" +msgstr "Kopiowanie DVD anulowane" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "UrzÄ…dzenia" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "UrzÄ…dzenia nie wykryte przez k9copy" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 +#: src/k9copy.cpp:294 +msgid "DVD Backup" +msgstr "Kopia zapasowa DVD" + +#: src/k9settings.cpp:42 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:42 +msgid "MPEG-4 Codecs" +msgstr "Kodeki MPEG-4" + +#: src/k9settings.cpp:48 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:57 +msgid "Title preview" +msgstr "PodglÄ…d tytuÅ‚u" + +#: src/k9mp4title.cpp:36 +#: src/k9mp4title.cpp:109 +#: src/k9titlefactor.cpp:99 +msgid "Select a Title in the treeview..." +msgstr "Wybierz tytuÅ‚ w widoku drzewa..." + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "NarzÄ™dzie do kopiowania pÅ‚yt DVD Video dla Å›rodowiska KDE" + +#: src/main.cpp:39 +msgid "output device" +msgstr "urzÄ…dzenie wyjÅ›ciowe" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "tytuÅ‚ do odtwarzania" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "Odtwarzaj element na stdout" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "Sektor poczÄ…tkowy" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "Sektor koÅ„cowy" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "Lista strumieni audio" + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "Lista strumieni spu" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "StopieÅ„ kompresji" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "Wymuszony stopieÅ„ kompresji" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "Rozmiar komórki do skopiowania" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "ÅÄ…czny rozmiar wybranych elementów" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "Rozmiar kopiowanych rozdziałów" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "Wybrane rozdziaÅ‚y" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "Nowy rozmiar DVD" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "Wybrane rozdziaÅ‚y" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "Ilość komórek w wybranym rozdziale" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "Status nazwy pliku" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "Inicjowanie statusu pliku" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "Kontynuuj odtwarzanie od ostatniego sektoru" + +#: src/main.cpp:58 +#, fuzzy +msgid "don't save status at end" +msgstr "Nie zapisuj statusu na koÅ„cu" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "Zapisz komórkÄ™ w katalogu tymczasowym przed rozpoczÄ™ciem kodowania" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:69 +msgid "" +"_: NAME OF TRANSLATORS\\n" +"Your names" +msgstr "" +"Wojciech Nawrocki\n " +"Tomasz ArgasiÅ„ski" + +#: src/main.cpp:70 +msgid "" +"_: EMAIL OF TRANSLATORS\\n" +"Your emails" +msgstr "" +"wojtasin@o2.pl\n " +"targasinski@o2.pl" + +#: src/k9prefmencoder.cpp:105 +#: src/k9prefmencoder.cpp:109 +#: src/k9prefmencoder.cpp:120 +#: src/k9prefmencoder.cpp:122 +msgid "new profile" +msgstr "Nowy profil" + +#: src/k9copy.cpp:137 +msgid "Shrink Factor" +msgstr "StopieÅ„ kompresji" + +#: src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +msgid "Edit menu" +msgstr "Edytuj menu" + +#: src/k9copy.cpp:263 +msgid "Play title" +msgstr "Odtwarzaj tytuÅ‚" + +#: src/k9copy.cpp:279 +msgid "Create MPEG-4" +msgstr "Utwórz MPEG-4" + +#: src/k9copy.cpp:286 +msgid "Eject" +msgstr "WysuÅ„" + +#: src/k9copy.cpp:300 +msgid "DVD Author" +msgstr "DVD Author" + +#: src/k9copy.cpp:306 +msgid "Create DVD" +msgstr "Utwórz DVD" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding options" +msgstr "Ustawienia kodowania MPEG-4" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding Options" +msgstr "Ustawienia kodowania MPEG-4" + +#: src/k9copy.cpp:375 +msgid "Settings" +msgstr "Ustawienia" + +#: src/k9langselect.cpp:90 +msgid "Subtitles" +msgstr "Napisy " + +#: src/k9main.cpp:373 +#: src/k9main.cpp:1141 +msgid "DVD is not opened" +msgstr "DVD nie jest otwarte" + +#: src/k9main.cpp:373 +#: src/k9main.cpp:395 +msgid "DVD Copy" +msgstr "Kopiowa DVD" + +#: src/k9main.cpp:395 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"NiewystarczajÄ…ca ilość miejsca na urzÄ…dzeniu %1\n" +"Wymagane %2 mb." + +#: src/k9main.cpp:399 +msgid "Backup in progress" +msgstr "Trwa tworzenie kopii" + +#: src/k9main.cpp:459 +#: src/k9main.cpp:608 +#: src/k9main.cpp:1194 +msgid "Ready" +msgstr "Gotowy" + +#: src/k9main.cpp:464 +#: k9author/k9import.cpp:156 +msgid "processing" +msgstr "przetwarzanie" + +#: src/k9main.cpp:499 +#: src/k9main.cpp:1247 +#: k9author/k9import.cpp:63 +msgid "ISO Image" +msgstr "Obraz ISO" + +#: src/k9main.cpp:560 +msgid "Open DVD" +msgstr "Otwórz DVD" + +#: src/k9main.cpp:586 +msgid "Titleset %1" +msgstr "TytuÅ‚y %1" + +#: src/k9main.cpp:636 +msgid "chapters" +msgstr "RozdziaÅ‚y" + +#: src/k9main.cpp:644 +#: src/k9main.cpp:657 +#: k9author/k9newtitle.cpp:117 +#: k9author/k9newtitle.cpp:139 +msgid "chapter %1" +msgstr "RozdziaÅ‚ %1" + +#: src/k9main.cpp:645 +#: src/k9main.cpp:660 +#: src/k9main.cpp:719 +#: src/k9main.cpp:737 +msgid "%1 MB" +msgstr "%1 MB" + +#: src/k9main.cpp:699 +msgid "video %1 " +msgstr "Wideo %1 " + +#: src/k9main.cpp:710 +msgid "audio %1 " +msgstr "Audio %1 " + +#: src/k9main.cpp:730 +msgid "subpicture %1 " +msgstr "Napisy %1 " + +#: src/k9main.cpp:1149 +msgid "Transcoding title : %1" +msgstr "Przetwarzanie tytuÅ‚u: %1" + +#: src/k9main.cpp:1248 +#: k9author/k9import.cpp:64 +msgid "Folder" +msgstr "Katalog" + +#: src/k9main.cpp:1355 +msgid "Open ISO Image" +msgstr "Otwórz obraz ISO" + +#: src/k9main.cpp:1366 +msgid "Open DVD folder" +msgstr "Otwórz katalog z zawartoÅ›ciÄ… DVD" + +#: src/k9mencodercmdgen.cpp:103 +msgid "Filters" +msgstr "Filtry" + +#: src/k9playbackoptions.cpp:149 +msgid "none" +msgstr "żaden" + +#: src/k9titlefactor.cpp:110 +msgid "Shrink Factor for %1" +msgstr "StopieÅ„ kompresji dla %1" + +#: k9author/k9newdvd.cpp:94 +#, fuzzy +msgid "Creating root menu" +msgstr "Tworzenie menu korzenia" + +#: k9author/k9newdvd.cpp:134 +msgid "The dvd authoring was canceled" +msgstr "Authoring DVD zostaÅ‚ anulowany" + +#: k9author/k9newdvd.cpp:160 +msgid "Creating menu for title %1" +msgstr "Tworzenie menu dla tytuÅ‚u %1" + +#: k9author/k9newdvd.cpp:381 +#: k9author/k9newtitle.cpp:63 +msgid "title %1" +msgstr "TytuÅ‚ %1" + +#: k9author/k9avidecode.cpp:31 +#: k9author/k9avidecode.cpp:35 +msgid "Cannot open then library %1" +msgstr "" + +#: k9author/k9avidecode.cpp:88 +msgid "Couldn't open the file %1" +msgstr "Nie można otworzyć pliku %1" + +#: k9author/k9avidecode.cpp:93 +msgid "Couldn't find stream information" +msgstr "Nie można odnaleźć informacji o strumieniu" + +#: k9author/k9avidecode.cpp:106 +msgid "The file doesn't contain any video stream" +msgstr "Plik nie zawiera żadnego strumienia wideo" + +#: k9author/k9avidecode.cpp:117 +msgid "Unsupported codec" +msgstr "Niewpsierany kodek" + +#: k9author/k9avidecode.cpp:122 +msgid "Could'nt open the codec" +msgstr "Nie można otworzyć kodeka" + +#: k9author/k9avidecode.cpp:133 +msgid "Unable to allocate memory for frames" +msgstr "Nie można przydzielić pamiÄ™ci dla ramek" + +#: k9author/k9menuedit.cpp:245 +msgid "Title %1 Menu" +msgstr "Menu tytuÅ‚u %1" + +#: k9author/k9menuedit.cpp:254 +#: k9author/k9menuedit.cpp:291 +msgid "Play Menu" +msgstr "Odtwarzaj menu" + +#: k9author/k9menuedit.cpp:256 +msgid "Play Title" +msgstr "Odtwarzaj tytuÅ‚" + +#: k9author/k9menuedit.cpp:262 +msgid "Play Root Menu" +msgstr "" + +#: k9author/k9menuedit.cpp:264 +msgid "Play Title Menu" +msgstr "Odtwarzaj menu tytuÅ‚u" + +#: k9author/k9menuedit.cpp:269 +#: k9author/k9menuedit.cpp:295 +msgid "Play Title %1" +msgstr "Odtwarzaj tytuÅ‚" + +#: k9author/k9importfiles.cpp:24 +msgid "Create new DVD" +msgstr "Stwórz nowe DVD" + diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 0000000..c6d75de --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,2190 @@ +# translation of k9copy-pt_BR.po to Português do Brasil +# translation of pt_BR.po to +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Fabio S Monteiro , 2005, 2006. +# Phantom X , 2006, 2007. +msgid "" +msgstr "" +"Project-Id-Version: k9copy-pt_BR\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-10-14 09:03+0200\n" +"PO-Revision-Date: 2007-11-09 02:06-0200\n" +"Last-Translator: Phantom X \n" +"Language-Team: Português do Brasil \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: rc.cpp:3 debug/libk9copy/backupdlg.cpp:156 libk9copy/k9dvdauthor.cpp:404 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Progresso da Cópia " + +#: rc.cpp:6 debug/libk9copy/backupdlg.cpp:157 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

Backup do DVD

" + +#: rc.cpp:9 debug/libk9copy/backupdlg.cpp:158 +#, no-c-format +msgid "Current step" +msgstr "Passo atual" + +#: rc.cpp:12 rc.cpp:47 rc.cpp:65 debug/libk9copy/backupdlg.cpp:159 +#: debug/libk9copy/mp4dlg.cpp:148 debug/libk9copy/progress.cpp:116 +#, no-c-format +msgid "Elapsed Time" +msgstr "Tempo Decorrido" + +#: rc.cpp:15 rc.cpp:612 rc.cpp:640 rc.cpp:666 +#: debug/libk9copy/backupdlg.cpp:160 debug/k9author/newTitle.cpp:131 +#: debug/k9author/chapterEdit.cpp:154 debug/k9author/import.cpp:111 +#, no-c-format +msgid "--:--:--" +msgstr "" + +#: rc.cpp:19 debug/libk9copy/dvdprogress.cpp:92 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - Analisando DVD" + +#: rc.cpp:25 debug/libk9copy/processList.cpp:68 +#, no-c-format +msgid "Process List" +msgstr "Lista de processo" + +#: rc.cpp:28 debug/libk9copy/processList.cpp:33 +#: debug/libk9copy/processList.cpp:69 +#, no-c-format +msgid "Processes" +msgstr "Processos" + +#: rc.cpp:31 debug/libk9copy/processList.cpp:34 +#: debug/libk9copy/processList.cpp:70 +#, no-c-format +msgid "Elapsed" +msgstr "Decorrido" + +#: rc.cpp:34 rc.cpp:603 debug/libk9copy/processList.cpp:35 +#: debug/libk9copy/processList.cpp:71 debug/k9author/import.cpp:46 +#: debug/k9author/import.cpp:107 +#, no-c-format +msgid "..." +msgstr "" + +#: rc.cpp:40 debug/libk9copy/processList.cpp:73 debug/src/progress.cpp:81 +#, no-c-format +msgid "Alt+C" +msgstr "" + +#: rc.cpp:43 debug/libk9copy/progress.cpp:114 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 +#, no-c-format +msgid "k9Copy" +msgstr "" + +#: rc.cpp:52 debug/libk9copy/mp4dlg.cpp:141 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - transcodificando" + +#: rc.cpp:55 debug/libk9copy/mp4dlg.cpp:142 +#, no-c-format +msgid "Encoding" +msgstr "Codificação" + +#: rc.cpp:62 debug/libk9copy/mp4dlg.cpp:147 k9author/k9newdvd.cpp:344 +#, no-c-format +msgid "fps" +msgstr "" + +#: rc.cpp:68 rc.cpp:154 rc.cpp:181 rc.cpp:284 debug/libk9copy/mp4dlg.cpp:149 +#: debug/src/prefAuthor.cpp:147 debug/src/prefMPEG4.cpp:337 +#: debug/src/prefMPEG4.cpp:347 +#, no-c-format +msgid "Bitrate" +msgstr "Bitrate" + +#: rc.cpp:71 rc.cpp:215 rc.cpp:232 debug/libk9copy/mp4dlg.cpp:150 +#: debug/src/k9mainw.cpp:66 debug/src/k9mainw.cpp:161 +#, no-c-format +msgid "Size" +msgstr "Tamanho" + +#: rc.cpp:74 debug/src/mencoderCmdGen.cpp:98 src/k9mencodercmdgen.cpp:55 +#, no-c-format +msgid "MEncoder options" +msgstr "Opções do MEncoder" + +#: rc.cpp:78 debug/src/mencoderCmdGen.cpp:108 src/k9mencodercmdgen.cpp:68 +#, no-c-format +msgid "Audio Codec" +msgstr "Codec de áudio" + +#: rc.cpp:81 rc.cpp:169 debug/src/prefMPEG4.cpp:343 +#: debug/src/mencoderCmdGen.cpp:104 +#, no-c-format +msgid "faac" +msgstr "" + +#: rc.cpp:84 rc.cpp:96 debug/src/mencoderCmdGen.cpp:107 +#: debug/src/mencoderCmdGen.cpp:119 +#, no-c-format +msgid "lavc" +msgstr "" + +#: rc.cpp:87 debug/src/mencoderCmdGen.cpp:120 src/k9mencodercmdgen.cpp:84 +#, no-c-format +msgid "Video Codec" +msgstr "Codec de vídeo" + +#: rc.cpp:90 rc.cpp:121 rc.cpp:388 debug/src/prefMPEG4.cpp:323 +#: debug/src/prefMencoder.cpp:299 debug/src/mencoderCmdGen.cpp:113 +#, no-c-format +msgid "x264" +msgstr "" + +#: rc.cpp:93 debug/src/mencoderCmdGen.cpp:116 +#, no-c-format +msgid "xvid" +msgstr "" + +#: rc.cpp:99 rc.cpp:313 rc.cpp:365 debug/src/prefMPEG4.cpp:315 +#: debug/src/prefMencoder.cpp:286 debug/src/prefpreview.cpp:140 +#, no-c-format +msgid "Form1" +msgstr "" + +#: rc.cpp:103 debug/src/prefMPEG4.cpp:339 +#, no-c-format +msgid "Video" +msgstr "Vídeo" + +#: rc.cpp:106 debug/src/prefMPEG4.cpp:317 +#, no-c-format +msgid "2 pass" +msgstr "" + +#: rc.cpp:109 debug/src/prefMPEG4.cpp:318 +#, no-c-format +msgid "Alt+2" +msgstr "" + +#: rc.cpp:112 rc.cpp:163 debug/src/prefMPEG4.cpp:319 +#: debug/src/prefMPEG4.cpp:340 +#, no-c-format +msgid "Codec" +msgstr "" + +#: rc.cpp:115 rc.cpp:385 debug/src/prefMPEG4.cpp:321 +#: debug/src/prefMencoder.cpp:298 +#, no-c-format +msgid "XviD" +msgstr "" + +#: rc.cpp:118 debug/src/prefMPEG4.cpp:322 +#, no-c-format +msgid "lavc MPEG4" +msgstr "" + +#: rc.cpp:130 debug/src/prefMPEG4.cpp:327 +#, no-c-format +msgid "640" +msgstr "" + +#: rc.cpp:134 debug/src/prefMPEG4.cpp:329 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "&Manter aspecto" + +#: rc.cpp:137 rc.cpp:493 debug/src/playbackoptionsw.cpp:230 +#: debug/src/prefMPEG4.cpp:330 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+M" + +#: rc.cpp:141 rc.cpp:206 rc.cpp:238 debug/src/prefMPEG4.cpp:332 +#: debug/src/k9mainw.cpp:163 +#, no-c-format +msgid "X" +msgstr "" + +#: rc.cpp:145 debug/src/prefMPEG4.cpp:334 +#, no-c-format +msgid "File size" +msgstr "Tamanho de arquivo" + +#: rc.cpp:148 debug/src/prefMPEG4.cpp:335 +#, no-c-format +msgid "Alt+S" +msgstr "" + +#: rc.cpp:151 debug/src/prefMPEG4.cpp:336 +#, no-c-format +msgid " MB" +msgstr "" + +#: rc.cpp:157 rc.cpp:519 debug/src/prefMPEG4.cpp:338 debug/src/prefDVD.cpp:100 +#, no-c-format +msgid "Alt+B" +msgstr "" + +#: rc.cpp:160 rc.cpp:263 rc.cpp:507 rc.cpp:575 +#: debug/src/playbackoptionsw.cpp:236 debug/src/prefAuthor.cpp:138 +#: debug/src/prefMPEG4.cpp:350 debug/k9Mplayer/mplayer.cpp:594 +#: src/k9langselect.cpp:79 +#, no-c-format +msgid "Audio" +msgstr "Ãudio" + +#: rc.cpp:166 debug/src/prefMPEG4.cpp:342 +#, no-c-format +msgid "mp3" +msgstr "" + +#: rc.cpp:172 debug/src/prefMPEG4.cpp:344 +#, no-c-format +msgid "mp2" +msgstr "" + +#: rc.cpp:175 debug/src/prefMPEG4.cpp:345 +#, no-c-format +msgid "ac3" +msgstr "" + +#: rc.cpp:178 debug/src/prefMPEG4.cpp:346 +#, no-c-format +msgid "adpcm ima" +msgstr "" + +#: rc.cpp:185 debug/src/prefMPEG4.cpp:349 +#, no-c-format +msgid "Gain" +msgstr "Ganho" + +#: rc.cpp:188 debug/src/prefMPEG4.cpp:351 +#, no-c-format +msgid "use cell cache" +msgstr "Usar cache de células" + +#: rc.cpp:191 rc.cpp:220 debug/src/k9mainw.cpp:157 +#, no-c-format +msgid "MainDlg" +msgstr "" + +#: rc.cpp:194 rc.cpp:223 debug/src/k9mainw.cpp:158 +#, no-c-format +msgid "Output device " +msgstr "Dispositivo de gravação: " + +#: rc.cpp:197 rc.cpp:244 debug/src/k9mainw.cpp:166 +#, no-c-format +msgid "@" +msgstr "" + +#: rc.cpp:200 +#, no-c-format +msgid "Input device " +msgstr "Dispositivo de leitura: " + +#: rc.cpp:203 rc.cpp:241 debug/src/k9mainw.cpp:165 libk9copy/k9burndvd.cpp:178 +#: libk9copy/k9burndvd.cpp:278 src/k9main.cpp:1344 +#: src/k9playbackoptions.cpp:147 k9author/k9import.cpp:207 +#, no-c-format +msgid "default" +msgstr "padrão" + +#: rc.cpp:209 +#, no-c-format +msgid "D&VD" +msgstr "" + +#: rc.cpp:212 rc.cpp:229 debug/src/k9mainw.cpp:65 debug/src/k9mainw.cpp:160 +#, no-c-format +msgid "Title" +msgstr "Título" + +#: rc.cpp:226 debug/src/k9mainw.cpp:159 src/main.cpp:37 +#, no-c-format +msgid "input device" +msgstr "Dispositivo de leitura" + +#: rc.cpp:235 debug/src/k9mainw.cpp:68 debug/src/k9mainw.cpp:162 +#, no-c-format +msgid "Content" +msgstr "Conteúdo" + +#: rc.cpp:248 debug/src/k9mainw.cpp:168 +#, no-c-format +msgid "Open a folder" +msgstr "Abrir um diretório" + +#: rc.cpp:252 debug/src/k9mainw.cpp:170 +#, no-c-format +msgid "Open an iso image" +msgstr "Abrir uma imagem ISO" + +#: rc.cpp:255 debug/src/viewmpeg2.cpp:205 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Previsualizar Título" + +#: rc.cpp:260 debug/src/prefAuthor.cpp:137 +#, no-c-format +msgid "Authoring options" +msgstr "Opções de masterização" + +#: rc.cpp:266 debug/src/prefAuthor.cpp:140 +#, no-c-format +msgid "AC3" +msgstr "" + +#: rc.cpp:269 debug/src/prefAuthor.cpp:141 +#, no-c-format +msgid "MP2" +msgstr "" + +#: rc.cpp:272 debug/src/prefAuthor.cpp:143 +#, no-c-format +msgid "128" +msgstr "" + +#: rc.cpp:275 debug/src/prefAuthor.cpp:144 +#, no-c-format +msgid "192" +msgstr "" + +#: rc.cpp:278 debug/src/prefAuthor.cpp:145 +#, no-c-format +msgid "320" +msgstr "" + +#: rc.cpp:281 debug/src/prefAuthor.cpp:146 +#, no-c-format +msgid "Format" +msgstr "Formato" + +#: rc.cpp:287 debug/src/prefAuthor.cpp:148 +#, no-c-format +msgid "Buttons" +msgstr "Botões" + +#: rc.cpp:299 debug/src/prefAuthor.cpp:152 +#, no-c-format +msgid "Hilite color" +msgstr "Cor de selecionado" + +#: rc.cpp:303 debug/src/prefAuthor.cpp:154 +#, no-c-format +msgid "Text color" +msgstr "Cor do texto" + +#: rc.cpp:307 debug/src/langselectw.cpp:120 src/k9copy.cpp:120 +#, no-c-format +msgid "Selection" +msgstr "Seleção" + +#: rc.cpp:310 debug/src/langselectw.cpp:93 debug/src/langselectw.cpp:121 +#, no-c-format +msgid "Languages" +msgstr "Idiomas" + +#: rc.cpp:317 debug/src/prefpreview.cpp:142 +#, no-c-format +msgid "&Internal Player" +msgstr "Reprodutor &Interno" + +#: rc.cpp:320 debug/src/prefpreview.cpp:143 +#, no-c-format +msgid "Alt+I" +msgstr "" + +#: rc.cpp:323 debug/src/prefpreview.cpp:144 +#, no-c-format +msgid "MPlayer" +msgstr "" + +#: rc.cpp:326 debug/src/prefpreview.cpp:145 +#, no-c-format +msgid "Alt+M" +msgstr "" + +#: rc.cpp:329 debug/src/prefpreview.cpp:146 +#, no-c-format +msgid "Internal viewer options" +msgstr "Opções do visualizador interno" + +#: rc.cpp:332 debug/src/prefpreview.cpp:147 +#, no-c-format +msgid "use OpenGL" +msgstr "Usar OpenGL" + +#: rc.cpp:335 debug/src/prefpreview.cpp:148 +#, no-c-format +msgid "Video output" +msgstr "Saída de vídeo" + +#: rc.cpp:338 debug/src/prefpreview.cpp:149 +#, no-c-format +msgid "Audio output" +msgstr "Saída de áudio" + +#: rc.cpp:341 debug/src/prefpreview.cpp:151 +#, no-c-format +msgid "X11" +msgstr "" + +#: rc.cpp:344 debug/src/prefpreview.cpp:152 +#, no-c-format +msgid "Xv" +msgstr "" + +#: rc.cpp:347 debug/src/prefpreview.cpp:153 +#, no-c-format +msgid "OpenGL" +msgstr "" + +#: rc.cpp:350 rc.cpp:359 debug/src/prefpreview.cpp:154 +#: debug/src/prefpreview.cpp:158 +#, no-c-format +msgid "SDL" +msgstr "" + +#: rc.cpp:353 debug/src/prefpreview.cpp:156 +#, no-c-format +msgid "ALSA" +msgstr "" + +#: rc.cpp:356 debug/src/prefpreview.cpp:157 +#, no-c-format +msgid "OSS" +msgstr "" + +#: rc.cpp:362 debug/src/prefpreview.cpp:159 +#, no-c-format +msgid "MPlayer options" +msgstr "Opções do MPlayer" + +#: rc.cpp:368 debug/src/prefMencoder.cpp:287 +#, no-c-format +msgid "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" +msgstr "" + +#: rc.cpp:375 debug/src/prefMencoder.cpp:292 +#, no-c-format +msgid "" +"pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" +msgstr "" +"número do passo\n" +"largura do vídeo\n" +"altura do vídeo\n" +"bitrate do vídeo\n" +"bitrate do áudio" + +#: rc.cpp:382 debug/src/prefMencoder.cpp:326 +#, no-c-format +msgid "Video codecs" +msgstr "Codecs de vídeo" + +#: rc.cpp:391 debug/src/prefMencoder.cpp:300 +#, no-c-format +msgid "MJPEG" +msgstr "" + +#: rc.cpp:394 debug/src/prefMencoder.cpp:301 +#, no-c-format +msgid "LJPEG" +msgstr "" + +#: rc.cpp:397 debug/src/prefMencoder.cpp:302 +#, no-c-format +msgid "H.261" +msgstr "" + +#: rc.cpp:400 debug/src/prefMencoder.cpp:303 +#, no-c-format +msgid "H.263" +msgstr "" + +#: rc.cpp:403 debug/src/prefMencoder.cpp:304 +#, no-c-format +msgid "MPEG-4 (DivX 4/5)" +msgstr "" + +#: rc.cpp:406 debug/src/prefMencoder.cpp:305 +#, no-c-format +msgid "DivX 3" +msgstr "" + +#: rc.cpp:409 debug/src/prefMencoder.cpp:306 +#, no-c-format +msgid "MS MPEG-4 v2" +msgstr "" + +#: rc.cpp:412 debug/src/prefMencoder.cpp:307 +#, no-c-format +msgid "WMV7" +msgstr "" + +#: rc.cpp:415 debug/src/prefMencoder.cpp:308 +#, no-c-format +msgid "WMV8" +msgstr "" + +#: rc.cpp:418 debug/src/prefMencoder.cpp:309 +#, no-c-format +msgid "RealVideo" +msgstr "" + +#: rc.cpp:421 debug/src/prefMencoder.cpp:310 +#, no-c-format +msgid "MPEG-1" +msgstr "" + +#: rc.cpp:424 debug/src/prefMencoder.cpp:311 +#, no-c-format +msgid "MPEG-2" +msgstr "" + +#: rc.cpp:427 debug/src/prefMencoder.cpp:312 +#, no-c-format +msgid "HuffYUV" +msgstr "" + +#: rc.cpp:430 debug/src/prefMencoder.cpp:313 +#, no-c-format +msgid "ffvHuff" +msgstr "" + +#: rc.cpp:433 debug/src/prefMencoder.cpp:314 +#, no-c-format +msgid "ASUS v1" +msgstr "" + +#: rc.cpp:436 debug/src/prefMencoder.cpp:315 +#, no-c-format +msgid "ASUS v2" +msgstr "" + +#: rc.cpp:440 rc.cpp:465 rc.cpp:555 debug/src/configDlg.cpp:42 +#: debug/src/configDlg.cpp:95 debug/src/prefMencoder.cpp:317 +#: debug/src/prefMencoder.cpp:329 +#, no-c-format +msgid "label" +msgstr "Rótulo" + +#: rc.cpp:443 debug/src/prefMencoder.cpp:318 +#, no-c-format +msgid "fourcc" +msgstr "" + +#: rc.cpp:446 debug/src/prefMencoder.cpp:319 +#, no-c-format +msgid "first pass" +msgstr "Primeiro passo" + +#: rc.cpp:451 debug/src/prefMencoder.cpp:322 +#, no-c-format +msgid "one pass" +msgstr "Um passo" + +#: rc.cpp:456 debug/src/prefMencoder.cpp:325 +#, no-c-format +msgid "second pass" +msgstr "Segundo passo" + +#: rc.cpp:459 debug/src/prefMencoder.cpp:332 +#, no-c-format +msgid "Audio codecs" +msgstr "Codecs de áudio" + +#: rc.cpp:462 debug/src/prefMencoder.cpp:328 +#, no-c-format +msgid "New Item" +msgstr "Novo Ãtem" + +#: rc.cpp:469 debug/src/prefMencoder.cpp:331 +#, no-c-format +msgid "options" +msgstr "Opções" + +#: rc.cpp:472 debug/src/prefMencoder.cpp:333 +#, no-c-format +msgid "Available variables" +msgstr "Variáveis disponíveis" + +#: rc.cpp:475 debug/src/titlefactor.cpp:321 +#, no-c-format +msgid "Shrink Factors" +msgstr "Fatores de compressão" + +#: rc.cpp:478 debug/src/titlefactor.cpp:322 +#, no-c-format +msgid "Shrink Factor for Title %1" +msgstr "Fator de compressão para o Título %1" + +#: rc.cpp:481 debug/src/titlefactor.cpp:323 +#, no-c-format +msgid "Change Factor" +msgstr "Mudar o Fator" + +#: rc.cpp:484 debug/src/titlefactor.cpp:324 +#, no-c-format +msgid "0.00" +msgstr "" + +#: rc.cpp:487 debug/src/playbackoptionsw.cpp:228 src/k9copy.cpp:114 +#, no-c-format +msgid "DVD playback options" +msgstr "Opções de reprodução do DVD" + +#: rc.cpp:490 debug/src/playbackoptionsw.cpp:229 +#, no-c-format +msgid "&Keep original menus" +msgstr "&Manter os menus originais" + +#: rc.cpp:498 debug/src/playbackoptionsw.cpp:233 +#, no-c-format +msgid "Selected Titles" +msgstr "Títulos selecionados" + +#: rc.cpp:501 debug/src/playbackoptionsw.cpp:234 +#, no-c-format +msgid "Default language" +msgstr "Idioma padrão" + +#: rc.cpp:504 debug/src/playbackoptionsw.cpp:235 +#, no-c-format +msgid "Subtitle" +msgstr "Legenda" + +#: rc.cpp:510 debug/src/prefDVD.cpp:97 +#, no-c-format +msgid "prefDVD" +msgstr "" + +#: rc.cpp:513 debug/src/prefDVD.cpp:98 +#, no-c-format +msgid "Output directory" +msgstr "Diretório de saída" + +#: rc.cpp:516 debug/src/prefDVD.cpp:99 +#, no-c-format +msgid "Burn with k3b" +msgstr "Gravar com k3b" + +#: rc.cpp:522 debug/src/prefDVD.cpp:101 +#, no-c-format +msgid "Auto burn" +msgstr "Gravação automática" + +#: rc.cpp:525 debug/src/prefDVD.cpp:102 +#, no-c-format +msgid "Alt+T" +msgstr "" + +#: rc.cpp:528 debug/src/prefDVD.cpp:103 +#, no-c-format +msgid "DVD size" +msgstr "Tamanho do DVD" + +#: rc.cpp:531 debug/src/prefDVD.cpp:104 +#, no-c-format +msgid "Quick scan" +msgstr "Análise rápida" + +#: rc.cpp:534 debug/src/prefDVD.cpp:105 +#, no-c-format +msgid "Alt+Q" +msgstr "" + +#: rc.cpp:537 debug/src/prefDVD.cpp:106 +#, no-c-format +msgid "use dvdAuthor for copy without menus" +msgstr "Usar dvdAuthor para cópia sem menus" + +#: rc.cpp:540 debug/src/prefDVD.cpp:107 +#, no-c-format +msgid "Alt+D" +msgstr "" + +#: rc.cpp:543 debug/src/prefDVD.cpp:108 +#, no-c-format +msgid "Clear output directory on exit" +msgstr "Limpar diretório de saída ao sair" + +#: rc.cpp:546 debug/src/prefDVD.cpp:109 +#, no-c-format +msgid "Alt+Y" +msgstr "" + +#: rc.cpp:549 debug/src/configDlg.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Dispositivos" + +#: rc.cpp:552 debug/src/configDlg.cpp:40 debug/src/configDlg.cpp:94 +#, no-c-format +msgid "device" +msgstr "dispositivo" + +#: rc.cpp:558 debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:96 +#, no-c-format +msgid "Input" +msgstr "Leitura" + +#: rc.cpp:561 rc.cpp:597 debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:97 +#: debug/k9author/import.cpp:105 +#, no-c-format +msgid "Output" +msgstr "Gravação" + +#: rc.cpp:572 debug/k9Mplayer/mplayer.cpp:593 src/k9settings.cpp:57 +#: src/k9copy.cpp:128 src/k9copy.cpp:390 k9Mplayer/k9mplayer.cpp:97 +#, no-c-format +msgid "Preview" +msgstr "Previsualizar" + +#: rc.cpp:578 debug/k9Mplayer/mplayer.cpp:595 +#, no-c-format +msgid "Subpicture" +msgstr "Legenda" + +#: rc.cpp:585 debug/k9Mplayer/mplayer.cpp:600 +#, no-c-format +msgid "-" +msgstr "" + +#: rc.cpp:589 debug/k9Mplayer/mplayer.cpp:602 +#, no-c-format +msgid "+" +msgstr "" + +#: rc.cpp:594 debug/k9author/import.cpp:104 +#, no-c-format +msgid "import" +msgstr "importar" + +#: rc.cpp:600 debug/k9author/import.cpp:44 debug/k9author/import.cpp:106 +#, no-c-format +msgid "Video files" +msgstr "Arquivos de vídeo" + +#: rc.cpp:606 debug/k9author/import.cpp:109 +#, no-c-format +msgid "PAL" +msgstr "" + +#: rc.cpp:609 debug/k9author/import.cpp:110 +#, no-c-format +msgid "NTSC" +msgstr "" + +#: rc.cpp:615 debug/k9author/chapterEdit.cpp:145 src/k9copy.cpp:211 +#: k9author/k9importfiles.cpp:34 +#, no-c-format +msgid "Chapter properties" +msgstr "Propriedades do capítulo" + +#: rc.cpp:618 debug/k9author/chapterEdit.cpp:146 +#, no-c-format +msgid "start" +msgstr "iniciar" + +#: rc.cpp:621 debug/k9author/chapterEdit.cpp:147 +#, no-c-format +msgid "video" +msgstr "vídeo" + +#: rc.cpp:624 debug/k9author/chapterEdit.cpp:148 +#, no-c-format +msgid "" +"*.avi\n" +"*.mpeg" +msgstr "" + +#: rc.cpp:628 rc.cpp:643 debug/k9author/chapterEdit.cpp:150 +#: debug/k9author/chapterEdit.cpp:155 +#, no-c-format +msgid "set Current Frame" +msgstr "configurar Quadro Atual" + +#: rc.cpp:631 rc.cpp:637 debug/k9author/chapterEdit.cpp:151 +#: debug/k9author/chapterEdit.cpp:153 +#, no-c-format +msgid "break continuity" +msgstr "quebrar continuidade" + +#: rc.cpp:634 debug/k9author/chapterEdit.cpp:152 +#, no-c-format +msgid "end" +msgstr "fim" + +#: rc.cpp:646 debug/k9author/chapterEdit.cpp:156 +#, no-c-format +msgid "set Title button" +msgstr "configurar botão de Título" + +#: rc.cpp:649 debug/k9author/newTitle.cpp:124 src/k9copy.cpp:204 +#: k9author/k9importfiles.cpp:40 k9author/k9newtitle.cpp:55 +#, no-c-format +msgid "Add title" +msgstr "Adicionar título" + +#: rc.cpp:653 debug/k9author/newTitle.cpp:126 +#, no-c-format +msgid "number of chapters" +msgstr "número de capítulos" + +#: rc.cpp:656 debug/k9author/newTitle.cpp:127 +#, no-c-format +msgid "chapter length" +msgstr "duração do capítulo" + +#: rc.cpp:663 debug/k9author/newTitle.cpp:130 +#, no-c-format +msgid "Video file" +msgstr "Arquivo de vídeo" + +#: rc.cpp:669 debug/k9author/menuEdit.cpp:146 src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +#, no-c-format +msgid "Edit Menu" +msgstr "Editar Menu" + +#: rc.cpp:672 debug/k9author/menuEdit.cpp:147 +#, no-c-format +msgid "Text" +msgstr "Texto" + +#: rc.cpp:675 debug/k9author/menuEdit.cpp:148 +#, no-c-format +msgid "Background picture" +msgstr "Imagem de fundo" + +#: rc.cpp:690 debug/k9author/menuEdit.cpp:156 k9author/k9menuedit.cpp:286 +#: k9author/k9import.cpp:45 +#, no-c-format +msgid "Root Menu" +msgstr "Menu Raiz" + +#: rc.cpp:693 debug/k9author/menuEdit.cpp:157 +#, no-c-format +msgid "At start" +msgstr "No início" + +#: rc.cpp:696 debug/k9author/menuEdit.cpp:159 +#, no-c-format +msgid "Play menu" +msgstr "Reproduzir menu" + +#: rc.cpp:699 rc.cpp:711 debug/k9author/menuEdit.cpp:160 +#: debug/k9author/menuEdit.cpp:165 +#, no-c-format +msgid "Play title 1" +msgstr "Reproduzir título 1" + +#: rc.cpp:702 debug/k9author/menuEdit.cpp:161 +#, no-c-format +msgid "At End" +msgstr "No Fim" + +#: rc.cpp:705 debug/k9author/menuEdit.cpp:163 +#, no-c-format +msgid "Play root menu" +msgstr "Reproduzir menu raiz" + +#: rc.cpp:708 debug/k9author/menuEdit.cpp:164 +#, no-c-format +msgid "Play title menu" +msgstr "Reproduzir menu título" + +#: rc.cpp:717 +#, no-c-format +msgid "A&ctions" +msgstr "A&ções" + +#: rc.cpp:720 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Barra de Ferramentas de Ações" + +#: debug/libk9copy/k9ifo2.moc.cpp:34 debug/libk9copy/k9ifo2.moc.cpp:42 +msgid "k9Ifo2" +msgstr "" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:34 +#: debug/libk9copy/k9dvdchapter.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:107 +#: debug/libk9copy/k9dvdchapter.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9DVDVideoStream" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDAudioStream" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDSubtitle" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDTitle" +msgstr "" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "" + +#: debug/libk9copy/k9dvdtitleset.moc.cpp:34 +#: debug/libk9copy/k9dvdtitleset.moc.cpp:42 +msgid "k9DVDTitleset" +msgstr "" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "" + +#: debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Previsualizar Menu" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "k9Widget" +msgstr "" + +#: debug/src/kviewmpeg2.moc.cpp:107 debug/src/kviewmpeg2.moc.cpp:115 +msgid "kViewMPEG2" +msgstr "" + +#: debug/k9Mplayer/k9mplayer.moc.cpp:34 debug/k9Mplayer/k9mplayer.moc.cpp:42 +msgid "K9Mplayer" +msgstr "" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "" + +#: libk9copy/k9dvd.cpp:133 +msgid "for visually impaired" +msgstr "para deficientes visuais" + +#: libk9copy/k9dvd.cpp:134 +msgid "director's comments" +msgstr "comentários do diretor" + +#: libk9copy/k9dvd.cpp:135 +msgid "alternate director's comments" +msgstr "comentários do diretor alternativos" + +#: libk9copy/k9dvd.cpp:139 +msgid "Large" +msgstr "Grande" + +#: libk9copy/k9dvd.cpp:140 +msgid "Children" +msgstr "Crianças" + +#: libk9copy/k9dvd.cpp:141 libk9copy/k9dvd.cpp:147 libk9copy/k9dvd.cpp:148 +#: libk9copy/k9dvd.cpp:149 +msgid "reserved" +msgstr "reservado" + +#: libk9copy/k9dvd.cpp:142 +msgid "Normal captions" +msgstr "Legendas normais" + +#: libk9copy/k9dvd.cpp:143 +msgid "Large captions" +msgstr "Legendas grandes" + +#: libk9copy/k9dvd.cpp:144 +msgid "Children captions" +msgstr "Legendas para crianças" + +#: libk9copy/k9dvd.cpp:146 +msgid "Forced" +msgstr "Forçado" + +#: libk9copy/k9dvd.cpp:150 +msgid "Director's comments" +msgstr "Comentários do diretor" + +#: libk9copy/k9dvd.cpp:151 +msgid "Large director's comments" +msgstr "Comentários do diretor grandes" + +#: libk9copy/k9dvd.cpp:152 +msgid "Director's comments for children" +msgstr "Comentários do diretor para crianças" + +#: libk9copy/k9dvd.cpp:189 +msgid "Couldn't open %1 for title\n" +msgstr "Não foi possível abrir %1 para o título\n" + +#: libk9copy/k9dvd.cpp:191 libk9copy/k9dvd.cpp:199 libk9copy/k9dvd.cpp:207 +#: libk9copy/k9dvd.cpp:368 src/k9main.cpp:563 +msgid "unknown" +msgstr "desconhecido" + +#: libk9copy/k9dvd.cpp:197 +msgid "Couldn't seek in %1 for title\n" +msgstr "Não foi possível procurar em %1 pelo título\n" + +#: libk9copy/k9dvd.cpp:224 +msgid "Not Specified" +msgstr "Não Especificado" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afar" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Abkhazian" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afrikaans" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Amharic" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Arabic" +msgstr "Ãrabe" + +#: libk9copy/k9dvd.cpp:225 +msgid "Assamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Aymara" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Azerbaijani" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Bashkir" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Byelorussian" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bulgarian" +msgstr "Búlgaro" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bihari" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bislama" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bengali; Bangla" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Tibetan" +msgstr "Tibetano" + +#: libk9copy/k9dvd.cpp:227 +msgid "Breton" +msgstr "Bretão" + +#: libk9copy/k9dvd.cpp:227 +msgid "Catalan" +msgstr "Catalão" + +#: libk9copy/k9dvd.cpp:227 +msgid "Corsican" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Czech" +msgstr "Tcheco" + +#: libk9copy/k9dvd.cpp:228 +msgid "Welsh" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Dansk" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Deutsch" +msgstr "Alemão" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Greek" +msgstr "Grécia" + +#: libk9copy/k9dvd.cpp:228 +msgid "English" +msgstr "Inglês" + +#: libk9copy/k9dvd.cpp:229 +msgid "Esperanto" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Espanol" +msgstr "Espanhol" + +#: libk9copy/k9dvd.cpp:229 +msgid "Estonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Basque" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Persian" +msgstr "Persa" + +#: libk9copy/k9dvd.cpp:230 +msgid "Suomi" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Fiji" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Faroese" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Francais" +msgstr "Francês" + +#: libk9copy/k9dvd.cpp:230 +msgid "Frisian" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Gaelic" +msgstr "Galês" + +#: libk9copy/k9dvd.cpp:231 +msgid "Scots Gaelic" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Galician" +msgstr "Galícia" + +#: libk9copy/k9dvd.cpp:231 +msgid "Guarani" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Gujarati" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Hausa" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 libk9copy/k9dvd.cpp:234 +msgid "Hebrew" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hindi" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hrvatski" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Magyar" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Armenian" +msgstr "Armênio" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingua" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Indonesian" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingue" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Italiano" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Inuktitut" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Japanese" +msgstr "Japonês" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:250 +msgid "Yiddish" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Javanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Georgian" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Kazakh" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Greenlandic" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Cambodian" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kannada" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Korean" +msgstr "Coreano" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kashmiri" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kurdish" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kirghiz" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Latin" +msgstr "Latino" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lingala" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lithuanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Maori" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Macedonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Mongolian" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Moldavian" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nepali" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nederlands" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Occitan" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Polish" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Portugues" +msgstr "Português" + +#: libk9copy/k9dvd.cpp:242 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Romanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Russian" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Serbo-Croatian" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovak" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Albanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Serbian" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Tamil" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Thai" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Turkish" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Ukrainian" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Vietnamese" +msgstr "Vietnamita" + +#: libk9copy/k9dvd.cpp:250 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Chinese" +msgstr "Chinês" + +#: libk9copy/k9dvd.cpp:251 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 libk9copy/k9dvd.cpp:252 libk9copy/k9dvd.cpp:475 +msgid "Unknown" +msgstr "Desconhecido" + +#: libk9copy/k9dvd.cpp:342 +msgid "Can't open disc %1!\n" +msgstr "Não foi possível abrir o disco %1!\n" + +#: libk9copy/k9dvd.cpp:354 +msgid "Can't open main ifo!\n" +msgstr "Não foi possível abrir o arquivo ifo principal!\n" + +#: libk9copy/k9dvd.cpp:396 libk9copy/k9dvd.cpp:691 +msgid "Title %1" +msgstr "Título %1" + +#: libk9copy/k9dvd.cpp:742 +msgid "reading title" +msgstr "lendo capítulo" + +#: libk9copy/k9dvd.cpp:859 +msgid "Error opening vobs for title %1\n" +msgstr "Erro abrindo arquivos vobs do título %1\n" + +#: libk9copy/k9dvd.cpp:870 +msgid "ERROR reading block %1\n" +msgstr "ERRO lendo bloco %1\n" + +#: libk9copy/k9dvdauthor.cpp:148 libk9copy/k9dvdauthor.cpp:366 +msgid "'%1' not selected" +msgstr "'%1' não selecionado" + +#: libk9copy/k9dvdauthor.cpp:149 libk9copy/k9dvdauthor.cpp:367 +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9dvdauthor.cpp:436 +#: libk9copy/k9dvdauthor.cpp:445 libk9copy/k9dvdauthor.cpp:448 +#: libk9copy/k9burndvd.cpp:237 libk9copy/k9burndvd.cpp:321 +#: k9author/k9newdvd.cpp:122 +msgid "authoring" +msgstr "masterização" + +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +#: k9Mplayer/k9mplayer.cpp:97 +msgid "Unable to run %1" +msgstr "Não foi possível executar %1" + +#: libk9copy/k9dvdauthor.cpp:403 libk9copy/k9dvdauthor.cpp:476 +#: libk9copy/k9dvdauthor.cpp:514 src/k9settings.cpp:63 +#: k9author/k9newdvd.cpp:143 +msgid "Authoring" +msgstr "Masterização" + +#: libk9copy/k9dvdauthor.cpp:436 +msgid "Dvdauthor error :\n" +msgstr "Erro do DVDAuthor:\n" + +#: libk9copy/k9dvdauthor.cpp:445 +msgid "Authoring cancelled" +msgstr "Masterização cancelada" + +#: libk9copy/k9dvdauthor.cpp:448 k9author/k9newdvd.cpp:136 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Ocorreu um erro enquanto executava DVDAuthor:\n" + +#: libk9copy/k9dvdauthor.cpp:515 +msgid "Fixing VOBUS" +msgstr "Consertando VOBUS" + +#: libk9copy/k9mp4enc.cpp:103 libk9copy/k9mp4enc.cpp:312 +msgid "Encoding error" +msgstr "Erro de codificação" + +#: libk9copy/k9mp4enc.cpp:152 src/k9main.cpp:1155 +msgid "Save file to disk" +msgstr "Salvar arquivo para o disco" + +#: libk9copy/k9mp4enc.cpp:161 libk9copy/k9mp4enc.cpp:350 +#: src/k9prefmpeg4.cpp:34 src/k9mp4title.cpp:49 src/k9main.cpp:290 +#: src/k9main.cpp:300 src/k9main.cpp:310 src/k9main.cpp:330 src/k9main.cpp:588 +#: src/k9main.cpp:689 src/k9main.cpp:703 src/k9prefdvd.cpp:35 +msgid "MB" +msgstr "" + +#: libk9copy/k9mp4enc.cpp:233 libk9copy/k9mp4enc.cpp:235 +#: k9author/k9newdvd.cpp:247 +msgid "Encoding %1" +msgstr "Codificando %1" + +#: libk9copy/k9mp4enc.cpp:233 +msgid "pass %1" +msgstr "passo %1" + +#: libk9copy/k9mp4enc.cpp:309 +msgid "MPEG-4 Encoding cancelled" +msgstr "Codificação para MPEG-4 cancelada" + +#: libk9copy/k9mp4enc.cpp:309 src/k9settings.cpp:48 src/k9main.cpp:1141 +msgid "MPEG-4 Encoding" +msgstr "Codificação para MPEG-4" + +#: libk9copy/k9mp4enc.cpp:312 +msgid "Error while running mencoder :" +msgstr "Erro ao executar o mencoder:" + +#: libk9copy/k9burndvd.cpp:188 libk9copy/k9burndvd.cpp:255 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - Gravando DVD" + +#: libk9copy/k9burndvd.cpp:189 libk9copy/k9burndvd.cpp:256 +#: libk9copy/k9burndvd.cpp:348 src/k9main.cpp:435 +msgid "Burning DVD" +msgstr "Gravando DVD" + +#: libk9copy/k9burndvd.cpp:200 libk9copy/k9burndvd.cpp:284 src/k9main.cpp:384 +#: k9author/k9import.cpp:178 +msgid "Save image to disk" +msgstr "Salvar imagem para o disco" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:302 +msgid "Insert a recordable DVD" +msgstr "Insira um DVD gravável" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:303 +#: libk9copy/k9burndvd.cpp:309 libk9copy/k9burndvd.cpp:314 +msgid "DVD burning" +msgstr "Gravando o DVD" + +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +msgid "Error burning DVD :\n" +msgstr "Erro ao gravar DVD:\n" + +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:314 +msgid "DVD Burning finished" +msgstr "Gravação do DVD terminada" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "An error occured while Burning DVD: %1" +msgstr "Um erro ocorreu na gravação do DVD: %1" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "Insert an other DVD" +msgstr "Insira outro DVD" + +#: libk9copy/k9burndvd.cpp:349 +msgid "Current write speed :%1 x" +msgstr "Velocidade de gravação atual: %1 x" + +#: libk9copy/k9dvdbackup.cpp:149 libk9copy/k9dvdbackup.cpp:163 +#: libk9copy/k9dvdbackup.cpp:513 libk9copy/k9dvdbackup.cpp:599 +msgid "DVD backup cancelled" +msgstr "Cópia do DVD cancelada" + +#: libk9copy/k9dvdbackup.cpp:176 +msgid "unable to open VIDEO_TS.IFO" +msgstr "não foi possível abrir VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:198 libk9copy/k9dvdbackup.cpp:381 +#: libk9copy/k9dvdbackup.cpp:446 +msgid "Unable to open file " +msgstr "Não foi possível abrir o arquivo" + +#: libk9copy/k9dvdbackup.cpp:277 +msgid "Unable to open titleset %1" +msgstr "Não foi possível abrir o VTS %1" + +#: libk9copy/k9dvdbackup.cpp:283 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting titleset %1" +msgstr "Extraindo VTS %1" + +#: libk9copy/k9dvdbackup.cpp:453 +msgid "Unable to open menu for titleset %1" +msgstr "Não foi possível abrir menu para o VTS %1" + +#: libk9copy/k9dvdbackup.cpp:479 +msgid "Extracting menu for titleset %1" +msgstr "Extraindo menu do VTS %1" + +#: libk9copy/k9dvdbackup.cpp:563 +msgid "Unable to open ifo file for titleset %1" +msgstr "Não foi possível abrir o arquivo ifo para o VTS %1" + +#: libk9copy/k9dvdbackup.cpp:575 libk9copy/k9dvdbackup.cpp:1694 +msgid "Unable to open DVD" +msgstr "Não foi possível abrir o DVD" + +#: libk9copy/k9dvdbackup.cpp:585 +msgid "Unable to open vobs for titleset %1" +msgstr "Não foi possível abrir vobs para o VTS %1" + +#: libk9copy/k9dvdbackup.cpp:1381 +msgid "Updating vob %1" +msgstr "Atualizando vob %1" + +#: libk9copy/k9dvdbackup.cpp:1398 +msgid "DVD backup canceled" +msgstr "Cópia do DVD cancelada" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "Dispositivos" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "Dispositivos não detectados pelo k9copy" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "" + +#: src/k9settings.cpp:34 src/k9copy.cpp:294 +msgid "DVD Backup" +msgstr "Backup de DVD" + +#: src/k9settings.cpp:42 +msgid "MEncoder" +msgstr "" + +#: src/k9settings.cpp:42 +msgid "MPEG-4 Codecs" +msgstr "Codecs MPEG-4" + +#: src/k9settings.cpp:48 +msgid "MPEG-4" +msgstr "" + +#: src/k9settings.cpp:57 +msgid "Title preview" +msgstr "Previsualizar título" + +#: src/k9mp4title.cpp:36 src/k9mp4title.cpp:109 src/k9titlefactor.cpp:99 +msgid "Select a Title in the treeview..." +msgstr "Selecione um Título na visão em árvore..." + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "Uma ferramenta de backup de DVD para o KDE" + +#: src/main.cpp:39 +msgid "output device" +msgstr "dispositivo de saída" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "título para reproduzir" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "reproduzir título na saída padrão" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "setor inicial" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "setor final" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "lista de faixas de áudio" + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "lista de faixas spu" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "Fator de compressão" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "fator de compressão forçado" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "tamanho da célula para copiar" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "tamanho total dos títulos selecionados" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "tamanho dos capítulos sendo copiados" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "capítulos selecionados" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "novo tamanho do dvd" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "capítulo selecionado" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "número de célula no capítulo selecionado" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "nome de arquivo de status" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "iniciar arquivo de status" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "continuar reproduzindo do último setor" + +#: src/main.cpp:58 +msgid "don't save status at end" +msgstr "não salvas o estado no final" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "salvar célula em um arquivo temporário antes de codificar" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "para uso interno" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "" + +#: src/main.cpp:69 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "Fabio S Monteiro, Phantom X" + +#: src/main.cpp:70 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "fsmont@gmail.com, megaphantomx@bol.com.br" + +#: src/k9prefmencoder.cpp:105 src/k9prefmencoder.cpp:109 +#: src/k9prefmencoder.cpp:120 src/k9prefmencoder.cpp:122 +msgid "new profile" +msgstr "novo perfil" + +#: src/k9copy.cpp:137 +msgid "Shrink Factor" +msgstr "Fator de compressão" + +#: src/k9copy.cpp:194 k9author/k9importfiles.cpp:31 +msgid "Edit menu" +msgstr "Editar menu" + +#: src/k9copy.cpp:263 +msgid "Play title" +msgstr "Reproduzir título" + +#: src/k9copy.cpp:279 +msgid "Create MPEG-4" +msgstr "Criar MPEG-4" + +#: src/k9copy.cpp:286 +msgid "Eject" +msgstr "Ejetar" + +#: src/k9copy.cpp:300 +msgid "DVD Author" +msgstr "Masterizar DVD" + +#: src/k9copy.cpp:306 +msgid "Create DVD" +msgstr "Criar DVD" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding options" +msgstr "opções de codificação MPEG-4" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding Options" +msgstr "Opções de codificação MPEG-4" + +#: src/k9copy.cpp:375 +msgid "Settings" +msgstr "Configurações" + +#: src/k9langselect.cpp:90 +msgid "Subtitles" +msgstr "Legendas" + +#: src/k9main.cpp:373 src/k9main.cpp:1141 +msgid "DVD is not opened" +msgstr "DVD não está aberto" + +#: src/k9main.cpp:373 src/k9main.cpp:395 +msgid "DVD Copy" +msgstr "Cópia do DVD" + +#: src/k9main.cpp:395 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"Espaço de disco insuficiente em %1\n" +"espera-se %2 MB." + +#: src/k9main.cpp:399 +msgid "Backup in progress" +msgstr "Cópia em progresso" + +#: src/k9main.cpp:459 src/k9main.cpp:608 src/k9main.cpp:1194 +msgid "Ready" +msgstr "Pronto" + +#: src/k9main.cpp:464 k9author/k9import.cpp:156 +msgid "processing" +msgstr "processando" + +#: src/k9main.cpp:499 src/k9main.cpp:1247 k9author/k9import.cpp:63 +msgid "ISO Image" +msgstr "Imagem ISO" + +#: src/k9main.cpp:560 +msgid "Open DVD" +msgstr "Abrir DVD" + +#: src/k9main.cpp:586 +msgid "Titleset %1" +msgstr "VTS %1" + +#: src/k9main.cpp:636 +msgid "chapters" +msgstr "capítulos" + +#: src/k9main.cpp:644 src/k9main.cpp:657 k9author/k9newtitle.cpp:117 +#: k9author/k9newtitle.cpp:139 +msgid "chapter %1" +msgstr "capítulo %1" + +#: src/k9main.cpp:645 src/k9main.cpp:660 src/k9main.cpp:719 src/k9main.cpp:737 +msgid "%1 MB" +msgstr "" + +#: src/k9main.cpp:699 +msgid "video %1 " +msgstr "vídeo %1 " + +#: src/k9main.cpp:710 +msgid "audio %1 " +msgstr "áudio %1 " + +#: src/k9main.cpp:730 +msgid "subpicture %1 " +msgstr "legenda %1 " + +#: src/k9main.cpp:1149 +msgid "Transcoding title : %1" +msgstr "Trancodificando título : %1" + +#: src/k9main.cpp:1248 k9author/k9import.cpp:64 +msgid "Folder" +msgstr "Pasta" + +#: src/k9main.cpp:1355 +msgid "Open ISO Image" +msgstr "Abrir Imagem ISO" + +#: src/k9main.cpp:1366 +msgid "Open DVD folder" +msgstr "Abrir diretério do DVD" + +#: src/k9mencodercmdgen.cpp:103 +msgid "Filters" +msgstr "Filtros" + +#: src/k9playbackoptions.cpp:149 +msgid "none" +msgstr "nenhum" + +#: src/k9titlefactor.cpp:110 +msgid "Shrink Factor for %1" +msgstr "Fator de Compressão para %1" + +#: k9author/k9newdvd.cpp:94 +msgid "Creating root menu" +msgstr "Criando menu raiz" + +#: k9author/k9newdvd.cpp:134 +msgid "The dvd authoring was canceled" +msgstr "A masterização do DVD foi cancelada" + +#: k9author/k9newdvd.cpp:160 +msgid "Creating menu for title %1" +msgstr "Criando menu do título %1" + +#: k9author/k9newdvd.cpp:381 k9author/k9newtitle.cpp:63 +msgid "title %1" +msgstr "título %1" + +#: k9author/k9avidecode.cpp:31 k9author/k9avidecode.cpp:35 +msgid "Cannot open then library %1" +msgstr "Não foi possível abrir a biblioteca %1" + +#: k9author/k9avidecode.cpp:88 +msgid "Couldn't open the file %1" +msgstr "Não foi possível abrir o arquivo %1" + +#: k9author/k9avidecode.cpp:93 +msgid "Couldn't find stream information" +msgstr "Não foi possível encontrar informação do stream" + +#: k9author/k9avidecode.cpp:106 +msgid "The file doesn't contain any video stream" +msgstr "O arquivo não contém nenhum stream de vídeo" + +#: k9author/k9avidecode.cpp:117 +msgid "Unsupported codec" +msgstr "codec não suportado" + +#: k9author/k9avidecode.cpp:122 +msgid "Could'nt open the codec" +msgstr "Não foi possível abrir o codec" + +#: k9author/k9avidecode.cpp:133 +msgid "Unable to allocate memory for frames" +msgstr "Impossível alocar memória para quadros" + +#: k9author/k9menuedit.cpp:245 +msgid "Title %1 Menu" +msgstr "Menu do Título %1" + +#: k9author/k9menuedit.cpp:254 k9author/k9menuedit.cpp:291 +msgid "Play Menu" +msgstr "Reproduzir Menu" + +#: k9author/k9menuedit.cpp:256 +msgid "Play Title" +msgstr "Reproduzir Título" + +#: k9author/k9menuedit.cpp:262 +msgid "Play Root Menu" +msgstr "Reproduzir Menu Raiz" + +#: k9author/k9menuedit.cpp:264 +msgid "Play Title Menu" +msgstr "Reproduzir Menu Título" + +#: k9author/k9menuedit.cpp:269 k9author/k9menuedit.cpp:295 +msgid "Play Title %1" +msgstr "Reproduzir Título %1" + +#: k9author/k9importfiles.cpp:24 +msgid "Create new DVD" +msgstr "Criar novo DVD" + diff --git a/po/ru.po b/po/ru.po new file mode 100644 index 0000000..afd645f --- /dev/null +++ b/po/ru.po @@ -0,0 +1,2188 @@ +# translation of ru-1.2.0.po to +# translation of ru.po to +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# +# Alexander V. Ribchansky , 2006. +msgid "" +msgstr "" +"Project-Id-Version: ru-1.2.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-10-14 09:03+0200\n" +"PO-Revision-Date: 2007-10-20 18:50+0300\n" +"Last-Translator: Alexander V. Ribchansky\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: rc.cpp:3 debug/libk9copy/backupdlg.cpp:156 libk9copy/k9dvdauthor.cpp:404 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - прогреÑÑ ÐºÐ¾Ð¿Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ" + +#: rc.cpp:6 debug/libk9copy/backupdlg.cpp:157 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

Копирование DVD-диÑка

" + +#: rc.cpp:9 debug/libk9copy/backupdlg.cpp:158 +#, no-c-format +msgid "Current step" +msgstr "Текущий шаг" + +#: rc.cpp:12 rc.cpp:47 rc.cpp:65 debug/libk9copy/backupdlg.cpp:159 +#: debug/libk9copy/mp4dlg.cpp:148 debug/libk9copy/progress.cpp:116 +#, no-c-format +msgid "Elapsed Time" +msgstr "Прошло времени" + +#: rc.cpp:15 rc.cpp:612 rc.cpp:640 rc.cpp:666 +#: debug/libk9copy/backupdlg.cpp:160 debug/k9author/newTitle.cpp:131 +#: debug/k9author/chapterEdit.cpp:154 debug/k9author/import.cpp:111 +#, no-c-format +msgid "--:--:--" +msgstr "" + +#: rc.cpp:19 debug/libk9copy/dvdprogress.cpp:92 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - Ðнализирует DVD" + +#: rc.cpp:25 debug/libk9copy/processList.cpp:68 +#, no-c-format +msgid "Process List" +msgstr "СпиÑок ПроцеÑÑов" + +#: rc.cpp:28 debug/libk9copy/processList.cpp:33 +#: debug/libk9copy/processList.cpp:69 +#, no-c-format +msgid "Processes" +msgstr "ПроцеÑÑÑ‹" + +#: rc.cpp:31 debug/libk9copy/processList.cpp:34 +#: debug/libk9copy/processList.cpp:70 +#, no-c-format +msgid "Elapsed" +msgstr "Прошло времени" + +#: rc.cpp:34 rc.cpp:603 debug/libk9copy/processList.cpp:35 +#: debug/libk9copy/processList.cpp:71 debug/k9author/import.cpp:46 +#: debug/k9author/import.cpp:107 +#, no-c-format +msgid "..." +msgstr "" + +#: rc.cpp:40 debug/libk9copy/processList.cpp:73 debug/src/progress.cpp:81 +#, no-c-format +msgid "Alt+C" +msgstr "" + +#: rc.cpp:43 debug/libk9copy/progress.cpp:114 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 +#, no-c-format +msgid "k9Copy" +msgstr "" + +#: rc.cpp:52 debug/libk9copy/mp4dlg.cpp:141 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - транÑкодирование" + +#: rc.cpp:55 debug/libk9copy/mp4dlg.cpp:142 +#, no-c-format +msgid "Encoding" +msgstr "Кодирование" + +#: rc.cpp:62 debug/libk9copy/mp4dlg.cpp:147 k9author/k9newdvd.cpp:344 +#, no-c-format +msgid "fps" +msgstr "" + +#: rc.cpp:68 rc.cpp:154 rc.cpp:181 rc.cpp:284 debug/libk9copy/mp4dlg.cpp:149 +#: debug/src/prefAuthor.cpp:147 debug/src/prefMPEG4.cpp:337 +#: debug/src/prefMPEG4.cpp:347 +#, no-c-format +msgid "Bitrate" +msgstr "Битрейт" + +#: rc.cpp:71 rc.cpp:215 rc.cpp:232 debug/libk9copy/mp4dlg.cpp:150 +#: debug/src/k9mainw.cpp:66 debug/src/k9mainw.cpp:161 +#, no-c-format +msgid "Size" +msgstr "Размер" + +#: rc.cpp:74 debug/src/mencoderCmdGen.cpp:98 src/k9mencodercmdgen.cpp:55 +#, no-c-format +msgid "MEncoder options" +msgstr "Параметры MEncoder" + +#: rc.cpp:78 debug/src/mencoderCmdGen.cpp:108 src/k9mencodercmdgen.cpp:68 +#, no-c-format +msgid "Audio Codec" +msgstr "Ðудио кодек" + +#: rc.cpp:81 rc.cpp:169 debug/src/prefMPEG4.cpp:343 +#: debug/src/mencoderCmdGen.cpp:104 +#, no-c-format +msgid "faac" +msgstr "" + +#: rc.cpp:84 rc.cpp:96 debug/src/mencoderCmdGen.cpp:107 +#: debug/src/mencoderCmdGen.cpp:119 +#, no-c-format +msgid "lavc" +msgstr "" + +#: rc.cpp:87 debug/src/mencoderCmdGen.cpp:120 src/k9mencodercmdgen.cpp:84 +#, no-c-format +msgid "Video Codec" +msgstr "Видео кодек" + +#: rc.cpp:90 rc.cpp:121 rc.cpp:388 debug/src/prefMPEG4.cpp:323 +#: debug/src/prefMencoder.cpp:299 debug/src/mencoderCmdGen.cpp:113 +#, no-c-format +msgid "x264" +msgstr "" + +#: rc.cpp:93 debug/src/mencoderCmdGen.cpp:116 +#, no-c-format +msgid "xvid" +msgstr "" + +#: rc.cpp:99 rc.cpp:313 rc.cpp:365 debug/src/prefMPEG4.cpp:315 +#: debug/src/prefMencoder.cpp:286 debug/src/prefpreview.cpp:140 +#, no-c-format +msgid "Form1" +msgstr "" + +#: rc.cpp:103 debug/src/prefMPEG4.cpp:339 +#, no-c-format +msgid "Video" +msgstr "Видео" + +#: rc.cpp:106 debug/src/prefMPEG4.cpp:317 +#, no-c-format +msgid "2 pass" +msgstr "двухпроходное" + +#: rc.cpp:109 debug/src/prefMPEG4.cpp:318 +#, no-c-format +msgid "Alt+2" +msgstr "" + +#: rc.cpp:112 rc.cpp:163 debug/src/prefMPEG4.cpp:319 +#: debug/src/prefMPEG4.cpp:340 +#, no-c-format +msgid "Codec" +msgstr "Кодек" + +#: rc.cpp:115 rc.cpp:385 debug/src/prefMPEG4.cpp:321 +#: debug/src/prefMencoder.cpp:298 +#, no-c-format +msgid "XviD" +msgstr "" + +#: rc.cpp:118 debug/src/prefMPEG4.cpp:322 +#, no-c-format +msgid "lavc MPEG4" +msgstr "" + +#: rc.cpp:130 debug/src/prefMPEG4.cpp:327 +#, no-c-format +msgid "640" +msgstr "" + +#: rc.cpp:134 debug/src/prefMPEG4.cpp:329 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "ÑохранÑÑ‚ÑŒ пропорции" + +#: rc.cpp:137 rc.cpp:493 debug/src/playbackoptionsw.cpp:230 +#: debug/src/prefMPEG4.cpp:330 +#, no-c-format +msgid "Alt+K" +msgstr "" + +#: rc.cpp:141 rc.cpp:206 rc.cpp:238 debug/src/prefMPEG4.cpp:332 +#: debug/src/k9mainw.cpp:163 +#, no-c-format +msgid "X" +msgstr "" + +#: rc.cpp:145 debug/src/prefMPEG4.cpp:334 +#, no-c-format +msgid "File size" +msgstr "Размер файла" + +#: rc.cpp:148 debug/src/prefMPEG4.cpp:335 +#, no-c-format +msgid "Alt+S" +msgstr "" + +#: rc.cpp:151 debug/src/prefMPEG4.cpp:336 +#, no-c-format +msgid " MB" +msgstr "" + +#: rc.cpp:157 rc.cpp:519 debug/src/prefMPEG4.cpp:338 debug/src/prefDVD.cpp:100 +#, no-c-format +msgid "Alt+B" +msgstr "" + +#: rc.cpp:160 rc.cpp:263 rc.cpp:507 rc.cpp:575 +#: debug/src/playbackoptionsw.cpp:236 debug/src/prefAuthor.cpp:138 +#: debug/src/prefMPEG4.cpp:350 debug/k9Mplayer/mplayer.cpp:594 +#: src/k9langselect.cpp:79 +#, no-c-format +msgid "Audio" +msgstr "Ðудио" + +#: rc.cpp:166 debug/src/prefMPEG4.cpp:342 +#, no-c-format +msgid "mp3" +msgstr "" + +#: rc.cpp:172 debug/src/prefMPEG4.cpp:344 +#, no-c-format +msgid "mp2" +msgstr "" + +#: rc.cpp:175 debug/src/prefMPEG4.cpp:345 +#, no-c-format +msgid "ac3" +msgstr "" + +#: rc.cpp:178 debug/src/prefMPEG4.cpp:346 +#, no-c-format +msgid "adpcm ima" +msgstr "" + +#: rc.cpp:185 debug/src/prefMPEG4.cpp:349 +#, no-c-format +msgid "Gain" +msgstr "УÑиление" + +#: rc.cpp:188 debug/src/prefMPEG4.cpp:351 +#, no-c-format +msgid "use cell cache" +msgstr "иÑпользовать кеш Ñчеек" + +#: rc.cpp:191 rc.cpp:220 debug/src/k9mainw.cpp:157 +#, no-c-format +msgid "MainDlg" +msgstr "" + +#: rc.cpp:194 rc.cpp:223 debug/src/k9mainw.cpp:158 +#, no-c-format +msgid "Output device " +msgstr "УÑтройÑтво вывода" + +#: rc.cpp:197 rc.cpp:244 debug/src/k9mainw.cpp:166 +#, no-c-format +msgid "@" +msgstr "" + +#: rc.cpp:200 +#, no-c-format +msgid "Input device " +msgstr "УÑтройÑтво ввода" + +#: rc.cpp:203 rc.cpp:241 debug/src/k9mainw.cpp:165 libk9copy/k9burndvd.cpp:178 +#: libk9copy/k9burndvd.cpp:278 src/k9main.cpp:1344 +#: src/k9playbackoptions.cpp:147 k9author/k9import.cpp:207 +#, no-c-format +msgid "default" +msgstr "по-умолчанию" + +#: rc.cpp:209 +#, no-c-format +msgid "D&VD" +msgstr "" + +#: rc.cpp:212 rc.cpp:229 debug/src/k9mainw.cpp:65 debug/src/k9mainw.cpp:160 +#, no-c-format +msgid "Title" +msgstr "Ролик" + +#: rc.cpp:226 debug/src/k9mainw.cpp:159 src/main.cpp:37 +#, no-c-format +msgid "input device" +msgstr "УÑтройÑтво ввода" + +#: rc.cpp:235 debug/src/k9mainw.cpp:68 debug/src/k9mainw.cpp:162 +#, no-c-format +msgid "Content" +msgstr "Содержимое" + +#: rc.cpp:248 debug/src/k9mainw.cpp:168 +#, no-c-format +msgid "Open a folder" +msgstr "Открыть каталог" + +#: rc.cpp:252 debug/src/k9mainw.cpp:170 +#, no-c-format +msgid "Open an iso image" +msgstr "Открыть ISO-образ" + +#: rc.cpp:255 debug/src/viewmpeg2.cpp:205 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - ПредпроÑмотр Ролика" + +#: rc.cpp:260 debug/src/prefAuthor.cpp:137 +#, no-c-format +msgid "Authoring options" +msgstr "Параметры авторинга" + +#: rc.cpp:266 debug/src/prefAuthor.cpp:140 +#, no-c-format +msgid "AC3" +msgstr "" + +#: rc.cpp:269 debug/src/prefAuthor.cpp:141 +#, no-c-format +msgid "MP2" +msgstr "" + +#: rc.cpp:272 debug/src/prefAuthor.cpp:143 +#, no-c-format +msgid "128" +msgstr "" + +#: rc.cpp:275 debug/src/prefAuthor.cpp:144 +#, no-c-format +msgid "192" +msgstr "" + +#: rc.cpp:278 debug/src/prefAuthor.cpp:145 +#, no-c-format +msgid "320" +msgstr "" + +#: rc.cpp:281 debug/src/prefAuthor.cpp:146 +#, no-c-format +msgid "Format" +msgstr "Формат" + +#: rc.cpp:287 debug/src/prefAuthor.cpp:148 +#, no-c-format +msgid "Buttons" +msgstr "Кнопки" + +#: rc.cpp:299 debug/src/prefAuthor.cpp:152 +#, no-c-format +msgid "Hilite color" +msgstr "" + +#: rc.cpp:303 debug/src/prefAuthor.cpp:154 +#, no-c-format +msgid "Text color" +msgstr "Цвет текÑта" + +#: rc.cpp:307 debug/src/langselectw.cpp:120 src/k9copy.cpp:120 +#, no-c-format +msgid "Selection" +msgstr "Избранное" + +#: rc.cpp:310 debug/src/langselectw.cpp:93 debug/src/langselectw.cpp:121 +#, no-c-format +msgid "Languages" +msgstr "Языки" + +#: rc.cpp:317 debug/src/prefpreview.cpp:142 +#, no-c-format +msgid "&Internal Player" +msgstr "Ð’Ñтроенный проигрыватель" + +#: rc.cpp:320 debug/src/prefpreview.cpp:143 +#, no-c-format +msgid "Alt+I" +msgstr "" + +#: rc.cpp:323 debug/src/prefpreview.cpp:144 +#, no-c-format +msgid "MPlayer" +msgstr "" + +#: rc.cpp:326 debug/src/prefpreview.cpp:145 +#, no-c-format +msgid "Alt+M" +msgstr "" + +#: rc.cpp:329 debug/src/prefpreview.cpp:146 +#, no-c-format +msgid "Internal viewer options" +msgstr "Параметры вÑтроенного проÑмотрщика" + +#: rc.cpp:332 debug/src/prefpreview.cpp:147 +#, no-c-format +msgid "use OpenGL" +msgstr "иÑпользовать OpenGL" + +#: rc.cpp:335 debug/src/prefpreview.cpp:148 +#, no-c-format +msgid "Video output" +msgstr "Вывод видео" + +#: rc.cpp:338 debug/src/prefpreview.cpp:149 +#, no-c-format +msgid "Audio output" +msgstr "Вывод аудио" + +#: rc.cpp:341 debug/src/prefpreview.cpp:151 +#, no-c-format +msgid "X11" +msgstr "" + +#: rc.cpp:344 debug/src/prefpreview.cpp:152 +#, no-c-format +msgid "Xv" +msgstr "" + +#: rc.cpp:347 debug/src/prefpreview.cpp:153 +#, no-c-format +msgid "OpenGL" +msgstr "" + +#: rc.cpp:350 rc.cpp:359 debug/src/prefpreview.cpp:154 +#: debug/src/prefpreview.cpp:158 +#, no-c-format +msgid "SDL" +msgstr "" + +#: rc.cpp:353 debug/src/prefpreview.cpp:156 +#, no-c-format +msgid "ALSA" +msgstr "" + +#: rc.cpp:356 debug/src/prefpreview.cpp:157 +#, no-c-format +msgid "OSS" +msgstr "" + +#: rc.cpp:362 debug/src/prefpreview.cpp:159 +#, no-c-format +msgid "MPlayer options" +msgstr "Параметры MPlayer" + +#: rc.cpp:368 debug/src/prefMencoder.cpp:287 +#, no-c-format +msgid "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" +msgstr "" + +#: rc.cpp:375 debug/src/prefMencoder.cpp:292 +#, no-c-format +msgid "" +"pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" +msgstr "" +"проход номер\n" +"ширина видео\n" +"выÑота видео\n" +"битрейт видео\n" +"битрейт аудио" + +#: rc.cpp:382 debug/src/prefMencoder.cpp:326 +#, no-c-format +msgid "Video codecs" +msgstr "Видео кодеки" + +#: rc.cpp:391 debug/src/prefMencoder.cpp:300 +#, no-c-format +msgid "MJPEG" +msgstr "" + +#: rc.cpp:394 debug/src/prefMencoder.cpp:301 +#, no-c-format +msgid "LJPEG" +msgstr "" + +#: rc.cpp:397 debug/src/prefMencoder.cpp:302 +#, no-c-format +msgid "H.261" +msgstr "" + +#: rc.cpp:400 debug/src/prefMencoder.cpp:303 +#, no-c-format +msgid "H.263" +msgstr "" + +#: rc.cpp:403 debug/src/prefMencoder.cpp:304 +#, no-c-format +msgid "MPEG-4 (DivX 4/5)" +msgstr "" + +#: rc.cpp:406 debug/src/prefMencoder.cpp:305 +#, no-c-format +msgid "DivX 3" +msgstr "" + +#: rc.cpp:409 debug/src/prefMencoder.cpp:306 +#, no-c-format +msgid "MS MPEG-4 v2" +msgstr "" + +#: rc.cpp:412 debug/src/prefMencoder.cpp:307 +#, no-c-format +msgid "WMV7" +msgstr "" + +#: rc.cpp:415 debug/src/prefMencoder.cpp:308 +#, no-c-format +msgid "WMV8" +msgstr "" + +#: rc.cpp:418 debug/src/prefMencoder.cpp:309 +#, no-c-format +msgid "RealVideo" +msgstr "" + +#: rc.cpp:421 debug/src/prefMencoder.cpp:310 +#, no-c-format +msgid "MPEG-1" +msgstr "" + +#: rc.cpp:424 debug/src/prefMencoder.cpp:311 +#, no-c-format +msgid "MPEG-2" +msgstr "" + +#: rc.cpp:427 debug/src/prefMencoder.cpp:312 +#, no-c-format +msgid "HuffYUV" +msgstr "" + +#: rc.cpp:430 debug/src/prefMencoder.cpp:313 +#, no-c-format +msgid "ffvHuff" +msgstr "" + +#: rc.cpp:433 debug/src/prefMencoder.cpp:314 +#, no-c-format +msgid "ASUS v1" +msgstr "" + +#: rc.cpp:436 debug/src/prefMencoder.cpp:315 +#, no-c-format +msgid "ASUS v2" +msgstr "" + +#: rc.cpp:440 rc.cpp:465 rc.cpp:555 debug/src/configDlg.cpp:42 +#: debug/src/configDlg.cpp:95 debug/src/prefMencoder.cpp:317 +#: debug/src/prefMencoder.cpp:329 +#, no-c-format +msgid "label" +msgstr "метка" + +#: rc.cpp:443 debug/src/prefMencoder.cpp:318 +#, no-c-format +msgid "fourcc" +msgstr "" + +#: rc.cpp:446 debug/src/prefMencoder.cpp:319 +#, no-c-format +msgid "first pass" +msgstr "первый проход" + +#: rc.cpp:451 debug/src/prefMencoder.cpp:322 +#, no-c-format +msgid "one pass" +msgstr "один проход" + +#: rc.cpp:456 debug/src/prefMencoder.cpp:325 +#, no-c-format +msgid "second pass" +msgstr "второй проход" + +#: rc.cpp:459 debug/src/prefMencoder.cpp:332 +#, no-c-format +msgid "Audio codecs" +msgstr "Ðудио кодеки" + +#: rc.cpp:462 debug/src/prefMencoder.cpp:328 +#, no-c-format +msgid "New Item" +msgstr "Ðовый Ñлемент" + +#: rc.cpp:469 debug/src/prefMencoder.cpp:331 +#, no-c-format +msgid "options" +msgstr "параметры" + +#: rc.cpp:472 debug/src/prefMencoder.cpp:333 +#, no-c-format +msgid "Available variables" +msgstr "ДоÑтупные переменные" + +#: rc.cpp:475 debug/src/titlefactor.cpp:321 +#, no-c-format +msgid "Shrink Factors" +msgstr "КоÑффициент ÑжатиÑ" + +#: rc.cpp:478 debug/src/titlefactor.cpp:322 +#, no-c-format +msgid "Shrink Factor for Title %1" +msgstr "КоÑффициент ÑÐ¶Ð°Ñ‚Ð¸Ñ Ð´Ð»Ñ Ð Ð¾Ð»Ð¸ÐºÐ° %1" + +#: rc.cpp:481 debug/src/titlefactor.cpp:323 +#, no-c-format +msgid "Change Factor" +msgstr "Изменить коÑффициент" + +#: rc.cpp:484 debug/src/titlefactor.cpp:324 +#, no-c-format +msgid "0.00" +msgstr "" + +#: rc.cpp:487 debug/src/playbackoptionsw.cpp:228 src/k9copy.cpp:114 +#, no-c-format +msgid "DVD playback options" +msgstr "наÑтройки DVD-диÑка" + +#: rc.cpp:490 debug/src/playbackoptionsw.cpp:229 +#, no-c-format +msgid "&Keep original menus" +msgstr "ОÑтавить иÑходное меню" + +#: rc.cpp:498 debug/src/playbackoptionsw.cpp:233 +#, no-c-format +msgid "Selected Titles" +msgstr "Выбранные ролики" + +#: rc.cpp:501 debug/src/playbackoptionsw.cpp:234 +#, no-c-format +msgid "Default language" +msgstr "Язык по-умолчанию" + +#: rc.cpp:504 debug/src/playbackoptionsw.cpp:235 +#, no-c-format +msgid "Subtitle" +msgstr "Субтитры" + +#: rc.cpp:510 debug/src/prefDVD.cpp:97 +#, no-c-format +msgid "prefDVD" +msgstr "" + +#: rc.cpp:513 debug/src/prefDVD.cpp:98 +#, no-c-format +msgid "Output directory" +msgstr "Каталог вывода" + +#: rc.cpp:516 debug/src/prefDVD.cpp:99 +#, no-c-format +msgid "Burn with k3b" +msgstr "ЗапиÑать иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ K3B" + +#: rc.cpp:522 debug/src/prefDVD.cpp:101 +#, no-c-format +msgid "Auto burn" +msgstr "Ðвто запиÑÑŒ" + +#: rc.cpp:525 debug/src/prefDVD.cpp:102 +#, no-c-format +msgid "Alt+T" +msgstr "" + +#: rc.cpp:528 debug/src/prefDVD.cpp:103 +#, no-c-format +msgid "DVD size" +msgstr "Размер DVD-диÑка" + +#: rc.cpp:531 debug/src/prefDVD.cpp:104 +#, no-c-format +msgid "Quick scan" +msgstr "БыÑтрое Ñканирование" + +#: rc.cpp:534 debug/src/prefDVD.cpp:105 +#, no-c-format +msgid "Alt+Q" +msgstr "" + +#: rc.cpp:537 debug/src/prefDVD.cpp:106 +#, no-c-format +msgid "use dvdAuthor for copy without menus" +msgstr "иÑпользовать DVDAuthor Ð´Ð»Ñ ÐºÐ¾Ð¿Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð±ÐµÐ· меню" + +#: rc.cpp:540 debug/src/prefDVD.cpp:107 +#, no-c-format +msgid "Alt+D" +msgstr "" + +#: rc.cpp:543 debug/src/prefDVD.cpp:108 +#, no-c-format +msgid "Clear output directory on exit" +msgstr "Очищать каталог вывода при выходе" + +#: rc.cpp:546 debug/src/prefDVD.cpp:109 +#, no-c-format +msgid "Alt+Y" +msgstr "" + +#: rc.cpp:549 debug/src/configDlg.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - УÑтройÑтва" + +#: rc.cpp:552 debug/src/configDlg.cpp:40 debug/src/configDlg.cpp:94 +#, no-c-format +msgid "device" +msgstr "уÑтройÑтво" + +#: rc.cpp:558 debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:96 +#, no-c-format +msgid "Input" +msgstr "Ввод" + +#: rc.cpp:561 rc.cpp:597 debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:97 +#: debug/k9author/import.cpp:105 +#, no-c-format +msgid "Output" +msgstr "Вывод" + +#: rc.cpp:572 debug/k9Mplayer/mplayer.cpp:593 src/k9settings.cpp:57 +#: src/k9copy.cpp:128 src/k9copy.cpp:390 k9Mplayer/k9mplayer.cpp:97 +#, no-c-format +msgid "Preview" +msgstr "ПредпроÑмотр" + +#: rc.cpp:578 debug/k9Mplayer/mplayer.cpp:595 +#, no-c-format +msgid "Subpicture" +msgstr "Подкартинка" + +#: rc.cpp:585 debug/k9Mplayer/mplayer.cpp:600 +#, no-c-format +msgid "-" +msgstr "" + +#: rc.cpp:589 debug/k9Mplayer/mplayer.cpp:602 +#, no-c-format +msgid "+" +msgstr "" + +#: rc.cpp:594 debug/k9author/import.cpp:104 +#, no-c-format +msgid "import" +msgstr "импорт" + +#: rc.cpp:600 debug/k9author/import.cpp:44 debug/k9author/import.cpp:106 +#, no-c-format +msgid "Video files" +msgstr "Видео файлы" + +#: rc.cpp:606 debug/k9author/import.cpp:109 +#, no-c-format +msgid "PAL" +msgstr "" + +#: rc.cpp:609 debug/k9author/import.cpp:110 +#, no-c-format +msgid "NTSC" +msgstr "" + +#: rc.cpp:615 debug/k9author/chapterEdit.cpp:145 src/k9copy.cpp:211 +#: k9author/k9importfiles.cpp:34 +#, no-c-format +msgid "Chapter properties" +msgstr "СвойÑтва главы" + +#: rc.cpp:618 debug/k9author/chapterEdit.cpp:146 +#, no-c-format +msgid "start" +msgstr "Ñтарт" + +#: rc.cpp:621 debug/k9author/chapterEdit.cpp:147 +#, no-c-format +msgid "video" +msgstr "видео" + +#: rc.cpp:624 debug/k9author/chapterEdit.cpp:148 +#, no-c-format +msgid "" +"*.avi\n" +"*.mpeg" +msgstr "" + +#: rc.cpp:628 rc.cpp:643 debug/k9author/chapterEdit.cpp:150 +#: debug/k9author/chapterEdit.cpp:155 +#, no-c-format +msgid "set Current Frame" +msgstr "уÑтановить Текущий Кадр" + +#: rc.cpp:631 rc.cpp:637 debug/k9author/chapterEdit.cpp:151 +#: debug/k9author/chapterEdit.cpp:153 +#, no-c-format +msgid "break continuity" +msgstr "прервать непрерывноÑÑ‚ÑŒ" + +#: rc.cpp:634 debug/k9author/chapterEdit.cpp:152 +#, no-c-format +msgid "end" +msgstr "конец" + +#: rc.cpp:646 debug/k9author/chapterEdit.cpp:156 +#, no-c-format +msgid "set Title button" +msgstr "уÑтановить кнопку Ролика" + +#: rc.cpp:649 debug/k9author/newTitle.cpp:124 src/k9copy.cpp:204 +#: k9author/k9importfiles.cpp:40 k9author/k9newtitle.cpp:55 +#, no-c-format +msgid "Add title" +msgstr "Добавить ролик" + +#: rc.cpp:653 debug/k9author/newTitle.cpp:126 +#, no-c-format +msgid "number of chapters" +msgstr "количеÑтво глав" + +#: rc.cpp:656 debug/k9author/newTitle.cpp:127 +#, no-c-format +msgid "chapter length" +msgstr "длинна главы" + +#: rc.cpp:663 debug/k9author/newTitle.cpp:130 +#, no-c-format +msgid "Video file" +msgstr "Видео файл" + +#: rc.cpp:669 debug/k9author/menuEdit.cpp:146 src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +#, no-c-format +msgid "Edit Menu" +msgstr "Редактировать Меню" + +#: rc.cpp:672 debug/k9author/menuEdit.cpp:147 +#, no-c-format +msgid "Text" +msgstr "ТекÑÑ‚" + +#: rc.cpp:675 debug/k9author/menuEdit.cpp:148 +#, no-c-format +msgid "Background picture" +msgstr "Ð¤Ð¾Ð½Ð¾Ð²Ð°Ñ ÐºÐ°Ñ€Ñ‚Ð¸Ð½ÐºÐ°" + +#: rc.cpp:690 debug/k9author/menuEdit.cpp:156 k9author/k9menuedit.cpp:286 +#: k9author/k9import.cpp:45 +#, no-c-format +msgid "Root Menu" +msgstr "Корневое Меню" + +#: rc.cpp:693 debug/k9author/menuEdit.cpp:157 +#, no-c-format +msgid "At start" +msgstr "Ð’ начале" + +#: rc.cpp:696 debug/k9author/menuEdit.cpp:159 +#, no-c-format +msgid "Play menu" +msgstr "Меню воÑпроизведениÑ" + +#: rc.cpp:699 rc.cpp:711 debug/k9author/menuEdit.cpp:160 +#: debug/k9author/menuEdit.cpp:165 +#, no-c-format +msgid "Play title 1" +msgstr "ВоÑпроизвеÑти ролик 1" + +#: rc.cpp:702 debug/k9author/menuEdit.cpp:161 +#, no-c-format +msgid "At End" +msgstr "К конце" + +#: rc.cpp:705 debug/k9author/menuEdit.cpp:163 +#, no-c-format +msgid "Play root menu" +msgstr "ВоÑпроизвеÑти корневое меню" + +#: rc.cpp:708 debug/k9author/menuEdit.cpp:164 +#, no-c-format +msgid "Play title menu" +msgstr "ВоÑпроизвеÑти меню роликов" + +#: rc.cpp:717 +#, no-c-format +msgid "A&ctions" +msgstr "ДейÑтвиÑ" + +#: rc.cpp:720 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Панель дейÑтвий" + +#: debug/libk9copy/k9ifo2.moc.cpp:34 debug/libk9copy/k9ifo2.moc.cpp:42 +msgid "k9Ifo2" +msgstr "" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:34 +#: debug/libk9copy/k9dvdchapter.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "Ячейка Главы" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:107 +#: debug/libk9copy/k9dvdchapter.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "Глава" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "k9ЗапиÑать DVD-диÑк" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9DVDVideoStream" +msgstr "ВидеоПоток" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDAudioStream" +msgstr "ЗвуковойПоток" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDSubtitle" +msgstr "Субтитры" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDTitle" +msgstr "Ролик" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "ПрогреÑÑ" + +#: debug/libk9copy/k9dvdtitleset.moc.cpp:34 +#: debug/libk9copy/k9dvdtitleset.moc.cpp:42 +msgid "k9DVDTitleset" +msgstr "Группа роликов" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "Ðвтор" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "Размер" + +#: debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Меню ПредпроÑмотра" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "k9Widget" +msgstr "" + +#: debug/src/kviewmpeg2.moc.cpp:107 debug/src/kviewmpeg2.moc.cpp:115 +msgid "kViewMPEG2" +msgstr "" + +#: debug/k9Mplayer/k9mplayer.moc.cpp:34 debug/k9Mplayer/k9mplayer.moc.cpp:42 +msgid "K9Mplayer" +msgstr "" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "" + +#: libk9copy/k9dvd.cpp:133 +msgid "for visually impaired" +msgstr "Ð´Ð»Ñ Ð²Ð¸Ð·ÑƒÐ°Ð»ÑŒÐ½Ð¾ ухудшенного" + +#: libk9copy/k9dvd.cpp:134 +msgid "director's comments" +msgstr "комментарии режиÑÑера" + +#: libk9copy/k9dvd.cpp:135 +msgid "alternate director's comments" +msgstr "альтернативный комментарий режиÑÑера" + +#: libk9copy/k9dvd.cpp:139 +msgid "Large" +msgstr "Большой" + +#: libk9copy/k9dvd.cpp:140 +msgid "Children" +msgstr "Маленькие" + +#: libk9copy/k9dvd.cpp:141 libk9copy/k9dvd.cpp:147 libk9copy/k9dvd.cpp:148 +#: libk9copy/k9dvd.cpp:149 +msgid "reserved" +msgstr "зарезервировано" + +#: libk9copy/k9dvd.cpp:142 +msgid "Normal captions" +msgstr "Ðормальные заголовки" + +#: libk9copy/k9dvd.cpp:143 +msgid "Large captions" +msgstr "Большие заголовки" + +#: libk9copy/k9dvd.cpp:144 +msgid "Children captions" +msgstr "Маленькие заголовки" + +#: libk9copy/k9dvd.cpp:146 +msgid "Forced" +msgstr "Принудительно" + +#: libk9copy/k9dvd.cpp:150 +msgid "Director's comments" +msgstr "Комментарии режиÑÑера" + +#: libk9copy/k9dvd.cpp:151 +msgid "Large director's comments" +msgstr "Большие комментарии режиÑÑера" + +#: libk9copy/k9dvd.cpp:152 +msgid "Director's comments for children" +msgstr "Комментарии режиÑÑера Ð´Ð»Ñ Ð´ÐµÑ‚ÐµÐ¹" + +#: libk9copy/k9dvd.cpp:189 +msgid "Couldn't open %1 for title\n" +msgstr "Ðевозможно открыть %1 Ð´Ð»Ñ Ñ€Ð¾Ð»Ð¸ÐºÐ°\n" + +#: libk9copy/k9dvd.cpp:191 libk9copy/k9dvd.cpp:199 libk9copy/k9dvd.cpp:207 +#: libk9copy/k9dvd.cpp:368 src/k9main.cpp:563 +msgid "unknown" +msgstr "неизвеÑтно" + +#: libk9copy/k9dvd.cpp:197 +msgid "Couldn't seek in %1 for title\n" +msgstr "Ðевозможно перейти в %1 Ð´Ð»Ñ Ñ€Ð¾Ð»Ð¸ÐºÐ°\n" + +#: libk9copy/k9dvd.cpp:224 +msgid "Not Specified" +msgstr "Ðе указанно" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afar" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Abkhazian" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afrikaans" +msgstr "" + +#: libk9copy/k9dvd.cpp:224 +msgid "Amharic" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Arabic" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Assamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Aymara" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Azerbaijani" +msgstr "" + +#: libk9copy/k9dvd.cpp:225 +msgid "Bashkir" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Byelorussian" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bulgarian" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bihari" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bislama" +msgstr "" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bengali; Bangla" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Tibetan" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Breton" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Catalan" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Corsican" +msgstr "" + +#: libk9copy/k9dvd.cpp:227 +msgid "Czech" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Welsh" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Dansk" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Deutsch" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Greek" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "English" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Esperanto" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Espanol" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Estonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Basque" +msgstr "" + +#: libk9copy/k9dvd.cpp:229 +msgid "Persian" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Suomi" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Fiji" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Faroese" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Francais" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Frisian" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Gaelic" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Scots Gaelic" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Galician" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Guarani" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Gujarati" +msgstr "" + +#: libk9copy/k9dvd.cpp:231 +msgid "Hausa" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 libk9copy/k9dvd.cpp:234 +msgid "Hebrew" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hindi" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hrvatski" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Magyar" +msgstr "" + +#: libk9copy/k9dvd.cpp:232 +msgid "Armenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingua" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Indonesian" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingue" +msgstr "" + +#: libk9copy/k9dvd.cpp:233 +msgid "Inupiak" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Italiano" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Inuktitut" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Japanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:250 +msgid "Yiddish" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Javanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Georgian" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Kazakh" +msgstr "" + +#: libk9copy/k9dvd.cpp:235 +msgid "Greenlandic" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Cambodian" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kannada" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Korean" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kashmiri" +msgstr "" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kurdish" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kirghiz" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Latin" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lingala" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lithuanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Maori" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Macedonian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Mongolian" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Moldavian" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nepali" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nederlands" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Occitan" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Polish" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Portugues" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Romanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Russian" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Serbo-Croatian" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovak" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovenian" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Albanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Serbian" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Tamil" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Thai" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Turkish" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Ukrainian" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Vietnamese" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Chinese" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 libk9copy/k9dvd.cpp:252 libk9copy/k9dvd.cpp:475 +msgid "Unknown" +msgstr "ÐеизвеÑтно" + +#: libk9copy/k9dvd.cpp:342 +msgid "Can't open disc %1!\n" +msgstr "Ðевозможно открыть диÑк %1!\n" + +#: libk9copy/k9dvd.cpp:354 +msgid "Can't open main ifo!\n" +msgstr "Ðевозможно открыть главный ifo-файл!\n" + +#: libk9copy/k9dvd.cpp:396 libk9copy/k9dvd.cpp:691 +msgid "Title %1" +msgstr "Ролик %1" + +#: libk9copy/k9dvd.cpp:742 +msgid "reading title" +msgstr "чтение ролика" + +#: libk9copy/k9dvd.cpp:859 +msgid "Error opening vobs for title %1\n" +msgstr "Ошибка Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ð¸Ñ vob-файла(ов) Ð´Ð»Ñ Ñ€Ð¾Ð»Ð¸ÐºÐ° %1\n" + +#: libk9copy/k9dvd.cpp:870 +msgid "ERROR reading block %1\n" +msgstr "Ошибка Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ð±Ð»Ð¾ÐºÐ° %1\n" + +#: libk9copy/k9dvdauthor.cpp:148 libk9copy/k9dvdauthor.cpp:366 +msgid "'%1' not selected" +msgstr "'%1' не выбрано" + +#: libk9copy/k9dvdauthor.cpp:149 libk9copy/k9dvdauthor.cpp:367 +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9dvdauthor.cpp:436 +#: libk9copy/k9dvdauthor.cpp:445 libk9copy/k9dvdauthor.cpp:448 +#: libk9copy/k9burndvd.cpp:237 libk9copy/k9burndvd.cpp:321 +#: k9author/k9newdvd.cpp:122 +msgid "authoring" +msgstr "авторинг" + +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +#: k9Mplayer/k9mplayer.cpp:97 +msgid "Unable to run %1" +msgstr "Ðевозможно запуÑтить %1" + +#: libk9copy/k9dvdauthor.cpp:403 libk9copy/k9dvdauthor.cpp:476 +#: libk9copy/k9dvdauthor.cpp:514 src/k9settings.cpp:63 +#: k9author/k9newdvd.cpp:143 +msgid "Authoring" +msgstr "Ðвторинг" + +#: libk9copy/k9dvdauthor.cpp:436 +msgid "Dvdauthor error :\n" +msgstr "Dvdauthor ошибка :\n" + +#: libk9copy/k9dvdauthor.cpp:445 +msgid "Authoring cancelled" +msgstr "Ðвторинг отменен" + +#: libk9copy/k9dvdauthor.cpp:448 k9author/k9newdvd.cpp:136 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Ошибка во Ð²Ñ€ÐµÐ¼Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ DVDAuthor:\n" + +#: libk9copy/k9dvdauthor.cpp:515 +msgid "Fixing VOBUS" +msgstr "ИÑправление VOBUS" + +#: libk9copy/k9mp4enc.cpp:103 libk9copy/k9mp4enc.cpp:312 +msgid "Encoding error" +msgstr "Ошибка кодированиÑ" + +#: libk9copy/k9mp4enc.cpp:152 src/k9main.cpp:1155 +msgid "Save file to disk" +msgstr "Сохранить файл на диÑк" + +#: libk9copy/k9mp4enc.cpp:161 libk9copy/k9mp4enc.cpp:350 +#: src/k9prefmpeg4.cpp:34 src/k9mp4title.cpp:49 src/k9main.cpp:290 +#: src/k9main.cpp:300 src/k9main.cpp:310 src/k9main.cpp:330 src/k9main.cpp:588 +#: src/k9main.cpp:689 src/k9main.cpp:703 src/k9prefdvd.cpp:35 +msgid "MB" +msgstr "" + +#: libk9copy/k9mp4enc.cpp:233 libk9copy/k9mp4enc.cpp:235 +#: k9author/k9newdvd.cpp:247 +msgid "Encoding %1" +msgstr "КодируетÑÑ %1" + +#: libk9copy/k9mp4enc.cpp:233 +msgid "pass %1" +msgstr "проход %1" + +#: libk9copy/k9mp4enc.cpp:309 +msgid "MPEG-4 Encoding cancelled" +msgstr "MPEG-4 кодирование отменено" + +#: libk9copy/k9mp4enc.cpp:309 src/k9settings.cpp:48 src/k9main.cpp:1141 +msgid "MPEG-4 Encoding" +msgstr "MPEG-4 Кодирование" + +#: libk9copy/k9mp4enc.cpp:312 +msgid "Error while running mencoder :" +msgstr "Ошибка во Ð²Ñ€ÐµÐ¼Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ mencoder:" + +#: libk9copy/k9burndvd.cpp:188 libk9copy/k9burndvd.cpp:255 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - ЗапиÑÑŒ DVD-диÑка" + +#: libk9copy/k9burndvd.cpp:189 libk9copy/k9burndvd.cpp:256 +#: libk9copy/k9burndvd.cpp:348 src/k9main.cpp:435 +msgid "Burning DVD" +msgstr "ЗапиÑать DVD-диÑк" + +#: libk9copy/k9burndvd.cpp:200 libk9copy/k9burndvd.cpp:284 src/k9main.cpp:384 +#: k9author/k9import.cpp:178 +msgid "Save image to disk" +msgstr "Сохранить образ на диÑк" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:302 +msgid "Insert a recordable DVD" +msgstr "Ð’Ñтавьте запиÑываемый DVD-диÑк" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:303 +#: libk9copy/k9burndvd.cpp:309 libk9copy/k9burndvd.cpp:314 +msgid "DVD burning" +msgstr "ЗапиÑÑŒ DVD" + +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +msgid "Error burning DVD :\n" +msgstr "Ошибка запиÑи DVD-диÑка :\n" + +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:314 +msgid "DVD Burning finished" +msgstr "ЗапиÑÑŒ DVD-диÑка окончена" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "An error occured while Burning DVD: %1" +msgstr "Ошибка во Ð²Ñ€ÐµÐ¼Ñ Ð·Ð°Ð¿Ð¸Ñи DVD-диÑка: %1" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "Insert an other DVD" +msgstr "Ð’Ñтавьте другой DVD-диÑк" + +#: libk9copy/k9burndvd.cpp:349 +msgid "Current write speed :%1 x" +msgstr "Ð¢ÐµÐºÑƒÑ‰Ð°Ñ ÑкороÑÑ‚ÑŒ запиÑи :%1 x" + +#: libk9copy/k9dvdbackup.cpp:149 libk9copy/k9dvdbackup.cpp:163 +#: libk9copy/k9dvdbackup.cpp:513 libk9copy/k9dvdbackup.cpp:599 +msgid "DVD backup cancelled" +msgstr "Копирование DVD-диÑка отменено" + +#: libk9copy/k9dvdbackup.cpp:176 +msgid "unable to open VIDEO_TS.IFO" +msgstr "невозможно открыть VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:198 libk9copy/k9dvdbackup.cpp:381 +#: libk9copy/k9dvdbackup.cpp:446 +msgid "Unable to open file " +msgstr "Ðевозможно открыть файл" + +#: libk9copy/k9dvdbackup.cpp:277 +msgid "Unable to open titleset %1" +msgstr "Ðевозможно открыть группу роликов %1" + +#: libk9copy/k9dvdbackup.cpp:283 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting titleset %1" +msgstr "Извлечение группы роликов %1" + +#: libk9copy/k9dvdbackup.cpp:453 +msgid "Unable to open menu for titleset %1" +msgstr "Ðевозможно открыть меню Ð´Ð»Ñ Ð³Ñ€ÑƒÐ¿Ð¿Ñ‹ роликов %1" + +#: libk9copy/k9dvdbackup.cpp:479 +msgid "Extracting menu for titleset %1" +msgstr "Извлечение меню Ð´Ð»Ñ Ð³Ñ€ÑƒÐ¿Ð¿Ñ‹ роликов %1" + +#: libk9copy/k9dvdbackup.cpp:563 +msgid "Unable to open ifo file for titleset %1" +msgstr "Ðевозможно открыть ifo-файл Ð´Ð»Ñ Ð³Ñ€ÑƒÐ¿Ð¿Ñ‹ роликов %1" + +#: libk9copy/k9dvdbackup.cpp:575 libk9copy/k9dvdbackup.cpp:1694 +msgid "Unable to open DVD" +msgstr "Ðевозможно открыть DVD-диÑк" + +#: libk9copy/k9dvdbackup.cpp:585 +msgid "Unable to open vobs for titleset %1" +msgstr "Ðевозможно открыть vob-файл Ð´Ð»Ñ Ð³Ñ€ÑƒÐ¿Ð¿Ñ‹ роликов %1" + +#: libk9copy/k9dvdbackup.cpp:1381 +msgid "Updating vob %1" +msgstr "ОбновлÑетÑÑ vob %1" + +#: libk9copy/k9dvdbackup.cpp:1398 +msgid "DVD backup canceled" +msgstr "Копирование DVD-диÑка отменено" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "УÑтройÑтва" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "УÑтройÑтва не обнаруженные k9copy" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "" + +#: src/k9settings.cpp:34 src/k9copy.cpp:294 +msgid "DVD Backup" +msgstr "ÐšÐ¾Ð¿Ð¸Ñ DVD" + +#: src/k9settings.cpp:42 +msgid "MEncoder" +msgstr "" + +#: src/k9settings.cpp:42 +msgid "MPEG-4 Codecs" +msgstr "MPEG-4 Кодеки" + +#: src/k9settings.cpp:48 +msgid "MPEG-4" +msgstr "" + +#: src/k9settings.cpp:57 +msgid "Title preview" +msgstr "ПредпроÑмотр Ролика" + +#: src/k9mp4title.cpp:36 src/k9mp4title.cpp:109 src/k9titlefactor.cpp:99 +msgid "Select a Title in the treeview..." +msgstr "Выберите Ролик в дереве проÑмотра" + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "Утилита резервного ÐºÐ¾Ð¿Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ DVD Ð´Ð»Ñ KDE" + +#: src/main.cpp:39 +msgid "output device" +msgstr "УÑтройÑтво вывода" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "ролик Ð´Ð»Ñ Ð²Ð¾ÑпроизведениÑ" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "воÑпроизвеÑти ролик на Ñтандартный вывод" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "начальный Ñектор" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "конечный Ñектор" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "ÑпиÑок аудиопотоков " + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "ÑпиÑок spu-потоков" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "коÑффициент ÑжатиÑ" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "принудительный коÑффициент ÑжатиÑ" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "размер копируемой Ñчейки" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "общий размер выбранных роликов" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "размер копируемых глав" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "выбранные главы" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "новый размер DVD" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "выбранные главы" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "номер Ñчейки в выбранной главе" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° ÑтатуÑа" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "инициализировать файл ÑтатуÑа" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "продолжить воÑпроизведение Ñ Ð¿Ð¾Ñледнего Ñектора" + +#: src/main.cpp:58 +msgid "don't save status at end" +msgstr "не ÑохранÑÑ‚ÑŒ ÑÑ‚Ð°Ñ‚ÑƒÑ Ð¿Ñ€Ð¸ выходе" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "Ñохранить Ñчейку во временном файле перед кодированием" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "Ð´Ð»Ñ Ð²Ð½ÑƒÑ‚Ñ€ÐµÐ½Ð½ÐµÐ³Ð¾ иÑпользованиÑ" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "" + +#: src/main.cpp:69 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "ÐлекÑандр РыбчанÑкий" + +#: src/main.cpp:70 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "triosoft@triosoft.com.ua" + +#: src/k9prefmencoder.cpp:105 src/k9prefmencoder.cpp:109 +#: src/k9prefmencoder.cpp:120 src/k9prefmencoder.cpp:122 +msgid "new profile" +msgstr "новый профиль" + +#: src/k9copy.cpp:137 +msgid "Shrink Factor" +msgstr "КоÑффициент ÑжатиÑ" + +#: src/k9copy.cpp:194 k9author/k9importfiles.cpp:31 +msgid "Edit menu" +msgstr "Редактировать меню" + +#: src/k9copy.cpp:263 +msgid "Play title" +msgstr "ВоÑпроизвеÑти ролик" + +#: src/k9copy.cpp:279 +msgid "Create MPEG-4" +msgstr "Создать MPEG-4" + +#: src/k9copy.cpp:286 +msgid "Eject" +msgstr "Извлечь" + +#: src/k9copy.cpp:300 +msgid "DVD Author" +msgstr "DVD Ðвтор" + +#: src/k9copy.cpp:306 +msgid "Create DVD" +msgstr "Создать DVD" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding options" +msgstr "Параметры MPEG-4 кодированиÑ" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding Options" +msgstr "Параметры MPEG-4 кодированиÑ" + +#: src/k9copy.cpp:375 +msgid "Settings" +msgstr "ÐаÑтройки" + +#: src/k9langselect.cpp:90 +msgid "Subtitles" +msgstr "Субтитры" + +#: src/k9main.cpp:373 src/k9main.cpp:1141 +msgid "DVD is not opened" +msgstr "DVD-диÑк не открыт" + +#: src/k9main.cpp:373 src/k9main.cpp:395 +msgid "DVD Copy" +msgstr "ÐšÐ¾Ð¿Ð¸Ñ DVD" + +#: src/k9main.cpp:395 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"ÐедоÑтаточно меÑта на %1 \n" +"необходимо %2 Мб " + +#: src/k9main.cpp:399 +msgid "Backup in progress" +msgstr "Идет процеÑÑ ÐºÐ¾Ð¿Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ" + +#: src/k9main.cpp:459 src/k9main.cpp:608 src/k9main.cpp:1194 +msgid "Ready" +msgstr "Готово" + +#: src/k9main.cpp:464 k9author/k9import.cpp:156 +msgid "processing" +msgstr "обработка" + +#: src/k9main.cpp:499 src/k9main.cpp:1247 k9author/k9import.cpp:63 +msgid "ISO Image" +msgstr "ISO-образ" + +#: src/k9main.cpp:560 +msgid "Open DVD" +msgstr "Открыть DVD-диÑк" + +#: src/k9main.cpp:586 +msgid "Titleset %1" +msgstr "Группа роликов %1" + +#: src/k9main.cpp:636 +msgid "chapters" +msgstr "Главы" + +#: src/k9main.cpp:644 src/k9main.cpp:657 k9author/k9newtitle.cpp:117 +#: k9author/k9newtitle.cpp:139 +msgid "chapter %1" +msgstr "глава %1" + +#: src/k9main.cpp:645 src/k9main.cpp:660 src/k9main.cpp:719 src/k9main.cpp:737 +msgid "%1 MB" +msgstr "" + +#: src/k9main.cpp:699 +msgid "video %1 " +msgstr "видео %1 " + +#: src/k9main.cpp:710 +msgid "audio %1 " +msgstr "аудио %1 " + +#: src/k9main.cpp:730 +msgid "subpicture %1 " +msgstr "Ñубтитры %1 " + +#: src/k9main.cpp:1149 +msgid "Transcoding title : %1" +msgstr "Кодирую ролик : %1" + +#: src/k9main.cpp:1248 k9author/k9import.cpp:64 +msgid "Folder" +msgstr "Папка" + +#: src/k9main.cpp:1355 +msgid "Open ISO Image" +msgstr "Открыть ISO-образ" + +#: src/k9main.cpp:1366 +msgid "Open DVD folder" +msgstr "Открыть DVD каталог" + +#: src/k9mencodercmdgen.cpp:103 +msgid "Filters" +msgstr "Фильтр" + +#: src/k9playbackoptions.cpp:149 +msgid "none" +msgstr "" + +#: src/k9titlefactor.cpp:110 +msgid "Shrink Factor for %1" +msgstr "КоÑффициент ÑÐ¶Ð°Ñ‚Ð¸Ñ Ð´Ð»Ñ %1" + +#: k9author/k9newdvd.cpp:94 +msgid "Creating root menu" +msgstr "Создание корневого меню" + +#: k9author/k9newdvd.cpp:134 +msgid "The dvd authoring was canceled" +msgstr "Ðвторинг отменен" + +#: k9author/k9newdvd.cpp:160 +msgid "Creating menu for title %1" +msgstr "Создание меню Ð´Ð»Ñ Ñ€Ð¾Ð»Ð¸ÐºÐ° %1" + +#: k9author/k9newdvd.cpp:381 k9author/k9newtitle.cpp:63 +msgid "title %1" +msgstr "ролик %1" + +#: k9author/k9avidecode.cpp:31 k9author/k9avidecode.cpp:35 +msgid "Cannot open then library %1" +msgstr "Ðевозможно открыть библиотеку %1" + +#: k9author/k9avidecode.cpp:88 +msgid "Couldn't open the file %1" +msgstr "Ðевозможно открыть файл %1" + +#: k9author/k9avidecode.cpp:93 +msgid "Couldn't find stream information" +msgstr "Ðевозможно найти потоковую информацию" + +#: k9author/k9avidecode.cpp:106 +msgid "The file doesn't contain any video stream" +msgstr "Файл не Ñодержит видеопотока" + +#: k9author/k9avidecode.cpp:117 +msgid "Unsupported codec" +msgstr "Ðе поддерживаемый кодек" + +#: k9author/k9avidecode.cpp:122 +msgid "Could'nt open the codec" +msgstr "Ðевозможно открыть кодек" + +#: k9author/k9avidecode.cpp:133 +msgid "Unable to allocate memory for frames" +msgstr "Ðевозможно выделить памÑÑ‚ÑŒ Ð´Ð»Ñ ÐºÐ°Ð´Ñ€Ð¾Ð²" + +#: k9author/k9menuedit.cpp:245 +msgid "Title %1 Menu" +msgstr "Меню Ролика %1" + +#: k9author/k9menuedit.cpp:254 k9author/k9menuedit.cpp:291 +msgid "Play Menu" +msgstr "ВоÑпроизвеÑти Меню" + +#: k9author/k9menuedit.cpp:256 +msgid "Play Title" +msgstr "ВоÑпроизвеÑти Ролик" + +#: k9author/k9menuedit.cpp:262 +msgid "Play Root Menu" +msgstr "ВоÑпроизвеÑти Корневое Меню" + +#: k9author/k9menuedit.cpp:264 +msgid "Play Title Menu" +msgstr "ВоÑпроизвеÑти Меню Роликов" + +#: k9author/k9menuedit.cpp:269 k9author/k9menuedit.cpp:295 +msgid "Play Title %1" +msgstr "ВоÑпроизвеÑти Ролик %1" + +#: k9author/k9importfiles.cpp:24 +msgid "Create new DVD" +msgstr "Создать новый DVD" + diff --git a/po/sr.po b/po/sr.po new file mode 100644 index 0000000..22391bb --- /dev/null +++ b/po/sr.po @@ -0,0 +1,2196 @@ +# Serbian translation of k9copy +# Courtesy of Prevod.org team (http://prevod.org/) -- 2006, 2007. +# +# This file is distributed under the same license as the k9copy package. +# +# Милош Поповић +# +msgid "" +msgstr "" +"Project-Id-Version: k9copy\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-10-14 09:03+0200\n" +"PO-Revision-Date: 2007-08-15 11:15+0100\n" +"Last-Translator: Милош Поповић \n" +"Language-Team: Serbian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: rc.cpp:3 debug/libk9copy/backupdlg.cpp:156 libk9copy/k9dvdauthor.cpp:404 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Ðапредак прављења копије" + +#: rc.cpp:6 debug/libk9copy/backupdlg.cpp:157 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

DVD резервна копија

" + +#: rc.cpp:9 debug/libk9copy/backupdlg.cpp:158 +#, no-c-format +msgid "Current step" +msgstr "Тренутни корак" + +#: rc.cpp:12 rc.cpp:47 rc.cpp:65 debug/libk9copy/backupdlg.cpp:159 +#: debug/libk9copy/mp4dlg.cpp:148 debug/libk9copy/progress.cpp:116 +#, no-c-format +msgid "Elapsed Time" +msgstr "Протекло време" + +#: rc.cpp:15 rc.cpp:612 rc.cpp:640 rc.cpp:666 +#: debug/libk9copy/backupdlg.cpp:160 debug/k9author/newTitle.cpp:131 +#: debug/k9author/chapterEdit.cpp:154 debug/k9author/import.cpp:111 +#, no-c-format +msgid "--:--:--" +msgstr "--:--:--" + +#: rc.cpp:19 debug/libk9copy/dvdprogress.cpp:92 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - DVD анализа" + +#: rc.cpp:25 debug/libk9copy/processList.cpp:68 +#, no-c-format +msgid "Process List" +msgstr "ЛиÑта за обраду" + +#: rc.cpp:28 debug/libk9copy/processList.cpp:33 +#: debug/libk9copy/processList.cpp:69 +#, no-c-format +msgid "Processes" +msgstr "Обраде" + +#: rc.cpp:31 debug/libk9copy/processList.cpp:34 +#: debug/libk9copy/processList.cpp:70 +#, no-c-format +msgid "Elapsed" +msgstr "Протекло" + +#: rc.cpp:34 rc.cpp:603 debug/libk9copy/processList.cpp:35 +#: debug/libk9copy/processList.cpp:71 debug/k9author/import.cpp:46 +#: debug/k9author/import.cpp:107 +#, no-c-format +msgid "..." +msgstr "..." + +#: rc.cpp:40 debug/libk9copy/processList.cpp:73 debug/src/progress.cpp:81 +#, no-c-format +msgid "Alt+C" +msgstr "Alt+C" + +#: rc.cpp:43 debug/libk9copy/progress.cpp:114 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 +#, no-c-format +msgid "k9Copy" +msgstr "k9Copy" + +#: rc.cpp:52 debug/libk9copy/mp4dlg.cpp:141 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - Кодирање" + +#: rc.cpp:55 debug/libk9copy/mp4dlg.cpp:142 +#, no-c-format +msgid "Encoding" +msgstr "Кодирање" + +#: rc.cpp:62 debug/libk9copy/mp4dlg.cpp:147 k9author/k9newdvd.cpp:344 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: rc.cpp:68 rc.cpp:154 rc.cpp:181 rc.cpp:284 debug/libk9copy/mp4dlg.cpp:149 +#: debug/src/prefAuthor.cpp:147 debug/src/prefMPEG4.cpp:337 +#: debug/src/prefMPEG4.cpp:347 +#, no-c-format +msgid "Bitrate" +msgstr "БитÑки проток" + +#: rc.cpp:71 rc.cpp:215 rc.cpp:232 debug/libk9copy/mp4dlg.cpp:150 +#: debug/src/k9mainw.cpp:66 debug/src/k9mainw.cpp:161 +#, no-c-format +msgid "Size" +msgstr "Величина" + +#: rc.cpp:74 debug/src/mencoderCmdGen.cpp:98 src/k9mencodercmdgen.cpp:55 +#, no-c-format +msgid "MEncoder options" +msgstr "MEncoder опције" + +#: rc.cpp:78 debug/src/mencoderCmdGen.cpp:108 src/k9mencodercmdgen.cpp:68 +#, no-c-format +msgid "Audio Codec" +msgstr "Звучни кодек" + +#: rc.cpp:81 rc.cpp:169 debug/src/prefMPEG4.cpp:343 +#: debug/src/mencoderCmdGen.cpp:104 +#, no-c-format +msgid "faac" +msgstr "faac" + +#: rc.cpp:84 rc.cpp:96 debug/src/mencoderCmdGen.cpp:107 +#: debug/src/mencoderCmdGen.cpp:119 +#, no-c-format +msgid "lavc" +msgstr "lavc" + +#: rc.cpp:87 debug/src/mencoderCmdGen.cpp:120 src/k9mencodercmdgen.cpp:84 +#, no-c-format +msgid "Video Codec" +msgstr "Видео кодек" + +#: rc.cpp:90 rc.cpp:121 rc.cpp:388 debug/src/prefMPEG4.cpp:323 +#: debug/src/prefMencoder.cpp:299 debug/src/mencoderCmdGen.cpp:113 +#, no-c-format +msgid "x264" +msgstr "x264" + +#: rc.cpp:93 debug/src/mencoderCmdGen.cpp:116 +#, no-c-format +msgid "xvid" +msgstr "xvid" + +#: rc.cpp:99 rc.cpp:313 rc.cpp:365 debug/src/prefMPEG4.cpp:315 +#: debug/src/prefMencoder.cpp:286 debug/src/prefpreview.cpp:140 +#, no-c-format +msgid "Form1" +msgstr "Form1" + +#: rc.cpp:103 debug/src/prefMPEG4.cpp:339 +#, no-c-format +msgid "Video" +msgstr "Видео" + +#: rc.cpp:106 debug/src/prefMPEG4.cpp:317 +#, no-c-format +msgid "2 pass" +msgstr "2 пролаза" + +#: rc.cpp:109 debug/src/prefMPEG4.cpp:318 +#, no-c-format +msgid "Alt+2" +msgstr "Alt+2" + +#: rc.cpp:112 rc.cpp:163 debug/src/prefMPEG4.cpp:319 +#: debug/src/prefMPEG4.cpp:340 +#, no-c-format +msgid "Codec" +msgstr "Кодек" + +#: rc.cpp:115 rc.cpp:385 debug/src/prefMPEG4.cpp:321 +#: debug/src/prefMencoder.cpp:298 +#, no-c-format +msgid "XviD" +msgstr "Xvid" + +#: rc.cpp:118 debug/src/prefMPEG4.cpp:322 +#, no-c-format +msgid "lavc MPEG4" +msgstr "lavc MPEG4" + +#: rc.cpp:130 debug/src/prefMPEG4.cpp:327 +#, no-c-format +msgid "640" +msgstr "640" + +#: rc.cpp:134 debug/src/prefMPEG4.cpp:329 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "&задржи размеру" + +#: rc.cpp:137 rc.cpp:493 debug/src/playbackoptionsw.cpp:230 +#: debug/src/prefMPEG4.cpp:330 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: rc.cpp:141 rc.cpp:206 rc.cpp:238 debug/src/prefMPEG4.cpp:332 +#: debug/src/k9mainw.cpp:163 +#, no-c-format +msgid "X" +msgstr "X" + +#: rc.cpp:145 debug/src/prefMPEG4.cpp:334 +#, no-c-format +msgid "File size" +msgstr "Величина датотеке" + +#: rc.cpp:148 debug/src/prefMPEG4.cpp:335 +#, no-c-format +msgid "Alt+S" +msgstr "Alt+S" + +#: rc.cpp:151 debug/src/prefMPEG4.cpp:336 +#, no-c-format +msgid " MB" +msgstr " MB" + +#: rc.cpp:157 rc.cpp:519 debug/src/prefMPEG4.cpp:338 debug/src/prefDVD.cpp:100 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+B" + +#: rc.cpp:160 rc.cpp:263 rc.cpp:507 rc.cpp:575 +#: debug/src/playbackoptionsw.cpp:236 debug/src/prefAuthor.cpp:138 +#: debug/src/prefMPEG4.cpp:350 debug/k9Mplayer/mplayer.cpp:594 +#: src/k9langselect.cpp:79 +#, no-c-format +msgid "Audio" +msgstr "Звук" + +#: rc.cpp:166 debug/src/prefMPEG4.cpp:342 +#, no-c-format +msgid "mp3" +msgstr "mp3" + +#: rc.cpp:172 debug/src/prefMPEG4.cpp:344 +#, no-c-format +msgid "mp2" +msgstr "mp2" + +#: rc.cpp:175 debug/src/prefMPEG4.cpp:345 +#, no-c-format +msgid "ac3" +msgstr "ac3" + +#: rc.cpp:178 debug/src/prefMPEG4.cpp:346 +#, no-c-format +msgid "adpcm ima" +msgstr "adpcm ima" + +#: rc.cpp:185 debug/src/prefMPEG4.cpp:349 +#, no-c-format +msgid "Gain" +msgstr "Појачање" + +#: rc.cpp:188 debug/src/prefMPEG4.cpp:351 +#, no-c-format +msgid "use cell cache" +msgstr "кориÑти кеш ћелије" + +#: rc.cpp:191 rc.cpp:220 debug/src/k9mainw.cpp:157 +#, no-c-format +msgid "MainDlg" +msgstr "MainDlg" + +#: rc.cpp:194 rc.cpp:223 debug/src/k9mainw.cpp:158 +#, no-c-format +msgid "Output device " +msgstr "Излазни уређај " + +#: rc.cpp:197 rc.cpp:244 debug/src/k9mainw.cpp:166 +#, no-c-format +msgid "@" +msgstr "@" + +#: rc.cpp:200 +#, no-c-format +msgid "Input device " +msgstr "Улазни уређај " + +#: rc.cpp:203 rc.cpp:241 debug/src/k9mainw.cpp:165 libk9copy/k9burndvd.cpp:178 +#: libk9copy/k9burndvd.cpp:278 src/k9main.cpp:1344 +#: src/k9playbackoptions.cpp:147 k9author/k9import.cpp:207 +#, no-c-format +msgid "default" +msgstr "подразумевано" + +#: rc.cpp:209 +#, no-c-format +msgid "D&VD" +msgstr "&ДВД" + +#: rc.cpp:212 rc.cpp:229 debug/src/k9mainw.cpp:65 debug/src/k9mainw.cpp:160 +#, no-c-format +msgid "Title" +msgstr "ÐаÑлов" + +#: rc.cpp:226 debug/src/k9mainw.cpp:159 src/main.cpp:37 +#, no-c-format +msgid "input device" +msgstr "улазни уређај" + +#: rc.cpp:235 debug/src/k9mainw.cpp:68 debug/src/k9mainw.cpp:162 +#, no-c-format +msgid "Content" +msgstr "Садржај" + +#: rc.cpp:248 debug/src/k9mainw.cpp:168 +#, no-c-format +msgid "Open a folder" +msgstr "Отвори фаÑциклу" + +#: rc.cpp:252 debug/src/k9mainw.cpp:170 +#, no-c-format +msgid "Open an iso image" +msgstr "Отвори iso одраз" + +#: rc.cpp:255 debug/src/viewmpeg2.cpp:205 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Преглед наÑлова" + +#: rc.cpp:260 debug/src/prefAuthor.cpp:137 +#, no-c-format +msgid "Authoring options" +msgstr "Опције ауторизације" + +#: rc.cpp:266 debug/src/prefAuthor.cpp:140 +#, no-c-format +msgid "AC3" +msgstr "AC3" + +#: rc.cpp:269 debug/src/prefAuthor.cpp:141 +#, no-c-format +msgid "MP2" +msgstr "MP2" + +#: rc.cpp:272 debug/src/prefAuthor.cpp:143 +#, no-c-format +msgid "128" +msgstr "128" + +#: rc.cpp:275 debug/src/prefAuthor.cpp:144 +#, no-c-format +msgid "192" +msgstr "192" + +#: rc.cpp:278 debug/src/prefAuthor.cpp:145 +#, no-c-format +msgid "320" +msgstr "320" + +#: rc.cpp:281 debug/src/prefAuthor.cpp:146 +#, no-c-format +msgid "Format" +msgstr "Формат" + +#: rc.cpp:287 debug/src/prefAuthor.cpp:148 +#, no-c-format +msgid "Buttons" +msgstr "Дугмићи" + +#: rc.cpp:299 debug/src/prefAuthor.cpp:152 +#, no-c-format +msgid "Hilite color" +msgstr "Боја иÑтицања" + +#: rc.cpp:303 debug/src/prefAuthor.cpp:154 +#, no-c-format +msgid "Text color" +msgstr "Боја пиÑма" + +#: rc.cpp:307 debug/src/langselectw.cpp:120 src/k9copy.cpp:120 +#, no-c-format +msgid "Selection" +msgstr "Изабрано" + +#: rc.cpp:310 debug/src/langselectw.cpp:93 debug/src/langselectw.cpp:121 +#, no-c-format +msgid "Languages" +msgstr "Језици" + +#: rc.cpp:317 debug/src/prefpreview.cpp:142 +#, no-c-format +msgid "&Internal Player" +msgstr "ИнтегриÑани прегледач" + +#: rc.cpp:320 debug/src/prefpreview.cpp:143 +#, no-c-format +msgid "Alt+I" +msgstr "Alt+I" + +#: rc.cpp:323 debug/src/prefpreview.cpp:144 +#, no-c-format +msgid "MPlayer" +msgstr "MPlayer" + +#: rc.cpp:326 debug/src/prefpreview.cpp:145 +#, no-c-format +msgid "Alt+M" +msgstr "Alt+M" + +#: rc.cpp:329 debug/src/prefpreview.cpp:146 +#, no-c-format +msgid "Internal viewer options" +msgstr "Опције интегриÑаног прегледача" + +#: rc.cpp:332 debug/src/prefpreview.cpp:147 +#, no-c-format +msgid "use OpenGL" +msgstr "кориÑти OpenGL" + +#: rc.cpp:335 debug/src/prefpreview.cpp:148 +#, no-c-format +msgid "Video output" +msgstr "Видео излаз" + +#: rc.cpp:338 debug/src/prefpreview.cpp:149 +#, no-c-format +msgid "Audio output" +msgstr "Звучни излаз" + +#: rc.cpp:341 debug/src/prefpreview.cpp:151 +#, no-c-format +msgid "X11" +msgstr "X11" + +#: rc.cpp:344 debug/src/prefpreview.cpp:152 +#, no-c-format +msgid "Xv" +msgstr "Xv" + +#: rc.cpp:347 debug/src/prefpreview.cpp:153 +#, no-c-format +msgid "OpenGL" +msgstr "OpenGL" + +#: rc.cpp:350 rc.cpp:359 debug/src/prefpreview.cpp:154 +#: debug/src/prefpreview.cpp:158 +#, no-c-format +msgid "SDL" +msgstr "SDL" + +#: rc.cpp:353 debug/src/prefpreview.cpp:156 +#, no-c-format +msgid "ALSA" +msgstr "ALSA" + +#: rc.cpp:356 debug/src/prefpreview.cpp:157 +#, no-c-format +msgid "OSS" +msgstr "OSS" + +#: rc.cpp:362 debug/src/prefpreview.cpp:159 +#, no-c-format +msgid "MPlayer options" +msgstr "MPlayer опције" + +#: rc.cpp:368 debug/src/prefMencoder.cpp:287 +#, no-c-format +msgid "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" +msgstr "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" + +#: rc.cpp:375 debug/src/prefMencoder.cpp:292 +#, no-c-format +msgid "" +"pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" +msgstr "" +"број пролаза\n" +"ширина видеа\n" +"видина видеа\n" +"битÑки проток видеа\n" +"битÑки проток звука" + +#: rc.cpp:382 debug/src/prefMencoder.cpp:326 +#, no-c-format +msgid "Video codecs" +msgstr "Видео кодеци" + +#: rc.cpp:391 debug/src/prefMencoder.cpp:300 +#, no-c-format +msgid "MJPEG" +msgstr "MJPEG" + +#: rc.cpp:394 debug/src/prefMencoder.cpp:301 +#, no-c-format +msgid "LJPEG" +msgstr "LJPEG" + +#: rc.cpp:397 debug/src/prefMencoder.cpp:302 +#, no-c-format +msgid "H.261" +msgstr "H.261" + +#: rc.cpp:400 debug/src/prefMencoder.cpp:303 +#, no-c-format +msgid "H.263" +msgstr "H.263" + +#: rc.cpp:403 debug/src/prefMencoder.cpp:304 +#, no-c-format +msgid "MPEG-4 (DivX 4/5)" +msgstr "MPEG-4 (DivX 4/5)" + +#: rc.cpp:406 debug/src/prefMencoder.cpp:305 +#, no-c-format +msgid "DivX 3" +msgstr "DivX 3" + +#: rc.cpp:409 debug/src/prefMencoder.cpp:306 +#, no-c-format +msgid "MS MPEG-4 v2" +msgstr "MS MPEG-4 v2" + +#: rc.cpp:412 debug/src/prefMencoder.cpp:307 +#, no-c-format +msgid "WMV7" +msgstr "WMV7" + +#: rc.cpp:415 debug/src/prefMencoder.cpp:308 +#, no-c-format +msgid "WMV8" +msgstr "WMV8" + +#: rc.cpp:418 debug/src/prefMencoder.cpp:309 +#, no-c-format +msgid "RealVideo" +msgstr "RealVideo" + +#: rc.cpp:421 debug/src/prefMencoder.cpp:310 +#, no-c-format +msgid "MPEG-1" +msgstr "MPEG-1" + +#: rc.cpp:424 debug/src/prefMencoder.cpp:311 +#, no-c-format +msgid "MPEG-2" +msgstr "MPEG-2" + +#: rc.cpp:427 debug/src/prefMencoder.cpp:312 +#, no-c-format +msgid "HuffYUV" +msgstr "HuffYUV" + +#: rc.cpp:430 debug/src/prefMencoder.cpp:313 +#, no-c-format +msgid "ffvHuff" +msgstr "ffvHuff" + +#: rc.cpp:433 debug/src/prefMencoder.cpp:314 +#, no-c-format +msgid "ASUS v1" +msgstr "ASUS v1" + +#: rc.cpp:436 debug/src/prefMencoder.cpp:315 +#, no-c-format +msgid "ASUS v2" +msgstr "ASUS v2" + +#: rc.cpp:440 rc.cpp:465 rc.cpp:555 debug/src/configDlg.cpp:42 +#: debug/src/configDlg.cpp:95 debug/src/prefMencoder.cpp:317 +#: debug/src/prefMencoder.cpp:329 +#, no-c-format +msgid "label" +msgstr "натпиÑ" + +#: rc.cpp:443 debug/src/prefMencoder.cpp:318 +#, no-c-format +msgid "fourcc" +msgstr "fourcc" + +#: rc.cpp:446 debug/src/prefMencoder.cpp:319 +#, no-c-format +msgid "first pass" +msgstr "први пролаз" + +#: rc.cpp:451 debug/src/prefMencoder.cpp:322 +#, no-c-format +msgid "one pass" +msgstr "један пролаз" + +#: rc.cpp:456 debug/src/prefMencoder.cpp:325 +#, no-c-format +msgid "second pass" +msgstr "други пролаз" + +#: rc.cpp:459 debug/src/prefMencoder.cpp:332 +#, no-c-format +msgid "Audio codecs" +msgstr "Звучни кодек" + +#: rc.cpp:462 debug/src/prefMencoder.cpp:328 +#, no-c-format +msgid "New Item" +msgstr "Ðова Ñтавка" + +#: rc.cpp:469 debug/src/prefMencoder.cpp:331 +#, no-c-format +msgid "options" +msgstr "опције" + +#: rc.cpp:472 debug/src/prefMencoder.cpp:333 +#, no-c-format +msgid "Available variables" +msgstr "ДоÑтупне промењљиве" + +#: rc.cpp:475 debug/src/titlefactor.cpp:321 +#, no-c-format +msgid "Shrink Factors" +msgstr "Фактори Ñужења" + +#: rc.cpp:478 debug/src/titlefactor.cpp:322 +#, no-c-format +msgid "Shrink Factor for Title %1" +msgstr "Фактор Ñужења за наÑлов %1" + +#: rc.cpp:481 debug/src/titlefactor.cpp:323 +#, no-c-format +msgid "Change Factor" +msgstr "Промени фактор" + +#: rc.cpp:484 debug/src/titlefactor.cpp:324 +#, no-c-format +msgid "0.00" +msgstr "0.00" + +#: rc.cpp:487 debug/src/playbackoptionsw.cpp:228 src/k9copy.cpp:114 +#, no-c-format +msgid "DVD playback options" +msgstr "ПоÑтавке DVD репродукције" + +#: rc.cpp:490 debug/src/playbackoptionsw.cpp:229 +#, no-c-format +msgid "&Keep original menus" +msgstr "Задржи оригиналне меније" + +#: rc.cpp:498 debug/src/playbackoptionsw.cpp:233 +#, no-c-format +msgid "Selected Titles" +msgstr "Изабрани наÑлови" + +#: rc.cpp:501 debug/src/playbackoptionsw.cpp:234 +#, no-c-format +msgid "Default language" +msgstr "Подразумевани језик" + +#: rc.cpp:504 debug/src/playbackoptionsw.cpp:235 +#, no-c-format +msgid "Subtitle" +msgstr "Превод" + +#: rc.cpp:510 debug/src/prefDVD.cpp:97 +#, no-c-format +msgid "prefDVD" +msgstr "поÑтДВД" + +#: rc.cpp:513 debug/src/prefDVD.cpp:98 +#, no-c-format +msgid "Output directory" +msgstr "Излазни директоријум" + +#: rc.cpp:516 debug/src/prefDVD.cpp:99 +#, no-c-format +msgid "Burn with k3b" +msgstr "Упиши диÑк помоћу k3b-а" + +#: rc.cpp:522 debug/src/prefDVD.cpp:101 +#, no-c-format +msgid "Auto burn" +msgstr "ÐутоматÑки упиши диÑк" + +#: rc.cpp:525 debug/src/prefDVD.cpp:102 +#, no-c-format +msgid "Alt+T" +msgstr "Alt+T" + +#: rc.cpp:528 debug/src/prefDVD.cpp:103 +#, no-c-format +msgid "DVD size" +msgstr "Величина ДВД-а" + +#: rc.cpp:531 debug/src/prefDVD.cpp:104 +#, no-c-format +msgid "Quick scan" +msgstr "Брзо Ñкенирање" + +#: rc.cpp:534 debug/src/prefDVD.cpp:105 +#, no-c-format +msgid "Alt+Q" +msgstr "Alt+Q" + +#: rc.cpp:537 debug/src/prefDVD.cpp:106 +#, no-c-format +msgid "use dvdAuthor for copy without menus" +msgstr "кориÑти dvdAuthor за копије без менија" + +#: rc.cpp:540 debug/src/prefDVD.cpp:107 +#, no-c-format +msgid "Alt+D" +msgstr "Alt+D" + +#: rc.cpp:543 debug/src/prefDVD.cpp:108 +#, no-c-format +msgid "Clear output directory on exit" +msgstr "ОчиÑти излазни директоријум при излаÑку из програма" + +#: rc.cpp:546 debug/src/prefDVD.cpp:109 +#, no-c-format +msgid "Alt+Y" +msgstr "Alt+Y" + +#: rc.cpp:549 debug/src/configDlg.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Уређаји" + +#: rc.cpp:552 debug/src/configDlg.cpp:40 debug/src/configDlg.cpp:94 +#, no-c-format +msgid "device" +msgstr "уређај" + +#: rc.cpp:558 debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:96 +#, no-c-format +msgid "Input" +msgstr "Улаз" + +#: rc.cpp:561 rc.cpp:597 debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:97 +#: debug/k9author/import.cpp:105 +#, no-c-format +msgid "Output" +msgstr "Излаз" + +#: rc.cpp:572 debug/k9Mplayer/mplayer.cpp:593 src/k9settings.cpp:57 +#: src/k9copy.cpp:128 src/k9copy.cpp:390 k9Mplayer/k9mplayer.cpp:97 +#, no-c-format +msgid "Preview" +msgstr "Преглед" + +#: rc.cpp:578 debug/k9Mplayer/mplayer.cpp:595 +#, no-c-format +msgid "Subpicture" +msgstr "Превод" + +#: rc.cpp:585 debug/k9Mplayer/mplayer.cpp:600 +#, no-c-format +msgid "-" +msgstr "-" + +#: rc.cpp:589 debug/k9Mplayer/mplayer.cpp:602 +#, no-c-format +msgid "+" +msgstr "+" + +#: rc.cpp:594 debug/k9author/import.cpp:104 +#, no-c-format +msgid "import" +msgstr "увоз" + +#: rc.cpp:600 debug/k9author/import.cpp:44 debug/k9author/import.cpp:106 +#, no-c-format +msgid "Video files" +msgstr "Видео датотеке" + +#: rc.cpp:606 debug/k9author/import.cpp:109 +#, no-c-format +msgid "PAL" +msgstr "PAL" + +#: rc.cpp:609 debug/k9author/import.cpp:110 +#, no-c-format +msgid "NTSC" +msgstr "NTSC" + +#: rc.cpp:615 debug/k9author/chapterEdit.cpp:145 src/k9copy.cpp:211 +#: k9author/k9importfiles.cpp:34 +#, no-c-format +msgid "Chapter properties" +msgstr "ПоÑтавке поглавља" + +#: rc.cpp:618 debug/k9author/chapterEdit.cpp:146 +#, no-c-format +msgid "start" +msgstr "почетак" + +#: rc.cpp:621 debug/k9author/chapterEdit.cpp:147 +#, no-c-format +msgid "video" +msgstr "видео" + +#: rc.cpp:624 debug/k9author/chapterEdit.cpp:148 +#, no-c-format +msgid "" +"*.avi\n" +"*.mpeg" +msgstr "" +"*.avi\n" +"*.mpeg" + +#: rc.cpp:628 rc.cpp:643 debug/k9author/chapterEdit.cpp:150 +#: debug/k9author/chapterEdit.cpp:155 +#, no-c-format +msgid "set Current Frame" +msgstr "поÑтави тренутни кадар" + +#: rc.cpp:631 rc.cpp:637 debug/k9author/chapterEdit.cpp:151 +#: debug/k9author/chapterEdit.cpp:153 +#, no-c-format +msgid "break continuity" +msgstr "прекини континуитет" + +#: rc.cpp:634 debug/k9author/chapterEdit.cpp:152 +#, no-c-format +msgid "end" +msgstr "крај" + +#: rc.cpp:646 debug/k9author/chapterEdit.cpp:156 +#, no-c-format +msgid "set Title button" +msgstr "поÑтави ÐаÑловно дугме" + +#: rc.cpp:649 debug/k9author/newTitle.cpp:124 src/k9copy.cpp:204 +#: k9author/k9importfiles.cpp:40 k9author/k9newtitle.cpp:55 +#, no-c-format +msgid "Add title" +msgstr "Додај наÑлов" + +#: rc.cpp:653 debug/k9author/newTitle.cpp:126 +#, no-c-format +msgid "number of chapters" +msgstr "број поглавља" + +#: rc.cpp:656 debug/k9author/newTitle.cpp:127 +#, no-c-format +msgid "chapter length" +msgstr "дужина поглавља" + +#: rc.cpp:663 debug/k9author/newTitle.cpp:130 +#, no-c-format +msgid "Video file" +msgstr "Видео датотека" + +#: rc.cpp:669 debug/k9author/menuEdit.cpp:146 src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +#, no-c-format +msgid "Edit Menu" +msgstr "Уреди мени" + +#: rc.cpp:672 debug/k9author/menuEdit.cpp:147 +#, no-c-format +msgid "Text" +msgstr "ТекÑÑ‚" + +#: rc.cpp:675 debug/k9author/menuEdit.cpp:148 +#, no-c-format +msgid "Background picture" +msgstr "ПозадинÑка Ñлика" + +#: rc.cpp:690 debug/k9author/menuEdit.cpp:156 k9author/k9menuedit.cpp:286 +#: k9author/k9import.cpp:45 +#, no-c-format +msgid "Root Menu" +msgstr "Главни мени" + +#: rc.cpp:693 debug/k9author/menuEdit.cpp:157 +#, no-c-format +msgid "At start" +msgstr "Ðа почетак" + +#: rc.cpp:696 debug/k9author/menuEdit.cpp:159 +#, no-c-format +msgid "Play menu" +msgstr "ПуÑти мени" + +#: rc.cpp:699 rc.cpp:711 debug/k9author/menuEdit.cpp:160 +#: debug/k9author/menuEdit.cpp:165 +#, no-c-format +msgid "Play title 1" +msgstr "ПуÑти наÑлов 1" + +#: rc.cpp:702 debug/k9author/menuEdit.cpp:161 +#, no-c-format +msgid "At End" +msgstr "Ðа крај" + +#: rc.cpp:705 debug/k9author/menuEdit.cpp:163 +#, no-c-format +msgid "Play root menu" +msgstr "ПуÑти главни мени" + +#: rc.cpp:708 debug/k9author/menuEdit.cpp:164 +#, no-c-format +msgid "Play title menu" +msgstr "ПуÑти мени наÑлова" + +#: rc.cpp:717 +#, no-c-format +msgid "A&ctions" +msgstr "&Радње" + +#: rc.cpp:720 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Палета Ñа алатима радње" + +#: debug/libk9copy/k9ifo2.moc.cpp:34 debug/libk9copy/k9ifo2.moc.cpp:42 +msgid "k9Ifo2" +msgstr "k9Ifo2" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:34 +#: debug/libk9copy/k9dvdchapter.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "k9 ћелија Ñа поглављем" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:107 +#: debug/libk9copy/k9dvdchapter.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "k9DVD поглавље" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "k9 ÑƒÐ¿Ð¸Ñ Ð”Ð’Ð”-а" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "k9DVD" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9DVDVideoStream" +msgstr "k9DVD видео ток" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDAudioStream" +msgstr "k9DVD звучни ток" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDSubtitle" +msgstr "k9DVD превод" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDTitle" +msgstr "k9DVD наÑлов" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "k9DVD напредак" + +#: debug/libk9copy/k9dvdtitleset.moc.cpp:34 +#: debug/libk9copy/k9dvdtitleset.moc.cpp:42 +msgid "k9DVDTitleset" +msgstr "k9DVD низ наÑлова" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "k9DVD аутор" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "k9DVD величина" + +#: debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - преглед менија" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "kCD уређај" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "kCD уређаји" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "k9Widget" +msgstr "k9Widget" + +#: debug/src/kviewmpeg2.moc.cpp:107 debug/src/kviewmpeg2.moc.cpp:115 +msgid "kViewMPEG2" +msgstr "kViewMPEG2" + +#: debug/k9Mplayer/k9mplayer.moc.cpp:34 debug/k9Mplayer/k9mplayer.moc.cpp:42 +msgid "K9Mplayer" +msgstr "K9Mplayer" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "kDecMPEG2" + +#: libk9copy/k9dvd.cpp:133 +msgid "for visually impaired" +msgstr "за оÑобе Ñа оштећеним видом" + +#: libk9copy/k9dvd.cpp:134 +msgid "director's comments" +msgstr "коментар режиÑера" + +#: libk9copy/k9dvd.cpp:135 +msgid "alternate director's comments" +msgstr "додатни коментар режиÑера" + +#: libk9copy/k9dvd.cpp:139 +msgid "Large" +msgstr "Велико" + +#: libk9copy/k9dvd.cpp:140 +msgid "Children" +msgstr "Деца" + +#: libk9copy/k9dvd.cpp:141 libk9copy/k9dvd.cpp:147 libk9copy/k9dvd.cpp:148 +#: libk9copy/k9dvd.cpp:149 +msgid "reserved" +msgstr "очивано" + +#: libk9copy/k9dvd.cpp:142 +msgid "Normal captions" +msgstr "Ðормална Ñлова" + +#: libk9copy/k9dvd.cpp:143 +msgid "Large captions" +msgstr "Велика Ñлова" + +#: libk9copy/k9dvd.cpp:144 +msgid "Children captions" +msgstr "Мала Ñлова" + +#: libk9copy/k9dvd.cpp:146 +msgid "Forced" +msgstr "Приморано" + +#: libk9copy/k9dvd.cpp:150 +msgid "Director's comments" +msgstr "РежиÑеров коментар" + +#: libk9copy/k9dvd.cpp:151 +msgid "Large director's comments" +msgstr "Дуги режиÑеров коментар" + +#: libk9copy/k9dvd.cpp:152 +msgid "Director's comments for children" +msgstr "РежиÑеров коментар за децу" + +#: libk9copy/k9dvd.cpp:189 +msgid "Couldn't open %1 for title\n" +msgstr "Ðе могу да отворим %1 за наÑлов\n" + +#: libk9copy/k9dvd.cpp:191 libk9copy/k9dvd.cpp:199 libk9copy/k9dvd.cpp:207 +#: libk9copy/k9dvd.cpp:368 src/k9main.cpp:563 +msgid "unknown" +msgstr "непознато" + +#: libk9copy/k9dvd.cpp:197 +msgid "Couldn't seek in %1 for title\n" +msgstr "Ðе могу да трагам у %1 за наÑлов\n" + +#: libk9copy/k9dvd.cpp:224 +msgid "Not Specified" +msgstr "Ðије одређено" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afar" +msgstr "афарÑки" + +#: libk9copy/k9dvd.cpp:224 +msgid "Abkhazian" +msgstr "абхазијÑки" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afrikaans" +msgstr "афрички" + +#: libk9copy/k9dvd.cpp:224 +msgid "Amharic" +msgstr "амхарÑки" + +#: libk9copy/k9dvd.cpp:225 +msgid "Arabic" +msgstr "арапÑки" + +#: libk9copy/k9dvd.cpp:225 +msgid "Assamese" +msgstr "аÑамешки" + +#: libk9copy/k9dvd.cpp:225 +msgid "Aymara" +msgstr "ајмарÑки" + +#: libk9copy/k9dvd.cpp:225 +msgid "Azerbaijani" +msgstr "азербејџанÑки" + +#: libk9copy/k9dvd.cpp:225 +msgid "Bashkir" +msgstr "башкирÑки" + +#: libk9copy/k9dvd.cpp:226 +msgid "Byelorussian" +msgstr "белоруÑки" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bulgarian" +msgstr "бугарÑки" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bihari" +msgstr "бихарÑки" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bislama" +msgstr "биÑламÑки" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bengali; Bangla" +msgstr "бенгали" + +#: libk9copy/k9dvd.cpp:227 +msgid "Tibetan" +msgstr "тибетанÑки" + +#: libk9copy/k9dvd.cpp:227 +msgid "Breton" +msgstr "бретонÑки" + +#: libk9copy/k9dvd.cpp:227 +msgid "Catalan" +msgstr "каталонÑки" + +#: libk9copy/k9dvd.cpp:227 +msgid "Corsican" +msgstr "корзиканÑки" + +#: libk9copy/k9dvd.cpp:227 +msgid "Czech" +msgstr "чешки" + +#: libk9copy/k9dvd.cpp:228 +msgid "Welsh" +msgstr "велшки" + +#: libk9copy/k9dvd.cpp:228 +msgid "Dansk" +msgstr "данÑки" + +#: libk9copy/k9dvd.cpp:228 +msgid "Deutsch" +msgstr "немачки" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Greek" +msgstr "грчки" + +#: libk9copy/k9dvd.cpp:228 +msgid "English" +msgstr "енглеÑки" + +#: libk9copy/k9dvd.cpp:229 +msgid "Esperanto" +msgstr "еÑперанто" + +#: libk9copy/k9dvd.cpp:229 +msgid "Espanol" +msgstr "шпањолÑки" + +#: libk9copy/k9dvd.cpp:229 +msgid "Estonian" +msgstr "еÑтонÑки" + +#: libk9copy/k9dvd.cpp:229 +msgid "Basque" +msgstr "баÑкијÑки" + +#: libk9copy/k9dvd.cpp:229 +msgid "Persian" +msgstr "перÑијÑки" + +#: libk9copy/k9dvd.cpp:230 +msgid "Suomi" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Fiji" +msgstr "фиџи" + +#: libk9copy/k9dvd.cpp:230 +msgid "Faroese" +msgstr "фароÑки" + +#: libk9copy/k9dvd.cpp:230 +msgid "Francais" +msgstr "француÑки" + +#: libk9copy/k9dvd.cpp:230 +msgid "Frisian" +msgstr "фризијÑки" + +#: libk9copy/k9dvd.cpp:230 +msgid "Gaelic" +msgstr "галÑки" + +#: libk9copy/k9dvd.cpp:231 +msgid "Scots Gaelic" +msgstr "шкотÑки галÑки" + +#: libk9copy/k9dvd.cpp:231 +msgid "Galician" +msgstr "галицијÑки" + +#: libk9copy/k9dvd.cpp:231 +msgid "Guarani" +msgstr "гуарани" + +#: libk9copy/k9dvd.cpp:231 +msgid "Gujarati" +msgstr "гуџарати" + +#: libk9copy/k9dvd.cpp:231 +msgid "Hausa" +msgstr "хауÑа" + +#: libk9copy/k9dvd.cpp:232 libk9copy/k9dvd.cpp:234 +msgid "Hebrew" +msgstr "хебрејÑки" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hindi" +msgstr "хинду" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hrvatski" +msgstr "хрватÑки" + +#: libk9copy/k9dvd.cpp:232 +msgid "Magyar" +msgstr "мађарÑки" + +#: libk9copy/k9dvd.cpp:232 +msgid "Armenian" +msgstr "јерменÑки" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingua" +msgstr "вишејезички" + +#: libk9copy/k9dvd.cpp:233 +msgid "Indonesian" +msgstr "индонезијÑки" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingue" +msgstr "вишејезички" + +#: libk9copy/k9dvd.cpp:233 +msgid "Inupiak" +msgstr "инупиак" + +#: libk9copy/k9dvd.cpp:234 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Italiano" +msgstr "италијанÑки" + +#: libk9copy/k9dvd.cpp:234 +msgid "Inuktitut" +msgstr "Инуктитут (транÑлитеровано)" + +#: libk9copy/k9dvd.cpp:234 +msgid "Japanese" +msgstr "јапанÑки" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:250 +msgid "Yiddish" +msgstr "јеврејÑки" + +#: libk9copy/k9dvd.cpp:235 +msgid "Javanese" +msgstr "јаванÑки" + +#: libk9copy/k9dvd.cpp:235 +msgid "Georgian" +msgstr "грузијÑки" + +#: libk9copy/k9dvd.cpp:235 +msgid "Kazakh" +msgstr "казахÑтанÑки" + +#: libk9copy/k9dvd.cpp:235 +msgid "Greenlandic" +msgstr "калалиÑут (гренландÑки)" + +#: libk9copy/k9dvd.cpp:236 +msgid "Cambodian" +msgstr "камбоџанÑки" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kannada" +msgstr "канадÑки" + +#: libk9copy/k9dvd.cpp:236 +msgid "Korean" +msgstr "корејÑки" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kashmiri" +msgstr "кашмирÑки" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kurdish" +msgstr "курдÑки" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kirghiz" +msgstr "киргишки" + +#: libk9copy/k9dvd.cpp:237 +msgid "Latin" +msgstr "латинÑки" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lingala" +msgstr "лингала" + +#: libk9copy/k9dvd.cpp:237 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lithuanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Maori" +msgstr "маори" + +#: libk9copy/k9dvd.cpp:238 +msgid "Macedonian" +msgstr "македонÑки" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Mongolian" +msgstr "монголÑки" + +#: libk9copy/k9dvd.cpp:239 +msgid "Moldavian" +msgstr "молдавÑки" + +#: libk9copy/k9dvd.cpp:239 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nepali" +msgstr "непалÑки" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nederlands" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Occitan" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Polish" +msgstr "пољÑки" + +#: libk9copy/k9dvd.cpp:241 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Portugues" +msgstr "португалÑки" + +#: libk9copy/k9dvd.cpp:242 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Romanian" +msgstr "румунÑки" + +#: libk9copy/k9dvd.cpp:243 +msgid "Russian" +msgstr "руÑки" + +#: libk9copy/k9dvd.cpp:243 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Serbo-Croatian" +msgstr "ÑрпÑко-хрватÑки" + +#: libk9copy/k9dvd.cpp:244 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovak" +msgstr "Ñловачки" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovenian" +msgstr "ÑловенÑки" + +#: libk9copy/k9dvd.cpp:244 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Albanian" +msgstr "албанÑки" + +#: libk9copy/k9dvd.cpp:245 +msgid "Serbian" +msgstr "ÑрпÑки" + +#: libk9copy/k9dvd.cpp:245 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Tamil" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Thai" +msgstr "тајландÑки (таи)" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Turkish" +msgstr "турÑки" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Ukrainian" +msgstr "украинÑки" + +#: libk9copy/k9dvd.cpp:249 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Vietnamese" +msgstr "вијетнамÑки" + +#: libk9copy/k9dvd.cpp:250 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Chinese" +msgstr "кинеÑки" + +#: libk9copy/k9dvd.cpp:251 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 libk9copy/k9dvd.cpp:252 libk9copy/k9dvd.cpp:475 +msgid "Unknown" +msgstr "непознат" + +#: libk9copy/k9dvd.cpp:342 +msgid "Can't open disc %1!\n" +msgstr "Ðе могу да отворим диÑк %1!\n" + +#: libk9copy/k9dvd.cpp:354 +msgid "Can't open main ifo!\n" +msgstr "Ме могу да отворим главни ifo!\n" + +#: libk9copy/k9dvd.cpp:396 libk9copy/k9dvd.cpp:691 +msgid "Title %1" +msgstr "ÐаÑлов %1" + +#: libk9copy/k9dvd.cpp:742 +msgid "reading title" +msgstr "читам наÑлов" + +#: libk9copy/k9dvd.cpp:859 +msgid "Error opening vobs for title %1\n" +msgstr "Грешка при отварању vob-ова за наÑлов %1\n" + +#: libk9copy/k9dvd.cpp:870 +msgid "ERROR reading block %1\n" +msgstr "Грешка при читању блока %1\n" + +#: libk9copy/k9dvdauthor.cpp:148 libk9copy/k9dvdauthor.cpp:366 +msgid "'%1' not selected" +msgstr "'%1' није изабран" + +#: libk9copy/k9dvdauthor.cpp:149 libk9copy/k9dvdauthor.cpp:367 +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9dvdauthor.cpp:436 +#: libk9copy/k9dvdauthor.cpp:445 libk9copy/k9dvdauthor.cpp:448 +#: libk9copy/k9burndvd.cpp:237 libk9copy/k9burndvd.cpp:321 +#: k9author/k9newdvd.cpp:122 +msgid "authoring" +msgstr "ауторизујем" + +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +#: k9Mplayer/k9mplayer.cpp:97 +msgid "Unable to run %1" +msgstr "Ðе могу да покренем %1" + +#: libk9copy/k9dvdauthor.cpp:403 libk9copy/k9dvdauthor.cpp:476 +#: libk9copy/k9dvdauthor.cpp:514 src/k9settings.cpp:63 +#: k9author/k9newdvd.cpp:143 +msgid "Authoring" +msgstr "Ðуторизујем" + +#: libk9copy/k9dvdauthor.cpp:436 +msgid "Dvdauthor error :\n" +msgstr "Грешка у програму Dvdauthor :\n" + +#: libk9copy/k9dvdauthor.cpp:445 +msgid "Authoring cancelled" +msgstr "Ðуторизација прекинута" + +#: libk9copy/k9dvdauthor.cpp:448 k9author/k9newdvd.cpp:136 +msgid "An error occured while running DVDAuthor:\n" +msgstr "Грешка је наÑтала при раду Ñа DVDAuthor:\n" + +#: libk9copy/k9dvdauthor.cpp:515 +msgid "Fixing VOBUS" +msgstr "Поправљање VOBUS" + +#: libk9copy/k9mp4enc.cpp:103 libk9copy/k9mp4enc.cpp:312 +msgid "Encoding error" +msgstr "Грешка у кодирању" + +#: libk9copy/k9mp4enc.cpp:152 src/k9main.cpp:1155 +msgid "Save file to disk" +msgstr "Сачувај датотеку на диÑк" + +#: libk9copy/k9mp4enc.cpp:161 libk9copy/k9mp4enc.cpp:350 +#: src/k9prefmpeg4.cpp:34 src/k9mp4title.cpp:49 src/k9main.cpp:290 +#: src/k9main.cpp:300 src/k9main.cpp:310 src/k9main.cpp:330 src/k9main.cpp:588 +#: src/k9main.cpp:689 src/k9main.cpp:703 src/k9prefdvd.cpp:35 +msgid "MB" +msgstr "MB" + +#: libk9copy/k9mp4enc.cpp:233 libk9copy/k9mp4enc.cpp:235 +#: k9author/k9newdvd.cpp:247 +msgid "Encoding %1" +msgstr "Кодирање %1" + +#: libk9copy/k9mp4enc.cpp:233 +msgid "pass %1" +msgstr "пролаз %1" + +#: libk9copy/k9mp4enc.cpp:309 +msgid "MPEG-4 Encoding cancelled" +msgstr "MPEG-4 кодирање прекинуто" + +#: libk9copy/k9mp4enc.cpp:309 src/k9settings.cpp:48 src/k9main.cpp:1141 +msgid "MPEG-4 Encoding" +msgstr "MPEG-4 кодирање" + +#: libk9copy/k9mp4enc.cpp:312 +msgid "Error while running mencoder :" +msgstr "Грешка при покретању програма mencoder :" + +#: libk9copy/k9burndvd.cpp:188 libk9copy/k9burndvd.cpp:255 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - Ð£Ð¿Ð¸Ñ Ð”Ð’Ð” диÑка" + +#: libk9copy/k9burndvd.cpp:189 libk9copy/k9burndvd.cpp:256 +#: libk9copy/k9burndvd.cpp:348 src/k9main.cpp:435 +msgid "Burning DVD" +msgstr "УпиÑивање ДВД диÑка" + +#: libk9copy/k9burndvd.cpp:200 libk9copy/k9burndvd.cpp:284 src/k9main.cpp:384 +#: k9author/k9import.cpp:178 +msgid "Save image to disk" +msgstr "Сачувај Ñлику на диÑк" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:302 +msgid "Insert a recordable DVD" +msgstr "Убаците упиÑив ДВД диÑк" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:303 +#: libk9copy/k9burndvd.cpp:309 libk9copy/k9burndvd.cpp:314 +msgid "DVD burning" +msgstr "УпиÑивање ДВД диÑка" + +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +msgid "Error burning DVD :\n" +msgstr "Грешка при упиÑу на ДВД :\n" + +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:314 +msgid "DVD Burning finished" +msgstr "УпиÑивање ДВД диÑка завршено" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "An error occured while Burning DVD: %1" +msgstr "Појавила Ñе грешка при упиÑивању ДВД диÑка: %1" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "Insert an other DVD" +msgstr "Убаците други ДВД" + +#: libk9copy/k9burndvd.cpp:349 +msgid "Current write speed :%1 x" +msgstr "Тренутна брзина упиÑа :%1 x" + +#: libk9copy/k9dvdbackup.cpp:149 libk9copy/k9dvdbackup.cpp:163 +#: libk9copy/k9dvdbackup.cpp:513 libk9copy/k9dvdbackup.cpp:599 +msgid "DVD backup cancelled" +msgstr "Прављење DVD резервне копије прекинуто" + +#: libk9copy/k9dvdbackup.cpp:176 +msgid "unable to open VIDEO_TS.IFO" +msgstr "Ðе могу да отворим VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:198 libk9copy/k9dvdbackup.cpp:381 +#: libk9copy/k9dvdbackup.cpp:446 +msgid "Unable to open file " +msgstr "Ðе могу да отворим датотеку " + +#: libk9copy/k9dvdbackup.cpp:277 +msgid "Unable to open titleset %1" +msgstr "Ðе могу да отворим низ наÑлова %1" + +#: libk9copy/k9dvdbackup.cpp:283 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting titleset %1" +msgstr "Чупам низ наÑлова %1" + +#: libk9copy/k9dvdbackup.cpp:453 +msgid "Unable to open menu for titleset %1" +msgstr "Ðе могу да отворим мени за низ наÑлова %1" + +#: libk9copy/k9dvdbackup.cpp:479 +msgid "Extracting menu for titleset %1" +msgstr "Чупам мени за низ наÑлова %1" + +#: libk9copy/k9dvdbackup.cpp:563 +msgid "Unable to open ifo file for titleset %1" +msgstr "Ðе могу да отворим ifo датотеку за низ наÑлова %1" + +#: libk9copy/k9dvdbackup.cpp:575 libk9copy/k9dvdbackup.cpp:1694 +msgid "Unable to open DVD" +msgstr "Ðе могу да отворим DVD" + +#: libk9copy/k9dvdbackup.cpp:585 +msgid "Unable to open vobs for titleset %1" +msgstr "Ðе могу да отворим vob-ове за низ наÑлова %1" + +#: libk9copy/k9dvdbackup.cpp:1381 +msgid "Updating vob %1" +msgstr "Ðжурирам vob %1" + +#: libk9copy/k9dvdbackup.cpp:1398 +msgid "DVD backup canceled" +msgstr "Прављење резервне копије прекинуто" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "Уређаји" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "Уређаји ниÑу пронађени од Ñтране програма" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 src/k9copy.cpp:294 +msgid "DVD Backup" +msgstr "DVD резервна копија" + +#: src/k9settings.cpp:42 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:42 +msgid "MPEG-4 Codecs" +msgstr "MPEG-4 кодеци" + +#: src/k9settings.cpp:48 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:57 +msgid "Title preview" +msgstr "преглед наÑлова" + +#: src/k9mp4title.cpp:36 src/k9mp4title.cpp:109 src/k9titlefactor.cpp:99 +msgid "Select a Title in the treeview..." +msgstr "Изаберите наÑлов у Ñтаблу за преглед..." + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "Ðлат за прављење DVD резервних копија у КДЕ окружењу" + +#: src/main.cpp:39 +msgid "output device" +msgstr "излазни уређај" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "наÑлов који да пуÑтим" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "пуÑти наÑлов на Ñтандардни излаз" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "обележивач почетка" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "обележивач краја" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "лиÑта звучних токова" + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "луÑта spu токова" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "фактор компреÑије" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "приморани фактор компреÑије" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "величина ћелије за умножавање" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "укупна величина изабраних наÑлова" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "величина поглавља за умножавање" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "изабрана поглавља" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "величина новог ДВД-а" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "изабрано поглавње" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "број ћелије у изабраном поглављу" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "име датотеке за Ñтање" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "покрени датотеку за Ñтањем" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "наÑтави репродукцију од задњег Ñектора" + +#: src/main.cpp:58 +msgid "don't save status at end" +msgstr "не чувај Ñтање на крају" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "Ñачувај ћелију у привремену датотеку пре кодирања" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "за унутарњу употребу" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "k9Copy" + +#: src/main.cpp:69 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "_: ИМЕ ПРЕВОДИЛÐЦÐ\\nМилош Поповић" + +#: src/main.cpp:70 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "_: МЕЈЛ ÐДРЕСРПРЕВОДИЛÐЦÐ\\ngpopac@gmail.com" + +#: src/k9prefmencoder.cpp:105 src/k9prefmencoder.cpp:109 +#: src/k9prefmencoder.cpp:120 src/k9prefmencoder.cpp:122 +msgid "new profile" +msgstr "нови профил" + +#: src/k9copy.cpp:137 +msgid "Shrink Factor" +msgstr "Фактор компреÑије" + +#: src/k9copy.cpp:194 k9author/k9importfiles.cpp:31 +msgid "Edit menu" +msgstr "Уреди мени" + +#: src/k9copy.cpp:263 +msgid "Play title" +msgstr "ПуÑти наÑлов" + +#: src/k9copy.cpp:279 +msgid "Create MPEG-4" +msgstr "Ðаправи MPEG-4" + +#: src/k9copy.cpp:286 +msgid "Eject" +msgstr "Избаци" + +#: src/k9copy.cpp:300 +msgid "DVD Author" +msgstr "ДВС аутор" + +#: src/k9copy.cpp:306 +msgid "Create DVD" +msgstr "Ðаправи ДВД" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding options" +msgstr "Опције MPEG4 кодирања" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding Options" +msgstr "Опције MPEG4 кодирања" + +#: src/k9copy.cpp:375 +msgid "Settings" +msgstr "ПоÑтавке" + +#: src/k9langselect.cpp:90 +msgid "Subtitles" +msgstr "Преводи" + +#: src/k9main.cpp:373 src/k9main.cpp:1141 +msgid "DVD is not opened" +msgstr "DVD није отворен" + +#: src/k9main.cpp:373 src/k9main.cpp:395 +msgid "DVD Copy" +msgstr "DVD умножавање" + +#: src/k9main.cpp:395 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"Ðедовољно меÑта на диÑку у %1\n" +"%2 MB очекивано" + +#: src/k9main.cpp:399 +msgid "Backup in progress" +msgstr "Прављење резервне копије у току" + +#: src/k9main.cpp:459 src/k9main.cpp:608 src/k9main.cpp:1194 +msgid "Ready" +msgstr "Спремно" + +#: src/k9main.cpp:464 k9author/k9import.cpp:156 +msgid "processing" +msgstr "обрада" + +#: src/k9main.cpp:499 src/k9main.cpp:1247 k9author/k9import.cpp:63 +msgid "ISO Image" +msgstr "ISO одраз" + +#: src/k9main.cpp:560 +msgid "Open DVD" +msgstr "Отвори DVD" + +#: src/k9main.cpp:586 +msgid "Titleset %1" +msgstr "Ðиз наÑлова %1" + +#: src/k9main.cpp:636 +msgid "chapters" +msgstr "поглавља" + +#: src/k9main.cpp:644 src/k9main.cpp:657 k9author/k9newtitle.cpp:117 +#: k9author/k9newtitle.cpp:139 +msgid "chapter %1" +msgstr "поглавље %1" + +#: src/k9main.cpp:645 src/k9main.cpp:660 src/k9main.cpp:719 src/k9main.cpp:737 +msgid "%1 MB" +msgstr "%1 MB" + +#: src/k9main.cpp:699 +msgid "video %1 " +msgstr "видео %1 " + +#: src/k9main.cpp:710 +msgid "audio %1 " +msgstr "звук %1 " + +#: src/k9main.cpp:730 +msgid "subpicture %1 " +msgstr "превод %1 " + +#: src/k9main.cpp:1149 +msgid "Transcoding title : %1" +msgstr "Кодирам наÑлов : %1" + +#: src/k9main.cpp:1248 k9author/k9import.cpp:64 +msgid "Folder" +msgstr "ФаÑцикла" + +#: src/k9main.cpp:1355 +msgid "Open ISO Image" +msgstr "Отвори ISO одраз" + +#: src/k9main.cpp:1366 +msgid "Open DVD folder" +msgstr "Отвори DVD фаÑциклу" + +#: src/k9mencodercmdgen.cpp:103 +msgid "Filters" +msgstr "Филтери" + +#: src/k9playbackoptions.cpp:149 +msgid "none" +msgstr "ништа" + +#: src/k9titlefactor.cpp:110 +msgid "Shrink Factor for %1" +msgstr "Фактор Ñужења за %1" + +#: k9author/k9newdvd.cpp:94 +msgid "Creating root menu" +msgstr "Правим главни мени" + +#: k9author/k9newdvd.cpp:134 +msgid "The dvd authoring was canceled" +msgstr "Ðуторизација ДВД-а је била прекинута" + +#: k9author/k9newdvd.cpp:160 +msgid "Creating menu for title %1" +msgstr "Правим мени за наÑлов %1" + +#: k9author/k9newdvd.cpp:381 k9author/k9newtitle.cpp:63 +msgid "title %1" +msgstr "наÑлов %1" + +#: k9author/k9avidecode.cpp:31 k9author/k9avidecode.cpp:35 +msgid "Cannot open then library %1" +msgstr "Ðе могу да отворим библиотеку %1" + +#: k9author/k9avidecode.cpp:88 +msgid "Couldn't open the file %1" +msgstr "Ðе могу да отворим датотеку %1" + +#: k9author/k9avidecode.cpp:93 +msgid "Couldn't find stream information" +msgstr "Ðе могу да нађем податке за проток" + +#: k9author/k9avidecode.cpp:106 +msgid "The file doesn't contain any video stream" +msgstr "Датотека не Ñадржи ни један видео ток" + +#: k9author/k9avidecode.cpp:117 +msgid "Unsupported codec" +msgstr "Ðеподржани кодек" + +#: k9author/k9avidecode.cpp:122 +msgid "Could'nt open the codec" +msgstr "Ðе могу да отворим кодек" + +#: k9author/k9avidecode.cpp:133 +msgid "Unable to allocate memory for frames" +msgstr "Ðе могу да алоцирам меморију за кадрове" + +#: k9author/k9menuedit.cpp:245 +msgid "Title %1 Menu" +msgstr "Мени %1. наÑлова" + +#: k9author/k9menuedit.cpp:254 k9author/k9menuedit.cpp:291 +msgid "Play Menu" +msgstr "ПуÑти мени" + +#: k9author/k9menuedit.cpp:256 +msgid "Play Title" +msgstr "ПуÑти наÑлов" + +#: k9author/k9menuedit.cpp:262 +msgid "Play Root Menu" +msgstr "ПуÑти главни мени" + +#: k9author/k9menuedit.cpp:264 +msgid "Play Title Menu" +msgstr "ПуÑти мени наÑлова" + +#: k9author/k9menuedit.cpp:269 k9author/k9menuedit.cpp:295 +msgid "Play Title %1" +msgstr "ПуÑти наÑлов %1" + +#: k9author/k9importfiles.cpp:24 +msgid "Create new DVD" +msgstr "Ðаправи нови ДВД" diff --git a/po/sr@latin.po b/po/sr@latin.po new file mode 100644 index 0000000..f67f82f --- /dev/null +++ b/po/sr@latin.po @@ -0,0 +1,2196 @@ +# Serbian translation of k9copy +# Courtesy of Prevod.org team (http://prevod.org/) -- 2006, 2007. +# +# This file is distributed under the same license as the k9copy package. +# +# MiloÅ¡ Popović +# +msgid "" +msgstr "" +"Project-Id-Version: k9copy\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-10-14 09:03+0200\n" +"PO-Revision-Date: 2007-08-15 11:15+0100\n" +"Last-Translator: MiloÅ¡ Popović \n" +"Language-Team: Serbian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" +"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: rc.cpp:3 debug/libk9copy/backupdlg.cpp:156 libk9copy/k9dvdauthor.cpp:404 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Napredak pravljenja kopije" + +#: rc.cpp:6 debug/libk9copy/backupdlg.cpp:157 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

DVD rezervna kopija

" + +#: rc.cpp:9 debug/libk9copy/backupdlg.cpp:158 +#, no-c-format +msgid "Current step" +msgstr "Trenutni korak" + +#: rc.cpp:12 rc.cpp:47 rc.cpp:65 debug/libk9copy/backupdlg.cpp:159 +#: debug/libk9copy/mp4dlg.cpp:148 debug/libk9copy/progress.cpp:116 +#, no-c-format +msgid "Elapsed Time" +msgstr "Proteklo vreme" + +#: rc.cpp:15 rc.cpp:612 rc.cpp:640 rc.cpp:666 +#: debug/libk9copy/backupdlg.cpp:160 debug/k9author/newTitle.cpp:131 +#: debug/k9author/chapterEdit.cpp:154 debug/k9author/import.cpp:111 +#, no-c-format +msgid "--:--:--" +msgstr "--:--:--" + +#: rc.cpp:19 debug/libk9copy/dvdprogress.cpp:92 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - DVD analiza" + +#: rc.cpp:25 debug/libk9copy/processList.cpp:68 +#, no-c-format +msgid "Process List" +msgstr "Lista za obradu" + +#: rc.cpp:28 debug/libk9copy/processList.cpp:33 +#: debug/libk9copy/processList.cpp:69 +#, no-c-format +msgid "Processes" +msgstr "Obrade" + +#: rc.cpp:31 debug/libk9copy/processList.cpp:34 +#: debug/libk9copy/processList.cpp:70 +#, no-c-format +msgid "Elapsed" +msgstr "Proteklo" + +#: rc.cpp:34 rc.cpp:603 debug/libk9copy/processList.cpp:35 +#: debug/libk9copy/processList.cpp:71 debug/k9author/import.cpp:46 +#: debug/k9author/import.cpp:107 +#, no-c-format +msgid "..." +msgstr "..." + +#: rc.cpp:40 debug/libk9copy/processList.cpp:73 debug/src/progress.cpp:81 +#, no-c-format +msgid "Alt+C" +msgstr "Alt+C" + +#: rc.cpp:43 debug/libk9copy/progress.cpp:114 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 +#, no-c-format +msgid "k9Copy" +msgstr "k9Copy" + +#: rc.cpp:52 debug/libk9copy/mp4dlg.cpp:141 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - Kodiranje" + +#: rc.cpp:55 debug/libk9copy/mp4dlg.cpp:142 +#, no-c-format +msgid "Encoding" +msgstr "Kodiranje" + +#: rc.cpp:62 debug/libk9copy/mp4dlg.cpp:147 k9author/k9newdvd.cpp:344 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: rc.cpp:68 rc.cpp:154 rc.cpp:181 rc.cpp:284 debug/libk9copy/mp4dlg.cpp:149 +#: debug/src/prefAuthor.cpp:147 debug/src/prefMPEG4.cpp:337 +#: debug/src/prefMPEG4.cpp:347 +#, no-c-format +msgid "Bitrate" +msgstr "Bitski protok" + +#: rc.cpp:71 rc.cpp:215 rc.cpp:232 debug/libk9copy/mp4dlg.cpp:150 +#: debug/src/k9mainw.cpp:66 debug/src/k9mainw.cpp:161 +#, no-c-format +msgid "Size" +msgstr "VeliÄina" + +#: rc.cpp:74 debug/src/mencoderCmdGen.cpp:98 src/k9mencodercmdgen.cpp:55 +#, no-c-format +msgid "MEncoder options" +msgstr "MEncoder opcije" + +#: rc.cpp:78 debug/src/mencoderCmdGen.cpp:108 src/k9mencodercmdgen.cpp:68 +#, no-c-format +msgid "Audio Codec" +msgstr "ZvuÄni kodek" + +#: rc.cpp:81 rc.cpp:169 debug/src/prefMPEG4.cpp:343 +#: debug/src/mencoderCmdGen.cpp:104 +#, no-c-format +msgid "faac" +msgstr "faac" + +#: rc.cpp:84 rc.cpp:96 debug/src/mencoderCmdGen.cpp:107 +#: debug/src/mencoderCmdGen.cpp:119 +#, no-c-format +msgid "lavc" +msgstr "lavc" + +#: rc.cpp:87 debug/src/mencoderCmdGen.cpp:120 src/k9mencodercmdgen.cpp:84 +#, no-c-format +msgid "Video Codec" +msgstr "Video kodek" + +#: rc.cpp:90 rc.cpp:121 rc.cpp:388 debug/src/prefMPEG4.cpp:323 +#: debug/src/prefMencoder.cpp:299 debug/src/mencoderCmdGen.cpp:113 +#, no-c-format +msgid "x264" +msgstr "x264" + +#: rc.cpp:93 debug/src/mencoderCmdGen.cpp:116 +#, no-c-format +msgid "xvid" +msgstr "xvid" + +#: rc.cpp:99 rc.cpp:313 rc.cpp:365 debug/src/prefMPEG4.cpp:315 +#: debug/src/prefMencoder.cpp:286 debug/src/prefpreview.cpp:140 +#, no-c-format +msgid "Form1" +msgstr "Form1" + +#: rc.cpp:103 debug/src/prefMPEG4.cpp:339 +#, no-c-format +msgid "Video" +msgstr "Video" + +#: rc.cpp:106 debug/src/prefMPEG4.cpp:317 +#, no-c-format +msgid "2 pass" +msgstr "2 prolaza" + +#: rc.cpp:109 debug/src/prefMPEG4.cpp:318 +#, no-c-format +msgid "Alt+2" +msgstr "Alt+2" + +#: rc.cpp:112 rc.cpp:163 debug/src/prefMPEG4.cpp:319 +#: debug/src/prefMPEG4.cpp:340 +#, no-c-format +msgid "Codec" +msgstr "Kodek" + +#: rc.cpp:115 rc.cpp:385 debug/src/prefMPEG4.cpp:321 +#: debug/src/prefMencoder.cpp:298 +#, no-c-format +msgid "XviD" +msgstr "Xvid" + +#: rc.cpp:118 debug/src/prefMPEG4.cpp:322 +#, no-c-format +msgid "lavc MPEG4" +msgstr "lavc MPEG4" + +#: rc.cpp:130 debug/src/prefMPEG4.cpp:327 +#, no-c-format +msgid "640" +msgstr "640" + +#: rc.cpp:134 debug/src/prefMPEG4.cpp:329 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "&zadrži razmeru" + +#: rc.cpp:137 rc.cpp:493 debug/src/playbackoptionsw.cpp:230 +#: debug/src/prefMPEG4.cpp:330 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: rc.cpp:141 rc.cpp:206 rc.cpp:238 debug/src/prefMPEG4.cpp:332 +#: debug/src/k9mainw.cpp:163 +#, no-c-format +msgid "X" +msgstr "X" + +#: rc.cpp:145 debug/src/prefMPEG4.cpp:334 +#, no-c-format +msgid "File size" +msgstr "VeliÄina datoteke" + +#: rc.cpp:148 debug/src/prefMPEG4.cpp:335 +#, no-c-format +msgid "Alt+S" +msgstr "Alt+S" + +#: rc.cpp:151 debug/src/prefMPEG4.cpp:336 +#, no-c-format +msgid " MB" +msgstr " MB" + +#: rc.cpp:157 rc.cpp:519 debug/src/prefMPEG4.cpp:338 debug/src/prefDVD.cpp:100 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+B" + +#: rc.cpp:160 rc.cpp:263 rc.cpp:507 rc.cpp:575 +#: debug/src/playbackoptionsw.cpp:236 debug/src/prefAuthor.cpp:138 +#: debug/src/prefMPEG4.cpp:350 debug/k9Mplayer/mplayer.cpp:594 +#: src/k9langselect.cpp:79 +#, no-c-format +msgid "Audio" +msgstr "Zvuk" + +#: rc.cpp:166 debug/src/prefMPEG4.cpp:342 +#, no-c-format +msgid "mp3" +msgstr "mp3" + +#: rc.cpp:172 debug/src/prefMPEG4.cpp:344 +#, no-c-format +msgid "mp2" +msgstr "mp2" + +#: rc.cpp:175 debug/src/prefMPEG4.cpp:345 +#, no-c-format +msgid "ac3" +msgstr "ac3" + +#: rc.cpp:178 debug/src/prefMPEG4.cpp:346 +#, no-c-format +msgid "adpcm ima" +msgstr "adpcm ima" + +#: rc.cpp:185 debug/src/prefMPEG4.cpp:349 +#, no-c-format +msgid "Gain" +msgstr "PojaÄanje" + +#: rc.cpp:188 debug/src/prefMPEG4.cpp:351 +#, no-c-format +msgid "use cell cache" +msgstr "koristi keÅ¡ ćelije" + +#: rc.cpp:191 rc.cpp:220 debug/src/k9mainw.cpp:157 +#, no-c-format +msgid "MainDlg" +msgstr "MainDlg" + +#: rc.cpp:194 rc.cpp:223 debug/src/k9mainw.cpp:158 +#, no-c-format +msgid "Output device " +msgstr "Izlazni ureÄ‘aj " + +#: rc.cpp:197 rc.cpp:244 debug/src/k9mainw.cpp:166 +#, no-c-format +msgid "@" +msgstr "@" + +#: rc.cpp:200 +#, no-c-format +msgid "Input device " +msgstr "Ulazni ureÄ‘aj " + +#: rc.cpp:203 rc.cpp:241 debug/src/k9mainw.cpp:165 libk9copy/k9burndvd.cpp:178 +#: libk9copy/k9burndvd.cpp:278 src/k9main.cpp:1344 +#: src/k9playbackoptions.cpp:147 k9author/k9import.cpp:207 +#, no-c-format +msgid "default" +msgstr "podrazumevano" + +#: rc.cpp:209 +#, no-c-format +msgid "D&VD" +msgstr "&DVD" + +#: rc.cpp:212 rc.cpp:229 debug/src/k9mainw.cpp:65 debug/src/k9mainw.cpp:160 +#, no-c-format +msgid "Title" +msgstr "Naslov" + +#: rc.cpp:226 debug/src/k9mainw.cpp:159 src/main.cpp:37 +#, no-c-format +msgid "input device" +msgstr "ulazni ureÄ‘aj" + +#: rc.cpp:235 debug/src/k9mainw.cpp:68 debug/src/k9mainw.cpp:162 +#, no-c-format +msgid "Content" +msgstr "Sadržaj" + +#: rc.cpp:248 debug/src/k9mainw.cpp:168 +#, no-c-format +msgid "Open a folder" +msgstr "Otvori fasciklu" + +#: rc.cpp:252 debug/src/k9mainw.cpp:170 +#, no-c-format +msgid "Open an iso image" +msgstr "Otvori iso odraz" + +#: rc.cpp:255 debug/src/viewmpeg2.cpp:205 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Pregled naslova" + +#: rc.cpp:260 debug/src/prefAuthor.cpp:137 +#, no-c-format +msgid "Authoring options" +msgstr "Opcije autorizacije" + +#: rc.cpp:266 debug/src/prefAuthor.cpp:140 +#, no-c-format +msgid "AC3" +msgstr "AC3" + +#: rc.cpp:269 debug/src/prefAuthor.cpp:141 +#, no-c-format +msgid "MP2" +msgstr "MP2" + +#: rc.cpp:272 debug/src/prefAuthor.cpp:143 +#, no-c-format +msgid "128" +msgstr "128" + +#: rc.cpp:275 debug/src/prefAuthor.cpp:144 +#, no-c-format +msgid "192" +msgstr "192" + +#: rc.cpp:278 debug/src/prefAuthor.cpp:145 +#, no-c-format +msgid "320" +msgstr "320" + +#: rc.cpp:281 debug/src/prefAuthor.cpp:146 +#, no-c-format +msgid "Format" +msgstr "Format" + +#: rc.cpp:287 debug/src/prefAuthor.cpp:148 +#, no-c-format +msgid "Buttons" +msgstr "Dugmići" + +#: rc.cpp:299 debug/src/prefAuthor.cpp:152 +#, no-c-format +msgid "Hilite color" +msgstr "Boja isticanja" + +#: rc.cpp:303 debug/src/prefAuthor.cpp:154 +#, no-c-format +msgid "Text color" +msgstr "Boja pisma" + +#: rc.cpp:307 debug/src/langselectw.cpp:120 src/k9copy.cpp:120 +#, no-c-format +msgid "Selection" +msgstr "Izabrano" + +#: rc.cpp:310 debug/src/langselectw.cpp:93 debug/src/langselectw.cpp:121 +#, no-c-format +msgid "Languages" +msgstr "Jezici" + +#: rc.cpp:317 debug/src/prefpreview.cpp:142 +#, no-c-format +msgid "&Internal Player" +msgstr "Integrisani pregledaÄ" + +#: rc.cpp:320 debug/src/prefpreview.cpp:143 +#, no-c-format +msgid "Alt+I" +msgstr "Alt+I" + +#: rc.cpp:323 debug/src/prefpreview.cpp:144 +#, no-c-format +msgid "MPlayer" +msgstr "MPlayer" + +#: rc.cpp:326 debug/src/prefpreview.cpp:145 +#, no-c-format +msgid "Alt+M" +msgstr "Alt+M" + +#: rc.cpp:329 debug/src/prefpreview.cpp:146 +#, no-c-format +msgid "Internal viewer options" +msgstr "Opcije integrisanog pregledaÄa" + +#: rc.cpp:332 debug/src/prefpreview.cpp:147 +#, no-c-format +msgid "use OpenGL" +msgstr "koristi OpenGL" + +#: rc.cpp:335 debug/src/prefpreview.cpp:148 +#, no-c-format +msgid "Video output" +msgstr "Video izlaz" + +#: rc.cpp:338 debug/src/prefpreview.cpp:149 +#, no-c-format +msgid "Audio output" +msgstr "ZvuÄni izlaz" + +#: rc.cpp:341 debug/src/prefpreview.cpp:151 +#, no-c-format +msgid "X11" +msgstr "X11" + +#: rc.cpp:344 debug/src/prefpreview.cpp:152 +#, no-c-format +msgid "Xv" +msgstr "Xv" + +#: rc.cpp:347 debug/src/prefpreview.cpp:153 +#, no-c-format +msgid "OpenGL" +msgstr "OpenGL" + +#: rc.cpp:350 rc.cpp:359 debug/src/prefpreview.cpp:154 +#: debug/src/prefpreview.cpp:158 +#, no-c-format +msgid "SDL" +msgstr "SDL" + +#: rc.cpp:353 debug/src/prefpreview.cpp:156 +#, no-c-format +msgid "ALSA" +msgstr "ALSA" + +#: rc.cpp:356 debug/src/prefpreview.cpp:157 +#, no-c-format +msgid "OSS" +msgstr "OSS" + +#: rc.cpp:362 debug/src/prefpreview.cpp:159 +#, no-c-format +msgid "MPlayer options" +msgstr "MPlayer opcije" + +#: rc.cpp:368 debug/src/prefMencoder.cpp:287 +#, no-c-format +msgid "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" +msgstr "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" + +#: rc.cpp:375 debug/src/prefMencoder.cpp:292 +#, no-c-format +msgid "" +"pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" +msgstr "" +"broj prolaza\n" +"Å¡irina videa\n" +"vidina videa\n" +"bitski protok videa\n" +"bitski protok zvuka" + +#: rc.cpp:382 debug/src/prefMencoder.cpp:326 +#, no-c-format +msgid "Video codecs" +msgstr "Video kodeci" + +#: rc.cpp:391 debug/src/prefMencoder.cpp:300 +#, no-c-format +msgid "MJPEG" +msgstr "MJPEG" + +#: rc.cpp:394 debug/src/prefMencoder.cpp:301 +#, no-c-format +msgid "LJPEG" +msgstr "LJPEG" + +#: rc.cpp:397 debug/src/prefMencoder.cpp:302 +#, no-c-format +msgid "H.261" +msgstr "H.261" + +#: rc.cpp:400 debug/src/prefMencoder.cpp:303 +#, no-c-format +msgid "H.263" +msgstr "H.263" + +#: rc.cpp:403 debug/src/prefMencoder.cpp:304 +#, no-c-format +msgid "MPEG-4 (DivX 4/5)" +msgstr "MPEG-4 (DivX 4/5)" + +#: rc.cpp:406 debug/src/prefMencoder.cpp:305 +#, no-c-format +msgid "DivX 3" +msgstr "DivX 3" + +#: rc.cpp:409 debug/src/prefMencoder.cpp:306 +#, no-c-format +msgid "MS MPEG-4 v2" +msgstr "MS MPEG-4 v2" + +#: rc.cpp:412 debug/src/prefMencoder.cpp:307 +#, no-c-format +msgid "WMV7" +msgstr "WMV7" + +#: rc.cpp:415 debug/src/prefMencoder.cpp:308 +#, no-c-format +msgid "WMV8" +msgstr "WMV8" + +#: rc.cpp:418 debug/src/prefMencoder.cpp:309 +#, no-c-format +msgid "RealVideo" +msgstr "RealVideo" + +#: rc.cpp:421 debug/src/prefMencoder.cpp:310 +#, no-c-format +msgid "MPEG-1" +msgstr "MPEG-1" + +#: rc.cpp:424 debug/src/prefMencoder.cpp:311 +#, no-c-format +msgid "MPEG-2" +msgstr "MPEG-2" + +#: rc.cpp:427 debug/src/prefMencoder.cpp:312 +#, no-c-format +msgid "HuffYUV" +msgstr "HuffYUV" + +#: rc.cpp:430 debug/src/prefMencoder.cpp:313 +#, no-c-format +msgid "ffvHuff" +msgstr "ffvHuff" + +#: rc.cpp:433 debug/src/prefMencoder.cpp:314 +#, no-c-format +msgid "ASUS v1" +msgstr "ASUS v1" + +#: rc.cpp:436 debug/src/prefMencoder.cpp:315 +#, no-c-format +msgid "ASUS v2" +msgstr "ASUS v2" + +#: rc.cpp:440 rc.cpp:465 rc.cpp:555 debug/src/configDlg.cpp:42 +#: debug/src/configDlg.cpp:95 debug/src/prefMencoder.cpp:317 +#: debug/src/prefMencoder.cpp:329 +#, no-c-format +msgid "label" +msgstr "natpis" + +#: rc.cpp:443 debug/src/prefMencoder.cpp:318 +#, no-c-format +msgid "fourcc" +msgstr "fourcc" + +#: rc.cpp:446 debug/src/prefMencoder.cpp:319 +#, no-c-format +msgid "first pass" +msgstr "prvi prolaz" + +#: rc.cpp:451 debug/src/prefMencoder.cpp:322 +#, no-c-format +msgid "one pass" +msgstr "jedan prolaz" + +#: rc.cpp:456 debug/src/prefMencoder.cpp:325 +#, no-c-format +msgid "second pass" +msgstr "drugi prolaz" + +#: rc.cpp:459 debug/src/prefMencoder.cpp:332 +#, no-c-format +msgid "Audio codecs" +msgstr "ZvuÄni kodek" + +#: rc.cpp:462 debug/src/prefMencoder.cpp:328 +#, no-c-format +msgid "New Item" +msgstr "Nova stavka" + +#: rc.cpp:469 debug/src/prefMencoder.cpp:331 +#, no-c-format +msgid "options" +msgstr "opcije" + +#: rc.cpp:472 debug/src/prefMencoder.cpp:333 +#, no-c-format +msgid "Available variables" +msgstr "Dostupne promenjljive" + +#: rc.cpp:475 debug/src/titlefactor.cpp:321 +#, no-c-format +msgid "Shrink Factors" +msgstr "Faktori suženja" + +#: rc.cpp:478 debug/src/titlefactor.cpp:322 +#, no-c-format +msgid "Shrink Factor for Title %1" +msgstr "Faktor suženja za naslov %1" + +#: rc.cpp:481 debug/src/titlefactor.cpp:323 +#, no-c-format +msgid "Change Factor" +msgstr "Promeni faktor" + +#: rc.cpp:484 debug/src/titlefactor.cpp:324 +#, no-c-format +msgid "0.00" +msgstr "0.00" + +#: rc.cpp:487 debug/src/playbackoptionsw.cpp:228 src/k9copy.cpp:114 +#, no-c-format +msgid "DVD playback options" +msgstr "Postavke DVD reprodukcije" + +#: rc.cpp:490 debug/src/playbackoptionsw.cpp:229 +#, no-c-format +msgid "&Keep original menus" +msgstr "Zadrži originalne menije" + +#: rc.cpp:498 debug/src/playbackoptionsw.cpp:233 +#, no-c-format +msgid "Selected Titles" +msgstr "Izabrani naslovi" + +#: rc.cpp:501 debug/src/playbackoptionsw.cpp:234 +#, no-c-format +msgid "Default language" +msgstr "Podrazumevani jezik" + +#: rc.cpp:504 debug/src/playbackoptionsw.cpp:235 +#, no-c-format +msgid "Subtitle" +msgstr "Prevod" + +#: rc.cpp:510 debug/src/prefDVD.cpp:97 +#, no-c-format +msgid "prefDVD" +msgstr "postDVD" + +#: rc.cpp:513 debug/src/prefDVD.cpp:98 +#, no-c-format +msgid "Output directory" +msgstr "Izlazni direktorijum" + +#: rc.cpp:516 debug/src/prefDVD.cpp:99 +#, no-c-format +msgid "Burn with k3b" +msgstr "UpiÅ¡i disk pomoću k3b-a" + +#: rc.cpp:522 debug/src/prefDVD.cpp:101 +#, no-c-format +msgid "Auto burn" +msgstr "Automatski upiÅ¡i disk" + +#: rc.cpp:525 debug/src/prefDVD.cpp:102 +#, no-c-format +msgid "Alt+T" +msgstr "Alt+T" + +#: rc.cpp:528 debug/src/prefDVD.cpp:103 +#, no-c-format +msgid "DVD size" +msgstr "VeliÄina DVD-a" + +#: rc.cpp:531 debug/src/prefDVD.cpp:104 +#, no-c-format +msgid "Quick scan" +msgstr "Brzo skeniranje" + +#: rc.cpp:534 debug/src/prefDVD.cpp:105 +#, no-c-format +msgid "Alt+Q" +msgstr "Alt+Q" + +#: rc.cpp:537 debug/src/prefDVD.cpp:106 +#, no-c-format +msgid "use dvdAuthor for copy without menus" +msgstr "koristi dvdAuthor za kopije bez menija" + +#: rc.cpp:540 debug/src/prefDVD.cpp:107 +#, no-c-format +msgid "Alt+D" +msgstr "Alt+D" + +#: rc.cpp:543 debug/src/prefDVD.cpp:108 +#, no-c-format +msgid "Clear output directory on exit" +msgstr "OÄisti izlazni direktorijum pri izlasku iz programa" + +#: rc.cpp:546 debug/src/prefDVD.cpp:109 +#, no-c-format +msgid "Alt+Y" +msgstr "Alt+Y" + +#: rc.cpp:549 debug/src/configDlg.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - UreÄ‘aji" + +#: rc.cpp:552 debug/src/configDlg.cpp:40 debug/src/configDlg.cpp:94 +#, no-c-format +msgid "device" +msgstr "ureÄ‘aj" + +#: rc.cpp:558 debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:96 +#, no-c-format +msgid "Input" +msgstr "Ulaz" + +#: rc.cpp:561 rc.cpp:597 debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:97 +#: debug/k9author/import.cpp:105 +#, no-c-format +msgid "Output" +msgstr "Izlaz" + +#: rc.cpp:572 debug/k9Mplayer/mplayer.cpp:593 src/k9settings.cpp:57 +#: src/k9copy.cpp:128 src/k9copy.cpp:390 k9Mplayer/k9mplayer.cpp:97 +#, no-c-format +msgid "Preview" +msgstr "Pregled" + +#: rc.cpp:578 debug/k9Mplayer/mplayer.cpp:595 +#, no-c-format +msgid "Subpicture" +msgstr "Prevod" + +#: rc.cpp:585 debug/k9Mplayer/mplayer.cpp:600 +#, no-c-format +msgid "-" +msgstr "-" + +#: rc.cpp:589 debug/k9Mplayer/mplayer.cpp:602 +#, no-c-format +msgid "+" +msgstr "+" + +#: rc.cpp:594 debug/k9author/import.cpp:104 +#, no-c-format +msgid "import" +msgstr "uvoz" + +#: rc.cpp:600 debug/k9author/import.cpp:44 debug/k9author/import.cpp:106 +#, no-c-format +msgid "Video files" +msgstr "Video datoteke" + +#: rc.cpp:606 debug/k9author/import.cpp:109 +#, no-c-format +msgid "PAL" +msgstr "PAL" + +#: rc.cpp:609 debug/k9author/import.cpp:110 +#, no-c-format +msgid "NTSC" +msgstr "NTSC" + +#: rc.cpp:615 debug/k9author/chapterEdit.cpp:145 src/k9copy.cpp:211 +#: k9author/k9importfiles.cpp:34 +#, no-c-format +msgid "Chapter properties" +msgstr "Postavke poglavlja" + +#: rc.cpp:618 debug/k9author/chapterEdit.cpp:146 +#, no-c-format +msgid "start" +msgstr "poÄetak" + +#: rc.cpp:621 debug/k9author/chapterEdit.cpp:147 +#, no-c-format +msgid "video" +msgstr "video" + +#: rc.cpp:624 debug/k9author/chapterEdit.cpp:148 +#, no-c-format +msgid "" +"*.avi\n" +"*.mpeg" +msgstr "" +"*.avi\n" +"*.mpeg" + +#: rc.cpp:628 rc.cpp:643 debug/k9author/chapterEdit.cpp:150 +#: debug/k9author/chapterEdit.cpp:155 +#, no-c-format +msgid "set Current Frame" +msgstr "postavi trenutni kadar" + +#: rc.cpp:631 rc.cpp:637 debug/k9author/chapterEdit.cpp:151 +#: debug/k9author/chapterEdit.cpp:153 +#, no-c-format +msgid "break continuity" +msgstr "prekini kontinuitet" + +#: rc.cpp:634 debug/k9author/chapterEdit.cpp:152 +#, no-c-format +msgid "end" +msgstr "kraj" + +#: rc.cpp:646 debug/k9author/chapterEdit.cpp:156 +#, no-c-format +msgid "set Title button" +msgstr "postavi Naslovno dugme" + +#: rc.cpp:649 debug/k9author/newTitle.cpp:124 src/k9copy.cpp:204 +#: k9author/k9importfiles.cpp:40 k9author/k9newtitle.cpp:55 +#, no-c-format +msgid "Add title" +msgstr "Dodaj naslov" + +#: rc.cpp:653 debug/k9author/newTitle.cpp:126 +#, no-c-format +msgid "number of chapters" +msgstr "broj poglavlja" + +#: rc.cpp:656 debug/k9author/newTitle.cpp:127 +#, no-c-format +msgid "chapter length" +msgstr "dužina poglavlja" + +#: rc.cpp:663 debug/k9author/newTitle.cpp:130 +#, no-c-format +msgid "Video file" +msgstr "Video datoteka" + +#: rc.cpp:669 debug/k9author/menuEdit.cpp:146 src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +#, no-c-format +msgid "Edit Menu" +msgstr "Uredi meni" + +#: rc.cpp:672 debug/k9author/menuEdit.cpp:147 +#, no-c-format +msgid "Text" +msgstr "Tekst" + +#: rc.cpp:675 debug/k9author/menuEdit.cpp:148 +#, no-c-format +msgid "Background picture" +msgstr "Pozadinska slika" + +#: rc.cpp:690 debug/k9author/menuEdit.cpp:156 k9author/k9menuedit.cpp:286 +#: k9author/k9import.cpp:45 +#, no-c-format +msgid "Root Menu" +msgstr "Glavni meni" + +#: rc.cpp:693 debug/k9author/menuEdit.cpp:157 +#, no-c-format +msgid "At start" +msgstr "Na poÄetak" + +#: rc.cpp:696 debug/k9author/menuEdit.cpp:159 +#, no-c-format +msgid "Play menu" +msgstr "Pusti meni" + +#: rc.cpp:699 rc.cpp:711 debug/k9author/menuEdit.cpp:160 +#: debug/k9author/menuEdit.cpp:165 +#, no-c-format +msgid "Play title 1" +msgstr "Pusti naslov 1" + +#: rc.cpp:702 debug/k9author/menuEdit.cpp:161 +#, no-c-format +msgid "At End" +msgstr "Na kraj" + +#: rc.cpp:705 debug/k9author/menuEdit.cpp:163 +#, no-c-format +msgid "Play root menu" +msgstr "Pusti glavni meni" + +#: rc.cpp:708 debug/k9author/menuEdit.cpp:164 +#, no-c-format +msgid "Play title menu" +msgstr "Pusti meni naslova" + +#: rc.cpp:717 +#, no-c-format +msgid "A&ctions" +msgstr "&Radnje" + +#: rc.cpp:720 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Paleta sa alatima radnje" + +#: debug/libk9copy/k9ifo2.moc.cpp:34 debug/libk9copy/k9ifo2.moc.cpp:42 +msgid "k9Ifo2" +msgstr "k9Ifo2" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:34 +#: debug/libk9copy/k9dvdchapter.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "k9 ćelija sa poglavljem" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:107 +#: debug/libk9copy/k9dvdchapter.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "k9DVD poglavlje" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "k9 upis DVD-a" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "k9DVD" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9DVDVideoStream" +msgstr "k9DVD video tok" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDAudioStream" +msgstr "k9DVD zvuÄni tok" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDSubtitle" +msgstr "k9DVD prevod" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDTitle" +msgstr "k9DVD naslov" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "k9DVD napredak" + +#: debug/libk9copy/k9dvdtitleset.moc.cpp:34 +#: debug/libk9copy/k9dvdtitleset.moc.cpp:42 +msgid "k9DVDTitleset" +msgstr "k9DVD niz naslova" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "k9DVD autor" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "k9DVD veliÄina" + +#: debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - pregled menija" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "kCD ureÄ‘aj" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "kCD ureÄ‘aji" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "k9Widget" +msgstr "k9Widget" + +#: debug/src/kviewmpeg2.moc.cpp:107 debug/src/kviewmpeg2.moc.cpp:115 +msgid "kViewMPEG2" +msgstr "kViewMPEG2" + +#: debug/k9Mplayer/k9mplayer.moc.cpp:34 debug/k9Mplayer/k9mplayer.moc.cpp:42 +msgid "K9Mplayer" +msgstr "K9Mplayer" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "kDecMPEG2" + +#: libk9copy/k9dvd.cpp:133 +msgid "for visually impaired" +msgstr "za osobe sa oÅ¡tećenim vidom" + +#: libk9copy/k9dvd.cpp:134 +msgid "director's comments" +msgstr "komentar režisera" + +#: libk9copy/k9dvd.cpp:135 +msgid "alternate director's comments" +msgstr "dodatni komentar režisera" + +#: libk9copy/k9dvd.cpp:139 +msgid "Large" +msgstr "Veliko" + +#: libk9copy/k9dvd.cpp:140 +msgid "Children" +msgstr "Deca" + +#: libk9copy/k9dvd.cpp:141 libk9copy/k9dvd.cpp:147 libk9copy/k9dvd.cpp:148 +#: libk9copy/k9dvd.cpp:149 +msgid "reserved" +msgstr "oÄivano" + +#: libk9copy/k9dvd.cpp:142 +msgid "Normal captions" +msgstr "Normalna slova" + +#: libk9copy/k9dvd.cpp:143 +msgid "Large captions" +msgstr "Velika slova" + +#: libk9copy/k9dvd.cpp:144 +msgid "Children captions" +msgstr "Mala slova" + +#: libk9copy/k9dvd.cpp:146 +msgid "Forced" +msgstr "Primorano" + +#: libk9copy/k9dvd.cpp:150 +msgid "Director's comments" +msgstr "Režiserov komentar" + +#: libk9copy/k9dvd.cpp:151 +msgid "Large director's comments" +msgstr "Dugi režiserov komentar" + +#: libk9copy/k9dvd.cpp:152 +msgid "Director's comments for children" +msgstr "Režiserov komentar za decu" + +#: libk9copy/k9dvd.cpp:189 +msgid "Couldn't open %1 for title\n" +msgstr "Ne mogu da otvorim %1 za naslov\n" + +#: libk9copy/k9dvd.cpp:191 libk9copy/k9dvd.cpp:199 libk9copy/k9dvd.cpp:207 +#: libk9copy/k9dvd.cpp:368 src/k9main.cpp:563 +msgid "unknown" +msgstr "nepoznato" + +#: libk9copy/k9dvd.cpp:197 +msgid "Couldn't seek in %1 for title\n" +msgstr "Ne mogu da tragam u %1 za naslov\n" + +#: libk9copy/k9dvd.cpp:224 +msgid "Not Specified" +msgstr "Nije odreÄ‘eno" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afar" +msgstr "afarski" + +#: libk9copy/k9dvd.cpp:224 +msgid "Abkhazian" +msgstr "abhazijski" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afrikaans" +msgstr "afriÄki" + +#: libk9copy/k9dvd.cpp:224 +msgid "Amharic" +msgstr "amharski" + +#: libk9copy/k9dvd.cpp:225 +msgid "Arabic" +msgstr "arapski" + +#: libk9copy/k9dvd.cpp:225 +msgid "Assamese" +msgstr "asameÅ¡ki" + +#: libk9copy/k9dvd.cpp:225 +msgid "Aymara" +msgstr "ajmarski" + +#: libk9copy/k9dvd.cpp:225 +msgid "Azerbaijani" +msgstr "azerbejdžanski" + +#: libk9copy/k9dvd.cpp:225 +msgid "Bashkir" +msgstr "baÅ¡kirski" + +#: libk9copy/k9dvd.cpp:226 +msgid "Byelorussian" +msgstr "beloruski" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bulgarian" +msgstr "bugarski" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bihari" +msgstr "biharski" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bislama" +msgstr "bislamski" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bengali; Bangla" +msgstr "bengali" + +#: libk9copy/k9dvd.cpp:227 +msgid "Tibetan" +msgstr "tibetanski" + +#: libk9copy/k9dvd.cpp:227 +msgid "Breton" +msgstr "bretonski" + +#: libk9copy/k9dvd.cpp:227 +msgid "Catalan" +msgstr "katalonski" + +#: libk9copy/k9dvd.cpp:227 +msgid "Corsican" +msgstr "korzikanski" + +#: libk9copy/k9dvd.cpp:227 +msgid "Czech" +msgstr "ÄeÅ¡ki" + +#: libk9copy/k9dvd.cpp:228 +msgid "Welsh" +msgstr "velÅ¡ki" + +#: libk9copy/k9dvd.cpp:228 +msgid "Dansk" +msgstr "danski" + +#: libk9copy/k9dvd.cpp:228 +msgid "Deutsch" +msgstr "nemaÄki" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bhutani" +msgstr "" + +#: libk9copy/k9dvd.cpp:228 +msgid "Greek" +msgstr "grÄki" + +#: libk9copy/k9dvd.cpp:228 +msgid "English" +msgstr "engleski" + +#: libk9copy/k9dvd.cpp:229 +msgid "Esperanto" +msgstr "esperanto" + +#: libk9copy/k9dvd.cpp:229 +msgid "Espanol" +msgstr "Å¡panjolski" + +#: libk9copy/k9dvd.cpp:229 +msgid "Estonian" +msgstr "estonski" + +#: libk9copy/k9dvd.cpp:229 +msgid "Basque" +msgstr "baskijski" + +#: libk9copy/k9dvd.cpp:229 +msgid "Persian" +msgstr "persijski" + +#: libk9copy/k9dvd.cpp:230 +msgid "Suomi" +msgstr "" + +#: libk9copy/k9dvd.cpp:230 +msgid "Fiji" +msgstr "fidži" + +#: libk9copy/k9dvd.cpp:230 +msgid "Faroese" +msgstr "faroski" + +#: libk9copy/k9dvd.cpp:230 +msgid "Francais" +msgstr "francuski" + +#: libk9copy/k9dvd.cpp:230 +msgid "Frisian" +msgstr "frizijski" + +#: libk9copy/k9dvd.cpp:230 +msgid "Gaelic" +msgstr "galski" + +#: libk9copy/k9dvd.cpp:231 +msgid "Scots Gaelic" +msgstr "Å¡kotski galski" + +#: libk9copy/k9dvd.cpp:231 +msgid "Galician" +msgstr "galicijski" + +#: libk9copy/k9dvd.cpp:231 +msgid "Guarani" +msgstr "guarani" + +#: libk9copy/k9dvd.cpp:231 +msgid "Gujarati" +msgstr "gudžarati" + +#: libk9copy/k9dvd.cpp:231 +msgid "Hausa" +msgstr "hausa" + +#: libk9copy/k9dvd.cpp:232 libk9copy/k9dvd.cpp:234 +msgid "Hebrew" +msgstr "hebrejski" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hindi" +msgstr "hindu" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hrvatski" +msgstr "hrvatski" + +#: libk9copy/k9dvd.cpp:232 +msgid "Magyar" +msgstr "maÄ‘arski" + +#: libk9copy/k9dvd.cpp:232 +msgid "Armenian" +msgstr "jermenski" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingua" +msgstr "viÅ¡ejeziÄki" + +#: libk9copy/k9dvd.cpp:233 +msgid "Indonesian" +msgstr "indonezijski" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingue" +msgstr "viÅ¡ejeziÄki" + +#: libk9copy/k9dvd.cpp:233 +msgid "Inupiak" +msgstr "inupiak" + +#: libk9copy/k9dvd.cpp:234 +msgid "Islenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:234 +msgid "Italiano" +msgstr "italijanski" + +#: libk9copy/k9dvd.cpp:234 +msgid "Inuktitut" +msgstr "Inuktitut (transliterovano)" + +#: libk9copy/k9dvd.cpp:234 +msgid "Japanese" +msgstr "japanski" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:250 +msgid "Yiddish" +msgstr "jevrejski" + +#: libk9copy/k9dvd.cpp:235 +msgid "Javanese" +msgstr "javanski" + +#: libk9copy/k9dvd.cpp:235 +msgid "Georgian" +msgstr "gruzijski" + +#: libk9copy/k9dvd.cpp:235 +msgid "Kazakh" +msgstr "kazahstanski" + +#: libk9copy/k9dvd.cpp:235 +msgid "Greenlandic" +msgstr "kalalisut (grenlandski)" + +#: libk9copy/k9dvd.cpp:236 +msgid "Cambodian" +msgstr "kambodžanski" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kannada" +msgstr "kanadski" + +#: libk9copy/k9dvd.cpp:236 +msgid "Korean" +msgstr "korejski" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kashmiri" +msgstr "kaÅ¡mirski" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kurdish" +msgstr "kurdski" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kirghiz" +msgstr "kirgiÅ¡ki" + +#: libk9copy/k9dvd.cpp:237 +msgid "Latin" +msgstr "latinski" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lingala" +msgstr "lingala" + +#: libk9copy/k9dvd.cpp:237 +msgid "Laothian" +msgstr "" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lithuanian" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Latvian, Lettish" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malagasy" +msgstr "" + +#: libk9copy/k9dvd.cpp:238 +msgid "Maori" +msgstr "maori" + +#: libk9copy/k9dvd.cpp:238 +msgid "Macedonian" +msgstr "makedonski" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malayalam" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Mongolian" +msgstr "mongolski" + +#: libk9copy/k9dvd.cpp:239 +msgid "Moldavian" +msgstr "moldavski" + +#: libk9copy/k9dvd.cpp:239 +msgid "Marathi" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Malay" +msgstr "" + +#: libk9copy/k9dvd.cpp:239 +msgid "Maltese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Burmese" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nauru" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nepali" +msgstr "nepalski" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nederlands" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Norsk" +msgstr "" + +#: libk9copy/k9dvd.cpp:240 +msgid "Occitan" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oromo" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oriya" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Punjabi" +msgstr "" + +#: libk9copy/k9dvd.cpp:241 +msgid "Polish" +msgstr "poljski" + +#: libk9copy/k9dvd.cpp:241 +msgid "Pashto, Pushto" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Portugues" +msgstr "portugalski" + +#: libk9copy/k9dvd.cpp:242 +msgid "Quechua" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Rhaeto-Romance" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Kirundi" +msgstr "" + +#: libk9copy/k9dvd.cpp:242 +msgid "Romanian" +msgstr "rumunski" + +#: libk9copy/k9dvd.cpp:243 +msgid "Russian" +msgstr "ruski" + +#: libk9copy/k9dvd.cpp:243 +msgid "Kinyarwanda" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sanskrit" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sindhi" +msgstr "" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sangho" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Serbo-Croatian" +msgstr "srpsko-hrvatski" + +#: libk9copy/k9dvd.cpp:244 +msgid "Sinhalese" +msgstr "" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovak" +msgstr "slovaÄki" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovenian" +msgstr "slovenski" + +#: libk9copy/k9dvd.cpp:244 +msgid "Samoan" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Shona" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Somali" +msgstr "" + +#: libk9copy/k9dvd.cpp:245 +msgid "Albanian" +msgstr "albanski" + +#: libk9copy/k9dvd.cpp:245 +msgid "Serbian" +msgstr "srpski" + +#: libk9copy/k9dvd.cpp:245 +msgid "Siswati" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sesotho" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sundanese" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Svenska" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Swahili" +msgstr "" + +#: libk9copy/k9dvd.cpp:246 +msgid "Tamil" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Telugu" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tajik" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Thai" +msgstr "tajlandski (tai)" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tigrinya" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Turkmen" +msgstr "" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tagalog" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Setswana" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Turkish" +msgstr "turski" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tsonga" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tatar" +msgstr "" + +#: libk9copy/k9dvd.cpp:248 +msgid "Twi" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uighur" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Ukrainian" +msgstr "ukrainski" + +#: libk9copy/k9dvd.cpp:249 +msgid "Urdu" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uzbek" +msgstr "" + +#: libk9copy/k9dvd.cpp:249 +msgid "Vietnamese" +msgstr "vijetnamski" + +#: libk9copy/k9dvd.cpp:250 +msgid "Volapuk" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Wolof" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Xhosa" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Yoruba" +msgstr "" + +#: libk9copy/k9dvd.cpp:250 +msgid "Zhuang" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 +msgid "Chinese" +msgstr "kineski" + +#: libk9copy/k9dvd.cpp:251 +msgid "Zulu" +msgstr "" + +#: libk9copy/k9dvd.cpp:251 libk9copy/k9dvd.cpp:252 libk9copy/k9dvd.cpp:475 +msgid "Unknown" +msgstr "nepoznat" + +#: libk9copy/k9dvd.cpp:342 +msgid "Can't open disc %1!\n" +msgstr "Ne mogu da otvorim disk %1!\n" + +#: libk9copy/k9dvd.cpp:354 +msgid "Can't open main ifo!\n" +msgstr "Me mogu da otvorim glavni ifo!\n" + +#: libk9copy/k9dvd.cpp:396 libk9copy/k9dvd.cpp:691 +msgid "Title %1" +msgstr "Naslov %1" + +#: libk9copy/k9dvd.cpp:742 +msgid "reading title" +msgstr "Äitam naslov" + +#: libk9copy/k9dvd.cpp:859 +msgid "Error opening vobs for title %1\n" +msgstr "GreÅ¡ka pri otvaranju vob-ova za naslov %1\n" + +#: libk9copy/k9dvd.cpp:870 +msgid "ERROR reading block %1\n" +msgstr "GreÅ¡ka pri Äitanju bloka %1\n" + +#: libk9copy/k9dvdauthor.cpp:148 libk9copy/k9dvdauthor.cpp:366 +msgid "'%1' not selected" +msgstr "'%1' nije izabran" + +#: libk9copy/k9dvdauthor.cpp:149 libk9copy/k9dvdauthor.cpp:367 +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9dvdauthor.cpp:436 +#: libk9copy/k9dvdauthor.cpp:445 libk9copy/k9dvdauthor.cpp:448 +#: libk9copy/k9burndvd.cpp:237 libk9copy/k9burndvd.cpp:321 +#: k9author/k9newdvd.cpp:122 +msgid "authoring" +msgstr "autorizujem" + +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +#: k9Mplayer/k9mplayer.cpp:97 +msgid "Unable to run %1" +msgstr "Ne mogu da pokrenem %1" + +#: libk9copy/k9dvdauthor.cpp:403 libk9copy/k9dvdauthor.cpp:476 +#: libk9copy/k9dvdauthor.cpp:514 src/k9settings.cpp:63 +#: k9author/k9newdvd.cpp:143 +msgid "Authoring" +msgstr "Autorizujem" + +#: libk9copy/k9dvdauthor.cpp:436 +msgid "Dvdauthor error :\n" +msgstr "GreÅ¡ka u programu Dvdauthor :\n" + +#: libk9copy/k9dvdauthor.cpp:445 +msgid "Authoring cancelled" +msgstr "Autorizacija prekinuta" + +#: libk9copy/k9dvdauthor.cpp:448 k9author/k9newdvd.cpp:136 +msgid "An error occured while running DVDAuthor:\n" +msgstr "GreÅ¡ka je nastala pri radu sa DVDAuthor:\n" + +#: libk9copy/k9dvdauthor.cpp:515 +msgid "Fixing VOBUS" +msgstr "Popravljanje VOBUS" + +#: libk9copy/k9mp4enc.cpp:103 libk9copy/k9mp4enc.cpp:312 +msgid "Encoding error" +msgstr "GreÅ¡ka u kodiranju" + +#: libk9copy/k9mp4enc.cpp:152 src/k9main.cpp:1155 +msgid "Save file to disk" +msgstr "SaÄuvaj datoteku na disk" + +#: libk9copy/k9mp4enc.cpp:161 libk9copy/k9mp4enc.cpp:350 +#: src/k9prefmpeg4.cpp:34 src/k9mp4title.cpp:49 src/k9main.cpp:290 +#: src/k9main.cpp:300 src/k9main.cpp:310 src/k9main.cpp:330 src/k9main.cpp:588 +#: src/k9main.cpp:689 src/k9main.cpp:703 src/k9prefdvd.cpp:35 +msgid "MB" +msgstr "MB" + +#: libk9copy/k9mp4enc.cpp:233 libk9copy/k9mp4enc.cpp:235 +#: k9author/k9newdvd.cpp:247 +msgid "Encoding %1" +msgstr "Kodiranje %1" + +#: libk9copy/k9mp4enc.cpp:233 +msgid "pass %1" +msgstr "prolaz %1" + +#: libk9copy/k9mp4enc.cpp:309 +msgid "MPEG-4 Encoding cancelled" +msgstr "MPEG-4 kodiranje prekinuto" + +#: libk9copy/k9mp4enc.cpp:309 src/k9settings.cpp:48 src/k9main.cpp:1141 +msgid "MPEG-4 Encoding" +msgstr "MPEG-4 kodiranje" + +#: libk9copy/k9mp4enc.cpp:312 +msgid "Error while running mencoder :" +msgstr "GreÅ¡ka pri pokretanju programa mencoder :" + +#: libk9copy/k9burndvd.cpp:188 libk9copy/k9burndvd.cpp:255 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - Upis DVD diska" + +#: libk9copy/k9burndvd.cpp:189 libk9copy/k9burndvd.cpp:256 +#: libk9copy/k9burndvd.cpp:348 src/k9main.cpp:435 +msgid "Burning DVD" +msgstr "Upisivanje DVD diska" + +#: libk9copy/k9burndvd.cpp:200 libk9copy/k9burndvd.cpp:284 src/k9main.cpp:384 +#: k9author/k9import.cpp:178 +msgid "Save image to disk" +msgstr "SaÄuvaj sliku na disk" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:302 +msgid "Insert a recordable DVD" +msgstr "Ubacite upisiv DVD disk" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:303 +#: libk9copy/k9burndvd.cpp:309 libk9copy/k9burndvd.cpp:314 +msgid "DVD burning" +msgstr "Upisivanje DVD diska" + +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +msgid "Error burning DVD :\n" +msgstr "GreÅ¡ka pri upisu na DVD :\n" + +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:314 +msgid "DVD Burning finished" +msgstr "Upisivanje DVD diska zavrÅ¡eno" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "An error occured while Burning DVD: %1" +msgstr "Pojavila se greÅ¡ka pri upisivanju DVD diska: %1" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "Insert an other DVD" +msgstr "Ubacite drugi DVD" + +#: libk9copy/k9burndvd.cpp:349 +msgid "Current write speed :%1 x" +msgstr "Trenutna brzina upisa :%1 x" + +#: libk9copy/k9dvdbackup.cpp:149 libk9copy/k9dvdbackup.cpp:163 +#: libk9copy/k9dvdbackup.cpp:513 libk9copy/k9dvdbackup.cpp:599 +msgid "DVD backup cancelled" +msgstr "Pravljenje DVD rezervne kopije prekinuto" + +#: libk9copy/k9dvdbackup.cpp:176 +msgid "unable to open VIDEO_TS.IFO" +msgstr "Ne mogu da otvorim VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:198 libk9copy/k9dvdbackup.cpp:381 +#: libk9copy/k9dvdbackup.cpp:446 +msgid "Unable to open file " +msgstr "Ne mogu da otvorim datoteku " + +#: libk9copy/k9dvdbackup.cpp:277 +msgid "Unable to open titleset %1" +msgstr "Ne mogu da otvorim niz naslova %1" + +#: libk9copy/k9dvdbackup.cpp:283 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting titleset %1" +msgstr "ÄŒupam niz naslova %1" + +#: libk9copy/k9dvdbackup.cpp:453 +msgid "Unable to open menu for titleset %1" +msgstr "Ne mogu da otvorim meni za niz naslova %1" + +#: libk9copy/k9dvdbackup.cpp:479 +msgid "Extracting menu for titleset %1" +msgstr "ÄŒupam meni za niz naslova %1" + +#: libk9copy/k9dvdbackup.cpp:563 +msgid "Unable to open ifo file for titleset %1" +msgstr "Ne mogu da otvorim ifo datoteku za niz naslova %1" + +#: libk9copy/k9dvdbackup.cpp:575 libk9copy/k9dvdbackup.cpp:1694 +msgid "Unable to open DVD" +msgstr "Ne mogu da otvorim DVD" + +#: libk9copy/k9dvdbackup.cpp:585 +msgid "Unable to open vobs for titleset %1" +msgstr "Ne mogu da otvorim vob-ove za niz naslova %1" + +#: libk9copy/k9dvdbackup.cpp:1381 +msgid "Updating vob %1" +msgstr "Ažuriram vob %1" + +#: libk9copy/k9dvdbackup.cpp:1398 +msgid "DVD backup canceled" +msgstr "Pravljenje rezervne kopije prekinuto" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "UreÄ‘aji" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "UreÄ‘aji nisu pronaÄ‘eni od strane programa" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 src/k9copy.cpp:294 +msgid "DVD Backup" +msgstr "DVD rezervna kopija" + +#: src/k9settings.cpp:42 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:42 +msgid "MPEG-4 Codecs" +msgstr "MPEG-4 kodeci" + +#: src/k9settings.cpp:48 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:57 +msgid "Title preview" +msgstr "pregled naslova" + +#: src/k9mp4title.cpp:36 src/k9mp4title.cpp:109 src/k9titlefactor.cpp:99 +msgid "Select a Title in the treeview..." +msgstr "Izaberite naslov u stablu za pregled..." + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "Alat za pravljenje DVD rezervnih kopija u KDE okruženju" + +#: src/main.cpp:39 +msgid "output device" +msgstr "izlazni ureÄ‘aj" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "naslov koji da pustim" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "pusti naslov na standardni izlaz" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "obeleživaÄ poÄetka" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "obeleživaÄ kraja" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "lista zvuÄnih tokova" + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "lusta spu tokova" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "faktor kompresije" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "primorani faktor kompresije" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "veliÄina ćelije za umnožavanje" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "ukupna veliÄina izabranih naslova" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "veliÄina poglavlja za umnožavanje" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "izabrana poglavlja" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "veliÄina novog DVD-a" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "izabrano poglavnje" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "broj ćelije u izabranom poglavlju" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "ime datoteke za stanje" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "pokreni datoteku za stanjem" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "nastavi reprodukciju od zadnjeg sektora" + +#: src/main.cpp:58 +msgid "don't save status at end" +msgstr "ne Äuvaj stanje na kraju" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "saÄuvaj ćeliju u privremenu datoteku pre kodiranja" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "za unutarnju upotrebu" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "k9Copy" + +#: src/main.cpp:69 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "_: IME PREVODILACA\\nMiloÅ¡ Popović" + +#: src/main.cpp:70 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "_: MEJL ADRESA PREVODILACA\\ngpopac@gmail.com" + +#: src/k9prefmencoder.cpp:105 src/k9prefmencoder.cpp:109 +#: src/k9prefmencoder.cpp:120 src/k9prefmencoder.cpp:122 +msgid "new profile" +msgstr "novi profil" + +#: src/k9copy.cpp:137 +msgid "Shrink Factor" +msgstr "Faktor kompresije" + +#: src/k9copy.cpp:194 k9author/k9importfiles.cpp:31 +msgid "Edit menu" +msgstr "Uredi meni" + +#: src/k9copy.cpp:263 +msgid "Play title" +msgstr "Pusti naslov" + +#: src/k9copy.cpp:279 +msgid "Create MPEG-4" +msgstr "Napravi MPEG-4" + +#: src/k9copy.cpp:286 +msgid "Eject" +msgstr "Izbaci" + +#: src/k9copy.cpp:300 +msgid "DVD Author" +msgstr "DVS autor" + +#: src/k9copy.cpp:306 +msgid "Create DVD" +msgstr "Napravi DVD" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding options" +msgstr "Opcije MPEG4 kodiranja" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding Options" +msgstr "Opcije MPEG4 kodiranja" + +#: src/k9copy.cpp:375 +msgid "Settings" +msgstr "Postavke" + +#: src/k9langselect.cpp:90 +msgid "Subtitles" +msgstr "Prevodi" + +#: src/k9main.cpp:373 src/k9main.cpp:1141 +msgid "DVD is not opened" +msgstr "DVD nije otvoren" + +#: src/k9main.cpp:373 src/k9main.cpp:395 +msgid "DVD Copy" +msgstr "DVD umnožavanje" + +#: src/k9main.cpp:395 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"Nedovoljno mesta na disku u %1\n" +"%2 MB oÄekivano" + +#: src/k9main.cpp:399 +msgid "Backup in progress" +msgstr "Pravljenje rezervne kopije u toku" + +#: src/k9main.cpp:459 src/k9main.cpp:608 src/k9main.cpp:1194 +msgid "Ready" +msgstr "Spremno" + +#: src/k9main.cpp:464 k9author/k9import.cpp:156 +msgid "processing" +msgstr "obrada" + +#: src/k9main.cpp:499 src/k9main.cpp:1247 k9author/k9import.cpp:63 +msgid "ISO Image" +msgstr "ISO odraz" + +#: src/k9main.cpp:560 +msgid "Open DVD" +msgstr "Otvori DVD" + +#: src/k9main.cpp:586 +msgid "Titleset %1" +msgstr "Niz naslova %1" + +#: src/k9main.cpp:636 +msgid "chapters" +msgstr "poglavlja" + +#: src/k9main.cpp:644 src/k9main.cpp:657 k9author/k9newtitle.cpp:117 +#: k9author/k9newtitle.cpp:139 +msgid "chapter %1" +msgstr "poglavlje %1" + +#: src/k9main.cpp:645 src/k9main.cpp:660 src/k9main.cpp:719 src/k9main.cpp:737 +msgid "%1 MB" +msgstr "%1 MB" + +#: src/k9main.cpp:699 +msgid "video %1 " +msgstr "video %1 " + +#: src/k9main.cpp:710 +msgid "audio %1 " +msgstr "zvuk %1 " + +#: src/k9main.cpp:730 +msgid "subpicture %1 " +msgstr "prevod %1 " + +#: src/k9main.cpp:1149 +msgid "Transcoding title : %1" +msgstr "Kodiram naslov : %1" + +#: src/k9main.cpp:1248 k9author/k9import.cpp:64 +msgid "Folder" +msgstr "Fascikla" + +#: src/k9main.cpp:1355 +msgid "Open ISO Image" +msgstr "Otvori ISO odraz" + +#: src/k9main.cpp:1366 +msgid "Open DVD folder" +msgstr "Otvori DVD fasciklu" + +#: src/k9mencodercmdgen.cpp:103 +msgid "Filters" +msgstr "Filteri" + +#: src/k9playbackoptions.cpp:149 +msgid "none" +msgstr "niÅ¡ta" + +#: src/k9titlefactor.cpp:110 +msgid "Shrink Factor for %1" +msgstr "Faktor suženja za %1" + +#: k9author/k9newdvd.cpp:94 +msgid "Creating root menu" +msgstr "Pravim glavni meni" + +#: k9author/k9newdvd.cpp:134 +msgid "The dvd authoring was canceled" +msgstr "Autorizacija DVD-a je bila prekinuta" + +#: k9author/k9newdvd.cpp:160 +msgid "Creating menu for title %1" +msgstr "Pravim meni za naslov %1" + +#: k9author/k9newdvd.cpp:381 k9author/k9newtitle.cpp:63 +msgid "title %1" +msgstr "naslov %1" + +#: k9author/k9avidecode.cpp:31 k9author/k9avidecode.cpp:35 +msgid "Cannot open then library %1" +msgstr "Ne mogu da otvorim biblioteku %1" + +#: k9author/k9avidecode.cpp:88 +msgid "Couldn't open the file %1" +msgstr "Ne mogu da otvorim datoteku %1" + +#: k9author/k9avidecode.cpp:93 +msgid "Couldn't find stream information" +msgstr "Ne mogu da naÄ‘em podatke za protok" + +#: k9author/k9avidecode.cpp:106 +msgid "The file doesn't contain any video stream" +msgstr "Datoteka ne sadrži ni jedan video tok" + +#: k9author/k9avidecode.cpp:117 +msgid "Unsupported codec" +msgstr "Nepodržani kodek" + +#: k9author/k9avidecode.cpp:122 +msgid "Could'nt open the codec" +msgstr "Ne mogu da otvorim kodek" + +#: k9author/k9avidecode.cpp:133 +msgid "Unable to allocate memory for frames" +msgstr "Ne mogu da alociram memoriju za kadrove" + +#: k9author/k9menuedit.cpp:245 +msgid "Title %1 Menu" +msgstr "Meni %1. naslova" + +#: k9author/k9menuedit.cpp:254 k9author/k9menuedit.cpp:291 +msgid "Play Menu" +msgstr "Pusti meni" + +#: k9author/k9menuedit.cpp:256 +msgid "Play Title" +msgstr "Pusti naslov" + +#: k9author/k9menuedit.cpp:262 +msgid "Play Root Menu" +msgstr "Pusti glavni meni" + +#: k9author/k9menuedit.cpp:264 +msgid "Play Title Menu" +msgstr "Pusti meni naslova" + +#: k9author/k9menuedit.cpp:269 k9author/k9menuedit.cpp:295 +msgid "Play Title %1" +msgstr "Pusti naslov %1" + +#: k9author/k9importfiles.cpp:24 +msgid "Create new DVD" +msgstr "Napravi novi DVD" diff --git a/po/tr.po b/po/tr.po new file mode 100644 index 0000000..e7f408c --- /dev/null +++ b/po/tr.po @@ -0,0 +1,2196 @@ +# translation of tr.po to +# translation of a.po to +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Can CoÅŸkuner , 2007. +# Murat Åženel , 2007. +msgid "" +msgstr "" +"Project-Id-Version: tr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-10-14 09:03+0200\n" +"PO-Revision-Date: 2007-10-17 11:01+0300\n" +"Last-Translator: Murat Åženel \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: rc.cpp:3 debug/libk9copy/backupdlg.cpp:156 libk9copy/k9dvdauthor.cpp:404 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - Yedekleme seviyesi" + +#: rc.cpp:6 debug/libk9copy/backupdlg.cpp:157 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

DVD Yedekleme

" + +#: rc.cpp:9 debug/libk9copy/backupdlg.cpp:158 +#, no-c-format +msgid "Current step" +msgstr "Şu anki adım" + +#: rc.cpp:12 rc.cpp:47 rc.cpp:65 debug/libk9copy/backupdlg.cpp:159 +#: debug/libk9copy/mp4dlg.cpp:148 debug/libk9copy/progress.cpp:116 +#, no-c-format +msgid "Elapsed Time" +msgstr "Geçen süre" + +#: rc.cpp:15 rc.cpp:612 rc.cpp:640 rc.cpp:666 +#: debug/libk9copy/backupdlg.cpp:160 debug/k9author/newTitle.cpp:131 +#: debug/k9author/chapterEdit.cpp:154 debug/k9author/import.cpp:111 +#, no-c-format +msgid "--:--:--" +msgstr "--:--:--" + +#: rc.cpp:19 debug/libk9copy/dvdprogress.cpp:92 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - DVD Analizi" + +#: rc.cpp:25 debug/libk9copy/processList.cpp:68 +#, no-c-format +msgid "Process List" +msgstr "İşlem listesi" + +#: rc.cpp:28 debug/libk9copy/processList.cpp:33 +#: debug/libk9copy/processList.cpp:69 +#, no-c-format +msgid "Processes" +msgstr "İşlemler" + +#: rc.cpp:31 debug/libk9copy/processList.cpp:34 +#: debug/libk9copy/processList.cpp:70 +#, no-c-format +msgid "Elapsed" +msgstr "Geçen süre" + +#: rc.cpp:34 rc.cpp:603 debug/libk9copy/processList.cpp:35 +#: debug/libk9copy/processList.cpp:71 debug/k9author/import.cpp:46 +#: debug/k9author/import.cpp:107 +#, no-c-format +msgid "..." +msgstr "..." + +#: rc.cpp:40 debug/libk9copy/processList.cpp:73 debug/src/progress.cpp:81 +#, no-c-format +msgid "Alt+C" +msgstr "Alt+C" + +#: rc.cpp:43 debug/libk9copy/progress.cpp:114 debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 debug/src/k9copy.moc.cpp:42 +#, no-c-format +msgid "k9Copy" +msgstr "k9Copy" + +#: rc.cpp:52 debug/libk9copy/mp4dlg.cpp:141 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - kod çevirimi" + +#: rc.cpp:55 debug/libk9copy/mp4dlg.cpp:142 +#, no-c-format +msgid "Encoding" +msgstr "Kodlama" + +#: rc.cpp:62 debug/libk9copy/mp4dlg.cpp:147 k9author/k9newdvd.cpp:344 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: rc.cpp:68 rc.cpp:154 rc.cpp:181 rc.cpp:284 debug/libk9copy/mp4dlg.cpp:149 +#: debug/src/prefAuthor.cpp:147 debug/src/prefMPEG4.cpp:337 +#: debug/src/prefMPEG4.cpp:347 +#, no-c-format +msgid "Bitrate" +msgstr "Bit Oranı" + +#: rc.cpp:71 rc.cpp:215 rc.cpp:232 debug/libk9copy/mp4dlg.cpp:150 +#: debug/src/k9mainw.cpp:66 debug/src/k9mainw.cpp:161 +#, no-c-format +msgid "Size" +msgstr "Boyut" + +#: rc.cpp:74 debug/src/mencoderCmdGen.cpp:98 src/k9mencodercmdgen.cpp:55 +#, no-c-format +msgid "MEncoder options" +msgstr "MEncoder seçenekleri" + +#: rc.cpp:78 debug/src/mencoderCmdGen.cpp:108 src/k9mencodercmdgen.cpp:68 +#, no-c-format +msgid "Audio Codec" +msgstr "Ses Kodeği" + +#: rc.cpp:81 rc.cpp:169 debug/src/prefMPEG4.cpp:343 +#: debug/src/mencoderCmdGen.cpp:104 +#, no-c-format +msgid "faac" +msgstr "faac" + +#: rc.cpp:84 rc.cpp:96 debug/src/mencoderCmdGen.cpp:107 +#: debug/src/mencoderCmdGen.cpp:119 +#, no-c-format +msgid "lavc" +msgstr "lavc" + +#: rc.cpp:87 debug/src/mencoderCmdGen.cpp:120 src/k9mencodercmdgen.cpp:84 +#, no-c-format +msgid "Video Codec" +msgstr "Video Çözücü" + +#: rc.cpp:90 rc.cpp:121 rc.cpp:388 debug/src/prefMPEG4.cpp:323 +#: debug/src/prefMencoder.cpp:299 debug/src/mencoderCmdGen.cpp:113 +#, no-c-format +msgid "x264" +msgstr "x264" + +#: rc.cpp:93 debug/src/mencoderCmdGen.cpp:116 +#, no-c-format +msgid "xvid" +msgstr "xvid" + +#: rc.cpp:99 rc.cpp:313 rc.cpp:365 debug/src/prefMPEG4.cpp:315 +#: debug/src/prefMencoder.cpp:286 debug/src/prefpreview.cpp:140 +#, no-c-format +msgid "Form1" +msgstr "Form1" + +#: rc.cpp:103 debug/src/prefMPEG4.cpp:339 +#, no-c-format +msgid "Video" +msgstr "Video" + +#: rc.cpp:106 debug/src/prefMPEG4.cpp:317 +#, no-c-format +msgid "2 pass" +msgstr "2 geçiş" + +#: rc.cpp:109 debug/src/prefMPEG4.cpp:318 +#, no-c-format +msgid "Alt+2" +msgstr "Alt+2" + +#: rc.cpp:112 rc.cpp:163 debug/src/prefMPEG4.cpp:319 +#: debug/src/prefMPEG4.cpp:340 +#, no-c-format +msgid "Codec" +msgstr "Kodek" + +#: rc.cpp:115 rc.cpp:385 debug/src/prefMPEG4.cpp:321 +#: debug/src/prefMencoder.cpp:298 +#, no-c-format +msgid "XviD" +msgstr "XviD" + +#: rc.cpp:118 debug/src/prefMPEG4.cpp:322 +#, no-c-format +msgid "lavc MPEG4" +msgstr "lavc MPEG4" + +#: rc.cpp:130 debug/src/prefMPEG4.cpp:327 +#, no-c-format +msgid "640" +msgstr "640" + +#: rc.cpp:134 debug/src/prefMPEG4.cpp:329 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "&Oranı koru" + +#: rc.cpp:137 rc.cpp:493 debug/src/playbackoptionsw.cpp:230 +#: debug/src/prefMPEG4.cpp:330 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: rc.cpp:141 rc.cpp:206 rc.cpp:238 debug/src/prefMPEG4.cpp:332 +#: debug/src/k9mainw.cpp:163 +#, no-c-format +msgid "X" +msgstr "X" + +#: rc.cpp:145 debug/src/prefMPEG4.cpp:334 +#, no-c-format +msgid "File size" +msgstr "Dosya boyutu" + +#: rc.cpp:148 debug/src/prefMPEG4.cpp:335 +#, no-c-format +msgid "Alt+S" +msgstr "Alt+S" + +#: rc.cpp:151 debug/src/prefMPEG4.cpp:336 +#, no-c-format +msgid " MB" +msgstr " MB" + +#: rc.cpp:157 rc.cpp:519 debug/src/prefMPEG4.cpp:338 debug/src/prefDVD.cpp:100 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+B" + +#: rc.cpp:160 rc.cpp:263 rc.cpp:507 rc.cpp:575 +#: debug/src/playbackoptionsw.cpp:236 debug/src/prefAuthor.cpp:138 +#: debug/src/prefMPEG4.cpp:350 debug/k9Mplayer/mplayer.cpp:594 +#: src/k9langselect.cpp:79 +#, no-c-format +msgid "Audio" +msgstr "Ses" + +#: rc.cpp:166 debug/src/prefMPEG4.cpp:342 +#, no-c-format +msgid "mp3" +msgstr "mp3" + +#: rc.cpp:172 debug/src/prefMPEG4.cpp:344 +#, no-c-format +msgid "mp2" +msgstr "mp2" + +#: rc.cpp:175 debug/src/prefMPEG4.cpp:345 +#, no-c-format +msgid "ac3" +msgstr "ac3" + +#: rc.cpp:178 debug/src/prefMPEG4.cpp:346 +#, no-c-format +msgid "adpcm ima" +msgstr "adpcm ima" + +#: rc.cpp:185 debug/src/prefMPEG4.cpp:349 +#, no-c-format +msgid "Gain" +msgstr "Gain" + +#: rc.cpp:188 debug/src/prefMPEG4.cpp:351 +#, no-c-format +msgid "use cell cache" +msgstr "hücre ön belleği kullan" + +#: rc.cpp:191 rc.cpp:220 debug/src/k9mainw.cpp:157 +#, no-c-format +msgid "MainDlg" +msgstr "Ana Pencere" + +#: rc.cpp:194 rc.cpp:223 debug/src/k9mainw.cpp:158 +#, no-c-format +msgid "Output device " +msgstr "Çıktı" + +#: rc.cpp:197 rc.cpp:244 debug/src/k9mainw.cpp:166 +#, no-c-format +msgid "@" +msgstr "@" + +#: rc.cpp:200 +#, no-c-format +msgid "Input device " +msgstr "Kaynak" + +#: rc.cpp:203 rc.cpp:241 debug/src/k9mainw.cpp:165 libk9copy/k9burndvd.cpp:178 +#: libk9copy/k9burndvd.cpp:278 src/k9main.cpp:1344 +#: src/k9playbackoptions.cpp:147 k9author/k9import.cpp:207 +#, no-c-format +msgid "default" +msgstr "Öntanımlı" + +#: rc.cpp:209 +#, no-c-format +msgid "D&VD" +msgstr "D&VD" + +#: rc.cpp:212 rc.cpp:229 debug/src/k9mainw.cpp:65 debug/src/k9mainw.cpp:160 +#, no-c-format +msgid "Title" +msgstr "Başlık" + +#: rc.cpp:226 debug/src/k9mainw.cpp:159 src/main.cpp:37 +#, no-c-format +msgid "input device" +msgstr "kaynak" + +#: rc.cpp:235 debug/src/k9mainw.cpp:68 debug/src/k9mainw.cpp:162 +#, no-c-format +msgid "Content" +msgstr "İçerik" + +#: rc.cpp:248 debug/src/k9mainw.cpp:168 +#, no-c-format +msgid "Open a folder" +msgstr "Dosya aç" + +#: rc.cpp:252 debug/src/k9mainw.cpp:170 +#, no-c-format +msgid "Open an iso image" +msgstr "İso imajı aç" + +#: rc.cpp:255 debug/src/viewmpeg2.cpp:205 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - Başlık Önizleme" + +#: rc.cpp:260 debug/src/prefAuthor.cpp:137 +#, no-c-format +msgid "Authoring options" +msgstr "Yazma seçenekleri" + +#: rc.cpp:266 debug/src/prefAuthor.cpp:140 +#, no-c-format +msgid "AC3" +msgstr "AC3" + +#: rc.cpp:269 debug/src/prefAuthor.cpp:141 +#, no-c-format +msgid "MP2" +msgstr "MP2" + +#: rc.cpp:272 debug/src/prefAuthor.cpp:143 +#, no-c-format +msgid "128" +msgstr "128" + +#: rc.cpp:275 debug/src/prefAuthor.cpp:144 +#, no-c-format +msgid "192" +msgstr "192" + +#: rc.cpp:278 debug/src/prefAuthor.cpp:145 +#, no-c-format +msgid "320" +msgstr "320" + +#: rc.cpp:281 debug/src/prefAuthor.cpp:146 +#, no-c-format +msgid "Format" +msgstr "Biçim" + +#: rc.cpp:287 debug/src/prefAuthor.cpp:148 +#, no-c-format +msgid "Buttons" +msgstr "Düğmeler" + +#: rc.cpp:299 debug/src/prefAuthor.cpp:152 +#, no-c-format +msgid "Hilite color" +msgstr "Vurgu rengi" + +#: rc.cpp:303 debug/src/prefAuthor.cpp:154 +#, no-c-format +msgid "Text color" +msgstr "Metin rengi" + +#: rc.cpp:307 debug/src/langselectw.cpp:120 src/k9copy.cpp:120 +#, no-c-format +msgid "Selection" +msgstr "Seçim" + +#: rc.cpp:310 debug/src/langselectw.cpp:93 debug/src/langselectw.cpp:121 +#, no-c-format +msgid "Languages" +msgstr "Diller" + +#: rc.cpp:317 debug/src/prefpreview.cpp:142 +#, no-c-format +msgid "&Internal Player" +msgstr "&Dahili Oynatıcı" + +#: rc.cpp:320 debug/src/prefpreview.cpp:143 +#, no-c-format +msgid "Alt+I" +msgstr "Alt+l" + +#: rc.cpp:323 debug/src/prefpreview.cpp:144 +#, no-c-format +msgid "MPlayer" +msgstr "MPlayer" + +#: rc.cpp:326 debug/src/prefpreview.cpp:145 +#, no-c-format +msgid "Alt+M" +msgstr "Alt+M" + +#: rc.cpp:329 debug/src/prefpreview.cpp:146 +#, no-c-format +msgid "Internal viewer options" +msgstr "Dahili görüntüleyici seçenekleri" + +#: rc.cpp:332 debug/src/prefpreview.cpp:147 +#, no-c-format +msgid "use OpenGL" +msgstr "OpenGL kullan" + +#: rc.cpp:335 debug/src/prefpreview.cpp:148 +#, no-c-format +msgid "Video output" +msgstr "Video çıktısı" + +#: rc.cpp:338 debug/src/prefpreview.cpp:149 +#, no-c-format +msgid "Audio output" +msgstr "Ses çıktısı" + +#: rc.cpp:341 debug/src/prefpreview.cpp:151 +#, no-c-format +msgid "X11" +msgstr "X11" + +#: rc.cpp:344 debug/src/prefpreview.cpp:152 +#, no-c-format +msgid "Xv" +msgstr "Xv" + +#: rc.cpp:347 debug/src/prefpreview.cpp:153 +#, no-c-format +msgid "OpenGL" +msgstr "OpenGL" + +#: rc.cpp:350 rc.cpp:359 debug/src/prefpreview.cpp:154 +#: debug/src/prefpreview.cpp:158 +#, no-c-format +msgid "SDL" +msgstr "SDL" + +#: rc.cpp:353 debug/src/prefpreview.cpp:156 +#, no-c-format +msgid "ALSA" +msgstr "ALSA" + +#: rc.cpp:356 debug/src/prefpreview.cpp:157 +#, no-c-format +msgid "OSS" +msgstr "OSS" + +#: rc.cpp:362 debug/src/prefpreview.cpp:159 +#, no-c-format +msgid "MPlayer options" +msgstr "MPlayer seçenekleri" + +#: rc.cpp:368 debug/src/prefMencoder.cpp:287 +#, no-c-format +msgid "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" +msgstr "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" + +#: rc.cpp:375 debug/src/prefMencoder.cpp:292 +#, no-c-format +msgid "" +"pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" +msgstr "" +"geçiş numarası\n" +"video genişliği\n" +"video yüksekliği\n" +"video bitrate\n" +"audio bitrate" + +#: rc.cpp:382 debug/src/prefMencoder.cpp:326 +#, no-c-format +msgid "Video codecs" +msgstr "Video çözücüler" + +#: rc.cpp:391 debug/src/prefMencoder.cpp:300 +#, no-c-format +msgid "MJPEG" +msgstr "MJPEG" + +#: rc.cpp:394 debug/src/prefMencoder.cpp:301 +#, no-c-format +msgid "LJPEG" +msgstr "LJPEG" + +#: rc.cpp:397 debug/src/prefMencoder.cpp:302 +#, no-c-format +msgid "H.261" +msgstr "H.261" + +#: rc.cpp:400 debug/src/prefMencoder.cpp:303 +#, no-c-format +msgid "H.263" +msgstr "H.263" + +#: rc.cpp:403 debug/src/prefMencoder.cpp:304 +#, no-c-format +msgid "MPEG-4 (DivX 4/5)" +msgstr "MPEG-4 (DivX 4/5)" + +#: rc.cpp:406 debug/src/prefMencoder.cpp:305 +#, no-c-format +msgid "DivX 3" +msgstr "DivX 3" + +#: rc.cpp:409 debug/src/prefMencoder.cpp:306 +#, no-c-format +msgid "MS MPEG-4 v2" +msgstr "MS MPEG-4 v2" + +#: rc.cpp:412 debug/src/prefMencoder.cpp:307 +#, no-c-format +msgid "WMV7" +msgstr "WMV7" + +#: rc.cpp:415 debug/src/prefMencoder.cpp:308 +#, no-c-format +msgid "WMV8" +msgstr "WMV8" + +#: rc.cpp:418 debug/src/prefMencoder.cpp:309 +#, no-c-format +msgid "RealVideo" +msgstr "RealVideo" + +#: rc.cpp:421 debug/src/prefMencoder.cpp:310 +#, no-c-format +msgid "MPEG-1" +msgstr "MPEG-1" + +#: rc.cpp:424 debug/src/prefMencoder.cpp:311 +#, no-c-format +msgid "MPEG-2" +msgstr "MPEG-2" + +#: rc.cpp:427 debug/src/prefMencoder.cpp:312 +#, no-c-format +msgid "HuffYUV" +msgstr "HuffYUV" + +#: rc.cpp:430 debug/src/prefMencoder.cpp:313 +#, no-c-format +msgid "ffvHuff" +msgstr "ffvHuff" + +#: rc.cpp:433 debug/src/prefMencoder.cpp:314 +#, no-c-format +msgid "ASUS v1" +msgstr "ASUS v1" + +#: rc.cpp:436 debug/src/prefMencoder.cpp:315 +#, no-c-format +msgid "ASUS v2" +msgstr "ASUS v2" + +#: rc.cpp:440 rc.cpp:465 rc.cpp:555 debug/src/configDlg.cpp:42 +#: debug/src/configDlg.cpp:95 debug/src/prefMencoder.cpp:317 +#: debug/src/prefMencoder.cpp:329 +#, no-c-format +msgid "label" +msgstr "etiket" + +#: rc.cpp:443 debug/src/prefMencoder.cpp:318 +#, no-c-format +msgid "fourcc" +msgstr "fourcc" + +#: rc.cpp:446 debug/src/prefMencoder.cpp:319 +#, no-c-format +msgid "first pass" +msgstr "ilk geçiş" + +#: rc.cpp:451 debug/src/prefMencoder.cpp:322 +#, no-c-format +msgid "one pass" +msgstr "tek geçiş" + +#: rc.cpp:456 debug/src/prefMencoder.cpp:325 +#, no-c-format +msgid "second pass" +msgstr "ikinci geçiş" + +#: rc.cpp:459 debug/src/prefMencoder.cpp:332 +#, no-c-format +msgid "Audio codecs" +msgstr "Ses çözücüleri" + +#: rc.cpp:462 debug/src/prefMencoder.cpp:328 +#, no-c-format +msgid "New Item" +msgstr "Yeni Öğe" + +#: rc.cpp:469 debug/src/prefMencoder.cpp:331 +#, no-c-format +msgid "options" +msgstr "seçenekler" + +#: rc.cpp:472 debug/src/prefMencoder.cpp:333 +#, no-c-format +msgid "Available variables" +msgstr "Var olan değişkenler" + +#: rc.cpp:475 debug/src/titlefactor.cpp:321 +#, no-c-format +msgid "Shrink Factors" +msgstr "Küçültme Etkenleri" + +#: rc.cpp:478 debug/src/titlefactor.cpp:322 +#, no-c-format +msgid "Shrink Factor for Title %1" +msgstr "Başlık %1 için Küçültme Etkenleri" + +#: rc.cpp:481 debug/src/titlefactor.cpp:323 +#, no-c-format +msgid "Change Factor" +msgstr "Çarpanı değiştir" + +#: rc.cpp:484 debug/src/titlefactor.cpp:324 +#, no-c-format +msgid "0.00" +msgstr "0.00" + +#: rc.cpp:487 debug/src/playbackoptionsw.cpp:228 src/k9copy.cpp:114 +#, no-c-format +msgid "DVD playback options" +msgstr "DVD oynatma seçenekleri" + +#: rc.cpp:490 debug/src/playbackoptionsw.cpp:229 +#, no-c-format +msgid "&Keep original menus" +msgstr "&Orijinal menüyü koru" + +#: rc.cpp:498 debug/src/playbackoptionsw.cpp:233 +#, no-c-format +msgid "Selected Titles" +msgstr "Seçili başlıklar" + +#: rc.cpp:501 debug/src/playbackoptionsw.cpp:234 +#, no-c-format +msgid "Default language" +msgstr "Öntanımlı dil" + +#: rc.cpp:504 debug/src/playbackoptionsw.cpp:235 +#, no-c-format +msgid "Subtitle" +msgstr "Altyazı" + +#: rc.cpp:510 debug/src/prefDVD.cpp:97 +#, no-c-format +msgid "prefDVD" +msgstr "prefDVD" + +#: rc.cpp:513 debug/src/prefDVD.cpp:98 +#, no-c-format +msgid "Output directory" +msgstr "Çıktı dizini" + +#: rc.cpp:516 debug/src/prefDVD.cpp:99 +#, no-c-format +msgid "Burn with k3b" +msgstr "K3b ile yaz" + +#: rc.cpp:522 debug/src/prefDVD.cpp:101 +#, no-c-format +msgid "Auto burn" +msgstr "Otomatik yaz" + +#: rc.cpp:525 debug/src/prefDVD.cpp:102 +#, no-c-format +msgid "Alt+T" +msgstr "Alt+T" + +#: rc.cpp:528 debug/src/prefDVD.cpp:103 +#, no-c-format +msgid "DVD size" +msgstr "DVD boyutu" + +#: rc.cpp:531 debug/src/prefDVD.cpp:104 +#, no-c-format +msgid "Quick scan" +msgstr "Çabuk tara" + +#: rc.cpp:534 debug/src/prefDVD.cpp:105 +#, no-c-format +msgid "Alt+Q" +msgstr "Alt+Q" + +#: rc.cpp:537 debug/src/prefDVD.cpp:106 +#, no-c-format +msgid "use dvdAuthor for copy without menus" +msgstr "Kopyalama için dvdAuthor'u menüsüz kullan" + +#: rc.cpp:540 debug/src/prefDVD.cpp:107 +#, no-c-format +msgid "Alt+D" +msgstr "Alt+D" + +#: rc.cpp:543 debug/src/prefDVD.cpp:108 +#, no-c-format +msgid "Clear output directory on exit" +msgstr "Çıkışta çıktı dizinini temizle" + +#: rc.cpp:546 debug/src/prefDVD.cpp:109 +#, no-c-format +msgid "Alt+Y" +msgstr "Alt+Y" + +#: rc.cpp:549 debug/src/configDlg.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - Aygıtlar" + +#: rc.cpp:552 debug/src/configDlg.cpp:40 debug/src/configDlg.cpp:94 +#, no-c-format +msgid "device" +msgstr "Aygıt" + +#: rc.cpp:558 debug/src/configDlg.cpp:44 debug/src/configDlg.cpp:96 +#, no-c-format +msgid "Input" +msgstr "Girdi" + +#: rc.cpp:561 rc.cpp:597 debug/src/configDlg.cpp:46 debug/src/configDlg.cpp:97 +#: debug/k9author/import.cpp:105 +#, no-c-format +msgid "Output" +msgstr "Çıktı" + +#: rc.cpp:572 debug/k9Mplayer/mplayer.cpp:593 src/k9settings.cpp:57 +#: src/k9copy.cpp:128 src/k9copy.cpp:390 k9Mplayer/k9mplayer.cpp:97 +#, no-c-format +msgid "Preview" +msgstr "Önizleme" + +#: rc.cpp:578 debug/k9Mplayer/mplayer.cpp:595 +#, no-c-format +msgid "Subpicture" +msgstr "Alt resim" + +#: rc.cpp:585 debug/k9Mplayer/mplayer.cpp:600 +#, no-c-format +msgid "-" +msgstr "-" + +#: rc.cpp:589 debug/k9Mplayer/mplayer.cpp:602 +#, no-c-format +msgid "+" +msgstr "+" + +#: rc.cpp:594 debug/k9author/import.cpp:104 +#, no-c-format +msgid "import" +msgstr "aktar" + +#: rc.cpp:600 debug/k9author/import.cpp:44 debug/k9author/import.cpp:106 +#, no-c-format +msgid "Video files" +msgstr "Video dosyaları" + +#: rc.cpp:606 debug/k9author/import.cpp:109 +#, no-c-format +msgid "PAL" +msgstr "PAL" + +#: rc.cpp:609 debug/k9author/import.cpp:110 +#, no-c-format +msgid "NTSC" +msgstr "NTSC" + +#: rc.cpp:615 debug/k9author/chapterEdit.cpp:145 src/k9copy.cpp:211 +#: k9author/k9importfiles.cpp:34 +#, no-c-format +msgid "Chapter properties" +msgstr "Bölüm özellikleri" + +#: rc.cpp:618 debug/k9author/chapterEdit.cpp:146 +#, no-c-format +msgid "start" +msgstr "başlangıç" + +#: rc.cpp:621 debug/k9author/chapterEdit.cpp:147 +#, no-c-format +msgid "video" +msgstr "video" + +#: rc.cpp:624 debug/k9author/chapterEdit.cpp:148 +#, no-c-format +msgid "" +"*.avi\n" +"*.mpeg" +msgstr "" +"*.avi\n" +"*.mpeg" + +#: rc.cpp:628 rc.cpp:643 debug/k9author/chapterEdit.cpp:150 +#: debug/k9author/chapterEdit.cpp:155 +#, no-c-format +msgid "set Current Frame" +msgstr "Şu anki kareyi ayarla" + +#: rc.cpp:631 rc.cpp:637 debug/k9author/chapterEdit.cpp:151 +#: debug/k9author/chapterEdit.cpp:153 +#, no-c-format +msgid "break continuity" +msgstr "ara devamlılığı" + +#: rc.cpp:634 debug/k9author/chapterEdit.cpp:152 +#, no-c-format +msgid "end" +msgstr "son" + +#: rc.cpp:646 debug/k9author/chapterEdit.cpp:156 +#, no-c-format +msgid "set Title button" +msgstr "Başlık düğmesini ayarla" + +#: rc.cpp:649 debug/k9author/newTitle.cpp:124 src/k9copy.cpp:204 +#: k9author/k9importfiles.cpp:40 k9author/k9newtitle.cpp:55 +#, no-c-format +msgid "Add title" +msgstr "Başlık ekle" + +#: rc.cpp:653 debug/k9author/newTitle.cpp:126 +#, no-c-format +msgid "number of chapters" +msgstr "Bölüm sayısı" + +#: rc.cpp:656 debug/k9author/newTitle.cpp:127 +#, no-c-format +msgid "chapter length" +msgstr "bölüm uzunluğu" + +#: rc.cpp:663 debug/k9author/newTitle.cpp:130 +#, no-c-format +msgid "Video file" +msgstr "Video dosyası" + +#: rc.cpp:669 debug/k9author/menuEdit.cpp:146 src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +#, no-c-format +msgid "Edit Menu" +msgstr "Menüyü Düzenle" + +#: rc.cpp:672 debug/k9author/menuEdit.cpp:147 +#, no-c-format +msgid "Text" +msgstr "Metin" + +#: rc.cpp:675 debug/k9author/menuEdit.cpp:148 +#, no-c-format +msgid "Background picture" +msgstr "Arkaplan resmi" + +#: rc.cpp:690 debug/k9author/menuEdit.cpp:156 k9author/k9menuedit.cpp:286 +#: k9author/k9import.cpp:45 +#, no-c-format +msgid "Root Menu" +msgstr "Kök Menü" + +#: rc.cpp:693 debug/k9author/menuEdit.cpp:157 +#, no-c-format +msgid "At start" +msgstr "Başta" + +#: rc.cpp:696 debug/k9author/menuEdit.cpp:159 +#, no-c-format +msgid "Play menu" +msgstr "Menüyü oynat" + +#: rc.cpp:699 rc.cpp:711 debug/k9author/menuEdit.cpp:160 +#: debug/k9author/menuEdit.cpp:165 +#, no-c-format +msgid "Play title 1" +msgstr "Başlık 1'i oynat" + +#: rc.cpp:702 debug/k9author/menuEdit.cpp:161 +#, no-c-format +msgid "At End" +msgstr "Sonda" + +#: rc.cpp:705 debug/k9author/menuEdit.cpp:163 +#, no-c-format +msgid "Play root menu" +msgstr "Kök menüyü oynat" + +#: rc.cpp:708 debug/k9author/menuEdit.cpp:164 +#, no-c-format +msgid "Play title menu" +msgstr "Başlık menüsünü oynat" + +#: rc.cpp:717 +#, no-c-format +msgid "A&ctions" +msgstr "&Eylemler" + +#: rc.cpp:720 +#, no-c-format +msgid "Actions ToolBar" +msgstr "Eylemler Araç Çubuğu" + +#: debug/libk9copy/k9ifo2.moc.cpp:34 debug/libk9copy/k9ifo2.moc.cpp:42 +msgid "k9Ifo2" +msgstr "k9Ifo2" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:34 +#: debug/libk9copy/k9dvdchapter.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "k9ChapterCell" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:107 +#: debug/libk9copy/k9dvdchapter.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "k9DVDBölüm" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "k9DVDYaz" + +#: debug/libk9copy/k9dvd.moc.cpp:34 debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "k9DVD" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9DVDVideoStream" +msgstr "k9DVDVideoAkışı" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDAudioStream" +msgstr "k9DVDSesAkışı" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDSubtitle" +msgstr "k9DVDAltyazı" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDTitle" +msgstr "k9DVDBaşlık" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "k9DVDProgress" + +#: debug/libk9copy/k9dvdtitleset.moc.cpp:34 +#: debug/libk9copy/k9dvdtitleset.moc.cpp:42 +msgid "k9DVDTitleset" +msgstr "k9DVDTitlesetx" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "k9DVDAuthor" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "k9DVDBoyutu" + +#: debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - Menü önizleme" + +#: debug/src/kcddrive.moc.cpp:34 debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "kCDSürücüsü" + +#: debug/src/kcddrive.moc.cpp:107 debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "kCDSürücüleri" + +#: debug/src/kviewmpeg2.moc.cpp:34 debug/src/kviewmpeg2.moc.cpp:42 +msgid "k9Widget" +msgstr "k9Widget" + +#: debug/src/kviewmpeg2.moc.cpp:107 debug/src/kviewmpeg2.moc.cpp:115 +msgid "kViewMPEG2" +msgstr "kViewMPEG2" + +#: debug/k9Mplayer/k9mplayer.moc.cpp:34 debug/k9Mplayer/k9mplayer.moc.cpp:42 +msgid "K9Mplayer" +msgstr "K9Mplayer" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "kDecMPEG2" + +#: libk9copy/k9dvd.cpp:133 +msgid "for visually impaired" +msgstr "görme engelliler için" + +#: libk9copy/k9dvd.cpp:134 +msgid "director's comments" +msgstr "yönetmen'in yorumları" + +#: libk9copy/k9dvd.cpp:135 +msgid "alternate director's comments" +msgstr "yönetmen'in yorumlarını değiştir" + +#: libk9copy/k9dvd.cpp:139 +msgid "Large" +msgstr "GenişEtiket" + +#: libk9copy/k9dvd.cpp:140 +msgid "Children" +msgstr "Çocuklar" + +#: libk9copy/k9dvd.cpp:141 libk9copy/k9dvd.cpp:147 libk9copy/k9dvd.cpp:148 +#: libk9copy/k9dvd.cpp:149 +msgid "reserved" +msgstr "dolu" + +#: libk9copy/k9dvd.cpp:142 +msgid "Normal captions" +msgstr "Normal başlıklar" + +#: libk9copy/k9dvd.cpp:143 +msgid "Large captions" +msgstr "Geniş yakalamalarMPlayer seçenekleri" + +#: libk9copy/k9dvd.cpp:144 +msgid "Children captions" +msgstr "Çocuk başlıkları" + +#: libk9copy/k9dvd.cpp:146 +msgid "Forced" +msgstr "Güçlendirilmiş" + +#: libk9copy/k9dvd.cpp:150 +msgid "Director's comments" +msgstr "Yönetmenin yorumları" + +#: libk9copy/k9dvd.cpp:151 +msgid "Large director's comments" +msgstr "Yönetmenin yorumlarını genişlet" + +#: libk9copy/k9dvd.cpp:152 +msgid "Director's comments for children" +msgstr "Çocuklar için yönetmenin yorumları" + +#: libk9copy/k9dvd.cpp:189 +msgid "Couldn't open %1 for title\n" +msgstr "Başlık için %1 açılamadı\n" + +#: libk9copy/k9dvd.cpp:191 libk9copy/k9dvd.cpp:199 libk9copy/k9dvd.cpp:207 +#: libk9copy/k9dvd.cpp:368 src/k9main.cpp:563 +msgid "unknown" +msgstr "bilinmeyen" + +#: libk9copy/k9dvd.cpp:197 +msgid "Couldn't seek in %1 for title\n" +msgstr "Başlık %1 için konumlanamadı\n" + +#: libk9copy/k9dvd.cpp:224 +msgid "Not Specified" +msgstr "Belirtilmemiş" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afar" +msgstr "Çok uzakta" + +#: libk9copy/k9dvd.cpp:224 +msgid "Abkhazian" +msgstr "Abhazca" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afrikaans" +msgstr "Afrikalılar" + +#: libk9copy/k9dvd.cpp:224 +msgid "Amharic" +msgstr "Habeşistan" + +#: libk9copy/k9dvd.cpp:225 +msgid "Arabic" +msgstr "Arapça" + +#: libk9copy/k9dvd.cpp:225 +msgid "Assamese" +msgstr "Assamese" + +#: libk9copy/k9dvd.cpp:225 +msgid "Aymara" +msgstr "Aymara" + +#: libk9copy/k9dvd.cpp:225 +msgid "Azerbaijani" +msgstr "Azerice" + +#: libk9copy/k9dvd.cpp:225 +msgid "Bashkir" +msgstr "Bashkir" + +#: libk9copy/k9dvd.cpp:226 +msgid "Byelorussian" +msgstr "Beyaz Rusça" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bulgarian" +msgstr "Bulgarca" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bihari" +msgstr "Bihari" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bislama" +msgstr "Bislama" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bengali; Bangla" +msgstr "Bengali; Bangla" + +#: libk9copy/k9dvd.cpp:227 +msgid "Tibetan" +msgstr "Tibetçe" + +#: libk9copy/k9dvd.cpp:227 +msgid "Breton" +msgstr "Breton" + +#: libk9copy/k9dvd.cpp:227 +msgid "Catalan" +msgstr "Katalanca" + +#: libk9copy/k9dvd.cpp:227 +msgid "Corsican" +msgstr "Corsican" + +#: libk9copy/k9dvd.cpp:227 +msgid "Czech" +msgstr "Çekçe" + +#: libk9copy/k9dvd.cpp:228 +msgid "Welsh" +msgstr "Galce" + +#: libk9copy/k9dvd.cpp:228 +msgid "Dansk" +msgstr "Dansk" + +#: libk9copy/k9dvd.cpp:228 +msgid "Deutsch" +msgstr "Almanca" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bhutani" +msgstr "Bhutani" + +#: libk9copy/k9dvd.cpp:228 +msgid "Greek" +msgstr "Rumca" + +#: libk9copy/k9dvd.cpp:228 +msgid "English" +msgstr "İngilizce" + +#: libk9copy/k9dvd.cpp:229 +msgid "Esperanto" +msgstr "Esperanto" + +#: libk9copy/k9dvd.cpp:229 +msgid "Espanol" +msgstr "İspanyolca" + +#: libk9copy/k9dvd.cpp:229 +msgid "Estonian" +msgstr "Estçe" + +#: libk9copy/k9dvd.cpp:229 +msgid "Basque" +msgstr "Basque" + +#: libk9copy/k9dvd.cpp:229 +msgid "Persian" +msgstr "Farsça" + +#: libk9copy/k9dvd.cpp:230 +msgid "Suomi" +msgstr "Suomi" + +#: libk9copy/k9dvd.cpp:230 +msgid "Fiji" +msgstr "Fiji" + +#: libk9copy/k9dvd.cpp:230 +msgid "Faroese" +msgstr "Faroese" + +#: libk9copy/k9dvd.cpp:230 +msgid "Francais" +msgstr "Francais" + +#: libk9copy/k9dvd.cpp:230 +msgid "Frisian" +msgstr "Frisian" + +#: libk9copy/k9dvd.cpp:230 +msgid "Gaelic" +msgstr "İrlandaca" + +#: libk9copy/k9dvd.cpp:231 +msgid "Scots Gaelic" +msgstr "İskoçça" + +#: libk9copy/k9dvd.cpp:231 +msgid "Galician" +msgstr "Galician" + +#: libk9copy/k9dvd.cpp:231 +msgid "Guarani" +msgstr "Guarani" + +#: libk9copy/k9dvd.cpp:231 +msgid "Gujarati" +msgstr "Gujarati" + +#: libk9copy/k9dvd.cpp:231 +msgid "Hausa" +msgstr "Hausa" + +#: libk9copy/k9dvd.cpp:232 libk9copy/k9dvd.cpp:234 +msgid "Hebrew" +msgstr "İbranice" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hindi" +msgstr "Hintçe" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hrvatski" +msgstr "Hırvatça" + +#: libk9copy/k9dvd.cpp:232 +msgid "Magyar" +msgstr "Magyar" + +#: libk9copy/k9dvd.cpp:232 +msgid "Armenian" +msgstr "Ermenice" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingua" +msgstr "Interlingua" + +#: libk9copy/k9dvd.cpp:233 +msgid "Indonesian" +msgstr "Endonezyaca" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingue" +msgstr "Interlingue" + +#: libk9copy/k9dvd.cpp:233 +msgid "Inupiak" +msgstr "Inupiak" + +#: libk9copy/k9dvd.cpp:234 +msgid "Islenska" +msgstr "Islenska" + +#: libk9copy/k9dvd.cpp:234 +msgid "Italiano" +msgstr "İtalyanca" + +#: libk9copy/k9dvd.cpp:234 +msgid "Inuktitut" +msgstr "Inuktitut" + +#: libk9copy/k9dvd.cpp:234 +msgid "Japanese" +msgstr "Japonca" + +#: libk9copy/k9dvd.cpp:235 libk9copy/k9dvd.cpp:250 +msgid "Yiddish" +msgstr "Yahudi Almancası" + +#: libk9copy/k9dvd.cpp:235 +msgid "Javanese" +msgstr "Cavaca" + +#: libk9copy/k9dvd.cpp:235 +msgid "Georgian" +msgstr "Gürcüce" + +#: libk9copy/k9dvd.cpp:235 +msgid "Kazakh" +msgstr "Kazakça" + +#: libk9copy/k9dvd.cpp:235 +msgid "Greenlandic" +msgstr "Grönlandca" + +#: libk9copy/k9dvd.cpp:236 +msgid "Cambodian" +msgstr "Kampuçça" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kannada" +msgstr "Kanada" + +#: libk9copy/k9dvd.cpp:236 +msgid "Korean" +msgstr "Korece" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kashmiri" +msgstr "Kashmiri" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kurdish" +msgstr "Kürtçe" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kirghiz" +msgstr "Kırgızca" + +#: libk9copy/k9dvd.cpp:237 +msgid "Latin" +msgstr "Latince" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lingala" +msgstr "Lingala" + +#: libk9copy/k9dvd.cpp:237 +msgid "Laothian" +msgstr "Laothian" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lithuanian" +msgstr "Litvanyaca" + +#: libk9copy/k9dvd.cpp:238 +msgid "Latvian, Lettish" +msgstr "Letonca" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malagasy" +msgstr "Malgaşça" + +#: libk9copy/k9dvd.cpp:238 +msgid "Maori" +msgstr "Maori" + +#: libk9copy/k9dvd.cpp:238 +msgid "Macedonian" +msgstr "Makedonca" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malayalam" +msgstr "Malayalam" + +#: libk9copy/k9dvd.cpp:239 +msgid "Mongolian" +msgstr "Moğolca" + +#: libk9copy/k9dvd.cpp:239 +msgid "Moldavian" +msgstr "Moldavyaca" + +#: libk9copy/k9dvd.cpp:239 +msgid "Marathi" +msgstr "Marathi" + +#: libk9copy/k9dvd.cpp:239 +msgid "Malay" +msgstr "Malayca" + +#: libk9copy/k9dvd.cpp:239 +msgid "Maltese" +msgstr "Maltaca" + +#: libk9copy/k9dvd.cpp:240 +msgid "Burmese" +msgstr "Birmanca" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nauru" +msgstr "Nauru" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nepali" +msgstr "Nepalce" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nederlands" +msgstr "Hollandaca" + +#: libk9copy/k9dvd.cpp:240 +msgid "Norsk" +msgstr "Norsk" + +#: libk9copy/k9dvd.cpp:240 +msgid "Occitan" +msgstr "Occitan" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oromo" +msgstr "Oromo" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oriya" +msgstr "Oriya" + +#: libk9copy/k9dvd.cpp:241 +msgid "Punjabi" +msgstr "Pencapça" + +#: libk9copy/k9dvd.cpp:241 +msgid "Polish" +msgstr "Polca" + +#: libk9copy/k9dvd.cpp:241 +msgid "Pashto, Pushto" +msgstr "Afganca" + +#: libk9copy/k9dvd.cpp:242 +msgid "Portugues" +msgstr "Portekizce" + +#: libk9copy/k9dvd.cpp:242 +msgid "Quechua" +msgstr "Quechua" + +#: libk9copy/k9dvd.cpp:242 +msgid "Rhaeto-Romance" +msgstr "Rhaeto-Romance" + +#: libk9copy/k9dvd.cpp:242 +msgid "Kirundi" +msgstr "Kirundi" + +#: libk9copy/k9dvd.cpp:242 +msgid "Romanian" +msgstr "Rumence" + +#: libk9copy/k9dvd.cpp:243 +msgid "Russian" +msgstr "Rusça" + +#: libk9copy/k9dvd.cpp:243 +msgid "Kinyarwanda" +msgstr "Kinyarwanda" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sanskrit" +msgstr "Sanskritçe" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sindhi" +msgstr "Sindhi" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sangho" +msgstr "Sangho" + +#: libk9copy/k9dvd.cpp:244 +msgid "Serbo-Croatian" +msgstr "Sırpça-Hırvatça" + +#: libk9copy/k9dvd.cpp:244 +msgid "Sinhalese" +msgstr "Sinhalese" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovak" +msgstr "Slovakça" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovenian" +msgstr "Slovence" + +#: libk9copy/k9dvd.cpp:244 +msgid "Samoan" +msgstr "Samoanca" + +#: libk9copy/k9dvd.cpp:245 +msgid "Shona" +msgstr "Shona" + +#: libk9copy/k9dvd.cpp:245 +msgid "Somali" +msgstr "Somali" + +#: libk9copy/k9dvd.cpp:245 +msgid "Albanian" +msgstr "Arnavut" + +#: libk9copy/k9dvd.cpp:245 +msgid "Serbian" +msgstr "Sırpça" + +#: libk9copy/k9dvd.cpp:245 +msgid "Siswati" +msgstr "Siswati" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sesotho" +msgstr "Sesotho" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sundanese" +msgstr "Sundanese" + +#: libk9copy/k9dvd.cpp:246 +msgid "Svenska" +msgstr "Svenska" + +#: libk9copy/k9dvd.cpp:246 +msgid "Swahili" +msgstr "Swahili" + +#: libk9copy/k9dvd.cpp:246 +msgid "Tamil" +msgstr "Tamilce" + +#: libk9copy/k9dvd.cpp:247 +msgid "Telugu" +msgstr "Telugu" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tajik" +msgstr "Tacikçe" + +#: libk9copy/k9dvd.cpp:247 +msgid "Thai" +msgstr "Tayca" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tigrinya" +msgstr "Tigrinya" + +#: libk9copy/k9dvd.cpp:247 +msgid "Turkmen" +msgstr "Türkmence" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tagalog" +msgstr "Tagalog" + +#: libk9copy/k9dvd.cpp:248 +msgid "Setswana" +msgstr "Setswana" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tonga" +msgstr "Tonga" + +#: libk9copy/k9dvd.cpp:248 +msgid "Turkish" +msgstr "Türkçe" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tsonga" +msgstr "Tsonga" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tatar" +msgstr "Tatar" + +#: libk9copy/k9dvd.cpp:248 +msgid "Twi" +msgstr "Twi" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uighur" +msgstr "Uighur" + +#: libk9copy/k9dvd.cpp:249 +msgid "Ukrainian" +msgstr "Ukraynaca" + +#: libk9copy/k9dvd.cpp:249 +msgid "Urdu" +msgstr "Urduca" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uzbek" +msgstr "Özbekçe" + +#: libk9copy/k9dvd.cpp:249 +msgid "Vietnamese" +msgstr "Vietnamca" + +#: libk9copy/k9dvd.cpp:250 +msgid "Volapuk" +msgstr "Volapuk" + +#: libk9copy/k9dvd.cpp:250 +msgid "Wolof" +msgstr "Wolof" + +#: libk9copy/k9dvd.cpp:250 +msgid "Xhosa" +msgstr "Xhosa" + +#: libk9copy/k9dvd.cpp:250 +msgid "Yoruba" +msgstr "Yoruba" + +#: libk9copy/k9dvd.cpp:250 +msgid "Zhuang" +msgstr "Zhuang" + +#: libk9copy/k9dvd.cpp:251 +msgid "Chinese" +msgstr "Çince" + +#: libk9copy/k9dvd.cpp:251 +msgid "Zulu" +msgstr "Zulu" + +#: libk9copy/k9dvd.cpp:251 libk9copy/k9dvd.cpp:252 libk9copy/k9dvd.cpp:475 +msgid "Unknown" +msgstr "Bilinmeyen" + +#: libk9copy/k9dvd.cpp:342 +msgid "Can't open disc %1!\n" +msgstr "Disk %1 açılamadı!\n" + +#: libk9copy/k9dvd.cpp:354 +msgid "Can't open main ifo!\n" +msgstr "Ana ifo açılamadı!\n" + +#: libk9copy/k9dvd.cpp:396 libk9copy/k9dvd.cpp:691 +msgid "Title %1" +msgstr "Başlık %1" + +#: libk9copy/k9dvd.cpp:742 +msgid "reading title" +msgstr "başlık okunuyor" + +#: libk9copy/k9dvd.cpp:859 +msgid "Error opening vobs for title %1\n" +msgstr "Başlık %1 için vob dosyaları açılamadı\n" + +#: libk9copy/k9dvd.cpp:870 +msgid "ERROR reading block %1\n" +msgstr "Blok %1 okunurken hata oluştu\n" + +#: libk9copy/k9dvdauthor.cpp:148 libk9copy/k9dvdauthor.cpp:366 +msgid "'%1' not selected" +msgstr "'%1' seçilmedi" + +#: libk9copy/k9dvdauthor.cpp:149 libk9copy/k9dvdauthor.cpp:367 +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9dvdauthor.cpp:436 +#: libk9copy/k9dvdauthor.cpp:445 libk9copy/k9dvdauthor.cpp:448 +#: libk9copy/k9burndvd.cpp:237 libk9copy/k9burndvd.cpp:321 +#: k9author/k9newdvd.cpp:122 +msgid "authoring" +msgstr "yazılıyor" + +#: libk9copy/k9dvdauthor.cpp:390 libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +#: k9Mplayer/k9mplayer.cpp:97 +msgid "Unable to run %1" +msgstr "%1 çalıştırılamadı" + +#: libk9copy/k9dvdauthor.cpp:403 libk9copy/k9dvdauthor.cpp:476 +#: libk9copy/k9dvdauthor.cpp:514 src/k9settings.cpp:63 +#: k9author/k9newdvd.cpp:143 +msgid "Authoring" +msgstr "Yazılıyor" + +#: libk9copy/k9dvdauthor.cpp:436 +msgid "Dvdauthor error :\n" +msgstr "Dvdauthor hatası :\n" + +#: libk9copy/k9dvdauthor.cpp:445 +msgid "Authoring cancelled" +msgstr "Yazma işlemi iptal edildi" + +#: libk9copy/k9dvdauthor.cpp:448 k9author/k9newdvd.cpp:136 +msgid "An error occured while running DVDAuthor:\n" +msgstr "DVDAuthor çalışırken bir hata oluştu:\n" + +#: libk9copy/k9dvdauthor.cpp:515 +msgid "Fixing VOBUS" +msgstr "VOBUS onarılıyor" + +#: libk9copy/k9mp4enc.cpp:103 libk9copy/k9mp4enc.cpp:312 +msgid "Encoding error" +msgstr "Kodlama hatası" + +#: libk9copy/k9mp4enc.cpp:152 src/k9main.cpp:1155 +msgid "Save file to disk" +msgstr "Dosyayı diske kaydet" + +#: libk9copy/k9mp4enc.cpp:161 libk9copy/k9mp4enc.cpp:350 +#: src/k9prefmpeg4.cpp:34 src/k9mp4title.cpp:49 src/k9main.cpp:290 +#: src/k9main.cpp:300 src/k9main.cpp:310 src/k9main.cpp:330 src/k9main.cpp:588 +#: src/k9main.cpp:689 src/k9main.cpp:703 src/k9prefdvd.cpp:35 +msgid "MB" +msgstr "MB" + +#: libk9copy/k9mp4enc.cpp:233 libk9copy/k9mp4enc.cpp:235 +#: k9author/k9newdvd.cpp:247 +msgid "Encoding %1" +msgstr "Kodlanıyor %1" + +#: libk9copy/k9mp4enc.cpp:233 +msgid "pass %1" +msgstr "%1 geçti" + +#: libk9copy/k9mp4enc.cpp:309 +msgid "MPEG-4 Encoding cancelled" +msgstr "MPEG-4 kodlama iptal edildi" + +#: libk9copy/k9mp4enc.cpp:309 src/k9settings.cpp:48 src/k9main.cpp:1141 +msgid "MPEG-4 Encoding" +msgstr "MPEG-4 kodlama" + +#: libk9copy/k9mp4enc.cpp:312 +msgid "Error while running mencoder :" +msgstr "Mencoder çalışırken hata oluştu:" + +#: libk9copy/k9burndvd.cpp:188 libk9copy/k9burndvd.cpp:255 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - DVD'ye yazıyor" + +#: libk9copy/k9burndvd.cpp:189 libk9copy/k9burndvd.cpp:256 +#: libk9copy/k9burndvd.cpp:348 src/k9main.cpp:435 +msgid "Burning DVD" +msgstr "DVD yazılıyor" + +#: libk9copy/k9burndvd.cpp:200 libk9copy/k9burndvd.cpp:284 src/k9main.cpp:384 +#: k9author/k9import.cpp:178 +msgid "Save image to disk" +msgstr "İmajı diske kaydet" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:302 +msgid "Insert a recordable DVD" +msgstr "Yazdırabilir DVD yerleştirin" + +#: libk9copy/k9burndvd.cpp:215 libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:303 +#: libk9copy/k9burndvd.cpp:309 libk9copy/k9burndvd.cpp:314 +msgid "DVD burning" +msgstr "DVD yazılıyor" + +#: libk9copy/k9burndvd.cpp:225 libk9copy/k9burndvd.cpp:309 +msgid "Error burning DVD :\n" +msgstr "DVD yazma hatası :\n" + +#: libk9copy/k9burndvd.cpp:230 libk9copy/k9burndvd.cpp:314 +msgid "DVD Burning finished" +msgstr "DVD yazma tamamlandı" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "An error occured while Burning DVD: %1" +msgstr "DVD yazılırken hata oluştu :%1" + +#: libk9copy/k9burndvd.cpp:236 libk9copy/k9burndvd.cpp:320 +msgid "Insert an other DVD" +msgstr "Diğer DVD'yi yerleştirin" + +#: libk9copy/k9burndvd.cpp:349 +msgid "Current write speed :%1 x" +msgstr "Geçerli yazma hızı :%1 x" + +#: libk9copy/k9dvdbackup.cpp:149 libk9copy/k9dvdbackup.cpp:163 +#: libk9copy/k9dvdbackup.cpp:513 libk9copy/k9dvdbackup.cpp:599 +msgid "DVD backup cancelled" +msgstr "DVD yedekleme iptal edildi" + +#: libk9copy/k9dvdbackup.cpp:176 +msgid "unable to open VIDEO_TS.IFO" +msgstr "VIDEO_TS.IFO açılamadı" + +#: libk9copy/k9dvdbackup.cpp:198 libk9copy/k9dvdbackup.cpp:381 +#: libk9copy/k9dvdbackup.cpp:446 +msgid "Unable to open file " +msgstr "Dosya açılamadı" + +#: libk9copy/k9dvdbackup.cpp:277 +msgid "Unable to open titleset %1" +msgstr "Başlık seti %1 açılamıyor" + +#: libk9copy/k9dvdbackup.cpp:283 libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting titleset %1" +msgstr "Titleset %1 çıkarılıyor" + +#: libk9copy/k9dvdbackup.cpp:453 +msgid "Unable to open menu for titleset %1" +msgstr "Titleset %1 için menü açılamadı" + +#: libk9copy/k9dvdbackup.cpp:479 +msgid "Extracting menu for titleset %1" +msgstr "Titleset %1 için menü çıkartılıyor" + +#: libk9copy/k9dvdbackup.cpp:563 +msgid "Unable to open ifo file for titleset %1" +msgstr "Titleset %1 için ifo dosyası açılamadı" + +#: libk9copy/k9dvdbackup.cpp:575 libk9copy/k9dvdbackup.cpp:1694 +msgid "Unable to open DVD" +msgstr "DVD açılamadı" + +#: libk9copy/k9dvdbackup.cpp:585 +msgid "Unable to open vobs for titleset %1" +msgstr "Başlık seti %1 için vob dosyaları açılamıyor" + +#: libk9copy/k9dvdbackup.cpp:1381 +msgid "Updating vob %1" +msgstr "Vob %1 güncelleniyor" + +#: libk9copy/k9dvdbackup.cpp:1398 +msgid "DVD backup canceled" +msgstr "DVD yedekleme iptal edildi" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "Aygıtlar" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "K9copy aygıtları bulamadı" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 src/k9copy.cpp:294 +msgid "DVD Backup" +msgstr "DVD yedekleme" + +#: src/k9settings.cpp:42 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:42 +msgid "MPEG-4 Codecs" +msgstr "MPEG-4 Codecs" + +#: src/k9settings.cpp:48 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:57 +msgid "Title preview" +msgstr "Başlık önizleme" + +#: src/k9mp4title.cpp:36 src/k9mp4title.cpp:109 src/k9titlefactor.cpp:99 +msgid "Select a Title in the treeview..." +msgstr "Ağaç görünümünden bir Başlık seçin..." + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "KDE için yedekleme aracı" + +#: src/main.cpp:39 +msgid "output device" +msgstr "çıktı aygıtı" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "oynatılacak başlık" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "başlığı stdout'ta oynat" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "Başlangıç sektörü" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "Bitiş sektörü" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "ses akışlarının listesi" + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "spu akışlarının listesi" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "kısaltma faktörü" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "güçlendirilmiş kısaltma faktörü" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "kopyalanacak hücre büyüklüğü" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "seçilen başlıkların toplam boyutu" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "kopyalanmış bölümlerin büyüklüğü" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "seçilen bölümler" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "yeni dvd boyutu" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "seçilen bölüm" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "seçilmiş bölümdeki hücre sayısı" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "durum dosya ismi" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "durum dosyasını başlat" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "Oynatmaya kaldığı yerden devam et" + +#: src/main.cpp:58 +msgid "don't save status at end" +msgstr "işlem sonundaki durumu kaydetme" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "çözümleme işleminden önce hücreyi geçici bir dosyaya kaydet" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "içsel kullanım için" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:69 +msgid "_: NAME OF TRANSLATORS\\nYour names" +msgstr "Can Coşkuner" + +#: src/main.cpp:70 +msgid "_: EMAIL OF TRANSLATORS\\nYour emails" +msgstr "fethicanc@gmail.com" + +#: src/k9prefmencoder.cpp:105 src/k9prefmencoder.cpp:109 +#: src/k9prefmencoder.cpp:120 src/k9prefmencoder.cpp:122 +msgid "new profile" +msgstr "yeni profil" + +#: src/k9copy.cpp:137 +msgid "Shrink Factor" +msgstr "Kısaltma Faktörü" + +#: src/k9copy.cpp:194 k9author/k9importfiles.cpp:31 +msgid "Edit menu" +msgstr "Menüyü düzenle" + +#: src/k9copy.cpp:263 +msgid "Play title" +msgstr "Oynat" + +#: src/k9copy.cpp:279 +msgid "Create MPEG-4" +msgstr "MPEG-4 yap" + +#: src/k9copy.cpp:286 +msgid "Eject" +msgstr "Çıkar" + +#: src/k9copy.cpp:300 +msgid "DVD Author" +msgstr "DVD Author" + +#: src/k9copy.cpp:306 +msgid "Create DVD" +msgstr "DCD Oluştur" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding options" +msgstr "MPEG-4 Kodlama Seçenekleri" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding Options" +msgstr "MPEG-4 Kodlama Seçenekleri" + +#: src/k9copy.cpp:375 +msgid "Settings" +msgstr "Ayarlar" + +#: src/k9langselect.cpp:90 +msgid "Subtitles" +msgstr "Altyazılar" + +#: src/k9main.cpp:373 src/k9main.cpp:1141 +msgid "DVD is not opened" +msgstr "DVD açılamadı" + +#: src/k9main.cpp:373 src/k9main.cpp:395 +msgid "DVD Copy" +msgstr "DVD kopyala" + +#: src/k9main.cpp:395 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"%1 üzerinde yetersiz disk alanı\n" +"%2 mb gerekli." + +#: src/k9main.cpp:399 +msgid "Backup in progress" +msgstr "Yedekleme işlemi yapılıyor" + +#: src/k9main.cpp:459 src/k9main.cpp:608 src/k9main.cpp:1194 +msgid "Ready" +msgstr "Hazır" + +#: src/k9main.cpp:464 k9author/k9import.cpp:156 +msgid "processing" +msgstr "işliyor" + +#: src/k9main.cpp:499 src/k9main.cpp:1247 k9author/k9import.cpp:63 +msgid "ISO Image" +msgstr "ISO imajı" + +#: src/k9main.cpp:560 +msgid "Open DVD" +msgstr "DVD aç" + +#: src/k9main.cpp:586 +msgid "Titleset %1" +msgstr "Başlık Seti %1" + +#: src/k9main.cpp:636 +msgid "chapters" +msgstr "Bölümler" + +#: src/k9main.cpp:644 src/k9main.cpp:657 k9author/k9newtitle.cpp:117 +#: k9author/k9newtitle.cpp:139 +msgid "chapter %1" +msgstr "Bölüm %1" + +#: src/k9main.cpp:645 src/k9main.cpp:660 src/k9main.cpp:719 src/k9main.cpp:737 +msgid "%1 MB" +msgstr "%1 MB" + +#: src/k9main.cpp:699 +msgid "video %1 " +msgstr "video %1" + +#: src/k9main.cpp:710 +msgid "audio %1 " +msgstr "ses %1" + +#: src/k9main.cpp:730 +msgid "subpicture %1 " +msgstr "alt resim %1" + +#: src/k9main.cpp:1149 +msgid "Transcoding title : %1" +msgstr "Başlık %1 kodlanıyor" + +#: src/k9main.cpp:1248 k9author/k9import.cpp:64 +msgid "Folder" +msgstr "Klasör" + +#: src/k9main.cpp:1355 +msgid "Open ISO Image" +msgstr "İSO imajını aç" + +#: src/k9main.cpp:1366 +msgid "Open DVD folder" +msgstr "DVD dosyasını aç" + +#: src/k9mencodercmdgen.cpp:103 +msgid "Filters" +msgstr "Filtreler" + +#: src/k9playbackoptions.cpp:149 +msgid "none" +msgstr "yok" + +#: src/k9titlefactor.cpp:110 +msgid "Shrink Factor for %1" +msgstr "%1 için Kısaltma Faktörü" + +#: k9author/k9newdvd.cpp:94 +msgid "Creating root menu" +msgstr "Kök menü oluşturuluyor" + +#: k9author/k9newdvd.cpp:134 +msgid "The dvd authoring was canceled" +msgstr "DVD yazma işlemi iptal edildi" + +#: k9author/k9newdvd.cpp:160 +msgid "Creating menu for title %1" +msgstr "%1 başlığı için menü oluşturuluyor" + +#: k9author/k9newdvd.cpp:381 k9author/k9newtitle.cpp:63 +msgid "title %1" +msgstr "başlık %1" + +#: k9author/k9avidecode.cpp:31 k9author/k9avidecode.cpp:35 +msgid "Cannot open then library %1" +msgstr "%1 kitaplığı açılamıyor" + +#: k9author/k9avidecode.cpp:88 +msgid "Couldn't open the file %1" +msgstr "%1 dosyası açılamadı" + +#: k9author/k9avidecode.cpp:93 +msgid "Couldn't find stream information" +msgstr "Akış bilgisi bulunamadı" + +#: k9author/k9avidecode.cpp:106 +msgid "The file doesn't contain any video stream" +msgstr "Dosya hiç bir video akışı içermiyor" + +#: k9author/k9avidecode.cpp:117 +msgid "Unsupported codec" +msgstr "Desteklenmeyen çözücü" + +#: k9author/k9avidecode.cpp:122 +msgid "Could'nt open the codec" +msgstr "Çözücü açılamadı" + +#: k9author/k9avidecode.cpp:133 +msgid "Unable to allocate memory for frames" +msgstr "Kareler için hafıza ayırılamadı" + +#: k9author/k9menuedit.cpp:245 +msgid "Title %1 Menu" +msgstr "Başlık %1 Menüsü" + +#: k9author/k9menuedit.cpp:254 k9author/k9menuedit.cpp:291 +msgid "Play Menu" +msgstr "Menüyü Oynat" + +#: k9author/k9menuedit.cpp:256 +msgid "Play Title" +msgstr "Başlığı Oynat" + +#: k9author/k9menuedit.cpp:262 +msgid "Play Root Menu" +msgstr "Kök Menüyü Oynat" + +#: k9author/k9menuedit.cpp:264 +msgid "Play Title Menu" +msgstr "Başlık Menüsünü Oynat" + +#: k9author/k9menuedit.cpp:269 k9author/k9menuedit.cpp:295 +msgid "Play Title %1" +msgstr "%1 Başlığını Oynat" + +#: k9author/k9importfiles.cpp:24 +msgid "Create new DVD" +msgstr "Yeni DVD Oluştur" + diff --git a/po/zh_TW.po b/po/zh_TW.po new file mode 100644 index 0000000..bf59af6 --- /dev/null +++ b/po/zh_TW.po @@ -0,0 +1,2527 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: zh_TW\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-07-29 23:25+0200\n" +"PO-Revision-Date: 2007-10-24 19:43+0800\n" +"Last-Translator: 洪任諭 \n" +"Language-Team: Traditional Chinese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Chinese\n" +"X-Poedit-Country: TAIWAN\n" + +#: rc.cpp:3 +#: debug/libk9copy/backupdlg.cpp:156 +#: libk9copy/k9dvdauthor.cpp:404 +#, no-c-format +msgid "k9Copy - Backup progression" +msgstr "k9Copy - 備份進度" + +#: rc.cpp:6 +#: debug/libk9copy/backupdlg.cpp:157 +#, no-c-format +msgid "

DVD Backup

" +msgstr "

DVD 備份

" + +#: rc.cpp:9 +#: debug/libk9copy/backupdlg.cpp:158 +#, no-c-format +msgid "Current step" +msgstr " ç›®å‰æ­¥é©Ÿ" + +#: rc.cpp:12 +#: rc.cpp:47 +#: rc.cpp:65 +#: debug/libk9copy/backupdlg.cpp:159 +#: debug/libk9copy/mp4dlg.cpp:148 +#: debug/libk9copy/progress.cpp:116 +#, no-c-format +msgid "Elapsed Time" +msgstr "經éŽæ™‚é–“" + +#: rc.cpp:15 +#: rc.cpp:612 +#: rc.cpp:640 +#: rc.cpp:666 +#: debug/libk9copy/backupdlg.cpp:160 +#: debug/k9author/newTitle.cpp:131 +#: debug/k9author/chapterEdit.cpp:154 +#: debug/k9author/import.cpp:111 +#, no-c-format +msgid "--:--:--" +msgstr "--:--:--" + +#: rc.cpp:19 +#: debug/libk9copy/dvdprogress.cpp:92 +#, no-c-format +msgid "k9Copy - DVD Analyze" +msgstr "k9Copy - åˆ†æž DVD" + +#: rc.cpp:25 +#: debug/libk9copy/processList.cpp:68 +#, no-c-format +msgid "Process List" +msgstr "處ç†åˆ—表" + +#: rc.cpp:28 +#: debug/libk9copy/processList.cpp:33 +#: debug/libk9copy/processList.cpp:69 +#, no-c-format +msgid "Processes" +msgstr "處ç†" + +#: rc.cpp:31 +#: debug/libk9copy/processList.cpp:34 +#: debug/libk9copy/processList.cpp:70 +#, no-c-format +msgid "Elapsed" +msgstr "經éŽæ™‚é–“" + +#: rc.cpp:34 +#: rc.cpp:603 +#: debug/libk9copy/processList.cpp:35 +#: debug/libk9copy/processList.cpp:71 +#: debug/k9author/import.cpp:46 +#: debug/k9author/import.cpp:107 +#, no-c-format +msgid "..." +msgstr "..." + +#: rc.cpp:40 +#: debug/libk9copy/processList.cpp:73 +#: debug/src/progress.cpp:81 +#, no-c-format +msgid "Alt+C" +msgstr "Alt+C" + +#: rc.cpp:43 +#: debug/libk9copy/progress.cpp:114 +#: debug/src/progress.cpp:78 +#: debug/src/k9copy.moc.cpp:34 +#: debug/src/k9copy.moc.cpp:42 +#, no-c-format +msgid "k9Copy" +msgstr "k9Copy" + +#: rc.cpp:52 +#: debug/libk9copy/mp4dlg.cpp:141 +#, no-c-format +msgid "k9Copy - transcoding" +msgstr "k9Copy - 轉碼" + +#: rc.cpp:55 +#: debug/libk9copy/mp4dlg.cpp:142 +#, no-c-format +msgid "Encoding" +msgstr "編碼" + +#: rc.cpp:62 +#: debug/libk9copy/mp4dlg.cpp:147 +#: k9author/k9newdvd.cpp:344 +#, no-c-format +msgid "fps" +msgstr "fps" + +#: rc.cpp:68 +#: rc.cpp:154 +#: rc.cpp:181 +#: rc.cpp:284 +#: debug/libk9copy/mp4dlg.cpp:149 +#: debug/src/prefAuthor.cpp:147 +#: debug/src/prefMPEG4.cpp:337 +#: debug/src/prefMPEG4.cpp:347 +#, no-c-format +msgid "Bitrate" +msgstr "ä½å…ƒçŽ‡(Bitrate)" + +#: rc.cpp:71 +#: rc.cpp:215 +#: rc.cpp:232 +#: debug/libk9copy/mp4dlg.cpp:150 +#: debug/src/k9mainw.cpp:66 +#: debug/src/k9mainw.cpp:161 +#, no-c-format +msgid "Size" +msgstr "大å°" + +#: rc.cpp:74 +#: debug/src/mencoderCmdGen.cpp:98 +#: src/k9mencodercmdgen.cpp:55 +#, no-c-format +msgid "MEncoder options" +msgstr "MEncoder é¸é …" + +#: rc.cpp:78 +#: debug/src/mencoderCmdGen.cpp:108 +#: src/k9mencodercmdgen.cpp:68 +#, no-c-format +msgid "Audio Codec" +msgstr "音訊編碼器(Codec)" + +#: rc.cpp:81 +#: rc.cpp:169 +#: debug/src/prefMPEG4.cpp:343 +#: debug/src/mencoderCmdGen.cpp:104 +#, no-c-format +msgid "faac" +msgstr "faac" + +#: rc.cpp:84 +#: rc.cpp:96 +#: debug/src/mencoderCmdGen.cpp:107 +#: debug/src/mencoderCmdGen.cpp:119 +#, no-c-format +msgid "lavc" +msgstr "lavc" + +#: rc.cpp:87 +#: debug/src/mencoderCmdGen.cpp:120 +#: src/k9mencodercmdgen.cpp:84 +#, no-c-format +msgid "Video Codec" +msgstr "視訊編碼器(Codec)" + +#: rc.cpp:90 +#: rc.cpp:121 +#: rc.cpp:388 +#: debug/src/prefMPEG4.cpp:323 +#: debug/src/prefMencoder.cpp:299 +#: debug/src/mencoderCmdGen.cpp:113 +#, no-c-format +msgid "x264" +msgstr "x264" + +#: rc.cpp:93 +#: debug/src/mencoderCmdGen.cpp:116 +#, no-c-format +msgid "xvid" +msgstr "xvid" + +#: rc.cpp:99 +#: rc.cpp:313 +#: rc.cpp:365 +#: debug/src/prefMPEG4.cpp:315 +#: debug/src/prefMencoder.cpp:286 +#: debug/src/prefpreview.cpp:140 +#, no-c-format +msgid "Form1" +msgstr "Form1" + +#: rc.cpp:103 +#: debug/src/prefMPEG4.cpp:339 +#, no-c-format +msgid "Video" +msgstr "視訊" + +#: rc.cpp:106 +#: debug/src/prefMPEG4.cpp:317 +#, no-c-format +msgid "2 pass" +msgstr "2 階段" + +#: rc.cpp:109 +#: debug/src/prefMPEG4.cpp:318 +#, no-c-format +msgid "Alt+2" +msgstr "Alt+2" + +#: rc.cpp:112 +#: rc.cpp:163 +#: debug/src/prefMPEG4.cpp:319 +#: debug/src/prefMPEG4.cpp:340 +#, no-c-format +msgid "Codec" +msgstr "編碼器(Codec)" + +#: rc.cpp:115 +#: rc.cpp:385 +#: debug/src/prefMPEG4.cpp:321 +#: debug/src/prefMencoder.cpp:298 +#, no-c-format +msgid "XviD" +msgstr "XviD" + +#: rc.cpp:118 +#: debug/src/prefMPEG4.cpp:322 +#, no-c-format +msgid "lavc MPEG4" +msgstr "lavc MPEG4" + +#: rc.cpp:130 +#: debug/src/prefMPEG4.cpp:327 +#, no-c-format +msgid "640" +msgstr "640" + +#: rc.cpp:134 +#: debug/src/prefMPEG4.cpp:329 +#, no-c-format +msgid "&keep aspect ratio" +msgstr "ä¿æŒé•·å¯¬æ¯”例 (&K)" + +#: rc.cpp:137 +#: rc.cpp:493 +#: debug/src/playbackoptionsw.cpp:230 +#: debug/src/prefMPEG4.cpp:330 +#, no-c-format +msgid "Alt+K" +msgstr "Alt+K" + +#: rc.cpp:141 +#: rc.cpp:206 +#: rc.cpp:238 +#: debug/src/prefMPEG4.cpp:332 +#: debug/src/k9mainw.cpp:163 +#, no-c-format +msgid "X" +msgstr "X" + +#: rc.cpp:145 +#: debug/src/prefMPEG4.cpp:334 +#, no-c-format +msgid "File size" +msgstr "檔案大å°" + +#: rc.cpp:148 +#: debug/src/prefMPEG4.cpp:335 +#, no-c-format +msgid "Alt+S" +msgstr "Alt+S" + +#: rc.cpp:151 +#: debug/src/prefMPEG4.cpp:336 +#, no-c-format +msgid " MB" +msgstr " MB" + +#: rc.cpp:157 +#: rc.cpp:519 +#: debug/src/prefMPEG4.cpp:338 +#: debug/src/prefDVD.cpp:100 +#, no-c-format +msgid "Alt+B" +msgstr "Alt+B" + +#: rc.cpp:160 +#: rc.cpp:263 +#: rc.cpp:507 +#: rc.cpp:575 +#: debug/src/playbackoptionsw.cpp:236 +#: debug/src/prefAuthor.cpp:138 +#: debug/src/prefMPEG4.cpp:350 +#: debug/k9Mplayer/mplayer.cpp:594 +#: src/k9langselect.cpp:79 +#, no-c-format +msgid "Audio" +msgstr "音訊" + +#: rc.cpp:166 +#: debug/src/prefMPEG4.cpp:342 +#, no-c-format +msgid "mp3" +msgstr "mp3" + +#: rc.cpp:172 +#: debug/src/prefMPEG4.cpp:344 +#, no-c-format +msgid "mp2" +msgstr "mp2" + +#: rc.cpp:175 +#: debug/src/prefMPEG4.cpp:345 +#, no-c-format +msgid "ac3" +msgstr "ac3" + +#: rc.cpp:178 +#: debug/src/prefMPEG4.cpp:346 +#, no-c-format +msgid "adpcm ima" +msgstr "adpcm ima" + +#: rc.cpp:185 +#: debug/src/prefMPEG4.cpp:349 +#, no-c-format +msgid "Gain" +msgstr "增強(Gain)" + +#: rc.cpp:188 +#: debug/src/prefMPEG4.cpp:351 +#, no-c-format +msgid "use cell cache" +msgstr "使用 cell cache" + +#: rc.cpp:191 +#: rc.cpp:220 +#: debug/src/k9mainw.cpp:157 +#, no-c-format +msgid "MainDlg" +msgstr "MainDlg" + +#: rc.cpp:194 +#: rc.cpp:223 +#: debug/src/k9mainw.cpp:158 +#, no-c-format +msgid "Output device " +msgstr "輸出è£ç½®" + +#: rc.cpp:197 +#: rc.cpp:244 +#: debug/src/k9mainw.cpp:166 +#, no-c-format +msgid "@" +msgstr "@" + +#: rc.cpp:200 +#, no-c-format +msgid "Input device " +msgstr "輸入è£ç½®" + +#: rc.cpp:203 +#: rc.cpp:241 +#: debug/src/k9mainw.cpp:165 +#: libk9copy/k9burndvd.cpp:178 +#: libk9copy/k9burndvd.cpp:278 +#: src/k9main.cpp:1344 +#: src/k9playbackoptions.cpp:147 +#: k9author/k9import.cpp:207 +#, no-c-format +msgid "default" +msgstr "é è¨­" + +#: rc.cpp:209 +#, no-c-format +msgid "D&VD" +msgstr "D&VD" + +#: rc.cpp:212 +#: rc.cpp:229 +#: debug/src/k9mainw.cpp:65 +#: debug/src/k9mainw.cpp:160 +#, no-c-format +msgid "Title" +msgstr "標題" + +#: rc.cpp:226 +#: debug/src/k9mainw.cpp:159 +#: src/main.cpp:37 +#, no-c-format +msgid "input device" +msgstr "輸入è£ç½®" + +#: rc.cpp:235 +#: debug/src/k9mainw.cpp:68 +#: debug/src/k9mainw.cpp:162 +#, no-c-format +msgid "Content" +msgstr "內容" + +#: rc.cpp:248 +#: debug/src/k9mainw.cpp:168 +#, no-c-format +msgid "Open a folder" +msgstr "開啟一個資料夾" + +#: rc.cpp:252 +#: debug/src/k9mainw.cpp:170 +#, no-c-format +msgid "Open an iso image" +msgstr "開啟一個iso映åƒæª”" + +#: rc.cpp:255 +#: debug/src/viewmpeg2.cpp:205 +#, no-c-format +msgid "k9Copy - Title Preview" +msgstr "k9Copy - é è¦½æ¨™é¡Œ" + +#: rc.cpp:260 +#: debug/src/prefAuthor.cpp:137 +#, no-c-format +msgid "Authoring options" +msgstr "編寫 (Authoring) é¸é …" + +#: rc.cpp:266 +#: debug/src/prefAuthor.cpp:140 +#, no-c-format +msgid "AC3" +msgstr "AC3" + +#: rc.cpp:269 +#: debug/src/prefAuthor.cpp:141 +#, no-c-format +msgid "MP2" +msgstr "MP2" + +#: rc.cpp:272 +#: debug/src/prefAuthor.cpp:143 +#, no-c-format +msgid "128" +msgstr "128" + +#: rc.cpp:275 +#: debug/src/prefAuthor.cpp:144 +#, no-c-format +msgid "192" +msgstr "192" + +#: rc.cpp:278 +#: debug/src/prefAuthor.cpp:145 +#, no-c-format +msgid "320" +msgstr "320" + +#: rc.cpp:281 +#: debug/src/prefAuthor.cpp:146 +#, no-c-format +msgid "Format" +msgstr "æ ¼å¼" + +#: rc.cpp:287 +#: debug/src/prefAuthor.cpp:148 +#, no-c-format +msgid "Buttons" +msgstr "按鈕" + +#: rc.cpp:299 +#: debug/src/prefAuthor.cpp:152 +#, no-c-format +msgid "Hilite color" +msgstr "高亮度色彩" + +#: rc.cpp:303 +#: debug/src/prefAuthor.cpp:154 +#, no-c-format +msgid "Text color" +msgstr "文字色彩" + +#: rc.cpp:307 +#: debug/src/langselectw.cpp:120 +#: src/k9copy.cpp:120 +#, no-c-format +msgid "Selection" +msgstr "é¸æ“‡" + +#: rc.cpp:310 +#: debug/src/langselectw.cpp:93 +#: debug/src/langselectw.cpp:121 +#, no-c-format +msgid "Languages" +msgstr "語言" + +#: rc.cpp:317 +#: debug/src/prefpreview.cpp:142 +#, no-c-format +msgid "&Internal Player" +msgstr "內部播放器 (&I)" + +#: rc.cpp:320 +#: debug/src/prefpreview.cpp:143 +#, no-c-format +msgid "Alt+I" +msgstr "Alt+I" + +#: rc.cpp:323 +#: debug/src/prefpreview.cpp:144 +#, no-c-format +msgid "MPlayer" +msgstr "MPlayer" + +#: rc.cpp:326 +#: debug/src/prefpreview.cpp:145 +#, no-c-format +msgid "Alt+M" +msgstr "Alt+M" + +#: rc.cpp:329 +#: debug/src/prefpreview.cpp:146 +#, no-c-format +msgid "Internal viewer options" +msgstr "內部檢視器é¸é …" + +#: rc.cpp:332 +#: debug/src/prefpreview.cpp:147 +#, no-c-format +msgid "use OpenGL" +msgstr "使用 OpenGL" + +#: rc.cpp:335 +#: debug/src/prefpreview.cpp:148 +#, no-c-format +msgid "Video output" +msgstr "視訊輸出" + +#: rc.cpp:338 +#: debug/src/prefpreview.cpp:149 +#, no-c-format +msgid "Audio output" +msgstr "音訊輸出" + +#: rc.cpp:341 +#: debug/src/prefpreview.cpp:151 +#, no-c-format +msgid "X11" +msgstr "X11" + +#: rc.cpp:344 +#: debug/src/prefpreview.cpp:152 +#, no-c-format +msgid "Xv" +msgstr "Xv" + +#: rc.cpp:347 +#: debug/src/prefpreview.cpp:153 +#, no-c-format +msgid "OpenGL" +msgstr "OpenGL" + +#: rc.cpp:350 +#: rc.cpp:359 +#: debug/src/prefpreview.cpp:154 +#: debug/src/prefpreview.cpp:158 +#, no-c-format +msgid "SDL" +msgstr "SDL" + +#: rc.cpp:353 +#: debug/src/prefpreview.cpp:156 +#, no-c-format +msgid "ALSA" +msgstr "ALSA" + +#: rc.cpp:356 +#: debug/src/prefpreview.cpp:157 +#, no-c-format +msgid "OSS" +msgstr "OSS" + +#: rc.cpp:362 +#: debug/src/prefpreview.cpp:159 +#, no-c-format +msgid "MPlayer options" +msgstr "MPlayer é¸é …" + +#: rc.cpp:368 +#: debug/src/prefMencoder.cpp:287 +#, no-c-format +msgid "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" +msgstr "" +"$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" + +#: rc.cpp:375 +#: debug/src/prefMencoder.cpp:292 +#, no-c-format +msgid "" +"pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" +msgstr "" +"階段數(pass number)\n" +"視訊寬度\n" +"視訊高度\n" +"視訊ä½å…ƒçŽ‡(bitrate)\n" +"音訊ä½å…ƒçŽ‡(bitrate)" + +#: rc.cpp:382 +#: debug/src/prefMencoder.cpp:326 +#, no-c-format +msgid "Video codecs" +msgstr "視訊編碼器" + +#: rc.cpp:391 +#: debug/src/prefMencoder.cpp:300 +#, no-c-format +msgid "MJPEG" +msgstr "MJPEG" + +#: rc.cpp:394 +#: debug/src/prefMencoder.cpp:301 +#, no-c-format +msgid "LJPEG" +msgstr "LJPEG" + +#: rc.cpp:397 +#: debug/src/prefMencoder.cpp:302 +#, no-c-format +msgid "H.261" +msgstr "H.261" + +#: rc.cpp:400 +#: debug/src/prefMencoder.cpp:303 +#, no-c-format +msgid "H.263" +msgstr "H.263" + +#: rc.cpp:403 +#: debug/src/prefMencoder.cpp:304 +#, no-c-format +msgid "MPEG-4 (DivX 4/5)" +msgstr "MPEG-4 (DivX 4/5)" + +#: rc.cpp:406 +#: debug/src/prefMencoder.cpp:305 +#, no-c-format +msgid "DivX 3" +msgstr "DivX 3" + +#: rc.cpp:409 +#: debug/src/prefMencoder.cpp:306 +#, no-c-format +msgid "MS MPEG-4 v2" +msgstr "MS MPEG-4 v2" + +#: rc.cpp:412 +#: debug/src/prefMencoder.cpp:307 +#, no-c-format +msgid "WMV7" +msgstr "WMV7" + +#: rc.cpp:415 +#: debug/src/prefMencoder.cpp:308 +#, no-c-format +msgid "WMV8" +msgstr "WMV8" + +#: rc.cpp:418 +#: debug/src/prefMencoder.cpp:309 +#, no-c-format +msgid "RealVideo" +msgstr "RealVideo" + +#: rc.cpp:421 +#: debug/src/prefMencoder.cpp:310 +#, no-c-format +msgid "MPEG-1" +msgstr "MPEG-1" + +#: rc.cpp:424 +#: debug/src/prefMencoder.cpp:311 +#, no-c-format +msgid "MPEG-2" +msgstr "MPEG-2" + +#: rc.cpp:427 +#: debug/src/prefMencoder.cpp:312 +#, no-c-format +msgid "HuffYUV" +msgstr "HuffYUV" + +#: rc.cpp:430 +#: debug/src/prefMencoder.cpp:313 +#, no-c-format +msgid "ffvHuff" +msgstr "ffvHuff" + +#: rc.cpp:433 +#: debug/src/prefMencoder.cpp:314 +#, no-c-format +msgid "ASUS v1" +msgstr "ASUS v1" + +#: rc.cpp:436 +#: debug/src/prefMencoder.cpp:315 +#, no-c-format +msgid "ASUS v2" +msgstr "ASUS v2" + +#: rc.cpp:440 +#: rc.cpp:465 +#: rc.cpp:555 +#: debug/src/configDlg.cpp:42 +#: debug/src/configDlg.cpp:95 +#: debug/src/prefMencoder.cpp:317 +#: debug/src/prefMencoder.cpp:329 +#, no-c-format +msgid "label" +msgstr "標籤" + +#: rc.cpp:443 +#: debug/src/prefMencoder.cpp:318 +#, no-c-format +msgid "fourcc" +msgstr "fourcc" + +#: rc.cpp:446 +#: debug/src/prefMencoder.cpp:319 +#, no-c-format +msgid "first pass" +msgstr "第一階段" + +#: rc.cpp:451 +#: debug/src/prefMencoder.cpp:322 +#, no-c-format +msgid "one pass" +msgstr "一階段" + +#: rc.cpp:456 +#: debug/src/prefMencoder.cpp:325 +#, no-c-format +msgid "second pass" +msgstr "第二階段" + +#: rc.cpp:459 +#: debug/src/prefMencoder.cpp:332 +#, no-c-format +msgid "Audio codecs" +msgstr "音訊編碼器" + +#: rc.cpp:462 +#: debug/src/prefMencoder.cpp:328 +#, no-c-format +msgid "New Item" +msgstr "æ–°é …ç›®" + +#: rc.cpp:469 +#: debug/src/prefMencoder.cpp:331 +#, no-c-format +msgid "options" +msgstr "é¸é …" + +#: rc.cpp:472 +#: debug/src/prefMencoder.cpp:333 +#, no-c-format +msgid "Available variables" +msgstr "å¯ç”¨çš„變數" + +#: rc.cpp:475 +#: debug/src/titlefactor.cpp:321 +#, no-c-format +msgid "Shrink Factors" +msgstr "壓縮係數" + +#: rc.cpp:478 +#: debug/src/titlefactor.cpp:322 +#, no-c-format +msgid "Shrink Factor for Title %1" +msgstr "標題 %1 的壓縮係數" + +#: rc.cpp:481 +#: debug/src/titlefactor.cpp:323 +#, no-c-format +msgid "Change Factor" +msgstr "變更係數" + +#: rc.cpp:484 +#: debug/src/titlefactor.cpp:324 +#, no-c-format +msgid "0.00" +msgstr "0.00" + +#: rc.cpp:487 +#: debug/src/playbackoptionsw.cpp:228 +#: src/k9copy.cpp:114 +#, no-c-format +msgid "DVD playback options" +msgstr "DVD 播放é¸é …" + +#: rc.cpp:490 +#: debug/src/playbackoptionsw.cpp:229 +#, no-c-format +msgid "&Keep original menus" +msgstr "ä¿ç•™åŽŸæœ‰ DVD é¸å–® (&K)" + +#: rc.cpp:498 +#: debug/src/playbackoptionsw.cpp:233 +#, no-c-format +msgid "Selected Titles" +msgstr "é¸å–的標題" + +#: rc.cpp:501 +#: debug/src/playbackoptionsw.cpp:234 +#, no-c-format +msgid "Default language" +msgstr "é è¨­èªžè¨€" + +#: rc.cpp:504 +#: debug/src/playbackoptionsw.cpp:235 +#, no-c-format +msgid "Subtitle" +msgstr "字幕" + +#: rc.cpp:510 +#: debug/src/prefDVD.cpp:97 +#, no-c-format +msgid "prefDVD" +msgstr "prefDVD" + +#: rc.cpp:513 +#: debug/src/prefDVD.cpp:98 +#, no-c-format +msgid "Output directory" +msgstr "輸出目錄" + +#: rc.cpp:516 +#: debug/src/prefDVD.cpp:99 +#, no-c-format +msgid "Burn with k3b" +msgstr "使用 k3b 燒錄" + +#: rc.cpp:522 +#: debug/src/prefDVD.cpp:101 +#, no-c-format +msgid "Auto burn" +msgstr "自動燒錄" + +#: rc.cpp:525 +#: debug/src/prefDVD.cpp:102 +#, no-c-format +msgid "Alt+T" +msgstr "Alt+T" + +#: rc.cpp:528 +#: debug/src/prefDVD.cpp:103 +#, no-c-format +msgid "DVD size" +msgstr "DVD 大å°" + +#: rc.cpp:531 +#: debug/src/prefDVD.cpp:104 +#, no-c-format +msgid "Quick scan" +msgstr "快速掃æ" + +#: rc.cpp:534 +#: debug/src/prefDVD.cpp:105 +#, no-c-format +msgid "Alt+Q" +msgstr "Alt+Q" + +#: rc.cpp:537 +#: debug/src/prefDVD.cpp:106 +#, no-c-format +msgid "use dvdAuthor for copy without menus" +msgstr "使用 dvdAuthor åšä¸åŒ…å«é¸å–®çš„複製" + +#: rc.cpp:540 +#: debug/src/prefDVD.cpp:107 +#, no-c-format +msgid "Alt+D" +msgstr "Alt+D" + +#: rc.cpp:543 +#: debug/src/prefDVD.cpp:108 +#, no-c-format +msgid "Clear output directory on exit" +msgstr "çµæŸæ™‚清除輸出目錄" + +#: rc.cpp:546 +#: debug/src/prefDVD.cpp:109 +#, no-c-format +msgid "Alt+Y" +msgstr "Alt+Y" + +#: rc.cpp:549 +#: debug/src/configDlg.cpp:93 +#, no-c-format +msgid "k9Copy - Devices" +msgstr "k9Copy - è£ç½®" + +#: rc.cpp:552 +#: debug/src/configDlg.cpp:40 +#: debug/src/configDlg.cpp:94 +#, no-c-format +msgid "device" +msgstr "è£ç½®" + +#: rc.cpp:558 +#: debug/src/configDlg.cpp:44 +#: debug/src/configDlg.cpp:96 +#, no-c-format +msgid "Input" +msgstr "輸入" + +#: rc.cpp:561 +#: rc.cpp:597 +#: debug/src/configDlg.cpp:46 +#: debug/src/configDlg.cpp:97 +#: debug/k9author/import.cpp:105 +#, no-c-format +msgid "Output" +msgstr "輸出" + +#: rc.cpp:572 +#: debug/k9Mplayer/mplayer.cpp:593 +#: src/k9settings.cpp:57 +#: src/k9copy.cpp:128 +#: src/k9copy.cpp:390 +#: k9Mplayer/k9mplayer.cpp:97 +#, no-c-format +msgid "Preview" +msgstr "é è¦½" + +#: rc.cpp:578 +#: debug/k9Mplayer/mplayer.cpp:595 +#, no-c-format +msgid "Subpicture" +msgstr "字幕" + +#: rc.cpp:585 +#: debug/k9Mplayer/mplayer.cpp:600 +#, no-c-format +msgid "-" +msgstr "-" + +#: rc.cpp:589 +#: debug/k9Mplayer/mplayer.cpp:602 +#, no-c-format +msgid "+" +msgstr "+" + +#: rc.cpp:594 +#: debug/k9author/import.cpp:104 +#, no-c-format +msgid "import" +msgstr "匯入" + +#: rc.cpp:600 +#: debug/k9author/import.cpp:44 +#: debug/k9author/import.cpp:106 +#, no-c-format +msgid "Video files" +msgstr "視訊檔案" + +#: rc.cpp:606 +#: debug/k9author/import.cpp:109 +#, no-c-format +msgid "PAL" +msgstr "PAL" + +#: rc.cpp:609 +#: debug/k9author/import.cpp:110 +#, no-c-format +msgid "NTSC" +msgstr "NTSC" + +#: rc.cpp:615 +#: debug/k9author/chapterEdit.cpp:145 +#: src/k9copy.cpp:211 +#: k9author/k9importfiles.cpp:34 +#, no-c-format +msgid "Chapter properties" +msgstr "章節屬性" + +#: rc.cpp:618 +#: debug/k9author/chapterEdit.cpp:146 +#, no-c-format +msgid "start" +msgstr "開始" + +#: rc.cpp:621 +#: debug/k9author/chapterEdit.cpp:147 +#, no-c-format +msgid "video" +msgstr "視訊" + +#: rc.cpp:624 +#: debug/k9author/chapterEdit.cpp:148 +#, no-c-format +msgid "" +"*.avi\n" +"*.mpeg" +msgstr "" +"*.avi\n" +"*.mpeg" + +#: rc.cpp:628 +#: rc.cpp:643 +#: debug/k9author/chapterEdit.cpp:150 +#: debug/k9author/chapterEdit.cpp:155 +#, no-c-format +msgid "set Current Frame" +msgstr "è¨­å®šç›®å‰ Frame" + +#: rc.cpp:631 +#: rc.cpp:637 +#: debug/k9author/chapterEdit.cpp:151 +#: debug/k9author/chapterEdit.cpp:153 +#, no-c-format +msgid "break continuity" +msgstr "破壞連續性" + +#: rc.cpp:634 +#: debug/k9author/chapterEdit.cpp:152 +#, no-c-format +msgid "end" +msgstr "çµæŸ" + +#: rc.cpp:646 +#: debug/k9author/chapterEdit.cpp:156 +#, no-c-format +msgid "set Title button" +msgstr "設定標題按鈕" + +#: rc.cpp:649 +#: debug/k9author/newTitle.cpp:124 +#: src/k9copy.cpp:204 +#: k9author/k9importfiles.cpp:40 +#: k9author/k9newtitle.cpp:55 +#, no-c-format +msgid "Add title" +msgstr "新增標題" + +#: rc.cpp:653 +#: debug/k9author/newTitle.cpp:126 +#, no-c-format +msgid "number of chapters" +msgstr "章節數é‡" + +#: rc.cpp:656 +#: debug/k9author/newTitle.cpp:127 +#, no-c-format +msgid "chapter length" +msgstr "章節長度" + +#: rc.cpp:663 +#: debug/k9author/newTitle.cpp:130 +#, no-c-format +msgid "Video file" +msgstr "視訊檔案" + +#: rc.cpp:669 +#: debug/k9author/menuEdit.cpp:146 +#: src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +#, no-c-format +msgid "Edit Menu" +msgstr "編輯é¸å–®" + +#: rc.cpp:672 +#: debug/k9author/menuEdit.cpp:147 +#, no-c-format +msgid "Text" +msgstr "文字" + +#: rc.cpp:675 +#: debug/k9author/menuEdit.cpp:148 +#, no-c-format +msgid "Background picture" +msgstr "背景圖片" + +#: rc.cpp:690 +#: debug/k9author/menuEdit.cpp:156 +#: k9author/k9menuedit.cpp:286 +#: k9author/k9import.cpp:45 +#, no-c-format +msgid "Root Menu" +msgstr "最上層é¸å–®" + +#: rc.cpp:693 +#: debug/k9author/menuEdit.cpp:157 +#, no-c-format +msgid "At start" +msgstr "在開始處" + +#: rc.cpp:696 +#: debug/k9author/menuEdit.cpp:159 +#, no-c-format +msgid "Play menu" +msgstr "播放é¸å–®" + +#: rc.cpp:699 +#: rc.cpp:711 +#: debug/k9author/menuEdit.cpp:160 +#: debug/k9author/menuEdit.cpp:165 +#, no-c-format +msgid "Play title 1" +msgstr "播放標題 1" + +#: rc.cpp:702 +#: debug/k9author/menuEdit.cpp:161 +#, no-c-format +msgid "At End" +msgstr "在çµå°¾è™•" + +#: rc.cpp:705 +#: debug/k9author/menuEdit.cpp:163 +#, no-c-format +msgid "Play root menu" +msgstr "播放最上層é¸å–®" + +#: rc.cpp:708 +#: debug/k9author/menuEdit.cpp:164 +#, no-c-format +msgid "Play title menu" +msgstr "播放標題é¸å–®" + +#: rc.cpp:717 +#, no-c-format +msgid "A&ctions" +msgstr "動作 (&A)" + +#: rc.cpp:720 +#, no-c-format +msgid "Actions ToolBar" +msgstr "動作工具列" + +#: debug/libk9copy/k9ifo2.moc.cpp:34 +#: debug/libk9copy/k9ifo2.moc.cpp:42 +msgid "k9Ifo2" +msgstr "k9Ifo2" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:34 +#: debug/libk9copy/k9dvdchapter.moc.cpp:42 +msgid "k9ChapterCell" +msgstr "k9ChapterCell" + +#: debug/libk9copy/k9dvdchapter.moc.cpp:107 +#: debug/libk9copy/k9dvdchapter.moc.cpp:115 +msgid "k9DVDChapter" +msgstr "k9DVDChapter" + +#: debug/libk9copy/k9burndvd.moc.cpp:34 +#: debug/libk9copy/k9burndvd.moc.cpp:42 +msgid "k9BurnDVD" +msgstr "k9BurnDVD" + +#: debug/libk9copy/k9dvd.moc.cpp:34 +#: debug/libk9copy/k9dvd.moc.cpp:42 +msgid "k9DVD" +msgstr "k9DVD" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:34 +#: debug/libk9copy/k9dvdtitle.moc.cpp:42 +msgid "k9DVDVideoStream" +msgstr "k9DVDVideoStream" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:107 +#: debug/libk9copy/k9dvdtitle.moc.cpp:115 +msgid "k9DVDAudioStream" +msgstr "k9DVDAudioStream" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:180 +#: debug/libk9copy/k9dvdtitle.moc.cpp:188 +msgid "k9DVDSubtitle" +msgstr "k9DVDSubtitle" + +#: debug/libk9copy/k9dvdtitle.moc.cpp:253 +#: debug/libk9copy/k9dvdtitle.moc.cpp:261 +msgid "k9DVDTitle" +msgstr "k9DVDTitle" + +#: debug/libk9copy/k9dvdprogress.moc.cpp:34 +#: debug/libk9copy/k9dvdprogress.moc.cpp:42 +msgid "k9DVDProgress" +msgstr "k9DVDProgress" + +#: debug/libk9copy/k9dvdtitleset.moc.cpp:34 +#: debug/libk9copy/k9dvdtitleset.moc.cpp:42 +msgid "k9DVDTitleset" +msgstr "k9DVDTitleset" + +#: debug/libk9copy/k9dvdauthor.moc.cpp:34 +#: debug/libk9copy/k9dvdauthor.moc.cpp:42 +msgid "k9DVDAuthor" +msgstr "k9DVDAuthor" + +#: debug/libk9copy/k9dvdsize.moc.cpp:34 +#: debug/libk9copy/k9dvdsize.moc.cpp:42 +msgid "k9DVDSize" +msgstr "k9DVDSize" + +#: debug/src/menupreview.cpp:1084 +msgid "k9Copy - Menu Preview" +msgstr "k9Copy - é¸å–®é è¦½" + +#: debug/src/kcddrive.moc.cpp:34 +#: debug/src/kcddrive.moc.cpp:42 +msgid "kCDDrive" +msgstr "kCDDrive" + +#: debug/src/kcddrive.moc.cpp:107 +#: debug/src/kcddrive.moc.cpp:115 +msgid "kCDDrives" +msgstr "kCDDrives" + +#: debug/src/kviewmpeg2.moc.cpp:34 +#: debug/src/kviewmpeg2.moc.cpp:42 +msgid "k9Widget" +msgstr "k9Widget" + +#: debug/src/kviewmpeg2.moc.cpp:107 +#: debug/src/kviewmpeg2.moc.cpp:115 +msgid "kViewMPEG2" +msgstr "kViewMPEG2" + +#: debug/k9Mplayer/k9mplayer.moc.cpp:34 +#: debug/k9Mplayer/k9mplayer.moc.cpp:42 +msgid "K9Mplayer" +msgstr "K9Mplayer" + +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:34 +#: debug/k9decmpeg/kdecmpeg2.moc.cpp:42 +msgid "kDecMPEG2" +msgstr "kDecMPEG2" + +#: libk9copy/k9dvd.cpp:133 +msgid "for visually impaired" +msgstr "給視覺障礙者" + +#: libk9copy/k9dvd.cpp:134 +msgid "director's comments" +msgstr "導演講評" + +#: libk9copy/k9dvd.cpp:135 +msgid "alternate director's comments" +msgstr "å¯æ›¿æ›çš„導演講評" + +#: libk9copy/k9dvd.cpp:139 +msgid "Large" +msgstr "大" + +#: libk9copy/k9dvd.cpp:140 +msgid "Children" +msgstr "å…’ç«¥" + +#: libk9copy/k9dvd.cpp:141 +#: libk9copy/k9dvd.cpp:147 +#: libk9copy/k9dvd.cpp:148 +#: libk9copy/k9dvd.cpp:149 +msgid "reserved" +msgstr "ä¿ç•™" + +#: libk9copy/k9dvd.cpp:142 +msgid "Normal captions" +msgstr "正常標題" + +#: libk9copy/k9dvd.cpp:143 +msgid "Large captions" +msgstr "大型標題" + +#: libk9copy/k9dvd.cpp:144 +msgid "Children captions" +msgstr "兒童標題" + +#: libk9copy/k9dvd.cpp:146 +msgid "Forced" +msgstr "強制" + +#: libk9copy/k9dvd.cpp:150 +msgid "Director's comments" +msgstr "導演講評" + +#: libk9copy/k9dvd.cpp:151 +msgid "Large director's comments" +msgstr "導演講評 (大)" + +#: libk9copy/k9dvd.cpp:152 +msgid "Director's comments for children" +msgstr "給兒童的導演講評" + +#: libk9copy/k9dvd.cpp:189 +msgid "Couldn't open %1 for title\n" +msgstr "無法開啟標題的 %1\n" + +#: libk9copy/k9dvd.cpp:191 +#: libk9copy/k9dvd.cpp:199 +#: libk9copy/k9dvd.cpp:207 +#: libk9copy/k9dvd.cpp:368 +#: src/k9main.cpp:563 +msgid "unknown" +msgstr "未知" + +#: libk9copy/k9dvd.cpp:197 +msgid "Couldn't seek in %1 for title\n" +msgstr "無法在標題的 %1 å…§æœå°‹\n" + +#: libk9copy/k9dvd.cpp:224 +msgid "Not Specified" +msgstr "未指定" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afar" +msgstr "Afar" + +#: libk9copy/k9dvd.cpp:224 +msgid "Abkhazian" +msgstr "阿布哈西亞語" + +#: libk9copy/k9dvd.cpp:224 +msgid "Afrikaans" +msgstr "å—éžè·è˜­èªž" + +#: libk9copy/k9dvd.cpp:224 +msgid "Amharic" +msgstr "衣索比亞語" + +#: libk9copy/k9dvd.cpp:225 +msgid "Arabic" +msgstr "阿拉伯語" + +#: libk9copy/k9dvd.cpp:225 +msgid "Assamese" +msgstr "阿薩姆語" + +#: libk9copy/k9dvd.cpp:225 +msgid "Aymara" +msgstr "Aymara" + +#: libk9copy/k9dvd.cpp:225 +msgid "Azerbaijani" +msgstr "亞塞拜然語" + +#: libk9copy/k9dvd.cpp:225 +msgid "Bashkir" +msgstr "Bashkir" + +#: libk9copy/k9dvd.cpp:226 +msgid "Byelorussian" +msgstr "白俄羅斯語" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bulgarian" +msgstr "ä¿åŠ åˆ©äºžèªž" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bihari" +msgstr "å°åº¦æ¯”哈爾邦(Bihar)語" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bislama" +msgstr "Bislama" + +#: libk9copy/k9dvd.cpp:226 +msgid "Bengali; Bangla" +msgstr "孟加拉語" + +#: libk9copy/k9dvd.cpp:227 +msgid "Tibetan" +msgstr "西è—語" + +#: libk9copy/k9dvd.cpp:227 +msgid "Breton" +msgstr "Breton" + +#: libk9copy/k9dvd.cpp:227 +msgid "Catalan" +msgstr "(西ç­ç‰™)嘉泰羅尼亞語" + +#: libk9copy/k9dvd.cpp:227 +msgid "Corsican" +msgstr "Corsican" + +#: libk9copy/k9dvd.cpp:227 +msgid "Czech" +msgstr "æ·å…‹èªž" + +#: libk9copy/k9dvd.cpp:228 +msgid "Welsh" +msgstr "å¨çˆ¾æ–¯èªž" + +#: libk9copy/k9dvd.cpp:228 +msgid "Dansk" +msgstr "Dansk" + +#: libk9copy/k9dvd.cpp:228 +msgid "Deutsch" +msgstr "德語" + +#: libk9copy/k9dvd.cpp:228 +msgid "Bhutani" +msgstr "Bhutani" + +#: libk9copy/k9dvd.cpp:228 +msgid "Greek" +msgstr "希臘語" + +#: libk9copy/k9dvd.cpp:228 +msgid "English" +msgstr "英語" + +#: libk9copy/k9dvd.cpp:229 +msgid "Esperanto" +msgstr "世界語(Esperanto)" + +#: libk9copy/k9dvd.cpp:229 +msgid "Espanol" +msgstr "Espanol" + +#: libk9copy/k9dvd.cpp:229 +msgid "Estonian" +msgstr "愛沙尼亞語" + +#: libk9copy/k9dvd.cpp:229 +msgid "Basque" +msgstr "巴斯克語" + +#: libk9copy/k9dvd.cpp:229 +msgid "Persian" +msgstr "波斯語" + +#: libk9copy/k9dvd.cpp:230 +msgid "Suomi" +msgstr "Suomi" + +#: libk9copy/k9dvd.cpp:230 +msgid "Fiji" +msgstr "æ–濟語" + +#: libk9copy/k9dvd.cpp:230 +msgid "Faroese" +msgstr "法羅群語" + +#: libk9copy/k9dvd.cpp:230 +msgid "Francais" +msgstr "法語" + +#: libk9copy/k9dvd.cpp:230 +msgid "Frisian" +msgstr "弗利然語" + +#: libk9copy/k9dvd.cpp:230 +msgid "Gaelic" +msgstr "蓋爾語" + +#: libk9copy/k9dvd.cpp:231 +msgid "Scots Gaelic" +msgstr "蘇格蘭蓋爾語" + +#: libk9copy/k9dvd.cpp:231 +msgid "Galician" +msgstr "加里西亞語" + +#: libk9copy/k9dvd.cpp:231 +msgid "Guarani" +msgstr "Guarani" + +#: libk9copy/k9dvd.cpp:231 +msgid "Gujarati" +msgstr "Gujarati" + +#: libk9copy/k9dvd.cpp:231 +msgid "Hausa" +msgstr "豪薩語(Hausa)" + +#: libk9copy/k9dvd.cpp:232 +#: libk9copy/k9dvd.cpp:234 +msgid "Hebrew" +msgstr "希伯來語" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hindi" +msgstr "北å°åº¦èªž" + +#: libk9copy/k9dvd.cpp:232 +msgid "Hrvatski" +msgstr "Hrvatski" + +#: libk9copy/k9dvd.cpp:232 +msgid "Magyar" +msgstr "Magyar" + +#: libk9copy/k9dvd.cpp:232 +msgid "Armenian" +msgstr "亞美尼亞語" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingua" +msgstr "Interlingua" + +#: libk9copy/k9dvd.cpp:233 +msgid "Indonesian" +msgstr "å°å°¼èªž" + +#: libk9copy/k9dvd.cpp:233 +msgid "Interlingue" +msgstr "Interlingue" + +#: libk9copy/k9dvd.cpp:233 +msgid "Inupiak" +msgstr "Inupiak" + +#: libk9copy/k9dvd.cpp:234 +msgid "Islenska" +msgstr "Islenska" + +#: libk9copy/k9dvd.cpp:234 +msgid "Italiano" +msgstr "義大利語" + +#: libk9copy/k9dvd.cpp:234 +msgid "Inuktitut" +msgstr "Inuktitut" + +#: libk9copy/k9dvd.cpp:234 +msgid "Japanese" +msgstr "日語" + +#: libk9copy/k9dvd.cpp:235 +#: libk9copy/k9dvd.cpp:250 +msgid "Yiddish" +msgstr "æ„第緒語" + +#: libk9copy/k9dvd.cpp:235 +msgid "Javanese" +msgstr "爪哇語" + +#: libk9copy/k9dvd.cpp:235 +msgid "Georgian" +msgstr "Georgian" + +#: libk9copy/k9dvd.cpp:235 +msgid "Kazakh" +msgstr "哈薩克語" + +#: libk9copy/k9dvd.cpp:235 +msgid "Greenlandic" +msgstr "Greenlandic" + +#: libk9copy/k9dvd.cpp:236 +msgid "Cambodian" +msgstr "柬埔寨語" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kannada" +msgstr "(å°åº¦)åŽé‚£é”語" + +#: libk9copy/k9dvd.cpp:236 +msgid "Korean" +msgstr "韓語" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kashmiri" +msgstr "喀什米爾語" + +#: libk9copy/k9dvd.cpp:236 +msgid "Kurdish" +msgstr "庫德語" + +#: libk9copy/k9dvd.cpp:237 +msgid "Kirghiz" +msgstr "å‰çˆ¾å‰æ–¯èªž" + +#: libk9copy/k9dvd.cpp:237 +msgid "Latin" +msgstr "拉ä¸èªž" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lingala" +msgstr "Lingala" + +#: libk9copy/k9dvd.cpp:237 +msgid "Laothian" +msgstr "Laothian" + +#: libk9copy/k9dvd.cpp:237 +msgid "Lithuanian" +msgstr "立陶宛語" + +#: libk9copy/k9dvd.cpp:238 +msgid "Latvian, Lettish" +msgstr "拉脫維亞語" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malagasy" +msgstr "馬拉加西語" + +#: libk9copy/k9dvd.cpp:238 +msgid "Maori" +msgstr "毛利語" + +#: libk9copy/k9dvd.cpp:238 +msgid "Macedonian" +msgstr "馬其頓語" + +#: libk9copy/k9dvd.cpp:238 +msgid "Malayalam" +msgstr "馬來亞拉姆語" + +#: libk9copy/k9dvd.cpp:239 +msgid "Mongolian" +msgstr "è’™å¤èªž" + +#: libk9copy/k9dvd.cpp:239 +msgid "Moldavian" +msgstr "Moldavian" + +#: libk9copy/k9dvd.cpp:239 +msgid "Marathi" +msgstr "馬拉地語" + +#: libk9copy/k9dvd.cpp:239 +msgid "Malay" +msgstr "馬來語" + +#: libk9copy/k9dvd.cpp:239 +msgid "Maltese" +msgstr "馬爾他語" + +#: libk9copy/k9dvd.cpp:240 +msgid "Burmese" +msgstr "緬甸語" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nauru" +msgstr "諾魯語" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nepali" +msgstr "尼泊爾語" + +#: libk9copy/k9dvd.cpp:240 +msgid "Nederlands" +msgstr "è·è˜­èªž" + +#: libk9copy/k9dvd.cpp:240 +msgid "Norsk" +msgstr "挪å¨èªž" + +#: libk9copy/k9dvd.cpp:240 +msgid "Occitan" +msgstr "Occitan" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oromo" +msgstr "Oromo" + +#: libk9copy/k9dvd.cpp:241 +msgid "Oriya" +msgstr "Oriya" + +#: libk9copy/k9dvd.cpp:241 +msgid "Punjabi" +msgstr "æ—é®æ™®èªž" + +#: libk9copy/k9dvd.cpp:241 +msgid "Polish" +msgstr "波蘭語" + +#: libk9copy/k9dvd.cpp:241 +msgid "Pashto, Pushto" +msgstr "(阿富汗)帕施圖語" + +#: libk9copy/k9dvd.cpp:242 +msgid "Portugues" +msgstr "è‘¡è„牙語" + +#: libk9copy/k9dvd.cpp:242 +msgid "Quechua" +msgstr "(å—éž)蓋楚瓦語" + +#: libk9copy/k9dvd.cpp:242 +msgid "Rhaeto-Romance" +msgstr "Rhaeto-Romance" + +#: libk9copy/k9dvd.cpp:242 +msgid "Kirundi" +msgstr "Kirundi" + +#: libk9copy/k9dvd.cpp:242 +msgid "Romanian" +msgstr "羅馬尼亞語" + +#: libk9copy/k9dvd.cpp:243 +msgid "Russian" +msgstr "俄語" + +#: libk9copy/k9dvd.cpp:243 +msgid "Kinyarwanda" +msgstr "Kinyarwanda" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sanskrit" +msgstr "梵語" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sindhi" +msgstr "Sindhi" + +#: libk9copy/k9dvd.cpp:243 +msgid "Sangho" +msgstr "Sangho" + +#: libk9copy/k9dvd.cpp:244 +msgid "Serbo-Croatian" +msgstr "Serbo-Croatian" + +#: libk9copy/k9dvd.cpp:244 +msgid "Sinhalese" +msgstr "錫蘭語" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovak" +msgstr "斯洛ä¼å…‹èªž" + +#: libk9copy/k9dvd.cpp:244 +msgid "Slovenian" +msgstr "斯洛維尼亞語" + +#: libk9copy/k9dvd.cpp:244 +msgid "Samoan" +msgstr "薩摩牙語" + +#: libk9copy/k9dvd.cpp:245 +msgid "Shona" +msgstr "Shona" + +#: libk9copy/k9dvd.cpp:245 +msgid "Somali" +msgstr "索馬利語" + +#: libk9copy/k9dvd.cpp:245 +msgid "Albanian" +msgstr "阿爾巴尼亞語" + +#: libk9copy/k9dvd.cpp:245 +msgid "Serbian" +msgstr "塞爾維亞語" + +#: libk9copy/k9dvd.cpp:245 +msgid "Siswati" +msgstr "Siswati" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sesotho" +msgstr "Sesotho" + +#: libk9copy/k9dvd.cpp:246 +msgid "Sundanese" +msgstr "Sundanese" + +#: libk9copy/k9dvd.cpp:246 +msgid "Svenska" +msgstr "Svenska" + +#: libk9copy/k9dvd.cpp:246 +msgid "Swahili" +msgstr "æ–¯è¯è¥¿é‡Œèªž" + +#: libk9copy/k9dvd.cpp:246 +msgid "Tamil" +msgstr "å¦ç±³çˆ¾èªž" + +#: libk9copy/k9dvd.cpp:247 +msgid "Telugu" +msgstr "Telugu" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tajik" +msgstr "å¡”å‰å…‹èªž" + +#: libk9copy/k9dvd.cpp:247 +msgid "Thai" +msgstr "泰語" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tigrinya" +msgstr "æ格利尼亞語" + +#: libk9copy/k9dvd.cpp:247 +msgid "Turkmen" +msgstr "土庫曼語" + +#: libk9copy/k9dvd.cpp:247 +msgid "Tagalog" +msgstr "塔加拉æ—語" + +#: libk9copy/k9dvd.cpp:248 +msgid "Setswana" +msgstr "Setswana" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tonga" +msgstr "æ±åŠ èªž" + +#: libk9copy/k9dvd.cpp:248 +msgid "Turkish" +msgstr "土耳其語" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tsonga" +msgstr "Tsonga" + +#: libk9copy/k9dvd.cpp:248 +msgid "Tatar" +msgstr "韃é¼èªž" + +#: libk9copy/k9dvd.cpp:248 +msgid "Twi" +msgstr "契維語" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uighur" +msgstr "維å¾çˆ¾èªž" + +#: libk9copy/k9dvd.cpp:249 +msgid "Ukrainian" +msgstr "çƒå…‹è˜­èªž" + +#: libk9copy/k9dvd.cpp:249 +msgid "Urdu" +msgstr "çƒéƒ½èªž" + +#: libk9copy/k9dvd.cpp:249 +msgid "Uzbek" +msgstr "çƒèŒ²åˆ¥å…‹èªž" + +#: libk9copy/k9dvd.cpp:249 +msgid "Vietnamese" +msgstr "越å—語" + +#: libk9copy/k9dvd.cpp:250 +msgid "Volapuk" +msgstr "沃拉普克語" + +#: libk9copy/k9dvd.cpp:250 +msgid "Wolof" +msgstr "Wolof" + +#: libk9copy/k9dvd.cpp:250 +msgid "Xhosa" +msgstr "科薩語" + +#: libk9copy/k9dvd.cpp:250 +msgid "Yoruba" +msgstr "優魯巴語" + +#: libk9copy/k9dvd.cpp:250 +msgid "Zhuang" +msgstr "瑤æ—語" + +#: libk9copy/k9dvd.cpp:251 +msgid "Chinese" +msgstr "中文" + +#: libk9copy/k9dvd.cpp:251 +msgid "Zulu" +msgstr "祖魯語" + +#: libk9copy/k9dvd.cpp:251 +#: libk9copy/k9dvd.cpp:252 +#: libk9copy/k9dvd.cpp:475 +msgid "Unknown" +msgstr "未知" + +#: libk9copy/k9dvd.cpp:342 +msgid "Can't open disc %1!\n" +msgstr "無法開啟碟片 %1!\n" + +#: libk9copy/k9dvd.cpp:354 +msgid "Can't open main ifo!\n" +msgstr "ç„¡æ³•é–‹å•Ÿä¸»è¦ ifo!\n" + +#: libk9copy/k9dvd.cpp:396 +#: libk9copy/k9dvd.cpp:691 +msgid "Title %1" +msgstr "標題 %1" + +#: libk9copy/k9dvd.cpp:742 +msgid "reading title" +msgstr "讀å–標題" + +#: libk9copy/k9dvd.cpp:859 +msgid "Error opening vobs for title %1\n" +msgstr "開啟標題 %1 çš„ vobs 時發生錯誤\n" + +#: libk9copy/k9dvd.cpp:870 +msgid "ERROR reading block %1\n" +msgstr "讀å–å€å¡Š %1 時發生錯誤\n" + +#: libk9copy/k9dvdauthor.cpp:148 +#: libk9copy/k9dvdauthor.cpp:366 +msgid "'%1' not selected" +msgstr "'%1' 未被é¸å–" + +#: libk9copy/k9dvdauthor.cpp:149 +#: libk9copy/k9dvdauthor.cpp:367 +#: libk9copy/k9dvdauthor.cpp:390 +#: libk9copy/k9dvdauthor.cpp:436 +#: libk9copy/k9dvdauthor.cpp:445 +#: libk9copy/k9dvdauthor.cpp:448 +#: libk9copy/k9burndvd.cpp:237 +#: libk9copy/k9burndvd.cpp:321 +#: k9author/k9newdvd.cpp:122 +msgid "authoring" +msgstr "編寫(authoring)" + +#: libk9copy/k9dvdauthor.cpp:390 +#: libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:309 +#: k9Mplayer/k9mplayer.cpp:97 +msgid "Unable to run %1" +msgstr "無法執行 %1" + +#: libk9copy/k9dvdauthor.cpp:403 +#: libk9copy/k9dvdauthor.cpp:476 +#: libk9copy/k9dvdauthor.cpp:514 +#: src/k9settings.cpp:63 +#: k9author/k9newdvd.cpp:143 +msgid "Authoring" +msgstr "編寫 (Authoring)" + +#: libk9copy/k9dvdauthor.cpp:436 +msgid "Dvdauthor error :\n" +msgstr "Dvdauthor 錯誤 :\n" + +#: libk9copy/k9dvdauthor.cpp:445 +msgid "Authoring cancelled" +msgstr "å–消編寫 (Authoring)" + +#: libk9copy/k9dvdauthor.cpp:448 +#: k9author/k9newdvd.cpp:136 +msgid "An error occured while running DVDAuthor:\n" +msgstr "執行 DVDAuthor 時發生錯誤:\n" + +#: libk9copy/k9dvdauthor.cpp:515 +msgid "Fixing VOBUS" +msgstr "修正 VOBUS" + +#: libk9copy/k9mp4enc.cpp:103 +#: libk9copy/k9mp4enc.cpp:312 +msgid "Encoding error" +msgstr "編碼錯誤" + +#: libk9copy/k9mp4enc.cpp:152 +#: src/k9main.cpp:1155 +msgid "Save file to disk" +msgstr "儲存檔案到ç£ç¢Ÿ" + +#: libk9copy/k9mp4enc.cpp:161 +#: libk9copy/k9mp4enc.cpp:350 +#: src/k9prefmpeg4.cpp:34 +#: src/k9mp4title.cpp:49 +#: src/k9main.cpp:290 +#: src/k9main.cpp:300 +#: src/k9main.cpp:310 +#: src/k9main.cpp:330 +#: src/k9main.cpp:588 +#: src/k9main.cpp:689 +#: src/k9main.cpp:703 +#: src/k9prefdvd.cpp:35 +msgid "MB" +msgstr "MB" + +#: libk9copy/k9mp4enc.cpp:233 +#: libk9copy/k9mp4enc.cpp:235 +#: k9author/k9newdvd.cpp:247 +msgid "Encoding %1" +msgstr "正在編碼 %1" + +#: libk9copy/k9mp4enc.cpp:233 +msgid "pass %1" +msgstr "階段 %1" + +#: libk9copy/k9mp4enc.cpp:309 +msgid "MPEG-4 Encoding cancelled" +msgstr "MPEG-4 編碼å–消" + +#: libk9copy/k9mp4enc.cpp:309 +#: src/k9settings.cpp:48 +#: src/k9main.cpp:1141 +msgid "MPEG-4 Encoding" +msgstr "MPEG-4 編碼" + +#: libk9copy/k9mp4enc.cpp:312 +msgid "Error while running mencoder :" +msgstr "執行 mencoder 時發生錯誤:" + +#: libk9copy/k9burndvd.cpp:188 +#: libk9copy/k9burndvd.cpp:255 +msgid "k9Copy - Burning DVD" +msgstr "k9Copy - 燒錄 DVD" + +#: libk9copy/k9burndvd.cpp:189 +#: libk9copy/k9burndvd.cpp:256 +#: libk9copy/k9burndvd.cpp:348 +#: src/k9main.cpp:435 +msgid "Burning DVD" +msgstr "燒錄 DVD" + +#: libk9copy/k9burndvd.cpp:200 +#: libk9copy/k9burndvd.cpp:284 +#: src/k9main.cpp:384 +#: k9author/k9import.cpp:178 +msgid "Save image to disk" +msgstr "儲存映åƒæª”到ç£ç¢Ÿ" + +#: libk9copy/k9burndvd.cpp:215 +#: libk9copy/k9burndvd.cpp:302 +msgid "Insert a recordable DVD" +msgstr "æ’å…¥å¯å¯«å…¥çš„ DVD" + +#: libk9copy/k9burndvd.cpp:215 +#: libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:230 +#: libk9copy/k9burndvd.cpp:303 +#: libk9copy/k9burndvd.cpp:309 +#: libk9copy/k9burndvd.cpp:314 +msgid "DVD burning" +msgstr "DVD 燒錄" + +#: libk9copy/k9burndvd.cpp:225 +#: libk9copy/k9burndvd.cpp:309 +msgid "Error burning DVD :\n" +msgstr "燒錄 DVD 發生錯誤:\n" + +#: libk9copy/k9burndvd.cpp:230 +#: libk9copy/k9burndvd.cpp:314 +msgid "DVD Burning finished" +msgstr "DVD 燒錄完æˆ" + +#: libk9copy/k9burndvd.cpp:236 +#: libk9copy/k9burndvd.cpp:320 +msgid "An error occured while Burning DVD: %1" +msgstr "燒錄 DVD 時發生了一個錯誤: %1" + +#: libk9copy/k9burndvd.cpp:236 +#: libk9copy/k9burndvd.cpp:320 +msgid "Insert an other DVD" +msgstr "æ’å…¥å¦ä¸€ç‰‡ DVD" + +#: libk9copy/k9burndvd.cpp:349 +msgid "Current write speed :%1 x" +msgstr "ç›®å‰å¯«å…¥é€Ÿåº¦: %1 x" + +#: libk9copy/k9dvdbackup.cpp:149 +#: libk9copy/k9dvdbackup.cpp:163 +#: libk9copy/k9dvdbackup.cpp:513 +#: libk9copy/k9dvdbackup.cpp:599 +msgid "DVD backup cancelled" +msgstr "DVD 備份å–消" + +#: libk9copy/k9dvdbackup.cpp:176 +msgid "unable to open VIDEO_TS.IFO" +msgstr "無法開啟 VIDEO_TS.IFO" + +#: libk9copy/k9dvdbackup.cpp:198 +#: libk9copy/k9dvdbackup.cpp:381 +#: libk9copy/k9dvdbackup.cpp:446 +msgid "Unable to open file " +msgstr "無法開啟檔案" + +#: libk9copy/k9dvdbackup.cpp:277 +msgid "Unable to open titleset %1" +msgstr "無法開啟標題組 %1" + +#: libk9copy/k9dvdbackup.cpp:283 +#: libk9copy/k9dvdbackup.cpp:571 +msgid "Extracting titleset %1" +msgstr "正在抽å–標題組 %1" + +#: libk9copy/k9dvdbackup.cpp:453 +msgid "Unable to open menu for titleset %1" +msgstr "無法開啟標題組 %1 çš„é¸å–®" + +#: libk9copy/k9dvdbackup.cpp:479 +msgid "Extracting menu for titleset %1" +msgstr "正在抽å–標題組 %1 çš„é¸å–®" + +#: libk9copy/k9dvdbackup.cpp:563 +msgid "Unable to open ifo file for titleset %1" +msgstr "無法開啟標題組 %1 çš„ ifo 檔" + +#: libk9copy/k9dvdbackup.cpp:575 +#: libk9copy/k9dvdbackup.cpp:1694 +msgid "Unable to open DVD" +msgstr "無法開啟 DVD" + +#: libk9copy/k9dvdbackup.cpp:585 +msgid "Unable to open vobs for titleset %1" +msgstr "無法開啟標題組 %1 çš„ vobs" + +#: libk9copy/k9dvdbackup.cpp:1381 +msgid "Updating vob %1" +msgstr "æ›´æ–° vob %1" + +#: libk9copy/k9dvdbackup.cpp:1398 +msgid "DVD backup canceled" +msgstr "DVD 備份å–消" + +#: src/k9settings.cpp:27 +msgid "Devices" +msgstr "è£ç½®" + +#: src/k9settings.cpp:27 +msgid "Devices not detected by k9copy" +msgstr "k9copy 沒有åµæ¸¬åˆ°çš„è£ç½®" + +#: src/k9settings.cpp:34 +msgid "DVD" +msgstr "DVD" + +#: src/k9settings.cpp:34 +#: src/k9copy.cpp:294 +msgid "DVD Backup" +msgstr "DVD 備份" + +#: src/k9settings.cpp:42 +msgid "MEncoder" +msgstr "MEncoder" + +#: src/k9settings.cpp:42 +msgid "MPEG-4 Codecs" +msgstr "MPEG-4 編碼器" + +#: src/k9settings.cpp:48 +msgid "MPEG-4" +msgstr "MPEG-4" + +#: src/k9settings.cpp:57 +msgid "Title preview" +msgstr "é è¦½æ¨™é¡Œ" + +#: src/k9mp4title.cpp:36 +#: src/k9mp4title.cpp:109 +#: src/k9titlefactor.cpp:99 +msgid "Select a Title in the treeview..." +msgstr "在樹狀列表中é¸å–一個標題..." + +#: src/main.cpp:32 +msgid "A DVD Backup tool for KDE" +msgstr "KDE 下的 DVD 備份工具" + +#: src/main.cpp:39 +msgid "output device" +msgstr "輸出è£ç½®" + +#: src/main.cpp:40 +msgid "title to play" +msgstr "è¦æ’­æ”¾çš„標題" + +#: src/main.cpp:41 +msgid "play title to stdout" +msgstr "播放標題到標準輸出 (stdout)" + +#: src/main.cpp:42 +msgid "start sector" +msgstr "開始å€æ®µ" + +#: src/main.cpp:43 +msgid "end sector" +msgstr "çµæŸå€æ®µ" + +#: src/main.cpp:44 +msgid "list of audio streams" +msgstr "音訊串æµåˆ—表" + +#: src/main.cpp:45 +msgid "list of spu streams" +msgstr "spu 串æµåˆ—表" + +#: src/main.cpp:46 +msgid "shrink factor" +msgstr "壓縮係數" + +#: src/main.cpp:47 +msgid "shrink factor forced" +msgstr "強制壓縮係數" + +#: src/main.cpp:48 +msgid "size of the cell to be copied" +msgstr "è¦è¤‡è£½çš„ cell 大å°" + +#: src/main.cpp:49 +msgid "total size of selected titles" +msgstr "所有é¸å–標題的大å°ç¸½å’Œ" + +#: src/main.cpp:50 +msgid "size of the chapters being copied" +msgstr "複製中章節的大å°" + +#: src/main.cpp:51 +msgid "selected chapters" +msgstr "é¸å–的章節" + +#: src/main.cpp:52 +msgid "new dvd size" +msgstr "æ–° DVD 大å°" + +#: src/main.cpp:53 +msgid "selected chapter" +msgstr "é¸å–的章節" + +#: src/main.cpp:54 +msgid "cell number in selected chapter" +msgstr "é¸å–的章節內的 cell 數é‡" + +#: src/main.cpp:55 +msgid "status file name" +msgstr "狀態檔å" + +#: src/main.cpp:56 +msgid "initialize status file" +msgstr "åˆå§‹åŒ–狀態檔" + +#: src/main.cpp:57 +msgid "continue playing from last sector" +msgstr "從上一個å€æ®µç¹¼çºŒæ’­æ”¾" + +#: src/main.cpp:58 +msgid "don't save status at end" +msgstr "çµæŸæ™‚ä¸ç´€éŒ„狀態" + +#: src/main.cpp:59 +msgid "save cell in a temporary file before encoding" +msgstr "編碼å‰å…ˆå°‡ cell 存到暫存檔案" + +#: src/main.cpp:60 +msgid "for internal use" +msgstr "僅為內部使用" + +#: src/main.cpp:66 +msgid "k9copy" +msgstr "k9copy" + +#: src/main.cpp:69 +msgid "" +"_: NAME OF TRANSLATORS\\n" +"Your names" +msgstr "洪任諭 (PCMan)" + +#: src/main.cpp:70 +msgid "" +"_: EMAIL OF TRANSLATORS\\n" +"Your emails" +msgstr "pcman.tw@gmail.com" + +#: src/k9prefmencoder.cpp:105 +#: src/k9prefmencoder.cpp:109 +#: src/k9prefmencoder.cpp:120 +#: src/k9prefmencoder.cpp:122 +msgid "new profile" +msgstr "新建個人設定" + +#: src/k9copy.cpp:137 +msgid "Shrink Factor" +msgstr "壓縮係數" + +#: src/k9copy.cpp:194 +#: k9author/k9importfiles.cpp:31 +msgid "Edit menu" +msgstr "編輯é¸å–®" + +#: src/k9copy.cpp:263 +msgid "Play title" +msgstr "播放標題" + +#: src/k9copy.cpp:279 +msgid "Create MPEG-4" +msgstr "建立 MPEG-4" + +#: src/k9copy.cpp:286 +msgid "Eject" +msgstr "退出" + +#: src/k9copy.cpp:300 +msgid "DVD Author" +msgstr "DVD 編寫 (Author)" + +#: src/k9copy.cpp:306 +msgid "Create DVD" +msgstr "建立 DVD" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding options" +msgstr "MPEG4 編碼é¸é …" + +#: src/k9copy.cpp:368 +msgid "MPEG4 Encoding Options" +msgstr "MPEG4 編碼é¸é …" + +#: src/k9copy.cpp:375 +msgid "Settings" +msgstr "設定" + +#: src/k9langselect.cpp:90 +msgid "Subtitles" +msgstr "字幕" + +#: src/k9main.cpp:373 +#: src/k9main.cpp:1141 +msgid "DVD is not opened" +msgstr "DVD 尚未開啟" + +#: src/k9main.cpp:373 +#: src/k9main.cpp:395 +msgid "DVD Copy" +msgstr "複製 DVD" + +#: src/k9main.cpp:395 +msgid "" +"Insufficient disk space on %1\n" +"%2 mb expected." +msgstr "" +"%1 上ç£ç¢Ÿç©ºé–“ä¸è¶³\n" +"é æœŸéœ€è¦ %2 mb" + +#: src/k9main.cpp:399 +msgid "Backup in progress" +msgstr "備份正在進行中" + +#: src/k9main.cpp:459 +#: src/k9main.cpp:608 +#: src/k9main.cpp:1194 +msgid "Ready" +msgstr "就緒" + +#: src/k9main.cpp:464 +#: k9author/k9import.cpp:156 +msgid "processing" +msgstr "正在處ç†" + +#: src/k9main.cpp:499 +#: src/k9main.cpp:1247 +#: k9author/k9import.cpp:63 +msgid "ISO Image" +msgstr "ISO 映åƒæª”" + +#: src/k9main.cpp:560 +msgid "Open DVD" +msgstr "é–‹å•Ÿ DVD" + +#: src/k9main.cpp:586 +msgid "Titleset %1" +msgstr "標題組 %1" + +#: src/k9main.cpp:636 +msgid "chapters" +msgstr "章節" + +#: src/k9main.cpp:644 +#: src/k9main.cpp:657 +#: k9author/k9newtitle.cpp:117 +#: k9author/k9newtitle.cpp:139 +msgid "chapter %1" +msgstr "章節 %1" + +#: src/k9main.cpp:645 +#: src/k9main.cpp:660 +#: src/k9main.cpp:719 +#: src/k9main.cpp:737 +msgid "%1 MB" +msgstr "%1 MB" + +#: src/k9main.cpp:699 +msgid "video %1 " +msgstr "視訊 %1 " + +#: src/k9main.cpp:710 +msgid "audio %1 " +msgstr "音訊 %1 " + +#: src/k9main.cpp:730 +msgid "subpicture %1 " +msgstr "字幕 %1 " + +#: src/k9main.cpp:1149 +msgid "Transcoding title : %1" +msgstr "正在轉碼的標題 : %1" + +#: src/k9main.cpp:1248 +#: k9author/k9import.cpp:64 +msgid "Folder" +msgstr "目錄" + +#: src/k9main.cpp:1355 +msgid "Open ISO Image" +msgstr "é–‹å•Ÿ ISO 映åƒæª”" + +#: src/k9main.cpp:1366 +msgid "Open DVD folder" +msgstr "é–‹å•Ÿ DVD 資料夾" + +#: src/k9mencodercmdgen.cpp:103 +msgid "Filters" +msgstr "éŽæ¿¾å™¨" + +#: src/k9playbackoptions.cpp:149 +msgid "none" +msgstr "ç„¡" + +#: src/k9titlefactor.cpp:110 +msgid "Shrink Factor for %1" +msgstr "%1 的壓縮係數" + +#: k9author/k9newdvd.cpp:94 +msgid "Creating root menu" +msgstr "建立最上層é¸å–®" + +#: k9author/k9newdvd.cpp:134 +msgid "The dvd authoring was canceled" +msgstr "DVD 編寫 (Authoring) 已被å–消" + +#: k9author/k9newdvd.cpp:160 +msgid "Creating menu for title %1" +msgstr "正在建立標題 %1 çš„é¸å–®" + +#: k9author/k9newdvd.cpp:381 +#: k9author/k9newtitle.cpp:63 +msgid "title %1" +msgstr "標題 %1" + +#: k9author/k9avidecode.cpp:31 +#: k9author/k9avidecode.cpp:35 +msgid "Cannot open then library %1" +msgstr "無法開啟涵å¼åº« %1" + +#: k9author/k9avidecode.cpp:88 +msgid "Couldn't open the file %1" +msgstr "無法開啟檔案 %1" + +#: k9author/k9avidecode.cpp:93 +msgid "Couldn't find stream information" +msgstr "無法找到串æµè³‡è¨Š" + +#: k9author/k9avidecode.cpp:106 +msgid "The file doesn't contain any video stream" +msgstr "這個檔案並ä¸åŒ…å«ä»»ä½•è¦–訊串æµ" + +#: k9author/k9avidecode.cpp:117 +msgid "Unsupported codec" +msgstr "ä¸æ”¯æ´çš„解碼器" + +#: k9author/k9avidecode.cpp:122 +msgid "Could'nt open the codec" +msgstr "無法開啟解碼器" + +#: k9author/k9avidecode.cpp:133 +msgid "Unable to allocate memory for frames" +msgstr "無法é…ç½® frames 所需的所有記憶體" + +#: k9author/k9menuedit.cpp:245 +msgid "Title %1 Menu" +msgstr "標題 %1 é¸å–®" + +#: k9author/k9menuedit.cpp:254 +#: k9author/k9menuedit.cpp:291 +msgid "Play Menu" +msgstr "播放é¸å–®" + +#: k9author/k9menuedit.cpp:256 +msgid "Play Title" +msgstr "播放標題" + +#: k9author/k9menuedit.cpp:262 +msgid "Play Root Menu" +msgstr "播放最上層é¸å–®" + +#: k9author/k9menuedit.cpp:264 +msgid "Play Title Menu" +msgstr "播放標題é¸å–®" + +#: k9author/k9menuedit.cpp:269 +#: k9author/k9menuedit.cpp:295 +msgid "Play Title %1" +msgstr "播放標題 %1" + +#: k9author/k9importfiles.cpp:24 +msgid "Create new DVD" +msgstr "建立新 DVD" + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..08a6ed0 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,59 @@ +# set the include path for X, qt and KDE +INCLUDES = -I$(top_srcdir)/dvdread -I$(top_srcdir)/k9Mplayer \ + -I$(top_srcdir)/k9author -I$(top_srcdir)/k9decmpeg -I$(top_srcdir)/k9devices \ + -I$(top_srcdir)/k9vamps -I$(top_srcdir)/libdvdnav -I$(top_srcdir)/libk9copy $(all_includes) + +# these are the headers for your project +noinst_HEADERS = k9copy.h k9glwidget.h k9langselect.h k9main.h \ + k9mencodercmdgen.h k9mp4title.h k9play.h k9playbackoptions.h k9prefauthor.h k9prefdvd.h \ + k9prefmencoder.h k9prefmpeg4.h k9prefpreview.h k9redirect.h k9settings.h k9titlefactor.h \ + k9updatefactor.h kconfigdlg.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + + +KDE_ICON = k9copy + +######################################################################### +# APPLICATION SECTION +######################################################################### +# this is the program that gets installed. it's name is used for all +# of the other Makefile.am variables +bin_PROGRAMS = k9copy + +# the application source, library search path, and link libraries +k9copy_SOURCES = configDlg.ui images.h k9copy.cpp k9copy.png k9glwidget.cpp \ + k9langselect.cpp k9main.cpp k9mainw.ui k9mencodercmdgen.cpp k9mp4title.cpp k9play.cpp \ + k9playbackoptions.cpp k9prefauthor.cpp k9prefdvd.cpp k9prefmencoder.cpp k9prefmpeg4.cpp \ + k9prefpreview.cpp k9redirect.cpp k9settings.cpp k9titlefactor.cpp k9updatefactor.cpp \ + kconfigdlg.cpp kviewmpeg2.cpp kviewmpeg2.h langselectw.ui main.cpp mencoderCmdGen.ui \ + playbackoptionsw.ui prefAuthor.ui prefDVD.ui prefMPEG4.ui prefMencoder.ui prefpreview.ui \ + titlefactor.ui viewmpeg2.ui +k9copy_LDFLAGS = $(KDE_RPATH) $(all_libraries) +k9copy_LDADD = $(top_builddir)/k9Mplayer/libk9mplayer.la \ + $(top_builddir)/k9author/libk9author.la $(top_builddir)/k9decmpeg/libk9decmpeg.la \ + $(top_builddir)/k9devices/libk9devices.la $(top_builddir)/k9vamps/libk9vamps.la \ + $(top_builddir)/libdvdnav/libk9dvdnav.la $(top_builddir)/libk9copy/libk9copy.la \ + $(top_builddir)/dvdread/libdvdread.la $(LIB_KDEUI) -lkmdi + +# this is where the desktop file will go +shelldesktopdir = $(kde_appsdir)/Utilities + + +# this is where the shell's XML-GUI resource file goes +shellrcdir = $(kde_datadir)/k9copy +shellrc_DATA = k9copyui.rc + +appsdatadir = $(kde_datadir)/k9copy +appsdata_DATA = anim.mng mencoder.xml + +AM_CXXFLAGS = -O3 -g3 + +applnkMultimedia_DATA = k9copy.desktop +applnkMultimediadir = $(xdg_appsdir) +SUBDIRS = icons + +konquerorServicesMenusdir = $(kde_datadir)/konqueror/servicemenus + +konquerorServicesMenus_DATA = k9copy_open.desktop diff --git a/src/anim.mng b/src/anim.mng new file mode 100644 index 0000000..c391388 Binary files /dev/null and b/src/anim.mng differ diff --git a/src/configDlg.cpp b/src/configDlg.cpp new file mode 100644 index 0000000..b4a6fb7 --- /dev/null +++ b/src/configDlg.cpp @@ -0,0 +1,119 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './configDlg.ui' +** +** Created: dim. oct. 26 08:57:34 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "configDlg.h" + +#include +#include +#include +#include +#include +#include +#include "kpushbutton.h" + +/* + * Constructs a configDlg as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +configDlg::configDlg( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "configDlg" ); + setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) ); + configDlgLayout = new QGridLayout( this, 1, 1, 11, 6, "configDlgLayout"); + + Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); + + configDlgLayout->addMultiCellLayout( Layout1, 3, 3, 0, 1 ); + spacer4 = new QSpacerItem( 20, 190, QSizePolicy::Minimum, QSizePolicy::Expanding ); + configDlgLayout->addItem( spacer4, 2, 1 ); + + tblDevices = new QTable( this, "tblDevices" ); + tblDevices->setNumCols( tblDevices->numCols() + 1 ); + tblDevices->horizontalHeader()->setLabel( tblDevices->numCols() - 1, tr2i18n( "device" ) ); + tblDevices->setNumCols( tblDevices->numCols() + 1 ); + tblDevices->horizontalHeader()->setLabel( tblDevices->numCols() - 1, tr2i18n( "label" ) ); + tblDevices->setNumCols( tblDevices->numCols() + 1 ); + tblDevices->horizontalHeader()->setLabel( tblDevices->numCols() - 1, tr2i18n( "Input" ) ); + tblDevices->setNumCols( tblDevices->numCols() + 1 ); + tblDevices->horizontalHeader()->setLabel( tblDevices->numCols() - 1, tr2i18n( "Output" ) ); + tblDevices->setResizePolicy( QTable::Default ); + tblDevices->setVScrollBarMode( QTable::Auto ); + tblDevices->setNumRows( 0 ); + tblDevices->setNumCols( 4 ); + tblDevices->setShowGrid( TRUE ); + tblDevices->setSelectionMode( QTable::Single ); + tblDevices->setFocusStyle( QTable::SpreadSheet ); + + configDlgLayout->addMultiCellWidget( tblDevices, 1, 2, 0, 0 ); + + layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); + + bAdd = new KPushButton( this, "bAdd" ); + bAdd->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, bAdd->sizePolicy().hasHeightForWidth() ) ); + bAdd->setProperty( "stdItem", 27 ); + layout4->addWidget( bAdd ); + + bRemove = new KPushButton( this, "bRemove" ); + bRemove->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, bRemove->sizePolicy().hasHeightForWidth() ) ); + bRemove->setProperty( "stdItem", 28 ); + layout4->addWidget( bRemove ); + + configDlgLayout->addLayout( layout4, 1, 1 ); + languageChange(); + resize( QSize(578, 342).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bRemove, SIGNAL( clicked() ), this, SLOT( bRemoveClick() ) ); + connect( bAdd, SIGNAL( clicked() ), this, SLOT( bAddClick() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +configDlg::~configDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void configDlg::languageChange() +{ + setCaption( tr2i18n( "k9Copy - Devices" ) ); + tblDevices->horizontalHeader()->setLabel( 0, tr2i18n( "device" ) ); + tblDevices->horizontalHeader()->setLabel( 1, tr2i18n( "label" ) ); + tblDevices->horizontalHeader()->setLabel( 2, tr2i18n( "Input" ) ); + tblDevices->horizontalHeader()->setLabel( 3, tr2i18n( "Output" ) ); + bAdd->setText( tr2i18n( "Add" ) ); + bAdd->setAccel( QKeySequence( QString::null ) ); + bRemove->setText( tr2i18n( "Remove" ) ); + bRemove->setAccel( QKeySequence( QString::null ) ); +} + +void configDlg::bRemoveClick() +{ + qWarning( "configDlg::bRemoveClick(): Not implemented yet" ); +} + +void configDlg::bAddClick() +{ + qWarning( "configDlg::bAddClick(): Not implemented yet" ); +} + +void configDlg::bOkClick() +{ + qWarning( "configDlg::bOkClick(): Not implemented yet" ); +} + +#include "configDlg.moc" diff --git a/src/configDlg.ui b/src/configDlg.ui new file mode 100644 index 0000000..2bc3c78 --- /dev/null +++ b/src/configDlg.ui @@ -0,0 +1,196 @@ + +configDlg + + + configDlg + + + + 0 + 0 + 578 + 342 + + + + + 7 + 7 + 0 + 0 + + + + k9Copy - Devices + + + + unnamed + + + 11 + + + 6 + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + + + spacer4 + + + Vertical + + + Expanding + + + + 20 + 190 + + + + + + + device + + + + + label + + + + + Input + + + + + Output + + + + tblDevices + + + Default + + + Auto + + + 0 + + + 4 + + + true + + + Single + + + SpreadSheet + + + + + layout4 + + + + unnamed + + + + bAdd + + + + 1 + 0 + 0 + 0 + + + + Add + + + + + + 27 + + + + + bRemove + + + + 1 + 0 + 0 + 0 + + + + Remove + + + + + + 28 + + + + + + + + + bRemove + clicked() + configDlg + bRemoveClick() + + + bAdd + clicked() + configDlg + bAddClick() + + + + + bRemoveClick() + bAddClick() + bOkClick() + + + + kpushbutton.h + kpushbutton.h + + diff --git a/src/hi16-app-k9copy.png b/src/hi16-app-k9copy.png new file mode 100755 index 0000000..1d2dbdb Binary files /dev/null and b/src/hi16-app-k9copy.png differ diff --git a/src/hi32-app-k9copy.png b/src/hi32-app-k9copy.png new file mode 100755 index 0000000..43d8974 Binary files /dev/null and b/src/hi32-app-k9copy.png differ diff --git a/src/hi48-app-k9copy.png b/src/hi48-app-k9copy.png new file mode 100755 index 0000000..6ed8588 Binary files /dev/null and b/src/hi48-app-k9copy.png differ diff --git a/src/icons/Makefile.am b/src/icons/Makefile.am new file mode 100644 index 0000000..6ab3ab3 --- /dev/null +++ b/src/icons/Makefile.am @@ -0,0 +1,2 @@ +k9icondir = $(kde_datadir)/k9copy/icons +k9icon_ICON = AUTO diff --git a/src/icons/hi16-action-dvdcopy.png b/src/icons/hi16-action-dvdcopy.png new file mode 100644 index 0000000..52012d0 Binary files /dev/null and b/src/icons/hi16-action-dvdcopy.png differ diff --git a/src/icons/hi16-action-mp4.png b/src/icons/hi16-action-mp4.png new file mode 100644 index 0000000..41bf256 Binary files /dev/null and b/src/icons/hi16-action-mp4.png differ diff --git a/src/icons/hi16-action-mpeg.png b/src/icons/hi16-action-mpeg.png new file mode 100644 index 0000000..e340e83 Binary files /dev/null and b/src/icons/hi16-action-mpeg.png differ diff --git a/src/icons/hi22-action-author.png b/src/icons/hi22-action-author.png new file mode 100644 index 0000000..3147499 Binary files /dev/null and b/src/icons/hi22-action-author.png differ diff --git a/src/icons/hi22-action-cycle.png b/src/icons/hi22-action-cycle.png new file mode 100644 index 0000000..b298916 Binary files /dev/null and b/src/icons/hi22-action-cycle.png differ diff --git a/src/icons/hi22-action-dvdcopy.png b/src/icons/hi22-action-dvdcopy.png new file mode 100644 index 0000000..459685f Binary files /dev/null and b/src/icons/hi22-action-dvdcopy.png differ diff --git a/src/icons/hi22-action-mp4.png b/src/icons/hi22-action-mp4.png new file mode 100644 index 0000000..8679617 Binary files /dev/null and b/src/icons/hi22-action-mp4.png differ diff --git a/src/icons/hi22-action-mpeg.png b/src/icons/hi22-action-mpeg.png new file mode 100644 index 0000000..056df2e Binary files /dev/null and b/src/icons/hi22-action-mpeg.png differ diff --git a/src/icons/hi22-action-title.png b/src/icons/hi22-action-title.png new file mode 100644 index 0000000..b1e7016 Binary files /dev/null and b/src/icons/hi22-action-title.png differ diff --git a/src/icons/hi32-action-author.png b/src/icons/hi32-action-author.png new file mode 100644 index 0000000..392d10f Binary files /dev/null and b/src/icons/hi32-action-author.png differ diff --git a/src/icons/hi32-action-dvdcopy.png b/src/icons/hi32-action-dvdcopy.png new file mode 100644 index 0000000..0ffc7b9 Binary files /dev/null and b/src/icons/hi32-action-dvdcopy.png differ diff --git a/src/icons/hi32-action-mp4.png b/src/icons/hi32-action-mp4.png new file mode 100644 index 0000000..8897481 Binary files /dev/null and b/src/icons/hi32-action-mp4.png differ diff --git a/src/icons/hi32-action-mpeg.png b/src/icons/hi32-action-mpeg.png new file mode 100644 index 0000000..eb6a32e Binary files /dev/null and b/src/icons/hi32-action-mpeg.png differ diff --git a/src/icons/hi48-action-author.png b/src/icons/hi48-action-author.png new file mode 100644 index 0000000..2d9a683 Binary files /dev/null and b/src/icons/hi48-action-author.png differ diff --git a/src/icons/hi48-action-dvdcopy.png b/src/icons/hi48-action-dvdcopy.png new file mode 100644 index 0000000..c2b39ef Binary files /dev/null and b/src/icons/hi48-action-dvdcopy.png differ diff --git a/src/icons/hi48-action-mencoder.png b/src/icons/hi48-action-mencoder.png new file mode 100644 index 0000000..ce1f60b Binary files /dev/null and b/src/icons/hi48-action-mencoder.png differ diff --git a/src/icons/hi48-action-mp4.png b/src/icons/hi48-action-mp4.png new file mode 100644 index 0000000..9ba4f74 Binary files /dev/null and b/src/icons/hi48-action-mp4.png differ diff --git a/src/icons/hi48-action-mpeg.png b/src/icons/hi48-action-mpeg.png new file mode 100644 index 0000000..87c23c3 Binary files /dev/null and b/src/icons/hi48-action-mpeg.png differ diff --git a/src/icons/hi48-action-mplayer.png b/src/icons/hi48-action-mplayer.png new file mode 100644 index 0000000..37d0fc9 Binary files /dev/null and b/src/icons/hi48-action-mplayer.png differ diff --git a/src/images.h b/src/images.h new file mode 100755 index 0000000..a3c9198 --- /dev/null +++ b/src/images.h @@ -0,0 +1,777 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +static const char* const img_text[] = + { + "30 30 2 1", + ". c None", + "# c #eee608", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "..............................", + "...........##.................", + "...........##.................", + "...........##.................", + "....####...##.###....####.....", + "...#...##..###.###..##..##....", + "...##..##..##...##..##..#.....", + "......###..##...##.###........", + "...##..##..##...##.###........", + "...##..##..##...##..##........", + "..###.###..###.##...###.......", + "...###.##............####.....", + "..............................", + "..............................", + "..............................", + "..............................", + ".............................." + }; + +static const char* const img_sound[] = + { + "30 29 230 2", + ".a c None", + ".# c None", + "Qt c None", + "aA c #101820", + "aM c #181820", + "aL c #181829", + "#c c #181c29", + ".V c #182029", + ".K c #182031", + ".6 c #182429", + "#q c #182431", + "#C c #202031", + "bq c #202420", + "#d c #202429", + ".W c #202431", + "#N c #202831", + ".7 c #202839", + ".M c #202c41", + ".8 c #20304a", + "bf c #292831", + ".L c #292839", + "bg c #292c29", + "br c #292c31", + ".X c #292c41", + "bt c #293029", + ".Z c #293041", + "#k c #29304a", + ".w c #29344a", + ".Y c #293452", + "#1 c #29384a", + "#l c #293852", + "#m c #293c5a", + "bs c #313031", + "#A c #313431", + ".U c #313441", + "#0 c #31344a", + ".x c #31384a", + "#e c #31385a", + ".J c #313c4a", + "#r c #313c52", + "#n c #31405a", + "#u c #314062", + "#v c #31446a", + "bh c #393439", + "a5 c #393839", + ".3 c #393c31", + ".5 c #393c4a", + "az c #393c52", + "aa c #39405a", + "#Z c #394452", + ".N c #39445a", + "#S c #394462", + "#w c #394862", + "af c #39486a", + "bi c #413c41", + ".l c #414039", + "aV c #41444a", + ".Q c #414841", + "be c #414852", + "#p c #414c41", + "#G c #414c6a", + ".E c #415041", + "ak c #41506a", + "#T c #415073", + "bj c #4a444a", + ".j c #4a4841", + ".f c #4a4c41", + "#h c #4a554a", + "#H c #4a597b", + "aW c #52505a", + "#b c #525062", + ".t c #52554a", + ".e c #52594a", + "bp c #525962", + ".v c #525973", + "aq c #525d52", + "ao c #525d73", + "#5 c #525d7b", + "#W c #526152", + "al c #526183", + "#s c #526583", + "#6 c #52698b", + "#R c #526994", + "a6 c #5a555a", + "bu c #5a595a", + "a7 c #5a5d5a", + "aO c #5a5d7b", + "ap c #5a615a", + "aX c #5a6162", + "aN c #5a616a", + ".y c #5a6173", + "as c #5a617b", + "#O c #5a657b", + "aD c #5a6583", + "ai c #5a6952", + "an c #5a698b", + "ac c #5a6994", + "#U c #5a6d94", + "#4 c #5a719c", + "bk c #625d62", + "bz c #626162", + ".i c #62655a", + ".F c #626562", + "#M c #626573", + ".d c #62695a", + "#. c #626962", + "ar c #626983", + ".g c #626d62", + "ba c #626d83", + "at c #626d8b", + ".2 c #62715a", + ".G c #627162", + "#7 c #62718b", + "#t c #627194", + "#D c #627594", + "#F c #62799c", + "by c #6a656a", + "a. c #6a696a", + ".h c #6a6d62", + "aB c #6a717b", + "a2 c #6a7194", + "#z c #6a756a", + "aj c #6a758b", + "ay c #6a799c", + "ab c #6a7d9c", + "ae c #6a7da4", + "#Q c #6a81a4", + "bA c #736d73", + "#X c #73716a", + "#j c #737583", + ".s c #737973", + "#V c #737994", + "#o c #737d94", + "aK c #737d9c", + "aE c #73819c", + "#E c #7389ac", + ".S c #7b7973", + "bx c #7b797b", + ".R c #7b7d73", + "bl c #7b7d7b", + "#f c #7b7d94", + "aC c #7b7d9c", + "#9 c #7b8173", + "a# c #7b8194", + ".1 c #7b8573", + "ah c #7b857b", + "aU c #7b859c", + "#8 c #7b897b", + "#2 c #7b89a4", + "a8 c #838183", + ".k c #83857b", + "bd c #838594", + ".9 c #83899c", + "#x c #8389a4", + "au c #8389ac", + "#I c #838da4", + "ad c #838dac", + "#3 c #8395b4", + ".H c #8b8583", + "#B c #8b899c", + ".0 c #8b8d9c", + ".T c #8b919c", + ".I c #8b95a4", + ".D c #949194", + "#i c #949594", + "bc c #9495a4", + "bb c #9495ac", + ".P c #9499a4", + ".u c #9499ac", + "aF c #9499b4", + ".B c #949d94", + "aw c #949db4", + "am c #94a1bd", + "## c #9c959c", + "ag c #9c9994", + "bo c #9c999c", + ".c c #9ca19c", + "a3 c #9ca1b4", + "#P c #9ca5c5", + "av c #9caabd", + "a9 c #a49da4", + "#L c #a4a194", + "#J c #a4a1a4", + "#Y c #a4a1ac", + "#g c #a4a59c", + ".4 c #a4a5b4", + ".n c #a4a5bd", + ".C c #a4aaa4", + ".A c #a4aabd", + "bF c #aca5ac", + "#a c #aca5b4", + ".r c #acaaa4", + ".b c #acaaac", + "aY c #acaab4", + "bG c #acaeac", + ".o c #acaebd", + "aP c #acaec5", + "aG c #acb6c5", + "bB c #b4aeb4", + "bm c #b4b2b4", + "bH c #b4b6b4", + ".O c #b4b6c5", + ".m c #b4bac5", + "ax c #b4bad5", + "#K c #bdb6b4", + "bw c #bdb6bd", + "bE c #bdbabd", + "a1 c #bdbac5", + ".p c #bdbacd", + ".z c #bdbecd", + "aJ c #bdc2d5", + "bI c #c5bec5", + "#y c #c5c2c5", + "aQ c #c5c2d5", + ".q c #c5c6cd", + "a4 c #c5c6d5", + "aT c #c5c6de", + "aZ c #cdcacd", + "aS c #cdd2de", + "aH c #cdd2e6", + "bD c #d5ced5", + "aR c #d5cede", + "bC c #d5d2d5", + "b# c #d5d2de", + "aI c #d5d6e6", + "bn c #ded6de", + "bv c #dedade", + "a0 c #e6dee6", + "b. c #e6e2e6", + "bJ c #eee2ee", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#.b.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.c.d.e.f.fQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.g.h.i.j.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.a.k.aQt.lQt.aQt.aQt.m.n.o.p.qQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#.r.sQt.#.t.#Qt.#Qt.u.v.w.x.y.z.AQt.#Qt.#Qt.#", + ".aQt.aQt.B.C.a.D.E.F.a.r.G.H.aQt.I.J.K.L.M.M.N.O.PQt.aQt.aQt", + "Qt.#Qt.#.s.Q.R.c.S.#Qt.k.F.#Qt.T.U.V.W.W.X.Y.Z.0.u.#Qt.#Qt.#", + ".aQt.aQt.1.2.3.f.aQt.aQt.aQt.4.5.V.W.6.W.7.Y.8.y.9Qt.aQt.aQt", + "Qt.#Qt.#Qt.t#.##Qt.#Qt.#Qt#a#b#c.W#d.W.W.M.Y#e.N#f.#Qt.#Qt.#", + ".aQt.aQt#g#h#iQt.aQt.aQt.a#j.V.K.V.W#d#k#l.Y#m#n#oQt.aQt.aQt", + "Qt.#Qt.#.c#pQt.#Qt.#Qt.#Qt.x#q.V.W#d#r#s#t#u#v#w#x.#Qt.#Qt.#", + ".aQt.a#y#z#A.aQt.aQt.aQt#B#C.V.W.6.U#D#E#F#G#u#H#IQt.aQt.aQt", + "Qt.#Qt.##J.#Qt.##K#LQt.##M#q.7#N#N#O#P#Q#R#S#T#U#V.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt#W#X.a#Y#Z#0#1#0#0#2#3#4#T#5#6#U#G#7.aQt.aQt", + "Qt.#Qt.#Qt.#Qt#8#9a.Qta##Saa#Saa#Gabac#Saaadae.Naf.vQt.#Qt.#", + ".aQt.aQtagagahai.aQt.aaj#S#w#wakal#5#l.w#Vaman#N#lao.aQt.aQt", + "Qt.#Qt.#.DapaqahQt.#Qtarak#Tasatauavaw.AaxayazaA.ZaBQt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aaCakaDaEaFaGaHaIaJaK#waLaMaNQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.uaOaDaPaQaRaSaTaU.5aVaWaXaYaZa0.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aa1aja2a3a4a4aJaj.Ua5a6a7a.a8a9#yb..aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qtb#.9babbbcbdbebfbgbh#AbibjbkblbmbnQt.#", + ".aQt.aQt.aQt.aQt.aQt.abnbobp.Ubfbqbrbsbsbt#Aa5bjbua8bmbv.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qtbvbw.Dbxa.bybza7a6a7bzbAbx.DbBbC.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aQtbvbD#ybEbmbBbF.bbGbmbHbIaZbv.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#bJ.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#" + }; + + +static const unsigned char img_preview[] = + { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x05, 0x40, 0xc8, 0x7f, 0x00, 0x00, 0x00, + 0xd2, 0x49, 0x44, 0x41, 0x54, 0x48, 0x89, 0xe5, 0x96, 0x4b, 0x0e, 0xc3, + 0x20, 0x0c, 0x44, 0x4b, 0xd5, 0x53, 0x71, 0x7f, 0xf9, 0x5a, 0xcd, 0x0a, + 0xc9, 0x22, 0xb6, 0x33, 0xe3, 0x40, 0x1d, 0xa9, 0xb3, 0x49, 0x84, 0x2c, + 0x9e, 0x7f, 0x18, 0x9a, 0x88, 0xbc, 0x2a, 0xf4, 0x2e, 0xa1, 0x56, 0x82, + 0x3f, 0x88, 0x51, 0xef, 0xfd, 0x3b, 0xfe, 0x45, 0xa4, 0x65, 0x6d, 0xb4, + 0x5a, 0x54, 0x63, 0xbd, 0xd9, 0xac, 0xb1, 0x39, 0x62, 0x43, 0x81, 0xa3, + 0x0d, 0x19, 0x79, 0xf0, 0xff, 0x6b, 0xae, 0xe7, 0x80, 0x47, 0x6d, 0xaf, + 0x3a, 0x53, 0x44, 0x1a, 0x62, 0x03, 0x83, 0x11, 0xb8, 0x5e, 0x47, 0x6c, + 0x2c, 0xb9, 0xe7, 0x38, 0xea, 0xea, 0x15, 0x1d, 0xbf, 0xad, 0xc6, 0x96, + 0x73, 0x7a, 0xcd, 0x04, 0x23, 0xf5, 0xcb, 0x3a, 0x32, 0xbe, 0xd0, 0xc8, + 0xbc, 0x0b, 0xb3, 0x74, 0x8a, 0x78, 0x75, 0xa4, 0x30, 0xf8, 0x57, 0xda, + 0x9a, 0xea, 0x39, 0x7b, 0x3a, 0xf5, 0x5b, 0xc1, 0x91, 0x23, 0x65, 0xa9, + 0x0e, 0xef, 0x63, 0x4f, 0xec, 0xa5, 0x6f, 0x89, 0x8e, 0x78, 0x3e, 0x22, + 0xd9, 0x29, 0x46, 0x81, 0xbd, 0x48, 0x33, 0x70, 0x18, 0x6c, 0x41, 0xef, + 0xc0, 0x21, 0x70, 0x54, 0xd3, 0x2c, 0xfc, 0x12, 0x8c, 0x34, 0x52, 0x06, + 0x1e, 0x82, 0x99, 0xee, 0x65, 0xe1, 0x2e, 0x38, 0x73, 0x64, 0x18, 0x78, + 0xf8, 0x02, 0x61, 0xa0, 0x2c, 0xdc, 0x7d, 0x73, 0x65, 0xa0, 0x0c, 0x3c, + 0x35, 0xb9, 0x56, 0xa8, 0x6c, 0x56, 0x1f, 0x9a, 0x62, 0x93, 0xe0, 0x9f, + 0x36, 0x40, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82 + }; + + +static const char* const img_video[] = + { + "30 30 205 2", + ".a c None", + ".# c None", + "Qt c None", + ".j c #292452", + ".q c #292852", + ".i c #39305a", + ".p c #393c6a", + ".r c #413c5a", + "#1 c #413c62", + ".k c #414462", + "#0 c #4a4483", + "#Z c #524ca4", + "#O c #52506a", + ".D c #5250a4", + ".1 c #5250ac", + ".d c #5a557b", + "## c #5a55ac", + ".0 c #5a599c", + "al c #5a59a4", + "#a c #5a59ac", + "#M c #5a5db4", + "#R c #5a8de6", + ".G c #625973", + "#Y c #6259ac", + ".u c #625d7b", + "#N c #625d9c", + "#k c #625dac", + ".e c #62619c", + ".Y c #6261ac", + "#X c #6265b4", + "#T c #6295ee", + ".Z c #6a61b4", + "#j c #6a659c", + ".O c #6a65a4", + ".2 c #6a65b4", + ".T c #6a6d94", + "#E c #6a8dd5", + ".s c #736973", + "a# c #736d8b", + ".E c #736da4", + ".C c #736db4", + "#l c #736dbd", + ".H c #73719c", + "#P c #7371b4", + "a9 c #7371bd", + ".P c #7375b4", + "#5 c #738dcd", + ".l c #7b717b", + ".t c #7b757b", + "ak c #7b759c", + ".c c #7b75a4", + ".f c #7b75ac", + "b# c #7b75b4", + ".X c #7b75bd", + ".N c #7b79b4", + "#b c #7b79bd", + "#i c #7b7da4", + "a1 c #7b7db4", + "b. c #7b7dbd", + "#6 c #7bbaff", + "ax c #8379bd", + "a3 c #837d8b", + "#2 c #837d94", + "a8 c #837dc5", + "#. c #8381bd", + "aZ c #8381c5", + "am c #8385bd", + "aO c #8b81c5", + "a. c #8b85a4", + "aU c #8b85bd", + "aN c #8b85c5", + ".v c #8b89b4", + "#B c #8b89bd", + ".A c #8b89c5", + ".B c #8b89cd", + "#u c #8b8dac", + "a4 c #8b8db4", + "#C c #8b8dc5", + ".m c #948da4", + ".6 c #948dc5", + ".o c #948dcd", + "aS c #94918b", + "aT c #94919c", + "aG c #9491bd", + ".7 c #9491c5", + "#A c #9491cd", + "#v c #9495bd", + "bj c #9495cd", + "#H c #94a5d5", + "#8 c #94c2f6", + "aR c #9c919c", + "aE c #9c91c5", + ".S c #9c95ac", + ".F c #9c95b4", + "aD c #9c95bd", + ".z c #9c95cd", + ".M c #9c95d5", + "aK c #9c99ac", + "#e c #9c99cd", + "a0 c #9c99d5", + "bg c #9c9dc5", + "a5 c #9c9dcd", + "a2 c #a499a4", + "aw c #a49db4", + "#W c #a49dc5", + ".h c #a49dcd", + ".y c #a49dd5", + "ay c #a4a1cd", + "bf c #a4a1d5", + "aB c #a4a5cd", + "aQ c #a4a5d5", + "aC c #aca5c5", + "aL c #aca5cd", + "aF c #aca5d5", + "#z c #aca5de", + "aJ c #acaaac", + "aa c #acaab4", + "ba c #acaacd", + ".L c #acaad5", + "af c #acaeb4", + "#s c #acbede", + "ag c #acd2f6", + "#V c #b4aebd", + "#h c #b4aecd", + "aV c #b4aed5", + "aY c #b4aede", + "at c #b4b2b4", + "be c #b4b2d5", + "aM c #b4b2de", + "bd c #b4b2e6", + "aI c #b4b6b4", + "aj c #b4b6bd", + "bi c #b4b6d5", + "#q c #b4bac5", + "av c #b4bed5", + "#r c #b4caf6", + "#7 c #b4daff", + ".3 c #bdb2de", + "aH c #bdb6bd", + "as c #bdb6c5", + "ar c #bdb6d5", + "#L c #bdb6de", + "aP c #bdb6e6", + "ae c #bdbad5", + "aA c #bdbae6", + "au c #bdcede", + "#J c #c5bec5", + "#9 c #c5becd", + "#o c #c5bede", + ".Q c #c5bee6", + ".9 c #c5c2e6", + "aX c #c5c2ee", + "bb c #c5c6d5", + ".b c #c5c6e6", + "#g c #cdc2de", + "#4 c #cdc6cd", + "#f c #cdcad5", + ".U c #cdced5", + "ai c #cde6f6", + "#G c #cde6ff", + ".K c #d5caee", + "az c #d5cecd", + "#U c #d5ced5", + "#y c #d5cee6", + "#m c #d5ceee", + "aq c #d5d2d5", + "aW c #d5d2de", + "#t c #d5d2e6", + ".g c #d5d2ee", + ".I c #d5d2f6", + "bh c #d5d6de", + "#Q c #ded2d5", + "a6 c #ded2de", + ".w c #ded2ee", + ".W c #ded2f6", + "#D c #ded6de", + ".5 c #ded6ee", + ".n c #ded6f6", + "a7 c #dedade", + ".8 c #dedae6", + "#K c #dedaf6", + "#S c #def6ff", + ".x c #e6d6f6", + "#I c #e6dae6", + "#d c #e6daf6", + "ab c #e6dee6", + "#w c #e6def6", + "#3 c #e6deff", + "bk c #e6e2e6", + "bc c #e6e2ee", + "#c c #e6e2f6", + ".V c #eee2ee", + "#p c #eee6ee", + ".J c #eee6f6", + "ad c #eee6ff", + "#n c #eeeaff", + "an c #eeeeee", + ".R c #eeeef6", + "#x c #f6eaff", + ".4 c #f6eeff", + "ap c #f6f2f6", + "ah c #f6ffff", + "ao c #fff6ff", + "ac c #fffaff", + "#F c #ffffff", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.bQt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.a.c.d.e.f.g.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#.h.i.j.k.l.mQt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aQt.aQt.nQt.a.o.p.q.r.s.t.u.vQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.w.x.y.z.A.B.C.D.E.F.t.G.H.A.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.a.I.J.K.L.M.A.N.O.D.P.Q.R.S.T.L.U.V.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#.W.y.X.Y.Z.0.1.2.3.4.5.6.7.8Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.9#..2##.D###a#b.z.z#c#d#e.h#fQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.##d#g#h#i#j#k#l.A.3#m#n.n.w.h.B#o#p.#Qt.#Qt.#Qt.#", + ".aQt.aQt.a.g#q#r#s#t#u#v.Q#w.4#x#y#z#A#B#C.V.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt#D#E#F#G#H#I#J#c#K#L.z.X#M#N#O#P.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.g#Q#R#S#S#T#U#V#W.A#X#Y#Z#0#1#2#h.B.aQt.aQt.aQt.aQt", + "Qt.#Qt.##3#4#5#6#7#8#9a..O.D###ka#aaabac#p.AQt.#Qt.#Qt.#Qt.#", + ".aQt.aad#waeafagahaiajakal##am#9anaoapapaq.o.aQt.aQt.aQt.aQt", + "Qt.#Qt.##warasatauavaw.Eax#eay#4abaqaqaz#J#CQt.#Qt.#Qt.#Qt.#", + ".aQt.aQt#taAaBaCawaDaE#zaF.zaGaHaIataJaJaKaL.aQt.aQt.aQt.aQt", + "Qt.#Qt.#aM.L.zaNaOaNaPaQ#e.6aNaJaRaSaTaUaVaWQt.#Qt.#Qt.#Qt.#", + ".aQt.aQtaXaYaZaZ#baZaVa0.AaZa1a2a3a4a5a6a7Qt.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.ha8a9.Xb.aM.o.o.7aOb#babbbc.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.abdaY#Cb.aNbebfbg#ebh#pabQt.aQt.aQt.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qtbi.LbjaF.L#tbkQt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.8Qt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt", + "Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#Qt.#", + ".aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt.aQt" + }; + + static const unsigned char img_chapter[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x17, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x81, 0x32, 0xf6, 0xe2, 0x00, 0x00, 0x08, + 0x6d, 0x49, 0x44, 0x41, 0x54, 0x48, 0x89, 0x3d, 0x95, 0xcb, 0x92, 0x23, + 0xc7, 0x79, 0x85, 0xbf, 0xbc, 0x55, 0xa1, 0x50, 0x40, 0xa1, 0x81, 0xee, + 0x06, 0xd0, 0xb7, 0x21, 0x7b, 0x24, 0xd2, 0xb2, 0x28, 0x51, 0x61, 0x5b, + 0xb2, 0xc3, 0x11, 0xd6, 0x13, 0x68, 0x69, 0x6d, 0xec, 0x95, 0x37, 0x76, + 0x38, 0xfc, 0x14, 0xde, 0x39, 0xc2, 0x2f, 0xa0, 0x85, 0x17, 0x76, 0x78, + 0xe7, 0x08, 0x79, 0xef, 0x07, 0x70, 0x48, 0x0c, 0x53, 0x66, 0x90, 0x96, + 0x4d, 0xce, 0x85, 0xd3, 0x1c, 0x8a, 0xd3, 0xd3, 0x40, 0xdf, 0x00, 0x74, + 0x01, 0x85, 0xaa, 0xcc, 0xca, 0x4c, 0x2f, 0x30, 0x9c, 0xdc, 0xe4, 0x2a, + 0xff, 0x38, 0x79, 0xce, 0xf9, 0xcf, 0x11, 0x7f, 0xf3, 0xd7, 0x3f, 0xff, + 0x8b, 0xdf, 0x7f, 0x6f, 0xfc, 0xf3, 0x41, 0x6f, 0x34, 0xb0, 0x31, 0x92, + 0x98, 0x14, 0xa3, 0x25, 0xd6, 0xad, 0x71, 0x6d, 0x45, 0x9e, 0x17, 0x28, + 0xa5, 0x49, 0xd3, 0x94, 0x18, 0x23, 0x8d, 0xdb, 0x10, 0x82, 0xe5, 0x66, + 0x36, 0xc7, 0xd6, 0x0d, 0x27, 0x67, 0xdf, 0xfd, 0xf4, 0x61, 0x9d, 0x8a, + 0xcd, 0x7a, 0xf3, 0xa3, 0x1f, 0xfc, 0xf0, 0x87, 0xcf, 0xbb, 0xdd, 0xec, + 0xa6, 0x93, 0xa5, 0xb6, 0xaa, 0xb6, 0x05, 0xc4, 0xe5, 0xd5, 0xec, 0xfa, + 0x0f, 0xda, 0x20, 0x87, 0x5a, 0x6b, 0x9c, 0x73, 0xbc, 0xfb, 0xee, 0x3b, + 0x4f, 0x9e, 0xfc, 0xef, 0x7f, 0xbd, 0x1f, 0x5c, 0x29, 0x6d, 0x75, 0xcf, + 0x66, 0xb5, 0x1c, 0x3c, 0x7b, 0xb1, 0xfe, 0x97, 0xbf, 0xff, 0xc7, 0x7f, + 0xfa, 0x85, 0xf8, 0xd9, 0xcf, 0xbe, 0xf7, 0xcb, 0xbf, 0xfb, 0xdb, 0xbf, + 0xfc, 0xf3, 0xf7, 0xbe, 0xf3, 0x47, 0xf4, 0xf6, 0xa6, 0x48, 0x63, 0x08, + 0xd1, 0xe3, 0x43, 0x83, 0x54, 0x01, 0xad, 0x32, 0x8c, 0x4e, 0x01, 0x88, + 0x11, 0x08, 0x20, 0x5b, 0x70, 0x8d, 0xa5, 0xb5, 0x96, 0xf9, 0xcd, 0x2d, + 0x37, 0xcb, 0x25, 0x8f, 0xce, 0xce, 0xe8, 0x64, 0x19, 0x52, 0x69, 0x42, + 0x14, 0xb4, 0xde, 0x93, 0x24, 0x86, 0x3c, 0xef, 0x91, 0x65, 0x03, 0x82, + 0x0f, 0x78, 0x1f, 0xf0, 0xbe, 0xc5, 0xbb, 0x05, 0xde, 0xad, 0x58, 0xdd, + 0x5f, 0x70, 0x75, 0xf9, 0x05, 0xff, 0xf6, 0xaf, 0x9f, 0xf0, 0x9f, 0xbf, + 0xfe, 0xe2, 0x4f, 0xf5, 0xef, 0xbd, 0xf7, 0xe1, 0xbc, 0xa9, 0x0d, 0xc6, + 0x1c, 0xa3, 0xd2, 0x33, 0x2e, 0xaf, 0xe6, 0x1c, 0xec, 0x8f, 0xe9, 0xf5, + 0x73, 0xb4, 0x52, 0x34, 0x8d, 0x45, 0x9b, 0x0e, 0x4a, 0x29, 0x04, 0x20, + 0x42, 0x40, 0x7a, 0x4f, 0x23, 0x6a, 0x5c, 0x6c, 0xd0, 0xca, 0x90, 0x98, + 0x0c, 0xad, 0xa7, 0x74, 0xd2, 0x1e, 0xda, 0x24, 0x38, 0x17, 0x48, 0x4d, + 0xa4, 0xdb, 0xed, 0x62, 0x12, 0x8d, 0x14, 0x81, 0x10, 0x1d, 0x31, 0x7a, + 0x62, 0x00, 0x29, 0x8e, 0x91, 0x6a, 0x44, 0x37, 0x93, 0x08, 0x71, 0x8d, + 0xb3, 0x21, 0x2a, 0x29, 0x5b, 0x7d, 0x32, 0x3d, 0xb9, 0xe9, 0x74, 0xfa, + 0xa0, 0x0c, 0x9f, 0x7d, 0xfe, 0x39, 0xb7, 0xf3, 0xd7, 0xfc, 0xe0, 0x83, + 0x0f, 0x58, 0xad, 0xee, 0x18, 0x14, 0x7b, 0x7c, 0xf9, 0xe2, 0x29, 0x4a, + 0x4a, 0x4e, 0xcf, 0xce, 0xb8, 0xbf, 0xbf, 0x27, 0x51, 0x1d, 0x32, 0x93, + 0xf1, 0xe5, 0xd3, 0x2f, 0x39, 0x9d, 0x1e, 0xb1, 0x28, 0x4b, 0x54, 0x9a, + 0x80, 0x54, 0x44, 0x21, 0x41, 0x0a, 0x36, 0xcd, 0x9a, 0xa7, 0xcf, 0x9e, + 0x32, 0x1a, 0x8d, 0x38, 0x3e, 0x3a, 0x62, 0x58, 0x0c, 0x69, 0xdb, 0x88, + 0x10, 0x0a, 0x29, 0x25, 0x51, 0x58, 0x22, 0x80, 0x50, 0x20, 0x25, 0x6b, + 0x57, 0xc7, 0x60, 0x54, 0xa3, 0x7b, 0xfd, 0x6e, 0x21, 0x89, 0x78, 0xeb, + 0xf9, 0xfa, 0xc5, 0x05, 0xa7, 0xc7, 0xa7, 0x64, 0xa6, 0xcf, 0xcb, 0xaf, + 0x5f, 0x52, 0x3d, 0x34, 0xdc, 0xcd, 0x57, 0x0c, 0x06, 0x05, 0xb4, 0x9a, + 0xab, 0x6f, 0x6e, 0xc8, 0x3a, 0x29, 0xef, 0x9c, 0x3d, 0x42, 0xa9, 0xc8, + 0x62, 0x79, 0xcb, 0x6a, 0x5d, 0xb2, 0x77, 0x38, 0x24, 0xc4, 0x16, 0xf0, + 0x5c, 0xbe, 0x7a, 0xcd, 0x93, 0xa7, 0x5f, 0x00, 0x60, 0x14, 0xbc, 0xf6, + 0x8e, 0x32, 0x5f, 0x50, 0x96, 0x25, 0x45, 0x51, 0x30, 0x18, 0x0c, 0xc8, + 0xb2, 0x2e, 0x1e, 0x41, 0x1d, 0x05, 0x2d, 0x8a, 0xb4, 0x6b, 0x9a, 0xff, + 0x79, 0xf2, 0xfc, 0xb7, 0x5a, 0x10, 0x6c, 0x53, 0x5b, 0xea, 0xad, 0xe5, + 0xa7, 0x7f, 0xf6, 0x53, 0x16, 0xf7, 0xf7, 0x64, 0x59, 0xc2, 0x64, 0x7c, + 0xc8, 0xfe, 0xfe, 0x3e, 0xa3, 0xd1, 0x1e, 0xde, 0xb7, 0x24, 0x89, 0xe6, + 0xc7, 0x3f, 0xfe, 0x43, 0x6c, 0x63, 0xe9, 0x24, 0x29, 0x1f, 0x7c, 0xff, + 0x03, 0x82, 0x6b, 0x59, 0x94, 0x2b, 0x56, 0x55, 0x89, 0x92, 0x8a, 0x10, + 0x22, 0x21, 0x44, 0x94, 0xd4, 0xd4, 0x75, 0x8d, 0x77, 0x9e, 0x6d, 0xb5, + 0x45, 0x22, 0x30, 0x46, 0x73, 0x7d, 0x3d, 0x67, 0x36, 0xbb, 0xe2, 0x68, + 0x3a, 0xe1, 0x60, 0x3a, 0x25, 0x12, 0xd1, 0x26, 0x41, 0x29, 0x05, 0x80, + 0xfe, 0xdd, 0xef, 0xbe, 0x79, 0xf7, 0x60, 0xb4, 0x87, 0x10, 0xe0, 0x7d, + 0x60, 0x38, 0x1c, 0xd2, 0x34, 0xf6, 0xcd, 0xdd, 0x50, 0x14, 0x05, 0x10, + 0xb1, 0xd6, 0x61, 0x4c, 0x42, 0x6b, 0x1d, 0x8b, 0xe5, 0x02, 0xe9, 0x23, + 0xd3, 0xc3, 0x31, 0x2d, 0x81, 0x55, 0x55, 0x12, 0x63, 0x44, 0x4a, 0xc9, + 0x70, 0x38, 0x44, 0x29, 0xc5, 0x70, 0x38, 0xe4, 0xf8, 0xf8, 0x18, 0xad, + 0x14, 0xeb, 0xf5, 0x1a, 0x6b, 0x2d, 0x00, 0x8b, 0xc5, 0x02, 0x62, 0x60, + 0x7f, 0x32, 0xa5, 0xd3, 0xe9, 0x93, 0xa5, 0x05, 0xcb, 0x65, 0xb9, 0x03, + 0x73, 0x77, 0x77, 0x77, 0xe0, 0x5a, 0x87, 0x10, 0x82, 0xba, 0xa9, 0xb9, + 0xb9, 0xbe, 0x66, 0xb4, 0x37, 0xe4, 0xdb, 0x13, 0x63, 0xc4, 0x39, 0x47, + 0x59, 0x96, 0x8c, 0x46, 0x23, 0x5e, 0x5e, 0x5c, 0x70, 0x73, 0x7d, 0xc3, + 0x78, 0xff, 0x80, 0xa3, 0xf1, 0x04, 0xef, 0x3d, 0x21, 0x04, 0x00, 0x84, + 0x10, 0x24, 0x49, 0x42, 0x8c, 0x91, 0x97, 0x2f, 0x5f, 0x12, 0x63, 0x64, + 0x3a, 0x9d, 0x12, 0x42, 0x40, 0x4a, 0x49, 0x92, 0x24, 0x34, 0x4d, 0xcd, + 0x7a, 0x23, 0x79, 0xf1, 0xe2, 0x05, 0x8f, 0x1e, 0x8d, 0x11, 0xc2, 0x10, + 0xe3, 0xee, 0xbd, 0x2e, 0xd7, 0x1b, 0xa1, 0x4c, 0x8a, 0x4e, 0x12, 0xf0, + 0x91, 0xe9, 0x74, 0x42, 0xaf, 0xdb, 0x7b, 0x3b, 0xfc, 0x5b, 0x0a, 0xa7, + 0xd3, 0x29, 0x49, 0x62, 0x38, 0x39, 0x39, 0x25, 0xeb, 0x64, 0x8c, 0xf7, + 0xf7, 0x91, 0x4a, 0x92, 0xe7, 0x39, 0x5a, 0x27, 0x08, 0xa1, 0x08, 0x01, + 0x84, 0x90, 0x14, 0x45, 0xc1, 0xc3, 0xc3, 0x03, 0x5a, 0x6b, 0xac, 0xb5, + 0x38, 0xe7, 0x10, 0xc0, 0xab, 0xcb, 0x4b, 0x84, 0x94, 0x5c, 0x5f, 0x5f, + 0x33, 0x1a, 0x4d, 0xc0, 0x41, 0xeb, 0x22, 0x26, 0xed, 0xec, 0xc0, 0x48, + 0xa9, 0x5e, 0xc6, 0x18, 0x31, 0x89, 0x26, 0x6c, 0x1c, 0xc7, 0xd3, 0x09, + 0xd7, 0xf3, 0x6b, 0x26, 0x93, 0xc9, 0x5b, 0xd3, 0x01, 0x64, 0x59, 0xc6, + 0xed, 0xed, 0x2d, 0x7b, 0xc3, 0x3d, 0xa6, 0x93, 0x09, 0xf8, 0x40, 0xdb, + 0xb6, 0x38, 0xd7, 0x22, 0x84, 0x20, 0x84, 0x40, 0x8c, 0x11, 0x80, 0xaa, + 0xaa, 0xe8, 0x76, 0xbb, 0xdc, 0xdc, 0xdc, 0x10, 0x42, 0x20, 0x4d, 0x53, + 0xac, 0xb5, 0xc8, 0x37, 0x40, 0x1e, 0x9f, 0x3f, 0xe2, 0xf4, 0xf8, 0x04, + 0x2d, 0xc0, 0xb9, 0x96, 0xc6, 0xb5, 0x7c, 0xf5, 0xd5, 0x0b, 0xa9, 0x41, + 0x5c, 0x08, 0x11, 0x10, 0xc2, 0x73, 0x7b, 0x7b, 0xcf, 0xfc, 0xf5, 0x0c, + 0x11, 0x61, 0x36, 0x9b, 0x71, 0x74, 0x74, 0xc4, 0x62, 0xb1, 0x40, 0x4a, + 0x49, 0xb7, 0xdb, 0x45, 0x6b, 0xcd, 0x67, 0x9f, 0x7e, 0xca, 0xc1, 0x68, + 0x9f, 0x44, 0x69, 0x32, 0x93, 0x30, 0xbb, 0xbd, 0x41, 0x24, 0xfa, 0x2d, + 0x20, 0x88, 0x8c, 0x46, 0x23, 0x96, 0xcb, 0x25, 0x77, 0x77, 0x77, 0x4c, + 0xa7, 0x53, 0x66, 0xb3, 0x19, 0xc6, 0x18, 0x62, 0x8c, 0x64, 0x59, 0x86, + 0xb5, 0x96, 0x3c, 0xef, 0xa1, 0x68, 0x30, 0xda, 0x20, 0xa5, 0xe4, 0xfc, + 0xfc, 0x3b, 0x41, 0xdb, 0xc6, 0x92, 0xf7, 0xbb, 0x74, 0xf3, 0x0e, 0x07, + 0x87, 0x63, 0x5c, 0xb5, 0x45, 0x49, 0xb1, 0x0b, 0xac, 0x37, 0x03, 0xa4, + 0x94, 0x0c, 0x06, 0x05, 0x4d, 0x63, 0x39, 0x3c, 0x3c, 0x64, 0x7f, 0x38, + 0xc4, 0x48, 0x8d, 0x46, 0xb0, 0x6e, 0xb6, 0xd4, 0xad, 0x23, 0xc6, 0x88, + 0xd6, 0x9a, 0xba, 0xde, 0x72, 0x70, 0x70, 0x40, 0x55, 0x55, 0x9c, 0x9d, + 0x9d, 0xbd, 0x65, 0xb7, 0xd3, 0xe9, 0x50, 0xd7, 0x35, 0xe5, 0xba, 0x24, + 0x49, 0x92, 0x1d, 0x93, 0xa1, 0xc5, 0x87, 0x40, 0x0c, 0x62, 0x27, 0x93, + 0x6d, 0x41, 0x49, 0x83, 0x40, 0xf2, 0xee, 0xd9, 0x23, 0x12, 0xa3, 0xa8, + 0xdf, 0xd0, 0x7c, 0x77, 0x7f, 0x47, 0x08, 0x81, 0xc9, 0x64, 0x42, 0x96, + 0xed, 0x74, 0x3d, 0x38, 0xd8, 0x47, 0x49, 0x85, 0x08, 0x11, 0x5f, 0x37, + 0x08, 0xad, 0xf8, 0x66, 0xfe, 0x1a, 0x63, 0x34, 0x4a, 0x49, 0x84, 0x80, + 0xbc, 0x97, 0x53, 0x6d, 0xb7, 0x54, 0xd5, 0x86, 0xdb, 0xdb, 0x5b, 0x06, + 0xc5, 0x80, 0xe9, 0x74, 0x4a, 0x59, 0x96, 0xb4, 0xce, 0xb1, 0x5c, 0xae, + 0x08, 0x78, 0xbc, 0xaf, 0x89, 0x7e, 0xc3, 0xed, 0xcd, 0xf5, 0xb7, 0x60, + 0x02, 0x21, 0x1a, 0x82, 0x17, 0xbc, 0x78, 0xfa, 0x14, 0x81, 0xa7, 0xd3, + 0x49, 0x19, 0x8f, 0xc7, 0x5c, 0x5e, 0xbe, 0xa2, 0xdf, 0x2b, 0x78, 0xfe, + 0xfc, 0x39, 0x77, 0x77, 0x77, 0x1c, 0x1e, 0x1e, 0xb2, 0xde, 0x56, 0xec, + 0x0d, 0x06, 0xf8, 0xda, 0xb2, 0x5f, 0x0c, 0x98, 0x5f, 0xcf, 0x89, 0x5a, + 0xa0, 0x94, 0x04, 0x22, 0x26, 0x31, 0x44, 0x02, 0x1f, 0xfe, 0xe8, 0x43, + 0xae, 0xae, 0xae, 0xd8, 0x54, 0x15, 0x21, 0x04, 0xac, 0xb5, 0xcc, 0x66, + 0x33, 0x3a, 0x9d, 0xce, 0x8e, 0x0d, 0x09, 0xc8, 0x16, 0xef, 0x4a, 0xba, + 0xdd, 0x5d, 0xf7, 0xe9, 0xe1, 0xde, 0x50, 0xe6, 0xdd, 0x9c, 0x10, 0x22, + 0x31, 0x46, 0x94, 0x96, 0xbb, 0x35, 0xaf, 0x6b, 0xf6, 0x47, 0xfb, 0x68, + 0x6d, 0x68, 0x5b, 0x4f, 0x51, 0x14, 0xa4, 0x69, 0x8a, 0x0b, 0x9e, 0x34, + 0x49, 0x51, 0x26, 0x45, 0x6b, 0x4d, 0xde, 0xcd, 0x59, 0xbb, 0x2d, 0x42, + 0x08, 0x62, 0x8c, 0x54, 0x55, 0x45, 0xd6, 0xed, 0x20, 0xc4, 0x8e, 0x7a, + 0xa5, 0x14, 0xe5, 0x43, 0x49, 0x59, 0x96, 0x84, 0x10, 0x28, 0xcb, 0x12, + 0x88, 0xa4, 0x69, 0x0a, 0x3a, 0x23, 0xed, 0x74, 0x18, 0x0c, 0x76, 0x51, + 0xa2, 0xc7, 0x93, 0xe9, 0xc8, 0x98, 0x9d, 0x89, 0x8a, 0xa2, 0xa0, 0xdb, + 0x4d, 0xe8, 0x66, 0x19, 0x59, 0x96, 0x91, 0x24, 0x09, 0x52, 0x28, 0x4e, + 0x4e, 0x76, 0x99, 0xb3, 0xdd, 0x6e, 0x11, 0x5a, 0xe3, 0x1a, 0xcb, 0x20, + 0xcf, 0xa9, 0xcb, 0x0d, 0x42, 0x08, 0xca, 0x79, 0x45, 0x8c, 0x11, 0x21, + 0x04, 0x4d, 0xd3, 0xb0, 0x7a, 0x58, 0xb2, 0x58, 0x2c, 0x58, 0x2c, 0x16, + 0x38, 0xe7, 0xc8, 0xb2, 0x0c, 0x63, 0x0c, 0x21, 0x04, 0xb6, 0xdb, 0x2d, + 0xa7, 0x27, 0x27, 0x08, 0xb1, 0x6b, 0x76, 0x01, 0x08, 0xf1, 0x26, 0x67, + 0xaa, 0xcd, 0xaa, 0x0a, 0x6f, 0x0c, 0xb8, 0xb8, 0xbf, 0xa3, 0x75, 0x39, + 0xab, 0xc5, 0x92, 0x08, 0x18, 0x63, 0x18, 0x14, 0x03, 0xaa, 0x6a, 0x8b, + 0xf7, 0x9e, 0x6e, 0x37, 0xc7, 0xb6, 0x16, 0xa3, 0x35, 0xcd, 0xa6, 0xe2, + 0xf6, 0x6a, 0xc6, 0x60, 0xb8, 0x47, 0x8c, 0xbb, 0x70, 0xf4, 0xa1, 0xa5, + 0x75, 0x16, 0xa5, 0x14, 0xe7, 0xe7, 0xe7, 0x6f, 0xe5, 0xd9, 0x2b, 0x06, + 0x38, 0xe7, 0x98, 0xcd, 0x66, 0x0c, 0x06, 0x03, 0xf2, 0x5e, 0x0f, 0x21, + 0x04, 0x3e, 0x78, 0x10, 0xd0, 0x4b, 0x0d, 0x5f, 0x7d, 0x75, 0x21, 0x75, + 0xb9, 0x5e, 0xfe, 0x49, 0xfd, 0x50, 0x62, 0xdb, 0x40, 0xeb, 0x1a, 0xb6, + 0x1b, 0x81, 0x54, 0x1a, 0x29, 0x25, 0xad, 0xab, 0xd1, 0x2a, 0x41, 0x4a, + 0x89, 0x52, 0x02, 0xe7, 0x2c, 0xb6, 0xb1, 0x60, 0x02, 0x51, 0x78, 0x06, + 0xc3, 0x21, 0x59, 0xb7, 0x8b, 0x94, 0xfa, 0x8d, 0x24, 0x02, 0xa9, 0xa0, + 0x5f, 0xec, 0x61, 0x8c, 0xe1, 0xf1, 0xe3, 0xc7, 0x64, 0x59, 0xc6, 0x68, + 0x6f, 0xc8, 0xb3, 0x67, 0xcf, 0x78, 0x78, 0x78, 0x60, 0x3c, 0x1e, 0x33, + 0xd8, 0x1b, 0x62, 0x3a, 0x1d, 0x9a, 0x5a, 0xa3, 0x92, 0x84, 0xf7, 0xa7, + 0x87, 0x9c, 0x9f, 0x3f, 0x0e, 0x3a, 0x06, 0x85, 0x6d, 0x2c, 0x4d, 0x5d, + 0xf3, 0xe8, 0xf4, 0x31, 0x49, 0xaa, 0x88, 0x40, 0xbf, 0xdf, 0x47, 0x29, + 0x85, 0x49, 0x34, 0x3b, 0xf9, 0x05, 0x02, 0x70, 0x2e, 0x40, 0x80, 0x44, + 0x29, 0x9c, 0x75, 0x2c, 0x96, 0x4b, 0x84, 0x90, 0xc4, 0x28, 0x11, 0x18, + 0x4e, 0x4e, 0xde, 0x01, 0xb1, 0x5b, 0xf3, 0x2c, 0xcb, 0x98, 0x4c, 0x26, + 0xb8, 0xc6, 0xd2, 0xed, 0x76, 0xc9, 0xb2, 0x8c, 0xf1, 0x78, 0xcc, 0xc9, + 0xe9, 0x3b, 0x68, 0x99, 0x90, 0x24, 0x1d, 0x5a, 0x07, 0xfd, 0x7e, 0x5f, + 0x7c, 0xf4, 0xab, 0x5f, 0xf5, 0xb4, 0x73, 0x56, 0xf8, 0x58, 0x13, 0x45, + 0xcd, 0xc7, 0x1f, 0x7f, 0x4e, 0xaf, 0x97, 0x23, 0x95, 0x24, 0x4d, 0x53, + 0xf2, 0x3c, 0x27, 0xef, 0x65, 0xf4, 0x7b, 0x39, 0xae, 0x6d, 0xf1, 0xde, + 0xa3, 0xb5, 0x21, 0xd1, 0x09, 0x32, 0x46, 0x8a, 0x5e, 0x1f, 0x84, 0x25, + 0xc6, 0x2d, 0x21, 0xd4, 0xc4, 0x98, 0x20, 0x84, 0x26, 0x49, 0x13, 0x92, + 0x24, 0x79, 0xdb, 0x6f, 0x89, 0x36, 0x24, 0x49, 0x42, 0x51, 0x14, 0x08, + 0x21, 0xd0, 0x46, 0xe3, 0x83, 0xa5, 0xf5, 0x0d, 0x88, 0x16, 0x21, 0x45, + 0x9c, 0x4c, 0x27, 0x1b, 0xdd, 0xeb, 0xa7, 0x6b, 0xdb, 0x96, 0xb8, 0x76, + 0x45, 0xa7, 0x23, 0xa8, 0xeb, 0x0d, 0xde, 0x7b, 0xe4, 0xa0, 0xe0, 0x76, + 0xfb, 0x80, 0x75, 0x39, 0xce, 0xe5, 0xa4, 0x69, 0x87, 0xb2, 0x5c, 0x93, + 0x24, 0x0a, 0xa3, 0x24, 0x22, 0x44, 0x82, 0xef, 0xe3, 0x83, 0xa5, 0xb6, + 0x37, 0x54, 0x5b, 0x8d, 0x54, 0x0d, 0x3d, 0x35, 0x20, 0x86, 0x2e, 0xb6, + 0xf1, 0x18, 0xb3, 0x03, 0xe4, 0x7d, 0x0b, 0x04, 0x62, 0x6c, 0x89, 0x31, + 0xb2, 0xd9, 0x2c, 0xb0, 0x0f, 0x96, 0xed, 0x66, 0xfe, 0xe6, 0x23, 0x81, + 0xaf, 0x2f, 0x2e, 0xd0, 0xdb, 0xaa, 0x4e, 0xb6, 0xd1, 0xb0, 0x7e, 0xb8, + 0xe5, 0x64, 0x5a, 0xb0, 0x59, 0x57, 0x1c, 0x4e, 0x0e, 0x51, 0xda, 0xb3, + 0x58, 0xac, 0x78, 0xfc, 0xdd, 0x82, 0xa6, 0x59, 0x12, 0x82, 0x66, 0xd0, + 0xcf, 0x90, 0x01, 0xb4, 0x00, 0xdb, 0x38, 0x6c, 0x33, 0xe7, 0xe6, 0xf6, + 0x15, 0xaf, 0x2e, 0x7e, 0x0b, 0xf6, 0x94, 0x4d, 0xde, 0xa3, 0x2a, 0xfa, + 0x04, 0x25, 0xe8, 0xf5, 0x86, 0x64, 0x69, 0xc1, 0xba, 0xac, 0x99, 0x5f, + 0xcf, 0x11, 0xa2, 0x45, 0x6a, 0x8f, 0x73, 0x15, 0xbe, 0xa9, 0x70, 0xb6, + 0xa2, 0xb5, 0x25, 0x55, 0xb9, 0x60, 0xeb, 0x5a, 0xf1, 0xd9, 0x27, 0xff, + 0x9d, 0x69, 0x63, 0x0e, 0xfe, 0xea, 0xdf, 0x7f, 0xf9, 0x1f, 0xe7, 0xc7, + 0x27, 0x9f, 0xc6, 0xc3, 0xfd, 0xb3, 0x74, 0xff, 0x60, 0x64, 0x9a, 0xf6, + 0xd1, 0xba, 0xb1, 0x9b, 0xb4, 0x18, 0x74, 0x9a, 0xff, 0x7b, 0xf2, 0x45, + 0xe1, 0xdc, 0x6a, 0x6b, 0xad, 0x73, 0x49, 0x92, 0x93, 0xc9, 0x7d, 0x68, + 0x53, 0x2e, 0x2f, 0x2f, 0xf9, 0xe8, 0xa3, 0x8f, 0xf8, 0xf8, 0x37, 0xbf, + 0xe6, 0x7b, 0xdf, 0x7f, 0x3f, 0xfd, 0xe3, 0x9f, 0xd0, 0x18, 0xd3, 0xc9, + 0x3f, 0xfe, 0xe4, 0x37, 0x3f, 0x49, 0xfb, 0x56, 0x1d, 0x1d, 0x1d, 0xa3, + 0x65, 0xca, 0x76, 0x6b, 0x59, 0xad, 0x56, 0x84, 0x68, 0x91, 0x2a, 0xe0, + 0xbd, 0x45, 0xc5, 0x88, 0x51, 0xd0, 0x49, 0x25, 0xdb, 0x4d, 0x73, 0x58, + 0x5e, 0xf7, 0xcb, 0x5f, 0xfc, 0xc3, 0x3f, 0x57, 0xff, 0x0f, 0x14, 0xc9, + 0x62, 0x82, 0xa2, 0xfd, 0xb2, 0x85, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, + 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 + }; diff --git a/src/k9copy.cpp b/src/k9copy.cpp new file mode 100644 index 0000000..a65fdf5 --- /dev/null +++ b/src/k9copy.cpp @@ -0,0 +1,528 @@ +// +// C++ Implementation: k9copy +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2005 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9main.h" +#include "k9copy.h" +#include "k9settings.h" +#include "k9playbackoptions.h" +#include "k9langselect.h" +#include "k9config.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kviewmpeg2.h" +#include "k9titlefactor.h" +#include +#include +#include "k9mp4title.h" +#include "k9tools.h" +#include "k9importfiles.h" +#include "k9import.h" +#include "k9menuedit.h" +#include "k9chapteredit.h" +#include "k9newtitle.h" +#include "k9menu.h" +#include +#include + +k9Copy::k9Copy() + : KMdiMainFrm( 0, "k9Copy" ,KMdi::IDEAlMode ) { + // tell the KMainWindow that this is indeed the main widget + m_k9MainView=NULL; + m_k9ImportView =NULL; + + // accept dnd + setAcceptDrops(true); + + // then, setup our actions + setupActions(); + + // and a status bar + statusBar()->show(); + statusBar()->insertFixedItem("",sbFactor,TRUE); + statusBar()->setItemFixed(sbFactor,100); + statusBar()->insertItem("",sbMessage,1,FALSE); + statusBar()->setItemAlignment(sbMessage,AlignLeft | AlignVCenter); + + // Apply the create the main window and ask the mainwindow to + // automatically save settings if changed: window size, toolbar + // position, icon size, etc. Also to add actions for the statusbar + // toolbar, and keybindings if necessary. + resize(QSize(800,600)); + + setToolviewStyle(KMdi::TextAndIcon); + createCopyWindows(); + backupAction->setChecked(true); + //createImportWindows(); +} + + +void k9Copy::createCopyWindows() { + saveDock(); + if (m_k9ImportView) { + m_k9ImportView->close(); + m_k9Import=NULL; + m_k9ImportView=NULL; + } + removeToolWindows(); + + m_actions["open"]->setEnabled(true); + m_actions["quit"]->setEnabled(true); + m_actions["preferences"]->setEnabled(true); + m_actions["playtitle"]->setEnabled(true); + m_actions["copy"]->setEnabled(true); + m_actions["create"]->setEnabled(false); + m_actions["mp4"]->setEnabled(true); + m_actions["eject"]->setEnabled(true); + + + k9Config config; + m_useXine=config.getUseMplayer(); + + m_useDvdAuthor=config.getUseDvdAuthor(); + + if (config.getPrefVersion() != VERSION) { + initCodecs(); + config.read(); + config.setPrefVersion(VERSION); + config.save(); + } + + m_k9Main=new k9Main(this,0,&m_drives); + m_k9MainView=createWrapper( m_k9Main,"",""); + addWindow(m_k9MainView, KMdi::StandardAdd); + + m_options=new k9PlaybackOptions(m_k9Main,this); + KMdiToolViewAccessor *acc; + acc=addToolWindow(m_options, KDockWidget::DockRight, getMainDockWidget(),0,i18n("DVD playback options"),i18n("DVD playback options")); + acc->show(); + + m_ToolViews.append(acc); + + m_lang=new k9LangSelect(m_k9Main,this); + acc=addToolWindow(m_lang, KDockWidget::DockRight, getMainDockWidget(),0,i18n("Selection"),i18n("Selection")); + m_ToolViews.append(acc); + + if (m_useXine) { + m_mp2=new K9Mplayer(this); + } else + m_mp2=new kViewMPEG2(); + + m_previewAcc=addToolWindow(m_mp2,KDockWidget::DockRight,getMainDockWidget(),0,i18n("Preview"),i18n("Preview")); + m_ToolViews.append(m_previewAcc); + + connect(m_k9Main,SIGNAL(showPreview( k9DVD*, k9DVDTitle*,int )),m_mp2,SLOT(open( k9DVD*, k9DVDTitle*,int ))); + connect(m_k9Main,SIGNAL(stopPreview()),m_mp2,SLOT(bStopClick())); + + m_factors =new k9TitleFactor( this); + m_factors->setUseDvdAuthor(m_useDvdAuthor); + int h=m_factors->height(); + acc=addToolWindow(m_factors,KDockWidget::DockBottom,getMainDockWidget(),10,i18n("Shrink Factor"),i18n("Shrink Factor")); + m_ToolViews.append(acc); + + connect(m_k9Main,SIGNAL(SelectionChanged( k9DVD*,bool )),m_factors,SLOT(SelectionChanged( k9DVD*,bool ))); + connect(m_k9Main,SIGNAL(changedTitle( k9DVDTitle* )),m_factors,SLOT(changedTitle( k9DVDTitle* ))); + + KDockWidget *dw=dockManager->findWidgetParentDock (m_factors); + dw->setForcedFixedHeight(h); + + addMp4TitleOptions(); + + // allow the view to change the statusbar and caption + + connect(m_k9Main, SIGNAL(changeStatusbar(const QString&,int )), + this, SLOT(changeStatusbar(const QString&,int))); + connect(m_k9Main, SIGNAL(changeCaption(const QString&)), + this, SLOT(changeCaption(const QString&))); + + setAutoSaveSettings(); + KSimpleConfig settings("K9Copy"); + if (settings.hasGroup("dock")) + dockManager->readConfig((KConfig*)&settings,"dock"); +} + +void k9Copy::removeToolWindows() { + for (KMdiToolViewAccessor *acc=m_ToolViews.first();acc;acc=m_ToolViews.next()) { + deleteToolWindow(acc); + } + m_ToolViews.clear(); +} + +void k9Copy::createImportWindows() { + saveDock(); + if (m_k9MainView) { + m_k9MainView->close(); + m_k9Main=NULL; + m_k9MainView=NULL; + } + + removeToolWindows(); + + m_actions["open"]->setEnabled(false); + m_actions["quit"]->setEnabled(true); + m_actions["preferences"]->setEnabled(true); + m_actions["playtitle"]->setEnabled(false); + m_actions["copy"]->setEnabled(false); + m_actions["create"]->setEnabled(false); + m_actions["mp4"]->setEnabled(false); + m_actions["eject"]->setEnabled(false); + + KMdiToolViewAccessor *acc; + m_k9Import=new k9Import(this,0,&m_drives); + m_k9ImportView=createWrapper( m_k9Import,"",""); + addWindow(m_k9ImportView, KMdi::StandardAdd); + + m_menuEdit=new k9MenuEdit(this,0,m_k9Import->getNewDVD()->getRootMenu()->getCanvas()); + m_menuEdit->setIcon(SmallIcon("edit")); + acc=addToolWindow(m_menuEdit, KDockWidget::DockRight, getMainDockWidget(),20,i18n("Edit menu"),i18n("Edit Menu")); + m_ToolViews.append(acc); + + connect (m_k9Import,SIGNAL(titleSelected(k9Title*)),m_menuEdit,SLOT(titleSelected(k9Title*))); + connect (m_k9Import,SIGNAL(rootSelected(k9NewDVD*)),m_menuEdit,SLOT(rootSelected(k9NewDVD*))); + m_k9Import->setMenuEdit(m_menuEdit); + + m_newTitle=new k9NewTitle(this); + m_newTitle->setK9Import(m_k9Import); + m_newTitle->setIcon(SmallIcon("fileimport")); + acc=addToolWindow(m_newTitle, KDockWidget::DockBottom, getMainDockWidget(),20,i18n("Add title"),i18n("Add title")); + m_ToolViews.append(acc); + acc->show(); + + + m_chapterEdit =new k9ChapterEdit(this); + m_chapterEdit->setIcon(SmallIcon("title")); + acc=addToolWindow(m_chapterEdit, KDockWidget::DockBottom, getMainDockWidget(),20,i18n("Chapter properties"),i18n("Chapter properties")); + m_ToolViews.append(acc); + connect(m_k9Import,SIGNAL(aviFileSelected(k9AviFile*)),m_chapterEdit,SLOT(setAviFile(k9AviFile*))); + + + + // allow the view to change the statusbar and caption +/* + connect(m_k9Main, SIGNAL(changeStatusbar(const QString&,int )), + this, SLOT(changeStatusbar(const QString&,int))); + connect(m_k9Main, SIGNAL(changeCaption(const QString&)), + this, SLOT(changeCaption(const QString&))); +*/ + setAutoSaveSettings(); + KSimpleConfig settings("K9Copy"); + if (settings.hasGroup("dockImport")) + dockManager->readConfig((KConfig*)&settings,"dockImport"); + + m_k9Import->init(); + +} + + +k9Copy::~k9Copy() { + k9Config config; + if (config.getPrefDelTmpFiles()) + k9Tools::clearOutput(config.getPrefOutput()+"/dvd"); +} + +void k9Copy::initCodecs() { + k9VideoCodecs v(0,0); + v.reset(); + k9AudioCodecs a(0,0); + a.reset(); +} + +bool k9Copy::queryClose ( ) { + return true; +} + +void k9Copy::setupActions() { + + m_actions["open"]=KStdAction::open(this, SLOT(fileOpen()), actionCollection()); + m_actions["quit"]=KStdAction::quit(this, SLOT(quit()), actionCollection()); + m_actions["preferences"]=KStdAction::preferences(this,SLOT(preferences()),actionCollection()); + KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + + + setStandardToolBarMenuEnabled(TRUE); + createStandardStatusBarAction(); + + PlayTitleAction = new KAction(i18n("Play title"), 0, + this, SLOT(ActionPlayTitle()), + actionCollection(), "PlayTitle"); + m_actions["playtitle"]=PlayTitleAction; + + QImage img; + img.loadFromData( img_preview, sizeof( img_preview ), "PNG" ); + PlayTitleAction->setIconSet(QIconSet(img)); + + CopyAction = new KAction(i18n("Copy"), 0, + this, SLOT(ActionCopy()), + actionCollection(), "Copy"); + m_actions["copy"]=CopyAction; + CopyAction->setIcon("dvdcopy"); + + + mkMpeg2Action = new KAction(i18n("Extract MPEG2"),0, + this, SLOT(ActionMpeg2()), + actionCollection(),"MakeMPEG2"); + m_actions["mp2"]=mkMpeg2Action; + + mkMpeg2Action->setIcon("mpeg"); + + mkMP4Action = new KAction(i18n("Create MPEG-4"),0, + this, SLOT(ActionMP4()), + actionCollection(),"MakeMPEG4"); + m_actions["mp4"]=mkMP4Action; + + mkMP4Action->setIcon("mp4"); + + ejectAction = new KAction(i18n("Eject"),0, + this, SLOT(ActionEject()), + actionCollection() , "Eject"); + ejectAction->setIcon("player_eject"); + + m_actions["eject"]=ejectAction; + + + backupAction= new KRadioAction(i18n("DVD Backup"),0, + this, SLOT(ActionBackup()), + actionCollection(), "backup"); + backupAction->setExclusiveGroup("mode"); + m_actions["backup"]=backupAction; + + authorAction= new KRadioAction(i18n("DVD Author"),0, + this, SLOT(ActionAuthor()), + actionCollection(), "author"); + authorAction->setExclusiveGroup("mode"); + m_actions["author"]=authorAction; + + m_actions["create"]= new KAction(i18n("Create DVD"),0, + this, SLOT(ActionCreate()), + actionCollection(), "Create"); + m_actions["create"]->setIcon("author"); + + createGUI(0); + +} + +void k9Copy::setActions( bool enabled) { + if (m_k9MainView) { + m_actions["open"]->setEnabled(enabled); + m_actions["quit"]->setEnabled(enabled); + m_actions["preferences"]->setEnabled(enabled); + m_actions["playtitle"]->setEnabled(enabled); + m_actions["copy"]->setEnabled(enabled); + m_actions["mp4"]->setEnabled(enabled); + m_actions["mp2"]->setEnabled(enabled); + m_actions["eject"]->setEnabled(enabled); + m_mp2->setEnabled(enabled); + m_mp4->setEnabled(enabled); + m_factors->setEnabled(enabled); + m_lang->setEnabled(enabled); + m_options->setEnabled(enabled); + } else { + m_actions["create"]->setEnabled(enabled); + m_menuEdit->setEnabled(enabled); + m_newTitle->setEnabled(enabled); + m_chapterEdit->setEnabled(enabled); + m_k9Import->setEnabled(enabled); + } + + +} + +void k9Copy::optionsConfigureKeys() { + KKeyDialog::configure(actionCollection()); +} + +void k9Copy::optionsConfigureToolbars() { + // use the standard toolbar editor + saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); + KEditToolbar dlg(factory()); + connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(newToolbarConfig())); + dlg.exec(); +} + +void k9Copy::newToolbarConfig() { + // this slot is called when user clicks "Ok" or "Apply" in the toolbar editor. + // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.) + createGUI(0); + + applyMainWindowSettings(KGlobal::config(), autoSaveGroup()); +} + +void k9Copy::fileOpen() { + m_k9Main->Open(); + +} + + +void k9Copy::addMp4TitleOptions() { + m_mp4=new k9MP4Title(this); + m_ToolViews.append(addToolWindow(m_mp4,KDockWidget::DockBottom,getMainDockWidget(),10,i18n("MPEG4 Encoding options"),i18n("MPEG4 Encoding Options"))); + connect(m_k9Main,SIGNAL(changedTitle( k9DVDTitle* )),m_mp4,SLOT(titleChanged( k9DVDTitle* ))); + connect(m_k9Main,SIGNAL(SelectionChanged( k9DVD*,bool )),m_mp4,SLOT(selectionChanged( k9DVD*,bool ))); + +} + +void k9Copy::preferences() { + k9settings settings(this,i18n("Settings")); + settings.exec(); + k9Config config; + m_useXine=config.getUseMplayer(); + + if (m_k9MainView) { + m_k9Main->readSettings(); + m_mp2->close(); + deleteToolWindow(m_previewAcc); + m_ToolViews.removeRef(m_previewAcc); + + if (m_useXine) + m_mp2=new K9Mplayer(this); + else + m_mp2=new kViewMPEG2(); + m_previewAcc=addToolWindow(m_mp2,KDockWidget::DockRight,getMainDockWidget(),0,i18n("Preview"),i18n("Preview")); + m_ToolViews.append(m_previewAcc); + //kViewMPEG2 * v=(kViewMPEG2*) m_mp2; + connect(m_k9Main,SIGNAL(showPreview( k9DVD*, k9DVDTitle*,int )),m_mp2,SLOT(open( k9DVD*, k9DVDTitle*,int ))); + connect(m_k9Main,SIGNAL(stopPreview()),m_mp2,SLOT(bStopClick())); + + m_mp4->load(); + } +} + + +void k9Copy::ActionCopy() { + if (m_useXine) + ((K9Mplayer*)m_mp2)->bStopClick(); + else + ((kViewMPEG2*)m_mp2)->bStopClick(); + m_k9Main->Copy(); +} + +void k9Copy::ActionPlayTitle() { + m_previewAcc->show(); + m_k9Main->PreviewTitle(); + +} + +void k9Copy::ActionMP4() { + m_k9Main->CreateMP4(); +} + +void k9Copy::ActionMpeg2() { + m_k9Main->extractMPEG2(); +} + +void k9Copy::ActionEject() { + m_k9Main->eject(); +} + +void k9Copy::ActionBackup() { + createCopyWindows(); +} + +void k9Copy::ActionAuthor() { + createImportWindows(); +} + +void k9Copy::ActionCreate() { + m_k9Import->execute(); +} + +KMdiToolViewAccessor * k9Copy::setToolWindow(QWidget *_widget,KDockWidget::DockPosition _pos,const QString &tabToolTip,const QString &tabCaption) { + KMdiToolViewAccessor *acc=addToolWindow(_widget, _pos, getMainDockWidget(),0,tabToolTip,tabCaption); + m_ToolViews.append(acc); + return acc; +} + +void k9Copy::removeToolWindow(KMdiToolViewAccessor *toolWin) { + deleteToolWindow(toolWin); + m_ToolViews.removeRef(toolWin); +} + + +void k9Copy::changeStatusbar(const QString& text,int id) { + // display the text on the statusbar + statusBar()->changeItem(text,id); +} + +void k9Copy::changeCaption(const QString& text) { + // display the text on the caption + setCaption(text); +} + +void k9Copy::clone( QString _input,QString _output) { + show(); + m_k9Main->Clone( _input,_output); +} + +void k9Copy::setInput(QString _input) { + m_k9Main->setInput(_input); +} + +void k9Copy::setOutput(QString _output) { + m_k9Main->setOutput(_output); +} + + +void k9Copy::quit() { + close( true); +} + +void k9Copy::saveDock() { + KConfig config("K9Copy"); + if (m_k9MainView) { + dockManager->writeConfig(&config,"dock"); + m_k9Main->saveSettings(); + } else if (m_k9ImportView) { + dockManager->writeConfig(&config,"dockImport"); + } +} + +void k9Copy::closeEvent( QCloseEvent* ce ) { + saveDock(); + ce->accept(); + kapp->quit(); +} + +KDockWidget* k9Copy::getVisibleDock() { + if (m_k9MainView) { + KDockWidget *w= manager()->findWidgetParentDock(m_options); + if (w->isVisible()) + return w; + + w= manager()->findWidgetParentDock(m_lang); + if (w->isVisible()) + return w; + + w= manager()->findWidgetParentDock(m_mp2); + if (w->isVisible()) + return w; + } else { + KDockWidget *w= manager()->findWidgetParentDock(m_menuEdit); + if (w->isVisible()) + return w; + } + + return NULL; +} + +void k9Copy::setEnabledCreateDVD(bool _state) { + m_actions["create"]->setEnabled(_state); +} + diff --git a/src/k9copy.desktop b/src/k9copy.desktop new file mode 100644 index 0000000..d772235 --- /dev/null +++ b/src/k9copy.desktop @@ -0,0 +1,17 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Application +Name=k9copy +Exec=k9copy -caption "%c" %i %m %u +Comment=DVD9 to DVD5 backup tool +Comment[fr]=Backup de DVD9 en DVD5 +Comment[tr]=DVD9 DVD5 yedekleme aracı +GenericName=Video DVD Backup +GenericName[fr]=Backup de DVD Video +GenericName[tr]=DVD Vidyo Yedekleme Aracı +MimeTypes= +Terminal=false +Icon=k9copy +X-DocPath=k9copy/index.html +Categories=Qt;KDE;AudioVideo;DiscBurning; +X-KDE-StartupNotify=true \ No newline at end of file diff --git a/src/k9copy.h b/src/k9copy.h new file mode 100644 index 0000000..2fb43f4 --- /dev/null +++ b/src/k9copy.h @@ -0,0 +1,121 @@ +// +// C++ Interface: k9copy +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2005 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#ifndef _K9COPY_H_ +#define _K9COPY_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "k9common.h" +#include "k9cddrive.h" +#include +#include + +enum eStatusBarId {sbMessage=0,sbFactor=1}; + +class k9Import; +class k9Main; +class kViewMPEG2; +class k9PlaybackOptions; +class k9LangSelect; +class k9MP4Title; +class k9TitleFactor; +class k9MenuEdit; +class k9NewTitle; +class k9ChapterEdit; +class k9Copy : public KMdiMainFrm { + Q_OBJECT +public: + /** + * Default Constructor + */ + k9Copy(); + + void clone(QString _input,QString _output); + void setInput(QString _input); + void setOutput(QString _output); + + KDockWidget* getVisibleDock(); + KMdiToolViewAccessor * setToolWindow(QWidget *_widget,KDockWidget::DockPosition _pos,const QString &tabToolTip,const QString &tabCaption) ; + void removeToolWindow(KMdiToolViewAccessor *toolWin); + + /** + * Default Destructor + */ + virtual ~k9Copy(); + +protected: + bool queryClose( ); + void closeEvent( QCloseEvent* ce ); + +private slots: + void ActionCopy(); + void ActionMP4(); + void ActionEject(); + void ActionMpeg2(); + void ActionBackup(); + void ActionAuthor(); + void ActionPlayTitle(); + void ActionCreate(); + void changeStatusbar(const QString& text,int id); + void changeCaption(const QString& text); + void optionsConfigureKeys(); + void optionsConfigureToolbars(); + void newToolbarConfig(); + void addMp4TitleOptions(); +public slots: + void fileOpen(); + void preferences(); + void quit(); + void setActions(bool enabled); + void setEnabledCreateDVD(bool _state); +private: + void setupAccel(); + void setupActions(); + void initCodecs(); + void createImportWindows(); + void createCopyWindows(); + void removeToolWindows(); + void saveDock(); + KAction *CopyAction; + KAction *PlayTitleAction; + KAction *mkMP4Action; + KAction *mkMpeg2Action; + KAction *ejectAction; + KRadioAction *backupAction; + KRadioAction *authorAction; +private: + k9Main *m_k9Main; + KMdiChildView *m_k9MainView,*m_k9ImportView; + KMdiToolViewAccessor *m_previewAcc; + k9PlaybackOptions *m_options; + k9TitleFactor *m_factors; + k9LangSelect *m_lang; + k9MP4Title *m_mp4; + QWidget *m_mp2; + k9MenuEdit *m_menuEdit; + k9NewTitle *m_newTitle; + k9ChapterEdit *m_chapterEdit; + k9Import *m_k9Import; + bool m_useXine; + bool m_useDvdAuthor; + QMap m_actions; + QPtrList m_ToolViews; + k9CdDrives m_drives; +}; + + + +#endif diff --git a/src/k9copy.png b/src/k9copy.png new file mode 100755 index 0000000..6ed8588 Binary files /dev/null and b/src/k9copy.png differ diff --git a/src/k9copy_open.desktop b/src/k9copy_open.desktop new file mode 100644 index 0000000..92e7f3d --- /dev/null +++ b/src/k9copy_open.desktop @@ -0,0 +1,11 @@ +[Desktop Action Play] +Exec=k9copy --input %u +Icon=k9copy.png +Name=Copy with k9copy +Name[fr]=Copier avec k9copy +Name[de]=Kopieren mit k9copy +Name[tr]=k9copy ile kopyala + +[Desktop Entry] +Actions=Play; +ServiceTypes=media/dvdvideo diff --git a/src/k9copyui.rc b/src/k9copyui.rc new file mode 100755 index 0000000..7a31f00 --- /dev/null +++ b/src/k9copyui.rc @@ -0,0 +1,38 @@ + + + + &File + + + + + + A&ctions + + + + + + + + + + + + + + + Actions ToolBar + + + + + + + + + + + + + diff --git a/src/k9glwidget.cpp b/src/k9glwidget.cpp new file mode 100644 index 0000000..444d823 --- /dev/null +++ b/src/k9glwidget.cpp @@ -0,0 +1,185 @@ +// +// C++ Implementation: k9glwidget +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "k9glwidget.h" + +#ifdef HAVE_OPENGL +#include +#include +#include +#include +#include "ac.h" +#include + +k9GLWidget::k9GLWidget(QWidget *parent, const char *name):QGLWidget(parent, name) { + XMapRaised(x11Display(),winId()); + + m_buffer=NULL; + m_height=0; + m_width=0; + library=new QLibrary("GL.so.1"); + + glClear = (glClear_t) library->resolve( "glClear" ); + glRasterPos2i= (glRasterPos2i_t)library->resolve("glRasterPos2i"); + glFlush = (glFlush_t)library->resolve("glFlush"); + glClearColor =(glClearColor_t)library->resolve("glClearColor"); + glShadeModel =(glShadeModel_t)library->resolve("glShadeModel"); + glPixelStorei =(glPixelStorei_t)library->resolve("glPixelStorei"); + glViewport =(glViewport_t)library->resolve("glViewport"); + glMatrixMode =(glMatrixMode_t)library->resolve("glMatrixMode"); + glLoadIdentity =(glLoadIdentity_t)library->resolve("glLoadIdentity"); + glOrtho =(glOrtho_t)library->resolve("glOrtho"); + glPixelZoom=(glPixelZoom_t)library->resolve("glPixelZoom"); + glDrawPixels=(glDrawPixels_t)library->resolve("glDrawPixels"); + glDisable=(glDisable_t)library->resolve("glDisable"); + glPixelTransferi=(glPixelTransferi_t)library->resolve("glPixelTransferi"); + glGetString=(glGetString_t)library->resolve("glGetString"); +} + +k9GLWidget* k9GLWidget::createWidget(QWidget *parent , const char *name ) { + //XInitThreads(); + return new k9GLWidget(parent,name); +} + +k9GLWidget::~k9GLWidget() { + if (m_buffer !=NULL) + free(m_buffer); + delete library; +} + +void k9GLWidget::paintGL() { + draw(); +} + +void k9GLWidget::setImage(uchar *_buffer,int _width,int _height,int _len) { + if (qApp==NULL) + return; + if (qApp->tryLock() ) { + uchar *buffer=_buffer; + m_width=_width; + m_height=_height; + m_mutex.lock(); + if (m_buffer !=NULL) + free(m_buffer); + m_buffer=buffer; + //m_stack.push(buffer); + m_mutex.unlock(); + update(); + if (qApp !=NULL) + qApp->unlock(); + } else { + free(_buffer); + } +} + +void k9GLWidget::draw() { + XLockDisplay(x11Display()); + // uchar *buffer=NULL; + if (m_mutex.tryLock()) { + /* if (!m_stack.isEmpty()) + buffer=m_stack.pop(); + if (buffer !=NULL) { + if (m_buffer !=NULL) + free(m_buffer); + m_buffer=buffer; + } +*/ + if (m_buffer!=NULL) { + int h=height()-2; + int w=width()-2; + GLfloat wratio=(GLfloat)w/(GLfloat)m_width; + GLfloat hratio=(GLfloat)h/(GLfloat)m_height; + GLfloat ratio= wratio < hratio ? wratio:hratio; + + + glClear(GL_COLOR_BUFFER_BIT); + int top = h-(int) (h -m_height*ratio) /2; + int left = (int) (w -m_width*ratio) /2; + + glRasterPos2i (left,top); + glPixelZoom (ratio, -ratio); + + glDrawPixels( m_width, m_height, GL_RGBA, GL_UNSIGNED_BYTE, m_buffer ); + swapBuffers(); + } else { + makeCurrent(); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + } + swapBuffers(); + m_mutex.unlock(); + } + XUnlockDisplay(x11Display()); +} + + +void k9GLWidget::initializeGL() { + setAutoBufferSwap(FALSE); + glClearColor (0.0, 0.0, 0.0, 0.0); + glShadeModel(GL_FLAT); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + glDisable(GL_ALPHA_TEST); + glDisable(GL_BLEND); + glDisable(GL_DEPTH_TEST); + glDisable(GL_DITHER); + glDisable(GL_FOG); + glDisable(GL_LIGHTING); + glDisable(GL_LOGIC_OP); + glDisable(GL_STENCIL_TEST); + glDisable(GL_TEXTURE_1D); + glDisable(GL_TEXTURE_2D); + + glPixelTransferi(GL_MAP_COLOR, GL_FALSE); + glPixelTransferi(GL_RED_SCALE, 1); + glPixelTransferi(GL_RED_BIAS, 0); + glPixelTransferi(GL_GREEN_SCALE, 1); + glPixelTransferi(GL_GREEN_BIAS, 0); + glPixelTransferi(GL_BLUE_SCALE, 1); + glPixelTransferi(GL_BLUE_BIAS, 0); + glPixelTransferi(GL_ALPHA_SCALE, 1); + glPixelTransferi(GL_ALPHA_BIAS, 0); + + /* + * Disable extensions that could slow down glDrawPixels. + */ + const GLubyte* extString = glGetString(GL_EXTENSIONS); + + if (extString != NULL) { + if (strstr((char*) extString, "GL_EXT_convolution") != NULL) { + glDisable(GL_CONVOLUTION_1D_EXT); + glDisable(GL_CONVOLUTION_2D_EXT); + glDisable(GL_SEPARABLE_2D_EXT); + } + if (strstr((char*) extString, "GL_EXT_histogram") != NULL) { + glDisable(GL_HISTOGRAM_EXT); + glDisable(GL_MINMAX_EXT); + } + if (strstr((char*) extString, "GL_EXT_texture3D") != NULL) { + glDisable(GL_TEXTURE_3D_EXT); + } + } + +} + +void k9GLWidget::resizeGL(int w, int h) { + glViewport (0, 0, w, h); + glMatrixMode (GL_PROJECTION); + glLoadIdentity(); + glOrtho(0, w,0,h,-1,1); + // glMatrixMode (GL_MODELVIEW); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); +} + + +#include "k9glwidget.moc" + +#endif diff --git a/src/k9glwidget.h b/src/k9glwidget.h new file mode 100644 index 0000000..c26237c --- /dev/null +++ b/src/k9glwidget.h @@ -0,0 +1,99 @@ +// +// C++ Interface: k9glwidget +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9GLWIDGET_H +#define K9GLWIDGET_H + +#include "k9common.h" + +#ifdef HAVE_OPENGL + +#include +#include +#include +#include + +typedef void (*glClear_t) (GLbitfield); +typedef void (*glRasterPos2i_t) ( GLint , GLint ); +typedef void (*glPixelZoom_t) ( GLfloat , GLfloat ); +typedef void (*glDrawPixels_t) ( GLsizei , GLsizei, GLenum , GLenum ,const GLvoid * ); +typedef void (* glFlush_t) ( void ); +typedef void (*glClearColor_t)( GLclampf , GLclampf , GLclampf , GLclampf ); +typedef void (*glShadeModel_t) ( GLenum ); +typedef void (*glPixelStorei_t)( GLenum , GLint ); +typedef void (*glViewport_t) ( GLint, GLint,GLsizei , GLsizei); +typedef void (*glMatrixMode_t)( GLenum ); +typedef void (*glLoadIdentity_t) (void); +typedef void (*glOrtho_t)( GLdouble , GLdouble ,GLdouble , GLdouble, GLdouble , GLdouble); +typedef void (*glDisable_t) ( GLenum ); +typedef void (*glPixelTransferi_t) ( GLenum , GLint ); +typedef const GLubyte * (*glGetString_t)( GLenum ); +/** + @author Jean-Michel PETIT +*/ +class k9GLWidget : public QGLWidget +{ +Q_OBJECT +public: + void setImage(uchar *_buffer,int _width,int _height,int _len); + static k9GLWidget * createWidget(QWidget *parent = 0, const char *name = 0); + ~k9GLWidget(); +protected: + void draw(); + void resizeGL(int width, int height); + void initializeGL(); + void paintGL(); +private: + k9GLWidget(QWidget *parent = 0, const char *name = 0); + QImage m_image; + QMutex m_mutex; + int m_width,m_height; + uchar *m_buffer; + QLibrary * library; + glClear_t glClear; + glRasterPos2i_t glRasterPos2i; + + glPixelZoom_t glPixelZoom; + glDrawPixels_t glDrawPixels; + glFlush_t glFlush; + glClearColor_t glClearColor; + glShadeModel_t glShadeModel; + glPixelStorei_t glPixelStorei; + glViewport_t glViewport; + glMatrixMode_t glMatrixMode; + glLoadIdentity_t glLoadIdentity; + glOrtho_t glOrtho; + glDisable_t glDisable; + glPixelTransferi_t glPixelTransferi; + glGetString_t glGetString; +}; + +#else + +#include +#include + +class k9GLWidget:public QWidget +{ +public: + static k9GLWidget * createWidget(QWidget *parent = 0, const char *name = 0) { + return new k9GLWidget(parent,name); + } + void setImage(uchar *_buffer,int _width,int _height,int _len){}; +private: + k9GLWidget(QWidget *parent = 0, const char *name = 0){}; + +}; + + +#endif +#endif + diff --git a/src/k9langselect.cpp b/src/k9langselect.cpp new file mode 100644 index 0000000..997d514 --- /dev/null +++ b/src/k9langselect.cpp @@ -0,0 +1,178 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9langselect.h" +#include "k9dvd.h" +#include "k9dvdtitle.h" +#include "k9main.h" +#include +k9LangSelect::k9LangSelect(k9Main *mainWindow,QWidget* parent, const char* name, WFlags fl) +: langSelect(parent,name,fl) +{ + setMain( mainWindow); + m_main->setLangSelect( this); +} + +k9LangSelect::~k9LangSelect() +{ +} + +/*$SPECIALIZATION$*/ + +void ckLvLangItem::stateChange(bool state) { + if (mainDlg->getupdating()) + return; + mainDlg->checkLang(language,streamType,state); + mainDlg->updateSelection(); +// k9DVD *d = mainDlg->dvd; + mainDlg->setDVDSize(); + mainDlg->updateFactor(); + //(mainDlg->factor)->setValue((int) (d->getfactor(mainDlg->withMenus(),true )*100)-100 ); +} + +void k9LangSelect::setMain(k9Main* _value) { + m_main = _value; + m_dvd=m_main->dvd; +} + +void k9LangSelect::fillLvLanguages() { + lvLanguages->clear(); + langAudItems.clear(); + langSubItems.clear(); + QStringList slAudLang,slSubLang; + if (m_dvd->getopened()) { + k9DVDSubtitle *l_sub; + k9DVDAudioStream *l_auds; + QObjectList *items=m_main->getItems(); + for (uint i=0;icount();i++) { + k9DVDListItem *litem=(k9DVDListItem*)items->at(i); + switch (litem->streamType) { + case SUB: { + l_sub=litem->subtitle; + if (slSubLang.contains(l_sub->getlanguage())==0) + slSubLang.append(l_sub->getlanguage()); + break; + } + case AUD: { + l_auds=litem->audioStream; + if (slAudLang.contains(l_auds->getlanguage())==0) + slAudLang.append(l_auds->getlanguage()); + break; + } + default: + break; + } + } + } + QListViewItem *audioRoot = new QListViewItem(lvLanguages); + audioRoot->setOpen( TRUE ); + audioRoot->setText(0, i18n("Audio")); + for ( QStringList::Iterator it = slAudLang.begin(); it != slAudLang.end(); ++it ) { + ckLvLangItem *lvitem=new ckLvLangItem(audioRoot,m_main); + lvitem->setText(0,*it); + lvitem->streamType=AUD; + lvitem->language=*it; + langAudItems.append(lvitem); + } + + QListViewItem *subRoot = new QListViewItem(lvLanguages); + subRoot->setOpen( TRUE ); + subRoot->setText(0, i18n("Subtitles")); + for ( QStringList::Iterator it = slSubLang.begin(); it != slSubLang.end(); ++it ) { + ckLvLangItem *lvitem=new ckLvLangItem(subRoot,m_main); + lvitem->setText(0,*it); + lvitem->streamType=SUB; + lvitem->language=*it; + langSubItems.append(lvitem); + } + +} + + + +void k9LangSelect::update() { + for (uint i=0;ilanguage); + for (uint i=0;ilanguage); +} + + +void k9LangSelect::updateLvLang(const eStreamType streamType,const QString & lang ) { + uint Total=0,Selected=0; + QString lg; + QObjectList *items = m_main->getItems(); + for (uint i=0;icount();i++) { + k9DVDListItem *litem=(k9DVDListItem*)items->at(i); + if (litem->streamType==streamType ) { + switch (streamType) { + case SUB : + lg= litem->subtitle->getlanguage(); + if (lg==lang) { + Total++; + if (litem->listItem->isOn()) + Selected ++; + } + break; + case AUD : + lg=litem->audioStream->getlanguage(); + if (lg==lang) { + Total++; + if (litem->listItem->isOn()) + Selected++; + } + break; + default: + break; + } + } + } + if (streamType==AUD) { + for (ckLvLangItem *langItem = langAudItems.first(); langItem; langItem = langAudItems.next() ) { + if (langItem->language ==lang) { + if (Selected==Total) { + langItem->setOn(true); + } else + langItem->setOn(false); + } + } + } + if (streamType==SUB) { + for (ckLvLangItem *langItem = langSubItems.first(); langItem; langItem = langSubItems.next() ) { + if (langItem->language ==lang) { + if (Selected==Total) { + langItem->setOn(true); + } else + langItem->setOn(false); + } + } + } + +} + +void k9LangSelect::selectAll( bool _state) { + for (ckLvLangItem *langItem = langAudItems.first(); langItem; langItem = langAudItems.next() ) { + langItem->setOn(_state); + } + for (ckLvLangItem *langItem = langSubItems.first(); langItem; langItem = langSubItems.next() ) { + langItem->setOn(_state); + } +} + +void k9LangSelect::clear() { + langAudItems.clear(); + langSubItems.clear(); + lvLanguages->clear(); +} +#include "k9langselect.moc" + diff --git a/src/k9langselect.h b/src/k9langselect.h new file mode 100644 index 0000000..e54ea5c --- /dev/null +++ b/src/k9langselect.h @@ -0,0 +1,73 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9LANGSELECT_H +#define K9LANGSELECT_H + +#include "k9common.h" +#include "langselectw.h" + +#include "k9main.h" +#include + +class k9Main; +class k9DVD; + +class ckLvLangItem : public QCheckListItem { +public: + ckLvLangItem( QListViewItem *parent,k9Main *dlg) + : QCheckListItem( parent,"",QCheckListItem::CheckBox) { + mainDlg=dlg; + streamType=NONE; + } + eStreamType streamType; + k9Main *mainDlg; + QString language; +protected: + void stateChange(bool state); +}; + + + +class k9LangSelect : public langSelect +{ + Q_OBJECT + +public: + k9LangSelect(k9Main *mainWindow,QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9LangSelect(); + + void setMain(k9Main* _value); + void fillLvLanguages(); + void update(); + void clear(); + void selectAll(bool _state); + /*$PUBLIC_FUNCTIONS$*/ + +public slots: + /*$PUBLIC_SLOTS$*/ + +protected: + /*$PROTECTED_FUNCTIONS$*/ + k9Main * m_main; + k9DVD *m_dvd; + QPtrList langAudItems; + QPtrList langSubItems; + void updateLvLang(const eStreamType streamType,const QString & lang ); + +protected slots: + /*$PROTECTED_SLOTS$*/ + +}; + +#endif + diff --git a/src/k9main.cpp b/src/k9main.cpp new file mode 100644 index 0000000..0daf516 --- /dev/null +++ b/src/k9main.cpp @@ -0,0 +1,1532 @@ +/*************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#include "k9main.h" +#include "k9common.h" +#include "k9dvdauthor.h" +#include "k9burndvd.h" +#include "k9dvd.h" +#include "k9dvdtitle.h" +#include "k9dvdtitleset.h" +#include "k9dvdbackup.h" +#include "k9mp4enc.h" +#include "k9settings.h" +#include "k9langselect.h" +#include "k9config.h" +#include "k9updatefactor.h" +#include "k9haldevice.h" +#include "k9titleencopt.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +k9DVDListItem::k9DVDListItem(QObject *DVD,ckLvItem *List,eStreamType type) +{ + switch(type) + { + case AUD : + audioStream=(k9DVDAudioStream*)DVD; + subtitle=NULL; + title=NULL; + break; + case SUB : + subtitle = (k9DVDSubtitle*)DVD; + audioStream=NULL; + title=NULL; + break; + case VID : + subtitle=NULL; + audioStream=NULL; + title =(k9DVDTitle*)DVD; + break; + default : + break; + } + listItem= List; + streamType=type; +} + +k9Main::k9Main(QWidget* parent, const char* name, k9CdDrives *_drives) + : MainDlg(parent,name),pxVideo((const char **) img_video), pxSound((const char **) img_sound), + pxText((const char **) img_text) +{ + drives=_drives; + m_parent=(k9Copy*)parent; + QImage img; + img.loadFromData( img_chapter, sizeof( img_chapter ), "PNG" ); + pxChapter.convertFromImage( img); + /* m_factory = KLibLoader::self()->factory("libk9copy"); + if (m_factory) { + dvd=static_cast(m_factory->create(this,"dvd", "k9DVD")); + } + */ + + dvd=new k9DVD(this); + + updating=false; + + items.setAutoDelete(true); + listView1->setDefaultRenameAction(QListView::Accept); + // KStandardDirs kd; + m_prefOutput=locateLocal("tmp","k9copy/",true); //kd.findResource("tmp",""); + connect(drives,SIGNAL(deviceAdded( k9CdDrive*)),this,SLOT(deviceAdded( k9CdDrive* ))); + connect(drives,SIGNAL(deviceRemoved( k9CdDrive*)),this,SLOT(deviceRemoved( k9CdDrive* ))); + + readSettings(); + bInputOpen->setPixmap(SmallIcon("fileopen")); + bInputOpenDir->setPixmap(SmallIcon("folder_open")); + emit SelectionChanged(NULL,true); + m_update=new k9UpdateFactor(this,""); + connect(m_update,SIGNAL(updateFactor_internal()),this,SLOT(updateFactor_internal())); +} + + +k9DVDListItem *k9Main::addListItem(QObject *DVD,ckLvItem *List,eStreamType type) +{ + k9DVDListItem *litem; + litem=new k9DVDListItem(DVD,List,type); + items.append(litem); + return litem; +} + +int LvItem::rtti() const +{ + return(1000); +} + + +int ckLvItem::rtti() const +{ + return(1001); +} + +int ckLvItem::compare ( QListViewItem * i, int col, bool ascending ) const +{ + if (i->rtti() !=1001) + return 1; + ckLvItem *litem = (ckLvItem*)i; + k9DVDTitleset *titleset1,*titleset2; + ckLvItem *l; + uint id,id2; + if (col==0) + { + switch(this->objectType) + { + case TITLESET: + titleset1=(k9DVDTitleset*)obj; + titleset2=(k9DVDTitleset*)litem->obj; + return titleset1->getnum() -titleset2->getnum(); + case STREAM: + l=(ckLvItem*)this; + id=streamType*100; + id2=litem->streamType*100; + + if (streamType==AUD) + { + id+=((k9DVDAudioStream*)l->stream)->getID(); + } + if (streamType==SUB) + { + id+=((k9DVDSubtitle*)l->stream)->getID().first(); + } + + if (litem->streamType==AUD) + { + id2+=((k9DVDAudioStream*)litem->stream)->getID(); + } + if (litem->streamType==SUB) + { + id2+=((k9DVDSubtitle*)litem->stream)->getID().first(); + } + + + return k9Main::compare(id,id2); + break; + case CHAPTER: + l=(ckLvItem*)this; + k9DVDChapter *ch1=(k9DVDChapter*)l->obj; + k9DVDChapter *ch2=(k9DVDChapter*)litem->obj; + return k9Main::compare(ch1->getnum()+ch1->getTitle()->getId()*1000 ,ch2->getnum()+ch2->getTitle()->getId()*1000); + break; + } + } + + if (col ==1) + { + switch (this->objectType) + { + case TITLESET: + titleset1=(k9DVDTitleset*)obj; + titleset2=(k9DVDTitleset*)litem->obj; + return k9Main::compare(titleset1->getsize(),titleset2->getsize()); + break; + case STREAM: + double size1,size2; + l =(ckLvItem*)this; + size1=l->getstreamSize(); + size2=litem->getstreamSize(); + return k9Main::compare(size1,size2); + break; + case CHAPTER: + l=(ckLvItem*)this; + k9DVDChapter *ch1=(k9DVDChapter*)l->obj; + k9DVDChapter *ch2=(k9DVDChapter*)litem->obj; + return k9Main::compare(ch1->getsectors(),ch2->getsectors()); + } + } + return QCheckListItem::compare(i,col,ascending); +} + +double ckLvItem::getstreamSize() +{ + double size; + k9DVDTitle *title; + switch (streamType) + { + case SUB: + { + k9DVDSubtitle *sub=(k9DVDSubtitle*)stream; + size=sub->getsize_mb(); + break; + } + case AUD: + { + k9DVDAudioStream *aud=(k9DVDAudioStream*)stream; + size=aud->getsize_mb(); + break; + } + case VID: + { + title=(k9DVDTitle*)obj; + size=title->gettotalvideosize_mb(); + break; + } + default: + size=0; + break; + } + return size; +} + + +int LvItem::compare ( QListViewItem * i, int col, bool ascending ) const +{ + if(i->rtti()==1001) + return -1; + LvItem *litem = (LvItem*)i; + k9DVDTitle *title1,*title2; + if (col ==1 && objectType==TITLE) + { + title1=(k9DVDTitle*)obj; + title2=(k9DVDTitle*)litem->obj; + return k9Main::compare(title1->gettotalsize_mb(),title2->gettotalsize_mb()); + } + if (col==0 && objectType==TITLE) + { + title1=(k9DVDTitle*)obj; + title2=(k9DVDTitle*)litem->obj; + return k9Main::compare(title1->getpgc(),title2->getpgc()); + } + + return QListViewItem::compare(i,col,ascending); +} + +void ckLvItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) +{ + if (column==1) + { + p->eraseRect(0,0,width,height()); + QFont f(p->font()); + + switch (objectType) + { + case TITLESET: + { + k9DVDTitleset *titleset=(k9DVDTitleset*)obj; + f.setBold(true); + p->setFont(f); + p->drawText(0,0,width,height(),Qt::AlignRight | Qt::AlignVCenter ,titleset->getsize_mb()+" " +i18n("MB")); + break; + } + case STREAM: + { + if ( ! mainDlg->getquickScan()) + { + double size=getstreamSize(); + QString c; + c.sprintf("%.2f ",size); + p->drawText(0,0,width,height(),Qt::AlignRight | Qt::AlignVCenter ,c+i18n("MB")); + } + break; + } + case CHAPTER : + { + k9DVDChapter *chapter=(k9DVDChapter*) obj; + double size=(double)chapter->getsectors()/512; + QString c; + c.sprintf("%.2f ",size); + p->drawText(0,0,width,height(),Qt::AlignRight | Qt::AlignVCenter ,c+i18n("MB")); + } + break; + default: + QCheckListItem::paintCell(p,cg,column,width,align); + } + } + else + QCheckListItem::paintCell(p,cg,column,width,align); + +} + +void LvItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) +{ + if (column==1 && objectType==TITLE) + { + p->eraseRect(0,0,width,height()); + k9DVDTitle * title=(k9DVDTitle*)obj; + QString c; + c.sprintf("%.2f ",title->gettotalsize_mb()); + p->drawText(0,0,width,height(),Qt::AlignRight | Qt::AlignVCenter ,c+i18n("MB")); + } + else + QListViewItem::paintCell(p,cg,column,width,align); +} + +void ckLvItem::stateChange(bool state) +{ + if (mainDlg !=NULL) + { + if (mainDlg->getupdating()) + return; + switch (objectType) + { + case ROOT : + mainDlg->checkAll(state); + break; + case TITLESET: + mainDlg->checkTS(state,this); + break; + default : + mainDlg->checkTitle(state,this); + break; + } + // k9DVD *d = mainDlg->dvd; + mainDlg->setDVDSize(); + mainDlg->updateFactor(); + //(mainDlg->factor)->setValue((int) (d->getfactor(mainDlg->withMenus(),true )*100)-100 ); + } +} + + +bool k9Main::getupdating() +{ + return updating; +} + + +void k9Main::Copy() +{ + QString c,filename; + if (!dvd->getopened()) + { + KMessageBox::error( this, i18n("DVD is not opened"), i18n("DVD Copy")); + return; + } + setDVDSize(); + updateSelection(); + + QString outputDir=m_prefOutput; + bool burn=false; + + if (cbOutputDev->currentItem() ==0) + { + filename=KFileDialog::getSaveFileName (QDir::homeDirPath(),"*.iso", 0,i18n("Save image to disk")); + if (filename =="") + return; + } else if (cbOutputDev->currentItem()==1) { + outputDir= KFileDialog::getExistingDirectory(QDir::homeDirPath()); + if (outputDir=="") + return; + } + + if (getFreeSpace( m_prefOutput) < m_prefSize) + { + if (KMessageBox::warningContinueCancel (this, i18n("Insufficient disk space on %1\n%2 mb expected.").arg(m_prefOutput).arg(m_prefSize),i18n("DVD Copy"))==KMessageBox::Cancel) + return; + } + stopPreview(); + changeStatusbar( i18n("Backup in progress"),sbMessage); + if (!m_useDvdAuthor || withMenus()) + { + //copy with k9DVDBackup + //k9DVDBackup *backup = static_cast(m_factory->create(dvd,"backup", "k9DVDBackup")); + m_playbackOptions->setSequence(); // JMP : temporaire + + k9DVDBackup *backup=new k9DVDBackup(dvd,"backup"); + + setProgressWindow(backup->getDialog()); + backup->setOutput(outputDir); + backup->setDevice(dvd->getDevice()); + backup->setWithMenus( withMenus()); + backup->execute(); + burn=backup->getErrMsg()==""; + delete backup; + removeProgressWindow(); + } + else + { + //k9DVDAuthor *b=static_cast(m_factory->create(dvd,"dvdauthor", "k9DVDAuthor")); + + k9DVDAuthor *b=new k9DVDAuthor(dvd,"dvdauthor"); + setProgressWindow( b->getDialog()); + m_playbackOptions->setSequence(); + b->setworkDir(outputDir); + b->author(); + if (!b->getError()) + burn=true; + removeProgressWindow(); + + delete b; + } + + if (burn && cbOutputDev->currentItem()!=1) + { + changeStatusbar(i18n("Burning DVD"),sbMessage); + + k9BurnDVD b; + + setProgressWindow( b.getDialog()); + b.setworkDir(m_prefOutput); + b.setUseK3b(m_prefK3b); + b.setAutoBurn(m_prefAutoBurn); + b.setvolId(dvd->getDVDTitle()); + b.setSpeed( cbBurnSpeed->currentText()); + if (cbOutputDev->currentItem() >1) + { + k9CdDrive * drive=(k9CdDrive*)recorderList.at(cbOutputDev->currentItem()-2); + b.setburnDevice(drive->device); + closeDVD(); + if (dvd->getDevice()== drive->device) + b.setAutoBurn(false); + } + else + b.makeIso(filename); + b.burn(); + removeProgressWindow(); + } + if(dvd->getopened()) + changeStatusbar(i18n("Ready"),sbMessage); + +} + +void k9Main::setProgressWindow(QWidget *_widget) { + m_toolView=m_parent->setToolWindow(_widget,KDockWidget::DockRight,i18n("processing"),i18n("processing")); + m_dockWidget = m_parent->getVisibleDock(); + m_parent->setActions( false); + m_toolView->show(); + this->setEnabled(false); + +} + +void k9Main::removeProgressWindow() { + m_parent->setActions(true); + + m_parent->removeToolWindow( m_toolView); + this->setEnabled(true); + if (m_dockWidget!=NULL) + m_dockWidget->changeHideShowState(); +} + +void k9Main::eject() +{ + closeDVD(); + drives->eject( getDevice(cbInputDev)); +} + + + +QString k9Main::getDevice(QComboBox *_combo) +{ + int index=-1; + for (int i=0; i<_combo->count();i++) + { + QString t =_combo->text(i); + if (_combo->text(i) == _combo->currentText()) + index=i; + } + QString res=""; + if ((index==-1) || (_combo->currentText() ==i18n("ISO Image"))) + { + res=_combo->currentText(); +#if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0) + + KURL url=KURL::fromPathOrURL(res); + //KIO::mount(true,0,res,"",true); + KIO::UDSEntry entry; + //first call to mount the device + KIO::NetAccess::stat(KURL::fromPathOrURL(res+"/."),entry,0); + if (KIO::NetAccess::stat(url,entry,0) ) + { + KIO::UDSEntry::iterator it; + for ( it = entry.begin(); it != entry.end(); ++it ) + { + if ( (*it).m_uds== KIO::UDS_LOCAL_PATH) { + res=(*it).m_str; + } + } + } +#endif + + } + else + { + k9CdDrive * drive=(k9CdDrive*)driveList.at(index); + res=drive->device; + } + return res; +} + +void k9Main::Open() +{ + int i; + k9DVDTitle * l_track; + QString t; + QTime h; + connect(listView1,SIGNAL(itemRenamed(QListViewItem*,int)),this,SLOT(itemRenamed(QListViewItem *,int))); + connect(listView1,SIGNAL(expanded( QListViewItem*)),this,SLOT(expanded( QListViewItem* ))); + connect(listView1,SIGNAL(collapsed( QListViewItem*)),this,SLOT(collapsed( QListViewItem* ))); + + closeDVD(); + QString sDevice=getDevice(cbInputDev); + + QString sVolName=""; + //if no dvd label, try to get it from hal + for (k9CdDrive *drive=driveList.first();drive;drive=driveList.next()) { + #ifdef HAVE_HAL + if (drive->getDevice() != NULL) { + if (drive->getDevice()->mountPoint()==sDevice) { + sVolName=drive->getDevice()->getVolumeName(); + sDevice=drive->device; + break; + } + } +#endif + } + + dvd->scandvd(sDevice,m_quickScan); + if (dvd->geterror()) + { + KMessageBox::error( this, dvd->geterrMsg(), i18n("Open DVD")); + return; + } + if (dvd->getDVDTitle()==i18n("unknown") && sVolName!="") { + dvd->setDVDTitle( sVolName); + } + + listView1->clear(); + items.clear(); + tsItems.clear(); + chItems.clear(); + + root = new ckLvItem (listView1,this,ROOT ); + root->setOpen( TRUE ); + + root->setText(0, dvd->getDVDTitle()); + root->setRenameEnabled(0,true); + root->obj=NULL; + root->streamType=NONE; + root->setPixmap(0,SmallIcon("dvd_unmount")); + + for (i=0;igettitlesetCount();i++) + { + ckLvItem *tsItem = new ckLvItem(root,this,TITLESET); + tsItem->setOpen(TRUE); + QString c; + c=i18n("Titleset %1").arg(i+1); + tsItem->setText(0,c); + tsItem->setText(1," "+dvd->gettitleset(i)->getsize_mb() +" " +i18n("MB")); + tsItem->obj=dvd->gettitleset(i) ; + tsItem->streamType=NONE; + tsItem->setRenameEnabled(0,false); + tsItems.append(tsItem); + tsItem->setPixmap( 0,SmallIcon("folder")); + } + + for (i=0;igettitleCount();i++) + { + l_track=dvd->gettitle(i); + if ((l_track->getIndexed())) + addTitle(l_track); + + h=l_track->gettotallength(); + } + + m_playbackOptions->fillTitleList(); + m_langSelect->fillLvLanguages(); + listView1->setSorting(0,true); + changeStatusbar( i18n("Ready"),sbMessage); + emit SelectionChanged(dvd,withMenus()); +} + +void k9Main::setDVDSize() +{ + //k9DVDSize *dvdsize=static_cast(m_factory->create(this,"dvd", "k9DVDSize")); + k9DVDSize *dvdsize=new k9DVDSize(this); + dvdsize->setMaxSizeDyn(m_prefSize); + delete dvdsize; +} + + +k9Main::~k9Main() +{ + delete dvd; +} + +void k9Main::closeEvent( QCloseEvent* ce ) +{ + saveSettings(); + ce->accept(); +} + + +void k9Main::addChapters(QListViewItem *_parent,k9DVDTitle *_title) +{ + LvItem *chapter = new LvItem(_parent,CHAPTER); + chapter->setText(0, i18n("chapters")); + chapter->setOpen( false); + chapter->setPixmap(0,pxChapter); + + int ch=0; + for (int i=0;i< _title->getchapterCount();i++) + { + ckLvItem *it =new ckLvItem(chapter,this,CHAPTER); + it->setText(0,i18n("chapter %1").arg(++ch)); + it->setText(1,i18n("%1 MB").arg((double)(_title->getChapter(i)->getsectors()) /512)); + it->streamType=CHAP; + it->obj=_title->getChapter(i); + chItems.append( it); + it->mainTitle=_title; + } + for (int j=0;j <_title->getTitles().count();j++) + { + k9DVDTitle *title2=_title->getTitles().at(j); + for (int i=0;i< title2->getchapterCount();i++) + { + ckLvItem *it =new ckLvItem(chapter,this,CHAPTER); + it->setText(0,i18n("chapter %1").arg(++ch)); + it->streamType=CHAP; + it->obj=title2->getChapter(i); + it->setText(1,i18n("%1 MB").arg((double)(title2->getChapter(i)->getsectors()) /512)); + chItems.append( it); + it->mainTitle=_title; + } + + } + +} +/** No descriptions */ +void k9Main::addTitle(k9DVDTitle *track) +{ + const int col1 =0; + const int col2 =1; + const int col3 =2; + k9DVDAudioStream *l_auds; + k9DVDSubtitle *l_sub; + int i; + QString c,ch; + + + listView1->setRootIsDecorated(true); + + LvItem * itemTrack = new LvItem( tsItems.at(track->getVTS()-1),TITLE); + itemTrack->setOpen( false ); + itemTrack->setText(col1,track->getname()); + itemTrack->setRenameEnabled(0,true); + itemTrack->setPixmap(col1,SmallIcon("title")); + c.sprintf("%.2f ", track->gettotalsize_mb()); + + itemTrack->setText(col2,c+i18n("MB")); + itemTrack->obj=track; + + addChapters( itemTrack,track); + + ckLvItem *video; + video=new ckLvItem( itemTrack,this,STREAM); + video->streamType=VID; + addListItem(track,video,VID); + video->setOpen( false ); + c=i18n("video %1 ").arg(track->getformat()); + c.append (" - " + track->gettotallength().toString("h:mm:ss")); + video->setText(col1, c); + c.sprintf("%.2f ", track->gettotalvideosize_mb()); + video->setText(col2,c +i18n("MB")); + video->setPixmap(col1,pxVideo); + video->obj=track; + + for (i=0;i< track->getaudioStreamCount();i++) + { + l_auds=track->getaudioStream(i); + c=i18n("audio %1 ").arg(i+1); + c.append( l_auds->getlanguage() + " " +l_auds->getformat()+" " ); + ch.sprintf("%dch ",l_auds->getchannels()); + c.append(ch+l_auds->getfrequency()+" "+l_auds->getquantization()); + ckLvItem * item = new ckLvItem( itemTrack,this,STREAM); + item->streamType=AUD; + item->language=l_auds->getlanguage(); + addListItem(l_auds,item,AUD); + item->setText( col1, c ); + c=i18n("%1 MB").arg(l_auds->getsize_mb()); + item->setText( col2,c); + item->setText( col3,l_auds->getcontent()); + item->setPixmap(col1,pxSound); + + item->obj=track; + item->stream=l_auds; + } + for (i=0;i< track->getsubPictureCount();i++) + { + l_sub=track->getsubtitle(i); + c=i18n("subpicture %1 ").arg(i+1); + c.append( l_sub->getlanguage()); + ckLvItem * item = new ckLvItem( itemTrack,this,STREAM); + item->streamType=SUB; + item->language=l_sub->getlanguage(); + addListItem(l_sub,item,SUB); + item->setText( col1, c ); + c=i18n("%1 MB").arg(l_sub->getsize_mb()); + item->setText( col2,c); + item->setText( col3, l_sub->getcontent()); + item->setPixmap(col1,pxText); + + item->obj=track; + item->stream=l_sub; + } +} + + +/** No descriptions */ +void k9Main::updateSelection() +{ + + k9DVDListItem *litem; + for (uint i=0;istreamType) + { + case SUB: + k9DVDSubtitle *l_sub; + l_sub=litem->subtitle; + l_sub->setselected(litem->listItem->isOn()); + break; + case AUD: + k9DVDAudioStream *l_auds; + l_auds=litem->audioStream; + l_auds->setselected(litem->listItem->isOn()); + break; + case VID : + k9DVDTitle *l_title; + l_title=litem->title; + + l_title->setforceSelection(litem->listItem->isOn()); + //if title is not selected => shrink factor is not forced + if (!l_title->isSelected()) + l_title->setforceFactor( false); + + break; + default : + break; + } + } + bool supdating=updating; + updating=true; + for (uint i=0;iobj; + it->setOn( c->getSelected()); + } + updating=supdating; +} + +void k9Main::checkLang(QString lang,eStreamType streamType,bool state) +{ + updating =true; + for (uint i=0;istreamType == streamType ) + { + switch (litem->streamType) + { + case SUB: + k9DVDSubtitle *l_sub; + l_sub=litem->subtitle; + if (l_sub->getlanguage() == lang) + { + l_sub->setselected(state); + litem->listItem->setOn(state); + checked=state; + + k9DVDTitle *title=(k9DVDTitle*)litem->listItem->obj; + ckLvItem * itemtitleset=(ckLvItem*)litem -> listItem->parent()->parent(); + itemtitleset->setOn(title->gettitleset()->getselected()); + } + break; + case AUD: + k9DVDAudioStream *l_auds; + l_auds=litem->audioStream; + if (l_auds->getlanguage() == lang) + { + l_auds->setselected(state); + litem->listItem->setOn(state); + checked=state; + + k9DVDTitle *title=(k9DVDTitle*)litem->listItem->obj; + ckLvItem * itemtitleset=(ckLvItem*)litem -> listItem->parent()->parent(); + itemtitleset->setOn(title->gettitleset()->getselected()); + } + break; + default: + break; + } + //we must check the video item + if (checked) + { + for (uint j=0; jlistItem->parent()==litem->listItem->parent() && litem2->streamType==VID ) + { + litem2->title->setforceSelection(state); + litem2->listItem->setOn(state); + } + } + } + } + } + m_playbackOptions->fillTitleList(); + updating=false; + emit SelectionChanged(dvd,withMenus()); + +} + +void k9Main::checkTitle(bool state, ckLvItem *_item) +{ + m_update->wait(); + + k9DVDListItem *litem; + updating=true; + + k9DVDTitle *title; + if (_item->streamType==CHAP) + { + k9DVDChapter *c=(k9DVDChapter*)_item->obj; + c->setSelected( state); + //title=c->getTitle(); + title=_item->mainTitle; + for (uint i=0;ititle && litem->streamType==VID) + litem->listItem->setOn(state); + + } + } + else + title=(k9DVDTitle*) _item->obj; + + + for (uint i=0;ilistItem->parent() == _item->parent()) + { + //if current item is video and is unchecked, uncheck audio and subtitles + if (!state && _item->streamType==VID) + { + switch (litem->streamType) + { + case SUB: + k9DVDSubtitle *l_sub; + l_sub=litem->subtitle; + l_sub->setselected(state); + litem->listItem->setOn(state); + break; + case AUD: + k9DVDAudioStream *l_auds; + l_auds=litem->audioStream; + l_auds->setselected(state); + litem->listItem->setOn(state); + break; + default: + break; + } + } + else if ( litem->streamType == VID && state && (_item->streamType==SUB || _item->streamType==AUD)) + { + litem->title->setforceSelection(state); + litem->listItem->setOn(state); + } + } + } + + + updateSelection(); + + k9DVDTitleset * titleset=NULL; + + titleset=title->gettitleset(); + + m_langSelect->update(); + + //check the titleset checkbox + if (titleset!=NULL) + { + ckLvItem * itemtitleset; + if (_item->streamType==CHAP) + itemtitleset=(ckLvItem*)_item->parent()->parent()->parent(); + else + itemtitleset=(ckLvItem*)_item->parent()->parent(); + itemtitleset->setOn(titleset->getselected()); + } + + m_playbackOptions->fillTitleList(); + updating=false; + emit SelectionChanged(dvd,withMenus()); +} + + + +void k9Main::checkAll(bool state) +{ + k9DVDListItem *litem; + updating=true; + for (uint i=0;istreamType) + { + case SUB: + litem->listItem->setOn(state); + break; + case AUD: + litem->listItem->setOn(state); + break; + case VID: + { + k9DVDTitle * l_title; + l_title=litem->title; + // l_title->setforceSelection(state); + litem->listItem->setOn(state); + + // k9DVDTitle *title=(k9DVDTitle*)litem->listItem->obj; + ckLvItem * itemtitleset=(ckLvItem*)litem -> listItem->parent()->parent(); + l_title->gettitleset()->setselected(state); + itemtitleset->setOn(l_title->gettitleset()->getselected()); + } + break; + default: + break; + } + } + + m_langSelect->selectAll(state); + + updateSelection(); + m_playbackOptions->fillTitleList(); + updating=false; + emit SelectionChanged(dvd,withMenus()); + +} + +void k9Main::checkTS( bool _state,ckLvItem *_item ) +{ + k9DVDTitleset *titleset = (k9DVDTitleset*)_item->obj; + titleset->setselected(_state); + k9DVDListItem *litem; + updating=true; + for (uint i=0;ilistItem->parent ()->parent() == _item) + { + litem->listItem->setOn(_state); + } + } + + m_langSelect->update(); + + updateSelection(); + + m_playbackOptions->fillTitleList(); + updating=false; + emit SelectionChanged(dvd,withMenus()); +} + +void k9Main::expanded( QListViewItem *item) { +if (item->rtti()==1001) + { + ckLvItem *ckit = (ckLvItem*) item; + if (ckit->objectType==TITLESET) + ckit->setPixmap( 0,SmallIcon("folder_open")); + } +} + +void k9Main::collapsed( QListViewItem *item) { +if (item->rtti()==1001) + { + ckLvItem *ckit = (ckLvItem*) item; + if (ckit->objectType==TITLESET) + ckit->setPixmap( 0,SmallIcon("folder")); + } +} + + +/** No descriptions */ +void k9Main::itemRenamed(QListViewItem * item,int ) +{ + k9DVDTitle *t=NULL; + QString newText; + if (item->rtti()==1000) + { + LvItem *it = (LvItem*) item; + t=(k9DVDTitle*)it->obj; + newText=it->text(0); + } + else if (item->rtti()==1001) + { + ckLvItem *ckit = (ckLvItem*) item; + t=(k9DVDTitle*)ckit->obj; + newText=ckit->text(0); + } + + QString c; + if (t !=NULL) + { + //QMessageBox::critical( this, "test", c.sprintf("%d",it->tag)); + t->setname(newText); + m_playbackOptions->titleRenamed( t,newText); + } + else + dvd->setDVDTitle(item->text(0)); +} + +/** No descriptions */ +void k9Main::readSettings() +{ + readDrives(); + k9Config config; + config.read(); + + m_prefOutput=config.getPrefOutput(); + cbInputDev->setCurrentItem(config.getInputDev()); + cbOutputDev->setCurrentItem(config.getOutputDev()); + m_prefK3b=config.getPrefK3b(); + + m_prefAutoBurn=config.getPrefAutoBurn(); + m_quickScan=config.getQuickScan(); + m_prefSize=config.getPrefSize(); + //fill the burn speed combo + //cbOutputDevActivated( cbOutputDev->currentItem()); + cbOutputDevActivated( config.getOutputDev()); + + + //m_useDvdAuthor=settings.readBoolEntry("/options/useDvdAuthor",true); + m_useDvdAuthor=config.getUseDvdAuthor(); +} +/** No descriptions */ +void k9Main::saveSettings() +{ + k9Config config; + config.read(); + + config.setInputDev(cbInputDev->currentItem()); + config.setOutputDev(cbOutputDev->currentItem()); + config.setKeepMenus(withMenus()); + config.save(); +} +/** No descriptions */ +void k9Main::bSaveClick() +{ + saveSettings(); +} + +/** No descriptions */ +void k9Main::PreviewTitle() +{ + if( listView1->selectedItem()==NULL) + return; + if (listView1->selectedItem()->depth() <2) + return; + int rtti=listView1->selectedItem()->rtti(); + QObject *obj; + if (rtti==1000) + { + LvItem *it=(LvItem*)listView1->selectedItem(); + obj=it->obj; + } + else + { + ckLvItem *it=(ckLvItem*)listView1->selectedItem(); + obj=it->obj; + } + + if (obj !=NULL) + { + k9DVDTitle *t; + ckLvItem *it=(ckLvItem*)listView1->selectedItem(); + int chapter=1; + if (it->depth()==4) { + k9DVDChapter *c=(k9DVDChapter*)obj; + t=c->getTitle(); + chapter=c->getnum(); + } else + t=(k9DVDTitle*)obj; + //viewer->show(); + //viewer->open(dvd,t); + + + emit showPreview( dvd,t,chapter); + } +} + +void k9Main::CreateMP4() +{ + if (!dvd->getopened()) + { + KMessageBox::error( this, i18n("DVD is not opened"), i18n("MPEG-4 Encoding")); + return; + } + QString filename=""; + int cpt=0; + for (int i=0; i < dvd->gettitleCount();i++) + { + k9DVDTitle *t=dvd->gettitle(i); + changeStatusbar( i18n("Transcoding title : %1").arg(t->getname()) ,sbMessage); + + if (t->isSelected() && t->getIndexed() ) + { + QString name; + if (filename=="") + filename=KFileDialog::getSaveFileName (QDir::homeDirPath(),"*.avi|Audio Video Interleave (*.avi)\n*.mpg|MPEG-1 and MPEG-2 systems (*.mpg)\n*.mp4|MPEG-4 format (*.mp4)\n*.asf|Advanced Streaming Format (*.asf)\n*.swf|Adobe Flash (*.swf)\n*.flv|Adobe Flash video files (*.flv)\n*.rm|RealVideo (*.rm)\n*.mov|QuickTime (*.mov)", 0,i18n("Save file to disk")); + if (filename=="") + break; + + k9MP4Enc *mp4=new k9MP4Enc(); + setProgressWindow( mp4->getDialog()); + if (cpt >0) { + QString ext=filename.section(".",-1); + if (ext!="") + ext="."+ext; + QString path=filename.left(filename.length()-ext.length()); + path=path+QString::number(cpt)+ext; + mp4->setFilename(path); + } + else + mp4->setFilename(filename); + + cpt++; + k9TitleEncOpt * opt=t->getEncOpt(); + mp4->setDevice(dvd->getDevice()); + mp4->setAudioBitrate(opt->getAudioBr()); + mp4->setVideoBitrate(opt->getVideoBr()); + mp4->setCodec( opt->getCodec()); + mp4->setAudioCodec(opt->getAudioCodec()); + mp4->setSize(QString::number(opt->getMaxSize())); + mp4->setAudioGain(QString::number(opt->getAudioGain())); + mp4->setNumberCD(QString::number(opt->getNumParts())); + mp4->setWidth(opt->getWidth() ); + mp4->setHeight(opt->getHeight()); + mp4->set2Passes( opt->get2Passes()); + mp4->setUseCache(opt->getUseCache()); + mp4->setMpeg2(false); + mp4->execute(t); + bool bStop=mp4->isCanceled(); + delete mp4; + removeProgressWindow(); + if (bStop) + break; + } + } + changeStatusbar( i18n("Ready") ,sbMessage); + + +} + +void k9Main::extractMPEG2() { + if (!dvd->getopened()) { + KMessageBox::error( this, i18n("DVD is not opened"), i18n("Extract Mpeg2")); + return; + } + QString filename=""; + int cpt=0; + + + for (int i=0; i < dvd->gettitleCount();i++) { + k9DVDTitle *t=dvd->gettitle(i); + changeStatusbar( i18n("Extracting title : %1",t->getname()) ,sbMessage); + + if (t->isSelected() && t->getIndexed() ) { + QString name; + if (filename=="") + filename=KFileDialog::getSaveFileName (QDir::homeDirPath(),"*.mpg|MPEG-1 and MPEG-2 systems (*.mpg)", 0,i18n("Save file to disk")); + if (filename=="") { + break; + } + + k9MP4Enc *mp4=new k9MP4Enc(); + setProgressWindow( mp4->getDialog()); + mp4->setMpeg2(true); + mp4->setUseCache(false); + + if (cpt >0) { + QString ext=filename.section(".",-1); + if (ext!="") + ext="."+ext; + QString path=filename.left(filename.length()-ext.length()); + path=path+QString::number(cpt)+ext; + mp4->setFilename(path); + } else + mp4->setFilename(filename); + cpt++; + k9TitleEncOpt * opt=t->getEncOpt(); + mp4->setDevice(dvd->getDevice()); + mp4->execute(t); + bool bStop=mp4->isCanceled(); + delete mp4; + removeProgressWindow(); + if (bStop) + break; + } + } + changeStatusbar( i18n("Ready") ,sbMessage); +} + +void k9Main::deviceAdded(k9CdDrive *_drive) { + addDrive(_drive); +} + +void k9Main::deviceRemoved(k9CdDrive *_drive) { + if (_drive->device == dvd->getDevice()) + closeDVD(); + + int i=driveList.find(_drive); + driveList.remove(i); + cbInputDev->removeItem(i); + + i=recorderList.find(_drive); + recorderList.remove( i); + cbOutputDev->removeItem(i+2); + +} + +void k9Main::addDrive(k9CdDrive *drive) { + #ifdef HAVE_HAL + if (drive->getDevice()!=NULL) { + k9HalDevice *dev=drive->getDevice(); + connect(dev,SIGNAL(volumeChanged( const QString &,const QString &)),this,SLOT(volumeChanged(const QString&,const QString&))); + } + #endif + if (drive->canReadDVD) + { + QString c(drive->name + " ("+drive->device+")"); + cbInputDev->insertItem(c,-1); + driveList.append(drive); + } + if (drive->canWriteDVD) + { + cbOutputDev->insertItem(drive->name+ " ("+drive->device+")",-1); + recorderList.append(drive); + } + +} + +/*! + \fn k9Main::readDrives() + */ +void k9Main::readDrives() +{ + cbInputDev->clear(); + cbOutputDev->clear(); + driveList.clear(); + recorderList.clear(); + cbOutputDev->insertItem(i18n("ISO Image")); + cbOutputDev->insertItem(i18n("Folder")); + + drives->scanDrives(); + +} + + +void k9Main::volumeChanged(const QString &device,const QString &volumeName) { + if (device==dvd->getDevice() && dvd->getopened() && volumeName=="") + closeDVD(); + else if (!dvd->getopened() && volumeName !="" && getDevice(cbInputDev)==device) { + Open(); + } +} + +/*! + \fn k9Main::listView1CurrentChanged( QListViewItem *newItem ) + */ +void k9Main::listView1CurrentChanged( QListViewItem *newItem ) +{ + if (newItem == NULL) + { + m_playbackOptions->enable(false); + } + else + { + if (!withMenus()) + { + m_playbackOptions->enable(true); + } + } + + k9DVDTitle *title=NULL; + + if (newItem->rtti()==1000) + { + LvItem *it = (LvItem*) newItem; + title=(k9DVDTitle*)it->obj; + } + else if (newItem->rtti()==1001 && newItem->depth()>2) + { + ckLvItem *ckit = (ckLvItem*) newItem; + if (((ckLvItem*)newItem)->streamType==CHAP) + { + LvItem *parent=(LvItem*)(ckit->parent()->parent()); + title=(k9DVDTitle*)parent->obj; + } + else + title=(k9DVDTitle*)ckit->obj; + } + if (title !=NULL) + { + emit changedTitle(title); + } + +} + + +void k9Main::closeDVD() +{ + //viewer->bStopClick(); + emit stopPreview(); + emit changedTitle(NULL); + emit SelectionChanged(NULL,withMenus()); + changeStatusbar( "",sbFactor); + changeStatusbar( "",sbMessage); + listView1->clear(); + items.clear(); + m_langSelect->clear(); + dvd->close(); + +} + + +int k9Main::compare(double v1,double v2) +{ + if (v1 v2) + return 1; + return 0; +} + + +void k9Main::cbOutputDevActivated(int _index) +{ + + if (_index==0) + return; + + k9CdDrive * drive=(k9CdDrive*)recorderList.at(_index-1); + if (drive !=NULL) { + QValueList list=drive->getWriteSpeeds(); + QValueList::iterator it=list.begin(); + + cbBurnSpeed->clear(); + cbBurnSpeed->insertItem(i18n("default")); + while( it !=list.end()) + { + cbBurnSpeed->insertItem(QString::number((double)(*it))); + it++; + } + } +} + +void k9Main::bInputOpenClick() +{ + QString result=KFileDialog::getOpenFileName (QDir::homeDirPath(),"*.iso", 0,i18n("Open ISO Image")); + if (result!="") + { + cbInputDev->setCurrentText(result); + Open(); + } +} + + +void k9Main::bInputOpenDirClick() +{ + QString result= KDirSelectDialog::selectDirectory (QDir::homeDirPath(), false, this,i18n("Open DVD folder")).path(); + if (result!="") + { + cbInputDev->setCurrentText(result); + Open(); + } +} + +void k9Main::fspDone() +{ + fspFinish=true; +} + +void k9Main::foundMountPoint( const QString &, unsigned long , unsigned long , unsigned long kBAvail) +{ + fspAvail=kBAvail; +} + +long k9Main::getFreeSpace(const QString & _path) +{ + fspFinish=false; + fspAvail=0; + KDiskFreeSp *FreeSp=new KDiskFreeSp(); + ; + + connect(FreeSp,SIGNAL(foundMountPoint (const QString &, unsigned long , unsigned long , unsigned long )),this,SLOT(foundMountPoint (const QString &, unsigned long , unsigned long , unsigned long ))); + connect(FreeSp,SIGNAL(done ( )),this,SLOT(fspDone ())); + QString mountPoint = KIO::findPathMountPoint( _path ); + FreeSp->readDF(mountPoint); + do + { + qApp->processEvents(); + } + while (!fspFinish); + fspAvail/=1024; + return fspAvail; + +} + + +void k9Main::setInput(QString _input) +{ + bool found=false; + for (uint i=0;i< driveList.count();i++) { + k9CdDrive *drive=(k9CdDrive*)driveList.at(i); + if (drive->device == _input) { + cbInputDev->setCurrentItem(i); + found=true; + } + } + if (!found) + cbInputDev->setCurrentText(_input); +} + +void k9Main::setOutput(QString _output) +{ + cbOutputDev->setCurrentItem(0); + for (uint i=0 ;i device); + // qDebug ("output=" +c); + if (c==_output) + { + cbOutputDev->setCurrentItem(i+2); + break; + } + } +} + +void k9Main::Clone(QString _input,QString _output) +{ + setInput(_input); + setOutput(_output); + m_playbackOptions->setwithMenus( true); + m_quickScan=true; + Open(); + checkAll( true); + Copy(); +} + +void k9Main::updateFactor(){ + + // m_update->updateFactor(); + updateFactor_internal(); +} + +void k9Main::updateFactor_internal() +{ + if (dvd->getopened() && m_mutex.tryLock()) + { + updateSelection(); + setDVDSize(); + double dbfactor=dvd->getfactor(withMenus(),true,m_useDvdAuthor); + + factor->setValue((int) ( dbfactor*100)-100 ); + + if (dvd->getsizeSelected(FALSE)==0) + changeStatusbar("",sbFactor); + else + changeStatusbar( QString::number(dbfactor,'f',2),sbFactor); + emit SelectionChanged( dvd,withMenus()); + m_mutex.unlock(); + } +} + +bool k9Main::withMenus() +{ + return m_playbackOptions->withMenus(); +} + +#include "k9main.moc" + + +void k9Main::setDrives(k9CdDrives* _value) { + drives = _value; +} diff --git a/src/k9main.h b/src/k9main.h new file mode 100644 index 0000000..6e9c348 --- /dev/null +++ b/src/k9main.h @@ -0,0 +1,240 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2005 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9MAIN_H +#define K9MAIN_H +#include "k9common.h" +#include "k9cddrive.h" +#include "images.h" +#include "k9mainw.h" +#include "kconfigdlg.h" +#include "k9playbackoptions.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "k9copy.h" +#include + +enum eStreamType {SUB,AUD,VID,NONE,CHAP} ; +enum eObjectType {TITLE,CHAPTER,TITLESET,STREAM,ROOT}; + +class LvItem : public QListViewItem { +public: + LvItem( QListViewItem *parent,eObjectType _objectType) + : QListViewItem( parent), obj( NULL ) { + objectType=_objectType; + } + LvItem( QListView *parent,eObjectType _objectType) + : QListViewItem( parent), obj( NULL ) { + objectType=_objectType; + } + eObjectType objectType; + QObject *obj; + virtual int rtti () const; + int compare ( QListViewItem * i, int col, bool ascending ) const; + void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ); +}; + +class k9Main; +class k9DVD; +class k9DVDAudioStream; +class k9DVDSubtitle; +class k9DVDTitle; +class KLibFactory; +class k9PlaybackOptions; +class k9LangSelect; +class k9UpdateFactor; + +class ckLvItem : public QCheckListItem { +public: + ckLvItem( QListViewItem *parent,k9Main *dlg,eObjectType _objectType) + : QCheckListItem( parent,"",QCheckListItem::CheckBox) { + mainDlg=dlg; + obj=NULL; + stream=NULL; + streamType=NONE; + language=""; + objectType=_objectType; + } + ckLvItem( QListView *parent,k9Main *dlg,eObjectType _objectType) + : QCheckListItem( parent,"",QCheckListItem::CheckBox) { + mainDlg=dlg; + obj=NULL; + stream=NULL; + streamType=NONE; + language=""; + objectType=_objectType; + } + eStreamType streamType; + eObjectType objectType; + + k9Main *mainDlg; + k9DVDTitle *mainTitle; + QObject *obj; + QObject *stream; + QString language; + virtual int rtti () const; + void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ); + int compare ( QListViewItem * i, int col, bool ascending ) const; + double getstreamSize(); + +protected: + void stateChange(bool state); + +}; + + +class k9DVDListItem : public QObject { + Q_OBJECT +public: + k9DVDAudioStream *audioStream; + k9DVDSubtitle *subtitle; + k9DVDTitle *title; + ckLvItem *listItem; + eStreamType streamType; +public: + k9DVDListItem(QObject *DVD,ckLvItem *List,eStreamType type); +}; + + +class k9Main : public MainDlg { + Q_OBJECT + +public: + + k9Main(QWidget* parent = 0, const char* name = 0, k9CdDrives *_drives=0 ); + ~k9Main(); + /*$PUBLIC_FUNCTIONS$*/ + void addTitle(k9DVDTitle *track); + void addChapters(QListViewItem *_parent,k9DVDTitle *_title); + void updateSelection(); + void checkAll(bool state); + void checkTS( bool _state,ckLvItem *_item ); + void checkTitle(bool state, ckLvItem *_item); + void checkLang(QString lang, eStreamType streamType,bool state); + bool getupdating(); + void saveSettings(); + void setDVDSize(); + static int compare(double v1,double v2); + void readSettings(); + bool getquickScan() { + return m_quickScan; + }; + void setPlaybackOptions(k9PlaybackOptions *_value) { + m_playbackOptions=_value; + }; + void setLangSelect(k9LangSelect *_value) { + m_langSelect=_value; + }; + QObjectList *getItems() { + return &items; + }; + void updateFactor(); + bool withMenus(); + k9DVD *dvd; + void eject(); +private slots: + virtual void listView1CurrentChanged( QListViewItem * ); + virtual void bSaveClick(); + virtual void cbOutputDevActivated(int); + virtual void bInputOpenClick(); + virtual void bInputOpenDirClick(); + virtual void foundMountPoint (const QString &mountPoint, unsigned long kBSize, unsigned long kBUsed, unsigned long kBAvail); + virtual void fspDone(); + virtual void updateFactor_internal(); + virtual void deviceAdded(k9CdDrive *_drive); + virtual void deviceRemoved(k9CdDrive *_drive); + virtual void expanded(QListViewItem*); + virtual void collapsed (QListViewItem*); +public slots: + /*$PUBLIC_SLOTS$*/ + virtual void PreviewTitle(); + virtual void CreateMP4(); + virtual void extractMPEG2(); + virtual void Copy(); + virtual void Open(); + virtual void Clone(QString _input,QString _output); + virtual void setInput(QString _input); + virtual void setOutput(QString _output); + virtual void volumeChanged(const QString &device,const QString &volumeName); + + void setDrives(k9CdDrives* _value); + +protected: + /*$PROTECTED_FUNCTIONS$*/ + QObjectList items; + k9DVDListItem *addListItem(QObject *DVD,ckLvItem *List,eStreamType type); + + void readDrives(); + void addDrive (k9CdDrive *_drive); + k9Copy *m_parent; + QPtrList tsItems; + QPtrList chItems; + ckLvItem * root; + QPtrList driveList; + QPtrList recorderList; + k9CdDrives *drives; + QPixmap pxVideo; + QPixmap pxSound; + QPixmap pxText; + QPixmap pxChapter; + QMutex m_mutex; + bool updating; + bool fspFinish; + long fspAvail; + void closeEvent( QCloseEvent* ce ); + void closeDVD(); + KLibFactory *m_factory; + QString getDevice(QComboBox *_combo); + k9UpdateFactor *m_update; + //PREFERENCES + QString m_prefOutput; + bool m_useDvdAuthor; + bool m_quickScan; + int m_prefSize; + bool m_prefK3b; + bool m_prefMenu; + bool m_prefAutoBurn; + k9PlaybackOptions *m_playbackOptions; + k9LangSelect *m_langSelect; + + KMdiToolViewAccessor *m_toolView; + KDockWidget *m_dockWidget; +protected slots: + /*$PROTECTED_SLOTS$*/ + void itemRenamed ( QListViewItem *item, int col ); +signals: // Signals + /** No descriptions */ + void sig_progress(QString str); + void changeStatusbar(const QString& str,int id); + void changeCaption(const QString& str); + void showPreview(k9DVD *_dvd,k9DVDTitle * title,int chapter); + void stopPreview(); + void SelectionChanged(k9DVD *_dvd,bool _withMenus); + void changedTitle(k9DVDTitle *_title); +private: + void fillLvLanguages(); + void updateLvLang(const eStreamType streamType,const QString & lang) ; + long getFreeSpace(const QString & _path); + void setProgressWindow(QWidget *_widget); + void removeProgressWindow(); + + +}; + +#endif + diff --git a/src/k9mainw.cpp b/src/k9mainw.cpp new file mode 100644 index 0000000..27eb9ac --- /dev/null +++ b/src/k9mainw.cpp @@ -0,0 +1,216 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './k9mainw.ui' +** +** Created: dim. oct. 26 08:57:34 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "k9mainw.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kselect.h" +#include "kcombobox.h" +#include "klineedit.h" +#include "kpushbutton.h" + +/* + * Constructs a MainDlg as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +MainDlg::MainDlg( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "MainDlg" ); + setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) ); + setMinimumSize( QSize( 0, 200 ) ); + MainDlgLayout = new QGridLayout( this, 1, 1, 2, 6, "MainDlgLayout"); + + lblInput_2 = new QLabel( this, "lblInput_2" ); + lblInput_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, lblInput_2->sizePolicy().hasHeightForWidth() ) ); + + MainDlgLayout->addWidget( lblInput_2, 1, 0 ); + + lblInput = new QLabel( this, "lblInput" ); + lblInput->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, lblInput->sizePolicy().hasHeightForWidth() ) ); + + MainDlgLayout->addWidget( lblInput, 0, 0 ); + + tab = new QWidget( this, "tab" ); + tabLayout = new QGridLayout( tab, 1, 1, 1, 0, "tabLayout"); + + factor = new KGradientSelector( tab, "factor" ); + factor->setEnabled( FALSE ); + factor->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)4, 0, 0, factor->sizePolicy().hasHeightForWidth() ) ); + factor->setMinimumSize( QSize( 0, 15 ) ); + factor->setValue( 0 ); + factor->setMinValue( 0 ); + factor->setMaxValue( 100 ); + factor->setFirstColor( QColor( 170, 0, 0 ) ); + factor->setSecondColor( QColor( 0, 255, 0 ) ); + + tabLayout->addWidget( factor, 1, 0 ); + + listView1 = new QListView( tab, "listView1" ); + listView1->addColumn( tr2i18n( "Title" ) ); + listView1->addColumn( tr2i18n( "Size" ) ); + listView1->header()->setResizeEnabled( FALSE, listView1->header()->count() - 1 ); + listView1->addColumn( tr2i18n( "Content" ) ); + listView1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, listView1->sizePolicy().hasHeightForWidth() ) ); + listView1->setMinimumSize( QSize( 0, 200 ) ); + listView1->setShowSortIndicator( TRUE ); + + tabLayout->addWidget( listView1, 0, 0 ); + + MainDlgLayout->addMultiCellWidget( tab, 2, 2, 0, 4 ); + + textLabel2_2 = new QLabel( this, "textLabel2_2" ); + textLabel2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, textLabel2_2->sizePolicy().hasHeightForWidth() ) ); + + MainDlgLayout->addWidget( textLabel2_2, 1, 4 ); + + cbBurnSpeed = new KComboBox( FALSE, this, "cbBurnSpeed" ); + cbBurnSpeed->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, cbBurnSpeed->sizePolicy().hasHeightForWidth() ) ); + cbBurnSpeed->setEditable( TRUE ); + + MainDlgLayout->addWidget( cbBurnSpeed, 1, 3 ); + + textLabel1_3 = new QLabel( this, "textLabel1_3" ); + textLabel1_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, textLabel1_3->sizePolicy().hasHeightForWidth() ) ); + + MainDlgLayout->addWidget( textLabel1_3, 1, 2 ); + + cbInputDev = new QComboBox( FALSE, this, "cbInputDev" ); + cbInputDev->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, cbInputDev->sizePolicy().hasHeightForWidth() ) ); + cbInputDev->setEditable( TRUE ); + cbInputDev->setAutoCompletion( TRUE ); + + MainDlgLayout->addWidget( cbInputDev, 0, 1 ); + + layout2 = new QHBoxLayout( 0, 0, 6, "layout2"); + + bInputOpenDir = new KPushButton( this, "bInputOpenDir" ); + bInputOpenDir->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, bInputOpenDir->sizePolicy().hasHeightForWidth() ) ); + bInputOpenDir->setMinimumSize( QSize( 22, 22 ) ); + bInputOpenDir->setMaximumSize( QSize( 22, 22 ) ); + layout2->addWidget( bInputOpenDir ); + + bInputOpen = new KPushButton( this, "bInputOpen" ); + bInputOpen->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, bInputOpen->sizePolicy().hasHeightForWidth() ) ); + bInputOpen->setMinimumSize( QSize( 22, 22 ) ); + bInputOpen->setMaximumSize( QSize( 22, 22 ) ); + layout2->addWidget( bInputOpen ); + spacer5_2 = new QSpacerItem( 50, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout2->addItem( spacer5_2 ); + + MainDlgLayout->addMultiCellLayout( layout2, 0, 0, 2, 4 ); + + cbOutputDev = new QComboBox( FALSE, this, "cbOutputDev" ); + cbOutputDev->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, cbOutputDev->sizePolicy().hasHeightForWidth() ) ); + cbOutputDev->setEditable( FALSE ); + cbOutputDev->setAutoCompletion( TRUE ); + + MainDlgLayout->addWidget( cbOutputDev, 1, 1 ); + languageChange(); + resize( QSize(743, 585).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( listView1, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( listView1CurrentChanged(QListViewItem*) ) ); + connect( cbOutputDev, SIGNAL( activated(int) ), this, SLOT( cbOutputDevActivated(int) ) ); + connect( bInputOpen, SIGNAL( clicked() ), this, SLOT( bInputOpenClick() ) ); + connect( bInputOpenDir, SIGNAL( clicked() ), this, SLOT( bInputOpenDirClick() ) ); + connect( listView1, SIGNAL( itemRenamed(QListViewItem*,int) ), this, SLOT( itemRenamed(QListViewItem*,int) ) ); + + // tab order + setTabOrder( cbInputDev, cbOutputDev ); + setTabOrder( cbOutputDev, bInputOpenDir ); + setTabOrder( bInputOpenDir, bInputOpen ); + setTabOrder( bInputOpen, cbBurnSpeed ); + setTabOrder( cbBurnSpeed, listView1 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MainDlg::~MainDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void MainDlg::languageChange() +{ + setCaption( tr2i18n( "MainDlg" ) ); + lblInput_2->setText( tr2i18n( "Output device " ) ); + lblInput->setText( tr2i18n( "input device" ) ); + listView1->header()->setLabel( 0, tr2i18n( "Title" ) ); + listView1->header()->setLabel( 1, tr2i18n( "Size" ) ); + listView1->header()->setLabel( 2, tr2i18n( "Content" ) ); + textLabel2_2->setText( tr2i18n( "X" ) ); + cbBurnSpeed->clear(); + cbBurnSpeed->insertItem( tr2i18n( "default" ) ); + textLabel1_3->setText( tr2i18n( "@" ) ); + bInputOpenDir->setText( QString::null ); + QToolTip::add( bInputOpenDir, tr2i18n( "Open a folder" ) ); + bInputOpen->setText( QString::null ); + QToolTip::add( bInputOpen, tr2i18n( "Open an iso image" ) ); +} + +void MainDlg::bSaveClick() +{ + qWarning( "MainDlg::bSaveClick(): Not implemented yet" ); +} + +void MainDlg::bDevicesClick() +{ + qWarning( "MainDlg::bDevicesClick(): Not implemented yet" ); +} + +void MainDlg::listView1CurrentChanged(QListViewItem*) +{ + qWarning( "MainDlg::listView1CurrentChanged(QListViewItem*): Not implemented yet" ); +} + +void MainDlg::cbOutputDevActivated(int) +{ + qWarning( "MainDlg::cbOutputDevActivated(int): Not implemented yet" ); +} + +void MainDlg::bInputOpenClick() +{ + qWarning( "MainDlg::bInputOpenClick(): Not implemented yet" ); +} + +void MainDlg::bInputOpenDirClick() +{ + qWarning( "MainDlg::bInputOpenDirClick(): Not implemented yet" ); +} + +void MainDlg::ckMp4AspectRatioClick() +{ + qWarning( "MainDlg::ckMp4AspectRatioClick(): Not implemented yet" ); +} + +void MainDlg::itemRenamed(QListViewItem*,int) +{ + qWarning( "MainDlg::itemRenamed(QListViewItem*,int): Not implemented yet" ); +} + +#include "k9mainw.moc" diff --git a/src/k9mainw.ui b/src/k9mainw.ui new file mode 100644 index 0000000..5598e0b --- /dev/null +++ b/src/k9mainw.ui @@ -0,0 +1,427 @@ + +MainDlg + + + MainDlg + + + + 0 + 0 + 743 + 585 + + + + + 5 + 7 + 0 + 0 + + + + + 0 + 200 + + + + MainDlg + + + + unnamed + + + 2 + + + + lblInput_2 + + + + 0 + 5 + 0 + 0 + + + + Output device + + + + + lblInput + + + + 0 + 5 + 0 + 0 + + + + input device + + + + + tab + + + + unnamed + + + 1 + + + 0 + + + + factor + + + false + + + + 5 + 4 + 0 + 0 + + + + + 0 + 15 + + + + 0 + + + 0 + + + 100 + + + + 170 + 0 + 0 + + + + + 0 + 255 + 0 + + + + + + + Title + + + true + + + true + + + + + Size + + + true + + + false + + + + + Content + + + true + + + true + + + + listView1 + + + + 7 + 7 + 0 + 0 + + + + + 0 + 200 + + + + true + + + + + + + textLabel2_2 + + + + 0 + 5 + 0 + 0 + + + + X + + + + + + default + + + + cbBurnSpeed + + + + 0 + 0 + 0 + 0 + + + + true + + + + + textLabel1_3 + + + + 0 + 5 + 0 + 0 + + + + @ + + + + + cbInputDev + + + + 5 + 0 + 0 + 0 + + + + true + + + true + + + + + layout2 + + + + unnamed + + + + bInputOpenDir + + + + 1 + 1 + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + Open a folder + + + + + bInputOpen + + + + 1 + 1 + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + Open an iso image + + + + + spacer5_2 + + + Horizontal + + + Expanding + + + + 50 + 21 + + + + + + + + cbOutputDev + + + + 5 + 0 + 0 + 0 + + + + false + + + true + + + + + + + listView1 + currentChanged(QListViewItem*) + MainDlg + listView1CurrentChanged(QListViewItem*) + + + cbOutputDev + activated(int) + MainDlg + cbOutputDevActivated(int) + + + bInputOpen + clicked() + MainDlg + bInputOpenClick() + + + bInputOpenDir + clicked() + MainDlg + bInputOpenDirClick() + + + listView1 + itemRenamed(QListViewItem*,int) + MainDlg + itemRenamed(QListViewItem*,int) + + + + cbInputDev + cbOutputDev + bInputOpenDir + bInputOpen + cbBurnSpeed + listView1 + + + bSaveClick() + bDevicesClick() + listView1CurrentChanged( QListViewItem * ) + cbOutputDevActivated(int) + bInputOpenClick() + bInputOpenDirClick() + ckMp4AspectRatioClick() + itemRenamed(QListViewItem*,int) + + + + kselect.h + kcombobox.h + klineedit.h + kpushbutton.h + kpushbutton.h + + diff --git a/src/k9mainwsov.ui b/src/k9mainwsov.ui new file mode 100644 index 0000000..e798ad8 --- /dev/null +++ b/src/k9mainwsov.ui @@ -0,0 +1,424 @@ + +MainDlg + + + MainDlg + + + + 0 + 0 + 747 + 585 + + + + MainDlg + + + + unnamed + + + 2 + + + + lblInput_2 + + + + 0 + 5 + 0 + 0 + + + + Output device + + + + + textLabel1_3 + + + + 0 + 5 + 0 + 0 + + + + @ + + + + + lblInput + + + + 0 + 5 + 0 + 0 + + + + Input device + + + + + + default + + + + cbBurnSpeed + + + + 0 + 0 + 0 + 0 + + + + true + + + + + cbInputDev + + + + 5 + 0 + 0 + 0 + + + + true + + + true + + + + + cbOutputDev + + + + 5 + 0 + 0 + 0 + + + + false + + + true + + + + + textLabel2_2 + + + + 0 + 5 + 0 + 0 + + + + X + + + + + tabWidget2 + + + + 7 + 7 + 0 + 0 + + + + + tab + + + D&VD + + + + unnamed + + + 1 + + + 0 + + + + factor + + + false + + + + 5 + 4 + 0 + 0 + + + + + 0 + 15 + + + + 0 + + + 0 + + + 100 + + + + 170 + 0 + 0 + + + + + 0 + 255 + 0 + + + + + + splitter1 + + + Horizontal + + + + + Title + + + true + + + true + + + + + Size + + + true + + + false + + + + listView1 + + + + 7 + 7 + 0 + 0 + + + + + 0 + 0 + + + + true + + + NoColumn + + + + + + + + + layout2 + + + + unnamed + + + + bInputOpenDir + + + + 1 + 1 + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + bInputOpen + + + + 1 + 1 + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + spacer5_2 + + + Horizontal + + + Expanding + + + + 50 + 21 + + + + + + + + + + listView1 + currentChanged(QListViewItem*) + MainDlg + listView1CurrentChanged(QListViewItem*) + + + cbOutputDev + activated(int) + MainDlg + cbOutputDevActivated(int) + + + bInputOpen + clicked() + MainDlg + bInputOpenClick() + + + bInputOpenDir + clicked() + MainDlg + bInputOpenDirClick() + + + listView1 + itemRenamed(QListViewItem*,int) + MainDlg + itemRenamed(QListViewItem*,int) + + + + cbInputDev + cbOutputDev + bInputOpenDir + bInputOpen + cbBurnSpeed + tabWidget2 + listView1 + + + bSaveClick() + bDevicesClick() + listView1CurrentChanged( QListViewItem * ) + cbOutputDevActivated(int) + bInputOpenClick() + bInputOpenDirClick() + ckMp4AspectRatioClick() + itemRenamed(QListViewItem*,int) + + + + kcombobox.h + klineedit.h + kselect.h + kpushbutton.h + kpushbutton.h + + diff --git a/src/k9mencodercmdgen.cpp b/src/k9mencodercmdgen.cpp new file mode 100644 index 0000000..2681b82 --- /dev/null +++ b/src/k9mencodercmdgen.cpp @@ -0,0 +1,670 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9mencodercmdgen.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +class _k9CheckListItem: public QCheckListItem { +public: + _k9CheckListItem(QListViewItem *_item):QCheckListItem(_item,"",QCheckListItem::CheckBox) {}; + QString root; + QDomDocument doc; + int page; + QFrame *frame; + int rtti () const {return 1001;} +protected: + void stateChange(bool _state); +}; + +void _k9CheckListItem::stateChange(bool _state) { + QDomElement eRoot=doc.documentElement().elementsByTagName(root).item(0).toElement(); + QDomElement eCodec=eRoot.elementsByTagName(text()).item(0).toElement(); + eCodec.setAttribute("selected",_state?"true":"false"); +} + + +k9MencoderCmdGen::k9MencoderCmdGen(QWidget* parent, const QString &_cmd, bool modal, WFlags fl) +: MyDialog1(parent,"", modal,fl) +{ + setCaption(kapp->makeStdCaption(i18n("MEncoder options"))); + m_row=0; m_page=1; + loadXml(); + parseCmd(_cmd); + + fillListView(); +} + +void k9MencoderCmdGen::fillListView() { + listView->clear(); + listView->header()->hide(); + QListViewItem *item=new QListViewItem(listView); + item->setOpen(true); + item->setText(0,i18n("Audio Codec")); + QDomElement root=m_doc.documentElement().elementsByTagName("AUDIO").item(0).toElement(); + for (int i=0; i< root.childNodes().count();i++) { + QDomElement eChild=root.childNodes().item(i).toElement(); + _k9CheckListItem *child=new _k9CheckListItem(item); + child->setText(0,eChild.nodeName()); + child->root="AUDIO"; + child->doc=m_doc; + QDomAttr attr=eChild.attributeNode("selected"); + if (!attr.isNull()) + child->setOn(attr.value()=="true"); + + addWidgets(child, "AUDIO",eChild.nodeName()); + + } + item=new QListViewItem(listView); + item->setText(0,i18n("Video Codec")); + item->setOpen(true); + root=m_doc.documentElement().elementsByTagName("VIDEO").item(0).toElement(); + for (int i=0; i< root.childNodes().count();i++) { + QDomElement eChild=root.childNodes().item(i).toElement(); + _k9CheckListItem *child=new _k9CheckListItem(item); + child->setText(0,eChild.nodeName()); + child->root="VIDEO"; + child->doc=m_doc; + QDomAttr attr=eChild.attributeNode("selected"); + if (!attr.isNull()) + child->setOn(attr.value()=="true"); + + addWidgets(child, "VIDEO",eChild.nodeName()); + + + } + + item=new QListViewItem(listView); + item->setText(0,i18n("Filters")); + item->setOpen(true); + root=m_doc.documentElement().elementsByTagName("FILTERS").item(0).toElement(); + for (int i=0; i< root.childNodes().count();i++) { + QDomElement eChild=root.childNodes().item(i).toElement(); + _k9CheckListItem *child=new _k9CheckListItem(item); + child->setText(0,eChild.nodeName()); + child->root="FILTERS"; + child->doc=m_doc; + QDomAttr attr=eChild.attributeNode("selected"); + if (!attr.isNull()) + child->setOn(attr.value()=="true"); + + addWidgets(child, "FILTERS",eChild.nodeName()); + } + +} + +k9MencoderCmdGen::~k9MencoderCmdGen() +{ +} + +/*$SPECIALIZATION$*/ + +void k9MencoderCmdGen::listViewCurrentChanged(QListViewItem *_item) { + if (_item->parent() == NULL) + wsOptions->raiseWidget(0); + else if (_item->rtti()==1001) { + _k9CheckListItem *item=(_k9CheckListItem*) _item; + wsOptions->raiseWidget(item->page); + + + } +} + +void k9MencoderCmdGen::loadXml() { + QFile file(KGlobal::dirs()->findResource( "data", "k9copy/mencoder.xml")); + if ( !file.open( IO_ReadOnly ) ) + return; + if ( !m_doc.setContent( &file ) ) { + file.close(); + return; + } + file.close(); + + + } + +void k9MencoderCmdGen::addWidgets(_k9CheckListItem *_listItem,QString _root,QString _cat) { + m_cpt=0; + QVBox *vbox=new QVBox(wsOptions); + wsOptions->addWidget(vbox,m_page); + _listItem->page=m_page; + m_page++; + + QFrame *fr=new QFrame(vbox); + _listItem->frame=fr; + + + QGridLayout *m_grid1=new QGridLayout(fr,1,1,0,0); + m_scrollView=new QScrollView(fr,0); + m_scrollView->viewport()->setPaletteBackgroundColor(this->paletteBackgroundColor()); + m_scrollView->setVScrollBarMode(QScrollView::AlwaysOn); + m_grid1->addWidget(m_scrollView,0,0); + + m_grid=new QGrid(2,m_scrollView->viewport()); + m_grid->setSpacing(2); + m_scrollView->addChild(m_grid); + + + //finds the VIDEO node + QDomElement eVideo=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); + //gets the codec list + QDomNodeList lCodecs=eVideo.elementsByTagName(_cat); + for (int i=0; isetChecked(bSel); + m_hbox=new QGrid(2,m_grid); + m_hbox->setFrameShape(QFrame::StyledPanel); + m_hbox->setFrameShadow(QFrame::Raised); + + if ( !_eOpt.attributeNode("description").isNull()) { + QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + } + + + QDomNodeList lOption=_eOpt.elementsByTagName("subopt"); + for (int i=0; iname()); + +} + + +void k9MencoderCmdGen::addInt(QDomElement _eOpt) { + QString sName=_eOpt.attributeNode("name").value(); + bool blist=false; + if (_eOpt.nodeName()=="subopt") + blist=true; + + int iMin=_eOpt.attributeNode("min").value().toInt(); + int iMax=_eOpt.attributeNode("max").value().toInt(); + int iDefault=_eOpt.attributeNode("default").value().toInt(); + + QWidget *parent; + if (!blist) { + parent=m_grid; + } else + parent=m_hbox; + + bool bSel=false; + QDomAttr aSel=_eOpt.attributeNode("selected"); + if (!aSel.isNull()) + bSel=aSel.value()=="true"; + + QCheckBox *ckLabel=new QCheckBox(sName,parent,QString("ck%1").arg(m_row++) ); + ckLabel->setChecked(bSel); + ckLabel->setBackgroundColor(parent->backgroundColor()); + + if ( !_eOpt.attributeNode("description").isNull()) { + QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + } + _eOpt.setAttribute("checkbox",ckLabel->name()); + + + KIntSpinBox *sb= new KIntSpinBox(iMin,iMax,1,iDefault,10,parent,QString("int%1").arg(m_row++)); + if (iMax <1000) + sb->setFixedWidth(50); + else + sb->setFixedWidth(100); + if( !_eOpt.attributeNode("special").isNull()){ + sb->setSpecialValueText(_eOpt.attributeNode("special").value()); + if (_eOpt.attributeNode("special").value()== _eOpt.attributeNode("default").value()) + sb->setValue(iMin-1); + + } + + _eOpt.setAttribute("widget",sb->name()); + + //m_grid->addWidget(label,m_row++,0); +} +void k9MencoderCmdGen::addFloat(QDomElement _eOpt) { + QString sName=_eOpt.attributeNode("name").value(); + double dMin=_eOpt.attributeNode("min").value().toDouble(); + double dMax=_eOpt.attributeNode("max").value().toDouble(); + double dDefault=_eOpt.attributeNode("default").value().toDouble(); + bool bSel=false; + bool blist=false; + if (_eOpt.nodeName()=="subopt") + blist=true; + + QWidget *parent; + if (!blist) { + parent=m_grid; + } else + parent=m_hbox; + QDomAttr aSel=_eOpt.attributeNode("selected"); + if (!aSel.isNull()) + bSel=aSel.value()=="true"; + + QCheckBox *ckLabel=new QCheckBox(sName,parent,QString("ck%1").arg(m_row++)); + ckLabel->setChecked(bSel); + if ( !_eOpt.attributeNode("description").isNull()) { + QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + } + _eOpt.setAttribute("checkbox",ckLabel->name()); + + double dStep=0.01; + int iPrecision=2; + if (!_eOpt.attributeNode("step").isNull()) { + dStep=_eOpt.attributeNode("step").value().toDouble(); + } + if (!_eOpt.attributeNode("precision").isNull()) { + iPrecision=_eOpt.attributeNode("precision").value().toInt(); + } + KDoubleSpinBox *sb= new KDoubleSpinBox(dMin,dMax,dStep,dDefault,iPrecision,parent,QString("float%1").arg(m_row++)); + if (dMax <1000) + sb->setFixedWidth(80); + else + sb->setFixedWidth(120); + if( !_eOpt.attributeNode("special").isNull()){ + sb->setSpecialValueText(_eOpt.attributeNode("special").value()); + } + + _eOpt.setAttribute("widget",sb->name()); +} + +void k9MencoderCmdGen::addBool(QDomElement _eOpt) { + QString sName=_eOpt.attributeNode("name").value(); + bool blist=false; + if (_eOpt.nodeName()=="subopt") + blist=true; + + bool bSel=false; + QWidget *parent; + if (!blist) { + parent = m_grid; + } else + parent = m_hbox; + + QDomAttr aSel=_eOpt.attributeNode("selected"); + if (!aSel.isNull()) + bSel=aSel.value()=="true"; + + QCheckBox *ckLabel=new QCheckBox(sName,parent,QString("ck%1").arg(m_row++)); + + if ( !_eOpt.attributeNode("description").isNull()) { + QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + } + QWidget *w=new QWidget(parent); + + if ((_eOpt.attributeNode("default").value()=="true") && bSel) + ckLabel->setChecked(true); + + _eOpt.setAttribute("checkbox",ckLabel->name()); + +} + +void k9MencoderCmdGen::addString(QDomElement _eOpt) { + QString sName=_eOpt.attributeNode("name").value(); + bool blist=false; + if (_eOpt.nodeName()=="subopt") + blist=true; + + QString sDefault=_eOpt.attributeNode("default").value(); + QWidget *parent; + if( !blist) { + parent=m_grid; + } else + parent=m_hbox; + + bool bSel=false; + QDomAttr aSel=_eOpt.attributeNode("selected"); + if (!aSel.isNull()) + bSel=aSel.value()=="true"; + + QCheckBox *ckLabel=new QCheckBox(sName,parent,QString("ck%1").arg(m_row++)); + ckLabel->setChecked(bSel); + if ( !_eOpt.attributeNode("description").isNull()) { + QToolTip::add(ckLabel,_eOpt.attributeNode("description").value()); + QWhatsThis::add(ckLabel,_eOpt.attributeNode("description").value()); + } + _eOpt.setAttribute("checkbox",ckLabel->name()); + + QComboBox *cb=new QComboBox(parent,QString("string%1").arg(m_row++)); + + QDomNodeList values=_eOpt.elementsByTagName("value"); + int def=0; + if (values.count()==0) { + cb->setEditable(true); + cb->setCurrentText(sDefault); + } else { + for (int i=0;iinsertItem(e.attributeNode("name").value()); + if (e.attributeNode("name").value() ==sDefault) + def=cb->count()-1; + } + cb->setCurrentItem(def); + } + _eOpt.setAttribute("widget",cb->name()); + +} + +const QString & k9MencoderCmdGen::getCmd(const QString &_root) { + /* QString str; + QTextStream ts(&str,IO_WriteOnly); + m_doc.save(ts,4); + QFile f ("/home/jmp/doc.xml"); + f.open(IO_WriteOnly); + f.writeBlock(str.latin1(),str.length()); + f.close(); +*/ + m_cmd=""; + QString m_sepOpt=":"; + QString m_sepValues=","; + //finds the VIDEO node + QDomElement eRoot=m_doc.documentElement().elementsByTagName(_root).item(0).toElement(); + + //gets the codec list + QDomNodeList lCodecs=eRoot.childNodes(); + for (int i=0; ichild(aCheckBox.value().latin1()); + if (ck->isChecked()) { + if (sCmd1.isEmpty()){ + if (eCodec.attributeNode("options").isNull()) + sCmd1=" -"+eCodec.tagName()+" "; + else + sCmd1=eCodec.tagName()+" -"+eCodec.attributeNode("options").value()+" "; + + } + if(aType.isNull()) { + //build list + eSep=eOpt.attributeNode("separator"); + if (!eSep.isNull()) + m_sepValues=eSep.value(); + QDomNodeList lSubOpt=eOpt.elementsByTagName("subopt"); + QString sCmd2=""; + QString sTmp=""; + for (int k=0;kchild(eSOpt.attributeNode("checkbox").value().latin1()); + if(aSType.value()=="int" && Sck->isChecked()) { + KIntSpinBox *isb=(KIntSpinBox*) this->child(aSWidget.value().latin1(),"KIntSpinBox"); + if (!sCmd2.isEmpty()) + sCmd2 +=m_sepValues; + sCmd2+=sTmp+sPrefix+isb->text().stripWhiteSpace() ; + sTmp=""; + } else if(aSType.value()=="float" && Sck->isChecked()) { + KDoubleSpinBox *isb=(KDoubleSpinBox*) this->child(aSWidget.value().latin1(),"KDoubleSpinBox"); + if (!sCmd2.isEmpty()) + sCmd2 +=m_sepValues; + sCmd2+=sTmp+sPrefix+isb->text().replace(",",".").stripWhiteSpace(); + sTmp=""; + } else if(aSType.value()=="string" && Sck->isChecked()) { + QComboBox *cb=(QComboBox*) this->child(aSWidget.value().latin1(),"QComboBox"); + if (!sCmd2.isEmpty() ) + sCmd2 +=m_sepValues; + // sCmd2+= cb->text(cb->currentItem()); + sCmd2+= sTmp+ sPrefix+cb->currentText(); + sTmp=""; + }else if(aSType.value()=="bool" && Sck->isChecked()) { + if (!sCmd2.isEmpty() ) + sCmd2 +=m_sepValues; + sCmd2+= sTmp+ eSOpt.attributeNode("name").value(); + sTmp=""; + } else if(sPrefix==""){ + sTmp +=m_sepValues; + } + } + if (!sCmd.isEmpty()) + sCmd +=m_sepOpt;; + sCmd+= eOpt.attributeNode("name").value() + "=" +sCmd2; + }else if(aType.value()=="int") { + KIntSpinBox *isb=(KIntSpinBox*) this->child(aWidget.value().latin1(),"KIntSpinBox"); + if (!sCmd.isEmpty()) + sCmd +=m_sepOpt; + sCmd+= eOpt.attributeNode("name").value() + "=" + isb->text(); + } else if(aType.value()=="float") { + KDoubleSpinBox *isb=(KDoubleSpinBox*) this->child(aWidget.value().latin1(),"KDoubleSpinBox"); + if (!sCmd.isEmpty()) + sCmd +=m_sepOpt; + sCmd+= eOpt.attributeNode("name").value() + "=" + isb->text().replace(",","."); + } else if(aType.value()=="string") { + QComboBox *cb=(QComboBox*) this->child(aWidget.value().latin1(),"QComboBox"); + if (!sCmd.isEmpty()) + sCmd +=m_sepOpt; + sCmd+= eOpt.attributeNode("name").value() + "=" + cb->currentText(); + } else if(aType.value()=="bool") { + if (!sCmd.isEmpty()) + sCmd +=m_sepOpt; + sCmd+=eOpt.attributeNode("name").value() ; + } + } + } + m_cmd+=sCmd1+sCmd; + + } + + return m_cmd; +} + +bool k9MencoderCmdGen::getMencoderOptions(QString &_cmd) { + k9MencoderCmdGen * m_cmdGen=new k9MencoderCmdGen(NULL,_cmd); + m_cmdGen->m_cmd=_cmd; + bool res=m_cmdGen->exec(); + if (res) { + QString m_video=m_cmdGen->getCmd("VIDEO").stripWhiteSpace(); + QString m_audio=m_cmdGen->getCmd("AUDIO").stripWhiteSpace(); + QString m_filters=m_cmdGen->getCmd("FILTERS").stripWhiteSpace(); + if (!m_video.isEmpty()) + m_video="-ovc "+m_video; + if (!m_audio.isEmpty()) + m_audio="-oac " +m_audio; + _cmd=" "+m_video+" "+m_audio+" "+m_filters; + } + delete m_cmdGen; + return res; +} + +void k9MencoderCmdGen::parseCmd(const QString &_cmd){ + QString cmd(_cmd); + cmd=cmd.replace("\n"," ").simplifyWhiteSpace(); + QStringList cmdList=QStringList::split(" ",cmd); + for (QStringList::iterator it=cmdList.begin();it!=cmdList.end();++it) { + if (*it=="-ovc") { + ++it; + selectCodec("VIDEO",*it); + } else if (*it=="-oac") { + ++it; + selectCodec("AUDIO",*it); + } else { + if (*it=="-vf") + selectCodec("FILTERS","vf"); + else if (*it=="-af") + selectCodec("FILTERS","af"); + QDomNodeList lRoot=m_doc.documentElement().childNodes(); + bool bFound=false; + QString sCodec=*it; + for (int i=0;i, (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9MENCODERCMDGEN_H +#define K9MENCODERCMDGEN_H + +#include "mencoderCmdGen.h" +#include +#include +#include +#include +#include +#include +class _k9CheckListItem; + +class k9MencoderCmdGen : public MyDialog1 +{ + Q_OBJECT + +public: + k9MencoderCmdGen(QWidget* parent, const QString &_cmd, bool modal = FALSE, WFlags fl = 0 ); + ~k9MencoderCmdGen(); + /*$PUBLIC_FUNCTIONS$*/ + static bool getMencoderOptions(QString &_cmd); +public slots: + /*$PUBLIC_SLOTS$*/ +private: + QScrollView *m_scrollView; + QGrid *m_grid; + QGrid *m_hbox; + int m_row,m_page,m_cpt; + QDomDocument m_doc; + QString m_cmd; + + void addWidgets(_k9CheckListItem *_item,QString _root,QString _cat); + void loadXml(); + void fillListView(); + void addInt(QDomElement _eOpt); + void addFloat(QDomElement _eOpt); + void addBool(QDomElement _eOpt); + void addString(QDomElement _eOpt); + void addList(QDomElement _eOpt); + + const QString & getCmd(const QString &_root); + void selectCodec(const QString &_root,const QString &_codec); + void parseCodecOptions(const QString &_root,const QString &_codec,const QString & _options); + void parseCmd(const QString &_cmd); + +protected: + /*$PROTECTED_FUNCTIONS$*/ + +protected slots: + /*$PROTECTED_SLOTS$*/ + void listViewCurrentChanged(QListViewItem*); +}; + +#endif + diff --git a/src/k9mp4title.cpp b/src/k9mp4title.cpp new file mode 100644 index 0000000..00bf426 --- /dev/null +++ b/src/k9mp4title.cpp @@ -0,0 +1,210 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "k9common.h" +#include "k9mp4title.h" +#include "k9config.h" +#include "k9titleencopt.h" +#include "k9dvdtitle.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +k9MP4Title::k9MP4Title(QWidget* parent, const char* name, WFlags fl) +: prefMPEG4(parent,name,fl) +{ + m_titleEncOpt=NULL; + load(); + ckUseCache->hide(); + tabWidget->setEnabled(false); + lTitle->setText(i18n("Select a Title in the treeview...")); + +} + +k9MP4Title::~k9MP4Title() +{ +} + + +void k9MP4Title::load() { + k9Config config; + + sbMp4Size->setValue(config.getPrefMp4Size()); + sbMp4Size->setSuffix(" "+ i18n("MB")); + sbMp4NumberCD->setValue(config.getPrefMp4NumberCD()); + sbAudioGain->setValue(config.getPrefMp4AudioGain()); + + + leMp4Width->setText(config.getPrefMp4Width()); + leMp4Height->setText(config.getPrefMp4Height()); + + ckMp4AspectRatio->setChecked(config.getPrefMp4AspectRatio()); + leMp4Height->setEnabled(!ckMp4AspectRatio->isChecked()); + + ck2passes->setChecked(config.getPrefMp42Passes()); + ckUseCache->setChecked(config.getPrefUseCellCache()); + + leMp4AudioBitrate->setText(config.getPrefMp4AudioBitrate()); + leMp4VideoBitrate->setText(config.getPrefMp4VideoBitrate()); + + QStringList m_codecLabels=config.getCodecLabels(); + QStringList m_codecLabelsAudio=config.getCodecLabelsAudio(); + + cbMp4Codec->clear(); + + cbMp4Codec->insertStringList(m_codecLabels); + cbMp4Codec->setCurrentItem(config.getPrefMp4Codec()); + + cbMp4AudioCodec->clear(); + cbMp4AudioCodec->insertStringList(m_codecLabelsAudio); + cbMp4AudioCodec->setCurrentItem(config.getPrefMp4AudioCodec()); + + cbMp4AudioCodec->setCurrentItem(config.getPrefMp4AudioCodec()); + if(config.getPrefMp4VideoBitrate() =="") + rbSize->setChecked(true); + else + rbBitrate->setChecked(true); +} + + +/*$SPECIALIZATION$*/ +void k9MP4Title::ckMp4AspectRatioClick() +{ + leMp4Height->setEnabled(!ckMp4AspectRatio->isChecked()); + if (m_titleEncOpt) + m_titleEncOpt->setKeepAspectRatio(ckMp4AspectRatio->isChecked()); + +} + +void k9MP4Title::selectionChanged(k9DVD *_dvd,bool) { + if (_dvd==NULL) + m_titleEncOpt=NULL; + if (m_titleEncOpt) + tabWidget->setEnabled(m_titleEncOpt->getTitle()->isSelected());; + + +} + + +void k9MP4Title::titleChanged( k9DVDTitle *_title) { + if (_title==NULL) { + m_titleEncOpt=NULL; + tabWidget->setEnabled(false); + lTitle->setText(i18n("Select a Title in the treeview...")); + } + else { + lTitle->setText(_title->getname()); + tabWidget->setEnabled( _title->isSelected()); + m_titleEncOpt=_title->getEncOpt(); + k9TitleEncOpt *opt=m_titleEncOpt; + sbMp4Size->setValue(opt->getMaxSize()); + sbMp4NumberCD->setValue(opt->getNumParts() ); + sbAudioGain->setValue(opt->getAudioGain() ); + + leMp4Width->setText(opt->getWidth() ); + leMp4Height->setText(opt->getHeight()); + + ckMp4AspectRatio->setChecked(opt->getKeepAspectRatio()); + leMp4Height->setEnabled(!ckMp4AspectRatio->isChecked()); + + ck2passes->setChecked(opt->get2Passes()); + ckUseCache->setChecked(opt->getUseCache()); + + leMp4AudioBitrate->setText(opt->getAudioBr()); + leMp4VideoBitrate->setText(opt->getVideoBr()); + cbMp4Codec->setCurrentItem(opt->getCodec() ); + cbMp4AudioCodec->setCurrentItem(opt->getAudioCodec()); + + if(opt->getVideoBr() =="") + rbSize->setChecked(true); + else + rbBitrate->setChecked(true); + } + leMp4VideoBitrate->setEnabled(rbBitrate->isChecked()); + sbMp4Size->setEnabled(rbSize->isChecked()); + +} + + +void k9MP4Title::cbMp4CodecActivated( int _value) { + if (m_titleEncOpt) + m_titleEncOpt->setCodec(_value); +} + +void k9MP4Title::cbMp4AudioCodecActivated( int _value) { + if (m_titleEncOpt) + m_titleEncOpt->setAudioCodec(_value); +} + +void k9MP4Title::ck2passesClicked() { + if (m_titleEncOpt) + m_titleEncOpt->set2Passes(ck2passes->isChecked()); +} + +void k9MP4Title::ckUseCacheClick() { + if (m_titleEncOpt) + m_titleEncOpt->setUseCache(ckUseCache->isChecked()); +} + +void k9MP4Title::sbMp4SizeValueChanged( int _value) { + if (m_titleEncOpt) + m_titleEncOpt->setMaxSize(_value); +} + +void k9MP4Title::sbMp4NumberCDValueChanged( int _value ) { + if (m_titleEncOpt) + m_titleEncOpt->setNumParts(_value); +} + +void k9MP4Title::sbAudioGainValueChanged( int _value ) { + if (m_titleEncOpt) + m_titleEncOpt->setAudioGain(_value); +} + +void k9MP4Title::leMp4WidthTextChanged( const QString & _value) { + if (m_titleEncOpt) + m_titleEncOpt->setWidth(_value); +} + +void k9MP4Title::leMp4HeightTextChanged( const QString & _value) { + if (m_titleEncOpt) + m_titleEncOpt->setHeight(_value); +} + +void k9MP4Title::leMp4AudioBitrateTextChanged( const QString & _value) { + if (m_titleEncOpt) + m_titleEncOpt->setAudioBr(_value); +} + + +void k9MP4Title::leMp4VideoBitrateTextChanged( const QString & _value) { + if (m_titleEncOpt) + m_titleEncOpt->setVideoBr(_value); +} + + +void k9MP4Title::rgVideoSizeChanged(){ + if (rbSize->isChecked()) + leMp4VideoBitrate->setText(""); + leMp4VideoBitrate->setEnabled(rbBitrate->isChecked()); + sbMp4Size->setEnabled(rbSize->isChecked()); +} + +#include "k9mp4title.moc" + diff --git a/src/k9mp4title.h b/src/k9mp4title.h new file mode 100644 index 0000000..da020f4 --- /dev/null +++ b/src/k9mp4title.h @@ -0,0 +1,59 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9MP4TITLE_H +#define K9MP4TITLE_H + +#include "prefMPEG4.h" +#include "k9titleencopt.h" + + +class k9DVDTitle; +class k9DVD; +class k9MP4Title : public prefMPEG4 +{ + Q_OBJECT + +public: + k9MP4Title(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9MP4Title(); + /*$PUBLIC_FUNCTIONS$*/ +private: + k9TitleEncOpt *m_titleEncOpt; +public slots: + /*$PUBLIC_SLOTS$*/ + virtual void ckMp4AspectRatioClick(); + virtual void load(); + virtual void titleChanged(k9DVDTitle *_title); + virtual void selectionChanged(k9DVD *_dvd,bool); +protected slots: + /*$PROTECTED_SLOTS$*/ + virtual void cbMp4CodecActivated( int ); + virtual void cbMp4AudioCodecActivated( int ); + + virtual void ck2passesClicked(); + virtual void sbMp4SizeValueChanged( int ); + virtual void sbAudioGainValueChanged( int ); + + virtual void sbMp4NumberCDValueChanged( int ); + virtual void leMp4WidthTextChanged( const QString & ); + virtual void leMp4HeightTextChanged( const QString & ); + virtual void leMp4AudioBitrateTextChanged( const QString & ); + virtual void leMp4VideoBitrateTextChanged( const QString & ); + + virtual void rgVideoSizeChanged(); + + virtual void ckUseCacheClick(); +}; + +#endif + diff --git a/src/k9play.cpp b/src/k9play.cpp new file mode 100644 index 0000000..c772a1d --- /dev/null +++ b/src/k9play.cpp @@ -0,0 +1,568 @@ +// +// C++ Implementation: k9play +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9play.h" +#include "k9dvdread.h" +#include "k9cell.h" +#include "k9vamps.h" +#include "ac.h" + +#include "dvdnav.h" +#include "k9saveimage.h" +#include +#include +#include +#include +#include +#include +#include "dvdread.h" +#include +#include + +void k9play::saveStatus(k9play_st _status) { + QFile fstatus(m_inject); + fstatus.open(IO_WriteOnly); + fstatus.writeBlock((const char*)&_status,sizeof(k9play_st)); + fstatus.close(); + kdebug (QString("saving status : %1 %2 %3 %4 %5 %6 %7\n").arg(_status.title).arg(_status.chapter).arg(_status.cell).arg(_status.sector).arg(_status.bytesWritten).arg(_status.bytesRead).arg(_status.bytesSkipped)); + +} + +void k9play::readStatus(k9play_st &_status) { + QFile fstatus(m_inject); + if (fstatus.open(IO_ReadOnly)) { + fstatus.readBlock((char*)&_status,sizeof(k9play_st)); + fstatus.close(); + } else memset(&_status,0,sizeof(k9play_st)); + + kdebug (QString("reading status : title:%1 chapter:%2 cell:%3 sector:%4 written:%5 readen:%6 skipped:%7 chapters:%8 \n").arg(_status.title).arg(_status.chapter).arg(_status.cell).arg(_status.sector).arg(_status.bytesWritten).arg(_status.bytesRead).arg(_status.bytesSkipped).arg(_status.bytesChapters)); + +} + + +k9play::k9play() { + m_stderr.open(IO_WriteOnly,stderr); + m_startSector=0xFFFFFFFF; + m_endSector=0xFFFFFFFF; + m_vampsFactor=1; + m_inputSize=1; + m_chapterSize=0; + m_chapter=0; + m_cell=0; + m_totalSize=0; + m_forcedFactor=false; + m_firstPass=false; + m_useCache=false; +} + +void k9play::kdebug(QString const & _msg) { + #ifdef debug + m_stderr.writeBlock(_msg.latin1(),_msg.length()); + #endif +} + +void k9play::writeOutput(QString const & _msg) { + m_stderr.writeBlock(_msg.latin1(),_msg.length()); +} + + +k9play::~k9play() { + m_stderr.close(); +} + +void k9play::setstartSector(QString _value) { + if (_value !="") + m_startSector=_value.toUInt(); +} + +void k9play::setinject(QString _value) { + m_inject=_value; +} + +void k9play::setendSector(QString _value) { + if (_value!="") + m_endSector=_value.toUInt(); +} + +void k9play::setaudioFilter( QString _value) { + if (_value!="") + m_audioFilter=QStringList::split(",",_value); +} + +void k9play::setsubpictureFilter( QString _value) { + if (_value!="") + m_subpictureFilter=QStringList::split(",",_value); +} + +void k9play::setchapterList( QString _value) { + if (_value!="") + m_chapterList=QStringList::split(",",_value); +} + +void k9play::setvampsFactor(QString _value) { + if (_value!="") + m_vampsFactor=_value.toDouble(); +} + +void k9play::setinputSize( QString _value) { + if (_value!="") + m_inputSize=_value.toULongLong(); +} + +void k9play::settotalSize( QString _value) { + if (_value!="") + m_totalSize=_value.toULongLong(); +} + +void k9play::setdvdSize( QString _value) { + if (_value!="") + m_dvdSize=_value.toULongLong(); +} + +void k9play::setchapterSize( QString _value) { + if (_value!="") + m_chapterSize=_value.toULongLong(); +} + + +void k9play::setchapter( QString _value) { + if (_value!="") + m_chapter=_value.toUInt(); +} + +void k9play::setcell(QString _value) { + if (_value !="") + m_cell=_value.toUInt(); +} + +void k9play::setinitStatus(bool _value) { + m_initstatus=_value; +} + +void k9play::setcontinue(bool _value) { + m_continue=_value; +} + +void k9play::setfirstPass(bool _value) { + m_firstPass=_value; +} + +void k9play::setforcedFactor( bool _value) { + m_forcedFactor=_value; +} + +void k9play::setuseCache(bool _value) { + m_useCache=_value; +} +void k9play::execute() { + //playCell(); + play(); + return; +} + + +void k9play::insert_nav_pack (int8_t *buf) +{ + int8_t *ptr = (int8_t*)buf; + static uint8_t nav_pack1 [] = + { + /* pack header: SCR=0, mux rate=10080000bps, stuffing length=0 */ + 0, 0, 1, 0xba, 0x44, 0x00, 0x04, 0x00, 0x04, 0x01, 0x01, 0x89, 0xc3, 0xf8, + /* system header */ + 0, 0, 1, 0xbb, 0x00, 0x12, + /* contents of system header filled in at run time (18 bytes) */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /* PES header for first private stream 2 packet */ + 0, 0, 1, 0xbf, 0x03, 0xd4 + }; + static uint8_t nav_pack2 [] = + { + /* PES header for second private stream 2 packet */ + 0, 0, 1, 0xbf, 0x03, 0xfa + }; + + memcpy (ptr, nav_pack1, sizeof (nav_pack1)); + ptr += sizeof (nav_pack1); + memset (ptr, 0, DVD_VIDEO_LB_LEN/2 - sizeof (nav_pack1)); + ptr = buf + DVD_VIDEO_LB_LEN/2; + memcpy (ptr, nav_pack2, sizeof (nav_pack2)); + ptr += sizeof (nav_pack2); + memset (ptr, 0, DVD_VIDEO_LB_LEN/2 - sizeof (nav_pack2)); +} + +void k9play::insert_dummy_pack (int8_t *buf) +{ + int8_t *ptr = buf; + static uint8_t dummy_pack [] = + { + /* pack header: SCR=0, mux rate=10080000bps, stuffing length=0 */ + 0, 0, 1, 0xba, 0x44, 0x00, 0x04, 0x00, 0x04, 0x01, 0x01, 0x89, 0xc3, 0xf8, + /* PES header for dummy video packet */ + 0, 0, 1, 0xe0, 0x07, 0xec, 0x81, 0x00, 0x00 + }; + + memcpy (ptr, dummy_pack, sizeof (dummy_pack)); + ptr += sizeof (dummy_pack); + memset (ptr, 0xff, DVD_VIDEO_LB_LEN - sizeof (dummy_pack)); +} + + + +/* which is the default language for menus/audio/subpictures? */ +#define DVD_LANGUAGE "en" +#define DVD_READ_CACHE 1 + +void k9play::play() { + dvdnav_t *dvdnav; + uint8_t mem[DVD_VIDEO_LB_LEN]; + int finished = 0; + bool skipped=false; + int32_t tt = 0,ptt=0; + uint32_t pos, lgr; + uint currCell=0; + m_pos=0xFFFFFFFF; + k9play_st status; + + if (m_initstatus) + memset(&status,0,sizeof(k9play_st)); + else { + readStatus( status); + if (m_continue) + m_startSector=status.sector; + } + + + + KTempFile *bufferFile; + if (m_useCache) { + bufferFile=new KTempFile(locateLocal("tmp", "k9copy/k9p"), ""); + m_output=bufferFile->file(); + } else { + m_output=new QFile(); + m_output->open(IO_WriteOnly,stdout); + } + k9vamps vamps(NULL); + vamps.reset(); + vamps.setPreserve( false); + vamps.setOutput(m_output); + k9SaveImage saveImage; + saveImage.play(); + vamps.setSaveImage(&saveImage); + + // if reading of previous cell reached end of chapter, don't seek for cell + if (m_chapter !=0 && m_cell !=0) { + if (m_cell==1) { + if (status.bytesRead <=status.bytesChapters) + status.bytesSkipped = status.bytesChapters - status.bytesRead; + else + status.bytesSkipped=0; + status.bytesChapters += m_chapterSize; + } + if (status.title == m_title && + status.chapter > m_chapter) { + skipped=true; + } + } + + //vamps.setVapFactor( m_vampsFactor); + if (m_totalSize>0 && !m_forcedFactor) { + double factor; + factor = (double) (m_totalSize - (status.bytesRead +status.bytesSkipped)) / (double) (m_dvdSize-status.bytesWritten) ; + if (factor <1) factor =1; + kdebug(QString("shrink factor %1 totalSize:%2 (status.bytesRead +status.bytesSkipped):%3 m_dvdSize:%4 status.bytesWritten:%5").arg(factor).arg(m_totalSize).arg(status.bytesRead +status.bytesSkipped).arg(m_dvdSize).arg(status.bytesWritten) ); + vamps.setVapFactor(factor); + } else { + vamps.setVapFactor(m_vampsFactor); + kdebug(QString("vamps factor %1\n").arg(m_vampsFactor)); + } + + + vamps.setInputSize(m_inputSize); + for ( QStringList::Iterator it = m_audioFilter.begin(); it != m_audioFilter.end(); ++it ) { + vamps.addAudio((*it).toInt()); + } + + for ( QStringList::Iterator it = m_subpictureFilter.begin(); it != m_subpictureFilter.end(); ++it ) { + vamps.addSubpicture((*it).toInt()); + } + + /* open dvdnav handle */ + if (dvdnav_open(&dvdnav, m_device,NULL) != DVDNAV_STATUS_OK) { + writeOutput("ERR:Error on dvdnav_open\n"); + return ; + } + + /* set read ahead cache usage */ + if (dvdnav_set_readahead_flag(dvdnav, DVD_READ_CACHE) != DVDNAV_STATUS_OK) { + writeOutput( QString("ERR:Error on dvdnav_set_readahead_flag: %1\n").arg(dvdnav_err_to_string(dvdnav))); + return; + } + + /* set the language */ + if (dvdnav_menu_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK || + dvdnav_audio_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK || + dvdnav_spu_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK) { + writeOutput( QString("ERR:Error on setting languages: %1\n").arg(dvdnav_err_to_string(dvdnav))); + return ; + } + + /* set the PGC positioning flag to have position information relatively to the + * whole feature instead of just relatively to the current chapter */ + if (dvdnav_set_PGC_positioning_flag(dvdnav, 1) != DVDNAV_STATUS_OK) { + writeOutput(QString("ERR:Error on dvdnav_set_PGC_positioning_flag: %1\n").arg(dvdnav_err_to_string(dvdnav))); + return ; + } + + int32_t parts; + dvdnav_get_number_of_parts(dvdnav , m_title, &parts); + + if (m_chapter ==0) + dvdnav_title_play(dvdnav , m_title); + else { + dvdnav_part_play(dvdnav, m_title, m_chapter); + ptt=m_chapter; + } + /* the read loop which regularly calls dvdnav_get_next_block + * and handles the returned events */ + bool bcopy=false; + bool bcell=true; + + + while (!finished && !skipped) { + int result, event, len; + uint8_t *buf = mem; + + /* the main reading function */ +#if DVD_READ_CACHE + + result = dvdnav_get_next_cache_block(dvdnav, &buf, &event, &len); +#else + + result = dvdnav_get_next_block(dvdnav, buf, &event, &len); +#endif + + + if (result == DVDNAV_STATUS_ERR) { + writeOutput(QString("ERR:Error getting next block: %1\n").arg(dvdnav_err_to_string(dvdnav))); + return; + } + switch (event) { + case DVDNAV_NAV_PACKET: + { + dvdnav_current_title_info(dvdnav, &tt, &ptt); + dvdnav_get_position(dvdnav, &pos, &lgr); + m_length=lgr; + status.title=tt; + status.chapter=ptt; + status.cell=currCell; + status.sector=pos; + + if ((m_endSector !=0xFFFFFFFF) && (((status.bytesRead+status.bytesSkipped)/2048) >m_endSector)) { + finished=1; + kdebug(QString("pos >m_endSector %1 %2").arg((status.bytesRead+status.bytesSkipped)/2048).arg(m_endSector)); + } + if ((m_chapter !=0 && ptt !=m_chapter) || (tt != m_title)) + finished=1; + if (m_cell!=0 && currCell>m_cell) + finished=1; + + if (!finished && m_chapterList.count() >0) { + if (m_chapterList.findIndex( QString::number(ptt)) == -1) { + dvdnav_part_play(dvdnav,tt, ptt+1); + kdebug( QString("skipping chapter %1").arg(ptt)); + continue; + //dvdnav_part_play(dvdnav_t *self, int32_t title, int32_t part); + } + + } + + if (m_continue) { + dvdnav_sector_search(dvdnav,m_startSector , SEEK_SET); + kdebug (QString("repositionning on %1").arg(m_startSector)); + m_continue=false; + finished=0; + bcell=true; + } else { + if ((m_cell==0 || (m_cell!=0 && currCell==m_cell)) && finished==0) { + if (!vamps.running()) + vamps.start(QThread::NormalPriority); + bcopy=true; + vamps.addData( buf,len); + status.bytesRead +=len; + if (!m_useCache) + writeOutput(QString("\rINFOPOS: %1 %2").arg((status.bytesRead+status.bytesSkipped) / DVD_VIDEO_LB_LEN).arg(lgr)); + if (m_pos==0xFFFFFFFF) + m_pos=(status.bytesRead+status.bytesSkipped) / DVD_VIDEO_LB_LEN; + } + + } + + } + break; + //removed break --> save + case DVDNAV_BLOCK_OK: + /* We have received a regular block of the currently playing MPEG stream.*/ + if (m_cell==0 || (m_cell!=0 && currCell==m_cell)) { + if (!vamps.running()) + vamps.start(QThread::NormalPriority); + vamps.addData( buf,len); + status.bytesRead +=len; + bcopy=true; + } + break; + case DVDNAV_NOP: + /* Nothing to do here. */ + break; + case DVDNAV_STILL_FRAME: + /* We have reached a still frame. A real player application would wait + * the amount of time specified by the still's length while still handling + * user input to make menus and other interactive stills work. + * A length of 0xff means an indefinite still which has to be skipped + * indirectly by some user interaction. */ + { + dvdnav_still_skip(dvdnav); + } + break; + case DVDNAV_WAIT: + /* We have reached a point in DVD playback, where timing is critical. + * Player application with internal fifos can introduce state + * inconsistencies, because libdvdnav is always the fifo's length + * ahead in the stream compared to what the application sees. + * Such applications should wait until their fifos are empty + * when they receive this type of event. */ + dvdnav_wait_skip(dvdnav); + break; + case DVDNAV_SPU_CLUT_CHANGE: + /* Player applications should pass the new colour lookup table to their + * SPU decoder */ + break; + case DVDNAV_SPU_STREAM_CHANGE: + /* Player applications should inform their SPU decoder to switch channels */ + break; + case DVDNAV_AUDIO_STREAM_CHANGE: + /* Player applications should inform their audio decoder to switch channels */ + break; + case DVDNAV_HIGHLIGHT: + /* Player applications should inform their overlay engine to highlight the + * given button */ + break; + case DVDNAV_VTS_CHANGE: + /* Some status information like video aspect and video scale permissions do + * not change inside a VTS. Therefore this event can be used to query such + * information only when necessary and update the decoding/displaying + * accordingly. */ + break; + case DVDNAV_CELL_CHANGE: + if (bcell) { + currCell++; + dvdnav_get_position(dvdnav, &pos, &lgr); + status.title=tt; + status.chapter=ptt; + status.cell=currCell; + status.sector=pos; + + if (m_useCache) { + flush(saveImage); + delete bufferFile; + bufferFile=new KTempFile(locateLocal("tmp", "k9copy/k9p"), ""); + m_output=bufferFile->file(); + vamps.setOutput(m_output); + } + } + break; + case DVDNAV_HOP_CHANNEL: + /* This event is issued whenever a non-seamless operation has been executed. + * Applications with fifos should drop the fifos content to speed up responsiveness. */ + break; + case DVDNAV_STOP: + /* Playback should end here. */ + { + finished = 1; + } + break; + default: + finished = 1; + break; + } + +#if DVD_READ_CACHE + dvdnav_free_cache_block(dvdnav, buf); +#endif + + } + vamps.setNoData(); + vamps.wait(); + /* destroy dvdnav handle */ + dvdnav_close(dvdnav); + + if (! bcopy) { + int8_t buf[DVD_VIDEO_LB_LEN]; + insert_nav_pack(buf); + m_output->writeBlock((const char*)buf,DVD_VIDEO_LB_LEN); + insert_dummy_pack(buf); + m_output->writeBlock((const char*)buf,DVD_VIDEO_LB_LEN); + + } + if (m_useCache) + flush(saveImage); + else { + m_output->close(); + delete m_output; + } + saveImage.stop(); + + status.bytesWritten +=vamps.getOutputBytes(); + if (!m_firstPass) + saveStatus( status); + delete bufferFile; +} + +void k9play::flush(k9SaveImage &_saveImage ) { + char buffer[20*DVD_VIDEO_LB_LEN]; + m_output->reset(); + QFile out; + out.open(IO_WriteOnly,stdout); + while(!m_output->atEnd()) { + writeOutput(QString("\rINFOPOS: %1 %2").arg(m_pos).arg(m_length)); + m_pos+=20; + int l=m_output->readBlock(buffer,20*DVD_VIDEO_LB_LEN); + if (l>0) { + out.writeBlock(buffer,l); + } + } + m_output->close(); + m_output->remove(); + m_pos=0xFFFFFFFF; +} + +bool k9play::readNavPack (k9DVDFile *fh, dsi_t *dsi,int sector,uchar *_buffer) +{ + int n; + /* try max_read_retries+1 times */ + n = fh->readBlocks( sector, 1,_buffer); + + if (n == 1) + { + /* read Ok */ + if (k9Cell::isNavPack (_buffer)) + /* parse contained DSI pack */ + navRead_DSI (dsi, _buffer + DSI_START_BYTE); + if (sector == dsi -> dsi_gi.nv_pck_lbn) { + return true; + } + } + return false; +} + + + + + diff --git a/src/k9play.h b/src/k9play.h new file mode 100644 index 0000000..8a9232a --- /dev/null +++ b/src/k9play.h @@ -0,0 +1,101 @@ +// +// C++ Interface: k9play +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9PLAY_H +#define K9PLAY_H + +#include "k9common.h" +#include "k9dvdtitle.h" +#include +/** + @author Jean-Michel PETIT +*/ + +typedef struct { + uint title; + uint chapter; + uint cell; + uint32_t sector; + uint64_t bytesWritten; + uint64_t bytesRead; + uint64_t bytesSkipped; + uint64_t bytesChapters; +} k9play_st; + + +class k9SaveImage; +class k9play{ +private: + int m_title; + k9DVD *m_dvd; + k9DVDTitle *m_dvdTitle; + QString m_device; + QFile *m_output; + QFile m_stderr; + uint32_t m_totalBytes; + uint32_t m_startSector,m_endSector; + uint32_t m_pos,m_length; + double m_vampsFactor; + uint64_t m_inputSize; + uint64_t m_totalSize; + uint64_t m_chapterSize; + uint64_t m_dvdSize; + uint m_chapter; + uint m_cell; + bool m_initstatus; + bool m_continue; + bool m_firstPass; + bool m_forcedFactor; + bool m_useCache; + QString m_inject; + QStringList m_audioFilter; + QStringList m_subpictureFilter; + QStringList m_chapterList; + void kdebug(QString const & _msg); + bool readNavPack (k9DVDFile *fh, dsi_t *dsi,int sector, uchar *_buffer); + void insert_dummy_pack (int8_t *buf); + void insert_nav_pack (int8_t *buf); + void saveStatus(k9play_st _status); + void readStatus(k9play_st &_status); + void flush(k9SaveImage &_saveImage); +public: + k9play(); + + ~k9play(); + void execute(); + void play(); + void writeOutput(QString const & _msg); + + void setTitle(int _value) {m_title = _value;}; + + void setDevice(const QString& _value) {m_device = _value;}; + + void setstartSector(QString _value); + void setendSector(QString _value); + void setaudioFilter(QString _value); + void setsubpictureFilter(QString _value); + void setchapterList(QString _value); + void setvampsFactor(QString _value); + void setinputSize(QString _value); + void settotalSize(QString _value); + void setchapter(QString _value); + void setcell(QString _value); + void setinject(QString _value); + void setdvdSize(QString _value); + void setchapterSize(QString _value); + void setinitStatus(bool _value); + void setcontinue (bool _value); + void setfirstPass (bool _value); + void setforcedFactor(bool _value); + void setuseCache(bool _value); +}; + +#endif diff --git a/src/k9playbackoptions.cpp b/src/k9playbackoptions.cpp new file mode 100644 index 0000000..3bf9715 --- /dev/null +++ b/src/k9playbackoptions.cpp @@ -0,0 +1,223 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9playbackoptions.h" +#include "k9config.h" +#include +#include + +k9PlaybackOptions::k9PlaybackOptions(k9Main *mainWindow, QWidget* parent, const char* name, WFlags fl) +: PlaybackOptionsw(parent,name,fl) +{ + + setMain( mainWindow); + m_main->setPlaybackOptions(this); + enable(false); + bSeqUp->setPixmap(SmallIcon("1uparrow")); + bSeqDown->setPixmap(SmallIcon("1downarrow")); + k9Config config; + ckMenu->setChecked(config.getKeepMenus()); + ckMenuClick(); + +} + +k9PlaybackOptions::~k9PlaybackOptions() +{ +} + +/*$SPECIALIZATION$*/ + void k9PlaybackOptions::setMain(k9Main* _value) { + m_main = _value; m_dvd=m_main->dvd; +} + + +void k9PlaybackOptions::fillTitleList() { + QString txt=lbSequence->currentText(); + + lbSequence->clear(); + k9DVDTitle *title=m_dvd->getstart(); + + bool found=title !=NULL; + //Reconstitution de l'ordre de lecture à partir des titres du DVD + while (found) { + if (title->isSelected()) { + lbItem *item=new lbItem(lbSequence,title->getname()); + item->setTitle(title); + if (title->getname()==txt) + lbSequence->setCurrentItem(item); + } + title=title->getnextTitle(); + found=title!=NULL; + } + + + for (int i=0;igettitleCount();i++) { + k9DVDTitle* l_track=m_dvd->gettitle(i); + if (l_track->getIndexed()) { + QString sTitle=l_track->getname(); + if(l_track->isSelected()) { + bool foundtitle=false; + for (uint j=0; jcount();j++) { + lbItem *tmp=(lbItem*)lbSequence->item(j); + if (tmp->getTitle() == l_track) + foundtitle=true; + } + if (!foundtitle) { + lbItem *item=new lbItem(lbSequence,sTitle); + item->setTitle(l_track); + if (sTitle==txt) + lbSequence->setCurrentItem(item); + } + } + } + } + if (lbSequence->currentItem()==-1) + lbSequence->setCurrentItem(0); + setSequence(); + enable(!ckMenu->isChecked() ); + +} + +void k9PlaybackOptions::ckMenuClick() { + + if (m_main!=NULL) { + enable((!ckMenu->isChecked()) && m_dvd->getopened()); + m_main->updateFactor(); + } else + enable(false); +} + +void k9PlaybackOptions::bSeqUpClick() { + int cur=lbSequence->currentItem(); + if (cur >0) { + lbItem *lbi=(lbItem*)lbSequence->item(cur); + lbSequence->takeItem(lbi); + lbSequence->insertItem(lbi,cur-1); + lbSequence->setCurrentItem(lbi); + } + setSequence(); +} + +void k9PlaybackOptions::bSeqDownClick() { + uint cur=lbSequence->currentItem(); + if (cur count()) { + lbItem *lbi=(lbItem*)lbSequence->item(cur); + lbSequence->takeItem(lbi); + lbSequence->insertItem(lbi,cur+1); + lbSequence->setCurrentItem(lbi); + } + setSequence(); +} + +void k9PlaybackOptions::setSequence() { + for (int i=0;i gettitleCount();i++) + m_dvd->gettitle(i)->setnextTitle( NULL); + + lbItem *lbi = (lbItem*)lbSequence->item(lbSequence->topItem()); + if (lbi !=NULL) { + lbItem *lbi2; + m_dvd->setstart(lbi->getTitle()); + for (uint i=0 ; i < lbSequence->count()-1;i++) { + lbi=(lbItem*)lbSequence->item(i); + lbi2=(lbItem*)lbSequence->item(i+1); + lbi->getTitle()->setnextTitle(lbi2->getTitle()); + } + } +} + +void k9PlaybackOptions::lbSequenceChanged(QListBoxItem *_item) { + if (_item == NULL) + return; + lbItem *lbi=(lbItem*) _item; + k9DVDTitle *title=lbi->getTitle(); + cbDefAudio->clear(); + cbDefSub->clear(); + lstAudioDef.clear(); + lstSubDef.clear(); + cbDefAudio->insertItem(i18n("default")); + lstAudioDef.append(NULL); + cbDefSub->insertItem(i18n("none")); + lstSubDef.append(NULL); + + for (int i=0;i < title->getaudioStreamCount();i++) { + if (title->getaudioStream(i)->getselected()) { +// if ( !title->getDefAudioSet()) +// title->setDefAudio(title->getaudioStream(i)); + cbDefAudio->insertItem( QString("%1 - %2").arg(title->getaudioStream(i)->getID()).arg(title->getaudioStream(i)->getlanguage())); + if (title->getaudioStream(i)==title->getDefAudio()) { + cbDefAudio->setCurrentItem(cbDefAudio->count()-1); + } + lstAudioDef.append(title->getaudioStream(i)); + } + } + + for (int i=0;i < title->getsubPictureCount();i++) { + if (title->getsubtitle(i)->getselected()) { + QPixmap icon; + cbDefSub->insertItem(QString("%1 - %2").arg(title->getsubtitle(i)->getID().first()).arg(title->getsubtitle(i)->getlanguage())); + if (title->getsubtitle(i)==title->getDefSubtitle()) { + cbDefSub->setCurrentItem(cbDefSub->count()-1); + } + lstSubDef.append(title->getsubtitle(i)); + } + } + +} + +void k9PlaybackOptions::cbDefAudioActivated(int _index) { + int cur=lbSequence->currentItem(); + lbItem *lbi=(lbItem*)lbSequence->item(cur); + lbi->getTitle()->setDefAudio(lstAudioDef.at(_index)); +} + +void k9PlaybackOptions::cbDefSubActivated(int _index) { + int cur=lbSequence->currentItem(); + lbItem *lbi=(lbItem*)lbSequence->item(cur); + lbi->getTitle()->setDefSubtitle(lstSubDef.at(_index)); +} + +void k9PlaybackOptions::titleRenamed (k9DVDTitle *_title, QString _newName) { + for (uint j=0; jcount();j++) { + lbItem *tmp=(lbItem*)lbSequence->item(j); + if (tmp->getTitle() == _title) { + lbItem *item=new lbItem(NULL,_newName); + item->setTitle(_title); + lbSequence->changeItem(item,j); + break; + } + } + +} + +bool k9PlaybackOptions::withMenus() { + return ckMenu->isChecked(); +} + +void k9PlaybackOptions::setwithMenus(bool _value) { + ckMenu->setChecked(_value); + +} + + +void k9PlaybackOptions::enable(bool _value) { + frPlayback->setEnabled(_value); +} + +void k9PlaybackOptions::clear() { + lbSequence->clear(); + enable(false); +} + + +#include "k9playbackoptions.moc" + diff --git a/src/k9playbackoptions.h b/src/k9playbackoptions.h new file mode 100644 index 0000000..55ee39d --- /dev/null +++ b/src/k9playbackoptions.h @@ -0,0 +1,79 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9PLAYBACKOPTIONS_H +#define K9PLAYBACKOPTIONS_H +#include "k9common.h" +#include "playbackoptionsw.h" +#include "k9dvd.h" +#include "k9main.h" +#include "k9dvdtitle.h" +#include +#include + +class lbItem : public QListBoxText { +protected: + k9DVDTitle *m_title; +public: + + lbItem(QListBox * listbox, const QString & text = QString::null ): + QListBoxText(listbox,text) {} + ; + void setTitle(k9DVDTitle *_value) { + m_title = _value; + } + k9DVDTitle *getTitle() const { + return m_title; + } +}; + +class k9Main; + +class k9PlaybackOptions : public PlaybackOptionsw +{ + Q_OBJECT + +public: + k9PlaybackOptions(k9Main *mainWindow,QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9PlaybackOptions(); + /*$PUBLIC_FUNCTIONS$*/ + void fillTitleList(); + k9DVD *m_dvd; + k9Main *m_main; + void setDvd(k9DVD* _value) {m_dvd = _value;} + void setMain(k9Main* _value); + void setSequence(); + void titleRenamed (k9DVDTitle *_title, QString _newName); + bool withMenus() ; + void setwithMenus(bool _value); + void enable(bool _value); + void clear(); +public slots: + /*$PUBLIC_SLOTS$*/ + virtual void ckMenuClick(); + +protected: + /*$PROTECTED_FUNCTIONS$*/ + QPtrList lstAudioDef; + QPtrList lstSubDef; + +protected slots: + /*$PROTECTED_SLOTS$*/ + virtual void bSeqUpClick(); + virtual void bSeqDownClick(); + virtual void cbDefAudioActivated(int _index); + virtual void cbDefSubActivated(int _index); + virtual void lbSequenceChanged (QListBoxItem * _item); +}; + +#endif + diff --git a/src/k9prefauthor.cpp b/src/k9prefauthor.cpp new file mode 100644 index 0000000..6717bce --- /dev/null +++ b/src/k9prefauthor.cpp @@ -0,0 +1,60 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "k9prefauthor.h" +#include "k9config.h" +#include +#include +#include +#include + +k9prefAuthor::k9prefAuthor(QWidget* parent, const char* name, WFlags fl) +: prefAuthor(parent,name,fl) +{ + load(); +} + +void k9prefAuthor::load() { + k9Config config; + cbAudioFormat->setCurrentText(config.getPrefAudioFormat()); + cbAudioBitrate->setCurrentText(QString::number(config.getPrefAudioBitrate())); + inButtonWidth->setValue(config.getPrefButtonWidth()); + inButtonHeight->setValue(config.getPrefButtonHeight()); + cbHiliteColor->setColor(config.getPrefButtonHiliteColor()); + cbTextColor->setColor(config.getPrefButtonTextColor()); + m_font=config.getPrefButtonFont(); +} + +k9prefAuthor::~k9prefAuthor() +{ +} + +/*$SPECIALIZATION$*/ +void k9prefAuthor::bButtonFontClicked() +{ + KFontDialog::getFont( m_font ); +} + +void k9prefAuthor::save() { + k9Config config; + config.setPrefAudioFormat(cbAudioFormat->currentText()); + config.setPrefAudioBitrate(cbAudioBitrate->currentText().toInt()); + config.setPrefButtonWidth(inButtonWidth->value()); + config.setPrefButtonHeight(inButtonHeight->value()); + config.setPrefButtonHiliteColor(cbHiliteColor->color()); + config.setPrefButtonFont(m_font); + config.setPrefButtonTextColor(cbTextColor->color()); + config.save(); +} + +#include "k9prefauthor.moc" + diff --git a/src/k9prefauthor.h b/src/k9prefauthor.h new file mode 100644 index 0000000..be59c40 --- /dev/null +++ b/src/k9prefauthor.h @@ -0,0 +1,41 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9PREFAUTHOR_H +#define K9PREFAUTHOR_H +#include "k9common.h" +#include "prefAuthor.h" +#include + +class k9prefAuthor : public prefAuthor +{ + Q_OBJECT + +public: + k9prefAuthor(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9prefAuthor(); + /*$PUBLIC_FUNCTIONS$*/ + void load(); +public slots: + /*$PUBLIC_SLOTS$*/ + virtual void bButtonFontClicked(); + virtual void save(); +protected: + /*$PROTECTED_FUNCTIONS$*/ + QFont m_font; +protected slots: + /*$PROTECTED_SLOTS$*/ + +}; + +#endif + diff --git a/src/k9prefdvd.cpp b/src/k9prefdvd.cpp new file mode 100644 index 0000000..8238b1c --- /dev/null +++ b/src/k9prefdvd.cpp @@ -0,0 +1,57 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9prefdvd.h" +#include "k9config.h" +#include +#include +#include +#include +#include + +k9prefDVD::k9prefDVD(QWidget* parent, const char* name, WFlags fl) +: prefDVD(parent,name,fl) +{ + k9Config config; + urOutput->setMode(2); + urOutput->setURL(config.getPrefOutput()); + ckK3b->setChecked(config.getPrefK3b()); + + ckAutoBurn->setChecked(config.getPrefAutoBurn()); + ckQuickScan->setChecked(config.getQuickScan()); + ckDvdAuthor->setChecked(config.getUseDvdAuthor()); + ckDelTmpFiles->setChecked(config.getPrefDelTmpFiles()); + sbSize->setValue(config.getPrefSize()); + sbSize->setSuffix(" "+ i18n("MB")); +} + +k9prefDVD::~k9prefDVD() +{ +} + +/*$SPECIALIZATION$*/ + +void k9prefDVD::save() { + k9Config config; + config.setPrefOutput( urOutput->url()); + config.setPrefK3b(ckK3b->isChecked()); + config.setPrefAutoBurn( ckAutoBurn->isChecked()); + config.setPrefSize(sbSize->value()); + config.setQuickScan( ckQuickScan->isChecked()); + config.setUseDvdAuthor( ckDvdAuthor->isChecked()); + config.setPrefDelTmpFiles(ckDelTmpFiles->isChecked()); + config.save(); +} + +#include "k9prefdvd.moc" + diff --git a/src/k9prefdvd.h b/src/k9prefdvd.h new file mode 100644 index 0000000..f0479c8 --- /dev/null +++ b/src/k9prefdvd.h @@ -0,0 +1,40 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9PREFDVD_H +#define K9PREFDVD_H +#include "k9common.h" +#include "prefDVD.h" + +class k9prefDVD : public prefDVD +{ + Q_OBJECT + +public: + k9prefDVD(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9prefDVD(); + /*$PUBLIC_FUNCTIONS$*/ + void save(); + +public slots: + /*$PUBLIC_SLOTS$*/ + +protected: + /*$PROTECTED_FUNCTIONS$*/ + +protected slots: + /*$PROTECTED_SLOTS$*/ + +}; + +#endif + diff --git a/src/k9prefmencoder.cpp b/src/k9prefmencoder.cpp new file mode 100644 index 0000000..b8d92d8 --- /dev/null +++ b/src/k9prefmencoder.cpp @@ -0,0 +1,198 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9prefmencoder.h" +#include +#include +#include "k9mencodercmdgen.h" +#include +#include +#include + +k9prefMencoder::k9prefMencoder(QWidget* parent, const char* name, WFlags fl) +: prefMencoder(parent,name,fl) +{ + m_update=false; + load(); + btnOpt1->setPixmap(SmallIcon("configure")); + btnOpt2->setPixmap(SmallIcon("configure")); + btnOpt3->setPixmap(SmallIcon("configure")); + btnOptA->setPixmap(SmallIcon("configure")); + +} + +void k9prefMencoder::load() { + lbvCodecs->clear(); + for (int i=0;i < m_codecs.count();i++) { + lbvCodecs->insertItem(m_codecs.getCodecName(i)); + } + lbvCodecs->setCurrentItem(0); + + lbaCodecs->clear(); + for (int i=0;i < m_audioCodecs.count();i++) { + lbaCodecs->insertItem(m_audioCodecs.getCodecName(i)); + } + lbaCodecs->setCurrentItem(0); + +} + +void k9prefMencoder::lbvCodecsCurrentChanged(QListBoxItem *_item) { + if (_item) { + int i=lbvCodecs->currentItem(); + m_update=true; + leFourcc->setText(m_codecs.getFourcc(i)); + teOpt1->setText(m_codecs.getOptions0(i)); + teOpt2->setText(m_codecs.getOptions1(i)); + teOpt3->setText(m_codecs.getOptions2(i)); + leVLabel->setText(_item->text()); + m_update=false; + } +} + +void k9prefMencoder::lbaCodecsCurrentChanged(QListBoxItem *_item) { + if (_item) { + int i=lbaCodecs->currentItem(); + m_update=true; + teOptA->setText(m_audioCodecs.getOptions(i)); + leALabel->setText(_item->text()); + m_update=false; + } +} + +void k9prefMencoder::save() +{ + m_codecs.save(); + m_audioCodecs.save(); + +} + +void k9prefMencoder::btnOpt1Clicked() { + QString s=teOpt1->text(); + if( k9MencoderCmdGen::getMencoderOptions(s)) + teOpt1->setText(s); + +} +void k9prefMencoder::btnOpt2Clicked() { + QString s=teOpt2->text(); + if( k9MencoderCmdGen::getMencoderOptions(s)) + teOpt2->setText(s); + +} +void k9prefMencoder::btnOpt3Clicked() { + QString s=teOpt3->text(); + if( k9MencoderCmdGen::getMencoderOptions(s)) + teOpt3->setText(s); + +} +void k9prefMencoder::btnOptAClicked() { + QString s=teOptA->text(); + if( k9MencoderCmdGen::getMencoderOptions(s)) + teOptA->setText(s); + +} + +void k9prefMencoder::btnAddVClicked() { + lbvCodecs->insertItem(i18n("new profile")); + m_codecs.setOptions0(lbvCodecs->count()-1,"-ovc copy"); + m_codecs.setOptions1(lbvCodecs->count()-1,"-ovc copy"); + m_codecs.setOptions2(lbvCodecs->count()-1,"-ovc copy"); + m_codecs.setCodecName(lbvCodecs->count()-1,i18n("new profile")); + lbvCodecs->setCurrentItem(lbvCodecs->count()-1); + +} + +void k9prefMencoder::btnDeleteVClicked() { + m_codecs.remove(lbvCodecs->currentItem()); + lbvCodecs->removeItem(lbvCodecs->currentItem()); +} + +void k9prefMencoder::btnAddAClicked() { + lbaCodecs->insertItem(i18n("new profile")); + m_audioCodecs.setOptions (lbaCodecs->count()-1,"-oac copy"); + m_audioCodecs.setCodecName(lbaCodecs->count()-1,i18n("new profile")); + lbaCodecs->setCurrentItem(lbaCodecs->count()-1); + +} + +void k9prefMencoder::bResetClicked() { + m_codecs.reset(); + m_audioCodecs.reset(); + load(); + lbvCodecs->setCurrentItem(0); + lbaCodecs->setCurrentItem(0); + lbvCodecsCurrentChanged (lbvCodecs->item(0)); + lbaCodecsCurrentChanged (lbaCodecs->item(0)); + + +} + +void k9prefMencoder::btnDeleteAClicked() { + m_audioCodecs.remove(lbaCodecs->currentItem()); + lbaCodecs->removeItem(lbaCodecs->currentItem()); +} + + +void k9prefMencoder::teOptATextChanged() { + if (!m_update) + m_audioCodecs.setOptions(lbaCodecs->currentItem(),teOptA->text()); +} + +void k9prefMencoder::teOpt1TextChanged() { + if (!m_update) + m_codecs.setOptions0(lbvCodecs->currentItem(),teOpt1->text()); +} + +void k9prefMencoder::teOpt2TextChanged() { + if (!m_update) + m_codecs.setOptions1(lbvCodecs->currentItem(),teOpt2->text()); + +} + +void k9prefMencoder::teOpt3TextChanged() { + if (!m_update) + m_codecs.setOptions2(lbvCodecs->currentItem(),teOpt3->text()); + +} + + +void k9prefMencoder::leVLabelTextChanged(const QString &_value) { + if (!m_update) { + lbvCodecs->changeItem(_value,lbvCodecs->currentItem()); + m_codecs.setCodecName(lbvCodecs->currentItem(),_value); + } +} +void k9prefMencoder::leALabelTextChanged(const QString &_value) { + if (!m_update) { + lbaCodecs->changeItem(_value,lbaCodecs->currentItem()); + m_audioCodecs.setCodecName(lbaCodecs->currentItem(),_value); + } +} + +void k9prefMencoder::leFourccTextChanged(const QString &_value) { + if (!m_update) { + m_codecs.setFourcc(lbvCodecs->currentItem(),_value); + } +} + + +k9prefMencoder::~k9prefMencoder() +{ +} + + + +/*$SPECIALIZATION$*/ + + +#include "k9prefmencoder.moc" + diff --git a/src/k9prefmencoder.h b/src/k9prefmencoder.h new file mode 100644 index 0000000..54ab311 --- /dev/null +++ b/src/k9prefmencoder.h @@ -0,0 +1,65 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9PREFMENCODER_H +#define K9PREFMENCODER_H + +#include "k9common.h" +#include "prefMencoder.h" +#include "k9videocodecs.h" +#include "k9audiocodecs.h" +#include +#include +#include + +class k9prefMencoder : public prefMencoder +{ + Q_OBJECT + +public: + k9prefMencoder(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9prefMencoder(); + /*$PUBLIC_FUNCTIONS$*/ + void save(void); + void load(); +public slots: + /*$PUBLIC_SLOTS$*/ + void teOptATextChanged(); + + void teOpt1TextChanged(); + void teOpt3TextChanged(); + void teOpt2TextChanged(); + void leVLabelTextChanged(const QString &); + void leALabelTextChanged(const QString &); + void leFourccTextChanged(const QString &); +private: + k9VideoCodecs m_codecs; + k9AudioCodecs m_audioCodecs; + bool m_update; +protected slots: + /*$PROTECTED_SLOTS$*/ + void lbvCodecsCurrentChanged(QListBoxItem *_item); + void lbaCodecsCurrentChanged(QListBoxItem *_item); + void btnOpt1Clicked(); + void btnOpt2Clicked(); + void btnOpt3Clicked(); + void btnOptAClicked(); + void btnAddVClicked(); + void btnDeleteVClicked(); + void btnAddAClicked(); + void btnDeleteAClicked(); + void bResetClicked(); +}; + + +#endif + diff --git a/src/k9prefmpeg4.cpp b/src/k9prefmpeg4.cpp new file mode 100644 index 0000000..db752bb --- /dev/null +++ b/src/k9prefmpeg4.cpp @@ -0,0 +1,110 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "k9common.h" +#include "k9prefmpeg4.h" +#include "k9config.h" +#include +#include +#include +#include +#include +#include +#include + +k9prefMPEG4::k9prefMPEG4(QWidget* parent, const char* name, WFlags fl) +: prefMPEG4(parent,name,fl) +{ + load(); +} + +void k9prefMPEG4::load() { + //KSimpleConfig settings("K9Copy"); + k9Config config; + sbMp4Size->setValue(config.getPrefMp4Size()); + sbMp4Size->setSuffix(" "+ i18n("MB")); + sbMp4NumberCD->setValue(config.getPrefMp4NumberCD()); + sbAudioGain->setValue(config.getPrefMp4AudioGain()); + + leMp4Width->setText(config.getPrefMp4Width()); + leMp4Height->setText(config.getPrefMp4Height()); + + ckMp4AspectRatio->setChecked(config.getPrefMp4AspectRatio()); + leMp4Height->setEnabled(!ckMp4AspectRatio->isChecked()); + + ck2passes->setChecked(config.getPrefMp42Passes()); + + leMp4AudioBitrate->setText(config.getPrefMp4AudioBitrate()); + leMp4VideoBitrate->setText(config.getPrefMp4VideoBitrate()); + + QStringList m_codecLabels=config.getCodecLabels(); + QStringList m_codecLabelsAudio=config.getCodecLabelsAudio(); + + cbMp4Codec->clear(); + cbMp4Codec->insertStringList(m_codecLabels); + cbMp4Codec->setCurrentItem(config.getPrefMp4Codec()); + + cbMp4AudioCodec->clear(); + cbMp4AudioCodec->insertStringList(m_codecLabelsAudio); + cbMp4AudioCodec->setCurrentItem(config.getPrefMp4AudioCodec()); + + ckUseCache->setChecked(config.getPrefUseCellCache()); + + if(config.getPrefMp4VideoBitrate() =="") + rbSize->setChecked(true); + else + rbBitrate->setChecked(true); + leMp4VideoBitrate->setEnabled(rbBitrate->isChecked()); + sbMp4Size->setEnabled(rbSize->isChecked()); + +} + + +k9prefMPEG4::~k9prefMPEG4() +{ +} + +void k9prefMPEG4::save() { + k9Config config; + config.setPrefMp4Codec(cbMp4Codec->currentItem()); + config.setPrefMp4AudioCodec(cbMp4AudioCodec->currentItem()); + config.setPrefMp4Size( (int)sbMp4Size->value()); + config.setPrefMp4NumberCD( (int)sbMp4NumberCD->value()); + config.setPrefMp4AudioGain( (int)sbAudioGain->value()); + config.setPrefMp4Width( leMp4Width->text()); + config.setPrefMp4Height(leMp4Height->text()); + config.setPrefMp4AspectRatio( ckMp4AspectRatio->isChecked()); + config.setPrefMp4AudioBitrate( leMp4AudioBitrate->text()); + config.setPrefMp4VideoBitrate( leMp4VideoBitrate->text()); + config.setPrefMp42Passes(ck2passes->isChecked()); + config.setPrefUseCellCache(ckUseCache->isChecked()); + config.save(); +} + +void k9prefMPEG4::ckMp4AspectRatioClick() { + leMp4Height->setEnabled(!ckMp4AspectRatio->isChecked()); + if (ckMp4AspectRatio->isChecked()) leMp4Height->setText(""); +} + +void k9prefMPEG4::rgVideoSizeChanged(){ + if (rbSize->isChecked()) + leMp4VideoBitrate->setText(""); + leMp4VideoBitrate->setEnabled(rbBitrate->isChecked()); + sbMp4Size->setEnabled(rbSize->isChecked()); + +} + +/*$SPECIALIZATION$*/ + + +#include "k9prefmpeg4.moc" + diff --git a/src/k9prefmpeg4.h b/src/k9prefmpeg4.h new file mode 100644 index 0000000..b8f692d --- /dev/null +++ b/src/k9prefmpeg4.h @@ -0,0 +1,58 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9PREFMPEG4_H +#define K9PREFMPEG4_H + +#include "prefMPEG4.h" +#include "k9common.h" +class k9prefMPEG4 : public prefMPEG4 +{ + Q_OBJECT + +public: + k9prefMPEG4(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9prefMPEG4(); + /*$PUBLIC_FUNCTIONS$*/ + void save(); + void load(); +public slots: + /*$PUBLIC_SLOTS$*/ + +protected: + /*$PROTECTED_FUNCTIONS$*/ + +protected slots: + /*$PROTECTED_SLOTS$*/ + virtual void ckMp4AspectRatioClick(); + virtual void rgVideoSizeChanged(); + + virtual void cbMp4CodecActivated( int ){}; + virtual void cbMp4AudioCodecActivated( int ){}; + + virtual void ck2passesClicked(){}; + virtual void sbMp4SizeValueChanged( int ){}; + virtual void sbAudioGainValueChanged( int ){}; + + virtual void sbMp4NumberCDValueChanged( int ) {}; + virtual void leMp4WidthTextChanged( const QString & ) {}; + virtual void leMp4HeightTextChanged( const QString & ) {}; + virtual void leMp4AudioBitrateTextChanged( const QString & ) {}; + virtual void leMp4VideoBitrateTextChanged( const QString & ) {}; + + virtual void ckUseCacheClick() {}; + + +}; + +#endif + diff --git a/src/k9prefpreview.cpp b/src/k9prefpreview.cpp new file mode 100644 index 0000000..e1c4fbf --- /dev/null +++ b/src/k9prefpreview.cpp @@ -0,0 +1,76 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9prefpreview.h" +#include "k9config.h" +#include +#include +#include +#include +#include + +k9prefPreview::k9prefPreview(QWidget* parent, const char* name, WFlags fl) +: prefPreview(parent,name,fl) +{ load(); +} + +k9prefPreview::~k9prefPreview() +{ +} + +/*$SPECIALIZATION$*/ + +void k9prefPreview::load() { + k9Config config; + + ckUseGL->setChecked(config.getUseGL()); + cbVout->setCurrentItem(config.getMplayerVout()); + cbAout->setCurrentItem(config.getMplayerAout()); + rbMplayer->setChecked(config.getUseMplayer()); + rbInternal->setChecked(!config.getUseMplayer()); + + if (rbMplayer->isChecked()) + rbMplayerClick(); + else + rbInternalClick(); + +} + + + +void k9prefPreview::save() { + k9Config config; + + if (rbMplayer->isChecked()) { + config.setMplayerVout( cbVout->currentItem()); + config.setMplayerAout( cbAout->currentItem()); + }else { + config.setUseGL( ckUseGL->isChecked()); + } + config.setUseMplayer( rbMplayer->isChecked()); + config.save(); +} + + +void k9prefPreview::rbInternalClick() { + wsOptions->raiseWidget(0); +} + +void k9prefPreview::rbMplayerClick() { + wsOptions->raiseWidget(1); +} + + + +#include "k9prefpreview.moc" + diff --git a/src/k9prefpreview.h b/src/k9prefpreview.h new file mode 100644 index 0000000..b5e661f --- /dev/null +++ b/src/k9prefpreview.h @@ -0,0 +1,41 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9PREFPREVIEW_H +#define K9PREFPREVIEW_H + +#include "k9common.h" +#include "prefpreview.h" + +class k9prefPreview : public prefPreview +{ + Q_OBJECT + +public: + k9prefPreview(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9prefPreview(); + /*$PUBLIC_FUNCTIONS$*/ + void save(); +public slots: + /*$PUBLIC_SLOTS$*/ + void rbInternalClick(); + void rbMplayerClick(); +protected: + /*$PROTECTED_FUNCTIONS$*/ + void load(); +protected slots: + /*$PROTECTED_SLOTS$*/ + +}; + +#endif + diff --git a/src/k9redirect.cpp b/src/k9redirect.cpp new file mode 100644 index 0000000..f5d2066 --- /dev/null +++ b/src/k9redirect.cpp @@ -0,0 +1,44 @@ +// +// C++ Implementation: k9redirect +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9redirect.h" +#include +k9Redirect::k9Redirect() +{ +} + + +k9Redirect::~k9Redirect() +{ +} + +void k9Redirect::execute() { + KProcess *p=new KProcess(); + *p << "mencoder"; + *p << "-oac" << "lavc" << "-ovc" << "lavc" << "-of" << "mpeg"; + *p << "-mpegopts" << "format=dvd" << "-vf" << "scale=720:576,harddup" << "-srate" << "48000" << "-af" << "lavcresample=48000" << "-lavcopts" << "vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:acodec=ac3:abitrate=192:aspect=16/9" << "-ofps" << "25" << "-o" << "/tmp/kde-jmp/k9copy/tmp.mpeg" << "-ss" << "00:00:00.000" << "-endpos" << "00:00:57.360" << "-really-quiet" << "/home/jmp/t.avi"; + p->start(KProcess::NotifyOnExit); + p->wait(); + + + QFile f("/tmp/kde-jmp/k9copy/tmp.mpeg"); + QFile fout; + f.open(IO_ReadOnly ); + fout.open(IO_WriteOnly,stdout); + while ( ! f.atEnd()) { + char *buf=new char [2048]; + f.readBlock(buf,2048); + fout.writeBlock(buf,2048); + delete buf; + } + f.close(); + fout.close(); +} diff --git a/src/k9redirect.h b/src/k9redirect.h new file mode 100644 index 0000000..24b3cd5 --- /dev/null +++ b/src/k9redirect.h @@ -0,0 +1,28 @@ +// +// C++ Interface: k9redirect +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9REDIRECT_H +#define K9REDIRECT_H + +#include "k9common.h" +#include +/** + @author Jean-Michel PETIT +*/ +class k9Redirect{ +public: + k9Redirect(); + + ~k9Redirect(); + void execute(); +}; + +#endif diff --git a/src/k9settings.cpp b/src/k9settings.cpp new file mode 100644 index 0000000..3bdad1e --- /dev/null +++ b/src/k9settings.cpp @@ -0,0 +1,97 @@ +// +// C++ Implementation: k9settings +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include "k9settings.h" + +#include +#include +#include +#include +#include + +k9settings::k9settings(QWidget *parent,const QString &caption): KDialogBase (IconList,caption, + Ok|Apply|Cancel, Ok) { + + setInitialSize(QSize(750,350), false); + + QFrame *frDevices; + frDevices=addPage (i18n("Devices"),i18n("Devices not detected by k9copy"),KGlobal::iconLoader()->loadIcon("blockdevice", KIcon::Panel, KIcon::SizeMedium)); + QGridLayout *grid = new QGridLayout(frDevices, 0, 0, 10 ); + m_configDlg=new kConfigDlg(frDevices); + grid->addWidget(m_configDlg,0,0); + + + QFrame *frDVD; + frDVD=addPage (i18n("DVD"),i18n("DVD Backup"),KGlobal::iconLoader()->loadIcon("dvdcopy", KIcon::Panel, KIcon::SizeMedium)); + grid = new QGridLayout(frDVD, 0, 0, 10 ); + m_prefDVD =new k9prefDVD(frDVD); + grid->addWidget(m_prefDVD,0,0); + + //TODO afficher uniquement si mencoder et mplayer installés + + QFrame *frMencoder; + frMencoder=addPage (i18n("MEncoder"),i18n("MPEG-4 Codecs"),KGlobal::iconLoader()->loadIcon("mencoder", KIcon::Panel, KIcon::SizeMedium)); + m_prefMencoder =new k9prefMencoder(frMencoder); + + + + QFrame *frMPEG4; + frMPEG4=addPage (i18n("MPEG-4"),i18n("MPEG-4 Encoding"),KGlobal::iconLoader()->loadIcon("mp4", KIcon::Panel, KIcon::SizeMedium)); + grid = new QGridLayout(frMPEG4, 0, 0, 10 ); + m_prefMPEG4 =new k9prefMPEG4(frMPEG4); + grid->addWidget(m_prefMPEG4,0,0); + + grid = new QGridLayout(frMencoder, 0, 0, 10 ); + grid->addWidget(m_prefMencoder,0,0); + + QFrame *frPreview; + frPreview=addPage (i18n("Preview"),i18n("Title preview"),KGlobal::iconLoader()->loadIcon("mplayer", KIcon::Panel, KIcon::SizeMedium)); + grid = new QGridLayout(frPreview, 0, 0, 10 ); + m_prefPreview =new k9prefPreview(frPreview); + grid->addWidget(m_prefPreview,0,0); + + QFrame *frAuthor; + frAuthor=addPage(i18n("Authoring"),i18n("Authoring"),KGlobal::iconLoader()->loadIcon("author",KIcon::Panel,KIcon::SizeMedium)); + grid = new QGridLayout(frAuthor, 0, 0, 10 ); + m_prefAuthor =new k9prefAuthor(frAuthor); + grid->addWidget(m_prefAuthor,0,0); + + + connect(this, SIGNAL(okClicked()), SLOT(slotOkClicked())); + connect(this, SIGNAL(applyClicked()), SLOT(slotApplyClicked())); +} + +void k9settings::slotOkClicked() { + m_configDlg->save(); + m_prefDVD->save(); + m_prefMPEG4->save(); + m_prefMencoder->save(); + m_prefPreview->save(); + m_prefAuthor->save(); +} + +void k9settings::slotApplyClicked() { + slotOkClicked(); + + m_prefMPEG4->load(); +} + +k9settings::~k9settings() { + /* delete m_configDlg; + delete m_prefDVD; + delete m_prefMPEG4; + delete m_prefMencoder; + delete m_prefPreview; +*/ +} + +#include "k9settings.moc" diff --git a/src/k9settings.h b/src/k9settings.h new file mode 100644 index 0000000..d1cc237 --- /dev/null +++ b/src/k9settings.h @@ -0,0 +1,46 @@ +// +// C++ Interface: k9settings +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9SETTINGS_H +#define K9SETTINGS_H + +#include "k9common.h" +#include "kconfigdlg.h" +#include "k9prefdvd.h" +#include "k9prefmpeg4.h" +#include "k9prefmencoder.h" +#include "k9prefpreview.h" +#include "k9prefauthor.h" +#include + +/** + @author Jean-Michel PETIT +*/ +class k9settings:public KDialogBase{ +Q_OBJECT +public: + k9settings(QWidget *parent,const QString &caption); + + virtual ~k9settings(); + +private: + kConfigDlg *m_configDlg; + k9prefDVD *m_prefDVD; + k9prefMPEG4 *m_prefMPEG4; + k9prefMencoder *m_prefMencoder; + k9prefPreview *m_prefPreview; + k9prefAuthor *m_prefAuthor; +private slots: + void slotOkClicked(); + void slotApplyClicked(); +}; + +#endif diff --git a/src/k9titlefactor.cpp b/src/k9titlefactor.cpp new file mode 100644 index 0000000..d020e52 --- /dev/null +++ b/src/k9titlefactor.cpp @@ -0,0 +1,145 @@ +// +// C++ Implementation: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + + +#include "k9titlefactor.h" +#include "k9cellcopylist.h" +#include "k9dvdsize.h" +#include +#include +#include +#include +#include + + + +k9TitleFactor::k9TitleFactor(QWidget* parent, const char* name, WFlags fl) + : titleFactor(parent,name,fl) { + m_current=NULL; + m_slFactorPressed=false; + m_factor=-1; + m_dvd=NULL; + m_updating=false; + SelectionChanged( NULL,m_withMenus); + m_useDvdAuthor=false; + slFactor->setPageStep(0); +} + +k9TitleFactor::~k9TitleFactor() {} + +/*$SPECIALIZATION$*/ +void k9TitleFactor::setUseDvdAuthor( bool _value) { + m_useDvdAuthor=_value; +} + +float k9TitleFactor::getFactor() { + if (m_factor==-1) + m_factor=m_dvd->getfactor( m_withMenus,false,m_useDvdAuthor); + return m_factor; +} + +void k9TitleFactor::ckAutoClicked(bool checked) { + if (m_current!=NULL && !m_updating) { + m_current->setforceFactor(checked); + if ( checked) { + m_current->setfactor( getFactor()); + slFactor->setValue(m_current->getfactor()*100.0); + setMinFactor(); + } else { + slFactor->setValue(getFactor()*100.0); + slFactor->setMinValue(100); + } + + } +} + +void k9TitleFactor::slFactorReleased() { + m_slFactorPressed=false; +} + +void k9TitleFactor::slFactorPressed() { + if (m_current !=NULL) { + m_current->setforceFactor(true); + setMinFactor(); + } + m_slFactorPressed=true; + +} + +void k9TitleFactor::slFactor_valueChanged( int ) { + if (m_current !=NULL ) { + if (m_slFactorPressed) { + m_current->setfactor( (double)slFactor->value() /100); + for (int i=0;i getTitles().count();i++) { + k9DVDTitle * title=m_current->getTitles().at(i); + title->setfactor( (double)slFactor->value() /100); + } + m_factor=-1; + } + if (m_current->getforceFactor()) + tFactor->setText(QString("%1").arg(m_current->getfactor(),4,'f',2)); + else + tFactor->setText(QString("%1").arg(getFactor(),4,'f',2)); + } + +} + +void k9TitleFactor::changedTitle(k9DVDTitle *_title) { + if (_title ==NULL) { + gbTitle->hide(); + lbTitle->setText(i18n("Select a Title in the treeview...")); + return; + } + + gbTitle->show(); + m_current=_title; + + m_updating=true; + gbTitle->setChecked(m_current->getforceFactor()); + m_updating=false; + + lbTitle->setText(QString(i18n("Shrink Factor for %1")).arg(m_current->getname())); + if (m_current->getforceFactor()) { + slFactor->setValue(m_current->getfactor()*100.0); + tFactor->setText(QString("%1").arg(m_current->getfactor(),4,'f',2)); + setMinFactor(); + } else { + slFactor->setValue(getFactor()*100.0); + tFactor->setText(QString("%1").arg(getFactor(),4,'f',2)); + slFactor->setMinValue(100); + } + +} + + +void k9TitleFactor::setMinFactor() { + k9CellCopyList *lst=new k9CellCopyList(m_dvd->getdvd(),m_dvd); + double minFactor=lst->getMinFactor( true); //TODO : corriger pour copie sans menus + slFactor->setMinValue(minFactor*100); + + delete lst; +} + +void k9TitleFactor::SelectionChanged( k9DVD *_dvd,bool _withMenus) { + m_dvd=_dvd; + if (_dvd==NULL) + m_current=NULL; + m_factor=-1; + m_withMenus=_withMenus; + + changedTitle( m_current); + +} + + +#include "k9titlefactor.moc" + diff --git a/src/k9titlefactor.h b/src/k9titlefactor.h new file mode 100644 index 0000000..65a02f9 --- /dev/null +++ b/src/k9titlefactor.h @@ -0,0 +1,55 @@ +// +// C++ Interface: +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2006 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#ifndef K9TITLEFACTOR_H +#define K9TITLEFACTOR_H + +#include "k9common.h" +#include "titlefactor.h" +#include "k9dvd.h" +#include "k9dvdtitle.h" + + +class k9TitleFactor : public titleFactor +{ + Q_OBJECT + +public: + k9TitleFactor(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~k9TitleFactor(); + /*$PUBLIC_FUNCTIONS$*/ +private : + k9DVDTitle *m_current; + k9DVD *m_dvd; + bool m_slFactorPressed; + bool m_withMenus; + bool m_useDvdAuthor; + float m_factor; + bool m_updating; +public slots: + /*$PUBLIC_SLOTS$*/ + virtual void ckAutoClicked(bool _checked); + virtual void slFactorReleased(); + virtual void slFactorPressed(); + virtual void slFactor_valueChanged( int ); + virtual void SelectionChanged( k9DVD *_dvd,bool _withMenus); + virtual void changedTitle(k9DVDTitle *_title); + virtual void setUseDvdAuthor(bool _value); +protected: + /*$PROTECTED_FUNCTIONS$*/ + void setMinFactor(); + float getFactor(); + +}; + +#endif + diff --git a/src/k9updatefactor.cpp b/src/k9updatefactor.cpp new file mode 100644 index 0000000..76a99c5 --- /dev/null +++ b/src/k9updatefactor.cpp @@ -0,0 +1,43 @@ +// +// C++ Implementation: k9updatefactor +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "k9updatefactor.h" + +k9UpdateFactor::k9UpdateFactor(QObject *parent, const char *name) + : QObject(parent, name), QThread() +{ +} + + +k9UpdateFactor::~k9UpdateFactor() +{ + wait(); +} + +void k9UpdateFactor::run(){ + do { + m_restart=false; + emit updateFactor_internal(); + } while (m_restart); +} + +void k9UpdateFactor::updateFactor() { + m_mutex.lock(); + if (running()) { + m_restart=true; + } + else + start(); + m_mutex.unlock(); +} + + +#include "k9updatefactor.moc" diff --git a/src/k9updatefactor.h b/src/k9updatefactor.h new file mode 100644 index 0000000..8ca98e2 --- /dev/null +++ b/src/k9updatefactor.h @@ -0,0 +1,42 @@ +// +// C++ Interface: k9updatefactor +// +// Description: +// +// +// Author: Jean-Michel PETIT , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef K9UPDATEFACTOR_H +#define K9UPDATEFACTOR_H + +#include "k9common.h" +#include +#include +#include +/** + @author Jean-Michel PETIT +*/ + +class k9Main; +class k9UpdateFactor : public QObject, public QThread +{ +Q_OBJECT +private: + QMutex m_mutex; + bool m_restart; +protected: + void run(); +public: + k9UpdateFactor(QObject *parent = 0, const char *name = 0); + + ~k9UpdateFactor(); + void updateFactor(); +signals: + void updateFactor_internal(); + +}; + +#endif diff --git a/src/kconfigdlg.cpp b/src/kconfigdlg.cpp new file mode 100644 index 0000000..1507939 --- /dev/null +++ b/src/kconfigdlg.cpp @@ -0,0 +1,151 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#include "kconfigdlg.h" +#include "kmessagebox.h" + +#include +#include + +#include +#include +#include "k9config.h" + +kConfigDlg::kConfigDlg(QWidget *parent) + : configDlg(parent) +{ + QStringList ldev; + QStringList llabels; + QStringList lIO; + tblDevices->setColumnWidth(0,150); + tblDevices->setColumnWidth(1,210); + tblDevices->setColumnWidth(2,40); + tblDevices->setColumnWidth(3,45); + //KSimpleConfig settings("K9Copy"); + k9Config config; + + ldev=config.getDevices(); + llabels=config.getDevicesLabels(); + lIO=config.getDevicesIO(); + int row=0; + for ( QStringList::Iterator it = ldev.begin(); it != ldev.end(); ++it ) + { + tblDevices->setNumRows(row+1); + tblDevices->setText(row,0,(*it)); + QStringList::Iterator it2=llabels.at(row); + tblDevices->setText(row,1,(*it2)); + + row++; + + } + for ( int j = 0; j < tblDevices->numRows(); ++j ) + { + QCheckTableItem *I = new QCheckTableItem( tblDevices, "" ); + QCheckTableItem *O = new QCheckTableItem( tblDevices, "" ) ; + QStringList::Iterator it=lIO.at(j); + QString c=(*it); + if((c =="I") || (c =="IO")) I->setChecked(true); + if((c =="O") || (c =="IO")) O->setChecked(true); + tblDevices->setItem( j, 2, I ); + tblDevices->setItem( j, 3, O); + } + + +// buttonCancel->setIconSet(KStdGuiItem::cancel().iconSet()); +// buttonOk->setIconSet(KStdGuiItem::ok().iconSet()); +} + + +kConfigDlg::~kConfigDlg() +{} + + + + +/*! + \fn kConfigDlg::bAddClick() + */ +void kConfigDlg::bAddClick() +{ + tblDevices->setNumRows(tblDevices->numRows()+1); + QCheckTableItem *I = new QCheckTableItem( tblDevices, "" ); + QCheckTableItem *O = new QCheckTableItem( tblDevices, "" ) ; + tblDevices->setItem( tblDevices->numRows()-1, 2, I ); + tblDevices->setItem( tblDevices->numRows()-1, 3, O); +} + + +/*! + \fn kConfigDlg::bRemoveClick() + */ +void kConfigDlg::bRemoveClick() +{ + tblDevices->removeRow(tblDevices->currentRow()); +} + + +void kConfigDlg::save() +{ + QStringList ldev; + QStringList llabels; + QStringList lIO; + //KSimpleConfig settings("K9Copy"); + k9Config config; + ldev.clear(); + llabels.clear(); + for (int i=0;inumRows();i++) + { + QString c=tblDevices->text(i,0); + if (!c.isEmpty()) + { + if (QFile::exists(c)) + { + ldev.append(tblDevices->text(i,0)); + c=tblDevices->text(i,1); + if (c.isEmpty()) c=tblDevices->text(i,0); + llabels.append(c); + QCheckTableItem *I = (QCheckTableItem*)tblDevices->item(i,2); + QCheckTableItem *O = (QCheckTableItem*)tblDevices->item(i,3); + if (O->isChecked() && I->isChecked()) + { + lIO.append("IO"); + } + else + { + if (O->isChecked()) lIO.append("O"); + if (I->isChecked()) lIO.append("I"); + if ((!O->isChecked()) && (!I->isChecked())) + { + lIO.append("x"); + } + } + } + else + { + KMessageBox::error( this, c + " is not a valid device", "Devices"); + } + } + } + + config.setDevicesLabels(llabels); + config.setDevices(ldev); + config.setDevicesIO(lIO); + config.save(); +} diff --git a/src/kconfigdlg.h b/src/kconfigdlg.h new file mode 100644 index 0000000..7dbc016 --- /dev/null +++ b/src/kconfigdlg.h @@ -0,0 +1,44 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#ifndef KCONFIGDLG_H +#define KCONFIGDLG_H + +#include "k9common.h" +#include +#include +#include +#include + +/** +@author Jean-Michel PETIT +*/ +class kConfigDlg : public configDlg +{ +public: + kConfigDlg(QWidget *parent); + + ~kConfigDlg(); + void bAddClick(); + void bRemoveClick(); + void save(); + +}; + +#endif diff --git a/src/kviewmpeg2.cpp b/src/kviewmpeg2.cpp new file mode 100755 index 0000000..899f31d --- /dev/null +++ b/src/kviewmpeg2.cpp @@ -0,0 +1,229 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#include "k9common.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include "kviewmpeg2.h" +#include "k9config.h" + + + +k9Widget::k9Widget(QWidget *parent):QWidget(parent) { + m_image=NULL; +} + +void k9Widget::setImage(QImage *_image) { + m_image=_image; + //paintEvent( NULL); + repaint(FALSE); +} + +void k9Widget::paintEvent( QPaintEvent *_event) { + setPaletteBackgroundColor(Qt::black); + int top,left; + if (m_image !=NULL) { + QPainter p(this); + double wratio=(double)width()/(double)m_image->width(); + double hratio=(double)height()/(double)m_image->height(); + double ratio= wratio < hratio ? wratio:hratio; + + top =(int) (height() -m_image->height()*ratio)/2+1; + left =(int) (width() -m_image->width()*ratio)/2 +1; + + p.scale(ratio,ratio); + + p.drawImage((int)(left/ratio),(int)(top/ratio),*m_image); + + p.end(); + } +} + +kViewMPEG2::kViewMPEG2() { + m_widget=NULL; + m_GLwidget=NULL; + m_layout=NULL; + bPlay->setPixmap(SmallIcon("player_play")); + bStop->setPixmap(SmallIcon("player_stop")); + connect(&m_player , SIGNAL(setPosition(uint32_t)), this, SLOT(setPosition(uint32_t))); + connect(&m_player , SIGNAL(setMax(uint32_t)), this, SLOT(setMax(uint32_t))); + connect(&m_player , SIGNAL(setMin(uint32_t)), this, SLOT(setMin(uint32_t))); + lockSlider=false; + stopped=true; + + m_layout=new QGridLayout(label,1,1); + +#ifdef HAVE_OPENGL + + readSettings(); +#else + + m_prefUseGL=FALSE; +#endif + //disable the option use_gl, so if k9copy crash, we restart without gl + if (m_prefUseGL) { + k9Config config; + config.setUseGL( false); + config.save(); + } + m_player.getDecoder()->setUseGL(m_prefUseGL); + if (m_prefUseGL) { + connect(m_player.getDecoder() , SIGNAL(ppmReady(uchar *,int,int,int)), this, SLOT(drawppm(uchar *,int,int,int))); + + m_GLwidget= k9GLWidget::createWidget(label); + m_widget=NULL; + m_layout->addWidget(m_GLwidget,0,0); + + //init ok, we can put the gl flag to true + k9Config config; + config.setUseGL( true); + config.save(); + + } else { + connect(m_player.getDecoder() , SIGNAL(pixmapReady(QImage *)), this, SLOT(drawPixmap(QImage *))); + m_widget=new k9Widget(label); + m_layout->addWidget(m_widget,0,0); + + m_GLwidget=NULL; + } + +} + + +void kViewMPEG2::readSettings() { + m_player.stop(); + + //KSimpleConfig settings("K9Copy"); + k9Config config; + m_prefUseGL=config.getUseGL(); + //m_prefUseGL=settings.readEntry("/options/useGL",0).toInt(); + +} + + +kViewMPEG2::~kViewMPEG2() { + stopped=true; + m_player.stop(); +} + + +void kViewMPEG2::lock() { + mutex.lock(); +} + +void kViewMPEG2::unlock() { + mutex.unlock(); +} + +void kViewMPEG2::setPosition( uint32_t _position) { + if (!lockSlider) + slider->setValue(_position); +} + +void kViewMPEG2::setMax( uint32_t _position) { + slider->setMaxValue(_position); +} + +void kViewMPEG2::setMin(uint32_t _position) { + slider->setMinValue(_position); +} + + +/** No descriptions */ +void kViewMPEG2::drawPixmap(QImage *image) { + if (qApp==NULL) + return; + if (qApp->tryLock()) { + m_widget->setImage( image); + if (qApp!=NULL) + qApp->unlock(); + } +} + +/** No descriptions */ +void kViewMPEG2::drawppm(uchar *_buf,int _width,int _height,int _len) { + if (qApp==NULL) + return; +// if (qApp->tryLock()) { + m_GLwidget->setImage(_buf,_width,_height,_len); + // if (qApp !=NULL) + // qApp->unlock(); + // } else + // free(_buf); +} + + +void kViewMPEG2::bPlayClick() { + m_player.play(); +} + + +int kViewMPEG2::open (k9DVD *_dvd,k9DVDTitle * title,int chapter) { + m_player.open(_dvd->getdvd()->getDvd(), _dvd->getDevice(),title,chapter); +} + + +/** No descriptions */ +void kViewMPEG2::setError(const QString & err) { + error=true; + errMsg=err; +} + + +void kViewMPEG2::resizeEvent(QResizeEvent *_event) {} + +void kViewMPEG2::bStopClick() { + m_player.stop(); +} + +void kViewMPEG2::sliderReleased() { + pause=true; + int i; + i=slider->value(); + m_player.updatePos(i); + lockSlider=false; + +} + +void kViewMPEG2::closeEvent( QCloseEvent* ce ) { + stopped=true; + ce->accept(); + return; + +} +/** No descriptions */ +void kViewMPEG2::sliderPressed() { + lockSlider=true; +} diff --git a/src/kviewmpeg2.h b/src/kviewmpeg2.h new file mode 100755 index 0000000..bd21253 --- /dev/null +++ b/src/kviewmpeg2.h @@ -0,0 +1,101 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ + +#ifndef KVIEWMPEG2_H +#define KVIEWMPEG2_H + +#include "k9dvdtitle.h" + +#include +#include +#include +#include +#include +#include +#include +#include "k9plaympeg2.h" +#include "k9glwidget.h" +#include "k9mplayer.h" + +/** + *@author + */ + +class k9Widget : public QWidget { +Q_OBJECT +protected: + QImage *m_image; + void paintEvent ( QPaintEvent * _event); +public: + k9Widget (QWidget *_parent); + void setImage(QImage *_image); +}; + + +class kViewMPEG2 : public ViewMPEG2 { +Q_OBJECT +public: + kViewMPEG2(); + ~kViewMPEG2(); +private: + QMutex mutex; + k9DVDTitle *m_title; + QString dev; + int selTitle; + unsigned long idxLect; + bool pause; + bool lockSlider; + QImage img; + bool stopped; + void sliderReleased(); + /** No descriptions */ + void sliderPressed(); + void lock(); + void unlock(); + QString file; + QString errMsg; + bool error; + QString length; + uint startSector; + uint lastSector; + k9PlayMPEG2 m_player; + QGridLayout *m_layout; + bool m_prefUseGL; + k9GLWidget *m_GLwidget; + k9Widget *m_widget; +protected: + void closeEvent( QCloseEvent* ); + void resizeEvent ( QResizeEvent * ); +public slots: // Public slots + /** No descriptions */ + int open (k9DVD *_dvd,k9DVDTitle * title,int chapter); + void drawPixmap( QImage *image); + void drawppm(uchar *_buf,int _width,int _height,int _len); + void setError(const QString & err); + void setPosition(uint32_t _position); + void setMax(uint32_t _position); + void setMin(uint32_t _position); + void bPlayClick(); + void bStopClick(); + void readSettings(); + +}; + +#endif diff --git a/src/langselectw.cpp b/src/langselectw.cpp new file mode 100644 index 0000000..357acfd --- /dev/null +++ b/src/langselectw.cpp @@ -0,0 +1,123 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './langselectw.ui' +** +** Created: dim. oct. 26 08:57:34 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "langselectw.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static const unsigned char img0_langselectw[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, + 0x08, 0x06, 0x00, 0x00, 0x00, 0xbd, 0xf9, 0x35, 0x54, 0x00, 0x00, 0x02, + 0x27, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x9d, 0xd2, 0x4f, 0x48, 0xd3, + 0x61, 0x18, 0xc0, 0xf1, 0xef, 0xef, 0x97, 0xca, 0x0a, 0xff, 0xe5, 0x82, + 0x22, 0x0c, 0x9a, 0x82, 0x59, 0x66, 0xed, 0x20, 0x25, 0x1d, 0x86, 0x51, + 0x20, 0x81, 0xc1, 0x82, 0x9d, 0xa2, 0xc3, 0x3a, 0x64, 0x07, 0x0f, 0xa5, + 0xd0, 0xa5, 0x0e, 0x5b, 0x5d, 0x0a, 0x42, 0x72, 0x75, 0x08, 0xba, 0x48, + 0x07, 0x3b, 0x49, 0x18, 0x51, 0x14, 0x44, 0x1b, 0x24, 0xb5, 0x9c, 0xe5, + 0x24, 0x10, 0x29, 0x64, 0x30, 0x41, 0xf1, 0xb7, 0x7f, 0xbf, 0xad, 0xed, + 0x37, 0x75, 0x9b, 0x6f, 0x87, 0xe5, 0xdc, 0x3f, 0x5d, 0xf4, 0xc2, 0x03, + 0xef, 0xe1, 0x79, 0x3e, 0xef, 0xc3, 0xf3, 0x3e, 0x92, 0x10, 0x02, 0x49, + 0x92, 0x28, 0x3e, 0x1e, 0x30, 0xd7, 0x18, 0x0c, 0xb6, 0x3a, 0x93, 0xc9, + 0x28, 0xd7, 0xd7, 0xb3, 0x01, 0xf8, 0xc6, 0xc6, 0x5c, 0xe7, 0xc2, 0xe1, + 0xb3, 0x9b, 0x39, 0x42, 0x88, 0xa2, 0x4b, 0x21, 0x60, 0x5c, 0x30, 0x99, + 0x84, 0xf0, 0x78, 0x84, 0x98, 0x9e, 0xce, 0xc5, 0xc2, 0xd0, 0x90, 0x78, + 0x09, 0x3d, 0xf9, 0x88, 0x10, 0x02, 0xb9, 0x44, 0x00, 0xd2, 0x60, 0xde, + 0xd7, 0xd7, 0x07, 0xa1, 0x50, 0x41, 0xb4, 0xf4, 0xf6, 0xa2, 0x6b, 0x6e, + 0x7e, 0x54, 0x9c, 0xbf, 0x1d, 0xe2, 0x4a, 0xb9, 0xdd, 0x10, 0x0c, 0x96, + 0xc4, 0x71, 0x8b, 0xc5, 0xf8, 0x1c, 0xac, 0x15, 0x91, 0x14, 0x34, 0x0a, + 0x4d, 0xcb, 0x16, 0x06, 0x02, 0x05, 0xc8, 0x21, 0x83, 0x81, 0xfd, 0xed, + 0xed, 0xb6, 0xa7, 0xd0, 0xb8, 0x99, 0x5f, 0x05, 0xf0, 0x75, 0xfc, 0x61, + 0xa4, 0xe6, 0xdb, 0x0b, 0x57, 0xfc, 0xfe, 0xcc, 0x6c, 0x0a, 0x1a, 0xea, + 0x74, 0x3a, 0x6b, 0x53, 0x6b, 0x6b, 0xb6, 0x10, 0xa0, 0x68, 0xf0, 0x9d, + 0x5d, 0x5d, 0x87, 0x7f, 0xcd, 0xcf, 0xdf, 0x04, 0xec, 0x39, 0xe4, 0x60, + 0x62, 0x1c, 0xdd, 0xc5, 0x0b, 0xe6, 0x5d, 0x33, 0xc2, 0x5c, 0xab, 0xd5, + 0x53, 0xd5, 0xd2, 0x82, 0x94, 0x4e, 0x67, 0xbb, 0xf8, 0x0b, 0xac, 0xb8, + 0xdd, 0x78, 0xbd, 0x5e, 0x35, 0x03, 0x5e, 0xa1, 0xd7, 0x23, 0xc1, 0x8d, + 0x02, 0x44, 0x8b, 0x46, 0x1d, 0x0d, 0x72, 0xd2, 0x16, 0xe8, 0x39, 0xc0, + 0xde, 0xa9, 0x3d, 0x10, 0x8b, 0x6d, 0x3d, 0x2b, 0x49, 0x24, 0xfd, 0x7e, + 0x3e, 0x78, 0xbd, 0x13, 0x1a, 0x5c, 0xed, 0x07, 0x95, 0x50, 0x08, 0x80, + 0x81, 0xfc, 0x99, 0xac, 0x67, 0xe4, 0x11, 0xe5, 0xc7, 0xa4, 0xba, 0xbb, + 0xfb, 0x24, 0xd1, 0xcc, 0x72, 0xb6, 0x83, 0xbc, 0x58, 0x54, 0x14, 0x12, + 0xe0, 0xe8, 0x07, 0xb5, 0xdc, 0x0c, 0x65, 0x80, 0xce, 0xc1, 0x39, 0x35, + 0x1c, 0x4a, 0x38, 0x74, 0xf2, 0x6f, 0xc2, 0xa7, 0xf4, 0x25, 0x48, 0x54, + 0xd3, 0xb8, 0x0e, 0xae, 0x72, 0x40, 0xc1, 0xef, 0x6c, 0x64, 0x18, 0x59, + 0x9e, 0xfd, 0xac, 0xd6, 0x9e, 0x3f, 0x4d, 0xb8, 0x3a, 0xba, 0x85, 0x28, + 0x0a, 0xc9, 0xd5, 0xd5, 0xed, 0xea, 0x0b, 0x91, 0xee, 0x3b, 0x73, 0xaa, + 0x12, 0x58, 0x1f, 0x94, 0x63, 0x0b, 0x2c, 0x5d, 0x3a, 0x01, 0x91, 0x08, + 0x44, 0x22, 0xc4, 0xe2, 0x71, 0xe6, 0xd7, 0xd6, 0x26, 0x76, 0x54, 0x8a, + 0xd7, 0xfe, 0xfb, 0xf0, 0x31, 0xdf, 0xd2, 0xa4, 0x4d, 0xbc, 0x31, 0x36, + 0xf9, 0xde, 0x82, 0xf3, 0x19, 0x8c, 0x0e, 0xe7, 0xed, 0x44, 0x71, 0xad, + 0x10, 0xa2, 0x14, 0x79, 0x7d, 0xeb, 0xa8, 0xd5, 0xff, 0xea, 0xb2, 0x70, + 0x3e, 0xb6, 0xf8, 0x76, 0x7c, 0x7d, 0x27, 0x04, 0xe0, 0xa3, 0xbd, 0xc3, + 0x17, 0x9e, 0x79, 0x20, 0x46, 0xaf, 0xb5, 0x5b, 0xff, 0x05, 0x29, 0xbb, + 0xf6, 0x4a, 0x30, 0x33, 0xa8, 0xfe, 0xfc, 0x42, 0xdb, 0x19, 0x93, 0xad, + 0x52, 0x37, 0x39, 0xad, 0xdc, 0x79, 0x7f, 0xbb, 0xcd, 0x19, 0x98, 0xba, + 0x27, 0x9e, 0x5c, 0x39, 0x62, 0xff, 0xaf, 0x4e, 0x00, 0x16, 0x57, 0xe4, + 0xbb, 0xee, 0x77, 0x9f, 0x08, 0x56, 0x77, 0x34, 0x54, 0x6a, 0xe4, 0x0f, + 0x51, 0x7b, 0x2c, 0x24, 0xc5, 0xd9, 0x54, 0x2e, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + + +/* + * Constructs a langSelect as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +langSelect::langSelect( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QImage img; + img.loadFromData( img0_langselectw, sizeof( img0_langselectw ), "PNG" ); + image0 = img; + if ( !name ) + setName( "langSelect" ); + setIcon( image0 ); + langSelectLayout = new QGridLayout( this, 1, 1, 2, 6, "langSelectLayout"); + + lvLanguages = new QListView( this, "lvLanguages" ); + lvLanguages->addColumn( tr2i18n( "Languages" ) ); + lvLanguages->header()->setClickEnabled( FALSE, lvLanguages->header()->count() - 1 ); + lvLanguages->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)7, 0, 0, lvLanguages->sizePolicy().hasHeightForWidth() ) ); + lvLanguages->setMinimumSize( QSize( 208, 0 ) ); + lvLanguages->setHScrollBarMode( QListView::AlwaysOff ); + lvLanguages->setResizeMode( QListView::LastColumn ); + + langSelectLayout->addWidget( lvLanguages, 0, 0 ); + languageChange(); + resize( QSize(600, 480).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); +} + +/* + * Destroys the object and frees any allocated resources + */ +langSelect::~langSelect() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void langSelect::languageChange() +{ + setCaption( tr2i18n( "Selection" ) ); + lvLanguages->header()->setLabel( 0, tr2i18n( "Languages" ) ); +} + +#include "langselectw.moc" diff --git a/src/langselectw.ui b/src/langselectw.ui new file mode 100644 index 0000000..943d72a --- /dev/null +++ b/src/langselectw.ui @@ -0,0 +1,72 @@ + +langSelect + + + langSelect + + + + 0 + 0 + 600 + 480 + + + + Selection + + + image0 + + + + unnamed + + + 2 + + + + + Languages + + + false + + + true + + + + lvLanguages + + + + 1 + 7 + 0 + 0 + + + + + 208 + 0 + + + + AlwaysOff + + + LastColumn + + + + + + + 89504e470d0a1a0a0000000d4948445200000011000000120806000000bdf935540000022749444154388d9dd24f48d36118c0f1efef97ca0affe582220c9a825966ed20251d86512081c1829da2c33a64070fa5d0a50e5b5d0a42727508ba48073b49185114441b24b59ce5241029643041f1b77fbfaded37759b6f87e5dc3f5df4c203efe1793eefc3f33e9210024992283e1e30d7180cb63a93c928d7d7b301f8c6c65ce7c2e1b39b394288a24b21605c309984f07884989ecec5c2d09078093df9881002b94400d260ded7d707a15041b4f4f6a26b6e7e549cbf1de24ab9dd100c96c4718bc5f81cac159114340a4dcb16060205c8218381fdededb6a7d0b8995f05f075fc61a4e6db0b57fcfecc6c0a1aea743a6b536b6bb610a068f09d5d5d877fcdcfdf04ec39e460621cddc50be65d33c25cabd553d5d282944e67bbf80bacb8dd78bd5e35035ea1d723c18d02448b461d0d72d216e839c0dea93d108b6d3d2b4924fd7e3e78bd131a5ced079550088081fc99ac67e411e5c7a4babbfb24d1cc72b683bc58541412e0e807b5dc0c6580cec139351c4a3874f26fc2a7f4254854d3b80eae7240c1ef6c6418599efdacd69e3f4db83aba85280ac9d5d5edea0b91ee3b73aa12581f94630b2c5d3a0191084422c4e271e6d7d62676548ad7fefbf031dfd2a44dbc3136f9de82f3198c0ee7ed4471ad10a214797deba8d5ffeab2703eb6f8767c7d2704e0a3bdc3179e792046afb55bff0529bbf64a3033a8fefc42db1993ad523739addc797fbbcd1998ba279e5c3962ffaf4e001657e4bbee779f08567734546ae40f517b2c24c5d9542e0000000049454e44ae426082 + + + + diff --git a/src/main.cpp b/src/main.cpp new file mode 100755 index 0000000..2158608 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,154 @@ +/************************************************************************** +* Copyright (C) 2005 by Jean-Michel Petit * +* jm_petit@laposte.net * +* * +* 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. * +***************************************************************************/ +#include "k9common.h" +#include "k9play.h" +#include +#include +#include +#include +#include "ac.h" +#include "k9copy.h" +#include "dvdread.h" +#include "k9redirect.h" + +static const char description[] = + I18N_NOOP("A DVD Backup tool for KDE"); + +static const char version[] = VERSION ;// "1.1.1-2"; + +static const KCmdLineOptions options[] = { + { "input ", I18N_NOOP("input device"), 0 + }, + { "output ", I18N_NOOP("output device"), 0 }, + { "dvdtitle ", I18N_NOOP("title to play"), 0 }, + { "play", I18N_NOOP("play title to stdout"), 0 }, + { "startsector ", I18N_NOOP("start sector"),0}, + { "endsector ", I18N_NOOP("end sector"),0}, + { "audiofilter ", I18N_NOOP("list of audio streams"),0}, + { "subpicturefilter ", I18N_NOOP("list of spu streams"),0}, + { "vampsfactor ", I18N_NOOP("shrink factor"),0}, + { "ffactor", I18N_NOOP("shrink factor forced"),0}, + { "inputsize ", I18N_NOOP("size of the cell to be copied"),0}, + { "totalsize ", I18N_NOOP("total size of selected titles"),0}, + { "chaptersize ", I18N_NOOP("size of the chapters being copied"),0}, + { "chapterlist ",I18N_NOOP("selected chapters"),0}, + { "dvdsize ", I18N_NOOP("new dvd size"),0}, + { "chapter ", I18N_NOOP("selected chapter"),0}, + { "cell ", I18N_NOOP("cell number in selected chapter"),0}, + { "inject ", I18N_NOOP("status file name"),0}, + { "initstatus" ,I18N_NOOP("initialize status file"),0}, + { "continue" ,I18N_NOOP("continue playing from last sector"),0}, + { "firstpass" ,I18N_NOOP("don't save status at end"),0}, + { "usecache" ,I18N_NOOP("save cell in a temporary file before encoding"),0}, + { "redirect" ,I18N_NOOP("for internal use"),0}, + KCmdLineLastOption // End of options. + }; + + +int main(int argc, char **argv) { + KAboutData about("k9copy", I18N_NOOP("k9copy"), version,description, + KAboutData::License_GPL, "(C) 2004-2006 Jean-Michel PETIT", 0, 0, "k9copy@free.fr"); + about.addAuthor( "Jean-Michel PETIT", 0, "k9copy@free.Fr" ); + about.setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\\nYour names") + ,I18N_NOOP("_: EMAIL OF TRANSLATORS\\nYour emails")); + + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions( options ); + + KApplication app; + // kMainDlg *mainWin = 0; + + // see if we are starting with session management + if (app.isRestored()) { + RESTORE(k9Copy); + } else { + ac_mmtest(); + tc_memcpy_init( 0, ac_mmflag()); + + // no session.. just start up normally + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + QString TitleNumber(args->getOption("dvdtitle")); + QString InputOptionArg( args->getOption("input")); + QString OutputOptionArg( args->getOption("output")); + QString startSectorArg(args->getOption("startsector")); + QString endSectorArg(args->getOption("endsector")); + QString audioFilterArg(args->getOption("audiofilter")); + QString subpictureFilterArg(args->getOption("subpicturefilter")); + QString vampsFactorArg(args->getOption("vampsfactor")); + QString inputSizeArg(args->getOption("inputsize")); + QString chapterArg(args->getOption("chapter")); + QString cellArg(args->getOption("cell")); + QString injectArg(args->getOption("inject")); + QString totalSizeArg(args->getOption("totalsize")); + QString dvdSizeArg(args->getOption("dvdsize")); + QString chapterSizeArg(args->getOption("chaptersize")); + QString chapterListArg(args->getOption("chapterlist")); + bool ffactor=args->isSet("ffactor"); + bool play= args->isSet("play"); + bool redirect = args->isSet("redirect"); + if (play) { + k9play player; + player.setinitStatus( args->isSet("initstatus")); + player.setcontinue( args->isSet("continue")); + player.setfirstPass(args->isSet("firstpass")); + player.setuseCache(args->isSet("usecache")); + player.setDevice(InputOptionArg); + player.setTitle(TitleNumber.toInt()); + player.setstartSector(startSectorArg); + player.setendSector(endSectorArg ); + player.setaudioFilter( audioFilterArg); + player.setsubpictureFilter( subpictureFilterArg); + player.setvampsFactor( vampsFactorArg); + player.setinputSize( inputSizeArg); + player.setchapter(chapterArg); + player.setcell(cellArg); + player.setinject(injectArg); + player.settotalSize(totalSizeArg); + player.setdvdSize(dvdSizeArg); + player.setchapterSize( chapterSizeArg); + player.setforcedFactor(ffactor); + player.setchapterList( chapterListArg); + player.execute(); + return 0; + } else if (redirect) { + k9Redirect redirect; + redirect.execute(); + return 0; + } else { + + k9Copy *widget = new k9Copy; + if (InputOptionArg !="") { + widget->setInput( InputOptionArg); + widget->fileOpen(); + } + if (OutputOptionArg !="") + widget->setOutput( OutputOptionArg); + + if ((InputOptionArg !="") && (OutputOptionArg!="")) + widget->clone( InputOptionArg,OutputOptionArg); + widget->show(); + } + } + + + int ret= app.exec(); + return ret; +} + diff --git a/src/mencoder.xml b/src/mencoder.xml new file mode 100644 index 0000000..ed0a8e8 --- /dev/null +++ b/src/mencoder.xml @@ -0,0 +1,726 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mencoderCmdGen.cpp b/src/mencoderCmdGen.cpp new file mode 100644 index 0000000..93701c5 --- /dev/null +++ b/src/mencoderCmdGen.cpp @@ -0,0 +1,129 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './mencoderCmdGen.ui' +** +** Created: dim. oct. 26 08:57:34 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "mencoderCmdGen.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "kpushbutton.h" + +/* + * Constructs a MyDialog1 as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ +MyDialog1::MyDialog1( QWidget* parent, const char* name, bool modal, WFlags fl ) + : QDialog( parent, name, modal, fl ) +{ + if ( !name ) + setName( "MyDialog1" ); + setSizeGripEnabled( TRUE ); + MyDialog1Layout = new QGridLayout( this, 1, 1, 11, 6, "MyDialog1Layout"); + + Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); + Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + Layout1->addItem( Horizontal_Spacing2 ); + + buttonOk = new KPushButton( this, "buttonOk" ); + buttonOk->setAutoDefault( TRUE ); + buttonOk->setDefault( TRUE ); + buttonOk->setProperty( "stdItem", 1 ); + Layout1->addWidget( buttonOk ); + + buttonCancel = new KPushButton( this, "buttonCancel" ); + buttonCancel->setAutoDefault( TRUE ); + buttonCancel->setProperty( "stdItem", 2 ); + Layout1->addWidget( buttonCancel ); + + MyDialog1Layout->addMultiCellLayout( Layout1, 1, 1, 0, 1 ); + + listView = new QListView( this, "listView" ); + listView->addColumn( QString::null ); + listView->header()->setClickEnabled( FALSE, listView->header()->count() - 1 ); + listView->header()->setResizeEnabled( FALSE, listView->header()->count() - 1 ); + listView->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)7, 0, 0, listView->sizePolicy().hasHeightForWidth() ) ); + listView->setMinimumSize( QSize( 200, 0 ) ); + listView->setResizeMode( QListView::LastColumn ); + + MyDialog1Layout->addWidget( listView, 0, 0 ); + + wsOptions = new QWidgetStack( this, "wsOptions" ); + + WStackPage = new QWidget( wsOptions, "WStackPage" ); + wsOptions->addWidget( WStackPage, 0 ); + + MyDialog1Layout->addWidget( wsOptions, 0, 1 ); + languageChange(); + resize( QSize(655, 498).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( listView, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( listViewCurrentChanged(QListViewItem*) ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +MyDialog1::~MyDialog1() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void MyDialog1::languageChange() +{ + setCaption( tr2i18n( "MEncoder options" ) ); + listView->header()->setLabel( 0, QString::null ); + listView->clear(); + QListViewItem * item_2 = new QListViewItem( listView, 0 ); + item_2->setOpen( TRUE ); + QListViewItem * item = new QListViewItem( item_2, 0 ); + item->setText( 0, tr2i18n( "faac" ) ); + item_2->setOpen( TRUE ); + item = new QListViewItem( item_2, item ); + item->setText( 0, tr2i18n( "lavc" ) ); + item_2->setText( 0, tr2i18n( "Audio Codec" ) ); + + QListViewItem * item_3 = new QListViewItem( listView, item_2 ); + item_3->setOpen( TRUE ); + item = new QListViewItem( item_3, item_2 ); + item->setText( 0, tr2i18n( "x264" ) ); + item_3->setOpen( TRUE ); + item = new QListViewItem( item_3, item ); + item->setText( 0, tr2i18n( "xvid" ) ); + item_3->setOpen( TRUE ); + item = new QListViewItem( item_3, item ); + item->setText( 0, tr2i18n( "lavc" ) ); + item_3->setText( 0, tr2i18n( "Video Codec" ) ); + +} + +void MyDialog1::listViewCurrentChanged(QListViewItem*) +{ + qWarning( "MyDialog1::listViewCurrentChanged(QListViewItem*): Not implemented yet" ); +} + +#include "mencoderCmdGen.moc" diff --git a/src/mencoderCmdGen.ui b/src/mencoderCmdGen.ui new file mode 100644 index 0000000..219764e --- /dev/null +++ b/src/mencoderCmdGen.ui @@ -0,0 +1,215 @@ + +MyDialog1 + + + MyDialog1 + + + + 0 + 0 + 655 + 498 + + + + MEncoder options + + + true + + + + unnamed + + + + Layout1 + + + + unnamed + + + 0 + + + 6 + + + + Horizontal Spacing2 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + buttonOk + + + true + + + true + + + 1 + + + + + buttonCancel + + + true + + + 2 + + + + + + + + + + + false + + + false + + + + + Audio Codec + + + + + + + faac + + + + + + + + lavc + + + + + + + + + Video Codec + + + + + + + x264 + + + + + + + + xvid + + + + + + + + lavc + + + + + + + + listView + + + + 0 + 7 + 0 + 0 + + + + + 200 + 0 + + + + LastColumn + + + + + wsOptions + + + + WStackPage + + + 0 + + + + + + + + buttonOk + clicked() + MyDialog1 + accept() + + + buttonCancel + clicked() + MyDialog1 + reject() + + + listView + currentChanged(QListViewItem*) + MyDialog1 + listViewCurrentChanged(QListViewItem*) + + + + listViewCurrentChanged(QListViewItem*) + + + + kpushbutton.h + kpushbutton.h + + diff --git a/src/pellicule.png b/src/pellicule.png new file mode 100644 index 0000000..87340c3 Binary files /dev/null and b/src/pellicule.png differ diff --git a/src/playbackoptionsw.cpp b/src/playbackoptionsw.cpp new file mode 100644 index 0000000..a6a4860 --- /dev/null +++ b/src/playbackoptionsw.cpp @@ -0,0 +1,279 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './playbackoptionsw.ui' +** +** Created: dim. oct. 26 08:57:35 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "playbackoptionsw.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "kpushbutton.h" +static const unsigned char img0_playbackoptionsw[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0x61, 0x00, 0x00, 0x03, + 0x16, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x75, 0x93, 0x4f, 0x48, 0x2b, + 0x67, 0x14, 0xc5, 0x4f, 0xbe, 0x99, 0x38, 0xc9, 0xc4, 0x38, 0x32, 0x6a, + 0xd0, 0x3e, 0x17, 0xc1, 0xaa, 0x0b, 0x17, 0x0a, 0x0d, 0x0a, 0xea, 0x03, + 0x69, 0x17, 0x2d, 0x2e, 0x5c, 0x08, 0x5d, 0x04, 0xba, 0xd1, 0xbd, 0xa9, + 0xd0, 0x4d, 0x37, 0x85, 0x3e, 0x5c, 0x06, 0x51, 0x74, 0xd1, 0xba, 0x2a, + 0xb4, 0x50, 0x05, 0xa9, 0xa0, 0x08, 0x82, 0xae, 0x6c, 0x03, 0x6d, 0x4d, + 0x9a, 0xc0, 0xf3, 0xa9, 0x1b, 0x17, 0x41, 0x34, 0x91, 0x50, 0x89, 0x89, + 0x9d, 0x7f, 0xdf, 0xcc, 0x7c, 0x73, 0xbb, 0x28, 0x86, 0x22, 0xed, 0x59, + 0x9f, 0xdf, 0xbd, 0x07, 0xee, 0xb9, 0x21, 0xbc, 0xd0, 0xe4, 0xe4, 0xe4, + 0x47, 0x53, 0x53, 0x53, 0xe9, 0x89, 0x89, 0x89, 0x8f, 0x93, 0xc9, 0x64, + 0x67, 0x3c, 0x1e, 0x47, 0xb1, 0x58, 0x7c, 0x3a, 0x3a, 0x3a, 0xfa, 0xe9, + 0xe0, 0xe0, 0xe0, 0x7b, 0xcb, 0xb2, 0xde, 0xbe, 0x64, 0x00, 0x00, 0xbd, + 0xbd, 0xbd, 0x3d, 0xcb, 0xcb, 0xcb, 0xdf, 0x95, 0xcb, 0x65, 0x41, 0xff, + 0xa3, 0x52, 0xa9, 0xf4, 0xd7, 0xec, 0xec, 0xec, 0x1b, 0x00, 0x6d, 0x2f, + 0x79, 0x7d, 0x63, 0x63, 0xe3, 0x0f, 0xd7, 0x75, 0x89, 0x88, 0xc8, 0x75, + 0x5d, 0xf2, 0x3c, 0x8f, 0x38, 0xe7, 0x64, 0xdb, 0x36, 0x71, 0xce, 0xc9, + 0xf7, 0x7d, 0x22, 0x22, 0xb2, 0x2c, 0x8b, 0x16, 0x17, 0x17, 0x77, 0x00, + 0x48, 0x2d, 0x3a, 0x9d, 0x4e, 0x7f, 0x53, 0xad, 0x56, 0xe9, 0xe6, 0xe6, + 0x86, 0x9a, 0xcd, 0x26, 0x39, 0x8e, 0xd3, 0x82, 0x0d, 0xc3, 0x68, 0x0d, + 0x11, 0xe2, 0x9f, 0x70, 0x8f, 0x8f, 0x8f, 0x94, 0x4a, 0xa5, 0x3e, 0x07, + 0x00, 0x49, 0xd3, 0xb4, 0x0f, 0xb2, 0xd9, 0xec, 0xb7, 0xb2, 0x2c, 0x33, + 0xdf, 0xf7, 0x11, 0x04, 0x01, 0xda, 0xda, 0xda, 0x20, 0xcb, 0x32, 0x00, + 0x80, 0x88, 0x10, 0x0a, 0x85, 0x10, 0x0e, 0x87, 0x41, 0x44, 0xe0, 0x9c, + 0x43, 0x55, 0x55, 0x74, 0x76, 0x76, 0xa6, 0xf6, 0xf6, 0xf6, 0x7e, 0x94, + 0xa7, 0xa7, 0xa7, 0x3f, 0xed, 0xea, 0xea, 0x92, 0x6d, 0xdb, 0x46, 0x2c, + 0x16, 0x83, 0x10, 0x02, 0xb6, 0x6d, 0x03, 0x00, 0x3c, 0xcf, 0x83, 0xef, + 0xfb, 0xd0, 0x34, 0x0d, 0x44, 0x04, 0xc7, 0x71, 0x60, 0xdb, 0x36, 0x1a, + 0x8d, 0x06, 0x52, 0xa9, 0x54, 0x62, 0x60, 0x60, 0xe0, 0x13, 0x79, 0x6c, + 0x6c, 0xec, 0x43, 0xd7, 0x75, 0x21, 0x49, 0x12, 0x42, 0xa1, 0x10, 0x24, + 0x49, 0x82, 0xeb, 0xba, 0x68, 0x36, 0x9b, 0xa8, 0xd5, 0x6a, 0x7e, 0x2c, + 0x16, 0x63, 0x9e, 0xe7, 0x31, 0x55, 0x55, 0xc1, 0x39, 0x87, 0x69, 0x9a, + 0xb0, 0x2c, 0x0b, 0x44, 0x84, 0x91, 0x91, 0x91, 0x09, 0x59, 0xd7, 0xf5, + 0x57, 0x00, 0xc0, 0x18, 0x83, 0x24, 0x49, 0x08, 0x87, 0xc3, 0xcf, 0x5b, + 0x68, 0x6e, 0x6e, 0xee, 0xb3, 0xd1, 0xd1, 0xd1, 0x57, 0x5b, 0x5b, 0x5b, + 0x6b, 0xa6, 0x69, 0x42, 0x08, 0x81, 0xa7, 0xa7, 0x27, 0x18, 0x86, 0x01, + 0x45, 0x51, 0xa0, 0xeb, 0x7a, 0x9f, 0xec, 0x79, 0x9e, 0xdb, 0xd1, 0xd1, + 0x01, 0x00, 0x50, 0x14, 0x05, 0x8c, 0x31, 0xc8, 0xb2, 0x8c, 0xf6, 0xf6, + 0xf6, 0xd0, 0xc2, 0xc2, 0xc2, 0xeb, 0xbe, 0xbe, 0xbe, 0xde, 0x46, 0xa3, + 0x81, 0x48, 0x24, 0x02, 0xce, 0x39, 0x0c, 0xc3, 0x80, 0x10, 0x02, 0x8a, + 0xa2, 0x80, 0x73, 0x2e, 0xe4, 0xeb, 0xeb, 0xeb, 0x77, 0xd1, 0x68, 0xf4, + 0x7d, 0xc6, 0x18, 0xc2, 0xe1, 0x30, 0x22, 0x91, 0x08, 0xba, 0xbb, 0xbb, + 0x51, 0xab, 0xd5, 0x90, 0xc9, 0x64, 0x32, 0x41, 0x10, 0xc0, 0x34, 0x4d, + 0x38, 0x8e, 0x03, 0xcb, 0xb2, 0x10, 0x04, 0x01, 0x18, 0x63, 0x08, 0x82, + 0x00, 0xe5, 0x72, 0xf9, 0x86, 0xe5, 0x72, 0xb9, 0x43, 0xcb, 0xb2, 0xa0, + 0xaa, 0x2a, 0x14, 0x45, 0x81, 0x10, 0x02, 0xb7, 0xb7, 0xb7, 0x70, 0x1c, + 0x07, 0xaa, 0xaa, 0x22, 0x91, 0x48, 0x40, 0x51, 0x14, 0x54, 0x2a, 0x15, + 0x70, 0xce, 0x5b, 0x17, 0xa9, 0x56, 0xab, 0xb8, 0xba, 0xba, 0xfa, 0x45, + 0xaa, 0xd7, 0xeb, 0x77, 0xc9, 0x64, 0x32, 0x3d, 0x33, 0x33, 0xa3, 0x31, + 0xc6, 0xb0, 0xb2, 0xb2, 0x82, 0x42, 0xa1, 0x80, 0xa5, 0xa5, 0x25, 0x98, + 0xa6, 0x89, 0x7c, 0x3e, 0x8f, 0xd5, 0xd5, 0x55, 0x48, 0x92, 0x84, 0xc3, + 0xc3, 0x43, 0x8c, 0x8f, 0x8f, 0x43, 0xd3, 0x34, 0x6c, 0x6f, 0x6f, 0xbf, + 0x2d, 0x14, 0x0a, 0x6f, 0x18, 0x80, 0x3f, 0xd7, 0xd6, 0xd6, 0xbe, 0x3c, + 0x3b, 0x3b, 0x83, 0x65, 0x59, 0xc8, 0xe7, 0xf3, 0x08, 0x82, 0x00, 0xf3, + 0xf3, 0xf3, 0x38, 0x3e, 0x3e, 0x46, 0xad, 0x56, 0x43, 0x34, 0x1a, 0x05, + 0x11, 0x61, 0x78, 0x78, 0x18, 0x89, 0x44, 0x02, 0xa7, 0xa7, 0xa7, 0xee, + 0xce, 0xce, 0xce, 0x57, 0x00, 0x9a, 0xad, 0x36, 0x0e, 0x0e, 0x0e, 0x7e, + 0xbd, 0xbb, 0xbb, 0xeb, 0x97, 0x4a, 0x25, 0xca, 0xe5, 0x72, 0x54, 0x2c, + 0x16, 0x69, 0x7f, 0x7f, 0x9f, 0x2a, 0x95, 0x0a, 0x5d, 0x5c, 0x5c, 0xd0, + 0xe5, 0xe5, 0x25, 0x3d, 0x3c, 0x3c, 0xd0, 0xfa, 0xfa, 0xba, 0x15, 0x8f, + 0xc7, 0xbf, 0x78, 0xe6, 0x5a, 0x7d, 0xae, 0xd7, 0xeb, 0x3f, 0x9f, 0x9c, + 0x9c, 0xbc, 0xf3, 0x3c, 0x6f, 0x50, 0xd7, 0xf5, 0xf7, 0x88, 0x08, 0x43, + 0x43, 0x43, 0x60, 0x8c, 0x81, 0x73, 0x8e, 0xf3, 0xf3, 0xf3, 0x20, 0x9b, + 0xcd, 0xfe, 0xbe, 0xb9, 0xb9, 0x99, 0x71, 0x1c, 0xe7, 0x87, 0x67, 0x2e, + 0xf4, 0x1f, 0x8f, 0xd9, 0xae, 0x28, 0xca, 0xeb, 0xfe, 0xfe, 0xfe, 0xc9, + 0x9e, 0x9e, 0x9e, 0x7e, 0x21, 0x04, 0xdd, 0xdf, 0xdf, 0xdf, 0xde, 0xdd, + 0xdd, 0xfd, 0x0a, 0xe0, 0x37, 0x00, 0xc6, 0xbf, 0xcd, 0x7f, 0x03, 0x0c, + 0x63, 0xc7, 0xb7, 0xdc, 0x56, 0x84, 0xa7, 0x00, 0x00, 0x00, 0x00, 0x49, + 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + + +/* + * Constructs a PlaybackOptionsw as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +PlaybackOptionsw::PlaybackOptionsw( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QImage img; + img.loadFromData( img0_playbackoptionsw, sizeof( img0_playbackoptionsw ), "PNG" ); + image0 = img; + if ( !name ) + setName( "PlaybackOptionsw" ); + setIcon( image0 ); + PlaybackOptionswLayout = new QGridLayout( this, 1, 1, 2, 6, "PlaybackOptionswLayout"); + + ckMenu = new QCheckBox( this, "ckMenu" ); + + PlaybackOptionswLayout->addWidget( ckMenu, 1, 0 ); + + frPlayback = new QFrame( this, "frPlayback" ); + frPlayback->setEnabled( FALSE ); + frPlayback->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, frPlayback->sizePolicy().hasHeightForWidth() ) ); + frPlayback->setFrameShape( QFrame::NoFrame ); + frPlayback->setFrameShadow( QFrame::Sunken ); + frPlaybackLayout = new QGridLayout( frPlayback, 1, 1, 0, 2, "frPlaybackLayout"); + + lbSequence = new QListBox( frPlayback, "lbSequence" ); + lbSequence->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, lbSequence->sizePolicy().hasHeightForWidth() ) ); + + frPlaybackLayout->addMultiCellWidget( lbSequence, 1, 5, 0, 0 ); + spacer5 = new QSpacerItem( 20, 31, QSizePolicy::Minimum, QSizePolicy::Expanding ); + frPlaybackLayout->addMultiCell( spacer5, 0, 1, 1, 1 ); + + bSeqUp = new KPushButton( frPlayback, "bSeqUp" ); + bSeqUp->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bSeqUp->sizePolicy().hasHeightForWidth() ) ); + bSeqUp->setMinimumSize( QSize( 21, 21 ) ); + bSeqUp->setMaximumSize( QSize( 21, 21 ) ); + + frPlaybackLayout->addMultiCellWidget( bSeqUp, 2, 2, 1, 2 ); + + bSeqDown = new KPushButton( frPlayback, "bSeqDown" ); + bSeqDown->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bSeqDown->sizePolicy().hasHeightForWidth() ) ); + bSeqDown->setMinimumSize( QSize( 21, 21 ) ); + bSeqDown->setMaximumSize( QSize( 21, 21 ) ); + + frPlaybackLayout->addMultiCellWidget( bSeqDown, 4, 4, 1, 2 ); + spacer7 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Fixed ); + frPlaybackLayout->addItem( spacer7, 3, 1 ); + + textLabel4 = new QLabel( frPlayback, "textLabel4" ); + textLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel4->sizePolicy().hasHeightForWidth() ) ); + QFont textLabel4_font( textLabel4->font() ); + textLabel4_font.setBold( TRUE ); + textLabel4->setFont( textLabel4_font ); + + frPlaybackLayout->addWidget( textLabel4, 0, 0 ); + + frame4 = new QFrame( frPlayback, "frame4" ); + frame4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, frame4->sizePolicy().hasHeightForWidth() ) ); + frame4->setMinimumSize( QSize( 211, 100 ) ); + frame4->setFrameShape( QFrame::NoFrame ); + frame4->setFrameShadow( QFrame::Raised ); + frame4Layout = new QGridLayout( frame4, 1, 1, 0, 0, "frame4Layout"); + + textLabel1 = new QLabel( frame4, "textLabel1" ); + textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) ); + QFont textLabel1_font( textLabel1->font() ); + textLabel1_font.setBold( TRUE ); + textLabel1->setFont( textLabel1_font ); + + frame4Layout->addMultiCellWidget( textLabel1, 0, 0, 0, 2 ); + + cbDefSub = new QComboBox( FALSE, frame4, "cbDefSub" ); + cbDefSub->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, cbDefSub->sizePolicy().hasHeightForWidth() ) ); + + frame4Layout->addWidget( cbDefSub, 2, 2 ); + + textLabel3 = new QLabel( frame4, "textLabel3" ); + textLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel3->sizePolicy().hasHeightForWidth() ) ); + + frame4Layout->addWidget( textLabel3, 2, 0 ); + + cbDefAudio = new QComboBox( FALSE, frame4, "cbDefAudio" ); + cbDefAudio->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, cbDefAudio->sizePolicy().hasHeightForWidth() ) ); + + frame4Layout->addWidget( cbDefAudio, 1, 2 ); + + textLabel2_3 = new QLabel( frame4, "textLabel2_3" ); + textLabel2_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel2_3->sizePolicy().hasHeightForWidth() ) ); + + frame4Layout->addWidget( textLabel2_3, 1, 0 ); + spacer4 = new QSpacerItem( 16, 21, QSizePolicy::Fixed, QSizePolicy::Minimum ); + frame4Layout->addMultiCell( spacer4, 1, 2, 1, 1 ); + + frPlaybackLayout->addWidget( frame4, 6, 0 ); + spacer6 = new QSpacerItem( 20, 280, QSizePolicy::Minimum, QSizePolicy::Expanding ); + frPlaybackLayout->addMultiCell( spacer6, 5, 6, 1, 1 ); + + PlaybackOptionswLayout->addWidget( frPlayback, 0, 0 ); + languageChange(); + resize( QSize(328, 491).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bSeqDown, SIGNAL( clicked() ), this, SLOT( bSeqDownClick() ) ); + connect( bSeqUp, SIGNAL( clicked() ), this, SLOT( bSeqUpClick() ) ); + connect( ckMenu, SIGNAL( clicked() ), this, SLOT( ckMenuClick() ) ); + connect( cbDefAudio, SIGNAL( activated(int) ), this, SLOT( cbDefAudioActivated(int) ) ); + connect( cbDefSub, SIGNAL( activated(int) ), this, SLOT( cbDefSubActivated(int) ) ); + connect( lbSequence, SIGNAL( currentChanged(QListBoxItem*) ), this, SLOT( lbSequenceChanged(QListBoxItem*) ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +PlaybackOptionsw::~PlaybackOptionsw() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void PlaybackOptionsw::languageChange() +{ + setCaption( tr2i18n( "DVD playback options" ) ); + ckMenu->setText( tr2i18n( "&Keep original menus" ) ); + ckMenu->setAccel( QKeySequence( tr2i18n( "Alt+K" ) ) ); + bSeqUp->setText( QString::null ); + bSeqDown->setText( QString::null ); + textLabel4->setText( tr2i18n( "Selected Titles" ) ); + textLabel1->setText( tr2i18n( "Default language" ) ); + textLabel3->setText( tr2i18n( "Subtitle" ) ); + textLabel2_3->setText( tr2i18n( "Audio" ) ); +} + +void PlaybackOptionsw::cbStartActivated(int) +{ + qWarning( "PlaybackOptionsw::cbStartActivated(int): Not implemented yet" ); +} + +void PlaybackOptionsw::cbTitleActivated(int) +{ + qWarning( "PlaybackOptionsw::cbTitleActivated(int): Not implemented yet" ); +} + +void PlaybackOptionsw::ckMenuClick() +{ + qWarning( "PlaybackOptionsw::ckMenuClick(): Not implemented yet" ); +} + +void PlaybackOptionsw::bSeqUpClick() +{ + qWarning( "PlaybackOptionsw::bSeqUpClick(): Not implemented yet" ); +} + +void PlaybackOptionsw::bSeqDownClick() +{ + qWarning( "PlaybackOptionsw::bSeqDownClick(): Not implemented yet" ); +} + +void PlaybackOptionsw::lbSequenceChanged(QListBoxItem*) +{ + qWarning( "PlaybackOptionsw::lbSequenceChanged(QListBoxItem*): Not implemented yet" ); +} + +void PlaybackOptionsw::cbDefAudioActivated(int) +{ + qWarning( "PlaybackOptionsw::cbDefAudioActivated(int): Not implemented yet" ); +} + +void PlaybackOptionsw::cbDefSubActivated(int) +{ + qWarning( "PlaybackOptionsw::cbDefSubActivated(int): Not implemented yet" ); +} + +#include "playbackoptionsw.moc" diff --git a/src/playbackoptionsw.ui b/src/playbackoptionsw.ui new file mode 100644 index 0000000..8f3105e --- /dev/null +++ b/src/playbackoptionsw.ui @@ -0,0 +1,405 @@ + +PlaybackOptionsw + + + PlaybackOptionsw + + + + 0 + 0 + 328 + 491 + + + + DVD playback options + + + image0 + + + + unnamed + + + 2 + + + + ckMenu + + + &Keep original menus + + + Alt+K + + + + + frPlayback + + + false + + + + 5 + 5 + 0 + 0 + + + + NoFrame + + + Sunken + + + + unnamed + + + 0 + + + 2 + + + + lbSequence + + + + 7 + 7 + 0 + 0 + + + + + + spacer5 + + + Vertical + + + Expanding + + + + 20 + 31 + + + + + + bSeqUp + + + + 0 + 0 + 0 + 0 + + + + + 21 + 21 + + + + + 21 + 21 + + + + + + + + + bSeqDown + + + + 0 + 0 + 0 + 0 + + + + + 21 + 21 + + + + + 21 + 21 + + + + + + + + + spacer7 + + + Vertical + + + Fixed + + + + 20 + 16 + + + + + + textLabel4 + + + + 5 + 0 + 0 + 0 + + + + + 1 + + + + Selected Titles + + + + + frame4 + + + + 5 + 0 + 0 + 0 + + + + + 211 + 100 + + + + NoFrame + + + Raised + + + + unnamed + + + 0 + + + 0 + + + + textLabel1 + + + + 5 + 0 + 0 + 0 + + + + + 1 + + + + Default language + + + + + cbDefSub + + + + 7 + 5 + 0 + 0 + + + + + + textLabel3 + + + + 5 + 0 + 0 + 0 + + + + Subtitle + + + + + cbDefAudio + + + + 7 + 5 + 0 + 0 + + + + + + textLabel2_3 + + + + 5 + 0 + 0 + 0 + + + + Audio + + + + + spacer4 + + + Horizontal + + + Fixed + + + + 16 + 21 + + + + + + + + spacer6 + + + Vertical + + + Expanding + + + + 20 + 280 + + + + + + + + + + 89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff610000031649444154388d75934f482b6714c54fbe9938c9c438326ad03e17c1aa0b170a0d0aea0369172d2e5c085d04bad1bda9d04d37853e5c065174d1ba2ab45005a9a00882ae6c036d4d9ac0f3a91b174134915089899d7fdfcc7c73bb288622ed599fdfbd07eeb921bcd0e4e4e447535353e98989898f93c964673c1e47b1587c3a3a3afae9e0e0e07bcbb2debe640000bdbdbd3dcbcbcbdf95cb6541ffa352a9f4d7ececec1b006d2f797d6363e30fd7758988c8755df23c8f38e764db3671cec9f77d2222b22c8b1617177700482d3a9d4e7f53ad56e9e6e6869acd26398ed3820dc3680d11e29f708f8f8f944aa53e070049d3b40fb2d9ecb7b22c33dff7110401dadada20cb32008088100a85100e874144e09c435555747676a6f6f6f67e94a7a7a73fedeaea926ddb462c16831002b66d03003ccf83effbd0340d4404c77160db361a8d0652a954626060e013796c6cec43d77521491242a110244982ebba68369ba8d56a7e2c16639ee7315555c13987699ab02c0b44849191910959d7f55700c0188324490887c3cf5b686e6eeeb3d1d1d1575b5b5b6ba669420881a7a7271886014551a0eb7a9fec799edbd1d101005014058c31c8b28cf6f6f6d0c2c2c2ebbebebede46a381482402ce390cc38010028aa280732ee4ebebeb77d168f47dc618c2e130229108babbbb51abd590c964324110c0344d388e03cbb21004011863088200e572f986e572b943cbb2a0aa2a1445811002b7b7b7701c07aaaa229148405114542a1570ce5b17a956abb8babafa45aad7eb77c964323d3333a331c6b0b2b28242a180a5a52598a6897c3e8fd5d555489284c3c3438c8f8f43d3346c6f6fbf2d140a6f18803fd7d6d6be3c3b3b836559c8e7f3088200f3f3f3383e3e46ad5643341a051161787818894402a7a7a7eececece57009aad360e0e0e7ebdbbbbeb974a25cae572542c16697f7f9f2a950a5d5c5cd0e5e5253d3c3cd0fafaba158fc7bf78e65a7daed7eb3f9f9c9cbcf33c6f50d7f5f78808434343608c81738ef3f3f3209bcdfebeb9b999711ce787672ef41f8fd9ae28caebfefefec99e9e9e7e2104dddfdfdfdeddddfd0ae03700c6bfcd7f030c63c7b7dc5684a70000000049454e44ae426082 + + + + + bSeqDown + clicked() + PlaybackOptionsw + bSeqDownClick() + + + bSeqUp + clicked() + PlaybackOptionsw + bSeqUpClick() + + + ckMenu + clicked() + PlaybackOptionsw + ckMenuClick() + + + cbDefAudio + activated(int) + PlaybackOptionsw + cbDefAudioActivated(int) + + + cbDefSub + activated(int) + PlaybackOptionsw + cbDefSubActivated(int) + + + lbSequence + currentChanged(QListBoxItem*) + PlaybackOptionsw + lbSequenceChanged(QListBoxItem*) + + + + cbStartActivated( int ) + cbTitleActivated( int ) + ckMenuClick() + bSeqUpClick() + bSeqDownClick() + lbSequenceChanged(QListBoxItem*) + cbDefAudioActivated(int) + cbDefSubActivated(int) + + + + kpushbutton.h + kpushbutton.h + + diff --git a/src/prefAuthor.cpp b/src/prefAuthor.cpp new file mode 100644 index 0000000..f43d619 --- /dev/null +++ b/src/prefAuthor.cpp @@ -0,0 +1,165 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './prefAuthor.ui' +** +** Created: dim. oct. 26 08:57:35 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "prefAuthor.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "knuminput.h" +#include "kpushbutton.h" +#include "kcolorbutton.h" + +/* + * Constructs a prefAuthor as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +prefAuthor::prefAuthor( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "prefAuthor" ); + prefAuthorLayout = new QGridLayout( this, 1, 1, 11, 6, "prefAuthorLayout"); + + groupBox1 = new QGroupBox( this, "groupBox1" ); + groupBox1->setColumnLayout(0, Qt::Vertical ); + groupBox1->layout()->setSpacing( 6 ); + groupBox1->layout()->setMargin( 11 ); + groupBox1Layout = new QGridLayout( groupBox1->layout() ); + groupBox1Layout->setAlignment( Qt::AlignTop ); + + cbAudioFormat = new QComboBox( FALSE, groupBox1, "cbAudioFormat" ); + + groupBox1Layout->addWidget( cbAudioFormat, 0, 1 ); + + cbAudioBitrate = new QComboBox( FALSE, groupBox1, "cbAudioBitrate" ); + + groupBox1Layout->addWidget( cbAudioBitrate, 1, 1 ); + + textLabel1 = new QLabel( groupBox1, "textLabel1" ); + + groupBox1Layout->addWidget( textLabel1, 0, 0 ); + + textLabel2 = new QLabel( groupBox1, "textLabel2" ); + + groupBox1Layout->addWidget( textLabel2, 1, 0 ); + spacer1 = new QSpacerItem( 151, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox1Layout->addMultiCell( spacer1, 0, 1, 2, 2 ); + + prefAuthorLayout->addWidget( groupBox1, 0, 0 ); + spacer3 = new QSpacerItem( 20, 60, QSizePolicy::Minimum, QSizePolicy::Expanding ); + prefAuthorLayout->addItem( spacer3, 2, 0 ); + + groupBox2 = new QGroupBox( this, "groupBox2" ); + groupBox2->setColumnLayout(0, Qt::Vertical ); + groupBox2->layout()->setSpacing( 6 ); + groupBox2->layout()->setMargin( 11 ); + groupBox2Layout = new QGridLayout( groupBox2->layout() ); + groupBox2Layout->setAlignment( Qt::AlignTop ); + + textLabel3 = new QLabel( groupBox2, "textLabel3" ); + + groupBox2Layout->addWidget( textLabel3, 0, 0 ); + spacer2 = new QSpacerItem( 121, 31, QSizePolicy::Expanding, QSizePolicy::Minimum ); + groupBox2Layout->addItem( spacer2, 0, 2 ); + + textLabel5 = new QLabel( groupBox2, "textLabel5" ); + + groupBox2Layout->addWidget( textLabel5, 1, 0 ); + + inButtonHeight = new KIntNumInput( groupBox2, "inButtonHeight" ); + inButtonHeight->setMinValue( 0 ); + inButtonHeight->setMaxValue( 480 ); + + groupBox2Layout->addWidget( inButtonHeight, 1, 1 ); + + inButtonWidth = new KIntNumInput( groupBox2, "inButtonWidth" ); + inButtonWidth->setMinValue( 0 ); + inButtonWidth->setMaxValue( 700 ); + + groupBox2Layout->addWidget( inButtonWidth, 0, 1 ); + + bButtonFont = new KPushButton( groupBox2, "bButtonFont" ); + + groupBox2Layout->addWidget( bButtonFont, 4, 1 ); + + textLabel6 = new QLabel( groupBox2, "textLabel6" ); + + groupBox2Layout->addWidget( textLabel6, 2, 0 ); + + cbHiliteColor = new KColorButton( groupBox2, "cbHiliteColor" ); + + groupBox2Layout->addWidget( cbHiliteColor, 2, 1 ); + + textLabel6_2 = new QLabel( groupBox2, "textLabel6_2" ); + + groupBox2Layout->addWidget( textLabel6_2, 3, 0 ); + + cbTextColor = new KColorButton( groupBox2, "cbTextColor" ); + + groupBox2Layout->addWidget( cbTextColor, 3, 1 ); + + prefAuthorLayout->addWidget( groupBox2, 1, 0 ); + languageChange(); + resize( QSize(600, 480).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bButtonFont, SIGNAL( clicked() ), this, SLOT( bButtonFontClicked() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +prefAuthor::~prefAuthor() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void prefAuthor::languageChange() +{ + setCaption( tr2i18n( "Authoring options" ) ); + groupBox1->setTitle( tr2i18n( "Audio" ) ); + cbAudioFormat->clear(); + cbAudioFormat->insertItem( tr2i18n( "AC3" ) ); + cbAudioFormat->insertItem( tr2i18n( "MP2" ) ); + cbAudioBitrate->clear(); + cbAudioBitrate->insertItem( tr2i18n( "128" ) ); + cbAudioBitrate->insertItem( tr2i18n( "192" ) ); + cbAudioBitrate->insertItem( tr2i18n( "320" ) ); + textLabel1->setText( tr2i18n( "Format" ) ); + textLabel2->setText( tr2i18n( "Bitrate" ) ); + groupBox2->setTitle( tr2i18n( "Buttons" ) ); + textLabel3->setText( tr2i18n( "Width" ) ); + textLabel5->setText( tr2i18n( "Height" ) ); + bButtonFont->setText( tr2i18n( "Font" ) ); + textLabel6->setText( tr2i18n( "Hilite color" ) ); + cbHiliteColor->setText( QString::null ); + textLabel6_2->setText( tr2i18n( "Text color" ) ); + cbTextColor->setText( QString::null ); +} + +void prefAuthor::bButtonFontClicked() +{ + qWarning( "prefAuthor::bButtonFontClicked(): Not implemented yet" ); +} + +#include "prefAuthor.moc" diff --git a/src/prefAuthor.ui b/src/prefAuthor.ui new file mode 100644 index 0000000..0f3db9a --- /dev/null +++ b/src/prefAuthor.ui @@ -0,0 +1,251 @@ + +prefAuthor + + + prefAuthor + + + + 0 + 0 + 600 + 480 + + + + Authoring options + + + + unnamed + + + + groupBox1 + + + Audio + + + + unnamed + + + + + AC3 + + + + + MP2 + + + + cbAudioFormat + + + + + + 128 + + + + + 192 + + + + + 320 + + + + cbAudioBitrate + + + + + textLabel1 + + + Format + + + + + textLabel2 + + + Bitrate + + + + + spacer1 + + + Horizontal + + + Expanding + + + + 151 + 21 + + + + + + + + spacer3 + + + Vertical + + + Expanding + + + + 20 + 60 + + + + + + groupBox2 + + + Buttons + + + + unnamed + + + + textLabel3 + + + Width + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 121 + 31 + + + + + + textLabel5 + + + Height + + + + + inButtonHeight + + + 0 + + + 480 + + + + + inButtonWidth + + + 0 + + + 700 + + + + + bButtonFont + + + Font + + + + + textLabel6 + + + Hilite color + + + + + cbHiliteColor + + + + + + + + textLabel6_2 + + + Text color + + + + + cbTextColor + + + + + + + + + + + + bButtonFont + clicked() + prefAuthor + bButtonFontClicked() + + + + bButtonFontClicked() + + + + knuminput.h + knuminput.h + knuminput.h + knuminput.h + kpushbutton.h + kcolorbutton.h + kcolorbutton.h + + diff --git a/src/prefDVD.cpp b/src/prefDVD.cpp new file mode 100644 index 0000000..d0aef30 --- /dev/null +++ b/src/prefDVD.cpp @@ -0,0 +1,114 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './prefDVD.ui' +** +** Created: dim. oct. 26 08:57:35 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "prefDVD.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include "kurlrequester.h" +#include "klineedit.h" +#include "kpushbutton.h" + +/* + * Constructs a prefDVD as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +prefDVD::prefDVD( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "prefDVD" ); + prefDVDLayout = new QGridLayout( this, 1, 1, 11, 6, "prefDVDLayout"); + + lblworkDir = new QLabel( this, "lblworkDir" ); + lblworkDir->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, lblworkDir->sizePolicy().hasHeightForWidth() ) ); + + prefDVDLayout->addWidget( lblworkDir, 0, 0 ); + + urOutput = new KURLRequester( this, "urOutput" ); + urOutput->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, urOutput->sizePolicy().hasHeightForWidth() ) ); + + prefDVDLayout->addMultiCellWidget( urOutput, 0, 0, 1, 2 ); + + ckK3b = new QCheckBox( this, "ckK3b" ); + + prefDVDLayout->addMultiCellWidget( ckK3b, 2, 2, 0, 2 ); + + ckAutoBurn = new QCheckBox( this, "ckAutoBurn" ); + ckAutoBurn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, ckAutoBurn->sizePolicy().hasHeightForWidth() ) ); + + prefDVDLayout->addMultiCellWidget( ckAutoBurn, 3, 3, 0, 2 ); + + textLabel1_2 = new QLabel( this, "textLabel1_2" ); + + prefDVDLayout->addWidget( textLabel1_2, 1, 0 ); + + sbSize = new QSpinBox( this, "sbSize" ); + sbSize->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, sbSize->sizePolicy().hasHeightForWidth() ) ); + sbSize->setMinimumSize( QSize( 80, 0 ) ); + sbSize->setMaxValue( 9000 ); + sbSize->setLineStep( 100 ); + sbSize->setValue( 4400 ); + + prefDVDLayout->addWidget( sbSize, 1, 1 ); + + ckQuickScan = new QCheckBox( this, "ckQuickScan" ); + + prefDVDLayout->addMultiCellWidget( ckQuickScan, 4, 4, 0, 2 ); + spacer1 = new QSpacerItem( 21, 110, QSizePolicy::Minimum, QSizePolicy::Expanding ); + prefDVDLayout->addItem( spacer1, 7, 2 ); + + ckDvdAuthor = new QCheckBox( this, "ckDvdAuthor" ); + + prefDVDLayout->addMultiCellWidget( ckDvdAuthor, 5, 5, 0, 2 ); + + ckDelTmpFiles = new QCheckBox( this, "ckDelTmpFiles" ); + + prefDVDLayout->addMultiCellWidget( ckDelTmpFiles, 6, 6, 0, 2 ); + languageChange(); + resize( QSize(600, 347).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); +} + +/* + * Destroys the object and frees any allocated resources + */ +prefDVD::~prefDVD() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void prefDVD::languageChange() +{ + setCaption( tr2i18n( "prefDVD" ) ); + lblworkDir->setText( tr2i18n( "Output directory" ) ); + ckK3b->setText( tr2i18n( "Burn with k3b" ) ); + ckK3b->setAccel( QKeySequence( tr2i18n( "Alt+B" ) ) ); + ckAutoBurn->setText( tr2i18n( "Auto burn" ) ); + ckAutoBurn->setAccel( QKeySequence( tr2i18n( "Alt+T" ) ) ); + textLabel1_2->setText( tr2i18n( "DVD size" ) ); + ckQuickScan->setText( tr2i18n( "Quick scan" ) ); + ckQuickScan->setAccel( QKeySequence( tr2i18n( "Alt+Q" ) ) ); + ckDvdAuthor->setText( tr2i18n( "use dvdAuthor for copy without menus" ) ); + ckDvdAuthor->setAccel( QKeySequence( tr2i18n( "Alt+D" ) ) ); + ckDelTmpFiles->setText( tr2i18n( "Clear output directory on exit" ) ); + ckDelTmpFiles->setAccel( QKeySequence( tr2i18n( "Alt+Y" ) ) ); +} + +#include "prefDVD.moc" diff --git a/src/prefDVD.ui b/src/prefDVD.ui new file mode 100644 index 0000000..d610ee8 --- /dev/null +++ b/src/prefDVD.ui @@ -0,0 +1,175 @@ + +prefDVD + + + prefDVD + + + + 0 + 0 + 600 + 347 + + + + prefDVD + + + + unnamed + + + + lblworkDir + + + + 0 + 5 + 0 + 0 + + + + Output directory + + + + + urOutput + + + + 5 + 0 + 0 + 0 + + + + + + ckK3b + + + Burn with k3b + + + Alt+B + + + + + ckAutoBurn + + + + 1 + 0 + 0 + 0 + + + + Auto burn + + + Alt+T + + + + + textLabel1_2 + + + DVD size + + + + + sbSize + + + + 0 + 0 + 0 + 0 + + + + + 80 + 0 + + + + 9000 + + + 100 + + + 4400 + + + + + ckQuickScan + + + Quick scan + + + Alt+Q + + + + + spacer1 + + + Vertical + + + Expanding + + + + 21 + 110 + + + + + + ckDvdAuthor + + + use dvdAuthor for copy without menus + + + Alt+D + + + + + ckDelTmpFiles + + + Clear output directory on exit + + + Alt+Y + + + + + + + kurlrequester.h + klineedit.h + kpushbutton.h + + diff --git a/src/prefMPEG4.cpp b/src/prefMPEG4.cpp new file mode 100644 index 0000000..9787413 --- /dev/null +++ b/src/prefMPEG4.cpp @@ -0,0 +1,418 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './prefMPEG4.ui' +** +** Created: dim. oct. 26 08:57:35 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "prefMPEG4.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const unsigned char img0_prefMPEG4[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0x61, 0x00, 0x00, 0x02, + 0x86, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x85, 0x52, 0xdd, 0x4b, 0x53, + 0x71, 0x18, 0x7e, 0xce, 0xd9, 0x39, 0x73, 0xf3, 0x98, 0xdb, 0xd0, 0xd0, + 0xf9, 0x39, 0x27, 0x47, 0x1d, 0x44, 0xa4, 0x4e, 0xfc, 0x82, 0x89, 0x83, + 0x62, 0x5e, 0x18, 0x61, 0x84, 0xa0, 0x65, 0x61, 0x17, 0x56, 0x57, 0x86, + 0xd1, 0x5d, 0x97, 0xf5, 0x27, 0x04, 0x5d, 0x84, 0x49, 0x17, 0xdd, 0x44, + 0x1a, 0x21, 0xcd, 0x0a, 0x6b, 0x22, 0xa6, 0x53, 0x18, 0x36, 0xb7, 0xe9, + 0x74, 0x1f, 0x88, 0x5f, 0xcb, 0xb5, 0xe3, 0xc7, 0x5c, 0xfb, 0x3c, 0xa7, + 0x8b, 0x3c, 0x31, 0x87, 0xd8, 0x0b, 0x3f, 0xde, 0xf7, 0xf9, 0xf1, 0x3c, + 0xcf, 0xfb, 0x5c, 0xbc, 0x04, 0x32, 0xaa, 0xa9, 0xa9, 0x99, 0x6d, 0x6b, + 0x33, 0xf4, 0x57, 0x6a, 0x0a, 0xda, 0x95, 0x0a, 0xa6, 0x2c, 0xc5, 0x0b, + 0xc9, 0x60, 0x28, 0xbc, 0xe2, 0x70, 0x7a, 0x3e, 0x5a, 0x2c, 0x96, 0x61, + 0x97, 0xcb, 0xc9, 0xa5, 0xf3, 0x09, 0x71, 0x50, 0xab, 0x8b, 0xa4, 0xbd, + 0x3d, 0xdd, 0xcf, 0xba, 0x3a, 0x5b, 0x06, 0x6b, 0x2f, 0x14, 0x49, 0x64, + 0x32, 0x1a, 0x20, 0x28, 0x2c, 0xb9, 0xfc, 0x58, 0x58, 0xdc, 0xc0, 0xaf, + 0xd0, 0x3e, 0x2a, 0x2b, 0x8a, 0xb9, 0xb1, 0x0f, 0x53, 0x0f, 0x47, 0x46, + 0x5e, 0x8d, 0x88, 0x3a, 0xc9, 0xb1, 0x98, 0x7e, 0x30, 0x70, 0x73, 0x74, + 0xe8, 0xfe, 0x95, 0xdb, 0x6c, 0x45, 0x3e, 0x49, 0x51, 0x14, 0x02, 0xbb, + 0xfb, 0x78, 0x3b, 0xbe, 0x80, 0xed, 0xdf, 0x4a, 0x34, 0x5c, 0xac, 0x81, + 0x00, 0x1a, 0x94, 0x24, 0x2c, 0xef, 0xba, 0xde, 0x71, 0x0d, 0xc8, 0x8e, + 0x5b, 0xad, 0xd6, 0xe9, 0x7f, 0x06, 0x03, 0x03, 0x77, 0x9f, 0x0e, 0xdd, + 0x29, 0xed, 0x57, 0x31, 0x87, 0x88, 0x09, 0x2a, 0xbc, 0x1b, 0x9f, 0xc7, + 0xcc, 0x5a, 0x12, 0xda, 0xd6, 0x0e, 0x9c, 0xd7, 0x56, 0xc1, 0xeb, 0x74, + 0xa2, 0xb1, 0x96, 0xc5, 0xc4, 0x17, 0x2b, 0xda, 0x0d, 0x3a, 0xe8, 0xaa, + 0x35, 0x46, 0x6e, 0x8f, 0x9f, 0xb3, 0xdb, 0xed, 0x6b, 0x92, 0xba, 0xba, + 0x7a, 0xcd, 0xa3, 0x7b, 0x86, 0x37, 0x6c, 0x49, 0x4c, 0xf2, 0x6d, 0x6e, + 0x03, 0xaf, 0xc7, 0x56, 0x20, 0xab, 0x31, 0xa2, 0x80, 0xd5, 0x01, 0x14, + 0x85, 0x14, 0x41, 0x02, 0x72, 0x06, 0xbe, 0x45, 0x1b, 0x5a, 0x5b, 0xf4, + 0x30, 0x4f, 0x7c, 0x82, 0xa9, 0x9d, 0x25, 0x12, 0xc9, 0xac, 0x86, 0xc9, + 0xaf, 0x33, 0xcf, 0x25, 0x7d, 0x7d, 0x7d, 0x83, 0x3d, 0x26, 0xb9, 0x71, + 0xd5, 0x17, 0xc4, 0x5a, 0x40, 0x0d, 0x5d, 0xb5, 0x16, 0x3e, 0x8e, 0x07, + 0x9d, 0xa3, 0x40, 0x0a, 0x24, 0x78, 0x90, 0xa0, 0x18, 0x06, 0xbb, 0x3b, + 0x01, 0x1c, 0x05, 0xb7, 0x90, 0x4c, 0xf0, 0x50, 0x30, 0x11, 0xb0, 0xda, + 0xc2, 0xfc, 0x79, 0xdb, 0xa6, 0x85, 0xac, 0xd2, 0x64, 0x1b, 0xb2, 0xa8, + 0x23, 0xe8, 0x6a, 0x4a, 0xe0, 0x70, 0x3a, 0x20, 0x20, 0x05, 0x55, 0x22, + 0x00, 0xee, 0x20, 0x82, 0xdd, 0xbd, 0x30, 0x42, 0x07, 0x11, 0x84, 0xa3, + 0x29, 0xa4, 0xf2, 0x0a, 0x31, 0xbb, 0x60, 0xc3, 0x5e, 0xc8, 0x8b, 0x17, + 0x2f, 0x47, 0x91, 0x2f, 0xf7, 0xa2, 0xbe, 0x5e, 0x6f, 0xa4, 0xce, 0xc9, + 0x0e, 0x8b, 0x11, 0xf3, 0x03, 0x28, 0x47, 0xef, 0xd5, 0x3c, 0x0c, 0xbf, + 0xb7, 0xa1, 0xb9, 0xf1, 0x12, 0x96, 0x97, 0xed, 0x88, 0xa8, 0xca, 0x3c, + 0x0c, 0x23, 0x97, 0x72, 0xab, 0x9f, 0x4b, 0x1d, 0x6e, 0x17, 0x72, 0x73, + 0x48, 0x68, 0x89, 0x2d, 0x04, 0x83, 0xdb, 0x98, 0x9e, 0x32, 0x43, 0x99, + 0xdb, 0x5c, 0x4e, 0x3c, 0x79, 0xdc, 0xeb, 0xf1, 0xba, 0xbf, 0x6b, 0x93, + 0x3c, 0x0d, 0x90, 0x52, 0xac, 0xfa, 0x8f, 0xc0, 0x13, 0x0c, 0x92, 0x3c, + 0x09, 0x2e, 0x2a, 0x44, 0xe3, 0xb1, 0xa8, 0x94, 0x56, 0x28, 0x49, 0x46, + 0xc1, 0x80, 0x20, 0x05, 0xa4, 0x36, 0xdd, 0xa0, 0x89, 0x04, 0x0e, 0x0e, + 0xa3, 0xa0, 0x68, 0xa5, 0x1f, 0xdd, 0x37, 0x3a, 0x67, 0x85, 0xe3, 0x02, + 0x20, 0x9c, 0x36, 0x8b, 0x58, 0x7c, 0xe9, 0x98, 0xfc, 0xb1, 0xe4, 0xb1, + 0x65, 0x5e, 0xe3, 0x89, 0x4b, 0x23, 0x88, 0x13, 0xf8, 0xaf, 0xf6, 0x24, + 0xe1, 0x56, 0xfa, 0xc6, 0xcc, 0x9e, 0x99, 0x20, 0x13, 0x93, 0x82, 0x20, + 0xc4, 0xff, 0x97, 0x40, 0x4c, 0x91, 0xbe, 0x5d, 0x9c, 0xc9, 0xb3, 0xe2, + 0x9e, 0x65, 0x26, 0x76, 0xf2, 0x18, 0xc4, 0x33, 0x89, 0x67, 0x19, 0xa6, + 0xff, 0x9f, 0xca, 0xd0, 0xeb, 0x1b, 0x6a, 0x4d, 0x26, 0xd3, 0x65, 0xb5, + 0xba, 0x50, 0xbb, 0xbe, 0xbe, 0x4e, 0x04, 0x02, 0x3f, 0x7d, 0x66, 0xb3, + 0x79, 0x72, 0x67, 0x67, 0xdb, 0x06, 0x20, 0x91, 0xce, 0xfd, 0x03, 0xf3, + 0x98, 0x43, 0xeb, 0x06, 0xad, 0xb9, 0x96, 0x00, 0x00, 0x00, 0x00, 0x49, + 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + + +/* + * Constructs a prefMPEG4 as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +prefMPEG4::prefMPEG4( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QImage img; + img.loadFromData( img0_prefMPEG4, sizeof( img0_prefMPEG4 ), "PNG" ); + image0 = img; + if ( !name ) + setName( "prefMPEG4" ); + setIcon( image0 ); + prefMPEG4Layout = new QGridLayout( this, 1, 1, 5, 2, "prefMPEG4Layout"); + + lTitle = new QLabel( this, "lTitle" ); + QFont lTitle_font( lTitle->font() ); + lTitle_font.setBold( TRUE ); + lTitle->setFont( lTitle_font ); + + prefMPEG4Layout->addWidget( lTitle, 0, 0 ); + + tabWidget = new QTabWidget( this, "tabWidget" ); + + tabVideo = new QWidget( tabWidget, "tabVideo" ); + tabVideoLayout = new QGridLayout( tabVideo, 1, 1, 11, 6, "tabVideoLayout"); + + ck2passes = new QCheckBox( tabVideo, "ck2passes" ); + + tabVideoLayout->addMultiCellWidget( ck2passes, 0, 0, 3, 6 ); + + textLabel1_4 = new QLabel( tabVideo, "textLabel1_4" ); + + tabVideoLayout->addWidget( textLabel1_4, 0, 0 ); + + cbMp4Codec = new QComboBox( FALSE, tabVideo, "cbMp4Codec" ); + cbMp4Codec->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, cbMp4Codec->sizePolicy().hasHeightForWidth() ) ); + + tabVideoLayout->addMultiCellWidget( cbMp4Codec, 0, 0, 1, 2 ); + + textLabel3_2 = new QLabel( tabVideo, "textLabel3_2" ); + + tabVideoLayout->addWidget( textLabel3_2, 1, 0 ); + + textLabel3_2_2 = new QLabel( tabVideo, "textLabel3_2_2" ); + + tabVideoLayout->addWidget( textLabel3_2_2, 2, 0 ); + + leMp4Width = new QLineEdit( tabVideo, "leMp4Width" ); + leMp4Width->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, leMp4Width->sizePolicy().hasHeightForWidth() ) ); + leMp4Width->setMinimumSize( QSize( 0, 0 ) ); + leMp4Width->setMaximumSize( QSize( 70, 32767 ) ); + leMp4Width->setMaxLength( 4 ); + leMp4Width->setAlignment( int( QLineEdit::AlignAuto ) ); + + tabVideoLayout->addWidget( leMp4Width, 1, 1 ); + + ckMp4AspectRatio = new QCheckBox( tabVideo, "ckMp4AspectRatio" ); + ckMp4AspectRatio->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ckMp4AspectRatio->sizePolicy().hasHeightForWidth() ) ); + ckMp4AspectRatio->setChecked( TRUE ); + + tabVideoLayout->addMultiCellWidget( ckMp4AspectRatio, 1, 1, 3, 6 ); + spacer9 = new QSpacerItem( 380, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + tabVideoLayout->addMultiCell( spacer9, 2, 2, 2, 6 ); + + leMp4Height = new QLineEdit( tabVideo, "leMp4Height" ); + leMp4Height->setEnabled( FALSE ); + leMp4Height->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, leMp4Height->sizePolicy().hasHeightForWidth() ) ); + leMp4Height->setMinimumSize( QSize( 0, 0 ) ); + leMp4Height->setMaximumSize( QSize( 70, 32767 ) ); + leMp4Height->setMaxLength( 4 ); + leMp4Height->setAlignment( int( QLineEdit::AlignAuto ) ); + + tabVideoLayout->addWidget( leMp4Height, 2, 1 ); + spacer8 = new QSpacerItem( 21, 110, QSizePolicy::Minimum, QSizePolicy::Expanding ); + tabVideoLayout->addItem( spacer8, 4, 5 ); + + sbMp4NumberCD = new QSpinBox( tabVideo, "sbMp4NumberCD" ); + sbMp4NumberCD->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, sbMp4NumberCD->sizePolicy().hasHeightForWidth() ) ); + sbMp4NumberCD->setMaxValue( 9 ); + sbMp4NumberCD->setMinValue( 1 ); + + tabVideoLayout->addWidget( sbMp4NumberCD, 3, 5 ); + + textLabel1 = new QLabel( tabVideo, "textLabel1" ); + textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) ); + + tabVideoLayout->addWidget( textLabel1, 3, 4 ); + + buttonGroup1 = new QButtonGroup( tabVideo, "buttonGroup1" ); + buttonGroup1->setFrameShape( QButtonGroup::NoFrame ); + buttonGroup1->setColumnLayout(0, Qt::Vertical ); + buttonGroup1->layout()->setSpacing( 6 ); + buttonGroup1->layout()->setMargin( 2 ); + buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() ); + buttonGroup1Layout->setAlignment( Qt::AlignTop ); + + rbSize = new QRadioButton( buttonGroup1, "rbSize" ); + + buttonGroup1Layout->addWidget( rbSize, 0, 0 ); + + sbMp4Size = new QSpinBox( buttonGroup1, "sbMp4Size" ); + sbMp4Size->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, sbMp4Size->sizePolicy().hasHeightForWidth() ) ); + sbMp4Size->setMinimumSize( QSize( 80, 0 ) ); + sbMp4Size->setButtonSymbols( QSpinBox::UpDownArrows ); + sbMp4Size->setMaxValue( 9999 ); + sbMp4Size->setMinValue( 1 ); + sbMp4Size->setLineStep( 10 ); + sbMp4Size->setValue( 700 ); + + buttonGroup1Layout->addWidget( sbMp4Size, 0, 1 ); + + rbBitrate = new QRadioButton( buttonGroup1, "rbBitrate" ); + + buttonGroup1Layout->addWidget( rbBitrate, 1, 0 ); + spacer6 = new QSpacerItem( 51, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + buttonGroup1Layout->addMultiCell( spacer6, 0, 1, 2, 2 ); + + leMp4VideoBitrate = new QLineEdit( buttonGroup1, "leMp4VideoBitrate" ); + leMp4VideoBitrate->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, leMp4VideoBitrate->sizePolicy().hasHeightForWidth() ) ); + + buttonGroup1Layout->addWidget( leMp4VideoBitrate, 1, 1 ); + + tabVideoLayout->addMultiCellWidget( buttonGroup1, 3, 3, 0, 3 ); + spacer3 = new QSpacerItem( 130, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + tabVideoLayout->addItem( spacer3, 3, 6 ); + tabWidget->insertTab( tabVideo, QString::fromLatin1("") ); + + tabAudio = new QWidget( tabWidget, "tabAudio" ); + tabAudioLayout = new QGridLayout( tabAudio, 1, 1, 11, 6, "tabAudioLayout"); + + textLabel1_4_2 = new QLabel( tabAudio, "textLabel1_4_2" ); + + tabAudioLayout->addWidget( textLabel1_4_2, 0, 0 ); + + cbMp4AudioCodec = new QComboBox( FALSE, tabAudio, "cbMp4AudioCodec" ); + cbMp4AudioCodec->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, cbMp4AudioCodec->sizePolicy().hasHeightForWidth() ) ); + + tabAudioLayout->addMultiCellWidget( cbMp4AudioCodec, 0, 0, 1, 2 ); + + textLabel1_5 = new QLabel( tabAudio, "textLabel1_5" ); + + tabAudioLayout->addWidget( textLabel1_5, 1, 0 ); + + leMp4AudioBitrate = new QLineEdit( tabAudio, "leMp4AudioBitrate" ); + leMp4AudioBitrate->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, leMp4AudioBitrate->sizePolicy().hasHeightForWidth() ) ); + leMp4AudioBitrate->setMinimumSize( QSize( 0, 0 ) ); + leMp4AudioBitrate->setMaximumSize( QSize( 70, 32767 ) ); + leMp4AudioBitrate->setMaxLength( 3 ); + leMp4AudioBitrate->setAlignment( int( QLineEdit::AlignAuto ) ); + + tabAudioLayout->addWidget( leMp4AudioBitrate, 1, 1 ); + spacer4 = new QSpacerItem( 376, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + tabAudioLayout->addMultiCell( spacer4, 1, 1, 2, 3 ); + + sbAudioGain = new QSpinBox( tabAudio, "sbAudioGain" ); + sbAudioGain->setMaxValue( 10 ); + sbAudioGain->setMinValue( 1 ); + + tabAudioLayout->addWidget( sbAudioGain, 2, 1 ); + + textLabel1_2 = new QLabel( tabAudio, "textLabel1_2" ); + + tabAudioLayout->addWidget( textLabel1_2, 2, 0 ); + spacer14 = new QSpacerItem( 20, 61, QSizePolicy::Minimum, QSizePolicy::Expanding ); + tabAudioLayout->addItem( spacer14, 3, 3 ); + tabWidget->insertTab( tabAudio, QString::fromLatin1("") ); + + prefMPEG4Layout->addWidget( tabWidget, 1, 0 ); + + ckUseCache = new QCheckBox( this, "ckUseCache" ); + + prefMPEG4Layout->addWidget( ckUseCache, 2, 0 ); + languageChange(); + resize( QSize(582, 460).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( cbMp4AudioCodec, SIGNAL( activated(int) ), this, SLOT( cbMp4AudioCodecActivated(int) ) ); + connect( cbMp4Codec, SIGNAL( activated(int) ), this, SLOT( cbMp4CodecActivated(int) ) ); + connect( ck2passes, SIGNAL( clicked() ), this, SLOT( ck2passesClicked() ) ); + connect( ckMp4AspectRatio, SIGNAL( clicked() ), this, SLOT( ckMp4AspectRatioClick() ) ); + connect( rbBitrate, SIGNAL( clicked() ), this, SLOT( rgVideoSizeChanged() ) ); + connect( rbSize, SIGNAL( clicked() ), this, SLOT( rgVideoSizeChanged() ) ); + connect( leMp4Width, SIGNAL( textChanged(const QString&) ), this, SLOT( leMp4WidthTextChanged(const QString&) ) ); + connect( leMp4Height, SIGNAL( textChanged(const QString&) ), this, SLOT( leMp4HeightTextChanged(const QString&) ) ); + connect( sbMp4Size, SIGNAL( valueChanged(int) ), this, SLOT( sbMp4SizeValueChanged(int) ) ); + connect( sbMp4NumberCD, SIGNAL( valueChanged(int) ), this, SLOT( sbMp4NumberCDValueChanged(int) ) ); + connect( leMp4VideoBitrate, SIGNAL( textChanged(const QString&) ), this, SLOT( leMp4VideoBitrateTextChanged(const QString&) ) ); + connect( sbAudioGain, SIGNAL( valueChanged(int) ), this, SLOT( sbAudioGainValueChanged(int) ) ); + connect( leMp4AudioBitrate, SIGNAL( textChanged(const QString&) ), this, SLOT( leMp4AudioBitrateTextChanged(const QString&) ) ); + connect( ckUseCache, SIGNAL( clicked() ), this, SLOT( ckUseCacheClick() ) ); + + // tab order + setTabOrder( tabWidget, cbMp4Codec ); + setTabOrder( cbMp4Codec, ck2passes ); + setTabOrder( ck2passes, leMp4Width ); + setTabOrder( leMp4Width, ckMp4AspectRatio ); + setTabOrder( ckMp4AspectRatio, leMp4Height ); + setTabOrder( leMp4Height, rbSize ); + setTabOrder( rbSize, rbBitrate ); + setTabOrder( rbBitrate, sbMp4Size ); + setTabOrder( sbMp4Size, leMp4VideoBitrate ); + setTabOrder( leMp4VideoBitrate, sbMp4NumberCD ); + setTabOrder( sbMp4NumberCD, cbMp4AudioCodec ); + setTabOrder( cbMp4AudioCodec, leMp4AudioBitrate ); + setTabOrder( leMp4AudioBitrate, sbAudioGain ); +} + +/* + * Destroys the object and frees any allocated resources + */ +prefMPEG4::~prefMPEG4() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void prefMPEG4::languageChange() +{ + setCaption( tr2i18n( "Form1" ) ); + lTitle->setText( QString::null ); + ck2passes->setText( tr2i18n( "2 pass" ) ); + ck2passes->setAccel( QKeySequence( tr2i18n( "Alt+2" ) ) ); + textLabel1_4->setText( tr2i18n( "Codec" ) ); + cbMp4Codec->clear(); + cbMp4Codec->insertItem( tr2i18n( "XviD" ) ); + cbMp4Codec->insertItem( tr2i18n( "lavc MPEG4" ) ); + cbMp4Codec->insertItem( tr2i18n( "x264" ) ); + cbMp4Codec->setCurrentItem( 1 ); + textLabel3_2->setText( tr2i18n( "Width" ) ); + textLabel3_2_2->setText( tr2i18n( "Height" ) ); + leMp4Width->setText( tr2i18n( "640" ) ); + leMp4Width->setInputMask( QString::null ); + ckMp4AspectRatio->setText( tr2i18n( "&keep aspect ratio" ) ); + ckMp4AspectRatio->setAccel( QKeySequence( tr2i18n( "Alt+K" ) ) ); + leMp4Height->setInputMask( QString::null ); + textLabel1->setText( tr2i18n( "X" ) ); + buttonGroup1->setTitle( QString::null ); + rbSize->setText( tr2i18n( "File size" ) ); + rbSize->setAccel( QKeySequence( tr2i18n( "Alt+S" ) ) ); + sbMp4Size->setSuffix( tr2i18n( " MB" ) ); + rbBitrate->setText( tr2i18n( "Bitrate" ) ); + rbBitrate->setAccel( QKeySequence( tr2i18n( "Alt+B" ) ) ); + tabWidget->changeTab( tabVideo, tr2i18n( "Video" ) ); + textLabel1_4_2->setText( tr2i18n( "Codec" ) ); + cbMp4AudioCodec->clear(); + cbMp4AudioCodec->insertItem( tr2i18n( "mp3" ) ); + cbMp4AudioCodec->insertItem( tr2i18n( "faac" ) ); + cbMp4AudioCodec->insertItem( tr2i18n( "mp2" ) ); + cbMp4AudioCodec->insertItem( tr2i18n( "ac3" ) ); + cbMp4AudioCodec->insertItem( tr2i18n( "adpcm ima" ) ); + textLabel1_5->setText( tr2i18n( "Bitrate" ) ); + leMp4AudioBitrate->setText( QString::null ); + textLabel1_2->setText( tr2i18n( "Gain" ) ); + tabWidget->changeTab( tabAudio, tr2i18n( "Audio" ) ); + ckUseCache->setText( tr2i18n( "use cell cache" ) ); +} + +void prefMPEG4::ckMp4AspectRatioClick() +{ + qWarning( "prefMPEG4::ckMp4AspectRatioClick(): Not implemented yet" ); +} + +void prefMPEG4::cbMp4CodecActivated(int) +{ + qWarning( "prefMPEG4::cbMp4CodecActivated(int): Not implemented yet" ); +} + +void prefMPEG4::cbMp4AudioCodecActivated(int) +{ + qWarning( "prefMPEG4::cbMp4AudioCodecActivated(int): Not implemented yet" ); +} + +void prefMPEG4::ck2passesClicked() +{ + qWarning( "prefMPEG4::ck2passesClicked(): Not implemented yet" ); +} + +void prefMPEG4::sbMp4SizeValueChanged(int) +{ + qWarning( "prefMPEG4::sbMp4SizeValueChanged(int): Not implemented yet" ); +} + +void prefMPEG4::sbMp4NumberCDValueChanged(int) +{ + qWarning( "prefMPEG4::sbMp4NumberCDValueChanged(int): Not implemented yet" ); +} + +void prefMPEG4::leMp4WidthTextChanged(const QString&) +{ + qWarning( "prefMPEG4::leMp4WidthTextChanged(const QString&): Not implemented yet" ); +} + +void prefMPEG4::leMp4HeightTextChanged(const QString&) +{ + qWarning( "prefMPEG4::leMp4HeightTextChanged(const QString&): Not implemented yet" ); +} + +void prefMPEG4::leMp4AudioBitrateTextChanged(const QString&) +{ + qWarning( "prefMPEG4::leMp4AudioBitrateTextChanged(const QString&): Not implemented yet" ); +} + +void prefMPEG4::rgVideoSizeChanged() +{ + qWarning( "prefMPEG4::rgVideoSizeChanged(): Not implemented yet" ); +} + +void prefMPEG4::leMp4VideoBitrateTextChanged(const QString&) +{ + qWarning( "prefMPEG4::leMp4VideoBitrateTextChanged(const QString&): Not implemented yet" ); +} + +void prefMPEG4::sbAudioGainValueChanged(int) +{ + qWarning( "prefMPEG4::sbAudioGainValueChanged(int): Not implemented yet" ); +} + +void prefMPEG4::ckUseCacheClick() +{ + qWarning( "prefMPEG4::ckUseCacheClick(): Not implemented yet" ); +} + +#include "prefMPEG4.moc" diff --git a/src/prefMPEG4.ui b/src/prefMPEG4.ui new file mode 100644 index 0000000..fc21017 --- /dev/null +++ b/src/prefMPEG4.ui @@ -0,0 +1,705 @@ + +prefMPEG4 + + + prefMPEG4 + + + + 0 + 0 + 582 + 460 + + + + Form1 + + + image0 + + + + unnamed + + + 5 + + + 2 + + + + lTitle + + + + 1 + + + + + + + + + tabWidget + + + + tabVideo + + + Video + + + + unnamed + + + + ck2passes + + + 2 pass + + + Alt+2 + + + + + textLabel1_4 + + + Codec + + + + + + XviD + + + + + lavc MPEG4 + + + + + x264 + + + + cbMp4Codec + + + + 0 + 0 + 0 + 0 + + + + 1 + + + + + textLabel3_2 + + + Width + + + + + textLabel3_2_2 + + + Height + + + + + leMp4Width + + + + 0 + 0 + 0 + 0 + + + + + 0 + 0 + + + + + 70 + 32767 + + + + 640 + + + 4 + + + AlignAuto + + + + + + + + ckMp4AspectRatio + + + + 7 + 0 + 0 + 0 + + + + &keep aspect ratio + + + Alt+K + + + true + + + + + spacer9 + + + Horizontal + + + Expanding + + + + 380 + 21 + + + + + + leMp4Height + + + false + + + + 1 + 0 + 0 + 0 + + + + + 0 + 0 + + + + + 70 + 32767 + + + + 4 + + + AlignAuto + + + + + + + + spacer8 + + + Vertical + + + Expanding + + + + 21 + 110 + + + + + + sbMp4NumberCD + + + + 0 + 0 + 0 + 0 + + + + 9 + + + 1 + + + + + textLabel1 + + + + 0 + 0 + 0 + 0 + + + + X + + + + + buttonGroup1 + + + NoFrame + + + + + + + unnamed + + + 2 + + + + rbSize + + + File size + + + Alt+S + + + + + sbMp4Size + + + + 0 + 0 + 0 + 0 + + + + + 80 + 0 + + + + MB + + + UpDownArrows + + + 9999 + + + 1 + + + 10 + + + 700 + + + + + rbBitrate + + + Bitrate + + + Alt+B + + + + + spacer6 + + + Horizontal + + + Expanding + + + + 51 + 20 + + + + + + leMp4VideoBitrate + + + + 5 + 0 + 0 + 0 + + + + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 130 + 21 + + + + + + + + tabAudio + + + Audio + + + + unnamed + + + + textLabel1_4_2 + + + Codec + + + + + + mp3 + + + + + faac + + + + + mp2 + + + + + ac3 + + + + + adpcm ima + + + + cbMp4AudioCodec + + + + 0 + 0 + 0 + 0 + + + + + + textLabel1_5 + + + Bitrate + + + + + leMp4AudioBitrate + + + + 1 + 0 + 0 + 0 + + + + + 0 + 0 + + + + + 70 + 32767 + + + + + + + 3 + + + AlignAuto + + + + + spacer4 + + + Horizontal + + + Expanding + + + + 376 + 20 + + + + + + sbAudioGain + + + 10 + + + 1 + + + + + textLabel1_2 + + + Gain + + + + + spacer14 + + + Vertical + + + Expanding + + + + 20 + 61 + + + + + + + + + ckUseCache + + + use cell cache + + + + + + + 89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff610000028649444154388d8552dd4b5371187eced93973f398dbd0d0f93927471d44a44efc828983625e186184a0656117565786d15d97f527045d844917dd441a21cd0a6b22a6531836b7e9741f885fcbb5e3c75cfb3ca78b3c3187d80b3fdef7f9f13ccffb5cbc0432aaa9a9996d6b33f4576a0ada950aa62cc50bc96028bce2707a3e5a2c966197cbc9a5f3097150ab8ba4bd3dddcfba3a5b066b2f144964321a20282cb9fc5858dcc0afd03e2a2b8ab9b10f530f47465e8d883ac9b1987e30707374e8fe95db6c453e49511402bbfb783bbe80eddf4a345cac81001a94242cefbade710dc88e5badd6e97f060303779f0edd29ed57318788092abc1b9fc7cc5a12dad60e9cd756c1eb74a2b196c5c4172bda0d3ae8aa35466e8f9fb3dbed6b92baba7acda37b86376c494cf26d6e03afc75620ab31a280d50114851441027206be451b5a5bf4304f7c82a99d2512c9ac86c9af33cf257d7d7d833d26b971d517c45a400d5db5163e8e079da3400a247890a01806bb3b011c05b7904cf0503011b0dac2fc79dba685acd2641bb2a823e86a4ae0703a202005552200ee2082ddbd3042071184a329a4f20a31bb60c35ec88b172f47912ff7a2be5e6fa4cec90e8b11f3032847efd53c0cbfb7a1b9f1129697ed88a8ca3c0c239772ab9f4b1d6e1772734868892d0483db989e324399db5c4e3c79dcebf1babf6b933c0d9052acfa8fc0130c923c092e2a44e3b1a89456284946c1802005a436dda089040e0ea3a068a51fdd373a6785e302209c368b587ce998fcb1e4b1655ee3894b238813f8aff624e156fac6cc9e992013938220c4ff97404c91be5d9cc9b3e29e652676f218c433896719a6ff9fcad0eb1b6a4d26d365b5ba50bbbebe4e04023f7d66b379726767db062091cefd03f39843eb06adb9960000000049454e44ae426082 + + + + + cbMp4AudioCodec + activated(int) + prefMPEG4 + cbMp4AudioCodecActivated(int) + + + cbMp4Codec + activated(int) + prefMPEG4 + cbMp4CodecActivated(int) + + + ck2passes + clicked() + prefMPEG4 + ck2passesClicked() + + + ckMp4AspectRatio + clicked() + prefMPEG4 + ckMp4AspectRatioClick() + + + rbBitrate + clicked() + prefMPEG4 + rgVideoSizeChanged() + + + rbSize + clicked() + prefMPEG4 + rgVideoSizeChanged() + + + leMp4Width + textChanged(const QString&) + prefMPEG4 + leMp4WidthTextChanged(const QString&) + + + leMp4Height + textChanged(const QString&) + prefMPEG4 + leMp4HeightTextChanged(const QString&) + + + sbMp4Size + valueChanged(int) + prefMPEG4 + sbMp4SizeValueChanged(int) + + + sbMp4NumberCD + valueChanged(int) + prefMPEG4 + sbMp4NumberCDValueChanged(int) + + + leMp4VideoBitrate + textChanged(const QString&) + prefMPEG4 + leMp4VideoBitrateTextChanged(const QString&) + + + sbAudioGain + valueChanged(int) + prefMPEG4 + sbAudioGainValueChanged(int) + + + leMp4AudioBitrate + textChanged(const QString&) + prefMPEG4 + leMp4AudioBitrateTextChanged(const QString&) + + + ckUseCache + clicked() + prefMPEG4 + ckUseCacheClick() + + + + tabWidget + cbMp4Codec + ck2passes + leMp4Width + ckMp4AspectRatio + leMp4Height + rbSize + rbBitrate + sbMp4Size + leMp4VideoBitrate + sbMp4NumberCD + cbMp4AudioCodec + leMp4AudioBitrate + sbAudioGain + + + ckMp4AspectRatioClick() + cbMp4CodecActivated( int ) + cbMp4AudioCodecActivated( int ) + ck2passesClicked() + sbMp4SizeValueChanged( int ) + sbMp4NumberCDValueChanged( int ) + leMp4WidthTextChanged( const QString & ) + leMp4HeightTextChanged( const QString & ) + leMp4AudioBitrateTextChanged( const QString & ) + rgVideoSizeChanged() + leMp4VideoBitrateTextChanged(const QString &) + sbAudioGainValueChanged(int) + ckUseCacheClick() + + + diff --git a/src/prefMencoder.cpp b/src/prefMencoder.cpp new file mode 100644 index 0000000..98a56ca --- /dev/null +++ b/src/prefMencoder.cpp @@ -0,0 +1,426 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './prefMencoder.ui' +** +** Created: dim. oct. 26 08:57:36 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "prefMencoder.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kpushbutton.h" + +/* + * Constructs a prefMencoder as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +prefMencoder::prefMencoder( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "prefMencoder" ); + prefMencoderLayout = new QGridLayout( this, 1, 1, 11, 6, "prefMencoderLayout"); + + layout2 = new QGridLayout( 0, 1, 1, 0, 6, "layout2"); + + textLabel2 = new QLabel( this, "textLabel2" ); + textLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) ); + QFont textLabel2_font( textLabel2->font() ); + textLabel2_font.setBold( TRUE ); + textLabel2->setFont( textLabel2_font ); + + layout2->addWidget( textLabel2, 0, 0 ); + + textLabel2_2 = new QLabel( this, "textLabel2_2" ); + textLabel2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel2_2->sizePolicy().hasHeightForWidth() ) ); + + layout2->addWidget( textLabel2_2, 0, 1 ); + + prefMencoderLayout->addLayout( layout2, 2, 0 ); + + tabWidget2 = new QTabWidget( this, "tabWidget2" ); + + tab = new QWidget( tabWidget2, "tab" ); + tabLayout = new QGridLayout( tab, 1, 1, 11, 6, "tabLayout"); + + lbvCodecs = new QListBox( tab, "lbvCodecs" ); + + tabLayout->addMultiCellWidget( lbvCodecs, 0, 4, 0, 1 ); + + btnDeleteV = new KPushButton( tab, "btnDeleteV" ); + btnDeleteV->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, btnDeleteV->sizePolicy().hasHeightForWidth() ) ); + btnDeleteV->setProperty( "stdItem", 28 ); + + tabLayout->addWidget( btnDeleteV, 5, 1 ); + + btnAddV = new KPushButton( tab, "btnAddV" ); + btnAddV->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, btnAddV->sizePolicy().hasHeightForWidth() ) ); + btnAddV->setProperty( "stdItem", 27 ); + + tabLayout->addWidget( btnAddV, 5, 0 ); + + textLabel1_3 = new QLabel( tab, "textLabel1_3" ); + + tabLayout->addWidget( textLabel1_3, 0, 2 ); + + textLabel2_3 = new QLabel( tab, "textLabel2_3" ); + + tabLayout->addWidget( textLabel2_3, 1, 2 ); + + textLabel1_2_3 = new QLabel( tab, "textLabel1_2_3" ); + + tabLayout->addWidget( textLabel1_2_3, 3, 2 ); + + layout9 = new QGridLayout( 0, 1, 1, 0, 6, "layout9"); + + teOpt2 = new QTextEdit( tab, "teOpt2" ); + teOpt2->setEnabled( TRUE ); + + layout9->addMultiCellWidget( teOpt2, 0, 1, 0, 0 ); + spacer5 = new QSpacerItem( 20, 81, QSizePolicy::Minimum, QSizePolicy::Expanding ); + layout9->addItem( spacer5, 1, 1 ); + + btnOpt2 = new KPushButton( tab, "btnOpt2" ); + btnOpt2->setMinimumSize( QSize( 22, 22 ) ); + btnOpt2->setMaximumSize( QSize( 22, 22 ) ); + + layout9->addWidget( btnOpt2, 0, 1 ); + + tabLayout->addLayout( layout9, 3, 3 ); + + layout10 = new QGridLayout( 0, 1, 1, 0, 6, "layout10"); + + teOpt3 = new QTextEdit( tab, "teOpt3" ); + teOpt3->setEnabled( TRUE ); + + layout10->addMultiCellWidget( teOpt3, 0, 1, 0, 0 ); + + btnOpt3 = new KPushButton( tab, "btnOpt3" ); + btnOpt3->setMinimumSize( QSize( 22, 22 ) ); + btnOpt3->setMaximumSize( QSize( 22, 22 ) ); + + layout10->addWidget( btnOpt3, 0, 1 ); + spacer6 = new QSpacerItem( 20, 60, QSizePolicy::Minimum, QSizePolicy::Expanding ); + layout10->addItem( spacer6, 1, 1 ); + + tabLayout->addMultiCellLayout( layout10, 4, 5, 3, 3 ); + + textLabel1_2 = new QLabel( tab, "textLabel1_2" ); + + tabLayout->addWidget( textLabel1_2, 2, 2 ); + + layout8 = new QGridLayout( 0, 1, 1, 0, 6, "layout8"); + spacer4 = new QSpacerItem( 20, 90, QSizePolicy::Minimum, QSizePolicy::Expanding ); + layout8->addItem( spacer4, 1, 1 ); + + teOpt1 = new QTextEdit( tab, "teOpt1" ); + teOpt1->setEnabled( TRUE ); + teOpt1->setWordWrap( QTextEdit::WidgetWidth ); + + layout8->addMultiCellWidget( teOpt1, 0, 1, 0, 0 ); + + btnOpt1 = new KPushButton( tab, "btnOpt1" ); + btnOpt1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, btnOpt1->sizePolicy().hasHeightForWidth() ) ); + btnOpt1->setMinimumSize( QSize( 22, 22 ) ); + btnOpt1->setMaximumSize( QSize( 22, 22 ) ); + + layout8->addWidget( btnOpt1, 0, 1 ); + + tabLayout->addLayout( layout8, 2, 3 ); + + textLabel1_2_3_2 = new QLabel( tab, "textLabel1_2_3_2" ); + + tabLayout->addMultiCellWidget( textLabel1_2_3_2, 4, 5, 2, 2 ); + + leFourcc = new QLineEdit( tab, "leFourcc" ); + + tabLayout->addWidget( leFourcc, 1, 3 ); + + leVLabel = new QLineEdit( tab, "leVLabel" ); + leVLabel->setEnabled( TRUE ); + + tabLayout->addWidget( leVLabel, 0, 3 ); + tabWidget2->insertTab( tab, QString::fromLatin1("") ); + + tab_2 = new QWidget( tabWidget2, "tab_2" ); + tabLayout_2 = new QGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); + + btnDeleteA = new KPushButton( tab_2, "btnDeleteA" ); + btnDeleteA->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, btnDeleteA->sizePolicy().hasHeightForWidth() ) ); + btnDeleteA->setProperty( "stdItem", 28 ); + + tabLayout_2->addWidget( btnDeleteA, 2, 1 ); + + btnAddA = new KPushButton( tab_2, "btnAddA" ); + btnAddA->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, btnAddA->sizePolicy().hasHeightForWidth() ) ); + btnAddA->setProperty( "stdItem", 27 ); + + tabLayout_2->addWidget( btnAddA, 2, 0 ); + + lbaCodecs = new QListBox( tab_2, "lbaCodecs" ); + + tabLayout_2->addMultiCellWidget( lbaCodecs, 0, 1, 0, 1 ); + + leALabel = new QLineEdit( tab_2, "leALabel" ); + + tabLayout_2->addWidget( leALabel, 0, 3 ); + + textLabel3 = new QLabel( tab_2, "textLabel3" ); + + tabLayout_2->addWidget( textLabel3, 0, 2 ); + + layout11 = new QGridLayout( 0, 1, 1, 0, 6, "layout11"); + + teOptA = new QTextEdit( tab_2, "teOptA" ); + + layout11->addMultiCellWidget( teOptA, 0, 1, 0, 0 ); + spacer4_2 = new QSpacerItem( 20, 78, QSizePolicy::Minimum, QSizePolicy::Expanding ); + layout11->addItem( spacer4_2, 1, 1 ); + + btnOptA = new KPushButton( tab_2, "btnOptA" ); + btnOptA->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, btnOptA->sizePolicy().hasHeightForWidth() ) ); + btnOptA->setMinimumSize( QSize( 22, 22 ) ); + btnOptA->setMaximumSize( QSize( 22, 22 ) ); + + layout11->addWidget( btnOptA, 0, 1 ); + + tabLayout_2->addMultiCellLayout( layout11, 1, 2, 3, 3 ); + + textLabel1_2_2_2 = new QLabel( tab_2, "textLabel1_2_2_2" ); + textLabel1_2_2_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel1_2_2_2->sizePolicy().hasHeightForWidth() ) ); + + tabLayout_2->addMultiCellWidget( textLabel1_2_2_2, 1, 2, 2, 2 ); + tabWidget2->insertTab( tab_2, QString::fromLatin1("") ); + + prefMencoderLayout->addMultiCellWidget( tabWidget2, 0, 0, 0, 2 ); + + textLabel1 = new QLabel( this, "textLabel1" ); + textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) ); + QFont textLabel1_font( textLabel1->font() ); + textLabel1_font.setBold( TRUE ); + textLabel1->setFont( textLabel1_font ); + + prefMencoderLayout->addWidget( textLabel1, 1, 0 ); + + bReset = new KPushButton( this, "bReset" ); + bReset->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, bReset->sizePolicy().hasHeightForWidth() ) ); + bReset->setProperty( "stdItem", 21 ); + + prefMencoderLayout->addMultiCellWidget( bReset, 1, 2, 2, 2 ); + spacer5_2 = new QSpacerItem( 121, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + prefMencoderLayout->addItem( spacer5_2, 1, 1 ); + languageChange(); + resize( QSize(672, 587).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( lbvCodecs, SIGNAL( currentChanged(QListBoxItem*) ), this, SLOT( lbvCodecsCurrentChanged(QListBoxItem*) ) ); + connect( teOpt1, SIGNAL( textChanged() ), this, SLOT( teOpt1TextChanged() ) ); + connect( teOpt2, SIGNAL( textChanged() ), this, SLOT( teOpt2TextChanged() ) ); + connect( leVLabel, SIGNAL( textChanged(const QString&) ), this, SLOT( leVLabelTextChanged(const QString&) ) ); + connect( teOpt3, SIGNAL( textChanged() ), this, SLOT( teOpt3TextChanged() ) ); + connect( lbaCodecs, SIGNAL( currentChanged(QListBoxItem*) ), this, SLOT( lbaCodecsCurrentChanged(QListBoxItem*) ) ); + connect( teOptA, SIGNAL( textChanged() ), this, SLOT( teOptATextChanged() ) ); + connect( leALabel, SIGNAL( textChanged(const QString&) ), this, SLOT( leALabelTextChanged(const QString&) ) ); + connect( btnOpt1, SIGNAL( clicked() ), this, SLOT( btnOpt1Clicked() ) ); + connect( btnOpt2, SIGNAL( clicked() ), this, SLOT( btnOpt2Clicked() ) ); + connect( btnOpt3, SIGNAL( clicked() ), this, SLOT( btnOpt3Clicked() ) ); + connect( btnOptA, SIGNAL( clicked() ), this, SLOT( btnOptAClicked() ) ); + connect( btnAddA, SIGNAL( clicked() ), this, SLOT( btnAddAClicked() ) ); + connect( btnAddV, SIGNAL( clicked() ), this, SLOT( btnAddVClicked() ) ); + connect( btnDeleteA, SIGNAL( clicked() ), this, SLOT( btnDeleteAClicked() ) ); + connect( btnDeleteV, SIGNAL( clicked() ), this, SLOT( btnDeleteVClicked() ) ); + connect( leFourcc, SIGNAL( textChanged(const QString&) ), this, SLOT( leFourccTextChanged(const QString&) ) ); + connect( bReset, SIGNAL( clicked() ), this, SLOT( bResetClicked() ) ); + + // tab order + setTabOrder( lbvCodecs, leVLabel ); + setTabOrder( leVLabel, leFourcc ); + setTabOrder( leFourcc, teOpt1 ); + setTabOrder( teOpt1, btnOpt1 ); + setTabOrder( btnOpt1, teOpt2 ); + setTabOrder( teOpt2, btnOpt2 ); + setTabOrder( btnOpt2, teOpt3 ); + setTabOrder( teOpt3, btnOpt3 ); + setTabOrder( btnOpt3, btnAddV ); + setTabOrder( btnAddV, btnDeleteV ); + setTabOrder( btnDeleteV, lbaCodecs ); + setTabOrder( lbaCodecs, leALabel ); + setTabOrder( leALabel, teOptA ); + setTabOrder( teOptA, btnOptA ); + setTabOrder( btnOptA, btnAddA ); + setTabOrder( btnAddA, btnDeleteA ); + setTabOrder( btnDeleteA, tabWidget2 ); + + // buddies + textLabel1_3->setBuddy( leVLabel ); + textLabel3->setBuddy( leALabel ); +} + +/* + * Destroys the object and frees any allocated resources + */ +prefMencoder::~prefMencoder() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void prefMencoder::languageChange() +{ + setCaption( tr2i18n( "Form1" ) ); + textLabel2->setText( tr2i18n( "$PASS\n" +"$WIDTH\n" +"$HEIGHT\n" +"$VIDBR\n" +"$AUDBR" ) ); + textLabel2_2->setText( tr2i18n( "pass number\n" +"video width\n" +"video height\n" +"video bitrate\n" +"audio bitrate" ) ); + lbvCodecs->clear(); + lbvCodecs->insertItem( tr2i18n( "XviD" ) ); + lbvCodecs->insertItem( tr2i18n( "x264" ) ); + lbvCodecs->insertItem( tr2i18n( "MJPEG" ) ); + lbvCodecs->insertItem( tr2i18n( "LJPEG" ) ); + lbvCodecs->insertItem( tr2i18n( "H.261" ) ); + lbvCodecs->insertItem( tr2i18n( "H.263" ) ); + lbvCodecs->insertItem( tr2i18n( "MPEG-4 (DivX 4/5)" ) ); + lbvCodecs->insertItem( tr2i18n( "DivX 3" ) ); + lbvCodecs->insertItem( tr2i18n( "MS MPEG-4 v2" ) ); + lbvCodecs->insertItem( tr2i18n( "WMV7" ) ); + lbvCodecs->insertItem( tr2i18n( "WMV8" ) ); + lbvCodecs->insertItem( tr2i18n( "RealVideo" ) ); + lbvCodecs->insertItem( tr2i18n( "MPEG-1" ) ); + lbvCodecs->insertItem( tr2i18n( "MPEG-2" ) ); + lbvCodecs->insertItem( tr2i18n( "HuffYUV" ) ); + lbvCodecs->insertItem( tr2i18n( "ffvHuff" ) ); + lbvCodecs->insertItem( tr2i18n( "ASUS v1" ) ); + lbvCodecs->insertItem( tr2i18n( "ASUS v2" ) ); + btnDeleteV->setAccel( QKeySequence( QString::null ) ); + textLabel1_3->setText( tr2i18n( "label" ) ); + textLabel2_3->setText( tr2i18n( "fourcc" ) ); + textLabel1_2_3->setText( tr2i18n( "first pass" ) ); + btnOpt2->setText( QString::null ); + btnOpt3->setText( QString::null ); + textLabel1_2->setText( tr2i18n( "one pass" ) ); + teOpt1->setText( QString::null ); + btnOpt1->setText( QString::null ); + textLabel1_2_3_2->setText( tr2i18n( "second pass" ) ); + tabWidget2->changeTab( tab, tr2i18n( "Video codecs" ) ); + lbaCodecs->clear(); + lbaCodecs->insertItem( tr2i18n( "New Item" ) ); + textLabel3->setText( tr2i18n( "label" ) ); + btnOptA->setText( QString::null ); + textLabel1_2_2_2->setText( tr2i18n( "options" ) ); + tabWidget2->changeTab( tab_2, tr2i18n( "Audio codecs" ) ); + textLabel1->setText( tr2i18n( "Available variables" ) ); +} + +void prefMencoder::lbvCodecsCurrentChanged(QListBoxItem*) +{ + qWarning( "prefMencoder::lbvCodecsCurrentChanged(QListBoxItem*): Not implemented yet" ); +} + +void prefMencoder::teOpt1TextChanged() +{ + qWarning( "prefMencoder::teOpt1TextChanged(): Not implemented yet" ); +} + +void prefMencoder::teOpt2TextChanged() +{ + qWarning( "prefMencoder::teOpt2TextChanged(): Not implemented yet" ); +} + +void prefMencoder::leVLabelTextChanged(const QString&) +{ + qWarning( "prefMencoder::leVLabelTextChanged(const QString&): Not implemented yet" ); +} + +void prefMencoder::teOpt3TextChanged() +{ + qWarning( "prefMencoder::teOpt3TextChanged(): Not implemented yet" ); +} + +void prefMencoder::lbaCodecsCurrentChanged(QListBoxItem*) +{ + qWarning( "prefMencoder::lbaCodecsCurrentChanged(QListBoxItem*): Not implemented yet" ); +} + +void prefMencoder::teOptATextChanged() +{ + qWarning( "prefMencoder::teOptATextChanged(): Not implemented yet" ); +} + +void prefMencoder::leALabelTextChanged(const QString&) +{ + qWarning( "prefMencoder::leALabelTextChanged(const QString&): Not implemented yet" ); +} + +void prefMencoder::btnOpt1Clicked() +{ + qWarning( "prefMencoder::btnOpt1Clicked(): Not implemented yet" ); +} + +void prefMencoder::btnOpt2Clicked() +{ + qWarning( "prefMencoder::btnOpt2Clicked(): Not implemented yet" ); +} + +void prefMencoder::btnOpt3Clicked() +{ + qWarning( "prefMencoder::btnOpt3Clicked(): Not implemented yet" ); +} + +void prefMencoder::btnOptAClicked() +{ + qWarning( "prefMencoder::btnOptAClicked(): Not implemented yet" ); +} + +void prefMencoder::btnAddVClicked() +{ + qWarning( "prefMencoder::btnAddVClicked(): Not implemented yet" ); +} + +void prefMencoder::btnDeleteVClicked() +{ + qWarning( "prefMencoder::btnDeleteVClicked(): Not implemented yet" ); +} + +void prefMencoder::btnAddAClicked() +{ + qWarning( "prefMencoder::btnAddAClicked(): Not implemented yet" ); +} + +void prefMencoder::btnDeleteAClicked() +{ + qWarning( "prefMencoder::btnDeleteAClicked(): Not implemented yet" ); +} + +void prefMencoder::leFourccTextChanged(const QString&) +{ + qWarning( "prefMencoder::leFourccTextChanged(const QString&): Not implemented yet" ); +} + +void prefMencoder::bResetClicked() +{ + qWarning( "prefMencoder::bResetClicked(): Not implemented yet" ); +} + +#include "prefMencoder.moc" diff --git a/src/prefMencoder.ui b/src/prefMencoder.ui new file mode 100644 index 0000000..e12aec6 --- /dev/null +++ b/src/prefMencoder.ui @@ -0,0 +1,825 @@ + +prefMencoder + + + prefMencoder + + + + 0 + 0 + 672 + 587 + + + + Form1 + + + + unnamed + + + + layout2 + + + + unnamed + + + + textLabel2 + + + + 0 + 0 + 0 + 0 + + + + + 1 + + + + $PASS +$WIDTH +$HEIGHT +$VIDBR +$AUDBR + + + + + textLabel2_2 + + + + 5 + 0 + 0 + 0 + + + + pass number +video width +video height +video bitrate +audio bitrate + + + + + + + tabWidget2 + + + + tab + + + Video codecs + + + + unnamed + + + + + XviD + + + + + x264 + + + + + MJPEG + + + + + LJPEG + + + + + H.261 + + + + + H.263 + + + + + MPEG-4 (DivX 4/5) + + + + + DivX 3 + + + + + MS MPEG-4 v2 + + + + + WMV7 + + + + + WMV8 + + + + + RealVideo + + + + + MPEG-1 + + + + + MPEG-2 + + + + + HuffYUV + + + + + ffvHuff + + + + + ASUS v1 + + + + + ASUS v2 + + + + lbvCodecs + + + + + btnDeleteV + + + + 1 + 0 + 0 + 0 + + + + + + + 28 + + + + + btnAddV + + + + 1 + 0 + 0 + 0 + + + + 27 + + + + + textLabel1_3 + + + label + + + leVLabel + + + + + textLabel2_3 + + + fourcc + + + + + textLabel1_2_3 + + + first pass + + + + + layout9 + + + + unnamed + + + + teOpt2 + + + true + + + + + spacer5 + + + Vertical + + + Expanding + + + + 20 + 81 + + + + + + btnOpt2 + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + + layout10 + + + + unnamed + + + + teOpt3 + + + true + + + + + btnOpt3 + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + spacer6 + + + Vertical + + + Expanding + + + + 20 + 60 + + + + + + + + textLabel1_2 + + + one pass + + + + + layout8 + + + + unnamed + + + + spacer4 + + + Vertical + + + Expanding + + + + 20 + 90 + + + + + + teOpt1 + + + true + + + + + + WidgetWidth + + + + + btnOpt1 + + + + 1 + 0 + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + + textLabel1_2_3_2 + + + second pass + + + + + leFourcc + + + + + leVLabel + + + true + + + + + + + tab + + + Audio codecs + + + + unnamed + + + + btnDeleteA + + + + 1 + 0 + 0 + 0 + + + + 28 + + + + + btnAddA + + + + 1 + 0 + 0 + 0 + + + + 27 + + + + + + New Item + + + + lbaCodecs + + + + + leALabel + + + + + textLabel3 + + + label + + + leALabel + + + + + layout11 + + + + unnamed + + + + teOptA + + + + + spacer4_2 + + + Vertical + + + Expanding + + + + 20 + 78 + + + + + + btnOptA + + + + 1 + 0 + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + + textLabel1_2_2_2 + + + + 5 + 0 + 0 + 0 + + + + options + + + + + + + + textLabel1 + + + + 5 + 0 + 0 + 0 + + + + + 1 + + + + Available variables + + + + + bReset + + + + 0 + 0 + 0 + 0 + + + + 21 + + + + + spacer5_2 + + + Horizontal + + + Expanding + + + + 121 + 21 + + + + + + + + lbvCodecs + currentChanged(QListBoxItem*) + prefMencoder + lbvCodecsCurrentChanged(QListBoxItem*) + + + teOpt1 + textChanged() + prefMencoder + teOpt1TextChanged() + + + teOpt2 + textChanged() + prefMencoder + teOpt2TextChanged() + + + leVLabel + textChanged(const QString&) + prefMencoder + leVLabelTextChanged(const QString&) + + + teOpt3 + textChanged() + prefMencoder + teOpt3TextChanged() + + + lbaCodecs + currentChanged(QListBoxItem*) + prefMencoder + lbaCodecsCurrentChanged(QListBoxItem*) + + + teOptA + textChanged() + prefMencoder + teOptATextChanged() + + + leALabel + textChanged(const QString&) + prefMencoder + leALabelTextChanged(const QString&) + + + btnOpt1 + clicked() + prefMencoder + btnOpt1Clicked() + + + btnOpt2 + clicked() + prefMencoder + btnOpt2Clicked() + + + btnOpt3 + clicked() + prefMencoder + btnOpt3Clicked() + + + btnOptA + clicked() + prefMencoder + btnOptAClicked() + + + btnAddA + clicked() + prefMencoder + btnAddAClicked() + + + btnAddV + clicked() + prefMencoder + btnAddVClicked() + + + btnDeleteA + clicked() + prefMencoder + btnDeleteAClicked() + + + btnDeleteV + clicked() + prefMencoder + btnDeleteVClicked() + + + leFourcc + textChanged(const QString&) + prefMencoder + leFourccTextChanged(const QString&) + + + bReset + clicked() + prefMencoder + bResetClicked() + + + + lbvCodecs + leVLabel + leFourcc + teOpt1 + btnOpt1 + teOpt2 + btnOpt2 + teOpt3 + btnOpt3 + btnAddV + btnDeleteV + lbaCodecs + leALabel + teOptA + btnOptA + btnAddA + btnDeleteA + tabWidget2 + + + lbvCodecsCurrentChanged(QListBoxItem*) + teOpt1TextChanged() + teOpt2TextChanged() + leVLabelTextChanged(const QString &) + teOpt3TextChanged() + lbaCodecsCurrentChanged(QListBoxItem*) + teOptATextChanged() + leALabelTextChanged(const QString&) + btnOpt1Clicked() + btnOpt2Clicked() + btnOpt3Clicked() + btnOptAClicked() + btnAddVClicked() + btnDeleteVClicked() + btnAddAClicked() + btnDeleteAClicked() + leFourccTextChanged(const QString&) + bResetClicked() + + + + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + kpushbutton.h + + diff --git a/src/prefpreview.cpp b/src/prefpreview.cpp new file mode 100644 index 0000000..54a959e --- /dev/null +++ b/src/prefpreview.cpp @@ -0,0 +1,171 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './prefpreview.ui' +** +** Created: dim. oct. 26 08:57:36 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "prefpreview.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a prefPreview as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +prefPreview::prefPreview( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "prefPreview" ); + prefPreviewLayout = new QGridLayout( this, 1, 1, 11, 6, "prefPreviewLayout"); + + buttonGroup1 = new QButtonGroup( this, "buttonGroup1" ); + buttonGroup1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, buttonGroup1->sizePolicy().hasHeightForWidth() ) ); + buttonGroup1->setFrameShape( QButtonGroup::NoFrame ); + buttonGroup1->setColumnLayout(0, Qt::Vertical ); + buttonGroup1->layout()->setSpacing( 6 ); + buttonGroup1->layout()->setMargin( 11 ); + buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() ); + buttonGroup1Layout->setAlignment( Qt::AlignTop ); + + rbInternal = new QRadioButton( buttonGroup1, "rbInternal" ); + + buttonGroup1Layout->addWidget( rbInternal, 0, 0 ); + + rbMplayer = new QRadioButton( buttonGroup1, "rbMplayer" ); + + buttonGroup1Layout->addWidget( rbMplayer, 1, 0 ); + + prefPreviewLayout->addWidget( buttonGroup1, 0, 0 ); + spacer5 = new QSpacerItem( 21, 210, QSizePolicy::Minimum, QSizePolicy::Expanding ); + prefPreviewLayout->addItem( spacer5, 2, 0 ); + + wsOptions = new QWidgetStack( this, "wsOptions" ); + wsOptions->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, wsOptions->sizePolicy().hasHeightForWidth() ) ); + wsOptions->setFrameShape( QWidgetStack::NoFrame ); + wsOptions->setFrameShadow( QWidgetStack::Sunken ); + wsOptions->setLineWidth( 1 ); + wsOptions->setMidLineWidth( 0 ); + + wspInternal = new QWidget( wsOptions, "wspInternal" ); + wspInternalLayout = new QGridLayout( wspInternal, 1, 1, 11, 6, "wspInternalLayout"); + + textLabel1 = new QLabel( wspInternal, "textLabel1" ); + QFont textLabel1_font( textLabel1->font() ); + textLabel1_font.setBold( TRUE ); + textLabel1->setFont( textLabel1_font ); + + wspInternalLayout->addWidget( textLabel1, 0, 0 ); + + ckUseGL = new QCheckBox( wspInternal, "ckUseGL" ); + + wspInternalLayout->addWidget( ckUseGL, 1, 0 ); + spacer1 = new QSpacerItem( 21, 30, QSizePolicy::Minimum, QSizePolicy::Expanding ); + wspInternalLayout->addItem( spacer1, 2, 0 ); + wsOptions->addWidget( wspInternal, 0 ); + + wspMplayer = new QWidget( wsOptions, "wspMplayer" ); + wspMplayerLayout = new QGridLayout( wspMplayer, 1, 1, 11, 6, "wspMplayerLayout"); + + textLabel3 = new QLabel( wspMplayer, "textLabel3" ); + + wspMplayerLayout->addWidget( textLabel3, 1, 0 ); + + textLabel4 = new QLabel( wspMplayer, "textLabel4" ); + textLabel4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, textLabel4->sizePolicy().hasHeightForWidth() ) ); + + wspMplayerLayout->addWidget( textLabel4, 2, 0 ); + + cbVout = new QComboBox( FALSE, wspMplayer, "cbVout" ); + + wspMplayerLayout->addWidget( cbVout, 1, 1 ); + + cbAout = new QComboBox( FALSE, wspMplayer, "cbAout" ); + cbAout->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, cbAout->sizePolicy().hasHeightForWidth() ) ); + + wspMplayerLayout->addWidget( cbAout, 2, 1 ); + spacer3 = new QSpacerItem( 81, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + wspMplayerLayout->addItem( spacer3, 1, 2 ); + spacer6 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding ); + wspMplayerLayout->addItem( spacer6, 3, 1 ); + + textLabel2 = new QLabel( wspMplayer, "textLabel2" ); + QFont textLabel2_font( textLabel2->font() ); + textLabel2_font.setBold( TRUE ); + textLabel2->setFont( textLabel2_font ); + + wspMplayerLayout->addMultiCellWidget( textLabel2, 0, 0, 0, 2 ); + wsOptions->addWidget( wspMplayer, 1 ); + + prefPreviewLayout->addWidget( wsOptions, 1, 0 ); + spacer4 = new QSpacerItem( 230, 21, QSizePolicy::Expanding, QSizePolicy::Minimum ); + prefPreviewLayout->addItem( spacer4, 0, 1 ); + languageChange(); + resize( QSize(536, 470).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( rbInternal, SIGNAL( clicked() ), this, SLOT( rbInternalClick() ) ); + connect( rbMplayer, SIGNAL( clicked() ), this, SLOT( rbMplayerClick() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +prefPreview::~prefPreview() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void prefPreview::languageChange() +{ + setCaption( tr2i18n( "Form1" ) ); + buttonGroup1->setTitle( QString::null ); + rbInternal->setText( tr2i18n( "&Internal Player" ) ); + rbInternal->setAccel( QKeySequence( tr2i18n( "Alt+I" ) ) ); + rbMplayer->setText( tr2i18n( "MPlayer" ) ); + rbMplayer->setAccel( QKeySequence( tr2i18n( "Alt+M" ) ) ); + textLabel1->setText( tr2i18n( "Internal viewer options" ) ); + ckUseGL->setText( tr2i18n( "use OpenGL" ) ); + textLabel3->setText( tr2i18n( "Video output" ) ); + textLabel4->setText( tr2i18n( "Audio output" ) ); + cbVout->clear(); + cbVout->insertItem( tr2i18n( "X11" ) ); + cbVout->insertItem( tr2i18n( "Xv" ) ); + cbVout->insertItem( tr2i18n( "OpenGL" ) ); + cbVout->insertItem( tr2i18n( "SDL" ) ); + cbAout->clear(); + cbAout->insertItem( tr2i18n( "ALSA" ) ); + cbAout->insertItem( tr2i18n( "OSS" ) ); + cbAout->insertItem( tr2i18n( "SDL" ) ); + textLabel2->setText( tr2i18n( "MPlayer options" ) ); +} + +void prefPreview::rbInternalClick() +{ + qWarning( "prefPreview::rbInternalClick(): Not implemented yet" ); +} + +void prefPreview::rbMplayerClick() +{ + qWarning( "prefPreview::rbMplayerClick(): Not implemented yet" ); +} + +#include "prefpreview.moc" diff --git a/src/prefpreview.ui b/src/prefpreview.ui new file mode 100644 index 0000000..901b1ce --- /dev/null +++ b/src/prefpreview.ui @@ -0,0 +1,336 @@ + +prefPreview + + + prefPreview + + + + 0 + 0 + 536 + 470 + + + + Form1 + + + + unnamed + + + + buttonGroup1 + + + + 5 + 0 + 0 + 0 + + + + NoFrame + + + + + + + unnamed + + + + rbInternal + + + &Internal Player + + + Alt+I + + + + + rbMplayer + + + MPlayer + + + Alt+M + + + + + + + spacer5 + + + Vertical + + + Expanding + + + + 21 + 210 + + + + + + wsOptions + + + + 5 + 5 + 0 + 0 + + + + NoFrame + + + Sunken + + + 1 + + + 0 + + + + wspInternal + + + 0 + + + + unnamed + + + + textLabel1 + + + + 1 + + + + Internal viewer options + + + + + ckUseGL + + + use OpenGL + + + + + spacer1 + + + Vertical + + + Expanding + + + + 21 + 30 + + + + + + + + wspMplayer + + + 1 + + + + unnamed + + + + textLabel3 + + + Video output + + + + + textLabel4 + + + + 5 + 5 + 0 + 0 + + + + Audio output + + + + + + X11 + + + + + Xv + + + + + OpenGL + + + + + SDL + + + + cbVout + + + + + + ALSA + + + + + OSS + + + + + SDL + + + + cbAout + + + + 5 + 0 + 0 + 0 + + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 81 + 21 + + + + + + spacer6 + + + Vertical + + + Expanding + + + + 20 + 21 + + + + + + textLabel2 + + + + 1 + + + + MPlayer options + + + + + + + + spacer4 + + + Horizontal + + + Expanding + + + + 230 + 21 + + + + + + + + rbInternal + clicked() + prefPreview + rbInternalClick() + + + rbMplayer + clicked() + prefPreview + rbMplayerClick() + + + + rbInternalClick() + rbMplayerClick() + + + diff --git a/src/titlefactor.cpp b/src/titlefactor.cpp new file mode 100644 index 0000000..e09fe73 --- /dev/null +++ b/src/titlefactor.cpp @@ -0,0 +1,346 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './titlefactor.ui' +** +** Created: dim. oct. 26 08:57:36 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "titlefactor.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const unsigned char img0_titlefactor[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x32, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x1e, 0x3f, 0x88, 0xb1, 0x00, 0x00, 0x09, + 0xf8, 0x49, 0x44, 0x41, 0x54, 0x68, 0x81, 0xed, 0x99, 0x6b, 0x6c, 0x5b, + 0xe5, 0x19, 0xc7, 0x7f, 0xc7, 0x3e, 0x3e, 0xc7, 0xd7, 0xc4, 0xa9, 0xe3, + 0xa4, 0x71, 0x12, 0xc7, 0xad, 0xd3, 0x92, 0x26, 0xbd, 0x37, 0x30, 0xae, + 0x03, 0x0a, 0x12, 0x9b, 0x36, 0x6d, 0xd0, 0xc2, 0x2e, 0x6c, 0xc0, 0x24, + 0x18, 0x7c, 0x18, 0x1a, 0xac, 0x50, 0x86, 0x00, 0xa1, 0x6e, 0xdc, 0x2a, + 0xca, 0x2a, 0x90, 0x46, 0x05, 0x6c, 0x42, 0x65, 0x83, 0x69, 0x08, 0x0a, + 0x13, 0x13, 0x12, 0x63, 0xac, 0x2d, 0x2d, 0x74, 0xd0, 0x06, 0xda, 0xd0, + 0x06, 0x92, 0x94, 0x84, 0x38, 0x4d, 0x9c, 0x38, 0x89, 0x13, 0xc7, 0xf7, + 0xcb, 0xf1, 0x79, 0xf7, 0xa1, 0x69, 0xa0, 0x6b, 0x1d, 0x9b, 0x11, 0xb1, + 0x72, 0xf9, 0x7f, 0x3b, 0x3e, 0xc7, 0xcf, 0xfb, 0xfc, 0xde, 0xf7, 0x3c, + 0x97, 0xf7, 0x3d, 0xd2, 0x8d, 0x6f, 0xf5, 0xf2, 0x65, 0x90, 0xe1, 0xff, + 0xed, 0xc0, 0x6c, 0xe9, 0x6b, 0x90, 0x53, 0x4d, 0x5f, 0x83, 0x9c, 0x6a, + 0x9a, 0x11, 0xe4, 0x06, 0xa7, 0x2a, 0xee, 0x69, 0xaa, 0x16, 0x9f, 0x97, + 0x33, 0x33, 0xe9, 0x87, 0x06, 0x7d, 0x46, 0x3f, 0x0a, 0x82, 0x6c, 0x5a, + 0x5e, 0x27, 0x6e, 0x7f, 0xe0, 0x6f, 0xac, 0xb9, 0xe1, 0x09, 0x1a, 0xda, + 0x7b, 0xc4, 0x4d, 0xd5, 0xf6, 0xcf, 0x1d, 0x68, 0xf3, 0x2a, 0xaf, 0x58, + 0x3d, 0x31, 0x29, 0x8e, 0xfc, 0xe1, 0x1f, 0xe2, 0xce, 0x07, 0x5f, 0xa2, + 0xa9, 0xb3, 0xbf, 0xa0, 0x0f, 0x72, 0xa1, 0x1b, 0x8a, 0x22, 0xb3, 0xac, + 0xb9, 0x8e, 0x97, 0xb7, 0x1f, 0xe4, 0x4f, 0xcf, 0xbd, 0xc5, 0xf3, 0x2f, + 0xbf, 0x4b, 0x99, 0xdd, 0x22, 0x56, 0x2d, 0xf5, 0xd2, 0xdc, 0x38, 0x97, + 0x15, 0x8b, 0xeb, 0x71, 0xcf, 0xb1, 0x73, 0x6f, 0x6f, 0x58, 0x9a, 0x2d, + 0xa7, 0x7b, 0x02, 0xa3, 0x0c, 0x85, 0xa2, 0x74, 0x74, 0x07, 0xd9, 0xd7, + 0x1e, 0xe0, 0xe2, 0x87, 0xc6, 0x99, 0x8c, 0x25, 0xd1, 0x34, 0x1d, 0xbb, + 0x4d, 0xe5, 0xd2, 0x4b, 0x96, 0xb1, 0x31, 0x30, 0x71, 0xd2, 0xff, 0x4b, + 0x33, 0x15, 0xc4, 0xbb, 0xe6, 0xbb, 0xc4, 0xa5, 0x3f, 0x7f, 0x9c, 0x15, + 0x2d, 0xf5, 0xf8, 0xea, 0x5d, 0x7c, 0x70, 0x78, 0x88, 0x0f, 0x0e, 0xf4, + 0x11, 0x97, 0x24, 0x54, 0x45, 0x46, 0x55, 0x65, 0xcc, 0xaa, 0x09, 0xb3, + 0x6a, 0x62, 0xc1, 0xbc, 0x2a, 0xca, 0xec, 0x66, 0xb2, 0x59, 0x0d, 0x4f, + 0x75, 0x39, 0xde, 0xda, 0x39, 0x18, 0x8d, 0xc7, 0x2f, 0xb8, 0xc1, 0x20, + 0x31, 0x36, 0x9e, 0xa0, 0xb7, 0x7f, 0x8c, 0x9c, 0x96, 0x07, 0x20, 0x38, + 0x1c, 0x61, 0x70, 0x38, 0x42, 0x4e, 0xd3, 0x89, 0x27, 0x33, 0xe4, 0xb2, + 0x1a, 0x52, 0x26, 0x87, 0xc7, 0xe7, 0x66, 0x79, 0x4b, 0x3d, 0xe5, 0x0e, + 0x33, 0x4f, 0xbf, 0xb0, 0x97, 0x2b, 0xbe, 0xb3, 0x92, 0xb1, 0xb3, 0x9b, + 0x0b, 0x4e, 0x5a, 0xc1, 0x15, 0x01, 0xb8, 0xb7, 0x37, 0x2c, 0x35, 0xf9, + 0xab, 0xc5, 0x91, 0xe0, 0x04, 0x37, 0x5f, 0xbb, 0x9a, 0x6b, 0xd6, 0x7e, + 0x83, 0xa8, 0x2c, 0x33, 0xd1, 0x3b, 0x4c, 0x70, 0x68, 0x82, 0xee, 0x81, + 0x71, 0xc2, 0xe3, 0x71, 0x22, 0xd1, 0x14, 0xc1, 0xde, 0x61, 0xfa, 0x35, + 0x1d, 0x61, 0x55, 0xd9, 0xdf, 0x31, 0xc0, 0x48, 0x38, 0x8a, 0xa6, 0xe9, + 0x27, 0xd8, 0x74, 0xd8, 0xcd, 0x78, 0xaa, 0xcb, 0xd1, 0x63, 0x29, 0xb4, + 0xbc, 0x8e, 0xd5, 0xe5, 0x60, 0xe5, 0x12, 0x2f, 0xaa, 0x22, 0x73, 0x5a, + 0xbd, 0x8b, 0x3a, 0x4f, 0x05, 0xae, 0x45, 0xf5, 0x38, 0xb3, 0x39, 0xcc, + 0xaa, 0xcc, 0xab, 0xbb, 0x3b, 0x91, 0x65, 0x03, 0x17, 0x9d, 0xdb, 0xc4, + 0xb3, 0x27, 0x9a, 0x2b, 0x0d, 0x04, 0xa0, 0x75, 0x69, 0x03, 0x8f, 0x3f, + 0xbd, 0x9b, 0x5c, 0x36, 0xc7, 0xbd, 0xbd, 0x89, 0xa9, 0x19, 0x91, 0xc0, + 0x3d, 0x87, 0xfb, 0x2f, 0x68, 0x11, 0x9a, 0x96, 0x47, 0xd3, 0x74, 0x92, + 0x8a, 0x4c, 0x36, 0x2f, 0x30, 0x25, 0x52, 0x68, 0x9a, 0x4e, 0x3a, 0x93, + 0x23, 0xaf, 0x0b, 0x3e, 0x39, 0x85, 0x02, 0x50, 0x4c, 0x46, 0xac, 0x16, + 0x85, 0xac, 0xd5, 0x8c, 0x41, 0x02, 0x35, 0x95, 0xc1, 0x66, 0x51, 0x30, + 0x48, 0x12, 0x56, 0x87, 0x85, 0x75, 0xfb, 0xfa, 0x24, 0x7a, 0x46, 0x01, + 0xb8, 0xbf, 0xa5, 0x46, 0x1c, 0xec, 0x1c, 0xc4, 0x6a, 0x51, 0x68, 0x5d, + 0xea, 0xe5, 0xd9, 0x03, 0x03, 0xff, 0x3b, 0xc8, 0xca, 0xc5, 0x5e, 0x0c, + 0x46, 0x89, 0xde, 0x8f, 0x46, 0x60, 0x8e, 0x93, 0xf1, 0x5c, 0x5e, 0xf4, + 0x25, 0xb2, 0x3c, 0x7d, 0x8e, 0x9f, 0x3b, 0x3a, 0x82, 0xd3, 0x7e, 0x6e, + 0x5c, 0xd5, 0x20, 0x14, 0x83, 0xc4, 0xba, 0xee, 0x50, 0x09, 0x31, 0x93, + 0xe2, 0x77, 0xa7, 0x57, 0x88, 0x9c, 0x2e, 0xb8, 0xbd, 0xeb, 0xe3, 0xe7, + 0xd7, 0x2f, 0xf6, 0x88, 0x77, 0x23, 0x29, 0xe1, 0xb3, 0x29, 0xcc, 0x31, + 0x19, 0xa5, 0xc8, 0x64, 0x92, 0x8e, 0xae, 0x21, 0x96, 0x37, 0xd7, 0xb3, + 0xfe, 0xc0, 0xc0, 0x8c, 0x76, 0x8b, 0xd6, 0x91, 0x96, 0x85, 0x35, 0x38, + 0x6c, 0x66, 0x0e, 0xbc, 0x17, 0xe0, 0xa1, 0xd6, 0x06, 0x71, 0x51, 0x4d, + 0x39, 0x7b, 0x86, 0x27, 0xb9, 0x6c, 0x47, 0x17, 0xeb, 0x5a, 0x3c, 0x02, + 0xe0, 0xbe, 0x95, 0x5e, 0xf1, 0xcc, 0x47, 0x63, 0xbc, 0x37, 0x91, 0x2c, + 0xce, 0x30, 0xa5, 0xc3, 0xd1, 0x14, 0x2f, 0xf6, 0x87, 0xb9, 0x67, 0x85, + 0x57, 0x00, 0xac, 0x6b, 0xf1, 0x88, 0xef, 0x6d, 0xef, 0x62, 0xcf, 0xf0, + 0x24, 0xe7, 0x57, 0x97, 0x01, 0x90, 0xc9, 0xe4, 0x38, 0x32, 0x34, 0xce, + 0xd2, 0x45, 0xb5, 0x45, 0xed, 0x15, 0x05, 0xb9, 0xf3, 0xfd, 0x21, 0xc9, + 0x60, 0x30, 0xd0, 0x3b, 0x1c, 0x21, 0x1a, 0x4b, 0x71, 0xa5, 0xcf, 0xc5, + 0x96, 0xb3, 0xfc, 0xb4, 0x8f, 0x27, 0xb8, 0x74, 0x7b, 0x27, 0x1b, 0x96, + 0xd7, 0x8b, 0x57, 0x06, 0x23, 0x3c, 0xd9, 0x1d, 0x62, 0x22, 0xab, 0x95, + 0x0c, 0x12, 0x4a, 0xe5, 0xd8, 0xd2, 0x15, 0xe2, 0xd5, 0x60, 0x84, 0x0d, + 0xcb, 0xeb, 0xc5, 0xa5, 0xdb, 0x3b, 0x69, 0x1f, 0x4f, 0xb0, 0xe5, 0x2c, + 0x3f, 0x57, 0xcd, 0xaf, 0x04, 0x60, 0x64, 0x3c, 0x8e, 0xa6, 0xe9, 0x78, + 0xaa, 0xcb, 0x3f, 0x3b, 0x08, 0xc0, 0x92, 0x26, 0x0f, 0x91, 0x78, 0x86, + 0x54, 0x2c, 0xc5, 0xfa, 0xb6, 0x80, 0x74, 0x6d, 0xa3, 0x9b, 0x47, 0xcf, + 0x9c, 0x47, 0x57, 0x34, 0xcd, 0x75, 0x7b, 0x7a, 0x78, 0xf0, 0xd0, 0x20, + 0xef, 0x84, 0x13, 0x4c, 0x7e, 0x0a, 0x90, 0x98, 0x96, 0x67, 0xdf, 0x68, + 0x9c, 0x7b, 0xda, 0x07, 0xb8, 0x72, 0x57, 0x37, 0xdd, 0xd1, 0x34, 0x5b, + 0xce, 0xf2, 0x73, 0x6d, 0xa3, 0x9b, 0xdb, 0xda, 0x02, 0xd2, 0xc3, 0xad, + 0x0d, 0x62, 0x78, 0x34, 0x8a, 0xaa, 0xc8, 0x34, 0xfa, 0xdc, 0xb3, 0x03, + 0xe2, 0xb0, 0x9b, 0x49, 0x24, 0xb3, 0xe4, 0xa7, 0xca, 0xd1, 0x2d, 0xfb, + 0xfa, 0xa4, 0x0f, 0x22, 0x29, 0xe9, 0xb6, 0xc5, 0x1e, 0x5e, 0x0b, 0x4e, + 0xf2, 0x4e, 0x38, 0x81, 0x26, 0x04, 0xed, 0x13, 0x49, 0x36, 0xb5, 0x36, + 0x14, 0x2d, 0x9c, 0x0f, 0x9f, 0xe1, 0x13, 0x1f, 0x44, 0x52, 0x68, 0x42, + 0x70, 0x28, 0x92, 0xe4, 0xf5, 0x50, 0x8c, 0xf5, 0x8b, 0x3d, 0xbc, 0x3f, + 0x91, 0x90, 0x6e, 0xd9, 0xd7, 0x27, 0x01, 0x64, 0x73, 0x79, 0x86, 0x46, + 0xa2, 0x98, 0x4c, 0x46, 0xdc, 0x15, 0xf6, 0xd9, 0x01, 0x39, 0x6d, 0x7e, + 0x35, 0xe1, 0x48, 0x82, 0x74, 0x22, 0x03, 0xc0, 0x8d, 0x8b, 0x6a, 0x84, + 0xdd, 0x64, 0x14, 0xdb, 0x02, 0x61, 0xe2, 0x53, 0xf5, 0x00, 0x60, 0xd7, + 0x70, 0x94, 0xbe, 0x78, 0xa6, 0xa8, 0xbd, 0x81, 0x44, 0x96, 0x3d, 0xa3, + 0xf1, 0xe9, 0xeb, 0x4c, 0x5e, 0x67, 0x5b, 0x20, 0x8c, 0xdd, 0x64, 0x14, + 0x37, 0x2e, 0xaa, 0x11, 0x70, 0x34, 0x3e, 0x06, 0x86, 0x23, 0x58, 0x2d, + 0x0a, 0x4e, 0xa7, 0x75, 0x76, 0x40, 0xdc, 0x2e, 0x3b, 0x5a, 0x2c, 0x45, + 0xd2, 0x6e, 0x06, 0x60, 0x34, 0x9d, 0x23, 0x93, 0xd7, 0x71, 0xc8, 0x46, + 0xac, 0xf2, 0xc7, 0x26, 0xde, 0x1e, 0x8b, 0xd3, 0x1b, 0x4b, 0x17, 0xb5, + 0xd7, 0x19, 0x4d, 0xb1, 0x63, 0x68, 0x72, 0xfa, 0xda, 0x2a, 0x1b, 0x70, + 0xc8, 0x46, 0x32, 0x79, 0x9d, 0xd1, 0x4c, 0x8e, 0x47, 0xce, 0xf0, 0x09, + 0x21, 0x04, 0xd9, 0xa9, 0x57, 0x75, 0xdd, 0x3b, 0xfd, 0x45, 0x33, 0x61, + 0xd1, 0xf4, 0x0b, 0x90, 0x4e, 0xe7, 0x00, 0x30, 0x4f, 0x5d, 0xb7, 0x38, + 0x2d, 0x2c, 0x70, 0xd4, 0x32, 0x96, 0xc9, 0xd1, 0x9f, 0xc8, 0x72, 0x38, + 0x9a, 0x66, 0xf7, 0x48, 0x94, 0xe7, 0xfb, 0xc2, 0x3c, 0x17, 0x08, 0xf3, + 0x50, 0xab, 0x4f, 0x6c, 0x38, 0x70, 0xe4, 0xa4, 0x83, 0x6f, 0x58, 0x5e, + 0x2f, 0x6e, 0x6d, 0xeb, 0x23, 0xae, 0xe5, 0xb9, 0xdc, 0xe7, 0xe2, 0xbc, + 0xaa, 0x32, 0x16, 0x94, 0x99, 0xf1, 0xda, 0x14, 0x2a, 0x55, 0x13, 0x8a, + 0x51, 0xe2, 0xa6, 0xbd, 0x7d, 0xd2, 0xdd, 0x8d, 0x95, 0x22, 0x95, 0xce, + 0x51, 0x51, 0x5e, 0x7c, 0x35, 0x4a, 0x06, 0xf1, 0x37, 0xb8, 0x91, 0x1d, + 0x16, 0xfa, 0x3a, 0x07, 0xd9, 0x7c, 0x61, 0x8b, 0x38, 0xd9, 0x0c, 0x6d, + 0x6e, 0xf5, 0x89, 0x2b, 0x1a, 0x5c, 0xe8, 0x42, 0x90, 0xd5, 0x0b, 0x97, + 0xe0, 0xac, 0xae, 0x73, 0x89, 0xc7, 0xc9, 0xb7, 0x6b, 0x2b, 0x38, 0xcb, + 0xed, 0xe0, 0xc1, 0x43, 0x83, 0xd2, 0xe1, 0x68, 0xea, 0x84, 0xe7, 0xd2, + 0x19, 0x8d, 0xd0, 0x58, 0x14, 0x5f, 0x9d, 0x8b, 0xec, 0x6c, 0x81, 0x54, + 0xbb, 0x1d, 0x28, 0x26, 0x23, 0xc3, 0xe1, 0x38, 0xf9, 0xfc, 0xc9, 0x9d, + 0x7c, 0xf0, 0xd0, 0xe0, 0x34, 0xdc, 0x9a, 0x06, 0x57, 0xc1, 0x80, 0x77, + 0xa9, 0x26, 0xde, 0x1c, 0x89, 0x49, 0x00, 0xbb, 0x43, 0xd1, 0x82, 0x63, + 0xe6, 0xf3, 0x3a, 0x99, 0x8c, 0x76, 0xb4, 0x0b, 0x28, 0xc1, 0xc7, 0x92, + 0x62, 0x44, 0xd3, 0x74, 0x84, 0x10, 0xc8, 0xb2, 0x01, 0x49, 0x2a, 0x5e, + 0xb8, 0x8f, 0x65, 0x9e, 0x4f, 0x7b, 0xef, 0xbf, 0x25, 0x49, 0x12, 0xfa, + 0xcc, 0xdb, 0x90, 0x69, 0x7d, 0x35, 0x76, 0x88, 0x5f, 0x24, 0x7d, 0x0d, + 0x72, 0xaa, 0xa9, 0x24, 0x90, 0x63, 0xf1, 0x2d, 0x4e, 0x89, 0x63, 0x88, + 0x93, 0xab, 0xa4, 0xf4, 0xab, 0x4d, 0xa5, 0x5c, 0x93, 0xc9, 0x88, 0xc1, + 0x50, 0x38, 0xe9, 0xfc, 0xd4, 0xef, 0x16, 0xb1, 0x5c, 0x9e, 0x65, 0x15, + 0x56, 0x7e, 0xdb, 0x7e, 0xf2, 0xfd, 0xc3, 0xdd, 0xcb, 0xea, 0x44, 0xfb, + 0x44, 0x12, 0x87, 0xc9, 0xc8, 0xd3, 0x3d, 0xa3, 0x33, 0x66, 0x30, 0x21, + 0xc4, 0x09, 0xdb, 0xe5, 0x42, 0x2a, 0x09, 0x64, 0x28, 0x14, 0x25, 0x9d, + 0xc9, 0x51, 0xeb, 0xb2, 0x1f, 0xd7, 0x2e, 0xdc, 0xbb, 0xc2, 0x2b, 0x06, + 0x92, 0x19, 0x3a, 0x27, 0x53, 0xb4, 0x4f, 0x24, 0xb9, 0xee, 0xcd, 0x1e, + 0x5a, 0x2b, 0x6d, 0x2c, 0x5c, 0x5e, 0x5f, 0xd0, 0x56, 0x2a, 0xaf, 0xf3, + 0x4c, 0xef, 0x28, 0x6d, 0x63, 0x09, 0x2e, 0x6b, 0x98, 0x23, 0x96, 0x55, + 0x58, 0x69, 0x2a, 0xb7, 0x50, 0x67, 0x55, 0xb9, 0x6b, 0xff, 0xc7, 0xb6, + 0x8d, 0x46, 0x03, 0xaa, 0x2a, 0x33, 0x1e, 0x49, 0x50, 0x4a, 0xbe, 0x2e, + 0x09, 0x24, 0x34, 0x16, 0x45, 0x24, 0xb3, 0x54, 0xd6, 0x57, 0x42, 0x28, + 0xce, 0xcf, 0x1a, 0xab, 0xc4, 0xbf, 0x86, 0x26, 0x59, 0xd7, 0xd6, 0x47, + 0xf7, 0x64, 0x8a, 0x3d, 0xa3, 0x31, 0x8e, 0xa5, 0xfb, 0xdb, 0x97, 0xd4, + 0xb2, 0xe9, 0x50, 0xb0, 0xe0, 0xd8, 0x9b, 0x0e, 0x05, 0xa5, 0x4b, 0x3c, + 0x4e, 0xb1, 0xf5, 0xc3, 0x51, 0x0e, 0x45, 0x92, 0x18, 0x24, 0x38, 0xdb, + 0xed, 0x60, 0x61, 0xb9, 0x85, 0xa6, 0x72, 0xab, 0x58, 0x3d, 0xb7, 0x8c, + 0xad, 0x1f, 0x8e, 0x48, 0x66, 0x55, 0xa6, 0xb2, 0xc2, 0x4e, 0x6f, 0xff, + 0x18, 0xfe, 0xd9, 0x02, 0x39, 0xa6, 0xcc, 0xd4, 0x32, 0xf7, 0xc4, 0xd2, + 0xec, 0x0a, 0x45, 0x69, 0x0b, 0xc7, 0x09, 0xa5, 0x72, 0xd3, 0xf7, 0x57, + 0xb9, 0x6c, 0x2c, 0xa9, 0xb0, 0xf2, 0xd6, 0x68, 0x6c, 0x46, 0x3b, 0x2b, + 0x5c, 0x76, 0x2e, 0x98, 0x5b, 0xc6, 0xce, 0xe1, 0x28, 0xba, 0x80, 0x37, + 0x46, 0x62, 0x1c, 0x8e, 0xa5, 0x19, 0x4d, 0x6b, 0xf8, 0xec, 0x2a, 0x00, + 0x26, 0xd9, 0x88, 0xdd, 0xa6, 0x4e, 0x37, 0x8e, 0xc5, 0x54, 0xd2, 0x0b, + 0x38, 0x34, 0x32, 0x89, 0xec, 0xb0, 0x60, 0x8d, 0x1f, 0xed, 0x6c, 0x77, + 0x87, 0xa2, 0xd2, 0x3c, 0xbb, 0x2a, 0x5d, 0xe3, 0x77, 0x1f, 0xb7, 0xec, + 0xdf, 0xac, 0x2e, 0x63, 0xde, 0x94, 0x23, 0x33, 0xa9, 0xc1, 0xa6, 0x70, + 0xa6, 0xdb, 0x71, 0xdc, 0x6f, 0xd7, 0xf8, 0xdd, 0x34, 0xd8, 0x14, 0x69, + 0xd7, 0xf0, 0xe4, 0xb4, 0x49, 0x45, 0x91, 0xd1, 0x85, 0x60, 0xf3, 0x2a, + 0x6f, 0xd1, 0x34, 0x53, 0x12, 0xc8, 0x47, 0x47, 0xc2, 0xb8, 0x9c, 0x36, + 0x2c, 0x16, 0x65, 0xfa, 0xb7, 0xb5, 0x0d, 0x2e, 0xb1, 0x2d, 0x30, 0xce, + 0x2a, 0x97, 0x1d, 0xaf, 0xed, 0xa8, 0xf3, 0x2b, 0x5d, 0x36, 0xee, 0x78, + 0xb7, 0x78, 0xcb, 0xbd, 0xbe, 0x2d, 0x20, 0x2d, 0x76, 0x5a, 0x91, 0x80, + 0x1a, 0x8b, 0xc2, 0xd2, 0x0a, 0x2b, 0x2f, 0xf6, 0x8f, 0xb3, 0xc6, 0xf7, + 0x71, 0x8f, 0xa6, 0xaa, 0x26, 0xea, 0xe6, 0x3a, 0x49, 0xa6, 0xb2, 0x44, + 0x26, 0x8b, 0x9f, 0x05, 0x94, 0x04, 0x32, 0x1a, 0x8e, 0xe1, 0x30, 0x9b, + 0x30, 0x4e, 0x81, 0xac, 0xf1, 0xb9, 0xc4, 0xda, 0x9d, 0x5d, 0xe4, 0x74, + 0xc1, 0xd6, 0x73, 0xfd, 0xfc, 0xa2, 0x69, 0x2e, 0x5e, 0x9b, 0x8a, 0x4b, + 0x35, 0x95, 0x62, 0x0e, 0x80, 0x3a, 0x9b, 0x42, 0xb3, 0xd3, 0xca, 0xcd, + 0xcd, 0x35, 0xfc, 0xe5, 0x9b, 0x0b, 0xc8, 0xe4, 0x05, 0x97, 0xef, 0xe8, + 0x9a, 0x86, 0x51, 0x4c, 0x46, 0x6a, 0xaa, 0xca, 0xc8, 0x4d, 0xed, 0x14, + 0x67, 0x05, 0xa4, 0xb7, 0x3f, 0x8c, 0xd7, 0xed, 0xa0, 0xbc, 0xc2, 0xc6, + 0xe5, 0x3e, 0x97, 0xb8, 0x7c, 0x47, 0x17, 0x76, 0xd9, 0xc8, 0x53, 0xe7, + 0x36, 0xf2, 0x58, 0x57, 0x48, 0xfa, 0xc9, 0xfc, 0x4a, 0xae, 0x5d, 0x50, + 0x85, 0x53, 0x31, 0x96, 0x0c, 0x62, 0x97, 0x8d, 0x5c, 0xed, 0x77, 0xf3, + 0xe3, 0x79, 0x95, 0x3c, 0xd6, 0x15, 0x92, 0x9e, 0x3a, 0xb7, 0x11, 0xbb, + 0x6c, 0x64, 0xed, 0xeb, 0x87, 0x59, 0xe3, 0x29, 0x17, 0x37, 0xb7, 0x05, + 0xa4, 0x9a, 0x2a, 0x27, 0x99, 0xac, 0xc6, 0xc1, 0xae, 0xe0, 0x67, 0x07, + 0xb9, 0xaf, 0xb9, 0x46, 0xe8, 0xba, 0x8e, 0xc7, 0x53, 0xc1, 0x9d, 0xfb, + 0x8f, 0x48, 0xbf, 0xef, 0x1c, 0xc6, 0x6d, 0x53, 0xd9, 0x7a, 0x5e, 0x23, + 0xdb, 0x02, 0x47, 0xcf, 0x7d, 0x37, 0x1e, 0x1c, 0x94, 0xae, 0xf2, 0xbb, + 0x99, 0x6f, 0x37, 0x17, 0x33, 0x37, 0xad, 0x5a, 0xab, 0xc2, 0x5a, 0x9f, + 0x6b, 0xba, 0xfd, 0xdf, 0x16, 0x08, 0x4b, 0x5b, 0xcf, 0x6b, 0xa4, 0xca, + 0x62, 0xe2, 0x91, 0xfe, 0xa3, 0xe7, 0xbb, 0xee, 0x0a, 0x2b, 0xaa, 0x22, + 0x33, 0x38, 0x1c, 0x29, 0x6a, 0xaf, 0x68, 0xd6, 0xea, 0xe8, 0x1e, 0x22, + 0x96, 0x48, 0xd3, 0xbc, 0xa8, 0x8e, 0x7e, 0x60, 0xe3, 0xaa, 0x06, 0x2c, + 0x08, 0x1e, 0xe8, 0x18, 0x3a, 0x2e, 0x16, 0x36, 0x77, 0x14, 0x4e, 0xb9, + 0x27, 0xd3, 0x7d, 0xef, 0x9d, 0x58, 0x30, 0x5f, 0xe8, 0x0b, 0x4b, 0xdb, + 0x2f, 0x5c, 0x28, 0x52, 0x9a, 0xce, 0xc3, 0x5d, 0x21, 0x2c, 0x56, 0x95, + 0xf9, 0xde, 0x4a, 0x3a, 0xba, 0x82, 0x94, 0xad, 0x68, 0xfc, 0x6c, 0x20, + 0x7b, 0xdb, 0xfb, 0xd0, 0xf3, 0x82, 0x96, 0xa6, 0x5a, 0x5e, 0x09, 0x46, + 0x79, 0x78, 0xca, 0xe1, 0x8d, 0x8b, 0x3d, 0x22, 0xa7, 0xe5, 0x49, 0x65, + 0x72, 0x64, 0xb2, 0x1a, 0x06, 0x01, 0xc9, 0x54, 0x96, 0x6c, 0x5e, 0x47, + 0xc0, 0x8c, 0x45, 0x4c, 0x00, 0x26, 0x83, 0x84, 0xc5, 0xa2, 0x20, 0x49, + 0x12, 0xb2, 0x6c, 0x38, 0x7a, 0x28, 0xae, 0x98, 0xb8, 0xf3, 0x13, 0x13, + 0x54, 0x66, 0x37, 0xe3, 0xf7, 0xb9, 0xd9, 0xf5, 0xf6, 0x61, 0x76, 0xac, + 0xa8, 0x17, 0xb7, 0xee, 0x3f, 0xf9, 0xf6, 0xb9, 0x24, 0x90, 0x37, 0xf6, + 0x7e, 0x48, 0x6d, 0x8d, 0x93, 0x44, 0x2a, 0xcb, 0xaf, 0xbd, 0x4e, 0x91, + 0x88, 0xa7, 0xf9, 0xf0, 0x48, 0x98, 0x47, 0xff, 0xbc, 0x8b, 0xf1, 0x48, + 0x82, 0x23, 0xc1, 0x09, 0xa2, 0xb1, 0x34, 0xb2, 0x6c, 0xa0, 0x3f, 0x38, + 0x41, 0x26, 0x93, 0x2b, 0x66, 0x12, 0x38, 0x16, 0xcc, 0xe5, 0x48, 0x92, + 0x84, 0xaa, 0xca, 0xd4, 0x54, 0x95, 0x53, 0x59, 0x61, 0x67, 0x75, 0x73, + 0xad, 0xa8, 0xae, 0x74, 0x50, 0x55, 0x59, 0x46, 0x34, 0x9e, 0x66, 0x49, + 0x53, 0x2d, 0xaf, 0xec, 0xec, 0xe0, 0xed, 0xfd, 0x1f, 0xcd, 0xe8, 0xee, + 0x8c, 0x20, 0xbf, 0xac, 0xb6, 0x89, 0xab, 0x87, 0x23, 0x34, 0xf9, 0xab, + 0x79, 0xf2, 0xd9, 0x3d, 0x74, 0xf5, 0x84, 0xe8, 0x1b, 0x08, 0x63, 0x34, + 0x1a, 0xb0, 0x59, 0x15, 0xcc, 0xaa, 0x09, 0xab, 0x59, 0xc1, 0xef, 0x73, + 0x63, 0xb5, 0x28, 0x5c, 0x74, 0xce, 0x69, 0xd4, 0xce, 0x75, 0x16, 0xed, + 0x8f, 0x0c, 0x06, 0x89, 0x89, 0x48, 0x92, 0x9e, 0xc0, 0x18, 0xe9, 0x6c, + 0x8e, 0xd0, 0x68, 0x94, 0xee, 0xde, 0x11, 0x0e, 0x66, 0x83, 0xbc, 0xf4, + 0xcf, 0x76, 0xb2, 0xb9, 0x3c, 0xaa, 0x6a, 0xa2, 0x75, 0x89, 0x17, 0xbf, + 0xcf, 0x8d, 0xa6, 0xe9, 0xfc, 0xfd, 0xb5, 0x83, 0x70, 0xf1, 0x8a, 0x82, + 0x36, 0x0b, 0x7e, 0x1f, 0x79, 0xe4, 0x0c, 0x9f, 0xf8, 0xd5, 0x6f, 0x9e, + 0x67, 0xe7, 0xbf, 0xbb, 0x91, 0x65, 0x23, 0x56, 0xb3, 0x89, 0xf9, 0xde, + 0x4a, 0x4e, 0x5f, 0xd6, 0xc0, 0xaa, 0x25, 0x0d, 0x78, 0x6b, 0x2b, 0xd8, + 0x18, 0x98, 0x98, 0x95, 0x8f, 0x3c, 0xd3, 0x63, 0x9e, 0xee, 0x13, 0x87, + 0xba, 0x82, 0xb4, 0xbf, 0x3f, 0x40, 0x67, 0x4f, 0x88, 0x7d, 0xed, 0x01, + 0xc2, 0x13, 0x71, 0x72, 0xb9, 0x3c, 0x56, 0xab, 0xc2, 0xb6, 0xc7, 0xaf, + 0x2f, 0x38, 0x66, 0x41, 0x90, 0x4d, 0xcb, 0xeb, 0xc4, 0xda, 0xeb, 0x9f, + 0xc0, 0x60, 0x30, 0xf0, 0xa3, 0xef, 0xb7, 0xf2, 0xad, 0xf3, 0x9b, 0xd9, + 0xd0, 0x3d, 0x32, 0xab, 0x8e, 0x97, 0xa2, 0x35, 0xf9, 0x9c, 0xf8, 0xeb, + 0x4b, 0x6d, 0x74, 0xf6, 0x84, 0xf8, 0xc1, 0x77, 0x57, 0xd2, 0xd9, 0xe4, + 0xfd, 0x74, 0x20, 0x00, 0xd7, 0x97, 0x2b, 0x62, 0xe1, 0xfc, 0x6a, 0x66, + 0x0a, 0xb2, 0xcf, 0x4b, 0xd7, 0x95, 0x29, 0xe2, 0x8f, 0xd1, 0x6c, 0x41, + 0x3f, 0x66, 0x04, 0xf9, 0x22, 0xe9, 0xab, 0xb5, 0xd5, 0xfd, 0x22, 0xe8, + 0x6b, 0x90, 0x53, 0x4d, 0x5f, 0x1a, 0x90, 0xff, 0x00, 0x4b, 0xa4, 0x33, + 0x5c, 0x02, 0x9a, 0xcf, 0x26, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, + 0x44, 0xae, 0x42, 0x60, 0x82 +}; + + +/* + * Constructs a titleFactor as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +titleFactor::titleFactor( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QImage img; + img.loadFromData( img0_titlefactor, sizeof( img0_titlefactor ), "PNG" ); + image0 = img; + if ( !name ) + setName( "titleFactor" ); + setIcon( image0 ); + titleFactorLayout = new QGridLayout( this, 1, 1, 5, 6, "titleFactorLayout"); + + lbTitle = new QLabel( this, "lbTitle" ); + QFont lbTitle_font( lbTitle->font() ); + lbTitle_font.setBold( TRUE ); + lbTitle->setFont( lbTitle_font ); + + titleFactorLayout->addWidget( lbTitle, 0, 0 ); + + gbTitle = new QGroupBox( this, "gbTitle" ); + gbTitle->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, gbTitle->sizePolicy().hasHeightForWidth() ) ); + gbTitle->setAlignment( int( QGroupBox::AlignVCenter ) ); + gbTitle->setFlat( FALSE ); + gbTitle->setCheckable( TRUE ); + gbTitle->setChecked( FALSE ); + gbTitle->setColumnLayout(0, Qt::Vertical ); + gbTitle->layout()->setSpacing( 1 ); + gbTitle->layout()->setMargin( 6 ); + gbTitleLayout = new QGridLayout( gbTitle->layout() ); + gbTitleLayout->setAlignment( Qt::AlignTop ); + + tFactor = new QLabel( gbTitle, "tFactor" ); + + gbTitleLayout->addWidget( tFactor, 1, 1 ); + + slFactor = new QSlider( gbTitle, "slFactor" ); + slFactor->setMinValue( 100 ); + slFactor->setMaxValue( 250 ); + slFactor->setOrientation( QSlider::Horizontal ); + slFactor->setTickmarks( QSlider::Below ); + slFactor->setTickInterval( 10 ); + + gbTitleLayout->addWidget( slFactor, 1, 0 ); + + titleFactorLayout->addWidget( gbTitle, 1, 0 ); + spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + titleFactorLayout->addItem( spacer1, 2, 0 ); + languageChange(); + resize( QSize(551, 115).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( slFactor, SIGNAL( sliderPressed() ), this, SLOT( slFactorPressed() ) ); + connect( slFactor, SIGNAL( sliderReleased() ), this, SLOT( slFactorReleased() ) ); + connect( slFactor, SIGNAL( valueChanged(int) ), this, SLOT( slFactor_valueChanged(int) ) ); + connect( gbTitle, SIGNAL( toggled(bool) ), this, SLOT( ckAutoClicked(bool) ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +titleFactor::~titleFactor() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void titleFactor::languageChange() +{ + setCaption( tr2i18n( "Shrink Factors" ) ); + lbTitle->setText( tr2i18n( "Shrink Factor for Title %1" ) ); + gbTitle->setTitle( tr2i18n( "Change Factor" ) ); + tFactor->setText( tr2i18n( "0.00" ) ); +} + +void titleFactor::slFactor_valueChanged(int) +{ + qWarning( "titleFactor::slFactor_valueChanged(int): Not implemented yet" ); +} + +void titleFactor::slFactorPressed() +{ + qWarning( "titleFactor::slFactorPressed(): Not implemented yet" ); +} + +void titleFactor::slFactorReleased() +{ + qWarning( "titleFactor::slFactorReleased(): Not implemented yet" ); +} + +void titleFactor::ckAutoClicked(bool) +{ + qWarning( "titleFactor::ckAutoClicked(bool): Not implemented yet" ); +} + +#include "titlefactor.moc" diff --git a/src/titlefactor.ui b/src/titlefactor.ui new file mode 100644 index 0000000..4c0f145 --- /dev/null +++ b/src/titlefactor.ui @@ -0,0 +1,165 @@ + +titleFactor + + + titleFactor + + + + 0 + 0 + 551 + 115 + + + + Shrink Factors + + + image0 + + + + unnamed + + + 5 + + + + lbTitle + + + + 1 + + + + Shrink Factor for Title %1 + + + + + gbTitle + + + + 5 + 0 + 0 + 0 + + + + Change Factor + + + AlignVCenter + + + false + + + true + + + false + + + + unnamed + + + 6 + + + 1 + + + + tFactor + + + 0.00 + + + + + slFactor + + + 100 + + + 250 + + + Horizontal + + + Below + + + 10 + + + + + + + spacer1 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + + + 89504e470d0a1a0a0000000d49484452000000320000003208060000001e3f88b1000009f8494441546881ed996b6c5be519c77fc73e3ec7d7c4a9e3a47112c7add39226bd3730ae030a129b366dd0c22e6cc024187c181aac508600a16edc2aca2a9046056c42658369080a13131263ac2d2d74d006dad006929484384d9c388913c7f7cbf179f7a169a06b1d9b11b172f97f3b3ec7cffbfcdef73c97f73dd28d6ff5f26590e1ffedc06ce96b90534d5f839c6a9a11e406a72aee69aa169f973333e987067d463f0a826c5a5e276e7fe06facb9e1091ada7bc44dd5f6cf1d68f32aaf583d31298efce11fe2ce075fa2a9b3bfa00f72a11b8a22b3acb98e97b71fe44fcfbdc5f32fbf4b99dd22562df5d2dc3897158beb71cfb1736f6f589a2da77b02a30c85a2747407d9d71ee0e287c6998c25d1341dbb4de5d24b96b1313071d2ff4b3315c4bbe6bbc4a53f7f9c152df5f8ea5d7c7078880f0ef41197245445465565ccaa09b36a62c1bc2acaec66b2590d4f7539deda39188dc72fb8c12031369ea0b77f8c9c960720381c617038424ed3892733e4b21a522687c7e766794b3de50e334fbfb0972bbeb392b1b39b0b4e5ac11501b8b7372c35f9abc591e004375fbb9a6bd67e83a82c33d13b4c706882ee8171c2e37122d114c1de61fa351d6155d9df31c048388aa6e927d874d8cd78aacbd16329b4bc8ed5e560e5122faa22735abd8b3a4f05ae45f538b339ccaaccabbb3b916503179ddbc4b3279a2b0d04a07569038f3fbd9b5c36c7bdbd89a91991c03d87fb2f68119a9647d374928a4c362f302552689a4e3a9323af0b3e398502504c46ac1685acd58c41023595c1665130481256878575fbfa247a4601b8bfa5461cec1cc46a51685deae5d90303ff3bc8cac55e0c4689de8f46608e93f15c5ef425b23c7d8e9f3b3a82d37e6e5cd5201483c4baee50093193e277a757889c2eb8bdebe3e7d72ff688772329e1b329cc3119a5c864928eae219637d7b3fec0c08c768bd691968535386c660ebc17e0a1d60671514d397b8627b96c4717eb5a3c02e0be955ef1cc4763bc37912cce30a5c3d1142ff687b967855700ac6bf188ef6def62cff024e757970190c9e4383234ced245b545ed1505b9f3fd21c96030d03b1c211a4b71a5cfc596b3fcb48f27b8747b271b96d78b5706233cd91d6222ab950c124ae5d8d215e2d560840dcbebc5a5db3b691f4fb0e52c3f57cdaf0460643c8ea6e978aacb3f3b08c092260f917886542cc5fab680746da39b47cf9c475734cd757b7a78f0d020ef84134c7e0a90989667df689c7bda07b8725737ddd1345bcef2736da39bdbda02d2c3ad0d6278348aaac834fadcb303e2b09b4924b3e4a7cad12dfbfaa40f2229e9b6c51e5e0b4ef24e38812604ed134936b536142d9c0f9fe1131f44526842702892e4f5508cf58b3dbc3f91906ed9d727016473798646a2984c46dc15f6d901396d7e35e14882742203c08d8b6a84dd6414db0261e253f50060d77094be78a6a8bd8144963da3f1e9eb4c5e675b208cdd6414372eaa1170343e068623582d0a4ea7757640dc2e3b5a2c45d26e0660349d2393d771c846acf2c726de1e8bd31b4b17b5d7194db1636872fada2a1b70c84632799dd14c8e47cef0092104d9a95775dd3bfd453361d1f40b904ee700304f5db7382d2c70d43296c9d19fc872389a66f74894e7fbc23c1708f350ab4f6c3870e4a4836f585e2f6e6deb23aee5b9dce7e2bcaa32169499f1da142a55138a51e2a6bd7dd2dd8d952295ce51515e7c354a06f137b8911d16fa3a07d97c618b38d90c6d6ef5892b1a5ce84290d50b97e0acae7389c7c9b76b2b38cbede0c14383d2e168ea84e7d2198dd058145f9d8bec6c8154bb1d282623c3e138f9fcc99d7cf0d0e034dc9a0657c18077a926de1c894900bb43d18263e6f33a998c76b40b28c1c7926244d3748410c8b201492a5eb88f659e4f7befbf254912faccdb90697d3576885f247d0d72aaa9249063f12d4e89638893aba4f4ab4da55c93c988c15038e9fcd4ef16b15c9e6515567edb7ef2fdc3ddcbea44fb441287c9c8d33da333663021c409dbe5422a09642814259dc951ebb21fd72edcbbc22b0692193a2753b44f24b9eecd1e5a2b6d2c5c5e5fd0562aaff34cef286d63092e6b9823965558692ab7506755b96bffc7b68d4603aa2a331e49504abe2e092434164524b354d6574228cecf1aabc4bf862659d7d647f7648a3da3318ea5fbdb97d4b2e950b0e0d89b0e05a54b3c4eb1f5c3510e4592182438dbed6061b985a672ab583db78cad1f8e486655a6b2c24e6fff18fed90239a6ccd432f7c4d2ec0a45690bc709a572d3f757b96c2ca9b0f2d6686c463b2b5c762e985bc6cee128ba803746621c8ea5194d6bf8ec2a0026d988dda64e378ec554d20b38343289ecb0608d1fed6c7787a2d23cbb2a5de3771fb7ecdfac2e63de942333a9c1a670a6db71dc6fd7f8dd34d81469d7f0e4b4494591d18560f32a6fd1345312c84747c2b89c362c1665fab7b50d2eb12d30ce2a971dafeda8f32b5d36ee78b778cbbdbe2d202d765a91801a8bc2d20a2b2ff68fb3c6f7718fa6aa26eae63a49a6b244268b9f059404321a8ee1309b304e81acf1b9c4da9d5de474c1d673fdfca2692e5e9b8a4b3595620e803a9b42b3d3cacdcd35fce59b0bc8e40597efe89a86514c466aaacac84ded146705a4b73f8cd7eda0bcc2c6e53e97b87c471776d9c853e736f2585748fac9fc4aae5d50855331960c62978d5ced77f3e379953cd615929e3ab711bb6c64edeb8759e3291737b705a49a2a2799acc6c1aee06707b9afb946e8ba8ec753c19dfb8f48bfef1cc66d53d97a5e23db0247cf7d371e1c94aef2bb996f37173337ad5aabc25a9f6bbafddf16084b5bcf6ba4ca62e291fea3e7bbee0a2baa2233381c296aaf68d6eae81e229648d3bca88e7e60e3aa062c081ee8183a2e163677144eb927d37def9d58305fe80b4bdb2f5c28529acec35d212c5695f9de4a3aba8294ad68fc6c207bdbfbd0f38296a65a5e09467978cae18d8b3d22a7e549657264b21a0601c954966c5e47c08c454c00268384c5a2204912b26c387a28ae98b8f31313546637e3f7b9d9f5f66176aca817b7ee3ff9f6b9249037f67e486d8d93442acbafbd4e9188a7f9f0489847ffbc8bf1488223c109a2b134b26ca03f384126932b66123816cce5489284aacad45495535961677573ada8ae7450555946349e6649532dafecece0edfd1fcde8ee8c20bfacb689ab872334f9ab79f2d93d74f584e81b0863341ab05915ccaa09ab59c1ef7363b5285c74ce69d4ce7516ed8f0c06898948929ec018e96c8ed06894eede110e6683bcf4cf76b2b93caa6aa2758917bfcf8da6e9fcfdb58370f18a82360b7e1f79e40c9ff8d56f9e67e7bfbb91652356b389f9de4a4e5fd6c0aa250d786b2bd8189898958f3cd3639eee1387ba82b4bf3f40674f887ded01c2137172b93c56abc2b6c7af2f386641904dcbebc4daeb9fc06030f0a3efb7f2adf39bd9d03d32ab8e97a235f99cf8eb4b6d74f684f8c17757d2d9e4fd742000d7972b62e1fc6a660ab2cf4bd79529e28fd16c413f6604f922e9abb5d5fd22e86b90534d5f1a90ff004ba4335c029acf260000000049454e44ae426082 + + + + + slFactor + sliderPressed() + titleFactor + slFactorPressed() + + + slFactor + sliderReleased() + titleFactor + slFactorReleased() + + + slFactor + valueChanged(int) + titleFactor + slFactor_valueChanged(int) + + + gbTitle + toggled(bool) + titleFactor + ckAutoClicked(bool) + + + + slFactor_valueChanged( int ) + slFactorPressed() + slFactorReleased() + ckAutoClicked(bool) + + + diff --git a/src/viewmpeg2.cpp b/src/viewmpeg2.cpp new file mode 100644 index 0000000..66a966a --- /dev/null +++ b/src/viewmpeg2.cpp @@ -0,0 +1,229 @@ +#include +/**************************************************************************** +** Form implementation generated from reading ui file './viewmpeg2.ui' +** +** Created: dim. oct. 26 08:57:36 2008 +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ + +#include "viewmpeg2.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const unsigned char img0_viewmpeg2[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0x61, 0x00, 0x00, 0x02, + 0xe7, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0x5d, 0x93, 0xb9, 0x6f, 0x5c, + 0x55, 0x14, 0xc6, 0x7f, 0xe7, 0xde, 0xfb, 0xb6, 0xd9, 0xbc, 0x66, 0xe2, + 0x19, 0xdb, 0x63, 0x27, 0x40, 0x6c, 0x30, 0x91, 0x85, 0xe4, 0x88, 0x86, + 0x06, 0xd2, 0x01, 0x2d, 0x2d, 0x12, 0x1d, 0x2d, 0xff, 0x4d, 0x94, 0x92, + 0x86, 0x86, 0x16, 0x29, 0x91, 0xc2, 0x92, 0x20, 0xb0, 0x82, 0x10, 0x12, + 0x04, 0x90, 0x92, 0x60, 0x05, 0x2f, 0x44, 0xce, 0x38, 0xf6, 0x78, 0xe6, + 0x2d, 0xf3, 0xe6, 0x6d, 0x97, 0x22, 0x16, 0xc2, 0x39, 0xd2, 0x57, 0x7c, + 0xfa, 0x8e, 0xce, 0xa2, 0xef, 0x1c, 0xe1, 0xa5, 0xb0, 0xd6, 0x9e, 0xe3, + 0x22, 0xf2, 0x72, 0xca, 0x79, 0xfd, 0xc6, 0xcd, 0xcf, 0x2f, 0xcf, 0xcd, + 0xcd, 0x74, 0x7d, 0xd7, 0xa1, 0x59, 0xf7, 0xfd, 0x38, 0x4e, 0x5e, 0x0d, + 0xe3, 0x78, 0xde, 0xf7, 0xdc, 0x70, 0x7a, 0xaa, 0xf5, 0x78, 0x92, 0xdb, + 0xd1, 0x24, 0xcb, 0xcf, 0x57, 0x11, 0xa1, 0x28, 0x0a, 0x7b, 0x74, 0x74, + 0xfc, 0xcc, 0x2c, 0x2c, 0xb4, 0xbf, 0x68, 0x35, 0xeb, 0x6f, 0x9e, 0x8c, + 0x22, 0xbb, 0x7b, 0x70, 0xac, 0x5c, 0xd7, 0x73, 0x2d, 0x81, 0x0c, 0x27, + 0xf0, 0xf4, 0xe9, 0x69, 0xde, 0x99, 0x6d, 0x15, 0xbd, 0x6e, 0x07, 0xcb, + 0xff, 0x27, 0x13, 0xd2, 0x34, 0x45, 0x2b, 0xb5, 0x6b, 0xca, 0x4a, 0xad, + 0x46, 0xe3, 0xbc, 0x76, 0x7f, 0x2f, 0xe2, 0xab, 0x07, 0xcf, 0x18, 0x84, + 0x11, 0xd6, 0xbe, 0xe8, 0x52, 0x55, 0xd6, 0x7b, 0x65, 0xde, 0xf7, 0x3e, + 0x7d, 0x77, 0x9d, 0x46, 0x2d, 0xf8, 0x6f, 0x3d, 0x0b, 0xf8, 0x8e, 0xa6, + 0x42, 0xaf, 0x1a, 0xa5, 0x8d, 0xfd, 0x7d, 0xff, 0x98, 0x3f, 0x9f, 0xbb, + 0xac, 0x2c, 0x5f, 0x61, 0x3a, 0x1a, 0x72, 0x10, 0x8d, 0x18, 0x97, 0x15, + 0x22, 0xf0, 0xb7, 0x85, 0x9b, 0xdb, 0x3b, 0x0c, 0x27, 0x42, 0x85, 0x00, + 0x42, 0x09, 0xbc, 0xbf, 0xb1, 0xc0, 0xf5, 0xd5, 0x19, 0x6b, 0x1c, 0x63, + 0x18, 0x46, 0x19, 0xcf, 0xfb, 0x39, 0x8b, 0x17, 0x3d, 0x2e, 0x2f, 0xb5, + 0xf1, 0x13, 0x9f, 0x83, 0xca, 0xa2, 0x94, 0x80, 0xc0, 0x24, 0x19, 0x50, + 0x4c, 0xd7, 0xa8, 0xb4, 0x83, 0x28, 0xa1, 0x02, 0x6c, 0xab, 0x81, 0xd6, + 0x06, 0xa3, 0x8d, 0x83, 0xd2, 0x82, 0x9b, 0x27, 0x4c, 0x99, 0x29, 0x4e, + 0x8a, 0x98, 0x72, 0xbe, 0x46, 0xc7, 0xf3, 0x10, 0x11, 0xc4, 0x96, 0xf8, + 0xa3, 0x9c, 0xc5, 0xce, 0x12, 0x5a, 0x1b, 0x3c, 0xad, 0xc8, 0xac, 0x65, + 0x21, 0xb0, 0x68, 0x32, 0x8c, 0xd6, 0x86, 0xcd, 0x8d, 0x1e, 0x83, 0xc1, + 0x23, 0x62, 0x3d, 0x41, 0x7a, 0x5d, 0x7a, 0xad, 0x3a, 0x4a, 0x14, 0x4a, + 0x81, 0x1c, 0xee, 0xb3, 0xb5, 0xd6, 0x61, 0x71, 0xa5, 0x87, 0x2b, 0x30, + 0xeb, 0x08, 0x3b, 0xc3, 0x98, 0x7c, 0x34, 0x44, 0xe5, 0x06, 0xa3, 0xb5, + 0x26, 0x8e, 0x4a, 0x46, 0xe5, 0x98, 0x61, 0x18, 0xb2, 0x1e, 0x74, 0xa8, + 0xfb, 0x42, 0x9e, 0x8e, 0x39, 0x7c, 0xb4, 0x43, 0xfa, 0x60, 0x9b, 0xbf, + 0x2e, 0xad, 0x53, 0x4c, 0x32, 0x2e, 0x34, 0x0d, 0x95, 0x99, 0xe0, 0xf4, + 0xf7, 0xa8, 0xc2, 0x12, 0xbd, 0xb2, 0x85, 0x71, 0x8c, 0xc3, 0x8f, 0x3b, + 0x7d, 0x6e, 0xf5, 0x85, 0xc0, 0x71, 0xd8, 0xff, 0xfa, 0x17, 0x9a, 0x2e, + 0x8c, 0xf3, 0x0a, 0x13, 0x34, 0xf8, 0x70, 0xfd, 0x35, 0x7e, 0xbd, 0x77, + 0x87, 0xab, 0xed, 0x94, 0x77, 0xde, 0xd8, 0x20, 0x70, 0x1d, 0x26, 0xcb, + 0x1d, 0x0e, 0x06, 0x05, 0x93, 0x50, 0x63, 0xb4, 0xd1, 0xb8, 0xad, 0x16, + 0xfe, 0x85, 0x17, 0x0e, 0xf7, 0xad, 0xe5, 0x54, 0x09, 0x9d, 0x59, 0x9f, + 0x6b, 0xcb, 0x2d, 0x3e, 0xd8, 0x6a, 0xf3, 0xfa, 0x9c, 0xc3, 0xad, 0xdb, + 0xdf, 0xe3, 0xba, 0x70, 0xb4, 0xfa, 0x0f, 0x77, 0x4f, 0x7f, 0xe6, 0x22, + 0x6b, 0x7c, 0x3c, 0xf7, 0x19, 0xc6, 0x18, 0x07, 0x6b, 0xc1, 0x51, 0xc2, + 0xf2, 0xb4, 0xc7, 0x66, 0xd7, 0xe7, 0xed, 0x9e, 0xcf, 0x7a, 0x1b, 0x9a, + 0xfe, 0x98, 0xa8, 0xf8, 0x0d, 0x77, 0x33, 0xe1, 0xf0, 0xc9, 0x1e, 0x5f, + 0xde, 0x8e, 0x08, 0x37, 0x42, 0xee, 0xd4, 0xbf, 0xe5, 0xa3, 0xee, 0x02, + 0x8e, 0x71, 0x30, 0x4a, 0x19, 0xb9, 0xda, 0xf5, 0x58, 0x5c, 0x3e, 0xa1, + 0x3d, 0x73, 0x44, 0xa6, 0xfa, 0x3c, 0x9c, 0x1c, 0xf2, 0xcd, 0x6e, 0x9f, + 0xc3, 0xf4, 0x98, 0x93, 0x6c, 0xc4, 0x28, 0x4f, 0x88, 0x57, 0xc7, 0x4c, + 0x25, 0x03, 0xae, 0xf7, 0xdf, 0x63, 0xfa, 0xd2, 0x0c, 0x33, 0xcc, 0xa2, + 0xb4, 0x16, 0x93, 0x17, 0xe5, 0xe3, 0xad, 0x6e, 0xc7, 0x4f, 0x69, 0xd8, + 0xa4, 0x4c, 0xc9, 0xca, 0x92, 0x25, 0x63, 0xb9, 0xd6, 0x04, 0x69, 0x82, + 0x88, 0x42, 0xe4, 0xec, 0xa9, 0xae, 0xc0, 0xc3, 0xed, 0x3f, 0x08, 0xf6, + 0x02, 0xb3, 0x36, 0xf7, 0x56, 0x59, 0x94, 0xd5, 0x13, 0xf3, 0xd3, 0xfd, + 0x1f, 0x3e, 0xd1, 0xca, 0xac, 0x0c, 0x07, 0x83, 0x20, 0x0a, 0x47, 0x41, + 0x1c, 0x47, 0x7e, 0x9a, 0x26, 0x5e, 0x96, 0x65, 0x6e, 0x59, 0x96, 0x5a, + 0x44, 0xac, 0x31, 0xa6, 0xf0, 0x3c, 0x3f, 0xab, 0xd5, 0xea, 0xa9, 0x68, + 0x49, 0xef, 0xdd, 0xfd, 0x4e, 0x3c, 0x6f, 0xfe, 0xd8, 0x93, 0xa9, 0x03, + 0x01, 0x1a, 0x40, 0x0d, 0x68, 0x9e, 0xa1, 0x7e, 0xc6, 0x03, 0xc0, 0x39, + 0x3b, 0xfd, 0x0c, 0x48, 0x80, 0x18, 0x88, 0x80, 0xf0, 0x0c, 0xc9, 0xbf, + 0xa0, 0xee, 0x36, 0x30, 0xfa, 0x5e, 0x19, 0x66, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +static const unsigned char img1_viewmpeg2[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x00, + 0x47, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, 0xed, 0xd7, 0xb1, 0x0d, 0x00, + 0x20, 0x0c, 0x03, 0x41, 0x82, 0x98, 0xca, 0xfb, 0xcb, 0x6b, 0x91, 0x0d, + 0xa0, 0xa0, 0x30, 0xc5, 0xa7, 0x75, 0x24, 0x9f, 0xd2, 0xa5, 0x6c, 0x8f, + 0xe4, 0xcc, 0x68, 0x3b, 0x00, 0x00, 0x00, 0x7e, 0x00, 0xac, 0xdb, 0x82, + 0xa4, 0xfd, 0x52, 0x60, 0xbb, 0x4e, 0x79, 0xfc, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0xe2, 0x31, 0x01, 0x00, 0x20, 0x0d, 0x68, + 0xfa, 0xa1, 0x08, 0xe5, 0x16, 0xc9, 0x6b, 0xf3, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +static const unsigned char img2_viewmpeg2[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x00, + 0x79, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, 0xed, 0xd7, 0x41, 0x0a, 0xc0, + 0x20, 0x0c, 0x44, 0xd1, 0xa4, 0xf4, 0x54, 0x73, 0x7f, 0x72, 0x2d, 0xbb, + 0x12, 0xba, 0xd4, 0x64, 0x24, 0x94, 0x8e, 0x6b, 0xe1, 0xbf, 0x45, 0x22, + 0xe8, 0x11, 0x61, 0x9d, 0xe7, 0x6a, 0xad, 0x0b, 0x20, 0x80, 0x00, 0x9f, + 0x01, 0x00, 0x18, 0x00, 0x46, 0x1b, 0xe0, 0x0d, 0x69, 0x05, 0x4c, 0x04, + 0x13, 0x92, 0x9e, 0x01, 0x16, 0xa4, 0x3c, 0x84, 0x55, 0x08, 0x6d, 0x0b, + 0xb2, 0x10, 0xfa, 0x1a, 0xee, 0x42, 0x8e, 0xbd, 0x03, 0xab, 0x88, 0x63, + 0x80, 0x88, 0xf0, 0x95, 0x7b, 0x77, 0x57, 0x98, 0x0e, 0xd8, 0x0d, 0xd3, + 0x00, 0xd9, 0x70, 0x19, 0x50, 0x0d, 0xa7, 0x01, 0xac, 0xf0, 0x3c, 0x5b, + 0x5b, 0xc0, 0x8e, 0x9b, 0x99, 0xb9, 0xfe, 0x05, 0x02, 0x08, 0xf0, 0x7b, + 0xc0, 0x03, 0xaa, 0x86, 0x2c, 0xa8, 0x26, 0x27, 0x76, 0xfe, 0x00, 0x00, + 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + + +/* + * Constructs a ViewMPEG2 as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +ViewMPEG2::ViewMPEG2( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QImage img; + img.loadFromData( img0_viewmpeg2, sizeof( img0_viewmpeg2 ), "PNG" ); + image0 = img; + img.loadFromData( img1_viewmpeg2, sizeof( img1_viewmpeg2 ), "PNG" ); + image1 = img; + img.loadFromData( img2_viewmpeg2, sizeof( img2_viewmpeg2 ), "PNG" ); + image2 = img; + if ( !name ) + setName( "ViewMPEG2" ); + setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) ); + setSizeIncrement( QSize( 0, 0 ) ); + setBaseSize( QSize( 0, 0 ) ); + setIcon( image0 ); + ViewMPEG2Layout = new QGridLayout( this, 1, 1, 2, 6, "ViewMPEG2Layout"); + + frame7 = new QFrame( this, "frame7" ); + frame7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, frame7->sizePolicy().hasHeightForWidth() ) ); + frame7->setMaximumSize( QSize( 32767, 50 ) ); + frame7->setFrameShape( QFrame::StyledPanel ); + frame7->setFrameShadow( QFrame::Raised ); + frame7Layout = new QGridLayout( frame7, 1, 1, 11, 6, "frame7Layout"); + + bStop = new QToolButton( frame7, "bStop" ); + bStop->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)1, 0, 0, bStop->sizePolicy().hasHeightForWidth() ) ); + bStop->setIconSet( QIconSet( image1 ) ); + + frame7Layout->addWidget( bStop, 0, 0 ); + + bPlay = new QToolButton( frame7, "bPlay" ); + bPlay->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)1, 0, 0, bPlay->sizePolicy().hasHeightForWidth() ) ); + bPlay->setIconSet( QIconSet( image2 ) ); + + frame7Layout->addWidget( bPlay, 0, 1 ); + + slider = new QSlider( frame7, "slider" ); + slider->setOrientation( QSlider::Horizontal ); + + frame7Layout->addWidget( slider, 0, 2 ); + + ViewMPEG2Layout->addWidget( frame7, 1, 0 ); + + label = new QLabel( this, "label" ); + label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)2, (QSizePolicy::SizeType)2, 0, 0, label->sizePolicy().hasHeightForWidth() ) ); + + ViewMPEG2Layout->addWidget( label, 0, 0 ); + languageChange(); + resize( QSize(320, 320).expandedTo(minimumSizeHint()) ); + clearWState( WState_Polished ); + + // signals and slots connections + connect( bStop, SIGNAL( clicked() ), this, SLOT( bStopClick() ) ); + connect( bPlay, SIGNAL( clicked() ), this, SLOT( bPlayClick() ) ); + connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); + connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +ViewMPEG2::~ViewMPEG2() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void ViewMPEG2::languageChange() +{ + setCaption( tr2i18n( "k9Copy - Title Preview" ) ); + bStop->setText( QString::null ); + bPlay->setText( QString::null ); +} + +void ViewMPEG2::sliderReleased() +{ + qWarning( "ViewMPEG2::sliderReleased(): Not implemented yet" ); +} + +void ViewMPEG2::bStopClick() +{ + qWarning( "ViewMPEG2::bStopClick(): Not implemented yet" ); +} + +void ViewMPEG2::bPlayClick() +{ + qWarning( "ViewMPEG2::bPlayClick(): Not implemented yet" ); +} + +void ViewMPEG2::sliderPressed() +{ + qWarning( "ViewMPEG2::sliderPressed(): Not implemented yet" ); +} + +#include "viewmpeg2.moc" diff --git a/src/viewmpeg2.ui b/src/viewmpeg2.ui new file mode 100755 index 0000000..e327884 --- /dev/null +++ b/src/viewmpeg2.ui @@ -0,0 +1,183 @@ + +ViewMPEG2 + + + ViewMPEG2 + + + + 0 + 0 + 320 + 320 + + + + + 7 + 7 + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 0 + + + + k9Copy - Title Preview + + + image0 + + + + unnamed + + + 2 + + + + frame7 + + + + 5 + 0 + 0 + 0 + + + + + 32767 + 50 + + + + StyledPanel + + + Raised + + + + unnamed + + + + bStop + + + + 0 + 1 + 0 + 0 + + + + + + + image1 + + + + + bPlay + + + + 0 + 1 + 0 + 0 + + + + + + + image2 + + + + + slider + + + Horizontal + + + + + + + label + + + + 2 + 2 + 0 + 0 + + + + + + + + 89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff61000002e749444154388d5d93b96f5c5514c67fe7defbb6d9bc66e219db6327406c309185e4888606d2012d2d121d2dff4d94928686162991c29220b082101204909260052f44ce38f678e62df3e66d972216c239d2577cfa8ecea2ef1ce1a5b0d69ee322f272ca79fdc6cdcf2fcfcdcd747dd7a159f7fd384e5e0de378def7dc707aaaf57892dbd124cbcf5711a1280a7b7474fccc2c2cb4bf6835eb6f9e8c22bb7b70ac5cd7732d810c27f0f4e969de996d15bd6e07cbff2713d234452bb56bca4aad46e3bc767f2fe2ab07cf188411d6bee85255d67b65def73e7d779d462df86f3d0bf88ea642af1aa58dfd7dff983f9fbbac2c5f613a1a72108d18971522f0b7859bdb3b0c274285004209bcbfb1c0f5d5196b1c63184619cffb398b173d2e2fb5f1139f83caa29480c02419504cd7a8b48328a1026cab81d606a38d83d2829b274c99294e8a9872be46c7f31011c496f8a39cc5ce125a1b3cadc8ac6521b068328cd686cd8d1e83c123623d417a5d7aad3a4a144a811ceeb3b5d66171a5872b30eb083bc3987c3444e506a3b5268e4a46e5986118b21e74a8fb429e8e397cb443fa609bbf2ead534c322e340d9599e0f4f7a8c212bdb285718cc38f3b7d6ef585c071d8fffa179a2e8cf30a1334f870fd357ebd7787abed9477ded820701d26cb1d0e0605935063b4d1b8ad16fe85170ef7ade554099d599f6bcb2d3ed86af3fa9cc3addbdfe3ba70b4fa0f774f7fe6226b7c3cf719c618076bc151c2f2b4c766d7e7ed9ecf7a1b9afe98a8f80d7733e1f0c91e5fde8e083742eed4bfe5a3ee028e71304a19b9daf5585c3ea13d7344a6fa3c9c1cf2cd6e9fc3f498936cc4284f8857c74c2503aef7df63fad20c33cca2b4169317e5e3ad6ec74f69d8a44cc9ca922563b9d60469828842e4eca9aec0c3ed3f08f602b336f7565994d513f3d3fd1f3ed1caac0c0783200a47411c477e9a265e96656e59965a44ac31a6f03c3fabd5eaa96849efddfd4e3c6ffed893a903011a400d689ea17ec603c0393bfd0c4880188880f00cc9bfa0ee3630fa5e19660000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af400000047494441545885edd7b10d00200c03418298cafbcb6b910da0a030c5a775249fd2a56c8fe4cc683b0000007e00acdb82a4fd5260bb4e79fc020000000000000080e2310100200d68faa108e516c96bf30000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af400000079494441545885edd7410ac0200c44d1a4f454737f722dbb12bad46424948e6be1bf4522e811619de76aad0b2080009f01001800461be00d69054c0413929e0116a43c8455086d0bb210fa1aee428ebd03ab88638088f0957b7757980ed80dd300d97019500da701acf03c5b5bc08e9b99b9fe050208f07bc003aa862ca8262776fe0000000049454e44ae426082 + + + + + bStop + clicked() + ViewMPEG2 + bStopClick() + + + bPlay + clicked() + ViewMPEG2 + bPlayClick() + + + slider + sliderReleased() + ViewMPEG2 + sliderReleased() + + + slider + sliderPressed() + ViewMPEG2 + sliderPressed() + + + + sliderReleased() + bStopClick() + bPlayClick() + sliderPressed() + + + diff --git a/stamp-h.in b/stamp-h.in new file mode 100755 index 0000000..e69de29 diff --git a/subdirs b/subdirs new file mode 100644 index 0000000..5fdca8a --- /dev/null +++ b/subdirs @@ -0,0 +1,11 @@ +doc +dvdread +k9Mplayer +k9author +k9decmpeg +k9devices +k9vamps +libdvdnav +libk9copy +po +src