geexbox-1.0/0000755000175000017500000000000010446320524012015 5ustar aurelaurelgeexbox-1.0/AUTHORS0000644000175000017500000001215410446314256013075 0ustar aurelaurel ooooo oo o o oo o M" "Mo Mo oM" M Mo oM" M oM""Mo oM""Mo "Mo" Mo"""o oM""Mo "Mo" M """M MooooMM MooooMM oMMo M "M M M oMMo "o oM M o M o oM Mo M oM M M oM Mo "MoooM"M "MooM" "MooM" M" "M M"ooo" "MooM" M" "M | NOTE | ~~~~ Do NOT send bug reports, help and feature requests directly to the authors. | GEEXBOX TEAM (PROJECT LEADERS) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Aurelien Jacobs * author * main developer Benjamin Zores * co-developer * website | REGULAR CONTRIBUTORS | ~~~~~~~~~~~~~~~~~~~~ Amir Shalem * Hebrew subtitles support through fribidi library. * complete rewrite of installator and GRUB support. * libtheora support. * too many fixes to be listed. Andrew Calkin * digimatrix remote support. * native ide-cd driver instead of ide-scsi layer. * support for X-in-1 cards readers. Alexis Saettler * CPU frequency scaling support. * Debian's generator package and repository. * Askey remote support. * various website's XHTML/CSS/XSL enhancements. Mathieu Schroeter * support for SHOUTcast, Extended M3U and custom network streams. * many patches over generator. Guillaume LECERF * support for LCD displays. * various patches and bug fixes. | PATCHES | ~~~~~~~ Ville Skyttä * many cleaning and fixes Serge Gebhardt * added fbi for image viewing support. BWare * added wifi support. Serial Cleaner * setcd patch * hauppauge remote support. Hervé Urbain * logitech remote support. * realmagic remote support. Plom * leadtek remote support. Mathieu Velten * enhanced win32 generator. Kevin Foss * radio card support. Arne Graesser * sleeptimer Cédric Chaissac * support for Microsoft MCE USB remote. * support for StreamZap remote. Jean Flinois * support for ATI Remote Wonder II. Laurent Peltier * support for SHOUTcast, Extended M3U and custom network streams. | TRANSLATIONS | ~~~~~~~~~~~~ Kiril Jovchev * Bulgarian menu translation. Michele Schaeuble * German menu and README translations. Andrighetto Riccardo * Italian menu translation. barb3tta * Italian README translation. Yogi * Polish menu translation. Eva Mikulcikova * Czech and Slovak menu translations. ClycioC * brasilian portuguese menu translation. Nikolas Garofil * dutch menu translation. kim * Finnish and Swedish menu translations. Tommi Tauriainen and team Jynkky * Finnish menu and readme translations fixes. c0p0n * Spanish menu translation. Nicolas Forgeard * French README translation. Sass Tabakajev * Estonian menu translation Ebore Belosa * Czech menu and help translation. Excaliber * Hebrew menu and help translation. Strahinic Igor * Serbian menu and help translation. Lars Sunde * Norwegian menu and help translation. Vladimir * Czech README translation. Yhlee * Korean menu and help translation. Christos Themelis * Greek menu and help translation. MarkTsai * Simplified and Traditional Chinese menu and help translation. Denis Polevoi * Russian README translation. Siddique Vally-Adam * French and English documentation about how to setup a Win32 PXE server. Heiko Rutenbeck (bzrudi) * Complete deutsch website's translation. | DESIGNERS | ~~~~~~~~~ Mickaël Beugnier for the GeeXboX logo and bootlogo design (releases 0.90-1 to 0.98). Nicolas Staszak (NICO.S) for the bootsplash and user interface design. | THANKS | ~~~~~~ Special thanks to Dennis Roos and his company InTouch for offering us a webserver and full of bandwidth up to Dec. 2005. Special thanks to George Pratt and Stephen McCarron and their company Hosting365 for offering us a dedicated webserver and full of bandwidth since Dec. 2005. Thanks for all of the generous donators who have contributed to help us with GeeXboX development by giving us hardware or money. They are too many to be listed here but each of them will recognize himself. The whole free software community, and especially the whole MPlayer team. geexbox-1.0/README0000644000175000017500000010251110446314257012703 0ustar aurelaurel ooooo oo o o oo o M" "Mo Mo oM" M Mo oM" M oM""Mo oM""Mo "Mo" Mo"""o oM""Mo "Mo" M """M MooooMM MooooMM oMMo M "M M M oMMo "o oM M o M o oM Mo M oM M M oM Mo "MoooM"M "MooM" "MooM" M" "M M"ooo" "MooM" M" "M | ABOUT | ~~~~~ GeeXboX is a kind of "divx box" software. In fact, it is a stand-alone boot CD which allows you to watch movies or listen to music. It supports many formats, such as avi, mpeg, divx, ogm, rm, mp3, ogg, dvd, vcd and cdda. It also supports some IR remote controllers and TV-Out for some graphic cards. This archive contains the needed scripts to rebuild an iso image of GeeXboX. | REQUIREMENTS | ~~~~~~~~~~~~ To generate a GeeXboX iso, you will need either : - a GNU/Linux system with mkisofs and mkzftree. - a MAC OS X system with mkisofs and mkzftree. - a windows system. To install the GeeXboX, you will need : - a GNU/Linux system with syslinux. To build the GeeXboX, you will need some classic tools : - a working GNU/Linux system. - the gcc C compiler. - GNU make - the patch command. - the nasm assembler. - bzip2 and gzip. - mkfs.ext2 and mkfs.vfat - the wget download tool (not needed for the full GeeXboX package). - mkisofs and mkzftree to build the iso image. - mkzftree to compress files on the iso image. - cdrecord (to burn the iso image). And also 1.2 GB of hard disk free space. | PERSONALIZATION | ~~~~~~~~~~~~~~~ When the GeeXboX is installed on a hard drive or generated, it is quite easy to personalize it. You can add some proprietary codecs such a rv9 or wmv9, simply by adding them in the GEEXBOX/codecs directory. You can find those codecs in the package on http://www.geexbox.org/releases/extra-codecs-nonfree.tar.gz You can also modify many options. This can be done simply by editing some text files. * Language : You can easily select your preferred menu language by following the procedure below : - GNU/Linux users: Edit the generator.sh script before running it and change the line near the top: "MENU_LANG=en" to your preferred language. For example: if you're French, change it to "MENU_LANG=fr". - Microsoft Windows users: When started, generator.exe gives you a combo list that allows you to choose your preferred language. NB : This has no effect on DVD language (see the MPlayer section). For the list of available languages please see the "language" directory. If your language is not available, you can translate the menu in your own language. This simply involves the creation of language/menu_LANG.conf and language/help_LANG.txt, and adding LANG to language/lang.conf. * Firmware auto-loader : GeeXboX supports many free drivers but unfortunately some of them may require an additionnal proprietary firmware (non-free and so not included in GeeXboX ISO) to work properly. The firmware is a binary file that is uploaded to the device (PCI or USB) when the driver is loaded. For each driver, the firmware has to be a specific file with a pre-determined name. If you have reluctant hardware that require additionnal firmware (in most of the cases, it only concerns WiFi and DVB cards), you'll need to check on the Internet for your Linux driver page to see how to check the firmware file. Most of the time, you'll get a direct download link. Sometimes, you'll need to extract it from your Windows drivers archive that was shipped with your hardware. Once you get the firmware file, simply put it into the /firmwares directory. You can put in as many firmwares as you want, and GeeXboX will automatically find them and use them with the right drivers if needed. The only thing you then have to take care is to have the good firmwares file and to generate a new ISO. Please note that you can also use the GeeXboX ISO generator to automatically grab firmwares for you. You can select all of the extra binary firmware files you want the generator to add for you. Simply note that this feature will require you to have an Internet access when using the GeeXboX generator. * MPlayer : This is where you can do most of the configuration and tweaking. The options take place in the file packages/MPlayer/config/mplayer.conf. You may want to modify options such as OSD font size (subfont-text-scale). You can also add lots of options such as DVD default language (eg: alang=fr,en). The best place to find them is the MPlayer manpage for Linux users (man -l build/MPlayer-*/DOCS/mplayer.1). You should also have a look at the MPlayer documentation (in build/MPlayer-*/DOCS or at http://www.mplayerhq.hu/DOCS/). Another file you may modify is the packages/i18n-texts/config/menu.conf. You can remove items you don't need, or you can translate it in your own language for example. Then the last file you can look at is the packages/MPlayer/build which contains the selection of options which are built into MPlayer. * TV-Out : Enabling the TV-Out is achieved with the help of multiple small programs dedicated to different video card brands. Currently we use atitvout for ATI cards, s3switch for S3 cards and nvtv for nVidia cards (and possibly intel i810 and 3dfx cards). The configuration of those programs is done in packages/tvout/config/tvout. There you can choose the TV standard you want (pal, ntsc...) and you can also modify specific options for nvtv. # TV Output Standard (ntsc/pal/secam) TVOUT_STANDARD=pal Please note that you can also define the output aspect (say 4:3 or 16:9 display) in this file through the line : TVOUT_ASPECT="4:3" This parameter will be used both for TVOut and regular (CRT/TFT) display. You can also specify the desired height/width values and your display's horizontal and vertical frequencies in case you have unusual screen like WideScreens or videoprojector. This can be done, editing the /etc/mplayer/mplayer.conf file. Default parameters are shown below (please uncomment lines related to frequency if you want to use them) : screenw=800 screenh=600 #monitor-hfreq=31.5k-50k #monitor-vfreq=50-90 * Lirc : You can choose one of the supported remote controller by editing the file GEEXBOX/etc/remote. Also take care to chose the corresponding ir receiver in the same configuration file. If you want to modify the key binding of your remote controler, look at the file GEEXBOX/etc/lirc/lircrc_REMOTE. * Network : You can configure the network in the file GEEXBOX/etc/network. There you can chose the IP address used by the GeeXboX (default is to use DHCP and if it don't work, fall back to 192.168.0.54). You can also specify a login and a password which will be used to connect to windows shares (default will only connect to anonymous shares). You can also declare some NFS mounts in GEEXBOX/etc/nfs. * Wifi : By default, GeeXboX tries to autodetect your network settings. If you have both traditionnal NIC and WiFi cards, only the latest will be setup. You may have to modify the /etc/network file in order to fit your network's settings. In this one, 4 lines are related to wireless cards : * PHY_TYPE="auto" # Network physical type (auto|ethernet|wifi) * WIFI_MODE="managed" # Wifi working mode (managed|ad-hoc) * WIFI_WEP="" # Wifi WEP key * WIFI_ESSID="any" # Wifi SSID These lines let you configure most of the settings. You can let autodetection enable or even force the use of ethernet or WiFi adapters. In the same way, this let you choose between the managed and the ad-hoc mode and let you define your WEP key and SSID. * Gateway : GeeXboX supports access to the Internet. In the case you've got a connection to the Internet, you may share it with your multimedia box, using a router or a gateway. For this, simply define the gateway IP address in the /etc/network file. * GATEWAY="" # Gateway IP ("" for DHCP or no internet connection) * DNS server : If you want to access to the Internet, GeeXboX may require a DNS server IP address. If you're not using a DHCP server that will do this job, you'll have to specify it by hand in the /etc/network file. * DNS_SERVER="" # DNS Server IP ("" for DHCP or none) * TV configuration : GeeXboX supports TV inputs and tuners. The system hardly tries to autodetect the card and the tuner. You can force the settings and skip the autodetection try. Please modify the /etc/tvcard as described : #TV CARD/TUNER Model (AUTO for autodetection or look at the following urls) #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.bttv #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.tuner TV_CARD=AUTO TV_TUNER=AUTO TVIN_STANDARD=pal Please let the AUTO parameter whether you want to keep autodetection, or replace it by the number of your card and tuner types, according to the previous URL. Please be careful : in order to force the card and tuner types, you have to know the EXACT REFERENCES of your hardware. Once done, you should be able to use the TV inputs (Composite and S-VHS) of your TV card. In the same way, you can use the tuner to watch TV. For that, you will have to define the region you belongs to and the frequency of the TV channels you want to watch. Once again, simply edit the /etc/tvcard file : # TV Channels # Syntax : CHAN="Channel Frequency:Channel Title" # Example : # CHAN="26:France 2" # CHAN="K08:Canal +" # TV Channels List # Available : france, europe-east, europe-west, us-bcast, us-cable CHANLIST=france Please be careful when editing channels and simply use the same syntax as described above and TV channels should be present in the main menu. * Audio configuration : GeeXboX supports both analog and digital audio output through regular JACK connectors or RCA SPDIF one. By default, output is set to analog. You can change this, by editing the /etc/audio file : # Output using SPDIF (yes/no), otherwise ANALOG output SPDIF=no Remember that you will need to set your output to SPDIF if you want to connect your soundcard to an external amplifier for decoding AC3/DTS streams (using passthrough mode). * Video post-processing : Post-Processing is a software way to get a smoother and more accurate render of your videos. It however consumes a lot of CPU time to magnify pictures but, as a result, it looks far better. Using MPlayer internal filters, GeeXboX lets you make h/v deblocking, deringing and auto luminance to enhance your image. By default, post-processing is disabled to avoid lagging on small configurations. You can enable it simply by editing the /etc/mplayer/mplayer.conf file : # Set Post Processing (h deblock, v deblock, dering, auto luminance) # Consumes CPU power, disabled for low configs, uncomment to enable it. #vf=pp=hb:a/vb:a/dr:a/al:a * DXR3/Hollywood+ cards : Users with this kind of hardware decompression card does NOT even need to have a video board and sound card to use GeeXboX. On the drawbacks, only the tvout connector can be used with DXR3 cards (no CRT display). You may have to set the required image norm (PAL/NTSC) in the /etc/tvout file and the kind of audio output you want to use (Analog or SPDIF) in /etc/audio. * Radio configuration : If your TV-card has built-in FM radio tuner, GeeXboX can support playing the radio. You have to modify the GEEXBOX/etc/radio file to have "RADIO=yes" if you want to use the radio. There is no hardware auto- detection, so setting this to 'yes' without a TV-card-based FM radio will put unnecessary menu items on your GeeXboX screen. The GEEXBOX/etc/radio file also has the radio station definition. There are a number of examples in the file, which simply include the radio frequency and the name of the station. Please be careful when editing channels and simply use the same syntax as the examples and the radio stations should be present in the main menu under "LISTEN RADIO". Since the radio application itself is not part of MPlayer, there is separate access to the volume. Please note that the volume that is being increased or decreased is Master volume. Before switching back to TV or video viewing, or music playing, the volume should be re-adjusted. * UPnP File Sharing : UPnP stands for Universal Plug & Play and is a network protocol aiming at providing the autodiscovery of devices and services of your Home Network. The UPnP A/V (for Audio/Video) norms defines several profiles for devices to easily share multimedia files and lets them being played. The UPnP Media Server profiles represent all of the devices that are able to share files to devices implementing the UPnP Media Player or UPnP Media Renderer profiles. The GeeXboX embeds a UPnP Control Point software that is able to auto-discover all UPnP Media Servers from your Home network and it simply mounts their contents to a dedicated mount point (/mnt/UPnP). This way, you just have to share contents using a compliant UPnP Media Server software and they'll be automatically accessible from GeeXboX. For more info about UPnP and some media servers usage, please go to http://www.geexbox.org/wiki/index.php/Accessing_to_UPnP_Contents * Network streaming : GeeXboX now gives you the possibility to add some SHOUTcast Radio/TV official playlist as easily as personal playlists (local and remote). SHOUTcast activation is set in "GEEXBOX/etc/network" config file. As SHOUTcast TV sometimes may contain pornographic and subscription-only streams, you can define a "black list" and a "white list" to allow/deny any streams you choose (default keywords for "black list" are : "adult xxx porn ESS SWCTV SWPTV Subscription"). The black/white lists are case-insensitive. "GEEXBOX/etc/netstream" config file can be set to create local and remote playlists (some examples are located in this file). "Remote playlists" refer to "Extended M3U" files. For French users only : You can get "FreeboxTV" thanks to this file, using the following process : - uncomment EXTM3U ad hoc entry. - use a GeeXboX version that have to be compiled with "LIVE555 library" support (otherwise you won't be able to decode the stream). * DVB cards : GeeXboX has a support for various types of DVB cards (Terrestrial, Cable, ATSC and Satellite) either in PCI or USB. Please note that for now, only one DVB adapter is usable at a time. Some DVB devices (especially USB ones) may require an external proprietary firmware to be loaded in the mean time as the driver to be usable. You may have a look at the LinuxTV DVB Wiki (http://linuxtv.org/wiki/index.php/Main_Page) to see if you're card requires one or not and if so, which one it is. Some firmwares can be fetched directly from the LinuxTV website (http://linuxtv.org/download/firmware/), otherwise may be included in the Windows drivers archive. See the GeeXboX firmware loader documentation to see how to get them loaded for you. For each card, the list of channels is available through the MPlayer's open menu. Nevertheless, there's no way to auto-discover these channels. Thus, adding the list of DVB channels to GeeXboX can be done in several ways : - using an existing channel list : MPlayer needs to have a working channels.conf file to use DVB. This file can be generated through the utilities provided by the dvb-apps package. Simply use a Linux box that has a DVB card configured, download the linuxtv-dvb-apps tarball from http://www.linuxtv.org/download/dvb/ , compile it and create the config file using the "scan" executable, in "zap" format (which is the default as of dvb-apps 1.1.0). For example, for a DVB-S (Satellite) card using Astra-19.2E as the provider: wget http://www.linuxtv.org/download/dvb/linuxtv-dvb-apps-1.1.0.tar.bz2 tar jxvf linuxtv-dvb-apps-1.1.0.tar.bz2 cd linuxtv-dvb-apps-1.1.0/util/scan make ./scan -x 0 dvb-s/Astra-19.2E > channels.conf The "-x 0" flag is here to restrict the scan to Free To Air channels only. Please always do so, as MPlayer do not support encrypted DVB channels. According to your type of DVB card, choose either a file from the "dvb-s" "dvb-c", "dvb-t" or "atsc" directories and ask for a scan. Then, simply copy the channels.conf file you've just created to the /etc/mplayer directory in the GeeXboX generator tree, and rebuild away. - using an existing transponder list : the procedure is highly similar to the one defined just before but with no scan. This time, the scan will be done at GeeXboX boot but this way, you do no more require another Linux system to generate the channels.conf file. To do so, you simpy have to check at : http://linuxtv.org/cgi-bin/viewcvs.cgi/dvb-apps/util/scan/ According to your DVB card type (S/T/C/ATSC), check for the good directory and grab the transponder frequency list that fit your needs. Then simply rename the file to dvb.conf and copy it to /etc. Then, rebuild a new ISO using the generator. A bootup, if GeeXboX detects a valid transponder file in /etc/dvb.conf, it will be used to scan for DVB channels and will generate the /etc/mplayer/channels.conf file itself. WARNING : Scanning can be slow according to the number of devices to be scanned and will be done each time you boot GeeXboX if using it as a LiveCD. It is highly recommended that you do it once only, then copy the generated /etc/mplayer/channels.conf file somewhere else and rebuild an ISO using generator, following the first method or to install it on disk. - using installator : this is for sure the easiest solution but requires you to install GeeXboX to disk. During the installation process, if a valid DVB device is recognized by the system, the installator script will ask you if you want to scan for DVB channels. The installator contains the complete list of transponders frequencies. That way, you just have to select your DVB device type and the transponder file you want to use for GeeXboX to scan. The channels.conf file will then be automatically generated. * DVD Navigation Menus : GeeXboX allows 2 DVD playback mode: - Direct movie playback (default). - DVD Navigation Menu support (fairly experimental). The first one can be safely trusted for playing any kind of DVD. Once inserted, the disc is automatically detected and MPlayer tries to play the title it consider as the movie one. The major advantage is that all copyright, advertisement and menu parts are skipped to allow a direct playback. However, in some situations (like DVDs with enhanced menus or most of the series DVD, containing multiple titles to be played) this method is inaccurate and you'll not be able to watch your DVD correctly. The second one, while still experimental (but has really good chances to works fine) supports the regular DVD Navigation Menus and let you control your DVD the same way you'll do it using a regular commercial DVD player. You can use the GeeXboX options menu to switch between the DVD playback methods, according to the DVD disc you're trying to watch. You can also make use of the GeeXboX ISO generator to select the default DVD playback method you want. * Recording Capabilities : GeeXboX allows you to record the stream you're watching and even proceed with live pause (a.k.a. Time-Shifting). Unfortunately, this operation is CPU-time consuming (realtime encoding and playback of a stream) and so, you may require a fairly recent computer to be able to fully make use of this feature. The control menu comes with a recorder-dedicated sub-menu that allows you to monitor the recording status (on/off), check for the recorded files destination, but also start/stop the record process and select the encoding profile you want to use. The record process can also be started (or stopped) from the keyboard, using the "i" key, or from the remote controller. There's unfortunately a requirement to the use of recording capabilities : you need to be able to store the recorded files somewhere. This can be an internal/external hard drive or a remote NFS/Samba share. The only thing that matters is that the filesystem has to be Linux-writable (i.e. NTFS disk aren't supported). Be aware while recording that your disk will be remounted R/W to allow file storage. Once the record process has ended, GeeXboX should remount your disk as R/O for safety measure but this might not work. It is then highly recommended when making use of the recording capabilities that you perform a clean shutdown of the computer to avoid a potential filesystem or data corruption. We won't take any responsibility for data loss. The recorded files destination path has to be specified at installation or ISO generation in the /etc/recorder configuration file. Simply replace the following setting with your own one : SAVE_PATH="/tmp" The default behavior is to save to /tmp but as it's a RAMdisk, GeeXboX is smart enough to not proceed so. Considering that, there's no way GeeXboX will try to record or store files to your computer unless you'd explicitely specify a destination path. In the same way, you can also specify the default encoding profile to be used when recording. You can always change to another one at runtime through the recorder option menu. A few profiles are available (see the /etc/mplayer/mencoder.conf file for a complete list and details) and they all feature different level of quality or encoding speed. You might choose one over another, according to your CPU power. According to the input stream (low-resolution WebTV, regular analog TV, digital HDTV ...), one profile might fit better than another. Below is a short non-exhaustive list of available encoding profiles : - MPEG 1 - MPEG 2 - Video CD (PAL/NTSC) - Super Video CD (PAL/NTSC) - DVD Video (PAL/NTSC) - Stream Dump (can be safely used on DVB MPEG-TS streams for example to avoid a re-encoding process). The default encoding profile has to be specified in the /etc/recorder configuration file, as below : RECORD_PROFILE="mpeg1" Unless you know exactly what you're doing, it is highly recommended that you use the ISO generator to select the default profile. When watching a TV stream and starting the record process, GeeXboX image might freeze a few seconds (time for MEncoder to start recording) and will start playing back the currently recording file. If you're CPU is too slow, the playback will lag, waiting for the frames to be encoded. If this happens, you only have 2 solutions : - use a more powerful HTPC. - use a fastest (i.e. less quality) encoding profile. When stopping the recording process, GeeXboX will stop MEncoder and will reload the original input stream. | GENERATION | ~~~~~~~~~~ First have a look at the personalization section just above. Then basically you can generate the iso under Linux by launching ./generator.sh or under windows by launching generator.exe | INSTALLATION | ~~~~~~~~~~~~ First you need to create a FAT16/32 or EXT2/3 partition with at least 16 MB of free space. Then you can install the GeeXboX under Linux by launching ./installator.sh And then responding to all the questions. Be carefull during this step. Read twice each question and stop installing if you don't understand one of the question. But the easiest way to install GeeXboX is still to boot it from CD and type "install" at isolinux boot prompt. | PXE BOOT | ~~~~~~~~ Yes, the GeeXboX is able to boot from the network on a diskless station ! To achieve this you will need : - a DHCP server - a TFTP server - a NFS server - a PXE capable station :-) * Using a GNU/Linux system : ------------------------ First configure your dhcp server to send PXE boot info. Here is an example with isc dhcp : allow booting; allow bootp; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.128 192.168.0.192; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; next-server 192.168.0.1; filename "/tftpboot/GEEXBOX/boot/pxelinux.0"; } The next-server option is the address of the TFTP server. Then configure your TFTP server (such as atftpd) to server the /tftpboot directory and copy a full GEEXBOX tree in this directory. For example you can copy the content of a GeeXboX CD from a linux WITH THE CDROM TRANSPARENT DECOMPRESSION ENABLED !! (to verify this, look at the sbin/init file in the GeeXboX tree and verify that it do not contain garbage) If you've built the GeeXboX yourself from sources, you can also generate the GEEXBOX tree with make pxe. Then you should edit the file /tftpboot/GEEXBOX/boot/pxelinux.cfg/default to set nfsroot to the right NFS path to the GEEXBOX tree. Finaly set up your NFS to export the GEEXBOX tree with a /etc/exports containing something like this : /tftpboot/GEEXBOX (ro) and a /etc/hosts.allow containing something like : ALL: ALL That should do the trick. Boot your PXE station and see what happen. * Using a Microsoft Windows system : -------------------------------- In order to boot in PXE mode from a Windows host, you'll need the following software : * An TFTP and a DHCP Server (for example "tftpd32", available at http://tftpd32.jounin.net/) * An NFS Server (for example "Allegro NFS server", available at http://opensource.franz.com/nfs/) * A computer supporting PXE boot mode. Download and uncompress (No need to install) the tftpd32 folder somewhere on your disk. In this example, lets assume it is : C:\tftpd32 Copy the complete GEEXBOX tree in the same directory (C:\tftpd32\GEEXBOX) Start tftpd32 : - Choose the C:\tftpd32 folder for "current directory". - Choose the interface (network card) to be used in "server interface". In the example here it's 192.168.0.1 - Go in "setting" and make sure DHCP server is checked (enabled) - In the "DHCP server" tab, fill in all the box using the following example : (Please refer to some documentation about DHCP all around the net in order to understand) * IP starting pool : 192.168.0.10 * Size of pool : 10 * Boot file : ./GEEXBOX/boot/pxelinux.0 * WINS/DNS server : 192.168.0.254 * Default router : 192.168.0.254 * Mask : 255.255.255.0 * Domain name : mydomain.net - Click "save" to apply modifications. First part is done, you can now boot the client computer (the one starting GeeXboX), and will see it loading until the logo appears. After a while it'll freeze because your NFS server is not set yet. Install "Allegro NFS server" and fill in the boxes following these settings : Exports tab : * Add a "new name" : and call it "/tftpboot/GEEXBOX" * In "path" just below : choose "C:\tftp32\GEEXBOX" folder * In "allowed host list" , choose "all" * "Read write", and "read only user list", choose "root" and "everyone" (if you want some log just check all in the last tab) Apply settings. Don't forget to modify the file : C:\tftp32\GEEXBOX\boot\pxelinux.cfg\default and change the IP address "192.168.0.2" to "192.168.0.1" (or the one you've previously setup). Just start the client computer and now GeeXboX should be running fine. | BUILDING | ~~~~~~~~ First have a look at the configuration section just under (at least the global part). Then basically you can build the iso with : make Or you can directly burn this iso with : make burn When done, you can save disk space by cleaning the build tree : make clean or by doing a full cleaning, even removing downloaded sources : make distclean There's also more advanced commands if you want to hack around the GeeXboX : scripts/get package # download the package scripts/unpack package # unpack and prepare the package scripts/build package # build the package scripts/install package # install the package with the $INSTALL prefix scripts/clean package # clean the package build tree scripts/clean --full package # clean both the package build and source trees make exec # launch directly the GeeXboX in a jail # WARNING: this is a highly experimental feature # use it at your own risks. If you've made a hacked version of the GeeXboX, you can easily build a small tar.bz2 for it with : make dist or a full tar (containing all sources) with : make fulldist or a geexbox generator with : make generator or a geexbox installator with : make installator or a pxe ready tree with : make pxe | CONFIGURATION | ~~~~~~~~~~~~~ * Global options : This is the first thing you should take care of before trying to build the GeeXboX. It stands in the file config/options, and it should be self explanatory. * Linux : This is a classical Linux configuration (packages/linux/linux.conf). You can edit them by hand, or you can also do a scripts/unpack linux and then a make menuconfig -C build/linux-* (or use the method you prefer instead of menuconfig). Then you should backup your build/linux-*/.config into packages/linux/linux.conf. * Lirc : Lirc allows you to control the GeeXboX using a remote controller. First you have to choose the file describing your specific remote in build/lirc-*/remotes (after doing a scripts/unpack lirc) and add it in packages/lirc/install. Then you should choose your device (default is /dev/ttyS0 (COM1)) and the lirc driver and put them in a file called packages/lirc/config/lircd_$REMOTE. Then you can choose your key mapping in the file packages/lirc/config/lircrc_$REMOTE. For each mapping you have to select a button (pike their names in the remote definition file) and associate an action to it. The action is one of MPlayer's actions (you can find a list in the html file build/MPlayer-*/DOCS/documentation.html#commands). | HACKING | ~~~~~~~ The first thing you should look at is the initialization script. In fact there are two initialization scripts. The first one is in packages/initrd/scripts/linuxrc but you shouldn't need to modify it. The second one is in config/options and that's where you may put some customizations. There you can first choose which is the architecture (i386 or PPC) you want to build GeeXboX for. After that, you can perform finnest tuning by specifying a certain kind of sub arch (386, pentium, athlon) in order to optimize the distribution for your specific CPU and gets the best perfomances off. Then the next thing which may interest you is the creation of a new "package". A package is just a bunch of scripts which have to follow some rules. All the scripts have to take place in a directory named as the program you want to "package", itself in the packages directory. Here is a list of the scripts you may create : - url : just a list of urls where to get the program sources. - unpack : what to do after unpacking the sources. For example, you can modify some configuration files. This does not include applying patches. - need_build : called when the package as allready been built, in order to be sure that it don't need to be rebuilt. It should remove the file .stamps/"package name"/build if the package need to be rebuilt. - build : all the steps needed to build the program. - install : all the steps needed to install the program. The installation prefix should be $INSTALL. In addition, the package main directory may contain extra subdirs : - config : where all config files belong. These files may be used either by the build script to compile the package or by the install script to be put to the system's /etc directory. - scripts : this subdir may contain runtime initialization scripts related to the current package which should be installed by install script - patches : this subdir may contain patches to be applied to the sources of the package, at unpack time. - sources : if files are present here, they will be automatically copied into the package's build tree. - init.d : contains initialization scripts to be launched at runtime. You also have to remember that software which run on the GeeXboX have to be compiled with the uClibc gcc wrapper. Fortunately, the GeeXboX toolchain is smart enough to automatically build all added packages using the uClibc gcc wrapper itself. Do not forget to ask for your package's compilation and installation by explicitely asking for it in the scripts/gentree build script. Finally, the best way to make a package is to look how other packages are done. | LICENSE | ~~~~~~~ All the programs used by the GeeXboX are protected by their respective license. They all are free software and most of them are covered by the GNU General Public License. The GeeXboX itself, meaning all the scripts which are used in the building process, are covered by the GNU General Public License. geexbox-1.0/COPYING0000644000175000017500000004313310446314256013061 0ustar aurelaurel GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, 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 St, 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. geexbox-1.0/VERSION0000644000175000017500000000000310446320334013055 0ustar aurelaurel1.0geexbox-1.0/ChangeLog0000644000175000017500000004435010446320334013574 0ustar aurelaurel2006-06-22 Aurelien Jacobs * new public release (version 1.0) 2006-06-12 Guillaume LECERF * upgraded MPlayer to 1.0pre8. 2006-05-20 Benjamin Zores * upgraded MPlayer to CVS 2006-05-19. 2006-05-16 Andrew CALKIN * disable recorder by default, as it is still experimental. 2006-05-14 Guillaume LECERF * branch vesafb-tng as it doesn't work on some cards. 2006-05-13 Benjamin Zores * upgraded MPlayer to CVS 2006-05-11. 2006-05-02 Amir Shalem * integrate vesafb-tng. 2006-04-11 Guillaume LECERF * integrate lcd4linux. 2006-03-29 Aurelien Jacobs * updated busybox to 1.1.1. 2006-03-26 Benjamin Zores * added DVD Navigation Menu support. 2006-03-25 Amir Shalem * updated linux to 2.6.16 2006-03-24 Amir Shalem * upgraded uClibc to SVN 2006-03-24 2006-03-17 Benjamin Zores * preliminary support for encoder with Time-Shifting feature (still considered as _experimental_ at this stage). * support for FLAC audio files metadata. 2006-03-17 Aurelien Jacobs * upgraded MPlayer to CVS 2006-02-23. 2006-03-17 Amir Shalem * Updated GCC to v4.1.0 2006-03-04 Benjamin Zores * added new menu that displays stream A/V properties (Codec, Bitrate, Resolution, ID3 Tags ...). 2006-02-22 Laurent Peltier Mathieu Schroeter * support for SHOUTcast, Extended M3U and custom network streams. * generator patch for network streams support. 2006-02-20 Benjamin Zores * added optionnal (default is NO) support for mencoder (in a single binary, code shared with mplayer). 2006-02-12 Benjamin Zores * added strace (with DEVTOOLS=yes only) for debugging facility. 2006-02-10 Amir Shalem * Optional support for C++ in toolchain * Optional support for LIVE555 library (RTP/RSTP/SIP streaming) 2006-01-03 Aurelien Jacobs * updated linux to 2.6.15. 2005-12-10 Benjamin Zores * updated djmount to release 0.50 (files are now natively shared, i.e. no more playlist, and you can seek in remote streams). * added support for non-free binary firmwares at sources build. 2005-11-23 Benjamin Zores * added support for PcCard (32bits CardBus only, not 16bits PCMCIA). 2005-11-11 Aurelien Jacobs * new public release (version 0.98.7) 2005-11-01 Benjamin Zores * added support for UPnP A/V Media Server browsing. * added support for DVB (Sat, Cable, Ter) cards (PCI and USB). * removed buggy RT2570 USB driver. 2005-10-28 Amir Shalem * updated linux to 2.6.14. * added support for Prism54 WiFi chipsets. * added support for Intel IPW2100/IPW2200 WiFi chipsets. 2005-08-29 Aurelien Jacobs * updated linux to 2.6.13. 2005-08-24 Benjamin Zores * added support for RT2570 USB WiFi chipsets. * added udev external firmwares auto-loader. 2005-08-15 Aurelien Jacobs * new public release (version 0.98.6) 2005-07-18 Aurelien Jacobs * integrate udev and replace our hotplug script. 2005-07-13 Benjamin Zores * compress kernel, binaries and grub archives using LZMA algorithm. 2005-07-05 Alexis Saettler * added support for CPU frequency scaling on laptops. 2005-07-03 Benjamin Zores * added support for MusePack codec (.mpc files) 2005-06-20 Andrew Calkin * use native IDE CD drivers instead of IDE-SCSI layer. * support for X-in-1 cards readers. 2005-06-07 Amir Shalem * added FLTK version of the generator. 2005-06-05 Andrew Calkin * added support for digimatrix remote. 2005-04-26 Benjamin Zores * added channels scanner for analog TV cards. 2005-04-17 Benjamin Zores * updated MPlayer to 1.0pre7. * added HTTP server with CGI support for Web Management. 2005-04-15 Kevin Foss * added radio card support. 2005-04-12 Aurelien Jacobs * powerpc architecture support. 2005-04-10 Benjamin Zores * added support for CX88 TV card chipsets. 2005-03-03 Benjamin Zores * upgrade linux to 2.6.11. 2005-01-13 Aurelien Jacobs * updated uClibc to 0.9.27. 2004-12-29 Aurelien Jacobs * new public release (version 0.98.5) 2004-12-24 Aurelien Jacobs * updated MPlayer to 1.0pre6. 2004-11-25 Amir Shalem * support for cross-compiling GeeXboX under FreeBSD. 2004-11-24 Benjamin Zores * added new official theme (graphics by Nicolas Staszak). 2004-11-17 Benjamin Zores * added TVOut support for i810/i815 based cards. 2004-11-14 Amir Shalem * complete rewrite of installator and support for GRUB as a bootloader (standalone or multiboot). 2004-10-13 Benjamin Zores * switch BusyBox to final 1.00 release. 2004-10-10 Benjamin Zores * added drivers for RT2500 i802.11 b/g chipset. 2004-09-17 Aurelien Jacobs * added a full cross-compilation toolchain. 2004-09-10 Benjamin Zores * updated VESA framebuffer driver to the new vesafb-tng. 2004-09-10 Alexis Saettler * switch BootSplash to FBSplash. 2004-09-05 Alexis Saettler * added support for Askey remote. 2004-09-03 Benjamin Zores * updated ALSA lib and utils to 1.0.6 * updated Samba to 3.0.6 * removed acx100 wireless drivers (need non free firmware to work). 2004-09-03 Aurelien Jacobs * added module-init-tools package for 2.6 modules. * switch the 2.4 LPP patch to BootSplash. * updated uClibc to current CVS for Linux 2.6 support. 2004-08-18 Benjamin Zores * ported GeeXboX to linux 2.6.8.1 kernel. * linux image and initrd now in gzip format, nor bzip2. * removed alsa-driver package (now included in kernel). * removed at76c503 package (now included in kernel). * updated em8300 drivers to CVS snapshot for 2.6 compatibility. 2004-08-17 Samuel Suárez * added Avermedia remote/receiver support. 2004-08-14 Sass Tabakajev * added estonian translation. 2004-08-12 Aurelien Jacobs * new public release (version 0.98) 2004-08-04 Benjamin Zores * added chapter selector for DVD and Matroska files. 2004-07-31 Alexis Saettler * added geexbox-generator Debian package 2004-07-26 Aurelien Jacobs * updated to busybox 1.00-rc2. 2004-07-25 Aurelien Jacobs * updated to busybox 1.00-rc1. * added dts decoding support. 2004-07-22 Aurelien Jacobs * separated remote selection from ir receiver selection. 2004-07-20 Bernardo Santos * added Gradiente D-10 remote support. 2004-07-18 Benjamin Zores * added support for SPDIF output. 2004-07-15 Aurelien Jacobs * updated to MPlayer 1.0pre5. 2004-07-14 Benjamin Zores * updated to ALSA 1.0.5a. * updated to Samba 3.0.4. * updated to nvtv 0.4.7. 2004-07-10 Benjamin Zores * added support for USB and SideWinder joysticks. 2004-06-03 Benjamin Zores * added drivers for wireless TI ACX100 chipsets. 2004-06-01 Benjamin Zores * added drivers for wireless RT2400 chipsets. 2004-05-28 bufa * added LG remote support. 2004-05-12 Benjamin Zores * added telnet server. 2004-05-09 Aurelien Jacobs * added libirman. 2004-05-08 Aurelien Jacobs * updated to syslinux-2.09. * updated to lirc-0.4.0pre4. * now use lirc to manage Ati Remote Wonder. 2004-05-02 Benjamin Zores * added vidix driver for CLE266 (VIA Unichrome) 2004-04-29 Aurelien Jacobs * updated to MPlayer-1.0pre4. * updated to linux-2.4.26. * updated to ALSA 1.0.4. * updated to BusyBox 1.0pre10 2004-03-31 Serge Gebhardt * added fbi for image viewing support. 2004-03-16 Aurelien Jacobs * really working v4l2 for bt8x8 and saa7134. 2004-03-10 Aurelien Jacobs * updated nvtv to version 0.4.6. 2004-03-05 Aurelien Jacobs * added MPEG hardware decompression for DXR3. 2004-03-02 Benjamin Zores * added Serial ATA controllers support. 2004-02-24 Benjamin Zores * added 3COM/NetGear Gigabit ethernet cards support. * switched to V4L2 API with Connexant chipsets support. 2004-02-23 barb3tta * added italian README translation. 2004-02-20 Benjamin Zores * updated to linux-2.4.25. 2004-02-06 Matt Rinsch * added Packard Bell Fast media remote and receiver support. 2004-02-05 Aurelien Jacobs * added streaming support. 2004-02-04 Benjamin Zores * added BT8x8 cards support. 2004-01-25 BWare * added wifi support. 2004-01-23 Aurelien Jacobs * updated uClibc to 0.9.26. 2004-01-15 Aurelien Jacobs * added matroska support. 2004-01-14 Madarassy László * added hungarian translation. * patched s3switch to support virge gx2. 2004-01-07 Benjamin Zores * added DXR3/Hollywood+ cards support (TVOut only for now). 2003-12-17 Benjamin Zores * added new Xmas theme for 0.96 release 2003-12-16 Yogi * added polish translation. 2003-12-15 Michele Schaeuble * added german translation. 2003-12-14 Aurelien Jacobs * alsa updated ALSA to 1.0.0rc2. 2003-12-11 Aurelien Jacobs * updated to MPlayer 1.0pre3. * updated to busybox 1.00-pre4. 2003-12-11 rheve * added animax remote support. 2003-12-04 Aurelien Jacobs * updated to linux-2.4.23. * added PXE boot support. 2003-11-27 Aurelien Jacobs * added NFS support. 2003-11-23 Kiril Jovchev * added bulgarian translation. 2003-11-22 Benjamin Zores * added experimental DirectFB support. 2003-11-12 Cristi S * added romanian translation. 2003-10-19 Benjamin Zores * added new halloween theme for 0.95 release. 2003-10-16 Aurelien Jacobs * updated MPlayer to 1.0pre2. 2003-10-16 Guillaume Roche * added menu's files filter. 2003-09-28 Benjamin Zores * added the Win32 version of the generator. 2003-09-23 Aurelien Jacobs * added autoplay. 2003-09-15 laclasse * added creative PC-DVD remote support. 2003-09-15 freddy ARNAULX * added sony RM-S6 remote support. 2003-09-10 Benjamin Zores * replaced oftpd by bftpd. 2003-09-06 Aurelien Jacobs * updated to linux 2.4.22. * updated to uClibc 0.9.20. * updated to MPlayer 1.0pre1. 2003-09-02 Benjamin Zores * replace OSS sound drivers by ALSA ones. 2003-08-30 Aurelien Jacobs * added genext2fs to be able to build the GeeXboX without being root. 2003-08-29 Aurelien Jacobs * added XCD support. 2003-08-25 Benjamin Zores * upgraded Samba to 3.0rc1 with WinXP shares support. * set resolution to 800x600 to fix some TV-Out bug with DVD playback. 2003-08-24 ClycioC * added brasilian portuguese translation. 2003-08-23 Aurelien Jacobs * updated MPlayer to the CVS version. 2003-08-21 Nikolas Garofil * added dutch translation. 2003-08-21 Benjamin Zores * added ftp server. 2003-08-18 kim * added finnish translation. 2003-08-14 Benjamin Zores * added zlib library to read files with compressed headers. 2003-08-13 kim * added swedish translation. 2003-08-12 c0p0n * improved spanish translation. 2003-08-09 zarta * added spanish translation. 2003-08-02 Aurelien Jacobs * fixed a bug which prevented to play file whose name contain a quote. 2003-07-30 Aurelien Jacobs * installator is now available directly from the GeeXboX cd, by typing install at boot prompt. 2003-07-29 Aurelien Jacobs * updated busybox to 1.00-pre1. * added DHCP network auto-configuration. 2003-07-28 Eva Mikulcikova * added czech and slovak translation. 2003-07-28 Aurelien Jacobs * added lirc_serial module to support homemade receiver. 2003-07-22 Aurelien Jacobs * updated samba to 3.0.0beta3. * added autodetection of all the shares on the network. 2003-07-21 Benjamin Zores / Mickaël Bugnier * added new theme: movies. 2003-07-20 Benjamin Zores * added Samba Network Shares support. 2003-07-18 Aurelien Jacobs * merged rp9codecs and dmocodecs into extralite to use the new MPlayer upstream binary codecs package. 2003-07-17 Plom * added leadtek tv2000 remote support. 2003-07-15 Benjamin Zores * replace kernel modules support by build-in drivers. * added support for Ethernet network cards. 2003-07-15 Andrighetto Riccardo * added Italian langage support for menu and help files. 2003-07-13 Aurelien Jacobs * added the installator version. 2003-07-04 Benjamin Zores * replace SysLinux by IsoLinux to avoid floppy emulation. 2003-07-02 Aurelien Jacobs * disabled many unused video filters in MPlayer. 2003-06-29 Aurelien Jacobs * added runtime subtitle file selection. 2003-06-25 Aurelien Jacobs * new public release (version 0.90-3) 2003-06-24 Aurelien Jacobs * tested and improved ATI Remote Wonder support. 2003-06-22 Hervé Urbain * added support for Realmagic remote controller. 2003-06-22 Aurelien Jacobs * better playtree interface (Jump to menu). 2003-06-19 Aurelien Jacobs * added runtime DVD subtitle selection. 2003-06-18 Aurelien Jacobs * added rescan-scsi-bus to correctly handle firewire devices. 2003-06-18 Serial Cleaner * added hauppauge remote support. 2003-06-17 Aurelien Jacobs * added ATI Remote Wonder support (not tested at all). * added runtime audio channel selection. 2003-06-15 Aurelien Jacobs * MPlayer menu now respond to all commands. 2003-06-14 Aurelien Jacobs * updated linux up to version 2.4.21. 2003-06-12 Hervé Urbain * added support for Logitech remote controller. 2003-06-12 Benjamin Zores/Aurelien Jacobs * more classical font for subtitles. 2003-06-11 Aurelien Jacobs * allowed on the fly aspect change. 2003-06-10 Aurelien Jacobs * added patch to remove some encoding parts of libavcodec. 2003-06-09 Aurelien Jacobs * added the generator version (win32 generator still not usable). 2003-06-08 Benjamin Zores * added Windows Media 9 codecs support. 2003-06-07 Benjamin Zores * added patch to use cyberblade's cards under vidix when using OverScan TV-Out's mode on EPIA 800. 2003-06-06 Aurelien Jacobs * reverted to an older acpi patch. * added patch for displaying I420 streams under vidix with radeon cards 2003-06-04 Serial Cleaner * added setcd to reduce CD drives speed. 2003-06-03 Aurelien Jacobs * added patch for displaying I420 streams under vidix with mga cards. 2003-06-03 Benjamin Zores * added RealVideo RV 20/30/40 codecs support. * added RealAudio Sipro/Cook/ATRAC3 codecs support. * added patch for displaying I420 streams under VESA mode. * added patch for displaying I420 streams under vidix with mach64 cards * added locales for easy langage change. 2003-06-02 Aurelien Jacobs * integreted iscd for better CD drives detection. 2003-05-29 Aurelien Jacobs * changed the stop/eject/quit scheme. 2003-05-28 Aurelien Jacobs * new public release (version 0.90-2) 2003-05-27 Benjamin Zores * added S3 Savage chipset TV-Out support. 2003-05-25 Aurelien Jacobs * changed mountpoints naming. * added support for SCSI/USB/firewire disks (no hotplug). 2003-05-22 Aurelien Jacobs * added some patches to allow compilation with gcc 3.3. * added some adaptec scsi support. 2003-05-21 Aurelien Jacobs * added firewire support. 2003-05-20 Aurelien Jacobs * merged the normal and acpi versions. 2003-05-19 Aurelien Jacobs * switched to 2.4.21-rc2 kernel (to support EPIA M9000 soundcard). * added USB keyboard support. 2003-05-18 Aurelien Jacobs * modularized kernel. * patch for audigy soundcards * more soundcards support. 2003-05-16 Aurelien Jacobs * first public release (version 0.90-1) geexbox-1.0/Makefile0000644000175000017500000000065710446314256013472 0ustar aurelaureliso: scripts/iso burn: iso scripts/burn dist: scripts/dist fulldist: scripts/dist full generator: scripts/generator installator: scripts/installator pxe: scripts/pxe exec: iso scripts/exec sum: iso generator dist fulldist scripts/sum md5sum scripts/sum sha1sum clean: scripts/clean distclean: rm -rf .stamps build.* sources geexbox* .PHONY: iso burn dist fulldist generator installator exec clean distclean geexbox-1.0/DOCS/0000755000175000017500000000000010446314256012552 5ustar aurelaurelgeexbox-1.0/DOCS/MPlayer-patches.txt0000664000175000017500000000127110446314256016314 0ustar aurelaurelPatches for MPlayer should be made so that they can be: 1) Numbered into the following broad groups: 000-049 : uClibC and general compilation-related 050-099 : VESA, VIDIX, VO-related 100-149 : ALSA-related 150-199 : Miscellaneous changes (e.g. filter types etc) 200-249 : input-related 250-299 : bg_video/OSD-related 300-349 : DVD/VCD/CDDA-related 350-399 : subtitle-related 400-449 : encoder/recorder-related 500-649 : libmenu-related 650-699 : tv-related 700-749 : dvdnav-related 2) If possible, patches that are unrelated to the previous patch should have a numeric spacing of 5 (0,5,10...) so that new patches related to an existing patch can be inserted in the sequence later if needed. geexbox-1.0/DOCS/README_cz.txt0000644000175000017500000003541010446314256014747 0ustar aurelaurel ooooo oo o o oo o M" "Mo Mo oM" M Mo oM" M oM""Mo oM""Mo "Mo" Mo"""o oM""Mo "Mo" M """M MooooMM MooooMM oMMo M "M M M oMMo "o oM M o M o oM Mo M oM M M oM Mo "MoooM"M "MooM" "MooM" M" "M M"ooo" "MooM" M" "M | O produktu | ~~~~~ GeeXboX je druh "divx box" softwaru. Jedná se o bootovací CD umožòující sledování filmù nebo poslouchání hudby. Podporuje celou øadu formátù jako avi, mpeg, divx, ogm, rm, mp3, ogg, dvd, vcd , cdda. Obsahuje také podporu IR dálkových ovladaèù a TV výstup na urèitých typech grafických karet. Tato distribuce obsahuje nástroje potøebné k vytvoøení vlastního GeexboX iso souboru. GeeXboX is a kind of "divx box" software. In fact, it is a stand-alone boot CD which allows you to watch movies or listen to music. It supports many formats, such as avi, mpeg, divx, ogm, rm, mp3, ogg, dvd, vcd and cdda. It also supports some IR remote controllers and TV-Out for some graphic cards. This archive contain the needed scripts to rebuild an iso image of the GeeXboX. | Požadavky na systém | ~~~~~~~~~~~~ Pro vytvoøení GeeXboX iso souboru potøebujete jedno z následujících: - GNU/Linux systém s mkisofs a mkzftree. - MAC OS X systém s mkisofs a mkzftree. - MS Windows systém. K instalaci GeeXboX potøebujete: - GNU/Linux systém s syslinux. Pro vytvoøení GeeXboXu jsou zapotøebí následující standardní nástroje: - funkèní GNU/Linux systém. - gcc C compiler. - GNU make - patch command. - nasm assembler. - bzip2 a gzip. - mkfs.ext2 a mkfs.vfat - wget download tool (není zapotøebí pokud máte plnou verzi GeeXboX balíèku). - mkisofs a mkzftree pro vytvoøení iso souboru. - mkzftree pro komprimaci souborù v iso souboru. - cdrecord (pro vypálení iso souboru). A také pøibližnì 500 MB volného diskového prosoru. | Vlastní nastavení | ~~~~~~~~~~~~~~~ Pokud je GeeXboX nainstalován na pevný disk nebo generován je velice jednoduché vytvoøit osobní nastavení. Mùžete pøidat další kodeky jako napøíklad rv9 nebo wmv9 pouhým nakopírováním do adresáøe GEEXBOX/codecs. Tyto kodeky mùžete nalézt v balíècích na http://www.geexbox.org/releases/geexbox-extra-codecs-nonfree.tar.gz Dále upravit velké množství nastavení editací textových konfiguraèních souborù. * Jazyky: Mùžete zvolit preferovaný jazyk nabídky následujícími zpùsoby: - uživatelé GNU/Linux: Pøed spuštìním editujte øádek "MENU_LANG=en" skriptu generator.sh na váš preferovaný jazyk napø "MENU_LANG=cz" - Uživatelé Microsoft Windows : Pøi spuštìní generátoru vyberte v rozbalovací nabídce požadovaný jazyk. Poznámka : Toto nemá vliv na volbu jazyka v DVD (více v sekci o MPlayeru ). Pro seznam podporovaných jazykù nahlédnìte do adresáøe "language". Pokud není Váš jazyk v nabídce mùžete jej vytvoøit pøeložením již existujících souborù menu language/menu_LANG.conf a language/help_LANG.txt, a pøidáním LANG do language/lang.conf. * MPlayer : Zde mùžete provádìt nejvíce nastavení a customizací. Nastavení se provádìjí pomocí souboru packages/MPlayer/mplayer.conf. Pravdìpodobnì budete chtít zmìnit hodnoty jako napø. velikost OSD fontu. Mùžete pøidat další parametry jako napø. výchozí jazyk pro DVD (eg: alang=cz,en). Nejlepším místem pro získání parametrù je manuál MPlayeru. Uživatelé linuxu (man -l build/MPlayer-*/DOCS/mplayer.1). Mùžete také nahlédnout na dokumentaci ( build/MPlayer-*/DOCS nebo na http://mplayerhq.hu/DOCS/). Dalším souborem kde je dobré provádìt úpravy je packages/MPlayer/menu.conf. Mùžete odebrat volby, které nepotøebujete nebo jej pøeložit do vašeho jazyka. Posledním souborem doporuèeným k editaci je packages/MPlayer/build který obsahuje výbìr možností MPlayeru. * tv výstup : TV výstu je dosažen s pomocí drobných aplikací uršených pro dané typy grafických karet V souèasné dobì používáme atitvout pro karty ATI, s3switch pro karty S3 a nvtv pro karty nVidia (možná i karty intel i810 a karty 3dfx cards). Nastavení tìchto pomocných programù je provedeno v config/tvout. Tam mùžete nastavi Váš TV standard (pal, ntsc...) a nastavit specielní volby pro nvtv. Zde mùžete také definovat pomìr stran (napø. 4:3 nebo 16:9) toho docílíte parametrem: TVOUT_ASPECT="4:3" Tento parametr bude použit pro oba (TVOut i klasický (CRT/TFT)) výstupy. V pøípadì že máte nestandardní monitor (Wide screen nebo videoprojektor) ùžete nastavit požadovanou výšku/šíøku stejnì jako obnovovací frekvenci. Parametry nastavujeme v souboru /etc/mplayer/mplayer.conf . Výchozí hodnoty jsou uvedeny níže (odkomentujte øádky u frekvencí pokud je chcete použít) : screenw=800 screenh=600 #monitor-hfreq=31.5k-50k #monitor-vfreq=50-90 * Lirc : Mùžete vybrat jeden z podporovaných typù dálkových ovladaèù editací souboru GEEXBOX/etc/remote. Dbejte na sprývný výbìr pøijímacího zaøízení v tomtéž souboru Pokud chcete zbìnit pøiøazení tlaèítek Vašeho ovladaèe podívejte se do souboru GEEXBOX/etc/lirc/lircrc_REMOTE. * Sí : Nastavení sítì se provádí v souboru GEEXBOX/etc/network. Zde mùžete nastavit IP adresu pro GeeXboX (výchozí nastavení je použít DHCP a pohud proces selže, je nastavena adresa 192.168.0.54. Lze zde také nastavit uživatelské jméno a heslo pro pøístup ke sdíleným složkám systému windows (výchozí nastavení se pøipojí pouze k anonymním sdílením). Parametry pro NFS se nastavují v souboru GEEXBOX/etc/nfs. * wifi : GeeXboX se pokusí automaticky zjistit síové nastavení. Pokud máte v systému klasickou NIC a WiFi kartu pouze poslední v øadì bude nastavena. Pro pøesné nastavení vyhovující Vašemu prostøedí musíte upravit soubor /etc/network. Následující øádky se týkají konfigurace WiFi : * PHY_TYPE="auto" # Network physical type (auto|ethernet|wifi) * WIFI_MODE="managed" # Wifi working mode (managed|ad-hoc) * WIFI_WEP="" # Wifi WEP key * WIFI_ESSID="any" # Wifi SSID Toto by mìlo postaèovat pro nastavení. Mùžete zvolit autodetekci nebo dokonce zvolit používání pouze WiFi nebo ethernetu. Stejným zpùsobem lze vybrat typ WiFi módu mezi managed a ad-hocvèetnì nastavení WEP klíèe a SSID. * gateway : GeeXboX podporuje pøístup na sí internet. Pokud máte na síti dostupné internetové pøipojení mùžete ho sdílet pro GeeXBox použitím routeru nebo brány. Pro tuto možnost editujte IP adresu brány v souboru /etc/network file. * GATEWAY="" # IP adresa brány ("" pro DHCP nebo žádný pøístup na internet) * nastavení TV : GeeXboX umožòuje použití TV tunerù. Systém se snaží rozpoznat jaký televizní tuner máte. Mùžete pøeskoèit autodetekci vepsáním parametrù Vašeho tuneru v /etc/tvcard následujícím zpùsobem : #TV CARD/TUNER Model (AUTO pro autodetekci nebo zadejte hodnoty z následujících odkazù) #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.bttv #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.tuner TV_CARD=AUTO TV_TUNER=AUTO TVIN_STANDARD=pal Nechte parametr AUTO pokud si pøejete aby se systém pokusil rozpoznat Vaši kartu, nebo jej nahraïte èíslem Vaší karty v souladu z odkaz uvedenými výše. Pozor v pøípadì že nepoužijete parametr AUTO musíte znát pøesný typ Vaší karty!. Pokud máte nastaveno mìli by jste být schopni pøijímat TV signáls (Composite a S-VHS) na vaší TV kartì. Stejnì jako sledovat televizní vysílání. Pro nalazení programù muzíte zadat region a frekvenci kanálu, který chcete sledovat. To lze provést v souboru /etc/tvcard : # TV programy # Syntaxe : CHAN="Frekvence:Název programu" # Ukázka : # CHAN="29:France 2" # CHAN="K08:Canal +" # TV Channels List # Available : france, europe-east, europe-west, us-bcast, us-cable CHANLIST=france Jednotlivé programy by se mìli objevit v základní nabídce. * audio nastavení : GeeXboX podporuje analogový i digitální audio výstup pøes klasický JACK nebo RCA SPDIF. Výchozí výstup je nastavený analogový. Tuto hodnotu mùžete zmìnit editací souboru /etc/audio : # Output using SPDIF (yes/no), otherwise ANALOG output SPDIF=no Pamatujte, že musíte nastavit SPDIF pokud chcete zvukovou kartu pøipojit k externímu zesilovaèi pro dekódování AC3/DTS stop. * DXR3/Hollywood+ karty : Uživatelé s tímto druhem hardware ani nemusí mít video a zvukovou kartu k používání GeeXboXu. Ve reálu lze použít pouze TV out s tìmito kartami. Možná bude zapotøebí nastavit požadovanou normu (PAL/NTSC) v souboru /etc/tvout fstejnì jako audio výstup (Analog nebo SPDIF) v /etc/audio. | Generování | ~~~~~~~~~~ Nejprve si prosím pøeètìte sekci o nastavení viz výše. Potom jednoduše vygenerujte iso soubor v Linuxu spuštìním skriptu ./generator.sh nebo ve windows aplikací generator.exe | Instalace | ~~~~~~~~~~~~ K instalaci je zapotøebí vytvoøit diskový oddíl FAT16 s alespoò 16MB volného místa. Pak je možné nainstalovat GeeXboX pod linuxem spuštìním skriptu ./installator.sh S následným zodpovìzením všech nastavujících dotazù. Dbejte zvýšené opatrnosti v prùbìhu instalace, radìji pøerušte instalaci pokud si nejste jisti co dìláte. | PXE Bootování | ~~~~~~~~ GeeXboX je schopný bootovat ze sítì na bezdiskové stanici. K dosažení tohoto stavu budete potøebovat: - DHCP server - TFTP server - NFS server - PXE kompatibilní stanici :-) Nejprve je nutné nakonfigurovat Váš DHCP server pro zasílání PXE bootovacích informací Zde je ukázka s isc dhcp: allow booting; allow bootp; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.128 192.168.0.192; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; next-server 192.168.0.1; filename "/tftpboot/GEEXBOX/boot/pxelinux.0"; } Další nastavení je adresa TFTP serveru. Nakonfigurujte TFTP server na adresáø /tftpboot a nakopírujte všechny GeeXboX soubory do tohoto adresáøe. Napøíklad mùžete nakopírovat obsah GeeXboX CD z linuxu v módu TRANSPARENT DECOMPRESSION ! pro ovìøení nahlédnìte do souboru sbin/init a zkontrolujte že je struktura normální. Pokud jste vytvoøili GeeXboX ze zrdrojových souborù mùžete strukturu GeeXboXu vygenerovat pomocí If you've built the GeeXboX yourself from sources, you can also generate make pxe. Poté mùžete editovat soubor /tftpboot/GEEXBOX/boot/pxelinux.cfg/default pro nastavení nfsroot na správnou NFS cestu pro GEEXBOX strukturu. Nakonec nastavte NFS pro export GEEXBOX struktury v /etc/exports zhruba tímto zpùsobem : /tftpboot/GEEXBOX (ro) a /etc/hosts.allow asi takhle: ALL: ALL To by mìlo být vše nyní mùžete zkusit nabootovat a uvidíte co se stane. | Vytváøení ISO | ~~~~~~~~ Nejprve prosím proètìte èást o nastavení. Potom vytvoøte iso pomocí: make Nebo soubor rovnou vypalte : make burn Když jste hotovi mùžete GeeXboX stukturu smazat pro úsporu místa na disku: make clean Nebo smazat všechny soubory a zdroje: make distclean Existuje více nastavujících pøíkazù pokud se chcete v GeeXboXu troch vrtat: scripts/get package # stáhnout balíèek scripts/unpack package # rozbalit a pøipravit balíèek scripts/build package # vytvoøí balíèek scripts/install package # instalovat balíèek s $INSTALL prefix scripts/clean package # vymazat adresáøovou strukturu balíèku make exec # launch directly the GeeXboX in a jail # WARNING: this is a highly experimental feature # use it at your own risks. Pokud jste vytvoøili upravenou verzi GeeXboXu mùžete vytvoøit tar.bz2 pomocí : make dist nebo plný tar (se všemi zdrojovými soubory) pomocí : make fulldist nebo geexbox generátor pomocí : make generator nebo geexbox instalátor pomocí : make installator nebo pxe strukturu pomocí : make pxe | Konfigurace | ~~~~~~~~~~~~~ * Globální nastavení : Je nejdùležitìjším krokem pøed samotným vytváøením GeeXboXu. Je uloženo v souboru config/options, a jeho syntaxe je srozumitelná. Mùžete zvolit typ Vašeho procesoru, téma, a zda chcete používat True Type fonty nebo ne. Také mùžete upravit nastavení Vaší vypalovaèky aby bylo možné iso rovnou vypálit. * Linux : Tohle je klasické nastavení Linuxu (packages/linux/linux.conf). Lze je editovat ružnì nebo spustit skript scripts/unpack linux a poté make menuconfig -C build/linux-* (pøípadnì použít Vámi preferovanou metodu namísto menuconfig). Zazálohujte /linux-*/.config do packages/linux/linux.conf. * Lirc : Lirc umožòuje ovládání GeeXboXu pomocí dálkového ovladaèe. Nejprve se pokuste nalézt soubor s vaším typem ovladaèe v build/lirc-*/remotes (po provedení scripts/unpack lirc) a pøidejte jej do packages/lirc/install. Potom vyberte zaøízení (výchozí je /dev/ttyS0 (COM1)) a ovladaè lirc a uložte jej do souboru packages/lirc/lircd_$REMOTE. Poté zvolte nastavení tlaèítek v souboru packages/lirc/lircrc_$REMOTE. Pro každé pøiøazení tlaèítka musíte vybrat jeho jméno ze souboru a zasociovat ho k urèité akci. Tou mùže být nìkterá z akcí MPlayeru (ty naleznete v souboru build/MPlayer-*/DOCS/documentation.html#commands). | Úpravy | ~~~~~~~ Jako první je dobré podívat se na inicializaèní skript. Ve skuteènosti se jedná o skripty dva. První je v packages/initrd/linuxrc ale ten pravdìpodobnì nebudete chtít upravovat. Druhý je config/init a v nìm se dá upravit nìkolik možností nastavení. Další co by Vás mohlo zajímat je vytvoøení nového balíèku. To není nic jiného než spousta skriptù které sledují urèitá pravidla. Všechny skripty musejí být ve stejném adresáøi jako je program který chcete "pøibalit" Zde je seznam skriptù které mùžete vytvoøit : - url : seznam adres kde lze stáhnout zdrojové soubory programù. - unpack : co se provede po rozbalení zdrojù, ùžete napøíklad upravit konfiguraèní soubory, netýká se aplikací záplat. - need_build : použití pokud balíèek již byl sestaven, a pro ujištìní že nepotøebuje reebuilt. Dojde k odstranìní souboru .stamps/"package name"/build v pøípadì že rebuild není nutný. - build : všechny nezbytné kroky k vytvoøení programu. - install : všechny nezbytné kroky k instalaci programu. Zaèátek instalace by mìl být $INSTALL. Když je soubor z url adresy pojmenován záplata-program_name-...je automaticky záplata aplikována na rozbalené zdrojové soubory programu. Mìli by jste pamatovat že software na kterém GeeXboX bìží musí být zkompilován s uClibc gcc wrapper. Nakonec, nejlepší cesta k vytvoøení balíèku je podívat s edo již hotových. | Licenèní podmínky | ~~~~~~~ Všechny programy použité v GeeXboXu jsou chránìny jejich licencí. Všechny jsou volnì šiøitelné a vìtšina z nich podléhá GNU licencování. GeeXboX jako takový. myšleno skripty použité pro jeho vytvoøení spadají pod GNU. geexbox-1.0/DOCS/README_de.txt0000644000175000017500000003767410446314256014741 0ustar aurelaurel ooooo oo o o oo o M" "Mo Mo oM" M Mo oM" M oM""Mo oM""Mo "Mo" Mo"""o oM""Mo "Mo" M """M MooooMM MooooMM oMMo M "M M M oMMo "o oM M o M o oM Mo M oM M M oM Mo "MoooM"M "MooM" "MooM" M" "M M"ooo" "MooM" M" "M | ÜBER GEEXBOX | ~~~~~~~~~~~~ GeeXboX ist eine Art "Divx Out-Of-The-Box" Software. Genaugenommen ist es eine bootfähige CD, welche es erlaubt, Filme anzuschauen, Musik zu hören und Bilder zu betrachten. Es unterstützt viele Formate wie zum Beispiel avi, mpeg, divx, ogm, rm, mp3, ogg, dvd, vcd, jpg, bmp, cdda... GeeXboX unterstützt zudem einige Infrarot-Fernbedienungen und den TV-Ausgang einiger Grafikkarten. Dieses Archiv enthält die nötigen Scripte um ein eigenes ISO-Image von GeeXboX zu erstellen. | VORAUSSETZUNGEN | ~~~~~~~~~~~~~~~ Um ein GeeXboX ISO zu erstellen, wird eines der folgenden Systeme benötigt: - GNU/Linux mit mkisofs und mkzftree. - MAC OS X mit mkisofs und mkzftree. - Windows. Um GeeXboX zu installieren benötigen Sie: - GNU/Linux mit syslinux. Um Ihre eigene GeeXboX zu erstellen benötigen Sie einige "klassische" Werkzeuge: - ein funktionierendes GNU/Linux System. - denn gcc C Compiler. - GNU make - patch. - den nasm Assembler. - bzip2 und gzip. - mkfs.ext2 und mkfs.vfat - wget Kommandozeilen-Downloadtool(wird nicht für das komplette GeeXboX Paket benötigt). - mkisofs und mkzftree um das ISO-Image zu erstellen und zu komprimieren. - cdrecord (um das ISO-Image zu brennen). Zudem benötigen Sie mindestens 500 MB freien Speicher auf Ihrer Festplatte. | PERSONALISIERUNG | ~~~~~~~~~~~~~~~~ Mit dem Generator ist es sehr einfach GeeXboX seinen persönlichen Bedürfnissen anzupassen. Sie können zum Beispiel die Unterstützung einiger proprietäre Codecs wie rv9 oder wmv9 hinzufügen, indem Sie die Codecs einfach in das Verzeichnis GEEXBOX/codecs kopieren. Diese Codecs finden Sie im Paket, welches unter http://www.geexbox.org/releases/geexbox-extra-codecs-nonfree.tar.gz erhältlich ist. Sie können aber auch viele andere Einstellungen verändern, indem Sie einfach einige Text-Dateien editieren: * Sprache: Sie können die Menu-Sprache ändern, indem Sie die Datei GEEXBOX/etc/lang editieren. Diese Einstellung hat keinen Effekt auf die Sprache der DVD (siehe Kapitel MPlayer). Falls Ihre Sprache nicht existiert, können Sie das Menu übersetzen, indem Sie die Dateien GEEXBOX/etc/mplayer/menu_LANG.conf und GEEXBOX/usr/share/mplayer/help_LANG.txt bearbeiten. * MPlayer: Dies ist der Ort, an dem Sie die meisten Einstellungen und Veränderungen vornehmen können. Die Einstellungen sind in der Datei packages/MPlayer/mplayer.conf enthalten. Dort können viele Optionen geändert werden, wie z.B. die Schriftgröße des Onscreen-Menüs (subfont-text-scale). Sie können aber auch viele andere Einstellungen, wie zum Beispiel die DVD Standard-Sprache verändern (zum Beispiel: alang=fr,en). Die beste Übersicht über alle Einstellung finden Linux-Benutzer in der manpage (man -l build/MPlayer-*/DOCS/mplayer.1). Weitere Informationen finden Sie auch in der MPlayer Dokumentation (in build/MPlayer-*/DOCS oder unter http://mplayerhq.hu/DOCS/). Eine andere Datei, die sie vielleicht editieren wollen, ist packages/MPlayer/menu.conf. Sie können z.B. einzelne Menupunkte entfernen oder das Menü in eine beliebige Sprache übersetzen. Die letzte interessante Datei ist packages/MPlayer/build. Sie enthält die Optionen, welche für das Erstellen von MPlayer gesetzt sind. * TV-Ausgang: Das Aktivieren des TV-Ausgangs wird durch die Verwendung mehrerer kleiner Programme für die unterschiedlichen Video Karten Hersteller erreicht. Wir verwenden im Moment atitvout für ATI Karten, s3switch für S3 Karten und nvtv für nVidia Karten (unterstützt zum Teil ebenfalls Intel i810 und 3dfx Karten). Die Einstellungen dieser Programme werden in der Datei config/tvout vorgenommen. Sie können den TV-Standard wählen (PAL, NTSC) und einige spezifische Optionen für nvtv vornehmen. * Lirc: Sie können eine der unterstützten Fernbedienungen wählen, indem Sie die Datei GEEXBOX/etc/remote editieren. Falls Sie eine ATI Remote Wonder verwenden (welche nicht von Lirc unterstützt wird), müssen Sie nichts verändern, da diese standardmässig von GeeXboX unterstützt wird. Falls Sie die Tastenbelegung ihrer Fernbedienung verändern möchten, so editieren Sie die Datei GEEXBOX/etc/lirc/lircrc_REMOTE. * Netzwerk: Die Netzwerkeinstellungen werden in der Datei GEEXBOX/etc/network vorgenommen. Hier können Sie beispielsweise die IP-Adresse festlegen (Standardmässig wird DHCP verwendet und falls dies nicht funktioniert, wird die IP 192.168.0.54 verwendet). Sie können aber auch einen Login-Name und eine Passwort festlegen, welches für die Windows-Freigaben verwendet wird (standardmässig wird nur zu anonymen Freigaben verbunden). Ebenso können NFS mounts in der Datei GEEXBOX/etc/nfs eingetragen werden. * WiFi: In der Default-Einstellung versucht GeeXboX automatisch ihre Netzwerkein- stellungen zu erkennen. Wenn sie einen traditionellen NIC und eine WiFi-Karte haben, wird nur letztere eingerichtet. Unter Umständen müssen sie die Datei /etc/network editieren, um sie an ihre Netzwerkeinstellungen anzupassen. Dort finden sie 4 Zeilen die Wireless Lan Karten betreffen: * PHY_TYPE="auto" # Physikalischer Netzwerktyp (auto|ethernet|wifi) * WIFI_MODE="managed" # Wifi Betreibsmodus (managed|ad-hoc) * WIFI_WEP="" # Wifi WEP Schlüssel * WIFI_ESSID="any" # Wifi SSID Hier können sie die meisten der nötigen Einstellungen vornehmen. Sie können die Autoerkennung eingeschalten lassen oder sogar die Verwendung von Ethernet oder WiFi erzwingen. Genauso können sie hier zwischen den Betreibsmodi "managed" oder "ad-hoc" wählen, sowie ihren WEP Schlüssel und SSID einstellen. * Internetzugang (Gateway): GeeXboX unterstützt auch einen Internetzugang. Wenn sie einen Verbindung zum Internet haben, können sie sich diese mit ihrer GeeXboX durch die Verwendung eines Routers oder eines Gateways teilen. Dazu müssen sie nur die IP-Adresse des Gateways in der Datei /etc/network eintragen * GATEWAY="yourIP" # Gateway IP ("" für DHCP oder keine Internetverbindung) * TV-Konfiguration: GeeXboX unterstützt TV-Input und Tuner und versucht die Karte wie den Tuner automatisch zu erkennen. Sie können die Autoerkennung auch umgehen und selbst die richtigen Einstellungen in der Datei /etc/tvcard wie folgend beschrieben vornehmen: #TV CARD/TUNER Model (AUTO für automatische Erkennung, weitere Infos in den Links) #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.bttv #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.tuner TV_CARD=AUTO TV_TUNER=AUTO Bitte lassen sie die Einträge auf "AUTO" wenn sie die automatische Erkennung verwenden wollen. Ansonsten setzen sie die richtige Zahl für ihre Karte und ihren Tuner-Typ (siehe obenstehende Links). VORSICHT: um selber die richtigen Einstellungen vorzunehmen. müssen sie die exakten Referenzzahlen ihrer Hardware kennen!!! Wenn das erledigt ist, sollte es ihnen möglich sein den TV-Eingang (Composite und S-VHS) ihrer Karte zu nutzen. Auf dieselbe Art und Weise können sie den TV-Tuner benutzen. Dafür müssen sie ihre Region und die Frequenzen der TV Kanäle in der Datei /etc/tvcard eintragen: # TV Channels # Syntax : CHAN="Channel Frequency:Channel Title" # Example : # CHAN="29:France 2" # CHAN="K08:Canal +" # TV Channels List # Available : france, europe-east, europe-west, us-bcast, us-cable CHANLIST=france Bitte seien sie vorsichtig beim editieren der Kanäle. Benutzen sie genau dieselbe Syntax wie oben beschrieben, dann sind ihre TV Kanäle im Hauptmenü verfügbar. | ERSTELLEN EINER ISO-DATEI | ~~~~~~~~~~~~~~~~~~~~~~~~~ Bitte widmen Sie einen Augenblick der oben beschriebenen Personalisierung ihrer GeeXboX bevor Sie mit der Erstellung einer ISO-Datei beginnen. Anschliessend können Sie unter Linux die ISO-Datei mit dem folgenden Kommando erstellen: ./generator.sh oder unter Windows mit dem Starten der Datei generator.exe | INSTALLATION | ~~~~~~~~~~~~ Als erstes benötigen Sie eine FAT16 Partition mit ungefähr 16 MB freiem Speicherplatz. Dann können Sie die Installation unter Linux starten, indem Sie folgendes Kommando eingeben: ./installator.sh Beantworten Sie anschliessend alle Fragen. Seien Sie bei diesem Vorgang sehr vorsichtig! Lesen Sie jede Frage zweimal und unterbrechen Sie die Installation wenn Sie eine Frage nicht verstehen. | PXE BOOT | ~~~~~~~~ Ja, GeeXboX ist fähig über ein Netzwerk ohne Festplatte zu starten! Um dies zu erreichen benötigen Sie folgendes: - einen DHCP Server - einen TFTP Server - einen NFS Server - einen PXE fähiger Computer :-) Zuerst müssen Sie den DHCP Server konfigurieren, damit dieser die PXE Boot Informationen schickt. Im Folgenden eine Beispiel mit isc dhcp: allow booting; allow bootp; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.128 192.168.0.192; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; next-server 192.168.0.1; filename "/tftpboot/GEEXBOX/boot/pxelinux.0"; } Die next-server Option ist die Adresse des TFTP Servers. Anschliessend konfigurieren Sie Ihren TFTP Server (wie zum Beispiel atftpd) so, damit er das Verzeichnis /tftpboot zur Verfügung stellt. Das Verzeichnis /tftpboot muss einen vollständigen GEEXBOX Stammbaum enthalten. Sie können dazu zum Beispiel den Inhalt eine GeeXboX CD von Linux aus MIT DER AKTIVIERTEN TRANSPARENTEN DEKOMPRESSION DER CDROM! (um dies zu überprüfen schauen Sie auf den Inhalt der sbin/init im GeeXboX Dateibaum und prüfen, ob diese Datei keinen Müll enthält). Falls Sie GeeXboX selber aus den Sourcen kompiliert haben, so können Sie einen Dateibaum ganz einfach mit make pxe erstellen. Danach sollten Sie die Datei /tftpboot/GEEXBOX/boot/pxelinux.cfg/default editieren, so dass nfsroot zum richtigen NFS Pfad des GEEXBOX Dateibaumes zeigt. Am Schluss müssen Sie noch NFS so konfigurieren, dass der GEEXBOX Dateibaum exportiert wird. Dies erreichen Sie, indem Sie der Datei /etc/exports in etwa folgendes hinzufügen: /tftpboot/GEEXBOX (ro) und der Datei /etc/hosts.allow folgendes hinzufügen: ALL: ALL Damit ist die Konfiguration abgeschlossen. Starten Sie den PXE Computer und schauen Sie was passiert. | KOMPILIEREN | ~~~~~~~~~~~ Bevor Sie beginnen, lesen Sie bitte das anschliessende Konfigurations-Kapitel (mindestens die allgemeinen Einstellungen). Anschliessen können Sie das ISO-Image einfach mit folgendem Kommando erstellen: make oder Sie brennen das ISO-Image sogleich: make burn Wenn Sie fertig sind, können Sie mehr freien Speicherplatz schaffen, indem Sie nicht mehr benötigte Dateien löschen: make clean oder alle Dateien inklusive der heruntergeladenen Dateien löschen: make distclean Es gibt noch einige Kommandos, die für fortgeschrittene Benutzer gedacht sind: scripts/get package # lädt ein Paket herunter scripts/unpack package # entpackt und bereitet das Paket vor scripts/build package # kompliert das Paket scripts/install package # installiert das Paket nach $INSTALL scripts/clean package # reinigt den Dateibaum des Paketes make exec # startet GeeXboX in einem Käfig # WARNUNG: Dies ist eine experimentelle Funktion, # Benutzung auf eigene Gefahr. Falls Sie eine veränderte Version von GeeXboX erstellt haben, so können Sie sehr einfach ein tar.bz2 Archiv davon erstellen: make dist oder ein vollständiges Archiv (inklusive allen Sourcen): make fulldist oder einen GeeXboX Generator mit: make generator oder eine GeeXboX Installationsroutine mit: make installator oder einen PXE fähigen Baum: make pxe | KONFIGURATION | ~~~~~~~~~~~~~ * Allgemeine Einstellungen: Dies ist der erste Schritt, den Sie vor dem Kompilieren von GeeXboX machen sollten. Alle Einstellungen stehen in der Datei config/options, welche sich selbsterklärend sein sollte. Dort können Sie die CPU-Familie und den Theme wählen und ob sie TrueType Schriften wollen oder nicht. Sie sollten zudem die Konfiguration des CD-Brenners anpassen, sofern sie die ISO-Datei direkt brennen wollen. * Linux : Dies ist die klassische Linux-Konfiguration (packages/linux/linux.conf). Sie können diese Datei entweder von Hand oder mit einem scripts/unpack linux und einem anschliessenden make menuconfig -C build/linux-* (oder ihrer bevorzugten Methode anstatt menuconfig) anpassen. Danach sollten Sie Ihre Konfigurationsdatei build/linux-*/.config nach packages/linux/linux.conf sichern. * Lirc : Lirc erlaubt Ihnen, GeeXboX mit einer Fernbedienung zu bedienen. Zuerst müssen Sie die zur ihrer Fernbedienung passende Datei aus build/lirc-*/remotes (nachdem Sie ein scripts/unpack lirc gemacht haben) auswählen und diese zur Datei packages/lirc/install hinzufügen. Danach sollten Sie die Gerätedatei (Standard ist /dev/ttyS0 (COM1)) und den Lirc Treiber auswählen und dies in die Datei packages/lirc/lircd_$REMOTE hinzufügen. Danach können Sie die Tasten in der Datei packages/lirc/lircrc_$REMOTE belegen. Für jede Belegung müssen Sie einen Knopf (entnehmen Sie die Namen der Knöpfe der Fernbedienungs-Defintion- Datei) eine passenden Belegung zuweisen. Die "Belegung" ist eine der MPlayer Aktionen (sie finden eine Liste der möglichen Aktionen in der HTML-Datei build/MPlayer-*/DOCS/documentation.html#commands). | VERÄNDERUNGEN | ~~~~~~~~~~~~~ Das Erste was Sie anschauen sollten, ist das Initialisierungs-Script. Eigentlich sind es zwei Initialisierungs-Scripte. Das Erste ist packages/initrd/linuxrc welches Sie aber wahrscheinlich nicht zu verändern brauchen. Das Zweite ist config/init, wo Sie Ihre Personalisierungen einbringen können. Das nächste was Sie interessieren könnte, ist die Erstellung eines neuen "Paketes". Ein Paket ist nur eine Reihe von Scripten, die einigen Regeln folgen müssen. Alle Scripte müssen sich in einem Verzeichnis befinden mit dem gleichen Namen wie das Programm, das Sie "packen" wollen, dieses Verzeichnis wiederum im packages Verzeichnis. Hier ist eine Liste mit den Scripten, die Sie erstellen sollten: - url: eine Liste der URL's, wo man die Programm-Sourcen herunterladen kann. - unpack: enthält, was nach dem Auspacken des Paketes gemacht wird. Zum Beispiel das Modifizieren von Konfigurations-Dateien. Dieses Script spielt jedoch keine Patches auf. - need_build: wird aufgerufen, falls das Paket schon kompiliert wurde, um sicherzugehen, dass es nicht noch einmal kompiliert werden muss. Es sollte die Datei .stamps/"package name"/build entfernen, falls das Paket nochmals kompiliert werden muss. - build: enthält alle Schritte um das Programm zu kompilieren. - install: enthält alle Schritte um das Programm installieren zu können. Das Prefix der Installtion sollte $INSTALL sein. Wenn die Datei url einen Dateinamen der Form patch-program_name-... enthält, wird der Patch automatisch auf die entpackten Sourcen aufgespielt. Beachten Sie zudem, dass Software, die auf der GeeXboX laufen soll, mit dem uClibc gcc Wrapper kompiliert werden muss. Es bleibt nur noch zu sagen, dass der beste Weg ein eigenes Paket zu erstellen der ist, einen Blick auf andere Pakete zu werfen. | LIZENZ | ~~~~~~~ Alle Programme, die von GeeXboX benutzt werden, sind durch ihre eigene Lizenz geschützt. Sie alle sind freie Software und die meisten Programme stehen unter der GNU General Public License. GeeXboX selber, gemeint sind alle Scripte die für die Komilierung benutzt werden, stehen unter der GNU General Public License. geexbox-1.0/DOCS/README_en.txt0000644000175000017500000010252310446314256014735 0ustar aurelaurel ooooo oo o o oo o M" "Mo Mo oM" M Mo oM" M oM""Mo oM""Mo "Mo" Mo"""o oM""Mo "Mo" M """M MooooMM MooooMM oMMo M "M M M oMMo "o oM M o M o oM Mo M oM M M oM Mo "MoooM"M "MooM" "MooM" M" "M M"ooo" "MooM" M" "M | ABOUT | ~~~~~ GeeXboX is a kind of "divx box" software. In fact, it is a stand-alone boot CD which allows you to watch movies or listen to music. It supports many formats, such as avi, mpeg, divx, ogm, rm, mp3, ogg, dvd, vcd and cdda. It also supports some IR remote controllers and TV-Out for some graphic cards. This archive contains the needed scripts to rebuild an iso image of GeeXboX. | REQUIREMENTS | ~~~~~~~~~~~~ To generate a GeeXboX iso, you will need either : - a GNU/Linux system with mkisofs and mkzftree. - a MAC OS X system with mkisofs and mkzftree. - a windows system. To install the GeeXboX, you will need : - a GNU/Linux system with syslinux. To build the GeeXboX, you will need some classic tools : - a working GNU/Linux system. - the gcc C compiler. - GNU make - the patch command. - the nasm assembler. - bzip2 and gzip. - mkfs.ext2 and mkfs.vfat - the wget download tool (not needed for the full GeeXboX package). - mkisofs and mkzftree to build the iso image. - mkzftree to compress files on the iso image. - cdrecord (to burn the iso image). And also 1.2 GB of hard disk free space. | PERSONALIZATION | ~~~~~~~~~~~~~~~ When the GeeXboX is installed on a hard drive or generated, it is quite easy to personalize it. You can add some proprietary codecs such a rv9 or wmv9, simply by adding them in the GEEXBOX/codecs directory. You can find those codecs in the package on http://www.geexbox.org/releases/extra-codecs-nonfree.tar.gz You can also modify many options. This can be done simply by editing some text files. * Language : You can easily select your preferred menu language by following the procedure below : - GNU/Linux users: Edit the generator.sh script before running it and change the line near the top: "MENU_LANG=en" to your preferred language. For example: if you're French, change it to "MENU_LANG=fr". - Microsoft Windows users: When started, generator.exe gives you a combo list that allows you to choose your preferred language. NB : This has no effect on DVD language (see the MPlayer section). For the list of available languages please see the "language" directory. If your language is not available, you can translate the menu in your own language. This simply involves the creation of language/menu_LANG.conf and language/help_LANG.txt, and adding LANG to language/lang.conf. * Firmware auto-loader : GeeXboX supports many free drivers but unfortunately some of them may require an additionnal proprietary firmware (non-free and so not included in GeeXboX ISO) to work properly. The firmware is a binary file that is uploaded to the device (PCI or USB) when the driver is loaded. For each driver, the firmware has to be a specific file with a pre-determined name. If you have reluctant hardware that require additionnal firmware (in most of the cases, it only concerns WiFi and DVB cards), you'll need to check on the Internet for your Linux driver page to see how to check the firmware file. Most of the time, you'll get a direct download link. Sometimes, you'll need to extract it from your Windows drivers archive that was shipped with your hardware. Once you get the firmware file, simply put it into the /firmwares directory. You can put in as many firmwares as you want, and GeeXboX will automatically find them and use them with the right drivers if needed. The only thing you then have to take care is to have the good firmwares file and to generate a new ISO. Please note that you can also use the GeeXboX ISO generator to automatically grab firmwares for you. You can select all of the extra binary firmware files you want the generator to add for you. Simply note that this feature will require you to have an Internet access when using the GeeXboX generator. * MPlayer : This is where you can do most of the configuration and tweaking. The options take place in the file packages/MPlayer/config/mplayer.conf. You may want to modify options such as OSD font size (subfont-text-scale). You can also add lots of options such as DVD default language (eg: alang=fr,en). The best place to find them is the MPlayer manpage for Linux users (man -l build/MPlayer-*/DOCS/mplayer.1). You should also have a look at the MPlayer documentation (in build/MPlayer-*/DOCS or at http://www.mplayerhq.hu/DOCS/). Another file you may modify is the packages/i18n-texts/config/menu.conf. You can remove items you don't need, or you can translate it in your own language for example. Then the last file you can look at is the packages/MPlayer/build which contains the selection of options which are built into MPlayer. * TV-Out : Enabling the TV-Out is achieved with the help of multiple small programs dedicated to different video card brands. Currently we use atitvout for ATI cards, s3switch for S3 cards and nvtv for nVidia cards (and possibly intel i810 and 3dfx cards). The configuration of those programs is done in packages/tvout/config/tvout. There you can choose the TV standard you want (pal, ntsc...) and you can also modify specific options for nvtv. # TV Output Standard (ntsc/pal/secam) TVOUT_STANDARD=pal Please note that you can also define the output aspect (say 4:3 or 16:9 display) in this file through the line : TVOUT_ASPECT="4:3" This parameter will be used both for TVOut and regular (CRT/TFT) display. You can also specify the desired height/width values and your display's horizontal and vertical frequencies in case you have unusual screen like WideScreens or videoprojector. This can be done, editing the /etc/mplayer/mplayer.conf file. Default parameters are shown below (please uncomment lines related to frequency if you want to use them) : screenw=800 screenh=600 #monitor-hfreq=31.5k-50k #monitor-vfreq=50-90 * Lirc : You can choose one of the supported remote controller by editing the file GEEXBOX/etc/remote. Also take care to chose the corresponding ir receiver in the same configuration file. If you want to modify the key binding of your remote controler, look at the file GEEXBOX/etc/lirc/lircrc_REMOTE. * Network : You can configure the network in the file GEEXBOX/etc/network. There you can chose the IP address used by the GeeXboX (default is to use DHCP and if it don't work, fall back to 192.168.0.54). You can also specify a login and a password which will be used to connect to windows shares (default will only connect to anonymous shares). You can also declare some NFS mounts in GEEXBOX/etc/nfs. * Wifi : By default, GeeXboX tries to autodetect your network settings. If you have both traditionnal NIC and WiFi cards, only the latest will be setup. You may have to modify the /etc/network file in order to fit your network's settings. In this one, 4 lines are related to wireless cards : * PHY_TYPE="auto" # Network physical type (auto|ethernet|wifi) * WIFI_MODE="managed" # Wifi working mode (managed|ad-hoc) * WIFI_WEP="" # Wifi WEP key * WIFI_ESSID="any" # Wifi SSID These lines let you configure most of the settings. You can let autodetection enable or even force the use of ethernet or WiFi adapters. In the same way, this let you choose between the managed and the ad-hoc mode and let you define your WEP key and SSID. * Gateway : GeeXboX supports access to the Internet. In the case you've got a connection to the Internet, you may share it with your multimedia box, using a router or a gateway. For this, simply define the gateway IP address in the /etc/network file. * GATEWAY="" # Gateway IP ("" for DHCP or no internet connection) * DNS server : If you want to access to the Internet, GeeXboX may require a DNS server IP address. If you're not using a DHCP server that will do this job, you'll have to specify it by hand in the /etc/network file. * DNS_SERVER="" # DNS Server IP ("" for DHCP or none) * TV configuration : GeeXboX supports TV inputs and tuners. The system hardly tries to autodetect the card and the tuner. You can force the settings and skip the autodetection try. Please modify the /etc/tvcard as described : #TV CARD/TUNER Model (AUTO for autodetection or look at the following urls) #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.bttv #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.tuner TV_CARD=AUTO TV_TUNER=AUTO TVIN_STANDARD=pal Please let the AUTO parameter whether you want to keep autodetection, or replace it by the number of your card and tuner types, according to the previous URL. Please be careful : in order to force the card and tuner types, you have to know the EXACT REFERENCES of your hardware. Once done, you should be able to use the TV inputs (Composite and S-VHS) of your TV card. In the same way, you can use the tuner to watch TV. For that, you will have to define the region you belongs to and the frequency of the TV channels you want to watch. Once again, simply edit the /etc/tvcard file : # TV Channels # Syntax : CHAN="Channel Frequency:Channel Title" # Example : # CHAN="26:France 2" # CHAN="K08:Canal +" # TV Channels List # Available : france, europe-east, europe-west, us-bcast, us-cable CHANLIST=france Please be careful when editing channels and simply use the same syntax as described above and TV channels should be present in the main menu. * Audio configuration : GeeXboX supports both analog and digital audio output through regular JACK connectors or RCA SPDIF one. By default, output is set to analog. You can change this, by editing the /etc/audio file : # Output using SPDIF (yes/no), otherwise ANALOG output SPDIF=no Remember that you will need to set your output to SPDIF if you want to connect your soundcard to an external amplifier for decoding AC3/DTS streams (using passthrough mode). * Video post-processing : Post-Processing is a software way to get a smoother and more accurate render of your videos. It however consumes a lot of CPU time to magnify pictures but, as a result, it looks far better. Using MPlayer internal filters, GeeXboX lets you make h/v deblocking, deringing and auto luminance to enhance your image. By default, post-processing is disabled to avoid lagging on small configurations. You can enable it simply by editing the /etc/mplayer/mplayer.conf file : # Set Post Processing (h deblock, v deblock, dering, auto luminance) # Consumes CPU power, disabled for low configs, uncomment to enable it. #vf=pp=hb:a/vb:a/dr:a/al:a * DXR3/Hollywood+ cards : Users with this kind of hardware decompression card does NOT even need to have a video board and sound card to use GeeXboX. On the drawbacks, only the tvout connector can be used with DXR3 cards (no CRT display). You may have to set the required image norm (PAL/NTSC) in the /etc/tvout file and the kind of audio output you want to use (Analog or SPDIF) in /etc/audio. * Radio configuration : If your TV-card has built-in FM radio tuner, GeeXboX can support playing the radio. You have to modify the GEEXBOX/etc/radio file to have "RADIO=yes" if you want to use the radio. There is no hardware auto- detection, so setting this to 'yes' without a TV-card-based FM radio will put unnecessary menu items on your GeeXboX screen. The GEEXBOX/etc/radio file also has the radio station definition. There are a number of examples in the file, which simply include the radio frequency and the name of the station. Please be careful when editing channels and simply use the same syntax as the examples and the radio stations should be present in the main menu under "LISTEN RADIO". Since the radio application itself is not part of MPlayer, there is separate access to the volume. Please note that the volume that is being increased or decreased is Master volume. Before switching back to TV or video viewing, or music playing, the volume should be re-adjusted. * UPnP File Sharing : UPnP stands for Universal Plug & Play and is a network protocol aiming at providing the autodiscovery of devices and services of your Home Network. The UPnP A/V (for Audio/Video) norms defines several profiles for devices to easily share multimedia files and lets them being played. The UPnP Media Server profiles represent all of the devices that are able to share files to devices implementing the UPnP Media Player or UPnP Media Renderer profiles. The GeeXboX embeds a UPnP Control Point software that is able to auto-discover all UPnP Media Servers from your Home network and it simply mounts their contents to a dedicated mount point (/mnt/UPnP). This way, you just have to share contents using a compliant UPnP Media Server software and they'll be automatically accessible from GeeXboX. For more info about UPnP and some media servers usage, please go to http://www.geexbox.org/wiki/index.php/Accessing_to_UPnP_Contents * Network streaming : GeeXboX now gives you the possibility to add some SHOUTcast Radio/TV official playlist as easily as personal playlists (local and remote). SHOUTcast activation is set in "GEEXBOX/etc/network" config file. As SHOUTcast TV sometimes may contain pornographic and subscription-only streams, you can define a "black list" and a "white list" to allow/deny any streams you choose (default keywords for "black list" are : "adult xxx porn ESS SWCTV SWPTV Subscription"). The black/white lists are case-insensitive. "GEEXBOX/etc/netstream" config file can be set to create local and remote playlists (some examples are located in this file). "Remote playlists" refer to "Extended M3U" files. For French users only : You can get "FreeboxTV" thanks to this file, using the following process : - uncomment EXTM3U ad hoc entry. - use a GeeXboX version that have to be compiled with "LIVE555 library" support (otherwise you won't be able to decode the stream). * DVB cards : GeeXboX has a support for various types of DVB cards (Terrestrial, Cable, ATSC and Satellite) either in PCI or USB. Please note that for now, only one DVB adapter is usable at a time. Some DVB devices (especially USB ones) may require an external proprietary firmware to be loaded in the mean time as the driver to be usable. You may have a look at the LinuxTV DVB Wiki (http://linuxtv.org/wiki/index.php/Main_Page) to see if you're card requires one or not and if so, which one it is. Some firmwares can be fetched directly from the LinuxTV website (http://linuxtv.org/download/firmware/), otherwise may be included in the Windows drivers archive. See the GeeXboX firmware loader documentation to see how to get them loaded for you. For each card, the list of channels is available through the MPlayer's open menu. Nevertheless, there's no way to auto-discover these channels. Thus, adding the list of DVB channels to GeeXboX can be done in several ways : - using an existing channel list : MPlayer needs to have a working channels.conf file to use DVB. This file can be generated through the utilities provided by the dvb-apps package. Simply use a Linux box that has a DVB card configured, download the linuxtv-dvb-apps tarball from http://www.linuxtv.org/download/dvb/ , compile it and create the config file using the "scan" executable, in "zap" format (which is the default as of dvb-apps 1.1.0). For example, for a DVB-S (Satellite) card using Astra-19.2E as the provider: wget http://www.linuxtv.org/download/dvb/linuxtv-dvb-apps-1.1.0.tar.bz2 tar jxvf linuxtv-dvb-apps-1.1.0.tar.bz2 cd linuxtv-dvb-apps-1.1.0/util/scan make ./scan -x 0 dvb-s/Astra-19.2E > channels.conf The "-x 0" flag is here to restrict the scan to Free To Air channels only. Please always do so, as MPlayer do not support encrypted DVB channels. According to your type of DVB card, choose either a file from the "dvb-s" "dvb-c", "dvb-t" or "atsc" directories and ask for a scan. Then, simply copy the channels.conf file you've just created to the /etc/mplayer directory in the GeeXboX generator tree, and rebuild away. - using an existing transponder list : the procedure is highly similar to the one defined just before but with no scan. This time, the scan will be done at GeeXboX boot but this way, you do no more require another Linux system to generate the channels.conf file. To do so, you simpy have to check at : http://linuxtv.org/cgi-bin/viewcvs.cgi/dvb-apps/util/scan/ According to your DVB card type (S/T/C/ATSC), check for the good directory and grab the transponder frequency list that fit your needs. Then simply rename the file to dvb.conf and copy it to /etc. Then, rebuild a new ISO using the generator. A bootup, if GeeXboX detects a valid transponder file in /etc/dvb.conf, it will be used to scan for DVB channels and will generate the /etc/mplayer/channels.conf file itself. WARNING : Scanning can be slow according to the number of devices to be scanned and will be done each time you boot GeeXboX if using it as a LiveCD. It is highly recommended that you do it once only, then copy the generated /etc/mplayer/channels.conf file somewhere else and rebuild an ISO using generator, following the first method or to install it on disk. - using installator : this is for sure the easiest solution but requires you to install GeeXboX to disk. During the installation process, if a valid DVB device is recognized by the system, the installator script will ask you if you want to scan for DVB channels. The installator contains the complete list of transponders frequencies. That way, you just have to select your DVB device type and the transponder file you want to use for GeeXboX to scan. The channels.conf file will then be automatically generated. * DVD Navigation Menus : GeeXboX allows 2 DVD playback mode: - Direct movie playback (default). - DVD Navigation Menu support (fairly experimental). The first one can be safely trusted for playing any kind of DVD. Once inserted, the disc is automatically detected and MPlayer tries to play the title it consider as the movie one. The major advantage is that all copyright, advertisement and menu parts are skipped to allow a direct playback. However, in some situations (like DVDs with enhanced menus or most of the series DVD, containing multiple titles to be played) this method is inaccurate and you'll not be able to watch your DVD correctly. The second one, while still experimental (but has really good chances to works fine) supports the regular DVD Navigation Menus and let you control your DVD the same way you'll do it using a regular commercial DVD player. You can use the GeeXboX options menu to switch between the DVD playback methods, according to the DVD disc you're trying to watch. You can also make use of the GeeXboX ISO generator to select the default DVD playback method you want. * Recording Capabilities : GeeXboX allows you to record the stream you're watching and even proceed with live pause (a.k.a. Time-Shifting). Unfortunately, this operation is CPU-time consuming (realtime encoding and playback of a stream) and so, you may require a fairly recent computer to be able to fully make use of this feature. The control menu comes with a recorder-dedicated sub-menu that allows you to monitor the recording status (on/off), check for the recorded files destination, but also start/stop the record process and select the encoding profile you want to use. The record process can also be started (or stopped) from the keyboard, using the "i" key, or from the remote controller. There's unfortunately a requirement to the use of recording capabilities : you need to be able to store the recorded files somewhere. This can be an internal/external hard drive or a remote NFS/Samba share. The only thing that matters is that the filesystem has to be Linux-writable (i.e. NTFS disk aren't supported). Be aware while recording that your disk will be remounted R/W to allow file storage. Once the record process has ended, GeeXboX should remount your disk as R/O for safety measure but this might not work. It is then highly recommended when making use of the recording capabilities that you perform a clean shutdown of the computer to avoid a potential filesystem or data corruption. We won't take any responsibility for data loss. The recorded files destination path has to be specified at installation or ISO generation in the /etc/recorder configuration file. Simply replace the following setting with your own one : SAVE_PATH="/tmp" The default behavior is to save to /tmp but as it's a RAMdisk, GeeXboX is smart enough to not proceed so. Considering that, there's no way GeeXboX will try to record or store files to your computer unless you'd explicitely specify a destination path. In the same way, you can also specify the default encoding profile to be used when recording. You can always change to another one at runtime through the recorder option menu. A few profiles are available (see the /etc/mplayer/mencoder.conf file for a complete list and details) and they all feature different level of quality or encoding speed. You might choose one over another, according to your CPU power. According to the input stream (low-resolution WebTV, regular analog TV, digital HDTV ...), one profile might fit better than another. Below is a short non-exhaustive list of available encoding profiles : - MPEG 1 - MPEG 2 - Video CD (PAL/NTSC) - Super Video CD (PAL/NTSC) - DVD Video (PAL/NTSC) - Stream Dump (can be safely used on DVB MPEG-TS streams for example to avoid a re-encoding process). The default encoding profile has to be specified in the /etc/recorder configuration file, as below : RECORD_PROFILE="mpeg1" Unless you know exactly what you're doing, it is highly recommended that you use the ISO generator to select the default profile. When watching a TV stream and starting the record process, GeeXboX image might freeze a few seconds (time for MEncoder to start recording) and will start playing back the currently recording file. If you're CPU is too slow, the playback will lag, waiting for the frames to be encoded. If this happens, you only have 2 solutions : - use a more powerful HTPC. - use a fastest (i.e. less quality) encoding profile. When stopping the recording process, GeeXboX will stop MEncoder and will reload the original input stream. | GENERATION | ~~~~~~~~~~ First have a look at the personalization section just above. Then basically you can generate the iso under Linux by launching ./generator.sh or under windows by launching generator.exe | INSTALLATION | ~~~~~~~~~~~~ First you need to create a FAT16/32 or EXT2/3 partition with at least 16 MB of free space. Then you can install the GeeXboX under Linux by launching ./installator.sh And then responding to all the questions. Be carefull during this step. Read twice each question and stop installing if you don't understand one of the question. But the easiest way to install GeeXboX is still to boot it from CD and type "install" at isolinux boot prompt. | PXE BOOT | ~~~~~~~~ Yes, the GeeXboX is able to boot from the network on a diskless station ! To achieve this you will need : - a DHCP server - a TFTP server - a NFS server - a PXE capable station :-) * Using a GNU/Linux system : ------------------------ First configure your dhcp server to send PXE boot info. Here is an example with isc dhcp : allow booting; allow bootp; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.128 192.168.0.192; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; next-server 192.168.0.1; filename "/tftpboot/GEEXBOX/boot/pxelinux.0"; } The next-server option is the address of the TFTP server. Then configure your TFTP server (such as atftpd) to server the /tftpboot directory and copy a full GEEXBOX tree in this directory. For example you can copy the content of a GeeXboX CD from a linux WITH THE CDROM TRANSPARENT DECOMPRESSION ENABLED !! (to verify this, look at the sbin/init file in the GeeXboX tree and verify that it do not contain garbage) If you've built the GeeXboX yourself from sources, you can also generate the GEEXBOX tree with make pxe. Then you should edit the file /tftpboot/GEEXBOX/boot/pxelinux.cfg/default to set nfsroot to the right NFS path to the GEEXBOX tree. Finaly set up your NFS to export the GEEXBOX tree with a /etc/exports containing something like this : /tftpboot/GEEXBOX (ro) and a /etc/hosts.allow containing something like : ALL: ALL That should do the trick. Boot your PXE station and see what happen. * Using a Microsoft Windows system : -------------------------------- In order to boot in PXE mode from a Windows host, you'll need the following software : * An TFTP and a DHCP Server (for example "tftpd32", available at http://tftpd32.jounin.net/) * An NFS Server (for example "Allegro NFS server", available at http://opensource.franz.com/nfs/) * A computer supporting PXE boot mode. Download and uncompress (No need to install) the tftpd32 folder somewhere on your disk. In this example, lets assume it is : C:\tftpd32 Copy the complete GEEXBOX tree in the same directory (C:\tftpd32\GEEXBOX) Start tftpd32 : - Choose the C:\tftpd32 folder for "current directory". - Choose the interface (network card) to be used in "server interface". In the example here it's 192.168.0.1 - Go in "setting" and make sure DHCP server is checked (enabled) - In the "DHCP server" tab, fill in all the box using the following example : (Please refer to some documentation about DHCP all around the net in order to understand) * IP starting pool : 192.168.0.10 * Size of pool : 10 * Boot file : ./GEEXBOX/boot/pxelinux.0 * WINS/DNS server : 192.168.0.254 * Default router : 192.168.0.254 * Mask : 255.255.255.0 * Domain name : mydomain.net - Click "save" to apply modifications. First part is done, you can now boot the client computer (the one starting GeeXboX), and will see it loading until the logo appears. After a while it'll freeze because your NFS server is not set yet. Install "Allegro NFS server" and fill in the boxes following these settings : Exports tab : * Add a "new name" : and call it "/tftpboot/GEEXBOX" * In "path" just below : choose "C:\tftp32\GEEXBOX" folder * In "allowed host list" , choose "all" * "Read write", and "read only user list", choose "root" and "everyone" (if you want some log just check all in the last tab) Apply settings. Don't forget to modify the file : C:\tftp32\GEEXBOX\boot\pxelinux.cfg\default and change the IP address "192.168.0.2" to "192.168.0.1" (or the one you've previously setup). Just start the client computer and now GeeXboX should be running fine. | BUILDING | ~~~~~~~~ First have a look at the configuration section just under (at least the global part). Then basically you can build the iso with : make Or you can directly burn this iso with : make burn When done, you can save disk space by cleaning the build tree : make clean or by doing a full cleaning, even removing downloaded sources : make distclean There's also more advanced commands if you want to hack around the GeeXboX : scripts/get package # download the package scripts/unpack package # unpack and prepare the package scripts/build package # build the package scripts/install package # install the package with the $INSTALL prefix scripts/clean package # clean the package build tree scripts/clean --full package # clean both the package build and source trees make exec # launch directly the GeeXboX in a jail # WARNING: this is a highly experimental feature # use it at your own risks. If you've made a hacked version of the GeeXboX, you can easily build a small tar.bz2 for it with : make dist or a full tar (containing all sources) with : make fulldist or a geexbox generator with : make generator or a geexbox installator with : make installator or a pxe ready tree with : make pxe | CONFIGURATION | ~~~~~~~~~~~~~ * Global options : This is the first thing you should take care of before trying to build the GeeXboX. It stands in the file config/options, and it should be self explanatory. * Linux : This is a classical Linux configuration (packages/linux/linux.conf). You can edit them by hand, or you can also do a scripts/unpack linux and then a make menuconfig -C build/linux-* (or use the method you prefer instead of menuconfig). Then you should backup your build/linux-*/.config into packages/linux/linux.conf. * Lirc : Lirc allows you to control the GeeXboX using a remote controller. First you have to choose the file describing your specific remote in build/lirc-*/remotes (after doing a scripts/unpack lirc) and add it in packages/lirc/install. Then you should choose your device (default is /dev/ttyS0 (COM1)) and the lirc driver and put them in a file called packages/lirc/config/lircd_$REMOTE. Then you can choose your key mapping in the file packages/lirc/config/lircrc_$REMOTE. For each mapping you have to select a button (pike their names in the remote definition file) and associate an action to it. The action is one of MPlayer's actions (you can find a list in the html file build/MPlayer-*/DOCS/documentation.html#commands). | HACKING | ~~~~~~~ The first thing you should look at is the initialization script. In fact there are two initialization scripts. The first one is in packages/initrd/scripts/linuxrc but you shouldn't need to modify it. The second one is in config/options and that's where you may put some customizations. There you can first choose which is the architecture (i386 or PPC) you want to build GeeXboX for. After that, you can perform finnest tuning by specifying a certain kind of sub arch (386, pentium, athlon) in order to optimize the distribution for your specific CPU and gets the best perfomances off. Then the next thing which may interest you is the creation of a new "package". A package is just a bunch of scripts which have to follow some rules. All the scripts have to take place in a directory named as the program you want to "package", itself in the packages directory. Here is a list of the scripts you may create : - url : just a list of urls where to get the program sources. - unpack : what to do after unpacking the sources. For example, you can modify some configuration files. This does not include applying patches. - need_build : called when the package as allready been built, in order to be sure that it don't need to be rebuilt. It should remove the file .stamps/"package name"/build if the package need to be rebuilt. - build : all the steps needed to build the program. - install : all the steps needed to install the program. The installation prefix should be $INSTALL. In addition, the package main directory may contain extra subdirs : - config : where all config files belong. These files may be used either by the build script to compile the package or by the install script to be put to the system's /etc directory. - scripts : this subdir may contain runtime initialization scripts related to the current package which should be installed by install script - patches : this subdir may contain patches to be applied to the sources of the package, at unpack time. - sources : if files are present here, they will be automatically copied into the package's build tree. - init.d : contains initialization scripts to be launched at runtime. You also have to remember that software which run on the GeeXboX have to be compiled with the uClibc gcc wrapper. Fortunately, the GeeXboX toolchain is smart enough to automatically build all added packages using the uClibc gcc wrapper itself. Do not forget to ask for your package's compilation and installation by explicitely asking for it in the scripts/gentree build script. Finally, the best way to make a package is to look how other packages are done. | LICENSE | ~~~~~~~ All the programs used by the GeeXboX are protected by their respective license. They all are free software and most of them are covered by the GNU General Public License. The GeeXboX itself, meaning all the scripts which are used in the building process, are covered by the GNU General Public License. geexbox-1.0/DOCS/README_es.txt0000644000175000017500000002505010446314256014741 0ustar aurelaurel ooooo oo o o oo o M" "Mo Mo oM" M Mo oM" M oM""Mo oM""Mo "Mo" Mo"""o oM""Mo "Mo" M """M MooooMM MooooMM oMMo M "M M M oMMo "o oM M o M o oM Mo M oM M M oM Mo "MoooM"M "MooM" "MooM" M" "M M"ooo" "MooM" M" "M | ACERCA DE... | ~~~~~~~~~~~~ Geexbox es un software que convierte tu ordenador en una máquina de reproducir DivX. De hecho, es un CD auto-arrancable que permite ver películas o escuchar música. Soporta multitud de formatos, tales como avi, mpeg, divx, ogm, rm, mp3, ogg, dvd, vcd y cdda. También soporta algunos mandos a distancia IR y las salidas de TV de ciertas tarjetas. Este archivo contiene los ficheros necesarios para generar una imagen iso personalizada de GeexBoX. | REQUISITOS | ~~~~~~~~~~ Para generar una iso GeeXboX, necesitas: - un sistema GNU/Linux con mkisofs y mkzftree. - un sistema windows. Para instalar GeeXboX, necesitarás: - un sistema GNU/Linux con syslinux. Para construir GeeXboX, te harán falta algunas utilidades clásicas: - un sistema GNU/Linux funcionando. - el compilador gcc para el lenguaje C. - GNU make. - el comando patch. - el ensamblador nasm. - bzip2 y gzip. - mkfs.ext2 y mkfs.vfat. - la utilidad de descarga wget (no necesaria para todo el paquete GeeXboX). - mkisofs y mkzftree para construir la imagen iso. - mkzftree para comprimir los archivos en la imagen iso. - cdrecord (para tostar la iso). Y también 500 megas de espacio libre en disco. | PERSONALIZACIÓN | ~~~~~~~~~~~~~~~ Cuando GeeXboX está instalado en un disco duro o es generado, resulta muy fácil personalizarlo. Puedes añadir algunos códecs propietarios como rv9 o wmv9, copiándolos en el directorio iso/GEEXBOX/codecs. Puedes encontrar estos códecs en el paquete http://www.mplayerhq.hu/MPlayer/releases/codecs/ . Ficheros útiles en el paquete de códecs: * Códecs de Real (usados para reroducir ficheros rv9 por ejemplo) : atrc.so.6.0, cook.so.6.0, sipr.so.6.0, drv3.so.6.0, drv4.so.6.0. * Códecs de Windows Media (wmv9/wma9) : wma9dmod.dll y wmv9dmod.dll. También puedes modificar muchas opcionesa través de la edición de algunos ficheros de texto. * Idioma : Puedes seleccionar fácilmente tu idioma de menú favorito editando el fichero GEEXBOX/etc/lang. Esto no tiene efecto en el lenguaje del DVD (mira en la sección de MPlayer). Si tu idioma no está disponible, puedes traducir el menú a tu propio idioma, lo que conlleva la creación de los archivos GEEXBOX/etc/mplayer/menu_LANG.conf y GEEXBOX/usr/share/mplayer/help_LANG.txt. * MPlayer : Aquí es donde puedes hacer la mayor parte de las configuraciones y ajustes. Las opciones se encuentran en el fichero packages/MPlayer/mplayer.conf. Quizás quieras modificar opciones como tamaño de fuente del OSD (subfont-text-scale). También puedes añadir muchas opciones como idioma por defecto para DVD (ej: alang=es,en). El mejor sitio para encontrar estas opciones es en la pagina man de MPlayer, para usuarios de linux (man -l build/MPlayer-*/DOCS/mplayer.1). Tambien deberias echar un vistazo a la documentación de MPlayer (http://mplayerhq.hu/DOCS/). Otro archivo que quizá quieras modificar es packages/MPlayer/menu.conf. Puedes quitar elementos del menú que no necesites, o, por ejemplo, traducirlos a tu propio idioma. El ultimo archivo que puedes mirar es packages/MPlayer/build, que contiene la selección de opciones que están compiladas en MPlayer. * Salida de TV : La activación de la salida de TV se consigue con la ayuda de múltiples programas dedicados a las diferentes marcas de tarjetas. Actualmente usamos atitvout para las tarjetas Ati, s3switch para las tarjetas S3 y nvtv para las tarjetas Nvidia (y posiblemente las intel i810 y las 3dfx). La configuracion de estos programas se realiza en config/tvout. Ahí puedes seleccionar el estandar de TV que quieras (pal para España, ntsc en Iberoamérica...) y modificar otras opciones específicas de nvtv. * Lirc : Puedes elegir uno de los controladores soportados editando el archivo GEEXBOX/etc/remote. Lirc no puede controlar ATI Rempote Wonder y está siempre activado, asi que no tienes que modificar nada para usarlo. Si quieres cambiar la asignación de teclas para el mando a distancia, mira en el fichero GEEXBOX/etc/lirc/lircrc_REMOTE. * Red : Puedes configurar la red en el archivo GEEXBOX/etc/network. Ahí puedes escoger la dirección IP usada por GeeXboX (por defecto se usa DHCP, y si no funciona, la IP cambia a 192.168.0.54.). También puedes establecer un usuario y contraseña para conectarse a recursos compartidos en máquinas windows (por defecto se conecta únicamente a los recursos que permitan conexiones anónimas). | GENERACIÓN | ~~~~~~~~~~ Primero hecha un vistazo a la sección de personalización detallada más arriba. Para generar la iso únicamente tienes que ejecutar en Linux ./generator.sh o generator.bat bajo windows. | INSTALACIÓN | ~~~~~~~~~~~ Lo primero que necesitas es crear una partición FAT16 con unos 16 MB libres. A partir de aquí, puedes instalar GeeXboX bajo Linux ejecutando ./installator.sh Responde a todas las preguntas y ten mucho cuidado con ellas. Léelas dos veces y, si no entiendes alguna, para la instalación. | COMPILANDO | ~~~~~~~~~~ Lo primero es echar un vistazo a la sección de configuración, más arriba (al menos, la parte general y la que se refiere al tostado en CD). A continuación, puedes crear la iso básicamente con: make O puedes quemarla directamente en CD con: make burn Cuando se haya terminado, puedes ahorrar espacio de disco limpiando el árbol de compilación: make clean o haciendo una limpieza total, incluso borrando las fuentes descargadas: make distclean Existen también otros comandos más avanzados si quieres enredar en las tripas de GeeXboX: scripts/get package # descargar el paquete scripts/unpack package # desempaqueta y prepara el paquete scripts/build package # construye el paquete scripts/install package # instala el paquete con el prefijo $INSTALL scripts/clean package # limpia el árbol de fuentes del paquete make exec # lanza directamente GeeXboX en una jaula # AVISO: esta característica es áltamente experimental # úsala a tu propio riesgo. Si has hecho una versión modificada de GeeXboX, puedes construir fácilmente un pequeño tar.bz2 con: make dist o un tar completo (conteniendo todos los fuentes) con: make fulldist o un generador geexbox con: make generator o un instalador geexbox con: make installator | CONFIGURACIÓN | ~~~~~~~~~~~~~ * Opciones globales: Éste es el primer apartado en el que debes fijarte antes de intentar compilar GeeXboX. Se encuentra en el archivo config/options, y debería explicarse por sí mismo. En este fichero puedes seleccionar la familia de tu CPU, el tema a usar, y si quieres utilizar fuentes truetype o no. Además, deberías modificar la configuración de la grabadora de CD para poder grabar directamente la ISO. * Linux: El archivo packages/linux/linux.conf es una configuración clásica de Linux. Puedes editarlo a mano, o también puedes ejecutar scripts/unpack linux y hacer make menuconfig -C build/linux-* (o utilizar el método que prefieras en vez de menuconfig). Es conveniente que hagas una copia de seguridad de build/linux-*/.config en packages/linux/linux.conf. Lo más "difícil" que puede ocurrir es mantener tamaño del kernel lo suficientemente reducido como para que quepa en una imagen de un disquete de arranque. * Lirc: Lirc te permite controlar GeeXboX a través de un mando a distancia. Lo primero que debes hacer es escoger el archivo que describe tu mando en concreto en build/lirc-*/remotes (despues de hacer scripts/unpack lirc) y añadirlo a packages/lirc/install. A partir de aquí, escoge un dispositivo (por defecto es /dev/ttyS0, o COM1) y el driver lirc y colócalos en un archivo con el nombre packages/lirc/lircd_$REMOTE. Entonces podrás escoger la asignación de teclas en packages/lirc/lircrc_$REMOTE. En cada asignación tienes que seleccionar un botón (coge los nombres del archivo de definición del mando a distancia) y asociarle una acción. Esta acción pertenece a MPlayer, y puedes encontrar un listado en build/MPlayer-*/DOCS/documentation.html#commands. | HACKING | ~~~~~~~ El primer sitio donde debes mirar es en el script de inicialización. De hecho, existen dos scripts de inicialización. El primero está en packages/initrd/linuxrc, aunque no deberías necesitar modificarlo. El segundo se encuentra en config/init y es donde puedes personalizar. Lo siguiente que podría interesarte es la creación de un nuevo "paquete". Un paquete consiste en una gran cantiad de scripts que han de seguir algunas reglas. Todos los scripts deben funcionar sobre un directorio llamado como el programa que quieres empaquetar, dentro del directorio packages. Una lista de scripts que puedes crear: - url: sólo una lista de urls para conseguir los fuentes del programa. - unpack: qué hacer después de desempaquetar los fuentes. Por ejemplo, puedes modificar algunos ficheros de configuración. Ésto no incluye aplicar parches. - need_build: es llamado cuando el paquete ha terminado de compilarse, con el objetivo de estar seguros de que no necesita volver a cons- truirse. Debe borrar el archivo .stamps/"nombre del paquete"/build, si el paquete debe ser recompilado. - build: todos los pasos necesarios para compilar el programa. - install: todos los pasos necesarios para instalar el programa. El prefijo de instalación debe ser $INSTALL. Cuando un archivo de las url se llama patch-nombre_del_programa-... se aplica automáticamente a los fuentes desempaquetados del programa. Además, debes recordar que el software que corre en GeeXboX debe ser compilado con el wrapper gcc de uClibc. Finalmente, el mejor modo de hacer un paquete es observar cómo están hechos otros paquetes. | LICENCIA | ~~~~~~~~ Todos los programas usados por GeeXbox estan protegidos por sus respectivas licencias. Todos ellos son software libre, y la mayoría están cubiertos por la Licencia Pública General GNU (GPL). El propio GeeXboX, incluyendo todos los scripts que son utilizados en el proceso de construcción y compilación, están cubiertos por la Licencia Pública General GNU (GPL). geexbox-1.0/DOCS/README_fr.txt0000644000175000017500000011430410446314256014742 0ustar aurelaurel ooooo oo o o oo o M" "Mo Mo oM" M Mo oM" M oM""Mo oM""Mo "Mo" Mo"""o oM""Mo "Mo" M """M MooooMM MooooMM oMMo M "M M M oMMo "o oM M o M o oM Mo M oM M M oM Mo "MoooM"M "MooM" "MooM" M" "M M"ooo" "MooM" M" "M | AVANT PROPOS | ~~~~~~~~~~~~ La GeeXboX est une sorte "divx box" logicielle. En fait, il s'agit d'un CD bootable qui vous permet de regarder des films ou d'écouter de la musique. Il supporte de nombreux formats tels que avi, mpeg, divx, ogm, rm, mp3, ogg, dvd, vcd et cdda. GeeXboX supporte aussi certains types de télécommandes infra-rouge et les sorties TV de certaines cartes graphiques. Cette archive contient tous les fichiers nécessaires pour générer une image iso personnalisée de la GeeXboX | PREREQUIS | ~~~~~~~~~ Pour générer une iso GeeXboX vous devez posséder l'un des sytémes suivants: - GNU/Linux avec mkisofs et mkzftree. - MAC OS X avec mkisofs et mkzftree. - Windows. Pour installer la GeeXboX, vous aurez besoin : - un système GNU/Linux avec SysLinux. Pour construire votre propre GeeXboX, vous nécessiterez les outils classiques : - un système GNU/Linux opérationnel. - Le compilateur C GCC. - GNU make - La commande patch. - L'assembleur nasm. - bzip2 et gzip. - mkfs.ext2 et mkfs.vfat - L'outil de téléchargement wget (non nécessaire pour le paquetage GeeXboX complet). - mkisofs et mkzftree pour construire l'image ISO. - mkzftree pour compresser les fichiers de l'image ISO. - cdrecord (pour graver l'image). Et environ 1.2 Go d'espace disque disponible. | PERSONALISATION | ~~~~~~~~~~~~~~~ Le but du générateur est de personnaliser facilement sa GeeXboX. La chose la plus interessante que vous puissiez faire et de générer une image comportant une vidéo complète qui sera lu automatiquement au boot. Vous avez juste à copier vos vidéos (ou vos fichiers sons) et vos playlists dans le repertoire iso. Vous pouvez aussi ajouter des codecs propriétaires comme le rv9 ou le wmv9, en les copiant simplement dans le répertoire iso/GEEXBOX/codecs. Ces codecs se trouvent ici : http://www.geexbox.org/releases/geexbox-extra-codecs-nonfree.tar.gz Vous pouvez modifier d'autres options en éditant simplement des fichiers textes. * Langue : Choisissez la langue de vos menus en éditant le fichier generator.sh ou generator.bat (en fonction de votre OS). Cela n'as pas d'effets sur la langue du DVD (voir section MPlayer). Si votre langue n'est pas disponible, vous pouvez toujours traduire un menu. Il suffit de re-créer les fichiers language/menu_LANG.conf and language/help_LANG.txt. * Chargement des firmwares : La GeeXboX supporte de nombreux pilotes de périphériques mais malheureusement, certains d'entre eux requierent un firmware binaire additionnel propriétaire (i.e. non-libre et donc non-inclus dans la GeeXboX). Le firmware est un fichier binaire qui est envoyé au périphérique (PCI ou USB) lorsque le pilote se charge. Pour chaque pilote, le firmware se doit d'être un fichier spécifique avec un nom pré-déterminé. Si vous disposez de matériel à problème qui peut nécessiter la présence d'un firmware additionnel (dans la plupart des cas, il s'agit de cartes WiFi ou DVB), vous devrez chercher sur Internet une page concernant le support de périphérique sous Linux et l'utilisation du firmware. La plupart du temps, vous tomberez sur un lien de téléchargement direct. Des fois, il vous sera nécessaire d'extraire ce firmware depuis une archive de pilotes pour Windows qui ont été fourni par le fabricant du périphérique. Une fois que vous disposerez du fichier de firmware pour votre carte, déposez le simplement dans le répertoire /firmwares. Vous pouvez y stocker autant de firmwares que vous voudrez, la GeeXboX essaiera d'elle même de les charger lorsqu'un pilote en aura besoin. La seule chose dont vous ayez à vous soucier et de disposer des bons fichiers de firmwares avec les bons noms avant de regénérer une nouvelle ISO. Veuillez noter que vous pouvez également utiliser le générateur d'ISO de la GeeXboX qui vous permettra de récupérer les firmwares pour vous. Vous pouvez l'utiliser pour sélectionner tous les fichiers de firmware que vous souhaiter et le générateur les téléchargera et ajoutera pour vous. Assurez vous juste de disposer d'une connexion à Internet lors de l'utilisation du générateur. * MPlayer : C'est ici que se font la plupart des configurations et modifications. Les options se situent dans le fichier packages/MPlayer/mplayer.conf Il est possible de changer des options comme la taille des police de l'OSD (subfont-text-scale) et beaucoup d'autres choses telles que la langue par défaut de lecture des DVD (ex: alang=fr,en). La meilleur façon de comprendre ces options est, pour les utilisateurs de Linux, de se référer au MAN de MPlayer (man -l build/MPlayer-*/DOCS/mplayer.1). D'autres informations sont aussi disponibles sur la documentation officielle (http://mplayerhq.hu/DOCS/). Il peut également être intéressant de modifier le fichier packages/MPlayer/menu.conf. Vous pouvez les menus qui vous semblent inutiles, ou les traduire dans d'autres langues par exemple. Enfin, le dernier intéressant est packages/MPlayer/build, qui contient la sélection d'options de compilation de MPlayer. * Sortie TV : Activer la sortie TV se fait au moyen de nombreux petits utilitaires dédiés chacun à une marque carte graphique. Nous utilisons actuellement atitvout pour les cartes ATI, s3switch pour les cartes S3 et nvtv pour les cartes nVidia (ce qui peut aussi marcher abec les cartes i810 et 3dfx). La configuration de ces programmes se fait dans iso/GEEXBOX/etc/tvout. Vous pouvez y choisir le standard que vous utilisez (pal, secam...) et y modifier les options spécifiques de nvtv. # TV Output Standard (ntsc/pal/secam) TVOUT_STANDARD=pal Vous pouvez également définir le rapport d'image de sortie (mode 4:3 ou 16:9) via la ligne : TVOUT_ASPECT="4:3" Ce paramètre est utilisé à la fois pour la sortie TV et pour l'affichage classique sur moniteurs CRT ou TFT. Vous pouvez également définir les valeurs de hauteur et largeur (en pixels) pour l'affichage, ainsi que les fréquences de rafraichissement horizontal et vertical, dans le cas où vous utiliseriez un écran panoramique ou encore un rétro-projecteur. Ceci peut etre fait en modifiant le contenu du fichier /etc/mplayer/mplayer.conf. Les paramètres suivants sont donnés par défaut (veuillez décommenter les lignes liées à la fréquence de refraichissement si vous souhaiter les utiliser ) : screenw=800 screenh=600 #monitor-hfreq=31.5k-50k #monitor-vfreq=50-90 * Lirc : Choisissez la télécommande supporté en éditant le fichier generator.sh ou generator.bat (en fonction de votre OS). Faite également attention à bien choisir le récepteur infrarouge correspondant dans le même fichier. Si vous désirez modifier le mappage des touches reportez vous au fichier lirc/lircrc_REMOTE. * Réseau : Le réseau est configurable au niveau du fichier iso/GEEXBOX/etc/network. Ici vous reglerez l'adresse IP de la GeeXboX (qui par défaut cherche un serveur DCHP ou prend l'IP 192.168.0.54 si elle n'en trouve pas). Il est aussi possible de lui assigner un login est un mot de passe (par défaut, la GeeXboX ne peut se connecter que sur des partages anonymes). Vous pouvez aussi déclarer des montages NFS dans GEEXBOX/etc/nfs. * WiFi : Par defaut, le système tente de détecter automatiquement votre configuration réseau. Si vous disposez à la fois d'une carte réseau Ethernet classique et d'une carte WiFi, seule cette dernière sera configurée. Vous pourrez avoir à modifier le fichier /etc/network afin d'y configurer vos paramètres réseaux. Dans ce dernier, 4 lignes sont relatives aux cartes sans-fils : PHY_TYPE="auto" # Network physical type (auto|ethernet|wifi) WIFI_MODE="managed" # Wifi working mode (managed|ad-hoc) WIFI_WEP="" # Wifi WEP key WIFI_ESSID="any" # Wifi SSID Vous pouvez soit conserver la détection automatique, soit forcer l'activation du controleur Ethernet ou WiFi. De la même façon, ceci vous permettra de choisir entre le mode managed et le mode de communication dit ad-hoc et de définir à la fois votre clé WEP et le SSID de votre réseau. * Passerelle : La GeeXboX supporte l'accès à Internet. Définissez simplement l'adresse IP de la passerelle dans le fichier /etc/network GATEWAY="" # Gateway IP ("" for DHCP or no internet connection) * Configuration TV : La GeeXboX supporte les entrées et tuners de cartes TV. Le système essaie avec peine de détecter automatiquement le type de carte et de tuners utilisés. Vous pouvez forcer les paramètres et ainsi éviter la tentative de détection automatique. Veuillez modifier le fichier /etc/tvcard tel qu'il suit : # TV CARD/TUNER Model (AUTO for autodetection or look at the following urls) # http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.bttv # http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.tuner TV_CARD=AUTO TV_TUNER=AUTO Laissez le paramètre AUTO si vous souahitez conserver la détection automatique, ou remplacez le par le numéro de la carte et du tuner, comme décrit dans les URL précédentes. Soyez attentifs : pour forcer les types de cartes et de tuners, vous devez connaître les REFERENCES EXACTES de votre matériel. Une fois cela fait, vous devriez être en mesure d'utiliser les entrées TV (Composite et S-VHS) de votre carte TV. De la même manière, vous pouvez utiliser le tuner pour regarder la TV. Pour cela, vous devrez définir votre région ainsi que les fréquences des chaînes que vous souhaitez visionner. Editez simplement le fichier /etc/tvcard : # TV Channels # Syntax : CHAN="Channel Frequency:Channel Title" # Example : # CHAN="29:France 2" # CHAN="K08:Canal +" # TV Channels List # Available : france, europe-east, europe-west, us-bcast, us-cable CHANLIST=france Faites attention lors de l'édition des canaux TV et veillez à utiliser la même syntaxe que décrit ci-dessus et les canaux TV devraient apparaître dans le menu principal. * Configuration Audio : La GeeXboX supporte à la fois la restitution audio via la sortie analogique ou numérique, en utilisant les connecteurs classiques JACK ou RCA SPDIF. Par défaut, la sortie est gérée de manière analogique. Ceci peut etre changé en modifiant le fichier /etc/audio : # Output using SPDIF (yes/no), otherwise ANALOG output SPDIF=no Souvenez vous qu'il est nécessaire de régler la sortie en mode numérique (SPDIF), si vous souhaitez relier votre carte son à un amplificateur hifi externe pour décoder des flux AC3/DTS (en utilisant le mode passthrough). * Post-Processing vidéo : Le Post-Processing est un moyen logiciel pour affiner une image, en la rendant plus nette et plus précise. Cela a par contre l'inconvénient de consommer une partie du temps processeur afin de rendre l'image plus belle. Via l'utilisation des filtres internes à MPlayer, la GeeXboX vous permet de minimiser les effets de blocs horizontaux et verticaux, les effets d'anneaux de dégradés et de corriger automatiquement la luminosité de votre film. Par défaut, le Post-Processing est désactivé, pour éviter de saccader sur de petites configurations matérielles. Il vous est possible de l'activer très simplement en éditant le fichier /etc/mplayer/mplayer.conf : # Set Post Processing (h deblock, v deblock, dering, auto luminance) # Consumes CPU power, disabled for low configs, uncomment to enable it. #vf=pp=hb:a/vb:a/dr:a/al:a * DXR3/Hollywood+ cards : Les utilisateurs de ce type de cartes de décompression n'ont pas besoin d'avoir une carte vidéo ou une carte son dans leur ordinateur. Parmi les inconvénients, on notera néanmoins que seule la sortie TV peut etre utilisée avec ce type de carte (pas d'affichage sur moniteur). Vous pouvez etre amené à définir la norme d'image souhaitée (PAL/NTSC) via le fichier /etc/tvout ainsi que le type de sortie audio à utiliser (Analogique ou SPDIF) via le fichier /etc/audio. * Configuration de la radio : Si vôtre carte TV dispose d'un tuner radio FM intégré, la GeeXboX vous permet d'écouter la radio. Pour cela, il vous faudra modifier le fichier GEEXBOX/etc/radio pour mettre l'option RADIO à yes. Le fichier GEEXBOX/etc/radio contient aussi la définition des stations. Des exemples sont présents dans le fichier. Il suffira de les dé-commenter et de les adapter à vos stations favorites. Le programme d'écoute de la radio ne faisant pas partie de MPlayer, il y a des contrôle de volume séparés pour la radio. Notez que le volume contrôlé est le volume principale. Il pourra donc être nécessaire de le réajuster avant de lancer la TV, une vidéo ou de la musique. * Partage de fichiers via UPnP : UPnP est l'acronyme de Universal Plug & Play et peut se décrire comme un protocole réseau permettant l'auto-découverte de périphériques ainsi que des services qui leur sont associés au sein de votre réseau domestique. La norme UPnP A/V (pour Audio/Video) définit un certains nombre de profiles pour des périphériques permettant le partage et la lecture de fichiers multimédias au sein d'un réseau. Le profile UPnP Media Server permet regroupe tous les périphériques capables de partager des fichiers à des périphériques de type UPnP Media Player ou UPnP Media Renderer, qui sont en mesure de les restituer. La GeeXboX embarque un logiciel de contrôle UPnP (UPnP Control Point) qui permet l'auto-découverte de tous les périphériques de type Media Server de votre réseau local et qui s'occupe de monter leur contenu en toute transparence dans un point de montage dédié (/mnt/UPnP). De cette manière, il vous suffit de disposer d'un PC ou autre périphérique possédant un logiciel compatible avec le profile UPnP Media Server pour que son contenu soit accessible depuis la GeeXboX. Pour plus d'infos sur l'UPnP ainsi que l'utilsiation de quelques serveurs, veuillez vous référer à la page suivante : http://www.geexbox.org/wiki/index.php/Accessing_to_UPnP_Contents * Streaming réseau : GeeXboX permet de rajouter les listes de streams SHOUTcast Radio et TV tout autant que vos propres listes de lecture. (locales et distantes.) L'activation de SHOUTcast se déclare dans le fichier de configuration "GEEXBOX/etc/network". SHOUTcast TV étant succeptible de diffuser des streams nécessitant une inscription particulière ainsi que des streams à caractère pornographique, une liste noire et une liste blanche peuvent être complétées afin de filtrer le contenu selon vos critères (par défaut, les mots clefs définis pour la liste noire sont : "adult xxx porn ESS SWCTV SWPTV Subscription"). La liste noire et la liste blanche sont insensibles à la casse. Vous pouvez créer vos listes de lecture locales et distantes dans le fichier de configuration "GEEXBOX/etc/netstream" (Des exemples sont contenus dans ce fichier). Les listes de lecture distantes concernent uniquement les fichiers M3U Etendus. Note aux utilisateurs (Français uniquement) : Il est possible de receptionner un flux "FreeboxTV" grâce à ce fichier. Pour y parvenir, veuillez suivre la procédure suivante : - dé-commentez l'entrée EXTM3U ad-hoc. - utilisez une version de GeeXboX compilée avec le support de la librairie "LIVE555". (ces deux conditions étant nécessaires à la visualisation du flux) * Cartes DVB : La GeeXboX supporte un grand nombre de cartes DVB (Terrestre i.e. TNT, Cable, ATSC et Satellite) et ce, aussi bien en PCI qu'en USB. Veuillez cependant noter qu'il n'est pour l'instant possible d'utiliser qu'un unique adaptateur DVB à la fois. Certains péripéhriques DVB (particulièrement ceux en USB) peuvent nécessiter un firmware propriétaire additionnel pour fonctionner correctement. Il vous sera peut être utile de jeter un oeil au Wiki DVB de LinuxTV (http://linuxtv.org/wiki/index.php/Main_Page) pour vous assurer que votre carte nécessite un tel firmware ou non. Dans ce cas, le générateur d'ISO pourra le télécharger pour vous. Certains firmwares peuvent être récupérés directement depuis le site Web de LinuxTV (http://linuxtv.org/download/firmware/), d'autres peuvent être inclus dans l'archive de drivers Windows du constructeur de la carte. Veuillez vous référer à la documentation sur le chargement des firmwares dans la GeeXboX pour de plus amples informations. Pour chaque carte, la liste des chaînes disponibles est disponible au sein du menu de MPlayer. Il n'est cependant pas possible d'auto-découvrir ces chaînes automatiquement. De ce fait, la déclaration de chaînes accessibles par DVB dans la GeeXboX peut être fait de différentes manières : - utiliser une liste de chaîne existante : MPlayer a besoin d'un fichier channels.conf valide et fonctionnel pour faire fonctionner la DVB. Ce fichier peut être généré à l'aide d'utilitaire fournis par le paquetage dvb-apps. Utilisez simplement une distribution Linux classique où votre carte DVB a déjà été configurée, téléchargez l'archive linuxtv-dvb-apps depuis le site http://www.linuxtv.org/download/dvb/, compilez le tout et créez le fichier de configuration via l'utilitaire "scan", dans le format "zap" (qui est le format par défaut). Par exemple, pour une carte DVB-S (Satellite) utilisant le fournisseur d'accès Astra-19.2E : wget http://www.linuxtv.org/download/dvb/linuxtv-dvb-apps-1.1.0.tar.bz2 tar jxvf linuxtv-dvb-apps-1.1.0.tar.bz2 cd linuxtv-dvb-apps-1.1.0/util/scan make ./scan -x 0 dvb-s/Astra-19.2E > channels.conf Le drapeau "-x 0" indique que le scan ne tentera pas de se connecter aux chaînes cryptées (généralement payantes). Veuillez tout le temps procéder de la sorte, MPlayer ne gérant de toutes façons pas les chaînes DVB cryptées. Selon votre type de carte DVB, choisissez un fichier de transponders (fournisseur) depuis les répertoires "dvb-s", "dvb-c", "dvb-t" ou "atsc". Ensuite, copiez simplement le fichier channels.conf que vous venez de générer au sein du répertoire /etc/mplayer de l'arborescence GeeXboX du générateur and recompilez une ISO. - utiliser une liste de transpondeur existante : cette procédure est relativement similaire à la précédente à la différence qu'il s'agit cette fois de la GeeXboX qui va s'occuper de scanner les chaînes pour vous et ce, à chaque démarrage. Vous n'aurez ainsi plus besoin d'une autre distribution Linux pour générer le fichier channels.conf. Pour ce faire, rendez-vous simplement sur : http://linuxtv.org/cgi-bin/viewcvs.cgi/dvb-apps/util/scan/ Selon votre type de carte DVB (S/T/C/ATSC), sélectionnez le bon répertoire et choisissez le fichier de liste de fréquences de transpondeurs qui correspond à vos besoins ou votre localisation géographique. Renommez ensuite simplement ce fichier en dvb.conf et copiez le dans le répertoire /etc. Puis, reconstruisez une ISO via le générateur. Au démarrage, si la GeeXboX détecte un fichier de transpondeur valide dans le fichier /etc/dvb.conf, elle l'utilisera pour scanner les chaînes DVB disponibles et générera le fichier /etc/mplayer/channels.conf d'elle-même. ATTENTION : Le scan de chaînes peut être relativement lent selon le type d'émetteur et le nombre de chaînes à découvrir. Ce processus est de plus effectué à chaque démarrage de la GeeXboX si vous l'utilisez en tant que LiveCD. Il est alors hautement recommandé qu'une fois le scan effectué, vous copiez manuellement le fichier /etc/mplayer/channels.conf qui aura été généré quelque part afin de pouvoir le ré-utiliser dans le générateur d'ISO en suivant la première méthode, ou de faire une installation sur disque dur. - utiliser l'installator : il s'agit probablement là de la méthode la plus simple mais recquiert une installation sur disque de la GeeXboX. Au cours du processus d'installation, si un périphérique compatible DVB est reconnu sur votre système, le script d'installation vous demandera de lui-même si vous souhaitez rechercher les chaînes disponibles pour votre carte DVB. L'installator contient la liste complète des fréquences des transpondeurs du site LinuxTV. De ce fait, vous n'aurez qu'à sélectionner votre type de carte ainsi que le transpondeur à utiliser et la GeeXboX s'occupera de scanner letout et de générer le fichier /etc/mplayer/channels.conf. * Menus de Navigation DVD : La GeeXboX propose 2 méthodes de lecture des DVD : - Lecture directe du film (defaut). - Lecture avec support des menus de Navigation DVD (expérimental). La première permet une lecture quasi-assurée de la plupart des DVDs. Une fois inséré, le disque est automatiquement détecté et MPlayer va essayer de lire le chapitre qu'il jugera correspondre au film. Le principal avantage réside dans le fait que toutes les scènes de droit d'auteur, publicités ou menus seront sautées pour permettre une lecture instantannée du film. Néanmoins, dans certaines situations (comme les DVD avec des menus très sophistiqués ou encore les DVD de séries TV, contenant de multiples épisodes et donc chapitres), cette méthode n'est pas précise et vous pourriez ne pas être en mesure de lire votre film correctement. La seconde, bien qu'encore expérimentale avec MPlayer (mais qui a néanmoins de très fortes chances de fonctionner), apporte le support des menus de navigation DVD, vous permettant donc de le lire comme vous le feriez avec n'importe quel lecteur DVD du commerce, avec les avantages et inconvénients qui en découlent. Il vous est bien entendu possible de basculer d'un mode de lecture DVD à un autre au moyen du menu d'options de la GeeXboX, selon le DVD que vous êtes amener à visionner. Il vous est également possible de spécifier la méthode de lecture par défaut au moyen du générateur d'ISO de la GeeXboX. * Capacités d'enregistrement : La GeeXboX permet l'enregistrement en cours de lecture, de même que la fonctionnalité de "pause en direct" (également connue sous le nom anglais de Time-Shifting). Malheureusement, cette opération est extrêmement consommatrice de temps CPU (encodage en temps-réel et lecture simultannée d'un flux vidéo) et, de ce fait, il se peut que vous nécessitiez un ordinateur relativement récent pour être à même de tirer partie de cette fonctionnalité. Le menu de contrôle comporte un sous-menu dédié à cette fonctionnalité d'enregistrement, qui vous permet de vérifier le statut de l'enregistrement (actif/inactif), vérifier le chemin de destination des fichiers enregistrés, mais également démarrer et/ou arrêter le processus d'enregistrement, ou encore de sélectionner le profil d'encodage que vous désirez utiliser. Le processus d'enregistrement peut également être appelé (ou interrompu) au moyen du clavier (via la touche "i") ou au moyen d'une télécommande. Une condition est néanmoins requise pour profiter de la fonctionnalité, à savoir que vous devez disposer d'un espace de stockage des fichiers. Ce dernier peut tout aussi bien être un disque dur interne ou externe qu'un lecteur réseau, connecté par NFS ou Samba. La seule contrainte à considérer réside dans le fait que Linux doit supporter l'accès en écriture au système de fichiers (autrement dit, les partitions NTFS ne sont pas utilisables). Prenez garde lors de l'enregistrement de fichiers au fait que votre disque dur sera remonté en R/W pour permettre le stockage. Une fois l'enregistrement terminé, la GeeXboX tentera de remonter votre disque en R/O, par mesure de sécurité, mais il y a toujours un risque que cela ne soit pas fait. Il est alors vivement recommandé, lors de l'utilisation de cette fonctionnalité, que vous procédiez à une extinction "propre" de l'ordinateur pour éviter toute corruption potentielle de données ou du système de fichiers. Nous n'assumons en aucun cas une éventuelle perte de données sensibles. Le répertoire de destination des fichiers enregistrés doit également être renseigné lors de l'installation ou de la génération de l'image ISO par le générateur. Il s'agit ici de modifier la variable suivante au sein du fichier /etc/recorder : SAVE_PATH="/tmp" Le comportement par défaut consiste à enregistrer les vidéos dans le répertoire /tmp, mais dans la mesure où il s'agit d'un RAMdisk, la GeeXboX est suffisamment intelligente pour refuser cette action. Partant de ce point, il n'y aucune chance que la GeeXboX tente d'enregistrer des fichiers sur votre disque dur à moins que vous n'aillez personnellement spécifié un répertoire de destination valide. De la même façon, il est également possible de choisir le profil d'encodage qui sera utilisé par défaut. Il vous sera toujours possible de le changer en cours d'éxécution, par le biais du menu dédié à l'enregistrement. De nombreux profils sont disponibles (consultez le fichier de configuration /etc/mplayer/mencoder.conf pour une liste exhaustive et les détails de chacun) et proposent chacun différents niveaux de qualité et de vitesse d'encodage. Vous serez amenés à en choisir l'un par rapport à l'autre selon votre puissance CPU. Selon le flux d'entrée (WebTV de faible résolution, TV analogique standard, TV numérique en haute résolution ...), un type de profil peut correspondre mieux qu'un autre. Vous trouverez ci-dessous une liste non-exhaustive des différents profils d'encodages disponibles : - MPEG 1 - MPEG 2 - Video CD (PAL/NTSC) - Super Video CD (PAL/NTSC) - DVD Video (PAL/NTSC) - Stream Dump (peut être utilisé sur des flux DVB de type MPEG-TS par exemple pour éviter un processus de ré-encodage). Le profil d'encodage par défaut doit être renseigné au sein du fichier de configuration /etc/recorder de la manière suivante : RECORD_PROFILE="mpeg1" A moins que vous ne sachiez exactement ce que vous faites, il est grandement recommandé que vous utilisiez le générateur d'images ISO pour choisir le profil par défaut. Lorsque vous regardez un flux TV et que vous débutez son enregistrement, l'image va se bloquer quelques secondes, le temps pour MEncoder de démarrer l'enregistrement, et la GeeXboX va procéder à la lecture en différé du fichier en cours d'enregistrement. Si votre CPU est trop lent, la lecture apparaîtra de manière saccadée, attendant que les images soient encodées. Si cela se produit, il existe 2 cas de figures : - utilisez un PC multimédia plus puissant. - utilisez un profil d'encodage plus rapide (i.e. de moindre qualité). Lorsque vous mettez fin au processus d'enregistrement, la GeeXboX arrêtera MEncoder et va relancer la lecture du flux vidéo original. | GENERATION DE L'ISO | ~~~~~~~~~~~~~~~~~~~ Avant tout, jetez un oeuil sur la section personalisation juste au dessus Sous Linux, l'ISO est générée en lançant la commande suivante: ./generator.sh et sous Windows: generator.exe | INSTALLATION | ~~~~~~~~~~~~ Avant tout, vous devez créer une partition de type FAT16/32 ou EXT2/3 d'une taille d'environ 16 Mo minimum. Puis, vous pouvez installer la GeeXboX depuis Linux en lançant simplement ./installator.sh Répondez ensuite à toutes les questions. Lisez les questions avec attention et stoppez l'installation si vous ne comprenez pas ce que vous faites. Mais le plus simple reste encore de démarrer la GeeXboX depuis le CD est de taper "install" au prompt de démarrage. | BOOT PXE | ~~~~~~~~ Oui, la GeeXboX est capable de booter depuis le réseau sur une machine sans disque ! Pour obtenir cela il vous faudra : - un serveur DHCP - un serveur TFTP - un serveur NFS - une machine supportant le PXE :-) * Depuis un poste GNU/Linux : ------------------------- Il faut tout d'abord configurer le server DHCP pour qu'il envoie les info de boot PXE. Voilà un exemple de configuration avec isc dhcp : allow booting; allow bootp; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.128 192.168.0.192; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; next-server 192.168.0.1; filename "/tftpboot/GEEXBOX/boot/pxelinux.0"; } L'option next-server est l'adresse du server TFTP. Ensuite il faut configurer votre serveur TFTP (tel que atftpd) pour qu'il serve le répertoire /tftpboot et copier une arborescence GEEXBOX complète dans ce répertoire. Par exemple il est possible de copier le contenu d'un CD de GeeXboX depuis un linux AVEC L'OPTION CDROM TRANSPARENT DECOMPRESSION ACTIVE !! (pour vérifier cela, il suffit de regarder si le fichier sbin/init de l'arborescence GeeXboX ne contient pas de caractères totalement incohérents). Si vous avez compilé la GeeXboX vous même a partir des sources, il est aussi possible de générer l'arborescence GEEXBOX avec make pxe. Ensuite il faut éditer le fichier /tftpboot/GEEXBOX/boot/pxelinux.cfg/default pour faire correspondre le nfsroot au bon chemin NFS vers l'arborescence GeeXboX. Enfin il reste a configurer NFS pour qu'il exporte l'arborescence GEEXBOX avec un fichier /etc/exports ressemblant à ceci : /tftpboot/GEEXBOX (ro) et un /etc/hosts.allow ressemblant à : ALL: ALL Ca devrait être bon. Reste a booter la machine PXE et a voir ce qu'il se passe. * Depuis un poste Microsoft Windows : --------------------------------- Pour démarrer en mode PXE depuis un système Microsoft Windows, il vous faudra les logiciels suivants : * Un serveur TFTP et un serveur DHCP ("tftpd32" remplira cette tâche, il est disponible à l'adresse http://tftpd32.jounin.net/). * Un serveur NFS (comme par exemple "Allegro NFS server", disponible à l'adresse http://opensource.franz.com/nfs/). * Une machine supportant le boot en mode PXE. Téléchargez et décompressez (aucune installation n'est requise) le dossier tftpd32 quelque part sur votre disque, par exemple C:\tftpd32 Copiez y une arborescence GEEXBOX complète : C:\tftpd32\GEEXBOX Lancez tftpd32 : - Sélectionnez le dossier C:\tftpd32 pour "current directory". - choisissez l'interface (carte réseau) à utiliser en haut dans "server interface". Ici dans l'exemple une carte avec l'IP 192.168.0.1 - Cliquez sur "setting" et vérifiez que "DHCP server" soit bien cochée. - Dans l'onglet "DHCP server", remplissez les champs, en suivant cet exemple : (se référer à une documentation plus approfondie sur le fonctionnement d'un serveur DHCP pour plus de détails) * IP starting pool : 192.168.0.10 * Size of pool : 10 * Boot file : ./GEEXBOX/boot/pxelinux.0 * WINS/DNS server : 192.168.0.254 * Default router : 192.168.0.254 * Mask : 255.255.255.0 * Domain name : mydomain.net - Faites "save" pour appliquer les modifications. La première partie est terminée, normalement en démarrant la machine cliente (qui doit lancer la GeeXboX), on devrait apercevoir le chargement jusqu'à l'affichage du logo. Le système se bloquera alors, car le serveur NFS n'a pas encore été configuré. Installez "Allegro NFS Server" et configurez le comme suit : - Onglet Exports : * faites un "new name" : et nommez le "/tftpboot/GEEXBOX" * dans "path", juste en dessous : selectionnez le répertoire "C:\tftp32\GEEXBOX" * dans "allowed host list", selectionnez "all". * "Read write" , et "read only user list", selectionnez "root" et "everyone" (pour avoir un log, il suffit de tout cocher dans le dernier onglet). Faites "Appliquer". N'oubliez pas de modifier le fichier C:\tftp32\GEEXBOX\boot\pxelinux.cfg\default et d'y changer l'adresse IP "192.168.0.2" en "192.168.0.1" (ou toute adresse que vous aurez choisie). Il suffit maintenant de démarrer la machine cliente pour amorçer la GeeXboX par le réseau. | COMPILATION | ~~~~~~~~~~~ Tout d'abord, regardez la partie de configuration ci-dessous. Typiquement, la compilation s'effectue simplement au moyen de : make Ou vous pouvez directement compiler et graver l'ISO via : make burn Une fois cela fait, vous pouvez regagner de l'espace disque en effaçant l'arborescence de compilation via : make clean ou en effectant un nettoyage complet, éliminant même les sources téléchargées : make distclean Il existe également des commandes plus avancées si vous désirez effectuer des modifications en profondeur au niveau de la GeeXboX : scripts/get package # télécharge le paquetage scripts/unpack package # prépare le paquetage scripts/build package # compile le paquetage scripts/install package # installe le paquetage dans $INSTALL scripts/clean package # nettoie l'arborescence du paquetage scripts/clean --full package # nettoie les sources du paquetage make exec # lance la GeeXboX dans une cellule # ATTENTION: ceci est une fonction # expérimentale. # Utilisez là à vos propres risques. Si vous avez effectué une version modifiée de la GeeXboX, vous pouvez : construire une archive réduite tar.bz2 via : make dist ou une archive complète (avec l'intégralité des sources) au moyen de : make fulldist ou construire le générateur d'ISO : make generator ou encore l'installateur : make installator ou enfin une arborescence PXE : make pxe | CONFIGURATION | ~~~~~~~~~~~~~ * Options Globales : C'est la première chose dont vous aurez à vous soucier avant d'essayer de compiler la GeeXboX. Elles sont contenues dans le fichier config/options, et devraient être suffisamment explicites. * Linux : Il s'agit d'une configuration Linux classique (packages/linux/linux.conf). Vous pouvez éditer le fichier à la main, ou via scripts/unpack linux suivi de make menuconfig -C build/linux-* (ou utiliser votre méthode préférée en lieu et place de menuconfig). Puis, vous devrez sauvegarder votre fichier build/linux-*/.config dans packages/linux/linux.conf. * Lirc : Lirc vous permet de contrôler la GeeXboX en utilisant une télécommande. En premier lieu, vous aurez à choisir le fichier correspondant à votre télécommande dans build/lirc-*/remotes (après avoir effectué scripts/unpack lirc) et l'ajouterez à packages/lirc/install. Puis, choisissez votre périphérique (par défaut, il s'agit de /dev/ttyS0 (COM1)) et le pilote lirc et mettez le tout dans un fichier nommé packages/lirc/lircd_$REMOTE. Vous pourrez ensuite choisir l'affectation des touches dans le fichier packages/lirc/lircrc_$REMOTE. Pour chaque affectation, vous aurez à chosir un bouton (choisissez leurs noms dans le fichier de définitions de la télécommande) et associez lui une action. L'action sera une de celle disponible dans MPlayer (vous pouvez trouver une liste dans le fichier html build/MPlayer-*/DOCS/documentation.html#commands). | MODIFICATION | ~~~~~~~~~~~~ La première chose dont vous aurez àvous soucier concerne le script d'initialisation. En fait, ils sont 2. Le premier est dans packages/initrd/linuxrc mais vous ne devriez pas avoir besoin de le modifier. Le second est config/init et c'est dans ce dernier que vous aurez de probables modifications à effectuer. Puis, vous pourrez être intéressés par l'ajout de nouveaux paquetages. Un paquetage n'est implement qu'un ensemble de scripts qui se doivent de suivre certaines règles. Tous les scripts se doivent d'être placés dans un répertoire dont le nom coïncide avec celui du programme que vous désirez ajouter, lui-même dans le répertoire packages. Voici une liste de scripts que vous aurez à créer : - url : simple liste d'URLS où sont disponibles les sources. - unpack : que faire après avoir décompresser les sources. Par exemples, vous pouvez modifier les fichiers de configuration. Ceci ne concerne pas l'application de patchs. - need_build : appelé lorsque le paquetage a déjà été compilé, afin de s'assurer qu'il n'aura plus besoin d'être recompilé. Il devrait supprimer le fichier .stamps/"package name"/build si le paquetage nécessite d'être reconstruit. - build : l'ensemble des étapes nécessaires pour compiler le programme. - install : l'ensemble des étapes nécessaires à l'installation du programme. Le préfixe d'installation devrait être $INSTALL. De plus, le répertoire décrivant un paquetage peut contenir de nombreux sous-répertoires additionnels : - config : c'est là que sont situés tous les fichiers de configuration. Ces derniers peuvent être, soit utilisés par le script build pour compiler le paquetage, soit par le script install pour être copiés dans le répertoire /etc de destination. - scripts : ce sous-répertoire peut contenir des scripts d'initialisation lié au paquetage courant et qui seront installés par le script install - patches : ce sous-répertoire peut contenir des patchs destinés à être appliqués aux sources du paquetage, au moment du script unpack. - sources : si des fichiers sont présents dans ce sous-répertoire, ils seront automatiquement copiés dans l'arbre de compilation du paquetage. - init.d : contient les scripts d'initialisation qui seront éxécutés au chargement du système. Vous devez avoir à l'esprit que les applications qui tournent sous le système GeeXboX doivent avoir été compilé avec la librairie uClibc. Enfin, la meilleure manière d'ajouter un paquetage est de s'inspirer de la façon dont les actuels sont faits. | LICENSE | ~~~~~~~ Tous les programmes utilisés par GeeXboX sont protégés par leurs licenses respectives. Tous ces logiciels sont libres et, pour la plupart, protégés par une licence GPL (License Publique Générale) La GeeXboX elle-même, c'est à dire tous les scripts utilisé et le système de compilation, est couvert par la licence GNU-GPL. geexbox-1.0/DOCS/README_it.txt0000644000175000017500000004150710446314256014753 0ustar aurelaurel ooooo oo o o oo o M" "Mo Mo oM" M Mo oM" M oM""Mo oM""Mo "Mo" Mo"""o oM""Mo "Mo" M """M MooooMM MooooMM oMMo M "M M M oMMo "o oM M o M o oM Mo M oM M M oM Mo "MoooM"M "MooM" "MooM" M" "M M"ooo" "MooM" M" "M | INFORMAZIONI | ~~~~~~~~~~~~ GeeXboX è una sorta di software per "divx box". Infatti, è un boot CD stand-alone che permette di vedere film o ascoltare musica. Supporta molti formati, come avi, mpeg, divx, ogm, rm, mp3, ogg, dvd, vcd e cdda. Supporta inoltre qualche telecomando IR e il TV-Out per qualche scheda grafica. Questo archivio contiene gli script che servono per creare un'immagine iso di GeeXboX. | REQUISITI | ~~~~~~~~~ Per creare una iso di GeeXboX, occorre una delle seguenti configurazioni : - un sistema GNU/Linux con mkisofs e mkzftree. - un sistema MAC OS X con mkisofs e mkzftree. - un sistema windows. Per installare GeeXboX, occorre : - un sistema GNU/Linux con syslinux. Per compilare GeeXboX, occorrono dei tools classici : - un sistema GNU/Linux funzionante. - il compilatore C gcc. - GNU make - il comando patch. - l'assembler nasm. - bzip2 e gzip. - mkfs.ext2 e mkfs.vfat - il tool di download wget (non occorre per il pacchetto competo di GeeXboX). - mkisofs e mkzftree per creare l'immagine iso. - mkzftree per comprimere i file nell'immagine iso. - cdrecord (per masterizzare l'immagine). E anche 500 MB di spazio libero su disco. | PERSONALIZZAZIONE | ~~~~~~~~~~~~~~~~~ Quando GeeXboX è installato su disco o generato, è facile da personalizzare. E' possibile aggiugnere alcuni codecs proprietari come rv9 o wmv9, semplicemente aggiugnendoli nella cartella GEEXBOX/codecs. Si possono trovare questi codecs nel pacchetto: http://www.geexbox.org/releases/geexbox-extra-codecs-nonfree.tar.gz E' possibile inoltre modificare molte opzioni. Questo è possibile modificando semplicemente qualche file di testo. * Linguaggio : E' possibile selezionare il linguaggio di menu preferito seguendo la seguente procedura: - Utenti GNU/Linux: Modificare lo script generator.sh prima di eseguirlo, cambiando la linea verso l'inizio del file: "MENU_LANG=en" con il linguaggio preferito. Esempio: se sei italiano, cambia la linea in "MENU_LANG=it". - Utenti Microsoft Windows: Quando viene eseguito, generator.exe permette di selezionare la lingua preferita tramite una lista a tendina. NB : Questa modifica non ha effetti sul linguaggio del DVD (leggere la sezione MPlayer section). Per la lista dei linguaggi disponibili sfogliare la directory "language". Se la tua lingua non è disponibile, puoi tradurre il menù nella tua lingua. Questo comporta la creazione dei file language/menu_LANG.conf e language/help_LANG.txt. * MPlayer : In questa sezione è possibile effettuare la maggior parte della configurazione e tweaking. Le opzioni sono salvate nel file packages/MPlayer/mplayer.conf. E' possibile modificare opzioni come la dimensione del font dell'OSD (subfont-text-scale). E' possibile inoltre aggiungere molte opzioni come la lingua predefinita per il DVD (es: alang=it,en). Il posto migliore per trovare tutte le opzioni, per utenti linux, è la manpage di MPlayer (man -l build/MPlayer-*/DOCS/mplayer.1). Inoltre è consigliato visitare la documentazione di MPlayer (in build/MPlayer-*/DOCS o al link http://mplayerhq.hu/DOCS/). un altro file che è possibile modificare è packages/MPlayer/menu.conf. E' possibile rimuovere gli elementi non utilizzati, oppure è possibile tradurli nella propria lingua. L'ultimo file utile per la configurazione è packages/MPlayer/build che contiene la selezione di opzioni che sono incluse in MPlayer. * uscita TV : L'abilitazione del TV-Out è possibile con l'aiuto di alcune piccole applicazioni dedicate alle varie marche di schede video. Attualmente viene utilizzato atitvout per le schede ATI, s3switch per le schede S3 e nvtv per le schede nVidia cards (e, ove possibile, schede intel i810 e 3dfx). La configurazione di questi programmi è effettuata in config/tvout. In questo file è possibile scegliere lo standard TV (pal, ntsc...) ed è inoltre possibile modificare le opzioni specifiche per nvtv. Si può definire l'aspetto (4:3 o 16:9) in questo file alla linea: TVOUT_ASPECT="4:3" Questo parametro verrà utilizzato sia per il TVOut che per i monitor. E' possibile specificare anche l'altezza/larghezza dello schermo e le frequenze orizzontale e verticale, in caso di schermi non standard, come WideScreens or videoproiettori. Questo può essere fatto modificando il file /etc/mplayer/mplayer.conf. I parametri predefiniti sono indicati di seguito (decommentare le linee relative alle frequenze se si vogliono utilizzare): screenw=800 screenh=600 #monitor-hfreq=31.5k-50k #monitor-vfreq=50-90 * Lirc : E' possibile scegliere uno dei telecomandi supportati modificando il file GEEXBOX/etc/remote. Fare attenzione a scegliere anche il corrispondente ricevitore ir nello stesso file di configurazione. Se si vuole modificare la configurazione dei tasti del proprio telecomando, modificare il file GEEXBOX/etc/lirc/lircrc_TELECOMANDO. * rete : E' possibile configuare la rete nel file GEEXBOX/etc/network. Si può scegliere l'indirizzo IP utilizzato da GeeXboX (il predefinito è di utilizzare DHCP e se non funziona, utilizzare l'ip 192.168.0.54). E' possibile inoltre specificare un login e una password che sarnno usati per connettersi con le condivisioni windows (predefinito: anonimo). E' inoltre possibile dichiarare i mount NFS in GEEXBOX/etc/nfs. * wifi : Come impostazioni predefinite, GeeXboX cerca di rilevare automaticamente le impostazioni di rete. Se sulla macchina sono installate sia una scheda di rete (NIC) e una scheda WiFi, solo quest'ultima sarà impostata. Per impostare correttamente la rete, può essere necessario modificare il file /etc/network. In questo file ci sono 4 linee riguardanti le schede wireless : * PHY_TYPE="auto" # Tipo fisico di rete (auto|ethernet|wifi) * WIFI_MODE="managed" # metodo di utilizzo Wifi (managed|ad-hoc) * WIFI_WEP="" # chiave WEP Wifi * WIFI_ESSID="any" # SSID Wifi Con queste linee è possibile configurare la gran parte delle impostazioni. E' possibile lasciare la rilevazione automatica oppure forzare l'uso della scheda ethernet o dell'adattatore WiFi. Allo stesso modo, è possibile scegliere tra il metodo managed e ad-hoc e definire la propria chiave WEP e SSID. * gateway : GeeXboX supporta l'accesso a Internet. Nel caso in cui tu abbia una connessione Internet, è possibile condividerla con il proprio multimedia box, utilizzando un router o un gateway. Per fare ciò, è necessario definire l'indirizzo IP del gateway nel file /etc/network. * GATEWAY="" # Gateway IP ("" per DHCP o nessuna connesione internet) * configuraqzione tv : GeeXboX supporta le entrate e i sintonizzatori TV. Il sistema cercherà di rilevare automaticamente la scheda e il sintonizzatore. E' possibile forzare le impostazioni e saltare i tentativi di rilevamento. Modificare il file /etc/tvcard come descritto : #TV CARD/TUNER Model (AUTO for autodetection or look at the following urls) #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.bttv #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.tuner TV_CARD=AUTO TV_TUNER=AUTO TVIN_STANDARD=pal Lasciare il parametro AUTO se si vuole mantenere il rilevazione automatica, oppure sostiruirlo con il numero del tipo di scheda e sintonizzatore in possesso, in base alle informazioni dei precedenti URL. Prestare molta attenzione: per forzare il tipo si scheda e sintonizzatore occorre conoscere l' ESATTO MODELLO del proprio hardware. Successivamente, dovrebbe essere possibile utilizzare l'input TV (Composito e S-VHS) della propria scheda TV. Allo stesso modo, sarà possibile usare il sintonizzatore per guardare la TV. Per fare ciò, è necessario specificare la regione di appartenenza e la frequenza dei canali TV che si vogliono visualizzare. Anche questa volta basta modificare il file /etc/tvcard : # TV Channels # Syntax : CHAN="Channel Frequency:Channel Title" # Example : # CHAN="29:France 2" # CHAN="K08:Canal +" # TV Channels List # Available : france, europe-east, europe-west, us-bcast, us-cable CHANLIST=france Prestare attenzione nell'usare la stessa sintassi descritta sopra, affinchè i canali TV siano presenti nel menu principale. * configurazione audio : GeeXboX supporta sia l'ourput audio analogico che digitale attraverso i connettori jack o RCA SPDIF. L'uscia predefinita è quella analogica. E' possibile cambiare tale impostaizone modificando il file /etc/audio : # Output using SPDIF (yes/no), otherwise ANALOG output SPDIF=no Ricorda che è necessario impostare l'uscita su SPDIF se si vuole collegare la scheda audio ad un amplificatore esterno per decodificare gli stream AC3/DTS (utilizzando il passthrough mode). * Scheda DXR3/Hollywood+ : Gli utenti con questo tipo di scheda di decompressione hardware NON hanno bisogno di una scheda video o audio per utilizzare GeeXboX. Per contro, è possibile utilizzare solo l'uscita TV con le schede DXR3 (niente monitor). E' necessario specificare il corretto stadard (PAL/NTSC) nel file /etc/tvout e il tipo di uscita audio da utilizzare (Analogica o SPDIF) in /etc/audio. | CREAZIONE | ~~~~~~~~~ Prima di tutto, leggere la sezione di personalizzaizone qui sopra. Una vota personalizzata, è possibile crare la iso sotto Linux, lanciando ./generator.sh o sotto windows, lanciando generator.exe | INSTALLAZIONE | ~~~~~~~~~~~~~ Inizialmente è necessario creare una partizione FAT16 con circa 16 MB di spazio libero. E' possibile installare GeeXboX sotto linux lanciando ./installator.sh E rispondendo alle domande poste dal programma. Ponete molta attenzione durante questi passaggi. Leggere due volte ogni domanda e uscire dall'installazione se non si capisce una domanda. | PXE BOOT | ~~~~~~~~ Sì, GeeXboX può avviarsi dalla rete da una stazione denza disco! Per raggiungere lo scopo è necessario: - un server DHCP - un server TFTP - un server NFS - una stazione che può utilizzare PXE :-) Configurare il server dhcp affinchè invii le informazioni di boot PXE. Ecco un esempio con isc dhcp : allow booting; allow bootp; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.128 192.168.0.192; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; next-server 192.168.0.1; filename "/tftpboot/GEEXBOX/boot/pxelinux.0"; } L'opzione next-server è l'indirizzo del server TFTP. Configurare il server TFTP (ad esempio atftpd) affichè pubblichi la cartella /tftpboot e copiare l'intera direcroty GEEXBOX in questa cartella. Ad esempio, si può copiare il contenuto di un CD GeeXboX da un sistema linux CON "CDROM TRANSPARENT DECOMPRESSION" ABILITATA !! (per verificare questo, controllare il file sbin/init nella directory GeeXboX e verificare che non contenga sporcizia) Se è stato compilato GeeXboX dai sorgenti, è possibile anche generare la directory GEEXBOX con make pxe. Modificare il file /tftpboot/GEEXBOX/boot/pxelinux.cfg/default per impostare nfsroot al giusto percorso NFS della directory GEEXBOX. Infine impostare NFS per esportare la directory GEEXBOX tramite /etc/exports contenente una riga simile alla seguente : /tftpboot/GEEXBOX (ro) e /etc/hosts.allow contenente qualcosa come: ALL: ALL Dovrebbe funzionare. Avviare la stazione PXE e vedere quello che accade. | COMPILAZIONE | ~~~~~~~~~~~~ Prima di tutto è consigliabile controllare la sezione di configurazione subito sotto (almeno la parte generale). Dopo di ciò, compilare l'immagine iso con : make Oppure è possibile masterizzare direttamente l'immagine con : make burn Quando la compilazione è completata, è possibile liberare spazio su disco pulendo la directory di compilazione : make clean oppure facendo una pulizia completa, eliminando anche i sorgenti scaricati : make distclean Ci sono anche comandi più avanzati, se si vuole fare un po' di hack di GeeXboX: scripts/get package # scarica il pacchetto scripts/unpack package # scompatta e prepara il pacchetto scripts/build package # compila il pacchettobuild scripts/install package # installa il pacchetto con il prefisso $INSTALL scripts/clean package # pulisce la directory dei sorgenti del pacchetto make exec # lancia direttamente GeeXboX in una [prigione] # ATTENZIONE: funzione sperimentale, # usare a proprio rischio. Se avete fatto una versione modificata di GeeXboX, è possibile compilare facilmente un piccolo tar.bz2 con : make dist oppure un tar completo (contenente tutti i sorgenti) con : make fulldist oppure un geexbox generator con : make generator oppure un geexbox installator con : make installator oppure una directory per pxe con : make pxe | CONFIGURAZIONE | ~~~~~~~~~~~~~~ * Opzioni generali : Questa è la prima cosa alla quale prestare attenzione prima di provare a compilare GeeXboX. Tali opzioni sono memorizzate nel file config/options, e dovrebbero spiegarsi da sole. Si può scegliere la famiglia di CPU, il tema, e se si vogliono font truetype o no. E' possibile modificare la configurazione del masterizzatore cd per poter masterizzare direttamente l'immagine iso. * Linux : Questa è una configurazione classica di linux (packages/linux/linux.conf). E' possibile modificarla a mano, oppure usare anche scripts/unpack linux e make menuconfig -C build/linux-* (o utilizzare il metodo preferito al posto di menuconfig). Infine fare un backup di build/linux-*/.config in packages/linux/linux.conf. * Lirc : Lirc permette di controllare GeeXboX usando un telecomando. Inizialmente occorre scegliere il file che descrive il proprio telecomando in build/lirc-*/remotes (dopo aver eseguito scripts/unpack lirc) e aggiungerlo in packages/lirc/install. Fatto questo, occorre scegliere la periferica (la predefinita è /dev/ttyS0 (COM1)) e il driver lirc, inserendoli in un file chiamato packages/lirc/lircd_$TELECOMANDO. E' possibile definire i tasti nel file packages/lirc/lircrc_$TELECOMANDO. Per ogni definizione occorre selezionare un tasto (utilizzando i nomi nel file di descrizione del telecomando) e associare un'azione a tale tasto. L'azione è una delle azioni di MPlayer's (si può trovare una lista nel file html build/MPlayer-*/DOCS/documentation.html#commands). | HACKING | ~~~~~~~ La prima cosa da controllare sono gli script di inizializzazione. Infatti, ci sono due script di installazione. Il primo è in packages/initrd/linuxrc, ma non ci dovrebbe essere bisogno di modificarlo. Il secondo è in config/init ed è quello in cui è possibile aggiongere qualche personalizzazione. La cosa successiva che può interessare è la creazione di un nuovo "pacchetto". Un pacchetto è un insieme di script che seguono alcune regole. Tutti gli script devono essere memorizzati in una directory chiamata come il programma che si vuole "impacchettare", che sta nella directory packages. Di seguito la lista degli script da cerare : - url : una lista di url dove trovare i sorgenti del programma. - unpack : cosa fare dopo aver scompattato i sorgenti. Ad esempio, è possibile modificare i file di configurazione. Questo non include l'applicazione delle patch. - need_build : chiamato quando il pacchetto è già compilato, per essere sicuri che non necessita di ricompilazione. Dovrebbe eliminare il file .stamps/"nome pacchetto"/build se il pacchetto necessita di ricompilazione. - build : tutti i passaggi necessari per compilare il programma. - install : tutti i passaggi necessari per installare il programma. Il prefisso di installazione deve essere $INSTALL. Quando un file degli url è chiamato patch-nome_programma-... è applicato automaticamenteit ai sorgenti scompattati del programma. Ricordare inoltre che il software utilizzato in GeeXboX deve essere compilato con il gcc wrapper uClibc. Se si è ancora incerti, la via migliore per creare un pacchetto è guardare come sono fatti gli altri pacchetti. | LICENZA | ~~~~~~~ Tutti i programmi utilizzati da GeeXboX sono protetti dalle rispettive licenze. Sono tutti software liberi e molti di questi sono regolati dalla GNU General Public License. GeeXboX per sè, intesa come tutti gli script utilizzati nel processo di compilazione, sono regolati dalla GNU General Public License. geexbox-1.0/DOCS/README_ru.txt0000644000175000017500000010165310446314256014764 0ustar aurelaurel ooooo oo o o oo o M" "Mo Mo oM" M Mo oM" M oM""Mo oM""Mo "Mo" Mo"""o oM""Mo "Mo" M """M MooooMM MooooMM oMMo M "M M M oMMo "o oM M o M o oM Mo M oM M M oM Mo "MoooM"M "MooM" "MooM" M" "M M"ooo" "MooM" M" "M О GeeXboX. GeeXboX - Ñвоего рода "divx коробка". ФактичеÑки, Ñто незавиÑимый загрузочный CD, который позволÑет Ñмотреть фильмы и Ñлушать музыку. GeeXboX поддерживает много форматов, например, такие как: avi, mpeg, divx, ogm, rm, mp3, ogg, dvd, vcd и cdda. GeeXboX также поддерживает некоторые ir-пульты диÑтанционного ÑƒÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸ tv-out Ð´Ð»Ñ Ð½ÐµÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… графичеÑких карт. Этот архив Ñодержит необходимые Ñценарии Ð´Ð»Ñ Ñборки iso образа GeeXboX. ТребованиÑ. Ð”Ð»Ñ Ð³ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ð¸ iso образа GeeXboX необходимо одно из Ñледующего: - GNU/Linux ÑиÑтема Ñ mkisofs и mkzftree - MAC OS X ÑиÑтема Ñ mkisofs и mkzftree - windows ÑиÑтема Ð”Ð»Ñ ÑƒÑтановки GeeXboX, Вам потребуетÑÑ: - GNU/Linux ÑиÑтема Ñ syslinux Ð”Ð»Ñ Ñборки GeeXboX, Вам будут необходимы некоторые клаÑÑичеÑкие инÑтрументы: - Ñ€Ð°Ð±Ð¾Ñ‚Ð°ÑŽÑ‰Ð°Ñ GNU/Linux ÑиÑтема - gcc C компилÑтор - GNU make - patch - nasm assembler - bzip2 и gzip - mkfs.ext2 и mkfs.vfat - wget загрузчик (не требуетÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð»Ð½Ð¾Ð³Ð¾ набора GeeXboX) - mkisofs и mkzftree Ð´Ð»Ñ Ñборки iso образа - mkzftree Ð´Ð»Ñ ÑÐ¶Ð°Ñ‚Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² iso образа - cdrecord (Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð¶Ð¸Ð³Ð° iso образа) Так же необходимы 1.2 Гб Ñвободного меÑта на жеÑтком диÑке. ПерÑÐ¾Ð½Ð°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ ÐšÐ¾Ð³Ð´Ð° GeeXboX уÑтановлен на жеÑткий диÑк или Ñгенерирован, его довольно легко перÑонализировать. Ð’Ñ‹ можете добавить некоторые проприетарные кодеки, такие как rv9 или wmv9, проÑто, помеÑтив их в директорию GEEXBOX/codecs. Ð’Ñ‹ можете найти Ñти кодеки в пакете на http://www.geexbox.org/releases/geexbox-extra-codecs-nonfree.tar.gz Также Ð’Ñ‹ можете изменить много опций. Ð”Ð»Ñ Ñтого проÑто отредактируйте некоторые текÑтовые файлы. Язык - можно легко выбрать предпочитаемый Вами Ñзык меню, ÑÐ»ÐµÐ´ÑƒÑ Ð¿Ñ€Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ð¾Ð¹ ниже процедуре: - GNU/Linux пользователи: Отредактируйте Ñкрипт generator.sh перед его выполнением и измените Ñтроку в начале: "MENU_LANG=en" на предпочитаемый Вами Ñзык. Ðапример, еÑли Ð’Ñ‹ француз, измените Ñто так "MENU_LANG=fr". - Microsoft Windows пользователи: ПоÑле запуÑка generator.exe предоÑтавлÑет комбинированный ÑпиÑок, который позволÑет выбрать, предпочитаемый Вами Ñзык. Замечание: Ñто не влиÑет на Ñзык DVD (Ñмотрите раздел MPlayer). ПожалуйÑта, проÑмотрите директорию "language", в ней ÑпиÑок доÑтупных Ñзыков. ЕÑли Ваш Ñзык не доÑтупен, Ð’Ñ‹ можете перевеÑти меню на Ваш Ñзык. Выполнить Ñто проÑто, Ñоздав language/menu_LANG.conf и language/help_LANG.txt, и добавив LANG в language/lang.conf. MPlayer: ЗдеÑÑŒ Ð’Ñ‹ можете уÑтановить большинÑтво параметров конфигурации и выполнить наÑтройки. Опции задаютÑÑ Ð² файле packages/MPlayer/mplayer.conf. Можно модифицировать такие опции, как, например, размер OSD шрифта (subfont-text-scale). Так же можно добавить много опций, таких, как предопределенный Ñзык DVD (например, alang=fr,en). Лучшее меÑто, где можно найти опиÑание - Ñто руководÑтво MPlayer Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÐµÐ¹ Linux (man -l build/MPlayer-*/DOCS/mplayer.1). Ð’Ñ‹ так же должны ознакомитьÑÑ Ñ Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸ÐµÐ¹ MPlayer (в build/MPlayer-*/DOCS или на http://mplayerhq.hu/DOCS/). Другой файл, который Ð’Ñ‹ можете модифицировать - Ñто packages/MPlayer/menu.conf. Можно убрать чаÑти не нужные Вам, или например, перевеÑти, нужные чаÑти на Ваш Ñзык. Затем, поÑледний файл, на который Ñледует обратить внимание Ñто packages/MPlayer/build. Он Ñодержит набор опций, которые будут вÑтроены в MPlayer. tv-out: Включение tv-out доÑтигаетÑÑ Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ набора маленьких программ, предназначенных Ð´Ð»Ñ Ñ€Ð°Ð·Ð»Ð¸Ñ‡Ð½Ñ‹Ñ… видеокарт разных брÑндов. Ð’ наÑтоÑщее времÑ, мы иÑпользуем atitvout Ð´Ð»Ñ ATI карт, s3switch Ð´Ð»Ñ S3 карт и nvtv Ð´Ð»Ñ nVidia карт (и, возможно, intel i810 и 3dfx). Эти программы конфигурируютÑÑ Ð² config/tvout. ЗдеÑÑŒ Ð’Ñ‹ можете выбрать, желаемый tv Ñтандарт (pal, ntsc...), а так же модифицировать Ñпециальные опции Ð´Ð»Ñ nvtv. # TV Output Standard (ntsc/pal/secam) TVOUT_STANDARD=pal ПожалуйÑта, заметьте, что Ð’Ñ‹ так же можете определить выходное Ñоотношение (Ñкажем 4:3 или 16:9 Ñкран) в Ñтом файле, Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€ÑƒÑ Ñтроку: TVOUT_ASPECT="4:3" Этот параметр будет иÑпользоватьÑÑ Ð¸ Ð´Ð»Ñ tv-out и Ð´Ð»Ñ Ð¾Ð±Ñ‹Ñ‡Ð½Ð¾Ð³Ð¾ (CRT/TFT) диÑплеев. Ð’Ñ‹ можете так же определить желаемые Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð²Ñ‹Ñоты/ширины Вашего диÑÐ¿Ð»ÐµÑ Ð¸ горизонтальные и вертикальные чаÑтоты Ð´Ð»Ñ Ñ‚Ð°ÐºÐ¸Ñ… Ñлучаев, как широкий Ñкран или видеопроектор. Это может быть выполнено, редактированием /etc/mplayer/mplayer.conf файла. Параметры по-умолчанию показаны ниже (пожалуйÑта, раÑкомментируйте Ñтроки, отноÑÑщиеÑÑ Ðº чаÑтоте, еÑли Ð’Ñ‹ хотите иÑпользовать их): screenw=800 screenh=600 #monitor-hfreq=31.5k-50k #monitor-vfreq=50-90 Lirc : Ð’Ñ‹ можете выбрать один из поддерживаемых пультов диÑтанционного управлениÑ, Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€ÑƒÑ Ñ„Ð°Ð¹Ð» GEEXBOX/etc/remote. Так же позаботьтеÑÑŒ о выборе ÑоответÑтвующего ir приемника в том же конфигурационном файле. ЕÑли Ð’Ñ‹ хотите изменить привÑзку клавиш Вашего пульта диÑтанционного управлениÑ, поÑмотрите в файле GEEXBOX/etc/lirc/lircrc_REMOTE. Сеть: Ð’Ñ‹ можете Ñконфигурировать Ñеть в файле GEEXBOX/etc/network. ЗдеÑÑŒ Ð’Ñ‹ можете выбрать ip адреÑ, иÑпользуемый GeeXboX (изначально иÑпользуетÑÑ DHCP и еÑли Ñто не Ñрабатывает, возвращаемÑÑ Ðº 192.168.0.54). Ð’Ñ‹ можете также определить логин и пароль, которые будут иÑпользоватьÑÑ Ð´Ð»Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ð´Ð¾Ñтупными реÑурÑами windows (изначально будет только Ñоединение Ñ Ð°Ð½Ð¾Ð½Ð¸Ð¼Ð½Ð¾ доÑтупными реÑурÑами). Ð’Ñ‹ можете так же объÑвить монтирование некоторых NFS в GEEXBOX/etc/nfs. wifi: Изначально, GeeXboX пытаетÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡ÐµÑки определить Ваши Ñетевые уÑтановки. ЕÑли Ð’Ñ‹ имеете обе традиционные NIC и WiFi карты только поÑледнÑÑ Ð±ÑƒÐ´ÐµÑ‚ задейÑтвована. Ð’Ñ‹ можете изменить /etc/network файл Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ð’Ð°ÑˆÐ¸Ñ… Ñетевых уÑтановок. Ð’ нем 4 Ñтроки отноÑÑÑ‚ÑÑ Ðº беÑпроводным картам : - PHY_TYPE="auto" # физичеÑкий тип Ñети (auto|ethernet|wifi) - WIFI_MODE="managed" # wifi рабочий режим (managed|ad-hoc) - WIFI_WEP="" # wifi WEP ключ - WIFI_ESSID="any" # wifi SSID Эти Ñтрочки позволÑÑŽÑ‚ Вам Ñконфигурировать большинÑтво уÑтановок. Ð’Ñ‹ можете разрешить включение Ð°Ð²Ñ‚Ð¾Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¸Ð»Ð¸ Ñвно указать иÑпользование ethernet или wifi адаптеров. Тем же путем можно выбрать между управлÑемым и ad-hoc режимом и определить Ваш WEP ключ и SSID. gateway: GeeXboX поддерживает доÑтуп к Internet. Ð’ Ñлучае, когда у Ð’Ð°Ñ ÐµÑть Ñоединение Ñ Internet, Ð’Ñ‹ можете Ñделать его доÑтупным Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ Вашего мультимедиа набора, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ router или gateway. Ð”Ð»Ñ Ñтого, проÑто задайте gateway ip Ð°Ð´Ñ€ÐµÑ Ð² файле /etc/network. - GATEWAY="" # Gateway ip ("" Ð´Ð»Ñ DHCP или отÑутÑтвующего internet ÑоединениÑ) tv конфигурациÑ: GeeXboX поддерживает tv ввод и приемники. СиÑтема уÑердно ÑтараетÑÑ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡ÐµÑки определить карту и приемник. Ð’Ñ‹ можете задать уÑтановки и отменить попытку автоопределениÑ. ПожалуйÑта, измените /etc/tvcard, как показано: #TV CARD/TUNER Model (AUTO Ð´Ð»Ñ Ð°Ð²Ñ‚Ð¾Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¸Ð»Ð¸ поÑмотрите по Ñледующим интернет адреÑам) #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.bttv #http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.tuner TV_CARD=AUTO TV_TUNER=AUTO TVIN_STANDARD=pal ПожалуйÑта, оÑтавьте AUTO параметр, еÑли желаете задейÑтвовать автоопределение, или замените его номером Вашей карты и типом приемника, в ÑоответÑтвии Ñ Ð¿Ñ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰Ð¸Ð¼Ð¸ интернет адреÑами. ПожалуйÑта, будьте оÑторожны: в Ñлучае ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ ÐºÐ°Ñ€Ñ‚Ñ‹ и типов приемников, Ð’Ñ‹ должны знать ТОЧÐЫЕ Ð¥ÐРÐКТЕРИСТИКИ Вашего аппаратного обеÑпечениÑ. Выполнив Ñто, Ð’Ñ‹ должны быть ÑпоÑобны иÑпользовать tv входы (Composite и S-VHS) на Вашей tv карте. Тем же путем, Ð’Ñ‹ можете иÑпользовать приемник Ð´Ð»Ñ Ð¿Ñ€Ð¾Ñмотра tv. Ð”Ð»Ñ Ñтого, Ð’Ñ‹ должны будете задать регион принадлежноÑти и чаÑтоту tv каналов, которые Ð’Ñ‹ хотите Ñмотреть. Еще раз, проÑто отредактируйте файл /etc/tvcard: # tv каналы # ÑинтакÑ: CHAN="чаÑтота канала:название канала" # пример: # CHAN="29:France 2" # CHAN="K08:Canal +" # ÑпиÑок tv каналов # доÑтупные: france, europe-east, europe-west, us-bcast, us-cable CHANLIST=france ПожалуйÑта, будьте оÑторожны, когда редактируете каналы и проÑто иÑпользуйте такой ÑинтакÑиÑ, как указан выше, и tv каналы будут приÑутÑтвовать в оÑновном меню. аудио конфигурациÑ: GeeXboX поддерживает оба - аналоговый и цифровой аудио выходы через Ñтандартные JACK Ñоединители или через RCA SPDIF. Изначально, уÑтановлен аналоговый выход. Ð’Ñ‹ можете изменить Ñто, Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€ÑƒÑ Ñ„Ð°Ð¹Ð» /etc/audio: # Выход, иÑпользующий SPDIF (yes/no), иначе ANALOG выход SPDIF=no Помните, что Вам потребуетÑÑ ÑƒÑтановка выхода в SPDIF, еÑли Ð’Ñ‹ захотите Ñоединить Вашу звуковую карту Ñ ÐºÐ°ÐºÐ¸Ð¼-нибудь внешним уÑилителем Ð´Ð»Ñ Ð´ÐµÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ AC3/DTS потоков (иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ñквозной режим). видео обработка: Обработка Ñто программный путь Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð±Ð¾Ð»ÐµÐµ гладкого и более точного предÑÑ‚Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð’Ð°ÑˆÐ¸Ñ… видео запиÑей. Это, тем не менее, задейÑтвует доÑтаточно реÑурÑов CPU Ð´Ð»Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÐºÐ°Ð´Ñ€Ð¾Ð² но, как результат, они выглÑдÑÑ‚ гораздо лучше. ИÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð²Ð½ÑƒÑ‚Ñ€ÐµÐ½Ð½Ð¸Ðµ фильтры MPlayer, GeeXboX позволÑет выполнÑть h/v разблокирование, шумоподавление и автоподÑветку Ð´Ð»Ñ ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ. Изначально, обработка отключена Ð´Ð»Ñ Ð¸Ð·Ð±ÐµÐ¶Ð°Ð½Ð¸Ñ Ð·Ð°Ð¿Ð°Ð·Ð´Ñ‹Ð²Ð°Ð½Ð¸Ñ Ð½Ð° Ñлабых ÑиÑтемах. Ð’Ñ‹ можете включить ее проÑто Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€ÑƒÑ Ñ„Ð°Ð¹Ð» /etc/mplayer/mplayer.conf: # УÑтановка обработки (h разблокирование, v разблокирование, шумоподавление, автоподÑветка) # Поглощает CPU мощноÑть, отключено Ð´Ð»Ñ Ñлабых ÑиÑтем, раÑкомментируйте Ð´Ð»Ñ Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ #vf=pp=hb:a/vb:a/dr:a/al:a DXR3/Hollywood+ карты: ПользователÑм Ñ Ð°Ð¿Ð¿Ð°Ñ€Ð°Ñ‚Ð½Ñ‹Ð¼ обеÑпечением подобного типа разжимающих карт даже ÐЕ нужно иметь видео и звуковую карту Ð´Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ GeeXboX. Так, только tvout коннектор может быть иÑпользован Ñ DXR3 картами (нет CRT диÑплеÑ). Ð’Ñ‹ можете уÑтановить требуемую нормировку образа (PAL/NTSC) в файле /etc/tvout и качеÑтво выходного аудио, которое Ð’Ñ‹ хотите иÑпользовать (Ðналоговый или SPDIF) в /etc/audio. ГенерациÑ. Во-первых, ознакомьтеÑÑŒ Ñ Ð¿ÐµÑ€Ñонализационной чаÑтью приведенной выше. Затем, в оÑновном, Ð’Ñ‹ можете Ñгенерировать iso под Linux, выполнив ./generator.sh или под windows, выполнив generator.exe Дополнительные подзаголовочные шрифты. Во-первых, убедитеÑÑŒ, что Ваш шрифт не включен в официальный GeeXboX пакет, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð³ÐµÐ½ÐµÑ€Ð°Ñ‚Ð¾Ñ€ и определÑÑ Ð’Ð°Ñˆ шрифт в вышеуказанной Ñекции. БольшинÑтво шрифтов уже включены в официальный пакет, некоторые поддерживаютÑÑ, но не включены по причине их чрезмерной величины (например, китайÑкие шрифты). ÐžÐ±Ñ‰Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ°: Ð”Ð»Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ¸ новых шрифтов Ð’Ñ‹ должны извлечь ваш шрифт в шрифт директорию и добавить название шрифта в language/lang.conf - Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ FONTS. Поддержка китайÑкого: Ð”Ð»Ñ Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ ÐºÐ¸Ñ‚Ð°Ð¹Ñких шрифтов в генерируемом geexbox iso Ð’Ñ‹ должны получить любой - big5 или gb2312 шрифт из раÑпроÑтранÑемых Ñ MPlayer шрифтов: http://www1.mplayerhq.hu/MPlayer/contrib/fonts/chinesefonts/ и раÑпаковать, и Ñкопировать в директорию генератора ./font/big5 или ./font/gb2312, ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ Ð¾ÐºÐ°Ð½Ñ‡Ð¸Ð²Ð°ÐµÑ‚ÑÑ Ð½Ð° `24` (размер шрифта 24). Ðапример, еÑли Ð’Ñ‹ желаете иÑпользовать 'gb2312 kai' шрифт: - GNU/Linux пользователи: wget http://www1.mplayerhq.hu/MPlayer/contrib/fonts/chinesefonts/gb2312-kai.tar.bz2 tar -jxf gb2312-kai.tar.bz2 mv gb2312-kai/gkai00mp24 ../path/to/generator/font/gb2312 - Windows пользователи: Перепишите http://www1.mplayerhq.hu/MPlayer/contrib/fonts/chinesefonts/gb2312-kai.tar.bz2 Откройте его Ñ WinZip И извлеките gb2312-kai\gkai00mp24 директорию из архива в ..\path\to\generator\font\gb2312 Поддержка корейÑкого: Ðналогично поддержке китайÑкого шрифта, только получить euc-kr шрифт Ð’Ñ‹ можете из: http://www1.mplayerhq.hu/MPlayer/contrib/fonts/korean/ Хорошим выбором будет иÑпользование dotum20.tar.gz euc-kr шрифта и раÑпаковка, и копирование в директорию генератора ./font/euc-kr путем, Ñходным Ñ Ñ€Ð°ÑÑмотренным выше. УÑтановка. Во-первых, Вам нужно Ñоздать FAT16/32 или EXT2/3 раздел Ñ, по меньшей мере, 16 Мб Ñвободного меÑта. Затем, Ð’Ñ‹ можете уÑтановить GeeXboX под Linux, выполнив ./installator.sh Затем, ответьте на вÑе вопроÑÑ‹. Будьте оÑторожны в течении Ñтого шага. Прочтите дважды каждый Ð²Ð¾Ð¿Ñ€Ð¾Ñ Ð¸ оÑтановите уÑтановку, еÑли Ð’Ñ‹ не понимаете один из вопроÑов. Ðо легчайшим путем уÑтановить GeeXboX, оÑтаетÑÑ ÐµÐ³Ð¾ загрузка Ñ CD и ответ "install" на загрузочное Ñообщение isolinux. PXE загрузка. Да, GeeXboX может загружатьÑÑ Ð¸Ð· Ñети на бездиÑковую Ñтанцию! Ð”Ð»Ñ Ð´Ð¾ÑÑ‚Ð¸Ð¶ÐµÐ½Ð¸Ñ Ñтого Вам потребуютÑÑ: - DHCP Ñервер - TFTP Ñервер - NFS Ñервер - PXE ÑовмеÑÑ‚Ð¸Ð¼Ð°Ñ ÑÑ‚Ð°Ð½Ñ†Ð¸Ñ :-) ИÑпользование GNU/Linux ÑиÑтемы: Во-первых, Ñконфигурируйте Ваш dhcp Ñервер Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ´Ð°Ñ‡Ð¸ Вашей PXE загрузочной информации. Вот пример Ñ isc dhcp: allow booting; allow bootp; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.128 192.168.0.192; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; next-server 192.168.0.1; filename "/tftpboot/GEEXBOX/boot/pxelinux.0"; } next-server Ð¾Ð¿Ñ†Ð¸Ñ Ñто Ð°Ð´Ñ€ÐµÑ TFTP Ñервера. Затем Ñконфигурируйте Ваш TFTP Ñервер (так же, как atftpd), Ð´Ð»Ñ Ñервера Ñто /tftpboot директориÑ, и Ñкопируйте полноÑтью GEEXBOX дерево в Ñту директорию. Ðапример, Ð’Ñ‹ можете Ñкопировать Ñодержимое GeeXboX CD из linux С ВКЛЮЧЕÐИЕМ ПРОЗРÐЧÐОЙ РÐСПÐКОВКИ CDROM! (Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ Ñтого, поÑмотрите в файл sbin/init в GeeXboX дереве и проверьте, что там не ÑодержитÑÑ Ð¼ÑƒÑора) ЕÑли Ð’Ñ‹ Ñобираете GeeXboX ÑамоÑтоÑтельно из иÑходных текÑтов, Ð’Ñ‹ можете также Ñгенерировать GEEXBOX дерево Ñ make pxe. Затем Ð’Ñ‹ должны отредактировать файл /tftpboot/GEEXBOX/boot/pxelinux.cfg/default Ð´Ð»Ñ ÑƒÑтановки nfsroot в правильный NFS путь GEEXBOX дерева. Окончательно уÑтановите Ваш NFS Ð´Ð»Ñ ÑкÑÐ¿Ð¾Ñ€Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ GEEXBOX дерева Ñ /etc/exports, Ñодержащим, что-то вроде Ñтого: /tftpboot/GEEXBOX (ro) и /etc/hosts.allow Ñодержащим, что-то вроде : ALL: ALL Ð¢Ð°ÐºÐ°Ñ Ð²Ð¾Ñ‚ премудроÑть. Загрузите Вашу PXE Ñтанцию и Ñмотрите, что получилоÑÑŒ. ИÑпользование Microsoft Windows ÑиÑтемы: Ð’ Ñлучае загрузки в PXE режиме Ñ Windows хоÑта, Вам потребуетÑÑ Ñледующее программное обеÑпечение: - TFTP и DHCP Ñервер (например, "tftpd32", доÑтупный по http://tftpd32.jounin.net/) - NFS Ñервер (например, "Allegro NFS server", доÑтупный по http://opensource.franz.com/nfs/) - компьютер, поддерживающий PXE загрузочный режим Перепишите и разожмите (инÑталлÑÑ†Ð¸Ñ Ð½Ðµ требуетÑÑ) tftpd32 папку куда-нибудь на Ваш диÑк. Ð’ Ñтом примере, давайте примем, что Ñто: C:\tftpd32. Скопируйте полноÑтью GEEXBOX дерево в ту же директорию (C:\tftpd32\GEEXBOX). Старт tftpd32: - Выберите C:\tftpd32 папку Ð´Ð»Ñ "текущей директории" - Выберите Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ (Ñетевую карту) Ð´Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² "Ñервер интерфейÑ" Ð’ данном примере - Ñто 192.168.0.1 - Зайдите в "уÑтановки" и убедитеÑÑŒ, что DHCP Ñервер отмечен (включен) - Ð’ "DHCP Ñервер" закладке, заполните вÑе полÑ, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ñледующий пример: (ПожалуйÑта, ÑверьтеÑÑŒ Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð½Ð¾Ð¹ документацией о DHCP в Ñети Ð´Ð»Ñ Ð»ÑƒÑ‡ÑˆÐµÐ³Ð¾ пониманиÑ) - ip starting pool: 192.168.0.10 - size of pool: 10 - boot file: ./GEEXBOX/boot/pxelinux.0 - wins/dns server: 192.168.0.254 - sefault router: 192.168.0.254 - mask: 255.255.255.0 - domain name : mydomain.net - Кликните "save" Ð´Ð»Ñ Ð¿Ñ€Ð¸Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ð¹. ÐŸÐµÑ€Ð²Ð°Ñ Ñ‡Ð°Ñть выполнена, Ð’Ñ‹ можете теперь загрузить клиентÑкий компьютер (который запуÑкает GeeXboX) и проÑмотреть его загрузку до поÑÐ²Ð»ÐµÐ½Ð¸Ñ Ð»Ð¾Ð³Ð¾Ñ‚Ð¸Ð¿Ð°. Через некоторое Ð²Ñ€ÐµÐ¼Ñ Ð¿Ñ€Ð¾Ñ†ÐµÑÑ Ð·Ð°Ð¼Ñ€ÐµÑ‚, потому что Ваш NFS Ñервер еще не уÑтановлен. УÑтановите "Allegro NFS server" и заполните вÑе Ð¿Ð¾Ð»Ñ ÑÐ»ÐµÐ´ÑƒÑ Ñ‚Ð°ÐºÐ¸Ð¼ уÑтановкам: ЭкÑпортируемые закладки: - Добавить "новое имÑ": и вызвать его "/tftpboot/GEEXBOX" - Ð’ "путь" как выше: выберите "C:\tftp32\GEEXBOX" папку - Ð’ "допуÑкаемом host ÑпиÑке" , выберите "вÑе" - "Чтение запиÑÑŒ", и "читать только ÑпиÑок пользователей", выберите "root" и "вÑе" (еÑли Ð’Ñ‹ желаете проводить определенный учет, доÑтаточно отметить вÑе в поÑледней закладке) Применение уÑтановок. Ðе забудьте изменить файл C:\tftp32\GEEXBOX\boot\pxelinux.cfg\default и изменить ip Ð°Ð´Ñ€ÐµÑ "192.168.0.2" на "192.168.0.1" (или на один из предыдущих, уÑтановленных Вами). ДоÑтаточно запуÑтить клиентÑкий компьютер и теперь GeeXboX должен заработать прекраÑно. Сборка. Во-первых, поÑмотрите в конфигурационную Ñекцию Ñразу под, по крайней мере, главной чаÑтью. Затем, в оÑновном, Ð’Ñ‹ можете поÑтроить iso Ñ: make Или Ð’Ñ‹ можете непоÑредÑтвенно прожечь Ñтот iso Ñ: make burn ПоÑле выполнениÑ, Ð’Ñ‹ можете оÑвободить диÑковое проÑтранÑтво, путем очиÑтки Ñборочного дерева: make clean или поÑредÑтвом Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð»Ð½Ð¾Ð¹ очиÑтки, даже убрав загруженные иÑходные текÑты: make distclean ЗдеÑÑŒ еÑть также улучшенные команды, еÑли Ð’Ñ‹ хотите подробнее разобратьÑÑ Ñ GeeXboX: scripts/get пакет # загрузить пакет scripts/unpack пакет # раÑпаковать и подготовить пакет scripts/build пакет # Ñобрать пакет scripts/install пакет # уÑтановить пакет Ñ $INSTALL префикÑом scripts/clean пакет # очиÑтить дерево Ñборки пакета scripts/clean --полный пакет # очиÑтить оба: Ñборку и Ð´ÐµÑ€ÐµÐ²ÑŒÑ Ð¸Ñходных текÑтов пакета make exec # запуÑтить непоÑредÑтвенно GeeXboX в ограничении # ПРЕДУПРЕЖДЕÐИЕ: Ñто оÑобо ÑкÑÐ¿ÐµÑ€Ð¸Ð¼ÐµÐ½Ñ‚Ð°Ð»ÑŒÐ½Ð°Ñ Ñ…Ð°Ñ€Ð°ÐºÑ‚ÐµÑ€Ð¸Ñтика # иÑпользуйте Ñто на Ваш ÑобÑтвенный риÑк ЕÑли Ð’Ñ‹ делаете подробную верÑию GeeXboX, Ð’Ñ‹ можете легко Ñобрать маленький tar.bz2 Ð´Ð»Ñ Ð½ÐµÐµ Ñ: make dist или полный tar (Ñодержащий вÑе иÑходные текÑты) Ñ: make fulldist или geexbox генератор Ñ: make generator или geexbox уÑтановщик Ñ: make installator или pxe готовое дерево Ñ: make pxe КонфигурациÑ. Глобальные опции: ÐŸÐµÑ€Ð²Ð°Ñ Ð²ÐµÑ‰ÑŒ, о которой Ð’Ñ‹ должны позаботитьÑÑ, перед попыткой Ñборки GeeXboX, находитьÑÑ Ð² файле config/options, и должна быть Ñама по Ñебе понÑтна. Linux: Это клаÑÑичеÑÐºÐ°Ñ Linux ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ (packages/linux/linux.conf). Ð’Ñ‹ можете отредактировать ее в ручную, или Ð’Ñ‹ можете так же выполнить scripts/unpack linux, а затем make menuconfig -C build/linux-* (или иÑпользовать метод предпочитаемый Вами в отличии от menuconfig). Затем Ð’Ñ‹ должны дублировать Ваш build/linux-*/.config в packages/linux/linux.conf. Lirc: Lirc позволÑет Вам контролировать GeeXboX, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð¿ÑƒÐ»ÑŒÑ‚ диÑтанционного управлениÑ. Во-первых Ð’Ñ‹ должны выбрать файл, ÑоответÑтвующий Ñпецификации Вашего диÑтанционного ÑƒÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ build/lirc-*/remotes (поÑле Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ scripts/unpack lirc) и добавить его в packages/lirc/install. Затем Ð’Ñ‹ должны выбрать Ваше уÑтройÑтво (изначально Ñто /dev/ttyS0 (COM1)) и lirc драйвер и помеÑтить его в файл, называемый packages/lirc/lircd_$REMOTE. Затем Ð’Ñ‹ можете выбрать Вашу раÑкладку клавиш в файле packages/lirc/lircrc_$REMOTE. Ð”Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð¹ раÑкладки Ð’Ñ‹ выбираете кнопку (их Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ð² файле определений диÑтанционного управлениÑ) и ÑопоÑтавлÑете какое-либо дейÑтвие Ð´Ð»Ñ Ð½ÐµÐµ. Ðапример, одно из дейÑтвий Mplayer-а (Ð’Ñ‹ можете найти ÑпиÑок в html файле build/MPlayer-*/DOCS/documentation.html#commands). Разработка. ÐŸÐµÑ€Ð²Ð°Ñ Ð²ÐµÑ‰ÑŒ, на которую Ð’Ñ‹ должны обратить внимание - инициализационный Ñкрипт. ФактичеÑки еÑть два инициализационных Ñкрипта. Первый в packages/initrd/linuxrc, но Вам не нужно изменÑть его. Второй - в config/init и в нем Ð’Ñ‹ можете задать некоторые наÑтройки. Ð¡Ð»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð²ÐµÑ‰ÑŒ, ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ Ð¼Ð¾Ð¶ÐµÑ‚ заинтереÑовать Ð’Ð°Ñ Ñто Ñоздание нового "пакета". Пакет Ñто вÑего лишь группа Ñкриптов, ÑоÑтавленных в ÑоответÑтвии Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð½Ñ‹Ð¼Ð¸ правилами. Ð’Ñе Ñкрипты, раÑполагаютÑÑ Ð² директории, называемой так же, как и программа в директории пакета, которую Ð’Ñ‹ хотите Ñделать незавиÑимым "пакетом". Вот ÑпиÑок Ñкриптов, которые Ð’Ñ‹ можете Ñоздать: - url: вÑего лишь ÑпиÑок адреÑов, где Ð’Ñ‹ получаете иÑходные текÑты программы - unpack: что проиÑходит поÑле раÑпаковки иÑходных текÑтов (например, Ð’Ñ‹ можете изменить определенные конфигурационные файлы; Ñто не включает приложение патчей) - need_build: вызываетÑÑ, когда необходимо убедитьÑÑ, что уже Ñобранный пакет не нуждаетÑÑ Ð² переÑборке; удалите файл .stamps/"package name"/build, еÑли пакет нуждаетÑÑ Ð² переÑборке - build: вÑе необходимые шаги Ð´Ð»Ñ Ñборки программы - install: вÑе необходимые шаги Ð´Ð»Ñ ÑƒÑтановки; Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ ÑƒÑтановки должен быть $INSTALL Когда файлы, полученные Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ñ‹Ñ… адреÑов называютÑÑ patch-program_name-... они автоматичеÑки применÑÑŽÑ‚ÑÑ Ðº раÑпакованным иÑходным текÑтам программы. Помните, что программное обеÑпечение, которое выполнÑетÑÑ Ð² GeeXboX, должно быть Ñкомпилировано в uClibc gcc ÑиÑтеме. Ð’ завершении, лучший путь Ñобрать пакет - Ñто поÑмотреть, как ÑобираютÑÑ Ð´Ñ€ÑƒÐ³Ð¸Ðµ пакеты. ЛицензиÑ. Ð’Ñе программы, иÑпользуемые в GeeXboX защищены их ÑоответÑтвующими лицензиÑми. Они вÑе - Ñвободное программное обеÑпечение и большинÑтво из них защищено GNU General Public License. GeeXboX Ñам-по-Ñебе - Ñто вÑе Ñкрипты, которые иÑпользуютÑÑ Ð² Ñборочном процеÑÑе - защищен GNU General Public License.geexbox-1.0/config/0000755000175000017500000000000010446320501013255 5ustar aurelaurelgeexbox-1.0/config/file_ext0000644000175000017500000000021410446314257015007 0ustar aurelaurelavi divx asf wmv mpeg mpg mpe vob m1v m2v m4v ts mp4 m4a ogm mkv mka rm ra rmvb mov qt bin mp3 mp2 ogg wav wma y4m dat iso ifo flac mpc vro geexbox-1.0/config/img_ext0000644000175000017500000000004110446314257014642 0ustar aurelaurelbmp gif jpeg jpg pcd png pnm ppm geexbox-1.0/config/init0000755000175000017500000000126110446314257014161 0ustar aurelaurel#!/bin/sh /bin/busybox test ! -e /proc/cpuinfo && /bin/busybox mount -t proc none /proc /bin/busybox test ! -e /sys/kernel && /bin/busybox mount -t sysfs none /sys /bin/busybox test ! -e /bin/cp && /bin/busybox --install -s progress() { if test -f /proc/splash; then echo "show $1" > /proc/splash fi } count=0 for script in /etc/init.d/*; do grep -q -e "^# runlevels:.*$1" $script && count=$(($count+1)); done pos=47000 step=$(((65535-$pos)/$count)) RET=0 for script in /etc/init.d/*; do if grep -q -e "^# runlevels:.*$1" $script; then pos=$(($pos+$step)) progress $pos /bin/sh $script S_RET=$? test $S_RET -ge $RET && RET=$S_RET fi done exit $RET geexbox-1.0/config/issue0000644000175000017500000000002310446314257014336 0ustar aurelaurelWelcome to GeeXboX geexbox-1.0/config/list_ext0000644000175000017500000000002510446314257015043 0ustar aurelaurelpls m3u asx ram smil geexbox-1.0/config/maps0000644000175000017500000000046710446314257014162 0ustar aurelaurel# EXTN XLate CREATOR TYPE Comment .b Raw 'UNIX' 'tbxi' "bootstrap" yaboot Raw 'UNIX' 'boot' "bootstrap" vmlinux Raw 'UNIX' 'boot' "kernel" .conf Raw 'UNIX' 'conf' "bootstrap" * Raw 'UNIX 'UNIX' "unix" geexbox-1.0/config/options0000644000175000017500000001014410446320333014676 0ustar aurelaurel# Target system we want to cross compile for (i386/ppc) TARGET_ARCH=i386 # The TARGET_CPU variable controls which processor should be targeted for # generated code. case $TARGET_ARCH in i386) # (AMD CPUs) opteron athlon64 athlon-fx athlon-mp athlon-xp athlon-4 # athlon-tbird athlon k8 k6-3 k6-2 k6 # (Intel CPUs) nocona prescott pentium4[m] pentium3[m] pentium-m # pentium2 pentiumpro pentium-mmx pentium # i686 i586 i486 i386 TARGET_CPU=i586 ;; ppc) # 401 403 405 405fp 440 440fp 505 601 602 603 603e ec603e 604 604e # 620 630 740 7400 7450 750 801 821 823 860 970 rios rios1 rios2 rsc rs64a # common G3 G4 G5 power power2 power3 power4 power5 powerpc powerpc64 TARGET_CPU=G3 ;; esac # Need to point to your actual cc # If you have ccache installed, take care that LOCAL_CC don't point to it LOCAL_CC=`which gcc` # Need to point to your actual g++ # If you have ccache installed, take care that LOCAL_CXX don't point to it LOCAL_CXX=`which g++` # Support C++ in toolchain TOOLCHAIN_CXX=no # Theme (omc) THEME=omc # Resolution (640x480, 800x600, 1024x768, 1280x1024 or 1600x1200) RESOLUTION=800x600 # Menu language (bg/br/ca/cs/de/en/es/et/fi/fr/gr/he/hu/it/nl/no/pl/ro/ru/sk/sr/sv) MENU_LANG=en # Subtitle charset (bg/br/ca/cs/de/en/es/et/fi/fr/gr/he/hu/it/nl/no/pl/ro/ru/sk/sr/sv) # Can also be set to a charset code (iso-8859-{1,2,7,8,9}/windows-125{0,1}/koi8-r) # when empty it defaults to $MENU_LANG SUB_CHARSET= # Remote to Use (pctv/logitech/hauppauge/realmagic/creative/leadtek/RM-S6/ # RX-V850/animax/askey/avermedia/packard_bell/atiusb/atiusb2/LG/D-10/ # digimatrix/mceusb/streamzap/cinergy1400/nova-s-plus/twinhan/tosh-vt76f/flytv-prime) REMOTE=atiusb # Remote receiver to use (animax/askey/avermedia/atiusb/atiusb2/creative/ # hauppauge/homemade/irman/leadtek/logitech/pctv/realmagic/digimatrix/mceusb/ # mceusb2/streamzap/cx88) RECEIVER=atiusb # Use Extra Binary Codecs - RealMedia/WindowsMedia 9 (yes/no) EXTRACODECS=no # Use Extra Binary Firmwares - WiFi/DVB cards (yes/no) EXTRAFIRMWARES=no # Network Support (Samba shares and FTP Server) (yes/no) NETWORK=yes # Start network services ? (Anonymous Telnet and FTP server as root) (yes/no) SERVICES=no # Wireless network support (yes/no) WIFI=yes # Auto-discovery of UPnP MediaServer devices (yes/no) UPNP=yes # Add radio tuner support (yes/no) RADIO=yes # Add DXR3/Hollywood+ support (EXPERIMENTAL) DXR3=yes # Add LIVE555 support (forces c++ support) LIVE555=yes # Support for Encoders (yes/no) ENCODERS=no # Image viewer / dia show support (yes/no) VIEW_IMG=yes # Allow addition of digimatrix-only support tools (yes/no) DIGIMATRIX=yes # Default timeout in seconds for dia show (0 to disable) VIEW_IMG_TIMEOUT=10 # LCD display support (yes/no) LCD4LINUX=yes # Enable LCD display by default (yes/no) LCD_ENABLED=no # Select the LCD display model (cf. packages/lcd4linux/config/lcd4linux.conf) # (SerDispLib / Trefon / LK204 / MI240 / CW12232 / CF631 / CF632 / CF633 / # HD44780-generic / HD44780-winamp / HD44780-kernelconcepts / SC1602D / # LCM-162 / HD44780-I2C / LCDTerm / SimpleLCD / M50530-24x8 / CT20x4 / # USBLCD / BWCT / T6963-240x64) LCD_MODEL=HD44780-winamp LCD_WIDTH=16 LCD_HEIGHT=2 # Size of the initrd file system RAMDISK_SIZE=2048 # enable debuging (debugging flags and enables gdb) DEBUG=no # enable gdb (yes/no) GDB=no # enable devel tools (yes/no) DEVTOOLS=no # verbose compilation mode (yes/no) VERBOSE=yes # download new sources when url file is updated (yes/no/ask) AUTOUPDATE=ask # Burning options # device (ex: 0,0,0). See the output of cdrecord -scanbus. BURNER=/dev/hda # blank the CD-RW before burning (yes/no) BLANK=yes # you can also pass options to cdrecord : CDRECORD_OPTS= # PXE boot options DEFAULT_NFS_SERVER=192.168.0.2 DEFAULT_NFS_DIR=/tftpboot/GEEXBOX # Concurrency make level (-j option) # Try value 1 (default) to 4 on single CPU computer, or more on # multi-processor computer (like hyperthreading SMP CPU) CONCURRENCY_MAKE_LEVEL=1 # read personal options if available test -f "$HOME/.geexbox-options" && . "$HOME/.geexbox-options" . config/path geexbox-1.0/config/path0000644000175000017500000000677510446314257014166 0ustar aurelaurelset -e GEEXBOX_VERSION=`cat VERSION` CONFIG=config SCRIPTS=scripts PACKAGES=packages SOURCES=sources BUILD_BASE=build BUILD=$BUILD_BASE.$TARGET_ARCH STAMPS_NOARCH=.stamps STAMPS=$BUILD/$STAMPS_NOARCH DOCS=DOCS ROOT=`pwd` TARGET_NAME=$TARGET_ARCH-pc-linux-uclibc TOOLCHAIN=$BUILD/toolchain SYSROOT_PREFIX=$ROOT/$TOOLCHAIN/$TARGET_NAME/sysroot LIB_PREFIX=$SYSROOT_PREFIX/usr/local TARGET_PREFIX=$ROOT/$TOOLCHAIN/bin/$TARGET_NAME- [ "$LIVE555" = yes ] && TOOLCHAIN_CXX=yes [ "$DEBUG" = yes ] && RAMDISK_SIZE=4096 [ "$DEBUG" = yes ] && GDB=yes TOOLCHAIN_LANGUAGES=c [ "$TOOLCHAIN_CXX" = yes ] && TOOLCHAIN_LANGUAGES=${TOOLCHAIN_LANGUAGES},c++ TARGET_CC=${TARGET_PREFIX}gcc TARGET_CXX=${TARGET_PREFIX}g++ TARGET_LD=${TARGET_PREFIX}ld TARGET_AS=${TARGET_PREFIX}as TARGET_AR=${TARGET_PREFIX}ar TARGET_NM=${TARGET_PREFIX}nm TARGET_RANLIB=${TARGET_PREFIX}ranlib TARGET_OBJCOPY=${TARGET_PREFIX}objcopy TARGET_STRIP=${TARGET_PREFIX}strip TARGET_CPPFLAGS= TARGET_CFLAGS="-Os -Wall -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" TARGET_LDFLAGS= if [ "$DEBUG" = yes ]; then TARGET_CFLAGS="$TARGET_CFLAGS -g3" TARGET_STRIP=touch else TARGET_CFLAGS="$TARGET_CFLAGS -s -fomit-frame-pointer" TARGET_LDFLAGS="$TARGET_LDFLAGS -s" fi HOST_CC=$ROOT/$TOOLCHAIN/bin/host-gcc HOST_CXX=$ROOT/$TOOLCHAIN/bin/host-g++ HOST_LD=ld HOST_AS=as HOST_AR=ar HOST_NM=nm HOST_RANLIB=ranlib HOST_OBJCOPY=objcopy HOST_STRIP=strip HOST_CPPFLAGS="" HOST_CFLAGS="-O2 -Wall -pipe" HOST_LDFLAGS="" export CCACHE_DIR=$ROOT/$BUILD/.ccache export MAKEFLAGS=-j$CONCURRENCY_MAKE_LEVEL export HAVE_PKG_CONFIG=no export ac_cv_path_PKG_CONFIG=no if [ -z "$PATH" -o "$PATH" = "${PATH#$ROOT/$TOOLCHAIN/bin:}" ]; then export PATH="$ROOT/$TOOLCHAIN/bin:$PATH" fi setup_toolchain() { if [ "$1" = "--optimize" ]; then OPTIMIZE=yes shift fi if [ "$1" = target ]; then export CC=$TARGET_CC export CXX=$TARGET_CXX export LD=$TARGET_LD export AS=$TARGET_AS export AR=$TARGET_AR export NM=$TARGET_NM export RANLIB=$TARGET_RANLIB export OBJCOPY=$TARGET_OBJCOPY export STRIP=$TARGET_STRIP export CPPFLAGS="$TARGET_CPPFLAGS" export CFLAGS="$TARGET_CFLAGS" export LDFLAGS="$TARGET_LDFLAGS" if [ "$OPTIMIZE" = yes ]; then case $TARGET_ARCH in i386) CFLAGS="$CFLAGS -march=$TARGET_CPU" ;; ppc) CFLAGS="$CFLAGS -maltivec" ;; esac fi elif [ "$1" = host ]; then export CC=$HOST_CC export CXX=$HOST_CXX export LD=$HOST_LD export AS=$HOST_AS export AR=$HOST_AR export NM=$HOST_NM export RANLIB=$HOST_RANLIB export OBJCOPY=$HOST_OBJCOPY export STRIP=$HOST_STRIP export CPPFLAGS="$HOST_CPPFLAGS" export CFLAGS="$HOST_CFLAGS" export LDFLAGS="$HOST_LDFLAGS" fi } setup_toolchain target SILENT_OUT=3 VERBOSE_OUT=4 if [ "$VERBOSE" = yes ]; then exec 3>/dev/null exec 4>&2 else exec 3>&2 exec 4>/dev/null fi INDENT_SIZE=4 GEEXBOX_SRCS=http://www.geexbox.org/src/$GEEXBOX_VERSION [ "$GEEXBOX_VERSION" = devel ] && GEEXBOX_VERSION=devel-`date +%Y%m%d` ISO=geexbox-$GEEXBOX_VERSION-$MENU_LANG.$TARGET_ARCH.iso GENERATOR_NAME=geexbox-generator-$GEEXBOX_VERSION.$TARGET_ARCH INSTALLATOR_NAME=geexbox-installator-$GEEXBOX_VERSION.$TARGET_ARCH PXE_NAME=geexbox-pxe/GEEXBOX.$TARGET_ARCH HOST_NAME_CACHE=$BUILD/configtools/host_name if [ -f $HOST_NAME_CACHE ]; then HOST_NAME=`cat $HOST_NAME_CACHE` elif [ -x $BUILD/configtools/config.guess ]; then HOST_NAME=`$BUILD/configtools/config.guess` fi kernel_path() { ls -d $ROOT/$BUILD/linux* } geexbox-1.0/config/sort0000644000175000017500000000002310446314257014175 0ustar aurelaurelisolinux.bin 10000 geexbox-1.0/scripts/0000755000175000017500000000000010446320333013502 5ustar aurelaurelgeexbox-1.0/scripts/build0000755000175000017500000000207710446314266014545 0ustar aurelaurel#!/bin/sh . config/options if [ -z "$1" ]; then echo "usage: $0 package_name" exit 1 fi if [ -f $PACKAGES/$1/arch ]; then grep -q "$TARGET_ARCH" "$PACKAGES/$1/arch" || exit 0 fi unset INSTALL mkdir -p $STAMPS/$1 STAMP=$STAMPS/$1/build $SCRIPTS/unpack $1 if [ -f $STAMP -a -f $PACKAGES/$1/need_build ]; then $PACKAGES/$1/need_build $@ fi if [ -f $STAMP -a $PACKAGES/$1/build -nt $STAMP ]; then rm -f $STAMP fi if [ ! -f $STAMP ]; then rm -f $STAMP printf "%${INDENT}c BUILD $1\n" >&$SILENT_OUT export INDENT=$((${INDENT:-1}+$INDENT_SIZE)) if [ -f $PACKAGES/$1/build ]; then $PACKAGES/$1/build $@ >&$VERBOSE_OUT elif [ -f $BUILD/$1*/Makefile ]; then $SCRIPTS/build toolchain make -C $BUILD/$1* >&$VERBOSE_OUT elif [ "$1" != "${1#theme-}" ]; then $SCRIPTS/build-theme $@ >&$VERBOSE_OUT elif [ -f $BUILD/$1*/$1.c ]; then $SCRIPTS/build toolchain make -C $BUILD/$1* $1 >&$VERBOSE_OUT fi . $CONFIG/options for i in `sed -n "s/^\(.*\)=.*$/\1/p" $CONFIG/options`; do eval val=\$$i echo STAMP_$i=$val >> $STAMP done fi geexbox-1.0/scripts/build-theme0000755000175000017500000000046210446314266015641 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build bootsplash cd $BUILD/$1* . ./config [ -z "$RESOLUTIONS" ] && RESOLUTIONS=800x600 for r in $RESOLUTIONS; do $ROOT/$BUILD/bootsplash*/Utilities/splash -s -f bootsplash-$r.cfg > bootsplash-$r.dat done rm -f bootsplash-*.cfg bootsplash-*.jpg bootsplash-*.jpeg geexbox-1.0/scripts/burn0000755000175000017500000000032310446314266014404 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/checkdeps burn [ ! -f $ISO ] && $SCRIPTS/iso if [ "$BLANK" = "yes" ]; then CDRECORD_OPTS="blank=fast $CDRECORD_OPTS" fi cdrecord dev=$BURNER $CDRECORD_OPTS -eject $ISO geexbox-1.0/scripts/checkdeps0000755000175000017500000000517410446314266015400 0ustar aurelaurel#!/bin/sh . config/options deps= deps_pkg= files= files_pkg= case $1 in get) deps="wget" deps_pkg="wget" ;; build) deps="gcc g++ sed patch touch nasm tar bzip2 gzip perl flex cp" deps_pkg="gcc g++ sed patch fileutils nasm tar bzip2 gzip perl flex coreutils" files="/usr/include/stdio.h" files_pkg="libc6-dev" ;; burn) deps="cdrecord" deps_pkg="cdrecord" ;; iso) deps="mkisofs mkzftree" if [ -f /etc/debian_version -a -n "`which apt-get 2>/dev/null`" ]; then deps_pkg="mkisofs mkisofs" else deps_pkg="mkisofs zisofs-tools" fi ;; esac getarg() { eval echo \${$(($1+2))} } i=0 while dep=`getarg $i $deps` && [ -n "$dep" ]; do [ -z "`which $dep 2>/dev/null`" ] && need="$need $dep" && need_pkg="$need_pkg `getarg $i $deps_pkg`" i=$(($i+1)) done i=0 while file=`getarg $i $files` && [ -n "$file" ]; do [ ! -f $file ] && need="$need $file" && need_pkg="$need_pkg `getarg $i $files_pkg`" i=$(($i+1)) done if [ -n "$need" ]; then echo "**** Your system lacks the following tools needed to $1 GeeXboX ****" echo $need if [ -f /etc/debian_version -a -n "`which apt-get 2>/dev/null`" ]; then echo "**** You seem to use a debian system ****" if [ $UID -ne 0 ]; then echo "**** I could install those packages but you need to be root for this ****" exit 1 else read -p "would you like to apt-get install the needed tools ? (y/n) " ans [ "$ans" = "y" ] && apt-get install $need_pkg fi elif [ -f /etc/mandrake-release -a -n "`which urpmi 2>/dev/null`" ]; then echo "**** You seem to use a mandrake system ****" if [ $UID -ne 0 ]; then echo "**** I could install those packages but you need to be root for this ****" exit 1 else read -p "would you like to urpmi the needed tools ? (y/n) " ans [ "$ans" = "y" ] && urpmi $need_pkg fi else echo "********" exit 1 fi fi need="" need_pkg="" i=0 while dep=`getarg $i $deps` && [ -n "$dep" ]; do [ -z "`which $dep 2>/dev/null`" ] && need="$need $dep" && need_pkg="$need_pkg `getarg $i $deps_pkg`" i=$(($i+1)) done i=0 while file=`getarg $i $files` && [ -n "$file" ]; do [ ! -f $file ] && need="$need $file" && need_pkg="$need_pkg `getarg $i $files_pkg`" i=$(($i+1)) done if [ -n "$need" ]; then if [ "$need" = " mkzftree" ]; then echo "**** mkzftree was not installed correctly." echo "**** It is not included in debian woody." echo "**** You will need for example a sarge version of mkisofs." else echo "**** The following packages were not installed correctly ****" echo $need_pkg echo "********" fi exit 1 fi geexbox-1.0/scripts/clean0000755000175000017500000000151410446314266014523 0ustar aurelaurel#!/bin/sh . config/options clean () { echo " CLEAN $1" >&$SILENT_OUT if [ "$CLEAN_SOURCES" = true ]; then if [ -f $PACKAGES/$1/url ]; then for i in `ls $SOURCES/$1 2>/dev/null`; do grep -q $i $PACKAGES/$1/url || rm -f $SOURCES/$1/$i done fi return fi if [ "$FULL" = true ]; then rm -rf $BUILD_BASE*/$STAMPS_NOARCH/$1* rm -rf $BUILD_BASE*/$1* rm -rf $STAMPS_NOARCH/$1 rm -rf $SOURCES/$1 else rm -rf $BUILD/$1* rm -f $STAMPS/$1/unpack rm -f $STAMPS/$1/build fi } if [ "$1" = "--full" ]; then FULL=true shift elif [ "$1" = "--sources" ]; then CLEAN_SOURCES=true shift fi if [ -z "$1" ]; then for i in $PACKAGES/*; do clean ${i#$PACKAGES/}; done rm -rf $BUILD/iso rm -rf $BUILD/ziso [ "$FULL" = true ] && rm -rf $CCACHE_DIR else clean $1 fi exit 0 geexbox-1.0/scripts/dist0000755000175000017500000000214410446320333014374 0ustar aurelaurel#!/bin/sh . config/options NODIST="extra-codecs-nonfree extra-firmwares-nonfree gdb termcap" GEEXDIR=geexbox-$GEEXBOX_VERSION [ "$1" = full ] && $SCRIPTS/get mkdir $GEEXDIR ln -s ../AUTHORS $GEEXDIR/AUTHORS ln -s ../README $GEEXDIR/README ln -s ../COPYING $GEEXDIR/COPYING ln -s ../VERSION $GEEXDIR/VERSION ln -s ../ChangeLog $GEEXDIR/ChangeLog ln -s ../Makefile $GEEXDIR/Makefile ln -s ../DOCS $GEEXDIR/DOCS ln -s ../$CONFIG $GEEXDIR/$CONFIG ln -s ../$SCRIPTS $GEEXDIR/$SCRIPTS ln -s ../$PACKAGES $GEEXDIR/$PACKAGES ln -s ../debian $GEEXDIR/debian if [ "$1" = full ]; then $SCRIPTS/clean --sources mkdir -p $GEEXDIR/$SOURCES for i in $SOURCES/*; do DIST=yes for j in $NODIST; do [ ${i##*/} = $j ] && DIST=no break done if [ $DIST = yes ]; then ln -s ../../$i $GEEXDIR/$i mkdir -p $GEEXDIR/$STAMPS_NOARCH/${i##*/} touch $GEEXDIR/$STAMPS_NOARCH/${i##*/}/get fi done tar chf $GEEXDIR-full.tar --exclude CVS --exclude .svn --exclude .arch-ids $GEEXDIR else tar chjf $GEEXDIR-lite.tar.bz2 --exclude CVS --exclude .svn --exclude .arch-ids $GEEXDIR fi rm -rf $GEEXDIR geexbox-1.0/scripts/exec0000755000175000017500000000456410446314266014375 0ustar aurelaurel#!/bin/sh . config/options ROOT=execroot mkdir -p $ROOT/dev/snd mkdir -p $ROOT/dev/input mkdir -p $ROOT/lib mkdir -p $ROOT/bin mkdir -p $ROOT/sbin mkdir -p $ROOT/proc mkdir -p $ROOT/mnt mkdir -p $ROOT/usr/sbin mkdir -p $ROOT/var/run mkdir -p $ROOT/var/log mkdir -p $ROOT/var/lock mkdir -p $ROOT/tmp lzma d $BUILD/iso/GEEXBOX/bin.tar.lzma -so | tar xf - -C $ROOT cp -r $BUILD/iso/GEEXBOX/sbin $ROOT cp -r $BUILD/iso/GEEXBOX/etc $ROOT cp -r $BUILD/iso/GEEXBOX/usr $ROOT cp -r $BUILD/iso/GEEXBOX/codecs $ROOT cp -r $BUILD/iso/GEEXBOX/firmwares $ROOT cp $BUILD/uClibc*/lib/* $ROOT/lib ln -s libc.so.0 $ROOT/lib/libc.so.6 cp $BUILD/busybox*/busybox $ROOT/bin cp config/init $ROOT/sbin ln -s busybox $ROOT/bin/sh touch $ROOT/etc/fstab touch $ROOT/EXEC cp $ROOT/etc/mplayer/menu_`cat $ROOT/etc/lang`.conf $ROOT/etc/mplayer/menu.conf sed -i 's%ok=\"quit 166\"/>%ok=\"quit 166\"/> %' $ROOT/etc/mplayer/menu.conf IFS=' ' for i in `cat ./packages/initrd/dev`; do mknod $ROOT`echo "$i" | cut -f3` `echo "$i" | cut -c1` `echo "$i" | cut -f2 | cut -f1 -d,` `echo "$i" | cut -f2 | cut -f2 -d,` done for i in `mount -l | grep -E "/dev/(hd|scd)" | cut -d' ' -f1,3,6`; do IFS=' ' i=($i) DEV=${i[0]##*/} if [ "$DEV" = "none" ]; then DEV=`echo "${i[2]}" | sed 's%.*dev=\(.*\)[,\)].*%\1%'` DEV=${DEV##*/} fi mkdir $ROOT/mnt/$DEV mount --bind ${i[1]} $ROOT/mnt/$DEV echo $DEV | grep scd >/dev/null 2>&1 if [ $? -eq 0 ]; then test ! -e $ROOT/dev/cdrom && ln -s /dev/$DEV $ROOT/dev/cdrom test ! -e $ROOT/dev/dvd && ln -s /dev/$DEV $ROOT/dev/dvd fi done for DEV in /dev/scd*; do DEV=${DEV##*/} if [ ! -d $ROOT/mnt/$DEV ]; then mkdir $ROOT/mnt/$DEV mount -t supermount -o dev=/dev/$DEV none $ROOT/mnt/$DEV >/dev/null 2>&1 if [ $? -eq 0 ]; then test ! -e $ROOT/dev/cdrom && ln -s /dev/$DEV $ROOT/dev/cdrom test ! -e $ROOT/dev/dvd && ln -s /dev/$DEV $ROOT/dev/dvd else rmdir $ROOT/mnt/$DEV fi fi done chroot $ROOT /sbin/init killall -9 mplayer >/dev/null 2>&1 killall -9 lircd >/dev/null 2>&1 [ -f $ROOT/log ] && cp $ROOT/log . for i in $ROOT/mnt/share/*; do test -d $i && umount $i >/dev/null 2>&1 rmdir $i done for i in $ROOT/mnt/*; do test -d $i && umount $i >/dev/null 2>&1 rmdir $i done for i in $ROOT/*; do if [ "$i" = "$ROOT/mnt" ]; then rmdir $i else rm -rf $i fi done rmdir $ROOT geexbox-1.0/scripts/extract0000755000175000017500000000172110446314266015113 0ustar aurelaurel#!/bin/sh . config/options if [ -z "$3" ]; then echo "usage: $0 package_name file_pattern target_dir" exit 1 fi [ ! -d "$SOURCES/$1" -o ! -f $PACKAGES/$1/url -o ! -d "$3" ] && exit 1 for s in `sed 's%.*/\(.*\)\$%\1%' $PACKAGES/$1/url`; do case $s in $2) f="$SOURCES/$1/$s" if [ ! -f $f ]; then echo "error: File $s doesn't exists in package $1 sources directory" echo "have you called scripts/extract before scripts/get ?" exit 1 fi case $s in *.tar) tar xf $f -C $3 ;; *.tar.bz2 | *.tbz) tar xjf $f -C $3 ;; *.tar.gz | *.tgz) tar xzf $f -C $3 ;; *.diff | *.patch) cat $f | patch -d $3 -p1 ;; *.diff.bz2 | *.patch.bz2 | patch-*.bz2) bzcat $f | patch -d $3 -p1 ;; *.diff.gz | *.patch.gz | patch-*.gz) zcat $f | patch -d $3 -p1 ;; *) cp -pPR $f $3 ;; esac ;; esac done geexbox-1.0/scripts/fixconfigtools0000755000175000017500000000072710446314266016503 0ustar aurelaurel#!/bin/sh . config/options # Avoid infinite loop [ "$*" = "$BUILD/configtools" ] && exit 0 $SCRIPTS/build configtools for i in $@; do [ -f "$i/config.guess" ] && cp -f $BUILD/configtools/config.guess $i [ -f "$i/config.sub" ] && cp -f $BUILD/configtools/config.sub $i [ -f "$i/configure.guess" ] && cp -f $BUILD/configtools/config.guess $i/configure.guess [ -f "$i/configure.sub" ] && cp -f $BUILD/configtools/config.sub $i/configure.sub done exit 0 geexbox-1.0/scripts/generator0000755000175000017500000000116210446314266015426 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/checkdeps build export INSTALL=$GENERATOR_NAME/iso/GEEXBOX rm -rf $GENERATOR_NAME $SCRIPTS/gentree generator full export INSTALL=$GENERATOR_NAME $SCRIPTS/install generator generator mkdir -p $GENERATOR_NAME/$DOCS cp -r $DOCS/* $GENERATOR_NAME/$DOCS/ cp $CONFIG/sort $GENERATOR_NAME/sort cp $CONFIG/maps $GENERATOR_NAME/maps cp AUTHORS $GENERATOR_NAME/AUTHORS cp COPYING $GENERATOR_NAME/COPYING echo $GEEXBOX_VERSION-custom > $GENERATOR_NAME/VERSION cat $PACKAGES/*/config/packages.ini > $GENERATOR_NAME/packages.ini tar czf $GENERATOR_NAME.tar.gz $GENERATOR_NAME rm -rf $GENERATOR_NAME geexbox-1.0/scripts/gentree0000755000175000017500000000335510446314266015077 0ustar aurelaurel#!/bin/sh . config/options if [ "$2" != boot ]; then mkdir -p $INSTALL/sbin mkdir -p $INSTALL/etc/init.d mkdir -p $INSTALL/codecs mkdir -p $INSTALL/firmwares cp $CONFIG/init $INSTALL/sbin cp $PACKAGES/*/init.d/* $INSTALL/etc/init.d/ cp $CONFIG/file_ext $INSTALL/etc cp $CONFIG/list_ext $INSTALL/etc $SCRIPTS/install linux modules $1 $SCRIPTS/install alsa $1 $SCRIPTS/install tvout $1 $SCRIPTS/install pciutils $1 $SCRIPTS/install MPlayer $1 $SCRIPTS/install installator $1 $SCRIPTS/install i18n $1 $SCRIPTS/install webgui $1 $SCRIPTS/install sleeptimer $1 $SCRIPTS/install theme $1 $SCRIPTS/install cpufreqd $1 [ "$LCD4LINUX" = yes ] && $SCRIPTS/install lcd4linux $1 [ "$DEVTOOLS" = yes ] && $SCRIPTS/install strace $1 [ "$NETWORK" = yes ] && $SCRIPTS/install network $1 [ "$RADIO" = yes ] && $SCRIPTS/install fmio $1 [ "$DXR3" = yes ] && $SCRIPTS/install em8300 $1 [ "$VIEW_IMG" = yes ] && $SCRIPTS/install fbi $1 [ "$GDB" = yes ] && $SCRIPTS/install gdb $1 [ "$EXTRACODECS" = yes ] && $SCRIPTS/install extra-codecs-nonfree $1 [ "$EXTRAFIRMWARES" = yes ] && $SCRIPTS/install extra-firmwares-nonfree $1 [ "$DIGIMATRIX" = yes ] && $SCRIPTS/install digitools $1 VER=`ls $INSTALL/lib/modules` $BUILD/module-init-tool*/depmod -b $INSTALL -v $VER > /dev/null for i in `ls $INSTALL/lib/modules/*/modules.* | grep -v modules.dep`; do rm -f $i done tar cf - -C $INSTALL lib usr/bin usr/lib | lzma e $INSTALL/bin.tar.lzma -si -a2 rm -rf $INSTALL/lib $INSTALL/usr/bin $INSTALL/usr/lib echo "$GEEXBOX_VERSION" > $INSTALL/etc/version fi if [ "$2" = boot -o "$2" = full ]; then $SCRIPTS/install linux image $1 $SCRIPTS/install initrd $1 $SCRIPTS/install syslinux $1 $SCRIPTS/install yaboot $1 fi geexbox-1.0/scripts/get0000755000175000017500000000215210446314266014217 0ustar aurelaurel#!/bin/sh . config/options NOGET="gdb termcap" if [ -z "$1" ]; then for i in $PACKAGES/*; do GET=yes for j in $NOGET; do [ ${i##*/} = $j ] && GET=no break done if [ $GET = yes ]; then $SCRIPTS/get ${i#$PACKAGES/} fi done exit 0 fi mkdir -p $STAMPS_NOARCH/$1 STAMP=$STAMPS_NOARCH/$1/get if [ -f $PACKAGES/$1/url ]; then if [ -f $STAMP ]; then [ ! $STAMP -ot $PACKAGES/$1/url -o $AUTOUPDATE = no ] && exit 0 if [ $AUTOUPDATE = ask ]; then echo "Package $1 is not up to date." echo -n "Do you want to download an up to date version ? (y/n) " read UPDATE [ "$UPDATE" = y ] || exit 0 fi fi $SCRIPTS/checkdeps get rm -f $STAMP printf "%${INDENT}c GET $1\n" >&$SILENT_OUT export INDENT=$((${INDENT:-1}+$INDENT_SIZE)) [ "$VERBOSE" != yes ] && WGET_OPT=-q mkdir -p $SOURCES/$1 for i in `sed s%GEEXBOX_SRCS%$GEEXBOX_SRCS% $PACKAGES/$1/url`; do wget --passive-ftp -c $WGET_OPT -P $SOURCES/$1 $i done cp -p $PACKAGES/$1/url $STAMP rm -f $BUILD_BASE*/$STAMPS_NOARCH/$1/unpack rm -f $BUILD_BASE*/$STAMPS_NOARCH/$1/build fi geexbox-1.0/scripts/install0000755000175000017500000000070410446314266015107 0ustar aurelaurel#!/bin/sh . config/options if [ -z "$1" ]; then echo "usage: $0 package_name" exit 1 fi if [ -f $PACKAGES/$1/arch ]; then grep -q "$TARGET_ARCH" "$PACKAGES/$1/arch" || exit 0 fi $SCRIPTS/build $@ printf "%${INDENT}c INSTALL $1\n" >&$SILENT_OUT export INDENT=$((${INDENT:-1}+$INDENT_SIZE)) if [ -f $PACKAGES/$1/install ]; then $PACKAGES/$1/install $@ >&$VERBOSE_OUT else mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/$1 $INSTALL/usr/bin fi geexbox-1.0/scripts/installator0000755000175000017500000000114210446314266015772 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/checkdeps build export INSTALL=$INSTALLATOR_NAME/disk/GEEXBOX rm -rf $INSTALLATOR_NAME $SCRIPTS/gentree installator export INSTALL=$INSTALLATOR_NAME/disk $SCRIPTS/gentree installator boot cp $PACKAGES/installator/scripts/installator.sh $INSTALLATOR_NAME mkdir -p $INSTALLATOR_NAME/$DOCS cp -r $DOCS/* $INSTALLATOR_NAME/$DOCS/ cp AUTHORS $INSTALLATOR_NAME/AUTHORS cp COPYING $INSTALLATOR_NAME/COPYING cp VERSION $INSTALLATOR_NAME/VERSION sed -i s/.*busybox.*// $INSTALLATOR_NAME/installator.sh tar czf $INSTALLATOR_NAME.tar.gz $INSTALLATOR_NAME rm -rf $INSTALLATOR_NAME geexbox-1.0/scripts/iso0000755000175000017500000000205310446314266014232 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/checkdeps build $SCRIPTS/checkdeps iso export INSTALL=$BUILD/iso/GEEXBOX rm -rf $BUILD/iso $SCRIPTS/gentree iso rm -rf $BUILD/ziso mkdir -p $BUILD/ziso mkzftree $INSTALL $BUILD/ziso/GEEXBOX export INSTALL=$BUILD/ziso/GEEXBOX $SCRIPTS/gentree iso boot case $TARGET_ARCH in i386) MKISOFS_ARCH="-no-emul-boot \ -boot-info-table \ -boot-load-size 4 \ -b GEEXBOX/boot/isolinux.bin \ -c GEEXBOX/boot/boot.catalog" ;; ppc) MKISOFS_ARCH="-hfs \ -part \ -no-desktop \ -map $CONFIG/maps \ -hfs-volid GEEXBOX \ -hfs-bless $BUILD/ziso/GEEXBOX/boot" ;; esac mkisofs -quiet -no-pad -V GEEXBOX -volset GEEXBOX \ -publisher "The GeeXboX team (www.geexbox.org)" \ -p "The GeeXboX team (www.geexbox.org)" \ -A "MKISOFS ISO 9660/HFS FILESYSTEM BUILDER" \ -z -D -r -J -sort $CONFIG/sort $MKISOFS_ARCH \ $BUILD/ziso > $ISO geexbox-1.0/scripts/pxe0000755000175000017500000000022110446314266014227 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/checkdeps build export INSTALL=$PXE_NAME rm -rf $PXE_NAME $SCRIPTS/gentree pxe full chmod -R +r $PXE_NAME geexbox-1.0/scripts/sum0000755000175000017500000000034410446314266014245 0ustar aurelaurel#!/bin/sh . config/options $1 geexbox-$GEEXBOX_VERSION-*.iso \ geexbox-generator-$GEEXBOX_VERSION*.tar.gz \ geexbox-$GEEXBOX_VERSION-lite.tar.bz2 \ geexbox-$GEEXBOX_VERSION-full.tar \ > geexbox-$GEEXBOX_VERSION.$1 geexbox-1.0/scripts/unpack0000755000175000017500000000232110446314266014717 0ustar aurelaurel#!/bin/sh . config/options if [ -z "$1" ]; then echo "usage: $0 package_name" exit 1 fi $SCRIPTS/get $1 mkdir -p $BUILD [ ! -d $SOURCES/$1 -a ! -d $PACKAGES/$1/sources ] && exit 0 mkdir -p $STAMPS/$1 STAMP=$STAMPS/$1/unpack [ -f $STAMP -a -f $PACKAGES/$1/need_unpack ] && $PACKAGES/$1/need_unpack $@ for patch in $PACKAGES/$1/patches/*; do if [ $patch -nt $STAMP ]; then rm -f $STAMP break fi done [ -f $STAMP ] && exit 0 printf "%${INDENT}c UNPACK $1\n" >&$SILENT_OUT export INDENT=$((${INDENT:-1}+$INDENT_SIZE)) rm -rf $BUILD/$1* if [ -f $PACKAGES/$1/url ]; then $SCRIPTS/extract $1 "$1*.tar.bz2" $BUILD $SCRIPTS/extract $1 "$1*.tar.gz" $BUILD $SCRIPTS/extract $1 "$1*.tgz" $BUILD fi if [ -d $PACKAGES/$1/sources ]; then [ ! -d $BUILD/$1* ] && mkdir -p $BUILD/$1 cp -PRf $PACKAGES/$1/sources/* $BUILD/$1*/ fi for i in $PACKAGES/$1/patches/*; do if [ -f $i ]; then cat $i | patch -d $BUILD/$1* -p1 >&$VERBOSE_OUT fi done $SCRIPTS/fixconfigtools $BUILD/$1* [ -f $PACKAGES/$1/unpack ] && $PACKAGES/$1/unpack $@ >&$VERBOSE_OUT rm -f $STAMPS/$1/build . $CONFIG/options for i in `sed -n "s/^\(.*\)=.*$/\1/p" $CONFIG/options`; do eval val=\$$i echo STAMP_$i=$val >> $STAMP done geexbox-1.0/packages/0000755000175000017500000000000010446314266013601 5ustar aurelaurelgeexbox-1.0/packages/MPlayer/0000755000175000017500000000000010446314257015152 5ustar aurelaurelgeexbox-1.0/packages/MPlayer/build0000755000175000017500000001357210446314257016207 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build lirc $SCRIPTS/build libogg $SCRIPTS/build libvorbis $SCRIPTS/build libtheora $SCRIPTS/build libdts $SCRIPTS/build libmpcdec $SCRIPTS/build cdparanoia $SCRIPTS/build zlib $SCRIPTS/build alsa $SCRIPTS/build freetype $SCRIPTS/build fribidi $SCRIPTS/build iconv-base setup_toolchain --optimize target if [ "$DXR3" = "yes" ]; then $SCRIPTS/build em8300 DXR3_CONFIG="--enable-dxr3 --enable-ossaudio" else DXR3_CONFIG="--disable-dxr3 --disable-ossaudio" fi if [ "$LIVE555" = "yes" ]; then $SCRIPTS/build live LIVE555_CONFIG="--enable-live --with-livelibdir=$LIB_PREFIX/live" else LIVE555_CONFIG="--disable-live" fi if [ "$ENCODERS" = "yes" ]; then ENCODERS_CONFIG="--enable-mencoder --enable-additional-filters" else ENCODERS_CONFIG="--disable-mencoder --disable-additional-filters" fi if [ "$TARGET_ARCH" = i386 ]; then $SCRIPTS/build vesautils ARCH_CONFIG="--enable-win32 \ --enable-dshow \ --enable-real \ --with-reallibdir=/codecs \ --with-win32libdir=/codecs \ --enable-vesa" else ARCH_CONFIG="--disable-win32 \ --disable-dshow \ --disable-real \ --disable-vesa" fi CFLAGS="$CFLAGS -ffast-math -DFIXED_POINT -D__USE_EXTERN_INLINES" cd $BUILD/$1* ./configure --prefix=/usr \ --confdir=/etc/mplayer \ --with-extralibdir="$LIB_PREFIX/lib" \ --with-extraincdir="$LIB_PREFIX/include" \ $ARCH_CONFIG \ $DXR3_CONFIG \ $LIVE555_CONFIG \ $ENCODERS_CONFIG \ --disable-gui \ --enable-largefiles \ --disable-linux-devfs \ --disable-termcap \ --disable-langinfo \ --enable-lirc \ --disable-lircc \ --enable-joystick \ --disable-xf86keysym \ --enable-tv \ --disable-tv-v4l \ --enable-tv-v4l2 \ --disable-tv-bsdbt848 \ --enable-rtc \ --enable-network \ --disable-winsock2 \ --disable-smb \ --disable-dvdread \ --enable-mpdvdkit \ --enable-dvdnav \ --disable-dvdnav-trace \ --enable-cdparanoia \ --enable-freetype \ --with-freetype-config="$LIB_PREFIX/bin/freetype-config" \ --disable-fontconfig \ --enable-fribidi \ --with-fribidi-config="$LIB_PREFIX/bin/fribidi-config" \ --enable-unrarlib \ --enable-menu \ --disable-sortsub \ --disable-enca \ --disable-macosx \ --disable-inet6 \ --disable-gethostbyname2 \ --disable-ftp \ --disable-vstream \ --disable-gif \ --disable-png \ --disable-jpeg \ --disable-libcdio \ --disable-liblzo \ --disable-qtx \ --disable-xanim \ --disable-xvid \ --disable-x264 \ --disable-divx4linux \ --disable-opendivx \ --enable-libavcodec \ --disable-libavformat \ --enable-libpostproc \ --disable-libavcodec_so \ --disable-libavformat_so \ --disable-libpostproc_so \ --disable-libfame \ --enable-vorbis \ --disable-speex \ --disable-internal-tremor \ --disable-tremor-low \ --disable-external-tremor \ --enable-theora \ --disable-external-faad \ --enable-internal-faad \ --disable-faac \ --disable-ladspa \ --disable-libdv \ --disable-mad \ --disable-toolame \ --disable-xmms \ --enable-mp3lib \ --enable-liba52 \ --enable-libdts \ --disable-libmpeg2 \ --enable-musepack \ --disable-amr_nb \ --disable-amr_nb-fixed \ --disable-amr_wb \ --enable-internal-vidix \ --disable-external-vidix \ --disable-gl \ --disable-dga \ --disable-svga \ --disable-sdl \ --disable-aa \ --disable-caca \ --disable-ggi \ --disable-ggiwmh \ --disable-directx \ --disable-dxr2 \ --disable-dvb \ --enable-dvbhead \ --disable-mga \ --disable-xmga \ --disable-xv \ --disable-xvmc \ --disable-vm \ --disable-xinerama \ --disable-x11 \ --disable-fbdev \ --disable-mlib \ --disable-3dfx \ --disable-tdfxfb \ --disable-directfb \ --disable-zr \ --disable-bl \ --disable-tdfxvid \ --disable-tga \ --disable-pnm \ --disable-md5sum \ --disable-arts \ --disable-esd \ --disable-polyp \ --disable-jack \ --disable-openal \ --enable-alsa \ --disable-sgiaudio \ --disable-sunaudio \ --disable-nas \ --disable-win32waveout \ --disable-select \ --enable-runtime-cpudetection \ --enable-cross-compile \ --target="$TARGET_ARCH-linux" \ --as=$AS \ --cc=$CC \ --host-cc=$HOST_CC \ --language=en \ --disable-shm \ --disable-dynamic-plugins sed -i s/-lnsl// config.mak sed -i 's/.*HAVE_LRINTF.*/#define HAVE_LRINTF 1/' config.h sed -i 's/.*HAVE_ROUND.*/#undef HAVE_ROUND/' config.h [ $DEBUG = "yes" ] && sed -i 's/.*MP_DEBUG.*/#define MP_DEBUG 1/' config.h make $STRIP libdha/libdha.so vidix/drivers/*.so geexbox-1.0/packages/MPlayer/config/0000755000175000017500000000000010446314257016417 5ustar aurelaurelgeexbox-1.0/packages/MPlayer/config/dvd0000644000175000017500000000010110446314257017107 0ustar aurelaurel# Configure system to active the DVD navigation menu. DVDNAV=no geexbox-1.0/packages/MPlayer/config/input.conf0000644000175000017500000000216710446314257020433 0ustar aurelaurel## ## GeeXboX MPlayer input control file ## ## Playback p pause SPACE pause f pt_step -1 g pt_step 1 h tv_step_channel 1 l tv_step_channel -1 n tv_step_norm b tv_step_chanlist ## Seeking RIGHT seek +10 LEFT seek -10 DOWN seek -60 UP seek +60 PGUP seek 600 PGDWN seek -600 ## Audio properties - audio_delay 0.100 + audio_delay -0.100 / volume -1 * volume 1 c mute e switch_audio ## Subtitle properties z sub_delay -0.1 x sub_delay +0.1 r sub_pos -1 t sub_pos +1 w sub_select ## DVD Menu Navigation 8 dvdnav 1 # DVDNav UP 2 dvdnav 2 # DVDNav DOWN 4 dvdnav 3 # DVDNav LEFT 6 dvdnav 4 # DVDNav RIGHT 0 dvdnav 5 # DVDNav MENU ENTER dvdnav 6 # DVDNav SELECT ## Miscelaneous a quit q quit ESC quit k halt o osd m menu toggle ; menu toggle s run /usr/bin/tvswitch y play_dvd #i record ## Controls 1 contrast -1 3 contrast 1 7 brightness -1 9 brightness 1 INS hue -1 DEL hue 1 HOME saturation -1 END saturation 1 ## Joystick JOY_RIGHT seek 10 JOY_LEFT seek -10 JOY_UP seek 60 JOY_DOWN seek -60 JOY_BTN1 menu hide JOY_BTN2 pause JOY_BTN3 osd JOY_BTN4 mute JOY_BTN5 volume -1 JOY_BTN6 volume 1 geexbox-1.0/packages/MPlayer/config/mencoder.conf0000644000175000017500000000551110446314257021064 0ustar aurelaurel# Be smart, don't try to mess with the -tv and -o options. # mp_recorder script knows better than you what it has to do. # Don't edit VCD/SVCD/DVD profiles values : these are standard compliant. [common] profile-desc="Default Recording Options" #tv=tv_options #tv=tv_channels [mpeg1] profile-desc="MPEG1 encoding" profile=common of=mpeg=yes ovc=lavc=yes oac=lavc=yes o="record.mpg" ofps=24000/1001 # 24fps lavcopts=vcodec=mpeg1video:vbitrate=1800:acodec=mp2:abitrate=192 mpegopts=format=mpeg1 vf=harddup [vcd-pal] profile-desc="Video CD (PAL)" profile=common of=mpeg=yes ovc=lavc=yes oac=lavc=yes o="record.mpg" ofps=25 # 25fps lavcopts=vcodec=mpeg1video:keyint=15:vrc_buf_size=327:vrc_minrate=1152:vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 mpegopts=format=xvcd vf=scale=352:288,harddup af=resample=44100:0:0 [vcd-ntsc] profile-desc="Video CD (NTSC)" profile=common of=mpeg=yes ovc=lavc=yes oac=lavc=yes o="record.mpg" ofps=30000/1001 # 29.976fps lavcopts=vcodec=mpeg1video:keyint=18:vrc_buf_size=327:vrc_minrate=1152:vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 mpegopts=format=xvcd vf=scale=352:240,harddup af=resample=44100:0:0 [mpeg2] profile-desc="MPEG2 encoding" profile=common of=mpeg=yes ovc=lavc=yes oac=lavc=yes o="record.mpg" ofps=30000/1001 # 29.976fps lavcopts=vcodec=mpeg2video:vbitrate=1800:acodec=mp2:abitrate=192 mpegopts=format=mpeg2 vf=harddup [svcd-pal] profile-desc="Super Video CD (PAL)" profile=common of=mpeg=yes ovc=lavc=yes oac=lavc=yes o="record.mpg" ofps=25 # 25fps lavcopts=vcodec=mpeg2video:mbd=2:keyint=15:vrc_buf_size=917:vrc_minrate=600:vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 mpegopts=format=xsvcd vf=scale=480:576,harddup af=resample=44100:0:0 [svcd-ntsc] profile-desc="Super Video CD (NTSC)" profile=common of=mpeg=yes ovc=lavc=yes oac=lavc=yes o="record.mpg" ofps=30000/1001 # 29.976fps lavcopts=vcodec=mpeg2video:mbd=2:keyint=18:vrc_buf_size=917:vrc_minrate=600:vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 mpegopts=format=xsvcd vf=scale=480:480,harddup af=resample=44100:0:0 [dvd-pal] profile-desc="DVD Video (PAL)" profile=common of=mpeg=yes ovc=lavc=yes oac=lavc=yes o="record.mpg" ofps=25 # 25fps lavcopts=vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:acodec=mp2:abitrate=384:aspect=16/9 mpegopts=format=dvd vf=scale=720:576,harddup af=resample=48000:0:0 [dvd-ntsc] profile-desc="DVD Video (NTSC)" profile=common of=mpeg=yes ovc=lavc=yes oac=lavc=yes o="record.mpg" ofps=30000/1001 # 29.976fps # NTSC DVDs must contain at least one LPCM or Dolby Digital audio track. lavcopts=vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:acodec=ac3:abitrate=384:aspect=16/9 mpegopts=format=dvd vf=scale=720:480,harddup af=resample=48000:0:0 [dump] profile-desc="Stream Dump" profile=common of=mpeg=yes ovc=copy=yes oac=copy=yes o="record.mpg" geexbox-1.0/packages/MPlayer/config/mplayer.conf0000644000175000017500000000116510446314257020742 0ustar aurelaurelvo=cvidix,vesa mixer-channel=Master framedrop=yes vsync=yes fs=yes zoom=yes menu=yes menu-startup=yes double=yes fixed-vo=yes nocolorkey=yes cache=1500 cache-min=5 idx=yes lircconf=/etc/lircrc sub-fuzziness=1 #monitor-hfreq=31.5k-50k #monitor-vfreq=50-90 input=file=/var/mp_control menu-utf8=1 menu-flip-hebrew=1 # Set Post Processing (h deblock, v deblock, dering, auto luminance) # Consumes CPU power, disabled for low configs, uncomment to enable it. #vf=pp=hb:a/vb:a/dr:a/al:a # Forces RTSP client's port (usefull for FreeboxTV users in router mode) # Do _NOT_ uncomment the line without LIVE555 support #rtsp-port = 31337 geexbox-1.0/packages/MPlayer/config/recorder0000644000175000017500000000026510446314257020152 0ustar aurelaurel# Encoding Options # Location where all recordings will be saved. # Ex: SAVE_PATH="/mnt/disk 1 part 1/my recordings" SAVE_PATH= # Default recording profile RECORD_PROFILE="mpeg1" geexbox-1.0/packages/MPlayer/init.d/0000755000175000017500000000000010446314257016337 5ustar aurelaurelgeexbox-1.0/packages/MPlayer/init.d/68_mp-fonts0000755000175000017500000000305110446314257020344 0ustar aurelaurel#!/bin/sh # # put the right font in the right place # # runlevels: geexbox, debug echo "### Setting up fonts ###" . /etc/lang.conf . /etc/lang.funcs readfirstword() { head -n 1 $1 | sed 's/^\([[:graph:]]*\).*$/\1/' } # set menu and help files according to language setting if test -f /etc/lang; then MENU_LANG=`readfirstword /etc/lang` cp -f /etc/mplayer/menu_$MENU_LANG.conf /etc/mplayer/menu.conf cp -f /usr/share/mplayer/help_$MENU_LANG.txt /usr/share/mplayer/help.txt MENU_CHARSET=`lang2charset $MENU_LANG` [ -z "$MENU_CHARSET" ] && exit 1 MENU_FONT=`lang2font "$MENU_LANG" menu` if [ -f /etc/theme.conf -a -f /usr/share/fonts/themefont.ttf ]; then . /etc/theme.conf [ -z "$FONT_CHARSETS" ] && FONT_CHARSETS="iso-8859-1" for i in $FONT_CHARSETS; do [ "$i" = "$MENU_CHARSET" ] && MENU_FONT="themefont.ttf" && break done fi MENU_FONT="/usr/share/fonts/$MENU_FONT" [ ! -f "$MENU_FONT" ] && exit 1 mp_set_option font "$MENU_FONT" fi # set subtitles font according to subfont setting if test -f /etc/subfont; then SUB_CHARSET=`readfirstword /etc/subfont` SUB_CHARSET=`lang2charset "$SUB_CHARSET"` [ -z "$SUB_CHARSET" ] && exit 1 SUB_FONT=`lang2font "$SUB_CHARSET" sub` SUB_FONT="/usr/share/fonts/$SUB_FONT" [ ! -f "$SUB_FONT" ] && exit 1 mp_set_option subfont "$SUB_FONT" mp_set_option subcp "$SUB_CHARSET" fribidi_mp_set_option "$SUB_CHARSET" fi # set font settings according to theme if test -f /etc/theme.conf; then . /etc/theme.conf mp_set_option subfont-text-scale "$FONT_SIZE" fi exit 0 geexbox-1.0/packages/MPlayer/init.d/70_mp-menu0000755000175000017500000000227410446314257020156 0ustar aurelaurel#!/bin/sh # # configure MPlayer's menu # # runlevels: geexbox, debug echo "### Configuring MPlayer's menu ###" # remove CD from menu if no cd drive is available test -e /dev/cdrom || sed -i 's/.*play_vcd.*//' /etc/mplayer/menu.conf test -e /dev/cdrom || sed -i 's/.*play_cdda.*//' /etc/mplayer/menu.conf # remove DVD from the menu if no dvd drive is available test -e /dev/dvd || sed -i 's/.*play_dvd.*//' /etc/mplayer/menu.conf # disable image file display if fbi is not present or fb not initialized test -x /usr/bin/fbi -a -e /dev/fb0 || ( echo -n "" > /etc/img_ext; sed -i 's/.*set_menu view_img_timeout.*//' /etc/mplayer/menu.conf ) # build a single file extensions filter cat /etc/file_ext > /etc/extensions cat /etc/list_ext >> /etc/extensions cat /etc/img_ext >> /etc/extensions # add partitions space informations in menu for i in `mount | sed -n 's%/dev/\(disk[0-9]part[0-9]\).*%\1%p'`; do MENU_DF="$MENU_DF " done # do the same for cdrom drives for i in `ls /dev/cdrom* | sed -n 's%/dev/\(cdrom[0-9]\).*%\1%p'`; do MENU_DF="$MENU_DF " done [ -n "$MENU_DF" ] && sed -i "s%property=\"MAC\"/>%property=\"MAC\"/> $MENU_DF%" /etc/mplayer/menu.conf exit 0 geexbox-1.0/packages/MPlayer/init.d/72_mp-audio0000755000175000017500000000366510446314257020322 0ustar aurelaurel#!/bin/sh # # configure MPlayer's audio settings # # runlevels: geexbox, debug echo "### Configuring MPlayer's audio settings ###" # include audio configuration file . /etc/audio echo $ALSA_CARD | grep -q ".." || ALSA_CARD="0$ALSA_CARD" case $SOUNDCARD_MODE in SPDIF) ALSA_REAL_MODE=IEC958 ;; analog) ALSA_REAL_MODE=DAC ;; esac ALSA_DEVICE=`sed -n "s/^$ALSA_CARD-\(..\): .*$ALSA_REAL_MODE.*/\1/p" /proc/asound/pcm | tail -n 1` [ -z "$ALSA_DEVICE" ] && ALSA_DEVICE=`grep -iv Modem /proc/asound/pcm | sed -n "s/^$ALSA_CARD-\(..\): .*playback.*/\1/p" | tail -n 1` [ -z "$ALSA_DEVICE" ] && ALSA_DEVICE=`sed -n "s/^$ALSA_CARD-\(..\): .*playback.*/\1/p" /proc/asound/pcm | tail -n 1` [ -n "$ALSA_DEVICE" ] && AO_DEVICE=":device=hw=$ALSA_CARD.$ALSA_DEVICE" [ -x /usr/bin/mencoder ] && echo ":forceaudio=1:alsa=1:adevice=hw.$ALSA_CARD:audiorate=32000" > /var/recorder_alsa # set alsa as audio output isn't forced already. mp_set_option ao "alsa$AO_DEVICE" # enable hardware AC3 output via S/PDIF if audio codec isn't forced already. if [ "$SOUNDCARD_MODE" = SPDIF -a "$AC3_DECODER" = hardware ]; then mp_set_option ac "hwac3," CHANNELS=2 fi # don't use Master mixer channel when not available if [ -z "`amixer -c $ALSA_CARD simple | grep "'Master'"`" ]; then sed -i 's/mixer-channel=Master//' /etc/mplayer/mplayer.conf fi # set number of playback channels if isn't forced already. mp_set_option channels "$CHANNELS" # set DVD default language echo "alang=`sed 's/^\(..\).*/\1/' /etc/lang | head -n 1`,en" >> /etc/mplayer/mplayer.conf # Set suitable background movie when playing audio-only. for i in background-audio.avi background.avi; do if [ -f /usr/share/mplayer/$i ]; then mp_set_option bgvideo "/usr/share/mplayer/$i" break fi done # set softvol for VIA 8235 rev80 and SiS SI7012 rev16 cards if grep -q -e 'Class 0401:.*1106:3059 (rev 80)' -e 'Class 0401:.*13f6:0111 (rev 16)' /proc/pci; then mp_set_option softvol "yes" fi exit 0 geexbox-1.0/packages/MPlayer/init.d/74_mp-video0000755000175000017500000000255110446314257020322 0ustar aurelaurel#!/bin/sh # # configure MPlayer's video settings # # runlevels: geexbox, debug echo "### Configuring MPlayer's video settings ###" # include tvout configuration file . /etc/tvout # set mplayer resolution when using offb if [ -e /dev/fb0 ]; then RES=`/usr/sbin/fbset | sed -n 's/mode "\(.*\)-.*"/\1/p'` RESX=`echo $RES | cut -f1 -dx` RESY=`echo $RES | cut -f2 -dx` mp_set_option screenw "$RESX" mp_set_option screenh "$RESY" else mp_set_option screenw 800 mp_set_option screenh 600 fi # set double to no for nvidia, sis and Kyro cards, VMWare, and some ATI cards for i in 'Class 0300:.*10de:' 'Class 0300:.*1039:' 'Class 0300:.*104a:0010' 'Class 0300:.*15ad:' 'Class 0300:.*1002:4c59'; do if grep -q "$i" /proc/pci; then # except if we want to try nvidia vidix if [ "$i" = 'Class 0300:.*10de:' -a ! -f /etc/mplayer/no_nvidia_vidix ]; then mp_set_option vf "format=yuy2" concat else mp_set_option vo "vesa" mp_set_option double "no" mp_set_option vf "expand=-1:-1:-1:-1:1" concat fi fi done # do not use VESA Direct Graphic Access on Intel i855, i865, i910 and # i915 cards if grep -q -e 'Class 0300:.*8086:3582' -e 'Class 0300:.*8086:2572' -e 'Class 0300:.*8086:2592' -e 'Class 0300:.*8086:2582' /proc/pci; then mp_set_option vo "vesa:nodga" fi # set the tvout aspect mp_set_option monitoraspect "$TVOUT_ASPECT" exit 0 geexbox-1.0/packages/MPlayer/init.d/75_mp-tvcard0000755000175000017500000000532310446314257020500 0ustar aurelaurel#!/bin/sh # # configure MPlayer's v4l2 settings # # runlevels: geexbox, debug echo "### Configuring MPlayer's v4l2 support ###" if [ -f /var/tvcard -a -c /dev/video0 ]; then . /etc/tvcard . /var/tvcard # configure mplayer v4l2 driver if [ -n "$TV_WIDTH" -a -n "$TV_HEIGHT" ]; then TV_OPTIONS=":width=$TV_WIDTH:height=$TV_HEIGHT" fi if [ -n "$TV_BRIGHTNESS" ]; then TV_OPTIONS="$TV_OPTIONS:brightness=$TV_BRIGHTNESS" fi if [ -n "$TV_CONTRAST" ]; then TV_OPTIONS="$TV_OPTIONS:contrast=$TV_CONTRAST" fi if [ -n "$TV_HUE" ]; then TV_OPTIONS="$TV_OPTIONS:hue=$TV_HUE" fi if [ -n "$TV_SATURATION" ]; then TV_OPTIONS="$TV_OPTIONS:saturation=$TV_SATURATION" fi if [ `grep -c ^CHAN /etc/tvcard` -gt 0 ]; then for CHAN in `sed -n 's/^CHAN="\(.*\):\(.*\)"/\1-\2/p' /etc/tvcard | sed 'y/ /_/' `; do mp_set_option tv=channels "$CHAN" concat done else sed "s/.*set_menu tv_chan.*//" /etc/mplayer/menu.conf fi echo "tv=driver=v4l2:norm=$TVIN_STANDARD:chanlist=$CHANLIST$TV_OPTIONS" >> /etc/mplayer/mplayer.conf if [ -x /usr/bin/mencoder ]; then AUDIO_OPTIONS=`cat /var/recorder_alsa` sed -i "s/^#tv=tv_options.*/tv=driver=v4l2:norm=$TVIN_STANDARD:chanlist=$CHANLIST$TV_OPTIONS$AUDIO_OPTIONS/" /etc/mplayer/mencoder.conf TV_CHANNELS=`grep -e tv=channels /etc/mplayer/mplayer.conf` sed -i "s/^#tv=tv_channels.*/$TV_CHANNELS/" /etc/mplayer/mencoder.conf fi IFS=' ' # set mplayer TV channels list echo "" >> /etc/mplayer/menu.conf for CHNAME in `sed -n 's/^tv=channels=//p' /etc/mplayer/mplayer.conf | sed -e 's/,/\n/g' -e 's/_/ /g' | sed 's/\(.*\)-\(.*\)/\2/'`; do echo "" >> /etc/mplayer/menu.conf done echo "" >> /etc/mplayer/menu.conf else # remove tv options from menu sed -i 's/.*ok="set_menu tv_settings".*//' /etc/mplayer/menu.conf sed -i 's/.*ok="set_menu tv_norm".*//' /etc/mplayer/menu.conf fi [ -f /var/digimatrix ] && sed -i 's/set_menu radio_settings/set_menu digimatrix_radio/' /etc/mplayer/menu.conf [ -f /etc/radio ] && . /etc/radio if [ "$RADIO" = yes ]; then # set mplayer menu radio stations list echo "" >> /etc/mplayer/menu.conf grep '^CHAN' /etc/radio | sed "s/^CHAN=\"\([^:]*\):\(.*\)\"//" >> /etc/mplayer/menu.conf echo "" >> /etc/mplayer/menu.conf else # no supported radio card specified sed -i 's/.*ok="set_menu radio_settings".*//' /etc/mplayer/menu.conf fi exit 0 geexbox-1.0/packages/MPlayer/init.d/76_mp-dvbcard0000755000175000017500000000143710446314257020625 0ustar aurelaurel#!/bin/sh # # configure MPlayer's DVB settings # # runlevels: geexbox, debug echo "### Configuring MPlayer's DVB support ###" CHANNELS_CONF=/etc/mplayer/channels.conf if [ -f /var/dvbcard ]; then . /var/dvbcard # build DVB channels configuration file if [ ! -f $CHANNELS_CONF ]; then if [ -f /etc/dvb.conf ]; then dvbscan -x 0 /etc/dvb.conf > $CHANNELS_CONF if [ -s $CHANNELS_CONF ]; then # remove non-coherent detected channels grep -v "^\[.*\]:" $CHANNELS_CONF > /tmp/channels.conf mv /tmp/channels.conf $CHANNELS_CONF fi fi fi fi # no DVB card or no configured channels if [ ! -f /var/dvbcard -o ! -s $CHANNELS_CONF ]; then # remove DVB options from menu sed -i 's/.*ok="set_menu dvb_sel".*//' /etc/mplayer/menu.conf fi exit 0 geexbox-1.0/packages/MPlayer/init.d/77_mp-dxr30000755000175000017500000000166410446314257020103 0ustar aurelaurel#!/bin/sh # # configure DXR3/Hollywood+ cards for MPlayer # # runlevels: geexbox, debug # include audio configuration file . /etc/audio # include tvout configuration file . /etc/tvout # set ao, vo and vf for DXR3/Hollywood+ cards and upload microcode. if [ -e /var/use_dxr3 ]; then echo "### Configuring DXR3/Hollywood+ cards for MPlayer ###" mp_set_option vo "dxr3:sync:norm=0" mp_set_option ao "oss:/dev/em8300_ma-0" mp_set_option vf "expand=-1:-1:-1:-1:1" concat sed -i "s%play_dvd.*%quit 167\"/>%" /etc/mplayer/menu.conf em8300setup -p -a -o >/dev/null 2>&1 # TVOut standard (default is PAL) if [ "$TVOUT_STANDARD" = "ntsc" ]; then em8300setup -n >/dev/null 2>&1 fi # set display to WideScreen format (default is 4:3) if [ "$TVOUT_ASPECT" = "16:9" ]; then em8300setup -w >/dev/null 2>&1 fi # use SPDIF output ? if [ "$SOUNDCARD_MODE" = SPDIF ]; then em8300setup -d >/dev/null 2>&1 fi fi exit 0 geexbox-1.0/packages/MPlayer/init.d/78_mp-utils0000755000175000017500000000074010446314257020356 0ustar aurelaurel#!/bin/sh # # start MPlayer's utilities # # runlevels: geexbox, debug echo "### Starting MPlayer's utilities ###" # create the mplayer control pipe for external programs mkfifo /var/mp_control # start the autolaunching script . /etc/autoplay [ $AUTOPLAY == "yes" ] && echo -n "" > /var/autoplay /usr/bin/autoplay 8 > /var/mp_control & # proceed to dvdnav setting . /etc/dvd [ $DVDNAV == "yes" ] && echo -n "" > /var/dvdnav # start the file copy daemon /usr/bin/cpd & exit 0 geexbox-1.0/packages/MPlayer/init.d/79_mp-recorder0000755000175000017500000000204610446314257021025 0ustar aurelaurel#!/bin/sh # # setup MEncoder recording profiles menu # # runlevels: geexbox, debug CFG=/etc/mplayer/mencoder.conf MENU=/etc/mplayer/menu.conf RECORD_CFG=/etc/recorder HELP=/usr/share/mplayer/help.txt echo "### Building MEncoder profiles selection menu ###" [ -f $RECORD_CFG ] && . $RECORD_CFG # Add list of supported encoding profiles if [ -x /usr/bin/mencoder -a ! -z "$SAVE_PATH" ]; then echo "" >> $MENU echo "" >> $MENU for profile in `grep "^\[" $CFG | grep -v common | grep -v dump | sed 's/\[//' | sed 's/\]//'`; do desc=`grep -A 1 "\[$profile\]" $CFG | grep profile-desc | sed 's/.*profile-desc=\"\(.*\)\"/\1/'` echo " " >> $MENU done echo "" >> $MENU else # no encoder available sed -i -e 's/.*ok="set_menu recorder".*//' -e 's/.*ok="set_menu profile_sel".*//' $MENU sed -i "s/^i :.*//" $HELP fi exit 0 geexbox-1.0/packages/MPlayer/init.d/82_mplayer0000755000175000017500000000243210446314257020250 0ustar aurelaurel#!/bin/sh # # configure and launch mplayer # # runlevels: geexbox, debug echo "### Starting MPlayer ###" # disable console blanking and cursor blinking for a proper MPlayer start echo -e "\033[9;0]" echo -e "\033[?25l" # disable kernel messages to avoid MPlayer screen corruption echo 0 > /proc/sys/kernel/printk # default directory echo -n /mnt/ > /var/mp_current_path # tty used for the video display and commands input TTY=4 RET=0 # start mplayer with gdb when built with debugging options if test -x /usr/bin/gdb; then echo "r /usr/share/mplayer/background.avi -loop 0" > /gdb_cmd gdb -x /gdb_cmd /usr/bin/mplayer else echo "0" > /tmp/mp_result # disable fbdev cursor echo -e "\033[?1;;c" >/dev/tty$TTY chvt $TTY ( # start mplayer or fbi and keep them launched while true; do if [ -n "`pidof lircd`" ]; then irpty /etc/lircrc -- mp_wrapper else mp_wrapper fi # kill mencoder if it is still running [ -x /usr/bin/mp_recorder ] && mp_recorder test `cat /tmp/mp_result` -eq 165 -a -x /usr/bin/fbi && fbi_wrapper test `cat /tmp/mp_result` -eq 166 && return 0 test `cat /tmp/mp_result` -eq 167 && mplayer dvd://1 > /dev/null 2>&1 test `cat /tmp/mp_result` -eq 168 && return 64 done ) $INSTALL/etc/mplayer/no_nvidia_vidix echo "Vidix should give you better performance especially with low-end hardware." >> $INSTALL/etc/mplayer/no_nvidia_vidix echo "This feature is not very well tested. That's why it is not enabled by" >> $INSTALL/etc/mplayer/no_nvidia_vidix echo "default. And that's also why you should help us, testing this feature" >> $INSTALL/etc/mplayer/no_nvidia_vidix echo "and reporting your results if you own nvidia hardware." >> $INSTALL/etc/mplayer/no_nvidia_vidix mkdir -p $INSTALL/codecs cp $BUILD/$1*/etc/codecs.conf $INSTALL/etc/mplayer if [ "$2" != generator ]; then cp $BUILD/theme-$THEME/background.avi $INSTALL/usr/share/mplayer [ -f $BUILD/theme-$THEME/background-audio.avi ] && cp $BUILD/theme-$THEME/background-audio.avi $INSTALL/usr/share/mplayer fi exit 0 geexbox-1.0/packages/MPlayer/need_build0000755000175000017500000000016510446314257017174 0ustar aurelaurel#!/bin/sh . config/options STAMP=$STAMPS/$1/build . $STAMP [ "$DEBUG" != "$STAMP_DEBUG" ] && rm -f $STAMP exit 0 geexbox-1.0/packages/MPlayer/patches/0000755000175000017500000000000010446314257016601 5ustar aurelaurelgeexbox-1.0/packages/MPlayer/patches/000_use-lrint-for-ints.diff0000644000175000017500000000373210446314257023500 0ustar aurelaurel* use lrint() whenever the left-value is integer this allows the compliation to use lrint() inlined math macros without this patch, gcc 4.1.0 optimize rint() calls into lrint() but, we dont have function of lrint(), just inlined math macro. use lrintf() whenever the argument is float for the same reason. diff -r 51494c531769 libavcodec/snow.c --- a/libavcodec/snow.c Sun Apr 30 16:52:40 2006 +0200 +++ b/libavcodec/snow.c Sun Apr 30 16:54:28 2006 +0200 @@ -3953,7 +3953,7 @@ } static int qscale2qlog(int qscale){ - return rint(QROOT*log(qscale / (float)FF_QP2LAMBDA)/log(2)) + return lrint(QROOT*log(qscale / (float)FF_QP2LAMBDA)/log(2)) + 61*QROOT/8; //<64 >60 } diff -r 51494c531769 libmpcodecs/vf_hue.c --- a/libmpcodecs/vf_hue.c Sun Apr 30 16:52:40 2006 +0200 +++ b/libmpcodecs/vf_hue.c Sun Apr 30 16:54:28 2006 +0200 @@ -31,8 +31,8 @@ static void process_C(uint8_t *udst, uin int w, int h, float hue, float sat) { int i; - const int s= rint(sin(hue) * (1<<16) * sat); - const int c= rint(cos(hue) * (1<<16) * sat); + const int s= lrint(sin(hue) * (1<<16) * sat); + const int c= lrint(cos(hue) * (1<<16) * sat); while (h--) { for (i = 0; iitem,"hue")) { - eq->value = rint(vf->priv->hue *100 / M_PI); + eq->value = lrint(vf->priv->hue *100 / M_PI); return CONTROL_TRUE; }else if (!strcmp(eq->item,"saturation")) { - eq->value = rint(vf->priv->saturation*100 - 100); + eq->value = lrintf(vf->priv->saturation*100 - 100); return CONTROL_TRUE; } break; diff -r 51494c531769 libvo/vo_dxr3.c --- a/libvo/vo_dxr3.c Sun Apr 30 16:52:40 2006 +0200 +++ b/libvo/vo_dxr3.c Sun Apr 30 16:54:28 2006 +0200 @@ -1307,7 +1307,7 @@ static int col_interp(float x, struct co y = 255; if(y < 0) y = 0; - return rint(y); + return lrintf(y); } static int overlay_set_keycolor(overlay_t *o, int color) { geexbox-1.0/packages/MPlayer/patches/005_nopcidb.diff0000644000175000017500000000503510446314257021440 0ustar aurelaureldiff -r c34020f29f4a libdha/pci_db2c.awk --- a/libdha/pci_db2c.awk Sun Apr 30 16:54:29 2006 +0200 +++ b/libdha/pci_db2c.awk Sun Apr 30 16:54:30 2006 +0200 @@ -44,9 +44,6 @@ BEGIN { print_name_struct(name_h_file); print "#include ">name_file print "#include \"pci_names.h\"">name_file - print "#include \"pci_dev_ids.c\"">name_file - print "">name_file - print "static struct vendor_id_s vendor_ids[] = {">name_file first_pass=1; init_name_db(); while(getline vendor_file; if(length(svend_name) < 9) printf("\t") >vendor_file; printf("0x%s /*%s*/\n",field[2], name_field) >vendor_file; - printf("{ 0x%s, \"%s\", dev_lst_%s },\n",field[2], name_field, field[2]) >name_file; printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_file if(first_pass == 1) { first_pass=0; } else { print "{ 0xFFFF, NULL }\n};" >dev_ids_file; } @@ -102,7 +98,6 @@ BEGIN { print "#endif/*PCI_IDS_INCLUDED*/">ids_file print "">name_h_file print "#endif/*PCI_NAMES_INCLUDED*/">name_h_file - print "};">name_file print "{ 0xFFFF, NULL }" >dev_ids_file; print "};">dev_ids_file print_func_bodies(name_file); @@ -149,30 +144,11 @@ function print_func_bodies(out_file) print "">out_file print "const char *pci_vendor_name(unsigned short id)" >out_file print "{" >out_file - print " unsigned i;" >out_file - print " for(i=0;iout_file - print " {" >out_file - print "\tif(vendor_ids[i].id == id) return vendor_ids[i].name;" >out_file - print " }" >out_file print " return NULL;" >out_file print "}">out_file print "" >out_file print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)" >out_file print "{" >out_file - print " unsigned i, j;" >out_file - print " for(i=0;iout_file - print " {" >out_file - print "\tif(vendor_ids[i].id == vendor_id)" >out_file - print "\t{" >out_file - print "\t j=0;" >out_file - print "\t while(vendor_ids[i].dev_list[j].id != 0xFFFF)" >out_file - print "\t {">out_file - print "\t\tif(vendor_ids[i].dev_list[j].id == device_id) return vendor_ids[i].dev_list[j].name;">out_file - print "\t\tj++;">out_file - print "\t };">out_file - print "\t break;" >out_file - print "\t}" >out_file - print " }" >out_file print " return NULL;">out_file print "}">out_file return geexbox-1.0/packages/MPlayer/patches/010_getpath.diff0000644000175000017500000000114510446314257021450 0ustar aurelaureldiff -r 839719c3cc68 get_path.c --- a/get_path.c Sun Apr 30 16:54:30 2006 +0200 +++ b/get_path.c Sun Apr 30 16:54:30 2006 +0200 @@ -24,7 +24,7 @@ char *get_path(char *filename){ #if defined(__MINGW32__) static char *config_dir = "/mplayer"; #else - static char *config_dir = "/.mplayer"; + static char *config_dir = "/mplayer"; #endif int len; #ifdef MACOSX_BUNDLE @@ -51,6 +51,7 @@ char *get_path(char *filename){ #else return NULL; #endif + homedir = "/etc"; len = strlen(homedir) + strlen(config_dir) + 1; if (filename == NULL) { if ((buff = (char *) malloc(len)) == NULL) geexbox-1.0/packages/MPlayer/patches/015_fix-include-pci.h.diff0000644000175000017500000000073110446314257023227 0ustar aurelaurel* fix #include for ppc target (linux 2.6). diff -r 73fec1c7390a libdha/sysdep/pci_linux.c --- a/libdha/sysdep/pci_linux.c Sun Apr 30 16:54:30 2006 +0200 +++ b/libdha/sysdep/pci_linux.c Sun Apr 30 16:54:30 2006 +0200 @@ -131,6 +131,7 @@ static int pci_config_type( void ) { ret mplayer-dev-eng@mplayerhq.hu, colin@colino.net*/ #include //#include +#define LINUX_MOD_DEVICETABLE_H #include #include "../../bswap.h" geexbox-1.0/packages/MPlayer/patches/050-vesa-setdisplay-nonfatal.diff0000644000175000017500000000143710446314257024657 0ustar aurelaurelif double buffering is enabled, but vbeSetDisplayStart() fails turn double buffering off. vbeSetDisplayStart always fails on VMWare. diff -Nur MPlayer-20060519.orig/libvo/vo_vesa.c MPlayer-20060519/libvo/vo_vesa.c --- MPlayer-20060519.orig/libvo/vo_vesa.c Sat Apr 29 02:06:42 2006 +++ MPlayer-20060519/libvo/vo_vesa.c Fri May 26 19:00:04 2006 @@ -1022,7 +1022,12 @@ } if(HAS_DGA() && vo_doublebuffering) { - for(i=0;i= 0) { mp_msg(MSGT_AO,MSGL_V,"alsa-init: chunksize set to %li\n", chunk_size); } if ((err = snd_pcm_hw_params_set_periods_near(alsa_handler, alsa_hwparams, geexbox-1.0/packages/MPlayer/patches/105_mixer-control-always-on.diff0000664000175000017500000000246010446314257024536 0ustar aurelaurel* Allows control of the audio mixer even for media with no audio content (e.g. background.avi or tv:// with immediatemode=1) --- old/mplayer.c 2006-05-27 02:33:57.000000000 +0800 +++ new/mplayer.c 2006-05-27 02:34:09.000000000 +0800 @@ -1567,7 +1567,7 @@ /// Volume (RW) static int mp_property_volume(m_option_t* prop,int action,void* arg) { - if(!sh_audio) return M_PROPERTY_UNAVAILABLE; +/* if(!sh_audio) return M_PROPERTY_UNAVAILABLE;*/ switch(action) { case M_PROPERTY_GET: @@ -1616,7 +1616,7 @@ /// Mute (RW) static int mp_property_mute(m_option_t* prop,int action,void* arg) { - if(!sh_audio) return M_PROPERTY_UNAVAILABLE; +/* if(!sh_audio) return M_PROPERTY_UNAVAILABLE; */ switch(action) { case M_PROPERTY_SET: @@ -3731,6 +3731,20 @@ mixer.audio_out = audio_out; mixer.volstep = volstep; } +else if (!strncmp (filename, "dvd", 3) || strcasestr (filename, ".ifo")) { + audio_out=NULL; +} +else{ +#if WORDS_BIGENDIAN + if(audio_out=init_best_audio_out(audio_driver_list,0,11025,2,AF_FORMAT_S16_BE,0)){ +#else + if(audio_out=init_best_audio_out(audio_driver_list,0,11025,2,AF_FORMAT_S16_LE,0)){ +#endif + inited_flags|=INITED_AO; + mixer.audio_out = audio_out; + mixer.volstep = volstep; + } +} current_module="av_init"; geexbox-1.0/packages/MPlayer/patches/115_mixer-reset-mute-on-exit.diff0000664000175000017500000000145510446314257024625 0ustar aurelaurel--- old/mplayer.c 2006-05-28 12:34:59.000000000 +0800 +++ new/mplayer.c 2006-05-28 12:48:05.000000000 +0800 @@ -437,6 +437,11 @@ #define INITED_VCODEC 2048 #define INITED_ALL 0xFFFF +#include "mixer.h" +mixer_t mixer; +/// step size of mixer changes +int volstep = 3; + static void uninit_player(unsigned int mask){ mask=inited_flags&mask; @@ -520,6 +525,8 @@ if(mask&INITED_AO){ inited_flags&=~INITED_AO; current_module="uninit_ao"; + if (user_muted | edl_muted) + mixer_mute(&mixer); audio_out->uninit(eof?0:1); audio_out=NULL; } @@ -664,11 +671,6 @@ extern void mp_input_register_options(m_config_t* cfg); -#include "mixer.h" -mixer_t mixer; -/// step size of mixer changes -int volstep = 3; - #include "cfg-mplayer.h" void parse_cfgfiles( m_config_t* conf ) geexbox-1.0/packages/MPlayer/patches/150_increase-cfg-parse-length-string.diff0000664000175000017500000000067210446314257026250 0ustar aurelaureldiff -r d4838c53105a parser-cfg.c --- a/parser-cfg.c Sun Apr 30 16:54:28 2006 +0200 +++ b/parser-cfg.c Sun Apr 30 16:54:28 2006 +0200 @@ -39,7 +39,7 @@ int m_config_parse_config_file(m_config_ #define PRINT_LINENUM mp_msg(MSGT_CFGPARSER,MSGL_V,"%s(%d): ", conffile, line_num) #define MAX_LINE_LEN 10000 #define MAX_OPT_LEN 1000 -#define MAX_PARAM_LEN 1000 +#define MAX_PARAM_LEN 1500 FILE *fp; char *line; char opt[MAX_OPT_LEN + 1]; geexbox-1.0/packages/MPlayer/patches/155_additional-filters.diff0000644000175000017500000001040510446314257023603 0ustar aurelaureldiff -r 9fdb997b3020 configure --- a/configure Sun Apr 30 16:54:28 2006 +0200 +++ b/configure Sun Apr 30 16:54:29 2006 +0200 @@ -1660,6 +1660,7 @@ _inet6=auto _inet6=auto _gethostbyname2=auto _ftp=yes +_additional_filters=yes _musepack=auto _vstream=auto _pthreads=yes @@ -2057,6 +2058,8 @@ for ac_option do --disable-win32) _win32=no _dshow=no ;; --enable-dshow) _win32=yes _dshow=yes ;; --disable-dshow) _dshow=no ;; + --enable-additional-filters) _additional_filters=yes ;; + --disable-additional-filters) _additional_filters=no ;; --with-x11incdir=*) _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'` @@ -6853,6 +6856,12 @@ fi fi echores "$_gethostbyname2" +if test "$_additional_filters" = yes ; then + _def_additional_filters='#define USE_ADDITIONAL_FILTERS 1' +else + _def_additional_filters='#undef USE_ADDITIONAL_FILTERS' +fi + # --------------- GUI specific tests begin ------------------- echocheck "GUI" echo "$_gui" @@ -7353,6 +7362,7 @@ CONFIG_LIBAVFORMAT_SO = $_libavformat_so CONFIG_LIBAVFORMAT_SO = $_libavformat_so CONFIG_LIBPOSTPROC = $_libpostproc CONFIG_LIBPOSTPROC_SO = $_libpostproc_so +ADDITIONAL_FILTERS = $_additional_filters ZORAN = $_zr FAME = $_fame FAME_LIB = $_ld_fame @@ -7737,6 +7747,9 @@ int setenv(const char *name, const char /* DirectShow support */ $_def_dshow +/* Additionnal filters support */ +$_def_additional_filters + /* Mac OS X specific features */ $_def_macosx $_def_macosx_finder_support diff -r 9fdb997b3020 libmpcodecs/Makefile --- a/libmpcodecs/Makefile Sun Apr 30 16:54:28 2006 +0200 +++ b/libmpcodecs/Makefile Sun Apr 30 16:54:29 2006 +0200 @@ -86,12 +86,18 @@ VIDEO_SRCS=dec_video.c \ $(VIDEO_SRCS_OPT) \ VFILTER_SRCS=vf.c \ - pullup.c \ + vf_crop.c \ + vf_expand.c \ + vf_format.c \ + vf_scale.c \ + vf_vo.c \ + +ifeq ($(ADDITIONAL_FILTERS),yes) +VFILTER_SRCS+=pullup.c \ vf_1bpp.c \ vf_2xsai.c \ vf_bmovl.c \ vf_boxblur.c \ - vf_crop.c \ vf_cropdetect.c \ vf_decimate.c \ vf_delogo.c \ @@ -104,12 +110,10 @@ VFILTER_SRCS=vf.c \ vf_dvbscale.c \ vf_eq2.c \ vf_eq.c \ - vf_expand.c \ vf_field.c \ vf_fil.c \ vf_filmdint.c \ vf_flip.c \ - vf_format.c \ vf_framestep.c \ vf_halfpack.c \ vf_harddup.c \ @@ -133,7 +137,6 @@ VFILTER_SRCS=vf.c \ vf_rgbtest.c \ vf_rotate.c \ vf_sab.c \ - vf_scale.c \ vf_smartblur.c \ vf_softpulldown.c \ vf_softskip.c \ @@ -144,11 +147,12 @@ VFILTER_SRCS=vf.c \ vf_tile.c \ vf_tinterlace.c \ vf_unsharp.c \ - vf_vo.c \ vf_yuvcsp.c \ vf_yuy2.c \ vf_yvu9.c \ vf_screenshot.c \ vf_yadif.c \ + +endif VFILTER_LAVC_SRCS += vf_lavc.c \ vf_lavcdeint.c \ diff -r 9fdb997b3020 libmpcodecs/vf.c --- a/libmpcodecs/vf.c Sun Apr 30 16:54:28 2006 +0200 +++ b/libmpcodecs/vf.c Sun Apr 30 16:54:29 2006 +0200 @@ -103,22 +103,26 @@ extern vf_info_t vf_info_screenshot; // list of available filters: static vf_info_t* filter_list[]={ - &vf_info_rectangle, -#ifndef HAVE_NO_POSIX_SELECT - &vf_info_bmovl, -#endif &vf_info_crop, &vf_info_expand, #if defined(USE_LIBPOSTPROC) || defined(USE_LIBPOSTPROC_SO) &vf_info_pp, #endif &vf_info_scale, +#ifdef USE_LIBAVCODEC + &vf_info_lavc, +#endif // &vf_info_osd, &vf_info_vo, + &vf_info_format, +#ifdef USE_ADDITIONAL_FILTERS + &vf_info_rectangle, +#ifndef HAVE_NO_POSIX_SELECT + &vf_info_bmovl, +#endif #ifdef USE_LIBFAME &vf_info_fame, #endif - &vf_info_format, &vf_info_noformat, &vf_info_yuy2, &vf_info_flip, @@ -127,7 +131,6 @@ static vf_info_t* filter_list[]={ &vf_info_mirror, &vf_info_palette, #ifdef USE_LIBAVCODEC - &vf_info_lavc, &vf_info_lavcdeint, #endif #ifdef HAVE_ZR @@ -198,6 +198,7 @@ &vf_info_screenshot, #endif &vf_info_yadif, +#endif NULL }; geexbox-1.0/packages/MPlayer/patches/165_conf.diff0000644000175000017500000000074110446314257020755 0ustar aurelaureldiff -r 33007f27d435 playtree.c --- a/playtree.c Sun Apr 30 16:54:30 2006 +0200 +++ b/playtree.c Sun Apr 30 16:54:31 2006 +0200 @@ -710,8 +710,9 @@ play_tree_iter_up_step(play_tree_iter_t* iter->tree = iter->tree->parent; // Pop subtree params - if(iter->config) { + if(iter->config && iter->entry_pushed > 0) { m_config_pop(iter->config); + iter->entry_pushed = 0; if(iter->mode == PLAY_TREE_ITER_RND) iter->tree->flags |= PLAY_TREE_RND_PLAYED; } geexbox-1.0/packages/MPlayer/patches/170_switch-ratio.diff0000644000175000017500000000073710446314257022446 0ustar aurelaureldiff -Naur MPlayer-20060519.orig/mplayer.c MPlayer-20060519/mplayer.c --- MPlayer-20060519.orig/mplayer.c 2006-05-25 12:55:35.000000000 +0200 +++ MPlayer-20060519/mplayer.c 2006-05-25 12:56:06.000000000 +0200 @@ -4927,7 +4927,7 @@ } break; case MP_CMD_SWITCH_RATIO : { - if (cmd->nargs == 0) + if (cmd->nargs == 0 || cmd->args[0].v.f == -1) movie_aspect = (float) sh_video->disp_w / sh_video->disp_h; else movie_aspect = cmd->args[0].v.f; geexbox-1.0/packages/MPlayer/patches/175_mpegpes.diff0000644000175000017500000000675410446314257021503 0ustar aurelaureldiff -r 9dec3136b59c libmenu/vf_menu.c --- a/libmenu/vf_menu.c Sun Apr 30 17:12:19 2006 +0200 +++ b/libmenu/vf_menu.c Sun Apr 30 17:22:53 2006 +0200 @@ -39,6 +39,7 @@ struct vf_priv_s { struct vf_priv_s { menu_t* root; menu_t* current; + int passthrough; }; static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts); @@ -180,6 +181,13 @@ static int put_image(struct vf_instance_ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ mp_image_t *dmpi = NULL; + if (vf->priv->passthrough) { + dmpi=vf_get_image(vf->next, IMGFMT_MPEGPES, MP_IMGTYPE_EXPORT, + 0, mpi->w, mpi->h); + dmpi->planes[0]=mpi->planes[0]; + return vf_next_put_image(vf,dmpi, pts); + } + if(vf->priv->current->show || (vf->priv->current->parent && vf->priv->current->parent->show)) { // Close all menu who requested it @@ -271,8 +279,15 @@ static int config(struct vf_instance_s* load_font_ft(width,height,&vo_font,font_name); } #endif + if(outfmt == IMGFMT_MPEGPES) + vf->priv->passthrough = 1; return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); } + +static int query_format(struct vf_instance_s* vf, unsigned int fmt){ + return (vf_next_query_format(vf,fmt)); +} + static int open(vf_instance_t *vf, char* args){ if(!st_priv) { st_priv = calloc(1,sizeof(struct vf_priv_s)); @@ -287,6 +302,7 @@ static int open(vf_instance_t *vf, char* } vf->config = config; + vf->query_format=query_format; vf->put_image = put_image; vf->get_image = get_image; vf->uninit=uninit; diff -r 9dec3136b59c libmpcodecs/vf_expand.c --- a/libmpcodecs/vf_expand.c Sun Apr 30 17:12:19 2006 +0200 +++ b/libmpcodecs/vf_expand.c Sun Apr 30 17:22:53 2006 +0200 @@ -31,6 +31,7 @@ static struct vf_priv_s { double aspect; int round; unsigned char* fb_ptr; + int passthrough; int first_slice; } vf_priv_dflt = { -1,-1, @@ -39,6 +40,7 @@ static struct vf_priv_s { 0., 1, NULL, + 0, 0 }; @@ -170,6 +172,10 @@ static int config(struct vf_instance_s* static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ + if(outfmt == IMGFMT_MPEGPES) { + vf->priv->passthrough = 1; + return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); + } if (outfmt == IMGFMT_IF09) return 0; // calculate the missing parameters: #if 0 @@ -331,6 +337,13 @@ static void draw_slice(struct vf_instanc } static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ + if (vf->priv->passthrough) { + mp_image_t *dmpi = vf_get_image(vf->next, IMGFMT_MPEGPES, + MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h); + dmpi->planes[0]=mpi->planes[0]; + return vf_next_put_image(vf,dmpi, pts); + } + if(mpi->flags&MP_IMGFLAG_DIRECT || mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){ vf->dmpi=mpi->priv; if(!vf->dmpi) { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_FunWhydowegetNULL); return 0; } @@ -388,9 +401,14 @@ static int control(struct vf_instance_s* return vf_next_control(vf,request,data); } +static int query_format(struct vf_instance_s* vf, unsigned int fmt){ + return (vf_next_query_format(vf,fmt)); +} + static int open(vf_instance_t *vf, char* args){ vf->config=config; vf->control=control; + vf->query_format=query_format; vf->start_slice=start_slice; vf->draw_slice=draw_slice; vf->get_image=get_image; geexbox-1.0/packages/MPlayer/patches/180_mpegts-alang-subs.diff0000644000175000017500000000113610446314257023355 0ustar aurelaureldiff -r 2006b012d73e libmpdemux/demux_ts.c --- a/libmpdemux/demux_ts.c Sun Apr 30 16:54:44 2006 +0200 +++ b/libmpdemux/demux_ts.c Sun Apr 30 16:54:45 2006 +0200 @@ -890,20 +890,8 @@ static demuxer_t *demux_open_ts(demuxer_ params.prog = ts_prog; params.probe = ts_probe; - if(dvdsub_lang != NULL) - { - strncpy(params.slang, dvdsub_lang, 3); - params.slang[3] = 0; - } - else memset(params.slang, 0, 4); - if(audio_lang != NULL) - { - strncpy(params.alang, audio_lang, 3); - params.alang[3] = 0; - } - else memset(params.alang, 0, 4); start_pos = ts_detect_streams(demuxer, ¶ms); geexbox-1.0/packages/MPlayer/patches/185_slave-set-option.diff0000644000175000017500000000360410446314257023244 0ustar aurelaureldiff -r 1abf56096b14 input/input.c --- a/input/input.c Sun Apr 30 16:54:45 2006 +0200 +++ b/input/input.c Sun Apr 30 16:54:45 2006 +0200 @@ -86,6 +86,7 @@ static mp_cmd_t mp_cmds[] = { { MP_CMD_GET_TIME_POS, "get_time_pos", 0, { {-1,{0}} } }, { MP_CMD_GET_TIME_LENGTH, "get_time_length", 0, { {-1,{0}} } }, { MP_CMD_SWITCH_AUDIO, "switch_audio", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } }, + { MP_CMD_SET_OPTION, "set_option", 2, { { MP_CMD_ARG_STRING, {0}}, { MP_CMD_ARG_STRING, {0}}, { MP_CMD_ARG_STRING, {0}}, {-1,{0}} } }, #ifdef USE_TV { MP_CMD_TV_STEP_CHANNEL, "tv_step_channel", 1, { { MP_CMD_ARG_INT ,{0}}, {-1,{0}} }}, { MP_CMD_TV_STEP_NORM, "tv_step_norm",0, { {-1,{0}} } }, diff -r 1abf56096b14 input/input.h --- a/input/input.h Sun Apr 30 16:54:45 2006 +0200 +++ b/input/input.h Sun Apr 30 16:54:45 2006 +0200 @@ -78,6 +78,8 @@ #define MP_CMD_RECORD 95 +#define MP_CMD_SET_OPTION 90 + #define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_LOADFILE 5001 #define MP_CMD_GUI_LOADSUBTITLE 5002 diff -r 1abf56096b14 mplayer.c --- a/mplayer.c Sun Apr 30 16:54:45 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:45 2006 +0200 @@ -4516,6 +4516,20 @@ if (stream->type==STREAMTYPE_DVDNAV && d case MP_CMD_GRAB_FRAMES : { grab_frames=2; } break; + case MP_CMD_SET_OPTION: { + char *option = cmd->args[0].v.s, *value = cmd->args[1].v.s; + m_config_set_option(mconfig, option, value); + if (cmd->nargs==3 && !strcmp(cmd->args[2].v.s, "save")) { + char *buf; + size_t len; + len = strlen(option) + strlen(value) + sizeof("mp_set_option '' ''"); + if ((buf = (char*)malloc(len))) { + sprintf(buf, "mp_set_option '%s' '%s'", option, value); + system(buf); + free(buf); + } + } + } break; case MP_CMD_PLAY_TREE_STEP : { int n = cmd->args[0].v.i; int force = cmd->args[1].v.i; geexbox-1.0/packages/MPlayer/patches/190_rtsp_noindex.diff0000644000175000017500000000144010446314257022537 0ustar aurelaureldiff -Naur MPlayer-20060519.orig/libmpdemux/realrtsp/rtsp.c MPlayer-20060519/libmpdemux/realrtsp/rtsp.c --- MPlayer-20060519.orig/libmpdemux/realrtsp/rtsp.c 2006-06-08 20:32:18.000000000 +0200 +++ MPlayer-20060519/libmpdemux/realrtsp/rtsp.c 2006-06-08 20:33:24.000000000 +0200 @@ -906,7 +906,8 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { URL_t *url; - + extern int index_mode; + mp_msg(MSGT_OPEN, MSGL_INFO, "STREAM_RTSP, URL: %s\n", stream->url); stream->streaming_ctrl = streaming_ctrl_new(); if( stream->streaming_ctrl==NULL ) @@ -918,6 +919,7 @@ //url_free(url); stream->fd = -1; + index_mode = -1; if(realrtsp_streaming_start( stream ) < 0) { streaming_ctrl_free(stream->streaming_ctrl); stream->streaming_ctrl = NULL; geexbox-1.0/packages/MPlayer/patches/195_asf_streaming.diff0000644000175000017500000001720110446314257022654 0ustar aurelaureldiff -Naur MPlayer-1.0pre8.orig/libmpdemux/asfheader.c MPlayer-1.0pre8/libmpdemux/asfheader.c --- MPlayer-1.0pre8.orig/libmpdemux/asfheader.c 2006-06-14 21:53:00.000000000 +0200 +++ MPlayer-1.0pre8/libmpdemux/asfheader.c 2006-06-14 21:53:12.000000000 +0200 @@ -34,8 +34,6 @@ #define ASF_GUID_PREFIX_file_header 0x8CABDCA1 #define ASF_GUID_PREFIX_content_desc 0x75b22633 #define ASF_GUID_PREFIX_stream_group 0x7bf875ce -#define ASF_GUID_PREFIX_ext_audio_stream 0x31178C9D -#define ASF_GUID_PREFIX_ext_stream_embed_stream_header 0x3AFB65E2 /* const char asf_audio_stream_guid[16] = {0x40, 0x9e, 0x69, 0xf8, @@ -53,12 +51,6 @@ 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2}; const char asf_data_chunk_guid[16] = {0x36, 0x26, 0xb2, 0x75, 0x8e, 0x66, 0xcf, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c}; -const char asf_ext_stream_embed_stream_header[16] = {0xe2, 0x65, 0xfb, 0x3a, - 0xef, 0x47, 0xf2, 0x40, 0xac, 0x2c, 0x70, 0xa9, 0x0d, 0x71, 0xd3, 0x43}; -const char asf_ext_stream_audio[16] = {0x9d, 0x8c, 0x17, 0x31, - 0xe1, 0x03, 0x28, 0x45, 0xb5, 0x82, 0x3d, 0xf9, 0xdb, 0x22, 0xf5, 0x03}; -const char asf_ext_stream_header[16] = {0xCB, 0xA5, 0xE6, 0x14, - 0x72, 0xC6, 0x32, 0x43, 0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A}; // the variable string is modify in this function @@ -85,10 +77,6 @@ switch(ASF_LOAD_GUID_PREFIX(guid)){ case ASF_GUID_PREFIX_audio_stream: return "guid_audio_stream"; - case ASF_GUID_PREFIX_ext_audio_stream: - return "guid_ext_audio_stream"; - case ASF_GUID_PREFIX_ext_stream_embed_stream_header: - return "guid_ext_stream_embed_stream_header"; case ASF_GUID_PREFIX_video_stream: return "guid_video_stream"; case ASF_GUID_PREFIX_audio_conceal_none: @@ -156,42 +144,6 @@ return -1; } -static int find_backwards_asf_guid(char *buf, const char *guid, int cur_pos) -{ - int i; - for (i=cur_pos-16; i>0; i--) { - if (memcmp(&buf[i], guid, 16) == 0) - return i + 16 + 8; // point after guid + length - } - return -1; -} - -static int asf_init_audio_stream(demuxer_t *demuxer,struct asf_priv* asf, sh_audio_t* sh_audio, ASF_stream_header_t *streamh, int *ppos, uint8_t** buf, char *hdr, unsigned int hdr_len) -{ - uint8_t *buffer = *buf; - int pos = *ppos; - - sh_audio->wf=calloc((streamh->type_sizetype_size,1); - memcpy(sh_audio->wf,buffer,streamh->type_size); - le2me_WAVEFORMATEX(sh_audio->wf); - if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf,MSGL_V); - if(ASF_LOAD_GUID_PREFIX(streamh->concealment)==ASF_GUID_PREFIX_audio_conceal_interleave){ - buffer = &hdr[pos]; - pos += streamh->stream_size; - if (pos > hdr_len) return 0; - asf->scrambling_h=buffer[0]; - asf->scrambling_w=(buffer[2]<<8)|buffer[1]; - asf->scrambling_b=(buffer[4]<<8)|buffer[3]; - if(asf->scrambling_b>0){ - asf->scrambling_w/=asf->scrambling_b; - } - } else { - asf->scrambling_b=asf->scrambling_h=asf->scrambling_w=1; - } - mp_msg(MSGT_HEADER,MSGL_V,"ASF: audio scrambling: %d x %d x %d\n",asf->scrambling_h,asf->scrambling_w,asf->scrambling_b); - return 1; -} - int read_asf_header(demuxer_t *demuxer,struct asf_priv* asf){ int hdr_len = asf->header.objh.size - sizeof(asf->header); char *hdr = NULL; @@ -204,9 +156,6 @@ int best_video = -1; int best_audio = -1; uint64_t data_len; - ASF_stream_header_t *streamh; - uint8_t *buffer; - int audio_pos=0; if(hdr_len < 0) { mp_msg(MSGT_HEADER, MSGL_FATAL, "Header size is too small.\n"); @@ -230,40 +179,12 @@ goto err_out; } - if ((pos = find_asf_guid(hdr, asf_ext_stream_audio, pos, hdr_len)) >= 0) - { - // Special case: found GUID for dvr-ms audio. - // Now skip back to associated stream header. - int sh_pos=0; - - sh_pos = find_backwards_asf_guid(hdr, asf_stream_header_guid, pos); - - if (sh_pos > 0) { - sh_audio_t *sh_audio; - - mp_msg(MSGT_HEADER, MSGL_V, "read_asf_header found dvr-ms audio stream header pos=%d\n", sh_pos); - // found audio stream header - following code reads header and - // initializes audio stream. - audio_pos = pos - 16 - 8; - streamh = (ASF_stream_header_t *)&hdr[sh_pos]; - le2me_ASF_stream_header_t(streamh); - audio_pos += 64; //16+16+4+4+4+16+4; - buffer = &hdr[audio_pos]; - sh_audio=new_sh_audio(demuxer,streamh->stream_no & 0x7F); - ++audio_streams; - if (!asf_init_audio_stream(demuxer, asf, sh_audio, streamh, &audio_pos, &buffer, hdr, hdr_len)) - goto len_err_out; - } - } // find stream headers - // only reset pos if we didnt find dvr_ms audio stream - // if we did find it then we want to avoid reading its header twice - if (audio_pos == 0) - pos = 0; - + pos = 0; while ((pos = find_asf_guid(hdr, asf_stream_header_guid, pos, hdr_len)) >= 0) { - streamh = (ASF_stream_header_t *)&hdr[pos]; + ASF_stream_header_t *streamh = (ASF_stream_header_t *)&hdr[pos]; + uint8_t *buffer; pos += sizeof(ASF_stream_header_t); if (pos > hdr_len) goto len_err_out; le2me_ASF_stream_header_t(streamh); @@ -285,8 +206,24 @@ case ASF_GUID_PREFIX_audio_stream: { sh_audio_t* sh_audio=new_sh_audio(demuxer,streamh->stream_no & 0x7F); ++audio_streams; - if (!asf_init_audio_stream(demuxer, asf, sh_audio, streamh, &pos, &buffer, hdr, hdr_len)) - goto len_err_out; + sh_audio->wf=calloc((streamh->type_sizetype_size,1); + memcpy(sh_audio->wf,buffer,streamh->type_size); + le2me_WAVEFORMATEX(sh_audio->wf); + if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf,MSGL_V); + if(ASF_LOAD_GUID_PREFIX(streamh->concealment)==ASF_GUID_PREFIX_audio_conceal_interleave){ + buffer = &hdr[pos]; + pos += streamh->stream_size; + if (pos > hdr_len) goto len_err_out; + asf->scrambling_h=buffer[0]; + asf->scrambling_w=(buffer[2]<<8)|buffer[1]; + asf->scrambling_b=(buffer[4]<<8)|buffer[3]; + if(asf->scrambling_b>0){ + asf->scrambling_w/=asf->scrambling_b; + } + } else { + asf->scrambling_b=asf->scrambling_h=asf->scrambling_w=1; + } + mp_msg(MSGT_HEADER,MSGL_V,"ASF: audio scrambling: %d x %d x %d\n",asf->scrambling_h,asf->scrambling_w,asf->scrambling_b); //if(demuxer->audio->id==-1) demuxer->audio->id=streamh.stream_no & 0x7F; break; } @@ -298,14 +235,10 @@ sh_video->bih=calloc((lenbih,&buffer[4+4+1+2],len); le2me_BITMAPINFOHEADER(sh_video->bih); - if (sh_video->bih->biCompression == mmioFOURCC('D', 'V', 'R', ' ')) { - //mp_msg(MSGT_DEMUXER, MSGL_WARN, MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat); - //sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale; - //sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate; - asf->asf_frame_state=-1; - asf->asf_frame_start_found=0; - asf->asf_is_dvr_ms=1; - } else asf->asf_is_dvr_ms=0; + if (sh_video->bih->biCompression == mmioFOURCC('D', 'V', 'R', ' ')) + mp_msg(MSGT_DEMUXER, MSGL_WARN, MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat); + //sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale; + //sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate; if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_video_header(sh_video->bih, MSGL_V); //asf_video_id=streamh.stream_no & 0x7F; //if(demuxer->video->id==-1) demuxer->video->id=streamh.stream_no & 0x7F; geexbox-1.0/packages/MPlayer/patches/200_lirc.diff0000644000175000017500000000053310446314257020746 0ustar aurelaureldiff -r d9fa6eb37505 input/input.c --- a/input/input.c Sun Apr 30 16:54:31 2006 +0200 +++ b/input/input.c Sun Apr 30 16:54:31 2006 +0200 @@ -1144,8 +1144,6 @@ mp_input_read_cmds(int time) { continue; mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_INPUT_ErrSelect,strerror(errno)); } - if(!got_cmd) - return NULL; } break; } geexbox-1.0/packages/MPlayer/patches/205_joystick.diff0000644000175000017500000000736110446314257021667 0ustar aurelaureldiff -r e9742d85360a input/joystick.c --- a/input/joystick.c Sun Apr 30 16:54:31 2006 +0200 +++ b/input/joystick.c Sun Apr 30 16:54:32 2006 +0200 @@ -32,6 +32,9 @@ int axis[256]; int btns = 0; + +// Callback to allow the menu filter to grab the incoming joystick event +void (*mp_input_joy_cb)(int code) = NULL; int mp_input_joystick_init(char* dev) { int fd,l=0; @@ -125,7 +128,14 @@ int mp_input_joystick_read(int fd) { btns &= ~(1 << ev.number); btns |= (ev.value << ev.number); if(ev.value == 1) - return ((JOY_BTN0+ev.number) | MP_KEY_DOWN); + { + if (mp_input_joy_cb) + { + mp_input_joy_cb (JOY_BTN0+ev.number); + return MP_INPUT_NOTHING; + } + return ((JOY_BTN0+ev.number) | MP_KEY_DOWN); + } else return (JOY_BTN0+ev.number); } else if(ev.type & JS_EVENT_AXIS) { @@ -138,6 +148,11 @@ int mp_input_joystick_read(int fd) { } else if(ev.value <= JOY_AXIS_DELTA && ev.value >= -JOY_AXIS_DELTA && axis[ev.number] != 0) { int r = axis[ev.number] == 1 ? JOY_AXIS0_PLUS+(2*ev.number) : JOY_AXIS0_MINUS+(2*ev.number); axis[ev.number] = 0; + if (mp_input_joy_cb) + { + mp_input_joy_cb (r); + return MP_INPUT_NOTHING; + } return r; } else return MP_INPUT_NOTHING; diff -r e9742d85360a input/joystick.h --- a/input/joystick.h Sun Apr 30 16:54:31 2006 +0200 +++ b/input/joystick.h Sun Apr 30 16:54:32 2006 +0200 @@ -37,3 +37,5 @@ int mp_input_joystick_init(char* dev); int mp_input_joystick_read(int fd); +// Set this to grab all incoming key codes +extern void (*mp_input_joy_cb)(int code); diff -r e9742d85360a libmenu/menu.c --- a/libmenu/menu.c Sun Apr 30 16:54:31 2006 +0200 +++ b/libmenu/menu.c Sun Apr 30 16:54:32 2006 +0200 @@ -20,6 +20,9 @@ #include "m_option.h" #include "m_struct.h" #include "menu.h" + +#include "input/input.h" +#include "input/joystick.h" extern menu_info_t menu_info_cmdlist; extern menu_info_t menu_info_pt; @@ -181,21 +184,27 @@ void menu_dflt_read_key(menu_t* menu,int void menu_dflt_read_key(menu_t* menu,int cmd) { switch(cmd) { case KEY_UP: + case JOY_AXIS1_MINUS: menu->read_cmd(menu,MENU_CMD_UP); break; case KEY_DOWN: + case JOY_AXIS1_PLUS: menu->read_cmd(menu,MENU_CMD_DOWN); break; case KEY_LEFT: + case JOY_AXIS0_MINUS: menu->read_cmd(menu,MENU_CMD_LEFT); break; case KEY_ESC: + case JOY_BTN1: menu->read_cmd(menu,MENU_CMD_CANCEL); break; case KEY_RIGHT: + case JOY_AXIS0_PLUS: menu->read_cmd(menu,MENU_CMD_RIGHT); break; case KEY_ENTER: + case JOY_BTN0: menu->read_cmd(menu,MENU_CMD_OK); break; } diff -r e9742d85360a libmenu/vf_menu.c --- a/libmenu/vf_menu.c Sun Apr 30 16:54:31 2006 +0200 +++ b/libmenu/vf_menu.c Sun Apr 30 16:54:32 2006 +0200 @@ -21,6 +21,7 @@ #include "libvo/video_out.h" #include "libvo/font_load.h" #include "input/input.h" +#include "input/joystick.h" #include "m_struct.h" #include "menu.h" @@ -212,6 +213,14 @@ static int put_image(struct vf_instance_ if(mp_input_key_cb && !vf->priv->current->show) mp_input_key_cb = NULL; +#ifdef HAVE_JOYSTICK + // Grab // Ungrab the joy inputs + if(!mp_input_joy_cb && vf->priv->current->show) + mp_input_joy_cb = key_cb; + if(mp_input_joy_cb && !vf->priv->current->show) + mp_input_joy_cb = NULL; +#endif + if(mpi->flags&MP_IMGFLAG_DIRECT) dmpi = mpi->priv; else { @@ -225,6 +234,10 @@ static int put_image(struct vf_instance_ } else { if(mp_input_key_cb) mp_input_key_cb = NULL; +#ifdef HAVE_JOYSTICK + if(mp_input_joy_cb) + mp_input_joy_cb = NULL; +#endif dmpi = vf_get_image(vf->next,mpi->imgfmt, MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h); geexbox-1.0/packages/MPlayer/patches/210_joystick-init.diff0000644000175000017500000000066610446314257022625 0ustar aurelaureldiff -r 09daeb8bedd2 input/joystick.c --- a/input/joystick.c Sun Apr 30 16:54:32 2006 +0200 +++ b/input/joystick.c Sun Apr 30 16:54:32 2006 +0200 @@ -71,7 +71,6 @@ int mp_input_joystick_init(char* dev) { mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l); break; } - ev.type &= ~JS_EVENT_INIT; if(ev.type == JS_EVENT_BUTTON) btns |= (ev.value << ev.number); if(ev.type == JS_EVENT_AXIS) geexbox-1.0/packages/MPlayer/patches/250_bgvideo.diff0000644000175000017500000001263510446314257021447 0ustar aurelaureldiff -r 3f43ce128995 cfg-mplayer.h --- a/cfg-mplayer.h Sun Apr 30 16:54:32 2006 +0200 +++ b/cfg-mplayer.h Sun Apr 30 17:12:13 2006 +0200 @@ -344,6 +344,8 @@ m_option_t mplayer_opts[]={ {"guiwid", &guiWinID, CONF_TYPE_INT, 0, 0, 0, NULL}, #endif + {"bgvideo", &bg_video, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"noloop", &loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL}, {"loop", &loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL}, {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL}, diff -r 3f43ce128995 mplayer.c --- a/mplayer.c Sun Apr 30 16:54:32 2006 +0200 +++ b/mplayer.c Sun Apr 30 17:12:13 2006 +0200 @@ -281,6 +281,9 @@ static char* spudec_ifo=NULL; static char* spudec_ifo=NULL; char* filename=NULL; //"MI2-Trailer.avi"; int forced_subs_only=0; + +static char* bg_video = NULL; +demuxer_t *bg_demuxer = NULL; // cache2: int stream_cache_size=-1; @@ -447,6 +450,13 @@ static void uninit_player(unsigned int m free_demuxer(demuxer); } demuxer=NULL; + current_module="free_bg_demuxer"; + if(bg_demuxer) { + stream_t* bg_s = bg_demuxer->stream; + free_demuxer(bg_demuxer); + bg_demuxer = NULL; + free_stream(bg_s); + } } // kill the cache process: @@ -1247,7 +1257,7 @@ void set_osd_bar(int type,char* name,dou * */ -static void update_osd_msg(void) { +static void update_osd_msg(demux_stream_t *d_audio) { mp_osd_msg_t *msg; static char osd_text[64] = ""; static char osd_text_timer[64]; @@ -1278,6 +1288,7 @@ static void update_osd_msg(void) { char percentage_text[10]; static int last_pts = -303; int pts = sh_video->pts; + if (bg_demuxer) pts=d_audio->pts+(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/sh_audio->i_bps; if(pts==last_pts-1) ++pts; else last_pts=pts; if (osd_show_percentage) @@ -3163,6 +3174,34 @@ sh_audio=d_audio->sh; sh_audio=d_audio->sh; sh_video=d_video->sh; +while(sh_audio && !sh_video && bg_video) { + int bg_file_format = 0; + stream_t* bg_s; + mp_msg(MSGT_CPLAYER,MSGL_INFO, "Open bgvideo: %s\n",bg_video); + bg_s = open_stream(bg_video,NULL,&bg_file_format); + if(!bg_s) { + mp_msg(MSGT_CPLAYER,MSGL_ERR, "Couldn't open the stream for back ground video: %s\n",bg_video); + break; + } + bg_demuxer = demux_open(bg_s,bg_file_format,-2,video_id,dvdsub_id,bg_video); + if(!bg_demuxer) { + mp_msg(MSGT_DEMUXER,MSGL_ERR,"Failed to open background video\n"); + free_stream(bg_s); + break; + } + if(!bg_demuxer->video && !bg_demuxer->video->sh) { + mp_msg(MSGT_DEMUXER,MSGL_ERR,"The background video don't have a video stream\n"); + free_demuxer(bg_demuxer); + bg_demuxer = NULL; + free_stream(bg_s); + break; + } + d_video = bg_demuxer->video; + sh_video = d_video->sh; + mp_msg(MSGT_DEMUXER,MSGL_INFO,"Background video should work ;)\n"); + break; +} + if(sh_video){ current_module="video_read_properties"; @@ -3501,7 +3540,7 @@ int was_paused=0; // Make sure old OSD does not stay around, // e.g. with -fixed-vo and same-resolution files clear_osd_msgs(); -update_osd_msg(); +update_osd_msg(d_audio); //================ SETUP AUDIO ========================== @@ -3675,6 +3714,8 @@ while(sh_audio){ break; } // while(sh_audio) +if(bg_demuxer && d_audio->eof) eof=1; + if(!sh_video) { // handle audio-only case: if(!quiet) { @@ -3701,7 +3742,16 @@ if(!sh_video) { // get it! current_module="video_read_frame"; in_size=video_read_frame(sh_video,&next_frame_time,&start,force_fps); - if(in_size<0){ eof=1; break; } + if(in_size<0){ + if(bg_demuxer) { + if(!demux_seek(bg_demuxer,0,0,1)) + eof = 1; + else + continue; + } else + eof=1; + break; + } if(in_size>max_framesize) max_framesize=in_size; // stats sh_video->timer+=frame_time; if(sh_audio) sh_audio->delay-=frame_time; @@ -3901,6 +3951,15 @@ if(time_frame>0.001 && !(vo_flags&256)){ if(vo_config_count) video_out->flip_page(); if (play_n_frames >= 0) { --play_n_frames; + if(play_n_frames<0) { + if(bg_demuxer) { + if(!demux_seek(bg_demuxer,0,0,1)) + eof = PT_NEXT_ENTRY; + else + play_n_frames = play_n_frames_mf; + } else + eof = PT_NEXT_ENTRY; + } if (play_n_frames <= 0) eof = PT_NEXT_ENTRY; } @@ -3922,6 +3981,13 @@ if(time_frame>0.001 && !(vo_flags&256)){ current_module="av_sync"; if(sh_audio){ + if(bg_demuxer) { + if(!quiet) mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.1f %4.1f%% %d%% \r" + ,sh_audio->delay-audio_out->get_delay() + ,(sh_audio->delay>0.5)?100.0*audio_time_usage/(double)sh_audio->delay:0 + ,cache_fill_status + ); + } else { double a_pts=0; double v_pts=0; @@ -3986,7 +4052,7 @@ if(time_frame>0.001 && !(vo_flags&256)){ if(!quiet) print_status(a_pts - audio_delay - delay, AV_delay, c_total); } - + } } else { // No audio: @@ -4046,7 +4112,7 @@ if(auto_quality>0){ int mlen = strlen(msg); msg[mlen-1] = '\0'; set_osd_msg(OSD_MSG_PAUSE,1,0,"%s",msg+1); - update_osd_msg(); + update_osd_msg(d_audio); } else mp_msg(MSGT_CPLAYER,MSGL_STATUS,MSGTR_Paused); mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_PAUSED\n"); @@ -4948,7 +5014,7 @@ if ((user_muted | edl_muted) != mixer.mu //================= Update OSD ==================== - update_osd_msg(); + update_osd_msg(d_audio); #ifdef USE_SUB // find sub geexbox-1.0/packages/MPlayer/patches/255_osdlevel.diff0000644000175000017500000000144410446314257021646 0ustar aurelaureldiff -r 680a0d780720 cfg-mplayer.h --- a/cfg-mplayer.h Sun Apr 30 16:54:33 2006 +0200 +++ b/cfg-mplayer.h Sun Apr 30 16:54:33 2006 +0200 @@ -53,10 +53,6 @@ extern int opt_screen_size_y; extern int opt_screen_size_y; extern int fullscreen; extern int vidmode; - -#ifdef USE_OSD -extern int osd_level; -#endif extern char *ao_outputfilename; extern int ao_pcm_waveheader; @@ -290,7 +286,6 @@ m_option_t mplayer_opts[]={ {"crash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"nocrash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, #endif - {"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, {"osd-duration", &osd_duration, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, #ifdef HAVE_MENU {"menu", &use_menu, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, geexbox-1.0/packages/MPlayer/patches/300_dvd-longest.diff0000644000175000017500000001671210446314257022252 0ustar aurelaureldiff -r d93e7bab77c4 help/help_mp-en.h --- a/help/help_mp-en.h Sun Apr 30 16:54:33 2006 +0200 +++ b/help/help_mp-en.h Sun Apr 30 16:54:34 2006 +0200 @@ -541,6 +541,11 @@ static char help_text[]= #define MSGTR_DVDnoMatchingSubtitle "No matching DVD subtitle language found!\n" #define MSGTR_DVDsubtitleChannel "Selected DVD subtitle channel: %d language: %c%c\n" #define MSGTR_DVDopenOk "DVD successfully opened.\n" +#define MSGTR_DVDlookLongest "Looking for longest track ...\n" +#define MSGTR_DVDinfo001 "Title: %02d, Length: %02x:%02x:%02x (%5d seconds) " +#define MSGTR_DVDinfo002 "Chapters: %02d, Cells: %02d, " +#define MSGTR_DVDinfo003 "Audio streams: %02d, Subpictures: %02d\n" +#define MSGTR_DVDtrackSelected "Selected track %d (%d seconds) ...\n" // muxer.c, muxer_*.c: #define MSGTR_TooManyStreams "Too many streams!" diff -r d93e7bab77c4 libmpdemux/stream_dvd.c --- a/libmpdemux/stream_dvd.c Sun Apr 30 16:54:33 2006 +0200 +++ b/libmpdemux/stream_dvd.c Sun Apr 30 16:54:34 2006 +0200 @@ -72,6 +72,106 @@ static struct m_struct_st stream_opts = &stream_priv_dflts, stream_opts_fields }; + +int dvd_title_info(dvd_reader_t *dvd, ifo_handle_t *ifo_zero, int mask) +{ + int nr; + int i; + ifo_handle_t **t_ifo; + int rt = 0; + int mt; + + // Print some info ... + if (mask & 0x0001) { + mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDlookLongest); + // printf("Looking for longest track ...\n"); + } + + //* Alloc space for all info in the dvd + nr = ifo_zero->vts_atrt->nr_of_vtss; + t_ifo = (ifo_handle_t **)malloc((nr + 1) * sizeof(ifo_handle_t *)); + + // * Read all info + for(i = 1; i <= nr; i++) { + t_ifo[i] = ifoOpen(dvd, i); + } + + // Navigate all titles + nr = ifo_zero->tt_srpt->nr_of_srpts; + for(i = 0; i < nr; i++) { + // Load information for the title + if (t_ifo[ifo_zero->tt_srpt->title[i].title_set_nr]->vtsi_mat) { + vtsi_mat_t *vtsi_mat; + pgcit_t *vts_pgcit; + int vts_ttn; + int title_set_nr; + pgc_t *pgc; + dvd_time_t *dvd_time; + int ct; + + vtsi_mat = t_ifo[ifo_zero->tt_srpt->title[i].title_set_nr]->vtsi_mat; + vts_pgcit = t_ifo[ifo_zero->tt_srpt->title[i].title_set_nr]->vts_pgcit; + vts_ttn = ifo_zero->tt_srpt->title[i].vts_ttn; + title_set_nr = ifo_zero->tt_srpt->title[i].title_set_nr; + pgc = vts_pgcit->pgci_srp[t_ifo[title_set_nr]->vts_ptt_srpt->title[vts_ttn - 1].ptt[0].pgcn - 1].pgc; + dvd_time = &pgc->playback_time; + + ct = dvd_time->hour * 3600 + dvd_time->minute * 60 + dvd_time->second; + + if (mask & 0x0002) { + // Print required info + mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDinfo001, + i+1, + dvd_time->hour, + dvd_time->minute, + dvd_time->second, + ct); + mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDinfo002, + ifo_zero->tt_srpt->title[i].nr_of_ptts, + pgc->nr_of_cells); + mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDinfo003, + vtsi_mat->nr_of_vts_audio_streams, + vtsi_mat->nr_of_vts_subp_streams); + } + + if (mask & 0x0001) { + // Look for the longest track + if (i == 0) { + // First pass + rt = 1; + mt = ct; + } + else { + // Check + if (ct > mt) { + rt = i + 1; + mt = ct; + } + } + } + } + } + + if (mask & 0x0001) { + // Show what happened + // printf("Selected track %d (%d seconds) ...\n", + mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_DVDtrackSelected, + rt, + mt); + } + + // Close all ifo + nr = ifo_zero->vts_atrt->nr_of_vtss; + for(i = 1; i <= nr; i++) { + ifoClose(t_ifo[i]); + } + + // Free temp memory + free(t_ifo); + + // Return track or 0 to stop + return( rt ); +} int dvd_parse_chapter_range(m_option_t *conf, const char *range) { const char *s; @@ -594,6 +694,17 @@ static int open_s(stream_t *stream,int m mp_msg(MSGT_IDENTIFY, MSGL_V, "ID_DVD_DISC_ID=%s\n", buf); } } + + if (dvd_title < 0) { + dvd_title = dvd_title_info(dvd, vmg_file, -dvd_title); + if (dvd_title <= 0) { + // Close & exit, no msg. + ifoClose( vmg_file ); + DVDClose( dvd ); + return NULL; + } + } + /** * Make sure our title number is valid. */ diff -r d93e7bab77c4 parser-mpcmd.c --- a/parser-mpcmd.c Sun Apr 30 16:54:33 2006 +0200 +++ b/parser-mpcmd.c Sun Apr 30 16:54:34 2006 +0200 @@ -58,6 +58,43 @@ static inline void add_entry(play_tree_t else play_tree_append_entry(*last_entryp,entry); *last_entryp = entry; +} + +static char *get_opt_str(char **arg, char *dst, unsigned dst_size) +{ + char *t; + + t = *arg; + if (*t == '\0') { + return( NULL); + } + else { + char *e; + unsigned l; + + e = strchr(t, ':'); + if (e != NULL) { + l = e - t; + } + else { + l = strlen(t); + } + if (l < dst_size) { + strncpy(dst, t, l); + dst[l] = '\0'; + t += l; + if (*t == ':') { + ++t; + } + } + else { + // Out of size -> error + strcpy(dst, "*"); + t += strlen(t); + } + *arg = t; + } + return( dst ); } /// Setup the \ref Config from command line arguments and build a playtree. @@ -244,8 +281,37 @@ m_config_parse_mp_command_line(m_config_ mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Invalid play entry %s\n",argv[i]); } - } else { // dvd:// or dvd://x entry - play_tree_add_file(entry,argv[i]); + } else { // dvd:// or dvd://x or dvd://longest:list entry + char *pc; + + pc = argv[i]+6; + if (*pc >= 'a' && *pc <= 'z') { + // may be option (passed as -nn to open_stream(...) + + char t_opt[80 + 1]; + char *opt_str; + int op = 0; + + while ((opt_str = get_opt_str(&pc, t_opt, sizeof(t_opt))) != NULL) { + if (strcmp(opt_str, "longest") == 0) { + op |= 0x0001; + } + else if (strcmp(opt_str, "list") == 0) { + op |= 0x0002; + } + else { + // Error -> bail out + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "dvd:// unknow option: [%s]\n", opt_str); + + goto err_out; + } + } + snprintf(entbuf, 9, "dvd://%d", -op); + play_tree_add_file(entry, entbuf); + } + else { + play_tree_add_file(entry,argv[i]); + } } } else { play_tree_add_file(entry,argv[i]); geexbox-1.0/packages/MPlayer/patches/305_vcd-dvd-cdda-play.diff0000644000175000017500000001557410446314257023221 0ustar aurelaureldiff -r eea2414bb57d input/input.c --- a/input/input.c Sun Apr 30 16:54:34 2006 +0200 +++ b/input/input.c Sun Apr 30 16:54:34 2006 +0200 @@ -102,6 +102,15 @@ static mp_cmd_t mp_cmds[] = { { MP_CMD_SUB_FORCED_ONLY, "forced_subs_only", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, #ifdef HAS_DVBIN_SUPPORT { MP_CMD_DVB_SET_CHANNEL, "dvb_set_channel", 2, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}}}}, +#endif +#ifdef HAVE_VCD + { MP_CMD_VCD_PLAY, "play_vcd", 0, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } }, +#endif +#ifdef USE_DVDREAD + { MP_CMD_DVD_PLAY, "play_dvd", 0, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } }, +#endif +#ifdef HAVE_CDDA + { MP_CMD_CDDA_PLAY, "play_cdda", 0, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } }, #endif { MP_CMD_SWITCH_RATIO, "switch_ratio", 0, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } }, { MP_CMD_VO_FULLSCREEN, "vo_fullscreen", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, diff -r eea2414bb57d input/input.h --- a/input/input.h Sun Apr 30 16:54:34 2006 +0200 +++ b/input/input.h Sun Apr 30 16:54:34 2006 +0200 @@ -71,6 +71,10 @@ #define MP_CMD_GET_PROPERTY 69 #define MP_CMD_OSD_SHOW_PROPERTY_TEXT 70 +#define MP_CMD_VCD_PLAY 80 +#define MP_CMD_DVD_PLAY 81 +#define MP_CMD_CDDA_PLAY 82 + #define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_LOADFILE 5001 #define MP_CMD_GUI_LOADSUBTITLE 5002 diff -r eea2414bb57d libmpdemux/cdda.c --- a/libmpdemux/cdda.c Sun Apr 30 16:54:34 2006 +0200 +++ b/libmpdemux/cdda.c Sun Apr 30 16:54:34 2006 +0200 @@ -284,6 +284,34 @@ static void cdparanoia_callback(long int #endif } +int get_cdda_tracks_num(char* dev) { + cdrom_drive* cdd = NULL; + int nb_tracks; + +#if defined(__NetBSD__) + cdd = cdda_identify_scsi(dev,dev,0,NULL); +#else + cdd = cdda_identify(dev,0,NULL); +#endif + + if(!cdd) { + mp_msg(MSGT_OPEN,MSGL_ERR,"Can't open cdda device\n"); + return -1; + } + + if(cdda_open(cdd)) { + mp_msg(MSGT_OPEN,MSGL_ERR,"Can't open disc\n"); + cdda_close(cdd); + return -1; + } + + cdda_verbose_set(cdd, CDDA_MESSAGE_FORGETIT, CDDA_MESSAGE_FORGETIT); + + nb_tracks = cdda_tracks(cdd); + cdda_close(cdd); + return nb_tracks; +} + static int fill_buffer(stream_t* s, char* buffer, int max_len) { cdda_priv* p = (cdda_priv*)s->priv; cd_track_t *cd_track; diff -r eea2414bb57d libmpdemux/stream_dvd.c --- a/libmpdemux/stream_dvd.c Sun Apr 30 16:54:34 2006 +0200 +++ b/libmpdemux/stream_dvd.c Sun Apr 30 16:54:34 2006 +0200 @@ -737,7 +737,6 @@ static int open_s(stream_t *stream,int m return STREAM_UNSUPORTED; } } - --dvd_chapter; // remap 1.. -> 0.. /* XXX No need to remap dvd_last_chapter */ /** * Make sure the angle number is valid for this title. @@ -908,8 +907,8 @@ static int open_s(stream_t *stream,int m * Determine which program chain we want to watch. This is based on the * chapter number. */ - pgc_id = vts_file->vts_ptt_srpt->title[ttn].ptt[dvd_chapter].pgcn; // local - pgn = vts_file->vts_ptt_srpt->title[ttn].ptt[dvd_chapter].pgn; // local + pgc_id = vts_file->vts_ptt_srpt->title[ttn].ptt[dvd_chapter-1].pgcn; // local + pgn = vts_file->vts_ptt_srpt->title[ttn].ptt[dvd_chapter-1].pgn; // local d->cur_pgc = vts_file->vts_pgcit->pgci_srp[pgc_id-1].pgc; d->cur_cell = d->cur_pgc->program_map[pgn-1] - 1; // start playback here d->packs_left=-1; // for Navi stuff diff -r eea2414bb57d mplayer.c --- a/mplayer.c Sun Apr 30 16:54:34 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:34 2006 +0200 @@ -4309,6 +4309,113 @@ if (stream->type==STREAMTYPE_DVDNAV && d case MP_CMD_QUIT : { exit_player_with_rc(MSGTR_Exit_quit, (cmd->nargs > 0)? cmd->args[0].v.i : 0); } +#ifdef HAVE_VCD + case MP_CMD_VCD_PLAY : { + char buf[10]; + play_tree_t *vcd, *tracks; + stream_t *s; + int i, m; + + if ((s = open_stream ("vcd://", NULL, &i)) == NULL) + break; + for (m=2; m<100; m++) + if (vcd_seek_to_track (s->priv, m) < 0) + break; + free_stream (s); + + tracks = play_tree_new(); + sprintf(buf, "vcd://%d", i = m > 2 ? 2 : 1); + play_tree_add_file(tracks, buf); + for (i++; ichild, 1); + play_tree_set_child(playtree, tracks); + play_tree_iter_step(playtree_iter, 0, 0); + eof = PT_NEXT_SRC; + } break; +#endif +#ifdef USE_DVDREAD + case MP_CMD_DVD_PLAY : { + struct stat st; + + if (stat ("/var/dvdnav", &st) == 0) + { + mp_cmd_t* c = mp_input_parse_cmd ("loadfile dvdnav://"); + if (c) + mp_input_queue_cmd (c); + break; + } + else + { + char buf[10]; + play_tree_t *dvd, *tracks; + stream_t *s; + int nb_tracks, i; + + if ((s = open_stream("dvd://", NULL, &i)) == NULL) + break; + + tracks = play_tree_new(); + play_tree_add_file(tracks, "dvd://1"); + + nb_tracks = ((dvd_priv_t *) s->priv)->vmg_file->tt_srpt->nr_of_srpts; + for (i=2; i<=nb_tracks; i++) + { + dvd = play_tree_new(); + sprintf(buf, "dvd://%d", i); + play_tree_add_file(dvd, buf); + play_tree_append_entry(tracks, dvd); + } + i = dvd_title_info(((dvd_priv_t *) s->priv)->dvd, + ((dvd_priv_t *) s->priv)->vmg_file, 0x0001); + free_stream (s); + + while(play_tree_iter_up_step(playtree_iter, 0, 1) != PLAY_TREE_ITER_END); + play_tree_free_list(playtree->child, 1); + play_tree_set_child(playtree, tracks); + play_tree_iter_down_step(playtree_iter, 0, 0); + play_tree_iter_step(playtree_iter, i-1, 0); + eof = PT_NEXT_SRC; + } + } break; +#endif +#ifdef HAVE_CDDA + case MP_CMD_CDDA_PLAY : { + int get_cdda_tracks_num(char* dev); + char buf[11]; + play_tree_t *cdda, *tracks; + int nb_tracks, i; + + nb_tracks = get_cdda_tracks_num (cdrom_device ? cdrom_device : DEFAULT_CDROM_DEVICE); + if (nb_tracks <= 0) + break; + + tracks = play_tree_new(); + play_tree_add_file(tracks, "cdda://1"); + + for (i=2; i<=nb_tracks; i++) + { + cdda = play_tree_new(); + sprintf(buf, "cdda://%d", i); + play_tree_add_file(cdda, buf); + play_tree_append_entry(tracks, cdda); + } + + while(play_tree_iter_up_step(playtree_iter, 0, 1) != PLAY_TREE_ITER_END); + play_tree_free_list(playtree->child, 1); + play_tree_set_child(playtree, tracks); + play_tree_iter_step(playtree_iter, 0, 0); + eof = PT_NEXT_SRC; + } break; +#endif + case MP_CMD_GRAB_FRAMES : { grab_frames=2; } break; geexbox-1.0/packages/MPlayer/patches/310_dvdvcd-trayunlock.diff0000644000175000017500000000201110446314257023453 0ustar aurelaureldiff -r 7d7fcdab76a3 libmpdemux/stream_vcd.c --- a/libmpdemux/stream_vcd.c Sun Apr 30 16:54:34 2006 +0200 +++ b/libmpdemux/stream_vcd.c Sun Apr 30 16:54:34 2006 +0200 @@ -94,6 +94,9 @@ static int open_s(stream_t *stream,int m m_struct_free(&stream_opts,opts); return STREAM_ERROR; } +#ifdef __linux__ + ioctl(f, CDROM_LOCKDOOR, 0); +#endif vcd = vcd_read_toc(f); if(!vcd) { diff -r 7d7fcdab76a3 libmpdvdkit2/device.c --- a/libmpdvdkit2/device.c Sun Apr 30 16:54:34 2006 +0200 +++ b/libmpdvdkit2/device.c Sun Apr 30 16:54:34 2006 +0200 @@ -58,6 +58,11 @@ # include /* struct iovec */ #endif +#ifdef __linux__ +#include +#include +#endif + #include "dvdcss.h" #include "common.h" @@ -266,6 +271,9 @@ static int libc_open ( dvdcss_t dvdcss, print_error( dvdcss, "failed to open device" ); return -1; } +#ifdef __linux__ + ioctl(dvdcss->i_fd, CDROM_LOCKDOOR, 0); +#endif dvdcss->i_pos = 0; geexbox-1.0/packages/MPlayer/patches/315_dvd-play-ifo.diff0000644000175000017500000000136410446314257022322 0ustar aurelaureldiff -r 8eab14a155a8 libmpdemux/stream.c --- a/libmpdemux/stream.c Sun Apr 30 16:54:35 2006 +0200 +++ b/libmpdemux/stream.c Sun Apr 30 16:54:35 2006 +0200 @@ -182,7 +182,22 @@ stream_t* open_stream_full(char* filenam int i,j,l,r; stream_info_t* sinfo; stream_t* s; - + char *ext = NULL; + + ext = strrchr (filename, '.'); + if (ext && !strcasecmp (ext + 1, "ifo")) + { + extern char *dvd_device; + struct stat st; + dvd_device = dirname (strdup (filename)); + dvd_title = -1; /* play longest track */ + + if (stat ("/var/dvdnav", &st) == 0) + filename = "dvdnav://"; + else + filename = "dvd://"; + } + for(i = 0 ; auto_open_streams[i] ; i++) { sinfo = auto_open_streams[i]; if(!sinfo->protocols) { geexbox-1.0/packages/MPlayer/patches/320_vcd-cdda-separated-devices.diff0000644000175000017500000000524110446314257025054 0ustar aurelaureldiff -r 1b903304e52c cfg-common.h --- a/cfg-common.h Sun Apr 30 16:54:35 2006 +0200 +++ b/cfg-common.h Sun Apr 30 16:54:35 2006 +0200 @@ -26,7 +26,8 @@ #endif {"vcd", "-vcd N is deprecated, use vcd://N instead.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL}, {"cuefile", "-cuefile is deprecated, use cue://filename:N where N is the track number.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"cdrom-device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"vcd-device", &vcd_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"cdda-device", &cdda_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, #ifdef USE_DVDNAV {"dvdnav", "-dvdnav is deprecated, use dvdnav:// instead.\n", CONF_TYPE_PRINT, 0, 0, 1, NULL}, {"skipopening", &dvd_nav_skip_opening, CONF_TYPE_FLAG, 0, 0, 1, NULL}, @@ -452,7 +453,7 @@ extern int vivo_param_width; extern int vivo_param_width; extern int vivo_param_height; extern int vivo_param_vformat; -extern char *dvd_device, *cdrom_device; +extern char *dvd_device, *vcd_device, *cdda_device; m_option_t vivoopts_conf[]={ {"version", &vivo_param_version, CONF_TYPE_INT, 0, 0, 0, NULL}, diff -r 1b903304e52c libmpdemux/cdda.c --- a/libmpdemux/cdda.c Sun Apr 30 16:54:35 2006 +0200 +++ b/libmpdemux/cdda.c Sun Apr 30 16:54:35 2006 +0200 @@ -21,7 +21,7 @@ #endif -extern char *cdrom_device; +char *cdda_device; static struct cdda_params { int speed; @@ -119,8 +119,8 @@ static int open_cdda(stream_t *st,int m, } if(!p->device) { - if (cdrom_device) - p->device = strdup(cdrom_device); + if (cdda_device) + p->device = strdup(cdda_device); else p->device = strdup(DEFAULT_CDROM_DEVICE); } diff -r 1b903304e52c libmpdemux/stream_vcd.c --- a/libmpdemux/stream_vcd.c Sun Apr 30 16:54:35 2006 +0200 +++ b/libmpdemux/stream_vcd.c Sun Apr 30 16:54:35 2006 +0200 @@ -25,7 +25,7 @@ #include "vcd_read.h" #endif -extern char *cdrom_device; +char *vcd_device; static struct stream_priv_s { int track; @@ -82,8 +82,8 @@ static int open_s(stream_t *stream,int m } if (!p->device) { - if(cdrom_device) - p->device = strdup(cdrom_device); + if(vcd_device) + p->device = strdup(vcd_device); else p->device = strdup(DEFAULT_CDROM_DEVICE); } diff -r 1b903304e52c mplayer.c --- a/mplayer.c Sun Apr 30 16:54:35 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:35 2006 +0200 @@ -4393,7 +4393,7 @@ if (stream->type==STREAMTYPE_DVDNAV && d play_tree_t *cdda, *tracks; int nb_tracks, i; - nb_tracks = get_cdda_tracks_num (cdrom_device ? cdrom_device : DEFAULT_CDROM_DEVICE); + nb_tracks = get_cdda_tracks_num (cdda_device ? cdda_device : DEFAULT_CDROM_DEVICE); if (nb_tracks <= 0) break; geexbox-1.0/packages/MPlayer/patches/325_cdda-paranoia-bail.diff0000644000175000017500000000056010446314257023415 0ustar aurelaureldiff -r 802f51b7b48d libmpdemux/cdda.c --- a/libmpdemux/cdda.c Sun Apr 30 16:54:45 2006 +0200 +++ b/libmpdemux/cdda.c Sun Apr 30 16:54:46 2006 +0200 @@ -319,6 +319,8 @@ static int fill_buffer(stream_t* s, char int i; buf = paranoia_read(p->cdp,cdparanoia_callback); + if (!buf) + return 0; #ifdef WORDS_BIGENDIAN for(i=0;i #endif +#include "mplayer.h" #include "mp_msg.h" #include "libmpcodecs/img_format.h" @@ -267,7 +268,7 @@ static int config(struct vf_instance_s* // here is the right place to get screen dimensions if (force_load_font) { force_load_font = 0; - load_font_ft(width,height); + load_font_ft(width,height,&vo_font,font_name); } #endif return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); diff -r 594922837fd5 libvo/font_load.h --- a/libvo/font_load.h Sun Apr 30 16:54:35 2006 +0200 +++ b/libvo/font_load.h Sun Apr 30 16:54:36 2006 +0200 @@ -62,6 +62,7 @@ typedef struct { } font_desc_t; extern font_desc_t* vo_font; +extern font_desc_t* sub_font; #ifdef HAVE_FREETYPE @@ -86,7 +87,7 @@ void render_one_glyph(font_desc_t *desc, void render_one_glyph(font_desc_t *desc, int c); int kerning(font_desc_t *desc, int prevc, int c); -void load_font_ft(int width, int height); +void load_font_ft(int width, int height, font_desc_t **desc, const char *name); #else diff -r 594922837fd5 libvo/font_load_ft.c --- a/libvo/font_load_ft.c Sun Apr 30 16:54:35 2006 +0200 +++ b/libvo/font_load_ft.c Sun Apr 30 16:54:36 2006 +0200 @@ -941,7 +941,7 @@ int kerning(font_desc_t *desc, int prevc { FT_Vector kern; - if (!vo_font->dynamic) return 0; + if (!desc->dynamic) return 0; if (prevc < 0 || c < 0) return 0; if (desc->font[prevc] != desc->font[c]) return 0; if (desc->font[prevc] == -1 || desc->font[c] == -1) return 0; @@ -1127,13 +1127,14 @@ int done_freetype(void) return 0; } -void load_font_ft(int width, int height) +void load_font_ft(int width, int height, font_desc_t** fontp, const char *font_name) { #ifdef HAVE_FONTCONFIG FcPattern *fc_pattern; FcChar8 *s; FcBool scalable; #endif + font_desc_t *vo_font = *fontp; vo_image_width = width; vo_image_height = height; @@ -1162,12 +1163,12 @@ void load_font_ft(int width, int height) } // s doesn't need to be freed according to fontconfig docs FcPatternGetString(fc_pattern, FC_FILE, 0, &s); - vo_font=read_font_desc_ft(s, width, height); + *fontp=read_font_desc_ft(s, width, height); free(fc_pattern); } else #endif - vo_font=read_font_desc_ft(font_name, width, height); + *fontp=read_font_desc_ft(font_name, width, height); #endif } diff -r 594922837fd5 libvo/sub.c --- a/libvo/sub.c Sun Apr 30 16:54:35 2006 +0200 +++ b/libvo/sub.c Sun Apr 30 16:54:36 2006 +0200 @@ -8,6 +8,7 @@ #include #endif +#include "mplayer.h" #include "mp_msg.h" #include "help_mp.h" #include "video_out.h" @@ -56,6 +57,7 @@ char * __sub_osd_names_short[] ={ "", "| //static int vo_font_loaded=-1; font_desc_t* vo_font=NULL; +font_desc_t* sub_font=NULL; unsigned char* vo_osd_text=NULL; int sub_unicode=0; @@ -343,7 +345,7 @@ inline static void vo_update_text_sub(mp obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE; - if(!vo_sub || !vo_font || !sub_visibility || (vo_font->font[40]<0)){ + if(!vo_sub || !sub_font || !sub_visibility || (sub_font->font[40]<0)){ obj->flags&=~OSDFLAG_VISIBLE; return; } @@ -353,7 +355,7 @@ inline static void vo_update_text_sub(mp // too long lines divide into a smaller ones i=k=lasth=0; - h=vo_font->height; + h=sub_font->height; lastStripPosition=-1; l=vo_sub->lines; @@ -364,7 +366,7 @@ inline static void vo_update_text_sub(mp int *char_seq, char_position, xlimit = dxs * sub_width_p / 100, counter; while (l) { - xsize = -vo_font->charspace; + xsize = -sub_font->charspace; l--; t=vo_sub->text[i++]; len=strlen(t)-1; @@ -395,7 +397,7 @@ inline static void vo_update_text_sub(mp mp_msg(MSGT_OSD,MSGL_WARN,"\nMAX_UCS exceeded!\n"); } if (!c) c++; // avoid UCS 0 - render_one_glyph(vo_font, c); + render_one_glyph(sub_font, c); if (c == ' ') { struct osd_text_t *tmp_ott = (struct osd_text_t *) calloc(1, sizeof(struct osd_text_t)); @@ -406,7 +408,7 @@ inline static void vo_update_text_sub(mp tmp_ott->prev = cp_ott; cp_ott->next = tmp_ott; tmp_ott->osd_kerning = - vo_font->charspace + vo_font->width[' ']; + sub_font->charspace + sub_font->width[' ']; cp_ott = tmp_ott; } tmp_ott->osd_length = xsize; @@ -418,16 +420,16 @@ inline static void vo_update_text_sub(mp xsize = 0; prevc = c; } else { - int delta_xsize = vo_font->width[c] + vo_font->charspace + kerning(vo_font, prevc, c); + int delta_xsize = sub_font->width[c] + sub_font->charspace + kerning(sub_font, prevc, c); if (xsize + delta_xsize <= dxs) { if (!x) x = 1; prevc = c; char_seq[char_position++] = c; xsize += delta_xsize; - if ((!suboverlap_enabled) && ((font = vo_font->font[c]) >= 0)) { - if (vo_font->pic_a[font]->h > h) { - h = vo_font->pic_a[font]->h; + if ((!suboverlap_enabled) && ((font = sub_font->font[c]) >= 0)) { + if (sub_font->pic_a[font]->h > h) { + h = sub_font->pic_a[font]->h; } } } else { @@ -449,7 +451,7 @@ inline static void vo_update_text_sub(mp tmp_ott->prev = cp_ott; cp_ott->next = tmp_ott; tmp_ott->osd_kerning = - vo_font->charspace + vo_font->width[' ']; + sub_font->charspace + sub_font->width[' ']; cp_ott = tmp_ott; } tmp_ott->osd_length = xsize; @@ -458,7 +460,7 @@ inline static void vo_update_text_sub(mp for (counter = 0; counter < char_position; ++counter) tmp_ott->text[counter] = char_seq[counter]; char_position = 0; - xsize = -vo_font->charspace; + xsize = -sub_font->charspace; } if (osl != NULL) { @@ -480,7 +482,7 @@ inline static void vo_update_text_sub(mp tmp->prev = tmp_otp; tmp_otp = tmp; tmp_otp->ott = tmp_ott; - value = -2 * vo_font->charspace - vo_font->width[' ']; + value = -2 * sub_font->charspace - sub_font->width[' ']; } else { tmp_otp->value = value; exit = 1; @@ -581,7 +583,7 @@ inline static void vo_update_text_sub(mp break; if (h > obj->y) { // out of the screen so end parsing - obj->y -= lasth - vo_font->height; // correct the y position + obj->y -= lasth - sub_font->height; // correct the y position break; } xsize = tmp_otp->value; @@ -598,17 +600,17 @@ inline static void vo_update_text_sub(mp break; } c = tmp_ott->text[counter]; - render_one_glyph(vo_font, c); + render_one_glyph(sub_font, c); obj->params.subtitle.utbl[utblc++] = c; k++; } obj->params.subtitle.utbl[utblc++] = ' '; } obj->params.subtitle.utbl[utblc - 1] = 0; - obj->y -= vo_font->height; + obj->y -= sub_font->height; } if(obj->params.subtitle.lines) - obj->y = dys - ((obj->params.subtitle.lines - 1) * vo_font->height + vo_font->pic_a[vo_font->font[40]]->h); + obj->y = dys - ((obj->params.subtitle.lines - 1) * sub_font->height + sub_font->pic_a[sub_font->font[40]]->h); // free memory if (otp_sub != NULL) { @@ -647,7 +649,7 @@ inline static void vo_update_text_sub(mp obj->bbox.x1=xmin; obj->bbox.x2=xmax; obj->bbox.y1=obj->y; -// obj->bbox.y2=obj->y+obj->params.subtitle.lines*vo_font->height; +// obj->bbox.y2=obj->y+obj->params.subtitle.lines*sub_font->height; obj->flags|=OSDFLAG_BBOX; alloc_buf(obj); @@ -693,18 +695,18 @@ inline static void vo_update_text_sub(mp } prevc = -1; while ((c=obj->params.subtitle.utbl[j++])){ - x += kerning(vo_font,prevc,c); - if ((font=vo_font->font[c])>=0) + x += kerning(sub_font,prevc,c); + if ((font=sub_font->font[c])>=0) draw_alpha_buf(obj,x,y, - vo_font->width[c], - vo_font->pic_a[font]->h+ydys ? vo_font->pic_a[font]->h : obj->dys-y, - vo_font->pic_b[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->bmp+vo_font->start[c], - vo_font->pic_a[font]->w); - x+=vo_font->width[c]+vo_font->charspace; + sub_font->width[c], + sub_font->pic_a[font]->h+ydys ? sub_font->pic_a[font]->h : obj->dys-y, + sub_font->pic_b[font]->bmp+sub_font->start[c], + sub_font->pic_a[font]->bmp+sub_font->start[c], + sub_font->pic_a[font]->w); + x+=sub_font->width[c]+sub_font->charspace; prevc = c; } - y+=vo_font->height; + y+=sub_font->height; } } @@ -787,12 +789,18 @@ int vo_update_osd(int dxs,int dys){ if (defer_counter >= FONT_LOAD_DEFER) force_load_font = 1; } - if (!vo_font || force_load_font) { + if (force_load_font) { force_load_font = 0; - load_font_ft(dxs, dys); + load_font_ft(dxs, dys, &vo_font, font_name); + load_font_ft(dxs, dys, &sub_font, sub_font_name); prev_dxs = dxs; prev_dys = dys; defer_counter = 0; + } else { + if (!vo_font) + load_font_ft(dxs, dys, &vo_font, font_name); + if (!sub_font) + load_font_ft(dxs, dys, &sub_font, sub_font_name); } #endif diff -r 594922837fd5 mencoder.c --- a/mencoder.c Sun Apr 30 16:54:35 2006 +0200 +++ b/mencoder.c Sun Apr 30 16:54:36 2006 +0200 @@ -185,6 +185,7 @@ static int play_n_frames_mf=-1; // sub: char *font_name=NULL; +char *sub_font_name=NULL; #ifdef HAVE_FONTCONFIG extern int font_fontconfig; #endif diff -r 594922837fd5 mplayer.c --- a/mplayer.c Sun Apr 30 16:54:35 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:36 2006 +0200 @@ -328,6 +328,7 @@ extern int vo_flags; // sub: char *font_name=NULL; +char *sub_font_name=NULL; #ifdef HAVE_FONTCONFIG extern int font_fontconfig; #endif @@ -2626,6 +2627,10 @@ if(!codecs_file || !parse_codec_cfg(code if(!vo_font) vo_font=read_font_desc(MPLAYER_DATADIR "/font/font.desc",font_factor,verbose>1); } + if (sub_font_name) + sub_font = read_font_desc(sub_font_name, font_factor, verbose>1); + else + sub_font = vo_font; #ifdef HAVE_FONTCONFIG } #endif diff -r 594922837fd5 mplayer.h --- a/mplayer.h Sun Apr 30 16:54:35 2006 +0200 +++ b/mplayer.h Sun Apr 30 16:54:36 2006 +0200 @@ -23,6 +23,7 @@ extern unsigned int osd_visible; extern unsigned int osd_visible; extern char * font_name; +extern char * sub_font_name; extern float font_factor; extern float movie_aspect; extern float force_fps; geexbox-1.0/packages/MPlayer/patches/400_player-encoder-single-binary.diff0000644000175000017500000003373310446314257025501 0ustar aurelaureldiff -r df3f5d46d866 Makefile --- a/Makefile Sun Apr 30 17:12:19 2006 +0200 +++ b/Makefile Sun Apr 30 17:36:01 2006 +0200 @@ -21,48 +21,46 @@ INSTALLSTRIP = -s INSTALLSTRIP = -s endif -SRCS_COMMON = asxparser.c \ - codec-cfg.c \ - cpudetect.c \ - edl.c \ - find_sub.c \ - m_config.c \ - m_option.c \ - m_struct.c \ - parser-cfg.c \ - playtree.c \ - playtreeparser.c \ - spudec.c \ - sub_cc.c \ - subreader.c \ - vobsub.c \ - -SRCS_MENCODER = mencoder.c \ - mp_msg-mencoder.c \ - $(SRCS_COMMON) \ - divx4_vbr.c \ - libvo/aclib.c \ - libvo/font_load.c \ - libvo/font_load_ft.c \ - libvo/osd.c \ - libvo/sub.c \ - parser-mecmd.c \ - xvid_vbr.c \ - -SRCS_MPLAYER = mplayer.c \ - m_property.c \ - mp_msg.c \ - $(SRCS_COMMON) \ - mixer.c \ - parser-mpcmd.c \ - subopt-helper.c \ +SRCS = mplayer.c \ + m_property.c \ + mp_msg.c \ + asxparser.c \ + codec-cfg.c \ + cpudetect.c \ + edl.c \ + find_sub.c \ + m_config.c \ + m_option.c \ + m_struct.c \ + parser-cfg.c \ + playtree.c \ + playtreeparser.c \ + spudec.c \ + sub_cc.c \ + subreader.c \ + vobsub.c \ + mixer.c \ + parser-mpcmd.c \ + subopt-helper.c \ + +ifeq ($(MENCODER),yes) +SRCS += mencoder.c \ + divx4_vbr.c \ + libvo/aclib.c \ + libvo/font_load.c \ + libvo/font_load_ft.c \ + libvo/osd.c \ + libvo/sub.c \ + parser-mecmd.c \ + xvid_vbr.c \ + +endif ifeq ($(UNRARLIB),yes) -SRCS_COMMON += unrarlib.c -endif - -OBJS_MENCODER = $(SRCS_MENCODER:.c=.o) -OBJS_MPLAYER = $(SRCS_MPLAYER:.c=.o) +SRCS += unrarlib.c +endif + +OBJS = $(SRCS:.c=.o) VO_LIBS = $(AA_LIB) \ $(X_LIB) \ @@ -345,17 +343,19 @@ libmenu/libmenu.a: libmenu/libmenu.a: $(MAKE) -C libmenu -MPLAYER_DEP = $(OBJS_MPLAYER) $(COMMON_DEPS) +DEP = $(OBJS) $(COMMON_DEPS) ifeq ($(LIBMENU),yes) -MPLAYER_DEP += libmenu/libmenu.a +DEP += libmenu/libmenu.a MENU_LIBS = libmenu/libmenu.a PARTS += libmenu else MENU_LIBS = endif -MENCODER_DEP = $(OBJS_MENCODER) $(COMMON_DEPS) libmpcodecs/libmpencoders.a +ifeq ($(MENCODER),yes) +DEP += libmpcodecs/libmpencoders.a +endif ifeq ($(VIDIX),yes) VIDIX_LIBS = vidix/libvidix.a @@ -364,10 +364,17 @@ endif endif ifeq ($(TARGET_WIN32),yes) -OBJS_MPLAYER += osdep/mplayer-rc.o -endif - -LIBS_MPLAYER = libvo/libvo.a \ +OBJS += osdep/mplayer-rc.o +endif + +ifeq ($(MENCODER),yes) +LIBS += libmpcodecs/libmpencoders.a \ + $(ENCORE_LIB) \ + $(MLIB_LIB) \ + +endif + +LIBS += libvo/libvo.a \ libao2/libao2.a \ input/libinput.a \ $(MENU_LIBS) \ @@ -385,11 +392,11 @@ LIBS_MPLAYER = libvo/libvo.a \ $(MATH_LIB) \ $(LIBC_LIB) \ -$(PRG): $(MPLAYER_DEP) +$(PRG): $(DEP) ifeq ($(TARGET_WIN32),yes) windres -o osdep/mplayer-rc.o osdep/mplayer.rc endif - $(CC) $(CFLAGS) -o $(PRG) $(OBJS_MPLAYER) $(LIBS_MPLAYER) + $(CC) $(CFLAGS) -o $(PRG) $(OBJS) $(LIBS) mplayer.exe.spec.c: libmpcodecs/libmpcodecs.a winebuild -fPIC -o mplayer.exe.spec.c -exe mplayer.exe -mcui \ @@ -399,7 +406,7 @@ mplayer.exe.so: $(MPLAYER_DEP) mplayer.e mplayer.exe.so: $(MPLAYER_DEP) mplayer.exe.spec.c $(CC) $(CFLAGS) -Wall -shared \ -Wl,-rpath,/usr/local/lib -Wl,-Bsymbolic \ - -o mplayer.exe.so $(OBJS_MPLAYER) mplayer.exe.spec.c \ + -o mplayer.exe.so $(OBJS) mplayer.exe.spec.c \ libvo/libvo.a libao2/libao2.a $(MENU_LIBS) $(VIDIX_LIBS) \ $(GUI_LIBS) $(COMMON_LIBS) $(GTK_LIBS) $(VO_LIBS) \ $(AO_LIBS) $(EXTRA_LIB) $(LIRC_LIB) $(LIRCC_LIB) \ @@ -407,26 +414,15 @@ mplayer.exe.so: $(MPLAYER_DEP) mplayer.e mplayer_wine.so: $(MPLAYER_DEP) $(CC) $(CFLAGS) -shared -Wl,-Bsymbolic -o mplayer_wine.so \ - mplayer_wine.spec.c $(OBJS_MPLAYER) libvo/libvo.a \ + mplayer_wine.spec.c $(OBJS) libvo/libvo.a \ libao2/libao2.a $(MENU_LIBS) $(VIDIX_LIBS) $(GUI_LIBS) \ $(COMMON_LIBS) $(GTK_LIBS) $(VO_LIBS) $(AO_LIBS) \ $(EXTRA_LIB) $(LIRC_LIB) $(LIRCC_LIB) $(STATIC_LIB) \ -lwine $(ARCH_LIB) $(MATH_LIB) \ ifeq ($(MENCODER),yes) -LIBS_MENCODER = libmpcodecs/libmpencoders.a \ - $(ENCORE_LIB) \ - $(COMMON_LIBS) \ - $(EXTRA_LIB) \ - $(MLIB_LIB) \ - $(LIRC_LIB) \ - $(LIRCC_LIB) \ - $(ARCH_LIB) \ - $(MATH_LIB) \ - $(LIBC_LIB) \ - -$(PRG_MENCODER): $(MENCODER_DEP) - $(CC) $(CFLAGS) -o $(PRG_MENCODER) $(OBJS_MENCODER) $(LIBS_MENCODER) +$(PRG_MENCODER): $(PRG) + -ln -sf $(PRG) $(PRG_MENCODER) endif codecs.conf.h: $(PRG_CFG) etc/codecs.conf @@ -461,7 +457,7 @@ endif fi ; \ done ifeq ($(MENCODER),yes) - $(INSTALL) -m 755 $(INSTALLSTRIP) $(PRG_MENCODER) $(BINDIR)/$(PRG_MENCODER) + -ln -sf $(PRG) $(BINDIR)/$(PRG_MENCODER) for i in $(MAN_LANG); do \ if test "$$i" = en ; then \ ln -sf mplayer.1 $(MANDIR)/man1/mencoder.1 ; \ @@ -520,7 +516,7 @@ dep: depend dep: depend depend: help_mp.h - $(CC) -MM $(CFLAGS) -DCODECS2HTML mplayer.c mencoder.c $(SRCS_MPLAYER) $(SRCS_MENCODER) 1>.depend + $(CC) -MM $(CFLAGS) -DCODECS2HTML mplayer.c mencoder.c $(SRCS) 1>.depend @for a in $(PARTS); do $(MAKE) -C $$a dep; done # ./configure must be run if it changed in CVS @@ -564,7 +560,7 @@ mplayer.o mencoder.o vobsub.o: version.h mplayer.o mencoder.o vobsub.o: version.h # temporary measure to make sure help_mp.h is built. we desperately need correct deps! -$(MPLAYER_DEP) $(MENCODER_DEP): help_mp.h +$(DEP): help_mp.h # # the following lines provide _partial_ dependency information diff -r df3f5d46d866 cfg-common.h --- a/cfg-common.h Sun Apr 30 17:12:19 2006 +0200 +++ b/cfg-common.h Sun Apr 30 17:36:01 2006 +0200 @@ -364,6 +364,9 @@ extern char* edl_output_filename; extern char* edl_output_filename; #ifdef USE_TV +#ifdef FOR_MENCODER +extern m_option_t tvopts_conf[]; +#else m_option_t tvopts_conf[]={ {"on", "-tv on is deprecated, use tv:// instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, {"immediatemode", &tv_param_immediate, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL}, @@ -409,6 +412,7 @@ m_option_t tvopts_conf[]={ {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif +#endif #ifdef HAS_DVBIN_SUPPORT #include "libmpdemux/dvbin.h" @@ -435,6 +439,9 @@ extern float sws_chr_sharpen; extern float sws_chr_sharpen; extern float sws_lum_sharpen; +#ifdef FOR_MENCODER +extern m_option_t scaler_filter_conf[]; +#else m_option_t scaler_filter_conf[]={ {"lgb", &sws_lum_gblur, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL}, {"cgb", &sws_chr_gblur, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL}, @@ -444,6 +451,7 @@ m_option_t scaler_filter_conf[]={ {"cs", &sws_chr_sharpen, CONF_TYPE_FLOAT, 0, -100.0, 100.0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; +#endif /* VIVO demuxer options: */ extern int vivo_param_version; @@ -456,6 +464,9 @@ extern int vivo_param_vformat; extern int vivo_param_vformat; extern char *dvd_device, *vcd_device, *cdda_device; +#ifdef FOR_MENCODER +extern m_option_t vivoopts_conf[]; +#else m_option_t vivoopts_conf[]={ {"version", &vivo_param_version, CONF_TYPE_INT, 0, 0, 0, NULL}, /* audio options */ @@ -469,6 +480,7 @@ m_option_t vivoopts_conf[]={ {"vformat", &vivo_param_vformat, CONF_TYPE_INT, 0, 0, 0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; +#endif extern int mf_w; extern int mf_h; @@ -477,6 +489,9 @@ extern m_obj_settings_t* vf_settings; extern m_obj_settings_t* vf_settings; extern m_obj_list_t vf_obj_list; +#ifdef FOR_MENCODER +extern m_option_t mfopts_conf[]; +#else m_option_t mfopts_conf[]={ {"on", "-mf on is deprecated, use mf:// instead.\n", CONF_TYPE_PRINT, 0, 0, 1, NULL}, {"w", &mf_w, CONF_TYPE_INT, 0, 0, 0, NULL}, @@ -485,17 +500,27 @@ m_option_t mfopts_conf[]={ {"type", &mf_type, CONF_TYPE_STRING, 0, 0, 0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; +#endif extern m_obj_settings_t* vo_plugin_args; #include "libaf/af.h" extern af_cfg_t af_cfg; // Audio filter configuration, defined in libmpcodecs/dec_audio.c + +#ifdef FOR_MENCODER +extern m_option_t audio_filter_conf[]; +#else m_option_t audio_filter_conf[]={ {"list", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, {"force", &af_cfg.force, CONF_TYPE_INT, CONF_RANGE, 0, 7, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; - +#endif + + +#ifdef FOR_MENCODER +extern m_option_t msgl_config[]; +#else m_option_t msgl_config[]={ { "all", &mp_msg_level_all, CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL}, @@ -586,6 +611,7 @@ m_option_t msgl_config[]={ " identify - identify output\n" "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, }; +#endif #ifdef WIN32 diff -r df3f5d46d866 cfg-mencoder.h --- a/cfg-mencoder.h Sun Apr 30 17:12:19 2006 +0200 +++ b/cfg-mencoder.h Sun Apr 30 17:36:01 2006 +0200 @@ -3,7 +3,9 @@ * config for cfgparser */ +#define FOR_MENCODER 1 #include "cfg-common.h" +#undef FOR_MENCODER #ifdef USE_FAKE_MONO extern int fakemono; // defined in dec_audio.c diff -r df3f5d46d866 mencoder.c --- a/mencoder.c Sun Apr 30 17:12:19 2006 +0200 +++ b/mencoder.c Sun Apr 30 17:36:01 2006 +0200 @@ -74,7 +74,7 @@ #include "osdep/timer.h" -#include "get_path.c" +extern char *get_path(char *filename); #ifdef USE_LIBAVCODEC #ifdef USE_LIBAVCODEC_SO @@ -85,30 +85,27 @@ #endif #include "libmpcodecs/ae.h" -int vo_doublebuffering=0; -int vo_directrendering=0; -int vo_config_count=0; -int forced_subs_only=0; +extern forced_subs_only; //-------------------------- // cache2: -int stream_cache_size=-1; +extern int stream_cache_size; #ifdef USE_STREAM_CACHE extern int cache_fill_status; -float stream_cache_min_percent=20.0; -float stream_cache_seek_min_percent=50.0; +extern float stream_cache_min_percent; +extern float stream_cache_seek_min_percent; #else #define cache_fill_status 0 #endif -int audio_id=-1; -int video_id=-1; -int dvdsub_id=-2; -int vobsub_id=-1; -char* audio_lang=NULL; -char* dvdsub_lang=NULL; +extern int audio_id; +extern int video_id; +extern int dvdsub_id; +extern int vobsub_id; +extern char* audio_lang; +extern char* dvdsub_lang; static char* spudec_ifo=NULL; static char** audio_codec_list=NULL; // override audio codec @@ -130,14 +127,14 @@ int out_file_format=MUXER_TYPE_AVI; // d //void resync_audio_stream(sh_audio_t *sh_audio){} extern int verbose; // must be global! -int quiet=0; -double video_time_usage=0; -double vout_time_usage=0; +extern int quiet; +extern double video_time_usage; +extern double vout_time_usage; double max_video_time_usage=0; double max_vout_time_usage=0; double cur_video_time_usage=0; double cur_vout_time_usage=0; -int benchmark=0; +extern int benchmark; extern int mp_msg_levels[MSGT_MAX]; extern int mp_msg_level_all; @@ -158,10 +155,10 @@ static int ignore_start=0; static int ignore_start=0; static int audio_density=2; -float force_fps=0; +extern float force_fps; static float force_ofps=0; // set to 24 for inverse telecine static int skip_limit=-1; -float playback_speed=1.0; +extern float playback_speed; static int force_srate=0; static int audio_output_format=0; @@ -184,22 +181,22 @@ static int play_n_frames_mf=-1; #include "libvo/sub.h" // sub: -char *font_name=NULL; -char *sub_font_name=NULL; +extern char *font_name; +extern char *sub_font_name; #ifdef HAVE_FONTCONFIG extern int font_fontconfig; #endif -float font_factor=0.75; -char **sub_name=NULL; -float sub_delay=0; -float sub_fps=0; -int sub_auto = 0; -int subcc_enabled=0; -int suboverlap_enabled = 1; +extern float font_factor; +extern char **sub_name; +extern float sub_delay; +extern float sub_fps; +extern int sub_auto; +extern int subcc_enabled; +extern int suboverlap_enabled; #ifdef USE_SUB static sub_data* subdata=NULL; -float sub_last_pts = -303; +extern float sub_last_pts; #endif int auto_expand=1; @@ -217,12 +217,6 @@ char *info_sourceform=NULL; char *info_comment=NULL; -// Needed by libmpdemux. -int mp_input_check_interrupt(int time) { - usec_sleep(time); - return 0; -} - //char *out_audio_codec=NULL; // override audio codec //char *out_video_codec=NULL; // override video codec @@ -299,7 +296,7 @@ static void mencoder_exit(int level, cha exit(level); } -void parse_cfgfiles( m_config_t* conf ) +void me_parse_cfgfiles( m_config_t* conf ) { char *conffile; if ((conffile = get_path("mencoder.conf")) == NULL) { @@ -360,7 +357,7 @@ static FILE* muxer_f=NULL; extern void print_wave_header(WAVEFORMATEX *h, int verbose_level); -int main(int argc,char* argv[]){ +int me_main(int argc,char* argv[]){ stream_t* stream=NULL; demuxer_t* demuxer=NULL; @@ -405,6 +402,7 @@ ao_data_t ao_data = {0,0,0,0,OUTBURST,-1 audio_encoding_params_t aparams; audio_encoder_t *aencoder = NULL; + sub_auto = 0; mp_msg_init(); mp_msg(MSGT_CPLAYER,MSGL_INFO, "MEncoder " VERSION " (C) 2000-2006 MPlayer Team\n"); @@ -463,7 +461,7 @@ if(!codecs_file || !parse_codec_cfg(code mconfig = m_config_new(); m_config_register_options(mconfig,mencoder_opts); - parse_cfgfiles(mconfig); + me_parse_cfgfiles(mconfig); filelist = m_config_parse_me_command_line(mconfig, argc, argv); if(!filelist) mencoder_exit(1, MSGTR_ErrorParsingCommandLine); diff -r df3f5d46d866 mplayer.c --- a/mplayer.c Sun Apr 30 17:12:19 2006 +0200 +++ b/mplayer.c Sun Apr 30 17:36:01 2006 +0200 @@ -2360,7 +2360,7 @@ static int set_property_command(mp_cmd_t ///@} // Command2Property -int main(int argc,char* argv[]){ +int mp_main(int argc,char* argv[]){ char * mem_ptr; @@ -5320,3 +5320,14 @@ exit_player_with_rc(MSGTR_Exit_eof, 0); return 1; } + +int +main (int argc, char **argv) +{ +#ifdef HAVE_MENCODER + if (strstr (argv[0], "mencoder")) + return me_main (argc, argv); + else +#endif + return mp_main (argc, argv); +} geexbox-1.0/packages/MPlayer/patches/405_command-record.diff0000644000175000017500000000417510446314257022724 0ustar aurelaureldiff -r 37c3bd5363cf input/input.c --- a/input/input.c Sun Apr 30 16:54:36 2006 +0200 +++ b/input/input.c Sun Apr 30 16:54:37 2006 +0200 @@ -117,6 +117,7 @@ static mp_cmd_t mp_cmds[] = { { MP_CMD_VO_ONTOP, "vo_ontop", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, { MP_CMD_VO_ROOTWIN, "vo_rootwin", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, { MP_CMD_VO_BORDER, "vo_border", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, + { MP_CMD_RECORD, "record", 0, { {-1,{0}} } }, { MP_CMD_SCREENSHOT, "screenshot", 0, { {-1,{0}} } }, { MP_CMD_PANSCAN, "panscan",1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_SWITCH_VSYNC, "switch_vsync", 0, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, diff -r 37c3bd5363cf input/input.h --- a/input/input.h Sun Apr 30 16:54:36 2006 +0200 +++ b/input/input.h Sun Apr 30 16:54:37 2006 +0200 @@ -75,6 +75,8 @@ #define MP_CMD_DVD_PLAY 81 #define MP_CMD_CDDA_PLAY 82 +#define MP_CMD_RECORD 95 + #define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_LOADFILE 5001 #define MP_CMD_GUI_LOADSUBTITLE 5002 diff -r 37c3bd5363cf mplayer.c --- a/mplayer.c Sun Apr 30 16:54:36 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:37 2006 +0200 @@ -91,6 +91,8 @@ int player_idle_mode=0; int player_idle_mode=0; extern int verbose; int quiet=0; +static int record=0; +static int old_index_mode=0; #ifdef WIN32 char * proc_priority=NULL; @@ -4732,6 +4734,27 @@ if (stream->type==STREAMTYPE_DVDNAV && d video_out->control(VOCTRL_SCREENSHOT, NULL); } break; + case MP_CMD_RECORD: + { + extern int index_mode; + char cmd[1024]; + + if (record == 0) + { + record = 1; + old_index_mode = index_mode; + index_mode = 0; /* do _NOT_ try to rebuild the index */ + + sprintf (cmd, "/usr/bin/mp_recorder \"%s\"&", filename); + } + else + { + record = 0; + sprintf (cmd, "/usr/bin/mp_recorder &"); + index_mode = old_index_mode; /* restore previous index mode */ + } + system (cmd); + } break; case MP_CMD_VF_CHANGE_RECTANGLE: set_rectangle(sh_video, cmd->args[0].v.i, cmd->args[1].v.i); break; geexbox-1.0/packages/MPlayer/patches/410_encoder_menu_properties.diff0000644000175000017500000001135610446314257024744 0ustar aurelaureldiff -r ab96fb760da1 libmenu/menu_cmdlist.c --- a/libmenu/menu_cmdlist.c Sun Apr 30 16:54:37 2006 +0200 +++ b/libmenu/menu_cmdlist.c Sun Apr 30 16:54:37 2006 +0200 @@ -6,7 +6,11 @@ #include #include #include +#define _GNU_SOURCE #include +#include +#include +#include #include "img_format.h" #include "mp_image.h" @@ -95,12 +99,37 @@ static void free_entry(list_entry_t* ent free(entry); } -static void close(menu_t* menu) { +static void close2(menu_t* menu) { menu_list_uninit(menu,free_entry); } +#define OPT_RECORDER_STATUS "recorder-status" +#define OPT_RECORDER_PROFILE "recorder-profile" +#define OPT_RECORDER_PATH "recorder-path" +#define RECORDER_FILE "/etc/recorder" +#define RECORDER_STATUS "/var/record_status" +#define RECORDER_STATE_ON "On" +#define RECORDER_STATE_OFF "Off" +#define RECORDER_STATE_UNKNOWN "Unknown" +#define PROP_RECORDER_PATH "SAVE_PATH=" +#define PROP_RECORDER_PROFILE "RECORD_PROFILE=" + +static int +is_valid_recorder_property (char *prop) +{ + if (!prop) + return 0; + + if (strcmp (prop, OPT_RECORDER_STATUS) != 0 && + strcmp (prop, OPT_RECORDER_PROFILE) != 0 && + strcmp (prop, OPT_RECORDER_PATH) != 0) + return 0; + + return 1; +} + static int parse_args(menu_t* menu,char* args) { - char *element,*body, **attribs, *name; + char *element,*body, **attribs, *name, *ok, *cancel, *prop; list_entry_t* m = NULL; int r; ASX_Parser_t* parser = asx_parser_new(); @@ -126,8 +155,102 @@ static int parse_args(menu_t* menu,char* asx_free_attribs(attribs); continue; } + prop = asx_get_attrib("prop",attribs); m = calloc(1,sizeof(struct list_entry_s)); - m->p.txt = name; + + if (!prop) + m->p.txt = name; + else if (!is_valid_recorder_property (prop)) + m->p.txt = name; + else + { + if (!strcmp (prop, OPT_RECORDER_STATUS)) + { + struct stat st; + m->p.txt = (char *) malloc (256); + if (stat (RECORDER_STATUS, &st) == 0) + sprintf (m->p.txt, "%s: %s", name, RECORDER_STATE_ON); + else + sprintf (m->p.txt, "%s: %s", name, RECORDER_STATE_OFF); + free (name); + free (prop); + } + else if (!strcmp (prop, OPT_RECORDER_PATH)) + { + struct stat st; + m->p.txt = (char *) malloc (256); + if (stat (RECORDER_FILE, &st) == 0) + { + FILE *f = NULL; + char *path = NULL; + + f = fopen (RECORDER_FILE, "r"); + while (!feof (f)) + { + char line[1024]; + int len = strlen (PROP_RECORDER_PATH); + fgets (line, 1024, f); + if (!strncmp (line, PROP_RECORDER_PATH, len)) + { + path = strdup (line + len + 1); + path[strlen (path) - 2] = '\0'; + break; + } + } + fclose (f); + + if (path) + { + sprintf (m->p.txt, "%s: %s", name, path); + free (path); + } + else + sprintf (m->p.txt, "%s: %s", name, RECORDER_STATE_UNKNOWN); + } + else + sprintf (m->p.txt, "%s: %s", name, RECORDER_STATE_UNKNOWN); + free (name); + free (prop); + } + else if (!strcmp (prop, OPT_RECORDER_PROFILE)) + { + struct stat st; + m->p.txt = (char *) malloc (256); + if (stat (RECORDER_FILE, &st) == 0) + { + FILE *f = NULL; + char *profile = NULL; + + f = fopen (RECORDER_FILE, "r"); + while (!feof (f)) + { + char line[1024]; + int len = strlen (PROP_RECORDER_PROFILE); + fgets (line, 1024, f); + if (!strncmp (line, PROP_RECORDER_PROFILE, len)) + { + profile = strdup (line + len); + profile[strlen (profile) - 1] = '\0'; + break; + } + } + fclose (f); + + if (profile) + { + sprintf (m->p.txt, "%s: %s", name, profile); + free (profile); + } + else + sprintf (m->p.txt, "%s: %s", name, RECORDER_STATE_UNKNOWN); + } + else + sprintf (m->p.txt, "%s: %s", name, RECORDER_STATE_UNKNOWN); + free (name); + free (prop); + } + } + m->ok = asx_get_attrib("ok",attribs); m->cancel = asx_get_attrib("cancel",attribs); m->left = asx_get_attrib("left",attribs); @@ -144,7 +267,7 @@ static int open(menu_t* menu, char* args menu->draw = menu_list_draw; menu->read_cmd = read_cmd; menu->read_key = read_key; - menu->close = close; + menu->close = close2; if(!args) { mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_ListMenuNeedsAnArgument); geexbox-1.0/packages/MPlayer/patches/500_menu-toggle-hide-fix.diff0000664000175000017500000000170210446314257023737 0ustar aurelaureldiff -r df23d9c02a71 libmenu/vf_menu.c --- a/libmenu/vf_menu.c Sun Apr 30 16:54:37 2006 +0200 +++ b/libmenu/vf_menu.c Sun Apr 30 16:54:38 2006 +0200 @@ -104,7 +104,7 @@ static int cmd_filter(mp_cmd_t* cmd, int case MP_CMD_MENU : { // Convert txt cmd from the users into libmenu stuff char* arg = cmd->args[0].v.s; - if(!priv->current->show) + if(!priv->current->show && !(strcmp(arg,"hide") == 0) ) priv->current->show = 1; else if(strcmp(arg,"up") == 0) menu_read_cmd(priv->current,MENU_CMD_UP); @@ -118,7 +118,7 @@ static int cmd_filter(mp_cmd_t* cmd, int menu_read_cmd(priv->current,MENU_CMD_OK); else if(strcmp(arg,"cancel") == 0) menu_read_cmd(priv->current,MENU_CMD_CANCEL); - else if(strcmp(arg,"hide") == 0) + else if(strcmp(arg,"hide") == 0 || strcmp(arg,"toggle") == 0) priv->current->show = 0; else mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnknownMenuCommand,arg); geexbox-1.0/packages/MPlayer/patches/505_menu-cmdlist-autoclose.diff0000664000175000017500000000204210446314257024421 0ustar aurelaureldiff -r 3213b1684465 libmenu/menu_cmdlist.c --- a/libmenu/menu_cmdlist.c Sun Apr 30 16:54:38 2006 +0200 +++ b/libmenu/menu_cmdlist.c Sun Apr 30 16:54:39 2006 +0200 @@ -39,15 +39,20 @@ struct list_entry_s { struct menu_priv_s { menu_list_priv_t p; -}; + int auto_close; +}; + +#define ST_OFF(m) M_ST_OFF(struct menu_priv_s, m) static struct menu_priv_s cfg_dflt = { - MENU_LIST_PRIV_DFLT + MENU_LIST_PRIV_DFLT, + 0, }; static m_option_t cfg_fields[] = { MENU_LIST_PRIV_FIELDS, { "title",M_ST_OFF(struct menu_priv_s,p.title), CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "auto-close", ST_OFF(auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL }, { NULL, NULL, NULL, 0,0,0,NULL } }; @@ -65,7 +70,11 @@ static void read_cmd(menu_t* menu,int cm if(mpriv->p.current->ok) { mp_cmd_t* c = mp_input_parse_cmd(mpriv->p.current->ok); if(c) + { + if (mpriv->auto_close) + mp_input_queue_cmd (mp_input_parse_cmd ("menu hide")); mp_input_queue_cmd(c); + } } } break; case MENU_CMD_LEFT: geexbox-1.0/packages/MPlayer/patches/510_menu-display-colors.diff0000644000175000017500000000063010446314257023725 0ustar aurelaureldiff -Naur MPlayer-20060429.orig/libmenu/menu_list.h MPlayer-20060429/libmenu/menu_list.h --- MPlayer-20060429.orig/libmenu/menu_list.h 2006-05-01 12:19:04.000000000 +0200 +++ MPlayer-20060429/libmenu/menu_list.h 2006-05-01 12:19:33.000000000 +0200 @@ -56,9 +56,9 @@ 0,0, \ 5, 3, \ NULL, \ - 0xE0, 0x20, \ - 0x80, 0x50, \ - 0xC0, 0x50 \ + 0xFF, 0xFF, \ + 0xFF, 0xFF, \ + 0xA4, 0x50 \ } geexbox-1.0/packages/MPlayer/patches/515_menu-audio-sub-chap.diff0000644000175000017500000005557410446314257023610 0ustar aurelaureldiff -r 13cd417bfd4a libmenu/Makefile --- a/libmenu/Makefile Sun Apr 30 16:54:39 2006 +0200 +++ b/libmenu/Makefile Sun Apr 30 16:54:39 2006 +0200 @@ -9,6 +9,9 @@ SRCS= menu.c \ menu_pt.c \ menu_list.c \ menu_filesel.c \ + menu_audiosel.c \ + menu_subsel.c \ + menu_chapsel.c \ menu_txt.c \ menu_console.c \ menu_param.c \ diff -r 13cd417bfd4a libmenu/menu.c --- a/libmenu/menu.c Sun Apr 30 16:54:39 2006 +0200 +++ b/libmenu/menu.c Sun Apr 30 16:54:39 2006 +0200 @@ -27,6 +27,9 @@ extern menu_info_t menu_info_cmdlist; extern menu_info_t menu_info_cmdlist; extern menu_info_t menu_info_pt; extern menu_info_t menu_info_filesel; +extern menu_info_t menu_info_audiosel; +extern menu_info_t menu_info_subsel; +extern menu_info_t menu_info_chapsel; extern menu_info_t menu_info_txt; extern menu_info_t menu_info_console; extern menu_info_t menu_info_pref; @@ -39,6 +42,9 @@ menu_info_t* menu_info_list[] = { &menu_info_pt, &menu_info_cmdlist, &menu_info_filesel, + &menu_info_audiosel, + &menu_info_subsel, + &menu_info_chapsel, &menu_info_txt, &menu_info_console, #ifdef HAS_DVBIN_SUPPORT diff -r 13cd417bfd4a libmpdemux/demux_mkv.c --- a/libmpdemux/demux_mkv.c Sun Apr 30 16:54:39 2006 +0200 +++ b/libmpdemux/demux_mkv.c Sun Apr 30 16:54:39 2006 +0200 @@ -255,6 +255,11 @@ typedef struct __attribute__((__packed__ uint32_t fourcc3; /* fourcc */ } real_audio_v5_props_t; +int mkv_subtitles[64]; +int mkv_subtitles_num; +uint64_t mkv_chapter_start[99]; +int mkv_chapter_num; +char* mkv_chapter_string[99]; /* for e.g. "-slang ger" */ extern char *dvdsub_lang; @@ -1366,6 +1371,35 @@ demux_mkv_read_chapters (demuxer_t *demu end = ebml_read_uint (s, &l) / 1000000; break; + case MATROSKA_ID_CHAPTERDISPLAY: + { + uint64_t len; + int i; + + len = ebml_read_length (s, &i); + l = len + i; + + while (len > 0) + { + uint64_t l; + int il; + + switch (ebml_read_id (s, &il)) + { + case MATROSKA_ID_CHAPTERSTRING: + mkv_chapter_string[mkv_chapter_num] + = ebml_read_utf8 (s, &l); + break; + + default: + ebml_read_skip (s, &l); + break; + } + len -= l + il; + } + break; + } + default: ebml_read_skip (s, &l); break; @@ -1387,6 +1421,8 @@ demux_mkv_read_chapters (demuxer_t *demu (int) ((end / 60 / 1000) % 60), (int) ((end / 1000) % 60), (int) (end % 1000)); + mkv_chapter_num = mkv_d->num_chapters; + mkv_chapter_start[mkv_chapter_num] = start; break; } @@ -2339,13 +2375,23 @@ demux_mkv_open (demuxer_t *demuxer) track = demux_mkv_find_track_by_num (mkv_d, demuxer->audio->id, MATROSKA_TRACK_AUDIO); - if (track && !demux_mkv_open_audio (demuxer, track)) + if (track) + { + for (i=0; i < mkv_d->num_tracks; i++) + if (mkv_d->tracks[i]->type == MATROSKA_TRACK_AUDIO) + { + int def = (mkv_d->tracks[i] == track); + if (demux_mkv_open_audio (demuxer, mkv_d->tracks[i]) && def) + demuxer->audio->id = -2; + else if (def) { mp_msg (MSGT_DEMUX, MSGL_INFO, "[mkv] Will play audio track %u\n", track->tnum); demuxer->audio->id = track->tnum; demuxer->audio->sh = demuxer->a_streams[track->tnum]; } + } + } else { mp_msg (MSGT_DEMUX, MSGL_INFO, "[mkv] No audio track found/wanted.\n"); @@ -2363,6 +2409,10 @@ demux_mkv_open (demuxer_t *demuxer) track = demux_mkv_find_track_by_language (mkv_d, dvdsub_lang, MATROSKA_TRACK_SUBTITLE); + mkv_subtitles_num = 0; + for (i=0; i < mkv_d->num_tracks; i++) + if (mkv_d->tracks[i]->type == MATROSKA_TRACK_SUBTITLE) + mkv_subtitles[mkv_subtitles_num++] = mkv_d->tracks[i]->tnum; if (track && !demux_mkv_open_sub (demuxer, track)) { mp_msg (MSGT_DEMUX, MSGL_INFO, @@ -2416,6 +2466,7 @@ demux_close_mkv (demuxer_t *demuxer) { mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; + mkv_subtitles_num = 0; if (mkv_d) { int i; diff -r 13cd417bfd4a libmpdemux/demux_ogg.c --- a/libmpdemux/demux_ogg.c Sun Apr 30 16:54:39 2006 +0200 +++ b/libmpdemux/demux_ogg.c Sun Apr 30 16:54:39 2006 +0200 @@ -170,6 +170,9 @@ extern subtitle* vo_sub; extern subtitle* vo_sub; static float clear_sub; //FILE* subout; +int ogg_subtitles[64]; +int ogg_subtitles_num=0; + static uint16_t get_uint16 (const void *buf) @@ -854,6 +857,7 @@ int demux_ogg_open(demuxer_t* demuxer) { clear_sub = -1; s = demuxer->stream; + ogg_subtitles_num = 0; demuxer->priv = ogg_d = (ogg_demuxer_t*)calloc(1,sizeof(ogg_demuxer_t)); @@ -1125,6 +1129,7 @@ int demux_ogg_open(demuxer_t* demuxer) { /// Check for text (subtitles) header } else if (strncmp(st->streamtype, "text", 4) == 0) { mp_msg(MSGT_DEMUX, MSGL_INFO, "[Ogg] stream %d: subtitles (SRT-like text subtitles), -sid %d\n", ogg_d->num_sub, ogg_d->n_text); + ogg_subtitles[ogg_subtitles_num++] = ogg_d->num_sub; ogg_d->subs[ogg_d->num_sub].samplerate= get_uint64(&st->time_unit)/10; ogg_d->subs[ogg_d->num_sub].text = 1; mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", ogg_d->n_text); @@ -1589,6 +1594,8 @@ static void demux_close_ogg(demuxer_t* d ogg_demuxer_t* ogg_d = demuxer->priv; int i; + ogg_subtitles_num = 0; + if(!ogg_d) return; diff -r 13cd417bfd4a libmpdemux/demuxer.h --- a/libmpdemux/demuxer.h Sun Apr 30 16:54:39 2006 +0200 +++ b/libmpdemux/demuxer.h Sun Apr 30 16:54:39 2006 +0200 @@ -315,6 +315,14 @@ extern int pts_from_bps; extern int extension_parsing; +extern int ogg_subtitles[]; +extern int ogg_subtitles_num; +extern int mkv_subtitles[]; +extern int mkv_subtitles_num; +extern int mkv_chapter_num; +extern uint64_t mkv_chapter_start[99]; +extern char* mkv_chapter_string[99]; + int demux_info_add(demuxer_t *demuxer, char *opt, char *param); char* demux_info_get(demuxer_t *demuxer, char *opt); int demux_info_print(demuxer_t *demuxer); diff -r 13cd417bfd4a libmpdemux/ebml.h --- a/libmpdemux/ebml.h Sun Apr 30 16:54:39 2006 +0200 +++ b/libmpdemux/ebml.h Sun Apr 30 16:54:39 2006 +0200 @@ -128,6 +128,8 @@ #define MATROSKA_ID_CHAPTERATOM 0xB6 #define MATROSKA_ID_CHAPTERTIMESTART 0x91 #define MATROSKA_ID_CHAPTERTIMEEND 0x92 +#define MATROSKA_ID_CHAPTERDISPLAY 0x80 +#define MATROSKA_ID_CHAPTERSTRING 0x85 /* IDs in the cluster master */ #define MATROSKA_ID_CLUSTERTIMECODE 0xE7 diff -r 13cd417bfd4a libmpdemux/stream.h --- a/libmpdemux/stream.h Sun Apr 30 16:54:39 2006 +0200 +++ b/libmpdemux/stream.h Sun Apr 30 16:54:39 2006 +0200 @@ -287,6 +287,8 @@ extern int dvd_title; extern int dvd_title; extern int dvd_chapter; extern int dvd_last_chapter; +extern int dvd_total_chapter; +extern int dvd_chapter_pos[99]; extern int dvd_angle; //#endif diff -r 13cd417bfd4a libmpdemux/stream_dvd.c --- a/libmpdemux/stream_dvd.c Sun Apr 30 16:54:39 2006 +0200 +++ b/libmpdemux/stream_dvd.c Sun Apr 30 16:54:39 2006 +0200 @@ -31,6 +31,8 @@ extern int dvd_last_chapter; extern int dvd_last_chapter; extern char* dvd_device; int dvd_angle=1; +int dvd_total_chapter=0; +int dvd_chapter_pos[99]; #ifdef HAVE_DVD #ifdef USE_DVDREAD @@ -275,6 +277,19 @@ int dvd_lang_from_sid(stream_t *stream, if (!d) return 0; if (id >= d->nr_of_subtitles) return 0; return d->subtitles[id].language; +} + +char *dvd_lang_from_aid(stream_t *stream, int aid){ +static char desc[32]; +dvd_priv_t *d=stream->priv; +int i; + for(i=0;inr_of_channels;i++){ + if(d->audio_streams[i].id==aid){ + sprintf (desc, "%c%c - %s (%s)", (d->audio_streams[i].language>>8)&0xFF, d->audio_streams[i].language&0xFF, dvd_audio_stream_types[d->audio_streams[i].type], dvd_audio_stream_channels[d->audio_streams[i].channels]); + return desc; + } + } + return NULL; } int dvd_sid_from_lang(stream_t *stream, unsigned char* lang) { @@ -721,6 +736,7 @@ static int open_s(stream_t *stream,int m * Make sure the chapter number is valid for this title. */ mp_msg(MSGT_OPEN,MSGL_INFO, MSGTR_DVDnumChapters, tt_srpt->title[dvd_title].nr_of_ptts); + dvd_total_chapter = tt_srpt->title[dvd_title].nr_of_ptts; if(dvd_chapter<1 || dvd_chapter>tt_srpt->title[dvd_title].nr_of_ptts) { mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDinvalidChapter, dvd_chapter); ifoClose( vmg_file ); @@ -926,6 +942,12 @@ static int open_s(stream_t *stream,int m d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector; mp_msg(MSGT_DVD,MSGL_V, "DVD start cell: %d pack: 0x%X-0x%X \n",d->cur_cell,d->cur_pack,d->cell_last_pack); + { + int chap; + for (chap = 0; chap < dvd_total_chapter; chap++) + dvd_chapter_pos[chap+1] = d->cur_pgc->cell_playback[chap].first_sector; + } + // ... (unimplemented) // return NULL; stream->type = STREAMTYPE_DVD; diff -r 13cd417bfd4a mplayer.c --- a/mplayer.c Sun Apr 30 16:54:39 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:39 2006 +0200 @@ -360,8 +360,8 @@ extern int mp_msg_levels[MSGT_MAX]; extern int mp_msg_levels[MSGT_MAX]; extern int mp_msg_level_all; -static stream_t* stream=NULL; -static demuxer_t *demuxer=NULL; +stream_t* stream=NULL; +demuxer_t *demuxer=NULL; static sh_audio_t *sh_audio=NULL; static sh_video_t *sh_video=NULL; static demux_stream_t *d_audio=NULL; @@ -3266,8 +3266,7 @@ demux_info_print(demuxer); //================== Read SUBTITLES (DVD & TEXT) ========================== if(vo_spudec==NULL && sh_video && - (stream->type==STREAMTYPE_DVD || demuxer->type==DEMUXER_TYPE_MATROSKA || - d_dvdsub->id >= 0)){ + (stream->type==STREAMTYPE_DVD || demuxer->type==DEMUXER_TYPE_MATROSKA)){ if (spudec_ifo) { unsigned int palette[16], width, height; diff -r 13cd417bfd4a mplayer.h --- a/mplayer.h Sun Apr 30 16:54:39 2006 +0200 +++ b/mplayer.h Sun Apr 30 16:54:39 2006 +0200 @@ -36,6 +36,9 @@ extern int sub_unicode; extern int sub_unicode; extern char * sub_cp; extern sub_data* subdata; //currently used subtitles +extern sub_data* set_of_subtitles[MAX_SUBTITLE_FILES]; +extern int set_of_sub_size; +extern int set_of_sub_pos; extern subtitle* vo_sub; extern int suboverlap_enabled; diff -r 13cd417bfd4a libmenu/menu_audiosel.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libmenu/menu_audiosel.c Sun Apr 30 16:54:39 2006 +0200 @@ -0,0 +1,133 @@ + +#include +#include +#include + +#include "config.h" + +#include "m_struct.h" +#include "m_option.h" +#include "input/input.h" + +#include "libmpdemux/stream.h" +#include "libmpdemux/demuxer.h" + +#include "img_format.h" +#include "mp_image.h" + +#include "menu.h" +#include "menu_list.h" + + +struct list_entry_s { + struct list_entry p; + int aid; +}; + +struct menu_priv_s { + menu_list_priv_t p; + char* title; + int auto_close; +}; + +static struct menu_priv_s cfg_dflt = { + MENU_LIST_PRIV_DFLT, + "Select audio channel", + 0 +}; + +#define ST_OFF(m) M_ST_OFF(struct menu_priv_s,m) + +static m_option_t cfg_fields[] = { + MENU_LIST_PRIV_FIELDS, + { "title", ST_OFF(title), CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "auto-close", ST_OFF(auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL }, + { NULL, NULL, NULL, 0,0,0,NULL } +}; + + +extern stream_t* stream; +extern demuxer_t *demuxer; +extern void resync_audio_stream(void *sh_audio); +extern char *dvd_lang_from_aid(stream_t *stream, int aid); + +static int fill_menu(menu_t* menu) { + char *str, aid_str[32]; + list_entry_t* e; + int aid; + + if (!demuxer || !demuxer->audio || !demuxer->audio->sh){ + menu_list_read_cmd(menu,MENU_CMD_CANCEL); + return 1; + } + + menu_list_init(menu); + + for (aid=0; aida_streams[aid]){ + if (stream->type == STREAMTYPE_DVD){ + if (!(str = dvd_lang_from_aid(stream, aid))) + continue; + strcpy (aid_str, str); + } else + sprintf(aid_str, "%d", aid); + if((e = calloc(1,sizeof(list_entry_t))) != NULL){ + e->p.next = NULL; + e->p.txt = strdup(aid_str); + e->aid = aid; + menu_list_add_entry(menu,e); + } + } + + return 1; +} + +static void read_cmd(menu_t* menu,int cmd) { + int aid; + + switch(cmd) { + case MENU_CMD_RIGHT: + case MENU_CMD_OK: + aid = menu->priv->p.current->aid; + if (demuxer->audio->id != aid){ + demuxer->audio->id = aid; + if(demuxer->audio->sh) + resync_audio_stream(demuxer->audio->sh); + } + if(menu->priv->auto_close) + mp_input_queue_cmd(mp_input_parse_cmd("menu hide")); + break; + default: + menu_list_read_cmd(menu,cmd); + } +} + +static void close_as(menu_t* menu) { + menu_list_uninit(menu,NULL); +} + +static int open_as(menu_t* menu, char* args) { + args = NULL; + + menu->draw = menu_list_draw; + menu->read_cmd = read_cmd; + menu->read_key = menu_dflt_read_key; + menu->close = close_as; + menu->priv->p.title = menu->priv->title; + + return fill_menu(menu); +} + +const menu_info_t menu_info_audiosel = { + "Audio selector menu", + "audiosel", + "aurel.j", + "", + { + "audiosel_cfg", + sizeof(struct menu_priv_s), + &cfg_dflt, + cfg_fields + }, + open_as +}; diff -r 13cd417bfd4a libmenu/menu_chapsel.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libmenu/menu_chapsel.c Sun Apr 30 16:54:39 2006 +0200 @@ -0,0 +1,167 @@ + +#include +#include +#include + +#include "config.h" + +#include "m_struct.h" +#include "m_option.h" +#include "input/input.h" + +#include "libmpdemux/stream.h" +#include "libmpdemux/demuxer.h" +#include "libvo/video_out.h" +#include "libvo/sub.h" +#include "spudec.h" +#include "mplayer.h" + +#include "img_format.h" +#include "mp_image.h" + +#include "menu.h" +#include "menu_list.h" + +struct list_entry_s { + struct list_entry p; + int cid; +}; + +struct menu_priv_s { + menu_list_priv_t p; + char* title; + int auto_close; +}; + +static struct menu_priv_s cfg_dflt = { + MENU_LIST_PRIV_DFLT, + "Select chapter", + 0 +}; + +#define ST_OFF(m) M_ST_OFF(struct menu_priv_s,m) + +static m_option_t cfg_fields[] = { + MENU_LIST_PRIV_FIELDS, + { "title", ST_OFF (title), CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "auto-close", ST_OFF (auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL }, + { NULL, NULL, NULL, 0, 0, 0, NULL } +}; + +extern stream_t* stream; +extern demuxer_t *demuxer; + +static int +fill_menu (menu_t* menu) +{ + list_entry_t* e; + int cid; + + if ((demuxer && stream->type == STREAMTYPE_DVD) + || (demuxer && demuxer->type == DEMUXER_TYPE_MATROSKA + && mkv_chapter_num > 0)) + { + menu_list_init (menu); + + if (stream->type == STREAMTYPE_DVD) + { + for (cid = 1; cid < dvd_total_chapter + 1; cid++) + { + char *chap = malloc (3 * sizeof (char)); + if ((e = calloc (1, sizeof (list_entry_t))) != NULL) + { + sprintf (chap, "%d", cid); + e->p.next = NULL; + e->p.txt = strdup (chap); + e->cid = cid; + menu_list_add_entry (menu, e); + } + free (chap); + } + } + else if (demuxer->type == DEMUXER_TYPE_MATROSKA) + { + for (cid = 0; cid < mkv_chapter_num + 0; cid++) + { + if ((e = calloc (1, sizeof (list_entry_t))) != NULL) + { + e->p.next = NULL; + if (mkv_chapter_string[cid]) + e->p.txt = strdup (mkv_chapter_string[cid]); + else + { + e->p.txt = malloc (4); + sprintf (e->p.txt, "%-3d", cid+1); + } + e->cid = cid + 1; + menu_list_add_entry (menu, e); + } + } + } + } + else + menu_list_read_cmd (menu, MENU_CMD_CANCEL); + + return 1; +} + +static void +read_cmd (menu_t* menu, int cmd) +{ + switch (cmd) + { + case MENU_CMD_RIGHT: + case MENU_CMD_OK: + if (stream->type == STREAMTYPE_DVD) + { + stream_seek (stream, + (off_t) dvd_chapter_pos[menu->priv->p.current->cid] + * 2048); + } + else if (demuxer->type == DEMUXER_TYPE_MATROSKA) + { + demux_seek(demuxer, + mkv_chapter_start[menu->priv->p.current->cid]/1000.0,0,1); + } + + if (menu->priv->auto_close) + mp_input_queue_cmd (mp_input_parse_cmd ("menu hide")); + break; + default: + menu_list_read_cmd (menu, cmd); + } +} + +static void +close_cs (menu_t* menu) +{ + menu_list_uninit (menu, NULL); +} + +static int +open_cs (menu_t* menu, char* args) +{ + args = NULL; + + menu->draw = menu_list_draw; + menu->read_cmd = read_cmd; + menu->read_key = menu_dflt_read_key; + menu->close = close_cs; + menu->priv->p.title = menu->priv->title; + + return fill_menu (menu); +} + +const menu_info_t menu_info_chapsel = { + "Chapter selector menu", + "chapsel", + "Benjamin Zores", + "", + { + "chapsel_cfg", + sizeof(struct menu_priv_s), + &cfg_dflt, + cfg_fields + }, + open_cs +}; diff -r 13cd417bfd4a libmenu/menu_subsel.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libmenu/menu_subsel.c Sun Apr 30 16:54:39 2006 +0200 @@ -0,0 +1,179 @@ + +#include +#include +#include + +#include "config.h" + +#include "m_struct.h" +#include "m_option.h" +#include "input/input.h" + +#include "libmpdemux/stream.h" +#include "libmpdemux/demuxer.h" +#include "libvo/video_out.h" +#include "libvo/sub.h" +#include "spudec.h" +#include "mplayer.h" + +#include "img_format.h" +#include "mp_image.h" + +#include "menu.h" +#include "menu_list.h" + + +struct list_entry_s { + struct list_entry p; + int sid; +}; + +struct menu_priv_s { + menu_list_priv_t p; + char* title; + int auto_close; +}; + +static struct menu_priv_s cfg_dflt = { + MENU_LIST_PRIV_DFLT, + "Select subtitle", + 0 +}; + +#define ST_OFF(m) M_ST_OFF(struct menu_priv_s,m) + +static m_option_t cfg_fields[] = { + MENU_LIST_PRIV_FIELDS, + { "title", ST_OFF(title), CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "auto-close", ST_OFF(auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL }, + { NULL, NULL, NULL, 0,0,0,NULL } +}; + + +extern stream_t* stream; +extern demuxer_t *demuxer; + +static int fill_menu(menu_t* menu) { + list_entry_t* e; + char txt[3]; + int lang, sid=0, inc; + + if ((demuxer && demuxer->sub && stream->type == STREAMTYPE_DVD) + || (demuxer && demuxer->type == DEMUXER_TYPE_OGG && ogg_subtitles_num>0) + || (demuxer&&demuxer->type == DEMUXER_TYPE_MATROSKA&&mkv_subtitles_num>0) + || set_of_sub_size > 0){ + menu_list_init(menu); + + if(stream->type == STREAMTYPE_DVD){ + while((lang = dvd_lang_from_sid(stream, sid))) + if((e = calloc(1,sizeof(list_entry_t))) != NULL){ + txt[0] = lang>>8; + txt[1] = lang; + txt[2] = 0; + e->p.txt = strdup(txt); + e->p.next = NULL; + e->sid = sid++; + menu_list_add_entry(menu,e); + } + } else { + if(demuxer->type == DEMUXER_TYPE_OGG) + for(sid=0; sidp.txt = strdup(txt); + e->p.next = NULL; + e->sid = sid; + menu_list_add_entry(menu,e); + } + } + else if(demuxer->type == DEMUXER_TYPE_MATROSKA) + for(sid=0; sidp.txt = strdup(txt); + e->p.next = NULL; + e->sid = sid; + menu_list_add_entry(menu,e); + } + } + inc = sid; + sid = 0; + while(sid < set_of_sub_size) + if((e = calloc(1,sizeof(list_entry_t))) != NULL){ + e->p.txt = strrchr(set_of_subtitles[sid]->filename, '/'); + if(e->p.txt == NULL) e->p.txt = set_of_subtitles[sid]->filename; + else e->p.txt++; + e->p.next = NULL; + e->sid = inc + sid++; + menu_list_add_entry(menu,e); + } + } + } else { + menu_list_read_cmd(menu,MENU_CMD_CANCEL); + } + + return 1; +} + +static void read_cmd(menu_t* menu,int cmd) { + int sid; + + switch(cmd) { + case MENU_CMD_RIGHT: + case MENU_CMD_OK: + sid = menu->priv->p.current->sid; + if(stream->type == STREAMTYPE_DVD && demuxer->sub->id != sid){ + demuxer->sub->id = sid; + if(vo_spudec) + spudec_reset(vo_spudec); + } else if(demuxer->type == DEMUXER_TYPE_OGG && sid < ogg_subtitles_num) { + demuxer->sub->id = ogg_subtitles[sid]; + } else if(demuxer->type==DEMUXER_TYPE_MATROSKA && sidsub->id = mkv_subtitles[sid]; + } else { + if (demuxer->type == DEMUXER_TYPE_OGG) + sid -= ogg_subtitles_num; + else if (demuxer->type == DEMUXER_TYPE_MATROSKA) + sid -= mkv_subtitles_num; + set_of_sub_pos = sid; + subdata = set_of_subtitles[set_of_sub_pos]; + vo_sub = NULL; + vo_osd_changed(OSDTYPE_SUBTITLE); + } + if(menu->priv->auto_close) + mp_input_queue_cmd(mp_input_parse_cmd("menu hide")); + break; + default: + menu_list_read_cmd(menu,cmd); + } +} + +static void close_ss(menu_t* menu) { + menu_list_uninit(menu,NULL); +} + +static int open_ss(menu_t* menu, char* args) { + args = NULL; + + menu->draw = menu_list_draw; + menu->read_cmd = read_cmd; + menu->read_key = menu_dflt_read_key; + menu->close = close_ss; + menu->priv->p.title = menu->priv->title; + + return fill_menu(menu); +} + +const menu_info_t menu_info_subsel = { + "Subtitle selector menu", + "subsel", + "aurel.j", + "", + { + "subsel_cfg", + sizeof(struct menu_priv_s), + &cfg_dflt, + cfg_fields + }, + open_ss +}; geexbox-1.0/packages/MPlayer/patches/520_menu-actions.diff0000644000175000017500000000457210446314257022433 0ustar aurelaureldiff -r 82f2cdd589df libmenu/menu.h --- a/libmenu/menu.h Sun Apr 30 17:23:48 2006 +0200 +++ b/libmenu/menu.h Sun Apr 30 17:28:22 2006 +0200 @@ -33,6 +33,7 @@ typedef struct menu_info_s { #define MENU_CMD_CANCEL 3 #define MENU_CMD_LEFT 4 #define MENU_CMD_RIGHT 5 +#define MENU_CMD_ACTION 6 /// Global init/uninit int menu_init(char* cfg_file); diff -r 82f2cdd589df libmenu/menu_filesel.c --- a/libmenu/menu_filesel.c Sun Apr 30 17:23:48 2006 +0200 +++ b/libmenu/menu_filesel.c Sun Apr 30 17:28:22 2006 +0200 @@ -40,6 +40,7 @@ struct menu_priv_s { char* file_action; char* dir_action; int auto_close; + char** actions; }; static struct menu_priv_s cfg_dflt = { @@ -50,7 +51,8 @@ static struct menu_priv_s cfg_dflt = { "Select a file: %p", "loadfile '%p'", NULL, - 0 + 0, + NULL }; #define ST_OFF(m) M_ST_OFF(struct menu_priv_s,m) @@ -62,6 +64,7 @@ static m_option_t cfg_fields[] = { { "file-action", ST_OFF(file_action), CONF_TYPE_STRING, 0, 0, 0, NULL }, { "dir-action", ST_OFF(dir_action), CONF_TYPE_STRING, 0, 0, 0, NULL }, { "auto-close", ST_OFF(auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL }, + { "actions", ST_OFF(actions), CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, { NULL, NULL, NULL, 0,0,0,NULL } }; @@ -204,6 +207,8 @@ bailout: return 1; } + +static char *action; static void read_cmd(menu_t* menu,int cmd) { mp_cmd_t* c = NULL; @@ -260,6 +265,16 @@ static void read_cmd(menu_t* menu,int cm menu->cl = 1; } } break; + case MENU_CMD_ACTION: { + int fname_len = strlen(mpriv->dir) + strlen(mpriv->p.current->p.txt) + 1; + char filename[fname_len]; + char *str; + sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt); + str = replace_path(action, filename); + mp_input_queue_cmd(mp_input_parse_cmd(str)); + if(str != action) + free(str); + } break; default: menu_list_read_cmd(menu,cmd); } @@ -268,8 +283,17 @@ static void read_key(menu_t* menu,int c) static void read_key(menu_t* menu,int c){ if(c == KEY_BS) read_cmd(menu,MENU_CMD_LEFT); - else - menu_list_read_key(menu,c,1); + else { + char **str; + for (str=mpriv->actions; str && *str; str++) + if (c == (*str)[0]) { + action = &(*str)[2]; + read_cmd(menu,MENU_CMD_ACTION); + break; + } + if (!str || !*str) + menu_list_read_key(menu,c,1); + } } static void clos(menu_t* menu) { geexbox-1.0/packages/MPlayer/patches/525_menu-cmd.diff0000644000175000017500000000654110446314257021541 0ustar aurelaureldiff -r e16f2b2827b8 input/input.c --- a/input/input.c Sun Apr 30 17:23:49 2006 +0200 +++ b/input/input.c Sun Apr 30 17:24:01 2006 +0200 @@ -885,7 +885,7 @@ mp_input_find_bind_for_key(mp_cmd_bind_t return binds[j].cmd; } -static mp_cmd_t* +mp_cmd_t* mp_input_get_cmd_from_keys(int n,int* keys, int paused) { char* cmd = NULL; mp_cmd_t* ret; diff -r e16f2b2827b8 input/input.h --- a/input/input.h Sun Apr 30 17:23:49 2006 +0200 +++ b/input/input.h Sun Apr 30 17:24:01 2006 +0200 @@ -207,6 +207,10 @@ void void mp_input_rm_key_fd(int fd); +// Convert a key list into a cmd +mp_cmd_t* +mp_input_get_cmd_from_keys(int n,int* keys, int paused); + // This function can be used to put a command in the system again. It's used by libmpdemux // when it performs a blocking operation to resend the command it received to the main // loop. diff -r e16f2b2827b8 libmenu/menu.c --- a/libmenu/menu.c Sun Apr 30 17:23:49 2006 +0200 +++ b/libmenu/menu.c Sun Apr 30 17:24:01 2006 +0200 @@ -213,6 +213,8 @@ void menu_dflt_read_key(menu_t* menu,int case JOY_BTN0: menu->read_cmd(menu,MENU_CMD_OK); break; + default: + mp_input_queue_cmd(mp_input_get_cmd_from_keys (1, &cmd, 0)); } } diff -r e16f2b2827b8 libmenu/menu_filesel.c --- a/libmenu/menu_filesel.c Sun Apr 30 17:23:49 2006 +0200 +++ b/libmenu/menu_filesel.c Sun Apr 30 17:24:01 2006 +0200 @@ -260,9 +260,9 @@ static void read_cmd(menu_t* menu,int cm free(str); } if(c) { + if(mpriv->auto_close) + mp_input_queue_cmd(mp_input_parse_cmd("menu hide")); mp_input_queue_cmd(c); - if(mpriv->auto_close) - menu->cl = 1; } } break; case MENU_CMD_ACTION: { diff -r e16f2b2827b8 libmenu/vf_menu.c --- a/libmenu/vf_menu.c Sun Apr 30 17:23:49 2006 +0200 +++ b/libmenu/vf_menu.c Sun Apr 30 17:24:01 2006 +0200 @@ -163,12 +163,12 @@ static void key_cb(int code) { inline static void copy_mpi(mp_image_t *dmpi, mp_image_t *mpi) { if(mpi->flags&MP_IMGFLAG_PLANAR){ + memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->chroma_width, mpi->chroma_height, + dmpi->stride[2],mpi->stride[2]); + memcpy_pic(dmpi->planes[1],mpi->planes[1], mpi->chroma_width, mpi->chroma_height, + dmpi->stride[1],mpi->stride[1]); memcpy_pic(dmpi->planes[0],mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0],mpi->stride[0]); - memcpy_pic(dmpi->planes[1],mpi->planes[1], mpi->chroma_width, mpi->chroma_height, - dmpi->stride[1],mpi->stride[1]); - memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->chroma_width, mpi->chroma_height, - dmpi->stride[2],mpi->stride[2]); } else { memcpy_pic(dmpi->planes[0],mpi->planes[0], mpi->w*(dmpi->bpp/8), mpi->h, @@ -188,15 +188,14 @@ static int put_image(struct vf_instance_ return vf_next_put_image(vf,dmpi, pts); } - if(vf->priv->current->show - || (vf->priv->current->parent && vf->priv->current->parent->show)) { // Close all menu who requested it - while(vf->priv->current->cl && vf->priv->current != vf->priv->root) { + while(vf->priv->current != vf->priv->root && vf->priv->current->cl) { menu_t* m = vf->priv->current; vf->priv->current = m->parent ? m->parent : vf->priv->root; menu_close(m); } + if(vf->priv->current->show) { // Step 1 : save the picture while(go2pause == 1) { static char delay = 0; // Hack : wait the 2 frame to be sure to show the right picture geexbox-1.0/packages/MPlayer/patches/530_menu-filefilter.diff0000644000175000017500000001201310446314257023106 0ustar aurelaureldiff -r a9cc48325bc5 input/input.c --- a/input/input.c Sun Apr 30 16:54:40 2006 +0200 +++ b/input/input.c Sun Apr 30 16:54:40 2006 +0200 @@ -115,6 +115,7 @@ static mp_cmd_t mp_cmds[] = { { MP_CMD_SWITCH_RATIO, "switch_ratio", 0, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } }, { MP_CMD_VO_FULLSCREEN, "vo_fullscreen", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, { MP_CMD_VO_ONTOP, "vo_ontop", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, + { MP_CMD_FILE_FILTER, "file_filter", 1, { { MP_CMD_ARG_INT, {0}}, {-1,{0}}}}, { MP_CMD_VO_ROOTWIN, "vo_rootwin", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, { MP_CMD_VO_BORDER, "vo_border", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, { MP_CMD_RECORD, "record", 0, { {-1,{0}} } }, diff -r a9cc48325bc5 input/input.h --- a/input/input.h Sun Apr 30 16:54:40 2006 +0200 +++ b/input/input.h Sun Apr 30 16:54:40 2006 +0200 @@ -70,6 +70,7 @@ #define MP_CMD_SET_PROPERTY 68 #define MP_CMD_GET_PROPERTY 69 #define MP_CMD_OSD_SHOW_PROPERTY_TEXT 70 +#define MP_CMD_FILE_FILTER 71 #define MP_CMD_VCD_PLAY 80 #define MP_CMD_DVD_PLAY 81 diff -r a9cc48325bc5 libmenu/menu_filesel.c --- a/libmenu/menu_filesel.c Sun Apr 30 16:54:40 2006 +0200 +++ b/libmenu/menu_filesel.c Sun Apr 30 16:54:40 2006 +0200 @@ -41,6 +41,7 @@ struct menu_priv_s { char* dir_action; int auto_close; char** actions; + char* filter; }; static struct menu_priv_s cfg_dflt = { @@ -52,6 +53,7 @@ static struct menu_priv_s cfg_dflt = { "loadfile '%p'", NULL, 0, + NULL, NULL }; @@ -65,6 +67,7 @@ static m_option_t cfg_fields[] = { { "dir-action", ST_OFF(dir_action), CONF_TYPE_STRING, 0, 0, 0, NULL }, { "auto-close", ST_OFF(auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL }, { "actions", ST_OFF(actions), CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + { "filter", ST_OFF(filter), CONF_TYPE_STRING, 0, 0, 0, NULL}, { NULL, NULL, NULL, 0,0,0,NULL } }; @@ -126,6 +129,58 @@ static int compare(char **a, char **b){ } } +char ** +get_extensions (menu_t *menu) +{ + char **extensions, ext[32]; + FILE *fp; + int n = 1; + + if (mpriv->filter == NULL) + return NULL; + + fp = fopen (mpriv->filter, "r"); + if (fp == NULL) + return NULL; + + extensions = (char **) malloc (sizeof (*extensions)); + *extensions = NULL; + + while (fgets (ext, sizeof (ext), fp)) + { + char **l, *e; + int s = strlen (ext); + + if (ext[s-1] == '\n') + { + ext[s-1] = '\0'; + s--; + } + e = (char *) malloc (s + 1); + extensions = (char **) realloc (extensions, ++n * sizeof (*extensions)); + extensions = (char **) realloc (extensions, ++n * sizeof (*extensions)); + strcpy (e, ext); + for (l=extensions; *l; l++); + *l++ = e; + *l = NULL; + } + + fclose (fp); + return extensions; +} + +void +free_extensions (char **extensions) +{ + if (extensions != NULL) + { + char **l = extensions; + while (*l) + free (*l++); + free (extensions); + } +} + static int open_dir(menu_t* menu,char* args) { char **namelist, **tp; struct dirent *dp; @@ -134,6 +189,8 @@ static int open_dir(menu_t* menu,char* a char* p = NULL; list_entry_t* e; DIR* dirp; + extern int file_filter; + char **extensions, **elem, *ext; menu_list_init(menu); @@ -152,11 +209,26 @@ static int open_dir(menu_t* menu,char* a } namelist = (char **) malloc(sizeof(char *)); + extensions = get_extensions (menu); n=0; while ((dp = readdir(dirp)) != NULL) { if(dp->d_name[0] == '.' && strcmp(dp->d_name,"..") != 0) continue; + mylstat(args,dp->d_name,&st); + if (file_filter && extensions && !S_ISDIR(st.st_mode)) { + if((ext = strrchr(dp->d_name,'.')) == NULL) + continue; + ext++; + elem = extensions; + do { + if (!strcasecmp(ext, *elem)) + break; + } while (*++elem); + if (*elem == NULL) + continue; + } + if(n%20 == 0){ // Get some more mem if((tp = (char **) realloc(namelist, (n+20) * sizeof (char *))) == NULL) { @@ -175,13 +247,13 @@ static int open_dir(menu_t* menu,char* a } strcpy(namelist[n], dp->d_name); - mylstat(args,namelist[n],&st); if(S_ISDIR(st.st_mode)) strcat(namelist[n], "/"); n++; } bailout: + free_extensions (extensions); closedir(dirp); qsort(namelist, n, sizeof(char *), (kill_warn)compare); diff -r a9cc48325bc5 mplayer.c --- a/mplayer.c Sun Apr 30 16:54:40 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:40 2006 +0200 @@ -283,6 +283,7 @@ static char* spudec_ifo=NULL; static char* spudec_ifo=NULL; char* filename=NULL; //"MI2-Trailer.avi"; int forced_subs_only=0; +int file_filter = 1; static char* bg_video = NULL; static demuxer_t *bg_demuxer = NULL; @@ -4312,6 +4313,10 @@ if (stream->type==STREAMTYPE_DVDNAV && d cmd->pausing = 1; brk_cmd = 1; } break; + case MP_CMD_FILE_FILTER : { + file_filter = cmd->args[0].v.i; + break; + } case MP_CMD_QUIT : { exit_player_with_rc(MSGTR_Exit_quit, (cmd->nargs > 0)? cmd->args[0].v.i : 0); } geexbox-1.0/packages/MPlayer/patches/535_menu-properties.diff0000644000175000017500000002524410446314257023174 0ustar aurelaureldiff -r 84218a4f7167 libmenu/menu_param.c --- a/libmenu/menu_param.c Sun Apr 30 16:54:40 2006 +0200 +++ b/libmenu/menu_param.c Sun Apr 30 16:54:41 2006 +0200 @@ -9,6 +9,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include "mp_msg.h" #include "help_mp.h" @@ -25,6 +33,17 @@ #include "menu_list.h" #include "input/input.h" #include "osdep/keycodes.h" + +#include "codec-cfg.h" +#include "libmpdemux/stream.h" +#include "libmpdemux/demuxer.h" +#include "libmpdemux/stheader.h" + +extern char *filename; +extern sh_video_t *sh_video; +extern sh_audio_t *sh_audio; +extern demuxer_t *demuxer; +extern demuxer_t *bg_demuxer; struct list_entry_s { struct list_entry p; @@ -59,6 +77,27 @@ static m_option_t cfg_fields[] = { }; #define mpriv (menu->priv) + +#define OPT_VERSION "Version" +#define OPT_IP "IP" +#define OPT_MAC "MAC" +#define OPT_NAME "Name" + +#define OPT_VCODEC "Video Codec" +#define OPT_VBITRATE "Video Bitrate" +#define OPT_RESOLUTION "Resolution" + +#define OPT_ACODEC "Audio Codec" +#define OPT_ABITRATE "Audio Bitrate" +#define OPT_SAMPLES "Audio Samples" + +#define OPT_INFO_TITLE "Title" +#define OPT_INFO_ARTIST "Artist" +#define OPT_INFO_ALBUM "Album" +#define OPT_INFO_YEAR "Year" +#define OPT_INFO_COMMENT "Comment" +#define OPT_INFO_TRACK "Track" +#define OPT_INFO_GENRE "Genre" m_option_t* mp_property_find(char* name); @@ -86,12 +124,136 @@ static void update_entries(menu_t* menu) if(e->opt) entry_set_text(menu,e); } +static int +is_valid_video_property (char *prop) +{ + if (!prop || !sh_video) + return 0; + + if (bg_demuxer && bg_demuxer->video && bg_demuxer->video->sh + && sh_video == bg_demuxer->video->sh) + return 0; + + if (strcmp (prop, OPT_VCODEC) != 0 && + strcmp (prop, OPT_VBITRATE) != 0 && + strcmp (prop, OPT_RESOLUTION) != 0) + return 0; + + return 1; +} + +static int +is_valid_audio_property (char *prop) +{ + if (!prop || !sh_audio) + return 0; + + if (strcmp (prop, OPT_ACODEC) != 0 && + strcmp (prop, OPT_ABITRATE) != 0 && + strcmp (prop, OPT_SAMPLES) != 0) + return 0; + + return 1; +} + +static int +is_valid_info_property (char *prop) +{ + if (!prop || !demuxer) + return 0; + + if (!bg_demuxer || !bg_demuxer->video || !bg_demuxer->video->sh + || sh_video != bg_demuxer->video->sh) + return 0; + + if (strcmp (prop, OPT_INFO_TITLE) != 0 && + strcmp (prop, OPT_INFO_ARTIST) != 0 && + strcmp (prop, OPT_INFO_ALBUM) != 0 && + strcmp (prop, OPT_INFO_YEAR) != 0 && + strcmp (prop, OPT_INFO_COMMENT) != 0 && + strcmp (prop, OPT_INFO_TRACK) != 0 && + strcmp (prop, OPT_INFO_GENRE) != 0) + return 0; + + return 1; +} + +static int is_part(char *name) { + if(strncmp(name, "disk", 4)) + return 0; + name += 4; + if(*name < '0' || *name > '9') + return 0; + name++; + if(strncmp(name, "part", 4)) + return 0; + name += 4; + if(*name < '0' || *name > '9') + return 0; + return 1; +} + +static int is_cdrom(char *name) { + if(strncmp(name, "cdrom", 5)) + return 0; + name += 5; + if(*name < '0' || *name > '9') + return 0; + return 1; +} + +static char *part_size(char *part) { + static char size[32]; + char name[] = "/dev/diskNpartN"; + struct mntent *mpoint; + struct statfs buf; + FILE *mtab; + + strcpy(name+5, part); + mtab = setmntent("/proc/mounts", "r"); + while((mpoint = getmntent(mtab)) != NULL) + if(!strcmp(mpoint->mnt_fsname, name)) + { + endmntent(mtab); + if(!statfs(mpoint->mnt_dir, &buf)) + if(buf.f_bfree > 0) + sprintf(size, "%lld M / %lld M", + (buf.f_bsize * (long long)buf.f_bfree) >> 20, + (buf.f_bsize * (long long)buf.f_blocks) >> 20); + else + sprintf(size, "%lld M", (buf.f_bsize * (long long)buf.f_blocks) >> 20); + else + sprintf(size, "unknown"); + return size; + } + endmntent(mtab); + sprintf(size, "unknown"); + return size; +} + +static char * +grab_demuxer_info (char *tag) +{ + char **info = demuxer->info; + int n; + + if (!info || !tag) + return strdup (""); + + for (n = 0; info[2*n] != NULL ; n++) + if (!strcmp (info[2*n], tag)) + break; + + return info[2*n+1] ? strdup (info[2*n+1]) : strdup (""); +} + static int parse_args(menu_t* menu,char* args) { char *element,*body, **attribs, *name; list_entry_t* m = NULL; int r; m_option_t* opt; ASX_Parser_t* parser = asx_parser_new(); + char *val; while(1) { @@ -104,9 +197,11 @@ asx_parser_free(parser); if(!m) mp_msg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_NoEntryFoundInTheMenuDefinition); +/* m = calloc(1,sizeof(struct list_entry_s)); m->p.txt = strdup("Back"); menu_list_add_entry(menu,m); +*/ return 1; } if(!strcmp(element,"menu")) { @@ -125,6 +217,136 @@ static int parse_args(menu_t* menu,char* } name = asx_get_attrib("property",attribs); + val = NULL; + if(name) { + if (!strcmp (name, OPT_VERSION)) { + struct stat st; + + if (stat ("/etc/version", &st) == 0) + { + int fd; + fd = open ("/etc/version", O_RDONLY); + val = (char *) malloc (st.st_size + 1); + memset (val, '\0', st.st_size + 1); + read (fd, val, st.st_size + 1); + close (fd); + } + else + val = strdup ("#undef"); + } + else if(!strcmp(name, OPT_IP)) { + struct if_nameindex *ifs, *ifp; + struct ifreq ifr; + int fd, ip; + + fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd >= 0) { + for (ifp = ifs = if_nameindex (); ifp->if_index != 0; ifp++) { + if (strcmp (ifp->if_name, "lo") && strcmp (ifp->if_name, "sit0")) { + strcpy(ifr.ifr_name, ifp->if_name); + ifr.ifr_addr.sa_family = AF_INET; + if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) { + val = (char *) malloc (16); + ip = ((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr.s_addr; + ip = ntohl (ip); + sprintf (val, "%d.%d.%d.%d", + (ip>>24)&0xFF, (ip>>16)&0xFF, (ip>>8)&0xFF, ip&0xFF); + } else { + val = strdup("NULL"); + } + break; + } + } + if_freenameindex (ifs); + close (fd); + } + } else if (!strcmp(name, OPT_MAC)) { + struct if_nameindex *ifs, *ifp; + struct ifreq ifr; + int fd; + + fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd >= 0) { + for (ifp = ifs = if_nameindex (); ifp->if_index != 0; ifp++) { + if (strcmp (ifp->if_name, "lo") && strcmp (ifp->if_name, "sit0")) { + strcpy(ifr.ifr_name, ifp->if_name); + ifr.ifr_addr.sa_family = AF_INET; + if (ioctl(fd, SIOCGIFHWADDR, &ifr) == 0) { + val = (char *) malloc (20); + unsigned char *hwaddr = (unsigned char *)ifr.ifr_hwaddr.sa_data; + sprintf (val, "%02X:%02X:%02X:%02X:%02X:%02X", + hwaddr[0],hwaddr[1],hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5]); + } else { + val = strdup("NULL"); + } + break; + } + } + if_freenameindex (ifs); + close (fd); + } + } else if (!strcmp (name, OPT_NAME)) { + val = strdup (basename (filename)); + + } else if (!strcmp (name, OPT_VCODEC) && is_valid_video_property(name)) { + val = (char *) malloc (8); + if (sh_video->format == 0x10000001) { + sprintf (val, "mpeg1"); + } + else if (sh_video->format == 0x10000002) { + sprintf (val, "mpeg2"); + } + else if (sh_video->format == 0x10000004) { + sprintf (val, "mpeg4"); + } + else if (sh_video->format == 0x10000005) { + sprintf (val, "h264"); + } + else if (sh_video->format >= 0x20202020) { + sprintf (val, "%.4s", (char *) &sh_video->format); + } + else { + sprintf (val, "0x%08X", sh_video->format); + } + } else if (!strcmp (name, OPT_VBITRATE) && is_valid_video_property(name)) { + val = (char *) malloc (16); + sprintf (val, "%d kbps", (int) (sh_video->i_bps * 8 / 1024)); + } else if (!strcmp (name, OPT_RESOLUTION) && is_valid_video_property(name)) { + val = (char *) malloc (16); + sprintf (val, "%d x %d", sh_video->disp_w, sh_video->disp_h); + } else if (!strcmp (name, OPT_ACODEC) && is_valid_audio_property(name)) { + val = strdup (sh_audio->codec->name); + } else if (!strcmp (name, OPT_ABITRATE) && is_valid_audio_property(name)) { + val = (char *) malloc (16); + sprintf (val, "%d kbps", (int) (sh_audio->i_bps * 8 / 1000)); + } else if (!strcmp (name, OPT_SAMPLES) && is_valid_audio_property(name)) { + val = (char *) malloc (16); + sprintf (val, "%d Hz, %d ch.", + sh_audio->samplerate, sh_audio->channels); + } else if ((!strcmp (name, OPT_INFO_TITLE) || + !strcmp (name, OPT_INFO_ARTIST) || + !strcmp (name, OPT_INFO_ALBUM) || + !strcmp (name, OPT_INFO_YEAR) || + !strcmp (name, OPT_INFO_COMMENT) || + !strcmp (name, OPT_INFO_TRACK) || + !strcmp (name, OPT_INFO_GENRE)) && + is_valid_info_property(name) && + strcmp(grab_demuxer_info(name), "") ) { + val = grab_demuxer_info (name); + + } else if (is_part(name) || is_cdrom(name)) { + val = strdup(part_size(name)); + } + } + if (val) { + int l = strlen(name) + 2 + strlen(val) + 1; + m = calloc(1,sizeof(struct list_entry_s)); + m->p.txt = malloc(l); + sprintf(m->p.txt,"%s: %s",name,val); + free(val); + menu_list_add_entry(menu,m); + goto next_element; + } opt = name ? mp_property_find(name) : NULL; if(!opt) { mp_msg(MSGT_OSD_MENU,MSGL_WARN,MSGTR_LIBMENU_PrefMenuEntryDefinitionsNeed,parser->line); diff -r 84218a4f7167 mplayer.c --- a/mplayer.c Sun Apr 30 16:54:40 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:41 2006 +0200 @@ -363,8 +363,8 @@ extern int mp_msg_level_all; stream_t* stream=NULL; demuxer_t *demuxer=NULL; -static sh_audio_t *sh_audio=NULL; -static sh_video_t *sh_video=NULL; +sh_audio_t *sh_audio=NULL; +sh_video_t *sh_video=NULL; static demux_stream_t *d_audio=NULL; static demux_stream_t *d_video=NULL; static demux_stream_t *d_dvdsub=NULL; geexbox-1.0/packages/MPlayer/patches/540_menu-autoupdate-properties.diff0000664000175000017500000000575110446314257025344 0ustar aurelaureldiff -r d805860eb5fa libmenu/menu.c --- a/libmenu/menu.c Sun Apr 30 16:54:41 2006 +0200 +++ b/libmenu/menu.c Sun Apr 30 16:54:41 2006 +0200 @@ -231,6 +231,7 @@ menu_t* menu_open(char *name) { return NULL; } m = calloc(1,sizeof(menu_t)); + strncpy(m->name,name,sizeof(m->name)); m->priv_st = &(menu_list[i].type->priv_st); m->priv = m_struct_copy(m->priv_st,menu_list[i].cfg); if(menu_list[i].type->open(m,menu_list[i].args)) diff -r d805860eb5fa libmenu/menu.h --- a/libmenu/menu.h Sun Apr 30 16:54:41 2006 +0200 +++ b/libmenu/menu.h Sun Apr 30 16:54:41 2006 +0200 @@ -12,6 +12,7 @@ struct menu_s { int show; // Draw it ? int cl; // Close request (user sent a close cmd or menu_t* parent; + char name[20]; }; typedef struct menu_info_s { diff -r d805860eb5fa libmenu/vf_menu.c --- a/libmenu/vf_menu.c Sun Apr 30 16:54:41 2006 +0200 +++ b/libmenu/vf_menu.c Sun Apr 30 16:54:41 2006 +0200 @@ -77,6 +77,18 @@ static mp_image_t* alloc_mpi(int w, int mpi->flags|=MP_IMGFLAG_ALLOCATED; return mpi; +} + +void menu_stream_opened(int onlyhidden, const char *menu_name) { + char cmd[30]; + if ( st_priv && ( (onlyhidden && !st_priv->current->show) || + !strncmp(menu_name,st_priv->current->name,20) ) ) { + sprintf(cmd, "set_menu %s", menu_name); + if (!st_priv->current->show && + strncmp(menu_name,st_priv->current->name,20)) + mp_input_queue_cmd(mp_input_parse_cmd("menu toggle")); + mp_input_queue_cmd(mp_input_parse_cmd(cmd)); + } } void vf_menu_pause_update(struct vf_instance_s* vf) { @@ -132,6 +144,11 @@ static int cmd_filter(mp_cmd_t* cmd, int mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_FailedToOpenMenu,menu); priv->current = l; priv->current->show = 0; + } else if ((!strcmp("recorder",menu) || !strcmp("properties",menu)) + && !strcmp(l->name,menu)) { + priv->current->show = l->show; + priv->current->parent = l->parent; + menu_close(l); } else { priv->current->show = 1; priv->current->parent = l; diff -r d805860eb5fa mplayer.c --- a/mplayer.c Sun Apr 30 16:54:41 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:41 2006 +0200 @@ -383,6 +383,7 @@ extern int vo_gamma_hue; #include "m_struct.h" #include "libmenu/menu.h" extern void vf_menu_pause_update(struct vf_instance_s* vf); +extern void menu_stream_opened(int onlyhidden, const char *menu_name); extern vf_info_t vf_info_menu; static vf_info_t* libmenu_vfs[] = { &vf_info_menu, @@ -3207,6 +3208,9 @@ while(sh_audio && !sh_video && bg_video) d_video = bg_demuxer->video; sh_video = d_video->sh; mp_msg(MSGT_DEMUXER,MSGL_INFO,"Background video should work ;)\n"); +#ifdef HAVE_MENU + menu_stream_opened(1, "properties"); +#endif break; } @@ -3511,6 +3515,11 @@ current_module="main"; // Disable the term OSD in verbose mode if(verbose) term_osd = 0; fflush(stdout); + +#ifdef HAVE_MENU +menu_stream_opened(0, "properties"); +menu_stream_opened(0, "recorder"); +#endif #ifdef HAVE_NEW_GUI if ( use_gui ) geexbox-1.0/packages/MPlayer/patches/545_menu-unicode.diff0000644000175000017500000000770510446314257022431 0ustar aurelaureldiff -r 6666480acccf cfg-mplayer.h --- a/cfg-mplayer.h Sun Apr 30 16:54:42 2006 +0200 +++ b/cfg-mplayer.h Sun Apr 30 16:54:42 2006 +0200 @@ -68,6 +68,8 @@ extern int WinID; #ifdef HAVE_MENU extern int menu_startup; +extern int menu_utf8; +extern int menu_unicode; #endif #ifdef HAVE_ZR @@ -293,6 +295,8 @@ m_option_t mplayer_opts[]={ {"menu-root", &menu_root, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, {"menu-cfg", &menu_cfg, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, {"menu-startup", &menu_startup, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"menu-utf8", &menu_utf8, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"menu-unicode", &menu_unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL}, #else {"menu", "OSD menu support was not compiled in.\n", CONF_TYPE_PRINT,0, 0, 0, NULL}, #endif diff -r 6666480acccf libmenu/menu.c --- a/libmenu/menu.c Sun Apr 30 16:54:42 2006 +0200 +++ b/libmenu/menu.c Sun Apr 30 16:54:42 2006 +0200 @@ -311,12 +311,35 @@ static inline int get_height(int c,int h return h; } -#ifdef HAVE_FREETYPE -#define render_txt(t) { char* p = t; while(*p) render_one_glyph(vo_font,*p++); } -#else -#define render_txt(t) -#endif - +int menu_utf8 = 0; +int menu_unicode = 0; + +static int get_next_char(char **txt) +{ + int c; + c = (unsigned char)*(*txt)++; + if (c >= 0x80) { + if (menu_utf8){ + if ((c & 0xe0) == 0xc0) /* 2 bytes U+00080..U+0007FF*/ + c = (c & 0x1f)<<6 | ((unsigned char)*(*txt)++ & 0x3f); + else if((c & 0xf0) == 0xe0){ /* 3 bytes U+00800..U+00FFFF*/ + c = (((c & 0x0f)<<6) | ((unsigned char)*(*txt)++ & 0x3f))<<6; + c |= ((unsigned char)*(*txt)++ & 0x3f); + } + } else if (menu_unicode) + c = (c<<8) + (unsigned char)*(*txt)++; + } + if (!c) c++; // avoid UCS 0 + return c; +} + +static void render_txt(char *txt) +{ + while (*txt) { + int c = get_next_char(&txt); + render_one_glyph(vo_font, c); + } +} void menu_draw_text(mp_image_t* mpi,char* txt, int x, int y) { draw_alpha_f draw_alpha = get_draw_alpha(mpi->imgfmt); @@ -330,7 +353,7 @@ void menu_draw_text(mp_image_t* mpi,char render_txt(txt); while (*txt) { - unsigned char c=*txt++; + int c=get_next_char(&txt); if ((font=vo_font->font[c])>=0 && (x + vo_font->width[c] <= mpi->w) && (y + vo_font->pic_a[font]->h <= mpi->h)) draw_alpha(vo_font->width[c], vo_font->pic_a[font]->h, vo_font->pic_b[font]->bmp+vo_font->start[c], @@ -420,7 +443,7 @@ void menu_draw_text_full(mp_image_t* mpi // Jump some the beginnig text if needed while(sy < ymin && *txt) { - unsigned char c=*txt++; + int c=get_next_char(&txt); if(c == '\n' || (warp && ll + vo_font->width[c] > w)) { ll = 0; sy += vo_font->height + vspace; @@ -494,7 +517,7 @@ void menu_draw_text_full(mp_image_t* mpi } while(sx < xmax && txt != line_end) { - unsigned char c = *txt++; + int c=get_next_char(&txt); font = vo_font->font[c]; if(font >= 0) { int cs = (vo_font->pic_a[font]->h - vo_font->height) / 2; @@ -522,7 +545,7 @@ int menu_text_length(char* txt) { int l = 0; render_txt(txt); while (*txt) { - unsigned char c=*txt++; + int c=get_next_char(&txt); l += vo_font->width[c]+vo_font->charspace; } return l - vo_font->charspace; @@ -534,7 +557,7 @@ void menu_text_size(char* txt,int max_wi render_txt(txt); while (*txt) { - unsigned char c=*txt++; + int c=get_next_char(&txt); if(c == '\n' || (warp && i + vo_font->width[c] >= max_width)) { if(*txt) l++; @@ -554,7 +577,7 @@ int menu_text_num_lines(char* txt, int m int l = 1, i = 0; render_txt(txt); while (*txt) { - unsigned char c=*txt++; + int c=get_next_char(&txt); if(c == '\n' || i + vo_font->width[c] > max_width) { l++; i = 0; @@ -569,7 +592,7 @@ char* menu_text_get_next_line(char* txt, int i = 0; render_txt(txt); while (*txt) { - unsigned char c=*txt; + int c=get_next_char(&txt); if(c == '\n') { txt++; break; geexbox-1.0/packages/MPlayer/patches/550_menu-chroot-mnt.diff0000644000175000017500000000117410446314257023063 0ustar aurelaureldiff -Naur MPlayer-20060429.orig/libmenu/menu_filesel.c MPlayer-20060429/libmenu/menu_filesel.c --- MPlayer-20060429.orig/libmenu/menu_filesel.c 2006-05-06 15:36:36.000000000 +0200 +++ MPlayer-20060429/libmenu/menu_filesel.c 2006-05-06 15:37:25.000000000 +0200 @@ -236,6 +236,8 @@ while ((dp = readdir(dirp)) != NULL) { if(dp->d_name[0] == '.' && strcmp(dp->d_name,"..") != 0) continue; + if (!strcmp (dp->d_name,"..") && !strcmp (mpriv->dir, "/mnt/")) + continue; mylstat(args,dp->d_name,&st); if (file_filter && extensions && !S_ISDIR(st.st_mode)) { if((ext = strrchr(dp->d_name,'.')) == NULL) geexbox-1.0/packages/MPlayer/patches/555_menu-playtree.diff0000644000175000017500000001374310446314257022630 0ustar aurelaureldiff -r cc4b9cfa9112 libmenu/menu_pt.c --- a/libmenu/menu_pt.c Sun Apr 30 16:54:41 2006 +0200 +++ b/libmenu/menu_pt.c Sun Apr 30 16:54:42 2006 +0200 @@ -33,11 +33,13 @@ struct menu_priv_s { struct menu_priv_s { menu_list_priv_t p; char* title; + int auto_close; }; static struct menu_priv_s cfg_dflt = { MENU_LIST_PRIV_DFLT, - "Jump to" + "Jump to", + 0 }; #define ST_OFF(m) M_ST_OFF(struct menu_priv_s,m) @@ -45,28 +47,78 @@ static m_option_t cfg_fields[] = { static m_option_t cfg_fields[] = { MENU_LIST_PRIV_FIELDS, { "title", ST_OFF(title), CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "auto-close", ST_OFF(auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL }, { NULL, NULL, NULL, 0,0,0,NULL } }; #define mpriv (menu->priv) +static int fill_menu(menu_t* menu) { + play_tree_t* i; + list_entry_t* e; + + menu_list_init(menu); + + mpriv->p.title = mpriv->title; + + if(playtree_iter->tree->parent) { + e = calloc(1,sizeof(list_entry_t)); + e->p.txt = ".."; + e->pt = playtree_iter->tree->parent; + menu_list_add_entry(menu,e); + } + + for(i = playtree_iter->tree ; i->prev != NULL ; i = i->prev) + /* NOP */; + for( ; i != NULL ; i = i->next ) { + e = calloc(1,sizeof(list_entry_t)); + if(i->files) { +#if defined(HAVE_VCD) || defined(HAVE_CDDA) + if (i->entry_type == PLAY_TREE_ENTRY_VCD + || !strncasecmp(i->files[0],"cdda://",7)) { + e->p.txt = (char *) malloc (10*sizeof(char)); + sprintf(e->p.txt, "Track %s", mp_basename(i->files[0])); + } + else +#endif +#ifdef USE_DVDREAD + if (i->entry_type == PLAY_TREE_ENTRY_DVD) { + e->p.txt = (char *) malloc (10*sizeof(char)); + sprintf(e->p.txt, "Title %s", mp_basename(i->files[0])); + } + else +#endif + e->p.txt = mp_basename(i->files[0]); + } + else + e->p.txt = "Initial Playlist ..."; + e->pt = i; + menu_list_add_entry(menu,e); + } + + return 1; +} + static void read_cmd(menu_t* menu,int cmd) { switch(cmd) { case MENU_CMD_RIGHT: case MENU_CMD_OK: { - int d = 1; + int d = 0; char str[15]; play_tree_t* i; mp_cmd_t* c; - if(playtree_iter->tree == mpriv->p.current->pt) - break; - - if(playtree_iter->tree->parent && mpriv->p.current->pt == playtree_iter->tree->parent) - snprintf(str,15,"pt_up_step 1"); - else { - for(i = playtree_iter->tree->next; i != NULL ; i = i->next) { + if(playtree_iter->tree->parent && mpriv->p.current->pt == playtree_iter->tree->parent){ + playtree_iter->tree = playtree_iter->tree->parent; + menu_list_uninit(menu,NULL); + fill_menu(menu); + } else if(mpriv->p.current->pt->child) { + playtree_iter->tree = mpriv->p.current->pt->child; + menu_list_uninit(menu,NULL); + fill_menu(menu); + } else { + for(i = playtree_iter->tree; i != NULL ; i = i->next) { if(i == mpriv->p.current->pt) break; d++; @@ -84,12 +136,14 @@ static void read_cmd(menu_t* menu,int cm } } snprintf(str,15,"pt_step %d",d); + c = mp_input_parse_cmd(str); + if(c) { + if(mpriv->auto_close) + mp_input_queue_cmd(mp_input_parse_cmd("menu hide")); + mp_input_queue_cmd(c); + } else + mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_FailedToBuildCommand,str); } - c = mp_input_parse_cmd(str); - if(c) - mp_input_queue_cmd(c); - else - mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_FailedToBuildCommand,str); } break; default: menu_list_read_cmd(menu,cmd); @@ -105,8 +159,6 @@ static void close(menu_t* menu) { } static int op(menu_t* menu, char* args) { - play_tree_t* i; - list_entry_t* e; args = NULL; // Warning kill menu->draw = menu_list_draw; @@ -114,30 +166,7 @@ static int op(menu_t* menu, char* args) menu->read_key = read_key; menu->close = close; - menu_list_init(menu); - - mpriv->p.title = mpriv->title; - - if(playtree_iter->tree->parent != playtree_iter->root) { - e = calloc(1,sizeof(list_entry_t)); - e->p.txt = ".."; - e->pt = playtree_iter->tree->parent; - menu_list_add_entry(menu,e); - } - - for(i = playtree_iter->tree ; i->prev != NULL ; i = i->prev) - /* NOP */; - for( ; i != NULL ; i = i->next ) { - e = calloc(1,sizeof(list_entry_t)); - if(i->files) - e->p.txt = mp_basename(i->files[0]); - else - e->p.txt = "Group ..."; - e->pt = i; - menu_list_add_entry(menu,e); - } - - return 1; + return fill_menu(menu); } const menu_info_t menu_info_pt = { diff -r cc4b9cfa9112 mplayer.c --- a/mplayer.c Sun Apr 30 16:54:41 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:42 2006 +0200 @@ -4440,7 +4440,7 @@ if (stream->type==STREAMTYPE_DVDNAV && d grab_frames=2; } break; case MP_CMD_PLAY_TREE_STEP : { - int n = cmd->args[0].v.i == 0 ? 1 : cmd->args[0].v.i; + int n = cmd->args[0].v.i; int force = cmd->args[1].v.i; #ifdef HAVE_NEW_GUI diff -r cc4b9cfa9112 playtree.c --- a/playtree.c Sun Apr 30 16:54:41 2006 +0200 +++ b/playtree.c Sun Apr 30 16:54:42 2006 +0200 @@ -252,7 +252,6 @@ play_tree_add_file(play_tree_t* pt,char* #ifdef MP_DEBUG assert(pt != NULL); - assert(pt->child == NULL); assert(file != NULL); #endif @@ -662,9 +661,6 @@ play_tree_is_valid(play_tree_t* pt) { #endif if(pt->entry_type != PLAY_TREE_ENTRY_NODE) { -#ifdef MP_DEBUG - assert(pt->child == NULL); -#endif return 1; } else if (pt->child != NULL) { @@ -724,7 +720,6 @@ play_tree_iter_down_step(play_tree_iter_ play_tree_iter_down_step(play_tree_iter_t* iter, int d,int with_nodes) { #ifdef MP_DEBUG - assert(iter->tree->files == NULL); assert(iter->tree->child != NULL); assert(iter->tree->child->parent == iter->tree); //printf("PT : Go DOWN\n"); diff -r cc4b9cfa9112 playtreeparser.c --- a/playtreeparser.c Sun Apr 30 16:54:41 2006 +0200 +++ b/playtreeparser.c Sun Apr 30 16:54:42 2006 +0200 @@ -684,6 +684,7 @@ parse_playlist_file(char* file) { free_stream(stream); play_tree_add_bpf(ret, file); + play_tree_add_file(ret,file); return ret; geexbox-1.0/packages/MPlayer/patches/560_menu-keep-dir.diff0000644000175000017500000000422310446314257022470 0ustar aurelaureldiff -r 99d87d930c49 libmenu/menu_filesel.c --- a/libmenu/menu_filesel.c Sun Apr 30 16:54:42 2006 +0200 +++ b/libmenu/menu_filesel.c Sun Apr 30 16:54:42 2006 +0200 @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -186,6 +187,7 @@ static int open_dir(menu_t* menu,char* a struct dirent *dp; struct stat st; int n; + int path_fp; char* p = NULL; list_entry_t* e; DIR* dirp; @@ -207,6 +209,13 @@ static int open_dir(menu_t* menu,char* a mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_OpendirError, strerror(errno)); return 0; } + + path_fp = open ("/var/mp_current_path", O_CREAT | O_WRONLY | O_TRUNC); + if (path_fp >= 0) + { + write (path_fp, mpriv->dir, strlen (mpriv->dir)); + close (path_fp); + } namelist = (char **) malloc(sizeof(char *)); extensions = get_extensions (menu); @@ -374,7 +383,7 @@ static void clos(menu_t* menu) { } static int open_fs(menu_t* menu, char* args) { - char *path = mpriv->path; + char *path = mpriv->path, *freepath = NULL; int r = 0; char wd[PATH_MAX+1]; args = NULL; // Warning kill @@ -383,6 +392,30 @@ static int open_fs(menu_t* menu, char* a menu->read_cmd = read_cmd; menu->read_key = read_key; menu->close = clos; + + if (!path || path[0] == '\0') { + struct stat st; + int path_fp; + + path_fp = open ("/var/mp_current_path", O_RDONLY); + if (path_fp >= 0) + { + if (!fstat(path_fp, &st) && st.st_size > 0 && (path = malloc(st.st_size+1))) + { + if (read(path_fp, path, st.st_size) == st.st_size && path[0] != '\0') + { + freepath = path; + path[st.st_size] = '\0'; + } + else + { + free(path); + path = NULL; + } + } + close (path_fp); + } + } getcwd(wd,PATH_MAX); if(!path || path[0] == '\0') { @@ -402,6 +435,9 @@ static int open_fs(menu_t* menu, char* a } else r = open_dir(menu,path); + if (freepath) + free(freepath); + return r; } geexbox-1.0/packages/MPlayer/patches/565_menu-cancel.diff0000644000175000017500000000066310446314257022226 0ustar aurelaureldiff -Naur MPlayer-20060429.orig/libmenu/menu.c MPlayer-20060429/libmenu/menu.c --- MPlayer-20060429.orig/libmenu/menu.c 2006-05-05 16:36:10.000000000 +0200 +++ MPlayer-20060429/libmenu/menu.c 2006-05-05 16:37:24.000000000 +0200 @@ -200,8 +200,6 @@ break; case KEY_LEFT: case JOY_AXIS0_MINUS: - menu->read_cmd(menu,MENU_CMD_LEFT); - break; case KEY_ESC: case JOY_BTN1: menu->read_cmd(menu,MENU_CMD_CANCEL); geexbox-1.0/packages/MPlayer/patches/570_menu-special-filename-escape.diff0000644000175000017500000000553310446314257025432 0ustar aurelaurelfixes two bugs: 1. doesn't add \ before spaces when showing dirname in interface title. 2. when replace_path() string is to be parsed by input command, I assume that the path is to be run in shell, and I do special escaping of 'into \'\\\'\' diff -r f07b83b8f199 libmenu/menu_filesel.c --- a/libmenu/menu_filesel.c Sun Apr 30 16:54:42 2006 +0200 +++ b/libmenu/menu_filesel.c Sun Apr 30 16:54:43 2006 +0200 @@ -79,7 +79,7 @@ static void free_entry(list_entry_t* ent free(entry); } -static char* replace_path(char* title , char* dir) { +static char* replace_path(char* title , char* dir , int escape) { char *p = strstr(title,"%p"); if(p) { int tl = strlen(title); @@ -89,16 +89,28 @@ static char* replace_path(char* title , char *r, *n, *d = dir; char term = *(p-1); + if (escape) { do { - if (*d == '\\' || *d == term) + if (*d == '\\') l++; + else if (*d == '\'') /* ' -> \'\\\'\' */ + l+=7; } while (*d++); + } r = malloc(l + 1); n = r + t1l; memcpy(r,title,t1l); do { - if (*dir == '\\' || *dir == term) + if (escape) { + if (*dir == '\\') *n++ = '\\'; + else if (*dir == '\'') { /* ' -> \'\\\'\' */ + *n++ = '\\'; *n++ = '\''; + *n++ = '\\'; *n++ = '\\'; + *n++ = '\\'; *n++ = '\''; + *n++ = '\\'; + } + } } while ((*n++ = *dir++)); if(tl - t1l - 2 > 0) strcpy(n-1,p+2); @@ -203,7 +215,7 @@ static int open_dir(menu_t* menu,char* a free(mpriv->p.title); p = strstr(mpriv->title,"%p"); - mpriv->p.title = replace_path(mpriv->title,mpriv->dir); + mpriv->p.title = replace_path(mpriv->title,mpriv->dir,0); if ((dirp = opendir (mpriv->dir)) == NULL){ mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_OpendirError, strerror(errno)); @@ -305,7 +317,7 @@ static void read_cmd(menu_t* menu,int cm char filename[fname_len]; char* str; sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt); - str = replace_path(mpriv->dir_action,filename); + str = replace_path(mpriv->dir_action,filename,1); c = mp_input_parse_cmd(str); if(str != mpriv->dir_action) free(str); @@ -335,7 +347,7 @@ static void read_cmd(menu_t* menu,int cm char filename[fname_len]; char *str; sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt); - str = replace_path(mpriv->file_action,filename); + str = replace_path(mpriv->file_action,filename,1); c = mp_input_parse_cmd(str); if(str != mpriv->file_action) free(str); @@ -351,7 +363,7 @@ static void read_cmd(menu_t* menu,int cm char filename[fname_len]; char *str; sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt); - str = replace_path(action, filename); + str = replace_path(action, filename, 1); mp_input_queue_cmd(mp_input_parse_cmd(str)); if(str != action) free(str); geexbox-1.0/packages/MPlayer/patches/575_streaminfo-dump.diff0000644000175000017500000001020010446314257023136 0ustar aurelaureldiff -r 90db519a2f3f mplayer.c --- a/mplayer.c Sun Apr 30 16:54:43 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:44 2006 +0200 @@ -747,6 +747,85 @@ static int libmpdemux_was_interrupted(in #define mp_basename2(s) (strrchr(s,'/')==NULL?(char*)s:(strrchr(s,'/')+1)) #define mp_basename(s) (strrchr(s,'\\')==NULL?(mp_basename2(s)):(strrchr(s,'\\')+1)) + +void dump_stream_info(demuxer_t *demuxer, char* log_filename) +{ + int fd; + FILE * log_file; + sh_video_t *sh_video = demuxer->video->sh; + sh_audio_t *sh_audio = demuxer->audio->sh; + + fd = open(log_filename, O_RDWR | O_NONBLOCK); + if(fd < 0) return; + log_file = fdopen(fd, "w"); + if(!log_file) return; + + fprintf(log_file, "ID_VIDEO_PERCENT=0\n"); + fprintf(log_file, "ID_FILENAME=%s\n", mp_basename(filename)); + fprintf(log_file, "ID_DEMUXER=%s\n", demuxer->desc->name); + + if (sh_video) { + /* Assume FOURCC if all bytes >= 0x20 (' ') */ + if (sh_video->format >= 0x20202020) + fprintf(log_file, "ID_VIDEO_FORMAT=%.4s\n", (char *)&sh_video->format); + else + fprintf(log_file, "ID_VIDEO_FORMAT=0x%08X\n", sh_video->format); + fprintf(log_file, "ID_VIDEO_BITRATE=%d\n", sh_video->i_bps*8); + fprintf(log_file, "ID_VIDEO_WIDTH=%d\n", sh_video->disp_w); + fprintf(log_file, "ID_VIDEO_HEIGHT=%d\n", sh_video->disp_h); + fprintf(log_file, "ID_VIDEO_FPS=%5.3f\n", sh_video->fps); + fprintf(log_file, "ID_VIDEO_ASPECT=%1.4f\n", sh_video->aspect); + } + if (sh_audio) { + char *info; + if ((info = demux_info_get(demuxer, "Title")) != NULL) + fprintf(log_file, "ID_AUDIO_TITLE=%s\n", info ); + if ((info = demux_info_get(demuxer, "Artist")) != NULL) + fprintf(log_file, "ID_AUDIO_ARTIST=%s\n", info ); + if ((info = demux_info_get(demuxer, "Album")) != NULL) + fprintf(log_file, "ID_AUDIO_ALBUM=%s\n", info ); + if ((info = demux_info_get(demuxer, "Year")) != NULL) + fprintf(log_file, "ID_AUDIO_YEAR=%s\n", info ); + if ((info = demux_info_get(demuxer, "Comment")) != NULL) + fprintf(log_file, "ID_AUDIO_COMMENT=%s\n", info ); + if ((info = demux_info_get(demuxer, "Track")) != NULL) + fprintf(log_file, "ID_AUDIO_TRACK=%s\n", info ); + if ((info = demux_info_get(demuxer, "Genre")) != NULL) + fprintf(log_file, "ID_AUDIO_GENRE=%s\n", info ); + if (sh_audio->codec) + fprintf(log_file, "ID_AUDIO_CODEC=%s\n", sh_audio->codec->name); + /* Assume FOURCC if all bytes >= 0x20 (' ') */ + if (sh_audio->format >= 0x20202020) + fprintf(log_file, "ID_AUDIO_FORMAT=%.4s\n", (char *)&sh_audio->format); + else + fprintf(log_file, "ID_AUDIO_FORMAT=%d\n", sh_audio->format); + fprintf(log_file, "ID_AUDIO_BITRATE=%d\n", sh_audio->i_bps*8); + fprintf(log_file, "ID_AUDIO_RATE=%d\n", sh_audio->samplerate); + fprintf(log_file, "ID_AUDIO_NCH=%d\n", sh_audio->channels); + } + fprintf(log_file, "ID_LENGTH=%.2lf\n", demuxer_get_time_length(demuxer)); + fclose(log_file); +} + +void dump_stream_position(demuxer_t *demuxer, char* log_filename) +{ + int fd, percent; + FILE * log_file; + + fd = open(log_filename, O_RDWR | O_NONBLOCK); + if(fd < 0) return; + log_file = fdopen(fd, "w"); + if(!log_file) return; + + off_t len = ( demuxer->movi_end - demuxer->movi_start ); + off_t pos = ( demuxer->file_format == DEMUXER_TYPE_AUDIO ? stream->pos : demuxer->filepos ); + percent = (len <= 0 ? 0 : ( pos - demuxer->movi_start ) * 100 / len ); + + fprintf(log_file, "ID_VIDEO_PERCENT=%i\n", percent); + fprintf(log_file, "ID_FILENAME=%s\n", mp_basename(filename)); + + fclose(log_file); +} int playtree_add_playlist(play_tree_t* entry) { @@ -3426,6 +3500,8 @@ if(sh_audio){ mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_AUDIO_NCH=%d\n", sh_audio->channels); } mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_LENGTH=%.2lf\n", demuxer_get_time_length(demuxer)); + +dump_stream_info(demuxer, "/tmp/mp_streaminfo"); if(!sh_video) goto main; // audio-only @@ -5066,6 +5142,8 @@ if (stream->type==STREAMTYPE_DVDNAV && d loop_seek = 1; } + dump_stream_position(demuxer, "/tmp/mp_streaminfo"); + if(rel_seek_secs || abs_seek_pos){ current_module="seek"; if(demux_seek(demuxer,rel_seek_secs,audio_delay,abs_seek_pos)){ geexbox-1.0/packages/MPlayer/patches/580_menu-fribidi-flip-hebrew.diff0000644000175000017500000000704410446314257024610 0ustar aurelaureldiff -r 073c0efee505 cfg-mplayer.h --- a/cfg-mplayer.h Sun Apr 30 16:54:45 2006 +0200 +++ b/cfg-mplayer.h Sun Apr 30 16:54:45 2006 +0200 @@ -70,6 +70,11 @@ extern int menu_startup; extern int menu_startup; extern int menu_utf8; extern int menu_unicode; +#ifdef USE_FRIBIDI +extern char *menu_fribidi_charset; +extern int menu_flip_hebrew; +extern int menu_fribidi_flip_commas; +#endif #endif #ifdef HAVE_ZR @@ -297,6 +302,13 @@ m_option_t mplayer_opts[]={ {"menu-startup", &menu_startup, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"menu-utf8", &menu_utf8, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"menu-unicode", &menu_unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL}, +#ifdef USE_FRIBIDI + {"menu-fribidi-charset", &menu_fribidi_charset, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"menu-flip-hebrew", &menu_flip_hebrew, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"menu-noflip-hebrew", &menu_flip_hebrew, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"menu-flip-hebrew-commas", &menu_fribidi_flip_commas, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"menu-noflip-hebrew-commas", &menu_fribidi_flip_commas, CONF_TYPE_FLAG, 0, 0, 1, NULL}, +#endif #else {"menu", "OSD menu support was not compiled in.\n", CONF_TYPE_PRINT,0, 0, 0, NULL}, #endif diff -r 073c0efee505 libmenu/menu.c --- a/libmenu/menu.c Sun Apr 30 16:54:45 2006 +0200 +++ b/libmenu/menu.c Sun Apr 30 16:54:45 2006 +0200 @@ -341,6 +341,56 @@ static void render_txt(char *txt) } } +#ifdef USE_FRIBIDI +#include +char *menu_fribidi_charset = NULL; +int menu_flip_hebrew = 0; +int menu_fribidi_flip_commas = 0; + +char *menu_fribidi(char *txt) +{ + static int char_set_num = -1; + static FriBidiChar *logical, *visual; + static size_t buffer_size = 1024; + static char *outputstr; + + FriBidiCharType base; + fribidi_boolean log2vis; + size_t len; + + if (menu_flip_hebrew) { + len = strlen(txt); + if (char_set_num == -1) { + fribidi_set_mirroring (FRIBIDI_TRUE); + fribidi_set_reorder_nsm (FRIBIDI_FALSE); + if (menu_utf8 == 0) { + char_set_num = fribidi_parse_charset(menu_fribidi_charset ? menu_fribidi_charset : "ISO8859-8"); + } else { + char_set_num = fribidi_parse_charset("UTF-8"); + } + buffer_size = 1024 > (len+1) ? 1024 : (len+1); + logical = (FriBidiChar*) malloc(buffer_size); + visual = (FriBidiChar*) malloc(buffer_size); + outputstr = (char*) malloc(buffer_size); + } else if (len+1 > buffer_size) { + buffer_size = len+1; + logical = (FriBidiChar*) realloc(logical, buffer_size); + visual = (FriBidiChar*) realloc(visual, buffer_size); + outputstr = (char*) realloc(outputstr, buffer_size); + } + len = fribidi_charset_to_unicode (char_set_num, txt, len, logical); + base = menu_fribidi_flip_commas?FRIBIDI_TYPE_ON:FRIBIDI_TYPE_L; + log2vis = fribidi_log2vis (logical, len, &base, visual, NULL, NULL, NULL); + if (log2vis) { + len = fribidi_remove_bidi_marks (visual, len, NULL, NULL, NULL); + fribidi_unicode_to_charset (char_set_num, visual, len, outputstr); + return outputstr; + } + } + return txt; +} +#endif + void menu_draw_text(mp_image_t* mpi,char* txt, int x, int y) { draw_alpha_f draw_alpha = get_draw_alpha(mpi->imgfmt); int font; @@ -350,6 +400,9 @@ void menu_draw_text(mp_image_t* mpi,char return; } +#ifdef USE_FRIBIDI + txt = menu_fribidi(txt); +#endif render_txt(txt); while (*txt) { @@ -381,6 +434,9 @@ void menu_draw_text_full(mp_image_t* mpi return; } +#ifdef USE_FRIBIDI + txt = menu_fribidi(txt); +#endif render_txt(txt); if(x > mpi->w || y > mpi->h) geexbox-1.0/packages/MPlayer/patches/585_menu-filesel-opendir-bail-to-mnt.diff0000644000175000017500000000111310446314257026174 0ustar aurelaureldiff -r 92ef6acb17e7 libmenu/menu_filesel.c --- a/libmenu/menu_filesel.c Sun Apr 30 16:54:46 2006 +0200 +++ b/libmenu/menu_filesel.c Sun Apr 30 16:54:46 2006 +0200 @@ -194,7 +194,7 @@ free_extensions (char **extensions) } } -static int open_dir(menu_t* menu,char* args) { +static int _open_dir(menu_t* menu,char* args) { char **namelist, **tp; struct dirent *dp; struct stat st; @@ -300,6 +300,9 @@ bailout: return 1; } +static int open_dir(menu_t* menu,char* args) { + return (_open_dir(menu, args) || _open_dir(menu, "/mnt/")); +} static char *action; geexbox-1.0/packages/MPlayer/patches/650_tvinput.diff0000644000175000017500000000235410446314257021542 0ustar aurelaureldiff -r 6cd0bd7e2d49 libmpdemux/tv.c --- a/libmpdemux/tv.c Sun Apr 30 16:54:43 2006 +0200 +++ b/libmpdemux/tv.c Sun Apr 30 16:54:43 2006 +0200 @@ -382,7 +382,11 @@ static int open_tv(tvi_handle_t *tvh) int channel = 0; if (tv_param_channel) { - if (isdigit(*tv_param_channel)) + if (*tv_param_channel == '-' && isdigit(tv_param_channel[1])) { + tv_param_input = atoi(tv_param_channel+1); + funcs->control(tvh->priv, TVI_CONTROL_SPC_SET_INPUT, &tv_param_input); + } + else if (isdigit(*tv_param_channel)) /* if tv_param_channel begins with a digit interpret it as a number */ channel = atoi(tv_param_channel); else @@ -430,6 +434,11 @@ static int open_tv(tvi_handle_t *tvh) if (tv_param_channel) { struct CHANLIST cl; + if (*tv_param_channel == '-' && isdigit(tv_param_channel[1])) { + tv_param_input = atoi(tv_param_channel+1); + funcs->control(tvh->priv, TVI_CONTROL_SPC_SET_INPUT, &tv_param_input); + } + else { mp_msg(MSGT_TV, MSGL_V, "Requested channel: %s\n", tv_param_channel); for (i = 0; i < chanlists[tvh->chanlist].count; i++) { @@ -445,6 +454,7 @@ static int open_tv(tvi_handle_t *tvh) tv_set_freq(tvh, (unsigned long)(((float)cl.freq/1000)*16)); break; } + } } } } geexbox-1.0/packages/MPlayer/patches/655_tvkeepon.diff0000644000175000017500000000067010446314257021670 0ustar aurelaureldiff -r 5f88e25ccf52 mplayer.c --- a/mplayer.c Sun Apr 30 16:54:44 2006 +0200 +++ b/mplayer.c Sun Apr 30 16:54:44 2006 +0200 @@ -3515,6 +3515,7 @@ if(!(video_out=init_best_video_out(video mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_ErrorInitializingVODevice); goto goto_next_file; // exit_player(MSGTR_Exit_error); } +system("[ -x /usr/bin/tvkeepon ] && /usr/bin/tvkeepon"); sh_video->video_out=video_out; inited_flags|=INITED_VO; } geexbox-1.0/packages/MPlayer/patches/660_tvchannel_fix_overflow.diff0000644000175000017500000000105510446314257024602 0ustar aurelaurel* already applied in trunk. diff -Naur MPlayer-1.0pre8.orig/libmpdemux/tv.c MPlayer-1.0pre8/libmpdemux/tv.c --- MPlayer-1.0pre8.orig/libmpdemux/tv.c 2006-06-20 21:56:14.000000000 +0200 +++ MPlayer-1.0pre8/libmpdemux/tv.c 2006-06-20 21:58:07.000000000 +0200 @@ -331,7 +331,8 @@ if (!sep) continue; // Wrong syntax, but mplayer should not crash - strcpy(tv_channel_current->name, sep + 1); + strlcpy(tv_channel_current->name, sep + 1, + sizeof(tv_channel_current->name)); sep[0] = '\0'; strncpy(tv_channel_current->number, tmp, 5); geexbox-1.0/packages/MPlayer/patches/700_player-dvdnav.diff0000644000175000017500000076325410446314257022616 0ustar aurelaurelbased on http://dcxx.fw.hu/mplayer/20060614/navmplayer.patch generated from vanilla MPlayer-1.0pre8 sources while resolving conflicts of the patch with original mplayer sources. after that I removed all parts which conflicted with geexbox mplayer and moved them into 701_player-dvdnav-conflict.diff diff -Nur MPlayer-1.0pre8.orig/Makefile MPlayer-1.0pre8/Makefile --- MPlayer-1.0pre8.orig/Makefile 2006-06-11 21:35:47.000000000 +0300 +++ MPlayer-1.0pre8/Makefile 2006-06-15 23:04:46.000000000 +0300 @@ -128,6 +128,10 @@ $(FONTCONFIG_LIB) \ $(ENCA_LIB) \ +ifeq ($(LIBMPDVDNAV),yes) +COMMON_LIBS += libmpdvdnav/libmpdvdnav.a +endif + CFLAGS = $(OPTFLAGS) -I. \ $(CACA_INC) \ $(CDPARANOIA_INC) \ @@ -193,6 +197,9 @@ PARTS += libmpdvdkit2 else endif +ifeq ($(LIBMPDVDNAV),yes) +PARTS += libmpdvdnav +endif ifeq ($(GUI),yes) PARTS += Gui endif @@ -252,6 +259,9 @@ ifeq ($(DVDKIT2),yes) COMMON_DEPS += libmpdvdkit2/libmpdvdkit.a endif +ifeq ($(LIBMPDVDNAV),yes) +COMMON_DEPS += libmpdvdnav/libmpdvdnav.a +endif ifeq ($(GUI),yes) COMMON_DEPS += Gui/libgui.a @@ -273,6 +283,9 @@ libmpdvdkit2/libmpdvdkit.a: $(MAKE) -C libmpdvdkit2 +libmpdvdnav/libmpdvdnav.a: + $(MAKE) -C libmpdvdnav + loader/libloader.a: $(MAKE) -C loader diff -Nur MPlayer-1.0pre8.orig/cfg-common.h MPlayer-1.0pre8/cfg-common.h --- MPlayer-1.0pre8.orig/cfg-common.h 2006-06-11 21:35:47.000000000 +0300 +++ MPlayer-1.0pre8/cfg-common.h 2006-06-15 23:04:46.000000000 +0300 @@ -31,6 +31,24 @@ {"dvdnav", "-dvdnav is deprecated, use dvdnav:// instead.\n", CONF_TYPE_PRINT, 0, 0, 1, NULL}, {"skipopening", &dvd_nav_skip_opening, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"noskipopening", &dvd_nav_skip_opening, CONF_TYPE_FLAG, 0, 1, 0, NULL}, +#ifdef USE_MPDVDNAV + {"mlang", &dvdmenu_lang, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"dvdnav-menutype", &dvdnav_menutype, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 0, 2, NULL}, + {"dvdnav-color-spu", &dvdnav_color_spu, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"dvdnav-nocolor-spu", &dvdnav_color_spu, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"dvdnav-force-menu", &dvdnav_force_menu, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"dvdnav-noforce-menu", &dvdnav_force_menu, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"dvdnav-still-repeat", &dvdnav_still_repeat, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 0, 10, NULL}, +// {"dvdnav-skipintro", &dvdnav_skipintro, CONF_TYPE_FLAG, 0, 0, 1, NULL}, +// {"dvdnav-noskipintro", &dvdnav_skipintro, CONF_TYPE_FLAG, 0, 1, 0, NULL}, +#ifdef USE_MPDVDNAV_TRACE + {"dvdnav-trace", &dvdnav_trace, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"dvdnav-notrace", &dvdnav_trace, CONF_TYPE_FLAG, 0, 1, 0, NULL}, +#else + {"dvdnav-trace", "MPlayer was compiled without dvdnav trace support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"dvdnav-notrace", "MPlayer was compiled without dvdnav trace support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif +#endif #endif #ifdef USE_DVDREAD {"dvd-device", &dvd_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, diff -Nur MPlayer-1.0pre8.orig/configure MPlayer-1.0pre8/configure --- MPlayer-1.0pre8.orig/configure 2006-06-11 21:35:47.000000000 +0300 +++ MPlayer-1.0pre8/configure 2006-06-15 23:04:46.000000000 +0300 @@ -1614,8 +1614,8 @@ _ladspa=auto _xmms=no _have_dvd=no -# dvdnav disabled, it does not work -#_dvdnav=no +_dvdnav=no +_dvdnav_trace=yes _dvdread=auto _dvdkit=auto _xanim=auto @@ -1839,9 +1839,10 @@ --disable-dvdread) _dvdread=no ;; --enable-mpdvdkit) _dvdkit=yes ;; --disable-mpdvdkit) _dvdkit=no ;; -# dvdnav disabled, it does not work -# --enable-dvdnav) _dvdnav=yes ;; -# --disable-dvdnav) _dvdnav=no ;; + --enable-dvdnav) _dvdnav=yes ;; + --disable-dvdnav) _dvdnav=no ;; + --enable-dvdnav-trace) _dvdnav_trace=yes ;; + --disable-dvdnav-trace) _dvdnav_trace=no ;; --enable-xanim) _xanim=yes ;; --disable-xanim) _xanim=no ;; --enable-real) _real=yes ;; @@ -5230,6 +5231,25 @@ # _noinputmodules="dvdnav $_noinputmodules" # fi # echores "$_dvdnav" +echocheck "DVDNAV support" +if test "$_dvdnav" = yes ; then + _largefiles=yes + _def_dvdnav='#define USE_DVDNAV 1' + _def_mpdvdnav='#define USE_MPDVDNAV 1' +if test "$_dvdnav_trace" = yes ; then + _def_mpdvdnav_trace='#define USE_MPDVDNAV_TRACE 1' + _inputmodules="dvdnav(dvdnav-trace) $_inputmodules" +else + _inputmodules="dvdnav $_inputmodules" +fi + _dvdnav_version='0110' + _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version" + _def_dvdnav_sversion="#define DVDNAVSVERSION \"0.1.10\"" + echores "yes" +else + _noinputmodules="dvdnav $_noinputmodules" +fi +echores "$_dvdnav" echocheck "cdparanoia" if test "$_cdparanoia" = auto ; then @@ -7473,6 +7493,7 @@ DVDREAD = $_dvdread DVDREAD_LIB = $_ld_dvdread DVDKIT2 = $_dvdkit +LIBMPDVDNAV = $_dvdnav SDL_INC = $_inc_sdl W32_DEP = $_dep_win32 W32_LIB = $_ld_win32 @@ -7860,6 +7881,9 @@ /* DVD navigation support using libdvdnav */ $_def_dvdnav $_def_dvdnav_version +$_def_dvdnav_sversion +$_def_mpdvdnav +$_def_mpdvdnav_trace /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */ #define MPEG12_POSTPROC 1 diff -Nur MPlayer-1.0pre8.orig/help/help_mp-en.h MPlayer-1.0pre8/help/help_mp-en.h --- MPlayer-1.0pre8.orig/help/help_mp-en.h 2006-06-11 21:35:45.000000000 +0300 +++ MPlayer-1.0pre8/help/help_mp-en.h 2006-06-15 23:04:46.000000000 +0300 @@ -24,6 +24,10 @@ #ifdef USE_DVDREAD " dvd:// play DVD title from device instead of plain file\n" " -alang/-slang select DVD audio/subtitle language (by 2-char country code)\n" +#ifdef USE_DVDNAV +" -mlang select DVD menu language (by 2-char country code)\n" +" -dvdnav-menutype set DVD menu button type: 0: spu (default), 1: simple box, 2: spu & simple box\n" +#endif #endif " -ss seek to given (seconds or hh:mm:ss) position\n" " -nosound do not play sound\n" @@ -1814,3 +1818,160 @@ // libvo/vo_xv.c #define MSGTR_LIBVO_XV_DrawFrameCalled "[VO_XV] draw_frame() called!!!!!!\n" + +// mpdvdnav - gui +#define MSGTR_MENU_DVDNAV "DVDNAV" +#define MSGTR_MENU_PlayDVDNAV "Play DVDNAV..." +#define MSGTR_MENU_MenuDVDNAV "Main DVD Menu" + +// mpdvdnav + +#define MSGTR_MPDVDNAV_StopEvent "DVDNAV Event: STOP!\n" +#define MSGTR_MPDVDNAV_WaitEvent "DVDNAV Event: Wait\n" +#define MSGTR_MPDVDNAV_StillFrameEvent "DVDNAV Event: Still frame\n" +#define MSGTR_MPDVDNAV_VtsChangeEvent "DVDNAV Event: Vts change\n" +#define MSGTR_MPDVDNAV_CellChangeEvent "DVDNAV Event: Cell change\n" +#define MSGTR_MPDVDNAV_SpuClutChangeEvent "DVDNAV Event: Spu clut change\n" +#define MSGTR_MPDVDNAV_HighlightEvent "DVDNAV Event: Highlight\n" +#define MSGTR_MPDVDNAV_NavPacketEvent "DVDNAV Event: Nav packet\n" + +#define MSGTR_MPDVDNAV_StillFrameDecodeError "Still frame decode error\n" +#define MSGTR_MPDVDNAV_StillSkip "Dvdnav still skip\n" +#define MSGTR_MPDVDNAV_CellN "cellN : %i\n" +#define MSGTR_MPDVDNAV_PgN "pgN : %d\n" +#define MSGTR_MPDVDNAV_CellLength "cell_length: %d\n" +#define MSGTR_MPDVDNAV_PgLength "pg_lenght : %d\n" +#define MSGTR_MPDVDNAV_PgcLength "pgc_lenght : %d\n" +#define MSGTR_MPDVDNAV_CellStart "cell_start : %d\n" +#define MSGTR_MPDVDNAV_PgStart "pg_start : %d\n" +#define MSGTR_MPDVDNAV_Title "DVDNAV new title: %i\n" +#define MSGTR_MPDVDNAV_Part "DVDNAV new part: %i\n" +#define MSGTR_MPDVDNAV_Aspect43 "Aspect 4/3\n" +#define MSGTR_MPDVDNAV_Aspect169 "Aspect 16/9\n" +#define MSGTR_MPDVDNAV_AspectOther "Aspect ? (%i)\n" +#define MSGTR_MPDVDNAV_AudioID "DVDNAV new audio ID: %i\n" +#define MSGTR_MPDVDNAV_DvdSubID "DVDNAV new dvdsub ID: %i\n" +#define MSGTR_MPDVDNAV_Len "DVDNAV len: %i\n" +#define MSGTR_MPDVDNAV_ReadInStillActive "%s: got a stream_read while I should be asleep!\n" +#define MSGTR_MPDVDNAV_ErrorGetNextBlock "Error getting next block from DVD (%s)\n" +#define MSGTR_MPDVDNAV_ErrorStreamRead "DVDNAV stream read error: %s\n" +#define MSGTR_MPDVDNAV_ErrorSeek "DVDNAV stream seek error: %s (%llx)\n" +#define MSGTR_MPDVDNAV_ErrorNav "DVDNAV navigation error: %s\n" +#define MSGTR_MPDVDNAV_NoColorSpu "Color SPU does not support this vo!\n" + +// ----------------------- libmpdvdnav error ----------------------- +// libmpdvdnav - dvdnav.c +#define MSGTR_LIBMPDVDNAV_Err_ErrorInitialisingTheDVDVM "Error initialising the DVD VM." +#define MSGTR_LIBMPDVDNAV_Err_ErrorStartingTheVM "Error starting the VM / opening the DVD device." +#define MSGTR_LIBMPDVDNAV_Err_PassedANullPointer "Passed a NULL pointer." +#define MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted "Virtual DVD machine not started." +#define MSGTR_LIBMPDVDNAV_Err_ErrorRestartingTheVM "Error restarting the VM." +#define MSGTR_LIBMPDVDNAV_Err_ErrorReadingNAVPacket "Error reading NAV packet." +#define MSGTR_LIBMPDVDNAV_Err_ExpectedNAVPacketButNoneFound "Expected NAV packet but none found." +#define MSGTR_LIBMPDVDNAV_Err_UnknownDomainWhenChangingVTS "Unknown domain when changing VTS." +#define MSGTR_LIBMPDVDNAV_Err_ErrorReadingNAVPacket "Error reading NAV packet." +#define MSGTR_LIBMPDVDNAV_Err_AttemptingToReadWithoutOpeningFile "Attempting to read without opening file." +#define MSGTR_LIBMPDVDNAV_Err_ErrorReadingFromDVD "Error reading from DVD." +#define MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC "No current PGC." +#define MSGTR_LIBMPDVDNAV_Err_PassedAnInvalidAngleNumber "Passed an invalid angle number." +// libmpdvdnav - searching.c +#define MSGTR_LIBMPDVDNAV_Err_CannotSeekInAStillFrame "Cannot seek in a still frame." +#define MSGTR_LIBMPDVDNAV_Err_RequestToSeekBehindEnd "Request to seek behind end." +#define MSGTR_LIBMPDVDNAV_Err_RequestToSeekBeforeStart "Request to seek before start." +#define MSGTR_LIBMPDVDNAV_Err_IllegalSeekMode "Illegal seek mode." +#define MSGTR_LIBMPDVDNAV_Err_ErrorWhenSeeking "Error when seeking." +#define MSGTR_LIBMPDVDNAV_Err_SkipToPreviousChapterFailed "Skip to previous chapter failed." +#define MSGTR_LIBMPDVDNAV_Err_SkipToTopChapterFailed "Skip to top chapter failed." +#define MSGTR_LIBMPDVDNAV_Err_SkipToNextChapterFailed "Skip to next chapter failed." +#define MSGTR_LIBMPDVDNAV_Err_NoSuchMenuOrMenuNotReachable "No such menu or menu not reachable." +#define MSGTR_LIBMPDVDNAV_Err_NewPositionNotYetDetermined "New position not yet determined." +// libmpdvdnav - highlight.c +#define MSGTR_LIBMPDVDNAV_Err_BadVMState "Bad VM state." +// libmpdvdnav - settings.c +#define MSGTR_LIBMPDVDNAV_Err_PassedIllegalLanguageCode "Passed illegal language code." + +// ----------------------- libmpdvdnav ----------------------------- +// libmpdvdnav - dvdnav.c +#define MSGTR_LIBMPDVDNAV_Using "libdvdnav: Using dvdnav version %s from http://dvd.sf.net\n" +#define MSGTR_LIBMPDVDNAV_Demux_error "libdvdnav: demux error! %02x %02x %02x (should be 0x000001) \n" +#define MSGTR_LIBMPDVDNAV_ErrorOpeningVtsDomain "Error opening vtsN=%i, domain=%i.\n" +// libmpdvdnav - highlight.c +#define MSGTR_LIBMPDVDNAV_NoCurrentPGC "No current PGC.\n" +#define MSGTR_LIBMPDVDNAV_NotInAMenu "Not in a menu.\n" +#define MSGTR_LIBMPDVDNAV_ThisNAVHasAlreadyBeenLeft "This NAV has already been left.\n" +#define MSGTR_LIBMPDVDNAV_ButtonDoesNotExist "Button does not exist.\n" +#define MSGTR_LIBMPDVDNAV_TitleOutOfRange "Title out of range.\n" +#define MSGTR_LIBMPDVDNAV_PartOutOfRange "Part out of range.\n" +#define MSGTR_LIBMPDVDNAV_NotImplementedYet "Not implemented yet.\n" +#define MSGTR_LIBMPDVDNAV_NotInATitleOrMenu "Not in a title or menu.\n" +// libmpdvdnav - navigation.c +#define MSGTR_LIBMPDVDNAV_PassedANullPointer "Passed a NULL pointer.\n" +#define MSGTR_LIBMPDVDNAV_VirtualDVDMachineNotStarted "Virtual DVD machine not started.\n" +#define MSGTR_LIBMPDVDNAV_BadVMState "Bad VM state.\n" +#define MSGTR_LIBMPDVDNAV_PassedATitleNumberOutOfRange "Passed a title number out of range.\n" +// libmpdvdnav - read_cache.c +#define MSGTR_LIBMPDVDNAV_PreCacheDVDReadReallocHappened "pre_cache DVD read realloc happened\n" +#define MSGTR_LIBMPDVDNAV_PreCacheDVDReadMalloc "pre_cache DVD read malloc %d blocks\n" +#define MSGTR_LIBMPDVDNAV_PreCachingWasImpossible "pre_caching was impossible, no cache chunk available\n" +#define MSGTR_LIBMPDVDNAV_ReadCacheSectorInfo "libdvdnav: sector=%d, start_sector=%d, last_sector=%d\n" +#define MSGTR_LIBMPDVDNAV_ReadCacheReadAheadSize "libdvdnav: read_ahead_size=%d, size=%d\n" +#define MSGTR_LIBMPDVDNAV_CacheMissOnSector "cache miss on sector %d\n" +// libmpdvdnav - remap.c +#define MSGTR_LIBMPDVDNAV_UnableToFindMapFile "libdvdnav: Unable to find map file '%s'\n" +#define MSGTR_LIBMPDVDNAV_IgnoringMapLine "libdvdnav: Ignoring map line (%d): %s\n" +#define MSGTR_LIBMPDVDNAV_RemapInfo "libdvdnav: %s: domain %d, title %d, program %d, start %lx, next %lx\n" +#define MSGTR_LIBMPDVDNAV_RedirectedTo "libdvdnav: Redirected to %lx\n" +// libmpdvdnav - searching.c +#define MSGTR_LIBMPDVDNAV_UnknownDomainForSeeking "libdvdnav: Error: Unknown domain for seeking.\n" +#define MSGTR_LIBMPDVDNAV_CouldNotLocateBlock "libdvdnav: Could not locate block\n" +#define MSGTR_LIBMPDVDNAV_AdmapNotLocated "libdvdnav: admap not located\n" +#define MSGTR_LIBMPDVDNAV_ErrorWhenSeeking "libdvdnav: Error when seeking\n" +#define MSGTR_LIBMPDVDNAV_FIXMEImplementSeekingToLocation "libdvdnav: FIXME: Implement seeking to location %u\n" +#define MSGTR_LIBMPDVDNAV_PreviousChapterFailed "libdvdnav: previous chapter failed.\n" +#define MSGTR_LIBMPDVDNAV_TopChapterFailed "libdvdnav: top chapter failed.\n" +#define MSGTR_LIBMPDVDNAV_NextChapterFailed "libdvdnav: next chapter failed.\n" +#define MSGTR_LIBMPDVDNAV_SearchChapterFailed "libdvdnav: search chapter failed.\n" +// libmpdvdnav - decoder.c +#define MSGTR_LIBMPDVDNAV_BadCallToVMGetbits "libdvdnav: Bad call to vm_getbits. Parameter out of range\n" +#define MSGTR_LIBMPDVDNAV_SuspectedRCERegionProtection "libdvdnav: Suspected RCE Region Protection!!!\n" +#define MSGTR_LIBMPDVDNAV_EvalCompareInvalidComparisonCode "libdvdnav: eval_compare: Invalid comparison code\n" +#define MSGTR_LIBMPDVDNAV_UnknownInstrution "libdvdnav: Unknown Instruction!\n" +#define MSGTR_LIBMPDVDNAV_WarningUnknownComman "libdvdnav: WARNING: Unknown Command=%x\n" +#define MSGTR_LIBMPDVDNAV_DecoderCWarningUnknownBits "libdvdnav: decoder.c: [WARNING, unknown bits:" +#define MSGTR_LIBMPDVDNAV_DecoderCButton "libdvdnav: %s (button %d)\n" +#define MSGTR_LIBMPDVDNAV_DecoderCButton2 "libdvdnav: %s %d (button %d)\n" +#define MSGTR_LIBMPDVDNAV_DecoderCVtsTitleMenu "libdvdnav: %s vts %d title %d menu %d\n" +#define MSGTR_LIBMPDVDNAV_DecoderCResumeCell "libdvdnav: %s resume cell %d\n" +#define MSGTR_LIBMPDVDNAV_DecoderCResumeCell2 "libdvdnav: %s %d resume cell %d\n" +// libmpdvdnav - vm.c +#define MSGTR_LIBMPDVDNAV_VmCDVDTitle "libdvdnav: DVD Title: " +#define MSGTR_LIBMPDVDNAV_VmCDVDSerialNumber "\nlibdvdnav: DVD Serial Number: " +#define MSGTR_LIBMPDVDNAV_VmCDVDTitleAlternative "\nlibdvdnav: DVD Title (Alternative): " +#define MSGTR_LIBMPDVDNAV_VmCCantReadNameBlock "libdvdnav: Can't read name block. Probably not a DVD-ROM device.\n" +#define MSGTR_LIBMPDVDNAV_VmCCantSeekToBlock "libdvdnav: Can't seek to block %u\n" +#define MSGTR_LIBMPDVDNAV_VmCNameOpenFailed "NAME OPEN FAILED\n" +#define MSGTR_LIBMPDVDNAV_VmCIfoOpenVTSIFailed "libdvdnav: ifoOpenVTSI failed - CRASHING!!!\n" +#define MSGTR_LIBMPDVDNAV_VmCIfoReadVTSPTTSRPTFailed "libdvdnav: ifoRead_VTS_PTT_SRPT failed - CRASHING!!!\n" +#define MSGTR_LIBMPDVDNAV_VmCIfoReadPGCITFailed "libdvdnav: ifoRead_PGCIT failed - CRASHING!!!\n" +#define MSGTR_LIBMPDVDNAV_VmCIfoReadPGCIUTFailed "libdvdnav: ifoRead_PGCI_UT failed - CRASHING!!!\n" +#define MSGTR_LIBMPDVDNAV_VmCIfoReadVOBUADMAPVtsiFailed "libdvdnav: ifoRead_VOBU_ADMAP vtsi failed - CRASHING\n" +#define MSGTR_LIBMPDVDNAV_VmCIfoReadTITLEVOBUADMAPVtsiFailed "libdvdnav: ifoRead_TITLE_VOBU_ADMAP vtsi failed - CRASHING\n" +#define MSGTR_LIBMPDVDNAV_VmCVmFaildToOpenReadTheDVD "libdvdnav: vm: faild to open/read the DVD\n" +#define MSGTR_LIBMPDVDNAV_VmCVmFaildToReadVIDEOTSIFO "libdvdnav: vm: faild to read VIDEO_TS.IFO\n" +#define MSGTR_LIBMPDVDNAV_VmCVmIfoReadFPPGCFailed "libdvdnav: vm: ifoRead_FP_PGC failed\n" +#define MSGTR_LIBMPDVDNAV_VmCVmIfoReadTTSRPTFailed "libdvdnav: vm: ifoRead_TT_SRPT failed\n" +#define MSGTR_LIBMPDVDNAV_VmCVmIfoReadPGCIUTFailed "libdvdnav: vm: ifoRead_PGCI_UT failed\n" +#define MSGTR_LIBMPDVDNAV_VmCVmIfoReadPRLMAITFailed "libdvdnav: vm: ifoRead_PTL_MAIT failed\n" +#define MSGTR_LIBMPDVDNAV_VmCVmIfoReadVTSATRTFailed "libdvdnav: vm: ifoRead_VTS_ATRT failed\n" +#define MSGTR_LIBMPDVDNAV_VmCVmIfoReadVOBUADMAPVgmiFailed "libdvdnav: vm: ifoRead_VOBU_ADMAP vgmi failed\n" +#define MSGTR_LIBMPDVDNAV_VmCDVDDiskReportsItselfWithRegionMask "libdvdnav: DVD disk reports itself with Region mask 0x%08x. Regions:" +#define MSGTR_LIBMPDVDNAV_VmCChapterNotFound "libdvdnav: chapter NOT FOUND!\n" +#define MSGTR_LIBMPDVDNAV_VmCInvalidAngleBlock "libdvdnav: Invalid angle block\n" +#define MSGTR_LIBMPDVDNAV_VmCInvalidBlockMode "libdvdnav: Invalid? Cell block_mode (%d), block_type (%d)\n" +#define MSGTR_LIBMPDVDNAV_VmCCellIsInBlockButDidNotEnter "libdvdnav: Cell is in block but did not enter at first cell!\n" +#define MSGTR_LIBMPDVDNAV_VmCTryingToResumeWithoutAnyResume "libdvdnav: trying to resume without any resume info set\n" +#define MSGTR_LIBMPDVDNAV_VmCRandomOrShuffleTitlesAreNotHandledYet "libdvdnav: RANDOM or SHUFFLE titles are NOT handled yet.\n" +#define MSGTR_LIBMPDVDNAV_VmCGetPGCNFailed "libdvdnav: get_PGCN failed. Was trying to find pgcN in domain %d\n" +#define MSGTR_LIBMPDVDNAV_VmCPgciUtHandleIsNULL "libdvdnav: *** pgci_ut handle is NULL ***\n" +#define MSGTR_LIBMPDVDNAV_VmCLanguageNotFound "libdvdnav: Language '%c%c' not found, using '%c%c' instead\n" +#define MSGTR_LIBMPDVDNAV_VmCMenuLanguagesAvailable "libdvdnav: Menu Languages available: " diff -Nur MPlayer-1.0pre8.orig/libmenu/menu.c MPlayer-1.0pre8/libmenu/menu.c --- MPlayer-1.0pre8.orig/libmenu/menu.c 2006-06-11 21:35:45.000000000 +0300 +++ MPlayer-1.0pre8/libmenu/menu.c 2006-06-15 23:04:46.000000000 +0300 @@ -20,6 +20,7 @@ #include "m_option.h" #include "m_struct.h" #include "menu.h" +#include "libvo/video_out.h" extern menu_info_t menu_info_cmdlist; extern menu_info_t menu_info_pt; @@ -252,7 +253,7 @@ ///////////////////////////// Helpers //////////////////////////////////// -typedef void (*draw_alpha_f)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +typedef void (*draw_alpha_f)(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); inline static draw_alpha_f get_draw_alpha(uint32_t fmt) { switch(fmt) { @@ -314,7 +315,7 @@ while (*txt) { unsigned char c=*txt++; if ((font=vo_font->font[c])>=0 && (x + vo_font->width[c] <= mpi->w) && (y + vo_font->pic_a[font]->h <= mpi->h)) - draw_alpha(vo_font->width[c], vo_font->pic_a[font]->h, + draw_alpha(vo_font->width[c], vo_font->pic_a[font]->h,DEST_PLANES_Y, vo_font->pic_b[font]->bmp+vo_font->start[c], vo_font->pic_a[font]->bmp+vo_font->start[c], vo_font->pic_a[font]->w, @@ -481,7 +482,7 @@ if(font >= 0) { int cs = (vo_font->pic_a[font]->h - vo_font->height) / 2; if ((sx + vo_font->width[c] < xmax) && (sy + vo_font->height < ymax) ) - draw_alpha(vo_font->width[c], vo_font->height, + draw_alpha(vo_font->width[c], vo_font->height, DEST_PLANES_Y, vo_font->pic_b[font]->bmp+vo_font->start[c] + cs * vo_font->pic_a[font]->w, vo_font->pic_a[font]->bmp+vo_font->start[c] + @@ -589,7 +590,7 @@ char pic[stride*h],pic_alpha[stride*h]; memset(pic,g,stride*h); memset(pic_alpha,alpha,stride*h); - draw_alpha(w,h,pic,pic_alpha,stride, + draw_alpha(w,h,DEST_PLANES_Y,pic,pic_alpha,stride, mpi->planes[0] + y * mpi->stride[0] + x * (mpi->bpp>>3), mpi->stride[0]); } diff -Nur MPlayer-1.0pre8.orig/libmpcodecs/Makefile MPlayer-1.0pre8/libmpcodecs/Makefile --- MPlayer-1.0pre8.orig/libmpcodecs/Makefile 2006-06-11 21:35:41.000000000 +0300 +++ MPlayer-1.0pre8/libmpcodecs/Makefile 2006-06-15 23:04:46.000000000 +0300 @@ -71,6 +71,7 @@ vd_xvid4.c \ vd_xvid.c \ vd_zrmjpeg.c \ + vd_videostill.c \ ifeq ($(CONFIG_LIBAVCODEC),yes) VIDEO_SRCS_OPT+=vd_ffmpeg.c diff -Nur MPlayer-1.0pre8.orig/libmpcodecs/vd.c MPlayer-1.0pre8/libmpcodecs/vd.c --- MPlayer-1.0pre8.orig/libmpcodecs/vd.c 2006-06-11 21:35:41.000000000 +0300 +++ MPlayer-1.0pre8/libmpcodecs/vd.c 2006-06-15 23:04:46.000000000 +0300 @@ -154,10 +154,8 @@ mp_msg(MSGT_DECVIDEO,MSGL_WARN, MSGTR_CodecDidNotSet); /* XXX: HACK, if sh->disp_* aren't set, * but we have w and h, set them :: atmos */ - if(!sh->disp_w && w) - sh->disp_w=w; - if(!sh->disp_h && h) - sh->disp_h=h; + if(w) sh->disp_w=w; + if(h) sh->disp_h=h; if(!sh->disp_w || !sh->disp_h) return 0; diff -Nur MPlayer-1.0pre8.orig/libmpcodecs/vd.h MPlayer-1.0pre8/libmpcodecs/vd.h --- MPlayer-1.0pre8.orig/libmpcodecs/vd.h 2006-06-11 21:35:41.000000000 +0300 +++ MPlayer-1.0pre8/libmpcodecs/vd.h 2006-06-15 23:04:46.000000000 +0300 @@ -24,6 +24,8 @@ #define VDCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */ #define VDCTRL_GET_EQUALIZER 7 /* get color options (brightness,contrast etc) */ #define VDCTRL_RESYNC_STREAM 8 /* seeking */ +#define VDCTRL_RESET 9 /* reset mpeg2 codec */ +#define VDCTRL_STORED_IMAGE 10 /* mpeg2 codec support stored image */ // callbacks: int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt); diff -Nur MPlayer-1.0pre8.orig/libmpcodecs/vd_libmpeg2.c MPlayer-1.0pre8/libmpcodecs/vd_libmpeg2.c --- MPlayer-1.0pre8.orig/libmpcodecs/vd_libmpeg2.c 2006-06-11 21:35:41.000000000 +0300 +++ MPlayer-1.0pre8/libmpcodecs/vd_libmpeg2.c 2006-06-15 23:04:46.000000000 +0300 @@ -52,6 +52,11 @@ (*((int*)arg)) == IMGFMT_422P) return CONTROL_TRUE; return CONTROL_FALSE; + case VDCTRL_RESET: + mpeg2_reset(mpeg2dec,(*((int*)arg))); + return CONTROL_TRUE; + case VDCTRL_STORED_IMAGE: + return CONTROL_TRUE; } return CONTROL_UNKNOWN; @@ -139,6 +144,9 @@ mpeg2dec->decoder.convert_id=NULL; if(len<=0) return NULL; // skipped null frame +#ifdef USE_DVDNAV + sh->enable_mpeg2_reset=0; +#endif // append extra 'end of frame' code: ((char*)data+len)[0]=0; @@ -175,16 +183,39 @@ ph = info->sequence->display_height * info->sequence->pixel_height; if(ph) sh->aspect = (float) pw / (float) ph; // video parameters inited/changed, (re)init libvo: +#ifdef USE_DVDNAV + sh->enable_mpeg2_reset=1; +#endif if (info->sequence->width >> 1 == info->sequence->chroma_width && info->sequence->height >> 1 == info->sequence->chroma_height) { +#ifdef USE_DVDNAV +//printf("lock: %i w:%i (%i) h: %i (%i) fmt: %i (%i) \n",sh->config_lock,sh->config_w,info->sequence->picture_width, +// sh->config_h,info->sequence->picture_height,sh->config_outfmt,IMGFMT_YV12); + if (sh->config_lock && sh->config_w==info->sequence->picture_width && + sh->config_h ==info->sequence->picture_height && sh->config_outfmt == IMGFMT_YV12) break; +#endif if(!mpcodecs_config_vo(sh, info->sequence->picture_width, info->sequence->picture_height, IMGFMT_YV12)) return 0; +#ifdef USE_DVDNAV + if(sh->config_lock) {sh->config_w=info->sequence->picture_width; + sh->config_h=info->sequence->picture_height; sh->config_outfmt=IMGFMT_YV12;} +#endif } else if (info->sequence->width >> 1 == info->sequence->chroma_width && info->sequence->height == info->sequence->chroma_height) { +#ifdef USE_DVDNAV +//printf("lock: %i w:%i (%i) h: %i (%i) fmt: %i (%i) \n",sh->config_lock,sh->config_w,info->sequence->picture_width, +// sh->config_h,info->sequence->picture_height,sh->config_outfmt,IMGFMT_422P); + if (sh->config_lock && sh->config_w==info->sequence->picture_width && + sh->config_h ==info->sequence->picture_height && sh->config_outfmt == IMGFMT_422P) break; +#endif if(!mpcodecs_config_vo(sh, info->sequence->picture_width, info->sequence->picture_height, IMGFMT_422P)) return 0; +#ifdef USE_DVDNAV + if(sh->config_lock) {sh->config_w=info->sequence->picture_width; + sh->config_h=info->sequence->picture_height; sh->config_outfmt=IMGFMT_422P;} +#endif } else return 0; break; case STATE_PICTURE: diff -Nur MPlayer-1.0pre8.orig/libmpcodecs/vf.c MPlayer-1.0pre8/libmpcodecs/vf.c --- MPlayer-1.0pre8.orig/libmpcodecs/vf.c 2006-06-11 21:35:41.000000000 +0300 +++ MPlayer-1.0pre8/libmpcodecs/vf.c 2006-06-15 23:04:46.000000000 +0300 @@ -318,12 +318,9 @@ if(mpi->width!=w2 || mpi->height!=h){ // printf("vf.c: MPI parameters changed! %dx%d -> %dx%d \n", mpi->width,mpi->height,w2,h); if(mpi->flags&MP_IMGFLAG_ALLOCATED){ - if(mpi->widthheightplanes[0]); mpi->flags&=~MP_IMGFLAG_ALLOCATED; - mp_msg(MSGT_VFILTER,MSGL_V,"vf.c: have to REALLOCATE buffer memory :(\n"); - } // } else { } { mpi->width=w2; mpi->chroma_width=(w2 + (1<chroma_x_shift) - 1)>>mpi->chroma_x_shift; diff -Nur MPlayer-1.0pre8.orig/libmpcodecs/vf_expand.c MPlayer-1.0pre8/libmpcodecs/vf_expand.c --- MPlayer-1.0pre8.orig/libmpcodecs/vf_expand.c 2006-06-11 21:35:41.000000000 +0300 +++ MPlayer-1.0pre8/libmpcodecs/vf_expand.c 2006-06-15 23:04:46.000000000 +0300 @@ -80,7 +80,7 @@ // TODO clear left and right side of the image if needed } -static void draw_func(int x0,int y0, int w,int h,unsigned char* src, unsigned char *srca, int stride){ +static void draw_func(int x0,int y0, int w,int h,int dp,unsigned char* src, unsigned char *srca, int stride){ unsigned char* dst; if(!vo_osd_changed_flag && vf->dmpi->planes[0]==vf->priv->fb_ptr){ // ok, enough to update the area inside the video, leave the black bands @@ -108,19 +108,19 @@ switch(vf->dmpi->imgfmt){ case IMGFMT_BGR15: case IMGFMT_RGB15: - vo_draw_alpha_rgb15(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); + vo_draw_alpha_rgb15(w,h,dp,src,srca,stride,dst,vf->dmpi->stride[0]); break; case IMGFMT_BGR16: case IMGFMT_RGB16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); + vo_draw_alpha_rgb16(w,h,dp,src,srca,stride,dst,vf->dmpi->stride[0]); break; case IMGFMT_BGR24: case IMGFMT_RGB24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); + vo_draw_alpha_rgb24(w,h,dp,src,srca,stride,dst,vf->dmpi->stride[0]); break; case IMGFMT_BGR32: case IMGFMT_RGB32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,dst,vf->dmpi->stride[0]); break; case IMGFMT_YV12: case IMGFMT_I420: @@ -129,13 +129,13 @@ case IMGFMT_IF09: case IMGFMT_Y800: case IMGFMT_Y8: - vo_draw_alpha_yv12(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,dst,vf->dmpi->stride[0]); break; case IMGFMT_YUY2: - vo_draw_alpha_yuy2(w,h,src,srca,stride,dst,vf->dmpi->stride[0]); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,dst,vf->dmpi->stride[0]); break; case IMGFMT_UYVY: - vo_draw_alpha_yuy2(w,h,src,srca,stride,dst+1,vf->dmpi->stride[0]); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,dst+1,vf->dmpi->stride[0]); break; } } diff -Nur MPlayer-1.0pre8.orig/libmpdemux/Makefile MPlayer-1.0pre8/libmpdemux/Makefile --- MPlayer-1.0pre8.orig/libmpdemux/Makefile 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/Makefile 2006-06-15 23:04:46.000000000 +0300 @@ -23,12 +23,15 @@ cddb.c \ cdinfo.c \ cue_read.c \ - dvdnav_stream.c \ + stream_dvdnav.c \ parse_es.c \ parse_mp4.c \ yuv4mpeg.c \ yuv4mpeg_ratio.c \ +# dvdnav_stream replaced: stream_dvdnav +# dvdnav_stream.c \ + # Stream readers/writers SRCS += stream.c \ stream_file.c \ diff -Nur MPlayer-1.0pre8.orig/libmpdemux/demux_avi.c MPlayer-1.0pre8/libmpdemux/demux_avi.c --- MPlayer-1.0pre8.orig/libmpdemux/demux_avi.c 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/demux_avi.c 2006-06-15 23:04:46.000000000 +0300 @@ -898,7 +898,7 @@ stream_t* s; demuxer_t *od; s = new_ds_stream(demuxer->audio); - od = new_demuxer(s,DEMUXER_TYPE_OGG,-1,-2,-2,NULL); + od = new_demuxer(s,DEMUXER_TYPE_OGG,-1,-2,-2,NULL,0); if(!demux_ogg_open(od)) { mp_msg( MSGT_DEMUXER,MSGL_ERR,MSGTR_ErrorOpeningOGGDemuxer); free_stream(s); diff -Nur MPlayer-1.0pre8.orig/libmpdemux/demux_mpg.c MPlayer-1.0pre8/libmpdemux/demux_mpg.c --- MPlayer-1.0pre8.orig/libmpdemux/demux_mpg.c 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/demux_mpg.c 2006-06-15 23:04:46.000000000 +0300 @@ -754,6 +754,7 @@ int i; if(sh_audio && !d_audio->eof && d_video->pts && d_audio->pts){ float a_pts=d_audio->pts; + if((float)sh_audio->i_bps==0.0f) break; a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; if(d_video->pts>a_pts){ skip_audio_frame(sh_audio); // sync audio @@ -860,6 +861,23 @@ *((int*)arg) = demuxer->audio->id; return DEMUXER_CTRL_OK; + case DEMUXER_CTRL_SET_TIME_PTS: { + if (demuxer->movi_end==0) + { + mpg_d->final_pts = 0.0; + mpg_d->has_valid_timestamps = 0; + return DEMUXER_CTRL_OK; + } + mpg_d->final_pts=*((float *)arg); + if (mpg_d->final_pts==0.0) + { + mpg_d->final_pts = 0.0; + mpg_d->has_valid_timestamps = 0; + return DEMUXER_CTRL_OK; + } + mpg_d->has_valid_timestamps = 1; + return DEMUXER_CTRL_OK; + } default: return DEMUXER_CTRL_NOTIMPL; } diff -Nur MPlayer-1.0pre8.orig/libmpdemux/demux_ogg.c MPlayer-1.0pre8/libmpdemux/demux_ogg.c --- MPlayer-1.0pre8.orig/libmpdemux/demux_ogg.c 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/demux_ogg.c 2006-06-15 23:04:46.000000000 +0300 @@ -1397,7 +1397,7 @@ // Create the ds_stream and the ogg demuxer s = new_ds_stream(demuxer->audio); - od = new_demuxer(s,DEMUXER_TYPE_OGG,0,-2,-2,NULL); + od = new_demuxer(s,DEMUXER_TYPE_OGG,0,-2,-2,NULL,0); /// Add the header packets in the ogg demuxer audio stream // Initial header diff -Nur MPlayer-1.0pre8.orig/libmpdemux/demux_rtp.cpp MPlayer-1.0pre8/libmpdemux/demux_rtp.cpp --- MPlayer-1.0pre8.orig/libmpdemux/demux_rtp.cpp 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/demux_rtp.cpp 2006-06-15 23:04:46.000000000 +0300 @@ -241,7 +241,7 @@ if (demux_is_multiplexed_rtp_stream(demuxer)) { stream_t* s = new_ds_stream(demuxer->video); demuxer_t* od = demux_open(s, DEMUXER_TYPE_UNKNOWN, - audio_id, video_id, dvdsub_id, NULL); + audio_id, video_id, dvdsub_id, NULL, 0, 0, 0); demuxer = new_demuxers_demuxer(od, od, od); } diff -Nur MPlayer-1.0pre8.orig/libmpdemux/demuxer.c MPlayer-1.0pre8/libmpdemux/demuxer.c --- MPlayer-1.0pre8.orig/libmpdemux/demuxer.c 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/demuxer.c 2006-06-15 23:04:46.000000000 +0300 @@ -145,7 +145,7 @@ ds->pos=0; ds->dpos=0; ds->pack_no=0; -//--------------- +//---------------- ds->packs=0; ds->bytes=0; ds->first=ds->last=ds->current=NULL; @@ -180,7 +180,7 @@ } -demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id,char *filename){ +demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id,char *filename,int hideerrmess){ demuxer_t *d=malloc(sizeof(demuxer_t)); memset(d,0,sizeof(demuxer_t)); d->stream=stream; @@ -193,6 +193,7 @@ d->video=new_demuxer_stream(d,v_id); d->sub=new_demuxer_stream(d,s_id); d->type=type; + d->hide_packs_err_mess=hideerrmess; if(type) if (!(d->desc = get_demuxer_desc_from_type(type))) mp_msg(MSGT_DEMUXER,MSGL_ERR,"BUG! Invalid demuxer type in new_demuxer(), big troubles ahead."); @@ -251,6 +252,11 @@ if (!demux_aid_vid_mismatch) mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_ID=%d\n", id); } + ((sh_video_t*)demuxer->v_streams[id])->config_lock=0; + ((sh_video_t*)demuxer->v_streams[id])->config_w=0; + ((sh_video_t*)demuxer->v_streams[id])->config_h=0; + ((sh_video_t*)demuxer->v_streams[id])->config_outfmt=0; + ((sh_video_t*)demuxer->v_streams[id])->enable_mpeg2_reset=0; return demuxer->v_streams[id]; } @@ -370,13 +376,15 @@ return 1; //ds->buffer_size; } if(demux->audio->packs>=MAX_PACKS || demux->audio->bytes>=MAX_PACK_BYTES){ + if (!(demux->hide_packs_err_mess)) { mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_TooManyAudioInBuffer,demux->audio->packs,demux->audio->bytes); - mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI); + mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI); } break; } if(demux->video->packs>=MAX_PACKS || demux->video->bytes>=MAX_PACK_BYTES){ + if (!(demux->hide_packs_err_mess)) { mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_TooManyVideoInBuffer,demux->video->packs,demux->video->bytes); - mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI); + mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI);} break; } if(!demux_fill_buffer(demux,ds)){ @@ -639,7 +647,7 @@ static demuxer_t* demux_open_stream(stream_t *stream, int file_format, int force, int audio_id, int video_id, int dvdsub_id, - char* filename) { + char* filename,int hideerrmess) { //int file_format=(*file_format_ptr); @@ -656,7 +664,7 @@ // If somebody requested a demuxer check it if (file_format) { if ((demuxer_desc = get_demuxer_desc_from_type(file_format))) { - demuxer = new_demuxer(stream,demuxer_desc->type,audio_id,video_id,dvdsub_id,filename); + demuxer = new_demuxer(stream,demuxer_desc->type,audio_id,video_id,dvdsub_id,filename, hideerrmess); if (demuxer_desc->check_file) { fformat = demuxer_desc->check_file(demuxer); if (force) @@ -670,7 +678,7 @@ // Format changed after check, recurse free_demuxer(demuxer); return demux_open_stream(stream, fformat, force, - audio_id, video_id, dvdsub_id, filename); + audio_id, video_id, dvdsub_id, filename, hideerrmess); } } else { // Check failed for forced demuxer, quit @@ -687,7 +695,7 @@ // Test demuxers with safe file checks for (i = 0; (demuxer_desc = demuxer_list[i]); i++) { if (demuxer_desc->safe_check) { - demuxer = new_demuxer(stream,demuxer_desc->type,audio_id,video_id,dvdsub_id,filename); + demuxer = new_demuxer(stream,demuxer_desc->type,audio_id,video_id,dvdsub_id,filename, hideerrmess); if ((fformat = demuxer_desc->check_file(demuxer)) != 0) { if (fformat == demuxer_desc->type) { mp_msg(MSGT_DEMUXER, MSGL_INFO, MSGTR_Detected_XXX_FileFormat, demuxer_desc->shortdesc); @@ -699,7 +707,7 @@ // Format changed after check, recurse free_demuxer(demuxer); demuxer=demux_open_stream(stream, fformat, force, - audio_id, video_id, dvdsub_id, filename); + audio_id, video_id, dvdsub_id, filename, hideerrmess); if(demuxer) return demuxer; // done! file_format = DEMUXER_TYPE_UNKNOWN; } @@ -722,7 +730,7 @@ if(file_format!=DEMUXER_TYPE_UNKNOWN){ // we like recursion :) demuxer=demux_open_stream(stream, file_format, force, - audio_id, video_id, dvdsub_id, filename); + audio_id, video_id, dvdsub_id, filename, hideerrmess); if(demuxer) return demuxer; // done! file_format=DEMUXER_TYPE_UNKNOWN; // continue fuzzy guessing... mp_msg(MSGT_DEMUXER,MSGL_V,"demuxer: continue fuzzy content-based format guessing...\n"); @@ -732,7 +740,7 @@ // Try detection for all other demuxers for (i = 0; (demuxer_desc = demuxer_list[i]); i++) { if (!demuxer_desc->safe_check && demuxer_desc->check_file) { - demuxer = new_demuxer(stream,demuxer_desc->type,audio_id,video_id,dvdsub_id,filename); + demuxer = new_demuxer(stream,demuxer_desc->type,audio_id,video_id,dvdsub_id,filename, hideerrmess); if ((fformat = demuxer_desc->check_file(demuxer)) != 0) { if (fformat == demuxer_desc->type) { mp_msg(MSGT_DEMUXER, MSGL_INFO, MSGTR_Detected_XXX_FileFormat, demuxer_desc->shortdesc); @@ -744,7 +752,7 @@ // Format changed after check, recurse free_demuxer(demuxer); demuxer=demux_open_stream(stream, fformat, force, - audio_id, video_id, dvdsub_id, filename); + audio_id, video_id, dvdsub_id, filename, hideerrmess); if(demuxer) return demuxer; // done! file_format = DEMUXER_TYPE_UNKNOWN; } @@ -797,7 +805,7 @@ extern float stream_cache_min_percent; extern float stream_cache_seek_min_percent; -demuxer_t* demux_open(stream_t *vs,int file_format,int audio_id,int video_id,int dvdsub_id,char* filename){ +demuxer_t* demux_open(stream_t *vs,int file_format,int audio_id,int video_id,int dvdsub_id,char* filename,int hideerrmess){ stream_t *as = NULL,*ss = NULL; demuxer_t *vd,*ad = NULL,*sd = NULL; int afmt =DEMUXER_TYPE_UNKNOWN,sfmt = DEMUXER_TYPE_UNKNOWN ; @@ -842,7 +850,7 @@ vd = demux_open_stream(vs, demuxer_type ? demuxer_type : file_format, demuxer_force, audio_stream ? -2 : audio_id, video_id, - sub_stream ? -2 : dvdsub_id, filename); + sub_stream ? -2 : dvdsub_id, filename, hideerrmess); if(!vd) { if(as) free_stream(as); if(ss) free_stream(ss); @@ -850,7 +858,7 @@ } if(as) { ad = demux_open_stream(as, audio_demuxer_type ? audio_demuxer_type : afmt, - audio_demuxer_force, audio_id, -2, -2, audio_stream); + audio_demuxer_force, audio_id, -2, -2, audio_stream, hideerrmess); if(!ad) { mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_OpeningAudioDemuxerFailed,audio_stream); free_stream(as); @@ -860,7 +868,7 @@ } if(ss) { sd = demux_open_stream(ss, sub_demuxer_type ? sub_demuxer_type : sfmt, - sub_demuxer_force, -2, -2, dvdsub_id, sub_stream); + sub_demuxer_force, -2, -2, dvdsub_id, sub_stream, hideerrmess); if(!sd) { mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_OpeningSubtitlesDemuxerFailed,sub_stream); free_stream(ss); @@ -976,6 +984,11 @@ int demux_control(demuxer_t *demuxer, int cmd, void *arg) { + switch (cmd) { + case DEMUXER_CTRL_SETHIDEPACKSERR: + demuxer->hide_packs_err_mess=*((int*)arg); + return DEMUXER_CTRL_OK; + } if (demuxer->desc->control) return demuxer->desc->control(demuxer,cmd,arg); @@ -1021,3 +1034,16 @@ index = demuxer->audio->id; return index; } + +void demuxer_set_hidemess(demuxer_t *demuxer, int hideflg) +{ + demux_control(demuxer, DEMUXER_CTRL_SETHIDEPACKSERR,(void *)&hideflg); + return; +} + +void demuxer_update_time_pts(demuxer_t *demuxer, float final_pts, off_t endpos) { +demuxer->stream->start_pos=0; +demuxer->stream->end_pos=endpos; +demuxer->movi_end=endpos; +demux_control(demuxer, DEMUXER_CTRL_SET_TIME_PTS,(void *)&final_pts); +} diff -Nur MPlayer-1.0pre8.orig/libmpdemux/demuxer.h MPlayer-1.0pre8/libmpdemux/demuxer.h --- MPlayer-1.0pre8.orig/libmpdemux/demuxer.h 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/demuxer.h 2006-06-15 23:04:46.000000000 +0300 @@ -73,6 +73,9 @@ #define DEMUXER_CTRL_GET_PERCENT_POS 11 #define DEMUXER_CTRL_SWITCH_AUDIO 12 +#define DEMUXER_CTRL_SETHIDEPACKSERR 13 +#define DEMUXER_CTRL_SET_TIME_PTS 14 + // Holds one packet/frame/whatever typedef struct demux_packet_st { int len; @@ -168,6 +171,9 @@ demux_stream_t *audio; // audio buffer/demuxer demux_stream_t *video; // video buffer/demuxer demux_stream_t *sub; // dvd subtitle buffer/demuxer +// -------------- + int hide_packs_err_mess; +// -------------- // stream headers: void* a_streams[MAX_A_STREAMS]; // audio streams (sh_audio_t) @@ -251,7 +257,7 @@ } demux_stream_t* new_demuxer_stream(struct demuxer_st *demuxer,int id); -demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id,char *filename); +demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id,char *filename,int hideerrmess); void free_demuxer_stream(demux_stream_t *ds); void free_demuxer(demuxer_t *demuxer); @@ -315,7 +321,7 @@ return a*10+b; } -demuxer_t* demux_open(stream_t *stream,int file_format,int aid,int vid,int sid,char* filename); +demuxer_t* demux_open(stream_t *stream,int file_format,int aid,int vid,int sid,char* filename,int hideerrmess); int demux_seek(demuxer_t *demuxer,float rel_seek_secs,float audio_delay,int flags); demuxer_t* new_demuxers_demuxer(demuxer_t* vd, demuxer_t* ad, demuxer_t* sd); @@ -349,3 +355,7 @@ extern void demuxer_help(void); extern int get_demuxer_type_from_name(char *demuxer_name, int *force); + +void demuxer_set_hidemess(demuxer_t *demuxer, int hideflg); + +void demuxer_update_time_pts(demuxer_t *demuxer, float final_pts, off_t endpos); diff -Nur MPlayer-1.0pre8.orig/libmpdemux/stheader.h MPlayer-1.0pre8/libmpdemux/stheader.h --- MPlayer-1.0pre8.orig/libmpdemux/stheader.h 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/stheader.h 2006-06-15 23:04:46.000000000 +0300 @@ -84,6 +84,12 @@ void* ImageDesc; // for quicktime codecs // codec-specific: void* context; // codec-specific stuff (usually HANDLE or struct pointer) + + int config_lock; + int config_w; + int config_h; + unsigned int config_outfmt; + int enable_mpeg2_reset; } sh_video_t; // demuxer.c: diff -Nur MPlayer-1.0pre8.orig/libmpdemux/stream.c MPlayer-1.0pre8/libmpdemux/stream.c --- MPlayer-1.0pre8.orig/libmpdemux/stream.c 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/stream.c 2006-06-15 23:04:46.000000000 +0300 @@ -115,7 +115,7 @@ &stream_info_dvd, #endif #ifdef USE_DVDNAV - &stream_info_dvdnav; + &stream_info_dvdnav, #endif &stream_info_null, diff -Nur MPlayer-1.0pre8.orig/libmpdemux/stream.h MPlayer-1.0pre8/libmpdemux/stream.h --- MPlayer-1.0pre8.orig/libmpdemux/stream.h 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/stream.h 2006-06-15 23:11:04.000000000 +0300 @@ -50,6 +50,70 @@ #define STREAM_CTRL_RESET 0 #define STREAM_CTRL_GET_TIME_LENGTH 1 +#define STREAM_CTRL_LANG_FROM_SID 2 +#define STREAM_CTRL_SID_FROM_LANG 3 +#define STREAM_CTRL_AID_FROM_LANG 4 +typedef struct dvd_idfromlang_st { + unsigned char* lang; + int id; + } dvd_idfromlang_t; +#define STREAM_CTRL_NUMBER_OF_SUBS 5 +#define STREAM_CTRL_DVDNAV_REALLYEOF 6 +#define STREAM_CTRL_DVDNAV_EVENT_STOP 7 +#define STREAM_CTRL_DVDNAV_EVENT_WAIT 8 +#define STREAM_CTRL_DVDNAV_EVENT_STILL 10 +#define STREAM_CTRL_DVDNAV_EVENT_VTS 11 +#define STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN 12 +#define STREAM_CTRL_GET_AUDIO_ID 13 +#define STREAM_CTRL_GET_DVDSUB_ID 14 +#define STREAM_CTRL_DVDNAV_EVENT_CELL 15 +#define STREAM_CTRL_DVDNAV_REALLY_CHANGE 16 +#define STREAM_CTRL_DVDNAV_TITLESET 17 +#define STREAM_CTRL_DVDNAV_IS_NEW_TITLE 18 +#define STREAM_CTRL_DVDNAV_EVENT_SPU_CLUT 19 +#define STREAM_CTRL_GET_SPU_CLUT 20 +typedef uint32_t spu_clut_t[16]; +#define STREAM_CTRL_GET_SPU_PALETTE 21 +typedef uint32_t spu_palette_t; +#define STREAM_CTRL_DVDNAV_EVENT_HIGHLIGHT 22 +#define STREAM_CTRL_DVDNAV_EVENT_NAV_PACKET 23 +#define STREAM_CTRL_DVDNAV_EVENT_CLEAR 24 +#define STREAM_CTRL_DVDNAV_STILLOK 25 +typedef struct { + int display; + uint32_t palette; + uint16_t sx,sy,ex,ey; + uint32_t pts; + uint32_t buttonN; +} mp_highlight_t; +#define STREAM_CTRL_DVDNAV_GET_HIGHLIGHT_SHOW 28 +#define STREAM_CTRL_DVDNAV_GET_HIGHLIGHT_ACTIVATE 29 +#define STREAM_CTRL_CHANGE_ASPECT 30 +#define STREAM_CTRL_GET_ASPECT 31 +#define STREAM_CTRL_SYNC_ASPECT 32 +#define STREAM_CTRL_DVDNAV_SET_LOCKSEEK 33 +#define STREAM_CTRL_GET_FINALPTS 34 +#define STREAM_CTRL_GET_TLEN 35 +#define STREAM_CTRL_DVDNAV_MOUSE 36 +#define STREAM_CTRL_DVDNAV_TITLE_PLAY 37 +#define STREAM_CTRL_DVDNAV_PART_PLAY 38 +#define STREAM_CTRL_DVDNAV_MENUCALL 39 +#define DVD_MENUCALL_Escape 0 +#define DVD_MENUCALL_Title 2 +#define DVD_MENUCALL_Root 3 +#define DVD_MENUCALL_Subpicture 4 +#define DVD_MENUCALL_Audio 5 +#define DVD_MENUCALL_Angle 6 +#define DVD_MENUCALL_Part 7 +#define STREAM_CTRL_DVDNAV_MENUFORCE 40 +#define STREAM_CTRL_DVDNAV_MENU_ACTION 41 +#define STREAM_CTRL_FULL_START 42 +#define STREAM_CTRL_SET_ALANG 43 +#define STREAM_CTRL_SET_SLANG 44 +#define STREAM_CTRL_SET_MLANG 45 +#define STREAM_CTRL_DVDNAV_GET_MENU_SID 46 +#define STREAM_CTRL_GET_PALETTE 47 + #ifdef MPLAYER_NETWORK #include "network.h" #endif @@ -290,10 +354,45 @@ extern int dvd_angle; //#endif +extern int dvbin_param_on; + extern char * audio_stream; #ifdef USE_DVDNAV -#include "dvdnav_stream.h" +extern int dvd_nav_skip_opening; +extern int dvd_nav_still; +extern int dvdnav_menutype; /* dvdnav menu type: 0-SPU, 1-BOX, 2-SPU&BOX */ +extern int dvdnav_continue_play; +extern int dvdnav_go_title; /* dvdnav_title_play */ +extern int dvdnav_go_part; /* dvdnav_part_play */ +extern int dvdnav_go_menu; /* call main menu */ +extern int dvdnav_go_menu_force; /* call force main menu with skip intro*/ +extern int dvdnav_go_audio; /* dvdnav set new audio stream */ +extern int dvdnav_go_spu; /* dbdnav set new spu stream */ +extern int dvdnav_force_menu; /* force display menu with simple box */ +extern int dvdnav_skipintro; /* skip intro before dvd menu */ +extern int dvdnav_color_spu; /* enable color spu buttons */ +extern int dvdnav_still_repeat; /* still pgc repeat count */ +#ifdef USE_MPDVDNAV_TRACE +extern int dvdnav_trace; /* print trace messages (only devel)*/ +#endif +extern char* dvdmenu_lang; /* nav menu language */ + +#ifdef HAVE_NEW_GUI +extern int dvdnav_window_width; +extern int dvdnav_window_height; +extern int dvdnav_window_orig_width; +extern int dvdnav_window_orig_height; +extern int dvdnav_mouse_x; +extern int dvdnav_mouse_y; +extern int dvdnav_mouse_button; +extern int dvdnav_mouse_set; +#endif + +// dvdnav menu button types +#define DVDNAV_MENUTYPE_SPU 0 +#define DVDNAV_MENUTYPE_BOX 1 +#define DVDNAV_MENUTYPE_SPU_BOX 2 #endif #ifdef USE_DVDREAD diff -Nur MPlayer-1.0pre8.orig/libmpdemux/test.c MPlayer-1.0pre8/libmpdemux/test.c --- MPlayer-1.0pre8.orig/libmpdemux/test.c 2006-06-11 21:35:46.000000000 +0300 +++ MPlayer-1.0pre8/libmpdemux/test.c 2006-06-15 23:04:46.000000000 +0300 @@ -69,7 +69,7 @@ if(stream_cache_size) stream_enable_cache(stream,stream_cache_size,0,0); - demuxer=demux_open(stream,file_format,-1,-1,-1,NULL); + demuxer=demux_open(stream,file_format,-1,-1,-1,NULL,0); if(!demuxer){ printf("Cannot open demuxer\n"); exit(1); diff -Nur MPlayer-1.0pre8.orig/libvo/osd.c MPlayer-1.0pre8/libvo/osd.c --- MPlayer-1.0pre8.orig/libvo/osd.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/osd.c 2006-06-15 23:04:46.000000000 +0300 @@ -11,6 +11,7 @@ #include #include "cpudetect.h" #include "mangle.h" +#include "video_out.h" #if defined(ARCH_X86) || defined(ARCH_X86_64) #define CAN_COMPILE_X86_ASM @@ -101,152 +102,152 @@ #endif //CAN_COMPILE_X86_ASM -void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_yv12(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ #ifdef RUNTIME_CPUDETECT #ifdef CAN_COMPILE_X86_ASM // ordered by speed / fastest first if(gCpuCaps.hasMMX2) - vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.has3DNow) - vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.hasMMX) - vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); else - vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #else //RUNTIME_CPUDETECT #ifdef HAVE_MMX2 - vo_draw_alpha_yv12_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_3DNOW) - vo_draw_alpha_yv12_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_MMX) - vo_draw_alpha_yv12_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined(ARCH_X86) || defined(ARCH_X86_64) - vo_draw_alpha_yv12_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_yv12_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yv12_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #endif //!RUNTIME_CPUDETECT } -void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_yuy2(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ #ifdef RUNTIME_CPUDETECT #ifdef CAN_COMPILE_X86_ASM // ordered by speed / fastest first if(gCpuCaps.hasMMX2) - vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.has3DNow) - vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.hasMMX) - vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); else - vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #else //RUNTIME_CPUDETECT #ifdef HAVE_MMX2 - vo_draw_alpha_yuy2_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_3DNOW) - vo_draw_alpha_yuy2_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_MMX) - vo_draw_alpha_yuy2_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined(ARCH_X86) || defined(ARCH_X86_64) - vo_draw_alpha_yuy2_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_yuy2_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_yuy2_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #endif //!RUNTIME_CPUDETECT } -void vo_draw_alpha_uyvy(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_uyvy(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ #ifdef RUNTIME_CPUDETECT #ifdef CAN_COMPILE_X86_ASM // ordered by speed / fastest first if(gCpuCaps.hasMMX2) - vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.has3DNow) - vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.hasMMX) - vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); else - vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #else //RUNTIME_CPUDETECT #ifdef HAVE_MMX2 - vo_draw_alpha_uyvy_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_3DNOW) - vo_draw_alpha_uyvy_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_MMX) - vo_draw_alpha_uyvy_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined(ARCH_X86) || defined(ARCH_X86_64) - vo_draw_alpha_uyvy_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_uyvy_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_uyvy_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #endif //!RUNTIME_CPUDETECT } -void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_rgb24(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ #ifdef RUNTIME_CPUDETECT #ifdef CAN_COMPILE_X86_ASM // ordered by speed / fastest first if(gCpuCaps.hasMMX2) - vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.has3DNow) - vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.hasMMX) - vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); else - vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #else //RUNTIME_CPUDETECT #ifdef HAVE_MMX2 - vo_draw_alpha_rgb24_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_3DNOW) - vo_draw_alpha_rgb24_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_MMX) - vo_draw_alpha_rgb24_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined(ARCH_X86) || defined(ARCH_X86_64) - vo_draw_alpha_rgb24_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_rgb24_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb24_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #endif //!RUNTIME_CPUDETECT } -void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_rgb32(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ #ifdef RUNTIME_CPUDETECT #ifdef CAN_COMPILE_X86_ASM // ordered by speed / fastest first if(gCpuCaps.hasMMX2) - vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.has3DNow) - vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); else if(gCpuCaps.hasMMX) - vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); else - vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #else //RUNTIME_CPUDETECT #ifdef HAVE_MMX2 - vo_draw_alpha_rgb32_MMX2(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_MMX2(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_3DNOW) - vo_draw_alpha_rgb32_3DNow(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_3DNow(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined (HAVE_MMX) - vo_draw_alpha_rgb32_MMX(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_MMX(w, h, dp, src, srca, srcstride, dstbase, dststride); #elif defined(ARCH_X86) || defined(ARCH_X86_64) - vo_draw_alpha_rgb32_X86(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_X86(w, h, dp, src, srca, srcstride, dstbase, dststride); #else - vo_draw_alpha_rgb32_C(w, h, src, srca, srcstride, dstbase, dststride); + vo_draw_alpha_rgb32_C(w, h, dp, src, srca, srcstride, dstbase, dststride); #endif #endif //!RUNTIME_CPUDETECT } @@ -297,8 +298,10 @@ } } -void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_rgb15(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ int y; +switch (dp) { + case DEST_PLANES_Y : for(y=0;y>5)&0x1F; + unsigned char b=(dst[x]>>10)&0x1F; + r=(((r*srca[x])>>5)+src[x])>>3; + dst[x]=(b<<10)|(g<<5)|r; + } + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + case DEST_PLANES_G: + for(y=0;y>5)&0x1F; + unsigned char b=(dst[x]>>10)&0x1F; + g=(((g*srca[x])>>5)+src[x])>>3; + dst[x]=(b<<10)|(g<<5)|r; + } + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + case DEST_PLANES_BR: + for(y=0;y>5)&0x1F; + unsigned char b=(dst[x]>>10)&0x1F; + b=(((b*srca[x])>>5)+src[x])>>3; + dst[x]=(b<<10)|(g<<5)|r; + } + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + } } -void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +void vo_draw_alpha_rgb16(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ int y; +switch (dp) { + case DEST_PLANES_Y : for(y=0;y>11)&0x1F; + unsigned char g=(dst[x]>>5)&0x3F; + r=(((r*srca[x])>>5)+src[x])>>3; + dst[x]=(b<<11)|(g<<5)|r; + } + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + case DEST_PLANES_G : + for(y=0;y>5)&0x3F; + unsigned char b=(dst[x]>>11)&0x1F; + g=(((g*srca[x])>>6)+src[x])>>2; + dst[x]=(b<<11)|(g<<5)|r; + } + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + case DEST_PLANES_BR : + for(y=0;y>5)&0x3F; + unsigned char b=(dst[x]>>11)&0x1F; + b=(((b*srca[x])>>5)+src[x])>>3; + dst[x]=(b<<11)|(g<<5)|r; + } + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + } } diff -Nur MPlayer-1.0pre8.orig/libvo/osd.h MPlayer-1.0pre8/libvo/osd.h --- MPlayer-1.0pre8.orig/libvo/osd.h 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/osd.h 2006-06-15 23:04:46.000000000 +0300 @@ -7,13 +7,13 @@ extern void vo_draw_alpha_init(void); // build tables -extern void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_yuy2(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_uyvy(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb15(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); -extern void vo_draw_alpha_rgb16(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_yv12(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_yuy2(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_uyvy(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_rgb24(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_rgb32(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_rgb15(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); +extern void vo_draw_alpha_rgb16(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride); #endif diff -Nur MPlayer-1.0pre8.orig/libvo/osd_template.c MPlayer-1.0pre8/libvo/osd_template.c --- MPlayer-1.0pre8.orig/libvo/osd_template.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/osd_template.c 2006-06-15 23:19:12.000000000 +0300 @@ -27,7 +27,7 @@ #define EMMS "emms" #endif -static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +static inline void RENAME(vo_draw_alpha_yv12)(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ int y; #if defined(FAST_OSD) && !defined(HAVE_MMX) w=w>>1; @@ -93,7 +93,7 @@ return; } -static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +static inline void RENAME(vo_draw_alpha_yuy2)(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ int y; #if defined(FAST_OSD) && !defined(HAVE_MMX) w=w>>1; @@ -160,7 +160,7 @@ return; } -static inline void RENAME(vo_draw_alpha_uyvy)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +static inline void RENAME(vo_draw_alpha_uyvy)(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ int y; #if defined(FAST_OSD) w=w>>1; @@ -184,8 +184,10 @@ } } -static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +static inline void RENAME(vo_draw_alpha_rgb24)(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ int y; +switch (dp) { + case DEST_PLANES_Y: for(y=0;y>8)+src[x]; + } + dst+=3; // 24bpp + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + case DEST_PLANES_G: + for(y=0;y>8)+src[x]; + } + dst+=3; // 24bpp + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + case DEST_PLANES_BR: + for(y=0;y>8)+src[x]; + } + dst+=3; // 24bpp + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + } } -static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ +static inline void RENAME(vo_draw_alpha_rgb32)(int w,int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){ int y; #ifdef WORDS_BIGENDIAN dstbase++; #endif +switch (dp) { + case DEST_PLANES_Y: for(y=0;y>8)+src[x])&0xff; + } + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + case DEST_PLANES_G: + for(y=0;y>8)+src[x])&0xff; + } + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + case DEST_PLANES_BR: + for(y=0;y>8)+src[x])&0xff; + } + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; + } + return; + } } diff -Nur MPlayer-1.0pre8.orig/libvo/sub.c MPlayer-1.0pre8/libvo/sub.c --- MPlayer-1.0pre8.orig/libvo/sub.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/sub.c 2006-06-15 23:04:46.000000000 +0300 @@ -67,6 +67,14 @@ int sub_bg_color=0; /* subtitles background color */ int sub_bg_alpha=0; int sub_justify=0; +uint16_t dvdnav_sx=0; +uint16_t dvdnav_ex=0; +uint16_t dvdnav_sy=0; +uint16_t dvdnav_ey=0; +int dvdnav_show=0; +unsigned char dvdnav_image=0x7f; +unsigned char dvdnav_alpha=0x7f; + // return the real height of a char: static inline int get_height(int c,int h){ @@ -129,11 +137,12 @@ } // renders the buffer -inline static void vo_draw_text_from_buffer(mp_osd_obj_t* obj,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){ +inline static void vo_draw_text_from_buffer(mp_osd_obj_t* obj,void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)){ if (obj->allocated > 0) { draw_alpha(obj->bbox.x1,obj->bbox.y1, obj->bbox.x2-obj->bbox.x1, obj->bbox.y2-obj->bbox.y1, + DEST_PLANES_Y, obj->bitmap_buffer, obj->alpha_buffer, obj->stride); @@ -177,6 +186,48 @@ } } +#undef max +#define max(x,y) ((x) > (y) ? (x) : (y)) +#undef min +#define min(x,y) ((x) < (y) ? (x) : (y)) + +void dvdnav_box_area(int sx, int sy, int ex, int ey, int show, unsigned char image, unsigned char alpha) +{ + dvdnav_sx=min(sx,ex); + dvdnav_ex=max(sx,ex); + dvdnav_sy=min(sy,ey); + dvdnav_ey=max(sy,ey); + dvdnav_show=show; + dvdnav_image=image; + dvdnav_alpha=alpha; +} + + +inline static void vo_update_dvdnav(mp_osd_obj_t* obj,int dxs,int dys){ + +unsigned char * bitmap_buffer; +unsigned char * alpha_buffer; +int len; +int stride; + +if (dvdnav_show) + { + obj->bbox.x1=obj->x=dvdnav_sx; + obj->bbox.y1=obj->y=dvdnav_sy; + obj->bbox.x2=dvdnav_ex; + obj->bbox.y2=dvdnav_ey; + alloc_buf(obj); + len = obj->stride*(obj->bbox.y2-obj->bbox.y1); +//printf("dvdnav box image: %x alpha: %x \n",dvdnav_image,dvdnav_alpha); + memset(obj->bitmap_buffer,dvdnav_image,len); + memset(obj->alpha_buffer,dvdnav_alpha,len); + obj->flags|=OSDFLAG_BBOX|OSDFLAG_VISIBLE|OSDFLAG_CHANGED; + } + else + obj->flags&=~OSDFLAG_VISIBLE; +} + + int vo_osd_progbar_type=-1; int vo_osd_progbar_value=100; // 0..256 @@ -721,7 +772,7 @@ obj->flags |= OSDFLAG_BBOX; } -inline static void vo_draw_spudec_sub(mp_osd_obj_t* obj, void (*draw_alpha)(int x0, int y0, int w, int h, unsigned char* src, unsigned char* srca, int stride)) +inline static void vo_draw_spudec_sub(mp_osd_obj_t* obj, void (*draw_alpha)(int x0, int y0, int w, int h, int dp, unsigned char* src, unsigned char* srca, int stride)) { spudec_draw_scaled(vo_spudec, obj->dxs, obj->dys, draw_alpha); } @@ -801,6 +852,10 @@ int vis=obj->flags&OSDFLAG_VISIBLE; obj->flags&=~OSDFLAG_BBOX; switch(obj->type){ + case OSDTYPE_DVDNAV: + vo_update_dvdnav(obj,dxs,dys); + obj->flags|=OSDFLAG_CHANGED; + break; case OSDTYPE_SUBTITLE: vo_update_text_sub(obj,dxs,dys); break; @@ -868,6 +923,7 @@ new_osd_obj(OSDTYPE_SUBTITLE); new_osd_obj(OSDTYPE_PROGBAR); new_osd_obj(OSDTYPE_SPU); + new_osd_obj(OSDTYPE_DVDNAV); #ifdef HAVE_FREETYPE force_load_font = 1; #endif @@ -893,7 +949,7 @@ } } -void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){ +void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)){ mp_osd_obj_t* obj=vo_osd_list; vo_update_osd(dxs,dys); while(obj){ @@ -903,6 +959,7 @@ case OSDTYPE_SPU: vo_draw_spudec_sub(obj, draw_alpha); // FIXME break; + case OSDTYPE_DVDNAV: case OSDTYPE_OSD: case OSDTYPE_SUBTITLE: case OSDTYPE_PROGBAR: diff -Nur MPlayer-1.0pre8.orig/libvo/sub.h MPlayer-1.0pre8/libvo/sub.h --- MPlayer-1.0pre8.orig/libvo/sub.h 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/sub.h 2006-06-15 23:04:46.000000000 +0300 @@ -10,6 +10,8 @@ #define OSDTYPE_SUBTITLE 2 #define OSDTYPE_PROGBAR 3 #define OSDTYPE_SPU 4 +#define OSDTYPE_DVDNAV 5 +void dvdnav_box_area(int sx, int sy, int ex, int ey, int show, unsigned char image, unsigned char alpha); #define OSDFLAG_VISIBLE 1 #define OSDFLAG_CHANGED 2 @@ -51,7 +53,7 @@ #if 0 // disable subtitles: -static inline void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){ +static inline void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)){ } #else @@ -110,7 +112,7 @@ //extern void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); //extern void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); //extern void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); -extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); +extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)); extern void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h)); void vo_init_osd(void); diff -Nur MPlayer-1.0pre8.orig/libvo/vesa_lvo.c MPlayer-1.0pre8/libvo/vesa_lvo.c --- MPlayer-1.0pre8.orig/libvo/vesa_lvo.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vesa_lvo.c 2006-06-15 23:04:46.000000000 +0300 @@ -233,50 +233,51 @@ } } -static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_null(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride) { UNUSED(x0); UNUSED(y0); UNUSED(w); UNUSED(h); + UNUSED(dp); UNUSED(src); UNUSED(srca); UNUSED(stride); } -static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride) { uint32_t bespitch = /*(*/mga_vid_config.src_width;// + 15) & ~15; switch(mga_vid_config.format){ case IMGFMT_BGR15: case IMGFMT_RGB15: - vo_draw_alpha_rgb15(w,h,src,srca,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch); + vo_draw_alpha_rgb15(w,h,dp,src,srca,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch); break; case IMGFMT_BGR16: case IMGFMT_RGB16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch); + vo_draw_alpha_rgb16(w,h,dp,src,srca,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch); break; case IMGFMT_BGR24: case IMGFMT_RGB24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,lvo_mem+3*(y0*bespitch+x0),3*bespitch); + vo_draw_alpha_rgb24(w,h,dp,src,srca,stride,lvo_mem+3*(y0*bespitch+x0),3*bespitch); break; case IMGFMT_BGR32: case IMGFMT_RGB32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,lvo_mem+4*(y0*bespitch+x0),4*bespitch); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,lvo_mem+4*(y0*bespitch+x0),4*bespitch); break; case IMGFMT_YV12: case IMGFMT_IYUV: case IMGFMT_I420: - vo_draw_alpha_yv12(w,h,src,srca,stride,lvo_mem+bespitch*y0+x0,bespitch); + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,lvo_mem+bespitch*y0+x0,bespitch); break; case IMGFMT_YUY2: - vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+2*(bespitch*y0+x0),bespitch); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,lvo_mem+2*(bespitch*y0+x0),bespitch); break; case IMGFMT_UYVY: - vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+2*(bespitch*y0+x0)+1,bespitch); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,lvo_mem+2*(bespitch*y0+x0)+1,bespitch); break; default: - draw_alpha_null(x0,y0,w,h,src,srca,stride); + draw_alpha_null(x0,y0,w,h,dp,src,srca,stride); } } diff -Nur MPlayer-1.0pre8.orig/libvo/video_out.h MPlayer-1.0pre8/libvo/video_out.h --- MPlayer-1.0pre8.orig/libvo/video_out.h 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/video_out.h 2006-06-15 23:04:46.000000000 +0300 @@ -74,6 +74,11 @@ int w,h; } mp_win_t; +#define VOCTRL_YUVSPU_SUPPORT 28 +#define VOCTRL_RGBSPU_SUPPORT 29 +#define VOCTRL_BGRSPU_SUPPORT 30 +#define VOCTRL_YUYSPU_SUPPORT 31 + #define VO_TRUE 1 #define VO_FALSE 0 #define VO_ERROR -1 @@ -86,6 +91,15 @@ #define VOFLAG_FLIPPING 0x08 #define VOFLAG_XOVERLAY_SUB_VO 0x10000 +// dest planes (draw_alpha) +#define DEST_PLANES_Y 0 +#define DEST_PLANES_U 1 +#define DEST_PLANES_V 2 +#define DEST_PLANES_RB 3 +#define DEST_PLANES_G 4 +#define DEST_PLANES_BR 5 +#define DEST_PLANES_YUYV 6 + typedef struct vo_info_s { /* driver name ("Matrox Millennium G200/G400" */ diff -Nur MPlayer-1.0pre8.orig/libvo/vo_aa.c MPlayer-1.0pre8/libvo/vo_aa.c --- MPlayer-1.0pre8.orig/libvo/vo_aa.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_aa.c 2006-06-15 23:04:46.000000000 +0300 @@ -531,7 +531,7 @@ } #ifdef USE_OSD -static void draw_alpha(int x,int y, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha(int x,int y, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride){ int i,j; for (i = 0; i < h; i++) { for (j = 0; j < w; j++) { diff -Nur MPlayer-1.0pre8.orig/libvo/vo_dfbmga.c MPlayer-1.0pre8/libvo/vo_dfbmga.c --- MPlayer-1.0pre8.orig/libvo/vo_dfbmga.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_dfbmga.c 2006-06-15 23:04:46.000000000 +0300 @@ -922,7 +922,7 @@ } static void -vo_draw_alpha_alut44( int w, int h, +vo_draw_alpha_alut44( int w, int h, int dp, unsigned char* src, unsigned char *srca, int srcstride, @@ -953,6 +953,7 @@ static void draw_alpha( int x0, int y0, int w, int h, + int dp, unsigned char *src, unsigned char *srca, int stride ) @@ -977,38 +978,47 @@ switch (subframe_format) { case DSPF_ALUT44: - vo_draw_alpha_alut44( w, h, src, srca, stride, + vo_draw_alpha_alut44( w, h, dp, src, srca, stride, ((uint8_t *) dst) + pitch * y0 + x0, pitch ); break; case DSPF_RGB32: case DSPF_ARGB: - vo_draw_alpha_rgb32( w, h, src, srca, stride, + vo_draw_alpha_rgb32( w, h, dp, src, srca, stride, (( uint8_t *) dst) + pitch * y0 + 4 * x0, pitch ); break; case DSPF_RGB24: - vo_draw_alpha_rgb24( w, h, src, srca, stride, + vo_draw_alpha_rgb24( w, h, dp, src, srca, stride, ((uint8_t *) dst) + pitch * y0 + 3 * x0, pitch ); break; case DSPF_RGB16: - vo_draw_alpha_rgb16( w, h, src, srca, stride, + vo_draw_alpha_rgb16( w, h, dp, src, srca, stride, ((uint8_t *) dst) + pitch * y0 + 2 * x0, pitch ); break; case DSPF_ARGB1555: - vo_draw_alpha_rgb15( w, h, src, srca, stride, + vo_draw_alpha_rgb15( w, h, dp, src, srca, stride, ((uint8_t *) dst) + pitch * y0 + 2 * x0, pitch ); break; case DSPF_YUY2: - vo_draw_alpha_yuy2( w, h, src, srca, stride, + switch (dp) { + case DEST_PLANES_Y: + vo_draw_alpha_yuy2( w, h, dp, src, srca, stride, ((uint8_t *) dst) + pitch * y0 + 2 * x0, pitch ); break; + case DEST_PLANES_YUYV: + vo_draw_alpha_yv12( w, h, dp, src, srca, stride, + ((uint8_t *) dst) + pitch * y0 + 2 * x0, + pitch ); + break; + } + break; case DSPF_UYVY: - vo_draw_alpha_yuy2( w, h, src, srca, stride, + vo_draw_alpha_yuy2( w, h, dp, src, srca, stride, ((uint8_t *) dst) + pitch * y0 + 2 * x0 + 1, pitch ); break; @@ -1018,10 +1028,34 @@ #endif case DSPF_I420: case DSPF_YV12: - vo_draw_alpha_yv12( w, h, src, srca, stride, + switch (dp) { + case DEST_PLANES_Y: + vo_draw_alpha_yv12( w, h, dp, src, srca, stride, ((uint8_t *) dst) + pitch * y0 + x0, pitch ); break; + case DEST_PLANES_U: + if (subframe_format==DSPF_YV12) + vo_draw_alpha_yv12( w, h, dp, src, srca, stride, + ((uint8_t *) dst) + pitch * y0 + x0 + pitch * in_height, + pitch ); + else + vo_draw_alpha_yv12( w, h, dp, src, srca, stride, + ((uint8_t *) dst) + pitch * y0 + x0 + pitch * (in_height+in_height/2), + pitch ); + break; + case DEST_PLANES_V: + if (subframe_format==DSPF_YV12) + vo_draw_alpha_yv12( w, h, dp, src, srca, stride, + ((uint8_t *) dst) + pitch * y0 + x0 + pitch * (in_height+in_height/2), + pitch ); + else + vo_draw_alpha_yv12( w, h, dp, src, srca, stride, + ((uint8_t *) dst) + pitch * y0 + x0 + pitch * in_height, + pitch ); + break; + } + break; } subframe->Unlock( subframe ); @@ -1416,6 +1450,18 @@ return get_equalizer( data, value ); } + case VOCTRL_YUVSPU_SUPPORT: + if (subframe_format==DSPF_I420 || subframe_format==DSPF_YV12) return VO_TRUE; + return VO_FALSE; + case VOCTRL_YUYSPU_SUPPORT: + if (subframe_format==DSPF_YUY2) return VO_TRUE; + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + if (subframe_format==DSPF_RGB32 || subframe_format==DSPF_ARGB || subframe_format==DSPF_RGB24 || + subframe_format==DSPF_RGB16 || subframe_format==DSPF_ARGB1555) return VO_TRUE; + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + return VO_FALSE; } return VO_NOTIMPL; diff -Nur MPlayer-1.0pre8.orig/libvo/vo_dga.c MPlayer-1.0pre8/libvo/vo_dga.c --- MPlayer-1.0pre8.orig/libvo/vo_dga.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_dga.c 2006-06-15 23:04:46.000000000 +0300 @@ -227,7 +227,7 @@ //--------------------------------------------------------- -static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { @@ -243,19 +243,19 @@ { case 32: - vo_draw_alpha_rgb32(w, h, src, srca, stride, d + 4 * offset, + vo_draw_alpha_rgb32(w, h, dp, src, srca, stride, d + 4 * offset, 4 * buffer_stride); break; case 24: - vo_draw_alpha_rgb24(w, h, src, srca, stride, d + 3 * offset, + vo_draw_alpha_rgb24(w, h, dp, src, srca, stride, d + 3 * offset, 3 * buffer_stride); break; case 15: - vo_draw_alpha_rgb15(w, h, src, srca, stride, d + 2 * offset, + vo_draw_alpha_rgb15(w, h, dp, src, srca, stride, d + 2 * offset, 2 * buffer_stride); break; case 16: - vo_draw_alpha_rgb16(w, h, src, srca, stride, d + 2 * offset, + vo_draw_alpha_rgb16(w, h, dp, src, srca, stride, d + 2 * offset, 2 * buffer_stride); break; } @@ -982,6 +982,14 @@ return get_image(data); case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t *) data)); + case VOCTRL_YUVSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + if(HW_MODE.vdm_mplayer_depth==32 || HW_MODE.vdm_mplayer_depth==24 || + HW_MODE.vdm_mplayer_depth==15 || HW_MODE.vdm_mplayer_depth==16) return VO_TRUE; + return VO_FALSE; } return VO_NOTIMPL; } diff -Nur MPlayer-1.0pre8.orig/libvo/vo_directfb2.c MPlayer-1.0pre8/libvo/vo_directfb2.c --- MPlayer-1.0pre8.orig/libvo/vo_directfb2.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_directfb2.c 2006-06-15 23:04:46.000000000 +0300 @@ -1445,6 +1445,20 @@ return(directfb_get_video_eq(data, value)); } + case VOCTRL_YUVSPU_SUPPORT: + if (pixel_format==DSPF_I420 || pixel_format==DSPF_YV12) return VO_TRUE; + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + if (pixel_format==DSPF_RGB32 || pixel_format==DSPF_ARGB || pixel_format==DSPF_RGB24 || + pixel_format==DSPF_RGB16) return VO_TRUE; +#if DIRECTFBVERSION > 915 + if (pixel_format==DSPF_ARGB1555) return VO_TRUE; +#else + if (pixel_format==DSPF_RGB15) return VO_TRUE; +#endif + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + return VO_FALSE; }; return VO_NOTIMPL; } @@ -1458,7 +1472,7 @@ // hopefully will be removed soon -static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { void *dst; @@ -1477,35 +1491,51 @@ switch(pixel_format) { case DSPF_RGB32: case DSPF_ARGB: - vo_draw_alpha_rgb32(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 4*x0,pitch); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 4*x0,pitch); break; case DSPF_RGB24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 3*x0,pitch); + vo_draw_alpha_rgb24(w,h,dp,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 3*x0,pitch); break; case DSPF_RGB16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch); + vo_draw_alpha_rgb16(w,h,dp,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch); break; #if DIRECTFBVERSION > 915 case DSPF_ARGB1555: #else case DSPF_RGB15: #endif - vo_draw_alpha_rgb15(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch); + vo_draw_alpha_rgb15(w,h,dp,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch); break; case DSPF_YUY2: - vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 2*x0,pitch); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 2*x0,pitch); break; case DSPF_UYVY: - vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 2*x0 + 1,pitch); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 2*x0 + 1,pitch); break; case DSPF_I420: case DSPF_YV12: - vo_draw_alpha_yv12(w,h,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 1*x0,pitch); + switch (dp) { + case DEST_PLANES_Y: + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) dst) + pitch*y0 + 1*x0,pitch); + break; + case DEST_PLANES_U: + if (pixel_format==DSPF_YV12) + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) dst) + pitch*height/4 + pitch*y0 + 1*x0,pitch); + else + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) dst) + pitch*height/2 + pitch*y0 + 1*x0,pitch); + break; + case DEST_PLANES_V: + if (pixel_format==DSPF_YV12) + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) dst) + pitch*height/2 + pitch*y0 + 1*x0,pitch); + else + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) dst) + pitch*height/4 + pitch*y0 + 1*x0,pitch); + break; + } break; } diff -Nur MPlayer-1.0pre8.orig/libvo/vo_directx.c MPlayer-1.0pre8/libvo/vo_directx.c --- MPlayer-1.0pre8.orig/libvo/vo_directx.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_directx.c 2006-06-15 23:04:46.000000000 +0300 @@ -82,7 +82,7 @@ static RECT last_rect = {0xDEADC0DE, 0xDEADC0DE, 0xDEADC0DE, 0xDEADC0DE}; extern void mplayer_put_key(int code); //let mplayer handel the keyevents -extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); +extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)); extern int vidmode; /***************************************************************************** @@ -140,37 +140,62 @@ LIBVO_EXTERN(directx) -static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { + uint8_t *d; + uint32_t uvstride=dstride/2; switch(image_format) { case IMGFMT_YV12 : case IMGFMT_I420 : case IMGFMT_IYUV : case IMGFMT_YVU9 : - vo_draw_alpha_yv12(w,h,src,srca,stride,((uint8_t *) image) + dstride*y0 + x0,dstride); + switch (dp) { + case DEST_PLANES_Y: + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) image) + dstride*y0 + x0,dstride); + break; + case DEST_PLANES_U: + if(image_format == IMGFMT_YV12) + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) image) + image_height*dstride + uvstride*y0 + x0,uvstride); + else + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) image) + image_height*dstride + uvstride*(image_height/2) + uvstride*y0 + x0,uvstride); + break; + case DEST_PLANES_V: + if(image_format == IMGFMT_YV12) + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) image) + image_height*dstride + uvstride*(image_height/2) + uvstride*y0 + x0,uvstride); + else + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) image) + image_height*dstride + uvstride*y0 + x0,uvstride); + break; + } break; case IMGFMT_YUY2 : - vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) image)+ dstride*y0 + 2*x0 ,dstride); + switch (dp) { + case DEST_PLANES_Y: + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,((uint8_t *) image)+ dstride*y0 + 2*x0 ,dstride); + break; + case DEST_PLANES_YUYV: + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) image)+ dstride*y0 + 2*x0 ,dstride); + break; + } break; case IMGFMT_UYVY : - vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) image) + dstride*y0 + 2*x0 + 1,dstride); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,((uint8_t *) image) + dstride*y0 + 2*x0 + 1,dstride); break; case IMGFMT_RGB15: case IMGFMT_BGR15: - vo_draw_alpha_rgb15(w,h,src,srca,stride,((uint8_t *) image)+dstride*y0+2*x0,dstride); + vo_draw_alpha_rgb15(w,h,dp,src,srca,stride,((uint8_t *) image)+dstride*y0+2*x0,dstride); break; case IMGFMT_RGB16: case IMGFMT_BGR16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) image)+dstride*y0+2*x0,dstride); + vo_draw_alpha_rgb16(w,h,dp,src,srca,stride,((uint8_t *) image)+dstride*y0+2*x0,dstride); break; case IMGFMT_RGB24: case IMGFMT_BGR24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,((uint8_t *) image)+dstride*y0+4*x0,dstride); + vo_draw_alpha_rgb24(w,h,dp,src,srca,stride,((uint8_t *) image)+dstride*y0+4*x0,dstride); break; case IMGFMT_RGB32: case IMGFMT_BGR32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,((uint8_t *) image)+dstride*y0+4*x0,dstride); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,((uint8_t *) image)+dstride*y0+4*x0,dstride); break; } } @@ -1596,6 +1621,25 @@ va_end(ap); return color_ctrl_get(data, value); } + case VOCTRL_YUVSPU_SUPPORT: { + if (image_format==IMGFMT_YV12 || image_format==IMGFMT_I420 || + image_format==IMGFMT_IYUV || image_format==IMGFMT_YVU9) return VO_TRUE; + return VO_FALSE; + } + case VOCTRL_YUYSPU_SUPPORT: { + if (image_format==IMGFMT_YUY2) return VO_TRUE; + return VO_FALSE; + } + case VOCTRL_RGBSPU_SUPPORT: { + if (image_format==IMGFMT_RGB15 || image_format==IMGFMT_RGB16 || + image_format==IMGFMT_RGB32) return VO_TRUE; + return VO_FALSE; + } + case VOCTRL_BGRSPU_SUPPORT: { + if (image_format==IMGFMT_BGR15 || image_format==IMGFMT_BGR16 || + image_format==IMGFMT_BGR32) return VO_TRUE; + return VO_FALSE; + } case VOCTRL_RESET: last_rect.left = 0xDEADC0DE; // reset window position cache // fall-through intended diff -Nur MPlayer-1.0pre8.orig/libvo/vo_dxr3.c MPlayer-1.0pre8/libvo/vo_dxr3.c --- MPlayer-1.0pre8.orig/libvo/vo_dxr3.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_dxr3.c 2006-06-15 23:04:46.000000000 +0300 @@ -677,7 +677,7 @@ return 0; } -static void draw_alpha(int x, int y, int w, int h, unsigned char* src, unsigned char *srca, int srcstride) +static void draw_alpha(int x, int y, int w, int h, int dp, unsigned char* src, unsigned char *srca, int srcstride) { #ifdef SPU_SUPPORT unsigned char *buf = &osdpicbuf[(y * osdpicbuf_w) + x]; diff -Nur MPlayer-1.0pre8.orig/libvo/vo_fbdev.c MPlayer-1.0pre8/libvo/vo_fbdev.c --- MPlayer-1.0pre8.orig/libvo/vo_fbdev.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_fbdev.c 2006-06-15 23:04:46.000000000 +0300 @@ -562,7 +562,7 @@ static int fb_line_len; static int fb_xres; static int fb_yres; -static void (*draw_alpha_p)(int w, int h, unsigned char *src, +static void (*draw_alpha_p)(int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride, unsigned char *dst, int dstride); @@ -1053,14 +1053,14 @@ return 0; } -static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { unsigned char *dst; dst = center + fb_line_len * y0 + fb_pixel_size * x0; - (*draw_alpha_p)(w, h, src, srca, stride, dst, fb_line_len); + (*draw_alpha_p)(w, h, dp, src, srca, stride, dst, fb_line_len); } static int draw_frame(uint8_t *src[]) { return 1; } @@ -1174,6 +1174,13 @@ return get_image(data); case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); + case VOCTRL_YUVSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + if (fb_bpp == 32 || fb_bpp==24 || fb_bpp==16 || fb_bpp==15) return VO_TRUE; + return VO_FALSE; } #ifdef CONFIG_VIDIX diff -Nur MPlayer-1.0pre8.orig/libvo/vo_fbdev2.c MPlayer-1.0pre8/libvo/vo_fbdev2.c --- MPlayer-1.0pre8.orig/libvo/vo_fbdev2.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_fbdev2.c 2006-06-15 23:04:46.000000000 +0300 @@ -79,7 +79,7 @@ static int fb_bpp; // 32: 32 24: 24 16: 16 15: 15 static size_t fb_size; // size of frame_buffer static int fb_line_len; // length of one line in bytes -static void (*draw_alpha_p)(int w, int h, unsigned char *src, +static void (*draw_alpha_p)(int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride, unsigned char *dst, int dstride); @@ -317,7 +317,7 @@ return 0; } -static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { unsigned char *dst; @@ -330,7 +330,7 @@ dst = next_frame + (in_width * y0 + x0) * fb_pixel_size; dstride = in_width * fb_pixel_size; #endif - (*draw_alpha_p)(w, h, src, srca, stride, dst, dstride); + (*draw_alpha_p)(w, h, dp, src, srca, stride, dst, dstride); } static void draw_osd(void) @@ -403,6 +403,13 @@ switch (request) { case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); + case VOCTRL_YUVSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + if (fb_bpp == 32 || fb_bpp==24 || fb_bpp==16 || fb_bpp==15) return VO_TRUE; + return VO_FALSE; } return VO_NOTIMPL; } diff -Nur MPlayer-1.0pre8.orig/libvo/vo_gl2.c MPlayer-1.0pre8/libvo/vo_gl2.c --- MPlayer-1.0pre8.orig/libvo/vo_gl2.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_gl2.c 2006-06-15 23:04:46.000000000 +0300 @@ -84,7 +84,7 @@ static int use_glFinish; static void (*draw_alpha_fnc) - (int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); + (int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride); /* The squares that are tiled to make up the game screen polygon */ @@ -573,23 +573,23 @@ glLoadIdentity(); } -static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb32(w,h,src,srca,stride,ImageData+4*(y0*image_width+x0),4*image_width); +static void draw_alpha_32(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride){ + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,ImageData+4*(y0*image_width+x0),4*image_width); } -static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb24(w,h,src,srca,stride,ImageData+3*(y0*image_width+x0),3*image_width); +static void draw_alpha_24(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride){ + vo_draw_alpha_rgb24(w,h,dp,src,srca,stride,ImageData+3*(y0*image_width+x0),3*image_width); } -static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb16(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width); +static void draw_alpha_16(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride){ + vo_draw_alpha_rgb16(w,h,dp,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width); } -static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ - vo_draw_alpha_rgb15(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width); +static void draw_alpha_15(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride){ + vo_draw_alpha_rgb15(w,h,dp,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width); } -static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha_null(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride){ } #ifdef GL_WIN32 @@ -1138,6 +1138,13 @@ return vo_x11_get_equalizer(data, value); } #endif + case VOCTRL_YUVSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + if (image_bpp==15 || image_bpp==16 || image_bpp==24 || image_bpp==32) return VO_TRUE; + return VO_FALSE; } return VO_NOTIMPL; } diff -Nur MPlayer-1.0pre8.orig/libvo/vo_macosx.m MPlayer-1.0pre8/libvo/vo_macosx.m --- MPlayer-1.0pre8.orig/libvo/vo_macosx.m 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_macosx.m 2006-06-15 23:04:46.000000000 +0300 @@ -78,17 +78,17 @@ LIBVO_EXTERN(macosx) extern void mplayer_put_key(int code); -extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); +extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)); -static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride) +static void draw_alpha(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { switch (image_format) { case IMGFMT_RGB32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,image_data+4*(y0*image_width+x0),4*image_width); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,image_data+4*(y0*image_width+x0),4*image_width); break; case IMGFMT_YUY2: - vo_draw_alpha_yuy2(w,h,src,srca,stride,image_data + (x0 + y0 * image_width) * 2,image_width*2); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,image_data + (x0 + y0 * image_width) * 2,image_width*2); break; } } diff -Nur MPlayer-1.0pre8.orig/libvo/vo_quartz.c MPlayer-1.0pre8/libvo/vo_quartz.c --- MPlayer-1.0pre8.orig/libvo/vo_quartz.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_quartz.c 2006-06-15 23:04:46.000000000 +0300 @@ -129,7 +129,7 @@ #include "osdep/keycodes.h" extern void mplayer_put_key(int code); -extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); +extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)); //PROTOTYPE///////////////////////////////////////////////////////////////// static OSStatus KeyEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData); @@ -194,23 +194,23 @@ } } -static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride) +static void draw_alpha(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { switch (image_format) { case IMGFMT_RGB32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,image_data+4*(y0*imgRect.right+x0),4*imgRect.right); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,image_data+4*(y0*imgRect.right+x0),4*imgRect.right); break; case IMGFMT_YV12: case IMGFMT_IYUV: case IMGFMT_I420: - vo_draw_alpha_yv12(w,h,src,srca,stride, ((char*)P) + P->componentInfoY.offset + x0 + y0 * imgRect.right, imgRect.right); + vo_draw_alpha_yv12(w,h,dp,src,srca,stride, ((char*)P) + P->componentInfoY.offset + x0 + y0 * imgRect.right, imgRect.right); break; case IMGFMT_UYVY: - vo_draw_alpha_uyvy(w,h,src,srca,stride,((char*)P) + (x0 + y0 * imgRect.right) * 2,imgRect.right*2); + vo_draw_alpha_uyvy(w,h,dp,src,srca,stride,((char*)P) + (x0 + y0 * imgRect.right) * 2,imgRect.right*2); break; case IMGFMT_YUY2: - vo_draw_alpha_yuy2(w,h,src,srca,stride,((char*)P) + (x0 + y0 * imgRect.right) * 2,imgRect.right*2); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,((char*)P) + (x0 + y0 * imgRect.right) * 2,imgRect.right*2); break; } } diff -Nur MPlayer-1.0pre8.orig/libvo/vo_sdl.c MPlayer-1.0pre8/libvo/vo_sdl.c --- MPlayer-1.0pre8.orig/libvo/vo_sdl.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_sdl.c 2006-06-15 23:04:46.000000000 +0300 @@ -286,7 +286,7 @@ * **/ -static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_alpha(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride){ struct sdl_priv_s *priv = &sdl_priv; if(priv->osd_has_changed) { @@ -327,16 +327,43 @@ case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_IYUV: - vo_draw_alpha_yv12(w,h,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); + switch (dp) { + case DEST_PLANES_Y : + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); + break; + case DEST_PLANES_U : + SDL_OVR_LOCK(-1) + if (priv->format==IMGFMT_YV12) + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) (priv->overlay->pixels[1]))+priv->overlay->pitches[1]*y0+x0,priv->overlay->pitches[1]); + else + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) (priv->overlay->pixels[2]))+priv->overlay->pitches[2]*y0+x0,priv->overlay->pitches[2]); + SDL_OVR_UNLOCK + break; + case DEST_PLANES_V : + SDL_OVR_LOCK(-1) + if (priv->format==IMGFMT_YV12) + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) (priv->overlay->pixels[2]))+priv->overlay->pitches[2]*y0+x0,priv->overlay->pitches[2]); + else + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) (priv->overlay->pixels[1]))+priv->overlay->pitches[1]*y0+x0,priv->overlay->pitches[1]); + SDL_OVR_UNLOCK + break; + } break; case IMGFMT_YUY2: case IMGFMT_YVYU: x0 *= 2; - vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); + switch (dp) { + case DEST_PLANES_Y : + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); + break; + case DEST_PLANES_YUYV : + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); + break; + } break; case IMGFMT_UYVY: x0 *= 2; - vo_draw_alpha_yuy2(w,h,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,((uint8_t *) *(priv->overlay->pixels))+priv->overlay->pitches[0]*y0+x0,priv->overlay->pitches[0]); break; default: @@ -345,19 +372,19 @@ switch(priv->format) { case IMGFMT_RGB15: case IMGFMT_BGR15: - vo_draw_alpha_rgb15(w,h,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); + vo_draw_alpha_rgb15(w,h,dp,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); break; case IMGFMT_RGB16: case IMGFMT_BGR16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); + vo_draw_alpha_rgb16(w,h,dp,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); break; case IMGFMT_RGB24: case IMGFMT_BGR24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); + vo_draw_alpha_rgb24(w,h,dp,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); break; case IMGFMT_RGB32: case IMGFMT_BGR32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,((uint8_t *) priv->surface->pixels)+y0*priv->surface->pitch+x0,priv->surface->pitch); break; } } @@ -366,19 +393,19 @@ switch(priv->format) { case IMGFMT_RGB15: case IMGFMT_BGR15: - vo_draw_alpha_rgb15(w,h,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); + vo_draw_alpha_rgb15(w,h,dp,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); break; case IMGFMT_RGB16: case IMGFMT_BGR16: - vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); + vo_draw_alpha_rgb16(w,h,dp,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); break; case IMGFMT_RGB24: case IMGFMT_BGR24: - vo_draw_alpha_rgb24(w,h,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); + vo_draw_alpha_rgb24(w,h,dp,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); break; case IMGFMT_RGB32: case IMGFMT_BGR32: - vo_draw_alpha_rgb32(w,h,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,((uint8_t *) priv->rgbsurface->pixels)+y0*priv->rgbsurface->pitch+x0,priv->rgbsurface->pitch); break; } } @@ -1729,6 +1756,18 @@ mp_msg(MSGT_VO,MSGL_DBG2, "SDL: Set fullscreen mode\n"); } } return VO_TRUE; + case VOCTRL_YUVSPU_SUPPORT: + if (priv->format == IMGFMT_YV12 || priv->format == IMGFMT_I420 || priv->format==IMGFMT_IYUV) return VO_TRUE; + return VO_FALSE; + case VOCTRL_YUYSPU_SUPPORT: + if (priv->format==IMGFMT_YUY2) return VO_TRUE; + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + if (priv->mode == RGB) return VO_TRUE; + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + if (priv->mode == BGR) return VO_TRUE; + return VO_FALSE; } return VO_NOTIMPL; diff -Nur MPlayer-1.0pre8.orig/libvo/vo_vesa.c MPlayer-1.0pre8/libvo/vo_vesa.c --- MPlayer-1.0pre8.orig/libvo/vo_vesa.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_vesa.c 2006-06-15 23:04:46.000000000 +0300 @@ -46,6 +46,7 @@ #include "vosub_vidix.h" #endif #include "mp_msg.h" +#include "help_mp.h" #include "postproc/swscale.h" #include "libmpcodecs/vf_scale.h" @@ -107,7 +108,7 @@ static unsigned video_mode; /* selected video mode for playback */ static struct VesaModeInfoBlock video_mode_info; static int flip_trigger = 0; -static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); +static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride); /* multibuffering */ uint8_t* video_base; /* should be never changed */ @@ -295,7 +296,7 @@ /* Please comment it out if you want have OSD within movie */ /*#define OSD_OUTSIDE_MOVIE 1*/ -static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_32(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride) { int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; #ifndef OSD_OUTSIDE_MOVIE @@ -305,10 +306,10 @@ y0 += y_offset; } #endif - vo_draw_alpha_rgb32(w,h,src,srca,stride,dga_buffer+4*(y0*dstride+x0),4*dstride); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,dga_buffer+4*(y0*dstride+x0),4*dstride); } -static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_24(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride) { int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; #ifndef OSD_OUTSIDE_MOVIE @@ -318,10 +319,10 @@ y0 += y_offset; } #endif - vo_draw_alpha_rgb24(w,h,src,srca,stride,dga_buffer+3*(y0*dstride+x0),3*dstride); + vo_draw_alpha_rgb24(w,h,dp,src,srca,stride,dga_buffer+3*(y0*dstride+x0),3*dstride); } -static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_16(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride) { int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; #ifndef OSD_OUTSIDE_MOVIE @@ -331,10 +332,10 @@ y0 += y_offset; } #endif - vo_draw_alpha_rgb16(w,h,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); + vo_draw_alpha_rgb16(w,h,dp,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); } -static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_15(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride) { int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; #ifndef OSD_OUTSIDE_MOVIE @@ -344,15 +345,16 @@ y0 += y_offset; } #endif - vo_draw_alpha_rgb15(w,h,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); + vo_draw_alpha_rgb15(w,h,dp,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); } -static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha_null(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride) { UNUSED(x0); UNUSED(y0); UNUSED(w); UNUSED(h); + UNUSED(dp); UNUSED(src); UNUSED(srca); UNUSED(stride); @@ -1096,6 +1098,14 @@ switch (request) { case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); + case VOCTRL_YUVSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + if (dstFourcc == IMGFMT_BGR15 || dstFourcc == IMGFMT_BGR16 || dstFourcc == IMGFMT_BGR24 || + dstFourcc == IMGFMT_BGR32 || dstFourcc == IMGFMT_BGR16) return VO_TRUE; + return VO_FALSE; } #ifdef CONFIG_VIDIX diff -Nur MPlayer-1.0pre8.orig/libvo/vo_x11.c MPlayer-1.0pre8/libvo/vo_x11.c --- MPlayer-1.0pre8.orig/libvo/vo_x11.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_x11.c 2006-06-15 23:04:46.000000000 +0300 @@ -42,6 +42,7 @@ #include "postproc/swscale_internal.h" //FIXME #include "postproc/rgb2rgb.h" #include "libmpcodecs/vf_scale.h" +#include "help_mp.h" #include "mp_msg.h" #include "help_mp.h" @@ -61,7 +62,7 @@ LIBVO_EXTERN(x11) /* private prototypes */ static void Display_Image(XImage * myximage, unsigned char *ImageData); -static void (*draw_alpha_fnc) (int x0, int y0, int w, int h, +static void (*draw_alpha_fnc) (int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride); @@ -106,39 +107,39 @@ } -static void draw_alpha_32(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha_32(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { - vo_draw_alpha_rgb32(w, h, src, srca, stride, + vo_draw_alpha_rgb32(w, h, dp, src, srca, stride, ImageData + 4 * (y0 * image_width + x0), 4 * image_width); } -static void draw_alpha_24(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha_24(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { - vo_draw_alpha_rgb24(w, h, src, srca, stride, + vo_draw_alpha_rgb24(w, h, dp, src, srca, stride, ImageData + 3 * (y0 * image_width + x0), 3 * image_width); } -static void draw_alpha_16(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha_16(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { - vo_draw_alpha_rgb16(w, h, src, srca, stride, + vo_draw_alpha_rgb16(w, h, dp, src, srca, stride, ImageData + 2 * (y0 * image_width + x0), 2 * image_width); } -static void draw_alpha_15(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha_15(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { - vo_draw_alpha_rgb15(w, h, src, srca, stride, + vo_draw_alpha_rgb15(w, h, dp, src, srca, stride, ImageData + 2 * (y0 * image_width + x0), 2 * image_width); } -static void draw_alpha_null(int x0, int y0, int w, int h, +static void draw_alpha_null(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { @@ -796,6 +797,14 @@ vo_x11_clearwindow(mDisplay, vo_window); } return VO_TRUE; + case VOCTRL_YUVSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + if (out_format == IMGFMT_BGR15 || out_format == IMGFMT_BGR16 || + out_format == IMGFMT_BGR24 || out_format == IMGFMT_BGR32) return VO_TRUE; + return VO_FALSE; } return VO_NOTIMPL; } diff -Nur MPlayer-1.0pre8.orig/libvo/vo_xv.c MPlayer-1.0pre8/libvo/vo_xv.c --- MPlayer-1.0pre8.orig/libvo/vo_xv.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_xv.c 2006-06-15 23:04:46.000000000 +0300 @@ -92,47 +92,83 @@ static uint32_t dwidth, dheight; static uint32_t max_width = 0, max_height = 0; // zero means: not set -static void (*draw_alpha_fnc) (int x0, int y0, int w, int h, +static int support_yuvspu = VO_FALSE; +static int support_yuyspu = VO_FALSE; + +static void (*draw_alpha_fnc) (int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride); -static void draw_alpha_yv12(int x0, int y0, int w, int h, +static void draw_alpha_yv12(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { + switch (dp) { + case DEST_PLANES_U: { + x0 += image_width/2 * (vo_panscan_x >> 1) / (vo_dwidth + vo_panscan_x); + vo_draw_alpha_yv12(w, h, dp, src, srca, stride, + xvimage[current_buf]->data + + xvimage[current_buf]->offsets[1] + + xvimage[current_buf]->pitches[1] * y0 + x0, + xvimage[current_buf]->pitches[1]); + break; } + case DEST_PLANES_V: { + x0 += image_width/2 * (vo_panscan_x >> 1) / (vo_dwidth + vo_panscan_x); + vo_draw_alpha_yv12(w, h, dp, src, srca, stride, + xvimage[current_buf]->data + + xvimage[current_buf]->offsets[2] + + xvimage[current_buf]->pitches[2] * y0 + x0, + xvimage[current_buf]->pitches[2]); + break; } + case DEST_PLANES_Y: { x0 += image_width * (vo_panscan_x >> 1) / (vo_dwidth + vo_panscan_x); - vo_draw_alpha_yv12(w, h, src, srca, stride, + vo_draw_alpha_yv12(w, h, dp, src, srca, stride, xvimage[current_buf]->data + xvimage[current_buf]->offsets[0] + xvimage[current_buf]->pitches[0] * y0 + x0, xvimage[current_buf]->pitches[0]); } + } -static void draw_alpha_yuy2(int x0, int y0, int w, int h, +} + +static void draw_alpha_yuy2(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { + switch (dp) { + case DEST_PLANES_Y: x0 += image_width * (vo_panscan_x >> 1) / (vo_dwidth + vo_panscan_x); - vo_draw_alpha_yuy2(w, h, src, srca, stride, + vo_draw_alpha_yuy2(w, h, dp, src, srca, stride, xvimage[current_buf]->data + xvimage[current_buf]->offsets[0] + xvimage[current_buf]->pitches[0] * y0 + 2 * x0, xvimage[current_buf]->pitches[0]); + break; + case DEST_PLANES_YUYV: + x0 += image_width * (vo_panscan_x >> 1) / (vo_dwidth + vo_panscan_x); + vo_draw_alpha_yv12(w, h, dp, src, srca, stride, + xvimage[current_buf]->data + + xvimage[current_buf]->offsets[0] + + xvimage[current_buf]->pitches[0] * y0 + 2 * x0, + xvimage[current_buf]->pitches[0]); + break; + } } -static void draw_alpha_uyvy(int x0, int y0, int w, int h, +static void draw_alpha_uyvy(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { x0 += image_width * (vo_panscan_x >> 1) / (vo_dwidth + vo_panscan_x); - vo_draw_alpha_yuy2(w, h, src, srca, stride, + vo_draw_alpha_yuy2(w, h, dp, src, srca, stride, xvimage[current_buf]->data + xvimage[current_buf]->offsets[0] + xvimage[current_buf]->pitches[0] * y0 + 2 * x0 + 1, xvimage[current_buf]->pitches[0]); } -static void draw_alpha_null(int x0, int y0, int w, int h, +static void draw_alpha_null(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { @@ -387,11 +423,13 @@ { case IMGFMT_YV12: case IMGFMT_I420: + support_yuvspu = VO_TRUE; case IMGFMT_IYUV: draw_alpha_fnc = draw_alpha_yv12; break; case IMGFMT_YUY2: case IMGFMT_YVYU: + support_yuyspu = VO_TRUE; draw_alpha_fnc = draw_alpha_yuy2; break; case IMGFMT_UYVY: @@ -1009,6 +1047,14 @@ case VOCTRL_ONTOP: vo_x11_ontop(); return VO_TRUE; + case VOCTRL_YUVSPU_SUPPORT: + return support_yuvspu; + case VOCTRL_RGBSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + return VO_FALSE; + case VOCTRL_YUYSPU_SUPPORT: + return support_yuyspu; } return VO_NOTIMPL; } diff -Nur MPlayer-1.0pre8.orig/libvo/vo_xvmc.c MPlayer-1.0pre8/libvo/vo_xvmc.c --- MPlayer-1.0pre8.orig/libvo/vo_xvmc.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_xvmc.c 2006-06-15 23:04:46.000000000 +0300 @@ -84,12 +84,12 @@ static int free_element; -static void (*draw_osd_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); +static void (*draw_osd_fnc)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride); static void (*clear_osd_fnc)(int x0,int y0, int w,int h); static void (*init_osd_fnc)(void); -static void draw_osd_AI44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); -static void draw_osd_IA44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); +static void draw_osd_AI44(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride); +static void draw_osd_IA44(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride); static void clear_osd_subpic(int x0,int y0, int w,int h); static void init_osd_yuv_pal(void); @@ -875,7 +875,7 @@ subpicture_alloc = 1; } -static void draw_osd_IA44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_osd_IA44(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride){ int ox,oy; int rez; @@ -895,7 +895,7 @@ } } -static void draw_osd_AI44(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ +static void draw_osd_AI44(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride){ int ox,oy; int rez; if( mp_msg_test(MSGT_VO,MSGL_DBG4) ) diff -Nur MPlayer-1.0pre8.orig/libvo/vo_yuv4mpeg.c MPlayer-1.0pre8/libvo/vo_yuv4mpeg.c --- MPlayer-1.0pre8.orig/libvo/vo_yuv4mpeg.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vo_yuv4mpeg.c 2006-06-15 23:04:46.000000000 +0300 @@ -179,25 +179,37 @@ } } -static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, +static void draw_alpha(int x0, int y0, int w, int h, int dp, unsigned char *src, unsigned char *srca, int stride) { switch (using_format) { case IMGFMT_YV12: - vo_draw_alpha_yv12(w, h, src, srca, stride, + switch (dp) { + case DEST_PLANES_Y: + vo_draw_alpha_yv12(w, h, dp, src, srca, stride, image + y0 * image_width + x0, image_width); break; + case DEST_PLANES_U: + if (image_u) vo_draw_alpha_yv12(w, h, dp, src, srca, stride, + image_u + y0 * image_width + x0, image_width); + break; + case DEST_PLANES_V: + if (image_v) vo_draw_alpha_yv12(w, h, dp, src, srca, stride, + image_v + y0 * image_width + x0, image_width); + break; + } + break; case IMGFMT_BGR|24: case IMGFMT_RGB|24: if (config_interlace != Y4M_ILACE_BOTTOM_FIRST) - vo_draw_alpha_rgb24(w, h, src, srca, stride, + vo_draw_alpha_rgb24(w, h, dp, src, srca, stride, rgb_buffer + (y0 * image_width + x0) * 3, image_width * 3); else { swap_fields (rgb_buffer, image_height, image_width * 3); - vo_draw_alpha_rgb24(w, h, src, srca, stride, + vo_draw_alpha_rgb24(w, h, dp, src, srca, stride, rgb_buffer + (y0 * image_width + x0) * 3, image_width * 3); swap_fields (rgb_buffer, image_height, image_width * 3); @@ -543,6 +555,15 @@ return query_format(*((uint32_t*)data)); case VOCTRL_DUPLICATE_FRAME: return write_last_frame(); + case VOCTRL_YUVSPU_SUPPORT: + if (using_format==IMGFMT_YV12) return VO_TRUE; + return VO_FALSE; + case VOCTRL_RGBSPU_SUPPORT: + if (using_format==IMGFMT_RGB|24) return VO_TRUE; + return VO_FALSE; + case VOCTRL_BGRSPU_SUPPORT: + if (using_format==IMGFMT_BGR|24) return VO_TRUE; + return VO_FALSE; } return VO_NOTIMPL; } diff -Nur MPlayer-1.0pre8.orig/libvo/vosub_vidix.c MPlayer-1.0pre8/libvo/vosub_vidix.c --- MPlayer-1.0pre8.orig/libvo/vosub_vidix.c 2006-06-11 21:35:43.000000000 +0300 +++ MPlayer-1.0pre8/libvo/vosub_vidix.c 2006-06-15 23:04:46.000000000 +0300 @@ -283,7 +283,7 @@ } } -static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +static void draw_alpha(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride) { uint32_t apitch,bespitch; void *lvo_mem; @@ -297,36 +297,57 @@ case IMGFMT_IF09: case IMGFMT_Y8: case IMGFMT_Y800: + switch (dp) { + case DEST_PLANES_Y: bespitch = (vidix_play.src.w + apitch) & (~apitch); - vo_draw_alpha_yv12(w,h,src,srca,stride,lvo_mem+bespitch*y0+x0,bespitch); + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,lvo_mem+bespitch*y0+x0,bespitch); + break; + case DEST_PLANES_U: + lvo_mem = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.u; + lvo_mem += dstrides.u*y0/2 + x0; + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,lvo_mem,dstrides.u/2); + break; + case DEST_PLANES_V: + lvo_mem = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.v; + lvo_mem += dstrides.v*y0/2 + x0; + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,lvo_mem,dstrides.v/2); + break; + } break; case IMGFMT_YUY2: bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); - vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+bespitch*y0+2*x0,bespitch); + switch (dp) { + case DEST_PLANES_Y: + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,lvo_mem+bespitch*y0+2*x0,bespitch); + break; + case DEST_PLANES_YUYV: + vo_draw_alpha_yv12(w,h,dp,src,srca,stride,lvo_mem+bespitch*y0+x0,bespitch); + break; + } break; case IMGFMT_UYVY: bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); - vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+bespitch*y0+2*x0+1,bespitch); + vo_draw_alpha_yuy2(w,h,dp,src,srca,stride,lvo_mem+bespitch*y0+2*x0+1,bespitch); break; case IMGFMT_RGB32: case IMGFMT_BGR32: bespitch = (vidix_play.src.w*4 + apitch) & (~apitch); - vo_draw_alpha_rgb32(w,h,src,srca,stride,lvo_mem+y0*bespitch+4*x0,bespitch); + vo_draw_alpha_rgb32(w,h,dp,src,srca,stride,lvo_mem+y0*bespitch+4*x0,bespitch); break; case IMGFMT_RGB24: case IMGFMT_BGR24: bespitch = (vidix_play.src.w*3 + apitch) & (~apitch); - vo_draw_alpha_rgb24(w,h,src,srca,stride,lvo_mem+y0*bespitch+3*x0,bespitch); + vo_draw_alpha_rgb24(w,h,dp,src,srca,stride,lvo_mem+y0*bespitch+3*x0,bespitch); break; case IMGFMT_RGB16: case IMGFMT_BGR16: bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); - vo_draw_alpha_rgb16(w,h,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch); + vo_draw_alpha_rgb16(w,h,dp,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch); break; case IMGFMT_RGB15: case IMGFMT_BGR15: bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); - vo_draw_alpha_rgb15(w,h,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch); + vo_draw_alpha_rgb15(w,h,dp,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch); break; default: return; @@ -512,7 +533,7 @@ next_frame = i; memset(vidix_mem + vidix_play.offsets[i], 0x80, vidix_play.frame_size); - draw_alpha(0, 0, image_width, image_height, tmp, tmpa, image_width); + draw_alpha(0, 0, image_width, image_height, DEST_PLANES_Y, tmp, tmpa, image_width); } free(tmp); free(tmpa); @@ -700,6 +721,16 @@ return VO_TRUE; } + case VOCTRL_YUVSPU_SUPPORT: + if((vidix_play.fourcc==IMGFMT_YV12 || vidix_play.fourcc==IMGFMT_YV12 || vidix_play.fourcc==IMGFMT_IYUV || + vidix_play.fourcc==IMGFMT_I420 || vidix_play.fourcc==IMGFMT_YVU9 || vidix_play.fourcc==IMGFMT_IF09 || + vidix_play.fourcc==IMGFMT_Y8 || vidix_play.fourcc==IMGFMT_Y800) && + !(vidix_play.flags & VID_PLAY_INTERLEAVED_UV)) return VO_TRUE; + return VO_FALSE; + case VOCTRL_YUYSPU_SUPPORT: + if((vidix_play.fourcc==IMGFMT_YUY2) && + !(vidix_play.flags & VID_PLAY_INTERLEAVED_UV)) return VO_TRUE; + return VO_FALSE; } return VO_NOTIMPL; // WARNING: we drop extra parameters (...) here! diff -Nur MPlayer-1.0pre8.orig/mencoder.c MPlayer-1.0pre8/mencoder.c --- MPlayer-1.0pre8.orig/mencoder.c 2006-06-11 21:35:47.000000000 +0300 +++ MPlayer-1.0pre8/mencoder.c 2006-06-15 23:04:46.000000000 +0300 @@ -63,6 +63,7 @@ #include "libmpcodecs/mp_image.h" #include "libmpcodecs/dec_audio.h" #include "libmpcodecs/dec_video.h" +#include "libmpcodecs/vd_videostill.h" #include "libmpcodecs/vf.h" // for MPEGLAYER3WAVEFORMAT: @@ -496,7 +497,7 @@ if (frameno_filename) { stream2=open_stream(frameno_filename,0,&i); if(stream2){ - demuxer2=demux_open(stream2,DEMUXER_TYPE_AVI,-1,-1,-2,NULL); + demuxer2=demux_open(stream2,DEMUXER_TYPE_AVI,-1,-1,-2,NULL,0); if(demuxer2) mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_UsingPass3ControlFile, frameno_filename); else mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_FormatNotRecognized); } @@ -575,7 +576,7 @@ if(demuxer2) audio_id=-2; /* do NOT read audio packets... */ //demuxer=demux_open(stream,file_format,video_id,audio_id,dvdsub_id); - demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id,filename); + demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id,filename,0); if(!demuxer){ mp_msg(MSGT_DEMUXER, MSGL_FATAL, MSGTR_FormatNotRecognized); mp_msg(MSGT_DEMUXER, MSGL_FATAL, MSGTR_CannotOpenDemuxer); diff -Nur MPlayer-1.0pre8.orig/mplayer.c MPlayer-1.0pre8/mplayer.c --- MPlayer-1.0pre8.orig/mplayer.c 2006-06-11 21:35:47.000000000 +0300 +++ MPlayer-1.0pre8/mplayer.c 2006-06-15 23:30:40.000000000 +0300 @@ -68,7 +68,13 @@ #include "codec-cfg.h" #ifdef USE_DVDNAV -#include +int dvdnav_wait = 0; +int dvdnav_still = 0; +int dvdnav_decodeok = 0; +int dvdnav_seek_counter = 0; +int dvdnav_menu_visible = 0; +int dvdnav_color_spu_flg = -1; +unsigned int dvdnav_activate_timer = 0; #endif #include "edl.h" @@ -187,6 +193,9 @@ #include "libmpcodecs/dec_audio.h" #include "libmpcodecs/dec_video.h" +#ifdef USE_DVDNAV +#include "libmpcodecs/vd_videostill.h" +#endif #include "libmpcodecs/mp_image.h" #include "libmpcodecs/vf.h" #include "libmpcodecs/vd.h" @@ -394,6 +403,7 @@ edl_record_ptr edl_records = NULL; ///< EDL entries memory area edl_record_ptr next_edl_record = NULL; ///< only for traversing edl_records short user_muted = 0; ///< Stores whether user wanted muted mode. +short sw_muted = 0; ///< Stores whether switch stream is currently is muted mode. short edl_muted = 0; ///< Stores whether EDL is currently in muted mode. short edl_decision = 0; ///< 1 when an EDL operation has been made. FILE* edl_fd = NULL; ///< fd to write to when in -edlout mode. @@ -1481,7 +1491,7 @@ return M_PROPERTY_NOT_IMPLEMENTED; } - if (edl_muted) return M_PROPERTY_DISABLED; + if (edl_muted || sw_muted) return M_PROPERTY_DISABLED; user_muted = 0; switch(action) { @@ -1513,14 +1523,16 @@ switch(action) { case M_PROPERTY_SET: - if(edl_muted) return M_PROPERTY_DISABLED; + if(edl_muted || sw_muted) return M_PROPERTY_DISABLED; if(!arg) return 0; + user_muted=!!*(int*)arg; if((!!*(int*)arg) != mixer.muted) mixer_mute(&mixer); return 1; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - if(edl_muted) return M_PROPERTY_DISABLED; + if(edl_muted || sw_muted) return M_PROPERTY_DISABLED; + user_muted=!user_muted; mixer_mute(&mixer); return 1; case M_PROPERTY_PRINT: @@ -1868,6 +1880,17 @@ if (vo_spudec && dvdsub_id >= 0) { char lang[3] = "\0\0\0"; int code = 0; +#ifdef USE_DVDNAV + if(stream->type==STREAMTYPE_DVDNAV) + { + code = dvdsub_id; + if (stream_control(demuxer->stream, STREAM_CTRL_LANG_FROM_SID, &code)!= + STREAM_OK) code=0; +// code = dvdnav_lang_from_sid((dvdnav_priv_t*)(stream->priv), +// dvdsub_id); + } + else +#endif code = dvd_lang_from_sid(stream, dvdsub_id); if (code) { lang[0] = code >> 8; @@ -1939,6 +1962,12 @@ spudec_reset(vo_spudec); } #endif +#ifdef USE_DVDNAV + if (vo_spudec && stream->type == STREAMTYPE_DVDNAV) { + d_dvdsub->id = dvdsub_id; + spudec_reset(vo_spudec); + } +#endif #ifdef HAVE_OGGVORBIS if (demuxer->type == DEMUXER_TYPE_OGG) d_dvdsub->id = demux_ogg_sub_id(demuxer, dvdsub_id); @@ -1980,6 +2009,15 @@ spudec_reset(vo_spudec); } #endif +#ifdef USE_DVDNAV + if (vo_spudec && stream->type == STREAMTYPE_DVDNAV && + dvdsub_id < 0 && reset_spu) + { + dvdsub_id = -2; + d_dvdsub->id = dvdsub_id; + spudec_reset(vo_spudec); + } +#endif return 1; } @@ -3008,7 +3046,12 @@ //============ Open DEMUXERS --- DETECT file type ======================= current_module="demux_open"; -demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id,filename); +#ifdef USE_DVDNAV +if (stream->type==STREAMTYPE_DVDNAV) + demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id,filename,1); + else +#endif +demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id,filename,0); // HACK to get MOV Reference Files working @@ -3225,9 +3268,18 @@ #ifdef USE_DVDNAV if (vo_spudec==NULL && stream->type==STREAMTYPE_DVDNAV) { current_module="spudec_init_dvdnav"; - vo_spudec=spudec_new_scaled(dvdnav_stream_get_palette((dvdnav_priv_t*)(stream->priv)), - sh_video->disp_w, sh_video->disp_h); +// vo_spudec=spudec_new_scaled( +// dvdnav_stream_get_palette((dvdnav_priv_t*)(stream->priv)), +// sh_video->disp_w, +// sh_video->disp_h); + unsigned int palette=0; + stream_control(stream,STREAM_CTRL_GET_PALETTE,&palette); + vo_spudec=spudec_new_scaled( + palette, + sh_video->disp_w, + sh_video->disp_h); } +if (dvdsub_id>=0 && stream->type==STREAMTYPE_DVDNAV) dvdnav_go_spu=2; #endif #ifdef USE_DVDREAD @@ -3597,7 +3649,41 @@ #ifdef USE_DVDNAV if (stream->type==STREAMTYPE_DVDNAV) { - dvdnav_stream_fullstart((dvdnav_priv_t *)stream->priv); +// dvdnav_stream_fullstart((dvdnav_priv_t *)stream->priv); + stream_control(stream,STREAM_CTRL_FULL_START,NULL); +// dvdnav_set_language( +// (dvdnav_priv_t *)stream->priv, dvdsub_lang, audio_lang, NULL); + stream_control(stream,STREAM_CTRL_SET_ALANG,&audio_lang); + stream_control(stream,STREAM_CTRL_SET_SLANG,&dvdsub_lang); +// stream_control(stream,STREAM_CTRL_SET_MLANG,NULL); + clearsmpi(); /* clear correct still image */ +if(stream->type==STREAMTYPE_DVDNAV) + { + current_module="dvdnav lang->id"; + struct dvd_idfromlang_st dvd_idfromlang; + dvd_idfromlang.lang=audio_lang; + dvd_idfromlang.id=0; + if(audio_lang && audio_id==-1) +// audio_id=dvdnav_aid_from_lang((dvdnav_priv_t*)(stream->priv),audio_lang); + if (stream_control(stream,STREAM_CTRL_AID_FROM_LANG,&dvd_idfromlang)==STREAM_OK) + audio_id=dvd_idfromlang.id; + if (sh_audio && audio_id>=0) dvdnav_go_audio=1; + if(dvdsub_lang && dvdsub_id==-2) dvdsub_id=-1; + + dvd_idfromlang.lang=dvdsub_lang; + dvd_idfromlang.id=0; + if(dvdsub_lang && dvdsub_id==-1) +// dvdsub_id=dvdnav_sid_from_lang((dvdnav_priv_t*)(stream->priv),dvdsub_lang); + if (stream_control(stream,STREAM_CTRL_SID_FROM_LANG,&dvd_idfromlang)==STREAM_OK) + dvdsub_id=dvd_idfromlang.id; + if (dvdsub_id>=0) dvdnav_go_spu=1; + global_sub_indices[SUB_SOURCE_DEMUX] = global_sub_size; // the global # of the first demux-specific sub. + int number_of_subs=0; +// global_sub_size += dvdnav_number_of_subs((dvdnav_priv_t*)(stream->priv)); + if (stream_control(stream,STREAM_CTRL_NUMBER_OF_SUBS,&number_of_subs)==STREAM_OK) + global_sub_size += number_of_subs; + current_module=NULL; + } } #endif @@ -3682,6 +3768,9 @@ vo_pts=sh_video->timer*90000.0; vo_fps=sh_video->fps; +#ifdef USE_DVDNAV +if (stream->type==STREAMTYPE_DVDNAV && dvdnav_still) frame_time_remaining=0; +#endif if(!frame_time_remaining){ //-------------------- Decode a frame: ----------------------- blit_frame = 0; // Don't blit if we hit EOF @@ -3718,6 +3807,21 @@ // decode: current_module="decode_video"; // printf("Decode! %p %d \n",start,in_size); +#ifdef USE_DVDNAV + if (stream->type==STREAMTYPE_DVDNAV) + { + dvdnav_decodeok=0; + blit_frame=decode_video_still(sh_video,start,in_size,drop_frame, + MP_NOPTS_VALUE,1); + if (!blit_frame && in_size>0) + { + if (vd_mpeg2_reset(sh_video,0)) + blit_frame=decode_video_still(sh_video,start,in_size,drop_frame, + MP_NOPTS_VALUE,1); + } + if (blit_frame && in_size>0) dvdnav_decodeok=1; + } else +#endif blit_frame=decode_video(sh_video,start,in_size,drop_frame, MP_NOPTS_VALUE); break; } @@ -4093,11 +4197,6 @@ rel_seek_secs+=step_sec; } -#ifdef USE_DVDNAV -if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still) - dvdnav_stream_sleeping((dvdnav_priv_t*)stream->priv); -#endif - //================= EDL ========================================= if( next_edl_record ) { // Are we (still?) doing EDL? @@ -4116,7 +4215,7 @@ edl_decision = 1; } else if( next_edl_record->action == EDL_MUTE ) { edl_muted = !edl_muted; - if ((user_muted | edl_muted) != mixer.muted) mixer_mute(&mixer); + if ((user_muted | edl_muted || sw_muted) != mixer.muted) mixer_mute(&mixer); mp_msg(MSGT_CPLAYER, MSGL_DBG4, "EDL_MUTE: [%f]\n", next_edl_record->start_sec ); } next_edl_record=next_edl_record->next; @@ -4124,6 +4223,530 @@ } } +#ifdef USE_DVDNAV +current_module="dvdnav_event"; +if (stream->type==STREAMTYPE_DVDNAV) + { +// if (((dvdnav_priv_t*)(stream->priv))->event.eventflag.stop) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_STOP,NULL)==STREAM_OK) + { + eof=1; + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_MPDVDNAV_StopEvent); + } else { + int nav_menu = 0; + + if (demuxer->audio->sh && !sh_audio) // Hot init audio + { + d_audio=demuxer->audio; + sh_audio=d_audio->sh; + sh_audio->ds=d_audio; + + current_module="hot init_audio_codec"; + if(!init_best_audio_codec(sh_audio,audio_codec_list,audio_fm_list)) + sh_audio=d_audio->sh=NULL; // failed to init :( + else + inited_flags|=INITED_ACODEC; +//================ SETUP AUDIO ========================== + + if(sh_audio){ + //const ao_info_t *info=audio_out->info; + current_module="hot af_preinit"; + ao_data.samplerate=force_srate; + ao_data.channels=0; + ao_data.format=audio_output_format; +#if 1 + // first init to detect best values + if(!preinit_audio_filters(sh_audio, + // input: + (int)(sh_audio->samplerate*playback_speed), + sh_audio->channels, sh_audio->sample_format, + // output: + &ao_data.samplerate, &ao_data.channels, &ao_data.format)){ + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_AudioFilterChainPreinitError); + exit_player(MSGTR_Exit_error); + } +#endif + current_module="hot ao2_init"; + if(!(audio_out=init_best_audio_out(audio_driver_list, + 0, // plugin flag + ao_data.samplerate, + ao_data.channels, + ao_data.format,0))){ + // FAILED: + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CannotInitAO); + uninit_player(INITED_ACODEC); // close codec + sh_audio=d_audio->sh=NULL; // -> nosound + } else { + // SUCCESS: + inited_flags|=INITED_AO; + mp_msg(MSGT_CPLAYER,MSGL_INFO, + "AO: [%s] %dHz %dch %s (%d bytes per sample)\n", + audio_out->info->short_name, + ao_data.samplerate, + ao_data.channels, + af_fmt2str_short(ao_data.format), + af_fmt2bits(ao_data.format)/8 ); + mp_msg(MSGT_CPLAYER,MSGL_V, + "AO: Description: %s\nAO: Author: %s\n", + audio_out->info->name, + audio_out->info->author); + if(strlen(audio_out->info->comment) > 0) + mp_msg(MSGT_CPLAYER,MSGL_V, + "AO: Comment: %s\n", + audio_out->info->comment); + // init audio filters: +#if 1 + current_module="hot af_init"; + if(!build_afilter_chain(sh_audio, &ao_data)) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_NoMatchingFilter); + } +#endif + } + mixer.audio_out = audio_out; + mixer.volstep = volstep; + } + } + if (!sh_audio) + { + demuxer->audio->id=-1; + } // force hot add audio + if (dvdnav_seek_counter && vd_decode_mp_preserve()) + dvdnav_seek_counter=1; +// if (((dvdnav_priv_t*)(stream->priv))->event.eventflag.wait) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_STOP,NULL)==STREAM_OK) + mp_msg(MSGT_CPLAYER,MSGL_V,MSGTR_MPDVDNAV_WaitEvent); +// if (((dvdnav_priv_t*)(stream->priv))->event.eventflag.still_frame) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_STILL,NULL)==STREAM_OK) + { + mp_msg(MSGT_CPLAYER,MSGL_V,MSGTR_MPDVDNAV_StillFrameEvent); + ds_free_packs(demuxer->audio); + ds_free_packs(demuxer->video); +// if (dvdnav_decodeok) dvdnav_seek_counter=1; + dvdnav_still=1; // still mode on + } +// if (((dvdnav_priv_t*)(stream->priv))->event.eventflag.vts_change) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS,NULL)==STREAM_OK) + { + dvdnav_still=0; // still mode off + dvdnav_activate_timer=0; // clear activate timer + mp_msg(MSGT_CPLAYER,MSGL_V,MSGTR_MPDVDNAV_VtsChangeEvent); +// if (((dvdnav_priv_t*)(stream->priv))->vts_domain) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN,NULL)==STREAM_OK) + { +// audio_id=((dvdnav_priv_t*)(stream->priv))->alang; // set new audio id + int id=0; + if (stream_control(stream,STREAM_CTRL_GET_AUDIO_ID,&id)==STREAM_OK) + audio_id=id; +// if (((dvdnav_priv_t*)(stream->priv))->slang==128) + id=128; + if (stream_control(stream,STREAM_CTRL_GET_DVDSUB_ID,&id)!=STREAM_OK) + id=128; + if (id==128) + { + dvdsub_id=-2; + d_dvdsub->id = dvdsub_id; + } else { + dvdsub_id=id; + d_dvdsub->id = dvdsub_id; + } + } // set new sub id + dvdnav_seek_counter=5; +#ifdef HAVE_NEW_GUI + if ( use_gui ) guiGetEvent( guiSetStream,(char *)stream ); +#endif + } +// if (((dvdnav_priv_t*)(stream->priv))->event.eventflag.cell_change) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_CELL,NULL)==STREAM_OK) + { + dvdnav_still=0; // still mode off + dvdnav_activate_timer=0; // clear activate timer + mp_msg(MSGT_CPLAYER,MSGL_V,MSGTR_MPDVDNAV_CellChangeEvent); + +// if (!(((dvdnav_priv_t*)(stream->priv))->vts_domain)) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN,NULL)!=STREAM_OK) + { +// if (((dvdnav_priv_t*)(stream->priv))->event.cell_really_change) + if (stream_control(stream,STREAM_CTRL_DVDNAV_REALLY_CHANGE,NULL)==STREAM_OK) + dvdnav_seek_counter=5; + } else { +// if (((dvdnav_priv_t*)(stream->priv))->lasttitle!= +// ((dvdnav_priv_t*)(stream->priv))->title) + if (stream_control(stream,STREAM_CTRL_DVDNAV_IS_NEW_TITLE,NULL)!=STREAM_OK) + { + dvdnav_seek_counter=2; +// audio_id=((dvdnav_priv_t*)(stream->priv))->alang; // set new audio id + int id=0; + if (stream_control(stream,STREAM_CTRL_GET_AUDIO_ID,&id)==STREAM_OK) + audio_id=id; +// if (((dvdnav_priv_t*)(stream->priv))->slang==128) + id=128; + if (stream_control(stream,STREAM_CTRL_GET_DVDSUB_ID,&id)!=STREAM_OK) + id=128; + if (id==128) + { + dvdsub_id=-2; + d_dvdsub->id = dvdsub_id; + } else { + dvdsub_id=id; + d_dvdsub->id = dvdsub_id; + } + } // set new sub id + } +// ((dvdnav_priv_t*)(stream->priv))->lasttitle= +// ((dvdnav_priv_t*)(stream->priv))->title; +// ((dvdnav_priv_t*)(stream->priv))->lastpart= +// ((dvdnav_priv_t*)(stream->priv))->part; +// ((dvdnav_priv_t*)(stream->priv))->old_vts_domain= +// ((dvdnav_priv_t*)(stream->priv))->vts_domain; + stream_control(stream,STREAM_CTRL_DVDNAV_TITLESET,NULL); + nav_menu=1; +#ifdef HAVE_NEW_GUI + if ( use_gui ) guiGetEvent( guiSetStream,(char *)stream ); +#endif + } +// if (((dvdnav_priv_t*)(stream->priv))->event.eventflag.spu_clut_change) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_SPU_CLUT,NULL)==STREAM_OK) + { + mp_msg(MSGT_CPLAYER,MSGL_V,MSGTR_MPDVDNAV_SpuClutChangeEvent); + if (vo_spudec) { +// spudec_update_palette(vo_spudec, +// ((dvdnav_priv_t*)(stream->priv))->event.spu_clut); + spu_clut_t spu_clut; + if (stream_control(stream,STREAM_CTRL_GET_SPU_CLUT,&spu_clut)==STREAM_OK) + spudec_update_palette(vo_spudec,spu_clut); +// if(!((dvdnav_priv_t*)(stream->priv))->vts_domain && + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN,NULL)!=STREAM_OK && + (dvdnav_menutype==DVDNAV_MENUTYPE_SPU || + dvdnav_menutype==DVDNAV_MENUTYPE_SPU_BOX)) + { + spu_palette_t spu_palette; + if (stream_control(stream,STREAM_CTRL_GET_SPU_PALETTE,&spu_palette)==STREAM_OK) + spudec_dvdnav_palette(vo_spudec,spu_palette); + vo_osd_changed(OSDTYPE_SPU); + } +// if (((dvdnav_priv_t*)(stream->priv))->vts_domain) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN,NULL)==STREAM_OK) + spudec_reset(vo_spudec); + } + nav_menu=1; + } +// if (((dvdnav_priv_t*)(stream->priv))->event.eventflag.highlight) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_HIGHLIGHT,NULL)==STREAM_OK) + { + mp_msg(MSGT_CPLAYER,MSGL_V,MSGTR_MPDVDNAV_HighlightEvent); +// dvdnav menu button update + nav_menu=1; + } +// if (((dvdnav_priv_t*)(stream->priv))->event.eventflag.nav_packet) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_NAV_PACKET,NULL)==STREAM_OK) + { + mp_msg(MSGT_CPLAYER,MSGL_DBG2,MSGTR_MPDVDNAV_NavPacketEvent); +// if (!(((dvdnav_priv_t*)(stream->priv))->vts_domain)) nav_menu=1; + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN,NULL)!=STREAM_OK) + nav_menu=1; + } +// ((dvdnav_priv_t*)(stream->priv))->lasttitle= +// ((dvdnav_priv_t*)(stream->priv))->title; +// ((dvdnav_priv_t*)(stream->priv))->lastpart= +// ((dvdnav_priv_t*)(stream->priv))->part; +// ((dvdnav_priv_t*)(stream->priv))->old_vts_domain= +// ((dvdnav_priv_t*)(stream->priv))->vts_domain; + stream_control(stream,STREAM_CTRL_DVDNAV_TITLESET,NULL); + d_video->eof=0; + d_audio->eof=0; + stream->eof=0; + demuxer->stream->eof=0; + demuxer->audio->eof=0; + demuxer->video->eof=0; + +// dvdnav event clear +// dvdnav_event_clear((dvdnav_priv_t*)(stream->priv)); + stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_CLEAR,NULL); + if (dvdnav_menu_visible && dvdnav_force_menu) + { + if (!vo_spudec || !spudec_visible(vo_spudec)) + { +// dvdnav_highlight_event_t highlight; +// dvdnav_get_highlight((dvdnav_priv_t*)(stream->priv),&highlight,1); + mp_highlight_t highlight; + stream_control(stream,STREAM_CTRL_DVDNAV_GET_HIGHLIGHT_SHOW,&highlight); + dvdnav_box_area(highlight.sx,highlight.sy,highlight.ex,highlight.ey, + 1,0x7f,0x7f); /* set box button area & on */ + vo_osd_changed(OSDTYPE_DVDNAV); + } else { + dvdnav_box_area(0,0,0,0,0,0x00,0x00); + vo_osd_changed(OSDTYPE_DVDNAV); + dvdnav_menu_visible=0; + } + } + if (dvdnav_activate_timer) + { +// reset activate? (>1 sec) + if (GetTimer() > dvdnav_activate_timer + 1000000) nav_menu=1; + } + if (nav_menu) + { + if (dvdnav_color_spu_flg==-1) + { + dvdnav_color_spu_flg=0; + if (dvdnav_color_spu && video_out) + { + if (!dvdnav_color_spu_flg && + video_out->control(VOCTRL_YUVSPU_SUPPORT,NULL)==VO_TRUE) + dvdnav_color_spu_flg=DVDNAV_SPU_YUV; + if (!dvdnav_color_spu_flg && + video_out->control(VOCTRL_YUYSPU_SUPPORT,NULL)==VO_TRUE) + dvdnav_color_spu_flg=DVDNAV_SPU_YUY; + if (!dvdnav_color_spu_flg && + video_out->control(VOCTRL_RGBSPU_SUPPORT,NULL)==VO_TRUE) + dvdnav_color_spu_flg=DVDNAV_SPU_RGB; + if (!dvdnav_color_spu_flg && + video_out->control(VOCTRL_BGRSPU_SUPPORT,NULL)==VO_TRUE) + dvdnav_color_spu_flg=DVDNAV_SPU_BGR; + if (!dvdnav_color_spu_flg) + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_MPDVDNAV_NoColorSpu); + } + } + dvdnav_menu_visible=0; +// if (!(((dvdnav_priv_t*)(stream->priv))->vts_domain)) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN,NULL)!=STREAM_OK) + { +// vts0 - set menu button +// dvdnav_highlight_event_t highlight; +// dvdnav_get_highlight((dvdnav_priv_t*)(stream->priv),&highlight,1); /* get spu botton area & palette */ + mp_highlight_t highlight; + stream_control(stream,STREAM_CTRL_DVDNAV_GET_HIGHLIGHT_SHOW,&highlight); + if (vo_spudec && (dvdnav_menutype==DVDNAV_MENUTYPE_SPU || + dvdnav_menutype==DVDNAV_MENUTYPE_SPU_BOX)) + { + int menu_sid = 0; + stream_control(stream,STREAM_CTRL_DVDNAV_GET_MENU_SID,&menu_sid); +// if(d_dvdsub->id!=((dvdnav_priv_t*)(stream->priv))->menu_sid) + if(d_dvdsub->id!=menu_sid) + { +// d_dvdsub->id=((dvdnav_priv_t*)(stream->priv))->menu_sid; + d_dvdsub->id=menu_sid; + spudec_reset(vo_spudec); + } + spudec_dvdnav_mode(vo_spudec, 1, dvdnav_color_spu_flg); /* spu menu button on */ + spudec_dvdnav_area(vo_spudec,highlight.sx,highlight.sy,highlight.ex, + highlight.ey,highlight.palette); /* set spu button area & palette */ + vo_osd_changed(OSDTYPE_SPU); + } + if (dvdnav_menutype==DVDNAV_MENUTYPE_BOX || + dvdnav_menutype==DVDNAV_MENUTYPE_SPU_BOX) + { + dvdnav_box_area(highlight.sx,highlight.sy,highlight.ex,highlight.ey, + 1,0x7f,0x7f); /* set box button area & on */ + vo_osd_changed(OSDTYPE_DVDNAV); + } + if (dvdnav_menutype==DVDNAV_MENUTYPE_SPU && highlight.buttonN) + dvdnav_menu_visible=1; + } else { +// reset spu info + global_sub_size = 0; + int i; + for (i = 0; i < SUB_SOURCES; i++) + global_sub_indices[i] = -1; +// global_sub_quiet_osd_hack = 1; + global_sub_indices[SUB_SOURCE_DEMUX] = global_sub_size; // the global # of the first demux-specific sub. +// global_sub_size += dvdnav_number_of_subs((dvdnav_priv_t*)(stream->priv)); + int number_of_subs=0; + if (stream_control(stream,STREAM_CTRL_NUMBER_OF_SUBS,&number_of_subs)==STREAM_OK) + global_sub_size += number_of_subs; + if (dvdnav_menutype==DVDNAV_MENUTYPE_BOX || + dvdnav_menutype==DVDNAV_MENUTYPE_SPU_BOX) + { + dvdnav_box_area(0,0,0,0,0,0x00,0x00); /* nav box button off */ + vo_osd_changed(OSDTYPE_DVDNAV); + } + spudec_dvdnav_mode(vo_spudec, 0, 0); /* spu menu button off */ + spudec_reset(vo_spudec); + } + } +// if (dvdnav_seek_counter && (!((dvdnav_priv_t*)(stream->priv))->stillok)) +// if (dvdnav_seek_counter && +// stream_control(stream,STREAM_CTRL_DVDNAV_STILLOK,NULL)!=STREAM_OK) + if (dvdnav_seek_counter && + stream_control(stream,STREAM_CTRL_DVDNAV_STILLOK,NULL)!=STREAM_OK) + { + sw_muted=1; + if (sh_audio && sw_muted != mixer.muted) mixer_mute(&mixer); +// if (((dvdnav_priv_t*)(stream->priv))->aspect!= +// ((dvdnav_priv_t*)(stream->priv))->lastaspect && sh_video) + int aspect=0; + if (stream_control(stream,STREAM_CTRL_CHANGE_ASPECT,NULL)==STREAM_OK && sh_video && + stream_control(stream,STREAM_CTRL_GET_ASPECT,&aspect)) + { +// switch (((dvdnav_priv_t*)(stream->priv))->aspect) /* set current ascpet */ + switch (aspect) /* set current ascpet */ + { + case 0 : // 4:3 + { +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: set aspect 4:3\n"); +#endif + movie_aspect = (float) 4 / 3; + mpcodecs_config_vo (sh_video, sh_video->disp_w, sh_video->disp_h, 0); + break; + } + case 3 : // FIXME: 16:9??? + case 2 : // 16:9 + { +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: set aspect 16:9\n"); +#endif + movie_aspect = (float) 16 / 9; + mpcodecs_config_vo (sh_video, sh_video->disp_w, sh_video->disp_h, 0); + break; + } + default: + { +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: unknow aspect %i\n", +// ((dvdnav_priv_t*)(stream->priv))->aspect); + aspect); +#endif + break; + } + } +// ((dvdnav_priv_t*)(stream->priv))->lastaspect= +// ((dvdnav_priv_t*)(stream->priv))->aspect; + stream_control(stream,STREAM_CTRL_SYNC_ASPECT,NULL); + } + if (sh_audio) + { +// audio_id=((dvdnav_priv_t*)(stream->priv))->alang; + int id=0; + if (stream_control(stream,STREAM_CTRL_GET_AUDIO_ID,&id)==STREAM_OK) + audio_id=id; + int v = demuxer_switch_audio(demuxer, audio_id); + } // switch audio channel + rel_seek_secs = 0.00; + abs_seek_pos = 0; + if(sh_video) sh_video->pts=0.0f; +// ((dvdnav_priv_t*)(stream->priv))->lockseek=1; + int lockseek=1; + stream_control(stream,STREAM_CTRL_DVDNAV_SET_LOCKSEEK,&lockseek); + if(demux_seek(demuxer,rel_seek_secs,0.0,abs_seek_pos)) + { // demuxer reset??? + rel_seek_secs = 0.00; + abs_seek_pos = 0; + if(sh_video) + { + current_module="seek_video_reset"; + resync_video_stream(sh_video); + if(vo_config_count) video_out->control(VOCTRL_RESET,NULL); + sh_video->pts=0.0f; + sh_video->num_frames=0; + sh_video->num_frames_decoded=0; + sh_video->timer=0.0f; + sh_video->stream_delay=0.0f; + frame_time_remaining=0; + audio_delay=0.0f; + sh_video->timer=0; + audio_delay += sh_video->stream_delay; + } + if(sh_audio) + { + audio_delay -= sh_audio->stream_delay; + sh_audio->delay=-audio_delay; + current_module="seek_audio_reset"; + audio_out->reset(); + resync_audio_stream(sh_audio); + } // stop audio, throwing away buffered data + if(vo_spudec) spudec_reset(vo_spudec); + } + current_module="demuxer_update_time_pts"; +// if (((dvdnav_priv_t*)(stream->priv))->vts_domain) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN,NULL)==STREAM_OK) + { + uint32_t tlen=0; + float final_pts=0.0; + if (stream_control(stream,STREAM_CTRL_GET_FINALPTS,&final_pts)==STREAM_OK && + stream_control(stream,STREAM_CTRL_GET_TLEN,&tlen)==STREAM_OK) + demuxer_update_time_pts(demuxer, + final_pts, + tlen*2048); +// demuxer_update_time_pts(demuxer, +// ((dvdnav_priv_t*)(stream->priv))->final_pts, +// ((dvdnav_priv_t*)(stream->priv))->tlen*2048); + } else { + demuxer_update_time_pts(demuxer, 0.0, 0); + } +// ((dvdnav_priv_t*)(stream->priv))->lockseek=0; + lockseek=0; + stream_control(stream,STREAM_CTRL_DVDNAV_SET_LOCKSEEK,&lockseek); + } + if (dvdnav_seek_counter) dvdnav_seek_counter--; else sw_muted=0; +#ifdef HAVE_NEW_GUI +// if (!(((dvdnav_priv_t*)(stream->priv))->vts_domain) && sh_video) + if (stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN,NULL)!=STREAM_OK && sh_video) + { + dvdnav_window_orig_width=sh_video->disp_w; /* set original video window size */ + dvdnav_window_orig_height=sh_video->disp_h; /* required on calculate mouse position */ +// dvdnav_mouse((dvdnav_priv_t*)(stream->priv)); /* process mouse positon: set menu button */ + stream_control(stream,STREAM_CTRL_DVDNAV_MOUSE,NULL); + } +#endif +// play to new title + if (dvdnav_go_title>0) + { +// dvdnav_title_play((dvdnav_t*)((dvdnav_priv_t*)(stream->priv))->dvdnav, +// dvdnav_go_title); + stream_control(stream,STREAM_CTRL_DVDNAV_TITLE_PLAY,&dvdnav_go_title); + dvdnav_go_title=dvdnav_go_part=dvdnav_go_menu=dvdnav_go_audio= + dvdnav_go_spu=0; + } +// play to new chapter + if (dvdnav_go_part>0) + { +// dvdnav_part_play((dvdnav_t*)((dvdnav_priv_t*)(stream->priv))->dvdnav, +// ((dvdnav_priv_t*)(stream->priv))->title, dvdnav_go_part); + stream_control(stream,STREAM_CTRL_DVDNAV_PART_PLAY,&dvdnav_go_part); + dvdnav_go_title=dvdnav_go_part=dvdnav_go_menu=dvdnav_go_audio= + dvdnav_go_spu=0; + } +// go main DVD menu + if (dvdnav_go_menu>0) + { +// dvdnav_menu_call((dvdnav_t*)((dvdnav_priv_t*)(stream->priv))->dvdnav, +// DVD_MENU_Root); + int menu_call = DVD_MENUCALL_Root; + stream_control(stream,STREAM_CTRL_DVDNAV_MENUCALL,&menu_call); + dvdnav_go_title=dvdnav_go_part=dvdnav_go_menu=dvdnav_go_audio= + dvdnav_go_spu=0; + } + if (dvdnav_go_menu_force) + { +// dvdnav_menu_force((dvdnav_priv_t*)(stream->priv)); /* go main menu with skip intro */ + stream_control(stream,STREAM_CTRL_DVDNAV_MENUFORCE,NULL); + dvdnav_go_title=dvdnav_go_part=dvdnav_go_menu=dvdnav_go_menu_force= + dvdnav_go_audio=dvdnav_go_spu=0; + } +// switch audio channel + if (dvdnav_go_audio) + { + if (sh_audio) demuxer_switch_audio(demuxer, audio_id); + dvdnav_go_audio=0; + } +// switch spu subtitle + if (dvdnav_go_spu) + { + d_dvdsub->id = dvdsub_id; + if (vo_spudec) + { + spudec_reset(vo_spudec); + dvdnav_go_spu--; + } + } + } +} +#endif + //================= Keyboard events, SEEKing ==================== current_module="key_events"; @@ -4579,209 +5202,35 @@ mplayer_put_key(cmd->args[0].v.i); } break; #ifdef USE_DVDNAV - case MP_CMD_DVDNAV_EVENT: { - dvdnav_priv_t * dvdnav_priv = (dvdnav_priv_t*)(stream->priv); - dvdnav_event_t * dvdnav_event = (dvdnav_event_t *)(cmd->args[0].v.v); - - /* ignore these events if we're not in dvd_nav mode */ - if (stream->type != STREAMTYPE_DVDNAV) break; - - if (!dvdnav_event) { - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNullEvent); - break; - } - - //printf("mplayer: got event: %d\n",dvdnav_event->event); - - switch (dvdnav_event->event) { - case DVDNAV_BLOCK_OK: { - /* be silent about this one */ - break; - } - case DVDNAV_HIGHLIGHT: { - dvdnav_highlight_event_t *hevent = (dvdnav_highlight_event_t*)(dvdnav_event->details); - if (!hevent) { - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavHighlightEventBroken); - break; - } - - if (hevent->display && hevent->buttonN>0) - { - //dvdnav_priv->seen_root_menu=1; /* if we got a highlight, we're on a menu */ - sprintf( dvd_nav_text, "Highlight button %d (%u,%u)-(%u,%u) PTS %d (now is %5.2f)", - hevent->buttonN, - hevent->sx,hevent->sy, - hevent->ex,hevent->ey, - hevent->pts, d_video->pts); - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavEvent,dvd_nav_text); - //osd_show_dvd_nav_delay = 60; - - osd_show_dvd_nav_highlight=1; /* this is just a flag */ - osd_show_dvd_nav_sx=hevent->sx; - osd_show_dvd_nav_ex=hevent->ex; - osd_show_dvd_nav_sy=hevent->sy; - osd_show_dvd_nav_ey=hevent->ey; - } - else { - osd_show_dvd_nav_highlight=0; - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavHighlightHide); - } - break; - } - case DVDNAV_STILL_FRAME: { - dvdnav_still_event_t *still_event = (dvdnav_still_event_t*)(dvdnav_event->details); - - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavStillFrame, still_event->length ); - while (dvdnav_stream_sleeping(dvdnav_priv)) { - usec_sleep(1000); /* 1ms */ - } - dvdnav_stream_sleep(dvdnav_priv,still_event->length); - break; - } - case DVDNAV_STOP: { - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNavStop ); - break; - } - case DVDNAV_NOP: { - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNavNOP); - break; - } - case DVDNAV_SPU_STREAM_CHANGE: { -#if DVDNAVVERSION > 012 - dvdnav_spu_stream_change_event_t *stream_change = (dvdnav_spu_stream_change_event_t*)(dvdnav_event->details); - - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNavSpuStreamChangeVerbose, - stream_change->physical_wide, - stream_change->physical_letterbox, - stream_change->physical_pan_scan, - stream_change->logical); - - if (vo_spudec && dvdsub_id!=stream_change->physical_wide) { - mp_msg(MSGT_INPUT,MSGL_DBG2,"d_dvdsub->id change: was %d is now %d\n", - d_dvdsub->id,stream_change->physical_wide); - // FIXME: need a better way to change SPU id - d_dvdsub->id=dvdsub_id=stream_change->physical_wide; - if (vo_spudec) spudec_reset(vo_spudec); - } -#else - dvdnav_stream_change_event_t *stream_change = (dvdnav_stream_change_event_t*)(dvdnav_event->details); - - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNavSpuStreamChange, - stream_change->physical, - stream_change->logical); - - if (vo_spudec && dvdsub_id!=stream_change->physical) { - mp_msg(MSGT_INPUT,MSGL_DBG2,"d_dvdsub->id change: was %d is now %d\n", - d_dvdsub->id,stream_change->physical); - // FIXME: need a better way to change SPU id - d_dvdsub->id=dvdsub_id=stream_change->physical; - if (vo_spudec) spudec_reset(vo_spudec); - } -#endif /* DVDNAVVERSION > 012 */ - break; - } - case DVDNAV_AUDIO_STREAM_CHANGE: { - int aid_temp; -#if DVDNAVVERSION > 012 - dvdnav_audio_stream_change_event_t *stream_change = (dvdnav_audio_stream_change_event_t*)(dvdnav_event->details); -#else - dvdnav_stream_change_event_t *stream_change = (dvdnav_stream_change_event_t*)(dvdnav_event->details); -#endif - - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNavAudioStreamChange, - stream_change->physical, - stream_change->logical); - - aid_temp=stream_change->physical; - if (aid_temp>=0) aid_temp+=128; // FIXME: is this sane? - if (d_audio && audio_id!=aid_temp) { - mp_msg(MSGT_INPUT,MSGL_DBG2,"d_audio->id change: was %d is now %d\n", - d_audio->id,aid_temp); - // FIXME: need a better way to change audio stream id - d_audio->id=dvdsub_id=aid_temp; - if(sh_audio) resync_audio_stream(sh_audio); - } - - break; - } - case DVDNAV_VTS_CHANGE: { - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNavVTSChange); - break; - } - case DVDNAV_CELL_CHANGE: { - dvdnav_cell_change_event_t *cell_change = (dvdnav_cell_change_event_t*)(dvdnav_event->details); - cell_playback_t * cell_playback = cell_change->new_cell; - - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNavCellChange); - osd_show_dvd_nav_highlight=0; /* screen changed, disable menu */ - /* - printf("new still time: %d\n",cell_playback->still_time); - printf("new cell_cmd_nr: %d\n",cell_playback->cell_cmd_nr); - printf("new playback_time: %02d:%02d:%02d.%02d\n", - cell_playback->playback_time.hour, - cell_playback->playback_time.minute, - cell_playback->playback_time.second, - cell_playback->playback_time.frame_u); - - */ - //rel_seek_secs=1; // not really: we can't seek, but it'll reset the muxer - //abs_seek_pos=0; - break; - } - case DVDNAV_NAV_PACKET: { - // printf("DVDNAV Event: Nav Packet\n"); - break; - } - case DVDNAV_SPU_CLUT_CHANGE: { - uint32_t * new_clut = (uint32_t *)(dvdnav_event->details); - - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNavSpuClutChange); - // send new palette to SPU decoder - if (vo_spudec) spudec_update_palette(vo_spudec,new_clut); - - break; - } - case DVDNAV_SEEK_DONE: { - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavNavSeekDone); - break; - } - } - - // free the dvdnav event - free(dvdnav_event->details); - free(dvdnav_event); - cmd->args[0].v.v=NULL; - } case MP_CMD_DVDNAV: { - dvdnav_priv_t * dvdnav_priv=(dvdnav_priv_t*)stream->priv; - +// dvdnav_priv_t * dvdnav_priv=(dvdnav_priv_t*)stream->priv; /* ignore these events if we're not in dvd_nav mode */ if (stream->type != STREAMTYPE_DVDNAV) break; - switch (cmd->args[0].v.i) { + case MP_CMD_DVDNAV_SELECT: + if (vo_spudec && (dvdnav_menutype==DVDNAV_MENUTYPE_SPU || + dvdnav_menutype==DVDNAV_MENUTYPE_SPU_BOX)) + { +// dvdnav_highlight_event_t highlight; +// dvdnav_get_highlight((dvdnav_priv_t*)(stream->priv),&highlight,2); /* get spu botton area & palette */ + mp_highlight_t highlight; + stream_control(stream,STREAM_CTRL_DVDNAV_GET_HIGHLIGHT_ACTIVATE,&highlight); + spudec_dvdnav_area(vo_spudec,highlight.sx,highlight.sy,highlight.ex, + highlight.ey,highlight.palette); /* set spu button area & palette */ + vo_osd_changed(OSDTYPE_SPU); + dvdnav_activate_timer=GetTimer(); + } case MP_CMD_DVDNAV_UP: - dvdnav_upper_button_select(dvdnav_priv->dvdnav); - break; case MP_CMD_DVDNAV_DOWN: - dvdnav_lower_button_select(dvdnav_priv->dvdnav); - break; case MP_CMD_DVDNAV_LEFT: - dvdnav_left_button_select(dvdnav_priv->dvdnav); - break; case MP_CMD_DVDNAV_RIGHT: - dvdnav_right_button_select(dvdnav_priv->dvdnav); - break; case MP_CMD_DVDNAV_MENU: - mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_MenuCall); - dvdnav_menu_call(dvdnav_priv->dvdnav,DVD_MENU_Root); - break; - case MP_CMD_DVDNAV_SELECT: - dvdnav_button_activate(dvdnav_priv->dvdnav); +// dvdnav_menu_action(dvdnav_priv, cmd->args[0].v.i); + stream_control(stream,STREAM_CTRL_DVDNAV_MENU_ACTION,&cmd->args[0].v.i); break; default: - mp_msg(MSGT_CPLAYER, MSGL_V, "Weird DVD Nav cmd %d\n",cmd->args[0].v.i); - break; - } +// mp_msg(MSGT_CPLAYER, MSGL_V, "Weird DVD Nav cmd %d\n",cmd->args[0].v.i); + break; } break; } #endif /* USE_DVDNAV */ @@ -4898,7 +5347,7 @@ next_edl_record = next_edl_record->next; } -if ((user_muted | edl_muted) != mixer.muted) mixer_mute(&mixer); +if ((user_muted || edl_muted) != mixer.muted) mixer_mute(&mixer); rel_seek_secs=0; abs_seek_pos=0; @@ -4906,6 +5355,7 @@ current_module=NULL; loop_seek=0; } +if (sh_audio && !user_muted && !edl_muted && !sw_muted && mixer.muted) mixer_mute(&mixer); #ifdef HAVE_NEW_GUI if(use_gui){ @@ -5003,6 +5453,15 @@ } /* detect wether the sub has changed or not */ +#ifdef USE_DVDNAV + /* still image now process data, because next frame reseek: delete read spu packet */ + if(stream->type==STREAMTYPE_DVDNAV) + { +// if(dvdnav_still || !((dvdnav_priv_t*)(stream->priv))->vts_domain) + if (dvdnav_still || stream_control(stream,STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN,NULL)!=STREAM_OK) + spudec_heartbeat(vo_spudec,90000*sh_video->timer); + } +#endif if(spudec_changed(vo_spudec)) vo_osd_changed(OSDTYPE_SPU); current_module=NULL; diff -Nur MPlayer-1.0pre8.orig/spudec.c MPlayer-1.0pre8/spudec.c --- MPlayer-1.0pre8.orig/spudec.c 2006-06-11 21:35:47.000000000 +0300 +++ MPlayer-1.0pre8/spudec.c 2006-06-15 23:04:46.000000000 +0300 @@ -91,6 +91,52 @@ int spu_changed; unsigned int forced_subs_only; /* flag: 0=display all subtitle, !0 display only forced subtitles */ unsigned int is_forced_sub; /* true if current subtitle is a forced subtitle */ + + packet_t *last_packet; + unsigned int widthuv, heightuv, strideuv; + unsigned int start_coluv, end_coluv; + unsigned int start_rowuv, end_rowuv; + size_t image_sizeuv; + size_t scaled_image_sizeuv; + size_t image_sizeyuy; + + unsigned int scaled_frame_widthuv, scaled_frame_heightuv; + unsigned int scaled_start_coluv, scaled_start_rowuv; + unsigned int scaled_widthuv, scaled_heightuv, scaled_strideuv; + unsigned char *scaled_imageu; + unsigned char *scaled_imagev; + unsigned char *scaled_aimageuv; + + unsigned int hpalette[4]; + unsigned int halpha[4]; + unsigned int hcuspal[4]; + + unsigned char *imageu; /* u value from yUv */ + unsigned char *imagev; /* v value from yuV*/ + unsigned char *aimageuv; /* alpha with uv*/ + unsigned char *imageyuy; /* yuy2 */ + unsigned char *aimageyuy; /* alpha with yuy2*/ + unsigned int strideyuy; + + int dvdnav_color_spu; /* flag: 0 = grayscale SPU, 1 = YUV color SPU 2 = RGB 3 = BGR */ + + int dvdnav_menu; /* flag: 0=normal subtitle, 1=dvdnav menu */ + unsigned int dvdnav_sx; /* dvdnav menu item box */ + unsigned int dvdnav_ex; + unsigned int dvdnav_sy; + unsigned int dvdnav_ey; + unsigned int dvdnav_modify; /* dvdnav menu item box is modify */ + uint32_t dvdnav_palette; /* dvdnav menu button palette */ + unsigned int dvdnav_x0; /* dvdnav menu item draw_alpha coordinates */ + unsigned int dvdnav_y0; + unsigned int dvdnav_w; + unsigned int dvdnav_h; + unsigned char *dvdnav_image; /* dvdnav menu item image */ + unsigned char *dvdnav_aimage; /* dvdnav menu item alpha */ + unsigned int dvdnav_stride; + unsigned int dvdnav_allocated; + unsigned int dvdnav_scalex; + unsigned int dvdnav_scaley; } spudec_handle_t; static void spudec_queue_packet(spudec_handle_t *this, packet_t *packet) @@ -210,11 +256,132 @@ } else { mp_msg(MSGT_SPUDEC, MSGL_FATAL, "Fatal: update_spu: malloc requested %d bytes\n", 2 * this->stride * this->height); } + unsigned char *imageu; + unsigned char *imagev; + switch (this->dvdnav_color_spu) { + case DVDNAV_SPU_YUV: + case DVDNAV_SPU_YUY: + for (fy = 0; fy < this->image_sizeuv && !this->aimageuv[fy]; fy++); + for (ly = this->strideuv * this->heightuv-1; + ly && !this->aimageuv[ly]; ly--); + first_y = fy / this->strideuv; + last_y = ly / this->strideuv; + this->start_rowuv += first_y; + // Some subtitles trigger this condition + if (last_y + 1 > first_y ) { + this->heightuv = last_y - first_y +1; + } else { + this->heightuv = 0; + this->image_sizeuv = 0; + return; + } + // printf("new h %d new start %d (sz %d st %d)---\n\n", this->height, this->start_row, this->image_size, this->stride); + imageu = malloc(3 * this->strideuv * this->heightuv); + if(imageu){ + this->image_sizeuv = this->strideuv * this->heightuv; + imagev = imageu + this->image_sizeuv; + aimage = imagev + this->image_sizeuv; + memcpy(imageu, this->imageu + this->strideuv * first_y, + this->image_sizeuv); + memcpy(imagev, this->imagev + this->strideuv * first_y, + this->image_sizeuv); + memcpy(aimage, this->aimageuv + this->strideuv * first_y, + this->image_sizeuv); + free(this->imageu); + this->imageu = imageu; + this->imagev = imagev; + this->aimageuv = aimage; + } else { + mp_msg(MSGT_SPUDEC, MSGL_FATAL, + "Fatal: update_spu: malloc requested %d bytes\n", + 3 * this->strideuv * this->height); + } + break; + case DVDNAV_SPU_RGB: + case DVDNAV_SPU_BGR: + this->image_sizeuv = this->stride * this->height; + imageu = malloc(2 * this->stride * this->height); + if(imageu){ + imagev = imageu + this->image_size; + memcpy(imageu, this->imageu + this->stride * first_y, this->image_size); + memcpy(imagev, this->imagev + this->stride * first_y, this->image_size); + free(this->imageu); + this->imageu = imageu; + this->imagev = imagev; + this->aimageuv = NULL; + } else { + mp_msg(MSGT_SPUDEC, MSGL_FATAL, + "Fatal: update_spu: malloc requested %d bytes\n", + 2 * this->stride * this->height); + } + break; + } +} + +void spu_yuv_to_rgb(unsigned int y,unsigned int u,unsigned int v, + unsigned int *r,unsigned int *g,unsigned int *b) +{ +int ty,tu,tv; +int tr,tg,tb; +ty=y;tv=u;tu=v; +tr = (298*(ty-16)+408*(tv-128))/256; +tg = (298*(ty-16)-100*(tu-128)-208*(tv-128))/256; +tb = (298*(ty-16)+516*(tu-128))/256; +if(tr>255) tr=255; if(tr<0) tr=0; +if(tg>255) tg=255; if(tg<0) tg=0; +if(tb>255) tb=255; if(tb<0) tb=0; +*r=tr; *g=tg; *b=tb; +return; +} + +static void spudec_process_fill(spudec_handle_t *this, int x, int y, int len, + unsigned char color, unsigned char coloru, unsigned char colorv, + unsigned char alpha) +{ +unsigned int corrx, corry, corrl; +if (this->stride-x-len<0) return; +if (len<0) return; +switch (this->dvdnav_color_spu) + { + case DVDNAV_SPU_YUV: + case DVDNAV_SPU_YUY: + corry=y & 0x01; + corrx=x & 0x01; + corrl=len & 0x01; + memset(this->image + y * this->stride + x, color, len); + memset(this->aimage + y * this->stride + x, alpha, len); + memset(this->imageu + (y-corry)/2 * this->strideuv + (x+corrx)/2, coloru, + (len-corrl)/2); + memset(this->imagev + (y-corry)/2 * this->strideuv + (x+corrx)/2, colorv, + (len-corrl)/2); + memset(this->aimageuv + (y-corry)/2 * this->strideuv + (x+corrx)/2, alpha, + (len-corrl)/2); + break; + case DVDNAV_SPU_RGB: + case DVDNAV_SPU_BGR: + memset(this->image + y * this->stride + x, color, len); + memset(this->imageu + y * this->stride + x, coloru, len); + memset(this->imagev + y * this->stride + x, colorv, len); + memset(this->aimage + y * this->stride + x, alpha, len); + break; + default: + memset(this->image + y * this->stride + x, color, len); + memset(this->aimage + y * this->stride + x, alpha, len); + break; +} } static void spudec_process_data(spudec_handle_t *this, packet_t *packet) { unsigned int cmap[4], alpha[4]; + unsigned int thpalette[4], thalpha[4]; + unsigned int hcmap[4], halpha[4]; + unsigned int cmapu[4], cmapv[4]; + unsigned int hcmapu[4], hcmapv[4]; + unsigned int control_start; + unsigned int current_nibble[2]; + unsigned int ty,tu,tv,tr,tg,tb; + int deinterlace_oddness; unsigned int i, x, y; this->scaled_frame_width = 0; @@ -226,6 +393,18 @@ this->height = packet->height; this->width = packet->width; this->stride = packet->stride; + this->strideuv = packet->stride; + control_start = packet->control_start; + current_nibble[0]=packet->current_nibble[0]; + current_nibble[1]=packet->current_nibble[1]; + deinterlace_oddness=packet->deinterlace_oddness; + + this->start_coluv = packet->start_col/2; + this->end_coluv = packet->end_col/2; + this->start_rowuv = packet->start_row/2; + this->end_rowuv = packet->end_row/2; + this->heightuv = packet->height/2+1; + this->widthuv = packet->width/2+1; for (i = 0; i < 4; ++i) { alpha[i] = mkalpha(packet->alpha[i]); if (alpha[i] == 0) @@ -241,7 +420,91 @@ cmap[i] = 256 - alpha[i]; } } - + if (this->dvdnav_menu) + for (i = 0; i < 4; ++i) { /* use button palette */ + thalpha[i]=(this->dvdnav_palette >> ((3-i)*4)) & 0x0f; + thpalette[i]=(this->dvdnav_palette >> (16+(3-i)*4)) & 0x0f; + halpha[i] = mkalpha(thalpha[i]); + hcmap[i] = ((this->global_palette[thpalette[i]] >> 16) & 0xff); + if (alpha[i] == 0) {cmap[i] = 0; cmapu[i] = 0; cmapv[i] = 0;} else { + if (cmap[i] + alpha[i] > 255) + cmap[i] = 256 - alpha[i]; + switch (this->dvdnav_color_spu) { + case DVDNAV_SPU_YUV: + case DVDNAV_SPU_YUY: + cmap[i] = ((this->global_palette[packet->palette[i]] >> 16) & 0xff); // Y + cmap[i] = ((0x100-alpha[i])*cmap[i]) >> 8; + cmapu[i] = ((this->global_palette[packet->palette[i]] >> 8) & 0xff); // u + cmapu[i] = ((0x100-alpha[i])*cmapu[i]) >> 8; + cmapv[i] = ((this->global_palette[packet->palette[i]] >> 0) & 0xff); // v + cmapv[i] = ((0x100-alpha[i])*cmapv[i]) >> 8; + break; + case DVDNAV_SPU_RGB: + ty = ((this->global_palette[packet->palette[i]] >> 16) & 0xff); // Y + tu = ((this->global_palette[packet->palette[i]] >> 8) & 0xff); // u + tv = ((this->global_palette[packet->palette[i]] >> 0) & 0xff); // v + spu_yuv_to_rgb(ty,tu,tv,&tr,&tg,&tb); + cmap[i] = tr; + cmapu[i] = tg; + cmapv[i] = tb; + cmap[i] = ((0x100-alpha[i])*cmap[i]) >> 8; + cmapu[i] = ((0x100-alpha[i])*cmapu[i]) >> 8; + cmapv[i] = ((0x100-alpha[i])*cmapv[i]) >> 8; + break; + case DVDNAV_SPU_BGR: + ty = ((this->global_palette[packet->palette[i]] >> 16) & 0xff); // Y + tu = ((this->global_palette[packet->palette[i]] >> 8) & 0xff); // u + tv = ((this->global_palette[packet->palette[i]] >> 0) & 0xff); // v + spu_yuv_to_rgb(ty,tu,tv,&tr,&tg,&tb); + cmap[i] = tb; + cmapu[i] = tg; + cmapv[i] = tr; + cmap[i] = ((0x100-alpha[i])*cmap[i]) >> 8; + cmapu[i] = ((0x100-alpha[i])*cmapu[i]) >> 8; + cmapv[i] = ((0x100-alpha[i])*cmapv[i]) >> 8; + break; + } + } + if (halpha[i] == 0) {hcmap[i] = 0; hcmapu[i] = 0; hcmapv[i] = 0;} else { + if (hcmap[i] + halpha[i] > 255) + hcmap[i] = 256 - halpha[i]; + switch (this->dvdnav_color_spu) { + case DVDNAV_SPU_YUV: + case DVDNAV_SPU_YUY: + hcmap[i] = ((this->global_palette[thpalette[i]] >> 16) & 0xff); // Y + hcmap[i] = ((0x100-halpha[i])*hcmap[i]) >> 8; + hcmapu[i] = ((this->global_palette[thpalette[i]] >> 8) & 0xff); // u + hcmapu[i] = ((0x100-halpha[i])*hcmapu[i]) >> 8; + hcmapv[i] = ((this->global_palette[thpalette[i]] >> 0) & 0xff); // v + hcmapv[i] = ((0x100-halpha[i])*hcmapv[i]) >> 8; + break; + case DVDNAV_SPU_RGB: + ty = ((this->global_palette[thpalette[i]] >> 16) & 0xff); // Y + tu = ((this->global_palette[thpalette[i]] >> 8) & 0xff); // u + tv = ((this->global_palette[thpalette[i]] >> 0) & 0xff); // v + spu_yuv_to_rgb(ty,tu,tv,&tr,&tg,&tb); + hcmap[i] = tr; + hcmapu[i] = tg; + hcmapv[i] = tb; + hcmap[i] = ((0x100-halpha[i])*hcmap[i]) >> 8; + hcmapu[i] = ((0x100-halpha[i])*hcmapu[i]) >> 8; + hcmapv[i] = ((0x100-halpha[i])*hcmapv[i]) >> 8; + break; + case DVDNAV_SPU_BGR: + ty = ((this->global_palette[thpalette[i]] >> 16) & 0xff); // Y + tu = ((this->global_palette[thpalette[i]] >> 8) & 0xff); // u + tv = ((this->global_palette[thpalette[i]] >> 0) & 0xff); // v + spu_yuv_to_rgb(ty,tu,tv,&tr,&tg,&tb); + hcmap[i] = tb; + hcmapu[i] = tg; + hcmapv[i] = tr; + hcmap[i] = ((0x100-halpha[i])*hcmap[i]) >> 8; + hcmapu[i] = ((0x100-halpha[i])*hcmapu[i]) >> 8; + hcmapv[i] = ((0x100-halpha[i])*hcmapv[i]) >> 8; + break; + } + } + } if (this->image_size < this->stride * this->height) { if (this->image != NULL) { free(this->image); @@ -255,6 +518,57 @@ } if (this->image == NULL) return; +if(this->dvdnav_menu && this->dvdnav_color_spu) + { + if (this->imageyuy) + { + free(this->imageyuy); + this->imageyuy=NULL; + this->aimageyuy=NULL; + } + if (this->dvdnav_color_spu==DVDNAV_SPU_YUV || + this->dvdnav_color_spu==DVDNAV_SPU_YUY) + { + if (this->image_sizeuv < this->strideuv * this->heightuv) + { + if (this->imageu != NULL) + { + free(this->imageu); + this->image_sizeuv = 0; + } + this->imageu = malloc(3 * this->strideuv * this->heightuv); + if (this->imageu) + { + this->image_sizeuv = this->strideuv * this->heightuv; + this->imagev = this->imageu + this->image_sizeuv; + this->aimageuv = this->imagev + this->image_sizeuv; + } + } + memset(this->imageu,0,3 * this->strideuv * this->heightuv); + } else { + if (this->image_sizeuv < this->stride * this->height) + { + if (this->imageu != NULL) + { + free(this->imageu); + this->image_sizeuv = 0; + } + this->imageu = malloc(2 * this->stride * this->height); + if (this->imageu) + { + this->image_sizeuv = this->stride * this->height; + this->imagev = this->imageu + this->image_sizeuv; + this->aimageuv = this->imagev + this->image_sizeuv; + } + } + memset(this->imageu,0,2 * this->stride * this->height); + } + if (this->imageu == NULL) return; + } else { + if (this->imageu) free(this->imageu); + this->imageu=NULL; + this->image_sizeuv=0; + } /* Kludge: draw_alpha needs width multiple of 8. */ if (this->width < this->stride) @@ -289,8 +603,86 @@ if (len > this->width - x || len == 0) len = this->width - x; /* FIXME have to use palette and alpha map*/ + if (this->dvdnav_menu) + { + if (this->start_row+y>=this->dvdnav_sy && + this->start_row+y<=this->dvdnav_ey) + { + if (this->start_col+x>=this->dvdnav_sx && + this->start_col+x+len<=this->dvdnav_ex) + spudec_process_fill(this, + x, + y, + len, + hcmap[color], hcmapu[color], hcmapv[color], halpha[color]); + else if(this->start_col+xdvdnav_sx && + this->start_col+x+len>this->dvdnav_sx && + this->start_col+x+len<=this->dvdnav_ex) + { + spudec_process_fill(this, + x, + y, + this->dvdnav_sx-this->start_col-x, + cmap[color], cmapu[color], cmapv[color], alpha[color]); + spudec_process_fill(this, + this->dvdnav_sx-this->start_col, + y, + len+this->start_col+x-this->dvdnav_sx, + hcmap[color], hcmapu[color], hcmapv[color], halpha[color]); + } + else if(this->start_col+xdvdnav_sx && + this->start_col+x+len>this->dvdnav_sx && + this->start_col+x+len>this->dvdnav_ex) + { + spudec_process_fill(this, + x, + y, + this->dvdnav_sx-this->start_col-x, + cmap[color], cmapu[color], cmapv[color], alpha[color]); + spudec_process_fill(this, + this->dvdnav_sx-this->start_col, + y, + this->dvdnav_ex-this->dvdnav_sx, + hcmap[color], hcmapu[color], hcmapv[color], halpha[color]); + spudec_process_fill(this, + this->dvdnav_ex-this->start_col, + y, + x+len+this->start_col-this->dvdnav_ex, + cmap[color], cmapu[color], cmapv[color], alpha[color]); + } + else if(this->start_col+x>=this->dvdnav_sx && + this->start_col+xdvdnav_ex && + this->start_col+x+len>this->dvdnav_ex) + { + spudec_process_fill(this, + x, + y, + this->dvdnav_ex-this->start_col-x, + hcmap[color], hcmapu[color], hcmapv[color], halpha[color]); + spudec_process_fill(this, + this->dvdnav_ex-this->start_col, + y, + len+this->start_col+x-this->dvdnav_ex, + cmap[color], cmapu[color], cmapv[color], alpha[color]); + } + else + spudec_process_fill(this, + x, + y, + len, + cmap[color], cmapu[color], cmapv[color], alpha[color]); + } else + spudec_process_fill(this, + x, + y, + len, + cmap[color], cmapu[color], cmapv[color], alpha[color]); + } + else + { memset(this->image + y * this->stride + x, cmap[color], len); memset(this->aimage + y * this->stride + x, alpha[color], len); + } x += len; if (x >= this->width) { next_line(packet); @@ -298,7 +690,12 @@ ++y; } } + packet->control_start = control_start; + packet->current_nibble[0]=current_nibble[0]; + packet->current_nibble[1]=current_nibble[1]; + packet->deinterlace_oddness=deinterlace_oddness; spudec_cut_image(this); +//printf("spudec_process_data: w: %i h: %i end\n",this->height,this->width); } @@ -583,6 +980,7 @@ spu->now_pts = 0; spu->end_pts = 0; spu->packet_size = spu->packet_offset = 0; +// if (spu->last_packet) {printf("free4\n");spudec_free_packet(spu->last_packet); spu->last_packet=NULL;} } void spudec_heartbeat(void *this, unsigned int pts100) @@ -590,6 +988,7 @@ spudec_handle_t *spu = (spudec_handle_t*) this; spu->now_pts = pts100; + if(spu->queue_head) spu->queue_head->start_pts=0; while (spu->queue_head != NULL && pts100 >= spu->queue_head->start_pts) { packet_t *packet = spudec_dequeue_packet(spu); spu->start_pts = packet->start_pts; @@ -597,17 +996,31 @@ if (spu->auto_palette) compute_palette(spu, packet); spudec_process_data(spu, packet); + if (spu->dvdnav_menu) + { + if(spu->last_packet) + { + spudec_free_packet(spu->last_packet); + } + spu->last_packet=packet; + } else spudec_free_packet(packet); spu->spu_changed = 1; } } + int spudec_visible(void *this){ spudec_handle_t *spu = (spudec_handle_t *)this; + if(!spu) return 0; + if (spu->dvdnav_menu && spu->height > 0) + { + if(spu->height>0) spu->end_pts=UINT_MAX; + return 1; + } int ret=(spu->start_pts <= spu->now_pts && spu->now_pts < spu->end_pts && spu->height > 0); -// printf("spu visible: %d \n",ret); return ret; } @@ -619,12 +1032,90 @@ } } -void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) +void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)) { spudec_handle_t *spu = (spudec_handle_t *)this; if (spu->start_pts <= spu->now_pts && spu->now_pts < spu->end_pts && spu->image) { - draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height, + if (spu->dvdnav_menu) + { /* spu menu mode? */ + switch (spu->dvdnav_color_spu) + { + case DVDNAV_SPU_YUV: + draw_alpha(spu->start_col, + spu->start_row, + spu->width, + spu->height, + DEST_PLANES_Y, + spu->image, + spu->aimage, + spu->stride); + draw_alpha(spu->start_coluv, + spu->start_rowuv, + spu->widthuv, + spu->heightuv, + DEST_PLANES_U, + spu->imageu, + spu->aimageuv, + spu->strideuv); + draw_alpha(spu->start_coluv, + spu->start_rowuv, + spu->widthuv, + spu->heightuv, + DEST_PLANES_V, + spu->imagev, + spu->aimageuv, + spu->strideuv); + break; + case DVDNAV_SPU_YUY: + if (!spu->imageyuy) spudec_create_yuy(spu,0); + if (spu->imageyuy) draw_alpha(spu->start_col, + spu->start_row, + spu->width*2, + spu->height/2, + DEST_PLANES_YUYV, + spu->imageyuy, + spu->aimageyuy, + spu->strideyuy); + break; + case DVDNAV_SPU_RGB: + case DVDNAV_SPU_BGR: + draw_alpha(spu->start_col, + spu->start_row, + spu->width, spu->height, + DEST_PLANES_BR, + spu->imagev, + spu->aimage, + spu->stride); + draw_alpha(spu->start_col, + spu->start_row, + spu->width, + spu->height, + DEST_PLANES_G, + spu->imageu, + spu->aimage, + spu->stride); + draw_alpha(spu->start_col, + spu->start_row, + spu->width, + spu->height, + DEST_PLANES_RB, + spu->image, + spu->aimage, + spu->stride); + break; + default: + draw_alpha(spu->start_col, + spu->start_row, + spu->width, + spu->height, + DEST_PLANES_Y, + spu->image, + spu->aimage, + spu->stride); + } + } else + draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height,DEST_PLANES_Y, spu->image, spu->aimage, spu->stride); spu->spu_changed = 0; } @@ -736,6 +1227,119 @@ } } +static void scale_image_uv(int x, int y, scale_pixel* table_x, + scale_pixel* table_y, spudec_handle_t * spu) +{ + int alpha[4]; + int coloru[4]; + int colorv[4]; + unsigned int scale[4]; + int base = table_y[y].position * spu->strideuv + table_x[x].position; + int scaled = y * spu->scaled_strideuv + x; + alpha[0] = canon_alpha(spu->aimageuv[base]); + alpha[1] = canon_alpha(spu->aimageuv[base + 1]); + alpha[2] = canon_alpha(spu->aimageuv[base + spu->strideuv]); + alpha[3] = canon_alpha(spu->aimageuv[base + spu->strideuv + 1]); + coloru[0] = spu->imageu[base]; + coloru[1] = spu->imageu[base + 1]; + coloru[2] = spu->imageu[base + spu->strideuv]; + coloru[3] = spu->imageu[base + spu->strideuv + 1]; + colorv[0] = spu->imagev[base]; + colorv[1] = spu->imagev[base + 1]; + colorv[2] = spu->imagev[base + spu->strideuv]; + colorv[3] = spu->imagev[base + spu->strideuv + 1]; +// FIXME: color hack!!! +// scale[0] = (table_x[x].left_up * table_y[y].left_up >> 16) * alpha[0]; +// scale[1] = (table_x[x].right_down * table_y[y].left_up >>16) * alpha[1]; +// scale[2] = (table_x[x].left_up * table_y[y].right_down >> 16) * alpha[2]; +// scale[3] = (table_x[x].right_down * table_y[y].right_down >> 16) * alpha[3]; + scale[0] = (table_x[x].left_up * table_y[y].left_up >> 16) * 0x100; + scale[1] = (table_x[x].right_down * table_y[y].left_up >>16) * 0x100; + scale[2] = (table_x[x].left_up * table_y[y].right_down >> 16) * 0x100; + scale[3] = (table_x[x].right_down * table_y[y].right_down >> 16) * 0x100; + spu->scaled_imageu[scaled] = + (coloru[0] * scale[0] + + coloru[1] * scale[1] + + coloru[2] * scale[2] + + coloru[3] * scale[3])>>24; + spu->scaled_imagev[scaled] = + (colorv[0] * scale[0] + + colorv[1] * scale[1] + + colorv[2] * scale[2] + + colorv[3] * scale[3])>>24; + scale[0] = (table_x[x].left_up * table_y[y].left_up >> 16) * alpha[0]; + scale[1] = (table_x[x].right_down * table_y[y].left_up >>16) * alpha[1]; + scale[2] = (table_x[x].left_up * table_y[y].right_down >> 16) * alpha[2]; + scale[3] = (table_x[x].right_down * table_y[y].right_down >> 16) * alpha[3]; + spu->scaled_aimageuv[scaled] = + (scale[0] + scale[1] + scale[2] + scale[3]) >> 16; + if (spu->scaled_aimageuv[scaled]){ + spu->scaled_aimageuv[scaled] = 256 - spu->scaled_aimageuv[scaled]; + if(spu->scaled_aimageuv[scaled] + spu->scaled_imageu[scaled] > 255) + spu->scaled_imageu[scaled] = 256 - spu->scaled_aimageuv[scaled]; + if(spu->scaled_aimageuv[scaled] + spu->scaled_imagev[scaled] > 255) + spu->scaled_imagev[scaled] = 256 - spu->scaled_aimageuv[scaled]; + } +} + +static void scale_image_rgb(int x, int y, scale_pixel* table_x, scale_pixel* table_y, spudec_handle_t * spu) +{ + int alpha[4]; + int colorr[4]; + int colorg[4]; + int colorb[4]; + unsigned int scale[4]; + int base = table_y[y].position * spu->stride + table_x[x].position; + int scaled = y * spu->scaled_stride + x; + alpha[0] = canon_alpha(spu->aimage[base]); + alpha[1] = canon_alpha(spu->aimage[base + 1]); + alpha[2] = canon_alpha(spu->aimage[base + spu->stride]); + alpha[3] = canon_alpha(spu->aimage[base + spu->stride + 1]); + colorr[0] = spu->image[base]; + colorr[1] = spu->image[base + 1]; + colorr[2] = spu->image[base + spu->stride]; + colorr[3] = spu->image[base + spu->stride + 1]; + colorg[0] = spu->imageu[base]; + colorg[1] = spu->imageu[base + 1]; + colorg[2] = spu->imageu[base + spu->stride]; + colorg[3] = spu->imageu[base + spu->stride + 1]; + colorb[0] = spu->imagev[base]; + colorb[1] = spu->imagev[base + 1]; + colorb[2] = spu->imagev[base + spu->stride]; + colorb[3] = spu->imagev[base + spu->stride + 1]; + scale[0] = (table_x[x].left_up * table_y[y].left_up >> 16) * alpha[0]; + scale[1] = (table_x[x].right_down * table_y[y].left_up >>16) * alpha[1]; + scale[2] = (table_x[x].left_up * table_y[y].right_down >> 16) * alpha[2]; + scale[3] = (table_x[x].right_down * table_y[y].right_down >> 16) * alpha[3]; + spu->scaled_image[scaled] = + (colorr[0] * scale[0] + + colorr[1] * scale[1] + + colorr[2] * scale[2] + + colorr[3] * scale[3])>>24; + spu->scaled_imageu[scaled] = + (colorg[0] * scale[0] + + colorg[1] * scale[1] + + colorg[2] * scale[2] + + colorg[3] * scale[3])>>24; + spu->scaled_imagev[scaled] = + (colorb[0] * scale[0] + + colorb[1] * scale[1] + + colorb[2] * scale[2] + + colorb[3] * scale[3])>>24; + spu->scaled_aimage[scaled] = + (scale[0] + scale[1] + scale[2] + scale[3]) >> 16; + if (spu->scaled_aimage[scaled]){ + spu->scaled_aimage[scaled] = 256 - spu->scaled_aimage[scaled]; + if(spu->scaled_aimage[scaled] + spu->scaled_image[scaled] > 255) + spu->scaled_image[scaled] = 256 - spu->scaled_aimage[scaled]; + if(spu->scaled_aimage[scaled] + spu->scaled_imageu[scaled] > 255) + spu->scaled_imageu[scaled] = 256 - spu->scaled_aimage[scaled]; + if(spu->scaled_aimage[scaled] + spu->scaled_imagev[scaled] > 255) + spu->scaled_imagev[scaled] = 256 - spu->scaled_aimage[scaled]; + } +} + + void sws_spu_image(unsigned char *d1, unsigned char *d2, int dw, int dh, int ds, unsigned char *s1, unsigned char *s2, int sw, int sh, int ss) { @@ -762,11 +1366,204 @@ sws_freeContext(ctx); } -void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) +void spudec_create_yuy(void *this, int spu_scaled) +{ +spudec_handle_t *spu = this; +unsigned char *dptr; +unsigned char *daptr; +unsigned char *sptry; +unsigned char *sptru; +unsigned char *sptrv; +unsigned char *saptr; +unsigned char *saptruv; +int y,x; + +if (spu_scaled) { + spu->strideyuy=spu->scaled_stride*2; + spu->imageyuy=malloc(spu->strideyuy*(spu->height+2)*2); + memset(spu->imageyuy,0,spu->strideyuy*(spu->height+2)*2); + spu->aimageyuy=spu->imageyuy+spu->strideyuy*spu->scaled_height; + for(y=0;yscaled_height;y++) { + dptr=spu->imageyuy+y*spu->strideyuy; + daptr=spu->aimageyuy+y*spu->strideyuy; + sptry=spu->scaled_image+y*spu->scaled_stride; + sptru=spu->scaled_imageu+y/2*spu->scaled_strideuv; + sptrv=spu->scaled_imagev+y/2*spu->scaled_strideuv; + saptr=spu->scaled_aimage+y*spu->scaled_stride; + saptruv=spu->scaled_aimageuv+y/2*spu->scaled_strideuv; + for(x=0;xscaled_widthuv-1;x++) { + *dptr++=*sptry++; + *dptr++=*sptrv++; + *dptr++=*sptry++; + *dptr++=*sptru++; + *daptr++=*saptr++; + *daptr++=*saptruv; + *daptr++=*saptr++; + *daptr++=*saptruv++; + } } + } else { + spu->strideyuy=spu->stride*2; + spu->imageyuy=malloc(spu->strideyuy*(spu->height+2)*2); + memset(spu->imageyuy,0,spu->strideyuy*(spu->height+2)*2); + spu->aimageyuy=spu->imageyuy+spu->strideyuy*spu->height; + for(y=0;yheight;y++) { + dptr=spu->imageyuy+y*spu->strideyuy; + daptr=spu->aimageyuy+y*spu->strideyuy; + sptry=spu->image+y*spu->stride; + sptru=spu->imageu+y/2*spu->strideuv; + sptrv=spu->imagev+y/2*spu->strideuv; + saptr=spu->aimage+y*spu->stride; + saptruv=spu->aimageuv+y/2*spu->strideuv; + for(x=0;xwidthuv-1;x++) { + *dptr++=*sptry++; + *dptr++=*sptrv++; + *dptr++=*sptry++; + *dptr++=*sptru++; + *daptr++=*saptr++; + *daptr++=*saptruv; + *daptr++=*saptr++; + *daptr++=*saptruv++; + } } + } +} + +void sws_spu_image_uv(unsigned char *du, unsigned char *dv, unsigned char *d2, + int dw, int dh, int ds, unsigned char *su, unsigned char *sv, + unsigned char *s2, int sw, int sh, int ss) +{ +struct SwsContext *ctx; +static SwsFilter filter; +static int firsttime = 1; +static float oldvar; +int i; + +if (!firsttime && oldvar != spu_gaussvar) sws_freeVec(filter.lumH); +if (firsttime) + { + filter.lumH = filter.lumV = + filter.chrH = filter.chrV = sws_getGaussianVec(spu_gaussvar, 3.0); + sws_normalizeVec(filter.lumH, 1.0); + firsttime = 0; + oldvar = spu_gaussvar; + } + +ctx=sws_getContext(sw, sh, IMGFMT_Y800, dw, dh, IMGFMT_Y800, SWS_GAUSS, &filter, NULL, NULL); +sws_scale(ctx,&su,&ss,0,sh,&du,&ds); +sws_scale(ctx,&sv,&ss,0,sh,&dv,&ds); +for (i=ss*sh-1; i>=0; i--) + if (!s2[i]) s2[i] = 255; //else s2[i] = 1; +sws_scale(ctx,&s2,&ss,0,sh,&d2,&ds); +for (i=ds*dh-1; i>=0; i--) + if (d2[i]==0) d2[i] = 1; + else if (d2[i]==255) d2[i] = 0; +sws_freeContext(ctx); +} + +void sws_spu_image_rgb(unsigned char *dr, unsigned char *dg, unsigned char *db, + unsigned char *d2, int dw, int dh, int ds, + unsigned char *sr,unsigned char *sg,unsigned char *sb, + unsigned char *s2, int sw, int sh, int ss) +{ +struct SwsContext *ctx; +static SwsFilter filter; +static int firsttime = 1; +static float oldvar; +int i; + +if (!firsttime && oldvar != spu_gaussvar) sws_freeVec(filter.lumH); +if (firsttime) + { + filter.lumH = filter.lumV = + filter.chrH = filter.chrV = sws_getGaussianVec(spu_gaussvar, 3.0); + sws_normalizeVec(filter.lumH, 1.0); + firsttime = 0; + oldvar = spu_gaussvar; + } + +ctx=sws_getContext(sw, sh, IMGFMT_Y800, dw, dh, IMGFMT_Y800, SWS_GAUSS, &filter, NULL, NULL); +sws_scale(ctx,&sr,&ss,0,sh,&dr,&ds); +sws_scale(ctx,&sg,&ss,0,sh,&dg,&ds); +sws_scale(ctx,&sb,&ss,0,sh,&db,&ds); +for (i=ss*sh-1; i>=0; i--) if (!s2[i]) s2[i] = 255; //else s2[i] = 1; +sws_scale(ctx,&s2,&ss,0,sh,&d2,&ds); +for (i=ds*dh-1; i>=0; i--) + if (d2[i]==0) d2[i] = 1; + else if (d2[i]==255) d2[i] = 0; +sws_freeContext(ctx); +} + +#undef max +#define max(x,y) ((x) > (y) ? (x) : (y)) +#undef min +#define min(x,y) ((x) < (y) ? (x) : (y)) + +void spudec_dvdnav_mode(void *this, int mode, int cflg) +{ /* set/clear spu menu mode */ +spudec_handle_t *spu = (spudec_handle_t *)this; +if (!spu) return; +spu->dvdnav_menu=mode; +spu->dvdnav_color_spu=cflg; +if (!spu->dvdnav_menu && spu->last_packet) + { + spudec_free_packet(spu->last_packet); + spu->last_packet=NULL; + } +return; +} + +void spudec_dvdnav_area(void *this, uint16_t sx, uint16_t sy, uint16_t ex, + uint16_t ey, uint32_t palette) +{ +spudec_handle_t *spu = this; +if (!spu) return; +if (spu->dvdnav_sx==min(sx,ex) && + spu->dvdnav_ex==max(sx,ex) && + spu->dvdnav_sy==min(sy,ey) && + spu->dvdnav_ey==max(sy,ey) && + spu->dvdnav_palette==palette) return; +spu->dvdnav_sx=min(sx,ex); /* set spu button area, palette & on */ +spu->dvdnav_ex=max(sx,ex); +spu->dvdnav_sy=min(sy,ey); +spu->dvdnav_ey=max(sy,ey); +spu->dvdnav_palette=palette; +spu->dvdnav_modify=1; +if (spu->dvdnav_menu && spu->last_packet) + { + if (spu->auto_palette) + compute_palette(spu, spu->last_packet); + spudec_process_data(spu, spu->last_packet); + } +return; +} + +void spudec_dvdnav_palette(void *this, uint32_t palette) +{ +spudec_handle_t *spu = this; +if (!spu) return; +spu->dvdnav_palette=palette; /* set spu button palette */ +return; +} + +void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)) { spudec_handle_t *spu = (spudec_handle_t *)me; scale_pixel *table_x; scale_pixel *table_y; + if (spu->dvdnav_menu) { + switch (spu->dvdnav_color_spu) + { + case DVDNAV_SPU_YUV: + case DVDNAV_SPU_YUY: + spudec_draw_scaled_yuv(me,dxs,dys,draw_alpha); + return; + break; + case DVDNAV_SPU_RGB: + case DVDNAV_SPU_BGR: + spudec_draw_scaled_rgb(me,dxs,dys,draw_alpha); + return; + break; + } + } if (spu->start_pts <= spu->now_pts && spu->now_pts < spu->end_pts) { @@ -779,7 +1576,7 @@ || (spu->orig_frame_width == dxs && spu->orig_frame_height == dys))) { if (spu->image) { - draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height, + draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height,DEST_PLANES_Y, spu->image, spu->aimage, spu->stride); spu->spu_changed = 0; } @@ -1086,7 +1883,7 @@ break; } draw_alpha(spu->scaled_start_col, spu->scaled_start_row, spu->scaled_width, spu->scaled_height, - spu->scaled_image, spu->scaled_aimage, spu->scaled_stride); + DEST_PLANES_Y,spu->scaled_image, spu->scaled_aimage, spu->scaled_stride); spu->spu_changed = 0; } } @@ -1098,78 +1895,1302 @@ } } -void spudec_update_palette(void * this, unsigned int *palette) -{ - spudec_handle_t *spu = (spudec_handle_t *) this; - if (spu && palette) { - memcpy(spu->global_palette, palette, sizeof(spu->global_palette)); - if(spu->hw_spu) - spu->hw_spu->control(VOCTRL_SET_SPU_PALETTE,spu->global_palette); - } -} - -void spudec_set_font_factor(void * this, double factor) +void spudec_draw_scaled_yuv(void *me, unsigned int dxs, unsigned int dys, + void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)) { - spudec_handle_t *spu = (spudec_handle_t *) this; - spu->font_start_level = (int)(0xF0-(0xE0*factor)); -} + spudec_handle_t *spu = (spudec_handle_t *)me; + scale_pixel *table_x; + scale_pixel *table_y; + unsigned int scalex = 0; + unsigned int scaley = 0; -void *spudec_new_scaled(unsigned int *palette, unsigned int frame_width, unsigned int frame_height) -{ - return spudec_new_scaled_vobsub(palette, NULL, 0, frame_width, frame_height); -} + if (spu->start_pts <= spu->now_pts && spu->now_pts < spu->end_pts) { -/* get palette custom color, width, height from .idx file */ -void *spudec_new_scaled_vobsub(unsigned int *palette, unsigned int *cuspal, unsigned int custom, unsigned int frame_width, unsigned int frame_height) + // check if only forced subtitles are requested + if( (spu->forced_subs_only) && !(spu->is_forced_sub) ){ + return;} + + if (!(spu_aamode&16) && (spu->orig_frame_width == 0 || + spu->orig_frame_height == 0 || + (spu->orig_frame_width == dxs && spu->orig_frame_height == dys))) { - spudec_handle_t *this = calloc(1, sizeof(spudec_handle_t)); - if (this){ - //(fprintf(stderr,"VobSub Custom Palette: %d,%d,%d,%d", this->cuspal[0], this->cuspal[1], this->cuspal[2],this->cuspal[3]); - this->packet = NULL; - this->image = NULL; - this->scaled_image = NULL; - /* XXX Although the video frame is some size, the SPU frame is - always maximum size i.e. 720 wide and 576 or 480 high */ - this->orig_frame_width = 720; - this->orig_frame_height = (frame_height == 480 || frame_height == 240) ? 480 : 576; - this->custom = custom; - // set up palette: - this->auto_palette = 1; - if (palette){ - memcpy(this->global_palette, palette, sizeof(this->global_palette)); - this->auto_palette = 0; - } - this->custom = custom; - if (custom && cuspal) { - memcpy(this->cuspal, cuspal, sizeof(this->cuspal)); - this->auto_palette = 0; - } - // forced subtitles default: show all subtitles - this->forced_subs_only=0; - this->is_forced_sub=0; + if (spu->image) + { + if (spu->dvdnav_color_spu==DVDNAV_SPU_YUY) { + if (!spu->imageyuy) spudec_create_yuy(spu,0); + if (spu->imageyuy) draw_alpha(spu->start_col, + spu->start_row, + spu->width*2, + spu->heightuv*2, + DEST_PLANES_YUYV, + spu->imageyuy, + spu->aimageyuy, + spu->strideyuy); + } else { + draw_alpha(spu->start_col, + spu->start_row, + spu->width, + spu->height, + DEST_PLANES_Y, + spu->image, + spu->aimage, + spu->stride); + if(spu->dvdnav_color_spu && spu->imageu && spu->aimageuv) + draw_alpha(spu->start_coluv, + spu->start_rowuv, + spu->widthuv, + spu->heightuv, + DEST_PLANES_U, + spu->imageu, + spu->aimageuv, + spu->strideuv); + if(spu->dvdnav_color_spu && spu->imagev && spu->aimageuv) + draw_alpha(spu->start_coluv, + spu->start_rowuv, + spu->widthuv, + spu->heightuv, + DEST_PLANES_V, + spu->imagev, + spu->aimageuv, + spu->strideuv); } - else - mp_msg(MSGT_SPUDEC,MSGL_FATAL, "FATAL: spudec_init: calloc"); - return this; + spu->spu_changed = 0; } + } else { + if (spu->scaled_frame_width != dxs || spu->scaled_frame_height != dys) + { /* Resizing is needed */ + /* scaled_x = scalex * x / 0x100 + scaled_y = scaley * y / 0x100 + order of operations is important because of rounding. */ + scalex = 0x100 * dxs / spu->orig_frame_width; + scaley = 0x100 * dys / spu->orig_frame_height; -void *spudec_new(unsigned int *palette) + spu->scaled_start_col = spu->start_col * scalex / 0x100; + spu->scaled_start_row = spu->start_row * scaley / 0x100; + spu->scaled_width = spu->width * scalex / 0x100; + spu->scaled_height = spu->height * scaley / 0x100; + spu->scaled_start_coluv = spu->start_coluv * scalex / 0x100; + spu->scaled_start_rowuv = spu->start_rowuv * scaley / 0x100; + spu->scaled_widthuv = spu->widthuv * scalex / 0x100; + spu->scaled_heightuv = spu->heightuv * scaley / 0x100; + /* Kludge: draw_alpha needs width multiple of 8 */ + spu->scaled_stride = (spu->scaled_width + 7) & ~7; + spu->scaled_strideuv = (spu->scaled_widthuv + 7) & ~7; + if (spu->scaled_image_size < spu->scaled_stride * + (spu->scaled_height+2)) { - return spudec_new_scaled(palette, 0, 0); + if (spu->scaled_image) + { + free(spu->scaled_image); + spu->scaled_image_size = 0; } - -void spudec_free(void *this) + spu->scaled_image = malloc(2 * spu->scaled_stride * + (spu->scaled_height+2)); + if (spu->scaled_image) +{ + memset(spu->scaled_image,0, + 2 * spu->scaled_stride * (spu->scaled_height+2)); + spu->scaled_image_size = spu->scaled_stride * + (spu->scaled_height+2); + spu->scaled_aimage = spu->scaled_image + spu->scaled_image_size; + } + } + if (spu->scaled_image_sizeuv < spu->scaled_strideuv * + (spu->scaled_heightuv+2)) { - spudec_handle_t *spu = (spudec_handle_t*)this; - if (spu) { - while (spu->queue_head) - spudec_free_packet(spudec_dequeue_packet(spu)); - if (spu->packet) - free(spu->packet); - if (spu->scaled_image) - free(spu->scaled_image); - if (spu->image) - free(spu->image); + if (spu->scaled_imageu) + { + free(spu->scaled_imageu); + spu->scaled_image_sizeuv = 0; + } + spu->scaled_imageu = malloc(3 * spu->scaled_strideuv * + (spu->scaled_height+2)); + if (spu->scaled_imageu) + { + memset(spu->scaled_imageu,0,3 * spu->scaled_strideuv * + (spu->scaled_height+2)); + spu->scaled_image_sizeuv = spu->scaled_strideuv * + (spu->scaled_heightuv+2); + spu->scaled_imagev = spu->scaled_imageu + + spu->scaled_image_sizeuv; + spu->scaled_aimageuv = spu->scaled_imagev + + spu->scaled_image_sizeuv; + } + } + if (spu->scaled_image) { + unsigned int x, y; + if (spu->scaled_width <= 1 || spu->scaled_height <= 1) { + goto nothing_to_do; + } + if (spu->scaled_widthuv <= 1 || spu->scaled_heightuv <= 1) { + goto nothing_to_do; + } + switch(spu_aamode&15) + { + case 4: + sws_spu_image(spu->scaled_image, spu->scaled_aimage, + spu->scaled_width, spu->scaled_height, spu->scaled_stride, + spu->image, spu->aimage, spu->width, spu->height, spu->stride); + sws_spu_image_uv(spu->scaled_imageu, spu->scaled_imagev, + spu->scaled_aimageuv, spu->scaled_widthuv, + spu->scaled_heightuv, spu->scaled_strideuv, + spu->imageu, spu->imagev, spu->aimageuv, + spu->widthuv, spu->heightuv, spu->strideuv); + break; + case 3: + table_x = calloc(spu->scaled_width, sizeof(scale_pixel)); + table_y = calloc(spu->scaled_height, sizeof(scale_pixel)); + if (!table_x || !table_y) + { + mp_msg(MSGT_SPUDEC, MSGL_FATAL, + "Fatal: spudec_draw_scaled: calloc failed\n"); + } + scale_table(0, 0, spu->width - 1, spu->scaled_width - 1, table_x); + scale_table(0, 0, spu->height - 1, spu->scaled_height - 1, table_y); + for (y = 0; y < spu->scaled_height; y++) + for (x = 0; x < spu->scaled_width; x++) + scale_image(x, y, table_x, table_y, spu); + free(table_x); + free(table_y); + table_x = calloc(spu->scaled_widthuv, sizeof(scale_pixel)); + table_y = calloc(spu->scaled_heightuv, sizeof(scale_pixel)); + if (!table_x || !table_y) { + mp_msg(MSGT_SPUDEC, MSGL_FATAL, + "Fatal: spudec_draw_scaled: calloc failed\n"); + } + scale_table(0, 0, spu->widthuv - 1, spu->scaled_widthuv - 1, + table_x); + scale_table(0, 0, spu->heightuv - 1, spu->scaled_heightuv - 1, + table_y); + for (y = 0; y < spu->scaled_heightuv; y++) + for (x = 0; x < spu->scaled_widthuv; x++) + scale_image_uv(x, y, table_x, table_y, spu); + free(table_x); + free(table_y); + break; + case 0: + /* no antialiasing */ + for (y = 0; y < spu->scaled_height; ++y) + { + int unscaled_y = y * 0x100 / scaley; + int strides = spu->stride * unscaled_y; + int scaled_strides = spu->scaled_stride * y; + for (x = 0; x < spu->scaled_width; ++x) + { + int unscaled_x = x * 0x100 / scalex; + spu->scaled_image[scaled_strides + x] = + spu->image[strides + unscaled_x]; + spu->scaled_aimage[scaled_strides + x] = + spu->aimage[strides + unscaled_x]; + } + } + for (y = 0; y < spu->scaled_heightuv; ++y) + { + int unscaled_y = y * 0x100 / scaley; + int strides = spu->strideuv * unscaled_y; + int scaled_strides = spu->scaled_strideuv * y; + for (x = 0; x < spu->scaled_widthuv; ++x) + { + int unscaled_x = x * 0x100 / scalex; + spu->scaled_imageu[scaled_strides + x] = + spu->imageu[strides + unscaled_x]; + spu->scaled_imagev[scaled_strides + x] = + spu->imagev[strides + unscaled_x]; + spu->scaled_aimageuv[scaled_strides + x] = + spu->aimageuv[strides + unscaled_x]; + } + } + break; + case 1: + { + /* Intermediate antialiasing. */ + for (y = 0; y < spu->scaled_height; ++y) { + const unsigned int unscaled_top = + y * spu->orig_frame_height / dys; + unsigned int unscaled_bottom = + (y + 1) * spu->orig_frame_height / dys; + if (unscaled_bottom >= spu->height) + unscaled_bottom = spu->height - 1; + for (x = 0; x < spu->scaled_width; ++x) + { + const unsigned int unscaled_left = + x * spu->orig_frame_width / dxs; + unsigned int unscaled_right = + (x + 1) * spu->orig_frame_width / dxs; + unsigned int color = 0; + unsigned int alpha = 0; + unsigned int walkx, walky; + unsigned int base, tmp; + if (unscaled_right >= spu->width) + unscaled_right = spu->width - 1; + for (walky = unscaled_top; walky <= unscaled_bottom; ++walky) + for (walkx = unscaled_left; walkx <= unscaled_right; ++walkx) + { + base = walky * spu->stride + walkx; + tmp = canon_alpha(spu->aimage[base]); + alpha += tmp; + color += tmp * spu->image[base]; + } + base = y * spu->scaled_stride + x; + spu->scaled_image[base] = alpha ? color / alpha : 0; + spu->scaled_aimage[base] = + alpha * (1 + unscaled_bottom - unscaled_top) * + (1 + unscaled_right - unscaled_left); + /* spu->scaled_aimage[base] = + alpha * dxs * dys / spu->orig_frame_width / spu->orig_frame_height; */ + if (spu->scaled_aimage[base]) { + spu->scaled_aimage[base] = 256 - spu->scaled_aimage[base]; + if (spu->scaled_aimage[base] + spu->scaled_image[base] > 255) + spu->scaled_image[base] = 256 - spu->scaled_aimage[base]; + } + } + } + for (y = 0; y < spu->scaled_heightuv; ++y) { + const unsigned int unscaled_top = y * + (spu->orig_frame_height/2) / (dys/2); + unsigned int unscaled_bottom = (y + 1) * + (spu->orig_frame_height/2) / (dys/2); + if (unscaled_bottom >= spu->heightuv) + unscaled_bottom = spu->heightuv - 1; + for (x = 0; x < spu->scaled_widthuv; ++x) { + const unsigned int unscaled_left = x * + (spu->orig_frame_width/2) / (dxs/2); + unsigned int unscaled_right = (x + 1) * + (spu->orig_frame_width/2) / (dxs/2); + unsigned int coloru = 0; + unsigned int colorv = 0; + unsigned int alpha = 0; + unsigned int walkx, walky; + unsigned int base, tmp; + if (unscaled_right >= spu->widthuv) + unscaled_right = spu->widthuv - 1; + for (walky = unscaled_top; walky <= unscaled_bottom; ++walky) + for (walkx = unscaled_left; walkx <= unscaled_right; ++walkx) + { + base = walky * spu->strideuv + walkx; + tmp = canon_alpha(spu->aimageuv[base]); + alpha += tmp; + coloru += tmp * spu->imageu[base]; + colorv += tmp * spu->imagev[base]; + } + base = y * spu->scaled_strideuv + x; + spu->scaled_imageu[base] = alpha ? coloru / alpha : 0; + spu->scaled_imagev[base] = alpha ? colorv / alpha : 0; + spu->scaled_aimageuv[base] = + alpha * (1 + unscaled_bottom - unscaled_top) * + (1 + unscaled_right - unscaled_left); + /* spu->scaled_aimage[base] = + alpha * dxs * dys / spu->orig_frame_width / spu->orig_frame_height; */ + if (spu->scaled_aimageuv[base]) { + spu->scaled_aimageuv[base] = 256 - spu->scaled_aimageuv[base]; + if (spu->scaled_aimageuv[base] + spu->scaled_imageu[base] > 255) + spu->scaled_imageu[base] = 256 - spu->scaled_aimageuv[base]; + if (spu->scaled_aimageuv[base] + spu->scaled_imagev[base] > 255) + spu->scaled_imagev[base] = 256 - spu->scaled_aimageuv[base]; + } + } + } + } + break; + case 2: + { + /* Best antialiasing. Very slow. */ + /* Any pixel (x, y) represents pixels from the original + rectangular region comprised between the columns + unscaled_y and unscaled_y + 0x100 / scaley and the rows + unscaled_x and unscaled_x + 0x100 / scalex + + The original rectangular region that the scaled pixel + represents is cut in 9 rectangular areas like this: + + +---+-----------------+---+ + | 1 | 2 | 3 | + +---+-----------------+---+ + | | | | + | 4 | 5 | 6 | + | | | | + +---+-----------------+---+ + | 7 | 8 | 9 | + +---+-----------------+---+ + + The width of the left column is at most one pixel and + it is never null and its right column is at a pixel + boundary. The height of the top row is at most one + pixel it is never null and its bottom row is at a + pixel boundary. The width and height of region 5 are + integral values. The width of the right column is + what remains and is less than one pixel. The height + of the bottom row is what remains and is less than + one pixel. + + The row above 1, 2, 3 is unscaled_y. The row between + 1, 2, 3 and 4, 5, 6 is top_low_row. The row between 4, + 5, 6 and 7, 8, 9 is (unsigned int)unscaled_y_bottom. + The row beneath 7, 8, 9 is unscaled_y_bottom. + + The column left of 1, 4, 7 is unscaled_x. The column + between 1, 4, 7 and 2, 5, 8 is left_right_column. The + column between 2, 5, 8 and 3, 6, 9 is (unsigned + int)unscaled_x_right. The column right of 3, 6, 9 is + unscaled_x_right. */ + const double inv_scalex = (double) 0x100 / scalex; + const double inv_scaley = (double) 0x100 / scaley; + for (y = 0; y < spu->scaled_height; ++y) { + const double unscaled_y = y * inv_scaley; + const double unscaled_y_bottom = unscaled_y + inv_scaley; + const unsigned int top_low_row = MIN(unscaled_y_bottom, unscaled_y + 1.0); + const double top = top_low_row - unscaled_y; + const unsigned int height = unscaled_y_bottom > top_low_row + ? (unsigned int) unscaled_y_bottom - top_low_row + : 0; + const double bottom = unscaled_y_bottom > top_low_row + ? unscaled_y_bottom - floor(unscaled_y_bottom) + : 0.0; + for (x = 0; x < spu->scaled_width; ++x) { + const double unscaled_x = x * inv_scalex; + const double unscaled_x_right = unscaled_x + inv_scalex; + const unsigned int left_right_column = + MIN(unscaled_x_right, unscaled_x + 1.0); + const double left = left_right_column - unscaled_x; + const unsigned int width = unscaled_x_right > left_right_column + ? (unsigned int) unscaled_x_right - left_right_column + : 0; + const double right = unscaled_x_right > left_right_column + ? unscaled_x_right - floor(unscaled_x_right) + : 0.0; + double color = 0.0; + double alpha = 0.0; + double tmp; + unsigned int base; + /* Now use these informations to compute a good alpha, + and lightness. The sum is on each of the 9 + region's surface and alpha and lightness. + + transformed alpha = sum(surface * alpha) / sum(surface) + transformed color = sum(surface * alpha * color) / sum(surface * alpha) + */ + /* 1: top left part */ + base = spu->stride * (unsigned int) unscaled_y; + tmp = left * top * + canon_alpha(spu->aimage[base + (unsigned int) unscaled_x]); + alpha += tmp; + color += tmp * spu->image[base + (unsigned int) unscaled_x]; + /* 2: top center part */ + if (width > 0) { + unsigned int walkx; + for (walkx = left_right_column; + walkx < (unsigned int) unscaled_x_right; + ++walkx) + { + base = spu->stride * (unsigned int) unscaled_y + walkx; + tmp = /* 1.0 * */ top * canon_alpha(spu->aimage[base]); + alpha += tmp; + color += tmp * spu->image[base]; + } + } + /* 3: top right part */ + if (right > 0.0) { + base = spu->stride * (unsigned int) unscaled_y + + (unsigned int) unscaled_x_right; + tmp = right * top * canon_alpha(spu->aimage[base]); + alpha += tmp; + color += tmp * spu->image[base]; + } + /* 4: center left part */ + if (height > 0) { + unsigned int walky; + for (walky = top_low_row; + walky < (unsigned int) unscaled_y_bottom; + ++walky) + { + base = spu->stride * walky + (unsigned int) unscaled_x; + tmp = left /* * 1.0 */ * canon_alpha(spu->aimage[base]); + alpha += tmp; + color += tmp * spu->image[base]; + } + } + /* 5: center part */ + if (width > 0 && height > 0) { + unsigned int walky; + for (walky = top_low_row; + walky < (unsigned int) unscaled_y_bottom; + ++walky) + { + unsigned int walkx; + base = spu->stride * walky; + for (walkx = left_right_column; + walkx < (unsigned int) unscaled_x_right; + ++walkx) { + tmp = /* 1.0 * 1.0 * */ canon_alpha(spu->aimage[base + walkx]); + alpha += tmp; + color += tmp * spu->image[base + walkx]; + } + } + } + /* 6: center right part */ + if (right > 0.0 && height > 0) { + unsigned int walky; + for (walky = top_low_row; + walky < (unsigned int) unscaled_y_bottom; + ++walky) + { + base = spu->stride * walky + + (unsigned int) unscaled_x_right; + tmp = right /* * 1.0 */ * canon_alpha(spu->aimage[base]); + alpha += tmp; + color += tmp * spu->image[base]; + } + } + /* 7: bottom left part */ + if (bottom > 0.0) { + base = spu->stride * (unsigned int) unscaled_y_bottom + + (unsigned int) unscaled_x; + tmp = left * bottom * canon_alpha(spu->aimage[base]); + alpha += tmp; + color += tmp * spu->image[base]; + } + /* 8: bottom center part */ + if (width > 0 && bottom > 0.0) { + unsigned int walkx; + base = spu->stride * (unsigned int) unscaled_y_bottom; + for (walkx = left_right_column; + walkx < (unsigned int) unscaled_x_right; + ++walkx) + { + tmp = /* 1.0 * */ bottom * + canon_alpha(spu->aimage[base + walkx]); + alpha += tmp; + color += tmp * spu->image[base + walkx]; + } + } + /* 9: bottom right part */ + if (right > 0.0 && bottom > 0.0) { + base = spu->stride * (unsigned int) + unscaled_y_bottom + (unsigned int) unscaled_x_right; + tmp = right * bottom * canon_alpha(spu->aimage[base]); + alpha += tmp; + color += tmp * spu->image[base]; + } + /* Finally mix these transparency and brightness information suitably */ + base = spu->scaled_stride * y + x; + spu->scaled_image[base] = alpha > 0 ? color / alpha : 0; + spu->scaled_aimage[base] = alpha * scalex * scaley / 0x10000; + if (spu->scaled_aimage[base]) { + spu->scaled_aimage[base] = 256 - spu->scaled_aimage[base]; + if (spu->scaled_aimage[base] + spu->scaled_image[base] > 255) + spu->scaled_image[base] = 256 - spu->scaled_aimage[base]; + } + } + } + for (y = 0; y < spu->scaled_heightuv; ++y) { + const double unscaled_y = y * inv_scaley; + const double unscaled_y_bottom = unscaled_y + inv_scaley; + const unsigned int top_low_row = + MIN(unscaled_y_bottom, unscaled_y + 1.0); + const double top = top_low_row - unscaled_y; + const unsigned int height = unscaled_y_bottom > top_low_row + ? (unsigned int) unscaled_y_bottom - top_low_row + : 0; + const double bottom = unscaled_y_bottom > top_low_row + ? unscaled_y_bottom - floor(unscaled_y_bottom) + : 0.0; + for (x = 0; x < spu->scaled_widthuv; ++x) { + const double unscaled_x = x * inv_scalex; + const double unscaled_x_right = unscaled_x + inv_scalex; + const unsigned int left_right_column = + MIN(unscaled_x_right, unscaled_x + 1.0); + const double left = left_right_column - unscaled_x; + const unsigned int width = unscaled_x_right > left_right_column + ? (unsigned int) unscaled_x_right - left_right_column + : 0; + const double right = unscaled_x_right > left_right_column + ? unscaled_x_right - floor(unscaled_x_right) + : 0.0; + double coloru = 0.0; + double colorv = 0.0; + double alpha = 0.0; + double tmp; + unsigned int base; + /* Now use these informations to compute a good alpha, + and lightness. The sum is on each of the 9 + region's surface and alpha and lightness. + + transformed alpha = sum(surface * alpha) / sum(surface) + transformed color = sum(surface * alpha * color) / sum(surface * alpha) + */ + /* 1: top left part */ + base = spu->strideuv * (unsigned int) unscaled_y; + tmp = left * top * + canon_alpha(spu->aimageuv[base + (unsigned int) unscaled_x]); + alpha += tmp; + coloru += tmp * spu->imageu[base + (unsigned int) unscaled_x]; + colorv += tmp * spu->imagev[base + (unsigned int) unscaled_x]; + /* 2: top center part */ + if (width > 0) { + unsigned int walkx; + for (walkx = left_right_column; + walkx < (unsigned int) unscaled_x_right; + ++walkx) + { + base = spu->strideuv * (unsigned int) unscaled_y + walkx; + tmp = /* 1.0 * */ top * canon_alpha(spu->aimageuv[base]); + alpha += tmp; + coloru += tmp * spu->imageu[base]; + colorv += tmp * spu->imagev[base]; + } + } + /* 3: top right part */ + if (right > 0.0) { + base = spu->strideuv * (unsigned int) unscaled_y + + (unsigned int) unscaled_x_right; + tmp = right * top * canon_alpha(spu->aimageuv[base]); + alpha += tmp; + coloru += tmp * spu->imageu[base]; + colorv += tmp * spu->imagev[base]; + } + /* 4: center left part */ + if (height > 0) { + unsigned int walky; + for (walky = top_low_row; + walky < (unsigned int) unscaled_y_bottom; + ++walky) + { + base = spu->strideuv * walky + (unsigned int) unscaled_x; + tmp = left /* * 1.0 */ * canon_alpha(spu->aimageuv[base]); + alpha += tmp; + coloru += tmp * spu->imageu[base]; + colorv += tmp * spu->imagev[base]; + } + } + /* 5: center part */ + if (width > 0 && height > 0) { + unsigned int walky; + for (walky = top_low_row; + walky < (unsigned int) unscaled_y_bottom; + ++walky) + { + unsigned int walkx; + base = spu->strideuv * walky; + for (walkx = left_right_column; + walkx < (unsigned int) unscaled_x_right; + ++walkx) + { + tmp = /* 1.0 * 1.0 * */ canon_alpha(spu->aimageuv[base + walkx]); + alpha += tmp; + coloru += tmp * spu->imageu[base + walkx]; + colorv += tmp * spu->imagev[base + walkx]; + } + } + } + /* 6: center right part */ + if (right > 0.0 && height > 0) { + unsigned int walky; + for (walky = top_low_row; + walky < (unsigned int) unscaled_y_bottom; + ++walky) + { + base = spu->strideuv * walky + + (unsigned int) unscaled_x_right; + tmp = right /* * 1.0 */ * canon_alpha(spu->aimageuv[base]); + alpha += tmp; + coloru += tmp * spu->imageu[base]; + colorv += tmp * spu->imagev[base]; + } + } + /* 7: bottom left part */ + if (bottom > 0.0) { + base = spu->strideuv * (unsigned int) unscaled_y_bottom + + (unsigned int) unscaled_x; + tmp = left * bottom * canon_alpha(spu->aimageuv[base]); + alpha += tmp; + coloru += tmp * spu->imageu[base]; + colorv += tmp * spu->imagev[base]; + } + /* 8: bottom center part */ + if (width > 0 && bottom > 0.0) { + unsigned int walkx; + base = spu->strideuv * (unsigned int) unscaled_y_bottom; + for (walkx = left_right_column; + walkx < (unsigned int) unscaled_x_right; + ++walkx) { + tmp = /* 1.0 * */ bottom * canon_alpha(spu->aimageuv[base + walkx]); + alpha += tmp; + coloru += tmp * spu->imageu[base + walkx]; + colorv += tmp * spu->imagev[base + walkx]; + } + } + /* 9: bottom right part */ + if (right > 0.0 && bottom > 0.0) { + base = spu->strideuv * (unsigned int) unscaled_y_bottom + + (unsigned int) unscaled_x_right; + tmp = right * bottom * canon_alpha(spu->aimageuv[base]); + alpha += tmp; + coloru += tmp * spu->imageu[base]; + colorv += tmp * spu->imagev[base]; + } + /* Finally mix these transparency and brightness information suitably */ + base = spu->scaled_strideuv * y + x; + spu->scaled_imageu[base] = alpha > 0 ? coloru / alpha : 0; + spu->scaled_imagev[base] = alpha > 0 ? colorv / alpha : 0; + spu->scaled_aimageuv[base] = alpha * scalex * scaley / 0x10000; + if (spu->scaled_aimageuv[base]) { + spu->scaled_aimageuv[base] = 256 - spu->scaled_aimageuv[base]; + if (spu->scaled_aimageuv[base] + spu->scaled_imageu[base] > 255) + spu->scaled_imageu[base] = 256 - spu->scaled_aimageuv[base]; + if (spu->scaled_aimageuv[base] + spu->scaled_imagev[base] > 255) + spu->scaled_imagev[base] = 256 - spu->scaled_aimageuv[base]; + } + } + } + } + } +nothing_to_do: + /* Kludge: draw_alpha needs width multiple of 8. */ + if (spu->scaled_width < spu->scaled_stride) + for (y = 0; y < spu->scaled_height; ++y) { + memset(spu->scaled_aimage + y * spu->scaled_stride + + spu->scaled_width, 0, + spu->scaled_stride - spu->scaled_width); + } + spu->scaled_frame_width = dxs; + spu->scaled_frame_height = dys; + if (spu->scaled_widthuv < spu->scaled_strideuv) + for (y = 0; y < spu->scaled_heightuv; ++y) { + memset(spu->scaled_aimageuv + y * spu->scaled_stride + + spu->scaled_widthuv, 0, + spu->scaled_strideuv - spu->scaled_widthuv); + } + spu->scaled_frame_widthuv = dxs/2; + spu->scaled_frame_heightuv = dys/2; + } + } + if (spu->scaled_image){ + switch (spu_alignment) { + case 0: + spu->scaled_start_row = dys*sub_pos/100; + if (spu->scaled_start_row + spu->scaled_height > dys) + spu->scaled_start_row = dys - spu->scaled_height; + spu->scaled_start_rowuv = (dys/2)*sub_pos/100; + if (spu->scaled_start_rowuv + spu->scaled_heightuv > (dys/2)) + spu->scaled_start_rowuv = (dys/2) - spu->scaled_heightuv; + break; + case 1: + spu->scaled_start_row = dys*sub_pos/100 - spu->scaled_height/2; + if (sub_pos < 50) { + if (spu->scaled_start_row < 0) spu->scaled_start_row = 0; + } else { + if (spu->scaled_start_row + spu->scaled_height > dys) + spu->scaled_start_row = dys - spu->scaled_height; + } + spu->scaled_start_rowuv = (dys/2)*sub_pos/100 - spu->scaled_heightuv/2; + if (sub_pos < 50) { + if (spu->scaled_start_rowuv < 0) spu->scaled_start_rowuv = 0; + } else { + if (spu->scaled_start_rowuv + spu->scaled_heightuv > (dys/2)) + spu->scaled_start_rowuv = (dys/2) - spu->scaled_heightuv; + } + break; + case 2: + spu->scaled_start_row = dys*sub_pos/100 - spu->scaled_height; + if (spu->scaled_start_row < 0) spu->scaled_start_row = 0; + spu->scaled_start_rowuv = (dys/2)*sub_pos/100 - spu->scaled_heightuv; + if (spu->scaled_start_rowuv < 0) spu->scaled_start_rowuv = 0; + break; + } + if (spu->dvdnav_color_spu==DVDNAV_SPU_YUY) { + if (!spu->imageyuy) spudec_create_yuy(spu,1); + if (spu->imageyuy) draw_alpha(spu->scaled_start_col, + spu->scaled_start_row, + spu->scaled_width*2, + spu->scaled_height, + DEST_PLANES_YUYV, + spu->imageyuy, + spu->aimageyuy, + spu->strideyuy); + } else { + draw_alpha(spu->scaled_start_col, + spu->scaled_start_row, + spu->scaled_width, + spu->scaled_height, + DEST_PLANES_Y, + spu->scaled_image, + spu->scaled_aimage, + spu->scaled_stride); + draw_alpha(spu->scaled_start_coluv, + spu->scaled_start_rowuv, + spu->scaled_widthuv, + spu->scaled_heightuv, + DEST_PLANES_U, + spu->scaled_imageu, + spu->scaled_aimageuv, + spu->scaled_strideuv); + draw_alpha(spu->scaled_start_coluv, + spu->scaled_start_rowuv, + spu->scaled_widthuv, + spu->scaled_heightuv, + DEST_PLANES_V, + spu->scaled_imagev, + spu->scaled_aimageuv, + spu->scaled_strideuv); + } + spu->spu_changed = 0; + } + } + } + else + { + mp_msg(MSGT_SPUDEC,MSGL_DBG2, + "SPU not displayed: start_pts=%d end_pts=%d now_pts=%d\n", + spu->start_pts, spu->end_pts, spu->now_pts); + } +} + +void spudec_draw_scaled_rgb(void *me, unsigned int dxs, unsigned int dys, + void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)) +{ + spudec_handle_t *spu = (spudec_handle_t *)me; + scale_pixel *table_x; + scale_pixel *table_y; + unsigned int scalex = 0; + unsigned int scaley = 0; + + if (spu->start_pts <= spu->now_pts && spu->now_pts < spu->end_pts) { + + // check if only forced subtitles are requested + if( (spu->forced_subs_only) && !(spu->is_forced_sub) ){ + return; + } + + if (!(spu_aamode&16) && (spu->orig_frame_width == 0 || + spu->orig_frame_height == 0 || + (spu->orig_frame_width == dxs && spu->orig_frame_height == dys))) { + if (spu->image) + { + draw_alpha(spu->start_col, + spu->start_row, + spu->width, + spu->height, + DEST_PLANES_RB, + spu->image, + spu->aimage, + spu->stride); + draw_alpha(spu->start_col, + spu->start_row, + spu->width, + spu->height, + DEST_PLANES_G, + spu->imageu, + spu->aimage, + spu->stride); + draw_alpha(spu->start_col, + spu->start_row, + spu->width, + spu->height, + DEST_PLANES_BR, + spu->imagev, + spu->aimage, + spu->stride); + spu->spu_changed = 0; + } + } + else { + if (spu->scaled_frame_width != dxs || spu->scaled_frame_height != dys) { /* Resizing is needed */ + /* scaled_x = scalex * x / 0x100 + scaled_y = scaley * y / 0x100 + order of operations is important because of rounding. */ + scalex = 0x100 * dxs / spu->orig_frame_width; + scaley = 0x100 * dys / spu->orig_frame_height; + + spu->scaled_start_col = spu->start_col * scalex / 0x100; + spu->scaled_start_row = spu->start_row * scaley / 0x100; + spu->scaled_width = spu->width * scalex / 0x100; + spu->scaled_height = spu->height * scaley / 0x100; + /* Kludge: draw_alpha needs width multiple of 8 */ + spu->scaled_stride = (spu->scaled_width + 7) & ~7; + if (spu->scaled_image_size < spu->scaled_stride * spu->scaled_height) { + if (spu->scaled_image) { + free(spu->scaled_image); + if (spu->scaled_imageu) + free(spu->scaled_imageu); + spu->scaled_image_size = 0; + } + spu->scaled_image = malloc(2 * spu->scaled_stride * spu->scaled_height); + spu->scaled_imageu = malloc(3 * spu->scaled_stride * spu->scaled_height); + if (spu->scaled_image) { + spu->scaled_image_size = spu->scaled_stride * spu->scaled_height; + spu->scaled_aimage = spu->scaled_image + spu->scaled_image_size; + } + if (spu->scaled_imageu) { + spu->scaled_imagev = spu->scaled_imageu + spu->scaled_image_size; + } + } + if (spu->scaled_image) { + unsigned int x, y; + if (spu->scaled_width <= 1 || spu->scaled_height <= 1) { + goto nothing_to_do; + } + switch(spu_aamode&15) { + case 4: + sws_spu_image_rgb(spu->scaled_image,spu->scaled_imageu, + spu->scaled_imagev, spu->scaled_aimage, + spu->scaled_width, spu->scaled_height, spu->scaled_stride, + spu->image, spu->imageu, spu->imagev, spu->aimage, + spu->width, spu->height, spu->stride); + break; + case 3: + table_x = calloc(spu->scaled_width, sizeof(scale_pixel)); + table_y = calloc(spu->scaled_height, sizeof(scale_pixel)); + if (!table_x || !table_y) { + mp_msg(MSGT_SPUDEC, MSGL_FATAL, + "Fatal: spudec_draw_scaled: calloc failed\n"); + } + scale_table(0, 0, spu->width - 1, spu->scaled_width - 1, table_x); + scale_table(0, 0, spu->height - 1, spu->scaled_height - 1, table_y); + for (y = 0; y < spu->scaled_height; y++) + for (x = 0; x < spu->scaled_width; x++) + scale_image_rgb(x, y, table_x, table_y, spu); + free(table_x); + free(table_y); + break; + case 0: + /* no antialiasing */ + for (y = 0; y < spu->scaled_height; ++y) { + int unscaled_y = y * 0x100 / scaley; + int strides = spu->stride * unscaled_y; + int scaled_strides = spu->scaled_stride * y; + for (x = 0; x < spu->scaled_width; ++x) { + int unscaled_x = x * 0x100 / scalex; + spu->scaled_image[scaled_strides + x] = + spu->image[strides + unscaled_x]; + spu->scaled_imageu[scaled_strides + x] = + spu->imageu[strides + unscaled_x]; + spu->scaled_imagev[scaled_strides + x] = + spu->imagev[strides + unscaled_x]; + spu->scaled_aimage[scaled_strides + x] = + spu->aimage[strides + unscaled_x]; + } + } + break; + case 1: + { + /* Intermediate antialiasing. */ + for (y = 0; y < spu->scaled_height; ++y) { + const unsigned int unscaled_top = y * + spu->orig_frame_height / dys; + unsigned int unscaled_bottom = (y + 1) * + spu->orig_frame_height / dys; + if (unscaled_bottom >= spu->height) + unscaled_bottom = spu->height - 1; + for (x = 0; x < spu->scaled_width; ++x) { + const unsigned int unscaled_left = x * + spu->orig_frame_width / dxs; + unsigned int unscaled_right = (x + 1) * + spu->orig_frame_width / dxs; + unsigned int colorr = 0; + unsigned int colorg = 0; + unsigned int colorb = 0; + unsigned int alpha = 0; + unsigned int walkx, walky; + unsigned int base, tmp; + if (unscaled_right >= spu->width) + unscaled_right = spu->width - 1; + for (walky = unscaled_top; walky <= unscaled_bottom; ++walky) + for (walkx = unscaled_left; walkx <= unscaled_right; ++walkx) { + base = walky * spu->stride + walkx; + tmp = canon_alpha(spu->aimage[base]); + alpha += tmp; + colorr += tmp * spu->image[base]; + colorg += tmp * spu->imageu[base]; + colorb += tmp * spu->imagev[base]; + } + base = y * spu->scaled_stride + x; + spu->scaled_image[base] = alpha ? colorr / alpha : 0; + spu->scaled_imageu[base] = alpha ? colorg / alpha : 0; + spu->scaled_imagev[base] = alpha ? colorb / alpha : 0; + spu->scaled_aimage[base] = + alpha * (1 + unscaled_bottom - unscaled_top) * (1 + unscaled_right - unscaled_left); + /* spu->scaled_aimage[base] = + alpha * dxs * dys / spu->orig_frame_width / spu->orig_frame_height; */ + if (spu->scaled_aimage[base]) { + spu->scaled_aimage[base] = 256 - spu->scaled_aimage[base]; + if (spu->scaled_aimage[base] + spu->scaled_image[base] > 255) + spu->scaled_image[base] = 256 - spu->scaled_aimage[base]; + if (spu->scaled_aimage[base] + spu->scaled_imageu[base] > 255) + spu->scaled_imageu[base] = 256 - spu->scaled_aimage[base]; + if (spu->scaled_aimage[base] + spu->scaled_imagev[base] > 255) + spu->scaled_imagev[base] = 256 - spu->scaled_aimage[base]; + } + } + } + } + break; + case 2: + { + /* Best antialiasing. Very slow. */ + /* Any pixel (x, y) represents pixels from the original + rectangular region comprised between the columns + unscaled_y and unscaled_y + 0x100 / scaley and the rows + unscaled_x and unscaled_x + 0x100 / scalex + + The original rectangular region that the scaled pixel + represents is cut in 9 rectangular areas like this: + + +---+-----------------+---+ + | 1 | 2 | 3 | + +---+-----------------+---+ + | | | | + | 4 | 5 | 6 | + | | | | + +---+-----------------+---+ + | 7 | 8 | 9 | + +---+-----------------+---+ + + The width of the left column is at most one pixel and + it is never null and its right column is at a pixel + boundary. The height of the top row is at most one + pixel it is never null and its bottom row is at a + pixel boundary. The width and height of region 5 are + integral values. The width of the right column is + what remains and is less than one pixel. The height + of the bottom row is what remains and is less than + one pixel. + + The row above 1, 2, 3 is unscaled_y. The row between + 1, 2, 3 and 4, 5, 6 is top_low_row. The row between 4, + 5, 6 and 7, 8, 9 is (unsigned int)unscaled_y_bottom. + The row beneath 7, 8, 9 is unscaled_y_bottom. + + The column left of 1, 4, 7 is unscaled_x. The column + between 1, 4, 7 and 2, 5, 8 is left_right_column. The + column between 2, 5, 8 and 3, 6, 9 is (unsigned + int)unscaled_x_right. The column right of 3, 6, 9 is + unscaled_x_right. */ + const double inv_scalex = (double) 0x100 / scalex; + const double inv_scaley = (double) 0x100 / scaley; + for (y = 0; y < spu->scaled_height; ++y) { + const double unscaled_y = y * inv_scaley; + const double unscaled_y_bottom = unscaled_y + inv_scaley; + const unsigned int top_low_row = + MIN(unscaled_y_bottom, unscaled_y + 1.0); + const double top = top_low_row - unscaled_y; + const unsigned int height = unscaled_y_bottom > top_low_row + ? (unsigned int) unscaled_y_bottom - top_low_row + : 0; + const double bottom = unscaled_y_bottom > top_low_row + ? unscaled_y_bottom - floor(unscaled_y_bottom) + : 0.0; + for (x = 0; x < spu->scaled_width; ++x) { + const double unscaled_x = x * inv_scalex; + const double unscaled_x_right = unscaled_x + inv_scalex; + const unsigned int left_right_column = + MIN(unscaled_x_right, unscaled_x + 1.0); + const double left = left_right_column - unscaled_x; + const unsigned int width = unscaled_x_right > left_right_column + ? (unsigned int) unscaled_x_right - left_right_column + : 0; + const double right = unscaled_x_right > left_right_column + ? unscaled_x_right - floor(unscaled_x_right) + : 0.0; + double colorr = 0.0; + double colorg = 0.0; + double colorb = 0.0; + double alpha = 0.0; + double tmp; + unsigned int base; + /* Now use these informations to compute a good alpha, + and lightness. The sum is on each of the 9 + region's surface and alpha and lightness. + + transformed alpha = sum(surface * alpha) / sum(surface) + transformed color = sum(surface * alpha * color) / sum(surface * alpha) + */ + /* 1: top left part */ + base = spu->stride * (unsigned int) unscaled_y; + tmp = left * top * canon_alpha(spu->aimage[base + (unsigned int) unscaled_x]); + alpha += tmp; + colorr += tmp * spu->image[base + (unsigned int) unscaled_x]; + colorg += tmp * spu->imageu[base + (unsigned int) unscaled_x]; + colorb += tmp * spu->imagev[base + (unsigned int) unscaled_x]; + /* 2: top center part */ + if (width > 0) { + unsigned int walkx; + for (walkx = left_right_column; + walkx < (unsigned int) unscaled_x_right; + ++walkx) { + base = spu->stride * (unsigned int) unscaled_y + walkx; + tmp = /* 1.0 * */ top * canon_alpha(spu->aimage[base]); + alpha += tmp; + colorr += tmp * spu->image[base]; + colorg += tmp * spu->imageu[base]; + colorb += tmp * spu->imagev[base]; + } + } + /* 3: top right part */ + if (right > 0.0) { + base = spu->stride * (unsigned int) unscaled_y + + (unsigned int) unscaled_x_right; + tmp = right * top * canon_alpha(spu->aimage[base]); + alpha += tmp; + colorr += tmp * spu->image[base]; + colorg += tmp * spu->imageu[base]; + colorb += tmp * spu->imagev[base]; + } + /* 4: center left part */ + if (height > 0) { + unsigned int walky; + for (walky = top_low_row; + walky < (unsigned int) unscaled_y_bottom; + ++walky) { + base = spu->stride * walky + (unsigned int) unscaled_x; + tmp = left /* * 1.0 */ * canon_alpha(spu->aimage[base]); + alpha += tmp; + colorr += tmp * spu->image[base]; + colorg += tmp * spu->imageu[base]; + colorb += tmp * spu->imagev[base]; + } + } + /* 5: center part */ + if (width > 0 && height > 0) { + unsigned int walky; + for (walky = top_low_row; + walky < (unsigned int) unscaled_y_bottom; + ++walky) { + unsigned int walkx; + base = spu->stride * walky; + for (walkx = left_right_column; + walkx < (unsigned int) unscaled_x_right; + ++walkx) { + tmp = /* 1.0 * 1.0 * */ canon_alpha(spu->aimage[base + walkx]); + alpha += tmp; + colorr += tmp * spu->image[base + walkx]; + colorg += tmp * spu->imageu[base + walkx]; + colorb += tmp * spu->imagev[base + walkx]; + } + } + } + /* 6: center right part */ + if (right > 0.0 && height > 0) { + unsigned int walky; + for (walky = top_low_row; + walky < (unsigned int) unscaled_y_bottom; + ++walky) { + base = spu->stride * walky + (unsigned int) unscaled_x_right; + tmp = right /* * 1.0 */ * canon_alpha(spu->aimage[base]); + alpha += tmp; + colorr += tmp * spu->image[base]; + colorg += tmp * spu->imageu[base]; + colorb += tmp * spu->imagev[base]; + } + } + /* 7: bottom left part */ + if (bottom > 0.0) { + base = spu->stride * (unsigned int) unscaled_y_bottom + + (unsigned int) unscaled_x; + tmp = left * bottom * canon_alpha(spu->aimage[base]); + alpha += tmp; + colorr += tmp * spu->image[base]; + colorg += tmp * spu->imageu[base]; + colorb += tmp * spu->imagev[base]; + } + /* 8: bottom center part */ + if (width > 0 && bottom > 0.0) { + unsigned int walkx; + base = spu->stride * (unsigned int) unscaled_y_bottom; + for (walkx = left_right_column; + walkx < (unsigned int) unscaled_x_right; + ++walkx) { + tmp = /* 1.0 * */ bottom * canon_alpha(spu->aimage[base + walkx]); + alpha += tmp; + colorr += tmp * spu->image[base + walkx]; + colorg += tmp * spu->imageu[base + walkx]; + colorb += tmp * spu->imagev[base + walkx]; + } + } + /* 9: bottom right part */ + if (right > 0.0 && bottom > 0.0) { + base = spu->stride * (unsigned int) unscaled_y_bottom + + (unsigned int) unscaled_x_right; + tmp = right * bottom * canon_alpha(spu->aimage[base]); + alpha += tmp; + colorr += tmp * spu->image[base]; + colorg += tmp * spu->imageu[base]; + colorb += tmp * spu->imagev[base]; + } + /* Finally mix these transparency and brightness information suitably */ + base = spu->scaled_stride * y + x; + spu->scaled_image[base] = alpha > 0 ? colorr / alpha : 0; + spu->scaled_imageu[base] = alpha > 0 ? colorg / alpha : 0; + spu->scaled_imagev[base] = alpha > 0 ? colorb / alpha : 0; + spu->scaled_aimage[base] = alpha * scalex * scaley / 0x10000; + if (spu->scaled_aimage[base]) { + spu->scaled_aimage[base] = 256 - spu->scaled_aimage[base]; + if (spu->scaled_aimage[base] + spu->scaled_image[base] > 255) + spu->scaled_image[base] = 256 - spu->scaled_aimage[base]; + if (spu->scaled_aimage[base] + spu->scaled_imageu[base] > 255) + spu->scaled_imageu[base] = 256 - spu->scaled_aimage[base]; + if (spu->scaled_aimage[base] + spu->scaled_imagev[base] > 255) + spu->scaled_imagev[base] = 256 - spu->scaled_aimage[base]; + } + } + } + } + } +nothing_to_do: + /* Kludge: draw_alpha needs width multiple of 8. */ + if (spu->scaled_width < spu->scaled_stride) + for (y = 0; y < spu->scaled_height; ++y) { + memset(spu->scaled_aimage + y * spu->scaled_stride + + spu->scaled_width, 0, + spu->scaled_stride - spu->scaled_width); + } + spu->scaled_frame_width = dxs; + spu->scaled_frame_height = dys; + } + } + if (spu->scaled_image){ + switch (spu_alignment) { + case 0: + spu->scaled_start_row = dys*sub_pos/100; + if (spu->scaled_start_row + spu->scaled_height > dys) + spu->scaled_start_row = dys - spu->scaled_height; + break; + case 1: + spu->scaled_start_row = dys*sub_pos/100 - spu->scaled_height/2; + if (sub_pos < 50) { + if (spu->scaled_start_row < 0) spu->scaled_start_row = 0; + } else { + if (spu->scaled_start_row + spu->scaled_height > dys) + spu->scaled_start_row = dys - spu->scaled_height; + } + break; + case 2: + spu->scaled_start_row = dys*sub_pos/100 - spu->scaled_height; + if (spu->scaled_start_row < 0) spu->scaled_start_row = 0; + break; + } + draw_alpha(spu->scaled_start_col, + spu->scaled_start_row, + spu->scaled_width, + spu->scaled_height, + DEST_PLANES_RB, + spu->scaled_image, + spu->scaled_aimage, + spu->scaled_stride); + draw_alpha(spu->scaled_start_col, + spu->scaled_start_row, + spu->scaled_width, + spu->scaled_height, + DEST_PLANES_G, + spu->scaled_imageu, + spu->scaled_aimage, + spu->scaled_stride); + draw_alpha(spu->scaled_start_col, + spu->scaled_start_row, + spu->scaled_width, + spu->scaled_height, + DEST_PLANES_BR, + spu->scaled_imagev, + spu->scaled_aimage, + spu->scaled_stride); + spu->spu_changed = 0; + } + } + } + else + { + mp_msg(MSGT_SPUDEC,MSGL_DBG2, + "SPU not displayed: start_pts=%d end_pts=%d now_pts=%d\n", + spu->start_pts, spu->end_pts, spu->now_pts); + } +} + +void spudec_update_palette(void * this, unsigned int *palette) +{ + spudec_handle_t *spu = (spudec_handle_t *) this; + if (spu && palette) { + memcpy(spu->global_palette, palette, sizeof(spu->global_palette)); + if(spu->hw_spu) + spu->hw_spu->control(VOCTRL_SET_SPU_PALETTE,spu->global_palette); + } +} + +void spudec_set_font_factor(void * this, double factor) +{ + spudec_handle_t *spu = (spudec_handle_t *) this; + spu->font_start_level = (int)(0xF0-(0xE0*factor)); +} + +void *spudec_new_scaled(unsigned int *palette, unsigned int frame_width, unsigned int frame_height) +{ + return spudec_new_scaled_vobsub(palette, NULL, 0, frame_width, frame_height); +} + +/* get palette custom color, width, height from .idx file */ +void *spudec_new_scaled_vobsub(unsigned int *palette, unsigned int *cuspal, unsigned int custom, unsigned int frame_width, unsigned int frame_height) +{ + spudec_handle_t *this = calloc(1, sizeof(spudec_handle_t)); + if (this){ + //(fprintf(stderr,"VobSub Custom Palette: %d,%d,%d,%d", this->cuspal[0], this->cuspal[1], this->cuspal[2],this->cuspal[3]); + this->packet = NULL; + this->image = NULL; + this->scaled_image = NULL; + /* XXX Although the video frame is some size, the SPU frame is + always maximum size i.e. 720 wide and 576 or 480 high */ + this->orig_frame_width = 720; + this->orig_frame_height = (frame_height == 480 || frame_height == 240) ? 480 : 576; + this->custom = custom; + // set up palette: + this->auto_palette = 1; + if (palette){ + memcpy(this->global_palette, palette, sizeof(this->global_palette)); + this->auto_palette = 0; + } + this->custom = custom; + if (custom && cuspal) { + memcpy(this->cuspal, cuspal, sizeof(this->cuspal)); + this->auto_palette = 0; + } + // forced subtitles default: show all subtitles + this->forced_subs_only=0; + this->is_forced_sub=0; + } + else + mp_msg(MSGT_SPUDEC,MSGL_FATAL, "FATAL: spudec_init: calloc"); + return this; +} + +void *spudec_new(unsigned int *palette) +{ + return spudec_new_scaled(palette, 0, 0); +} + +void spudec_free(void *this) +{ + spudec_handle_t *spu = (spudec_handle_t*)this; + if (spu) { + while (spu->queue_head) + spudec_free_packet(spudec_dequeue_packet(spu)); + if (spu->packet) + free(spu->packet); + if (spu->scaled_image) + free(spu->scaled_image); + if (spu->image) + free(spu->image); + if (spu->dvdnav_image) + free(spu->dvdnav_image); + if (spu->dvdnav_aimage) + free(spu->dvdnav_aimage); + + if (spu->imageu) + free(spu->imageu); + if (spu->imageyuy) + free(spu->imageyuy); + spu->imageyuy=NULL; + if (spu->scaled_imageu) + free(spu->scaled_imageu); + + if (spu->last_packet) {spudec_free_packet(spu->last_packet); spu->last_packet=NULL;} + spu->dvdnav_allocated = 0; free(spu); } } diff -Nur MPlayer-1.0pre8.orig/spudec.h MPlayer-1.0pre8/spudec.h --- MPlayer-1.0pre8.orig/spudec.h 2006-06-11 21:35:47.000000000 +0300 +++ MPlayer-1.0pre8/spudec.h 2006-06-15 23:04:46.000000000 +0300 @@ -5,8 +5,31 @@ void spudec_heartbeat(void *this, unsigned int pts100); void spudec_assemble(void *this, unsigned char *packet, unsigned int len, unsigned int pts100); -void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); -void spudec_draw_scaled(void *this, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); +#define DVDNAV_SPU_YUV 1 +#define DVDNAV_SPU_RGB 2 +#define DVDNAV_SPU_BGR 3 +#define DVDNAV_SPU_YUY 4 + +void spu_yuv_to_rgb(unsigned int y,unsigned int u,unsigned int v, + unsigned int *r,unsigned int *g,unsigned int *b); +void spudec_dvdnav_mode(void *this, int mode, int cflg); +void spudec_dvdnav_area(void *this, uint16_t sx, uint16_t sy, + uint16_t ex, uint16_t ey, uint32_t palette); +void spudec_dvdnav_palette(void *this, uint32_t palette); +int spudec_dvdnav_menu_box(void *this, int scaled, unsigned int scalex, + unsigned int scaley); +void spudec_new_scaled_yuv(unsigned int *palette, unsigned int frame_width, + unsigned int frame_height); +void spudec_new_scaled_rgb(unsigned int *palette, unsigned int frame_width, + unsigned int frame_height); +void spudec_draw_scaled_yuv(void *me, unsigned int dxs, unsigned int dys, + void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)); +void spudec_draw_scaled_rgb(void *me, unsigned int dxs, unsigned int dys, + void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)); +void spudec_create_yuy(void *this, int spu_scaled); + +void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)); +void spudec_draw_scaled(void *this, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)); void spudec_update_palette(void *this, unsigned int *palette); void *spudec_new_scaled(unsigned int *palette, unsigned int frame_width, unsigned int frame_height); void *spudec_new_scaled_vobsub(unsigned int *palette, unsigned int *cuspal, unsigned int custom, unsigned int frame_width, unsigned int frame_height); @@ -18,7 +41,7 @@ void spudec_set_hw_spu(void *this, vo_functions_t *hw_spu); int spudec_changed(void *this); void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, unsigned int* bbox); -void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); +void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride)); void spudec_set_forced_subs_only(void * const this, const unsigned int flag); #endif geexbox-1.0/packages/MPlayer/patches/701_player-dvdnav-conflict.diff0000644000175000017500000000313610446314257024400 0ustar aurelaurelcontinuation of 700_player-dvdnav.diff (see it for more information) which conflicted with geexbox patches. diff -Nur MPlayer-1.0pre8.orig/mplayer.c MPlayer-1.0pre8/mplayer.c --- MPlayer-1.0pre8.orig/mplayer.c 2006-06-02 19:16:27.000000000 +0300 +++ MPlayer-1.0pre8/mplayer.c 2006-06-02 19:18:50.000000000 +0300 @@ -3384,7 +3384,11 @@ //================== Read SUBTITLES (DVD & TEXT) ========================== if(vo_spudec==NULL && sh_video && - (stream->type==STREAMTYPE_DVD || demuxer->type==DEMUXER_TYPE_MATROSKA)){ + (stream->type==STREAMTYPE_DVD || demuxer->type==DEMUXER_TYPE_MATROSKA || +#ifdef USE_DVDNAV + stream->type==STREAMTYPE_DVDNAV +#endif + )){ if (spudec_ifo) { unsigned int palette[16], width, height; @@ -3908,6 +3912,24 @@ // get it! current_module="video_read_frame"; in_size=video_read_frame(sh_video,&next_frame_time,&start,force_fps); +#ifdef USE_DVDNAV + if (stream->type==STREAMTYPE_DVDNAV) + { +// if (dvdnav_reallyeof((dvdnav_priv_t*)(stream->priv))) + if (stream_control(stream,STREAM_CTRL_DVDNAV_REALLYEOF,NULL)==STREAM_OK) + { + eof=1; + break; + } + if (in_size<0) + { + sh_video->num_frames++; + sh_video->num_frames_decoded++; + sh_video->pts+=next_frame_time; + } + sh_video->config_lock=1; + } else { +#endif if(in_size<0){ if(bg_demuxer) { if(!demux_seek(bg_demuxer,0,0,1)) @@ -3918,6 +3939,9 @@ eof=1; break; } +#ifdef USE_DVDNAV + } +#endif if(in_size>max_framesize) max_framesize=in_size; // stats sh_video->timer+=frame_time; if(sh_audio) sh_audio->delay-=frame_time; geexbox-1.0/packages/MPlayer/patches/702_dvdnav-rtp-demux-open.diff0000644000175000017500000000115110446314257024165 0ustar aurelaurelFix diff -Nur MPlayer-20060519.orig/libmpdemux/demux_rtp.cpp MPlayer-20060519/libmpdemux/demux_rtp.cpp --- MPlayer-20060519.orig/libmpdemux/demux_rtp.cpp 2006-06-02 20:12:02.000000000 +0300 +++ MPlayer-20060519/libmpdemux/demux_rtp.cpp 2006-06-02 20:12:48.000000000 +0300 @@ -241,7 +241,7 @@ if (demux_is_multiplexed_rtp_stream(demuxer)) { stream_t* s = new_ds_stream(demuxer->video); demuxer_t* od = demux_open(s, DEMUXER_TYPE_UNKNOWN, - audio_id, video_id, dvdsub_id, NULL, 0, 0, 0); + audio_id, video_id, dvdsub_id, NULL, 0); demuxer = new_demuxers_demuxer(od, od, od); } geexbox-1.0/packages/MPlayer/patches/710_dvdnav-bgvideo.diff0000644000175000017500000000127610446314257022727 0ustar aurelaurel250_bgvideo.diff added a demux_open, and dvdnav added another parameter. diff -Nur MPlayer-20060519.orig/mplayer.c MPlayer-20060519/mplayer.c --- MPlayer-20060519.orig/mplayer.c 2006-06-02 19:26:22.000000000 +0300 +++ MPlayer-20060519/mplayer.c 2006-06-02 19:28:19.000000000 +0300 @@ -3305,7 +3305,7 @@ mp_msg(MSGT_CPLAYER,MSGL_ERR, "Couldn't open the stream for back ground video: %s\n",bg_video); break; } - bg_demuxer = demux_open(bg_s,bg_file_format,-2,video_id,dvdsub_id,bg_video); + bg_demuxer = demux_open(bg_s,bg_file_format,-2,video_id,dvdsub_id,bg_video, 0); if(!bg_demuxer) { mp_msg(MSGT_DEMUXER,MSGL_ERR,"Failed to open background video\n"); free_stream(bg_s); geexbox-1.0/packages/MPlayer/patches/715_player-dvdnav-extra.diff0000644000175000017500000120551310446314257023733 0ustar aurelaurelextra new files for dvdnav, as a seperate patch. based on files taken from: http://www.freeweb.hu/dcxx/mplayer/index-20060614.html does not include: libmpdvdnav/libdvdnav_changes.diff diff -Nur a/libmpcodecs/vd_videostill.c b/libmpcodecs/vd_videostill.c --- a/libmpcodecs/vd_videostill.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpcodecs/vd_videostill.c 2006-06-12 23:10:25.000000000 +0300 @@ -0,0 +1,151 @@ +#include "config.h" + +#include +#ifdef HAVE_MALLOC_H +#include +#endif +#include +#include + +#include "mp_msg.h" +#include "help_mp.h" + +#include "osdep/timer.h" +#include "osdep/shmem.h" + +#include "stream.h" +#include "demuxer.h" +#include "parse_es.h" + +#include "codec-cfg.h" + +#include "libvo/video_out.h" + +#include "stheader.h" +#include "vd.h" +#include "vf.h" + +#include "dec_video.h" + +#ifdef DYNAMIC_PLUGINS +#include +#endif + +#ifdef USE_MPDVDNAV_TRACE +extern int dvdnav_trace; +#endif + +#include "libvo/fastmemcpy.h" +mp_image_t *smpi=NULL; +int mp_preserve=0; +#define MP_STORED_IMAGE_NOSET -1 +#define MP_STORED_IMAGE_OFF 0 +#define MP_STORED_IMAGE_ON 1 +int mp_stored_image=MP_STORED_IMAGE_NOSET; + + +extern double video_time_usage; +extern double vout_time_usage; + +extern vd_functions_t* mpvdec; // FIXME! + +#include "cpudetect.h" + +void clearsmpi(void) {smpi=NULL; mp_stored_image=MP_STORED_IMAGE_NOSET;} + +int vd_mpeg2_reset(sh_video_t *sh_video, int full_reset) +{ +if (!mpvdec) return 0; +if (mp_stored_image==MP_STORED_IMAGE_NOSET) return 0; +if (mp_stored_image==MP_STORED_IMAGE_OFF) return 1; +if (!sh_video->enable_mpeg2_reset) return 0; +mpvdec->control(sh_video, VDCTRL_RESET, &full_reset); +return 1; +} + +inline static void copy_mpi(mp_image_t *dmpi, mp_image_t *mpi) { + if(mpi->flags&MP_IMGFLAG_PLANAR){ + memcpy_pic(dmpi->planes[0],mpi->planes[0], mpi->w, mpi->h, + dmpi->stride[0],mpi->stride[0]); + memcpy_pic(dmpi->planes[1],mpi->planes[1], mpi->chroma_width, mpi->chroma_height, + dmpi->stride[1],mpi->stride[1]); + memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->chroma_width, mpi->chroma_height, + dmpi->stride[2],mpi->stride[2]); + } else { + memcpy_pic(dmpi->planes[0],mpi->planes[0], + mpi->w*(dmpi->bpp/8), mpi->h, + dmpi->stride[0],mpi->stride[0]); + } +} + + +int vd_decode_mp_preserve(void) {return mp_preserve;} + +int decode_video_still(sh_video_t *sh_video,unsigned char *start, + int in_size,int drop_frame, double pts, int enable_still){ +vf_instance_t* vf; +mp_image_t *mpi=NULL; +unsigned int t=GetTimer(); +unsigned int t2; +double tt; +int ret; + +if (in_size>=0 || !enable_still) + //if(!(sh_video->ds->flags&1) || sh_video->ds->pack_no<5) + mpi=mpvdec->decode(sh_video, start, in_size, drop_frame); +//------------------------ frame decoded. -------------------- + +#ifdef ARCH_X86 + // some codecs are broken, and doesn't restore MMX state :( + // it happens usually with broken/damaged files. + if(gCpuCaps.has3DNow){ + __asm __volatile ("femms\n\t":::"memory"); + } + else if(gCpuCaps.hasMMX){ + __asm __volatile ("emms\n\t":::"memory"); + } +#endif + +if (mp_stored_image==MP_STORED_IMAGE_NOSET && mpvdec && enable_still) + { + if (mpvdec->control(sh_video, VDCTRL_STORED_IMAGE, NULL)==CONTROL_TRUE) + mp_stored_image=MP_STORED_IMAGE_ON; + else + mp_stored_image=MP_STORED_IMAGE_OFF; + } +mp_preserve=0; +if (in_size>=0 && mpi && enable_still && mp_stored_image==MP_STORED_IMAGE_ON) + { + smpi=mpi; /* It will use copy_mpi() or other solution? */ + if (mpi) mp_preserve=mpi->flags & MP_IMGFLAG_PRESERVE; + } +if (in_size<0 && enable_still && smpi && mp_stored_image!=MP_STORED_IMAGE_NOSET) + { + mpi=smpi; + } + + +t2=GetTimer();t=t2-t; +tt = t*0.000001f; +video_time_usage+=tt; + +if(!mpi || (drop_frame && !(enable_still && in_size<0))) return 0; // error / skipped frame +//vo_draw_image(video_out,mpi); +vf=sh_video->vfilter; +ret = vf->put_image(vf,mpi, pts); // apply video filters and call the leaf vo/ve +if (in_size>=0 && mpi && enable_still && mp_stored_image==MP_STORED_IMAGE_OFF) + { + smpi=mpcodecs_get_image(sh_video, + (sh_video->codec->outflags[sh_video->outfmtidx] & CODECS_FLAG_STATIC) ? + MP_IMGTYPE_STATIC : MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_WIDTH, + sh_video->disp_w, sh_video->disp_h); + if (smpi) copy_mpi(smpi,mpi); + } +if(ret>0) vf->control(vf,VFCTRL_DRAW_OSD,NULL); + + t2=GetTimer()-t2; + tt=t2*0.000001f; + vout_time_usage+=tt; + +return ret; +} diff -Nur a/libmpcodecs/vd_videostill.h b/libmpcodecs/vd_videostill.h --- a/libmpcodecs/vd_videostill.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpcodecs/vd_videostill.h 2006-04-04 00:48:44.000000000 +0300 @@ -0,0 +1,8 @@ +#ifndef __VD_VIDEOSTILL_H_ +#define __VD_VIDEOSTILL_H_ + +extern void clearsmpi(void); +extern int vd_mpeg2_reset(sh_video_t *sh_video, int force_reset); +extern int decode_video_still(sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame, double pts,int enable_still); +extern int vd_decode_mp_preserve(void); +#endif diff -Nur a/libmpdemux/stream_dvdnav.c b/libmpdemux/stream_dvdnav.c --- a/libmpdemux/stream_dvdnav.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdemux/stream_dvdnav.c 2006-06-14 18:56:06.000000000 +0300 @@ -0,0 +1,1441 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: dvdnav.c,v 1.63 2004/01/31 17:12:58 jcdutton Exp $ + * + */ + +/* + * Ötvös Attila (Attila, Otvos) created it with the libdvdnav-0.1.10. + * Useful links: + * SourceForge.net: DVD tools for Linux + * http://sourceforge.net/projects/dvd/ + */ + +#include "config.h" + +#ifdef USE_MPDVDNAV // enable dvdnav support? +#include +#include +#include +#include +#include "mp_msg.h" +#include "../libmpdemux/stream.h" +#include "help_mp.h" +#include "osdep/timer.h" +#include "input/input.h" +#include "stream.h" +#include "stream_dvdnav.h" +#include "libvo/video_out.h" +#include "spudec.h" +#include "m_option.h" +#include "m_struct.h" +#include "libmpdvdnav/dvdnav_internal.h" + +#define TRACE // enable trace messages print, usage: -dvdnav-trace options +//#define LOG_DEBUG + +int dvd_nav_skip_opening = 0; +int dvd_nav_still = 0; +int dvdnav_menutype = 0; +int dvdnav_continue_play = 0; +int dvdnav_go_title = 0; +int dvdnav_go_part = 0; +int dvdnav_go_menu = 0; +int dvdnav_go_menu_force = 0; +int dvdnav_go_audio = 0; +int dvdnav_go_spu = 0; +int dvdnav_trace = 0; +int dvdnav_force_menu = 0; +int dvdnav_skipintro = 0; +int dvdnav_color_spu = 1; +int dvdnav_still_repeat = DVDNAV_MAX_STILL_FRAME; +char* dvdmenu_lang = NULL; + +extern char* dvd_device; +extern int audio_id; +extern int dvdsub_id; +extern char* audio_lang; +extern char* dvdsub_lang; + +#ifdef HAVE_NEW_GUI +int dvdnav_window_width=0; +int dvdnav_window_height=0; +int dvdnav_window_orig_width=0; +int dvdnav_window_orig_height=0; +int dvdnav_mouse_x=0; +int dvdnav_mouse_y=0; +int dvdnav_mouse_orig_x=0; +int dvdnav_mouse_orig_y=0; +int dvdnav_mouse_button=0; +int dvdnav_mouse_set=0; +#endif + +off_t eventnum=0; + +int cellxx=0; + +static struct stream_priv_s { + int track; + char* device; +} stream_priv_dflts = { + 1, + NULL +}; + +#define ST_OFF(f) M_ST_OFF(struct stream_priv_s,f) +/// URL definition +static m_option_t stream_opts_fields[] = { + { NULL, NULL, 0, 0, 0, 0, NULL } +}; +static struct m_struct_st stream_opts = { + "dvd", + sizeof(struct stream_priv_s), + &stream_priv_dflts, + stream_opts_fields +}; + + +#ifndef _MSC_VER +#include +#include +#else +#ifndef MAXPATHLEN +#define MAXPATHLEN 255 +#endif +#endif /* _MSC_VER */ + +int dvdnav_seek(dvdnav_priv_t * dvdnav_priv, off_t newpos,stream_t *s) +{ +if (dvdnav_priv->lockseek) return 0; +if (dvdnav_sector_search(dvdnav_priv->dvdnav, newpos, SEEK_SET)!= + DVDNAV_STATUS_OK) { + if (!newpos) mp_msg(MSGT_CPLAYER,MSGL_ERR, + MSGTR_MPDVDNAV_ErrorSeek,dvdnav_err_to_string(dvdnav_priv->dvdnav), + newpos ); + return 0; + } +return 1; +} + +static int seek(stream_t *s, off_t newpos) +{ +off_t seekpos; + +mp_msg(MSGT_CPLAYER,MSGL_DBG2,"DVDNAV seek pos: %llx\n",newpos); +dvdnav_priv_t* dvdnav_priv=s->priv; +int domain_vts=dvdnav_priv->vts_domain; +if(newpos!=s->pos) { + if (!domain_vts) + mp_msg(MSGT_CPLAYER,MSGL_V,"Cannot seek in DVDNAV streams yet!\n"); + else { + seekpos=newpos/2048; + if (dvdnav_seek((dvdnav_priv_t*)s->priv,seekpos,s)) s->pos=newpos; } + } +if (newpos==0) { + ((dvdnav_priv_t*)(s->priv))->stillcounter=0; + ((dvdnav_priv_t*)(s->priv))->waitcounter=0; + ((dvdnav_priv_t*)(s->priv))->lockstillcounter=0;} +return 1; +} + +unsigned int * dvdnav_stream_get_palette(dvdnav_priv_t * dvdnav_priv) +{ +if (!dvdnav_priv) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, + "%s: NULL dvdnav_priv\n", + __FUNCTION__); + return NULL; + } +if (!dvdnav_priv->dvdnav) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, + "%s: NULL dvdnav_priv->dvdnav\n", + __FUNCTION__); + return NULL; + } +if (!dvdnav_priv->dvdnav->vm) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, + "%s: NULL dvdnav_priv->dvdnav->vm\n", + __FUNCTION__); + return NULL; + } +if (!dvdnav_priv->dvdnav->vm->state.pgc) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, + "%s: NULL dvdnav_priv->dvdnav->vm->state.pgc\n", + __FUNCTION__); + return NULL; + } +return dvdnav_priv->dvdnav->vm->state.pgc->palette; +} + +int dvdnav_menu_action(dvdnav_priv_t * dvdnav_priv, int action) +{ +pci_t* pnavpci; +dsi_t* pnavdsi; +uint32_t buttonN; +pnavpci = dvdnav_get_current_nav_pci( dvdnav_priv->dvdnav ); +pnavdsi = dvdnav_get_current_nav_dsi( dvdnav_priv->dvdnav ); +dvdnav_status_t nav_status; +if (!dvdnav_priv) return 0; +switch (action) { + case MP_CMD_DVDNAV_UP: + nav_status = dvdnav_upper_button_select(dvdnav_priv->dvdnav, pnavpci); +#ifdef USE_MPDVDNAV_TRACE + dvdnav_print_buttons(dvdnav_priv,"dvdnav cmd up"); +#endif + break; + case MP_CMD_DVDNAV_DOWN: + nav_status = dvdnav_lower_button_select(dvdnav_priv->dvdnav, pnavpci); +#ifdef USE_MPDVDNAV_TRACE + dvdnav_print_buttons(dvdnav_priv,"dvdnav cmd down"); +#endif + break; + case MP_CMD_DVDNAV_LEFT: + nav_status = dvdnav_left_button_select(dvdnav_priv->dvdnav, pnavpci); +#ifdef USE_MPDVDNAV_TRACE + dvdnav_print_buttons(dvdnav_priv,"dvdnav cmd left"); +#endif + break; + case MP_CMD_DVDNAV_RIGHT: + nav_status = dvdnav_right_button_select(dvdnav_priv->dvdnav, pnavpci); +#ifdef USE_MPDVDNAV_TRACE + dvdnav_print_buttons(dvdnav_priv,"dvdnav cmd right"); +#endif + break; + case MP_CMD_DVDNAV_MENU: + dvdnav_wait_still_clear(dvdnav_priv->dvdnav); + dvdnav_priv->cell_timer=0; + dvdnav_priv->one_cell_timer=0; + dvdnav_priv->stillflg=0; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: menu action: Menu Root\n"); +#endif + dvdnav_button_select_auto_action( dvdnav_priv->dvdnav, 0); + nav_status = dvdnav_menu_call(dvdnav_priv->dvdnav,DVD_MENU_Root); + break; + case MP_CMD_DVDNAV_SELECT: + dvdnav_wait_still_clear(dvdnav_priv->dvdnav); + dvdnav_priv->cell_timer=0; + dvdnav_priv->one_cell_timer=0; + dvdnav_priv->stillflg=0; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: menu action: Menu Select\n"); +#endif + dvdnav_button_select_auto_action( dvdnav_priv->dvdnav, 0); + nav_status = dvdnav_button_activate(dvdnav_priv->dvdnav, pnavpci); + break; + default: + return 0; + } +if (nav_status == DVDNAV_STATUS_ERR) {mp_msg(MSGT_CPLAYER, MSGL_WARN, + MSGTR_MPDVDNAV_ErrorNav, + dvdnav_err_to_string(dvdnav_priv->dvdnav)); + return 0;} +return 1; +} + +int dvdnav_menu_force(dvdnav_priv_t * dvdnav_priv) +{ +return 1; +} + +void dvdnav_stream_fullstart(dvdnav_priv_t * dvdnav_priv) +{ +if (dvdnav_priv && !dvdnav_priv->started) { +// dvdnav_stream_reset(dvdnav_priv); + dvdnav_priv->started=1; } +dvdnav_event_clear(dvdnav_priv); +dvdnav_priv->stillcounter=0; +dvdnav_priv->waitcounter=0; +dvdnav_priv->lockstillcounter=0; +} + +int dvdnav_reallyeof(dvdnav_priv_t * dvdnav_priv) +{ +if (!dvdnav_priv) return 1; +return dvdnav_priv->stopflg; +} + +void dvdnav_set_language(dvdnav_priv_t *dvdnav_priv, char *alang, + char *slang, char *mlang) /* set nav languages */ +{ +if (slang) { + if (dvdnav_spu_language_select(dvdnav_priv->dvdnav, slang ) != + DVDNAV_STATUS_OK) /* FIXME: don't work! */ + mp_msg(MSGT_FIXME, MSGL_FIXME, "Error on setting spu languages: %s\n", + dvdnav_err_to_string(dvdnav_priv->dvdnav)); } +if (alang) { + if (dvdnav_audio_language_select(dvdnav_priv->dvdnav, alang ) != + DVDNAV_STATUS_OK) /* FIXME: don't work! */ + mp_msg(MSGT_FIXME, MSGL_FIXME, "Error on setting audio languages: %s\n", + dvdnav_err_to_string(dvdnav_priv->dvdnav)); } +if (mlang) { + if (dvdnav_menu_language_select(dvdnav_priv->dvdnav, dvdmenu_lang ) != + DVDNAV_STATUS_OK) + mp_msg(MSGT_FIXME, MSGL_FIXME, "Error on setting menu languages: %s\n", + dvdnav_err_to_string(dvdnav_priv->dvdnav)); } +return; +} + +int dvdnav_lang_from_sid(dvdnav_priv_t *dvdnav_priv, int id) +{ +if (!dvdnav_priv) return 0; +if (id >= dvdnav_priv->nr_of_subtitles) return 0; +return dvdnav_priv->subtitles[id].language; +} + +int dvdnav_sid_from_lang(dvdnav_priv_t *dvdnav_priv, unsigned char* lang) +{ +if (!dvdnav_priv) return 0; +int code,i; +while(lang && strlen(lang)>=2) { + code=lang[1]|(lang[0]<<8); + for(i=0;inr_of_subtitles;i++) { + if(dvdnav_priv->subtitles[i].language==code) { + mp_msg(MSGT_OPEN,MSGL_V,MSGTR_DVDsubtitleChannel, i, lang[0],lang[1]); + return i;} + } + lang+=2; + while (lang[0]==',' || lang[0]==' ') ++lang; + } +mp_msg(MSGT_OPEN,MSGL_WARN,MSGTR_DVDnoMatchingSubtitle); +return -1; +} + +int dvdnav_aid_from_lang(dvdnav_priv_t *dvdnav_priv, unsigned char* lang) +{ +if (!dvdnav_priv) return 0; +int code,i; +while(lang && strlen(lang)>=2) { + code=lang[1]|(lang[0]<<8); + for(i=0;inr_of_channels;i++) { + if(dvdnav_priv->audio_streams[i].language==code) { + mp_msg(MSGT_OPEN,MSGL_V,MSGTR_DVDaudioChannel, + dvdnav_priv->audio_streams[i].id, lang[0],lang[1]); + return dvdnav_priv->audio_streams[i].id;} + } + lang+=2; + while (lang[0]==',' || lang[0]==' ') ++lang; + } +mp_msg(MSGT_OPEN,MSGL_WARN,MSGTR_DVDnoMatchingAudio); +return -1; +} + +int dvdnav_number_of_subs(dvdnav_priv_t *dvdnav_priv) +{ +if (!dvdnav_priv) return -1; +return dvdnav_priv->nr_of_subtitles; +} + +static void stream_dvdnav_close(stream_t *s) +{ +free_dvdnav_stream((dvdnav_priv_t*)s->priv); +} + +void dvdnav_event_clear(dvdnav_priv_t * dvdnav_priv) +{ +memset(&(dvdnav_priv->event),0,sizeof(stream_dvdnav_event_t)); +return; +} + +void dvdnav_get_highlight(dvdnav_priv_t *dvdnav_priv, + dvdnav_highlight_event_t *highlight_event, + int display_mode) +{ +pci_t* pnavpci; +int button_number = -1; +int b_mode = 0; +if (!dvdnav_priv) return; +if (!dvdnav_priv->dvdnav) return; +if (!highlight_event) return; +if (NULL==(pnavpci = dvdnav_get_current_nav_pci( dvdnav_priv->dvdnav ))) return; +dvdnav_get_current_highlight(dvdnav_priv->dvdnav, &(highlight_event->buttonN)); +highlight_event->display=display_mode; /* show */ +if (highlight_event->display==2) b_mode=1; /* activate */ +if (highlight_event->buttonN > 0 && pnavpci->hli.hl_gi.btn_ns > 0 && + highlight_event->display) { + for (button_number = 0; button_number < pnavpci->hli.hl_gi.btn_ns; + button_number++) { + btni_t *btni = &(pnavpci->hli.btnit[button_number]); + if(highlight_event->buttonN==button_number+1) { + highlight_event->sx=min(btni->x_start,btni->x_end); + highlight_event->ex=max(btni->x_start,btni->x_end); + highlight_event->sy=min(btni->y_start,btni->y_end); + highlight_event->ey=max(btni->y_start,btni->y_end); + if (btni->btn_coln==0) highlight_event->palette=0; + else + highlight_event->palette= + pnavpci->hli.btn_colit.btn_coli[btni->btn_coln-1][b_mode]; + } + } +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_DBG2, + "dvdnav: get highlight (%i:%i-%i:%i #%i)\n", + highlight_event->sx, + highlight_event->sy, + highlight_event->ex, + highlight_event->ey, + highlight_event->buttonN); +#endif + } else { /* hide button or none button */ +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_DBG2, + "dvdnav: get highlight hide\n"); +#endif + highlight_event->sx=0; + highlight_event->ex=0; + highlight_event->sy=0; + highlight_event->ey=0; + highlight_event->palette=0; + highlight_event->buttonN=0; } +#ifdef USE_MPDVDNAV_TRACE + dvdnav_print_buttons(dvdnav_priv,"dvdnav_get_highlight"); +#endif +return; +} + +void dvdnav_get_button_palette(dvdnav_priv_t *dvdnav_priv,uint32_t *palette) /* get button palette */ +{ +pci_t* pnavpci; +int button_number; +int buttonN; +int b_mode = 0; +if (!dvdnav_priv) return; +if (!dvdnav_priv->dvdnav) return; +if (!palette) return; +if (NULL==(pnavpci = dvdnav_get_current_nav_pci( dvdnav_priv->dvdnav ))) + return; +dvdnav_get_current_highlight(dvdnav_priv->dvdnav, &buttonN); /* get current button ID */ +if (pnavpci->hli.hl_gi.btn_ns) { /* is buttons */ + for (button_number = 0; button_number < pnavpci->hli.hl_gi.btn_ns; + button_number++) { + btni_t *btni = &(pnavpci->hli.btnit[button_number]); + if(buttonN==button_number+1) { /* current button? */ + if (btni->btn_coln==0) *palette=0; + else *palette= + pnavpci->hli.btn_colit.btn_coli[btni->btn_coln-1][b_mode]; + } + } + } +if (*palette==0) /* if none current button? */ + { + btni_t *btni = &(pnavpci->hli.btnit[0]); + if (btni->btn_coln==0) *palette=0; + else *palette= + pnavpci->hli.btn_colit.btn_coli[btni->btn_coln-1][b_mode]; + } +return; +} + +void dvdnav_print_buttons(dvdnav_priv_t *dvdnav_priv, char* txt) +{ +#ifdef USE_MPDVDNAV_TRACE +if( !mp_msg_test(MSGT_CPLAYER,MSGL_DBG2) ) return; +pci_t* pnavpci; +int button_number; +int buttonN; +int b_mode = 0; +if (!dvdnav_priv) return; +if (!dvdnav_priv->dvdnav) return; +if (NULL==(pnavpci = dvdnav_get_current_nav_pci( dvdnav_priv->dvdnav ))) + return; +dvdnav_get_current_highlight(dvdnav_priv->dvdnav, &buttonN); /* get current button ID */ +if (pnavpci->hli.hl_gi.btn_ns) { /* is buttons */ + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: buttons number: %d (%s)\n", + pnavpci->hli.hl_gi.btn_ns, + txt); + for (button_number = 0; button_number < pnavpci->hli.hl_gi.btn_ns; + button_number++) { + btni_t *btni = &(pnavpci->hli.btnit[button_number]); + if(buttonN==button_number+1) { /* current button? */ + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: *buttons: #%d (%d:%d,%d:%d)\n", + button_number, + btni->x_start, + btni->y_start, + btni->x_end, + btni->y_end); + } else { + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: buttons: #%d (%d:%d,%d:%d)\n", + button_number, + btni->x_start, + btni->y_start, + btni->x_end, + btni->y_end); + } + } + } else { + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: buttons number: no buttons (%s)\n", + txt); + } +#endif +return; +} + + +#ifdef HAVE_NEW_GUI +void dvdnav_mouse(dvdnav_priv_t * dvdnav_priv) +{ +pci_t* pnavpci; +if (dvdnav_mouse_set!=1) return; +dvdnav_mouse_set=2; // Lock mouse event +if (NULL==(pnavpci = dvdnav_get_current_nav_pci( dvdnav_priv->dvdnav ))) + return; +if (dvdnav_window_orig_width>0 && + dvdnav_window_orig_height>0 && + dvdnav_window_width>0 && + dvdnav_window_height>0) { + // Calculate original mouse position (if scaled window) + dvdnav_mouse_orig_x= + dvdnav_mouse_x*dvdnav_window_orig_width/dvdnav_window_width; + dvdnav_mouse_orig_y= + dvdnav_mouse_y*dvdnav_window_orig_height/dvdnav_window_height; + } else { + dvdnav_mouse_orig_x=dvdnav_mouse_x; + dvdnav_mouse_orig_y=dvdnav_mouse_y; } +if (pnavpci->hli.hl_gi.btn_ns) { /* is buttons */ + dvdnav_mouse_select(dvdnav_priv->dvdnav, pnavpci, + dvdnav_mouse_orig_x, + dvdnav_mouse_orig_y); /* mouse position select */ +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_mouse_button) dvdnav_print_buttons(dvdnav_priv, + "dvdnav_mouse"); +#endif + if (dvdnav_mouse_button) dvdnav_menu_action(dvdnav_priv, + MP_CMD_DVDNAV_SELECT); } /* mouse button event */ +dvdnav_mouse_set=0; +dvdnav_mouse_button=0; +return; +} +#endif + +#define FIRST_AC3_AID 128 +#define FIRST_DTS_AID 136 +#define FIRST_MPG_AID 0 +#define FIRST_PCM_AID 160 + +int dvdnav_stream_read(dvdnav_priv_t * dvdnav_priv, unsigned char *buf, + int *len,stream_dvdnav_event_t *event) +{ +int eventid = DVDNAV_NOP; + +if (!len) return -1; +*len=-1; +if (!dvdnav_priv) return -1; +if (!buf) return -1; +if (dvdnav_priv->stopflg) return -1; + +if (dvd_nav_still) { + mp_msg(MSGT_CPLAYER,MSGL_DBG2, + MSGTR_MPDVDNAV_ReadInStillActive, + __FUNCTION__); + *len=0; + return -1; + } +if (dvdnav_get_next_block(dvdnav_priv->dvdnav,buf,&eventid,len)!= + DVDNAV_STATUS_OK) { + mp_msg(MSGT_CPLAYER,MSGL_ERR, + MSGTR_MPDVDNAV_ErrorGetNextBlock, + dvdnav_err_to_string(dvdnav_priv->dvdnav) ); + *len=-1; + } + else if (eventid!=DVDNAV_BLOCK_OK) { + switch (eventid) { +#if 0 + case DVDNAV_NOP : { + event->eventflag.nop=1; + event->eventflag.isevent=1; + break; } +#endif + case DVDNAV_STILL_FRAME: { + event->eventflag.still_frame=1; + event->eventflag.isevent=1; + dvdnav_priv->stillflg=1; + dvdnav_priv->stillok=0; + dvdnav_still_event_t *still_event = (dvdnav_still_event_t*)(buf); + event->still_length=still_event->length; + unsigned int end_time=0; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: still frame (%x)\n", + event->still_length); +#endif + if (still_event->length==0x01) // FIXME: TIME HACK + { + pci_t* pnavpci = dvdnav_get_current_nav_pci( dvdnav_priv->dvdnav ); + end_time=(pnavpci->pci_gi.e_eltm.hour*3600+ + pnavpci->pci_gi.e_eltm.minute*60+ + pnavpci->pci_gi.e_eltm.second)*1000000; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) { + float et=end_time; + et=et/1000000; + mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: still wait time %8.3f sec (form pci_t) hack:(\n", + et); + } +#endif + } + if (event->still_length==0xff) { + if (dvdnav_priv->stillcounterdvdnav); + else + dvdnav_priv->stillok=1; + } else { + if (end_time==0) end_time=still_event->length*1000000; + if (!dvdnav_priv->cell_timer) { + dvdnav_priv->cell_timer = GetTimer(); + dvdnav_priv->one_cell_timer = dvdnav_priv->cell_timer; + } + unsigned int now = GetTimer(); +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) { + float pt=now-dvdnav_priv->cell_timer; + pt=pt/1000000; + float et=end_time; + et=et/1000000; + mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: remains time %8.3f sec\n", + et-pt); + } +#endif + if (now-dvdnav_priv->cell_timerdvdnav, 1); + if (dvdnav_priv->stillcounterdvdnav); + else + dvdnav_priv->stillok=1; // don't let dvdnav stall on this image + } else { + dvdnav_still_skip(dvdnav_priv->dvdnav); + dvdnav_priv->cell_timer=0; + dvdnav_priv->one_cell_timer=0;} + } + break; } + case DVDNAV_SPU_STREAM_CHANGE : { + event->eventflag.spu_stream_change=1; + event->eventflag.isevent=1; + dvdnav_spu_stream_change_event_t *spu_stream_change_event = + (dvdnav_spu_stream_change_event_t*)(buf); + event->spu_physical_wide= + spu_stream_change_event->physical_wide; + event->spu_physical_letterbox= + spu_stream_change_event->physical_letterbox; + event->spu_physical_pan_scan= + spu_stream_change_event->physical_pan_scan; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: spu stream change\n"); +#endif + break; } + case DVDNAV_AUDIO_STREAM_CHANGE : { + event->eventflag.audio_stream_change=1; + event->eventflag.isevent=1; + dvdnav_audio_stream_change_event_t *audio_stream_change_event = + (dvdnav_audio_stream_change_event_t*)(buf); + event->audio_physical= + audio_stream_change_event->physical; + event->audio_logical= + audio_stream_change_event->logical; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: audio stream change\n"); +#endif + break; } + case DVDNAV_VTS_CHANGE : { +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: vts change\n"); +#endif + event->eventflag.vts_change=1; + event->eventflag.isevent=1; + dvdnav_vts_change_event_t *vts_change_event = + (dvdnav_vts_change_event_t*)(buf); + event->vts_old_vtsN=vts_change_event->old_vtsN; + event->vts_old_domain=vts_change_event->old_domain; + event->vts_new_vtsN=vts_change_event->new_vtsN; + event->vts_new_domain=vts_change_event->new_domain; + dvdnav_get_position(dvdnav_priv->dvdnav, + &(dvdnav_priv->tpos), + &(dvdnav_priv->tlen)); + if (!dvdnav_priv->vts_domain) + dvdnav_priv->cell_timer=GetTimer(); + else + dvdnav_priv->cell_timer=0; + event->cell_really_change=1; + dvdnav_priv->one_cell_timer=dvdnav_priv->cell_timer; + dvdnav_priv->stillok=0; + dvdnav_priv->stillflg=0; + dvdnav_priv->stillcounter=0; + dvdnav_priv->waitcounter=0; + dvdnav_priv->lockstillcounter=0; + break; } + case DVDNAV_CELL_CHANGE : { + event->eventflag.cell_change=1; + event->eventflag.isevent=1; + dvdnav_cell_change_event_t *cell_change_event = + (dvdnav_cell_change_event_t*)(buf); + event->cell_cellN=cell_change_event->cellN; + event->cell_pgN=cell_change_event->pgN; + event->cell_cell_length=cell_change_event->cell_length; + event->cell_pg_length=cell_change_event->pg_length; + event->cell_pgc_length=cell_change_event->pgc_length; + event->cell_cell_start=cell_change_event->cell_start; + event->cell_pg_start=cell_change_event->pg_start; + int pgcN = 0; + dvdnav_get_pgc(dvdnav_priv->dvdnav, &pgcN); +// get dvdnav audio setting + uint8_t alang=dvdnav_get_active_audio_stream(dvdnav_priv->dvdnav); + dvdnav_priv->alang= + 128+dvdnav_get_active_audio_stream(dvdnav_priv->dvdnav); +// get dvdnav spu settings + dvdnav_priv->slang=dvdnav_get_active_spu_stream(dvdnav_priv->dvdnav); +// get dvdnav aspect settings + dvdnav_priv->aspect=dvdnav_get_video_aspect(dvdnav_priv->dvdnav); +// setting dvdnav info + dvdnav_priv->vts_domain=dvdnav_is_domain_vts(dvdnav_priv->dvdnav); + dvdnav_get_position(dvdnav_priv->dvdnav, + &(dvdnav_priv->tpos), + &(dvdnav_priv->tlen)); + dvdnav_get_number_of_titles(dvdnav_priv->dvdnav, + &(dvdnav_priv->titles_nr)); + dvdnav_priv->part=0; + dvdnav_priv->title=0; + event->cell_really_change=0; + if (dvdnav_priv->cell_cellN!=event->cell_cellN || + dvdnav_priv->cell_pgN!=event->cell_pgN || + dvdnav_priv->cell_pgcN!=pgcN) // really cell change? + { + event->cell_really_change=1; + dvdnav_priv->stillcounter=0; + dvdnav_priv->waitcounter=0; + dvdnav_priv->lockstillcounter=0; + } + if (event->cell_really_change) + { + dvdnav_priv->stillok=0; + dvdnav_priv->cell_timer=GetTimer(); + dvdnav_priv->one_cell_timer=dvdnav_priv->cell_timer; + dvdnav_priv->stillflg=0; + dvdnav_priv->stillcounter=0; + dvdnav_priv->waitcounter=0; + dvdnav_priv->lockstillcounter=0; + } + if (!(dvdnav_priv->vts_domain)) { + dvdnav_priv->chapters_nr=0; + dvdnav_priv->menu_sid= + dvdnav_get_active_spu_stream(dvdnav_priv->dvdnav); + dvdnav_priv->final_pts=0.0; + } else { + dvdnav_priv->final_pts = cell_change_event->cell_length; + dvdnav_priv->final_pts = dvdnav_priv->final_pts / 90000; + dvdnav_current_title_info(dvdnav_priv->dvdnav, + &dvdnav_priv->title, + &dvdnav_priv->part); + dvdnav_get_number_of_parts(dvdnav_priv->dvdnav, + dvdnav_priv->title, + &dvdnav_priv->chapters_nr); + event->cell_really_change=1; + + uint32_t audio_id; + audio_attr_t audio_attr; + dvdnav_priv->nr_of_channels=0; + int language; + int i; + for( i=0; i<8; i++) { + if (-1!=(audio_id=audio_id= + dvdnav_get_audio_logical_stream(dvdnav_priv->dvdnav, i))) { + dvdnav_get_audio_attr(dvdnav_priv->dvdnav, i, &audio_attr); + language=0; + if(audio_attr.lang_type==1) + language=audio_attr.lang_code; + dvdnav_priv->audio_streams[dvdnav_priv->nr_of_channels].language= + language; + dvdnav_priv->audio_streams[dvdnav_priv->nr_of_channels].id= + audio_id; + switch (audio_attr.audio_format) { + case 0: // ac3 + dvdnav_priv->audio_streams[dvdnav_priv->nr_of_channels].id+= + FIRST_AC3_AID; + break; + case 6: // dts + dvdnav_priv->audio_streams[dvdnav_priv->nr_of_channels].id+= + FIRST_DTS_AID; + break; + case 2: // mpeg layer 1/2/3 + case 3: // mpeg2 ext + dvdnav_priv->audio_streams[dvdnav_priv->nr_of_channels].id+= + FIRST_MPG_AID; + break; + case 4: // lpcm + dvdnav_priv->audio_streams[dvdnav_priv->nr_of_channels].id+= + FIRST_PCM_AID; + break; + } + dvdnav_priv->audio_streams[dvdnav_priv->nr_of_channels].type= + audio_attr.audio_format; + dvdnav_priv->audio_streams[dvdnav_priv->nr_of_channels].channels= + audio_attr.channels; + if (alang==i) dvdnav_priv->alang= + dvdnav_priv->audio_streams[dvdnav_priv->nr_of_channels].id; + dvdnav_priv->nr_of_channels++; + } + } + dvdnav_priv->nr_of_subtitles=0; + uint32_t sub_id; + subp_attr_t subp_attr; + for( i=0; i<32; i++) + { + if (-1!=(sub_id=dvdnav_get_spu_logical_stream(dvdnav_priv->dvdnav, + i))) { + dvdnav_get_spu_attr(dvdnav_priv->dvdnav, i, &subp_attr); + language=0; + if(subp_attr.type==1) language=subp_attr.lang_code; + dvdnav_priv->subtitles[dvdnav_priv->nr_of_subtitles].language= + language; + dvdnav_priv->subtitles[dvdnav_priv->nr_of_subtitles].id= + sub_id; + dvdnav_priv->nr_of_subtitles++; + } + } + } + dvdnav_priv->cell_cellN=cell_change_event->cellN; + dvdnav_priv->cell_pgN=cell_change_event->pgN; + dvdnav_priv->cell_pgcN=pgcN; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: cell change\n"); +#endif + break; } + case DVDNAV_NAV_PACKET : { + event->eventflag.nav_packet=1; + event->eventflag.isevent=1; + pci_t* pnavpci = dvdnav_get_current_nav_pci( dvdnav_priv->dvdnav ); + int buttonN; + if (pnavpci && pnavpci->hli.hl_gi.btn_ns) { + dvdnav_get_current_highlight(dvdnav_priv->dvdnav, &buttonN); /* get current button ID */ + if (buttonN==0 || buttonN > pnavpci->hli.hl_gi.btn_ns) + { + dvdnav_button_select( dvdnav_priv->dvdnav , pnavpci, 1); +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: reset menu button number\n"); +#endif + } + } +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: nav packet\n"); +#endif +#ifdef USE_MPDVDNAV_TRACE + dvdnav_print_buttons(dvdnav_priv,"highlight event"); +#endif + break; } + case DVDNAV_STOP: { + event->eventflag.stop=1; + event->eventflag.isevent=1; + dvdnav_priv->stopflg=1; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: stop\n"); +#endif + break; } + case DVDNAV_HIGHLIGHT : { + event->eventflag.highlight=1; + event->eventflag.isevent=1; + dvdnav_highlight_event_t *highlight_event = + (dvdnav_highlight_event_t*)(buf); + event->hl_display=highlight_event->display; + /* libdvdnav v0.1.10: these fields are currently not set!! */ + dvdnav_get_highlight(dvdnav_priv,highlight_event,1); + event->hl_palette=highlight_event->palette; + event->hl_sx=highlight_event->sx; + event->hl_sy=highlight_event->sy; + event->hl_ex=highlight_event->ex; + event->hl_ey=highlight_event->ey; + event->hl_pts=highlight_event->pts; + event->hl_buttonN=highlight_event->buttonN; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: highlight (%i:%i-%i:%i #%i)\n", + event->hl_sx, + event->hl_sy, + event->hl_ex, + event->hl_ey, + event->hl_buttonN); +#endif +#ifdef USE_MPDVDNAV_TRACE + dvdnav_print_buttons(dvdnav_priv,"highlight event"); +#endif + break; } + case DVDNAV_SPU_CLUT_CHANGE: { + event->eventflag.spu_clut_change=1; + event->eventflag.isevent=1; + memcpy(event->spu_clut,buf,16*sizeof(uint32_t)); + dvdnav_get_button_palette(dvdnav_priv,&(event->spu_palette)); +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: spu clut change\n"); +#endif + break; } + case DVDNAV_HOP_CHANNEL : { + event->eventflag.hop_channel=1; + event->eventflag.isevent=1; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: hop channel\n"); +#endif + break; } + case DVDNAV_WAIT: { +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: wait\n"); +#endif + event->eventflag.wait=1; + event->eventflag.isevent=1; + int flag=0; + dvdnav_is_still_cell( dvdnav_priv->dvdnav , &flag); + if (!flag && dvdnav_priv->lockseek) { + dvdnav_wait_back(dvdnav_priv->dvdnav); + break; } + if (!dvdnav_priv->vts_domain && dvdnav_priv->cell_timer && !flag) { + pci_t* pnavpci = dvdnav_get_current_nav_pci( dvdnav_priv->dvdnav ); + unsigned int end_time=(pnavpci->pci_gi.e_eltm.hour*3600+ + pnavpci->pci_gi.e_eltm.minute*60+ + pnavpci->pci_gi.e_eltm.second)*1000000; + unsigned int now = GetTimer(); + float t; + t=now-dvdnav_priv->one_cell_timer; + dvdnav_priv->one_cell_timer=now; + t=t/1000000; + float rt=end_time-(now-dvdnav_priv->cell_timer); + rt=rt/1000000; + float et=end_time; + et=et/1000000; +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, + "dvdnav: remains time %8.3f sec (%8.3f/%8.3f sec)\n", + rt,et,t); +#endif + if (t<2.00 && et>4.00) { // correct cell play time? + if (now-dvdnav_priv->cell_timerwaitcounterdvdnav); + dvdnav_priv->waitcounter++; + } + } else { + dvdnav_priv->waitcounter=0; + dvdnav_priv->cell_timer=0; + dvdnav_priv->one_cell_timer=0; + dvdnav_priv->back_from_timer=1; + dvdnav_wait_still_clear(dvdnav_priv->dvdnav); + } + } else { + dvdnav_wait_skip(dvdnav_priv->dvdnav); + dvdnav_priv->waitcounter=0; + dvdnav_priv->cell_timer=0; + dvdnav_priv->one_cell_timer=0; + } + } else { + dvdnav_wait_skip(dvdnav_priv->dvdnav); + if (!flag) { + dvdnav_priv->cell_timer=0; + dvdnav_priv->one_cell_timer=0; + dvdnav_priv->waitcounter=0; + } + } + break; + } + } + *len=0; + } +return eventid; +} + + +static int fill_buffer(stream_t *s, char *but, int len) +{ +int event; +dvdnav_priv_t* dvdnav_priv=s->priv; +len=0; +while (len==0) /* grab all event until DVDNAV_BLOCK_OK (len=2048), DVDNAV_STOP or DVDNAV_STILL_FRAME */ + { + if (-1==(event=dvdnav_stream_read(dvdnav_priv, s->buffer, &len, + &(dvdnav_priv->event))) || + len==-1) + { + mp_msg(MSGT_CPLAYER,MSGL_ERR, + "DVDNAV stream read error!\n"); + return 0; + } + switch (event) { + case DVDNAV_STOP: return len; break; /* return eof */ + case DVDNAV_STILL_FRAME: { + if (!dvdnav_priv->stillok) dvdnav_priv->stillcounter++; + dvdnav_priv->lockstillcounter++; + return len; + break; }/* return eof */ + case DVDNAV_WAIT: { + if (dvdnav_priv->waitcounter>=dvdnav_still_repeat) return len; + break; + } + } + if (dvdnav_priv->event.cell_really_change && + dvdnav_priv->started && + !dvdnav_priv->vts_domain) return len; + } +mp_msg(MSGT_STREAM,MSGL_DBG2,"DVDNAV fill_buffer len: %d\n",len); +return len; +} + +static int control(stream_t *stream,int cmd,void* arg) +{ +dvdnav_priv_t *priv = stream->priv; +switch(cmd) + { + case STREAM_CTRL_GET_TIME_LENGTH: + { + return STREAM_OK; + } + case STREAM_CTRL_LANG_FROM_SID: + { + *(int*)arg = dvdnav_lang_from_sid(priv,*(int*)arg); + return STREAM_OK; + } + case STREAM_CTRL_SID_FROM_LANG: + { + if (!arg) return STREAM_ERROR; + (*(struct dvd_idfromlang_st*)arg).id=dvdnav_sid_from_lang(priv, + (*(struct dvd_idfromlang_st*)arg).lang); + return STREAM_OK; + } + case STREAM_CTRL_AID_FROM_LANG: + { + if (!arg) return STREAM_ERROR; + (*(struct dvd_idfromlang_st*)arg).id=dvdnav_aid_from_lang(priv, + (*(struct dvd_idfromlang_st*)arg).lang); + return STREAM_OK; + } + case STREAM_CTRL_NUMBER_OF_SUBS: + { + *(int*)arg = dvdnav_number_of_subs(priv); + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_REALLYEOF: + { + if (dvdnav_reallyeof(priv)) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_EVENT_STOP: + { + if (priv->event.eventflag.stop) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_EVENT_WAIT: + { + if (priv->event.eventflag.wait) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_EVENT_STILL: + { + if (priv->event.eventflag.still_frame) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_EVENT_VTS: + { + if (priv->event.eventflag.vts_change) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_EVENT_VTS_DOMAIN: + { + if (priv->vts_domain) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_GET_AUDIO_ID: + { + if (!arg) return STREAM_ERROR; + *(int*)arg = priv->alang; + return STREAM_OK; + } + case STREAM_CTRL_GET_DVDSUB_ID: + { + if (!arg) return STREAM_ERROR; + *(int*)arg = priv->slang; + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_EVENT_CELL: + { + if (priv->event.eventflag.cell_change) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_REALLY_CHANGE: + { + if (priv->event.cell_really_change) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_TITLESET: + { + priv->lasttitle=priv->title; + priv->lastpart=priv->part; + priv->old_vts_domain=priv->vts_domain; + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_IS_NEW_TITLE: + { + if (priv->lasttitle!=priv->title) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_EVENT_SPU_CLUT: + { + if (priv->event.eventflag.spu_clut_change) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_GET_SPU_CLUT: + { + memcpy(arg,&(priv->event.spu_clut),sizeof(spu_clut_t)); + return STREAM_OK; + } + case STREAM_CTRL_GET_SPU_PALETTE: + { + if (!arg) return STREAM_ERROR; + *(uint32_t*)arg=priv->event.spu_palette; + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_EVENT_HIGHLIGHT: + { + if (priv->event.eventflag.highlight) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_EVENT_NAV_PACKET: + { + if (priv->event.eventflag.nav_packet) + return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_EVENT_CLEAR: + { + dvdnav_event_clear(priv); + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_STILLOK: + { + if (priv->stillok) return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_GET_HIGHLIGHT_SHOW: + { + if (!arg) return STREAM_ERROR; + dvdnav_highlight_event_t highlight_event; + dvdnav_get_highlight(priv,&highlight_event,1); + (*(mp_highlight_t*)arg).display=highlight_event.display; + (*(mp_highlight_t*)arg).sx=highlight_event.sx; + (*(mp_highlight_t*)arg).sy=highlight_event.sy; + (*(mp_highlight_t*)arg).ex=highlight_event.ex; + (*(mp_highlight_t*)arg).ey=highlight_event.ey; + (*(mp_highlight_t*)arg).pts=highlight_event.pts; + (*(mp_highlight_t*)arg).palette=highlight_event.palette; + (*(mp_highlight_t*)arg).buttonN=highlight_event.buttonN; + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_GET_HIGHLIGHT_ACTIVATE: + { + if (!arg) return STREAM_ERROR; + dvdnav_highlight_event_t highlight_event; + dvdnav_get_highlight(priv,&highlight_event,2); + (*(mp_highlight_t*)arg).display=highlight_event.display; + (*(mp_highlight_t*)arg).sx=highlight_event.sx; + (*(mp_highlight_t*)arg).sy=highlight_event.sy; + (*(mp_highlight_t*)arg).ex=highlight_event.ex; + (*(mp_highlight_t*)arg).ey=highlight_event.ey; + (*(mp_highlight_t*)arg).palette=highlight_event.palette; + (*(mp_highlight_t*)arg).pts=highlight_event.pts; + (*(mp_highlight_t*)arg).buttonN=highlight_event.buttonN; + return STREAM_OK; + } + case STREAM_CTRL_CHANGE_ASPECT: + { + if (priv->lastaspect!=priv->aspect) return STREAM_OK; + return STREAM_ERROR; + } + case STREAM_CTRL_GET_ASPECT: + { + if (!arg) return STREAM_ERROR; + *(int*)arg=priv->aspect; + return STREAM_OK; + } + case STREAM_CTRL_SYNC_ASPECT: + { + priv->lastaspect=priv->aspect; + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_SET_LOCKSEEK: + { + if (!arg) return STREAM_ERROR; + priv->lockseek=*(int*)arg; + return STREAM_OK; + } + case STREAM_CTRL_GET_FINALPTS: + { + if (!arg) return STREAM_ERROR; + *(float*)arg=priv->final_pts; + return STREAM_OK; + } + case STREAM_CTRL_GET_TLEN: + { + if (!arg) return STREAM_ERROR; + *(uint32_t*)arg=priv->tlen; + return STREAM_OK; + } +#ifdef HAVE_NEW_GUI + case STREAM_CTRL_DVDNAV_MOUSE: + { + dvdnav_mouse(priv); + return STREAM_OK; + } +#endif + case STREAM_CTRL_DVDNAV_TITLE_PLAY: + { + if (!arg) return STREAM_ERROR; + dvdnav_title_play(priv->dvdnav,*(int32_t*)arg); + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_PART_PLAY: + { + if (!arg) return STREAM_ERROR; + dvdnav_part_play(priv->dvdnav,priv->title,*(int32_t*)arg); + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_MENUCALL: + { + if (!arg) return STREAM_ERROR; + switch (*(int*)arg) { + case DVD_MENUCALL_Escape: { + dvdnav_menu_call(priv->dvdnav,DVD_MENU_Escape); + return STREAM_OK;} + case DVD_MENUCALL_Title: { + dvdnav_menu_call(priv->dvdnav,DVD_MENU_Title); + return STREAM_OK;} + case DVD_MENUCALL_Root: { + dvdnav_menu_call(priv->dvdnav,DVD_MENU_Root); + return STREAM_OK;} + case DVD_MENUCALL_Subpicture: { + dvdnav_menu_call(priv->dvdnav,DVD_MENU_Subpicture); + return STREAM_OK;} + case DVD_MENUCALL_Audio: { + dvdnav_menu_call(priv->dvdnav,DVD_MENU_Audio); + return STREAM_OK;} + case DVD_MENUCALL_Angle: { + dvdnav_menu_call(priv->dvdnav,DVD_MENU_Angle); + return STREAM_OK;} + case DVD_MENUCALL_Part: { + dvdnav_menu_call(priv->dvdnav,DVD_MENU_Part); + return STREAM_OK;} + } + return STREAM_ERROR; + } + case STREAM_CTRL_DVDNAV_MENUFORCE: + { + dvdnav_menu_force(priv); + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_MENU_ACTION: + { + if (!arg) return STREAM_ERROR; + dvdnav_menu_action(priv,*(int*)arg); + return STREAM_OK; + } + case STREAM_CTRL_FULL_START: + { + dvdnav_stream_fullstart(priv); + return STREAM_OK; + } + case STREAM_CTRL_SET_ALANG: + { + if (!arg) return STREAM_ERROR; + if (!*(char**)arg) return STREAM_ERROR; + if (dvdnav_audio_language_select(priv->dvdnav, *(char**)arg ) != + DVDNAV_STATUS_OK) { /* FIXME: don't work! */ + mp_msg(MSGT_FIXME, MSGL_FIXME, "Error on setting spu languages: %s\n", + dvdnav_err_to_string(priv->dvdnav)); + return STREAM_ERROR; + } + return STREAM_OK; + } + case STREAM_CTRL_SET_SLANG: + { + if (!arg) return STREAM_ERROR; + if (!*(char**)arg) return STREAM_ERROR; + if (dvdnav_spu_language_select(priv->dvdnav, *(char**)arg ) != + DVDNAV_STATUS_OK) { /* FIXME: don't work! */ + mp_msg(MSGT_FIXME, MSGL_FIXME, "Error on setting spu languages: %s\n", + dvdnav_err_to_string(priv->dvdnav)); + return STREAM_ERROR; + } + return STREAM_OK; + } + case STREAM_CTRL_SET_MLANG: + { + if (!arg) return STREAM_ERROR; + if (!*(char**)arg) return STREAM_ERROR; + if (dvdnav_menu_language_select(priv->dvdnav, *(char**)arg ) != + DVDNAV_STATUS_OK) { /* FIXME: don't work! */ + mp_msg(MSGT_FIXME, MSGL_FIXME, "Error on setting spu languages: %s\n", + dvdnav_err_to_string(priv->dvdnav)); + return STREAM_ERROR; + } + return STREAM_OK; + } + case STREAM_CTRL_DVDNAV_GET_MENU_SID: + { + if (!arg) return STREAM_ERROR; + *(int*)arg=priv->menu_sid; + return STREAM_OK; + } + case STREAM_CTRL_GET_PALETTE: + { + if (!arg) return STREAM_ERROR; + *(unsigned int*)arg=dvdnav_stream_get_palette(priv);; + return STREAM_OK; + } + + } +return STREAM_UNSUPORTED; +} + + +dvdnav_priv_t * new_dvdnav_stream(char * filename, uint32_t titlenum) +{ +char * title_str; +dvdnav_priv_t *dvdnav_priv; +if (!filename) return NULL; +if (!(dvdnav_priv=(dvdnav_priv_t*)calloc(1,sizeof(*dvdnav_priv)))) return NULL; +if (!(dvdnav_priv->filename=strdup(filename))) + { + free(dvdnav_priv); + return NULL; + } +if(dvdnav_open(&(dvdnav_priv->dvdnav),dvdnav_priv->filename)!= + DVDNAV_STATUS_OK) + { + free(dvdnav_priv->filename); + free(dvdnav_priv); + return NULL; + } +if (!dvdnav_priv->dvdnav) + { + free(dvdnav_priv); + return NULL; + } +/* turn on dvdnav caching */ +dvdnav_set_readahead_flag(dvdnav_priv->dvdnav,0); +/* report the title?! */ +if (dvdmenu_lang) // menu + { + if (dvdnav_menu_language_select(dvdnav_priv->dvdnav, dvdmenu_lang ) != + DVDNAV_STATUS_OK) + mp_msg(MSGT_FIXME, MSGL_FIXME, + "Error on setting menu languages: %s\n", + dvdnav_err_to_string(dvdnav_priv->dvdnav)); + } +/* use title time length (default: part time length) */ +if (dvdnav_set_PGC_positioning_flag(dvdnav_priv->dvdnav, 1) != + DVDNAV_STATUS_OK) + mp_msg(MSGT_FIXME, MSGL_FIXME, + "Error on setting pgc based: %s\n", + dvdnav_err_to_string(dvdnav_priv->dvdnav)); +dvdnav_event_clear(dvdnav_priv); +if (titlenum>0) dvdnav_go_title=titlenum; +dvdnav_priv->lastaspect=-1; +return dvdnav_priv; +} + +void free_dvdnav_stream(dvdnav_priv_t * dvdnav_priv) +{ +if (!dvdnav_priv) return; +dvdnav_close(dvdnav_priv->dvdnav); +dvdnav_priv->dvdnav=NULL; +free(dvdnav_priv); +} + + +static int open_s(stream_t *stream,int mode, void* opts, int* file_format) +{ +struct stream_priv_s* p = (struct stream_priv_s*)opts; +char *filename, *name; +int event,len,tmplen=0; +dvdnav_priv_t *dvdnav_priv; + +mp_msg(MSGT_OPEN,MSGL_INFO,"URL: %s\n", filename); +filename = strdup(stream->url); +name = (filename[9] == '\0') ? NULL : filename + 9; +uint32_t titlenum=0; +if (name) titlenum=atoi(name); /* eg. mplayer dvdnav://1 */ +if (dvd_device) + { + if(!(dvdnav_priv=new_dvdnav_stream(dvd_device,titlenum))) + { + mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenDVD,dvd_device); + return STREAM_UNSUPORTED; + } + } else { + if(!(dvdnav_priv=new_dvdnav_stream(DEFAULT_DVD_DEVICE,titlenum))) + { + mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenDVD,dvd_device); + return STREAM_UNSUPORTED; + } + } +stream->sector_size = 2048; +stream->flags = STREAM_READ | STREAM_SEEK; +stream->fill_buffer = fill_buffer; +stream->seek = seek; +stream->control = control; +stream->close = stream_dvdnav_close; +stream->type = STREAMTYPE_DVDNAV; +stream->priv=(void*)dvdnav_priv; +return STREAM_OK; +} + +stream_info_t stream_info_dvdnav = { + "DVDNAV stream", + "dvdnav", + "Otvos Attila", + "", + open_s, + { "dvdnav", NULL }, + &stream_opts, + 1 // Urls are an option string +}; + +#endif // #ifdef USE_MPDVDNAV diff -Nur a/libmpdemux/stream_dvdnav.h b/libmpdemux/stream_dvdnav.h --- a/libmpdemux/stream_dvdnav.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdemux/stream_dvdnav.h 2006-06-12 22:27:44.000000000 +0300 @@ -0,0 +1,262 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: dvdnav.h,v 1.31 2003/06/09 15:17:44 mroi Exp $ + * + */ + +#ifndef __STREAM_DVDNAV_H_ + +#ifdef USE_MPDVDNAV // enable dvdnav support? + +#define __STREAM_DVDNAV_H_ + +#ifdef USE_DVDREAD + +#ifdef USE_MPDVDKIT +#if (USE_MPDVDKIT == 2) +#include "libmpdvdkit2/dvd_input.h" +#include "libmpdvdkit2/dvd_reader.h" +#include "libmpdvdkit2/ifo_types.h" +#include "libmpdvdkit2/ifo_read.h" +#include "libmpdvdkit2/nav_read.h" +#else +#include "libmpdvdkit/dvd_input.h" +#include "libmpdvdkit/dvd_reader.h" +#include "libmpdvdkit/ifo_types.h" +#include "libmpdvdkit/ifo_read.h" +#include "libmpdvdkit/nav_read.h" +#endif +#else +#include +#include +#include +#include +#include +#endif + +#include "libmpdvdnav/dvdnav.h" + +#if 0 +extern int dvd_nav_skip_opening; +extern int dvd_nav_still; +extern int dvdnav_menutype; /* dvdnav menu type: 0-SPU, 1-BOX, 2-SPU&BOX */ +extern int dvdnav_continue_play; +extern int dvdnav_go_title; /* dvdnav_title_play */ +extern int dvdnav_go_part; /* dvdnav_part_play */ +extern int dvdnav_go_menu; /* call main menu */ +extern int dvdnav_go_menu_force; /* call force main menu with skip intro*/ +extern int dvdnav_go_audio; /* dvdnav set new audio stream */ +extern int dvdnav_go_spu; /* dbdnav set new spu stream */ +extern int dvdnav_force_menu; /* force display menu with simple box */ +extern int dvdnav_skipintro; /* skip intro before dvd menu */ +extern int dvdnav_color_spu; /* enable color spu buttons */ +extern int dvdnav_still_repeat; /* still pgc repeat count */ +#ifdef USE_MPDVDNAV_TRACE +extern int dvdnav_trace; /* print trace messages (only devel)*/ +#endif +extern char* dvdmenu_lang; /* nav menu language */ + +#ifdef HAVE_NEW_GUI +extern int dvdnav_window_width; +extern int dvdnav_window_height; +extern int dvdnav_window_orig_width; +extern int dvdnav_window_orig_height; +extern int dvdnav_mouse_x; +extern int dvdnav_mouse_y; +extern int dvdnav_mouse_button; +extern int dvdnav_mouse_set; +#endif + +// dvdnav menu button types +#define DVDNAV_MENUTYPE_SPU 0 +#define DVDNAV_MENUTYPE_BOX 1 +#define DVDNAV_MENUTYPE_SPU_BOX 2 +#endif + +#define DVDNAV_MAX_STILL_FRAME 5 + +#undef max +#define max(x,y) ((x) > (y) ? (x) : (y)) +#undef min +#define min(x,y) ((x) < (y) ? (x) : (y)) + +typedef struct { + int event; /* event number fromd dvdnav_events.h */ + void * details; /* event details */ + int len; /* bytes in details */ +} dvdnav_event_t; + + +typedef struct stream_dvdnav_event_flg_st { + unsigned int nop : 1; // 1 + unsigned int still_frame : 1; // 2 + unsigned int spu_stream_change : 1; // 3 + unsigned int audio_stream_change : 1; // 4 + unsigned int vts_change : 1; // 5 + unsigned int cell_change : 1; // 6 + unsigned int nav_packet : 1; // 7 + unsigned int stop : 1; // 8 + unsigned int highlight : 1; // 9 + unsigned int spu_clut_change : 1; // 10 + unsigned int none1 : 1; + unsigned int hop_channel : 1; // 12 + unsigned int wait : 1; // 13 + unsigned int none2 : 2; + unsigned int isevent : 1; +} stream_dvdnav_event_flg_t; + + +typedef struct stream_dvdnav_event_st { +stream_dvdnav_event_flg_t eventflag; +off_t eventid; +// store dvdnav event parameters +// DVDNAV_STILL_FRAME +int still_length; +// DVDNAV_SPU_STREAM_CHANGE +int spu_physical_wide; +int spu_physical_letterbox; +int spu_physical_pan_scan; +// DVDNAV_AUDIO_STREAM_CHANGE +int audio_physical; +int audio_logical; +// DVDNAV_VTS_CHANGE +int vts_old_vtsN; +dvd_read_domain_t vts_old_domain; +int vts_new_vtsN; +dvd_read_domain_t vts_new_domain; +// DVDNAV_CELL_CHANGE +int cell_cellN; +int cell_pgN; +int64_t cell_cell_length; +int64_t cell_pg_length; +int64_t cell_pgc_length; +int64_t cell_cell_start; +int64_t cell_pg_start; +int cell_really_change; +// DVDNAV_HIGHLIGHT +int hl_display; +uint32_t hl_palette; +uint16_t hl_sx,hl_sy,hl_ex,hl_ey; +uint32_t hl_pts; +uint32_t hl_buttonN; +// DVDNAV_SPU_CLUT_CHANGE +uint32_t spu_clut[16]; +uint32_t spu_palette; +} stream_dvdnav_event_t; + + + +typedef struct { + int id; // 0 - 31 mpeg; 128 - 159 ac3; 160 - 191 pcm + int language; + int type; + int channels; +} nstream_language_t; + +typedef struct { + dvdnav_t *dvdnav; /* libdvdnav handle */ + char *filename; + int started; /* libdvdnav start */ + int stopflg; /* libdvdnav stop event */ + int vts_domain; /* is vts domain flag */ + int old_vts_domain; /* old vts domain flag */ + uint32_t tpos; /* title pos */ + uint32_t tlen; /* title length */ + float final_pts; /* playback time */ + + int32_t title; /* current title number */ + int32_t part; /* current chapter number */ + int32_t lasttitle; /* last title number */ + int32_t lastpart; /* last chapter number */ + + uint8_t alang; /* current audio language */ + uint8_t slang; /* current spu language */ + uint8_t menu_sid; /* current menu spu stream id */ + uint8_t aspect; /* current video aspect */ + uint8_t lastaspect; /* last aspect */ + uint32_t titles_nr; /* number of titles */ + uint32_t chapters_nr; /* number of chapters in actual title */ + int nr_of_channels; /* number of audio channels */ + nstream_language_t audio_streams[32]; /* audio properties */ + int nr_of_subtitles; /* number of subtitles */ + nstream_language_t subtitles[32]; /* subtitles properties */ + stream_dvdnav_event_t event; /* dvdnav event storage st/ructure */ + int stillflg; /* still frame mode */ + int stillcounter; + int waitcounter; + int lockstillcounter; + int lockseek; /* disable seek sector */ + int stillok; + unsigned int cell_timer; /* pgc cell timer */ + unsigned int one_cell_timer; /* pgc only one cell timer */ + int back_from_timer; /* if back from timer then nav_demux_seek required */ + + int cell_cellN; /* last cellN */ + int cell_pgN; /* last pgN */ + int cell_pgcN; /* last pgcN */ + int lock_pgN; /* lock pgN */ + int lock_pgcN; /* lock pgcN */ +} dvdnav_priv_t; + +// open new dvdnav stream +dvdnav_priv_t * new_dvdnav_stream(char * filename, uint32_t titlenum); +// read dvdnav block or event +int dvdnav_stream_read(dvdnav_priv_t * dvdnav_priv, unsigned char *buf, + int *len,stream_dvdnav_event_t *event); +// clear all stored event +void dvdnav_event_clear(dvdnav_priv_t * dvdnav_priv); +// close and free dvdnav +void free_dvdnav_stream(dvdnav_priv_t * dvdnav_priv); +// get palette +unsigned int * dvdnav_stream_get_palette(dvdnav_priv_t * dvdnav_priv); +// call menu action UP,DOWN,LEFT,RIGHT,ACTIVATE & MENU +int dvdnav_menu_action(dvdnav_priv_t * dvdnav_priv, int action); +// go main menu with skip intro +int dvdnav_menu_force(dvdnav_priv_t * dvdnav_priv); +void dvdnav_stream_fullstart(dvdnav_priv_t *dvdnav_priv); +// is dvdnav stop event? +int dvdnav_reallyeof(dvdnav_priv_t * dvdnav_priv); +// set languages +void dvdnav_set_language(dvdnav_priv_t *dvdnav_priv, char* alang, + char *slang, char *mlang); +// get lang sid +int dvdnav_lang_from_sid(dvdnav_priv_t * dvdnav_priv, int id); +// get lang sid +int dvdnav_sid_from_lang(dvdnav_priv_t * dvdnav_priv, unsigned char* lang); +// get audio sid +int dvdnav_aid_from_lang(dvdnav_priv_t * dvdnav_priv, unsigned char* lang); +// get subtitles number +int dvdnav_number_of_subs(dvdnav_priv_t * dvdnav_priv); +// get highlight properties +void dvdnav_get_highlight(dvdnav_priv_t *dvdnav_priv, + dvdnav_highlight_event_t *highlight_event, + int display_mode); +// show menu button (dvdnav-trace) +void dvdnav_print_buttons(dvdnav_priv_t *dvdnav_priv,char* txt); +// get current button palette +void dvdnav_get_button_palette(dvdnav_priv_t *dvdnav_priv,uint32_t *palette); +#ifdef HAVE_NEW_GUI +// hadler gmplayer mouse +void dvdnav_mouse(dvdnav_priv_t * dvdnav_priv); +#endif // HAVE_NEW_GUI +#endif // USE_DVDREAD + +#endif // USE_MPDVDNAV +#endif // __STREAM_DVDNAV_H_ diff -Nur a/libmpdvdnav/Makefile b/libmpdvdnav/Makefile --- a/libmpdvdnav/Makefile 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/Makefile 2006-04-05 17:03:10.000000000 +0300 @@ -0,0 +1,84 @@ + +include ../config.mak + +SRCS = decoder.c \ + dvdnav.c \ + highlight.c \ + navigation.c \ + read_cache.c \ + remap.c \ + searching.c \ + settings.c \ + vm.c \ + vmcmd.c + +OBJS = $(SRCS:.c=.o) + +LIB=libmpdvdnav + +.SUFFIXES: .c .o + +ifeq ($(OPTFLAGS),) +OPTFLAGS = -mcpu=pentium -march=pentium -O4 +else +OPTFLAGS += -DHAVE_MPLAYER +endif + +# \ -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + +# -funroll-loops removed, triggered gcc 3.0.4 (3.x?) bug +CFLAGS= -I. -I.. $(OPTFLAGS) $(EXTRA_INC)\ + -DSYS_LINUX -D__USE_UNIX98 -D_REENTRANT -D_GNU_SOURCE \ + -DHAVE_DVDCSS_DVDCSS_H -DSTDC_HEADERS -DHAVE_LIMITS_H \ + -DHAVE_ERRNO_H -DHAVE_INTTYPES_H -DHAVE_UNISTD_H \ + -DHAVE_CONFIG_H \ + +ifeq ($(TARGET_OS),CYGWIN) +CFLAGS+=-DSYS_CYGWIN +endif + +ifeq ($(TARGET_OS),Darwin) +CFLAGS+=-D__DARWIN__ +endif + +INCLUDE = -I.. -I../loader $(CSS_INC) $(EXTRA_INC) $(LIBAV_INC) +ifeq ($(DVDKIT2),yes) +INCLUDE += -I../libmpdvdkit2 -I../../libmpdvdkit2 +else +ifeq ($(DVDKIT),yes) +INCLUDE += -I../libmpdvdkit -I../../libmpdvdkit +endif +endif + +.c.o: + $(CC) $(CFLAGS) -c -o $@ $< + +all: $(LIB).a +default: $(LIB).a + +$(LIB).a: $(OBJS) + $(AR) rc $(LIB).a $(OBJS) + $(RANLIB) $(LIB).a + +$(LIB).so: $(OBJS) + $(CC) -o $(LIB).so -shared -rdynamic $(OBJS) + +clean: + rm -f *.o *.a *~ *.so + +distclean: clean + rm -f .depend + +dep: depend + +depend: .depend + +.depend: Makefile config.h + $(CC) -MM $(CFLAGS) $(SRCS) 1>.depend + +# +# include dependency files if they exist +# +ifneq ($(wildcard .depend),) +include .depend +endif diff -Nur a/libmpdvdnav/config.h b/libmpdvdnav/config.h --- a/libmpdvdnav/config.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/config.h 2006-04-05 17:03:09.000000000 +0300 @@ -0,0 +1,2 @@ +/* Let it be for now*/ +#include "../config.h" diff -Nur a/libmpdvdnav/decoder.c b/libmpdvdnav/decoder.c --- a/libmpdvdnav/decoder.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/decoder.c 2006-04-05 17:03:09.000000000 +0300 @@ -0,0 +1,816 @@ +/* + * Copyright (C) 2000, 2001 Martin Norbäck, Håkan 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: decoder.c,v 1.2 2004/03/03 16:50:42 mroi Exp $ + * + */ + +#ifndef HAVE_MPLAYER +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#else +#include "config.h" +#endif + +#include +#include +#include +#include /* For memset */ + +#ifdef USE_MPDVDKIT +#if (USE_MPDVDKIT == 2) +#include "libmpdvdkit2/dvd_input.h" +#include "libmpdvdkit2/dvd_reader.h" +#include "libmpdvdkit2/ifo_types.h" +#include "libmpdvdkit2/ifo_read.h" +#include "libmpdvdkit2/nav_read.h" +#else +#include "libmpdvdkit/dvd_input.h" +#include "libmpdvdkit/dvd_reader.h" +#include "libmpdvdkit/ifo_types.h" +#include "libmpdvdkit/ifo_read.h" +#include "libmpdvdkit/nav_read.h" +#endif +#else +#include +#include +#include +#include +#include +#endif + +#include "dvdnav_internal.h" + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif + +#ifdef USE_MPDVDNAV_TRACE +extern int dvdnav_trace; +#endif + +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) ) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_BadCallToVMGetbits); + 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 */ + /* mp_msg(MSGT_FIXME,MSGL_FIXME, "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 */ + /* mp_msg(MSGT_FIXME,MSGL_FIXME, "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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_SuspectedRCERegionProtection); + } + 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; + } + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_EvalCompareInvalidComparisonCode); + 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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_UnknownInstrution); + 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 */ + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_WarningUnknownComman, vm_getbits(&command, 63, 3)); + abort(); + } + /* Check if there are bits not yet examined */ + + if(command.instruction & ~ command.examined) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_DecoderCWarningUnknownBits); + mp_msg(MSGT_CPLAYER,MSGL_INFO," %08llx", (command.instruction & ~ command.examined) ); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "]\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 USE_MPDVDNAV_TRACE + /* DEBUG */ + if (dvdnav_trace) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: Registers before transaction\n"); + vm_print_registers( registers ); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: Full list of commands to execute\n"); + for(i = 0; i < num_commands; i++) + vm_print_cmd(i, &commands[i]); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: --------------------------------------------\n"); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: Single stepping commands\n");} +#endif + + i = 0; + while(i < num_commands && total < 100000) { + int32_t line; + +#ifdef TRACE + if (dvdnav_trace) vm_print_cmd(i, &commands[i]); +#endif + + line = eval_command(&commands[i].bytes[0], registers, return_values); + + if (line < 0) { /* Link command */ +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: Registers after transaction\n"); + vm_print_registers( registers ); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: Registers after transaction\n"); + vm_print_registers( registers ); } +#endif + return 0; +} + +#ifdef USE_MPDVDNAV_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: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_DecoderCButton, cmd, value.data1); + break; + case LinkPGCN: + case JumpTT: + case JumpVTS_TT: + case JumpSS_VMGM_MENU: /* == 2 -> Title Menu */ + case JumpSS_VMGM_PGC: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: %s %d\n", cmd, value.data1); + break; + case LinkPTTN: + case LinkPGN: + case LinkCN: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_DecoderCButton2, cmd, value.data1, value.data2); + break; + case Exit: + case JumpSS_FP: + case PlayThis: /* Humm.. should we have this at all.. */ + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: %s\n", cmd); + break; + case JumpVTS_PTT: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: %s %d:%d\n", cmd, value.data1, value.data2); + break; + case JumpSS_VTSM: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_DecoderCVtsTitleMenu, + cmd, value.data1, value.data2, value.data3); + break; + case CallSS_FP: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_DecoderCResumeCell, cmd, value.data1); + break; + case CallSS_VMGM_MENU: /* == 2 -> Title Menu */ + case CallSS_VTSM: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_DecoderCResumeCell2, cmd, value.data1, value.data2); + break; + case CallSS_VMGM_PGC: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_DecoderCResumeCell2, cmd, value.data1, value.data2); + break; + } + } + +void vm_print_registers( registers_t *registers ) { + int32_t i; + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: # "); + for(i = 0; i < 24; i++) + mp_msg(MSGT_CPLAYER,MSGL_INFO, " %2d |", i); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "\nlibdvdnav: SRPMS: "); + for(i = 0; i < 24; i++) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%04x|", registers->SPRM[i]); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "\nlibdvdnav: GRPMS: "); + for(i = 0; i < 16; i++) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%04x|", get_GPRM(registers, i) ); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "\nlibdvdnav: Gmode: "); + for(i = 0; i < 16; i++) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%04x|", registers->GPRM_mode[i]); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "\nlibdvdnav: Gtime: "); + for(i = 0; i < 16; i++) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%04lx|", registers->GPRM_time[i].tv_sec & 0xffff); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "\n"); +} + +#endif + diff -Nur a/libmpdvdnav/decoder.h b/libmpdvdnav/decoder.h --- a/libmpdvdnav/decoder.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/decoder.h 2006-04-05 17:03:09.000000000 +0300 @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2000, 2001 Martin Norbäck, Håkan 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: decoder.h,v 1.1 2004/01/11 21:43:13 mroi Exp $ + * + */ + +#ifndef DECODER_H_INCLUDED +#define DECODER_H_INCLUDED + +#include +#include + +#ifdef USE_MPDVDKIT +#if (USE_MPDVDKIT == 2) +#include "libmpdvdkit2/dvd_input.h" +#include "libmpdvdkit2/dvd_reader.h" +#include "libmpdvdkit2/ifo_types.h" +#include "libmpdvdkit2/ifo_read.h" +#include "libmpdvdkit2/nav_read.h" +#else +#include "libmpdvdkit/dvd_input.h" +#include "libmpdvdkit/dvd_reader.h" +#include "libmpdvdkit/ifo_types.h" +#include "libmpdvdkit/ifo_read.h" +#include "libmpdvdkit/nav_read.h" +#endif +#else +#include +#include +#include +#include +#include +#endif +#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 USE_MPDVDNAV_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 -Nur a/libmpdvdnav/dvd_types.h b/libmpdvdnav/dvd_types.h --- a/libmpdvdnav/dvd_types.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/dvd_types.h 2006-04-05 17:03:09.000000000 +0300 @@ -0,0 +1,281 @@ +/* + * Copyright (C) 2000, 2001 Björn Englund, Håkan 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: dvd_types.h,v 1.7 2003/04/21 13:18:06 mroi Exp $ + * + */ + +/* + * Various useful structs and enums for DVDs. + */ + +#ifndef DVD_H_INCLUDED +#define DVD_H_INCLUDED + +#include + + +/* + * 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 -Nur a/libmpdvdnav/dvdnav.c b/libmpdvdnav/dvdnav.c --- a/libmpdvdnav/dvdnav.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/dvdnav.c 2006-04-05 17:03:09.000000000 +0300 @@ -0,0 +1,1156 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: dvdnav.c,v 1.63 2004/01/31 17:12:58 jcdutton Exp $ + * + */ + +#ifndef HAVE_MPLAYER +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#else +#include "config.h" +#endif + +/* +#define LOG_DEBUG +*/ + +#include "dvdnav_internal.h" +#include "read_cache.h" +#ifdef USE_MPDVDKIT +#if (USE_MPDVDKIT == 2) +#include "libmpdvdkit2/dvd_input.h" +#include "libmpdvdkit2/dvd_reader.h" +#include "libmpdvdkit2/ifo_types.h" +#include "libmpdvdkit2/ifo_read.h" +#include "libmpdvdkit2/nav_read.h" +#else +#include "libmpdvdkit/dvd_input.h" +#include "libmpdvdkit/dvd_reader.h" +#include "libmpdvdkit/ifo_types.h" +#include "libmpdvdkit/ifo_read.h" +#include "libmpdvdkit/nav_read.h" +#endif +#else +#include +#include +#include +#include +#include +#endif + +#include +#include +#include + +#include "remap.h" + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif + +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) { + dvdnav_t *this; + struct timeval time; + + /* Create a new structure */ + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_Using, DVDNAVSVERSION); + + (*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(MSGTR_LIBMPDVDNAV_Err_ErrorInitialisingTheDVDVM); + pthread_mutex_destroy(&this->vm_lock); + free(this); + return DVDNAV_STATUS_ERR; + } + if(!vm_reset(this->vm, path)) { + printerr(MSGTR_LIBMPDVDNAV_Err_ErrorStartingTheVM); + 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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: close:called\n"); +#endif + + if(!this) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + if (this->file) { + DVDCloseFile(this->file); +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: reset:called\n"); +#endif + + if(!this) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: reseting vm\n"); +#endif + if(!vm_reset(this->vm, NULL)) { + printerr(MSGTR_LIBMPDVDNAV_Err_ErrorRestartingTheVM); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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 */ +static 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)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_Demux_error,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; + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: nav packet=%u\n",p-p_start-6); + for(i=0;i<80;i++) + mp_msg(MSGT_FIXME,MSGL_FIXME, "%02x ",p[i-6]); + mp_msg(MSGT_FIXME,MSGL_FIXME, "\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)) { + mp_msg(MSGT_FIXME,MSGL_FIXME, "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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + + if(!this->started) { + /* Start the VM */ + vm_start(this->vm); + 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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: POS-NEXT "); + vm_position_print(this->vm, &this->position_next); + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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(MSGTR_LIBMPDVDNAV_Err_ErrorReadingNAVPacket); + 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(MSGTR_LIBMPDVDNAV_Err_ExpectedNAVPacketButNoneFound); + 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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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(MSGTR_LIBMPDVDNAV_Err_UnknownDomainWhenChangingVTS); + 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) { + snprintf(this->err_str,MAX_ERR_LEN,MSGTR_LIBMPDVDNAV_ErrorOpeningVtsDomain, 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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: SPU_STREAM_CHANGE stream_id_wide=%d\n",stream_change->physical_wide); + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: SPU_STREAM_CHANGE stream_id_letterbox=%d\n",stream_change->physical_letterbox); + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: SPU_STREAM_CHANGE stream_id_pan_scan=%d\n",stream_change->physical_pan_scan); +#endif + if (stream_change->physical_wide != -1 && + stream_change->physical_letterbox != -1 && + stream_change->physical_pan_scan != -1) { +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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(MSGTR_LIBMPDVDNAV_Err_ErrorReadingNAVPacket); + 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(MSGTR_LIBMPDVDNAV_Err_ExpectedNAVPacketButNoneFound); + 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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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(MSGTR_LIBMPDVDNAV_Err_AttemptingToReadWithoutOpeningFile); + 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(MSGTR_LIBMPDVDNAV_Err_ErrorReadingFromDVD); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return -1; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return -1; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return -1; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return -1; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return -1; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + 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; +} + +#ifdef USE_MPDVDNAV +dvdnav_status_t dvdnav_get_audio_attr(dvdnav_t *this, uint8_t audio_num, audio_attr_t *audio_attr) { + if(!this || !audio_attr) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + pthread_mutex_unlock(&this->vm_lock); + return -1; + } + *audio_attr=vm_get_audio_attr(this->vm, audio_num); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} +#endif + +int8_t dvdnav_get_spu_logical_stream(dvdnav_t *this, uint8_t subp_num) { + int8_t retval; + + if(!this) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return -1; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + 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; +} + +#ifdef USE_MPDVDNAV +dvdnav_status_t dvdnav_get_spu_attr(dvdnav_t *this, uint8_t audio_num, subp_attr_t *subp_attr) { + if(!this || !subp_attr) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + pthread_mutex_unlock(&this->vm_lock); + return -1; + } + *subp_attr=vm_get_subp_attr(this->vm, audio_num); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} +#endif + +int8_t dvdnav_get_active_audio_stream(dvdnav_t *this) { + int8_t retval; + + if(!this) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return -1; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return -1; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + return -1; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return -1; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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(MSGTR_LIBMPDVDNAV_Err_PassedAnInvalidAngleNumber); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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 -Nur a/libmpdvdnav/dvdnav.h b/libmpdvdnav/dvdnav.h --- a/libmpdvdnav/dvdnav.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/dvdnav.h 2006-04-05 17:03:09.000000000 +0300 @@ -0,0 +1,692 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: dvdnav.h,v 1.31 2003/06/09 15:17:44 mroi 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 + +#ifdef USE_MPDVDKIT +#if (USE_MPDVDKIT == 2) +#include "libmpdvdkit2/dvd_input.h" +#include "libmpdvdkit2/dvd_reader.h" +#include "libmpdvdkit2/ifo_types.h" +#include "libmpdvdkit2/ifo_read.h" +#include "libmpdvdkit2/nav_read.h" +#else +#include "libmpdvdkit/dvd_input.h" +#include "libmpdvdkit/dvd_reader.h" +#include "libmpdvdkit/ifo_types.h" +#include "libmpdvdkit/ifo_read.h" +#include "libmpdvdkit/nav_read.h" +#endif +#else +#include +#include +#include +#include +#include +#endif + +#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); + +/* + * 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); + + +/********************************************************************* + * 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); + +#ifdef USE_MPDVDNAV +/* + * If we are currently in a still-frame this function repeat it. + * + * See also the DVDNAV_STILL_FRAME event. + */ +dvdnav_status_t dvdnav_still_back(dvdnav_t *self); +/* + * Clear wait flags and repeat current cell. + */ +dvdnav_status_t dvdnav_wait_back(dvdnav_t *self); +/* + * Clear wait & still flags + */ +dvdnav_status_t dvdnav_wait_still_clear(dvdnav_t *self); +/* + * Wheather the still event will be in the current cell? + */ +dvdnav_status_t dvdnav_is_still_cell(dvdnav_t *self, int *flag); +#endif + +/* + * 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); + +#ifdef USE_MPDVDNAV +/* + * Get current PGC number + */ +dvdnav_status_t dvdnav_get_pgc(dvdnav_t *self, int *pg_num); +#endif + +/********************************************************************* + * 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); + +#ifdef USE_MPDVDNAV +/* + * Enable & disable auto action mode + */ +dvdnav_status_t dvdnav_button_select_auto_action(dvdnav_t *self, int mode); +#endif +/* + * 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); + +#ifdef USE_MPDVDNAV +dvdnav_status_t dvdnav_get_audio_attr(dvdnav_t *self, uint8_t audio_mum, audio_attr_t *audio_attr); + +int8_t dvdnav_get_active_audio_stream(dvdnav_t *self); +#endif + +/* + * 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); + +#ifdef USE_MPDVDNAV +dvdnav_status_t dvdnav_get_spu_attr(dvdnav_t *self, uint8_t audio_mum, subp_attr_t *subp_attr); + +int8_t dvdnav_get_active_spu_stream(dvdnav_t *self); +#endif + +/* + * 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 -Nur a/libmpdvdnav/dvdnav_events.h b/libmpdvdnav/dvdnav_events.h --- a/libmpdvdnav/dvdnav_events.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/dvdnav_events.h 2006-04-05 17:03:09.000000000 +0300 @@ -0,0 +1,262 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: dvdnav_events.h,v 1.12 2003/04/27 01:26:18 jcdutton Exp $ + * + */ + +/* + * This header defines events and event types + */ + +#ifndef DVDNAV_EVENTS_H_INCLUDED +#define DVDNAV_EVENTS_H_INCLUDED + +#ifdef USE_MPDVDKIT +#if (USE_MPDVDKIT == 2) +#include "libmpdvdkit2/dvd_input.h" +#include "libmpdvdkit2/dvd_reader.h" +#include "libmpdvdkit2/ifo_types.h" +#include "libmpdvdkit2/ifo_read.h" +#include "libmpdvdkit2/nav_read.h" +#else +#include "libmpdvdkit/dvd_input.h" +#include "libmpdvdkit/dvd_reader.h" +#include "libmpdvdkit/ifo_types.h" +#include "libmpdvdkit/ifo_read.h" +#include "libmpdvdkit/nav_read.h" +#endif +#else +#include +#include +#include +#include +#include +#endif + + +/* + * 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 -Nur a/libmpdvdnav/dvdnav_internal.h b/libmpdvdnav/dvdnav_internal.h --- a/libmpdvdnav/dvdnav_internal.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/dvdnav_internal.h 2006-04-05 17:03:09.000000000 +0300 @@ -0,0 +1,201 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: dvdnav_internal.h,v 1.12 2004/02/13 19:16:17 mroi Exp $ + * + */ + +#ifndef DVDNAV_INTERNAL_H_INCLUDED +#define DVDNAV_INTERNAL_H_INCLUDED + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#ifdef WIN32 + +/* workaround for objidl.h */ +#undef STREAM_SEEK +/* 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 gettimeofday( struct timeval *tv, void *tz ) +{ + struct timeb t; + ftime( &t ); + tv->tv_sec = t.time; + tv->tv_usec = t.millitm * 1000; + return 0; +} +#include /* read() */ +#define lseek64 _lseeki64 +#define STREAM_SEEK (STREAM_SEEK_BW|STREAM_SEEK_FW) + +#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 stdout + +/* 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 -Nur a/libmpdvdnav/highlight.c b/libmpdvdnav/highlight.c --- a/libmpdvdnav/highlight.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/highlight.c 2006-04-05 17:03:10.000000000 +0300 @@ -0,0 +1,550 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: highlight.c,v 1.32 2004/01/20 01:22:24 jcdutton Exp $ + * + */ + +#ifndef HAVE_MPLAYER +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#else +#include "config.h" +#endif + +#include +#ifdef USE_MPDVDKIT +#if (USE_MPDVDKIT == 2) +#include "libmpdvdkit2/dvd_input.h" +#include "libmpdvdkit2/dvd_reader.h" +#include "libmpdvdkit2/ifo_types.h" +#include "libmpdvdkit2/ifo_read.h" +#include "libmpdvdkit2/nav_read.h" +#else +#include "libmpdvdkit/dvd_input.h" +#include "libmpdvdkit/dvd_reader.h" +#include "libmpdvdkit/ifo_types.h" +#include "libmpdvdkit/ifo_read.h" +#include "libmpdvdkit/nav_read.h" +#endif +#else +#include +#include +#include +#include +#include +#endif +#include "dvdnav_internal.h" + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif +#ifdef USE_MPDVDNAV_TRACE +extern int dvdnav_trace; +#endif + +/* +#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); + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"%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; + } + mp_msg(MSGT_CPLAYER,MSGL_INFO," @ %s fps", rate); +} + +static void nav_print_PCI_GI(pci_gi_t *pci_gi) { + int32_t i; + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: pci_gi:\n"); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: nv_pck_lbn 0x%08x\n", pci_gi->nv_pck_lbn); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: vobu_cat 0x%04x\n", pci_gi->vobu_cat); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: vobu_uop_ctl 0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: vobu_s_ptm 0x%08x\n", pci_gi->vobu_s_ptm); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: vobu_e_ptm 0x%08x\n", pci_gi->vobu_e_ptm); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: e_eltm "); + print_time(&pci_gi->e_eltm); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n"); + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: vobu_isrc \""); + for(i = 0; i < 32; i++) { + char c = pci_gi->vobu_isrc[i]; + if((c >= ' ') && (c <= '~')) + mp_msg(MSGT_CPLAYER,MSGL_INFO,"%c", c); + else + mp_msg(MSGT_CPLAYER,MSGL_INFO,"."); + } + mp_msg(MSGT_CPLAYER,MSGL_INFO,"\"\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; + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: nsml_agli:\n"); + for(i = 0; i < 9; i++) + if(nsml_agli->nsml_agl_dsta[i]) + mp_msg(MSGT_CPLAYER,MSGL_INFO,"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; + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: hl_gi:\n"); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: hli_ss 0x%01x\n", hl_gi->hli_ss & 0x03); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: hli_s_ptm 0x%08x\n", hl_gi->hli_s_ptm); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: hli_e_ptm 0x%08x\n", hl_gi->hli_e_ptm); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btn_se_e_ptm 0x%08x\n", hl_gi->btn_se_e_ptm); + + *btngr_ns = hl_gi->btngr_ns; + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btngr_ns %d\n", hl_gi->btngr_ns); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btngr%d_dsp_ty 0x%02x\n", 1, hl_gi->btngr1_dsp_ty); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btngr%d_dsp_ty 0x%02x\n", 2, hl_gi->btngr2_dsp_ty); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btngr%d_dsp_ty 0x%02x\n", 3, hl_gi->btngr3_dsp_ty); + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btn_ofn %d\n", hl_gi->btn_ofn); + *btn_ns = hl_gi->btn_ns; + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btn_ns %d\n", hl_gi->btn_ns); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: nsl_btn_ns %d\n", hl_gi->nsl_btn_ns); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: fosl_btnn %d\n", hl_gi->fosl_btnn); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"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; + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btn_colit:\n"); + for(i = 0; i < 3; i++) + for(j = 0; j < 2; j++) + mp_msg(MSGT_CPLAYER,MSGL_INFO,"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; + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btnit:\n"); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: btngr_ns: %i\n", btngr_ns); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"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]; + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: group %d btni %d: ", i+1, j+1); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"btn_coln %d, auto_action_mode %d\n", + btni->btn_coln, btni->auto_action_mode); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: coords (%d, %d) .. (%d, %d)\n", + btni->x_start, btni->y_start, btni->x_end, btni->y_end); + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: up %d, ", btni->up); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"down %d, ", btni->down); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"left %d, ", btni->left); + mp_msg(MSGT_CPLAYER,MSGL_INFO,"right %d\n", btni->right); + for(k = 0; k < 8; k++) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,"libdvdnav: %02x ", btni->cmd.bytes[k]); + } + mp_msg(MSGT_CPLAYER,MSGL_INFO,, "| "); +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) vm_print_mnemonic(&btni->cmd); +#endif + mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n"); + } + } + } +} + +static void nav_print_HLI(hli_t *hli) { + int32_t btngr_ns = 0, btn_ns = 0; + + mp_msg(MSGT_CPLAYER,MSGL_INFO,"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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,"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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return NULL; + } + if(!pci->hli.hl_gi.hli_ss) { + mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_NotInAMenu); + return NULL; + } + if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { + mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_ThisNAVHasAlreadyBeenLeft); + 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) { +#ifdef USE_MPDVDNAV + if (this->vm->auto_action_mode) return DVDNAV_STATUS_OK; +#endif + 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 + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + if(!pci->hli.hl_gi.hli_ss) { + mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_NotInAMenu); + return DVDNAV_STATUS_ERR; + } + if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { + mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_ThisNAVHasAlreadyBeenLeft); + 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 + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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 + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + if(!pci->hli.hl_gi.hli_ss) { + mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_NotInAMenu); + return DVDNAV_STATUS_ERR; + } + if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { + mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_ThisNAVHasAlreadyBeenLeft); + return DVDNAV_STATUS_ERR; + } + +#ifdef BUTTON_TESTING + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: Button select %i\n", button); +#endif + + if((button <= 0) || (button > pci->hli.hl_gi.btn_ns)) { + mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_ButtonDoesNotExist); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + if(!pci->hli.hl_gi.hli_ss) { + mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_NotInAMenu); + return DVDNAV_STATUS_ERR; + } + if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { + mp_msg( MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_ThisNAVHasAlreadyBeenLeft); + 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 -Nur a/libmpdvdnav/navigation.c b/libmpdvdnav/navigation.c --- a/libmpdvdnav/navigation.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/navigation.c 2006-04-05 17:03:10.000000000 +0300 @@ -0,0 +1,294 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: navigation.c,v 1.21 2004/01/07 19:34:28 mroi Exp $ + * + */ + +#ifndef HAVE_MPLAYER +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#else +#include "config.h" +#endif + +#include "dvdnav_internal.h" + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif + +/* Navigation API calls */ + +dvdnav_status_t dvdnav_still_skip(dvdnav_t *this) { + if(!this) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + 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; +} + +#ifdef USE_MPDVDNAV +dvdnav_status_t dvdnav_still_back(dvdnav_t *this) { + if(!this) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + this->position_current.still = 0; + this->skip_still = 0; + this->sync_wait = 0; + this->sync_wait_skip = 1; + + pthread_mutex_lock(&this->vm_lock); + vm_play_cell(this->vm); +// vm_play_pgc(this->vm); + pthread_mutex_unlock(&this->vm_lock); + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_wait_back(dvdnav_t *this) { + if(!this) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + this->position_current.still = 0; + this->skip_still = 0; + this->sync_wait = 0; + this->sync_wait_skip = 0; + + pthread_mutex_lock(&this->vm_lock); + vm_play_cell(this->vm); +// vm_play_pgc(this->vm); + pthread_mutex_unlock(&this->vm_lock); + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_wait_still_clear(dvdnav_t *this) { + if(!this) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + this->position_current.still = 0; + this->skip_still = 0; + this->sync_wait = 0; + this->sync_wait_skip = 0; + + return DVDNAV_STATUS_OK; +} + +dvdnav_status_t dvdnav_is_still_cell(dvdnav_t *this, int *flag) +{ + if(!this || !flag) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + *flag=this->position_current.still; + return DVDNAV_STATUS_OK; +} +#endif + +dvdnav_status_t dvdnav_wait_skip(dvdnav_t *this) { + if(!this) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + 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) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + if(!this->started) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_VirtualDVDMachineNotStarted); + 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) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + if(!this->started) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_VirtualDVDMachineNotStarted); + return DVDNAV_STATUS_ERR; + } + if ((title < 1) || (title > vm_get_vmgi(this->vm)->tt_srpt->nr_of_srpts) ) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedATitleNumberOutOfRange); + 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) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->vtsi || !this->vm->vmgi) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_BadVMState); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if (!this->vm->state.pgc) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_NoCurrentPGC); + 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; + } + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_NotInATitleOrMenu); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int32_t title) { + if(!this) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + 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) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if (!this->vm->vmgi) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_BadVMState); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if (!this->vm->state.pgc) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_NoCurrentPGC); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + if((title < 1) || (title > this->vm->vmgi->tt_srpt->nr_of_srpts)) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_TitleOutOfRange); + 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)) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PartOutOfRange); + 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) + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_NotImplementedYet); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_time_play(dvdnav_t *this, int32_t title, + uint64_t time) { + if(!this) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + /* FIXME: Implement */ + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_NotImplementedYet); + return DVDNAV_STATUS_ERR; +} + +dvdnav_status_t dvdnav_stop(dvdnav_t *this) { + if(!this) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + 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) { + mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_LIBMPDVDNAV_PassedANullPointer); + 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 -Nur a/libmpdvdnav/read_cache.c b/libmpdvdnav/read_cache.c --- a/libmpdvdnav/read_cache.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/read_cache.c 2006-04-05 17:03:10.000000000 +0300 @@ -0,0 +1,337 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: read_cache.c,v 1.30 2004/03/03 16:48:36 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. + */ + +#ifndef HAVE_MPLAYER +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#else +#include "config.h" +#endif + +#include "dvdnav.h" +#include "dvdnav_internal.h" +#include "read_cache.h" +#include +#include + +#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 + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif + +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 +*/ + +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); + mp_msg(MSGT_CPLAYER,MSGL_DBG2,MSGTR_LIBMPDVDNAV_PreCacheDVDReadReallocHappened); + 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; + mp_msg(MSGT_CPLAYER,MSGL_DBG2,MSGTR_LIBMPDVDNAV_PreCacheDVDReadMalloc, + (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 { + mp_msg(MSGT_CPLAYER,MSGL_DBG2,MSGTR_LIBMPDVDNAV_PreCachingWasImpossible); + } + 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); + + mp_msg(MSGT_CPLAYER,MSGL_DBG2,MSGTR_LIBMPDVDNAV_ReadCacheSectorInfo, 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; + } + mp_msg(MSGT_CPLAYER,MSGL_DBG2,MSGTR_LIBMPDVDNAV_ReadCacheReadAheadSize, 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) + mp_msg(MSGT_CPLAYER,MSGL_DBG2,MSGTR_LIBMPDVDNAV_CacheMissOnSector, 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 -Nur a/libmpdvdnav/read_cache.h b/libmpdvdnav/read_cache.h --- a/libmpdvdnav/read_cache.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/read_cache.h 2006-04-05 17:03:10.000000000 +0300 @@ -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: read_cache.h,v 1.4 2002/07/12 15:46:44 mroi 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 -Nur a/libmpdvdnav/remap.c b/libmpdvdnav/remap.c --- a/libmpdvdnav/remap.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/remap.c 2006-04-05 17:40:59.000000000 +0300 @@ -0,0 +1,262 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: remap.c,v 1.4 2003/08/27 13:54:19 mroi Exp $ + */ + +#include +#include +#include + +#ifndef _MSC_VER +#include +#include +#else +#ifndef MAXPATHLEN +#define MAXPATHLEN 255 +#endif +#endif /* _MSC_VER */ + +#ifdef HAVE_MPLAYER +#include "config.h" +#endif + +#include +#include "remap.h" +#include "dvdnav_internal.h" + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif + +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[MAXPATHLEN]; + char *home; + int res; + FILE *fp; + block_t tmp; + remap_t *map; + + /* Build the map filename */ + home = getenv("HOME"); +#ifdef WIN32 + if(!home) home = getenv("USERPROFILE"); + if(!home) home = getenv("HOMEPATH"); + if(!home) home = (char*)get_path(""); +#endif + assert(home); + snprintf(fname, sizeof(fname), "%s/.dvdnav/%s.map", home, title); + /* Open the map file */ + fp = fopen( fname, "r"); + if (!fp) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_UnableToFindMapFile, 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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_IgnoringMapLine, res, buf); + continue; + } + remap_add_node( map, tmp); + } + } + + 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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_RemapInfo, + 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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_RedirectedTo, b->end_block); + } + return b->end_block - cblock; + } + return offset; +} diff -Nur a/libmpdvdnav/remap.h b/libmpdvdnav/remap.h --- a/libmpdvdnav/remap.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/remap.h 2006-04-05 17:03:10.000000000 +0300 @@ -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: remap.h,v 1.2 2003/02/20 15:32:19 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 -Nur a/libmpdvdnav/searching.c b/libmpdvdnav/searching.c --- a/libmpdvdnav/searching.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/searching.c 2006-04-05 17:03:10.000000000 +0300 @@ -0,0 +1,523 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: searching.c,v 1.35 2004/01/07 19:35:12 mroi Exp $ + * + */ + +#ifndef HAVE_MPLAYER +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#else +#include "config.h" +#endif + +#include +#include "dvdnav_internal.h" + +/* +#define LOG_DEBUG +*/ + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif + +/* Searching API calls */ + +dvdnav_status_t dvdnav_time_search(dvdnav_t *this, + uint64_t time) { + /* FIXME: Time search the current PGC based on the xxx table */ + return DVDNAV_STATUS_OK; +} + +/* 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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_UnknownDomainForSeeking); + } + 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]; + + /* mp_msg(MSGT_FIXME,MSGL_FIXME, "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 { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_CouldNotLocateBlock); + return DVDNAV_STATUS_ERR; + } + } + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_AdmapNotLocated); + 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(MSGTR_LIBMPDVDNAV_Err_CannotSeekInAStillFrame); + 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(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: seeking to offset=%lu pos=%u length=%u\n", offset, target, length); + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: Before cellN=%u blockN=%u\n", state->cellN, state->blockN); +#endif + + switch(origin) { + case SEEK_SET: + if(offset > length) { + printerr(MSGTR_LIBMPDVDNAV_Err_RequestToSeekBehindEnd); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + target = offset; + break; + case SEEK_CUR: + if(target + offset > length) { + printerr(MSGTR_LIBMPDVDNAV_Err_RequestToSeekBehindEnd); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + target += offset; + break; + case SEEK_END: + if(length - offset < 0) { + printerr(MSGTR_LIBMPDVDNAV_Err_RequestToSeekBeforeStart); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + target = length - offset; + break; + default: + /* Error occured */ + printerr(MSGTR_LIBMPDVDNAV_Err_IllegalSeekMode); + 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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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; + } + } + } + + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_ErrorWhenSeeking); + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_FIXMEImplementSeekingToLocation, target); + printerr(MSGTR_LIBMPDVDNAV_Err_ErrorWhenSeeking); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if(!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: previous chapter\n"); +#endif + if (!vm_jump_prev_pg(this->vm)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_PreviousChapterFailed); + printerr(MSGTR_LIBMPDVDNAV_Err_SkipToPreviousChapterFailed); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + this->position_current.still = 0; + this->vm->hop_channel++; +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if(!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: top chapter\n"); +#endif + if (!vm_jump_top_pg(this->vm)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_TopChapterFailed); + printerr(MSGTR_LIBMPDVDNAV_Err_SkipToTopChapterFailed); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + this->position_current.still = 0; + this->vm->hop_channel++; +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if(!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } + +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "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); + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_NextChapterFailed); + printerr(MSGTR_LIBMPDVDNAV_Err_SkipToNextChapterFailed); + 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 + mp_msg(MSGT_FIXME,MSGL_FIXME, "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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if(!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + 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(MSGTR_LIBMPDVDNAV_Err_NoSuchMenuOrMenuNotReachable); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + if(!this->started) { + printerr(MSGTR_LIBMPDVDNAV_Err_VirtualDVDMachineNotStarted); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + state = &(this->vm->state); + if(!state->pgc || this->vm->stopped) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + 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(MSGTR_LIBMPDVDNAV_Err_NewPositionNotYetDetermined); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + state = &(this->vm->state); + if(!state->pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + 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; +} + +#ifdef USE_MPDVDNAV +dvdnav_status_t dvdnav_get_pgc(dvdnav_t *this, int *pg_num) +{ + if(!this || !pg_num) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + if(!this->vm->state.pgc) { + printerr(MSGTR_LIBMPDVDNAV_Err_NoCurrentPGC); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_ERR; + } +#ifdef LOG_DEBUG + mp_msg(MSGT_FIXME,MSGL_FIXME, "libdvdnav: get pgc\n"); +#endif + *pg_num = vm_get_PGCN(this->vm); + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} +#endif diff -Nur a/libmpdvdnav/settings.c b/libmpdvdnav/settings.c --- a/libmpdvdnav/settings.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/settings.c 2006-04-05 17:03:10.000000000 +0300 @@ -0,0 +1,145 @@ +/* + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: settings.c,v 1.9 2003/12/31 21:37:16 jcdutton Exp $ + * + */ + +#ifndef HAVE_MPLAYER +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#else +#include "config.h" +#endif + +#include "dvdnav_internal.h" + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif + +/* Characteristics/setting API calls */ + +dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *this, int32_t *region) { + if(!this || !region) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + if(!code[0] || !code[1]) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedIllegalLanguageCode); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + 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(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + (*flag) = this->pgc_based; + return DVDNAV_STATUS_OK; +} + +#ifdef USE_MPDVDNAV +dvdnav_status_t dvdnav_button_select_auto_action(dvdnav_t *this, int mode) +{ + if(!this) { + printerr(MSGTR_LIBMPDVDNAV_Err_PassedANullPointer); + return DVDNAV_STATUS_ERR; + } + + pthread_mutex_lock(&this->vm_lock); + this->vm->auto_action_mode = mode; + pthread_mutex_unlock(&this->vm_lock); + return DVDNAV_STATUS_OK; +} +#endif diff -Nur a/libmpdvdnav/vm.c b/libmpdvdnav/vm.c --- a/libmpdvdnav/vm.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/vm.c 2006-04-05 17:41:51.000000000 +0300 @@ -0,0 +1,1921 @@ +/* + * Copyright (C) 2000, 2001 Håkan 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: vm.c,v 1.6 2004/05/21 19:32:25 mroi Exp $ + * + */ + +#ifndef HAVE_MPLAYER +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#else +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef USE_MPDVDKIT +#if (USE_MPDVDKIT == 2) +#include "libmpdvdkit2/dvd_input.h" +#include "libmpdvdkit2/dvd_reader.h" +#include "libmpdvdkit2/ifo_types.h" +#include "libmpdvdkit2/ifo_read.h" +#include "libmpdvdkit2/nav_read.h" +#else +#include "libmpdvdkit/dvd_input.h" +#include "libmpdvdkit/dvd_reader.h" +#include "libmpdvdkit/ifo_types.h" +#include "libmpdvdkit/ifo_read.h" +#include "libmpdvdkit/nav_read.h" +#endif +#else +#include +#include +#include +#include +#include +#endif + +#include "dvdnav_internal.h" + +#ifdef _MSC_VER +#include /* read() */ +#endif /* _MSC_VER */ + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif +#ifdef USE_MPDVDNAV_TRACE +extern int dvdnav_trace; +#endif + +/* +#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 USE_MPDVDNAV_TRACE +static void vm_print_current_domain_state(vm_t *vm) { + switch((vm->state).domain) { + case VTS_DOMAIN: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: Video Title Domain: -\n"); + break; + + case VTSM_DOMAIN: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: Video Title Menu Domain: -\n"); + break; + + case VMGM_DOMAIN: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: Video Manager Menu Domain: -\n"); + break; + + case FP_DOMAIN: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: First Play Domain: -\n"); + break; + + default: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: Unknown Domain: -\n"); + break; + } + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 i; + dvd_input_t fd; + uint8_t data[DVD_VIDEO_LB_LEN]; + + /* Read DVD name */ + fd = dvdinput_open(device); + if (fd > 0) { + off = dvdinput_seek( fd, 16 ); + if( off == 16 ) { + off = dvdinput_read( fd, data, 1, DVDINPUT_NOFLAGS ); + if (off == 1 ) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCDVDTitle); + for(i=40; i < 73; i++ ) { + if((data[i] == 0)) break; + if((data[i] > 32) && (data[i] < 127)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%c", data[i]); + } else { + mp_msg(MSGT_CPLAYER,MSGL_INFO, " "); + } + } + strncpy(name, &data[40], 32); + i=31; + while( (i >= 0) && (name[i] <= ' ')) --i; + name[i+1] = '\0'; + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCDVDSerialNumber); + for(i=813; i < 829; i++ ) { + if((data[i] == 0)) break; + if((data[i] > 32) && (data[i] < 127)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%c", data[i]); + } else { + mp_msg(MSGT_CPLAYER,MSGL_INFO, " "); + } + } + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCDVDTitleAlternative); + for(i=89; i < 128; i++ ) { + if((data[i] == 0)) break; + if((data[i] > 32) && (data[i] < 127)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%c", data[i]); + } else { + mp_msg(MSGT_CPLAYER,MSGL_INFO, " "); + } + } + mp_msg(MSGT_CPLAYER,MSGL_INFO, "\n"); + } else { + mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_LIBMPDVDNAV_VmCCantReadNameBlock); + } + } else { + mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_LIBMPDVDNAV_VmCCantSeekToBlock); + } + dvdinput_close(fd); + } else { + mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_LIBMPDVDNAV_VmCNameOpenFailed); + } +} + + +static void ifoOpenNewVTSI(vm_t *vm, dvd_reader_t *dvd, int vtsN) { + if((vm->state).vtsN == vtsN) { + return; /* We alread have it */ + } + + if(vm->vtsi != NULL) + ifoClose(vm->vtsi); + + vm->vtsi = ifoOpenVTSI(dvd, vtsN); + if(vm->vtsi == NULL) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCIfoOpenVTSIFailed); + assert(0); + } + if(!ifoRead_VTS_PTT_SRPT(vm->vtsi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCIfoReadVTSPTTSRPTFailed); + assert(0); + } + if(!ifoRead_PGCIT(vm->vtsi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCIfoReadPGCITFailed); + assert(0); + } + if(!ifoRead_PGCI_UT(vm->vtsi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCIfoReadPGCIUTFailed); + assert(0); + } + if(!ifoRead_VOBU_ADMAP(vm->vtsi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCIfoReadVOBUADMAPVtsiFailed); + assert(0); + } + if(!ifoRead_TITLE_VOBU_ADMAP(vm->vtsi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCIfoReadTITLEVOBUADMAPVtsiFailed); + assert(0); + } + (vm->state).vtsN = vtsN; +} + + +/* 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 */ + +void vm_start(vm_t *vm) { + /* Set pgc to FP (First Play) pgc */ + set_FP_PGC(vm); + process_command(vm, play_PGC(vm)); +} + +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) { + 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) { + vm->dvd = DVDOpen(dvdroot); + if(!vm->dvd) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCVmFaildToOpenReadTheDVD); + return 0; + } + dvd_read_name(vm->dvd_name, dvdroot); + vm->map = remap_loadmap(vm->dvd_name); + vm->vmgi = ifoOpenVMGI(vm->dvd); + if(!vm->vmgi) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCVmFaildToReadVIDEOTSIFO); + return 0; + } + if(!ifoRead_FP_PGC(vm->vmgi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCVmIfoReadFPPGCFailed); + return 0; + } + if(!ifoRead_TT_SRPT(vm->vmgi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCVmIfoReadTTSRPTFailed); + return 0; + } + if(!ifoRead_PGCI_UT(vm->vmgi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCVmIfoReadPGCIUTFailed); + return 0; + } + if(!ifoRead_PTL_MAIT(vm->vmgi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCVmIfoReadPRLMAITFailed); + /* return 0; Not really used for now.. */ + } + if(!ifoRead_VTS_ATRT(vm->vmgi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCVmIfoReadVTSATRTFailed); + /* return 0; Not really used for now.. */ + } + if(!ifoRead_VOBU_ADMAP(vm->vmgi)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCVmIfoReadVOBUADMAPVgmiFailed); + /* return 0; Not really used for now.. */ + } + /* ifoRead_TXTDT_MGI(vmgi); Not implemented yet */ + } + if (vm->vmgi) { + int i, mask; + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCDVDDiskReportsItselfWithRegionMask, + 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) + mp_msg(MSGT_CPLAYER,MSGL_INFO, " %d", i); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "\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; + ifoOpenNewVTSI(target, target->dvd, vtsN); + + /* 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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCChapterNotFound); + return 0; + } + + title = get_TT(vm, vm->state.vtsN, vts_ttn); + +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace && title) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: ************ this chapter FOUND!\n"); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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].present) { + streamN = (vm->state).pgc->audio_control[audioN].s_audio; + } + } + + 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].present) { + if(source_aspect == 0) /* 4:3 */ + streamN = (vm->state).pgc->subp_control[subpN].s_4p3; + if(source_aspect == 3) /* 16:9 */ + switch (mode) { + case 0: + streamN = (vm->state).pgc->subp_control[subpN].s_wide; + break; + case 1: + streamN = (vm->state).pgc->subp_control[subpN].s_lbox; + break; + case 2: + streamN = (vm->state).pgc->subp_control[subpN].s_panscan; + } + } + } + + 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++) { +#ifdef USE_MPDVDKIT + if((vm->state).pgc->audio_control[audioN].present) { +#else + if((vm->state).pgc->audio_control[audioN] & (1<<15)) { +#endif + 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++) { +#ifdef USE_MPDVDKIT + if((vm->state).pgc->subp_control[subpN].present) { +#else + if((vm->state).pgc->subp_control[subpN] & (1<<31)) { +#endif + 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 + +#if 0 +int vm_get_audio_id(vm_t *vm, int streamN) { + switch ((vm->state).domain) { + case VTS_DOMAIN: + return vm->vtsi->vtsi_mat->vts_audio_attr[streamN].s_audio; + case VTSM_DOMAIN: + return vm->vtsi->vtsi_mat->vtsm_audio_attr.s_audio; + case VMGM_DOMAIN: + case FP_DOMAIN: + return vm->vmgi->vmgi_mat->vmgm_audio_attr.s_audio;; + default: + abort(); + } +} +#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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: play_PGC:"); + if((vm->state).domain != FP_DOMAIN) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, " (vm->state).pgcN (%i)\n", get_PGCN(vm)); + } else { + mp_msg(MSGT_CPLAYER,MSGL_INFO, " 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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: play_PGC_PG:"); + if((vm->state).domain != FP_DOMAIN) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, " (vm->state).pgcN (%i)\n", get_PGCN(vm)); + } else { + mp_msg(MSGT_CPLAYER,MSGL_INFO, " 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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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. */ +//#ifndef USE_MPDVDNAV + if(!set_PGCN(vm, (vm->state).pgc->next_pgc_nr)) { + link_values.command = Exit; + return link_values; + } +//#endif + return play_PGC(vm); +} + +static link_t play_PG(vm_t *vm) { +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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)) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCInvalidAngleBlock); + (vm->state).cellN -= (vm->state).AGL_REG - 1; + } +#endif + break; + case 2: /* ?? */ + case 3: /* ?? */ + default: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCInvalidBlockMode, + (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: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCCellIsInBlockButDidNotEnter); + } + + /* 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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: Cell should restart here\n"); +#endif + return play_this; +} + +static link_t play_Cell_post(vm_t *vm) { + cell_playback_t *cell; + +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: Cell command didn't do a Jump, Link or Call\n"); +#endif + } + } else { +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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: + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCInvalidBlockMode, + (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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: Before printout starts:\n"); + vm_print_link(link_values); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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)) + assert(0); + link_values = play_PGC(vm); + 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)) + assert(0); + link_values = play_PGC(vm); + 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)) + assert(0); + link_values = play_PGC(vm); + 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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCTryingToResumeWithoutAnyResume); + link_values.command = Exit; + break; + } + + (vm->state).domain = VTS_DOMAIN; + ifoOpenNewVTSI(vm, vm->dvd, (vm->state).rsm_vtsN); + 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 righ value in set_PGN() below */ + (vm->state).cellN = (vm->state).rsm_cellN; + link_values.command = PlayThis; + link_values.data1 = (vm->state).rsm_blockN; + 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)) + assert(0); + link_values = play_PGC(vm); + 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; + ifoOpenNewVTSI(vm, vm->dvd, link_values.data1); /* Also sets (vm->state).vtsN */ + } 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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: After printout starts:\n"); + vm_print_current_domain_state(vm); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: After printout ends.\n"); } +#endif + + } + (vm->state).blockN = link_values.data1; + 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) + ifoOpenNewVTSI(vm, vm->dvd, vtsN); /* Also sets (vm->state).vtsN */ + + 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; + (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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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. */ + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCRandomOrShuffleTitlesAreNotHandledYet); + } + } + 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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 USE_MPDVDNAV_TRACE + if (dvdnav_trace) mp_msg(MSGT_CPLAYER,MSGL_INFO, "libdvdnav: Found menu.\n"); +#endif + return pgcN; + } + } +#ifdef USE_MPDVDNAV_TRACE + if (dvdnav_trace) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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++; + } + } + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCGetPGCNFailed, + (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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCPgciUtHandleIsNULL); + 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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCLanguageNotFound, + (char)(lang >> 8), (char)(lang & 0xff), + (char)(h->pgci_ut->lu[0].lang_code >> 8), + (char)(h->pgci_ut->lu[0].lang_code & 0xff)); + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LIBMPDVDNAV_VmCMenuLanguagesAvailable); + for(i = 0; i < h->pgci_ut->nr_of_lus; i++) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%c%c ", + (char)(h->pgci_ut->lu[i].lang_code >> 8), + (char)(h->pgci_ut->lu[i].lang_code & 0xff)); + } + mp_msg(MSGT_CPLAYER,MSGL_INFO, "\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 USE_MPDVDNAV_TRACE +void vm_position_print(vm_t *vm, vm_position_t *position) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 + +#ifdef USE_MPDVDNAV +void vm_play_pgc(vm_t *vm) +{ + process_command(vm, play_PGC(vm)); +} + +void vm_play_cell(vm_t *vm) +{ + play_Cell(vm); +} + +int vm_get_PGCN(vm_t *vm) { return get_PGCN(vm); } +#endif diff -Nur a/libmpdvdnav/vm.h b/libmpdvdnav/vm.h --- a/libmpdvdnav/vm.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/vm.h 2006-04-05 17:03:10.000000000 +0300 @@ -0,0 +1,194 @@ +/* + * Copyright (C) 2000, 2001 Håkan 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: vm.h,v 1.1 2004/01/11 21:43:13 mroi 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; + 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; +#ifdef USE_MPDVDNAV + int pgc_post_flag; + int auto_action_mode; +#endif +} 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 */ +void 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 USE_MPDVDNAV +void vm_play_pgc(vm_t *vm); +void vm_play_cell(vm_t *vm); +#endif + +#ifdef USE_MPDVDNAV_TRACE +/* Debug */ +void vm_position_print(vm_t *vm, vm_position_t *position); +#endif + +#ifdef USE_MPDVDNAV +int vm_get_PGCN(vm_t *vm); +#endif + + +#endif /* VM_HV_INCLUDED */ diff -Nur a/libmpdvdnav/vmcmd.c b/libmpdvdnav/vmcmd.c --- a/libmpdvdnav/vmcmd.c 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/vmcmd.c 2006-04-05 17:03:10.000000000 +0300 @@ -0,0 +1,549 @@ +/* + * Copyright (C) 2000, 2001 Martin Norbäck, Håkan 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: vmcmd.c,v 1.2 2004/03/03 16:50:42 mroi Exp $ + * + */ + +#ifndef HAVE_MPLAYER +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#else +#include "config.h" +#endif + +#include +#include +#include + +#include "dvdnav_internal.h" + +#ifdef USE_MPDVDNAV +#include "../mp_msg.h" +#include "../help_mp.h" +#endif + + +/* 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 *)) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%s (SRPM:%d)", system_reg_table[reg], reg); + else + mp_msg(MSGT_CPLAYER,MSGL_INFO, " WARNING: Unknown system register ( reg=%d ) ", reg); +} + +static void print_g_reg(uint8_t reg) { + if(reg < 16) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "g[%" PRIu8 "]", reg); + else + mp_msg(MSGT_CPLAYER,MSGL_INFO, " 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) + mp_msg(MSGT_CPLAYER,MSGL_INFO, " %s ", cmp_op_table[op]); + else + mp_msg(MSGT_CPLAYER,MSGL_INFO, " 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) + mp_msg(MSGT_CPLAYER,MSGL_INFO, " %s ", set_op_table[op]); + else + mp_msg(MSGT_CPLAYER,MSGL_INFO, " 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); + + mp_msg(MSGT_CPLAYER,MSGL_INFO, "0x%x", i); + if(isprint(i & 0xff) && isprint((i>>8) & 0xff)) + mp_msg(MSGT_CPLAYER,MSGL_INFO, " (\"%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) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "0x%x", vm_getbits(command, start - 1, 7)); + else + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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); + + mp_msg(MSGT_CPLAYER,MSGL_INFO, "0x%x", i); + if(isprint(i & 0xff) && isprint((i>>8) & 0xff)) + mp_msg(MSGT_CPLAYER,MSGL_INFO, " (\"%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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "if ("); + print_g_reg(vm_getbits(command,39,8)); + print_cmp_op(op); + print_reg_or_data(command, vm_getbits(command, 55,1), 31); + mp_msg(MSGT_CPLAYER,MSGL_INFO, ") "); + } +} + +static void print_if_version_2(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + + if(op) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "if ("); + print_reg(vm_getbits(command, 15, 8)); + print_cmp_op(op); + print_reg(vm_getbits(command, 7, 8)); + mp_msg(MSGT_CPLAYER,MSGL_INFO, ") "); + } +} + +static void print_if_version_3(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + + if(op) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "if ("); + print_g_reg(vm_getbits(command, 43, 4)); + print_cmp_op(op); + print_reg_or_data(command, vm_getbits(command, 55, 1), 15); + mp_msg(MSGT_CPLAYER,MSGL_INFO, ") "); + } +} + +static void print_if_version_4(command_t* command) { + uint8_t op = vm_getbits(command, 54, 3); + + if(op) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "if ("); + print_g_reg(vm_getbits(command, 51, 4)); + print_cmp_op(op); + print_reg_or_data(command, vm_getbits(command, 55, 1), 31); + mp_msg(MSGT_CPLAYER,MSGL_INFO, ") "); + } +} + +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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "if ("); + print_g_reg(vm_getbits(command, 31, 8)); + print_cmp_op(op); + print_reg(vm_getbits(command, 23, 8)); + mp_msg(MSGT_CPLAYER,MSGL_INFO, ") "); + } else { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "if ("); + print_g_reg(vm_getbits(command, 39, 8)); + print_cmp_op(op); + print_reg_or_data(command, vm_getbits(command, 55, 1), 31); + mp_msg(MSGT_CPLAYER,MSGL_INFO, ") "); + } + } +} + +static void print_special_instruction(command_t* command) { + uint8_t op = vm_getbits(command, 51, 4); + + switch(op) { + case 0: /* NOP */ + mp_msg(MSGT_CPLAYER,MSGL_INFO, "Nop"); + break; + case 1: /* Goto line */ + mp_msg(MSGT_CPLAYER,MSGL_INFO, "Goto %" PRIu8, vm_getbits(command, 7, 8)); + break; + case 2: /* Break */ + mp_msg(MSGT_CPLAYER,MSGL_INFO, "Break"); + break; + case 3: /* Parental level */ + mp_msg(MSGT_CPLAYER,MSGL_INFO, "SetTmpPML %" PRIu8 ", Goto %" PRIu8, + vm_getbits(command, 11, 4), vm_getbits(command, 7, 8)); + break; + default: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%s (button %" PRIu8 ")", link_table[linkop], button); + else + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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) + mp_msg(MSGT_CPLAYER,MSGL_INFO, ", "); + + switch(op) { + case 0: + if(!optional) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "WARNING: NOP (link)!"); + break; + case 1: + print_linksub_instruction(command); + break; + case 4: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "LinkPGCN %" PRIu16, vm_getbits(command, 14, 15)); + break; + case 5: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "LinkPTT %" PRIu16 " (button %" PRIu8 ")", + vm_getbits(command, 9, 10), vm_getbits(command, 15, 6)); + break; + case 6: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "LinkPGN %" PRIu8 " (button %" PRIu8 ")", + vm_getbits(command, 6, 7), vm_getbits(command, 15, 6)); + break; + case 7: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "LinkCN %" PRIu8 " (button %" PRIu8 ")", + vm_getbits(command, 7, 8), vm_getbits(command, 15, 6)); + break; + default: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "WARNING: Unknown link instruction"); + } +} + +static void print_jump_instruction(command_t* command) { + switch(vm_getbits(command, 51, 4)) { + case 1: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "Exit"); + break; + case 2: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "JumpTT %" PRIu8, vm_getbits(command, 22, 7)); + break; + case 3: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "JumpVTS_TT %" PRIu8, vm_getbits(command, 22, 7)); + break; + case 5: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "JumpSS FP"); + break; + case 1: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "JumpSS VMGM (menu %" PRIu8 ")", vm_getbits(command, 19, 4)); + break; + case 2: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "JumpSS VMGM (pgc %" PRIu8 ")", vm_getbits(command, 46, 15)); + break; + } + break; + case 8: + switch(vm_getbits(command, 23, 2)) { + case 0: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "CallSS FP (rsm_cell %" PRIu8 ")", + vm_getbits(command, 31, 8)); + break; + case 1: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "CallSS VMGM (menu %" PRIu8 + ", rsm_cell %" PRIu8 ")", vm_getbits(command, 19, 4), vm_getbits(command, 31, 8)); + break; + case 2: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "CallSS VTSM (menu %" PRIu8 + ", rsm_cell %" PRIu8 ")", vm_getbits(command, 19, 4), vm_getbits(command, 31, 8)); + break; + case 3: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "CallSS VMGM (pgc %" PRIu8 ", rsm_cell %" PRIu8 ")", + vm_getbits(command, 46, 15), vm_getbits(command, 31, 8)); + break; + } + break; + default: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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); + mp_msg(MSGT_CPLAYER,MSGL_INFO, " = "); + print_reg_or_data_2(command, vm_getbits(command, 60, 1), 47 - (i*8) ); + mp_msg(MSGT_CPLAYER,MSGL_INFO, " "); + } + } + break; + case 2: /* Set system reg 9 & 10 (Navigation timer, Title PGC number) */ + print_system_reg(9); + mp_msg(MSGT_CPLAYER,MSGL_INFO, " = "); + print_reg_or_data(command, vm_getbits(command, 60, 1), 47); + mp_msg(MSGT_CPLAYER,MSGL_INFO, " "); + print_system_reg(10); + mp_msg(MSGT_CPLAYER,MSGL_INFO, " = %" PRIu16, vm_getbits(command, 30, 15)); /* ?? */ + break; + case 3: /* Mode: Counter / Register + Set */ + mp_msg(MSGT_CPLAYER,MSGL_INFO, "SetMode "); + if(vm_getbits(command, 23, 1)) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "Counter "); + else + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 */ + mp_msg(MSGT_CPLAYER,MSGL_INFO, " = 0x%x (button no %d)", vm_getbits(command, 31, 16), vm_getbits(command, 31, 6)); + else + mp_msg(MSGT_CPLAYER,MSGL_INFO, " = g[%" PRIu8 "]", vm_getbits(command, 19, 4)); + break; + default: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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 { + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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); + mp_msg(MSGT_CPLAYER,MSGL_INFO, ", "); + print_if_version_4(&command); + print_linksub_instruction(&command); + break; + case 5: /* Compare -> (Set and LinkSub) instructions */ + print_if_version_5(&command); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "{ "); + print_set_version_3(&command); + mp_msg(MSGT_CPLAYER,MSGL_INFO, ", "); + print_linksub_instruction(&command); + mp_msg(MSGT_CPLAYER,MSGL_INFO, " }"); + break; + case 6: /* Compare -> Set, always LinkSub instructions */ + print_if_version_5(&command); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "{ "); + print_set_version_3(&command); + mp_msg(MSGT_CPLAYER,MSGL_INFO, " } "); + print_linksub_instruction(&command); + break; + default: + mp_msg(MSGT_CPLAYER,MSGL_INFO, "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) { + mp_msg(MSGT_CPLAYER,MSGL_INFO, " libdvdnav: vmcmd.c: [WARNING, unknown bits:"); + mp_msg(MSGT_CPLAYER,MSGL_INFO, " %08llx", (command.instruction & ~ command.examined) ); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "]"); + } +} + +void vm_print_cmd(int row, vm_cmd_t *vm_command) { + int i; + + mp_msg(MSGT_CPLAYER,MSGL_INFO, "(%03d) ", row + 1); + for(i = 0; i < 8; i++) + mp_msg(MSGT_CPLAYER,MSGL_INFO, "%02x ", vm_command->bytes[i]); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "| "); + + vm_print_mnemonic(vm_command); + mp_msg(MSGT_CPLAYER,MSGL_INFO, "\n"); +} + diff -Nur a/libmpdvdnav/vmcmd.h b/libmpdvdnav/vmcmd.h --- a/libmpdvdnav/vmcmd.h 1970-01-01 02:00:00.000000000 +0200 +++ b/libmpdvdnav/vmcmd.h 2006-04-05 17:03:10.000000000 +0300 @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2000, 2001 Martin Norbäck, Håkan 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id: vmcmd.h,v 1.1 2004/01/11 21:43:13 mroi Exp $ + * + */ + +#ifndef VMCMD_H_INCLUDED +#define VMCMD_H_INCLUDED + +#include + +void vm_print_mnemonic(vm_cmd_t *command); +void vm_print_cmd(int row, vm_cmd_t *command); + +#endif /* VMCMD_H_INCLUDED */ geexbox-1.0/packages/MPlayer/scripts/0000755000175000017500000000000010446314257016641 5ustar aurelaurelgeexbox-1.0/packages/MPlayer/scripts/cpd0000755000175000017500000000101710446314257017334 0ustar aurelaurel#!/bin/sh FIFO=/var/cp_fifo DIR= RM= mkfifo $FIFO 2>/dev/null while true; do read CMD FILE < $FIFO case "$CMD" in cd) DIR=$FILE [ -d "$DIR" ] || DIR=${DIR%/[^/]*} ;; cp) [ -z "$DIR" ] && continue rw "$DIR" cp -R "$FILE" "$DIR" ro "$DIR" ;; rm) RM=$FILE ;; rmok) if [ "$FILE" = "$RM" ]; then rw "$FILE" rm -r "$FILE" ro "$FILE" fi RM= ;; exit) break; ;; esac done rm $FIFO geexbox-1.0/packages/MPlayer/scripts/mp_loader0000755000175000017500000000366610446314257020544 0ustar aurelaurel#!/bin/sh # MPlayer file loader : determines what to do with the chosen file # usage: mp_loader file_location key_binding cp_fifo=/var/cp_fifo mp_fifo=/var/mp_control filter_file=/etc/file_ext filter_playlist=/etc/list_ext filter_image=/etc/img_ext file=$1 key=$2 if [ "$key" = "u" ]; then append=1; else append=0; fi if test -e "$file"; then ext=`echo "$file" | sed 's/.*\.\([^\.]*\)/\1/'` escfile=`echo "$file" | sed 's%\(\\\\\)%\1\1%g' | sed 's%"%\\\\"%g'` # File Operations if [ "$key" = "d" ]; then echo "cd $file" > $cp_fifo elif [ "$key" = "c" ]; then echo "cp $file" > $cp_fifo elif [ "$key" = "r" ]; then echo "rm $file" > $cp_fifo elif [ "$key" = "o" ]; then echo "rmok $file" > $cp_fifo elif [ -d "$file" ]; then if [ "$key" = "p" ]; then playdir "$file" || view_img -a "$file" elif [ "$key" = "l" ]; then playdir "$file" || view_img -r "$file" elif [ "$key" = "u" ]; then playdir "$file" $append fi elif [ -n "$ext" ]; then # File Playback if `grep -iq "^$ext\$" $filter_file`; then if [ "$key" = "p" ]; then playdir "$file" elif [ "$key" = "l" ]; then playdir "$file" else echo -e "menu hide\nloadfile \"$escfile\" $append" > $mp_fifo fi elif `grep -iq "^$ext\$" $filter_playlist`; then echo -e "menu hide\nloadlist \"$escfile\" $append" > $mp_fifo elif `grep -iq "^$ext\$" $filter_image`; then if [ "$key" = "p" ]; then view_img -a "$file" elif [ "$key" = "l" ]; then view_img -r "$file" else view_img "$file" fi else # Extension isn't supported in our extension file but might be # playable as well, let's MPlayer figure it out ... echo -e "menu hide\nloadfile \"$escfile\" $append" > $mp_fifo fi else # File do not have extension, try to play it aswell ... echo -e "menu hide\nloadfile \"$escfile\" $append" > $mp_fifo fi fi geexbox-1.0/packages/MPlayer/scripts/mp_recorder0000755000175000017500000000754210446314257021100 0ustar aurelaurel#!/bin/sh # MEncoder/MPlayer stream recorder # usage: mp_recorder file_location MENCODER=/usr/bin/mencoder CFG=/etc/mplayer/mencoder.conf FAILSAFE_TIMEOUT=2 RECORD_SOURCE=/var/record_source RECORD_STATUS=/var/record_status RECORDER_CFG=/etc/recorder mp_fifo=/var/mp_control bg_file=/usr/share/mplayer/background.avi record_fifo=/var/record_fifo file="$1" # Test for special input sources, given by $1 (with :// removed) file_test () { [ -z $1 ] && { echo 0; return;} if [ $1 = "net" ]; then if [ `file_test mms` -eq 1 -o `file_test mmst` -eq 1 -o `file_test http` -eq 1 -o `file_test http_proxy` -eq 1 -o `file_test rtp` -eq 1 -o `file_test rtsp` -eq 1 -o `file_test ftp` -eq 1 -o `file_test udp` -eq 1 -o `file_test unsv` -eq 1 ]; then echo 1; return else echo 0; return fi fi [ $1 = "file" -a -f "$file" ] && { echo 1; return;} [ -f "$file" -a ! $1 = "file" ] && { echo 0; return;} [ ! -f "$file" -a $1 = "file" ]&& { echo 0; return;} file_strp=`echo $file | sed "s/^$1\:\/\///"` if [ $(( ${#file}-${#file_strp} )) -eq $(( ${#1} + 3 )) ]; then { echo 1; return;} else { echo 0; return;} fi } [ ! -f $RECORDER_CFG ] && exit 1 . $RECORDER_CFG if [ ! -f $RECORD_STATUS ]; then [ -z "$file" ] && exit 1 # No source to record from. [ -z "$SAVE_PATH" ] && exit 1 # No save directory specified. [ ! -d "$SAVE_PATH" ] && exit 1 # not a valid directory. # Remounts the required disk RW in order to write to rw "$SAVE_PATH" # Set recording destination filename DATE=`date '+%F'` HOUR=`date '+%H'` MIN=`date '+%M'` OUTPUT=record-$DATE-$HOUR-$MIN # Edit MEncoder configuration with the correct destination filename. sed -i -e "s|^o=\".*\.\(.*\)\"|o=\"$SAVE_PATH/$OUTPUT\.\1\"|" $CFG # Check if dvb source, and if so force dump stream. [ `file_test dvb` -eq 1 ] && RECORD_PROFILE=dump # Force release of (possibly) locked v4l/dvb devices if [ `file_test dvb` -eq 1 -o `file_test tv` -eq 1 ]; then echo "loadfile $bg_file" > $mp_fifo & sleep 1 fi # Start Recording in background $MENCODER -profile $RECORD_PROFILE "$file" &> /dev/null & # Give MEncoder some time to start. sleep 1 # Allow more time for network streaming sources if [ `file_test net` -eq 1 ]; then sleep 10 FAILSAFE_TIMEOUT=10 fi # Test if MEncoder really has started (no bail out, whatever the reason) [ -z "`pidof mencoder`" ] && exit 1 # Create a FIFO, dump recording to and ask MPlayer to play from there. [ -f "$SAVE_PATH/$OUTPUT.mpg" ] || exit 1 [ -f $record_fifo ] && rm $record_fifo mkfifo $record_fifo tail -f "$SAVE_PATH/$OUTPUT.mpg" > $record_fifo & echo "loadfile $record_fifo" > $mp_fifo & # Keep trace of original stream source in order to restore it at # the end of recording session echo "SOURCE=\"$file\"" > $RECORD_SOURCE # Create recorder status file. echo "" > $RECORD_STATUS # Start failsafe procedure. sleep 1 FILESIZE_OLD=`ls -l "$SAVE_PATH/$OUTPUT.mpg" | sed "s/.* 0 *0 *\([0-9]*\) \/.*/\1/"` while [ ! -z "`pidof tail`" ]; do sleep $FAILSAFE_TIMEOUT [ -z "`pidof mencoder`" ] && mp_recorder & FILESIZE=`ls -l "$SAVE_PATH/$OUTPUT.mpg" | sed "s/.* 0 *0 *\([0-9]*\) \/.*/\1/"` # If no size increase assume failure and exit recording process. [ $FILESIZE_OLD -eq $FILESIZE ] && mp_recorder & FILESIZE_OLD=$FILESIZE done elif [ -f $RECORD_STATUS ]; then # Stop MEncoder recording [ -z "`pidof mencoder`" ] || killall mencoder [ -z "`pidof mencoder`" ] || killall -9 mencoder # Stop output to FIFO and remove it. [ -z "`pidof tail`" ] || killall tail [ -f $record_fifo ] && rm $record_fifo # Remounts the required disk RO for safety. ro "$SAVE_PATH" # Reload the original source. [ -f $RECORD_SOURCE ] && . $RECORD_SOURCE && rm $RECORD_SOURCE echo "loadfile \"$SOURCE\"" > $mp_fifo & # Remove recorder status file rm $RECORD_STATUS fi geexbox-1.0/packages/MPlayer/scripts/mp_set_option0000755000175000017500000000047510446314257021454 0ustar aurelaurel#!/bin/sh file=/etc/mplayer/mplayer.conf option=$1 value=$2 if grep -q "^$option=" $file; then if [ "$3" = "concat" ] && ! grep -q "^$option=\$" $file; then sed -i "s|^\($option=.*[^,]\).*|\1,$value|" $file else sed -i "s|^$option=.*|$option=$value|" $file fi else echo "$option=$value" >> $file fi geexbox-1.0/packages/MPlayer/scripts/mp_wrapper0000755000175000017500000000014610446314257020744 0ustar aurelaurel#!/bin/sh mplayer /usr/share/mplayer/background.avi -loop 0 >/dev/null 2>&1 echo $? > /tmp/mp_result geexbox-1.0/packages/MPlayer/scripts/playdir0000755000175000017500000000075510446314257020242 0ustar aurelaurel#!/bin/sh # Remove stale playlist files [ -f /tmp/*.pls ] && rm /tmp/*.pls DIR="$1" APPEND=${2:-0} [ -d "$DIR" ] && DIR=${DIR%\/} || DIR=${DIR%/[^/]*} NAME=${DIR##*/} for i in `cat /etc/file_ext`; do if [ -z "$EXTS" ]; then EXTS="$i" else EXTS="$EXTS\|$i" fi done find "$DIR" | grep -v /GEEXBOX/ | grep -i "\.\($EXTS\)\$" | sort > /tmp/"$NAME".pls if [ -s /tmp/"$NAME".pls ]; then echo -e "menu hide\nloadlist \"/tmp/$NAME.pls\" $APPEND" > /var/mp_control else exit 1 fi geexbox-1.0/packages/MPlayer/unpack0000755000175000017500000000017310446314257016362 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain sed -i 's/\(cc_check -lpthread\) && $TMPO/\1/' $BUILD/$1*/configure geexbox-1.0/packages/MPlayer/url0000644000175000017500000000010210446314257015670 0ustar aurelaurelhttp://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre8.tar.bz2 geexbox-1.0/packages/alsa/0000755000175000017500000000000010446314260014513 5ustar aurelaurelgeexbox-1.0/packages/alsa/build0000755000175000017500000000011710446314260015537 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build alsa-lib $SCRIPTS/build alsa-utils geexbox-1.0/packages/alsa/config/0000755000175000017500000000000010446314260015760 5ustar aurelaurelgeexbox-1.0/packages/alsa/config/audio0000644000175000017500000000144610446314260017011 0ustar aurelaurel# Soundcard Configuration File # Soundcard's ID (0 for first card, 1 for second, ...) ALSA_CARD="0" # Output mode (SPDIF or analog) SOUNDCARD_MODE="analog" # AC3 decoder mode (hardware or software) # note: in analog mode this option is ignored and defaults to software. AC3_DECODER="hardware" # IEC958 Playback AC97-SPSA Mode: # 0. PCM1 # 1. PCM2,PCM1 (rear) # 2. Centre and LFE # 3. PCM3,Modem,Dedicated S/PDIF # For SPDIF most users will want 0, but some users may need 3. AC97_SPSA="0" # Playback channels # 2 - Stereo # 4 - Surround # 6 - Full 5.1 # note: in SPDIF and hardware AC3 decoder mode this option is ignored. CHANNELS="2" # SB Live/Audigy Analog/Digital Output Mode: # 0: Suitable for some older SB Live! cards # 1: Suitable for newer SB Live! and all Audigy cards SBL_AUDIGY="1" geexbox-1.0/packages/alsa/install0000755000175000017500000000017610446314260016113 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/install alsa-lib $SCRIPTS/install alsa-utils cp $PACKAGES/$1/config/audio $INSTALL/etc geexbox-1.0/packages/alsa-lib/0000755000175000017500000000000010446314257015265 5ustar aurelaurelgeexbox-1.0/packages/alsa-lib/build0000755000175000017500000000101510446314257016307 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain CFLAGS="$CFLAGS -fPIC -DPIC" cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --datadir=/usr/share \ --enable-static \ --enable-shared \ --with-debug=no \ --with-versioned=no \ --disable-dependency-tracking sed -i 's/.*PKGLIBDIR.*/#define PKGLIBDIR ""/' include/config.h make make -C include install-data make -C src install-exec geexbox-1.0/packages/alsa-lib/config/0000755000175000017500000000000010446314257016532 5ustar aurelaurelgeexbox-1.0/packages/alsa-lib/config/PMac.conf0000644000175000017500000000022710446314257020222 0ustar aurelaurel# configuration for PMac PMac.pcm.front.0 { @args [ CARD ] @args.CARD { type string } type hw card $CARD device 0 } geexbox-1.0/packages/alsa-lib/install0000755000175000017500000000157010446314257016664 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build alsa-utils $SCRIPTS/build MPlayer [ "$DIGIMATRIX" = yes ] && $SCRIPTS/build digitools SO=`ls -d $BUILD/$1*`/libasound.so.2 libstrip $SO $BUILD/$1*/src/.libs/libasound.a "$BUILD/alsa-utils*/amixer/amixer $BUILD/MPlayer*/mplayer $BUILD/digitools*/digitools" "" "_snd_pcm_hw_open _snd_pcm_plug_open _snd_pcm_hooks_open _snd_pcm_asym_open _snd_pcm_softvol_open" mkdir -p $INSTALL/usr/lib cp $SO $INSTALL/usr/lib mkdir -p $INSTALL/usr/share/alsa sed 's%.*~/\.asoundrc.*%%' $BUILD/$1*/src/conf/alsa.conf > $INSTALL/usr/share/alsa/alsa.conf cp -rf $BUILD/$1*/src/conf/cards $INSTALL/usr/share/alsa/ cp -rf $BUILD/$1*/src/conf/pcm $INSTALL/usr/share/alsa/ rm -f $INSTALL/usr/share/alsa/cards/Makefile* rm -f $INSTALL/usr/share/alsa/pcm/Makefile* if [ "$TARGET_ARCH" = ppc ]; then cp $PACKAGES/$1/config/PMac.conf $INSTALL/usr/share/alsa/cards fi geexbox-1.0/packages/alsa-lib/patches/0000755000175000017500000000000010446314257016714 5ustar aurelaurelgeexbox-1.0/packages/alsa-lib/patches/10_wordexp.diff0000644000175000017500000000317210446314257021541 0ustar aurelaureldiff -Nur alsa-lib-1.0.11rc1.orig/src/alisp/alisp.c alsa-lib-1.0.11rc1/src/alisp/alisp.c --- alsa-lib-1.0.11rc1.orig/src/alisp/alisp.c 2005-01-19 15:56:31.000000000 +0200 +++ alsa-lib-1.0.11rc1/src/alisp/alisp.c 2005-12-17 16:51:54.000000000 +0200 @@ -30,7 +30,6 @@ #include #include #include -#include #define alisp_seq_iterator alisp_object diff -Nur alsa-lib-1.0.11rc1.orig/src/names.c alsa-lib-1.0.11rc1/src/names.c --- alsa-lib-1.0.11rc1.orig/src/names.c 2005-06-06 17:01:13.000000000 +0300 +++ alsa-lib-1.0.11rc1/src/names.c 2005-12-17 16:52:03.000000000 +0200 @@ -31,7 +31,6 @@ */ #include -#include #include #include #include diff -Nur alsa-lib-1.0.11rc1.orig/src/userfile.c alsa-lib-1.0.11rc1/src/userfile.c --- alsa-lib-1.0.11rc1.orig/src/userfile.c 2005-12-05 16:27:28.000000000 +0200 +++ alsa-lib-1.0.11rc1/src/userfile.c 2005-12-17 16:47:45.000000000 +0200 @@ -61,11 +61,31 @@ } #else /* !HAVE_WORDEXP_H */ +#include +#include + /* just copy the string - would be nicer to expand by ourselves, though... */ int snd_user_file(const char *file, char **result) { - *result = strdup(file); - if (! *result) + glob_t globbuf; + int err; + + assert(file && result); + err = glob(file, 0, NULL, &globbuf); + switch (err) { + case GLOB_NOSPACE: + return -ENOMEM; + case 0: + if (globbuf.gl_pathc == 1) + break; + /* Fall through */ + default: + globfree(&globbuf); + return -EINVAL; + } + *result = strdup(globbuf.gl_pathv[0]); + globfree(&globbuf); + if (*result == NULL) return -ENOMEM; return 0; } geexbox-1.0/packages/alsa-lib/patches/20_reduce.diff0000644000175000017500000000201710446314257021316 0ustar aurelaureldiff -Naur alsa-lib-1.0.4.orig/include/error.h alsa-lib-1.0.4/include/error.h --- alsa-lib-1.0.4.orig/include/error.h 2004-04-27 00:16:40.000000000 +0200 +++ alsa-lib-1.0.4/include/error.h 2004-04-27 00:19:31.000000000 +0200 @@ -61,11 +61,11 @@ extern int snd_lib_error_set_handler(snd_lib_error_handler_t handler); #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95) -#define SNDERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, __VA_ARGS__) /**< Shows a sound error message. */ -#define SYSERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, __VA_ARGS__) /**< Shows a system error message (related to \c errno). */ +#define SNDERR(...) +#define SYSERR(...) #else -#define SNDERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, ##args) /**< Shows a sound error message. */ -#define SYSERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, ##args) /**< Shows a system error message (related to \c errno). */ +#define SNDERR(args...) +#define SYSERR(args...) #endif /** \} */ geexbox-1.0/packages/alsa-lib/url0000644000175000017500000000007310446314257016012 0ustar aurelaurelftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.0.11.tar.bz2 geexbox-1.0/packages/alsa-utils/0000755000175000017500000000000010446314257015657 5ustar aurelaurelgeexbox-1.0/packages/alsa-utils/build0000755000175000017500000000037310446314257016707 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build alsa-lib cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --disable-dependency-tracking \ --disable-alsamixer make -C amixer geexbox-1.0/packages/alsa-utils/init.d/0000755000175000017500000000000010446314257017044 5ustar aurelaurelgeexbox-1.0/packages/alsa-utils/init.d/40_alsa0000755000175000017500000000414710446314257020223 0ustar aurelaurel#!/bin/sh # # setup alsa (especially the mixer config) # # runlevels: geexbox, debug echo "### Setting up sound card ###" # include audio configuration file . /etc/audio echo "" > /etc/asound.conf mixer() { parm=${3:-on} amixer -c $ALSA_CARD sset "$1" "$2" $parm >/dev/null 2>&1 amixer -c $ALSA_CARD sset "$1" $parm >/dev/null 2>&1 } # set alsa channel mode (6ch, 4ch, 2ch) mixer 'Channel Mode' "${CHANNELS}ch" # set common mixer params mixer Master 90% mixer Front 75% mixer PCM 90% mixer Synth 90% # mute CD, since using digital audio instead mixer CD 0% mute # Only unmute Line and Aux if they are possibly used. if [ -e /var/use_dxr3 -o -e /var/tvcard -o -e /var/dvbcard -o -e /var/digimatrix ]; then mixer Line 90% mixer Aux 90% else mixer Line 0% mute mixer Aux 0% mute fi # mute mic mixer Mic 0% mute # ESS 1969 chipset has 2 PCM channels mixer PCM,1 90% # Trident/YMFPCI/emu10k1 mixer Wave 100% mixer Music 100% mixer AC97 100% mixer Surround 90% mixer 'Surround Digital' 90% mixer 'Wave Surround' 90% if [ "$CHANNELS" = 6 ]; then mixer 'Duplicate Front' 0% off else mixer 'Duplicate Front' 90% fi mixer 'Sigmatel 4-Speaker Stereo' 90% # CS4237B chipset: mixer 'Master Digital' 90% # DRC mixer 'Dynamic Range Compression' 90% # Envy24 chips with analog outs mixer DAC 90% mixer DAC,0 90% mixer DAC,1 90% # some notebooks use headphone instead of master mixer Headphone 90% mixer 'Internal Speaker' 75% mixer Playback 100% mixer Center 90% mixer LFE 90% mixer Center/LFE 90% # Required for either Analog or Digital output mixer 'SB Live Analog/Digital Output Jack' $SBL_AUDIGY mixer 'Audigy Analog/Digital Output Jack' $SBL_AUDIGY # set SPDIF mixer params if [ "$SOUNDCARD_MODE" = SPDIF ]; then mixer 'IEC958' 90% mixer 'IEC958 Output' 90% mixer 'IEC958 Playback AC97-SPSA' $AC97_SPSA mixer 'IEC958 Coaxial' 90% mixer 'IEC958 LiveDrive' 90% mixer 'IEC958 Optical Raw' 90% mixer 'SPDIF Out' 90% mixer 'SPDIF Front' 90% mixer 'SPDIF Rear' 90% mixer 'SPDIF Center/LFE' 90% else mixer 'SPDIF Out' 0% off mixer 'Analog Front' 90% mixer 'Analog Rear' 90% mixer 'Analog Center/LFE' 90% fi exit 0 geexbox-1.0/packages/alsa-utils/install0000755000175000017500000000014410446314257017252 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/amixer/amixer $INSTALL/usr/bin geexbox-1.0/packages/alsa-utils/url0000644000175000017500000000007710446314260016402 0ustar aurelaurelftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.0.11.tar.bz2 geexbox-1.0/packages/atitvout/0000755000175000017500000000000010446314260015452 5ustar aurelaurelgeexbox-1.0/packages/atitvout/arch0000644000175000017500000000000510446314260016305 0ustar aurelaureli386 geexbox-1.0/packages/atitvout/build0000755000175000017500000000026010446314260016475 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build lrmi make -C $BUILD/$1* \ CFLAGS="$CFLAGS -I$LIB_PREFIX/include/lrmi" \ $1 $STRIP $BUILD/$1*/$1 geexbox-1.0/packages/atitvout/patches/0000755000175000017500000000000010446314260017101 5ustar aurelaurelgeexbox-1.0/packages/atitvout/patches/10_use-system-lrmi-fix.diff0000644000175000017500000000153010446314260024075 0ustar aurelaureltaken from: http://amd.colony.ee/pmwiki.php?pagename=Main.Atitvout atitvout-use-system-lrmi-fix.patch --- atitvout.orig/Makefile 2004-04-10 14:05:02.000000000 +0300 +++ atitvout/Makefile 2004-04-20 08:10:29.624321736 +0300 @@ -1,5 +1,5 @@ VERSION=0.4 -CFLAGS=-Wall -O2 -g -DVERSION=\"$(VERSION)\" -I./lrmi-0.6 +CFLAGS=-Wall -O2 -g -DVERSION=\"$(VERSION)\" OBJS=atitvout.o ati.o vbeinfo.o vbecall.o mach64.o radeon.o TAR=atitvout-$(VERSION).tar.gz BINARY=atitvout @@ -8,8 +8,7 @@ all: $(BINARY) $(BINARY): $(OBJS) - make -C lrmi-0.6 - $(CC) $(OBJS) lrmi-0.6/liblrmi.a -o $(BINARY) + $(CC) $(OBJS) -o $(BINARY) -llrmi strip: $(BINARY) @du -h $(BINARY) @@ -18,7 +17,6 @@ clean: rm -f *.o $(BINARY) *~ README index.html *.tar.gz test.out - make -C lrmi-0.6 clean install: strip install -g root -o root -m 555 $(BINARY) /usr/local/sbin geexbox-1.0/packages/atitvout/patches/20_models.diff0000664000175000017500000000174710446314260021532 0ustar aurelaureltaken from Fedora atitvout source rpm --- atitvout.orig/atitvout.c 2002-09-16 22:37:08.000000000 +0300 +++ atitvout/atitvout.c 2004-07-23 21:43:27.426417887 +0300 @@ -118,8 +118,20 @@ } else { if (strncmp(oem, "ATI MACH64", 10) == 0) radeon = 0; + /* From http://amd.colony.ee/pmwiki.php?pagename=Main.Atitvout */ + else if (strncmp(oem, "ATI MOBILE M3", 13) == 0) + radeon = 0; + /* From Ville S */ + else if (strcmp(oem, "ATI MOBILITY RADEON") == 0) + radeon = 0; + /* From NetBSD package */ + else if (strcmp(oem, "ATI MOBILITY RADEON 9000") == 0) + radeon = 0; else if (strncmp(oem, "ATI RAGE128", 11) == 0) radeon = 1; + /* From Ville S */ + else if (strcmp(oem, "ATI RV200") == 0) + radeon = 1; /* Note: Also it's possible to have here 'RG6' for first radeons */ else if (strstr(oem, "RADEON") != 0) radeon = 1; geexbox-1.0/packages/atitvout/url0000644000175000017500000000010110446314260016167 0ustar aurelaurelhttp://0pointer.de/lennart/projects/atitvout/atitvout-0.4.tar.gz geexbox-1.0/packages/autoplay/0000755000175000017500000000000010446314260015431 5ustar aurelaurelgeexbox-1.0/packages/autoplay/config/0000775000175000017500000000000010446314260016700 5ustar aurelaurelgeexbox-1.0/packages/autoplay/config/autoplay0000664000175000017500000000011010446314260020451 0ustar aurelaurel# Configure system to autoplay when automounting media. AUTOPLAY="yes" geexbox-1.0/packages/autoplay/install0000755000175000017500000000024510446314260017026 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/etc cp $PACKAGES/$1/config/autoplay $INSTALL/etc mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/$1 $INSTALL/usr/bin exit 0 geexbox-1.0/packages/autoplay/sources/0000755000175000017500000000000010446314260017114 5ustar aurelaurelgeexbox-1.0/packages/autoplay/sources/autoplay.c0000644000175000017500000004044710446314260021127 0ustar aurelaurel/* autoplay.c v0.0.6 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef MNT_DETACH #define MNT_DETACH 0x00000002 /* Just detach from the tree */ #endif static char *xcd_exts[] = {"dat", NULL}; static char **exts; static char *playlist = NULL; static int playlist_len = 0; typedef struct _cd_drive { char *dev; char *mnt; int fd; int status; }*cd_drive; static char ** get_extensions (char *filename) { char **extensions, ext[32]; FILE *fp; int n = 1; if (filename == NULL) return NULL; fp = fopen (filename, "r"); if (fp == NULL) return NULL; extensions = (char **) malloc (sizeof (*extensions)); *extensions = NULL; while (fgets (ext, sizeof (ext), fp)) { char **l, *e; int s = strlen (ext); if (ext[s-1] == '\n') { ext[s-1] = '\0'; s--; } e = (char *) malloc (s + 1); extensions = (char **) realloc (extensions, ++n * sizeof (*extensions)); extensions = (char **) realloc (extensions, ++n * sizeof (*extensions)); strcpy (e, ext); for (l=extensions; *l; l++); *l++ = e; *l = NULL; } fclose (fp); return extensions; } static void free_extensions (char **extensions) { if (extensions != NULL) { char **l = extensions; while (*l) free (*l++); free (extensions); } } static char *fullname; static int fullname_maxlen; static int fullname_len; static void escape_playlist (const char *str, int second_level) { int is_playlist_str = (str == playlist); char *new_str; int new_len, len; if (!str) return; for (new_len = 0, len = 0; *str; str++) switch (*str) { case '\'': if (second_level) new_len+=6; case '\\': new_len++; default: new_len++; len++; break; } if (new_len == len && is_playlist_str) return; if (playlist_len < new_len + 1) { playlist_len = new_len + 1; playlist = (char *) realloc (playlist, playlist_len); if (is_playlist_str) str = &playlist[len]; } new_str = &playlist[new_len]; len++; /* for null character */ while (len--) switch (*str) { case '\'': if (second_level) { /* ' -> \'\\\'\' */ *new_str-- = '\''; *new_str-- = '\\'; /* \' */ *new_str-- = '\''; *new_str-- = '\\'; /* \' */ *new_str-- = '\\'; *new_str-- = '\\'; /* \\ */ } case '\\': *new_str-- = *str--; *new_str-- = '\\'; break; default: *new_str-- = *str--; break; } } static int is_playable (const struct dirent *dir) { char **str, *ext; struct stat st; if (*dir->d_name == '.') return 0; strcpy (fullname+fullname_len, dir->d_name); stat (fullname, &st); if (S_ISDIR(st.st_mode) && strcmp (dir->d_name, "GEEXBOX")) return 1; ext = strrchr (dir->d_name, '.'); if (ext++ == NULL) return 0; for (str=exts; *str; str++) if (!strcasecmp (ext, *str)) return 1; return 0; } static int build_playlist (char *dir, int fd) { struct dirent **namelist; int i, n, len, dirlen, count=0; struct stat st; if (dir) { dirlen = strlen (dir); if (dirlen + 2 > fullname_maxlen) { fullname = (char *) realloc (fullname, dirlen + 2); fullname_maxlen = dirlen + 2; } strcpy (fullname, dir); } strcat (fullname, "/"); fullname_len = dirlen = strlen (fullname); n = scandir (fullname, &namelist, is_playable, alphasort); if (n < 0) return 0; for (i=0; i fullname_maxlen) { fullname = (char *) realloc (fullname, len + 1); fullname_maxlen = len + 1; } strcpy (fullname+dirlen, namelist[i]->d_name); stat (fullname, &st); if (S_ISDIR(st.st_mode)) count += build_playlist (NULL, fd); else { if (fd == -1) { if (playlist == NULL) { playlist_len = strlen (fullname) + 1; playlist = (char *) malloc (playlist_len); } else if (playlist_len < strlen (fullname) + 1) { playlist_len = strlen (fullname) + 1; playlist = (char *) realloc (playlist, playlist_len); } strcpy (playlist, fullname); } else { write (fd, fullname, len-1); write (fd, "\n", 1); } count++; } free (namelist[i]); } free (namelist); return count; } static int open_device(const char *dev) { int fd = open(dev, O_RDONLY | O_NONBLOCK); if (fd >= 0) ioctl(fd, CDROM_LOCKDOOR, 0); return fd; } static int mntlock_fd = -1; static int mntlock(void) { if (mntlock_fd != -1 || (mntlock_fd = open("/tmp/mntlock", O_RDONLY | O_CREAT)) != -1) { if (!flock(mntlock_fd, LOCK_EX)) return 1; close(mntlock_fd); /* locking failed, try to reopen file next time */ mntlock_fd = -1; } return 0; } static void mntunlock(void) { if (flock(mntlock_fd, LOCK_UN)) { /* freeing lock failed, close fd instand */ close(mntlock_fd); mntlock_fd = -1; } } static int is_cdrom_mounted(cd_drive drive) { char buf[PATH_MAX]; size_t devlen; FILE *f; devlen = strlen(drive->dev); f = fopen("/proc/mounts", "r"); if (f) { while (!feof(f)) { if (fgets(buf, sizeof(buf), f) && !strncmp(buf, drive->dev, devlen) && buf[devlen] == ' ') { fclose(f); return 1; } } fclose(f); } return 0; } static void umount_cdrom(cd_drive drive) { if (umount2(drive->mnt, MNT_DETACH) < 0 && errno == EBUSY) { do { usleep(1000000); } while (umount(drive->mnt) < 0 && errno == EBUSY); } } static char **fstype_list = NULL; static void load_proc_filesystems(void) { char buf[255], *fstype; size_t n = 0, len; FILE *f; f = fopen("/proc/filesystems", "r"); if (f) { while (!feof(f)) { if (fgets(buf, sizeof(buf), f) && buf[0] == '\t') { len = strlen(buf); if (buf[len-1] == '\n') buf[--len] = '\0'; fstype = (char*) malloc(len); strcpy(fstype, &buf[1]); // skip the first tab char fstype_list = (char **) realloc(fstype_list, ++n * sizeof(*fstype_list)); fstype_list[n-1] = fstype; } } fclose(f); if (n) { fstype_list = (char **)realloc(fstype_list, ++n * sizeof(*fstype_list)); fstype_list[n-1] = NULL; } } } static int mount_cdrom(cd_drive drive) { char **fstype; if (drive->fd != -1) { close(drive->fd); drive->fd = -1; } for (fstype = fstype_list; *fstype; fstype++) { if (!mount(drive->dev, drive->mnt, *fstype, MS_RDONLY | MS_NOSUID | MS_NODEV | MS_NOEXEC, NULL)) return 1; } return 0; } static cd_drive * load_mnts(int init) { cd_drive drive, *drives; char buf[PATH_MAX], *tmp; int n; FILE *f; if (!mntlock()) return NULL; drives = NULL; n = 0; f = fopen("/etc/mnts", "r"); if (f) { while (!feof(f)) { if (!fgets(buf, sizeof(buf), f)) continue; if ((tmp = strchr(buf, '\n'))) *tmp = '\0'; if (!(tmp = strchr(buf, '\t'))) continue; *tmp++ = '\0'; if (strncmp(buf, "/dev/cdrom", sizeof("/dev/cdrom")-1)) continue; drive = (cd_drive) malloc(sizeof(*drive)); drive->dev = malloc (strlen (buf) + 1); strcpy (drive->dev, buf); drive->mnt = malloc (strlen (tmp) + 1); strcpy(drive->mnt, tmp); drive->fd = -1; if (init) { if (is_cdrom_mounted(drive)) umount_cdrom(drive); drive->status = CDS_NO_DISC; } else { drive->status = is_cdrom_mounted(drive) ? CDS_DISC_OK : CDS_NO_DISC; } drives = (cd_drive *)realloc(drives, ++n * sizeof(*drives)); drives[n-1] = drive; } fclose(f); if (n) { drives = (cd_drive *)realloc(drives, ++n * sizeof(*drives)); drives[n-1] = NULL; } } mntunlock(); return drives; } int main (int argc, char **argv) { cd_drive drive, *drives, *ptr; char **file_exts, **playlist_exts, **img_exts; char *filename; char *play_dvd_cmd; struct stat st; struct stat st_ap; int n, status, speed=0, off_silent=0; time_t last_mtime = 0; filename = (char *) malloc (PATH_MAX + 10); fullname_maxlen = 1024; fullname = (char *) malloc (fullname_maxlen); if (!(argc&1)) speed = atoi (argv[argc-1]); load_proc_filesystems (); file_exts = get_extensions ("/etc/file_ext"); playlist_exts = get_extensions ("/etc/list_ext"); img_exts = get_extensions ("/etc/img_ext"); if (!fstype_list || !file_exts || !playlist_exts || !img_exts) return 2; if (!stat ("/var/use_dxr3", &st) && S_ISREG (st.st_mode)) play_dvd_cmd = "set_option dvd-device %s save\nquit 167\n"; else play_dvd_cmd = "set_option dvd-device %s save\nmenu hide\nplay_dvd\n"; drives = load_mnts(1); if (!drives) return 3; while (1) { usleep(1000000); if (!stat("/var/autoplay", &st_ap)) off_silent=0; else off_silent=1; if (!stat("/etc/mnts", &st) && st.st_mtime != last_mtime) { if (drives) { for (ptr=drives, drive=*ptr; drive; ptr++, drive=*ptr) { if (drive->fd >= 0) close(drive->fd); free(drive->dev); free(drive->mnt); free(drive); } free(drives); } drives = load_mnts(0); if (!drives) continue; last_mtime = st.st_mtime; } for (ptr=drives, drive=*ptr; drive; ptr++, drive=*ptr) { if (drive->status == CDS_NO_INFO) continue; if (drive->fd < 0 && (drive->fd = open_device(drive->dev)) < 0) continue; status = ioctl (drive->fd, CDROM_DRIVE_STATUS, CDSL_CURRENT); switch (status) { case CDS_DISC_OK: if (drive->status != status) { /* a media as been inserted */ drive->status = status; if (speed > 1 && speed < 100) ioctl (drive->fd, CDROM_SELECT_SPEED, speed); status = ioctl (drive->fd, CDROM_DISC_STATUS, CDSL_CURRENT); switch (status) { case CDS_AUDIO: /* it's an audio CD */ if (!off_silent) printf("set_option cdda-device %s save\nmenu hide\nplay_cdda\n", drive->dev); break; case CDS_NO_INFO: /* no information, but try to mount and detect */ case CDS_DATA_1: case CDS_DATA_2: /* it's a data CD */ if (!mount_cdrom(drive)) break; sprintf (filename, "%s/video_ts", drive->mnt); if (!stat (filename, &st) && S_ISDIR (st.st_mode)) { if (!off_silent) printf(play_dvd_cmd, drive->dev); break; } sprintf (filename, "%s/VIDEO_TS", drive->mnt); if (!stat (filename, &st) && S_ISDIR (st.st_mode)) { if (!off_silent) printf(play_dvd_cmd, drive->dev); break; } sprintf (filename, "%s/vcd", drive->mnt); if (!stat (filename, &st) && S_ISDIR (st.st_mode)) { if (!off_silent) printf("set_option vcd-device %s save\nmenu hide\nplay_vcd\n", drive->dev); break; } sprintf (filename, "%s/svcd", drive->mnt); if (!stat (filename, &st) && S_ISDIR (st.st_mode)) { if (!off_silent) printf("set_option vcd-device %s save\nmenu hide\nplay_vcd\n", drive->dev); break; } exts=playlist_exts; if (build_playlist (drive->mnt, -1) == 1) { escape_playlist(playlist, 0); if (!off_silent) printf ("menu hide\nloadlist '%s'\n", playlist); } else { char *playlist = "/tmp/playlist.pls"; int fd = open (playlist, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR); if (fd < 0) return 1; exts=file_exts; n = build_playlist (drive->mnt, fd); if (n > 0) if (!off_silent) printf ("menu hide\nloadlist %s\n", playlist); close (fd); if (n <= 0) { exts=img_exts; if (build_playlist (drive->mnt, -1) > 0) { escape_playlist(drive->mnt, 1); if (!off_silent) printf ("run 'view_img -r \\'%s\\''\n", playlist); } else { exts=xcd_exts; if (build_playlist (drive->mnt, -1) >= 1) if (!off_silent) printf ("set_option vcd-device %s save\nmenu hide\nplay_vcd\n", drive->dev); } } } break; case CDS_MIXED: if (!off_silent) printf("set_option cdda-device %s save\nmenu hide\nplay_cdda\n", drive->dev); case CDS_XA_2_1: case CDS_XA_2_2: /* it's a special CD */ mount_cdrom(drive); break; case CDS_NO_DISC: /* no disc, refresh the drive. */ default: drive->status = CDS_NO_DISC; close(drive->fd); drive->fd = -1; break; } fflush (stdout); } break; case -1: /* close the fd on ioctl failure, should never happen */ case CDS_NO_INFO: /* Drive do not support status request :-( */ close(drive->fd); drive->fd = -1; default: /* the media as been ejected */ if (drive->status != status) { drive->status = status; umount_cdrom(drive); } } } } free_extensions (file_exts); free_extensions (playlist_exts); return 0; } geexbox-1.0/packages/bftpd/0000755000175000017500000000000010446314260014672 5ustar aurelaurelgeexbox-1.0/packages/bftpd/build0000755000175000017500000000042110446314260015714 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --without-debug \ --without-pax \ --without-libz \ --without-pam make LDFLAGS="$LDFLAGS" geexbox-1.0/packages/bftpd/config/0000755000175000017500000000000010446314260016137 5ustar aurelaurelgeexbox-1.0/packages/bftpd/config/bftpd.conf0000644000175000017500000000022110446314260020100 0ustar aurelaurelglobal { PORT="21" HELLO_STRING="Welcome to GeeXboX's FTP Server." AUTO_CHDIR="/" DO_CHROOT="no" RATIO="none" ANONYMOUS_USER="yes" } geexbox-1.0/packages/bftpd/init.d/0000755000175000017500000000000010446314260016057 5ustar aurelaurelgeexbox-1.0/packages/bftpd/init.d/54_ftp0000755000175000017500000000040510446314260017105 0ustar aurelaurel#!/bin/sh # # start ftp server # # runlevels: geexbox, debug # get options test -f /etc/network || exit 1 . /etc/network if test "$FTP_SERVER" = "yes" -a -f /etc/bftpd.conf; then echo "### Starting FTP server ###" bftpd -d -c /etc/bftpd.conf & fi exit 0 geexbox-1.0/packages/bftpd/install0000755000175000017500000000023310446314260016264 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/usr/bin mkdir -p $INSTALL/etc cp $BUILD/$1*/$1 $INSTALL/usr/bin cp $PACKAGES/$1/config/$1.conf $INSTALL/etc geexbox-1.0/packages/bftpd/patches/0000755000175000017500000000000010446314260016321 5ustar aurelaurelgeexbox-1.0/packages/bftpd/patches/10_noauth.diff0000644000175000017500000000326310446314260020755 0ustar aurelaurel--- bftpd-1.3/commands.c.orig 2006-04-11 22:38:49.000000000 +0800 +++ bftpd-1.3/commands.c 2006-04-11 22:39:24.000000000 +0800 @@ -166,17 +166,14 @@ void init_userinfo() { - struct passwd *temp = getpwnam(user); - if (temp) { - userinfo.pw_name = strdup(temp->pw_name); - userinfo.pw_passwd = strdup(temp->pw_passwd); - userinfo.pw_uid = temp->pw_uid; - userinfo.pw_gid = temp->pw_gid; - userinfo.pw_gecos = strdup(temp->pw_gecos); - userinfo.pw_dir = strdup(temp->pw_dir); - userinfo.pw_shell = strdup(temp->pw_shell); - userinfo_set = 1; - } + userinfo.pw_name = strdup("geexbox"); + userinfo.pw_passwd = strdup("ftp"); + userinfo.pw_uid = 0; + userinfo.pw_gid = 0; + userinfo.pw_gecos = strdup(""); + userinfo.pw_dir = strdup("/"); + userinfo.pw_shell = strdup("/bin/sh"); + userinfo_set = 1; } void command_user(char *username) --- bftpd-1.3/login.c.orig 2006-04-11 22:39:10.000000000 +0800 +++ bftpd-1.3/login.c 2006-04-11 22:40:47.000000000 +0800 @@ -186,10 +186,6 @@ char str[256]; char *foo; int maxusers; - if (!getpwnam(user)) { - control_printf(SL_FAILURE, "421 Login incorrect."); - exit(0); - } if (strncasecmp(foo = config_getoption("DENY_LOGIN"), "no", 2)) { if (foo[0] != '\0') { if (strncasecmp(foo, "yes", 3)) @@ -224,12 +220,6 @@ exit(0); } - if(checkuser() || checkshell()) { - control_printf(SL_FAILURE, "421 Login incorrect."); - exit(0); - } - if (checkpass(password)) - return 1; if (strcasecmp((char *) config_getoption("RATIO"), "none")) { sscanf((char *) config_getoption("RATIO"), "%i/%i", &ratio_send, &ratio_recv); geexbox-1.0/packages/bftpd/patches/20_rw-switch.diff0000644000175000017500000001245010446314260021405 0ustar aurelaurel--- bftpd-1.3/commands.c.orig 2006-04-11 22:42:34.000000000 +0800 +++ bftpd-1.3/commands.c 2006-04-11 22:51:46.000000000 +0800 @@ -85,6 +85,57 @@ bftpd_statuslog(3, success, "%s", buffer); } +static void rw_ro(char *script, char *path) +{ + pid_t pid; + sighandler_t save_quit, save_int, save_chld; + + save_quit = signal(SIGQUIT, SIG_IGN); + save_int = signal(SIGINT, SIG_IGN); + save_chld = signal(SIGCHLD, SIG_DFL); + + if ((pid = vfork()) < 0) { + signal(SIGQUIT, save_quit); + signal(SIGINT, save_int); + signal(SIGCHLD, save_chld); + return; + } + if (pid == 0) { + char *const argv[] = { script, path, NULL }; + + signal(SIGQUIT, SIG_DFL); + signal(SIGINT, SIG_DFL); + signal(SIGCHLD, SIG_DFL); + + execv(script, argv); + _exit(127); + } + + /* Signals are not absolutly guarenteed with vfork */ + signal(SIGQUIT, SIG_IGN); + signal(SIGINT, SIG_IGN); + + do { + pid = wait4(pid, NULL, 0, NULL); + } while (pid == -1 && errno == EINTR); + + signal(SIGQUIT, save_quit); + signal(SIGINT, save_int); + signal(SIGCHLD, save_chld); + + return; +} + +static inline void rw(char *path) +{ + rw_ro("/usr/bin/rw", path); +} + +static inline void ro(char *path) +{ + rw_ro("/usr/bin/ro", path); +} + void new_umask() { int um; @@ -484,6 +535,7 @@ struct timeval tv; char *p, *pp; char *mapped = bftpd_cwd_mappath(filename); + rw(mapped); int my_buffer_size; /* total transfer buffer size divided by number of clients */ int num_clients; /* number of clients connected to the server */ @@ -532,12 +584,13 @@ if (! attempt_gzip) { fd = open(mapped, flags, 00666); - if (mapped) - free(mapped); if (fd == -1) { bftpd_log("Error: '%s' while trying to store file '%s'.\n", strerror(errno), filename); control_printf(SL_FAILURE, "553 Error: %s.", strerror(errno)); + close(fd); + ro(mapped); + free(mapped); return; } } @@ -560,7 +613,12 @@ bftpd_log("Client is storing file '%s'.\n", filename); if (dataconn()) + { + close(fd); + ro(mapped); + free(mapped); return; + } /* Figure out how big the transfer buffer should be. This will be the total size divided by the number of clients connected. @@ -597,6 +655,7 @@ if (!select(max, &rfds, NULL, NULL, &tv)) { close(sock); close(fd); + ro(mapped); control_printf(SL_FAILURE, "426 Kicked due to data transmission timeout."); bftpd_log("Kicked due to data transmission timeout.\n"); /* Before we exit, let's remove our entry in the log file. -- Jesse */ @@ -607,6 +666,9 @@ test_abort(0, fd, sock); if (buffer) free(buffer); + close(fd); + ro(mapped); + free(mapped); return; } @@ -663,6 +725,8 @@ #endif close(sock); + ro(mapped); + free(mapped); alarm(control_timeout); offset = 0; control_printf(SL_SUCCESS, "226 File transmission successful."); @@ -1128,6 +1192,7 @@ void command_dele(char *filename) { char *mapped = bftpd_cwd_mappath(filename); + rw(mapped); if (unlink(mapped)) { bftpd_log("Error: '%s' while trying to delete file '%s'.\n", strerror(errno), filename); @@ -1136,12 +1201,14 @@ bftpd_log("Deleted file '%s'.\n", filename); control_printf(SL_SUCCESS, "200 OK"); } + ro(mapped); free(mapped); } void command_mkd(char *dirname) { char *mapped = bftpd_cwd_mappath(dirname); + rw(mapped); if (mkdir(mapped, 0755)) { bftpd_log("Error: '%s' while trying to create directory '%s'.\n", strerror(errno), dirname); @@ -1150,12 +1217,14 @@ bftpd_log("Created directory '%s'.\n", dirname); control_printf(SL_SUCCESS, "257 \"%s\" has been created.", dirname); } + ro(mapped); free(mapped); } void command_rmd(char *dirname) { char *mapped = bftpd_cwd_mappath(dirname); + rw(mapped); if (rmdir(mapped)) { bftpd_log("Error: '%s' while trying to remove directory '%s'.\n", strerror(errno), dirname); @@ -1164,6 +1233,7 @@ bftpd_log("Removed directory '%s'.\n", dirname); control_printf(SL_SUCCESS, "250 OK"); } + ro(mapped); free(mapped); } @@ -1192,6 +1262,8 @@ void command_rnto(char *newname) { char *mapped = bftpd_cwd_mappath(newname); + rw(philename); + rw(mapped); if (rename(philename, mapped)) { bftpd_log("Error: '%s' while trying to rename '%s' to '%s'.\n", strerror(errno), philename, bftpd_cwd_mappath(newname)); @@ -1203,6 +1275,8 @@ } free(philename); free(mapped); + ro(mapped); + ro(philename); philename = NULL; } @@ -1252,6 +1326,7 @@ return; } mapped = bftpd_cwd_mappath(strdup(strchr(params, ' ') + 1)); + rw(mapped); *strchr(params, ' ') = '\0'; sscanf(params, "%o", &permissions); if (chmod(mapped, permissions)) @@ -1261,6 +1336,7 @@ permissions); control_printf(SL_SUCCESS, "200 CHMOD successful."); } + ro(mapped); free(mapped); } @@ -1291,6 +1367,7 @@ return; } mapped = bftpd_cwd_mappath(filename); + rw(mapped); if (chown(mapped, uid, gid)) control_printf(SL_FAILURE, "550 Error: %s.", strerror(errno)); else { @@ -1298,6 +1375,7 @@ gid); control_printf(SL_SUCCESS, "200 CHOWN successful."); } + ro(mapped); free(mapped); } geexbox-1.0/packages/bftpd/url0000644000175000017500000000007610446314260015422 0ustar aurelaurelhttp://freshmeat.net/redir/bftpd/712/url_tgz/bftpd-1.4.tar.gz geexbox-1.0/packages/binutils/0000755000175000017500000000000010446314260015424 5ustar aurelaurelgeexbox-1.0/packages/binutils/build0000755000175000017500000000052310446314260016451 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/install ccache setup_toolchain host cd $BUILD/$1* mkdir -p objdir cd objdir ../configure --host=$HOST_NAME \ --build=$HOST_NAME \ --target=$TARGET_NAME \ --prefix=$ROOT/$TOOLCHAIN \ --with-sysroot=$SYSROOT_PREFIX \ --disable-nls make geexbox-1.0/packages/binutils/install0000755000175000017500000000015710446314260017023 0ustar aurelaurel#!/bin/sh . config/options make -C $BUILD/$1*/objdir install cp $PACKAGES/$1/scripts/libstrip $TOOLCHAIN/bin geexbox-1.0/packages/binutils/patches/0000755000175000017500000000000010446314260017053 5ustar aurelaurelgeexbox-1.0/packages/binutils/patches/10_uclibc-conf.diff0000644000175000017500000004773010446314260022404 0ustar aurelaureldiff -ur binutils-2.15.97.orig/bfd/config.bfd binutils-2.15.97/bfd/config.bfd --- binutils-2.15.97.orig/bfd/config.bfd 2005-04-29 20:48:14.000000000 -0400 +++ binutils-2.15.97/bfd/config.bfd 2005-04-29 20:53:50.000000000 -0400 @@ -140,7 +140,7 @@ targ_defvec=ecoffalpha_little_vec targ_selvecs=bfd_elf64_alpha_vec ;; - alpha*-*-linux-gnu* | alpha*-*-elf*) + alpha*-*-linux-* | alpha*-*-elf*) targ_defvec=bfd_elf64_alpha_vec targ_selvecs=ecoffalpha_little_vec ;; @@ -150,7 +150,7 @@ alpha*-*-*) targ_defvec=ecoffalpha_little_vec ;; - ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu) + ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_ia64_little_vec targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" ;; @@ -227,7 +227,7 @@ targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec ;; - armeb-*-elf | arm*b-*-linux-gnu*) + armeb-*-elf | arm*b-*-linux-*) targ_defvec=bfd_elf32_bigarm_vec targ_selvecs=bfd_elf32_littlearm_vec ;; @@ -235,7 +235,7 @@ targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec ;; - arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \ + arm-*-elf | arm-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \ arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \ arm*-*-eabi* ) targ_defvec=bfd_elf32_littlearm_vec @@ -385,7 +385,7 @@ ;; #ifdef BFD64 - hppa*64*-*-linux-gnu*) + hppa*64*-*-linux-*) targ_defvec=bfd_elf64_hppa_linux_vec targ_selvecs=bfd_elf64_hppa_vec ;; @@ -396,7 +396,7 @@ ;; #endif - hppa*-*-linux-gnu*) + hppa*-*-linux-*) targ_defvec=bfd_elf32_hppa_linux_vec targ_selvecs=bfd_elf32_hppa_vec ;; @@ -529,7 +529,7 @@ targ_selvecs=bfd_elf32_i386_vec targ_underscore=yes ;; - i[3-7]86-*-linux-gnu*) + i[3-7]86-*-linux-*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" targ64_selvecs=bfd_elf64_x86_64_vec @@ -543,7 +543,7 @@ targ_defvec=bfd_elf64_x86_64_vec targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" ;; - x86_64-*-linux-gnu*) + x86_64-*-linux-*) targ_defvec=bfd_elf64_x86_64_vec targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" ;; @@ -719,7 +719,7 @@ targ_selvecs=bfd_elf32_m68k_vec targ_underscore=yes ;; - m68*-*-linux-gnu*) + m68*-*-linux-*) targ_defvec=bfd_elf32_m68k_vec targ_selvecs=m68klinux_vec ;; @@ -1005,7 +1005,7 @@ ;; #endif powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ - powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ + powerpc-*-solaris2* | powerpc-*-linux-* | powerpc-*-rtems* | \ powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*) targ_defvec=bfd_elf32_powerpc_vec targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" @@ -1042,7 +1042,7 @@ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" ;; powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ - powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\ + powerpcle-*-solaris2* | powerpcle-*-linux-* | powerpcle-*-vxworks* |\ powerpcle-*-rtems*) targ_defvec=bfd_elf32_powerpcle_vec targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" @@ -1213,7 +1213,7 @@ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" targ_underscore=yes ;; - sparc-*-linux-gnu*) + sparc-*-linux-*) targ_defvec=bfd_elf32_sparc_vec targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec" ;; @@ -1260,7 +1260,7 @@ targ_defvec=sunos_big_vec targ_underscore=yes ;; - sparc64-*-linux-gnu*) + sparc64-*-linux-*) targ_defvec=bfd_elf64_sparc_vec targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec" ;; @@ -1329,7 +1329,7 @@ targ_underscore=yes ;; - vax-*-linux-gnu*) + vax-*-linux-*) targ_defvec=bfd_elf32_vax_vec ;; diff -ur binutils-2.15.97.orig/bfd/configure binutils-2.15.97/bfd/configure --- binutils-2.15.97.orig/bfd/configure 2005-04-29 20:48:14.000000000 -0400 +++ binutils-2.15.97/bfd/configure 2005-04-29 20:53:50.000000000 -0400 @@ -9918,7 +9918,7 @@ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) COREFILE='' ;; - alpha*-*-linux-gnu*) + alpha*-*-linux-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/alphalinux.h"' ;; @@ -9982,7 +9982,7 @@ COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386mach3.h"' ;; - i[3-7]86-*-linux-gnu*) + i[3-7]86-*-linux-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386linux.h"' ;; @@ -10020,7 +10020,7 @@ COREFILE=trad-core.lo TRAD_HEADER='"hosts/hp300bsd.h"' ;; - m68*-*-linux-gnu*) + m68*-*-linux-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/m68klinux.h"' ;; @@ -10154,7 +10154,7 @@ COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' ;; - vax-*-linux-gnu*) + vax-*-linux-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxlinux.h"' ;; diff -ur binutils-2.15.97.orig/bfd/configure.in binutils-2.15.97/bfd/configure.in --- binutils-2.15.97.orig/bfd/configure.in 2005-04-29 20:48:14.000000000 -0400 +++ binutils-2.15.97/bfd/configure.in 2005-04-29 20:53:50.000000000 -0400 @@ -163,7 +163,7 @@ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) COREFILE='' ;; - alpha*-*-linux-gnu*) + alpha*-*-linux-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/alphalinux.h"' ;; @@ -248,7 +248,7 @@ TRAD_HEADER='"hosts/i386mach3.h"' ;; changequote(,)dnl - i[3-7]86-*-linux-gnu*) + i[3-7]86-*-linux-*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386linux.h"' @@ -289,7 +289,7 @@ COREFILE=trad-core.lo TRAD_HEADER='"hosts/hp300bsd.h"' ;; - m68*-*-linux-gnu*) + m68*-*-linux-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/m68klinux.h"' ;; @@ -375,7 +375,7 @@ COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' ;; - vax-*-linux-gnu*) + vax-*-linux-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxlinux.h"' ;; diff -ur binutils-2.15.97.orig/gas/configure binutils-2.15.97/gas/configure --- binutils-2.15.97.orig/gas/configure 2005-04-29 20:48:14.000000000 -0400 +++ binutils-2.15.97/gas/configure 2005-04-29 20:53:50.000000000 -0400 @@ -4462,7 +4462,7 @@ _ACEOF ;; - ppc-*-linux-gnu*) + ppc-*-linux-*) case "$endian" in big) ;; *) { { echo "$as_me:$LINENO: error: GNU/Linux must be configured big endian" >&5 diff -ur binutils-2.15.97.orig/gas/configure.in binutils-2.15.97/gas/configure.in --- binutils-2.15.97.orig/gas/configure.in 2005-04-29 20:48:14.000000000 -0400 +++ binutils-2.15.97/gas/configure.in 2005-04-29 20:53:50.000000000 -0400 @@ -161,7 +161,7 @@ AC_DEFINE(AIX_WEAK_SUPPORT, 1, [Define if using AIX 5.2 value for C_WEAKEXT.]) ;; - ppc-*-linux-gnu*) + ppc-*-linux-*) case "$endian" in big) ;; *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;; diff -ur binutils-2.15.97.orig/gas/configure.tgt binutils-2.15.97/gas/configure.tgt --- binutils-2.15.97.orig/gas/configure.tgt 2005-04-29 20:48:14.000000000 -0400 +++ binutils-2.15.97/gas/configure.tgt 2005-04-29 20:53:50.000000000 -0400 @@ -100,7 +100,7 @@ alpha-*-*vms*) fmt=evax ;; alpha-*-osf*) fmt=ecoff ;; alpha-*-linuxecoff*) fmt=ecoff ;; - alpha-*-linux-gnu*) fmt=elf em=linux ;; + alpha-*-linux-*) fmt=elf em=linux ;; alpha-*-netbsd*) fmt=elf em=nbsd ;; alpha-*-openbsd*) fmt=elf em=obsd ;; @@ -116,7 +116,7 @@ arm-*-conix*) fmt=elf ;; arm-*-linux*aout*) fmt=aout em=linux ;; arm-*-linux-gnueabi*) fmt=elf em=armlinuxeabi ;; - arm-*-linux-gnu*) fmt=elf em=linux ;; + arm-*-linux-*) fmt=elf em=linux ;; arm-*-uclinux*) fmt=elf em=linux ;; arm-*-netbsdelf*) fmt=elf em=nbsd ;; arm-*-*n*bsd*) fmt=aout em=nbsd ;; @@ -128,7 +128,7 @@ avr-*-*) fmt=elf ;; - cris-*-linux-gnu* | crisv32-*-linux-gnu*) + cris-*-linux-* | crisv32-*-linux-*) fmt=multi bfd_gas=yes em=linux ;; cris-*-* | crisv32-*-*) fmt=multi bfd_gas=yes ;; @@ -192,7 +192,7 @@ i386-*-linux*aout*) fmt=aout em=linux ;; i386-*-linux*oldld) fmt=aout em=linux ;; i386-*-linux*coff*) fmt=coff em=linux ;; - i386-*-linux-gnu*) fmt=elf em=linux ;; + i386-*-linux-*) fmt=elf em=linux ;; i386-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;; i386-*-sysv[45]*) fmt=elf ;; i386-*-solaris*) fmt=elf ;; @@ -238,7 +238,7 @@ ia64-*-elf*) fmt=elf ;; ia64-*-aix*) fmt=elf em=ia64aix ;; - ia64-*-linux-gnu*) fmt=elf em=linux ;; + ia64-*-linux-*) fmt=elf em=linux ;; ia64-*-hpux*) fmt=elf em=hpux ;; ia64-*-netbsd*) fmt=elf em=nbsd ;; @@ -265,7 +265,7 @@ m68k-*-rtems*) fmt=elf ;; m68k-*-hpux*) fmt=hp300 em=hp300 ;; m68k-*-linux*aout*) fmt=aout em=linux ;; - m68k-*-linux-gnu*) fmt=elf em=linux ;; + m68k-*-linux-*) fmt=elf em=linux ;; m68k-*-uclinux*) fmt=elf ;; m68k-*-gnu*) fmt=elf ;; m68k-*-netbsdelf*) fmt=elf em=nbsd ;; @@ -332,7 +332,7 @@ ppc-*-beos*) fmt=coff ;; ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;; ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;; - ppc-*-linux-gnu*) fmt=elf em=linux ;; + ppc-*-linux-*) fmt=elf em=linux ;; ppc-*-solaris*) fmt=elf ;; ppc-*-rtems*) fmt=elf ;; ppc-*-macos*) fmt=coff em=macos ;; @@ -340,7 +340,7 @@ ppc-*-kaos*) fmt=elf ;; ppc-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;; - s390-*-linux-gnu*) fmt=elf em=linux ;; + s390-*-linux-*) fmt=elf em=linux ;; s390-*-tpf*) fmt=elf ;; sh*-*-linux*) fmt=elf em=linux @@ -369,7 +369,7 @@ sparc-*-aout | sparc*-*-vxworks*) fmt=aout em=sparcaout ;; sparc-*-coff) fmt=coff ;; sparc-*-linux*aout*) fmt=aout em=linux ;; - sparc-*-linux-gnu*) fmt=elf em=linux ;; + sparc-*-linux-*) fmt=elf em=linux ;; sparc-fujitsu-none) fmt=aout ;; sparc-*-elf) fmt=elf ;; sparc-*-sysv4*) fmt=elf ;; @@ -398,7 +398,7 @@ vax-*-netbsdelf*) fmt=elf em=nbsd ;; vax-*-netbsd*) fmt=aout em=nbsd ;; vax-*-bsd* | vax-*-ultrix*) fmt=aout ;; - vax-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;; + vax-*-linux-*) fmt=elf em=linux bfd_gas=yes ;; w65-*-*) fmt=coff ;; diff -ur binutils-2.15.97.orig/ld/configure.host binutils-2.15.97/ld/configure.host --- binutils-2.15.97.orig/ld/configure.host 2005-04-29 20:48:15.000000000 -0400 +++ binutils-2.15.97/ld/configure.host 2005-04-29 20:53:50.000000000 -0400 @@ -83,7 +83,7 @@ HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"` ;; -arm*-*-linux-gnu*) +arm*-*-linux-*) HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"` ;; @@ -141,7 +141,7 @@ HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' ;; -ia64-*-linux-gnu*) +ia64-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"` ;; @@ -155,11 +155,11 @@ HOSTING_LIBS='-L/usr/lib32 '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else ${CC} -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors' ;; -mips*-*-linux-gnu*) +mips*-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` ;; -m68*-*-linux-gnu*) +m68*-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` ;; @@ -183,19 +183,19 @@ HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' ;; -powerpc64*-*-linux-gnu*) +powerpc64*-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld64.so.1,"` ;; -powerpc*-*-linux-gnu*) +powerpc*-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` ;; -s390x-*-linux-gnu*) +s390x-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld64.so.1,"` ;; -s390-*-linux-gnu*) +s390-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` ;; @@ -209,15 +209,15 @@ HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`' ;; -sparc-*-linux-gnu*) +sparc-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld-linux.so.2,"` ;; -sparc64-*-linux-gnu*) +sparc64-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld-linux.so.2,"` ;; -x86_64-*-linux-gnu*) +x86_64-*-linux-*) HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"` ;; diff -ur binutils-2.15.97.orig/ld/configure.tgt binutils-2.15.97/ld/configure.tgt --- binutils-2.15.97.orig/ld/configure.tgt 2005-04-29 20:48:15.000000000 -0400 +++ binutils-2.15.97/ld/configure.tgt 2005-04-29 20:53:50.000000000 -0400 @@ -30,7 +30,7 @@ cris-*-*aout*) targ_emul=crisaout targ_extra_emuls="criself crislinux" targ_extra_libpath=$targ_extra_emuls ;; -cris-*-linux-gnu* | cris-*-linux-gnu*) +cris-*-linux-* | crisv32-*-linux-*) targ_emul=crislinux ;; cris-*-* | crisv32-*-*) targ_emul=criself targ_extra_emuls="crisaout crislinux" @@ -62,14 +62,14 @@ tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'` tdir_sun4=sparc-sun-sunos4 ;; -sparc64-*-linux-gnu*) targ_emul=elf64_sparc +sparc64-*-linux-*) targ_emul=elf64_sparc targ_extra_emuls="elf32_sparc sparclinux sun4" targ_extra_libpath=elf32_sparc tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'` tdir_sparclinux=${tdir_elf32_sparc}aout tdir_sun4=sparc-sun-sunos4 ;; -sparc*-*-linux-gnu*) targ_emul=elf32_sparc +sparc*-*-linux-*) targ_emul=elf32_sparc targ_extra_emuls="sparclinux elf64_sparc sun4" targ_extra_libpath=elf64_sparc tdir_sparclinux=${targ_alias}aout @@ -119,8 +119,8 @@ ia64-*-aix*) targ_emul=elf64_aix ;; m32r*le-*-elf*) targ_emul=m32rlelf ;; m32r*-*-elf*) targ_emul=m32relf ;; -m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;; -m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;; +m32r*le-*-linux-*) targ_emul=m32rlelf_linux ;; +m32r*-*-linux-*) targ_emul=m32relf_linux ;; m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;; m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf @@ -131,7 +131,7 @@ m68*-apple-aux*) targ_emul=m68kaux ;; maxq-*-coff) targ_emul=maxqcoff;; *-tandem-none) targ_emul=st2000 ;; -i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;; +i370-*-elf* | i370-*-linux-*) targ_emul=elf32i370 ;; i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;; i[3-7]86-*-vsta) targ_emul=vsta ;; i[3-7]86-go32-rtems*) targ_emul=i386go32 ;; @@ -155,14 +155,14 @@ tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;; i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;; -i[3-7]86-*-linux-gnu*) targ_emul=elf_i386 +i[3-7]86-*-linux-*) targ_emul=elf_i386 targ_extra_emuls=i386linux if test x${want64} = xtrue; then targ_extra_emuls="$targ_extra_emuls elf_x86_64" fi tdir_i386linux=${targ_alias}aout ;; -x86_64-*-linux-gnu*) targ_emul=elf_x86_64 +x86_64-*-linux-*) targ_emul=elf_x86_64 targ_extra_emuls="elf_i386 i386linux" targ_extra_libpath=elf_i386 tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'` @@ -262,13 +262,13 @@ arm-*-kaos*) targ_emul=armelf ;; arm9e-*-elf) targ_emul=armelf ;; arm*b-*-linux-gnueabi) targ_emul=armelfb_linux_eabi ;; -arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;; +arm*b-*-linux-*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;; arm*-*-linux-gnueabi) targ_emul=armelf_linux_eabi ;; -arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; +arm*-*-linux-*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; arm-*-vxworks) targ_emul=armelf_vxworks ;; arm*-*-conix*) targ_emul=armelf ;; -thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; +thumb-*-linux-* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;; strongarm-*-coff) targ_emul=armcoff ;; strongarm-*-elf) targ_emul=armelf ;; strongarm-*-kaos*) targ_emul=armelf ;; @@ -372,7 +372,7 @@ targ_extra_emuls=m68kelf tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'` ;; -m68k-*-linux-gnu*) targ_emul=m68kelf +m68k-*-linux-*) targ_emul=m68kelf targ_extra_emuls=m68klinux tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'` ;; @@ -388,9 +388,9 @@ m68*-*-psos*) targ_emul=m68kpsos ;; m68*-*-rtemscoff*) targ_emul=m68kcoff ;; m68*-*-rtems*) targ_emul=m68kelf ;; -hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;; +hppa*64*-*-linux-*) targ_emul=hppa64linux ;; hppa*64*-*) targ_emul=elf64hppa ;; -hppa*-*-linux-gnu*) targ_emul=hppalinux ;; +hppa*-*-linux-*) targ_emul=hppalinux ;; hppa*-*-*elf*) targ_emul=hppaelf ;; hppa*-*-lites*) targ_emul=hppaelf ;; hppa*-*-netbsd*) targ_emul=hppanbsd ;; @@ -402,7 +402,7 @@ vax-*-netbsdaout* | vax-*-netbsd*) targ_emul=vaxnbsd targ_extra_emuls=elf32vax ;; -vax-*-linux-gnu*) targ_emul=elf32vax ;; +vax-*-linux-*) targ_emul=elf32vax ;; mips*-*-pe) targ_emul=mipspe ; targ_extra_ofiles="deffilep.o pe-dll.o" ;; mips*-dec-ultrix*) targ_emul=mipslit ;; @@ -436,18 +436,18 @@ mips*-*-vxworks*) targ_emul=elf32ebmip targ_extra_emuls="elf32elmip" ;; mips*-*-windiss) targ_emul=elf32mipswindiss ;; -mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32 +mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" targ_extra_libpath="elf32ltsmip elf64ltsmip" ;; -mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32 +mips64*-*-linux-*) targ_emul=elf32btsmipn32 targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" targ_extra_libpath="elf32btsmip elf64btsmip" ;; -mips*el-*-linux-gnu*) targ_emul=elf32ltsmip +mips*el-*-linux-*) targ_emul=elf32ltsmip targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" ;; -mips*-*-linux-gnu*) targ_emul=elf32btsmip +mips*-*-linux-*) targ_emul=elf32btsmip targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" ;; mips*-*-lnews*) targ_emul=mipslnews ;; @@ -467,7 +467,7 @@ alpha*-*-linuxecoff*) targ_emul=alpha targ_extra_emuls=elf64alpha tdir_elf64alpha=`echo ${targ_alias} | sed -e 's/ecoff//'` ;; -alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha +alpha*-*-linux-*) targ_emul=elf64alpha targ_extra_emuls=alpha tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'` ;; alpha*-*-osf*) targ_emul=alpha ;; diff -ur binutils-2.15.97.orig/ld/emultempl/elf32.em binutils-2.15.97/ld/emultempl/elf32.em --- binutils-2.15.97.orig/ld/emultempl/elf32.em 2005-04-29 20:48:15.000000000 -0400 +++ binutils-2.15.97/ld/emultempl/elf32.em 2005-04-29 20:53:50.000000000 -0400 @@ -65,7 +65,7 @@ if [ "x${USE_LIBPATH}" = xyes ] ; then case ${target} in - *-*-linux-gnu*) + *-*-linux-*) cat >>e${EMULATION_NAME}.c < @@ -350,7 +350,7 @@ EOF case ${target} in - *-*-linux-gnu*) + *-*-linux-*) cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <name, force)) break; geexbox-1.0/packages/binutils/patches/20_uclibc-libtool-conf.diff0000644000175000017500000002153110446314260024036 0ustar aurelaureldiff -urN binutils-2.16.90.0.2-dist/bfd/configure binutils-2.16.90.0.2/bfd/configure --- binutils-2.16.90.0.2-dist/bfd/configure 2005-04-29 12:50:24.000000000 -0500 +++ binutils-2.16.90.0.2/bfd/configure 2005-04-30 11:34:59.246377032 -0500 @@ -3584,6 +3584,11 @@ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' diff -urN binutils-2.16.90.0.2-dist/binutils/configure binutils-2.16.90.0.2/binutils/configure --- binutils-2.16.90.0.2-dist/binutils/configure 2005-04-29 12:50:26.000000000 -0500 +++ binutils-2.16.90.0.2/binutils/configure 2005-04-30 11:35:28.900868864 -0500 @@ -1577,6 +1577,11 @@ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' diff -urN binutils-2.16.90.0.2-dist/configure binutils-2.16.90.0.2/configure --- binutils-2.16.90.0.2-dist/configure 2005-04-29 12:50:23.000000000 -0500 +++ binutils-2.16.90.0.2/configure 2005-04-30 11:31:12.525843792 -0500 @@ -1111,7 +1111,7 @@ ;; "") case "${target}" in - *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu) + *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*) # Enable libmudflap by default in GNU and friends. ;; *-*-freebsd*) diff -urN binutils-2.16.90.0.2-dist/configure.in binutils-2.16.90.0.2/configure.in --- binutils-2.16.90.0.2-dist/configure.in 2005-04-29 12:50:23.000000000 -0500 +++ binutils-2.16.90.0.2/configure.in 2005-04-30 11:29:51.643139832 -0500 @@ -328,7 +328,7 @@ ;; "") case "${target}" in - *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu) + *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*) # Enable libmudflap by default in GNU and friends. ;; *-*-freebsd*) diff -urN binutils-2.16.90.0.2-dist/gas/configure binutils-2.16.90.0.2/gas/configure --- binutils-2.16.90.0.2-dist/gas/configure 2005-04-29 12:50:27.000000000 -0500 +++ binutils-2.16.90.0.2/gas/configure 2005-04-30 11:35:21.097055224 -0500 @@ -3421,6 +3421,11 @@ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' diff -urN binutils-2.16.90.0.2-dist/gas/testsuite/gas/sh/basic.exp binutils-2.16.90.0.2/gas/testsuite/gas/sh/basic.exp --- binutils-2.16.90.0.2-dist/gas/testsuite/gas/sh/basic.exp 2005-04-09 14:03:14.000000000 -0500 +++ binutils-2.16.90.0.2/gas/testsuite/gas/sh/basic.exp 2005-04-30 11:41:57.301822944 -0500 @@ -20,7 +20,7 @@ # Written by Cygnus Support. -if [istarget "sh*-*-linux-gnu"] { +if {[istarget "sh*-*-linux-gnu"] || [istarget "sh*-*-linux-uclibc"]} { global ASFLAGS set ASFLAGS "$ASFLAGS -big" } diff -urN binutils-2.16.90.0.2-dist/gprof/configure binutils-2.16.90.0.2/gprof/configure --- binutils-2.16.90.0.2-dist/gprof/configure 2005-04-29 12:50:29.000000000 -0500 +++ binutils-2.16.90.0.2/gprof/configure 2005-04-30 11:35:36.880655752 -0500 @@ -3419,6 +3419,11 @@ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' diff -urN binutils-2.16.90.0.2-dist/ld/configure binutils-2.16.90.0.2/ld/configure --- binutils-2.16.90.0.2-dist/ld/configure 2005-04-29 12:50:30.000000000 -0500 +++ binutils-2.16.90.0.2/ld/configure 2005-04-30 11:46:15.974498720 -0500 @@ -1581,6 +1581,11 @@ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' diff -urN binutils-2.16.90.0.2-dist/ld/testsuite/ld-sh/sh.exp binutils-2.16.90.0.2/ld/testsuite/ld-sh/sh.exp --- binutils-2.16.90.0.2-dist/ld/testsuite/ld-sh/sh.exp 2005-04-09 14:03:29.000000000 -0500 +++ binutils-2.16.90.0.2/ld/testsuite/ld-sh/sh.exp 2005-04-30 11:45:07.890849008 -0500 @@ -62,7 +62,7 @@ set testsrec "SH relaxing to S-records" -if [istarget sh*-linux-gnu] { +if {[istarget sh*-linux-gnu] || [istarget sh*-*-linux-uclibc]} { # This target needs the explicit entry address. catch "exec $objdump -x tmpdir/sh1 | grep start\\ address | sed s/start\\ address//" entry_addr set srec_relax_arg "-Ttext $entry_addr -relax --oformat srec tmpdir/sh1.o" @@ -117,7 +117,7 @@ return } -if [istarget sh*-linux-gnu] { +if {[istarget sh*-linux-gnu] || [istarget sh*-*-linux-uclibc]} { exec sed -e s/_main/main/ -e s/_trap/trap/ -e s/_stack/stack/ \ < $srcdir/$subdir/start.s >tmpdir/start.s } else { diff -urN binutils-2.16.90.0.2-dist/ld/testsuite/ld-srec/srec.exp binutils-2.16.90.0.2/ld/testsuite/ld-srec/srec.exp --- binutils-2.16.90.0.2-dist/ld/testsuite/ld-srec/srec.exp 2005-04-29 12:50:30.000000000 -0500 +++ binutils-2.16.90.0.2/ld/testsuite/ld-srec/srec.exp 2005-04-30 11:44:26.358162936 -0500 @@ -385,7 +385,7 @@ setup_xfail "v850*-*-elf" # The S-record linker doesn't handle Alpha Elf relaxation. -setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*" +setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*" "alpha*-*-linux-uclibc*" setup_xfail "alpha*-*-netbsd*" # The S-record linker hasn't any hope of coping with HPPA relocs. @@ -424,7 +424,7 @@ setup_xfail "thumb-*-*" setup_xfail "powerpc*-*-eabi*" setup_xfail "v850*-*-elf" -setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*" +setup_xfail "alpha*-*-elf*" "alpha*-*-linux-gnu*" "alpha*-*-gnu*" "alpha*-*-linux-uclibc*" setup_xfail "alpha*-*-netbsd*" setup_xfail "hppa*-*-*" setup_xfail "ia64-*-*" diff -urN binutils-2.16.90.0.2-dist/libtool.m4 binutils-2.16.90.0.2/libtool.m4 --- binutils-2.16.90.0.2-dist/libtool.m4 2004-07-27 23:36:06.000000000 -0500 +++ binutils-2.16.90.0.2/libtool.m4 2005-04-30 11:35:54.062043784 -0500 @@ -645,6 +645,11 @@ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] diff -urN binutils-2.16.90.0.2-dist/ltconfig binutils-2.16.90.0.2/ltconfig --- binutils-2.16.90.0.2-dist/ltconfig 2004-11-22 14:33:30.000000000 -0600 +++ binutils-2.16.90.0.2/ltconfig 2005-04-30 11:22:10.594229920 -0500 @@ -602,6 +602,7 @@ # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in +linux-uclibc*) ;; linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac @@ -1270,6 +1271,23 @@ dynamic_linker='GNU/Linux ld.so' ;; +linux-uclibc*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # 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 + # Assume using the uClibc dynamic linker. + dynamic_linker="uClibc ld.so" + ;; + netbsd*) need_lib_prefix=no need_version=no diff -urN binutils-2.16.90.0.2-dist/opcodes/configure binutils-2.16.90.0.2/opcodes/configure --- binutils-2.16.90.0.2-dist/opcodes/configure 2005-04-29 12:50:31.000000000 -0500 +++ binutils-2.16.90.0.2/opcodes/configure 2005-04-30 11:17:07.168357664 -0500 @@ -3588,6 +3588,11 @@ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' geexbox-1.0/packages/binutils/scripts/0000755000175000017500000000000010446314260017113 5ustar aurelaurelgeexbox-1.0/packages/binutils/scripts/libstrip0000755000175000017500000000210310446314260020665 0ustar aurelaurel#!/bin/sh . config/options LIB=$1 LIBA=$2 PROG=$3 SO=$4 PROG_SYMS=$5 LDSCRIPT=`ls $ROOT/$TOOLCHAIN/$TARGET_NAME/lib/ldscripts/elf*$TARGET_ARCH.xs` if [ ! -f $LIBA ]; then echo "ERROR $LIBA doesn't exists." exit 1 fi if [ -f $LIB -a $LIB -nt $LIBA ]; then for i in $PROG $LDSCRIPT $0; do [ $i -nt $LIB ] && NEED_TO_STRIP=yes && break done [ "$NEED_TO_STRIP" = yes ] || exit 0 fi echo -n "stripping $LIB ..." for i in $SO; do SO_SYMS="$SO_SYMS `$TARGET_NM --dynamic $i | sed -n 's/^........ [ABDGTW] \(..*\)/\1/p'`" done for i in $PROG; do if [ -f $i ]; then for j in `$TARGET_NM --dynamic $i | sed -n 's/^........ [BUV] \(..*\)/\1/p'`; do (echo "$SO_SYMS" | grep $j >/dev/null) || (echo "$PROG_SYMS" | grep $j >/dev/null) || PROG_SYMS="$PROG_SYMS $j" done fi done echo "INCLUDE $LDSCRIPT" > /tmp/ldscript for i in $PROG_SYMS; do echo "EXTERN($i)" >> /tmp/ldscript done [ "$DEBUG" != yes ] && SFLAG=-s $TARGET_CC $SFLAG -Wl,-warn-common -shared -o $LIB -Wl,-soname,`basename $LIB` -Wl,--script=/tmp/ldscript $LIBA echo " done" rm -f /tmp/ldscript geexbox-1.0/packages/binutils/url0000644000175000017500000000007410446314260016152 0ustar aurelaurelftp://ftp.ciril.fr/pub/gnu/binutils/binutils-2.16.1.tar.bz2 geexbox-1.0/packages/bootsplash/0000755000175000017500000000000010446314260015751 5ustar aurelaurelgeexbox-1.0/packages/bootsplash/build0000755000175000017500000000023610446314260016777 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain setup_toolchain host make -C $BUILD/$1*/Utilities \ CC=$CC \ CFLAGS="$CFLAGS" \ splash geexbox-1.0/packages/bootsplash/patches/0000755000175000017500000000000010446314260017400 5ustar aurelaurelgeexbox-1.0/packages/bootsplash/patches/10_nosilentjpeg.diff0000644000175000017500000000105410446314260023233 0ustar aurelaurel--- bootsplash-3.1.orig/Utilities/splash.c 2004-09-20 20:54:42.832461640 +0200 +++ bootsplash-3.1/Utilities/splash.c 2004-09-20 23:49:27.094611528 +0200 @@ -517,13 +517,13 @@ exit(1); } fclose(sfp); - if (sboxcount) - memmove(pic + 47 + l + boxcount * 12, - sboxes, sboxcount * 12); - silentl += sboxcount * 12; - l += silentl; } fclose(fp); + if (sboxcount) + memmove(pic + 47 + l + boxcount * 12, + sboxes, sboxcount * 12); + silentl += sboxcount * 12; + l += silentl; } else { l = 0; pic = calloc(47, 1); geexbox-1.0/packages/bootsplash/url0000644000175000017500000000012410446314260016473 0ustar aurelaurelftp://ftp.openbios.org/pub/bootsplash/rpm-sources/bootsplash/bootsplash-3.1.tar.bz2 geexbox-1.0/packages/busybox/0000755000175000017500000000000010446314260015266 5ustar aurelaurelgeexbox-1.0/packages/busybox/build0000755000175000017500000000011510446314260016310 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* make $1 geexbox-1.0/packages/busybox/config/0000755000175000017500000000000010446314260016533 5ustar aurelaurelgeexbox-1.0/packages/busybox/config/busybox.conf0000644000175000017500000004016410446314260021102 0ustar aurelaurel# # Automatically generated make config: don't edit # HAVE_DOT_CONFIG=y # # Busybox Settings # # # General Configuration # # CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y # CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set # CONFIG_FEATURE_VERBOSE_USAGE is not set CONFIG_FEATURE_INSTALLER=y # CONFIG_LOCALE_SUPPORT is not set # CONFIG_FEATURE_DEVFS is not set # CONFIG_FEATURE_DEVPTS is not set # CONFIG_FEATURE_CLEAN_UP is not set # CONFIG_FEATURE_SUID is not set # CONFIG_FEATURE_SUID_CONFIG is not set # CONFIG_FEATURE_SUID_CONFIG_QUIET is not set # CONFIG_SELINUX is not set # # Build Options # # CONFIG_STATIC is not set # CONFIG_DISABLE_SHARED is not set # CONFIG_BUILD_LIBBUSYBOX is not set # CONFIG_FEATURE_FULL_LIBBUSYBOX is not set # CONFIG_FEATURE_SHARED_BUSYBOX is not set CONFIG_LFS=y USING_CROSS_COMPILER=y CROSS_COMPILER_PREFIX="" EXTRA_CFLAGS_OPTIONS="" # CONFIG_BUILD_AT_ONCE is not set # # Debugging Options # # CONFIG_DEBUG is not set # CONFIG_NO_DEBUG_LIB is not set # CONFIG_DMALLOC is not set # CONFIG_EFENCE is not set # CONFIG_DEBUG_YANK_SUSv2 is not set # # Installation Options # # CONFIG_INSTALL_NO_USR is not set CONFIG_INSTALL_APPLET_SYMLINKS=y # CONFIG_INSTALL_APPLET_HARDLINKS is not set # CONFIG_INSTALL_APPLET_DONT is not set PREFIX="./_install" # # Busybox Library Tuning # CONFIG_MD5_SIZE_VS_SPEED=1 # # Applets # # # Archival Utilities # # CONFIG_AR is not set # CONFIG_FEATURE_AR_LONG_FILENAMES is not set # CONFIG_BUNZIP2 is not set # CONFIG_CPIO is not set # CONFIG_DPKG is not set # CONFIG_DPKG_DEB is not set # CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set # CONFIG_GUNZIP is not set # CONFIG_FEATURE_GUNZIP_UNCOMPRESS is not set # CONFIG_GZIP is not set # CONFIG_RPM2CPIO is not set # CONFIG_RPM is not set CONFIG_TAR=y # CONFIG_FEATURE_TAR_CREATE is not set # CONFIG_FEATURE_TAR_BZIP2 is not set CONFIG_FEATURE_TAR_LZMA=y # CONFIG_FEATURE_TAR_FROM is not set # CONFIG_FEATURE_TAR_GZIP is not set # CONFIG_FEATURE_TAR_COMPRESS is not set # CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y # CONFIG_FEATURE_TAR_LONG_OPTIONS is not set # CONFIG_UNCOMPRESS is not set CONFIG_UNLZMA=y CONFIG_FEATURE_LZMA_FAST=y # CONFIG_UNZIP is not set # # Common options for cpio and tar # # CONFIG_FEATURE_UNARCHIVE_TAPE is not set # CONFIG_FEATURE_DEB_TAR_GZ is not set # CONFIG_FEATURE_DEB_TAR_BZ2 is not set # CONFIG_FEATURE_DEB_TAR_LZMA is not set # # Coreutils # # CONFIG_BASENAME is not set # CONFIG_CAL is not set CONFIG_CAT=y # CONFIG_CHGRP is not set # CONFIG_CHMOD is not set # CONFIG_CHOWN is not set # CONFIG_CHROOT is not set # CONFIG_CMP is not set # CONFIG_COMM is not set CONFIG_CP=y CONFIG_CUT=y CONFIG_DATE=y # CONFIG_FEATURE_DATE_ISOFMT is not set CONFIG_DD=y # CONFIG_DF is not set # CONFIG_DIRNAME is not set # CONFIG_DOS2UNIX is not set # CONFIG_UNIX2DOS is not set # CONFIG_DU is not set # CONFIG_FEATURE_DU_DEFALT_BLOCKSIZE_1K is not set CONFIG_ECHO=y CONFIG_FEATURE_FANCY_ECHO=y # CONFIG_ENV is not set # CONFIG_EXPR is not set # CONFIG_EXPR_MATH_SUPPORT_64 is not set # CONFIG_FALSE is not set # CONFIG_FOLD is not set CONFIG_HEAD=y # CONFIG_FEATURE_FANCY_HEAD is not set # CONFIG_HOSTID is not set # CONFIG_ID is not set # CONFIG_INSTALL is not set # CONFIG_LENGTH is not set CONFIG_LN=y # CONFIG_LOGNAME is not set CONFIG_LS=y # CONFIG_FEATURE_LS_FILETYPES is not set # CONFIG_FEATURE_LS_FOLLOWLINKS is not set # CONFIG_FEATURE_LS_RECURSIVE is not set CONFIG_FEATURE_LS_SORTFILES=y # CONFIG_FEATURE_LS_TIMESTAMPS is not set # CONFIG_FEATURE_LS_USERNAME is not set # CONFIG_FEATURE_LS_COLOR is not set # CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set # CONFIG_MD5SUM is not set CONFIG_MKDIR=y CONFIG_MKFIFO=y # CONFIG_MKNOD is not set CONFIG_MV=y # CONFIG_NICE is not set # CONFIG_NOHUP is not set # CONFIG_OD is not set # CONFIG_PRINTENV is not set # CONFIG_PRINTF is not set # CONFIG_PWD is not set # CONFIG_REALPATH is not set CONFIG_RM=y CONFIG_RMDIR=y # CONFIG_SEQ is not set # CONFIG_SHA1SUM is not set CONFIG_SLEEP=y # CONFIG_FEATURE_FANCY_SLEEP is not set CONFIG_SORT=y # CONFIG_FEATURE_SORT_BIG is not set # CONFIG_STAT is not set # CONFIG_FEATURE_STAT_FORMAT is not set # CONFIG_STTY is not set # CONFIG_SUM is not set # CONFIG_SYNC is not set CONFIG_TAIL=y # CONFIG_FEATURE_FANCY_TAIL is not set # CONFIG_TEE is not set # CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set CONFIG_TEST=y # CONFIG_FEATURE_TEST_64 is not set # CONFIG_TOUCH is not set # CONFIG_TR is not set # CONFIG_FEATURE_TR_CLASSES is not set # CONFIG_FEATURE_TR_EQUIV is not set # CONFIG_TRUE is not set # CONFIG_TTY is not set # CONFIG_UNAME is not set # CONFIG_UNIQ is not set # CONFIG_USLEEP is not set # CONFIG_UUDECODE is not set # CONFIG_UUENCODE is not set # CONFIG_WATCH is not set # CONFIG_WC is not set # CONFIG_WHO is not set # CONFIG_WHOAMI is not set # CONFIG_YES is not set # # Common options for cp and mv # # CONFIG_FEATURE_PRESERVE_HARDLINKS is not set # # Common options for ls, more and telnet # # CONFIG_FEATURE_AUTOWIDTH is not set # # Common options for df, du, ls # # CONFIG_FEATURE_HUMAN_READABLE is not set # CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set # # Console Utilities # CONFIG_CHVT=y # CONFIG_CLEAR is not set # CONFIG_DEALLOCVT is not set # CONFIG_DUMPKMAP is not set # CONFIG_LOADFONT is not set # CONFIG_LOADKMAP is not set # CONFIG_OPENVT is not set # CONFIG_RESET is not set # CONFIG_SETCONSOLE is not set # CONFIG_SETKEYCODES is not set # # Debian Utilities # # CONFIG_MKTEMP is not set # CONFIG_PIPE_PROGRESS is not set # CONFIG_READLINK is not set # CONFIG_FEATURE_READLINK_FOLLOW is not set # CONFIG_RUN_PARTS is not set # CONFIG_START_STOP_DAEMON is not set # CONFIG_WHICH is not set # # Editors # # CONFIG_AWK is not set # CONFIG_FEATURE_AWK_MATH is not set # CONFIG_PATCH is not set CONFIG_SED=y # CONFIG_VI is not set # CONFIG_FEATURE_VI_COLON is not set # CONFIG_FEATURE_VI_YANKMARK is not set # CONFIG_FEATURE_VI_SEARCH is not set # CONFIG_FEATURE_VI_USE_SIGNALS is not set # CONFIG_FEATURE_VI_DOT_CMD is not set # CONFIG_FEATURE_VI_READONLY is not set # CONFIG_FEATURE_VI_SETOPTS is not set # CONFIG_FEATURE_VI_SET is not set # CONFIG_FEATURE_VI_WIN_RESIZE is not set # CONFIG_FEATURE_VI_OPTIMIZE_CURSOR is not set # # Finding Utilities # CONFIG_FIND=y # CONFIG_FEATURE_FIND_MTIME is not set # CONFIG_FEATURE_FIND_MMIN is not set # CONFIG_FEATURE_FIND_PERM is not set # CONFIG_FEATURE_FIND_TYPE is not set # CONFIG_FEATURE_FIND_XDEV is not set # CONFIG_FEATURE_FIND_NEWER is not set # CONFIG_FEATURE_FIND_INUM is not set # CONFIG_FEATURE_FIND_EXEC is not set CONFIG_GREP=y # CONFIG_FEATURE_GREP_EGREP_ALIAS is not set # CONFIG_FEATURE_GREP_FGREP_ALIAS is not set CONFIG_FEATURE_GREP_CONTEXT=y # CONFIG_XARGS is not set # CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set # CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set # CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set # CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set # # Init Utilities # # CONFIG_INIT is not set # CONFIG_FEATURE_USE_INITTAB is not set # CONFIG_FEATURE_INIT_SCTTY is not set # CONFIG_FEATURE_EXTRA_QUIET is not set # CONFIG_FEATURE_INIT_COREDUMPS is not set # CONFIG_FEATURE_INITRD is not set CONFIG_HALT=y # CONFIG_MESG is not set # # Login/Password Management Utilities # # CONFIG_FEATURE_SHADOWPASSWDS is not set # CONFIG_USE_BB_SHADOW is not set # CONFIG_USE_BB_PWD_GRP is not set # CONFIG_ADDGROUP is not set # CONFIG_DELGROUP is not set # CONFIG_ADDUSER is not set # CONFIG_DELUSER is not set # CONFIG_GETTY is not set # CONFIG_FEATURE_UTMP is not set # CONFIG_FEATURE_WTMP is not set # CONFIG_LOGIN is not set # CONFIG_FEATURE_SECURETTY is not set # CONFIG_PASSWD is not set # CONFIG_SU is not set # CONFIG_SULOGIN is not set # CONFIG_VLOCK is not set # # Linux Ext2 FS Progs # # CONFIG_CHATTR is not set # CONFIG_E2FSCK is not set # CONFIG_FSCK is not set # CONFIG_LSATTR is not set CONFIG_MKE2FS=y # CONFIG_TUNE2FS is not set # CONFIG_E2LABEL is not set # CONFIG_FINDFS is not set # # Linux Module Utilities # CONFIG_INSMOD=y # CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set # CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set # CONFIG_FEATURE_INSMOD_LOADINKMEM is not set # CONFIG_FEATURE_INSMOD_LOAD_MAP is not set # CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set CONFIG_RMMOD=y # CONFIG_LSMOD is not set # CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set CONFIG_MODPROBE=y CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS=y # # Options common to multiple modutils # CONFIG_FEATURE_CHECK_TAINTED_MODULE=y # CONFIG_FEATURE_2_4_MODULES is not set CONFIG_FEATURE_2_6_MODULES=y # CONFIG_FEATURE_QUERY_MODULE_INTERFACE is not set # # Linux System Utilities # CONFIG_DMESG=y CONFIG_FBSET=y # CONFIG_FEATURE_FBSET_FANCY is not set # CONFIG_FEATURE_FBSET_READMODE is not set # CONFIG_FDFLUSH is not set # CONFIG_FDFORMAT is not set # CONFIG_FDISK is not set FDISK_SUPPORT_LARGE_DISKS=y # CONFIG_FEATURE_FDISK_WRITABLE is not set # CONFIG_FEATURE_AIX_LABEL is not set # CONFIG_FEATURE_SGI_LABEL is not set # CONFIG_FEATURE_SUN_LABEL is not set # CONFIG_FEATURE_OSF_LABEL is not set # CONFIG_FEATURE_FDISK_ADVANCED is not set # CONFIG_FREERAMDISK is not set # CONFIG_FSCK_MINIX is not set # CONFIG_MKFS_MINIX is not set # CONFIG_FEATURE_MINIX2 is not set # CONFIG_GETOPT is not set # CONFIG_HEXDUMP is not set # CONFIG_HWCLOCK is not set # CONFIG_FEATURE_HWCLOCK_LONGOPTIONS is not set # CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set # CONFIG_IPCRM is not set # CONFIG_IPCS is not set # CONFIG_LOSETUP is not set # CONFIG_MDEV is not set # CONFIG_FEATURE_MDEV_CONF is not set # CONFIG_MKSWAP is not set # CONFIG_MORE is not set # CONFIG_FEATURE_USE_TERMIOS is not set CONFIG_MOUNT=y CONFIG_FEATURE_MOUNT_NFS=y CONFIG_PIVOT_ROOT=y # CONFIG_RDATE is not set # CONFIG_READPROFILE is not set # CONFIG_SETARCH is not set # CONFIG_SWAPONOFF is not set # CONFIG_SWITCH_ROOT is not set CONFIG_UMOUNT=y # CONFIG_FEATURE_UMOUNT_ALL is not set # # Common options for mount/umount # # CONFIG_FEATURE_MOUNT_LOOP is not set # CONFIG_FEATURE_MTAB_SUPPORT is not set # # Miscellaneous Utilities # # CONFIG_ADJTIMEX is not set # CONFIG_BBCONFIG is not set # CONFIG_CROND is not set # CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set # CONFIG_CRONTAB is not set # CONFIG_DC is not set # CONFIG_DEVFSD is not set # CONFIG_DEVFSD_MODLOAD is not set # CONFIG_DEVFSD_FG_NP is not set # CONFIG_DEVFSD_VERBOSE is not set CONFIG_EJECT=y # CONFIG_LAST is not set # CONFIG_LESS is not set # CONFIG_FEATURE_LESS_BRACKETS is not set # CONFIG_FEATURE_LESS_FLAGS is not set # CONFIG_FEATURE_LESS_FLAGCS is not set # CONFIG_FEATURE_LESS_MARKS is not set # CONFIG_FEATURE_LESS_REGEXP is not set CONFIG_HDPARM=y # CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set # CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set # CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set # CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set # CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set # CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set # CONFIG_MAKEDEVS is not set # CONFIG_FEATURE_MAKEDEVS_LEAF is not set # CONFIG_FEATURE_MAKEDEVS_TABLE is not set # CONFIG_MOUNTPOINT is not set # CONFIG_MT is not set # CONFIG_RUNLEVEL is not set # CONFIG_RX is not set # CONFIG_STRINGS is not set # CONFIG_SETSID is not set # CONFIG_TIME is not set # CONFIG_WATCHDOG is not set # # Networking Utilities # # CONFIG_FEATURE_IPV6 is not set # CONFIG_ARPING is not set # CONFIG_DNSD is not set # CONFIG_ETHER_WAKE is not set # CONFIG_FAKEIDENTD is not set # CONFIG_FTPGET is not set # CONFIG_FTPPUT is not set # CONFIG_HOSTNAME is not set CONFIG_HTTPD=y # CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY is not set CONFIG_FEATURE_HTTPD_BASIC_AUTH=y # CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set # CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP is not set # CONFIG_FEATURE_HTTPD_SETUID is not set # CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES is not set CONFIG_FEATURE_HTTPD_CGI=y # CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set # CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set # CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set CONFIG_IFCONFIG=y # CONFIG_FEATURE_IFCONFIG_STATUS is not set # CONFIG_FEATURE_IFCONFIG_SLIP is not set # CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set # CONFIG_FEATURE_IFCONFIG_HW is not set # CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set # CONFIG_IFUPDOWN is not set # CONFIG_FEATURE_IFUPDOWN_IP is not set # CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set # CONFIG_FEATURE_IFUPDOWN_IPV4 is not set # CONFIG_FEATURE_IFUPDOWN_IPV6 is not set # CONFIG_FEATURE_IFUPDOWN_IPX is not set # CONFIG_FEATURE_IFUPDOWN_MAPPING is not set # CONFIG_INETD is not set # CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO is not set # CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD is not set # CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME is not set # CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME is not set # CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN is not set # CONFIG_FEATURE_INETD_RPC is not set # CONFIG_IP is not set # CONFIG_FEATURE_IP_ADDRESS is not set # CONFIG_FEATURE_IP_LINK is not set # CONFIG_FEATURE_IP_ROUTE is not set # CONFIG_FEATURE_IP_TUNNEL is not set # CONFIG_IPCALC is not set # CONFIG_FEATURE_IPCALC_FANCY is not set # CONFIG_IPADDR is not set # CONFIG_IPLINK is not set # CONFIG_IPROUTE is not set # CONFIG_IPTUNNEL is not set # CONFIG_NAMEIF is not set # CONFIG_NC is not set # CONFIG_NC_GAPING_SECURITY_HOLE is not set # CONFIG_NETSTAT is not set # CONFIG_NSLOOKUP is not set # CONFIG_PING is not set # CONFIG_FEATURE_FANCY_PING is not set # CONFIG_PING6 is not set # CONFIG_FEATURE_FANCY_PING6 is not set CONFIG_ROUTE=y # CONFIG_TELNET is not set # CONFIG_FEATURE_TELNET_TTYPE is not set # CONFIG_FEATURE_TELNET_AUTOLOGIN is not set CONFIG_TELNETD=y # CONFIG_FEATURE_TELNETD_INETD is not set # CONFIG_TFTP is not set # CONFIG_FEATURE_TFTP_GET is not set # CONFIG_FEATURE_TFTP_PUT is not set # CONFIG_FEATURE_TFTP_BLOCKSIZE is not set # CONFIG_FEATURE_TFTP_DEBUG is not set # CONFIG_TRACEROUTE is not set # CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set # CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set # CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set # CONFIG_VCONFIG is not set CONFIG_WGET=y # CONFIG_FEATURE_WGET_STATUSBAR is not set # CONFIG_FEATURE_WGET_AUTHENTICATION is not set # CONFIG_FEATURE_WGET_IP6_LITERAL is not set # # udhcp Server/Client # # CONFIG_UDHCPD is not set CONFIG_UDHCPC=y # CONFIG_DUMPLEASES is not set # CONFIG_FEATURE_UDHCP_SYSLOG is not set # CONFIG_FEATURE_UDHCP_DEBUG is not set # CONFIG_ZCIP is not set # # Process Utilities # # CONFIG_FREE is not set # CONFIG_FUSER is not set CONFIG_KILL=y CONFIG_KILLALL=y CONFIG_PIDOF=y # CONFIG_FEATURE_PIDOF_SINGLE is not set # CONFIG_FEATURE_PIDOF_OMIT is not set # CONFIG_PS is not set # CONFIG_FEATURE_PS_WIDE is not set # CONFIG_RENICE is not set # CONFIG_BB_SYSCTL is not set # CONFIG_TOP is not set # CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set # CONFIG_UPTIME is not set # # Shells # CONFIG_FEATURE_SH_IS_ASH=y # CONFIG_FEATURE_SH_IS_HUSH is not set # CONFIG_FEATURE_SH_IS_LASH is not set # CONFIG_FEATURE_SH_IS_MSH is not set # CONFIG_FEATURE_SH_IS_NONE is not set CONFIG_ASH=y # # Ash Shell Options # # CONFIG_ASH_JOB_CONTROL is not set # CONFIG_ASH_READ_NCHARS is not set # CONFIG_ASH_READ_TIMEOUT is not set # CONFIG_ASH_ALIAS is not set CONFIG_ASH_MATH_SUPPORT=y # CONFIG_ASH_MATH_SUPPORT_64 is not set # CONFIG_ASH_GETOPTS is not set # CONFIG_ASH_CMDCMD is not set # CONFIG_ASH_BUILTIN_ECHO is not set # CONFIG_ASH_MAIL is not set CONFIG_ASH_OPTIMIZE_FOR_SIZE=y # CONFIG_ASH_RANDOM_SUPPORT is not set # CONFIG_ASH_EXPAND_PRMT is not set # CONFIG_HUSH is not set # CONFIG_LASH is not set # CONFIG_MSH is not set # # Bourne Shell Options # # CONFIG_FEATURE_SH_EXTRA_QUIET is not set # CONFIG_FEATURE_SH_STANDALONE_SHELL is not set CONFIG_FEATURE_COMMAND_EDITING=y # CONFIG_FEATURE_COMMAND_EDITING_VI is not set CONFIG_FEATURE_COMMAND_HISTORY=15 # CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set CONFIG_FEATURE_COMMAND_TAB_COMPLETION=y # CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set # CONFIG_FEATURE_SH_FANCY_PROMPT is not set # # System Logging Utilities # # CONFIG_SYSLOGD is not set # CONFIG_FEATURE_ROTATE_LOGFILE is not set # CONFIG_FEATURE_REMOTE_LOG is not set # CONFIG_FEATURE_IPC_SYSLOG is not set CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 # CONFIG_LOGREAD is not set # CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set # CONFIG_KLOGD is not set # CONFIG_LOGGER is not set geexbox-1.0/packages/busybox/config/busybox.devtools.conf0000644000175000017500000000037710446314260022742 0ustar aurelaurelCONFIG_CHMOD=y CONFIG_LSMOD=y CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y CONFIG_FEATURE_IFCONFIG_STATUS=y CONFIG_NETSTAT=y CONFIG_PING=y CONFIG_FEATURE_FANCY_PING=y CONFIG_PS=y CONFIG_FEATURE_PS_WIDE=y CONFIG_MORE=y CONFIG_FEATURE_USE_TERMIOS=y CONFIG_VI=y geexbox-1.0/packages/busybox/init.d/0000755000175000017500000000000010446314260016453 5ustar aurelaurelgeexbox-1.0/packages/busybox/init.d/10_eject0000755000175000017500000000156610446314260020003 0ustar aurelaurel#!/bin/sh # # eject CD if booted from cdrom and their is no media files on it # # runlevels: geexbox, debug if test -n "$CDROM"; then echo "### Eject CDROM ###" ( # add recognized files extension to the EXTS list for i in `cat /etc/file_ext`; do if [ -z "$EXTS" ]; then EXTS="$i" else EXTS="$EXTS\|$i" fi done # add recognized images extension to the EXTS list if [ -x /usr/bin/fbi -a -e /dev/fb0 ]; then for i in `cat /etc/img_ext`; do EXTS="$EXTS\|$i"; done fi # add recognized playlists extension to the EXTS list for i in `cat /etc/list_ext`; do EXTS="$EXTS\|$i"; done # check if their is recognized media files on the CD if [ -z "`find "$CDROM" | grep -v /GEEXBOX/ | grep -i "\.\($EXTS\)\$"`" ]; then # eject the CD (except when started with make exec) [ -e /dev/cdrom -a ! -f /EXEC ] && eject fi )& fi exit 0 geexbox-1.0/packages/busybox/init.d/52_telnet0000755000175000017500000000043510446314260020204 0ustar aurelaurel#!/bin/sh # # start telnet daemon # # runlevels: geexbox, debug # get options test -f /etc/network || exit 1 . /etc/network if test "$TELNET_SERVER" = "yes" -a -f /etc/issue; then echo "### Starting telnet daemon ###" /usr/sbin/telnetd -f /etc/issue >/dev/null 2>&1 & fi exit 0 geexbox-1.0/packages/busybox/init.d/53_httpd0000755000175000017500000000040210446314260020027 0ustar aurelaurel#!/bin/sh # # start http daemon # # runlevels: geexbox, debug # get options test -f /etc/network || exit 1 . /etc/network if test "$HTTP_SERVER" = "yes"; then echo "### Starting http daemon ###" /usr/sbin/httpd -h /var/www >/dev/null 2>&1 & fi exit 0 geexbox-1.0/packages/busybox/init.d/80_debug0000755000175000017500000000044110446314260017775 0ustar aurelaurel#!/bin/sh # # start a debugging shell # # runlevels: debug # give a shell to MPlayer in debug mode echo "### Starting debugging shell ###" sed -i 's%ok=\"quit 166\"/>%ok=\"quit 166\"/> %' /etc/mplayer/menu.conf # start shell /bin/sh exit 0 geexbox-1.0/packages/busybox/init.d/80_nodebug0000755000175000017500000000015710446314260020336 0ustar aurelaurel#!/bin/sh # # removes kernel modules from ramdisk # # runlevels: geexbox, install rm -rf /lib/modules exit 0 geexbox-1.0/packages/busybox/init.d/90_umount0000755000175000017500000000064410446314260020244 0ustar aurelaurel#!/bin/sh # # umount all mounted disks # # runlevels: geexbox, debug echo "### Unmounting disks and shares ###" # umount samba shares for DIR in /mnt/shares/*/*; do test -d "$DIR" && umount "$DIR" >/dev/null 2>&1 && rmdir "$DIR" done # when started with make exec, umount partitions if test -f /EXEC; then for DIR in /mnt/*; do test -d "$DIR" && umount "$DIR" >/dev/null 2>&1 done umount /proc fi exit 0 geexbox-1.0/packages/busybox/install0000755000175000017500000000030310446314260016656 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/bin mkdir -p $INSTALL/usr/share/udhcpc cp $BUILD/$1*/$1 $INSTALL/bin cp $PACKAGES/$1/scripts/udhcp.script $INSTALL/usr/share/udhcpc/default.script geexbox-1.0/packages/busybox/need_unpack0000755000175000017500000000017210446314260017470 0ustar aurelaurel#!/bin/sh . config/options STAMP=$STAMPS/$1/unpack test $PACKAGES/$1/config/$1.conf -nt $STAMP && rm -f $STAMP exit 0 geexbox-1.0/packages/busybox/patches/0000755000175000017500000000000010446314260016715 5ustar aurelaurelgeexbox-1.0/packages/busybox/patches/40_eject-dont-umount.diff0000644000175000017500000000142410446314260023434 0ustar aurelaurelIndex: busybox-1.1.1/miscutils/eject.c =================================================================== --- busybox-1.1.1.orig/miscutils/eject.c 2006-03-22 22:16:24.000000000 +0100 +++ busybox-1.1.1/miscutils/eject.c 2006-03-24 01:45:45.000000000 +0100 @@ -29,18 +29,10 @@ { unsigned long flags; char *device; - struct mntent *m; flags = bb_getopt_ulflags(argc, argv, "t"); device = argv[optind] ? : DEFAULT_CDROM; - if ((m = find_mount_point(device, bb_path_mtab_file))) { - if (umount(m->mnt_dir)) { - bb_error_msg_and_die("Can't umount"); - } else if (ENABLE_FEATURE_MTAB_SUPPORT) { - erase_mtab(m->mnt_fsname); - } - } if (ioctl(bb_xopen(device, (O_RDONLY | O_NONBLOCK)), (flags ? CDROMCLOSETRAY : CDROMEJECT))) { bb_perror_msg_and_die("%s", device); geexbox-1.0/packages/busybox/patches/50_ash-flock.diff0000644000175000017500000000273210446314260021726 0ustar aurelaurelIndex: busybox-1.1.1/shell/ash.c =================================================================== --- busybox-1.1.1.orig/shell/ash.c 2006-03-22 22:16:21.000000000 +0100 +++ busybox-1.1.1/shell/ash.c 2006-03-24 01:45:58.000000000 +0100 @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -1234,6 +1235,7 @@ #if JOBS static int fgcmd(int, char **); #endif +static int flockcmd(int, char **); #ifdef CONFIG_ASH_GETOPTS static int getoptscmd(int, char **); #endif @@ -1333,6 +1335,7 @@ #if JOBS { BUILTIN_REGULAR "fg", fgcmd }, #endif + { BUILTIN_NOSPEC "flock", flockcmd }, #ifdef CONFIG_ASH_GETOPTS { BUILTIN_REGULAR "getopts", getoptscmd }, #endif @@ -6863,6 +6866,46 @@ static int +flockcmd(int argc, char **argv) +{ + static int fd = -1; + int operation = 0, c; + + while ((c = nextopt("ensu"))) + switch (c) { + case 'e': + operation |= LOCK_EX; + break; + case 'n': + operation |= LOCK_NB; + break; + case 's': + operation |= LOCK_SH; + break; + case 'u': + if (fd == -1 || flock(fd, LOCK_UN)) + return 127; + close(fd); + fd = -1; + return 0; + } + + c = 127; + if (fd == -1 && *argptr && (fd = open(*argptr, O_RDONLY | O_CREAT)) != -1) + { + if (!flock(fd, operation)) { + c = 0; + } else { + close(fd); + fd = -1; + } + } + + return c; +} + + +static int waitcmd(int argc, char **argv) { struct job *job; geexbox-1.0/packages/busybox/patches/60_umount-return-errno.diff0000644000175000017500000000142610446314260024046 0ustar aurelaurelIndex: busybox-1.1.1/util-linux/umount.c =================================================================== --- busybox-1.1.1.orig/util-linux/umount.c 2006-03-22 22:16:26.000000000 +0100 +++ busybox-1.1.1/util-linux/umount.c 2006-03-24 01:47:09.000000000 +0100 @@ -36,7 +36,7 @@ char path[2*PATH_MAX]; struct mntent me; FILE *fp; - int status = EXIT_SUCCESS; + int status = 0; unsigned long opt; struct mtab_list { char *dir; @@ -128,7 +128,7 @@ * can't do simple constant propagation in local variables... */ if(ENABLE_FEATURE_MTAB_SUPPORT && !(opt & OPT_NO_MTAB) && m) erase_mtab(m->dir); - status = EXIT_FAILURE; + status = errno ? errno : 127; bb_perror_msg("Couldn't umount %s", path); } // Find next matching mtab entry for -a or umount /dev geexbox-1.0/packages/busybox/patches/70_wget-retry-timeout.diff0000644000175000017500000000711210446314260023653 0ustar aurelaurelIndex: busybox-1.1.1/include/usage.h =================================================================== --- busybox-1.1.1.orig/include/usage.h 2006-03-24 01:57:26.000000000 +0100 +++ busybox-1.1.1/include/usage.h 2006-03-24 02:06:49.000000000 +0100 @@ -3455,7 +3455,8 @@ #define wget_trivial_usage \ "[-c|--continue] [-q|--quiet] [-O|--output-document file]\n" \ - "\t\t[--header 'header: value'] [-Y|--proxy on/off] [-P DIR] url" + "\t\t[--header 'header: value'] [-Y|--proxy on/off] [-P DIR]\n" \ + "\t\t[-T|--read-timeout value] [-R|--tries value] url" #define wget_full_usage \ "wget retrieves files via HTTP or FTP\n\n" \ "Options:\n" \ @@ -3463,7 +3464,9 @@ "\t-q\tquiet mode - do not print\n" \ "\t-P\tSet directory prefix to DIR\n" \ "\t-O\tsave to filename ('-' for stdout)\n" \ - "\t-Y\tuse proxy ('on' or 'off')" + "\t-Y\tuse proxy ('on' or 'off')\n" \ + "\t-T\tdelay before timeout and shutdown\n" \ + "\t-R\tnumber of retry" #define which_trivial_usage \ "[COMMAND ...]" Index: busybox-1.1.1/networking/wget.c =================================================================== --- busybox-1.1.1.orig/networking/wget.c 2006-03-24 01:57:26.000000000 +0100 +++ busybox-1.1.1/networking/wget.c 2006-03-24 02:07:37.000000000 +0100 @@ -146,6 +146,8 @@ #define WGET_OPT_HEADER 16 #define WGET_OPT_PREFIX 32 #define WGET_OPT_PROXY 64 +#define WGET_OPT_TIMEOUT 128 +#define WGET_OPT_RETRY 256 static const struct option wget_long_options[] = { { "continue", 0, NULL, 'c' }, @@ -155,9 +157,26 @@ { "header", 1, NULL, 131 }, { "directory-prefix",1, NULL, 'P' }, { "proxy", 1, NULL, 'Y' }, + { "read-timeout", 1, NULL, 'T' }, + { "tries", 1, NULL, 'R' }, { 0, 0, 0, 0 } }; +static void timeout_reached(int ignore) +{ + if (filesize == 0) /* still haven't been able to talk with server */ + exit(-1); +} + +static void alarm_timeout(int wait) +{ + struct itimerval itv; + + itv.it_value.tv_sec = wait; + itv.it_value.tv_usec = 0; + setitimer(ITIMER_REAL, &itv, NULL); +} + int wget_main(int argc, char **argv) { int n, try=5, status; @@ -173,6 +192,7 @@ struct host_info server, target; struct sockaddr_in s_in; llist_t *headers_llist = NULL; + struct sigaction sa; FILE *sfp = NULL; /* socket to web/ftp server */ FILE *dfp = NULL; /* socket to ftp server (data) */ @@ -184,15 +204,17 @@ int quiet_flag = FALSE; /* Be verry, verry quiet... */ int use_proxy = 1; /* Use proxies if env vars are set */ char *proxy_flag = "on"; /* Use proxies if env vars are set */ + char *timeout = "900"; /* Read Timeout duration (-T) */ + char *nr_tries = NULL; /* Number of retries (-R) */ /* * Crack command line. */ bb_opt_complementally = "-1:\203::"; bb_applet_long_options = wget_long_options; - opt = bb_getopt_ulflags(argc, argv, "cq\213O:\203:P:Y:", + opt = bb_getopt_ulflags(argc, argv, "cq\213O:\203:P:Y:T:R:", &fname_out, &headers_llist, - &dir_prefix, &proxy_flag); + &dir_prefix, &proxy_flag, &timeout, &nr_tries); if (opt & WGET_OPT_CONTINUE) { ++do_continue; } @@ -218,6 +240,9 @@ } } + if (opt & WGET_OPT_RETRY) + try = atoi(nr_tries); + parse_url(argv[optind], &target); server.host = target.host; server.port = target.port; @@ -295,6 +320,13 @@ server.host, inet_ntoa(s_in.sin_addr), ntohs(server.port)); } + /* starting timer */ + sa.sa_handler = timeout_reached; + sigemptyset (&sa.sa_mask); + sa.sa_flags = SA_RESTART; + sigaction (SIGALRM, &sa, NULL); + alarm_timeout (atoi (timeout)); + if (use_proxy || !target.is_ftp) { /* * HTTP session geexbox-1.0/packages/busybox/scripts/0000755000175000017500000000000010446314260016755 5ustar aurelaurelgeexbox-1.0/packages/busybox/scripts/udhcp.script0000755000175000017500000000123210446314260021307 0ustar aurelaurel#!/bin/sh case "$1" in deconfig) ifconfig $interface 0.0.0.0 ;; renew|bound) if [ -n "$dns" ]; then rm -f /etc/resolv.conf [ -n "$domain" ] && echo "search $domain" >> /etc/resolv.conf for ns in $dns; do echo "nameserver $ns" >> /etc/resolv.conf done fi [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$subnet" ] && NETMASK="netmask $subnet" ifconfig $interface $ip $BROADCAST $NETMASK while route del default gw 0.0.0.0 dev $interface; do : done metric=0 for i in $router; do route add default gw $i dev $interface metric $((metric++)) done ;; esac geexbox-1.0/packages/busybox/unpack0000755000175000017500000000061310446314260016475 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain BUSYBOX=`ls -d $BUILD/$1*` sed -i -e "s|^HOSTCC[[:space:]]*=.*$|HOSTCC = $HOST_CC|" \ -e "s|^CROSS[[:space:]]*=.*$|CROSS = $TARGET_PREFIX|" \ $BUSYBOX/Rules.mak cp $PACKAGES/$1/config/$1.conf $BUSYBOX/.config [ "$DEVTOOLS" = yes ] && cat $PACKAGES/$1/config/$1.devtools.conf >> $BUSYBOX/.config make -C $BUSYBOX oldconfig geexbox-1.0/packages/busybox/url0000644000175000017500000000006710446314260016016 0ustar aurelaurelhttp://www.busybox.net/downloads/busybox-1.1.3.tar.bz2 geexbox-1.0/packages/ccache/0000755000175000017500000000000010446314260015001 5ustar aurelaurelgeexbox-1.0/packages/ccache/build0000755000175000017500000000032110446314260016022 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/install make setup_toolchain host CC=$LOCAL_CC cd $BUILD/$1* ./configure --host=$HOST_NAME \ --build=$HOST_NAME \ --prefix=$ROOT/$TOOLCHAIN make geexbox-1.0/packages/ccache/install0000755000175000017500000000176110446314260016402 0ustar aurelaurel#!/bin/sh . config/options make -C $BUILD/$1* install if [ "$2" = toolchain ]; then GCC_VERSION=`sed -n 's/.*\/gcc-core-\([0-9\.]*\)\..*/\1/p' $PACKAGES/gcc/url` CROSS_CC=$TARGET_CC-$GCC_VERSION rm -f $TARGET_CC echo "#!/bin/sh" >$TARGET_CC echo "$ROOT/$TOOLCHAIN/bin/ccache $CROSS_CC \"\$@\"" >>$TARGET_CC chmod +x $TARGET_CC # To avoid cache trashing DATE="0501`echo $GCC_VERSION | sed 's/\([0-9]\)/0\1/g' | sed 's/\.//g'`" touch -c -t $DATE $CROSS_CC CROSS_CXX=$SYSROOT_PREFIX/../bin/g++ if [ -f "$CROSS_CXX" ]; then rm -f $TARGET_CXX echo "#!/bin/sh" >$TARGET_CXX echo "$ROOT/$TOOLCHAIN/bin/ccache $CROSS_CXX \"\$@\"" >>$TARGET_CXX chmod +x $TARGET_CXX # To avoid cache trashing touch -c -t $DATE $CROSS_CXX fi else echo "#!/bin/sh" >$HOST_CC echo "$ROOT/$TOOLCHAIN/bin/ccache $LOCAL_CC \"\$@\"" >>$HOST_CC chmod +x $HOST_CC echo "#!/bin/sh" >$HOST_CXX echo "$ROOT/$TOOLCHAIN/bin/ccache $LOCAL_CXX \"\$@\"" >>$HOST_CXX chmod +x $HOST_CXX fi geexbox-1.0/packages/ccache/stats0000755000175000017500000000006610446314260016067 0ustar aurelaurel#!/bin/sh . config/options $TOOLCHAIN/bin/ccache -s geexbox-1.0/packages/ccache/url0000644000175000017500000000005610446314260015527 0ustar aurelaurelhttp://samba.org/ftp/ccache/ccache-2.4.tar.gz geexbox-1.0/packages/cdparanoia/0000755000175000017500000000000010446314260015674 5ustar aurelaurelgeexbox-1.0/packages/cdparanoia/build0000755000175000017500000000074010446314260016722 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain export ac_cv_sizeof_short=2 export ac_cv_sizeof_int=4 export ac_cv_sizeof_long=4 export ac_cv_sizeof_long_long=8 cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME make lib OPT="$CFLAGS -ffast-math" mkdir -p $LIB_PREFIX/lib $LIB_PREFIX/include cp interface/cdda_interface.h paranoia/cdda_paranoia.h $LIB_PREFIX/include cp interface/libcdda_interface.a paranoia/libcdda_paranoia.a $LIB_PREFIX/lib geexbox-1.0/packages/cdparanoia/patches/0000755000175000017500000000000010446314260017323 5ustar aurelaurelgeexbox-1.0/packages/cdparanoia/patches/10_gcc_fix.diff0000644000175000017500000000137110446314260022061 0ustar aurelaureldiff -Naur cdparanoia-III-alpha9.8.orig/interface/utils.h cdparanoia-III-alpha9.8/interface/utils.h --- cdparanoia-III-alpha9.8.orig/interface/utils.h 2000-04-20 00:41:04.000000000 +0200 +++ cdparanoia-III-alpha9.8/interface/utils.h 2005-01-14 18:25:16.000000000 +0100 @@ -112,6 +112,7 @@ break; case CDDA_MESSAGE_FORGETIT: default: + break; } } } @@ -127,6 +128,7 @@ break; case CDDA_MESSAGE_FORGETIT: default: + break; } } } @@ -169,6 +171,7 @@ break; case CDDA_MESSAGE_FORGETIT: default: + break; } } if(malloced)free(buffer); @@ -205,6 +208,7 @@ break; case CDDA_MESSAGE_FORGETIT: default: + break; } } if(malloced)free(buffer); geexbox-1.0/packages/cdparanoia/patches/20_paranoia-read-bail.diff0000644000175000017500000000473710446314260024101 0ustar aurelaureldiff -ur cdparanoia-III-alpha9.8.orig/paranoia/p_block.h cdparanoia-III-alpha9.8/paranoia/p_block.h --- cdparanoia-III-alpha9.8.orig/paranoia/p_block.h Mon Mar 26 07:44:02 2001 +++ cdparanoia-III-alpha9.8/paranoia/p_block.h Mon Jul 25 11:40:11 2005 @@ -159,6 +159,7 @@ /* statistics for verification */ + int readerrors; } cdrom_paranoia; extern c_block *c_alloc(int16_t *vector,long begin,long size); diff -ur cdparanoia-III-alpha9.8.orig/paranoia/paranoia.c cdparanoia-III-alpha9.8/paranoia/paranoia.c --- cdparanoia-III-alpha9.8.orig/paranoia/paranoia.c Mon Mar 26 07:44:02 2001 +++ cdparanoia-III-alpha9.8/paranoia/paranoia.c Mon Jul 25 11:40:11 2005 @@ -58,6 +58,8 @@ #include "overlap.h" #include "gap.h" #include "isort.h" +#include +#include static inline long re(root_block *root){ if(!root)return(-1); @@ -1045,7 +1047,7 @@ /* returns last block read, -1 on error */ c_block *i_read_c_block(cdrom_paranoia *p,long beginword,long endword, - void(*callback)(long,int)){ + void(*callback)(long,int), int *bail){ /* why do it this way? We need to read lots of sectors to kludge around stupid read ahead buffers on cheap drives, as well as avoid @@ -1065,6 +1067,7 @@ long dynoverlap=(p->dynoverlap+CD_FRAMEWORDS-1)/CD_FRAMEWORDS; long anyflag=0; + *bail = 0; /* What is the first sector to read? want some pre-buffer if we're not at the extreme beginning of the disc */ @@ -1140,6 +1143,14 @@ backward! */ if(callback)(*callback)((adjread+thisread)*CD_FRAMEWORDS,PARANOIA_CB_READERR); + if(++p->readerrors == 20) { + if (ioctl(p->d->ioctl_fd, CDROM_DRIVE_STATUS, CDSL_CURRENT) != CDS_DISC_OK) { + *bail = 1; + anyflag = 0; + break; + } + p->readerrors = 0; + } memset(buffer+(sofar+thisread)*CD_FRAMEWORDS,0, CD_FRAMESIZE_RAW*(secread-thisread)); if(flags)memset(flags+(sofar+thisread)*CD_FRAMEWORDS,2, @@ -1203,6 +1214,8 @@ long retry_count=0,lastend=-2; root_block *root=&p->root; + p->readerrors=0; + if(beginword>p->root.returnedlimit)p->root.returnedlimit=beginword; lastend=re(root); @@ -1236,7 +1249,10 @@ /* Hmm, need more. Read another block */ { - c_block *new=i_read_c_block(p,beginword,endword,callback); + int bail; + c_block *new=i_read_c_block(p,beginword,endword,callback, &bail); + if (bail) + return NULL; if(new){ if(p->enable&(PARANOIA_MODE_OVERLAP|PARANOIA_MODE_VERIFY)){ geexbox-1.0/packages/cdparanoia/patches/30_null-pointer-check.diff0000644000175000017500000000106510446314260024164 0ustar aurelaureldebian bug #168683 diff -Nur cdparanoia-III-alpha9.8.orig/interface/scan_devices.c cdparanoia-III-alpha9.8/interface/scan_devices.c --- cdparanoia-III-alpha9.8.orig/interface/scan_devices.c Mon Mar 26 07:44:01 2001 +++ cdparanoia-III-alpha9.8/interface/scan_devices.c Tue Jul 26 12:55:30 2005 @@ -617,7 +617,8 @@ /* It would seem some TOSHIBA CDROMs gets things wrong */ - if (!strncmp (p + 8, "TOSHIBA", 7) && + if (p && + !strncmp (p + 8, "TOSHIBA", 7) && !strncmp (p + 16, "CD-ROM", 6) && p[0] == TYPE_DISK) { p[0] = TYPE_ROM; geexbox-1.0/packages/cdparanoia/url0000644000175000017500000000010610446314260016416 0ustar aurelaurelhttp://www.xiph.org/paranoia/download/cdparanoia-III-alpha9.8.src.tgz geexbox-1.0/packages/configtools/0000755000175000017500000000000010446314260016121 5ustar aurelaurelgeexbox-1.0/packages/configtools/build0000755000175000017500000000010710446314260017144 0ustar aurelaurel#!/bin/sh . config/options $BUILD/$1/config.guess > $HOST_NAME_CACHE geexbox-1.0/packages/configtools/url0000644000175000017500000000004110446314260016641 0ustar aurelaurelGEEXBOX_SRCS/configtools.tar.bz2 geexbox-1.0/packages/cpufreqd/0000755000175000017500000000000010446314260015404 5ustar aurelaurelgeexbox-1.0/packages/cpufreqd/build0000755000175000017500000000055610446314260016437 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build cpufrequtils export ac_cv_func_malloc_0_nonnull=yes export ac_cv_lib_cpufreq_cpufreq_cpu_exists=yes export LDADD="-lsysfs" cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix= \ --exec-prefix=/usr \ --disable-static make geexbox-1.0/packages/cpufreqd/config/0000755000175000017500000000000010446314260016651 5ustar aurelaurelgeexbox-1.0/packages/cpufreqd/config/cpufreqd.conf0000644000175000017500000000067210446314260021336 0ustar aurelaurel[General] pidfile=/var/run/cpufreqd.pid poll_interval=2 enable_plugins=cpu,@CPUFREQD_LIBS@ verbosity=0 [/General] [Profile] name=hi_boost minfreq=66% maxfreq=100% policy=performance [/Profile] [Profile] name=lo_power minfreq=0% maxfreq=66% policy=conservative [/Profile] [Rule] name=conservative ac=off battery_interval=0-100 cpu_interval=0-40 profile=lo_power [/Rule] [Rule] name=AC_on ac=on profile=hi_boost [/Rule] geexbox-1.0/packages/cpufreqd/init.d/0000755000175000017500000000000010446314260016571 5ustar aurelaurelgeexbox-1.0/packages/cpufreqd/init.d/78_cpufreq0000755000175000017500000000032110446314260020476 0ustar aurelaurel#!/bin/sh # # cpufreq deamon # # runlevels: geexbox, debug if [ -x /usr/bin/cpufreqd -a -r /etc/cpufreqd.conf ]; then echo "### Starting CpuFreq daemon ###" cpufreqd --file=/etc/cpufreqd.conf fi exit 0 geexbox-1.0/packages/cpufreqd/install0000755000175000017500000000076510446314260017010 0ustar aurelaurel#!/bin/sh . config/options case $TARGET_ARCH in i386) cpufreqd_libs="acpi_ac acpi_battery" ;; ppc) cpufreqd_libs="pmu" ;; esac mkdir -p $INSTALL/usr/lib for lib in cpu $cpufreqd_libs; do cp $BUILD/$1*/src/.libs/$1_$lib.so $INSTALL/usr/lib done mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/src/$1 $INSTALL/usr/bin mkdir -p $INSTALL/etc cpufreqd_libs=`echo $cpufreqd_libs | sed 's/ /,/g'` sed "s%@CPUFREQD_LIBS@%$cpufreqd_libs%" $PACKAGES/$1*/config/$1.conf > $INSTALL/etc/$1.conf geexbox-1.0/packages/cpufreqd/patches/0000755000175000017500000000000010446314260017033 5ustar aurelaurelgeexbox-1.0/packages/cpufreqd/patches/01_pselect-def.diff0000644000175000017500000000261110446314260022360 0ustar aurelaurel--- cpufreqd-2.0.0.old/src/main.c 2005-11-23 20:53:08.000000000 +0100 +++ cpufreqd-2.0.0/src/main.c 2005-12-08 16:28:04.000000000 +0100 @@ -79,6 +79,41 @@ static int cpufreqd_mode = ARG_DYNAMIC; /* operation mode (manual / dynamic) */ /* + * From glibc + */ +int +pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, + const struct timespec *timeout, const sigset_t *sigmask) +{ + struct timeval tval; + int retval; + sigset_t savemask; + + /* Change nanosecond number to microseconds. This might mean losing + * precision and therefore the `pselect` should be available. But + * for now it is hardly found. */ + if (timeout != NULL) + TIMESPEC_TO_TIMEVAL (&tval, timeout); + + /* The setting and restoring of the signal mask and the select call + * should be an atomic operation. This can't be done without kernel + * help. */ + if (sigmask != NULL) + sigprocmask (SIG_SETMASK, sigmask, &savemask); + + /* Note the pselect() is a cancellation point. But since we call + * select() which itself is a cancellation point we do not have + * to do anything here. */ + retval = select (nfds, readfds, writefds, exceptfds, + timeout != NULL ? &tval : NULL); + + if (sigmask != NULL) + sigprocmask (SIG_SETMASK, &savemask, NULL); + + return retval; +} + +/* * Evaluates the full rule and returns the percentage score * for it. */ geexbox-1.0/packages/cpufreqd/patches/20_no-log.diff0000644000175000017500000000103410446314260021357 0ustar aurelaurel* this patch also significantly reduce the binary size. diff -Naur cpufreqd-2.0.0.orig/src/cpufreqd_log.h cpufreqd-2.0.0/src/cpufreqd_log.h --- cpufreqd-2.0.0.orig/src/cpufreqd_log.h 2005-12-29 17:36:05.000000000 +0100 +++ cpufreqd-2.0.0/src/cpufreqd_log.h 2005-12-29 17:36:51.000000000 +0100 @@ -32,7 +32,6 @@ extern void cpufreqd_log (const int prio, const char *fmt, ...); -#define clog(__prio,__fmt,...) \ - cpufreqd_log(__prio, "%-25s: "__fmt, __func__, ## __VA_ARGS__) +#define clog(__prio,__fmt,...) do { } while(0) #endif geexbox-1.0/packages/cpufreqd/url0000644000175000017500000000011510446314260016126 0ustar aurelaurelhttp://switch.dl.sourceforge.net/sourceforge/cpufreqd/cpufreqd-2.0.0.tar.bz2 geexbox-1.0/packages/cpufrequtils/0000755000175000017500000000000010446314260016321 5ustar aurelaurelgeexbox-1.0/packages/cpufrequtils/build0000755000175000017500000000047110446314260017350 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build sysfsutils cd $BUILD/$1*/libcpufreq ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --enable-sysfs \ --disable-proc \ --disable-shared make make install geexbox-1.0/packages/cpufrequtils/url0000644000175000017500000000011610446314260017044 0ustar aurelaurelhttp://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-0.4.tar.bz2 geexbox-1.0/packages/dialog/0000755000175000017500000000000010446314260015032 5ustar aurelaurelgeexbox-1.0/packages/dialog/build0000755000175000017500000000066710446314260016070 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build ncurses cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --disable-nls \ --without-dbmalloc \ --without-dmalloc \ --with-ncurses \ --disable-widec \ --disable-rc-file \ --disable-Xdialog \ --disable-form \ --disable-tailbox make geexbox-1.0/packages/dialog/patches/0000755000175000017500000000000010446314260016461 5ustar aurelaurelgeexbox-1.0/packages/dialog/patches/10_reduce.diff0000644000175000017500000000151110446314260021060 0ustar aurelaurelenable only: yesno, msgbox, menu, inputbox diff -Nur dialog-1.0-20060126.orig/dialog.c dialog-1.0-20060126/dialog.c --- dialog-1.0-20060126.orig/dialog.c Thu Jan 19 00:51:37 2006 +++ dialog-1.0-20060126/dialog.c Sat Feb 11 13:51:58 2006 @@ -895,14 +895,8 @@ { {o_yesno, 4, 4, call_yesno}, {o_msgbox, 4, 4, call_msgbox}, - {o_infobox, 4, 4, call_infobox}, - {o_textbox, 4, 4, call_textbox}, {o_menu, 7, 0, call_menu}, - {o_inputmenu, 7, 0, call_inputmenu}, - {o_checklist, 8, 0, call_checklist}, - {o_radiolist, 8, 0, call_radiolist}, {o_inputbox, 4, 5, call_inputbox}, - {o_passwordbox, 4, 5, call_passwordbox}, #ifdef HAVE_XDIALOG {o_calendar, 4, 7, call_calendar}, {o_fselect, 4, 5, call_fselect}, geexbox-1.0/packages/dialog/url0000644000175000017500000000007210446314260015556 0ustar aurelaurelftp://invisible-island.net/dialog/dialog-1.0-20060126.tgz geexbox-1.0/packages/digitools/0000775000175000017500000000000010446314260015572 5ustar aurelaurelgeexbox-1.0/packages/digitools/arch0000644000175000017500000000000510446314260016423 0ustar aurelaureli386 geexbox-1.0/packages/digitools/build0000755000175000017500000000030010446314260016606 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build alsa make -C $BUILD/$1* \ LDFLAGS="$LDFLAGS -lasound -ldl" \ CFLAGS="$CFLAGS -DSILENT" \ STRIP="$STRIP" \ default \ strip geexbox-1.0/packages/digitools/init.d/0000775000175000017500000000000010446314260016757 5ustar aurelaurelgeexbox-1.0/packages/digitools/init.d/30_digitools0000755000175000017500000000067510446314260021212 0ustar aurelaurel#!/bin/sh # # setup the Digimatrix # # runlevels: geexbox, debug [ -f /proc/acpi/dsdt ] || exit 1 [ `grep -e P4SQ -c /proc/acpi/dsdt` -eq 0 ] && exit 1 echo "### Setting up Digimatrix ###" [ -x /usr/bin/digifan ] && digifan -g 5 -i [ -x /usr/bin/digipanel ] && digipanel -lts [ -x /usr/bin/digiradio ] && echo '' > /var/digimatrix # PAL-I/SECAM requires tda9887 options for audio echo "options tda9887 port2=0" >> /etc/modprobe.conf exit 0 geexbox-1.0/packages/digitools/init.d/89_digiwake0000755000175000017500000000041010446314260021002 0ustar aurelaurel#!/bin/sh # # setup the Digimatrix Wake-On-CIR # # runlevels: geexbox, debug [ -f /proc/acpi/dsdt ] || exit 1 [ `grep -e P4SQ -c /proc/acpi/dsdt` -eq 0 ] && exit 1 echo "### Setting up Digimatrix Wake-On-CIR ###" [ -x /usr/bin/digiwake ] && digiwake -w exit 0 geexbox-1.0/packages/digitools/install0000755000175000017500000000033410446314260017164 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/usr/bin cp -PR \ $BUILD/$1*/digitools \ $BUILD/$1*/digipanel \ $BUILD/$1*/digiradio \ $BUILD/$1*/digifan \ $BUILD/$1*/digiwake \ $INSTALL/usr/bin exit 0 geexbox-1.0/packages/digitools/url0000664000175000017500000000004210446314260016313 0ustar aurelaurelGEEXBOX_SRCS/digitools-1.0.tar.gz geexbox-1.0/packages/djmount/0000755000175000017500000000000010446314260015253 5ustar aurelaurelgeexbox-1.0/packages/djmount/build0000755000175000017500000000101110446314260016271 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build fuse $SCRIPTS/build talloc $SCRIPTS/build libupnp cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --with-external-talloc \ --with-external-libupnp \ --without-libiconv-prefix \ --with-fuse-prefix=$LIB_PREFIX \ --with-talloc-prefix=$LIB_PREFIX \ --with-libupnp-prefix=$LIB_PREFIX \ --disable-charset \ --disable-debug make geexbox-1.0/packages/djmount/init.d/0000755000175000017500000000000010446314260016440 5ustar aurelaurelgeexbox-1.0/packages/djmount/init.d/59_upnp0000755000175000017500000000051410446314260017665 0ustar aurelaurel#!/bin/sh # # mount UPnP VFS # # runlevels: geexbox, debug # get options test -f /etc/network || exit 1 . /etc/network if test "$UPNP" = "yes" -a -f /usr/bin/djmount; then echo "### Mounting UPnP VFS ###" # Build UPnP VFS directory mkdir -p /tmp/UPnP # Mount UPnP VFS djmount -f /tmp/UPnP >/dev/null 2>&1 & fi exit 0 geexbox-1.0/packages/djmount/install0000755000175000017500000000016310446314260016647 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/install fuse mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/$1/$1 $INSTALL/usr/bin geexbox-1.0/packages/djmount/patches/0000755000175000017500000000000010446314260016702 5ustar aurelaurelgeexbox-1.0/packages/djmount/patches/10_mount.diff0000644000175000017500000000123410446314260021176 0ustar aurelaureldiff -Naur djmount-0.50.orig/djmount/device_list.c djmount-0.50/djmount/device_list.c --- djmount-0.50.orig/djmount/device_list.c 2005-12-06 23:05:02.000000000 +0100 +++ djmount-0.50/djmount/device_list.c 2005-12-10 12:01:09.000000000 +0100 @@ -35,6 +35,7 @@ #include "service.h" #include "talloc_util.h" +#include #include #include #include @@ -462,6 +463,7 @@ AddDevice (d_event->DeviceId, d_event->Location, d_event->Expires); Log_Print (LOG_DEBUG, "Discovery: DeviceList after AddDevice ="); DeviceList_PrintStatus (LOG_DEBUG); + symlink ("/tmp/UPnP", "/mnt/UPnP"); } break; geexbox-1.0/packages/djmount/patches/20_browse-folder.diff0000644000175000017500000000155010446314260022610 0ustar aurelaureldiff -Naur djmount-0.50.orig/djmount/djfs.c djmount-0.50/djmount/djfs.c --- djmount-0.50.orig/djmount/djfs.c 2005-12-08 18:30:53.000000000 +0100 +++ djmount-0.50/djmount/djfs.c 2005-12-10 12:03:42.000000000 +0100 @@ -308,13 +308,6 @@ for (i = 0; i < names->nb; i++) { const char* const devName = names->str[i]; DIR_BEGIN(devName) { - FILE_BEGIN("status") { - const char* const str = DeviceList_GetDeviceStatusString - (tmp_ctx, devName, true); - FILE_SET_STRING (str); - FILE_SET_SIZE (str ? strlen (str) : 0); - } FILE_END; - DIR_BEGIN("browse") { size_t nb_matched = 0; const ContentDir_BrowseResult* const res = _DJFS_BrowseCDS (tmp_ctx, devName, ptr, &nb_matched); @@ -369,7 +362,6 @@ } PTR_LIST_FOR_EACH_PTR_END; } DIR_END; } - } DIR_END; // "browse" } DIR_END; // devName } } geexbox-1.0/packages/djmount/patches/30_no-xml-file.diff0000644000175000017500000000126010446314260022164 0ustar aurelaureldiff -Naur djmount-0.50.orig/djmount/djfs.c djmount-0.50/djmount/djfs.c --- djmount-0.50.orig/djmount/djfs.c 2005-12-08 18:30:53.000000000 +0100 +++ djmount-0.50/djmount/djfs.c 2005-12-10 12:05:42.000000000 +0100 @@ -356,15 +356,6 @@ } FILE_END; } } - char* const name = MediaFile_GetName (tmp_ctx, o, "xml"); - FILE_BEGIN (name) { - const char* const str = talloc_asprintf - (tmp_ctx, - "\n%s", - DIDLObject_GetElementString (o, tmp_ctx)); - FILE_SET_STRING (str); - FILE_SET_SIZE (str ? strlen (str) : 0); - } FILE_END; } } PTR_LIST_FOR_EACH_PTR_END; } DIR_END; geexbox-1.0/packages/djmount/patches/40_mimetypes.diff0000644000175000017500000000313110446314260022051 0ustar aurelaureldiff -Naur djmount-0.51.orig/djmount/media_file.c djmount-0.51/djmount/media_file.c --- djmount-0.51.orig/djmount/media_file.c 2006-01-10 22:41:22.000000000 +0100 +++ djmount-0.51/djmount/media_file.c 2006-02-12 18:41:38.000000000 +0100 @@ -73,6 +73,9 @@ { "video/x-motion-jpeg", "m3u", "mjpg" }, { "video/quicktime", "m3u", "mov" }, { "video/x-matroska", "m3u", "mkv" }, + { "video/x-ms-wmv", "m3u", "wmv" }, + { "video/mpeg", "m3u", "mpg" }, + { "video/mp2p", "m3u", "vob" }, { "video/", "m3u", NULL }, { "application/x-matroska", "m3u", "mkv" }, { "application/ogg", "m3u", "ogg" }, @@ -87,7 +90,26 @@ { "image/x-xpixmap", NULL, "xpm" }, { "image/x-xbitmap", NULL, "xbm" }, { "image/x-photo-cd", NULL, "pcd" }, + { "image/bmp", NULL, "bmp" }, + { "image/gif", NULL, "gif" }, + { "image/png", NULL, "png" }, + { "image/x-quicktime", NULL, "qti" }, + { "image/tiff", NULL, "tif" }, { "image/", NULL, NULL }, + { "text/srt", NULL, "srt" }, + { "text/ssa", NULL, "ssa" }, + { "text/psb", NULL, "psb" }, + { "text/pjs", NULL, "pjs" }, + { "text/sub", NULL, "sub" }, + { "text/idx", NULL, "idx" }, + { "text/dks", NULL, "dks" }, + { "text/tts", NULL, "tts" }, + { "text/vsf", NULL, "vsf" }, + { "text/zeg", NULL, "zeg" }, + { "text/mpl", NULL, "mpl" }, + { "text/bup", NULL, "bup" }, + { "text/ifo", NULL, "ifo" }, + { "text/", NULL, NULL }, { NULL, NULL, NULL } }; geexbox-1.0/packages/djmount/unpack0000755000175000017500000000012310446314260016456 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/fixconfigtools $BUILD/$1*/libupnp/config.aux geexbox-1.0/packages/djmount/url0000644000175000017500000000011110446314260015771 0ustar aurelaurelhttp://switch.dl.sourceforge.net/sourceforge/djmount/djmount-0.53.tar.gz geexbox-1.0/packages/dosfstools/0000755000175000017500000000000010446314260015772 5ustar aurelaurelgeexbox-1.0/packages/dosfstools/build0000755000175000017500000000014110446314260017013 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain make -C $BUILD/$1*/mkdosfs \ mkdosfs geexbox-1.0/packages/dosfstools/install0000755000175000017500000000014610446314260017367 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/mkdosfs/mkdosfs $INSTALL/usr/bin geexbox-1.0/packages/dosfstools/url0000644000175000017500000000012010446314260016510 0ustar aurelaurelftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-2.11.src.tar.gz geexbox-1.0/packages/dvb-apps/0000755000175000017500000000000010446314260015307 5ustar aurelaurelgeexbox-1.0/packages/dvb-apps/build0000755000175000017500000000021610446314260016333 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1*/util/scan make CC="$CC" \ CFLAGS="$CFLAGS" \ LFLAGS="$LDFLAGS" geexbox-1.0/packages/dvb-apps/install0000755000175000017500000000036110446314260016703 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/util/scan/scan $INSTALL/usr/bin/dvbscan # Build DVB transponders frequencies archive tar cf - -C $BUILD/$1/util/scan/ dvb | lzma e $INSTALL/usr/share/dvb.tar.lzma -si -a2 geexbox-1.0/packages/dvb-apps/unpack0000755000175000017500000000216010446314260016515 0ustar aurelaurel#!/bin/sh . config/options DVBFREQ="`ls -d $BUILD/$1*/util/scan`/dvb" # Build DVB Transponders Frequencies list mkdir -p $DVBFREQ # Add DVB Terrestrial transponders frequencies for i in `ls $BUILD/$1*/util/scan/dvb-t/ | grep -v CVS | sed 's/\([a-z][a-z]\)-.*/\1/'`; do mkdir -p "$DVBFREQ/dvb-t/$i" done for i in `ls $BUILD/$1*/util/scan/dvb-t/*-*`; do tmpdir=`echo $i | sed "s%.*/dvb-t/\([a-z][a-z]\)-.*%\1%"` file=`echo $i | sed "s%.*/dvb-t/[a-z][a-z]-\(.*\)%\1%"` cp $i "$DVBFREQ/dvb-t/$tmpdir/$file" done # Add DVB Satellite transponders frequencies mkdir -p "$DVBFREQ/dvb-s" cp $BUILD/$1*/util/scan/dvb-s/*-* $DVBFREQ/dvb-s/ # Add DVB Cable transponders frequencies for i in `ls $BUILD/$1*/util/scan/dvb-c/ | grep -v CVS | sed 's/\([a-z][a-z]\)-.*/\1/'`; do mkdir -p "$DVBFREQ/dvb-c/$i" done for i in `ls $BUILD/$1*/util/scan/dvb-c/*-*`; do tmpdir=`echo $i | sed "s%.*/dvb-c/\([a-z][a-z]\)-.*%\1%"` file=`echo $i | sed "s%.*/dvb-c/[a-z][a-z]-\(.*\)%\1%"` cp $i "$DVBFREQ/dvb-c/$tmpdir/$file" done # Add US ATSC transponders frequencies mkdir -p "$DVBFREQ/atsc" cp $BUILD/$1*/util/scan/atsc/*-* $DVBFREQ/atsc/ geexbox-1.0/packages/dvb-apps/url0000644000175000017500000000004710446314260016035 0ustar aurelaurelGEEXBOX_SRCS/dvb-apps-06042006.tar.bz2 geexbox-1.0/packages/em8300/0000755000175000017500000000000010446314260014507 5ustar aurelaurelgeexbox-1.0/packages/em8300/build0000755000175000017500000000076110446314260015540 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build linux cd $BUILD/$1* make -C modules PWD=`ls -d $ROOT/$BUILD/$1*/modules` KERNEL_LOCATION=$(kernel_path) ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --with-firmware-dir=/firmwares \ --enable-static \ --disable-shared \ --disable-gtktest make -C em8300setup make -C include install em8300incdir="$LIB_PREFIX/include/linux" geexbox-1.0/packages/em8300/config/0000755000175000017500000000000010446314260015754 5ustar aurelaurelgeexbox-1.0/packages/em8300/config/dxr30000664000175000017500000000203510446314260016561 0ustar aurelaurel# Below are the default GeeXboX settings for the adv717x and em8300 # modules: ADV717X_OPTS="pixelport_16bit=0" EM8300_OPTS="" # Other settings that have been reported # (http://dxr3.sourceforge.net/) to commonly fix the "green screen" # or "only 1/2 screen" problems for many users are included below- # remove the "#" before the $ symbol to activate a given setting: ## Option 1 ## #ADV717X_OPTS="pixelport_16bit=1 pixelport_other_pal=1" #EM8300_OPTS="dicom_fix=1 dicom_control=1 dicom_other_pal=1" ## Option 2 ## #ADV717X_OPTS="pixelport_16bit=0 pixelport_other_pal=0" #EM8300_OPTS="dicom_fix=1 dicom_control=1 dicom_other_pal=0" ## Option 3 ## #ADV717X_OPTS="pixelport_16bit=0 pixelport_other_pal=1" #EM8300_OPTS="dicom_fix=1 dicom_control=1 dicom_other_pal=1" ## Option 4 ## #ADV717X_OPTS="pixelport_16bit=1 pixelport_other_pal=0" #EM8300_OPTS="dicom_fix=0 dicom_control=0 dicom_other_pal=0" # If none of these options work for you, you can try other combinations # based on the information: # http://dxr3.sourceforge.net/howto.html#modparam geexbox-1.0/packages/em8300/config/packages.ini0000644000175000017500000000043110446314260020231 0ustar aurelaurel[Firmwares/EM8300] name=Firmware for the EM8300 card. desc=Firmware for the RealMagic EM8300 Hollywood+ desc=(a.k.a. Creative Labs DXR3) MPEG-2 hardware decompression card. file=http://dxr3.sourceforge.net/download/em8300.uc md5=1af7a2241e17d17684289f39168eb6b9 rename=em8300.bin geexbox-1.0/packages/em8300/init.d/0000775000175000017500000000000010446314260015676 5ustar aurelaurelgeexbox-1.0/packages/em8300/init.d/36_dxr30000755000175000017500000000064010446314260017012 0ustar aurelaurel#!/bin/sh # # setup tv cards # # runlevels: geexbox, debug, install if grep -q 'Class 0480:.*1105:8300' /proc/pci; then echo "### Setting up DXR3 card ###" # include module modprobe options . /etc/dxr3 # Drivers for DXR3/Hollywood+ cards modprobe bt865 2>&1 >/dev/null modprobe adv717x $ADV717X_OPTS 2>&1 >/dev/null modprobe em8300 $EM8300_OPTS 2>&1 >/dev/null echo '' > /var/use_dxr3 fi exit 0 geexbox-1.0/packages/em8300/install0000755000175000017500000000102410446314260016100 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/usr/lib mkdir -p $INSTALL/usr/bin mkdir -p `ls -d $INSTALL/lib/modules/*`/kernel/drivers/video cp $PACKAGES/$1/config/dxr3 $INSTALL/etc cp $BUILD/$1*/modules/adv717x.ko $INSTALL/lib/modules/*/kernel/drivers/video/ cp $BUILD/$1*/modules/bt865.ko $INSTALL/lib/modules/*/kernel/drivers/video/ cp $BUILD/$1*/modules/em8300.ko $INSTALL/lib/modules/*/kernel/drivers/video/ cp $BUILD/$1*/modules/em8300.uc $INSTALL/firmwares/em8300.bin cp $BUILD/$1*/em8300setup/em8300setup $INSTALL/usr/bin geexbox-1.0/packages/em8300/patches/0000755000175000017500000000000010446314260016136 5ustar aurelaurelgeexbox-1.0/packages/em8300/unpack0000755000175000017500000000011210446314260015710 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/fixconfigtools $BUILD/$1*/autotools geexbox-1.0/packages/em8300/url0000644000175000017500000000010710446314261015233 0ustar aurelaurelhttp://switch.dl.sourceforge.net/sourceforge/dxr3/em8300-0.15.3.tar.gz geexbox-1.0/packages/extra-codecs-nonfree/0000755000175000017500000000000010446314261017607 5ustar aurelaurelgeexbox-1.0/packages/extra-codecs-nonfree/arch0000644000175000017500000000000510446314261020442 0ustar aurelaureli386 geexbox-1.0/packages/extra-codecs-nonfree/config/0000755000175000017500000000000010446314261021054 5ustar aurelaurelgeexbox-1.0/packages/extra-codecs-nonfree/config/packages.ini0000644000175000017500000000343710446314261023342 0ustar aurelaurel[Codecs/] name=Codecs file=http://www.geexbox.org/codecs/ dir=iso/GEEXBOX/codecs/ target=i386 [Codecs/On2/] name=On2 Codecs file=On2/ target=i386 [Codecs/On2/On2 VP4 Personal] name=On2 VP4 Personal Codec license=LICENSE file=vp4vfw.dll.bz2 md5=4fa1470b0744c8fded709494cc01dcdd target=i386 [Codecs/On2/On2 VP5 Personal] name=On2 VP5 Personal Codec license=LICENSE file=vp5vfw.dll.bz2 md5=8f58c6bfe31a9bb1c193aa1d4831989c target=i386 [Codecs/On2/On2 VP6 Personal] name=On2 VP6 Personal Codec license=LICENSE file=vp6vfw.dll.bz2 md5=5bcef75c281d57241cd0f6a51d2afeed target=i386 [Codecs/Real/] name=Win32 Real Player + Audio decoders file=Real/Win32/ target=i386 [Codecs/Real/RealPlayer 8 RV30] name=Win32 RealPlayer 8 RV30 decoder license=LICENSE file=drv33260.dll.bz2 md5=2be675800d03234aa8ab6a800a61fae2 target=i386 [Codecs/Real/RealPlayer 9 RV40] name=Win32 RealPlayer 9 RV40 decoder license=LICENSE file=drv43260.dll.bz2 md5=73f4dad3532961c0e1268c6002204d22 target=i386 [Codecs/Real/RealAudio] name=Win32 RealAudio decoders desc=Win32 RealAudio decoders for: desc= Sipro, ATRAC3 license=LICENSE file=atrc3260.dll.bz2 md5=c6dbfd36e02c91ff95c5411329f6fd07 file=sipr3260.dll.bz2 md5=f0695d686550c324d77fac7ae49c19d8 file=tokr3260.dll.bz2 md5=eedfa7261cbc1e1c6e99b34e7ecf3301 target=i386 [Codecs/QuickTime] name=QuickTime decoder desc=Win32 QuickTime Video decoder for: desc= Indeo desc= desc=Win32 QuickTime Audio decoder for: desc= QCLP, MACE3, MACE6, QDMC license=QuickTime/LICENSE file=QuickTime/QuickTime.qts.bz2 md5=10ade79f871f5e40fa6e7a884f1c170e target=i386 [Codecs/Windows Media/] name=Windows Media Codecs file=WindowsMedia/ target=i386 [Codecs/Windows Media/Windows Media 9] name=Windows Media 9 Video codecs license=LICENSE file=wmv9dmod.dll.bz2 md5=b98208455f1e4de7b7445f4f6219f179 target=i386 geexbox-1.0/packages/extra-codecs-nonfree/install0000755000175000017500000000012610446314261021202 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/codecs cp $BUILD/$1*/* $INSTALL/codecs geexbox-1.0/packages/extra-codecs-nonfree/unpack0000755000175000017500000000015210446314261021014 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $BUILD/$1 $SCRIPTS/extract $1 "*" $BUILD/$1 bunzip2 $BUILD/$1/*.bz2 geexbox-1.0/packages/extra-codecs-nonfree/url0000644000175000017500000000076110446314261020340 0ustar aurelaurelhttp://www.geexbox.org/codecs/On2/vp4vfw.dll.bz2 http://www.geexbox.org/codecs/On2/vp5vfw.dll.bz2 http://www.geexbox.org/codecs/On2/vp6vfw.dll.bz2 http://www.geexbox.org/codecs/Real/Win32/drv33260.dll.bz2 http://www.geexbox.org/codecs/Real/Win32/drv43260.dll.bz2 http://www.geexbox.org/codecs/Real/Win32/atrc3260.dll.bz2 http://www.geexbox.org/codecs/Real/Win32/sipr3260.dll.bz2 http://www.geexbox.org/codecs/Real/Win32/tokr3260.dll.bz2 http://www.geexbox.org/codecs/WindowsMedia/wmv9dmod.dll.bz2 geexbox-1.0/packages/extra-firmwares-nonfree/0000755000175000017500000000000010446314261020346 5ustar aurelaurelgeexbox-1.0/packages/extra-firmwares-nonfree/config/0000755000175000017500000000000010446314261021613 5ustar aurelaurelgeexbox-1.0/packages/extra-firmwares-nonfree/config/packages.ini0000644000175000017500000001220010446314261024065 0ustar aurelaurel[Firmwares/] name=Firmwares for drivers file=http://www.geexbox.org/firmwares/ dir=iso/GEEXBOX/firmwares/ [Firmwares/WiFi/] name=Firmwares for Wireless drivers file=WiFi/ [Firmwares/WiFi/IPW2100] name=Intel PRO/Wireless 2100 Firmware license=ipw/ipw2100-1.3/LICENSE file=ipw/ipw2100-1.3/ipw2100-1.3-i.fw.bz2 md5=9fac3d40b2a836c11eda6e1ee88d8102 file=ipw/ipw2100-1.3/ipw2100-1.3-p.fw.bz2 md5=d98845daefb9fd0dba035c0b730fd3f6 file=ipw/ipw2100-1.3/ipw2100-1.3.fw.bz2 md5=1c84b3b29f8060b1c6f25f6d4fdfb88f [Firmwares/WiFi/IPW2200] name=Intel Pro/Wireless 2200BG Firmware license=ipw/ipw2200-2.4/LICENSE file=ipw/ipw2200-2.4/ipw-2.4-boot.fw.bz2 md5=b8f60d741bd12f6df79333645716edd4 file=ipw/ipw2200-2.4/ipw-2.4-bss.fw.bz2 md5=82504ecd36f9db0b2d304ad601e0690a file=ipw/ipw2200-2.4/ipw-2.4-bss_ucode.fw.bz2 md5=b733598926bece2ad4de1d1671c6b20b file=ipw/ipw2200-2.4/ipw-2.4-ibss.fw.bz2 md5=acdf549482db7039d1bf8a79df263ed8 file=ipw/ipw2200-2.4/ipw-2.4-ibss_ucode.fw.bz2 md5=96f574ec930fd3863d4869af4b3983a1 file=ipw/ipw2200-2.4/ipw-2.4-sniffer.fw.bz2 md5=8ff7ddb8b7805d0ee08041514d8ed308 file=ipw/ipw2200-2.4/ipw-2.4-sniffer_ucode.fw.bz2 md5=513bf26951ce877295b217064fb5f675 [Firmwares/WiFi/Prism54] name=Prism54 PCI Firmware driver file=prism54/p54pci_1.0.4.3.arm.bz2 md5=a8e9382105ffddbb35c077e2809d041f rename=isl3890.bz2 file=prism54/p54pci_1.1.0.0.arm.bz2 md5=2dd1e17b8b8cecbb945ea903c4bd45f8 rename=isl3877.bz2 [Firmwares/DVB/] name=Firmware for the DVB cards. file=DVB/ [Firmwares/DVB/dvb-usb-a800] name=Firmware for the AVerMedia AVerTV DVB-T USB 2.0 card. file=dvb-usb-a800/dvb-usb-avertv-a800-02.fw.bz2 md5=c29f6ca057792ebc29be0631203bdb58 [Firmwares/DVB/dvb-usb-dibusb-mb] name=Firmware for DIBcom USB 1.1 DVB-T devices. file=dvb-usb-dibusb-mb/dvb-usb-dibusb-5.0.0.11.fw.bz2 md5=152373433e4178d128ec00575d2f8777 [Firmwares/DVB/dvb-usb-dibusb-mc] name=Firmware for the Artec T1 USB2.0 DVB-T USB device. file=dvb-usb-dibusb-mc/dvb-usb-dibusb-6.0.0.8.fw.bz2 md5=ac5e2cef27c08f53f0d816626bfe1bd3 [Firmwares/DVB/dvb-usb-dtt200u/] name=Firmwares for the WideView/Yakumo/Hama/Typhoon/Yuan Boxes and Pens. [Firmwares/DVB/dvb-usb-dtt200u/dtt200u] name=Firmware for the WideView/Yuan/Yakumo/Hama/Typhoon DVB-T USB2.0 (WT-200U) file=dvb-usb-dtt200u/dvb-usb-dtt200u-01.fw.bz2 md5=87a6b8fd649b6ae7f8790530ffde36c1 [Firmwares/DVB/dvb-usb-dtt200u/wt220u] name=Firmware for the WideView WT-220U PenType Receiver (and clones) file=dvb-usb-dtt200u/dvb-usb-wt220u-01.fw.bz2 md5=c9e2fc2e3bdc62ca52f5c98f9aac4e84 [Firmwares/DVB/cxusb-bluebird] name=Firmware for the frontend of some DViCO FusionHDTV (Bluebird) USB2.0 cards. file=cxusb-bluebird/dvb-usb-bluebird-01.fw.bz2 md5=c7dfeffc8e479dad1bffa09840c5522d [Firmwares/DVB/nxt200x] name=Firmware for the frontend of some Technisat/B2C2 Sky/Air/Cable2PC USB file=nxt2002/dvb-fe-nxt2002.fw.bz2 md5=9da8860dfa3d379cc84ee6b40eb167da file=nxt2004/dvb-fe-nxt2004.fw.bz2 md5=d4667fb7f1b8ae7fba0b8749ed6a6908 [Firmwares/DVB/or51132] name=Firmware for the OREN 51132 demodulators. file=or51132/dvb-fe-or51132-qam.fw.bz2 md5=0948363fcd00f989346fc6d6723710d4 file=or51132/dvb-fe-or51132-vsb.fw.bz2 md5=4bc3a4973974f13323fc50158c6d69c8 [Firmwares/DVB/or51211] name=Firmware for OREN or51211 demodulators. file=or51211/dvb-fe-or51211.fw.bz2 md5=897b9ed4f2c52f68a8a3f2a5f82820fa [Firmwares/DVB/sp8870] name=Firmware for the SP8870 based demodulators. file=sp8870/dvb-fe-sp8870.fw.bz2 md5=7eb13762632f6d15e304f5f6383d6408 [Firmwares/DVB/sp887x] name=Firmware for the SP887x based demodulators. file=sp887x/dvb-fe-sp887x.fw.bz2 md5=3159053213c98893fc10517c362354ca [Firmwares/DVB/tda1004x/] name=Firmware for the Philips TDA10045H/TDA10046H based cards [Firmwares/DVB/tda1004x/TDA10045H] name=Firmware for the Philips TDA10045H based card file=tda1004x/dvb-fe-tda10045.fw.bz2 md5=64040708bbd6a0dff0b76fcdbaa645b1 [Firmwares/DVB/tda1004x/TDA10046H] name=Firmware for the Philips TDA10046H based card file=tda1004x/dvb-fe-tda10046.fw.bz2 md5=fce4dcf2915d28f5bd8e52df37175edb [Firmwares/DVB/ttpci] name=Firmware for the AV7110 based DVB cards. file=ttpci/2622/dvb-ttpci-01.fw.bz2 md5=f1e6c403888603cf2bccc752493209c0 [Firmwares/DVB/ttusb_dec/] name=Firmware for the Technotrend DEC Budget USB1.1 (DVB-S/T) based cards. [Firmwares/DVB/ttusb_dec/DEC2000-t] name=Firmware for the Technotrend DEC Budget USB1.1 DEC2000-T file=ttusb_dec/dvb-ttusb-dec-2000t.fw.bz2 md5=aa2741d99341331c444af2beea34b158 [Firmwares/DVB/ttusb_dec/DEC2540-t] name=Firmware for the Technotrend DEC Budget USB1.1 DEC2540-T file=ttusb_dec/dvb-ttusb-dec-2540t.fw.bz2 md5=5bdd31c517e667ec047f13f59947c047 [Firmwares/DVB/ttusb_dec/DEC3000-s] name=Firmware for the Technotrend DEC Budget USB1.1 DEC3000-S file=ttusb_dec/dvb-ttusb-dec-3000s.fw.bz2 md5=fdf8ec99c55301b04e5ad586c957540d [Firmwares/DVB/umt-010] name=Firmware for the HanfTek UMT-010 card. file=umt-010/dvb-usb-umt-010-02.fw.bz2 md5=49979c657355e8ff3158d7ac39d9273f [Firmwares/DVB/vp702x] name=Firmware for the TwinhanDTV StarBox - DVB-S based cards. file=vp702x/dvb-usb-vp702x-01.fw.bz2 md5=fde23b38e662c2ebe8f8e090338d4c94 [Firmwares/DVB/vp7045] name=Firmware for the Twinhan DVB-T USB2.0 based cards. file=vp7045/dvb-usb-vp7045-01.fw.bz2 md5=3c73a3f380ec08b845e5c11a286fe1d3 geexbox-1.0/packages/extra-firmwares-nonfree/install0000755000175000017500000000013410446314261021740 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/firmwares cp $BUILD/$1*/* $INSTALL/firmwares geexbox-1.0/packages/extra-firmwares-nonfree/unpack0000755000175000017500000000043210446314261021554 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $BUILD/$1 $SCRIPTS/extract $1 "*" $BUILD/$1 # Rename firmwares that need to be mv $BUILD/$1/p54pci_1.0.4.3.arm.bz2 $BUILD/$1/isl3890.bz2 mv $BUILD/$1/p54pci_1.1.0.0.arm.bz2 $BUILD/$1/isl3877.bz2 # Uncompress firmwares bunzip2 $BUILD/$1/*.bz2 geexbox-1.0/packages/extra-firmwares-nonfree/url0000644000175000017500000000444210446314261021077 0ustar aurelaurelhttp://www.geexbox.org/firmwares/WiFi/ipw/ipw2100-1.3/ipw2100-1.3-i.fw.bz2 http://www.geexbox.org/firmwares/WiFi/ipw/ipw2100-1.3/ipw2100-1.3-p.fw.bz2 http://www.geexbox.org/firmwares/WiFi/ipw/ipw2100-1.3/ipw2100-1.3.fw.bz2 http://www.geexbox.org/firmwares/WiFi/ipw/ipw2200-2.4/ipw-2.4-boot.fw.bz2 http://www.geexbox.org/firmwares/WiFi/ipw/ipw2200-2.4/ipw-2.4-bss.fw.bz2 http://www.geexbox.org/firmwares/WiFi/ipw/ipw2200-2.4/ipw-2.4-bss_ucode.fw.bz2 http://www.geexbox.org/firmwares/WiFi/ipw/ipw2200-2.4/ipw-2.4-ibss.fw.bz2 http://www.geexbox.org/firmwares/WiFi/ipw/ipw2200-2.4/ipw-2.4-ibss_ucode.fw.bz2 http://www.geexbox.org/firmwares/WiFi/prism54/p54pci_1.0.4.3.arm.bz2 http://www.geexbox.org/firmwares/WiFi/prism54/p54pci_1.1.0.0.arm.bz2 http://www.geexbox.org/firmwares/DVB/dvb-usb-a800/dvb-usb-avertv-a800-02.fw.bz2 http://www.geexbox.org/firmwares/DVB/dvb-usb-dibusb-mb/dvb-usb-dibusb-5.0.0.11.fw.bz2 http://www.geexbox.org/firmwares/DVB/dvb-usb-dibusb-mc/dvb-usb-dibusb-6.0.0.8.fw.bz2 http://www.geexbox.org/firmwares/DVB/dvb-usb-dtt200u/dvb-usb-dtt200u-01.fw.bz2 http://www.geexbox.org/firmwares/DVB/dvb-usb-dtt200u/dvb-usb-wt220u-01.fw.bz2 http://www.geexbox.org/firmwares/DVB/cxusb-bluebird/dvb-usb-bluebird-01.fw.bz2 http://www.geexbox.org/firmwares/DVB/nxt2002/dvb-fe-nxt2002.fw.bz2 http://www.geexbox.org/firmwares/DVB/nxt2004/dvb-fe-nxt2004.fw.bz2 http://www.geexbox.org/firmwares/DVB/or51132/dvb-fe-or51132-qam.fw.bz2 http://www.geexbox.org/firmwares/DVB/or51132/dvb-fe-or51132-vsb.fw.bz2 http://www.geexbox.org/firmwares/DVB/or51211/dvb-fe-or51211.fw.bz2 http://www.geexbox.org/firmwares/DVB/sp8870/dvb-fe-sp8870.fw.bz2 http://www.geexbox.org/firmwares/DVB/sp887x/dvb-fe-sp887x.fw.bz2 http://www.geexbox.org/firmwares/DVB/tda1004x/dvb-fe-tda10045.fw.bz2 http://www.geexbox.org/firmwares/DVB/tda1004x/dvb-fe-tda10046.fw.bz2 http://www.geexbox.org/firmwares/DVB/ttpci/261f/dvb-ttpci-01.fw.bz2 http://www.geexbox.org/firmwares/DVB/ttusb_dec/dvb-ttusb-dec-2000t.fw.bz2 http://www.geexbox.org/firmwares/DVB/ttusb_dec/dvb-ttusb-dec-2540t.fw.bz2 http://www.geexbox.org/firmwares/DVB/ttusb_dec/dvb-ttusb-dec-3000s.fw.bz2 http://www.geexbox.org/firmwares/DVB/umt-010/dvb-usb-umt-010-02.fw.bz2 http://www.geexbox.org/firmwares/DVB/vp702x/dvb-usb-vp702x-01.fw.bz2 http://www.geexbox.org/firmwares/DVB/vp7045/dvb-usb-vp7045-01.fw.bz2 geexbox-1.0/packages/fbi/0000755000175000017500000000000010446314261014334 5ustar aurelaurelgeexbox-1.0/packages/fbi/build0000755000175000017500000000043510446314261015363 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build libpcd $SCRIPTS/build jpeg $SCRIPTS/build libpng $SCRIPTS/build zlib $SCRIPTS/build libungif $SCRIPTS/build libexif $SCRIPTS/build lirc CFLAGS="$CFLAGS -ffast-math" make -C $BUILD/$1* \ verbose=yes \ fbi geexbox-1.0/packages/fbi/install0000755000175000017500000000063010446314261015727 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/$1 $INSTALL/usr/bin cp $PACKAGES/$1/scripts/fbi_wrapper $INSTALL/usr/bin cp $PACKAGES/$1/scripts/view_img $INSTALL/usr/bin mkdir -p $INSTALL/usr/lib/kbd/consolefonts $SCRIPTS/extract $1 "*.psf" $INSTALL/usr/lib/kbd/consolefonts mkdir -p $INSTALL/etc cp $CONFIG/img_ext $INSTALL/etc echo $VIEW_IMG_TIMEOUT > $INSTALL/etc/view_img_timeout geexbox-1.0/packages/fbi/patches/0000755000175000017500000000000010446314261015763 5ustar aurelaurelgeexbox-1.0/packages/fbi/patches/10_lirc.diff0000644000175000017500000000165010446314261020050 0ustar aurelaureldiff -Naur fbi-1.31.orig/fbi.c fbi-1.31/fbi.c --- fbi-1.31.orig/fbi.c 2004-04-03 00:20:19.000000000 +0200 +++ fbi-1.31/fbi.c 2004-04-03 00:55:02.000000000 +0200 @@ -942,7 +942,9 @@ redraw = 1; left += steps; - } else if (0 == strcmp(key, "\x1b[5~")) { + } else if (0 == strcmp(key, "\x1b[5~") || + 0 == strcmp(key, "b") || + 0 == strcmp(key, "B")) { return KEY_PGUP; } else if (0 == strcmp(key, "\x1b[6~") || 0 == strcmp(key, "n") || diff -Naur fbi-1.31.orig/lirc.c fbi-1.31/lirc.c --- fbi-1.31.orig/lirc.c 2004-04-03 00:20:19.000000000 +0200 +++ fbi-1.31/lirc.c 2004-04-03 00:20:31.000000000 +0200 @@ -22,7 +22,7 @@ fprintf(stderr,"lirc: no infrared remote support available\n"); return -1; } - if (0 != lirc_readconfig(NULL,&config,NULL)) { + if (0 != lirc_readconfig("/etc/lircrc",&config,NULL)) { config = NULL; } if (debug) geexbox-1.0/packages/fbi/patches/20_nofork.diff0000644000175000017500000000070410446314261020415 0ustar aurelaureldiff -Naur fbi-1.31.orig/fbtools.c fbi-1.31/fbtools.c --- fbi-1.31.orig/fbtools.c 2004-12-30 01:56:26.767298760 +0100 +++ fbi-1.31/fbtools.c 2004-12-30 01:56:36.956749728 +0100 @@ -265,6 +265,8 @@ fprintf(stderr,"access %s: %s\n",vtname,strerror(errno)); exit(1); } + + /* do not fork! switch (fork()) { case 0: break; @@ -274,6 +276,8 @@ default: exit(0); } + */ + close(tty); close(0); close(1); geexbox-1.0/packages/fbi/patches/30_crosscompile.diff0000644000175000017500000000077310446314261021630 0ustar aurelaurel--- fbi-1.31.orig/mk/Variables.mk Wed Nov 17 14:54:13 2004 +++ fbi-1.31/mk/Variables.mk Wed Nov 17 14:54:29 2004 @@ -33,12 +33,6 @@ CFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes \ -Wpointer-arith -Wunused -# add /usr/local to the search path if something is in there ... -ifneq ($(wildcard /usr/local/include/*.h),) - CFLAGS += -I/usr/local/include - LDFLAGS += -L/usr/local/$(LIB) -endif - # fixup include path for $(srcdir) != "." ifneq ($(srcdir),.) CFLAGS += -I. -I$(srcdir) geexbox-1.0/packages/fbi/patches/40_no-sys_siglist.diff0000644000175000017500000000044010446314261022104 0ustar aurelaureldiff -Nur fbi-1.31.orig/fbtools.c fbi-1.31/fbtools.c --- fbi-1.31.orig/fbtools.c Sun Feb 22 14:27:40 2004 +++ fbi-1.31/fbtools.c Fri Sep 16 13:03:24 2005 @@ -518,6 +518,5 @@ /* cleanup */ fb_cleanup(); - fprintf(stderr,"Oops: %s\n",sys_siglist[termsig]); exit(42); } geexbox-1.0/packages/fbi/patches/50_alt-scroll-keys.diff0000664000175000017500000000240310446314261022147 0ustar aurelaureldiff -Nur fbi-1.31.orig/fbi.c fbi-1.31/fbi.c --- fbi-1.31.orig/fbi.c 2005-12-18 17:25:44.000000000 +0800 +++ fbi-1.31/fbi.c 2005-12-19 00:58:33.000000000 +0800 @@ -923,10 +923,12 @@ return KEY_SPACE; } - } else if (0 == strcmp(key, "\x1b[A") && img->i.height > fb_var.yres) { + } else if (( 0 == strcmp(key, "\x1b[A") || 0 == strcmp(key, "u")) + && img->i.height > fb_var.yres) { redraw = 1; top -= steps; - } else if (0 == strcmp(key, "\x1b[B") && img->i.height > fb_var.yres) { + } else if (( 0 == strcmp(key, "\x1b[B") || 0 == strcmp(key, "d")) + && img->i.height > fb_var.yres) { redraw = 1; top += steps; } else if (0 == strcmp(key, "\x1b[1~") && img->i.height > fb_var.yres) { @@ -935,10 +937,12 @@ } else if (0 == strcmp(key, "\x1b[4~")) { redraw = 1; top = img->i.height - fb_var.yres; - } else if (0 == strcmp(key, "\x1b[D") && img->i.width > fb_var.xres) { + } else if ((0 == strcmp(key, "\x1b[D") || 0 == strcmp(key, "<")) + && img->i.width > fb_var.xres) { redraw = 1; left -= steps; - } else if (0 == strcmp(key, "\x1b[C") && img->i.width > fb_var.xres) { + } else if ((0 == strcmp(key, "\x1b[C") || 0 == strcmp(key, ">")) + && img->i.width > fb_var.xres) { redraw = 1; left += steps; geexbox-1.0/packages/fbi/scripts/0000755000175000017500000000000010446314261016023 5ustar aurelaurelgeexbox-1.0/packages/fbi/scripts/fbi_wrapper0000755000175000017500000000052510446314261020253 0ustar aurelaurel#!/bin/sh if [ -f /var/view_img_timeout ]; then VIEW_IMG_TIMEOUT=`cat /var/view_img_timeout` else VIEW_IMG_TIMEOUT=`cat /etc/view_img_timeout` fi if [ $VIEW_IMG_TIMEOUT -eq 0 ] ; then VIEW_IMG_TIMEOUT="" else VIEW_IMG_TIMEOUT="--timeout $VIEW_IMG_TIMEOUT" fi fbi -a -q $VIEW_IMG_TIMEOUT --once --list /tmp/view_img_files >/dev/null geexbox-1.0/packages/fbi/scripts/view_img0000755000175000017500000000127610446314261017565 0ustar aurelaurel#!/bin/sh for i in `cat /etc/img_ext`; do if [ -z "$EXTS" ]; then EXTS="$i" else EXTS="$EXTS\|$i" fi done if test "$1" = "-a"; then # display all images in the selected folder DIR=$2 [ -d "$DIR" ] || DIR=${DIR%/[^/]*}/ ls -1 "$DIR" | grep -i "\.\($EXTS\)\$" | sed "s%\(.*\)%$DIR\1%" > /tmp/view_img_files elif test "$1" = "-r"; then # display all images in the selected folder and its subfolders (recursive) DIR=$2 [ -d "$DIR" ] || DIR=${DIR%/[^/]*}/ find "$DIR" | grep -i "\.\($EXTS\)\$" > /tmp/view_img_files else # display a single image echo "$1" > /tmp/view_img_files fi if [ -s /tmp/view_img_files ]; then echo 'quit 165' > /var/mp_control else exit 1 fi geexbox-1.0/packages/fbi/unpack0000755000175000017500000000143710446314261015550 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain sed -i 's/\$(call ac_header,X11\/X.h)/no/' $BUILD/$1*/GNUmakefile sed -i 's/\$(call ac_lib,pcd_open,pcd)/yes/' $BUILD/$1*/GNUmakefile sed -i 's/\$(call ac_lib,jpeg_start_compress,jpeg)/yes/' $BUILD/$1*/GNUmakefile sed -i 's/\$(call ac_lib,DGifOpenFileName,ungif)/yes/' $BUILD/$1*/GNUmakefile sed -i 's/\$(call ac_lib,png_read_info,png,-lz)/yes/' $BUILD/$1*/GNUmakefile sed -i 's/\$(call ac_lib,TIFFOpen,tiff)/no/' $BUILD/$1*/GNUmakefile sed -i 's/\$(call ac_lib,exif_data_new_from_file,exif,-lm)/yes/' $BUILD/$1*/GNUmakefile sed -i 's/\$(call ac_lib,curl_easy_init,curl)/no/' $BUILD/$1*/GNUmakefile sed -i 's/\$(call ac_lib,lirc_init,lirc_client)/yes/' $BUILD/$1*/GNUmakefile for I in $BUILD/$1*/*.c; do sed -i 's/stderr/stdout/g' $I done geexbox-1.0/packages/fbi/url0000644000175000017500000000011610446314261015057 0ustar aurelaurelhttp://dl.bytesex.org/releases/fbida/fbi_1.31.tar.gz GEEXBOX_SRCS/lat1-16.psf geexbox-1.0/packages/fmio/0000755000175000017500000000000010446314261014526 5ustar aurelaurelgeexbox-1.0/packages/fmio/arch0000644000175000017500000000000510446314261015361 0ustar aurelaureli386 geexbox-1.0/packages/fmio/build0000755000175000017500000000011710446314261015552 0ustar aurelaurel#!/bin/sh . config/options make -C $BUILD/$1*/src $STRIP $BUILD/$1*/src/fmio geexbox-1.0/packages/fmio/config/0000755000175000017500000000000010446314261015773 5ustar aurelaurelgeexbox-1.0/packages/fmio/config/radio0000644000175000017500000000027010446314261017013 0ustar aurelaurel# # Radio Options RADIO=no # # Radio Channels # Syntax : CHAN="Channel Frequency:Channel Title" # Example: #CHAN="91.5:CBC Radio 1" #CHAN="106.1:CHEZ" #CHAN="94.9:CIMF Rock Detente" geexbox-1.0/packages/fmio/install0000755000175000017500000000024010446314261016116 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/etc mkdir -p $INSTALL/usr/bin cp $PACKAGES/$1/config/radio $INSTALL/etc cp $BUILD/$1*/src/fmio $INSTALL/usr/bin geexbox-1.0/packages/fmio/patches/0000755000175000017500000000000010446314261016155 5ustar aurelaurelgeexbox-1.0/packages/fmio/patches/10_crosscompile.diff0000644000175000017500000000106410446314261022012 0ustar aurelaureldiff -Nur fmio-2.0.8.orig/src/Makefile fmio-2.0.8/src/Makefile --- fmio-2.0.8.orig/src/Makefile Fri Apr 15 23:34:32 2005 +++ fmio-2.0.8/src/Makefile Fri Apr 15 23:35:12 2005 @@ -6,6 +6,8 @@ # Makefile for fmio -- small utility to manipulate FM radio card # CC?=cc +AR?=ar +RANLIB?=ranlib CFLAGS?=-O2 -Wall # don't use mixer stuff @@ -97,8 +99,8 @@ libradio.a: $(ALLHDRS) $(OBJS) $(DRVS) rm -f $@ - ar cru $@ $(OBJS) $(DRVS) - ranlib $@ + $(AR) cru $@ $(OBJS) $(DRVS) + $(RANLIB) $@ fmio.0: $(MANPAGE) @echo "groff -Tascii -mandoc $(MANPAGE) > $@" geexbox-1.0/packages/fmio/url0000644000175000017500000000003710446314261015253 0ustar aurelaurelGEEXBOX_SRCS/fmio-2.0.8.tar.gz geexbox-1.0/packages/freetype/0000755000175000017500000000000010446314261015417 5ustar aurelaurelgeexbox-1.0/packages/freetype/build0000755000175000017500000000042610446314261016446 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build zlib cd $BUILD/$1* ./configure \ --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-shared \ --with-zlib make make install geexbox-1.0/packages/freetype/unpack0000755000175000017500000000011410446314261016622 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/fixconfigtools $BUILD/$1*/builds/unix geexbox-1.0/packages/freetype/url0000644000175000017500000000011610446314261016142 0ustar aurelaurelhttp://switch.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.10.tar.bz2 geexbox-1.0/packages/fribidi/0000755000175000017500000000000010446314261015204 5ustar aurelaurelgeexbox-1.0/packages/fribidi/build0000755000175000017500000000033210446314261016227 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-shared make make install geexbox-1.0/packages/fribidi/url0000644000175000017500000000007610446314261015734 0ustar aurelaurelhttp://fribidi.freedesktop.org/download/fribidi-0.10.7.tar.gz geexbox-1.0/packages/fuse/0000755000175000017500000000000010446314261014536 5ustar aurelaurelgeexbox-1.0/packages/fuse/build0000755000175000017500000000060310446314261015562 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-shared \ --enable-static \ --disable-kernel-module \ --enable-lib \ --with-kernel=$(kernel_path) make make -C include install make -C lib install geexbox-1.0/packages/fuse/install0000755000175000017500000000014610446314261016133 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/util/fusermount $INSTALL/usr/bin geexbox-1.0/packages/fuse/url0000644000175000017500000000010410446314261015256 0ustar aurelaurelhttp://switch.dl.sourceforge.net/sourceforge/fuse/fuse-2.5.3.tar.gz geexbox-1.0/packages/gcc/0000755000175000017500000000000010446314261014330 5ustar aurelaurelgeexbox-1.0/packages/gcc/patches/0000755000175000017500000000000010446314261015757 5ustar aurelaurelgeexbox-1.0/packages/gcc/patches/10_uclibc-conf.diff0000644000175000017500000003544110446314261021304 0ustar aurelaurel--- gcc-4.1.0/gcc/config/t-linux-uclibc +++ gcc-4.1.0/gcc/config/t-linux-uclibc @@ -0,0 +1,5 @@ +# Remove glibc specific files added in t-linux +SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES)) + +# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc +LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH)) --- gcc-4.1.0/gcc/config.gcc +++ gcc-4.1.0/gcc/config.gcc @@ -1887,7 +1887,7 @@ s390x-ibm-tpf*) ;; sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ - sh-*-linux* | sh[346lbe]*-*-linux* | \ + sh*-*-linux* | sh[346lbe]*-*-linux* | \ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ sh64-*-netbsd* | sh64l*-*-netbsd*) tmake_file="${tmake_file} sh/t-sh sh/t-elf" @@ -2341,6 +2341,12 @@ m32c-*-elf*) ;; esac +# Rather than hook into each target, just do it after all the linux +# targets have been processed +case ${target} in +*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc" +esac + case ${target} in i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1) tmake_file="${tmake_file} i386/t-gmm_malloc" --- gcc-4.1.0/configure +++ gcc-4.1.0/configure @@ -1133,7 +1133,7 @@ no) ;; "") case "${target}" in - *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu) + *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*) # Enable libmudflap by default in GNU and friends. ;; *-*-freebsd*) --- gcc-4.1.0/configure.in +++ gcc-4.1.0/configure.in @@ -341,7 +341,7 @@ no) ;; "") case "${target}" in - *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu) + *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*) # Enable libmudflap by default in GNU and friends. ;; *-*-freebsd*) --- gcc-4.1.0/contrib/regression/objs-gcc.sh +++ gcc-4.1.0/contrib/regression/objs-gcc.sh @@ -105,6 +105,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H then make all-gdb all-dejagnu all-ld || exit 1 make install-gdb install-dejagnu install-ld || exit 1 +elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ] + then + make all-gdb all-dejagnu all-ld || exit 1 + make install-gdb install-dejagnu install-ld || exit 1 elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then make bootstrap || exit 1 make install || exit 1 --- gcc-4.1.0/gcc/config/alpha/linux-elf.h +++ gcc-4.1.0/gcc/config/alpha/linux-elf.h @@ -27,7 +27,11 @@ Boston, MA 02110-1301, USA. */ #define SUBTARGET_EXTRA_SPECS \ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER }, +#if defined USE_UCLIBC +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#else #define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#endif #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \ %{O*:-O3} %{!O*:-O1} \ --- gcc-4.1.0/gcc/config/arm/linux-elf.h +++ gcc-4.1.0/gcc/config/arm/linux-elf.h @@ -51,7 +51,11 @@ #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" +#ifdef USE_UCLIBC +#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0" +#else #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2" +#endif #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \ %{b} \ --- gcc-4.1.0/gcc/config/cris/linux.h +++ gcc-4.1.0/gcc/config/cris/linux.h @@ -73,6 +73,25 @@ Boston, MA 02110-1301, USA. */ #undef CRIS_DEFAULT_CPU_VERSION #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG +#ifdef USE_UCLIBC + +#undef CRIS_SUBTARGET_VERSION +#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc" + +#undef CRIS_LINK_SUBTARGET_SPEC +#define CRIS_LINK_SUBTARGET_SPEC \ + "-mcrislinux\ + -rpath-link include/asm/../..%s\ + %{shared} %{static}\ + %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\ + %{!shared: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \ + %{!r:%{O2|O3: --gc-sections}}" + +#else /* USE_UCLIBC */ + #undef CRIS_SUBTARGET_VERSION #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu" @@ -87,6 +106,8 @@ Boston, MA 02110-1301, USA. */ %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\ %{!r:%{O2|O3: --gc-sections}}" +#endif /* USE_UCLIBC */ + /* Node: Run-time Target */ --- gcc-4.1.0/gcc/config/i386/linux.h +++ gcc-4.1.0/gcc/config/i386/linux.h @@ -107,6 +107,11 @@ Boston, MA 02110-1301, USA. */ #define LINK_EMULATION "elf_i386" #define DYNAMIC_LINKER "/lib/ld-linux.so.2" +#if defined USE_UCLIBC +#undef DYNAMIC_LINKER +#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#endif + #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ { "link_emulation", LINK_EMULATION },\ --- gcc-4.1.0/gcc/config/i386/linux64.h +++ gcc-4.1.0/gcc/config/i386/linux64.h @@ -54,14 +54,21 @@ Boston, MA 02110-1301, USA. */ When the -shared link option is used a final link is not being done. */ +#ifdef USE_UCLIBC +#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0" +#else +#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2" +#endif #undef LINK_SPEC #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \ %{shared:-shared} \ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ - %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \ + %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \ + %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \ %{static:-static}}" /* Similar to standard Linux, but adding -ffast-math support. */ --- gcc-4.1.0/gcc/config/ia64/linux.h +++ gcc-4.1.0/gcc/config/ia64/linux.h @@ -37,13 +37,18 @@ do { \ /* Define this for shared library support because it isn't in the main linux.h file. */ +#ifdef USE_UCLIBC +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#else +#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2" +#endif #undef LINK_SPEC #define LINK_SPEC "\ %{shared:-shared} \ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \ + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ %{static:-static}}" --- gcc-4.1.0/gcc/config/m68k/linux.h +++ gcc-4.1.0/gcc/config/m68k/linux.h @@ -123,12 +123,17 @@ Boston, MA 02110-1301, USA. */ /* If ELF is the default format, we should not use /lib/elf. */ +#ifdef USE_UCLIBC +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#else +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1" +#endif #undef LINK_SPEC #define LINK_SPEC "-m m68kelf %{shared} \ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \ + %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ %{static}}" /* For compatibility with linux/a.out */ --- gcc-4.1.0/gcc/config/mips/linux.h +++ gcc-4.1.0/gcc/config/mips/linux.h @@ -105,6 +105,11 @@ Boston, MA 02110-1301, USA. */ /* Borrowed from sparc/linux.h */ #undef LINK_SPEC +#ifdef USE_UCLIBC +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#else +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1" +#endif #define LINK_SPEC \ "%(endian_spec) \ %{shared:-shared} \ @@ -112,7 +117,7 @@ Boston, MA 02110-1301, USA. */ %{!ibcs: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ %{static:-static}}}" #undef SUBTARGET_ASM_SPEC --- gcc-4.1.0/gcc/config/pa/pa-linux.h +++ gcc-4.1.0/gcc/config/pa/pa-linux.h @@ -49,13 +49,18 @@ Boston, MA 02110-1301, USA. */ /* Define this for shared library support because it isn't in the main linux.h file. */ +#ifdef USE_UCLIBC +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#else +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1" +#endif #undef LINK_SPEC #define LINK_SPEC "\ %{shared:-shared} \ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ %{static:-static}}" /* glibc's profiling functions don't need gcc to allocate counters. */ --- gcc-4.1.0/gcc/config/rs6000/linux.h +++ gcc-4.1.0/gcc/config/rs6000/linux.h @@ -72,7 +72,11 @@ #define LINK_START_DEFAULT_SPEC "%(link_start_linux)" #undef LINK_OS_DEFAULT_SPEC +#ifdef USE_UCLIBC +#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)" +#else #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" +#endif #define LINK_GCC_C_SEQUENCE_SPEC \ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}" --- gcc-4.1.0/gcc/config/rs6000/sysv4.h +++ gcc-4.1.0/gcc/config/rs6000/sysv4.h @@ -866,6 +866,7 @@ extern int fixuplabelno; mcall-linux : %(link_os_linux) ; \ mcall-gnu : %(link_os_gnu) ; \ mcall-netbsd : %(link_os_netbsd) ; \ + mcall-linux-uclibc : %(link_os_linux_uclibc); \ mcall-openbsd: %(link_os_openbsd) ; \ : %(link_os_default) }" @@ -1043,6 +1044,10 @@ extern int fixuplabelno; %{rdynamic:-export-dynamic} \ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" +#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}" + #if defined(HAVE_LD_EH_FRAME_HDR) # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " #endif @@ -1209,6 +1214,7 @@ ncrtn.o%s" { "link_os_sim", LINK_OS_SIM_SPEC }, \ { "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \ { "link_os_linux", LINK_OS_LINUX_SPEC }, \ + { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \ { "link_os_gnu", LINK_OS_GNU_SPEC }, \ { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ --- gcc-4.1.0/gcc/config/s390/linux.h +++ gcc-4.1.0/gcc/config/s390/linux.h @@ -77,6 +77,13 @@ Software Foundation, 51 Franklin Street, #define MULTILIB_DEFAULTS { "m31" } #endif +#ifdef USE_UCLIBC +#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0" +#else +#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1" +#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1" +#endif #undef LINK_SPEC #define LINK_SPEC \ "%{m31:-m elf_s390}%{m64:-m elf64_s390} \ @@ -86,8 +93,8 @@ Software Foundation, 51 Franklin Street, %{!static: \ %{rdynamic:-export-dynamic} \ %{!dynamic-linker: \ - %{m31:-dynamic-linker /lib/ld.so.1} \ - %{m64:-dynamic-linker /lib/ld64.so.1}}}}" + %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \ + %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}" #define TARGET_ASM_FILE_END file_end_indicate_exec_stack --- gcc-4.1.0/gcc/config/sh/linux.h +++ gcc-4.1.0/gcc/config/sh/linux.h @@ -56,12 +56,21 @@ Boston, MA 02110-1301, USA. */ #undef SUBTARGET_LINK_EMUL_SUFFIX #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" #undef SUBTARGET_LINK_SPEC +#ifdef USE_UCLIBC +#define SUBTARGET_LINK_SPEC \ + "%{shared:-shared} \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \ + %{static:-static}" +#else #define SUBTARGET_LINK_SPEC \ "%{shared:-shared} \ %{!static: \ %{rdynamic:-export-dynamic} \ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ %{static:-static}" +#endif /* Output assembler code to STREAM to call the profiler. */ --- gcc-4.1.0/gcc/config/sparc/linux.h +++ gcc-4.1.0/gcc/config/sparc/linux.h @@ -125,6 +125,11 @@ Boston, MA 02110-1301, USA. */ /* If ELF is the default format, we should not use /lib/elf. */ +#ifdef USE_UCLIBC +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#else +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#endif #undef LINK_SPEC #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ %{!mno-relax:%{!r:-relax}} \ @@ -132,7 +137,7 @@ Boston, MA 02110-1301, USA. */ %{!ibcs: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ %{static:-static}}}" /* The sun bundled assembler doesn't accept -Yd, (and neither does gas). --- gcc-4.1.0/gcc/config/sparc/linux64.h +++ gcc-4.1.0/gcc/config/sparc/linux64.h @@ -162,12 +162,17 @@ Boston, MA 02110-1301, USA. */ { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \ { "link_arch", LINK_ARCH_SPEC }, +#ifdef USE_UCLIBC +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#else +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#endif #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \ %{!shared: \ %{!ibcs: \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \ %{static:-static}}} \ " --- gcc-4.1.0/libmudflap/configure +++ gcc-4.1.0/libmudflap/configure @@ -5382,6 +5382,11 @@ linux-gnu*) lt_cv_deplibs_check_method=pass_all ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' --- gcc-4.1.0/libtool.m4 +++ gcc-4.1.0/libtool.m4 @@ -743,6 +743,11 @@ linux-gnu*) lt_cv_deplibs_check_method=pass_all ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] --- gcc-4.1.0/ltconfig +++ gcc-4.1.0/ltconfig @@ -603,6 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in +linux-uclibc*) ;; linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac @@ -1274,6 +1275,23 @@ linux-gnu*) dynamic_linker='GNU/Linux ld.so' ;; +linux-uclibc*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # 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 + # Assume using the uClibc dynamic linker. + dynamic_linker="uClibc ld.so" + ;; + netbsd*) need_lib_prefix=no need_version=no geexbox-1.0/packages/gcc/patches/20_uclibc-locale.diff0000644000175000017500000033303710446314261021621 0ustar aurelaureldiff -urN gcc-4.1.0-dist/libstdc++-v3/acinclude.m4 gcc-4.1.0/libstdc++-v3/acinclude.m4 --- gcc-4.1.0-dist/libstdc++-v3/acinclude.m4 2006-03-26 12:08:28.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/acinclude.m4 2006-03-25 22:06:30.000000000 -0700 @@ -1071,7 +1071,7 @@ AC_MSG_CHECKING([for C locale to use]) GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], [use MODEL for target locale package], - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto]) # If they didn't use this option switch, or if they specified --enable # with no specific model, we'll have to look for one. If they @@ -1087,6 +1087,9 @@ # Default to "generic". if test $enable_clocale_flag = auto; then case ${target_os} in + *-uclibc*) + enable_clocale_flag=uclibc + ;; linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) AC_EGREP_CPP([_GLIBCXX_ok], [ #include @@ -1230,6 +1233,40 @@ CTIME_CC=config/locale/generic/time_members.cc CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h ;; + uclibc) + AC_MSG_RESULT(uclibc) + + # Declare intention to use gettext, and add support for specific + # languages. + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT + ALL_LINGUAS="de fr" + + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then + USE_NLS=yes + fi + # Export the build objects. + for ling in $ALL_LINGUAS; do \ + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ + done + AC_SUBST(glibcxx_MOFILES) + AC_SUBST(glibcxx_POFILES) + + CLOCALE_H=config/locale/uclibc/c_locale.h + CLOCALE_CC=config/locale/uclibc/c_locale.cc + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc + CCOLLATE_CC=config/locale/uclibc/collate_members.cc + CCTYPE_CC=config/locale/uclibc/ctype_members.cc + CMESSAGES_H=config/locale/uclibc/messages_members.h + CMESSAGES_CC=config/locale/uclibc/messages_members.cc + CMONEY_CC=config/locale/uclibc/monetary_members.cc + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc + CTIME_H=config/locale/uclibc/time_members.h + CTIME_CC=config/locale/uclibc/time_members.cc + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h + ;; esac # This is where the testsuite looks for locale catalogs, using the diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,63 @@ +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- + +// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// Written by Jakub Jelinek + +#include +#include + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning clean this up +#endif + +#ifdef __UCLIBC_HAS_XLOCALE__ + +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; +extern "C" __typeof(strcoll_l) __strcoll_l; +extern "C" __typeof(strftime_l) __strftime_l; +extern "C" __typeof(strtod_l) __strtod_l; +extern "C" __typeof(strtof_l) __strtof_l; +extern "C" __typeof(strtold_l) __strtold_l; +extern "C" __typeof(strxfrm_l) __strxfrm_l; +extern "C" __typeof(newlocale) __newlocale; +extern "C" __typeof(freelocale) __freelocale; +extern "C" __typeof(duplocale) __duplocale; +extern "C" __typeof(uselocale) __uselocale; + +#ifdef _GLIBCXX_USE_WCHAR_T +extern "C" __typeof(iswctype_l) __iswctype_l; +extern "C" __typeof(towlower_l) __towlower_l; +extern "C" __typeof(towupper_l) __towupper_l; +extern "C" __typeof(wcscoll_l) __wcscoll_l; +extern "C" __typeof(wcsftime_l) __wcsftime_l; +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; +extern "C" __typeof(wctype_l) __wctype_l; +#endif + +#endif // GLIBC 2.3 and later diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,152 @@ +// Wrapper for underlying C-language localization -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004, 2005 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.8 Standard locale categories. +// + +// Written by Benjamin Kosnik + +#include // For errno +#include +#include +#include +#include + +#ifndef __UCLIBC_HAS_XLOCALE__ +#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) +#define __strtof_l(S, E, L) strtof((S), (E)) +#define __strtod_l(S, E, L) strtod((S), (E)) +#define __strtold_l(S, E, L) strtold((S), (E)) +#warning should dummy __newlocale check for C|POSIX ? +#define __newlocale(a, b, c) NULL +#define __freelocale(a) ((void)0) +#define __duplocale(a) __c_locale() +#endif + +namespace std +{ + template<> + void + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { + char* __sanity; + errno = 0; + float __f = __strtof_l(__s, &__sanity, __cloc); + if (__sanity != __s && errno != ERANGE) + __v = __f; + else + __err |= ios_base::failbit; + } + + template<> + void + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { + char* __sanity; + errno = 0; + double __d = __strtod_l(__s, &__sanity, __cloc); + if (__sanity != __s && errno != ERANGE) + __v = __d; + else + __err |= ios_base::failbit; + } + + template<> + void + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { + char* __sanity; + errno = 0; + long double __ld = __strtold_l(__s, &__sanity, __cloc); + if (__sanity != __s && errno != ERANGE) + __v = __ld; + else + __err |= ios_base::failbit; + } + + void + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, + __c_locale __old) + { + __cloc = __newlocale(1 << LC_ALL, __s, __old); +#ifdef __UCLIBC_HAS_XLOCALE__ + if (!__cloc) + { + // This named locale is not supported by the underlying OS. + __throw_runtime_error(__N("locale::facet::_S_create_c_locale " + "name not valid")); + } +#endif + } + + void + locale::facet::_S_destroy_c_locale(__c_locale& __cloc) + { + if (__cloc && _S_get_c_locale() != __cloc) + __freelocale(__cloc); + } + + __c_locale + locale::facet::_S_clone_c_locale(__c_locale& __cloc) + { return __duplocale(__cloc); } +} // namespace std + +namespace __gnu_cxx +{ + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = + { + "LC_CTYPE", + "LC_NUMERIC", + "LC_TIME", + "LC_COLLATE", + "LC_MONETARY", + "LC_MESSAGES", +#if _GLIBCXX_NUM_CATEGORIES != 0 + "LC_PAPER", + "LC_NAME", + "LC_ADDRESS", + "LC_TELEPHONE", + "LC_MEASUREMENT", + "LC_IDENTIFICATION" +#endif + }; +} + +namespace std +{ + const char* const* const locale::_S_categories = __gnu_cxx::category_names; +} // namespace std diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2006-03-26 13:03:42.000000000 -0700 @@ -0,0 +1,117 @@ +// Wrapper for underlying C-language localization -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.8 Standard locale categories. +// + +// Written by Benjamin Kosnik + +#ifndef _C_LOCALE_H +#define _C_LOCALE_H 1 + +#pragma GCC system_header + +#include // get std::strlen +#include // get std::snprintf or std::sprintf +#include +#include // For codecvt +#ifdef __UCLIBC_MJN3_ONLY__ +#warning fix this +#endif +#ifdef __UCLIBC_HAS_LOCALE__ +#include // For codecvt using iconv, iconv_t +#endif +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +#include // For messages +#endif + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning what is _GLIBCXX_C_LOCALE_GNU for +#endif +#define _GLIBCXX_C_LOCALE_GNU 1 + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning fix categories +#endif +// #define _GLIBCXX_NUM_CATEGORIES 6 +#define _GLIBCXX_NUM_CATEGORIES 0 + +#ifdef __UCLIBC_HAS_XLOCALE__ +namespace __gnu_cxx +{ + extern "C" __typeof(uselocale) __uselocale; +} +#endif + +namespace std +{ +#ifdef __UCLIBC_HAS_XLOCALE__ + typedef __locale_t __c_locale; +#else + typedef int* __c_locale; +#endif + + // Convert numeric value of type _Tv to string and return length of + // string. If snprintf is available use it, otherwise fall back to + // the unsafe sprintf which, in general, can be dangerous and should + // be avoided. + template + int + __convert_from_v(char* __out, + const int __size __attribute__ ((__unused__)), + const char* __fmt, +#ifdef __UCLIBC_HAS_XLOCALE__ + _Tv __v, const __c_locale& __cloc, int __prec) + { + __c_locale __old = __gnu_cxx::__uselocale(__cloc); +#else + _Tv __v, const __c_locale&, int __prec) + { +# ifdef __UCLIBC_HAS_LOCALE__ + char* __old = std::setlocale(LC_ALL, NULL); + char* __sav = new char[std::strlen(__old) + 1]; + std::strcpy(__sav, __old); + std::setlocale(LC_ALL, "C"); +# endif +#endif + + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); + +#ifdef __UCLIBC_HAS_XLOCALE__ + __gnu_cxx::__uselocale(__old); +#elif defined __UCLIBC_HAS_LOCALE__ + std::setlocale(LC_ALL, __sav); + delete [] __sav; +#endif + return __ret; + } +} + +#endif diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,306 @@ +// std::codecvt implementation details, GNU version -*- C++ -*- + +// Copyright (C) 2002, 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.2.1.5 - Template class codecvt +// + +// Written by Benjamin Kosnik + +#include +#include + +namespace std +{ + // Specializations. +#ifdef _GLIBCXX_USE_WCHAR_T + codecvt_base::result + codecvt:: + do_out(state_type& __state, const intern_type* __from, + const intern_type* __from_end, const intern_type*& __from_next, + extern_type* __to, extern_type* __to_end, + extern_type*& __to_next) const + { + result __ret = ok; + state_type __tmp_state(__state); + +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_codecvt); +#endif + + // wcsnrtombs is *very* fast but stops if encounters NUL characters: + // in case we fall back to wcrtomb and then continue, in a loop. + // NB: wcsnrtombs is a GNU extension + for (__from_next = __from, __to_next = __to; + __from_next < __from_end && __to_next < __to_end + && __ret == ok;) + { + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', + __from_end - __from_next); + if (!__from_chunk_end) + __from_chunk_end = __from_end; + + __from = __from_next; + const size_t __conv = wcsnrtombs(__to_next, &__from_next, + __from_chunk_end - __from_next, + __to_end - __to_next, &__state); + if (__conv == static_cast(-1)) + { + // In case of error, in order to stop at the exact place we + // have to start again from the beginning with a series of + // wcrtomb. + for (; __from < __from_next; ++__from) + __to_next += wcrtomb(__to_next, *__from, &__tmp_state); + __state = __tmp_state; + __ret = error; + } + else if (__from_next && __from_next < __from_chunk_end) + { + __to_next += __conv; + __ret = partial; + } + else + { + __from_next = __from_chunk_end; + __to_next += __conv; + } + + if (__from_next < __from_end && __ret == ok) + { + extern_type __buf[MB_LEN_MAX]; + __tmp_state = __state; + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); + if (__conv > static_cast(__to_end - __to_next)) + __ret = partial; + else + { + memcpy(__to_next, __buf, __conv); + __state = __tmp_state; + __to_next += __conv; + ++__from_next; + } + } + } + +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#endif + + return __ret; + } + + codecvt_base::result + codecvt:: + do_in(state_type& __state, const extern_type* __from, + const extern_type* __from_end, const extern_type*& __from_next, + intern_type* __to, intern_type* __to_end, + intern_type*& __to_next) const + { + result __ret = ok; + state_type __tmp_state(__state); + +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_codecvt); +#endif + + // mbsnrtowcs is *very* fast but stops if encounters NUL characters: + // in case we store a L'\0' and then continue, in a loop. + // NB: mbsnrtowcs is a GNU extension + for (__from_next = __from, __to_next = __to; + __from_next < __from_end && __to_next < __to_end + && __ret == ok;) + { + const extern_type* __from_chunk_end; + __from_chunk_end = static_cast(memchr(__from_next, '\0', + __from_end + - __from_next)); + if (!__from_chunk_end) + __from_chunk_end = __from_end; + + __from = __from_next; + size_t __conv = mbsnrtowcs(__to_next, &__from_next, + __from_chunk_end - __from_next, + __to_end - __to_next, &__state); + if (__conv == static_cast(-1)) + { + // In case of error, in order to stop at the exact place we + // have to start again from the beginning with a series of + // mbrtowc. + for (;; ++__to_next, __from += __conv) + { + __conv = mbrtowc(__to_next, __from, __from_end - __from, + &__tmp_state); + if (__conv == static_cast(-1) + || __conv == static_cast(-2)) + break; + } + __from_next = __from; + __state = __tmp_state; + __ret = error; + } + else if (__from_next && __from_next < __from_chunk_end) + { + // It is unclear what to return in this case (see DR 382). + __to_next += __conv; + __ret = partial; + } + else + { + __from_next = __from_chunk_end; + __to_next += __conv; + } + + if (__from_next < __from_end && __ret == ok) + { + if (__to_next < __to_end) + { + // XXX Probably wrong for stateful encodings + __tmp_state = __state; + ++__from_next; + *__to_next++ = L'\0'; + } + else + __ret = partial; + } + } + +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#endif + + return __ret; + } + + int + codecvt:: + do_encoding() const throw() + { + // XXX This implementation assumes that the encoding is + // stateless and is either single-byte or variable-width. + int __ret = 0; +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_codecvt); +#endif + if (MB_CUR_MAX == 1) + __ret = 1; +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#endif + return __ret; + } + + int + codecvt:: + do_max_length() const throw() + { +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_codecvt); +#endif + // XXX Probably wrong for stateful encodings. + int __ret = MB_CUR_MAX; +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#endif + return __ret; + } + + int + codecvt:: + do_length(state_type& __state, const extern_type* __from, + const extern_type* __end, size_t __max) const + { + int __ret = 0; + state_type __tmp_state(__state); + +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_codecvt); +#endif + + // mbsnrtowcs is *very* fast but stops if encounters NUL characters: + // in case we advance past it and then continue, in a loop. + // NB: mbsnrtowcs is a GNU extension + + // A dummy internal buffer is needed in order for mbsnrtocws to consider + // its fourth parameter (it wouldn't with NULL as first parameter). + wchar_t* __to = static_cast(__builtin_alloca(sizeof(wchar_t) + * __max)); + while (__from < __end && __max) + { + const extern_type* __from_chunk_end; + __from_chunk_end = static_cast(memchr(__from, '\0', + __end + - __from)); + if (!__from_chunk_end) + __from_chunk_end = __end; + + const extern_type* __tmp_from = __from; + size_t __conv = mbsnrtowcs(__to, &__from, + __from_chunk_end - __from, + __max, &__state); + if (__conv == static_cast(-1)) + { + // In case of error, in order to stop at the exact place we + // have to start again from the beginning with a series of + // mbrtowc. + for (__from = __tmp_from;; __from += __conv) + { + __conv = mbrtowc(NULL, __from, __end - __from, + &__tmp_state); + if (__conv == static_cast(-1) + || __conv == static_cast(-2)) + break; + } + __state = __tmp_state; + __ret += __from - __tmp_from; + break; + } + if (!__from) + __from = __from_chunk_end; + + __ret += __from - __tmp_from; + __max -= __conv; + + if (__from < __end && __max) + { + // XXX Probably wrong for stateful encodings + __tmp_state = __state; + ++__from; + ++__ret; + --__max; + } + } + +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#endif + + return __ret; + } +#endif +} diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,80 @@ +// std::collate implementation details, GNU version -*- C++ -*- + +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions +// + +// Written by Benjamin Kosnik + +#include +#include + +#ifndef __UCLIBC_HAS_XLOCALE__ +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) +#endif + +namespace std +{ + // These are basically extensions to char_traits, and perhaps should + // be put there instead of here. + template<> + int + collate::_M_compare(const char* __one, const char* __two) const + { + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); + } + + template<> + size_t + collate::_M_transform(char* __to, const char* __from, + size_t __n) const + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } + +#ifdef _GLIBCXX_USE_WCHAR_T + template<> + int + collate::_M_compare(const wchar_t* __one, + const wchar_t* __two) const + { + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); + } + + template<> + size_t + collate::_M_transform(wchar_t* __to, const wchar_t* __from, + size_t __n) const + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } +#endif +} diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,314 @@ +// std::ctype implementation details, GNU version -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. +// + +// Written by Benjamin Kosnik + +#define _LIBC +#include +#undef _LIBC +#include + +#ifndef __UCLIBC_HAS_XLOCALE__ +#define __wctype_l(S, L) wctype((S)) +#define __towupper_l(C, L) towupper((C)) +#define __towlower_l(C, L) towlower((C)) +#define __iswctype_l(C, M, L) iswctype((C), (M)) +#endif + +namespace std +{ + // NB: The other ctype specializations are in src/locale.cc and + // various /config/os/* files. + template<> + ctype_byname::ctype_byname(const char* __s, size_t __refs) + : ctype(0, false, __refs) + { + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) + { + this->_S_destroy_c_locale(this->_M_c_locale_ctype); + this->_S_create_c_locale(this->_M_c_locale_ctype, __s); +#ifdef __UCLIBC_HAS_XLOCALE__ + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; + this->_M_table = this->_M_c_locale_ctype->__ctype_b; +#endif + } + } + +#ifdef _GLIBCXX_USE_WCHAR_T + ctype::__wmask_type + ctype::_M_convert_to_wmask(const mask __m) const + { + __wmask_type __ret; + switch (__m) + { + case space: + __ret = __wctype_l("space", _M_c_locale_ctype); + break; + case print: + __ret = __wctype_l("print", _M_c_locale_ctype); + break; + case cntrl: + __ret = __wctype_l("cntrl", _M_c_locale_ctype); + break; + case upper: + __ret = __wctype_l("upper", _M_c_locale_ctype); + break; + case lower: + __ret = __wctype_l("lower", _M_c_locale_ctype); + break; + case alpha: + __ret = __wctype_l("alpha", _M_c_locale_ctype); + break; + case digit: + __ret = __wctype_l("digit", _M_c_locale_ctype); + break; + case punct: + __ret = __wctype_l("punct", _M_c_locale_ctype); + break; + case xdigit: + __ret = __wctype_l("xdigit", _M_c_locale_ctype); + break; + case alnum: + __ret = __wctype_l("alnum", _M_c_locale_ctype); + break; + case graph: + __ret = __wctype_l("graph", _M_c_locale_ctype); + break; + default: + __ret = __wmask_type(); + } + return __ret; + } + + wchar_t + ctype::do_toupper(wchar_t __c) const + { return __towupper_l(__c, _M_c_locale_ctype); } + + const wchar_t* + ctype::do_toupper(wchar_t* __lo, const wchar_t* __hi) const + { + while (__lo < __hi) + { + *__lo = __towupper_l(*__lo, _M_c_locale_ctype); + ++__lo; + } + return __hi; + } + + wchar_t + ctype::do_tolower(wchar_t __c) const + { return __towlower_l(__c, _M_c_locale_ctype); } + + const wchar_t* + ctype::do_tolower(wchar_t* __lo, const wchar_t* __hi) const + { + while (__lo < __hi) + { + *__lo = __towlower_l(*__lo, _M_c_locale_ctype); + ++__lo; + } + return __hi; + } + + bool + ctype:: + do_is(mask __m, wchar_t __c) const + { + // The case of __m == ctype_base::space is particularly important, + // due to its use in many istream functions. Therefore we deal with + // it first, exploiting the knowledge that on GNU systems _M_bit[5] + // is the mask corresponding to ctype_base::space. NB: an encoding + // change would not affect correctness! + bool __ret = false; + if (__m == _M_bit[5]) + __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); + else + { + // Highest bitmask in ctype_base == 10, but extra in "C" + // library for blank. + const size_t __bitmasksize = 11; + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) + if (__m & _M_bit[__bitcur]) + { + if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) + { + __ret = true; + break; + } + else if (__m == _M_bit[__bitcur]) + break; + } + } + return __ret; + } + + const wchar_t* + ctype:: + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const + { + for (; __lo < __hi; ++__vec, ++__lo) + { + // Highest bitmask in ctype_base == 10, but extra in "C" + // library for blank. + const size_t __bitmasksize = 11; + mask __m = 0; + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) + __m |= _M_bit[__bitcur]; + *__vec = __m; + } + return __hi; + } + + const wchar_t* + ctype:: + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const + { + while (__lo < __hi && !this->do_is(__m, *__lo)) + ++__lo; + return __lo; + } + + const wchar_t* + ctype:: + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const + { + while (__lo < __hi && this->do_is(__m, *__lo) != 0) + ++__lo; + return __lo; + } + + wchar_t + ctype:: + do_widen(char __c) const + { return _M_widen[static_cast(__c)]; } + + const char* + ctype:: + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const + { + while (__lo < __hi) + { + *__dest = _M_widen[static_cast(*__lo)]; + ++__lo; + ++__dest; + } + return __hi; + } + + char + ctype:: + do_narrow(wchar_t __wc, char __dfault) const + { + if (__wc >= 0 && __wc < 128 && _M_narrow_ok) + return _M_narrow[__wc]; +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_ctype); +#endif + const int __c = wctob(__wc); +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#endif + return (__c == EOF ? __dfault : static_cast(__c)); + } + + const wchar_t* + ctype:: + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, + char* __dest) const + { +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_ctype); +#endif + if (_M_narrow_ok) + while (__lo < __hi) + { + if (*__lo >= 0 && *__lo < 128) + *__dest = _M_narrow[*__lo]; + else + { + const int __c = wctob(*__lo); + *__dest = (__c == EOF ? __dfault : static_cast(__c)); + } + ++__lo; + ++__dest; + } + else + while (__lo < __hi) + { + const int __c = wctob(*__lo); + *__dest = (__c == EOF ? __dfault : static_cast(__c)); + ++__lo; + ++__dest; + } +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#endif + return __hi; + } + + void + ctype::_M_initialize_ctype() + { +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_ctype); +#endif + wint_t __i; + for (__i = 0; __i < 128; ++__i) + { + const int __c = wctob(__i); + if (__c == EOF) + break; + else + _M_narrow[__i] = static_cast(__c); + } + if (__i == 128) + _M_narrow_ok = true; + else + _M_narrow_ok = false; + for (size_t __j = 0; + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) + _M_widen[__j] = btowc(__j); + + for (size_t __k = 0; __k <= 11; ++__k) + { + _M_bit[__k] = static_cast(_ISbit(__k)); + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); + } +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#endif + } +#endif // _GLIBCXX_USE_WCHAR_T +} diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,100 @@ +// std::messages implementation details, GNU version -*- C++ -*- + +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions +// + +// Written by Benjamin Kosnik + +#include +#include + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning fix gettext stuff +#endif +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +extern "C" char *__dcgettext(const char *domainname, + const char *msgid, int category); +#undef gettext +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) +#else +#undef gettext +#define gettext(msgid) (msgid) +#endif + +namespace std +{ + // Specializations. + template<> + string + messages::do_get(catalog, int, int, const string& __dfault) const + { +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_messages); + const char* __msg = const_cast(gettext(__dfault.c_str())); + __uselocale(__old); + return string(__msg); +#elif defined __UCLIBC_HAS_LOCALE__ + char* __old = strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, _M_name_messages); + const char* __msg = gettext(__dfault.c_str()); + setlocale(LC_ALL, __old); + free(__old); + return string(__msg); +#else + const char* __msg = gettext(__dfault.c_str()); + return string(__msg); +#endif + } + +#ifdef _GLIBCXX_USE_WCHAR_T + template<> + wstring + messages::do_get(catalog, int, int, const wstring& __dfault) const + { +# ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(_M_c_locale_messages); + char* __msg = gettext(_M_convert_to_char(__dfault)); + __uselocale(__old); + return _M_convert_from_char(__msg); +# elif defined __UCLIBC_HAS_LOCALE__ + char* __old = strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, _M_name_messages); + char* __msg = gettext(_M_convert_to_char(__dfault)); + setlocale(LC_ALL, __old); + free(__old); + return _M_convert_from_char(__msg); +# else + char* __msg = gettext(_M_convert_to_char(__dfault)); + return _M_convert_from_char(__msg); +# endif + } +#endif +} diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,121 @@ +// std::messages implementation details, GNU version -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.2.7.1.2 messages functions +// + +// Written by Benjamin Kosnik + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning fix prototypes for *textdomain funcs +#endif +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +extern "C" char *__textdomain(const char *domainname); +extern "C" char *__bindtextdomain(const char *domainname, + const char *dirname); +#else +#undef __textdomain +#undef __bindtextdomain +#define __textdomain(D) ((void)0) +#define __bindtextdomain(D,P) ((void)0) +#endif + + // Non-virtual member functions. + template + messages<_CharT>::messages(size_t __refs) + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), + _M_name_messages(_S_get_c_name()) + { } + + template + messages<_CharT>::messages(__c_locale __cloc, const char* __s, + size_t __refs) + : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL) + { + const size_t __len = std::strlen(__s) + 1; + char* __tmp = new char[__len]; + std::memcpy(__tmp, __s, __len); + _M_name_messages = __tmp; + + // Last to avoid leaking memory if new throws. + _M_c_locale_messages = _S_clone_c_locale(__cloc); + } + + template + typename messages<_CharT>::catalog + messages<_CharT>::open(const basic_string& __s, const locale& __loc, + const char* __dir) const + { + __bindtextdomain(__s.c_str(), __dir); + return this->do_open(__s, __loc); + } + + // Virtual member functions. + template + messages<_CharT>::~messages() + { + if (_M_name_messages != _S_get_c_name()) + delete [] _M_name_messages; + _S_destroy_c_locale(_M_c_locale_messages); + } + + template + typename messages<_CharT>::catalog + messages<_CharT>::do_open(const basic_string& __s, + const locale&) const + { + // No error checking is done, assume the catalog exists and can + // be used. + __textdomain(__s.c_str()); + return 0; + } + + template + void + messages<_CharT>::do_close(catalog) const + { } + + // messages_byname + template + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) + : messages<_CharT>(__refs) + { + if (this->_M_name_messages != locale::facet::_S_get_c_name()) + delete [] this->_M_name_messages; + char* __tmp = new char[std::strlen(__s) + 1]; + std::strcpy(__tmp, __s); + this->_M_name_messages = __tmp; + + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) + { + this->_S_destroy_c_locale(this->_M_c_locale_messages); + this->_S_create_c_locale(this->_M_c_locale_messages, __s); + } + } diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,692 @@ +// std::moneypunct implementation details, GNU version -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions +// + +// Written by Benjamin Kosnik + +#define _LIBC +#include +#undef _LIBC +#include + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning optimize this for uclibc +#warning tailor for stub locale support +#endif + +#ifndef __UCLIBC_HAS_XLOCALE__ +#define __nl_langinfo_l(N, L) nl_langinfo((N)) +#endif + +namespace std +{ + // Construct and return valid pattern consisting of some combination of: + // space none symbol sign value + money_base::pattern + money_base::_S_construct_pattern(char __precedes, char __space, char __posn) + { + pattern __ret; + + // This insanely complicated routine attempts to construct a valid + // pattern for use with monyepunct. A couple of invariants: + + // if (__precedes) symbol -> value + // else value -> symbol + + // if (__space) space + // else none + + // none == never first + // space never first or last + + // Any elegant implementations of this are welcome. + switch (__posn) + { + case 0: + case 1: + // 1 The sign precedes the value and symbol. + __ret.field[0] = sign; + if (__space) + { + // Pattern starts with sign. + if (__precedes) + { + __ret.field[1] = symbol; + __ret.field[3] = value; + } + else + { + __ret.field[1] = value; + __ret.field[3] = symbol; + } + __ret.field[2] = space; + } + else + { + // Pattern starts with sign and ends with none. + if (__precedes) + { + __ret.field[1] = symbol; + __ret.field[2] = value; + } + else + { + __ret.field[1] = value; + __ret.field[2] = symbol; + } + __ret.field[3] = none; + } + break; + case 2: + // 2 The sign follows the value and symbol. + if (__space) + { + // Pattern either ends with sign. + if (__precedes) + { + __ret.field[0] = symbol; + __ret.field[2] = value; + } + else + { + __ret.field[0] = value; + __ret.field[2] = symbol; + } + __ret.field[1] = space; + __ret.field[3] = sign; + } + else + { + // Pattern ends with sign then none. + if (__precedes) + { + __ret.field[0] = symbol; + __ret.field[1] = value; + } + else + { + __ret.field[0] = value; + __ret.field[1] = symbol; + } + __ret.field[2] = sign; + __ret.field[3] = none; + } + break; + case 3: + // 3 The sign immediately precedes the symbol. + if (__precedes) + { + __ret.field[0] = sign; + __ret.field[1] = symbol; + if (__space) + { + __ret.field[2] = space; + __ret.field[3] = value; + } + else + { + __ret.field[2] = value; + __ret.field[3] = none; + } + } + else + { + __ret.field[0] = value; + if (__space) + { + __ret.field[1] = space; + __ret.field[2] = sign; + __ret.field[3] = symbol; + } + else + { + __ret.field[1] = sign; + __ret.field[2] = symbol; + __ret.field[3] = none; + } + } + break; + case 4: + // 4 The sign immediately follows the symbol. + if (__precedes) + { + __ret.field[0] = symbol; + __ret.field[1] = sign; + if (__space) + { + __ret.field[2] = space; + __ret.field[3] = value; + } + else + { + __ret.field[2] = value; + __ret.field[3] = none; + } + } + else + { + __ret.field[0] = value; + if (__space) + { + __ret.field[1] = space; + __ret.field[2] = symbol; + __ret.field[3] = sign; + } + else + { + __ret.field[1] = symbol; + __ret.field[2] = sign; + __ret.field[3] = none; + } + } + break; + default: + __ret = pattern(); + } + return __ret; + } + + template<> + void + moneypunct::_M_initialize_moneypunct(__c_locale __cloc, + const char*) + { + if (!_M_data) + _M_data = new __moneypunct_cache; + + if (!__cloc) + { + // "C" locale + _M_data->_M_decimal_point = '.'; + _M_data->_M_thousands_sep = ','; + _M_data->_M_grouping = ""; + _M_data->_M_grouping_size = 0; + _M_data->_M_curr_symbol = ""; + _M_data->_M_curr_symbol_size = 0; + _M_data->_M_positive_sign = ""; + _M_data->_M_positive_sign_size = 0; + _M_data->_M_negative_sign = ""; + _M_data->_M_negative_sign_size = 0; + _M_data->_M_frac_digits = 0; + _M_data->_M_pos_format = money_base::_S_default_pattern; + _M_data->_M_neg_format = money_base::_S_default_pattern; + + for (size_t __i = 0; __i < money_base::_S_end; ++__i) + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; + } + else + { + // Named locale. + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, + __cloc)); + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, + __cloc)); + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); + + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); + if (!__nposn) + _M_data->_M_negative_sign = "()"; + else + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, + __cloc); + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); + + // _Intl == true + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, + __cloc)); + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, + __pposn); + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, + __nposn); + } + } + + template<> + void + moneypunct::_M_initialize_moneypunct(__c_locale __cloc, + const char*) + { + if (!_M_data) + _M_data = new __moneypunct_cache; + + if (!__cloc) + { + // "C" locale + _M_data->_M_decimal_point = '.'; + _M_data->_M_thousands_sep = ','; + _M_data->_M_grouping = ""; + _M_data->_M_grouping_size = 0; + _M_data->_M_curr_symbol = ""; + _M_data->_M_curr_symbol_size = 0; + _M_data->_M_positive_sign = ""; + _M_data->_M_positive_sign_size = 0; + _M_data->_M_negative_sign = ""; + _M_data->_M_negative_sign_size = 0; + _M_data->_M_frac_digits = 0; + _M_data->_M_pos_format = money_base::_S_default_pattern; + _M_data->_M_neg_format = money_base::_S_default_pattern; + + for (size_t __i = 0; __i < money_base::_S_end; ++__i) + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; + } + else + { + // Named locale. + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, + __cloc)); + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, + __cloc)); + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); + + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); + if (!__nposn) + _M_data->_M_negative_sign = "()"; + else + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, + __cloc); + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); + + // _Intl == false + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, + __pposn); + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, + __nposn); + } + } + + template<> + moneypunct::~moneypunct() + { delete _M_data; } + + template<> + moneypunct::~moneypunct() + { delete _M_data; } + +#ifdef _GLIBCXX_USE_WCHAR_T + template<> + void + moneypunct::_M_initialize_moneypunct(__c_locale __cloc, +#ifdef __UCLIBC_HAS_XLOCALE__ + const char*) +#else + const char* __name) +#endif + { + if (!_M_data) + _M_data = new __moneypunct_cache; + + if (!__cloc) + { + // "C" locale + _M_data->_M_decimal_point = L'.'; + _M_data->_M_thousands_sep = L','; + _M_data->_M_grouping = ""; + _M_data->_M_grouping_size = 0; + _M_data->_M_curr_symbol = L""; + _M_data->_M_curr_symbol_size = 0; + _M_data->_M_positive_sign = L""; + _M_data->_M_positive_sign_size = 0; + _M_data->_M_negative_sign = L""; + _M_data->_M_negative_sign_size = 0; + _M_data->_M_frac_digits = 0; + _M_data->_M_pos_format = money_base::_S_default_pattern; + _M_data->_M_neg_format = money_base::_S_default_pattern; + + // Use ctype::widen code without the facet... + for (size_t __i = 0; __i < money_base::_S_end; ++__i) + _M_data->_M_atoms[__i] = + static_cast(money_base::_S_atoms[__i]); + } + else + { + // Named locale. +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(__cloc); +#else + // Switch to named locale so that mbsrtowcs will work. + char* __old = strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, __name); +#endif + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning fix this... should be monetary +#endif +#ifdef __UCLIBC__ +# ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +# else + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; +# endif +#else + union { char *__s; wchar_t __w; } __u; + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); + _M_data->_M_decimal_point = __u.__w; + + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); + _M_data->_M_thousands_sep = __u.__w; +#endif + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); + + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); + + wchar_t* __wcs_ps = 0; + wchar_t* __wcs_ns = 0; + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); + try + { + mbstate_t __state; + size_t __len = strlen(__cpossign); + if (__len) + { + ++__len; + memset(&__state, 0, sizeof(mbstate_t)); + __wcs_ps = new wchar_t[__len]; + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); + _M_data->_M_positive_sign = __wcs_ps; + } + else + _M_data->_M_positive_sign = L""; + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); + + __len = strlen(__cnegsign); + if (!__nposn) + _M_data->_M_negative_sign = L"()"; + else if (__len) + { + ++__len; + memset(&__state, 0, sizeof(mbstate_t)); + __wcs_ns = new wchar_t[__len]; + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); + _M_data->_M_negative_sign = __wcs_ns; + } + else + _M_data->_M_negative_sign = L""; + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); + + // _Intl == true. + __len = strlen(__ccurr); + if (__len) + { + ++__len; + memset(&__state, 0, sizeof(mbstate_t)); + wchar_t* __wcs = new wchar_t[__len]; + mbsrtowcs(__wcs, &__ccurr, __len, &__state); + _M_data->_M_curr_symbol = __wcs; + } + else + _M_data->_M_curr_symbol = L""; + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); + } + catch (...) + { + delete _M_data; + _M_data = 0; + delete __wcs_ps; + delete __wcs_ns; +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#else + setlocale(LC_ALL, __old); + free(__old); +#endif + __throw_exception_again; + } + + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, + __cloc)); + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, + __pposn); + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, + __nposn); + +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#else + setlocale(LC_ALL, __old); + free(__old); +#endif + } + } + + template<> + void + moneypunct::_M_initialize_moneypunct(__c_locale __cloc, +#ifdef __UCLIBC_HAS_XLOCALE__ + const char*) +#else + const char* __name) +#endif + { + if (!_M_data) + _M_data = new __moneypunct_cache; + + if (!__cloc) + { + // "C" locale + _M_data->_M_decimal_point = L'.'; + _M_data->_M_thousands_sep = L','; + _M_data->_M_grouping = ""; + _M_data->_M_grouping_size = 0; + _M_data->_M_curr_symbol = L""; + _M_data->_M_curr_symbol_size = 0; + _M_data->_M_positive_sign = L""; + _M_data->_M_positive_sign_size = 0; + _M_data->_M_negative_sign = L""; + _M_data->_M_negative_sign_size = 0; + _M_data->_M_frac_digits = 0; + _M_data->_M_pos_format = money_base::_S_default_pattern; + _M_data->_M_neg_format = money_base::_S_default_pattern; + + // Use ctype::widen code without the facet... + for (size_t __i = 0; __i < money_base::_S_end; ++__i) + _M_data->_M_atoms[__i] = + static_cast(money_base::_S_atoms[__i]); + } + else + { + // Named locale. +#ifdef __UCLIBC_HAS_XLOCALE__ + __c_locale __old = __uselocale(__cloc); +#else + // Switch to named locale so that mbsrtowcs will work. + char* __old = strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, __name); +#endif + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning fix this... should be monetary +#endif +#ifdef __UCLIBC__ +# ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +# else + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; +# endif +#else + union { char *__s; wchar_t __w; } __u; + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); + _M_data->_M_decimal_point = __u.__w; + + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); + _M_data->_M_thousands_sep = __u.__w; +#endif + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); + + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); + + wchar_t* __wcs_ps = 0; + wchar_t* __wcs_ns = 0; + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); + try + { + mbstate_t __state; + size_t __len; + __len = strlen(__cpossign); + if (__len) + { + ++__len; + memset(&__state, 0, sizeof(mbstate_t)); + __wcs_ps = new wchar_t[__len]; + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); + _M_data->_M_positive_sign = __wcs_ps; + } + else + _M_data->_M_positive_sign = L""; + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); + + __len = strlen(__cnegsign); + if (!__nposn) + _M_data->_M_negative_sign = L"()"; + else if (__len) + { + ++__len; + memset(&__state, 0, sizeof(mbstate_t)); + __wcs_ns = new wchar_t[__len]; + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); + _M_data->_M_negative_sign = __wcs_ns; + } + else + _M_data->_M_negative_sign = L""; + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); + + // _Intl == true. + __len = strlen(__ccurr); + if (__len) + { + ++__len; + memset(&__state, 0, sizeof(mbstate_t)); + wchar_t* __wcs = new wchar_t[__len]; + mbsrtowcs(__wcs, &__ccurr, __len, &__state); + _M_data->_M_curr_symbol = __wcs; + } + else + _M_data->_M_curr_symbol = L""; + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); + } + catch (...) + { + delete _M_data; + _M_data = 0; + delete __wcs_ps; + delete __wcs_ns; +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#else + setlocale(LC_ALL, __old); + free(__old); +#endif + __throw_exception_again; + } + + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, + __pposn); + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, + __nposn); + +#ifdef __UCLIBC_HAS_XLOCALE__ + __uselocale(__old); +#else + setlocale(LC_ALL, __old); + free(__old); +#endif + } + } + + template<> + moneypunct::~moneypunct() + { + if (_M_data->_M_positive_sign_size) + delete [] _M_data->_M_positive_sign; + if (_M_data->_M_negative_sign_size + && wcscmp(_M_data->_M_negative_sign, L"()") != 0) + delete [] _M_data->_M_negative_sign; + if (_M_data->_M_curr_symbol_size) + delete [] _M_data->_M_curr_symbol; + delete _M_data; + } + + template<> + moneypunct::~moneypunct() + { + if (_M_data->_M_positive_sign_size) + delete [] _M_data->_M_positive_sign; + if (_M_data->_M_negative_sign_size + && wcscmp(_M_data->_M_negative_sign, L"()") != 0) + delete [] _M_data->_M_negative_sign; + if (_M_data->_M_curr_symbol_size) + delete [] _M_data->_M_curr_symbol; + delete _M_data; + } +#endif +} diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,173 @@ +// std::numpunct implementation details, GNU version -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions +// + +// Written by Benjamin Kosnik + +#define _LIBC +#include +#undef _LIBC +#include + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning tailor for stub locale support +#endif +#ifndef __UCLIBC_HAS_XLOCALE__ +#define __nl_langinfo_l(N, L) nl_langinfo((N)) +#endif + +namespace std +{ + template<> + void + numpunct::_M_initialize_numpunct(__c_locale __cloc) + { + if (!_M_data) + _M_data = new __numpunct_cache; + + if (!__cloc) + { + // "C" locale + _M_data->_M_grouping = ""; + _M_data->_M_grouping_size = 0; + _M_data->_M_use_grouping = false; + + _M_data->_M_decimal_point = '.'; + _M_data->_M_thousands_sep = ','; + + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; + + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; + } + else + { + // Named locale. + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, + __cloc)); + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, + __cloc)); + + // Check for NULL, which implies no grouping. + if (_M_data->_M_thousands_sep == '\0') + _M_data->_M_grouping = ""; + else + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); + } + + // NB: There is no way to extact this info from posix locales. + // _M_truename = __nl_langinfo_l(YESSTR, __cloc); + _M_data->_M_truename = "true"; + _M_data->_M_truename_size = 4; + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); + _M_data->_M_falsename = "false"; + _M_data->_M_falsename_size = 5; + } + + template<> + numpunct::~numpunct() + { delete _M_data; } + +#ifdef _GLIBCXX_USE_WCHAR_T + template<> + void + numpunct::_M_initialize_numpunct(__c_locale __cloc) + { + if (!_M_data) + _M_data = new __numpunct_cache; + + if (!__cloc) + { + // "C" locale + _M_data->_M_grouping = ""; + _M_data->_M_grouping_size = 0; + _M_data->_M_use_grouping = false; + + _M_data->_M_decimal_point = L'.'; + _M_data->_M_thousands_sep = L','; + + // Use ctype::widen code without the facet... + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) + _M_data->_M_atoms_out[__i] = + static_cast(__num_base::_S_atoms_out[__i]); + + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) + _M_data->_M_atoms_in[__j] = + static_cast(__num_base::_S_atoms_in[__j]); + } + else + { + // Named locale. + // NB: In the GNU model wchar_t is always 32 bit wide. +#ifdef __UCLIBC_MJN3_ONLY__ +#warning fix this +#endif +#ifdef __UCLIBC__ +# ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +# else + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; +# endif +#else + union { char *__s; wchar_t __w; } __u; + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); + _M_data->_M_decimal_point = __u.__w; + + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); + _M_data->_M_thousands_sep = __u.__w; +#endif + + if (_M_data->_M_thousands_sep == L'\0') + _M_data->_M_grouping = ""; + else + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); + } + + // NB: There is no way to extact this info from posix locales. + // _M_truename = __nl_langinfo_l(YESSTR, __cloc); + _M_data->_M_truename = L"true"; + _M_data->_M_truename_size = 4; + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); + _M_data->_M_falsename = L"false"; + _M_data->_M_falsename_size = 5; + } + + template<> + numpunct::~numpunct() + { delete _M_data; } + #endif +} diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2006-03-25 22:18:37.000000000 -0700 @@ -0,0 +1,406 @@ +// std::time_get, std::time_put implementation, GNU version -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions +// + +// Written by Benjamin Kosnik + +#include +#include + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning tailor for stub locale support +#endif +#ifndef __UCLIBC_HAS_XLOCALE__ +#define __nl_langinfo_l(N, L) nl_langinfo((N)) +#endif + +namespace std +{ + template<> + void + __timepunct:: + _M_put(char* __s, size_t __maxlen, const char* __format, + const tm* __tm) const + { +#ifdef __UCLIBC_HAS_XLOCALE__ + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, + _M_c_locale_timepunct); +#else + char* __old = strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, _M_name_timepunct); + const size_t __len = strftime(__s, __maxlen, __format, __tm); + setlocale(LC_ALL, __old); + free(__old); +#endif + // Make sure __s is null terminated. + if (__len == 0) + __s[0] = '\0'; + } + + template<> + void + __timepunct::_M_initialize_timepunct(__c_locale __cloc) + { + if (!_M_data) + _M_data = new __timepunct_cache; + + if (!__cloc) + { + // "C" locale + _M_c_locale_timepunct = _S_get_c_locale(); + + _M_data->_M_date_format = "%m/%d/%y"; + _M_data->_M_date_era_format = "%m/%d/%y"; + _M_data->_M_time_format = "%H:%M:%S"; + _M_data->_M_time_era_format = "%H:%M:%S"; + _M_data->_M_date_time_format = ""; + _M_data->_M_date_time_era_format = ""; + _M_data->_M_am = "AM"; + _M_data->_M_pm = "PM"; + _M_data->_M_am_pm_format = ""; + + // Day names, starting with "C"'s Sunday. + _M_data->_M_day1 = "Sunday"; + _M_data->_M_day2 = "Monday"; + _M_data->_M_day3 = "Tuesday"; + _M_data->_M_day4 = "Wednesday"; + _M_data->_M_day5 = "Thursday"; + _M_data->_M_day6 = "Friday"; + _M_data->_M_day7 = "Saturday"; + + // Abbreviated day names, starting with "C"'s Sun. + _M_data->_M_aday1 = "Sun"; + _M_data->_M_aday2 = "Mon"; + _M_data->_M_aday3 = "Tue"; + _M_data->_M_aday4 = "Wed"; + _M_data->_M_aday5 = "Thu"; + _M_data->_M_aday6 = "Fri"; + _M_data->_M_aday7 = "Sat"; + + // Month names, starting with "C"'s January. + _M_data->_M_month01 = "January"; + _M_data->_M_month02 = "February"; + _M_data->_M_month03 = "March"; + _M_data->_M_month04 = "April"; + _M_data->_M_month05 = "May"; + _M_data->_M_month06 = "June"; + _M_data->_M_month07 = "July"; + _M_data->_M_month08 = "August"; + _M_data->_M_month09 = "September"; + _M_data->_M_month10 = "October"; + _M_data->_M_month11 = "November"; + _M_data->_M_month12 = "December"; + + // Abbreviated month names, starting with "C"'s Jan. + _M_data->_M_amonth01 = "Jan"; + _M_data->_M_amonth02 = "Feb"; + _M_data->_M_amonth03 = "Mar"; + _M_data->_M_amonth04 = "Apr"; + _M_data->_M_amonth05 = "May"; + _M_data->_M_amonth06 = "Jun"; + _M_data->_M_amonth07 = "Jul"; + _M_data->_M_amonth08 = "Aug"; + _M_data->_M_amonth09 = "Sep"; + _M_data->_M_amonth10 = "Oct"; + _M_data->_M_amonth11 = "Nov"; + _M_data->_M_amonth12 = "Dec"; + } + else + { + _M_c_locale_timepunct = _S_clone_c_locale(__cloc); + + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, + __cloc); + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); + + // Day names, starting with "C"'s Sunday. + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); + + // Abbreviated day names, starting with "C"'s Sun. + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); + + // Month names, starting with "C"'s January. + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); + + // Abbreviated month names, starting with "C"'s Jan. + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); + } + } + +#ifdef _GLIBCXX_USE_WCHAR_T + template<> + void + __timepunct:: + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, + const tm* __tm) const + { +#ifdef __UCLIBC_HAS_XLOCALE__ + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, + _M_c_locale_timepunct); +#else + char* __old = strdup(setlocale(LC_ALL, NULL)); + setlocale(LC_ALL, _M_name_timepunct); + const size_t __len = wcsftime(__s, __maxlen, __format, __tm); + setlocale(LC_ALL, __old); + free(__old); +#endif + // Make sure __s is null terminated. + if (__len == 0) + __s[0] = L'\0'; + } + + template<> + void + __timepunct::_M_initialize_timepunct(__c_locale __cloc) + { + if (!_M_data) + _M_data = new __timepunct_cache; + +#warning wide time stuff +// if (!__cloc) + { + // "C" locale + _M_c_locale_timepunct = _S_get_c_locale(); + + _M_data->_M_date_format = L"%m/%d/%y"; + _M_data->_M_date_era_format = L"%m/%d/%y"; + _M_data->_M_time_format = L"%H:%M:%S"; + _M_data->_M_time_era_format = L"%H:%M:%S"; + _M_data->_M_date_time_format = L""; + _M_data->_M_date_time_era_format = L""; + _M_data->_M_am = L"AM"; + _M_data->_M_pm = L"PM"; + _M_data->_M_am_pm_format = L""; + + // Day names, starting with "C"'s Sunday. + _M_data->_M_day1 = L"Sunday"; + _M_data->_M_day2 = L"Monday"; + _M_data->_M_day3 = L"Tuesday"; + _M_data->_M_day4 = L"Wednesday"; + _M_data->_M_day5 = L"Thursday"; + _M_data->_M_day6 = L"Friday"; + _M_data->_M_day7 = L"Saturday"; + + // Abbreviated day names, starting with "C"'s Sun. + _M_data->_M_aday1 = L"Sun"; + _M_data->_M_aday2 = L"Mon"; + _M_data->_M_aday3 = L"Tue"; + _M_data->_M_aday4 = L"Wed"; + _M_data->_M_aday5 = L"Thu"; + _M_data->_M_aday6 = L"Fri"; + _M_data->_M_aday7 = L"Sat"; + + // Month names, starting with "C"'s January. + _M_data->_M_month01 = L"January"; + _M_data->_M_month02 = L"February"; + _M_data->_M_month03 = L"March"; + _M_data->_M_month04 = L"April"; + _M_data->_M_month05 = L"May"; + _M_data->_M_month06 = L"June"; + _M_data->_M_month07 = L"July"; + _M_data->_M_month08 = L"August"; + _M_data->_M_month09 = L"September"; + _M_data->_M_month10 = L"October"; + _M_data->_M_month11 = L"November"; + _M_data->_M_month12 = L"December"; + + // Abbreviated month names, starting with "C"'s Jan. + _M_data->_M_amonth01 = L"Jan"; + _M_data->_M_amonth02 = L"Feb"; + _M_data->_M_amonth03 = L"Mar"; + _M_data->_M_amonth04 = L"Apr"; + _M_data->_M_amonth05 = L"May"; + _M_data->_M_amonth06 = L"Jun"; + _M_data->_M_amonth07 = L"Jul"; + _M_data->_M_amonth08 = L"Aug"; + _M_data->_M_amonth09 = L"Sep"; + _M_data->_M_amonth10 = L"Oct"; + _M_data->_M_amonth11 = L"Nov"; + _M_data->_M_amonth12 = L"Dec"; + } +#if 0 + else + { + _M_c_locale_timepunct = _S_clone_c_locale(__cloc); + + union { char *__s; wchar_t *__w; } __u; + + __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); + _M_data->_M_date_format = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); + _M_data->_M_date_era_format = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); + _M_data->_M_time_format = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); + _M_data->_M_time_era_format = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); + _M_data->_M_date_time_format = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); + _M_data->_M_date_time_era_format = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); + _M_data->_M_am = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); + _M_data->_M_pm = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); + _M_data->_M_am_pm_format = __u.__w; + + // Day names, starting with "C"'s Sunday. + __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); + _M_data->_M_day1 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); + _M_data->_M_day2 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); + _M_data->_M_day3 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); + _M_data->_M_day4 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); + _M_data->_M_day5 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); + _M_data->_M_day6 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); + _M_data->_M_day7 = __u.__w; + + // Abbreviated day names, starting with "C"'s Sun. + __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); + _M_data->_M_aday1 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); + _M_data->_M_aday2 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); + _M_data->_M_aday3 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); + _M_data->_M_aday4 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); + _M_data->_M_aday5 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); + _M_data->_M_aday6 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); + _M_data->_M_aday7 = __u.__w; + + // Month names, starting with "C"'s January. + __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); + _M_data->_M_month01 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); + _M_data->_M_month02 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); + _M_data->_M_month03 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); + _M_data->_M_month04 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); + _M_data->_M_month05 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); + _M_data->_M_month06 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); + _M_data->_M_month07 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); + _M_data->_M_month08 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); + _M_data->_M_month09 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); + _M_data->_M_month10 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); + _M_data->_M_month11 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); + _M_data->_M_month12 = __u.__w; + + // Abbreviated month names, starting with "C"'s Jan. + __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); + _M_data->_M_amonth01 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); + _M_data->_M_amonth02 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); + _M_data->_M_amonth03 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); + _M_data->_M_amonth04 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); + _M_data->_M_amonth05 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); + _M_data->_M_amonth06 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); + _M_data->_M_amonth07 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); + _M_data->_M_amonth08 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); + _M_data->_M_amonth09 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); + _M_data->_M_amonth10 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); + _M_data->_M_amonth11 = __u.__w; + __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); + _M_data->_M_amonth12 = __u.__w; + } +#endif // 0 + } +#endif +} diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h 2005-10-21 02:34:06.000000000 -0600 @@ -0,0 +1,76 @@ +// std::time_get, std::time_put implementation, GNU version -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.2.5.1.2 - time_get functions +// ISO C++ 14882: 22.2.5.3.2 - time_put functions +// + +// Written by Benjamin Kosnik + + template + __timepunct<_CharT>::__timepunct(size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), + _M_name_timepunct(_S_get_c_name()) + { _M_initialize_timepunct(); } + + template + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), + _M_name_timepunct(_S_get_c_name()) + { _M_initialize_timepunct(); } + + template + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, + size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), + _M_name_timepunct(NULL) + { + const size_t __len = std::strlen(__s) + 1; + char* __tmp = new char[__len]; + std::memcpy(__tmp, __s, __len); + _M_name_timepunct = __tmp; + + try + { _M_initialize_timepunct(__cloc); } + catch(...) + { + delete [] _M_name_timepunct; + __throw_exception_again; + } + } + + template + __timepunct<_CharT>::~__timepunct() + { + if (_M_name_timepunct != _S_get_c_name()) + delete [] _M_name_timepunct; + delete _M_data; + _S_destroy_c_locale(_M_c_locale_timepunct); + } diff -urN gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h --- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h 2006-03-25 22:06:30.000000000 -0700 @@ -0,0 +1,64 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +/** @file ctype_base.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. + */ + +// Information as gleaned from /usr/include/ctype.h + + /// @brief Base class for ctype. + struct ctype_base + { + // Note: In uClibc, the following two types depend on configuration. + + // Non-standard typedefs. + typedef const __ctype_touplow_t* __to_type; + + // NB: Offsets into ctype::_M_table force a particular size + // on the mask type. Because of this, we don't use an enum. + typedef __ctype_mask_t mask; + static const mask upper = _ISupper; + static const mask lower = _ISlower; + static const mask alpha = _ISalpha; + static const mask digit = _ISdigit; + static const mask xdigit = _ISxdigit; + static const mask space = _ISspace; + static const mask print = _ISprint; + static const mask graph = _ISalpha | _ISdigit | _ISpunct; + static const mask cntrl = _IScntrl; + static const mask punct = _ISpunct; + static const mask alnum = _ISalpha | _ISdigit; + }; diff -urN gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h --- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h 2006-03-25 22:06:30.000000000 -0700 @@ -0,0 +1,69 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000, 2002 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const + { return _M_table[static_cast(__c)] & __m; } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const + { + while (__low < __high) + *__vec++ = _M_table[static_cast(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const + { + while (__low < __high + && !(_M_table[static_cast(*__low)] & __m)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const + { + while (__low < __high + && (_M_table[static_cast(*__low)] & __m) != 0) + ++__low; + return __low; + } diff -urN gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h --- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2006-03-25 22:06:30.000000000 -0700 @@ -0,0 +1,92 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + const ctype_base::mask* + ctype::classic_table() throw() + { return __C_ctype_b; } + + ctype::ctype(__c_locale, const mask* __table, bool __del, + size_t __refs) + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) + { + _M_toupper = __C_ctype_toupper; + _M_tolower = __C_ctype_tolower; + _M_table = __table ? __table : __C_ctype_b; + memset(_M_widen, 0, sizeof(_M_widen)); + memset(_M_narrow, 0, sizeof(_M_narrow)); + } + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) + { + _M_toupper = __C_ctype_toupper; + _M_tolower = __C_ctype_tolower; + _M_table = __table ? __table : __C_ctype_b; + memset(_M_widen, 0, sizeof(_M_widen)); + memset(_M_narrow, 0, sizeof(_M_narrow)); + } + + char + ctype::do_toupper(char __c) const + { return _M_toupper[static_cast(__c)]; } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_toupper[static_cast(*__low)]; + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[static_cast(__c)]; } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_tolower[static_cast(*__low)]; + ++__low; + } + return __high; + } diff -urN gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h --- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h 2006-03-25 22:06:30.000000000 -0700 @@ -0,0 +1,44 @@ +// Specific definitions for GNU/Linux -*- C++ -*- + +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute 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 library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#ifndef _GLIBCXX_OS_DEFINES +#define _GLIBCXX_OS_DEFINES 1 + +// System-specific #define, typedefs, corrections, etc, go here. This +// file will come before all others. + +// This keeps isanum, et al from being propagated as macros. +#define __NO_CTYPE 1 + +#include + +// We must not see the optimized string functions GNU libc defines. +#define __NO_STRING_INLINES + +#endif diff -urN gcc-4.1.0-dist/libstdc++-v3/configure gcc-4.1.0/libstdc++-v3/configure --- gcc-4.1.0-dist/libstdc++-v3/configure 2006-03-26 12:08:28.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/configure 2006-03-25 22:06:30.000000000 -0700 @@ -4005,6 +4005,11 @@ lt_cv_deplibs_check_method=pass_all ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' @@ -5740,7 +5745,7 @@ enableval="$enable_clocale" case "$enableval" in - generic|gnu|ieee_1003.1-2001|yes|no|auto) ;; + generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;; *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5 echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;} { (exit 1); exit 1; }; } ;; @@ -5765,6 +5770,9 @@ # Default to "generic". if test $enable_clocale_flag = auto; then case ${target_os} in + linux-uclibc*) + enable_clocale_flag=uclibc + ;; linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5995,6 +6003,76 @@ CTIME_CC=config/locale/generic/time_members.cc CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h ;; + uclibc) + echo "$as_me:$LINENO: result: uclibc" >&5 +echo "${ECHO_T}uclibc" >&6 + + # Declare intention to use gettext, and add support for specific + # languages. + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT + ALL_LINGUAS="de fr" + + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_check_msgfmt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$check_msgfmt"; then + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_check_msgfmt="yes" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" +fi +fi +check_msgfmt=$ac_cv_prog_check_msgfmt +if test -n "$check_msgfmt"; then + echo "$as_me:$LINENO: result: $check_msgfmt" >&5 +echo "${ECHO_T}$check_msgfmt" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then + USE_NLS=yes + fi + # Export the build objects. + for ling in $ALL_LINGUAS; do \ + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ + done + + + + CLOCALE_H=config/locale/uclibc/c_locale.h + CLOCALE_CC=config/locale/uclibc/c_locale.cc + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc + CCOLLATE_CC=config/locale/uclibc/collate_members.cc + CCTYPE_CC=config/locale/uclibc/ctype_members.cc + CMESSAGES_H=config/locale/uclibc/messages_members.h + CMESSAGES_CC=config/locale/uclibc/messages_members.cc + CMONEY_CC=config/locale/uclibc/monetary_members.cc + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc + CTIME_H=config/locale/uclibc/time_members.h + CTIME_CC=config/locale/uclibc/time_members.cc + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h + ;; esac # This is where the testsuite looks for locale catalogs, using the diff -urN gcc-4.1.0-dist/libstdc++-v3/configure.host gcc-4.1.0/libstdc++-v3/configure.host --- gcc-4.1.0-dist/libstdc++-v3/configure.host 2006-03-26 12:08:28.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/configure.host 2006-03-25 22:06:30.000000000 -0700 @@ -261,6 +261,12 @@ ;; esac +# Override for uClibc since linux-uclibc gets mishandled above. +case "${host_os}" in + *-uclibc*) + os_include_dir="os/uclibc" + ;; +esac # Set any OS-dependent and CPU-dependent bits. # THIS TABLE IS SORTED. KEEP IT THAT WAY. diff -urN gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4 gcc-4.1.0/libstdc++-v3/crossconfig.m4 --- gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4 2006-03-26 12:08:28.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/crossconfig.m4 2006-03-25 22:06:30.000000000 -0700 @@ -143,6 +143,99 @@ ;; esac ;; + *-uclibc*) +# Temporary hack until we implement the float versions of the libm funcs + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ + machine/endian.h machine/param.h sys/machine.h sys/types.h \ + fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) + SECTION_FLAGS='-ffunction-sections -fdata-sections' + AC_SUBST(SECTION_FLAGS) + GLIBCXX_CHECK_LINKER_FEATURES + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT + GLIBCXX_CHECK_WCHAR_T_SUPPORT + + # For LFS. + AC_DEFINE(HAVE_INT64_T) + case "$target" in + *-uclinux*) + # Don't enable LFS with uClinux + ;; + *) + AC_DEFINE(_GLIBCXX_USE_LFS) + esac + + # For showmanyc_helper(). + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h) + GLIBCXX_CHECK_POLL + GLIBCXX_CHECK_S_ISREG_OR_S_IFREG + + # For xsputn_2(). + AC_CHECK_HEADERS(sys/uio.h) + GLIBCXX_CHECK_WRITEV + +# AC_DEFINE(HAVE_ACOSF) +# AC_DEFINE(HAVE_ASINF) +# AC_DEFINE(HAVE_ATANF) +# AC_DEFINE(HAVE_ATAN2F) + AC_DEFINE(HAVE_CEILF) + AC_DEFINE(HAVE_COPYSIGN) +# AC_DEFINE(HAVE_COPYSIGNF) +# AC_DEFINE(HAVE_COSF) +# AC_DEFINE(HAVE_COSHF) +# AC_DEFINE(HAVE_EXPF) +# AC_DEFINE(HAVE_FABSF) + AC_DEFINE(HAVE_FINITE) + AC_DEFINE(HAVE_FINITEF) + AC_DEFINE(HAVE_FLOORF) +# AC_DEFINE(HAVE_FMODF) +# AC_DEFINE(HAVE_FREXPF) + AC_DEFINE(HAVE_HYPOT) +# AC_DEFINE(HAVE_HYPOTF) + AC_DEFINE(HAVE_ISINF) + AC_DEFINE(HAVE_ISINFF) + AC_DEFINE(HAVE_ISNAN) + AC_DEFINE(HAVE_ISNANF) +# AC_DEFINE(HAVE_LOGF) +# AC_DEFINE(HAVE_LOG10F) +# AC_DEFINE(HAVE_MODFF) +# AC_DEFINE(HAVE_SINF) +# AC_DEFINE(HAVE_SINHF) +# AC_DEFINE(HAVE_SINCOS) +# AC_DEFINE(HAVE_SINCOSF) + AC_DEFINE(HAVE_SQRTF) +# AC_DEFINE(HAVE_TANF) +# AC_DEFINE(HAVE_TANHF) + if test x"long_double_math_on_this_cpu" = x"yes"; then + AC_MSG_ERROR([long_double_math_on_this_cpu is yes!]) +# AC_DEFINE(HAVE_ACOSL) +# AC_DEFINE(HAVE_ASINL) +# AC_DEFINE(HAVE_ATANL) +# AC_DEFINE(HAVE_ATAN2L) +# AC_DEFINE(HAVE_CEILL) +# AC_DEFINE(HAVE_COPYSIGNL) +# AC_DEFINE(HAVE_COSL) +# AC_DEFINE(HAVE_COSHL) +# AC_DEFINE(HAVE_EXPL) +# AC_DEFINE(HAVE_FABSL) +# AC_DEFINE(HAVE_FINITEL) +# AC_DEFINE(HAVE_FLOORL) +# AC_DEFINE(HAVE_FMODL) +# AC_DEFINE(HAVE_FREXPL) +# AC_DEFINE(HAVE_HYPOTL) +# AC_DEFINE(HAVE_ISINFL) +# AC_DEFINE(HAVE_ISNANL) +# AC_DEFINE(HAVE_LOGL) +# AC_DEFINE(HAVE_LOG10L) +# AC_DEFINE(HAVE_MODFL) +# AC_DEFINE(HAVE_POWL) +# AC_DEFINE(HAVE_SINL) +# AC_DEFINE(HAVE_SINHL) +# AC_DEFINE(HAVE_SINCOSL) +# AC_DEFINE(HAVE_SQRTL) +# AC_DEFINE(HAVE_TANL) +# AC_DEFINE(HAVE_TANHL) + fi + ;; *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu) AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ machine/endian.h machine/param.h sys/machine.h sys/types.h \ @@ -157,7 +250,7 @@ AC_DEFINE(HAVE_INT64_T) case "$target" in *-uclinux*) - # Don't enable LFS with uClibc + # Don't enable LFS with uClinux ;; *) AC_DEFINE(_GLIBCXX_USE_LFS) diff -urN gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h --- gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h 2006-03-26 12:08:28.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h 2006-03-25 22:06:30.000000000 -0700 @@ -101,7 +101,9 @@ using std::wmemcpy; using std::wmemmove; using std::wmemset; +#if _GLIBCXX_HAVE_WCSFTIME using std::wcsftime; +#endif #if _GLIBCXX_USE_C99 using std::wcstold; diff -urN gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h --- gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h 2006-03-26 12:08:28.000000000 -0700 +++ gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h 2006-03-25 22:06:30.000000000 -0700 @@ -180,7 +180,9 @@ using ::wcscoll; using ::wcscpy; using ::wcscspn; +#if _GLIBCXX_HAVE_WCSFTIME using ::wcsftime; +#endif using ::wcslen; using ::wcsncat; using ::wcsncmp; geexbox-1.0/packages/gcc/patches/21_uclibc-locale-snprintf-c99-fix.diff0000644000175000017500000000111610446314261024637 0ustar aurelaureldiff -Nur gcc-3.4.5.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.5/libstdc++-v3/config/locale/uclibc/c_locale.h --- gcc-3.4.5.orig/libstdc++-v3/config/locale/uclibc/c_locale.h Fri Mar 3 16:38:52 2006 +++ gcc-3.4.5/libstdc++-v3/config/locale/uclibc/c_locale.h Fri Mar 3 16:40:34 2006 @@ -100,7 +100,11 @@ # endif #endif +#ifdef _GLIBCXX_USE_C99 const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); +#else + const int __ret = std::sprintf(__out, __fmt, __prec, __v); +#endif #ifdef __UCLIBC_HAS_XLOCALE__ __gnu_cxx::__uselocale(__old); geexbox-1.0/packages/gcc/patches/22_libstdc-index-macro.diff0000644000175000017500000000132110446314261022741 0ustar aurelaurel--- gcc-4.1.0/libstdc++-v3/include/ext/rope.mps 2006-03-24 01:49:51 +0100 +++ gcc-4.1.0/libstdc++-v3/include/ext/rope 2006-03-24 01:49:37 +0100 @@ -59,6 +59,9 @@ #include #include +/* cope w/ index defined as macro, SuSv3 proposal */ +#undef index + # ifdef __GC # define __GC_CONST const # else --- gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h.mps 2006-03-24 01:50:04 +0100 +++ gcc-4.1.0/libstdc++-v3/include/ext/ropeimpl.h 2006-03-24 01:50:28 +0100 @@ -53,6 +53,9 @@ #include // For uninitialized_copy_n #include // For power +/* cope w/ index defined as macro, SuSv3 proposal */ +#undef index + namespace __gnu_cxx { using std::size_t; geexbox-1.0/packages/gcc/patches/30_fastmath-fxsave.diff0000644000175000017500000000160410446314261022215 0ustar aurelaurel* change fxsave to be global variable (static) instand of stack variable, to really make it 16 bytes aligned. this bug happens because we compile our code with -Os which effects the stack preferred stack boundary (-mpreferred-stack-boundary) to be 2^2 = 4 bytes instand of 2^4 = 16 bytes and then __attribute__ ((aligned (16))) does always work for stack variables. this adds (atleast) 512 bytes to programs which uses -ffast-math but allows them to use DAZ optimization. diff -Nur gcc-4.1.0.orig/gcc/config/i386/crtfastmath.c gcc-4.1.0/gcc/config/i386/crtfastmath.c --- gcc-4.1.0.orig/gcc/config/i386/crtfastmath.c Wed Aug 17 06:07:06 2005 +++ gcc-4.1.0/gcc/config/i386/crtfastmath.c Fri Mar 17 12:43:50 2006 @@ -75,7 +75,7 @@ if (edx & FXSAVE) { /* Check if DAZ is available. */ - struct + static struct { unsigned short int cwd; unsigned short int swd; geexbox-1.0/packages/gcc/unpack0000755000175000017500000000010410446314261015532 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/fixconfigtools $BUILD/$1*/gcc geexbox-1.0/packages/gcc/url0000644000175000017500000000024710446314261015060 0ustar aurelaurelftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.1/gcc-core-4.1.1.tar.bz2 ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.1/gcc-g++-4.1.1.tar.bz2 geexbox-1.0/packages/gcc-core/0000755000175000017500000000000010446314261015256 5ustar aurelaurelgeexbox-1.0/packages/gcc-core/build0000755000175000017500000000115010446314261016300 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/install ccache $SCRIPTS/install binutils $SCRIPTS/unpack uClibc $SCRIPTS/unpack gcc setup_toolchain host cd $BUILD/gcc* mkdir -p objdir-$1 cd objdir-$1 ../configure --host=$HOST_NAME \ --build=$HOST_NAME \ --target=$TARGET_NAME \ --prefix=$ROOT/$TOOLCHAIN \ --with-sysroot=$SYSROOT_PREFIX \ --with-local-prefix=${LIB_PREFIX#$SYSROOT_PREFIX} \ --enable-languages=c \ --disable-libmudflap \ --disable-libssp \ --disable-shared \ --disable-nls make geexbox-1.0/packages/gcc-core/install0000755000175000017500000000014610446314261016653 0ustar aurelaurel#!/bin/sh . config/options make -C $BUILD/gcc*/objdir-$1 install $SCRIPTS/install ccache toolchain geexbox-1.0/packages/gcc-final/0000755000175000017500000000000010446314261015417 5ustar aurelaurelgeexbox-1.0/packages/gcc-final/build0000755000175000017500000000131110446314261016440 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/install ccache $SCRIPTS/install binutils $SCRIPTS/build uClibc $SCRIPTS/unpack gcc setup_toolchain host cd $BUILD/gcc* mkdir -p objdir-$1 cd objdir-$1 ../configure --host=$HOST_NAME \ --build=$HOST_NAME \ --target=$TARGET_NAME \ --prefix=$ROOT/$TOOLCHAIN \ --with-sysroot=$SYSROOT_PREFIX \ --with-local-prefix=${LIB_PREFIX#$SYSROOT_PREFIX} \ --enable-languages=${TOOLCHAIN_LANGUAGES} \ --enable-clocale=uclibc \ --disable-__cxa_atexit \ --disable-libmudflap \ --disable-libssp \ --disable-shared \ --disable-nls make geexbox-1.0/packages/gcc-final/install0000755000175000017500000000014610446314261017014 0ustar aurelaurel#!/bin/sh . config/options make -C $BUILD/gcc*/objdir-$1 install $SCRIPTS/install ccache toolchain geexbox-1.0/packages/gdb/0000755000175000017500000000000010446314261014330 5ustar aurelaurelgeexbox-1.0/packages/gdb/build0000755000175000017500000000075010446314261015357 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build ncurses export bash_cv_have_mbstate_t=set export CC_FOR_BUILD="$HOST_CC" export CFLAGS_FOR_BUILD="$HOST_CFLAGS" cd $BUILD/$1* mkdir -p objdir cd objdir ../configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --with-sysroot=$SYSROOT_PREFIX \ --disable-nls \ --disable-sim \ --without-x \ --disable-tui \ --disable-libada make geexbox-1.0/packages/gdb/install0000755000175000017500000000011110446314261015715 0ustar aurelaurel#!/bin/sh . config/options cp $BUILD/$1*/objdir/$1/$1 $INSTALL/usr/bin geexbox-1.0/packages/gdb/patches/0000755000175000017500000000000010446314261015757 5ustar aurelaurelgeexbox-1.0/packages/gdb/patches/10_uclibc-conf.diff0000644000175000017500000000460310446314261021300 0ustar aurelaurel--- gdb-6.3/bfd/configure.orig Fri Oct 8 16:53:56 2004 +++ gdb-6.3/bfd/configure Sun Feb 27 18:32:58 2005 @@ -3583,6 +3583,11 @@ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' --- gdb-6.3/libtool.m4.orig Wed Jul 21 21:21:41 2004 +++ gdb-6.3/libtool.m4 Mon Feb 28 00:08:11 2005 @@ -653,6 +653,11 @@ fi ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + newsos6) [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 --- gdb-6.3/ltconfig.orig Tue Oct 5 15:34:42 2004 +++ gdb-6.3/ltconfig Sun Feb 27 18:14:41 2005 @@ -602,7 +602,7 @@ # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in -linux-gnu*) ;; +linux-gnu*|linux-uclibc*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac @@ -1270,6 +1270,24 @@ dynamic_linker='GNU/Linux ld.so' ;; +linux-uclibc*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + # Note: copied from linux-gnu, and may not be appropriate. + hardcode_into_libs=yes + # Assume using the uClibc dynamic linker. + dynamic_linker="uClibc ld.so" + ;; + netbsd*) need_lib_prefix=no need_version=no --- gdb-6.3/opcodes/configure.orig Fri Sep 17 08:13:38 2004 +++ gdb-6.3/opcodes/configure Mon Feb 28 00:09:42 2005 @@ -3595,6 +3595,11 @@ fi ;; +linux-uclibc*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` + ;; + newsos6) 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 geexbox-1.0/packages/gdb/url0000644000175000017500000000005310446314261015053 0ustar aurelaurelhttp://ftp.gnu.org/gnu/gdb/gdb-6.4.tar.bz2 geexbox-1.0/packages/generator/0000755000175000017500000000000010446314261015562 5ustar aurelaurelgeexbox-1.0/packages/generator/build0000755000175000017500000000002210446314261016601 0ustar aurelaurel#!/bin/sh exit 0 geexbox-1.0/packages/generator/install0000755000175000017500000000034610446314261017161 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/install tools-generator cp $BUILD/$1*/generator.exe $INSTALL cp $BUILD/$1*/linux-i386-generator $INSTALL cp $BUILD/$1*/macosx-generator $INSTALL cp $PACKAGES/$1/scripts/generator.sh $INSTALL geexbox-1.0/packages/generator/scripts/0000755000175000017500000000000010446314261017251 5ustar aurelaurelgeexbox-1.0/packages/generator/scripts/generator.sh0000755000175000017500000002077010446314261021604 0ustar aurelaurel#!/bin/sh # Menu language (bg/br/ca/cs/de/en/es/et/fi/fr/gr/he/hu/it/ko/nl/no/pl/ro/ru/sk/sr/sv/zh_CN/zh_TW) # This have no effect on DVD language. See iso/GEEXBOX/etc/mplayer/mplayer.conf MENU_LANG=en # Subtitle charset (bg/br/ca/cs/de/en/es/et/fi/fr/gr/he/hu/it/ko/nl/no/pl/ro/ru/sk/sr/sv/zh_CN/zh_TW) # Can also be set to a charset code (iso-8859-{1,2,7,8,9}/windows-125{0,1}/koi8-r/gb2312/big5/euc-kr) # when empty default is to MENU_LANG SUB_CHARSET= # Remote to Use (pctv/logitech/hauppauge/realmagic/creative/leadtek/RM-S6/ # RX-V850/animax/askey/avermedia/packard_bell/atiusb/atiusb2/LG/D-10/ # digimatrix/mceusb/streamzap/flytv-prime) REMOTE=atiusb # Remote receiver to use (animax/askey/avermedia/atiusb/atiusb2/creative/ # hauppauge/homemade/irman/leadtek/logitech/pctv/realmagic/digimatrix/mceusb/ # mceusb2/streamzap) RECEIVER=atiusb # Theme THEME= # Resolution (640x480, 800x600, 1024x768, 1280x1024 or 1600x1200) RESOLUTION=800x600 # You should not have to modify the rest of this file if [ -d ./iso -a -d ./lirc -a -d ./i18n ]; then TMPDIR="." GEEXBOX_DIR="." elif [ -d /usr/share/geexbox-generator ]; then TMPDIR="/tmp/geexbox-generator" GEEXBOX_DIR="/usr/share/geexbox-generator" else echo "" echo "**** GeeXboX files not found ****" echo "" exit 1 fi if [ -e /etc/geexbox-generator.conf ]; then . /etc/geexbox-generator.conf; fi if [ -e ~/.geexbox-generator ]; then . ~/.geexbox-generator.conf; fi [ -d $W32CODECS_DIR ] && W32CODECS_USAGE=" [-w|--with-w32codecs]" usage() { cat << EOF Usage: $0 [-h|--help]$W32CODECS_USAGE [-o file.iso] EOF exit 1 } while [ $# -ne 0 ]; do case $1 in --help|-h) usage ;; --with-w32codecs|-w) [ -d /usr/lib/win32 ] && W32CODECS=1 ;; --arch|-a) TARGET_ARCH=$2 shift ;; -o) OUTPUT=$2 shift ;; *) echo "Invalid option: $1" >&2 exit 1 ;; esac shift || true done if [ "$GEEXBOX_DIR" != "." ]; then # non distribution classic generator if [ -z "$TARGET_ARCH" ]; then # try to get arch from dpkg-architecture, or assign a default value if [ -x "/usr/bin/dpkg-architecture" ]; then TARGET_ARCH=$(/usr/bin/dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null) else TARGET_ARCH=i386 fi fi fi if [ -d "$GEEXBOX_DIR/$TARGET_ARCH" ]; then GEEXBOX_DIR=$GEEXBOX_DIR/$TARGET_ARCH else # wrong arch, force delete variable TARGET_ARCH="" fi case `uname -ms` in Linux\ i[3456]86) path=linux/i386 ext= ;; "Darwin Power Macintosh") path=macosx ext= ;; MINGW* | CYGWIN*) path=win32 ext=.exe ;; *) path= ;; esac if [ -n "$path" ]; then path="$GEEXBOX_DIR/tools/$path" [ -z "$MKISOFS" -a -x "$path/mkisofs$ext" ] && MKISOFS="$path/mkisofs$ext" [ -z "$MKZFTREE" -a -x "$path/mkzftree$ext" ] && MKZFTREE="$path/mkzftree$ext" fi [ -z "$MKISOFS" ] && MKISOFS=`which mkisofs` [ -z "$MKZFTREE" ] && MKZFTREE=`which mkzftree` if [ -z "$MKISOFS" -o -z "$MKZFTREE" ]; then echo "" echo "**** You need to have mkisofs and mkzftree installed ****" echo "" exit 1 fi if [ -z "$TARGET_ARCH" ]; then if [ -f "$GEEXBOX_DIR/iso/GEEXBOX/boot/isolinux.bin" ]; then TARGET_ARCH=i386 elif [ -f "$GEEXBOX_DIR/iso/GEEXBOX/boot/yaboot" ]; then TARGET_ARCH=ppc else echo "Failed to detect iso target arch" exit 1 fi fi OUTPUT=geexbox-`cat $GEEXBOX_DIR/VERSION`-$MENU_LANG.$TARGET_ARCH.iso W32CODECS_DIR=/usr/lib/win32 . $GEEXBOX_DIR/i18n/lang.conf . $GEEXBOX_DIR/i18n/lang.funcs [ -z "$THEME" ] && THEME=`cat $GEEXBOX_DIR/themes/default` if [ ! -f "$GEEXBOX_DIR/themes/$THEME/config" ]; then OTHEME=$THEME THEME="theme-$THEME" if [ ! -f "$GEEXBOX_DIR/themes/$THEME/config" ]; then echo "" echo "**** GeeXboX theme '$OTHEME' not found. ****" echo "" exit 1 fi fi . $GEEXBOX_DIR/themes/$THEME/config [ -z "$FONT_CHARSETS" ] && FONT_CHARSETS="iso-8859-1" MENU_CHARSET=`lang2charset "$MENU_LANG"` MENU_FONT=`lang2font "$MENU_LANG" menu` SUB_CHARSET=`lang2charset "$SUB_CHARSET"` SUB_FONT=`lang2font "$SUB_CHARSET" sub` for i in $FONT_CHARSETS; do if [ "$i" = "$MENU_CHARSET" ]; then MENU_FONT="themefont.ttf" break fi done [ -z "$SUB_FONT" -o -z "$MENU_FONT" ] && exit 1 for font in $MENU_FONT $SUB_FONT; do if [ "$font" != "themefont.ttf" -a ! -f $GEEXBOX_DIR/i18n/fonts/$font ]; then echo "" echo "**** $font font is missing ****" echo "**** Please visit the README - EXTRA SUBTITLE FONTS section ****" echo "" exit 1 fi done for file in menu_$MENU_LANG.conf help_$MENU_LANG.txt; do if [ ! -f $GEEXBOX_DIR/i18n/texts/$file ]; then echo "" echo "**** $file language file is missing ****" echo "" exit 1 fi done if [ $TMPDIR = "." ]; then rm -rf $TMPDIR/ziso else rm -rf $TMPDIR fi mkdir -p $TMPDIR/ziso [ ! -d $TMPDIR/iso ] && cp -r $GEEXBOX_DIR/iso $TMPDIR/iso echo $MENU_LANG > $TMPDIR/iso/GEEXBOX/etc/lang cp $GEEXBOX_DIR/i18n/texts/help_$MENU_LANG.txt $TMPDIR/iso/GEEXBOX/usr/share/mplayer/ cp $GEEXBOX_DIR/i18n/texts/menu_$MENU_LANG.conf $TMPDIR/iso/GEEXBOX/etc/mplayer/ cp $GEEXBOX_DIR/i18n/lang.conf $TMPDIR/iso/GEEXBOX/etc/ echo $SUB_CHARSET > $TMPDIR/iso/GEEXBOX/etc/subfont cp -r $GEEXBOX_DIR/i18n/fonts/$SUB_FONT $TMPDIR/iso/GEEXBOX/usr/share/fonts/ if [ "$MENU_FONT" = "themefont.ttf" ]; then cp $GEEXBOX_DIR/themes/$THEME/*.ttf $TMPDIR/iso/GEEXBOX/usr/share/fonts/themefont.ttf elif [ "$MENU_FONT" != "$SUB_FONT" ]; then cp -r $GEEXBOX_DIR/i18n/fonts/$MENU_FONT $TMPDIR/iso/GEEXBOX/usr/share/fonts/ fi for i in $SUB_CHARSET $MENU_CHARSET; do grep "^$i " $GEEXBOX_DIR/i18n/iconv/charset.db | cut -d ' ' -f 2 | while read f; do cp -f $GEEXBOX_DIR/i18n/iconv/$f $TMPDIR/iso/GEEXBOX/usr/share/iconv/ done done cp $GEEXBOX_DIR/themes/$THEME/config $TMPDIR/iso/GEEXBOX/etc/theme.conf cp $GEEXBOX_DIR/themes/$THEME/*.ttf $TMPDIR/iso/GEEXBOX/usr/share/fonts/themefont.ttf cp $GEEXBOX_DIR/themes/$THEME/background.avi $TMPDIR/iso/GEEXBOX/usr/share/mplayer/ [ -f $GEEXBOX_DIR/themes/$THEME/background-audio.avi ] && cp $GEEXBOX_DIR/themes/$THEME/background-audio.avi $TMPDIR/iso/GEEXBOX/usr/share/mplayer/ [ $TARGET_ARCH = i386 -a -f $GEEXBOX_DIR/themes/$THEME/grub-splash.xpm.gz ] && cp $GEEXBOX_DIR/themes/$THEME/grub-splash.xpm.gz $TMPDIR/iso/GEEXBOX/usr/share/ cp $GEEXBOX_DIR/lirc/lircrc_$REMOTE $TMPDIR/iso/GEEXBOX/etc/lircrc cp $GEEXBOX_DIR/lirc/lircd_$RECEIVER $TMPDIR/iso/GEEXBOX/etc/lircd cp $GEEXBOX_DIR/lirc/lircd_$REMOTE.conf $TMPDIR/iso/GEEXBOX/etc/lircd.conf [ -n "$W32CODECS" ] && ln -s $W32CODECS_DIR/* $TMPDIR/iso/GEEXBOX/codecs/ "$MKZFTREE" $TMPDIR/iso/GEEXBOX $TMPDIR/ziso/GEEXBOX rm -f $TMPDIR/iso/GEEXBOX/usr/share/mplayer/help_$MENU_LANG.txt rm -f $TMPDIR/iso/GEEXBOX/etc/mplayer/menu_$MENU_LANG.conf rm -f $TMPDIR/iso/GEEXBOX/etc/lang.conf rm -f $TMPDIR/iso/GEEXBOX/etc/lang rm -f $TMPDIR/iso/GEEXBOX/etc/subfont rm -f $TMPDIR/iso/GEEXBOX/etc/theme.conf rm -rf $TMPDIR/iso/GEEXBOX/usr/share/iconv/* rm -rf $TMPDIR/iso/GEEXBOX/usr/share/fonts/* rm -f $TMPDIR/iso/GEEXBOX/usr/share/mplayer/background.avi rm -f $TMPDIR/iso/GEEXBOX/usr/share/mplayer/background-audio.avi rm -f $TMPDIR/iso/GEEXBOX/usr/share/grub-splash.xpm.gz rm -f $TMPDIR/iso/GEEXBOX/etc/lirc* cp -rf $TMPDIR/iso/GEEXBOX/boot/* $TMPDIR/ziso/GEEXBOX/boot [ -f $GEEXBOX_DIR/themes/$THEME/bootsplash-$RESOLUTION.dat ] && cat $GEEXBOX_DIR/themes/$THEME/bootsplash-$RESOLUTION.dat >> $TMPDIR/ziso/GEEXBOX/boot/initrd.gz [ $TARGET_ARCH = i386 -a -f $GEEXBOX_DIR/themes/$THEME/splash-isolinux.rle ] && cp $GEEXBOX_DIR/themes/$THEME/splash-isolinux.rle $TMPDIR/ziso/GEEXBOX/boot/splash.rle for i in $TMPDIR/iso/*; do [ "$i" != $TMPDIR/iso/GEEXBOX ] && ln -s "../$i" $TMPDIR/ziso done case $TARGET_ARCH in i386) MKISOFS_ARCH="-no-emul-boot \ -boot-info-table \ -boot-load-size 4 \ -b GEEXBOX/boot/isolinux.bin \ -c GEEXBOX/boot/boot.catalog" ;; ppc) MKISOFS_ARCH="-hfs \ -part \ -no-desktop \ -map $GEEXBOX_DIR/maps \ -hfs-volid GEEXBOX \ -hfs-bless $TMPDIR/ziso/GEEXBOX/boot" ;; esac "$MKISOFS" -quiet -no-pad -V GEEXBOX -volset GEEXBOX \ -publisher "The GeeXboX team (www.geexbox.org)" \ -p "The GeeXboX team (www.geexbox.org)" \ -A "MKISOFS ISO 9660/HFS FILESYSTEM BUILDER" \ -z -f -D -r -J -sort $GEEXBOX_DIR/sort $MKISOFS_ARCH \ $TMPDIR/ziso > $OUTPUT if [ $TMPDIR = "." ]; then rm -rf $TMPDIR/ziso else rm -rf $TMPDIR fi echo "" echo "**** Your customized GeeXboX iso is ready ****" echo "" geexbox-1.0/packages/generator/url0000644000175000017500000000006210446314261016305 0ustar aurelaurelGEEXBOX_SRCS/generator--fltk--0--patch-183.tar.gz geexbox-1.0/packages/genext2fs/0000755000175000017500000000000010446314261015501 5ustar aurelaurelgeexbox-1.0/packages/genext2fs/build0000755000175000017500000000016110446314261016524 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain setup_toolchain host make -C $BUILD/$1* \ genext2fs geexbox-1.0/packages/genext2fs/patches/0000755000175000017500000000000010446314261017130 5ustar aurelaurelgeexbox-1.0/packages/genext2fs/patches/10_glibc.diff0000644000175000017500000000052510446314261021344 0ustar aurelaurel--- genext2fs-1.3.orig.orig/genext2fs.c Mon Jun 18 11:11:32 2001 +++ genext2fs-1.3.orig/genext2fs.c Wed Nov 17 22:02:07 2004 @@ -168,7 +168,7 @@ // which of course is not the same on Solaris, old glibc and new // glibc ... -#ifdef __GNUC__ +#ifdef __GLIBC__ #define SCANF_PREFIX "a" #define SCANF_STRING(s) (&s) #define GETCWD_SIZE 0 geexbox-1.0/packages/genext2fs/url0000644000175000017500000000012010446314261016217 0ustar aurelaurelhttp://ftp.de.debian.org/debian/pool/main/g/genext2fs/genext2fs_1.3.orig.tar.gz geexbox-1.0/packages/grub/0000755000175000017500000000000010446314261014533 5ustar aurelaurelgeexbox-1.0/packages/grub/arch0000644000175000017500000000000510446314261015366 0ustar aurelaureli386 geexbox-1.0/packages/grub/build0000755000175000017500000000045610446314261015565 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix="`ls -d $ROOT/$BUILD/$1*`/build" \ --disable-shared \ --without-curses \ --enable-graphics make make install geexbox-1.0/packages/grub/install0000755000175000017500000000101610446314261016125 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain FILES="e2fs_stage1_5 fat_stage1_5 stage1 stage2" mkdir -p $INSTALL/usr/share tar cf - -C $BUILD/$1*/build/lib/grub/i386-pc $FILES | lzma e $INSTALL/usr/share/grub-i386-pc.tar.lzma -si -a2 mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/build/sbin/grub $INSTALL/usr/bin if [ "$2" != generator ]; then $SCRIPTS/unpack theme-$THEME [ -f "$BUILD/theme-$THEME/grub-splash.xpm.gz" ] && cp $BUILD/theme-$THEME/grub-splash.xpm.gz $INSTALL/usr/share/grub-splash.xpm.gz fi exit 0 geexbox-1.0/packages/grub/patches/0000755000175000017500000000000010446314261016162 5ustar aurelaurelgeexbox-1.0/packages/grub/patches/10_2gb_limit.diff0000644000175000017500000000242510446314261021167 0ustar aurelaurel Author: Goswin Brederlow Status: pending Updated by: Otavio Salvador - resync with 0.97 code diff -r 190816689333 stage2/char_io.c --- a/stage2/char_io.c Sat Nov 5 15:00:55 2005 +++ b/stage2/char_io.c Sat Nov 5 13:09:55 2005 @@ -1175,13 +1175,13 @@ #endif /* ! STAGE1_5 */ int -memcheck (int addr, int len) +memcheck (unsigned long int addr, unsigned long int len) { #ifdef GRUB_UTIL - auto int start_addr (void); - auto int end_addr (void); + auto unsigned long int start_addr (void); + auto int unsigned long end_addr (void); - auto int start_addr (void) + auto unsigned long int start_addr (void) { int ret; # if defined(HAVE_START_SYMBOL) @@ -1192,7 +1192,7 @@ return ret; } - auto int end_addr (void) + auto unsigned long int end_addr (void) { int ret; # if defined(HAVE_END_SYMBOL) diff -r 190816689333 stage2/shared.h --- a/stage2/shared.h Sat Nov 5 15:00:55 2005 +++ b/stage2/shared.h Sat Nov 5 13:09:55 2005 @@ -911,7 +911,7 @@ int nul_terminate (char *str); int get_based_digit (int c, int base); int safe_parse_maxint (char **str_ptr, int *myint_ptr); -int memcheck (int start, int len); +int memcheck (unsigned long int start, unsigned long int len); void grub_putstr (const char *str); #ifndef NO_DECOMPRESSION geexbox-1.0/packages/grub/patches/11_initrd-max-address.diff0000644000175000017500000000153010446314261023013 0ustar aurelaurel Date: 2005-11-11 Author: Otavio Salvador Comment: Stolen from SuSE grub package. It fix the max address of initrd image and include a safe default in case of it isn't available --- grub-0.94/stage2/boot.c.orig 2004-01-11 09:49:05.000000000 +0100 +++ grub-0.94/stage2/boot.c 2004-03-04 16:11:21.857403508 +0100 @@ -810,8 +810,11 @@ moveto = (mbi.mem_upper + 0x400) << 10; moveto = (moveto - len) & 0xfffff000; - max_addr = (lh->header == LINUX_MAGIC_SIGNATURE && lh->version >= 0x0203 - ? lh->initrd_addr_max : LINUX_INITRD_MAX_ADDRESS); + max_addr = LINUX_INITRD_MAX_ADDRESS; + if (lh->header == LINUX_MAGIC_SIGNATURE && + lh->version >= 0x0203 && + lh->initrd_addr_max < max_addr) + max_addr = lh->initrd_addr_max; if (moveto + len >= max_addr) moveto = (max_addr - len) & 0xfffff000; geexbox-1.0/packages/grub/patches/13_geometry-26kernel.diff0000644000175000017500000001535210446314261022606 0ustar aurelaurel Date: 2005-11-11 Author: Otavio Salvador Comment: Stolen from Fedora grub package. Put geometry discover inside of grub code since kernel 2.6 doesn't do that anymore. --- grub-0.95/lib/device.c.26geom 2004-11-30 16:33:00.186025728 -0500 +++ grub-0.95/lib/device.c 2004-11-30 16:45:09.073218032 -0500 @@ -131,6 +131,152 @@ #include #include +#if defined(__linux__) +/* The 2.6 kernel has removed all of the geometry handling for IDE drives + * that did fixups for LBA, etc. This means that the geometry we get + * with the ioctl has a good chance of being wrong. So, we get to + * also know about partition tables and try to read what the geometry + * is there. *grumble* Very closely based on code from cfdisk + */ +static void get_kernel_geometry(int fd, long long *cyl, int *heads, int *sectors) { + struct hd_geometry hdg; + + if (ioctl (fd, HDIO_GETGEO, &hdg)) + return; + + *cyl = hdg.cylinders; + *heads = hdg.heads; + *sectors = hdg.sectors; +} + +struct partition { + unsigned char boot_ind; /* 0x80 - active */ + unsigned char head; /* starting head */ + unsigned char sector; /* starting sector */ + unsigned char cyl; /* starting cylinder */ + unsigned char sys_ind; /* What partition type */ + unsigned char end_head; /* end head */ + unsigned char end_sector; /* end sector */ + unsigned char end_cyl; /* end cylinder */ + unsigned char start4[4]; /* starting sector counting from 0 */ + unsigned char size4[4]; /* nr of sectors in partition */ +}; + +#define ALIGNMENT 2 +typedef union { + struct { + unsigned char align[ALIGNMENT]; + unsigned char b[SECTOR_SIZE]; + } c; + struct { + unsigned char align[ALIGNMENT]; + unsigned char buffer[0x1BE]; + struct partition part[4]; + unsigned char magicflag[2]; + } p; +} partition_table; + +#define PART_TABLE_FLAG0 0x55 +#define PART_TABLE_FLAG1 0xAA + +static void +get_partition_table_geometry(partition_table *bufp, long long *cyl, int *heads, + int *sectors) { + struct partition *p; + int i,h,s,hh,ss; + int first = 1; + int bad = 0; + + if (bufp->p.magicflag[0] != PART_TABLE_FLAG0 || + bufp->p.magicflag[1] != PART_TABLE_FLAG1) { + /* Matthew Wilcox: slightly friendlier version of + fatal(_("Bad signature on partition table"), 3); + */ + fprintf(stderr, "Unknown partition table signature\n"); + return; + } + + hh = ss = 0; + for (i=0; i<4; i++) { + p = &(bufp->p.part[i]); + if (p->sys_ind != 0) { + h = p->end_head + 1; + s = (p->end_sector & 077); + if (first) { + hh = h; + ss = s; + first = 0; + } else if (hh != h || ss != s) + bad = 1; + } + } + + if (!first && !bad) { + *heads = hh; + *sectors = ss; + } +} + +static long long my_lseek (unsigned int fd, long long offset, + unsigned int origin) +{ +#if defined(__linux__) && (!defined(__GLIBC__) || \ + ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))) + /* Maybe libc doesn't have large file support. */ + loff_t offset, result; + static int _llseek (uint filedes, ulong hi, ulong lo, + loff_t *res, uint wh); + _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo, + loff_t *, res, uint, wh); + + if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET) < 0) + return (long long) -1; + return result; +#else + return lseek(fd, offset, SEEK_SET); +#endif +} + +static void get_linux_geometry (int fd, struct geometry *geom) { + long long kern_cyl = 0; int kern_head = 0, kern_sectors = 0; + long long pt_cyl = 0; int pt_head = 0, pt_sectors = 0; + partition_table bufp; + char *buff, *buf_unaligned; + + buf_unaligned = malloc(sizeof(partition_table) + 4095); + buff = (char *) (((unsigned long)buf_unaligned + 4096 - 1) & + (~(4096-1))); + + get_kernel_geometry(fd, &kern_cyl, &kern_head, &kern_sectors); + + if (my_lseek (fd, 0*SECTOR_SIZE, SEEK_SET) < 0) { + fprintf(stderr, "Unable to seek"); + } + + if (read(fd, buff, SECTOR_SIZE) == SECTOR_SIZE) { + memcpy(bufp.c.b, buff, SECTOR_SIZE); + get_partition_table_geometry(&bufp, &pt_cyl, &pt_head, &pt_sectors); + } else { + fprintf(stderr, "Unable to read partition table: %s\n", strerror(errno)); + } + + if (pt_head && pt_sectors) { + int cyl_size; + + geom->heads = pt_head; + geom->sectors = pt_sectors; + cyl_size = pt_head * pt_sectors; + geom->cylinders = geom->total_sectors/cyl_size; + } else { + geom->heads = kern_head; + geom->sectors = kern_sectors; + geom->cylinders = kern_cyl; + } + + return; +} +#endif + /* Get the geometry of a drive DRIVE. */ void get_drive_geometry (struct geometry *geom, char **map, int drive) @@ -151,21 +297,16 @@ #if defined(__linux__) /* Linux */ { - struct hd_geometry hdg; unsigned long nr; - - if (ioctl (fd, HDIO_GETGEO, &hdg)) - goto fail; if (ioctl (fd, BLKGETSIZE, &nr)) goto fail; /* Got the geometry, so save it. */ - geom->cylinders = hdg.cylinders; - geom->heads = hdg.heads; - geom->sectors = hdg.sectors; geom->total_sectors = nr; - + get_linux_geometry(fd, geom); + if (!geom->heads && !geom->cylinders && !geom->sectors) + goto fail; goto success; } @@ -841,6 +982,7 @@ { char dev[PATH_MAX]; /* XXX */ int fd; + off_t offset = (off_t) sector * (off_t) SECTOR_SIZE; if ((partition & 0x00FF00) != 0x00FF00) { @@ -874,35 +1016,13 @@ errnum = ERR_NO_PART; return 0; } - -#if defined(__linux__) && (!defined(__GLIBC__) || \ - ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))) - /* Maybe libc doesn't have large file support. */ - { - loff_t offset, result; - static int _llseek (uint filedes, ulong hi, ulong lo, - loff_t *res, uint wh); - _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo, - loff_t *, res, uint, wh); - offset = (loff_t) sector * (loff_t) SECTOR_SIZE; - if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET)) - { - errnum = ERR_DEV_VALUES; - return 0; - } - } -#else - { - off_t offset = (off_t) sector * (off_t) SECTOR_SIZE; - if (lseek (fd, offset, SEEK_SET) != offset) - { - errnum = ERR_DEV_VALUES; - return 0; - } - } -#endif + if (my_lseek(fd, offset, SEEK_SET) != offset) + { + errnum = ERR_DEV_VALUES; + return 0; + } if (write (fd, buf, size * SECTOR_SIZE) != (size * SECTOR_SIZE)) { geexbox-1.0/packages/grub/patches/20_graphics.diff0000644000175000017500000016666410446314261021140 0ustar aurelaureldiff -Naur grub-0.97.orig/configure.ac grub-0.97/configure.ac --- grub-0.97.orig/configure.ac 2005-05-07 23:36:03.000000000 -0300 +++ grub-0.97/configure.ac 2005-06-12 20:56:49.000000000 -0300 @@ -595,6 +595,11 @@ [ --enable-diskless enable diskless support]) AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes) +dnl Graphical splashscreen support +AC_ARG_ENABLE(graphics, + [ --disable-graphics disable graphics terminal support]) +AM_CONDITIONAL(GRAPHICS_SUPPORT, test "x$enable_graphics" != xno) + dnl Hercules terminal AC_ARG_ENABLE(hercules, [ --disable-hercules disable hercules terminal support]) diff -Naur grub-0.97.orig/stage2/asm.S grub-0.97/stage2/asm.S --- grub-0.97.orig/stage2/asm.S 2004-06-19 13:55:22.000000000 -0300 +++ grub-0.97/stage2/asm.S 2005-06-13 14:05:31.000000000 -0300 @@ -2216,7 +2216,304 @@ pop %ebx pop %ebp ret - + + +/* graphics mode functions */ +#ifdef SUPPORT_GRAPHICS +VARIABLE(cursorX) +.word 0 +VARIABLE(cursorY) +.word 0 +VARIABLE(cursorCount) +.word 0 +VARIABLE(cursorBuf) +.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + + +/* + * set_int1c_handler(void) + */ +ENTRY(set_int1c_handler) + pushl %edi + + /* save the original int1c handler */ + movl $0x70, %edi + movw (%edi), %ax + movw %ax, ABS(int1c_offset) + movw 2(%edi), %ax + movw %ax, ABS(int1c_segment) + + /* save the new int1c handler */ + movw $ABS(int1c_handler), %ax + movw %ax, (%edi) + xorw %ax, %ax + movw %ax, 2(%edi) + + popl %edi + ret + + +/* + * unset_int1c_handler(void) + */ +ENTRY(unset_int1c_handler) + pushl %edi + + /* check if int1c_handler is set */ + movl $0x70, %edi + movw $ABS(int1c_handler), %ax + cmpw %ax, (%edi) + jne int1c_1 + xorw %ax, %ax + cmpw %ax, 2(%edi) + jne int1c_1 + + /* restore the original */ + movw ABS(int1c_offset), %ax + movw %ax, (%edi) + movw ABS(int1c_segment), %ax + movw %ax, 2(%edi) + +int1c_1: + popl %edi + ret + + +/* + * blinks graphics cursor + */ + .code16 +write_data: + movw $0, %ax + movw %ax, %ds + + mov $0xA000, %ax /* video in es:di */ + mov %ax, %es + mov $80, %ax + movw $ABS(cursorY), %si + mov %ds:(%si), %bx + mul %bx + movw $ABS(cursorX), %si + mov %ds:(%si), %bx + shr $3, %bx /* %bx /= 8 */ + add %bx, %ax + mov %ax, %di + + movw $ABS(cursorBuf), %si /* fontBuf in ds:si */ + + /* prepare for data moving */ + mov $16, %dx /* altura da fonte */ + mov $80, %bx /* bytes por linha */ + +write_loop: + movb %ds:(%si), %al + xorb $0xff, %al + movb %al, %ds:(%si) /* invert cursorBuf */ + movb %al, %es:(%di) /* write to video */ + add %bx, %di + inc %si + dec %dx + jg write_loop + ret + +int1c_handler: + pusha + mov $0, %ax + mov %ax, %ds + mov $ABS(cursorCount), %si + mov %ds:(%si), %ax + inc %ax + mov %ax, %ds:(%si) + cmp $9, %ax + jne int1c_done + + mov $0, %ax + mov %ax, %ds:(%si) + call write_data + +int1c_done: + popa + iret + /* call previous int1c handler */ + /* ljmp */ + .byte 0xea +int1c_offset: .word 0 +int1c_segment: .word 0 + .code32 + + +/* + * unsigned char set_videomode(unsigned char mode) + * BIOS call "INT 10H Function 0h" to set video mode + * Call with %ah = 0x0 + * %al = video mode + * Returns old videomode. + */ +ENTRY(set_videomode) + pushl %ebp + movl %esp,%ebp + pushl %ebx + pushl %ecx + + movb 8(%ebp), %cl + + call EXT_C(prot_to_real) + .code16 + + xorb %al, %al + movb $0xf, %ah + int $0x10 /* Get Current Video mode */ + movb %al, %ch + xorb %ah, %ah + movb %cl, %al + int $0x10 /* Set Video mode */ + + DATA32 call EXT_C(real_to_prot) + .code32 + + xorl %eax, %eax + movb %ch, %al + + popl %ecx + popl %ebx + popl %ebp + ret + + +/* + * int get_videomode() + * BIOS call "INT 10H Function 0Fh" to get current video mode + * Call with %al = 0x0 + * %ah = 0xF + * Returns current videomode. + */ +ENTRY(get_videomode) + pushl %ebp + movl %esp,%ebp + pushl %ebx + pushl %ecx + + call EXT_C(prot_to_real) + .code16 + + xorb %al, %al + movb $0xF, %ah + int $0x10 /* Get Current Video mode */ + movb %al, %cl /* For now we only want display mode */ + + DATA32 call EXT_C(real_to_prot) + .code32 + + xorl %eax, %eax + movb %cl, %al + + popl %ecx + popl %ebx + popl %ebp + ret + + +/* + * unsigned char * graphics_get_font() + * BIOS call "INT 10H Function 11h" to set font + * Call with %ah = 0x11 + */ +ENTRY(graphics_get_font) + push %ebp + push %ebx + push %ecx + push %edx + + call EXT_C(prot_to_real) + .code16 + + movw $0x1130, %ax + movb $6, %bh /* font 8x16 */ + int $0x10 + movw %bp, %dx + movw %es, %cx + + DATA32 call EXT_C(real_to_prot) + .code32 + + xorl %eax, %eax + movw %cx, %ax + shll $4, %eax + movw %dx, %ax + + pop %edx + pop %ecx + pop %ebx + pop %ebp + ret + + +/* + * graphics_set_palette(index, red, green, blue) + * BIOS call "INT 10H Function 10h" to set individual dac register + * Call with %ah = 0x10 + * %bx = register number + * %ch = new value for green (0-63) + * %cl = new value for blue (0-63) + * %dh = new value for red (0-63) + */ + +ENTRY(graphics_set_palette) + push %ebp + push %eax + push %ebx + push %ecx + push %edx + + movw $0x3c8, %bx /* address write mode register */ + + /* wait vertical retrace */ + movw $0x3da, %dx +l1b: + inb %dx, %al /* wait vertical active display */ + test $8, %al + jnz l1b + +l2b: + inb %dx, %al /* wait vertical retrace */ + test $8, %al + jnz l2b + + mov %bx, %dx + movb 0x18(%esp), %al /* index */ + outb %al, %dx + inc %dx + + movb 0x1c(%esp), %al /* red */ + outb %al, %dx + + movb 0x20(%esp), %al /* green */ + outb %al, %dx + + movb 0x24(%esp), %al /* blue */ + outb %al, %dx + + movw 0x18(%esp), %bx + + call EXT_C(prot_to_real) + .code16 + + movb %bl, %bh + movw $0x1000, %ax + int $0x10 + + DATA32 call EXT_C(real_to_prot) + .code32 + + pop %edx + pop %ecx + pop %ebx + pop %eax + pop %ebp + ret +#endif /* SUPPORT_GRAPHICS */ + + /* * getrtsecs() * if a seconds value can be read, read it and return it (BCD), diff -Naur grub-0.97.orig/stage2/builtins.c grub-0.97/stage2/builtins.c --- grub-0.97.orig/stage2/builtins.c 2005-02-15 19:58:23.000000000 -0200 +++ grub-0.97/stage2/builtins.c 2005-06-13 18:44:03.000000000 -0300 @@ -28,6 +28,10 @@ #include #include +#ifdef SUPPORT_GRAPHICS +# include +#endif + #ifdef SUPPORT_NETBOOT # define GRUB 1 # include @@ -237,12 +241,22 @@ static int boot_func (char *arg, int flags) { + struct term_entry *prev_term = current_term; /* Clear the int15 handler if we can boot the kernel successfully. This assumes that the boot code never fails only if KERNEL_TYPE is not KERNEL_TYPE_NONE. Is this assumption is bad? */ if (kernel_type != KERNEL_TYPE_NONE) unset_int15_handler (); + /* if our terminal needed initialization, we should shut it down + * before booting the kernel, but we want to save what it was so + * we can come back if needed */ + if (current_term->shutdown) + { + current_term->shutdown(); + current_term = term_table; /* assumption: console is first */ + } + #ifdef SUPPORT_NETBOOT /* Shut down the networking. */ cleanup_net (); @@ -306,6 +320,13 @@ return 1; } + /* if we get back here, we should go back to what our term was before */ + current_term = prev_term; + if (current_term->startup) + /* if our terminal fails to initialize, fall back to console since + * it should always work */ + if (current_term->startup() == 0) + current_term = term_table; /* we know that console is first */ return 0; } @@ -852,6 +873,251 @@ }; #endif /* SUPPORT_NETBOOT */ +#ifdef SUPPORT_GRAPHICS + +static int splashimage_func(char *arg, int flags) { + int i; + + /* filename can only be 256 characters due to our buffer size */ + if (grub_strlen(arg) > 256) { + grub_printf("Splash image filename too large\n"); + grub_printf("Press any key to continue..."); + getkey(); + return 1; + } + + /* get rid of TERM_NEED_INIT from the graphics terminal. */ + for (i = 0; term_table[i].name; i++) { + if (grub_strcmp (term_table[i].name, "graphics") == 0) { + term_table[i].flags &= ~TERM_NEED_INIT; + break; + } + } + + graphics_set_splash(arg); + + if (flags == BUILTIN_CMDLINE && graphics_inited) { + graphics_end(); + if (graphics_init() == 0) { + /* Fallback to default term */ + current_term = term_table; + max_lines = current_term->max_lines; + if (current_term->cls) + current_term->cls(); + grub_printf("Failed to set splash image and/or graphics mode\n"); + return 1; + } + graphics_cls(); + } + + if (flags == BUILTIN_MENU) + current_term = term_table + i; + + return 0; +} + +static struct builtin builtin_splashimage = +{ + "splashimage", + splashimage_func, + BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, + "splashimage FILE", + "Load FILE as the background image when in graphics mode." +}; + + +/* shade */ +static int +shade_func(char *arg, int flags) +{ + int new_shade; + + if (!arg || safe_parse_maxint(&arg, &new_shade) == 0) + return (1); + + if (shade != new_shade) { + shade = new_shade; + if (flags == BUILTIN_CMDLINE && graphics_inited) { + graphics_end(); + graphics_init(); + graphics_cls(); + } + } + + return 0; +} + +static struct builtin builtin_shade = +{ + "shade", + shade_func, + BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, + "shade INTEGER", + "If set to 0, disables the use of shaded text, else enables it." +}; + + +/* foreground */ +static int +foreground_func(char *arg, int flags) +{ + if (grub_strlen(arg) == 6) { + int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2; + int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2; + int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2; + + foreground = (r << 16) | (g << 8) | b; + if (graphics_inited) + graphics_set_palette(15, r, g, b); + + return 0; + } + + return 1; +} + +static struct builtin builtin_foreground = +{ + "foreground", + foreground_func, + BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, + "foreground RRGGBB", + "Sets the foreground color when in graphics mode." + "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal." +}; + + +/* background */ +static int +background_func(char *arg, int flags) +{ + if (grub_strlen(arg) == 6) { + int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2; + int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2; + int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2; + + background = (r << 16) | (g << 8) | b; + if (graphics_inited) + graphics_set_palette(0, r, g, b); + return 0; + } + + return 1; +} + +static struct builtin builtin_background = +{ + "background", + background_func, + BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, + "background RRGGBB", + "Sets the background color when in graphics mode." + "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal." +}; + + +/* border */ +static int +border_func(char *arg, int flags) +{ + if (grub_strlen(arg) == 6) { + int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2; + int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2; + int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2; + + window_border = (r << 16) | (g << 8) | b; + if (graphics_inited) + graphics_set_palette(0x11, r, g, b); + + return 0; + } + + return 1; +} + +static struct builtin builtin_border = +{ + "border", + border_func, + BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, + "border RRGGBB", + "Sets the border video color when in graphics mode." + "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal." +}; + + +/* viewport */ +static int +viewport_func (char *arg, int flags) +{ + int i; + int x0 = 0, y0 = 0, x1 = 80, y1 = 30; + int *pos[4] = { &x0, &y0, &x1, &y1 }; + + if (!arg) + return (1); + for (i = 0; i < 4; i++) { + if (!*arg) + return (1); + while (*arg && (*arg == ' ' || *arg == '\t')) + ++arg; + if (!safe_parse_maxint(&arg, pos[i])) + return (1); + while (*arg && (*arg != ' ' && *arg != '\t')) + ++arg; + } + + /* minimum size is 65 colums and 16 rows */ + if (x0 > x1 - 66 || y0 > y1 - 16 || x0 < 0 || y0 < 0 || x1 > 80 || y1 > 30) + return 1; + + view_x0 = x0; + view_y0 = y0; + view_x1 = x1; + view_y1 = y1; + + if (flags == BUILTIN_CMDLINE && graphics_inited) { + graphics_end(); + graphics_init(); + graphics_cls(); + } + + return 0; +} + +static struct builtin builtin_viewport = +{ + "viewport", + viewport_func, + BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST, + "viewport x0 y0 x1 y1", + "Changes grub internals to output text in the window defined by" + " four parameters. The x and y parameters are 0 based. This option" + " only works with the graphics interface." +}; + +#endif /* SUPPORT_GRAPHICS */ + + +/* clear */ +static int +clear_func() +{ + if (current_term->cls) + current_term->cls(); + + return 0; +} + +static struct builtin builtin_clear = +{ + "clear", + clear_func, + BUILTIN_CMDLINE | BUILTIN_HELP_LIST, + "clear", + "Clear the screen" +}; + /* displayapm */ static int @@ -1454,14 +1720,20 @@ /* help */ -#define MAX_SHORT_DOC_LEN 39 -#define MAX_LONG_DOC_LEN 66 - static int help_func (char *arg, int flags) { - int all = 0; - + int all = 0, max_short_doc_len, max_long_doc_len; + max_short_doc_len = 39; + max_long_doc_len = 66; +#ifdef SUPPORT_GRAPHICS + if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0) + { + max_short_doc_len = (view_x1 - view_x0 + 1) / 2 - 1; + max_long_doc_len = (view_x1 - view_x0) - 14; + } +#endif + if (grub_memcmp (arg, "--all", sizeof ("--all") - 1) == 0) { all = 1; @@ -1491,13 +1763,13 @@ len = grub_strlen ((*builtin)->short_doc); /* If the length of SHORT_DOC is too long, truncate it. */ - if (len > MAX_SHORT_DOC_LEN - 1) - len = MAX_SHORT_DOC_LEN - 1; + if (len > max_short_doc_len - 1) + len = max_short_doc_len - 1; for (i = 0; i < len; i++) grub_putchar ((*builtin)->short_doc[i]); - for (; i < MAX_SHORT_DOC_LEN; i++) + for (; i < max_short_doc_len; i++) grub_putchar (' '); if (! left) @@ -1546,10 +1818,10 @@ int i; /* If LEN is too long, fold DOC. */ - if (len > MAX_LONG_DOC_LEN) + if (len > max_long_doc_len) { /* Fold this line at the position of a space. */ - for (len = MAX_LONG_DOC_LEN; len > 0; len--) + for (len = max_long_doc_len; len > 0; len--) if (doc[len - 1] == ' ') break; } @@ -4085,7 +4357,7 @@ }; -#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) +#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS) /* terminal */ static int terminal_func (char *arg, int flags) @@ -4244,17 +4516,29 @@ end: current_term = term_table + default_term; current_term->flags = term_flags; - + if (lines) max_lines = lines; else - /* 24 would be a good default value. */ - max_lines = 24; - + max_lines = current_term->max_lines; + /* If the interface is currently the command-line, restart it to repaint the screen. */ - if (current_term != prev_term && (flags & BUILTIN_CMDLINE)) + if ((current_term != prev_term) && (flags & BUILTIN_CMDLINE)){ + if (prev_term->shutdown) + prev_term->shutdown(); + if (current_term->startup) { + /* If startup fails, return to previous term */ + if (current_term->startup() == 0) { + current_term = prev_term; + max_lines = current_term->max_lines; + if (current_term->cls) { + current_term->cls(); + } + } + } grub_longjmp (restart_cmdline_env, 0); + } return 0; } @@ -4264,7 +4548,7 @@ "terminal", terminal_func, BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST, - "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules]", + "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]", "Select a terminal. When multiple terminals are specified, wait until" " you push any key to continue. If both console and serial are specified," " the terminal to which you input a key first will be selected. If no" @@ -4276,7 +4560,7 @@ " seconds. The option --lines specifies the maximum number of lines." " The option --silent is used to suppress messages." }; -#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */ +#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */ #ifdef SUPPORT_SERIAL @@ -4795,13 +5079,20 @@ /* The table of builtin commands. Sorted in dictionary order. */ struct builtin *builtin_table[] = { +#ifdef SUPPORT_GRAPHICS + &builtin_background, +#endif &builtin_blocklist, &builtin_boot, #ifdef SUPPORT_NETBOOT &builtin_bootp, #endif /* SUPPORT_NETBOOT */ +#ifdef SUPPORT_GRAPHICS + &builtin_border, +#endif &builtin_cat, &builtin_chainloader, + &builtin_clear, &builtin_cmp, &builtin_color, &builtin_configfile, @@ -4821,6 +5112,9 @@ &builtin_embed, &builtin_fallback, &builtin_find, +#ifdef SUPPORT_GRAPHICS + &builtin_foreground, +#endif &builtin_fstest, &builtin_geometry, &builtin_halt, @@ -4864,9 +5158,13 @@ #endif /* SUPPORT_SERIAL */ &builtin_setkey, &builtin_setup, -#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) +#ifdef SUPPORT_GRAPHICS + &builtin_shade, + &builtin_splashimage, +#endif /* SUPPORT_GRAPHICS */ +#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS) &builtin_terminal, -#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */ +#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */ #ifdef SUPPORT_SERIAL &builtin_terminfo, #endif /* SUPPORT_SERIAL */ @@ -4880,5 +5178,8 @@ &builtin_unhide, &builtin_uppermem, &builtin_vbeprobe, +#ifdef SUPPORT_GRAPHICS + &builtin_viewport, +#endif 0 }; diff -Naur grub-0.97.orig/stage2/char_io.c grub-0.97/stage2/char_io.c --- grub-0.97.orig/stage2/char_io.c 2005-02-01 18:51:23.000000000 -0200 +++ grub-0.97/stage2/char_io.c 2005-06-12 20:56:49.000000000 -0300 @@ -29,12 +29,17 @@ # include #endif +#ifdef SUPPORT_GRAPHICS +# include +#endif + #ifndef STAGE1_5 struct term_entry term_table[] = { { "console", 0, + 24, console_putchar, console_checkkey, console_getkey, @@ -43,13 +48,16 @@ console_cls, console_setcolorstate, console_setcolor, - console_setcursor + console_setcursor, + 0, + 0 }, #ifdef SUPPORT_SERIAL { "serial", /* A serial device must be initialized. */ TERM_NEED_INIT, + 24, serial_putchar, serial_checkkey, serial_getkey, @@ -58,6 +66,8 @@ serial_cls, serial_setcolorstate, 0, + 0, + 0, 0 }, #endif /* SUPPORT_SERIAL */ @@ -65,6 +75,7 @@ { "hercules", 0, + 24, hercules_putchar, console_checkkey, console_getkey, @@ -73,11 +84,30 @@ hercules_cls, hercules_setcolorstate, hercules_setcolor, - hercules_setcursor + hercules_setcursor, + 0, + 0 }, #endif /* SUPPORT_HERCULES */ +#ifdef SUPPORT_GRAPHICS + { "graphics", + TERM_NEED_INIT, /* flags */ + 30, /* number of lines */ + graphics_putchar, /* putchar */ + console_checkkey, /* checkkey */ + console_getkey, /* getkey */ + graphics_getxy, /* getxy */ + graphics_gotoxy, /* gotoxy */ + graphics_cls, /* cls */ + graphics_setcolorstate, /* setcolorstate */ + graphics_setcolor, /* setcolor */ + graphics_setcursor, /* nocursor */ + graphics_init, /* initialize */ + graphics_end /* shutdown */ + }, +#endif /* SUPPORT_GRAPHICS */ /* This must be the last entry. */ - { 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 } }; /* This must be console. */ @@ -305,9 +335,10 @@ /* XXX: These should be defined in shared.h, but I leave these here, until this code is freezed. */ -#define CMDLINE_WIDTH 78 #define CMDLINE_MARGIN 10 - + + /* command-line limits */ + int cmdline_width = 78, col_start = 0; int xpos, lpos, c, section; /* The length of PROMPT. */ int plen; @@ -338,7 +369,7 @@ /* If the cursor is in the first section, display the first section instead of the second. */ - if (section == 1 && plen + lpos < CMDLINE_WIDTH) + if (section == 1 && plen + lpos < cmdline_width) cl_refresh (1, 0); else if (xpos - count < 1) cl_refresh (1, 0); @@ -354,7 +385,7 @@ grub_putchar ('\b'); } else - gotoxy (xpos, getxy () & 0xFF); + gotoxy (xpos + col_start, getxy () & 0xFF); } } @@ -364,7 +395,7 @@ lpos += count; /* If the cursor goes outside, scroll the screen to the right. */ - if (xpos + count >= CMDLINE_WIDTH) + if (xpos + count >= cmdline_width) cl_refresh (1, 0); else { @@ -383,7 +414,7 @@ } } else - gotoxy (xpos, getxy () & 0xFF); + gotoxy (xpos + col_start, getxy () & 0xFF); } } @@ -398,14 +429,14 @@ if (full) { /* Recompute the section number. */ - if (lpos + plen < CMDLINE_WIDTH) + if (lpos + plen < cmdline_width) section = 0; else - section = ((lpos + plen - CMDLINE_WIDTH) - / (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN) + 1); + section = ((lpos + plen - cmdline_width) + / (cmdline_width - 1 - CMDLINE_MARGIN) + 1); /* From the start to the end. */ - len = CMDLINE_WIDTH; + len = cmdline_width; pos = 0; grub_putchar ('\r'); @@ -445,8 +476,8 @@ if (! full) offset = xpos - 1; - start = ((section - 1) * (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN) - + CMDLINE_WIDTH - plen - CMDLINE_MARGIN); + start = ((section - 1) * (cmdline_width - 1 - CMDLINE_MARGIN) + + cmdline_width - plen - CMDLINE_MARGIN); xpos = lpos + 1 - start; start += offset; } @@ -471,7 +502,7 @@ /* If the cursor is at the last position, put `>' or a space, depending on if there are more characters in BUF. */ - if (pos == CMDLINE_WIDTH) + if (pos == cmdline_width) { if (start + len < llen) grub_putchar ('>'); @@ -488,7 +519,7 @@ grub_putchar ('\b'); } else - gotoxy (xpos, getxy () & 0xFF); + gotoxy (xpos + col_start, getxy () & 0xFF); } /* Initialize the command-line. */ @@ -518,10 +549,10 @@ llen += l; lpos += l; - if (xpos + l >= CMDLINE_WIDTH) + if (xpos + l >= cmdline_width) cl_refresh (1, 0); - else if (xpos + l + llen - lpos > CMDLINE_WIDTH) - cl_refresh (0, CMDLINE_WIDTH - xpos); + else if (xpos + l + llen - lpos > cmdline_width) + cl_refresh (0, cmdline_width - xpos); else cl_refresh (0, l + llen - lpos); } @@ -533,12 +564,22 @@ grub_memmove (buf + lpos, buf + lpos + count, llen - count + 1); llen -= count; - if (xpos + llen + count - lpos > CMDLINE_WIDTH) - cl_refresh (0, CMDLINE_WIDTH - xpos); + if (xpos + llen + count - lpos > cmdline_width) + cl_refresh (0, cmdline_width - xpos); else cl_refresh (0, llen + count - lpos); } + max_lines = current_term->max_lines; +#ifdef SUPPORT_GRAPHICS + if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0) + { + cmdline_width = (view_x1 - view_x0) - 2; + col_start = view_x0; + max_lines = view_y1 - view_y0; + } +#endif + plen = grub_strlen (prompt); llen = grub_strlen (cmdline); @@ -1006,6 +1047,48 @@ } #endif /* ! STAGE1_5 */ +#ifndef STAGE1_5 +/* Internal pager. */ +int +do_more (void) +{ + if (count_lines >= 0) + { + count_lines++; + if (count_lines >= max_lines - 2) + { + int tmp; + + /* It's important to disable the feature temporarily, because + the following grub_printf call will print newlines. */ + count_lines = -1; + + grub_printf("\n"); + if (current_term->setcolorstate) + current_term->setcolorstate (COLOR_STATE_HIGHLIGHT); + + grub_printf ("[Hit return to continue]"); + + if (current_term->setcolorstate) + current_term->setcolorstate (COLOR_STATE_NORMAL); + + + do + { + tmp = ASCII_CHAR (getkey ()); + } + while (tmp != '\n' && tmp != '\r'); + grub_printf ("\r \r"); + + /* Restart to count lines. */ + count_lines = 0; + return 1; + } + } + return 0; +} +#endif + /* Display an ASCII character. */ void grub_putchar (int c) @@ -1034,38 +1117,11 @@ if (c == '\n') { + int flag; /* Internal `more'-like feature. */ - if (count_lines >= 0) - { - count_lines++; - if (count_lines >= max_lines - 2) - { - int tmp; - - /* It's important to disable the feature temporarily, because - the following grub_printf call will print newlines. */ - count_lines = -1; - - if (current_term->setcolorstate) - current_term->setcolorstate (COLOR_STATE_HIGHLIGHT); - - grub_printf ("\n[Hit return to continue]"); - - if (current_term->setcolorstate) - current_term->setcolorstate (COLOR_STATE_NORMAL); - - do - { - tmp = ASCII_CHAR (getkey ()); - } - while (tmp != '\n' && tmp != '\r'); - grub_printf ("\r \r"); - - /* Restart to count lines. */ - count_lines = 0; - return; - } - } + flag = do_more (); + if (flag) + return; } current_term->putchar (c); @@ -1090,7 +1146,7 @@ cls (void) { /* If the terminal is dumb, there is no way to clean the terminal. */ - if (current_term->flags & TERM_DUMB) + if (current_term->flags & TERM_DUMB) grub_putchar ('\n'); else current_term->cls (); @@ -1217,6 +1273,16 @@ return ! errnum; } +void +grub_memcpy(void *dest, const void *src, int len) +{ + int i; + register char *d = (char*)dest, *s = (char*)src; + + for (i = 0; i < len; i++) + d[i] = s[i]; +} + void * grub_memmove (void *to, const void *from, int len) { diff -Naur grub-0.97.orig/stage2/cmdline.c grub-0.97/stage2/cmdline.c --- grub-0.97.orig/stage2/cmdline.c 2004-08-16 20:23:01.000000000 -0300 +++ grub-0.97/stage2/cmdline.c 2005-06-12 20:56:49.000000000 -0300 @@ -50,10 +50,11 @@ void print_cmdline_message (int forever) { - printf (" [ Minimal BASH-like line editing is supported. For the first word, TAB\n" - " lists possible command completions. Anywhere else TAB lists the possible\n" - " completions of a device/filename.%s ]\n", - (forever ? "" : " ESC at any time exits.")); + grub_printf(" [ Minimal BASH-like line editing is supported. For\n" + " the first word, TAB lists possible command\n" + " completions. Anywhere else TAB lists the possible\n" + " completions of a device/filename.%s ]\n", + (forever ? "" : " ESC at any time\n exits.")); } /* Find the builtin whose command name is COMMAND and return the diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c --- grub-0.97.orig/stage2/graphics.c 1969-12-31 21:00:00.000000000 -0300 +++ grub-0.97/stage2/graphics.c 2005-06-13 19:13:31.000000000 -0300 @@ -0,0 +1,585 @@ +/* + * graphics.c - graphics mode support for GRUB + * Implemented as a terminal type by Jeremy Katz based + * on a patch by Paulo César Pereira de Andrade + * Options and enhancements made by Herton Ronaldo Krzesinski + * + * + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2001,2002 Red Hat, Inc. + * Portions copyright (C) 2000 Conectiva, Inc. + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifdef SUPPORT_GRAPHICS + +#include +#include +#include + +int saved_videomode; +unsigned char *font8x16; + +int graphics_inited = 0; +static char splashimage[256]; + +int shade = 1, no_cursor = 0; + +#define VSHADOW VSHADOW1 +unsigned char VSHADOW1[38400]; +unsigned char VSHADOW2[38400]; +unsigned char VSHADOW4[38400]; +unsigned char VSHADOW8[38400]; + +/* define the default viewable area */ +int view_x0 = 0; +int view_y0 = 0; +int view_x1 = 80; +int view_y1 = 30; + +/* text buffer has to be kept around so that we can write things as we + * scroll and the like */ +unsigned short text[80 * 30]; + +/* graphics options */ +int foreground = (63 << 16) | (63 << 8) | (63), background = 0, window_border = 0; + +/* current position */ +static int fontx = 0; +static int fonty = 0; + +/* global state so that we don't try to recursively scroll or cursor */ +static int no_scroll = 0; + +/* color state */ +static int graphics_standard_color = A_NORMAL; +static int graphics_normal_color = A_NORMAL; +static int graphics_highlight_color = A_REVERSE; +static int graphics_current_color = A_NORMAL; +static color_state graphics_color_state = COLOR_STATE_STANDARD; + +static inline void outb(unsigned short port, unsigned char val) +{ + __asm __volatile ("outb %0,%1"::"a" (val), "d" (port)); +} + +static void MapMask(int value) { + outb(0x3c4, 2); + outb(0x3c5, value); +} + +/* bit mask register */ +static void BitMask(int value) { + outb(0x3ce, 8); + outb(0x3cf, value); +} + +/* move the graphics cursor location to col, row */ +static void graphics_setxy(int col, int row) { + if (col >= view_x0 && col < view_x1) { + fontx = col; + cursorX = col << 3; + } + if (row >= view_y0 && row < view_y1) { + fonty = row; + cursorY = row << 4; + } +} + +/* scroll the screen */ +static void graphics_scroll() { + int i, j, k; + + /* we don't want to scroll recursively... that would be bad */ + if (no_scroll) + return; + no_scroll = 1; + + /* disable pager temporarily */ + k = count_lines; + count_lines = -1; + + /* move everything up a line */ + for (j = view_y0 + 1; j < view_y1; j++) { + graphics_gotoxy(view_x0, j - 1); + for (i = view_x0; i < view_x1; i++) { + graphics_putchar(text[j * 80 + i]); + } + } + + /* last line should be blank */ + graphics_gotoxy(view_x0, view_y1 - 1); + for (i = view_x0; i < view_x1; i++) + graphics_putchar(' '); + graphics_setxy(view_x0, view_y1 - 1); + + count_lines = k; + + no_scroll = 0; +} + +/* Set the splash image */ +void graphics_set_splash(char *splashfile) { + grub_strcpy(splashimage, splashfile); +} + +/* Get the current splash image */ +char *graphics_get_splash(void) { + return splashimage; +} + +/* + * Initialize a vga16 graphics display with the palette based off of + * the image in splashimage. If the image doesn't exist, leave graphics + * mode. The mode initiated is 12h. From "Ralf Brown's Interrupt List": + * text/ text pixel pixel colors disply scrn system + * grph resol box resolution pages addr + * 12h G 80x30 8x16 640x480 16/256K . A000 VGA,ATI VIP + * G 80x30 8x16 640x480 16/64 . A000 ATI EGA Wonder + * G . . 640x480 16 . . UltraVision+256K EGA + */ +int graphics_init() +{ + if (!graphics_inited) { + saved_videomode = set_videomode(0x12); + if (get_videomode() != 0x12) { + set_videomode(saved_videomode); + return 0; + } + graphics_inited = 1; + } + else + return 1; + + font8x16 = (unsigned char*)graphics_get_font(); + + /* make sure that the highlight color is set correctly */ + graphics_highlight_color = ((graphics_normal_color >> 4) | + ((graphics_normal_color & 0xf) << 4)); + + graphics_cls(); + + if (!read_image(splashimage)) { + grub_printf("Failed to read splash image (%s)\n", splashimage); + grub_printf("Press any key to continue..."); + getkey(); + set_videomode(saved_videomode); + graphics_inited = 0; + return 0; + } + + set_int1c_handler(); + + return 1; +} + +/* Leave graphics mode */ +void graphics_end(void) +{ + if (graphics_inited) { + unset_int1c_handler(); + set_videomode(saved_videomode); + graphics_inited = 0; + no_cursor = 0; + } +} + +/* Print ch on the screen. Handle any needed scrolling or the like */ +void graphics_putchar(int ch) { + ch &= 0xff; + + graphics_cursor(0); + + if (ch == '\n') { + if (fonty + 1 < view_y1) + graphics_setxy(fontx, fonty + 1); + else + graphics_scroll(); + graphics_cursor(1); + return; + } else if (ch == '\r') { + graphics_setxy(view_x0, fonty); + graphics_cursor(1); + return; + } + + graphics_cursor(0); + + text[fonty * 80 + fontx] = ch; + text[fonty * 80 + fontx] &= 0x00ff; + if (graphics_current_color & 0xf0) + text[fonty * 80 + fontx] |= 0x100; + + graphics_cursor(0); + + if ((fontx + 1) >= view_x1) { + graphics_setxy(view_x0, fonty); + if (fonty + 1 < view_y1) + graphics_setxy(view_x0, fonty + 1); + else + graphics_scroll(); + graphics_cursor(1); + do_more (); + graphics_cursor(0); + } else { + graphics_setxy(fontx + 1, fonty); + } + + graphics_cursor(1); +} + +/* get the current location of the cursor */ +int graphics_getxy(void) { + return (fontx << 8) | fonty; +} + +void graphics_gotoxy(int x, int y) { + graphics_cursor(0); + + graphics_setxy(x, y); + + graphics_cursor(1); +} + +void graphics_cls(void) { + int i; + unsigned char *mem, *s1, *s2, *s4, *s8; + + graphics_cursor(0); + graphics_gotoxy(view_x0, view_y0); + + mem = (unsigned char*)VIDEOMEM; + s1 = (unsigned char*)VSHADOW1; + s2 = (unsigned char*)VSHADOW2; + s4 = (unsigned char*)VSHADOW4; + s8 = (unsigned char*)VSHADOW8; + + for (i = 0; i < 80 * 30; i++) + text[i] = ' '; + graphics_cursor(1); + + BitMask(0xff); + + /* plane 1 */ + MapMask(1); + grub_memcpy(mem, s1, 38400); + + /* plane 2 */ + MapMask(2); + grub_memcpy(mem, s2, 38400); + + /* plane 3 */ + MapMask(4); + grub_memcpy(mem, s4, 38400); + + /* plane 4 */ + MapMask(8); + grub_memcpy(mem, s8, 38400); + + MapMask(15); + + if (no_cursor) { + no_cursor = 0; + set_int1c_handler(); + } +} + +void graphics_setcolorstate (color_state state) { + switch (state) { + case COLOR_STATE_STANDARD: + graphics_current_color = graphics_standard_color; + break; + case COLOR_STATE_NORMAL: + graphics_current_color = graphics_normal_color; + break; + case COLOR_STATE_HIGHLIGHT: + graphics_current_color = graphics_highlight_color; + break; + default: + graphics_current_color = graphics_standard_color; + break; + } + + graphics_color_state = state; +} + +void graphics_setcolor (int normal_color, int highlight_color) { + graphics_normal_color = normal_color; + graphics_highlight_color = highlight_color; + + graphics_setcolorstate (graphics_color_state); +} + +int graphics_setcursor (int on) { + if (!no_cursor && !on) { + no_cursor = 1; + unset_int1c_handler(); + graphics_cursor(0); + } + else if(no_cursor && on) { + no_cursor = 0; + set_int1c_handler(); + graphics_cursor(1); + } + return 0; +} + +/* Read in the splashscreen image and set the palette up appropriately. + * Format of splashscreen is an xpm (can be gzipped) with 16 colors and + * 640x480. */ +int read_image(char *s) +{ + char buf[32], pal[16], c; + unsigned char base, mask, *s1, *s2, *s4, *s8; + unsigned i, len, idx, colors, x, y, width, height; + + if (!grub_open(s)) + return 0; + + /* read header */ + if (!grub_read((char*)&buf, 10) || grub_memcmp(buf, "/* XPM */\n", 10)) { + grub_close(); + return 0; + } + + /* parse info */ + while (grub_read(&c, 1)) { + if (c == '"') + break; + } + + while (grub_read(&c, 1) && (c == ' ' || c == '\t')) + ; + + i = 0; + width = c - '0'; + while (grub_read(&c, 1)) { + if (c >= '0' && c <= '9') + width = width * 10 + c - '0'; + else + break; + } + while (grub_read(&c, 1) && (c == ' ' || c == '\t')) + ; + + height = c - '0'; + while (grub_read(&c, 1)) { + if (c >= '0' && c <= '9') + height = height * 10 + c - '0'; + else + break; + } + while (grub_read(&c, 1) && (c == ' ' || c == '\t')) + ; + + colors = c - '0'; + while (grub_read(&c, 1)) { + if (c >= '0' && c <= '9') + colors = colors * 10 + c - '0'; + else + break; + } + + base = 0; + while (grub_read(&c, 1) && c != '"') + ; + + /* palette */ + for (i = 0, idx = 1; i < colors; i++) { + len = 0; + + while (grub_read(&c, 1) && c != '"') + ; + grub_read(&c, 1); /* char */ + base = c; + grub_read(buf, 4); /* \t c # */ + + while (grub_read(&c, 1) && c != '"') { + if (len < sizeof(buf)) + buf[len++] = c; + } + + if (len == 6 && idx < 15) { + int r = ((hex(buf[0]) << 4) | hex(buf[1])) >> 2; + int g = ((hex(buf[2]) << 4) | hex(buf[3])) >> 2; + int b = ((hex(buf[4]) << 4) | hex(buf[5])) >> 2; + + pal[idx] = base; + graphics_set_palette(idx, r, g, b); + ++idx; + } + } + + x = y = len = 0; + + s1 = (unsigned char*)VSHADOW1; + s2 = (unsigned char*)VSHADOW2; + s4 = (unsigned char*)VSHADOW4; + s8 = (unsigned char*)VSHADOW8; + + for (i = 0; i < 38400; i++) + s1[i] = s2[i] = s4[i] = s8[i] = 0; + + /* parse xpm data */ + while (y < height) { + while (1) { + if (!grub_read(&c, 1)) { + grub_close(); + return 0; + } + if (c == '"') + break; + } + + while (grub_read(&c, 1) && c != '"') { + for (i = 1; i < 15; i++) + if (pal[i] == c) { + c = i; + break; + } + + mask = 0x80 >> (x & 7); + if (c & 1) + s1[len + (x >> 3)] |= mask; + if (c & 2) + s2[len + (x >> 3)] |= mask; + if (c & 4) + s4[len + (x >> 3)] |= mask; + if (c & 8) + s8[len + (x >> 3)] |= mask; + + if (++x >= 640) { + x = 0; + + if (y < 480) + len += 80; + ++y; + } + } + } + + grub_close(); + + graphics_set_palette(0, (background >> 16), (background >> 8) & 63, + background & 63); + graphics_set_palette(15, (foreground >> 16), (foreground >> 8) & 63, + foreground & 63); + graphics_set_palette(0x11, (window_border >> 16), (window_border >> 8) & 63, + window_border & 63); + + return 1; +} + +/* Convert a character which is a hex digit to the appropriate integer */ +int hex(int v) +{ + if (v >= 'A' && v <= 'F') + return (v - 'A' + 10); + if (v >= 'a' && v <= 'f') + return (v - 'a' + 10); + return (v - '0'); +} + +void graphics_cursor(int set) { + unsigned char *pat, *mem, *ptr, chr[16 << 2]; + int i, ch, invert, offset; + + if (set && (no_cursor || no_scroll)) + return; + + offset = cursorY * 80 + fontx; + ch = text[fonty * 80 + fontx] & 0xff; + invert = (text[fonty * 80 + fontx] & 0xff00) != 0; + pat = font8x16 + (ch << 4); + + mem = (unsigned char*)VIDEOMEM + offset; + + if (!set) { + for (i = 0; i < 16; i++) { + unsigned char mask = pat[i]; + + if (!invert) { + chr[i ] = ((unsigned char*)VSHADOW1)[offset]; + chr[16 + i] = ((unsigned char*)VSHADOW2)[offset]; + chr[32 + i] = ((unsigned char*)VSHADOW4)[offset]; + chr[48 + i] = ((unsigned char*)VSHADOW8)[offset]; + + if (shade) { + if (ch == DISP_VERT || ch == DISP_LL || + ch == DISP_UR || ch == DISP_LR) { + unsigned char pmask = ~(pat[i] >> 1); + + chr[i ] &= pmask; + chr[16 + i] &= pmask; + chr[32 + i] &= pmask; + chr[48 + i] &= pmask; + } + if (i > 0 && ch != DISP_VERT) { + unsigned char pmask = ~(pat[i - 1] >> 1); + + chr[i ] &= pmask; + chr[16 + i] &= pmask; + chr[32 + i] &= pmask; + chr[48 + i] &= pmask; + if (ch == DISP_HORIZ || ch == DISP_UR || ch == DISP_LR) { + pmask = ~pat[i - 1]; + + chr[i ] &= pmask; + chr[16 + i] &= pmask; + chr[32 + i] &= pmask; + chr[48 + i] &= pmask; + } + } + } + chr[i ] |= mask; + chr[16 + i] |= mask; + chr[32 + i] |= mask; + chr[48 + i] |= mask; + + offset += 80; + } + else { + chr[i ] = mask; + chr[16 + i] = mask; + chr[32 + i] = mask; + chr[48 + i] = mask; + } + } + } + else { + MapMask(15); + ptr = mem; + for (i = 0; i < 16; i++, ptr += 80) { + cursorBuf[i] = pat[i]; + *ptr = ~pat[i]; + } + return; + } + + offset = 0; + for (i = 1; i < 16; i <<= 1, offset += 16) { + int j; + + MapMask(i); + ptr = mem; + for (j = 0; j < 16; j++, ptr += 80) + *ptr = chr[j + offset]; + } + + MapMask(15); +} + +#endif /* SUPPORT_GRAPHICS */ diff -Naur grub-0.97.orig/stage2/graphics.h grub-0.97/stage2/graphics.h --- grub-0.97.orig/stage2/graphics.h 1969-12-31 21:00:00.000000000 -0300 +++ grub-0.97/stage2/graphics.h 2005-06-12 20:56:49.000000000 -0300 @@ -0,0 +1,44 @@ +/* graphics.h - graphics console interface */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002 Free Software Foundation, Inc. + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef GRAPHICS_H +#define GRAPHICS_H + +/* magic constant */ +#define VIDEOMEM 0xA0000 + +/* function prototypes */ +char *graphics_get_splash(void); + +int read_image(char *s); +void graphics_cursor(int set); + +/* function prototypes for asm functions */ +void * graphics_get_font(); +void graphics_set_palette(int idx, int red, int green, int blue); +void set_int1c_handler(); +void unset_int1c_handler(); + +extern short cursorX, cursorY; +extern char cursorBuf[16]; +extern int shade; +extern int view_x0, view_y0, view_x1, view_y1; + +#endif /* GRAPHICS_H */ diff -Naur grub-0.97.orig/stage2/Makefile.am grub-0.97/stage2/Makefile.am --- grub-0.97.orig/stage2/Makefile.am 2005-02-02 18:37:35.000000000 -0200 +++ grub-0.97/stage2/Makefile.am 2005-06-12 20:56:49.000000000 -0300 @@ -7,7 +7,7 @@ fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \ imgact_aout.h iso9660.h jfs.h mb_header.h mb_info.h md5.h \ nbi.h pc_slice.h serial.h shared.h smp-imps.h term.h \ - terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h + terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h graphics.h EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS) # For . @@ -19,7 +19,7 @@ disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \ fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \ fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \ - terminfo.c tparm.c + terminfo.c tparm.c graphics.c libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \ -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \ -DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \ @@ -79,8 +79,14 @@ HERCULES_FLAGS = endif +if GRAPHICS_SUPPORT +GRAPHICS_FLAGS = -DSUPPORT_GRAPHICS=1 +else +GRAPHICS_FLAGS = +endif + STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \ - $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) + $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) $(GRAPHICS_FLAGS) STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000 STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1 @@ -90,7 +96,8 @@ cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \ fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \ fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \ - hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c + hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c \ + graphics.c pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK) diff -Naur grub-0.97.orig/stage2/shared.h grub-0.97/stage2/shared.h --- grub-0.97.orig/stage2/shared.h 2004-06-19 13:40:09.000000000 -0300 +++ grub-0.97/stage2/shared.h 2005-06-12 20:56:49.000000000 -0300 @@ -792,6 +792,11 @@ /* Set the cursor position. */ void gotoxy (int x, int y); +/* Internal pager + Returns 1 = if pager was used + 0 = if pager wasn't used */ +int do_more (void); + /* Displays an ASCII character. IBM displays will translate some characters to special graphical ones (see the DISP_* constants). */ void grub_putchar (int c); @@ -871,6 +876,7 @@ int grub_tolower (int c); int grub_isspace (int c); int grub_strncat (char *s1, const char *s2, int n); +void grub_memcpy(void *dest, const void *src, int len); void *grub_memmove (void *to, const void *from, int len); void *grub_memset (void *start, int c, int len); int grub_strncat (char *s1, const char *s2, int n); diff -Naur grub-0.97.orig/stage2/stage2.c grub-0.97/stage2/stage2.c --- grub-0.97.orig/stage2/stage2.c 2005-03-19 14:51:57.000000000 -0300 +++ grub-0.97/stage2/stage2.c 2005-06-13 22:38:08.000000000 -0300 @@ -20,6 +20,12 @@ #include #include +#ifdef SUPPORT_GRAPHICS +# include +#endif + +int col_start, col_end, row_start, box_size; + grub_jmp_buf restart_env; #if defined(PRESET_MENU_STRING) || defined(SUPPORT_DISKLESS) @@ -105,13 +111,13 @@ if (highlight && current_term->setcolorstate) current_term->setcolorstate (COLOR_STATE_HIGHLIGHT); - gotoxy (2, y); + gotoxy (2 + col_start, y); grub_putchar (' '); - for (x = 3; x < 75; x++) + for (x = 3 + col_start; x < (col_end - 5); x++) { - if (*entry && x <= 72) + if (*entry && x <= (col_end - 8)) { - if (x == 72) + if (x == (col_end - 8)) grub_putchar (DISP_RIGHT); else grub_putchar (*entry++); @@ -119,7 +125,7 @@ else grub_putchar (' '); } - gotoxy (74, y); + gotoxy ((col_end - 6), y); if (current_term->setcolorstate) current_term->setcolorstate (COLOR_STATE_STANDARD); @@ -131,7 +137,7 @@ { int i; - gotoxy (77, y + 1); + gotoxy ((col_end - 3), y + 1); if (first) grub_putchar (DISP_UP); @@ -151,14 +157,14 @@ menu_entries++; } - gotoxy (77, y + size); + gotoxy ((col_end - 3), y + size); if (*menu_entries) grub_putchar (DISP_DOWN); else grub_putchar (' '); - gotoxy (74, y + entryno + 1); + gotoxy ((col_end - 6), y + entryno + 1); } static void @@ -196,30 +202,30 @@ if (current_term->setcolorstate) current_term->setcolorstate (COLOR_STATE_NORMAL); - gotoxy (1, y); + gotoxy (1 + col_start, y); grub_putchar (DISP_UL); - for (i = 0; i < 73; i++) + for (i = col_start; i < (col_end - 7); i++) grub_putchar (DISP_HORIZ); grub_putchar (DISP_UR); i = 1; while (1) { - gotoxy (1, y + i); + gotoxy (1 + col_start, y + i); if (i > size) break; grub_putchar (DISP_VERT); - gotoxy (75, y + i); + gotoxy ((col_end - 5), y + i); grub_putchar (DISP_VERT); i++; } grub_putchar (DISP_LL); - for (i = 0; i < 73; i++) + for (i = col_start; i < (col_end - 7); i++) grub_putchar (DISP_HORIZ); grub_putchar (DISP_LR); @@ -233,6 +239,7 @@ { int c, time1, time2 = -1, first_entry = 0; char *cur_entry = 0; + struct term_entry *prev_term = NULL; /* * Main loop for menu UI. @@ -250,6 +257,22 @@ } } + col_start = 0; + col_end = 80; + row_start = 0; + box_size = 12; + /* if we're using viewport we need to make sure to setup + coordinates correctly. */ +#ifdef SUPPORT_GRAPHICS + if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0) + { + col_start = view_x0; + col_end = view_x1; + row_start = view_y0; + box_size = (view_y1 - view_y0) - 13; + } +#endif + /* If the timeout was expired or wasn't set, force to show the menu interface. */ if (grub_timeout < 0) @@ -302,36 +325,36 @@ if (current_term->flags & TERM_DUMB) print_entries_raw (num_entries, first_entry, menu_entries); else - print_border (3, 12); + print_border (3 + row_start, box_size); grub_printf ("\n\ - Use the %c and %c keys to select which entry is highlighted.\n", + Use the %c and %c keys to select which entry is highlighted.\n", DISP_UP, DISP_DOWN); if (! auth && password) { printf ("\ - Press enter to boot the selected OS or \'p\' to enter a\n\ - password to unlock the next set of features."); + Press enter to boot the selected OS or \'p\' to enter a\n\ + password to unlock the next set of features."); } else { if (config_entries) printf ("\ - Press enter to boot the selected OS, \'e\' to edit the\n\ - commands before booting, or \'c\' for a command-line."); + Press enter to boot the selected OS, \'e\' to edit the\n\ + commands before booting, or \'c\' for a command-line."); else printf ("\ - Press \'b\' to boot, \'e\' to edit the selected command in the\n\ - boot sequence, \'c\' for a command-line, \'o\' to open a new line\n\ - after (\'O\' for before) the selected line, \'d\' to remove the\n\ - selected line, or escape to go back to the main menu."); + Press \'b\' to boot, \'e\' to edit the selected command in the\n\ + boot sequence, \'c\' for a command-line, \'o\' to open a new line\n\ + after (\'O\' for before) the selected line, \'d\' to remove the\n\ + selected line, or escape to go back to the main menu."); } if (current_term->flags & TERM_DUMB) grub_printf ("\n\nThe selected entry is %d ", entryno); else - print_entries (3, 12, first_entry, entryno, menu_entries); + print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); } /* XX using RT clock now, need to initialize value */ @@ -358,10 +381,10 @@ entryno, grub_timeout); else { - gotoxy (3, 22); - grub_printf ("The highlighted entry will be booted automatically in %d seconds. ", + gotoxy (3 + col_start, 10 + box_size + row_start); + grub_printf (" The highlighted entry will be booted automatically in %d seconds. ", grub_timeout); - gotoxy (74, 4 + entryno); + gotoxy ((col_end - 6), 4 + entryno + row_start); } grub_timeout--; @@ -387,12 +410,12 @@ if (current_term->flags & TERM_DUMB) grub_putchar ('\r'); else - gotoxy (3, 22); + gotoxy (3 + col_start, 10 + box_size + row_start); printf (" "); grub_timeout = -1; fallback_entryno = -1; if (! (current_term->flags & TERM_DUMB)) - gotoxy (74, 4 + entryno); + gotoxy ((col_end - 6), 4 + entryno + row_start); } /* We told them above (at least in SUPPORT_SERIAL) to use @@ -408,12 +431,12 @@ { if (entryno > 0) { - print_entry (4 + entryno, 0, + print_entry (4 + entryno + row_start, 0, get_entry (menu_entries, first_entry + entryno, 0)); entryno--; - print_entry (4 + entryno, 1, + print_entry (4 + entryno + row_start, 1, get_entry (menu_entries, first_entry + entryno, 0)); @@ -421,7 +444,7 @@ else if (first_entry > 0) { first_entry--; - print_entries (3, 12, first_entry, entryno, + print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); } } @@ -433,29 +456,29 @@ entryno++; else { - if (entryno < 11) + if (entryno < (box_size - 1)) { - print_entry (4 + entryno, 0, + print_entry (4 + entryno + row_start, 0, get_entry (menu_entries, first_entry + entryno, 0)); entryno++; - print_entry (4 + entryno, 1, + print_entry (4 + entryno + row_start, 1, get_entry (menu_entries, first_entry + entryno, 0)); } - else if (num_entries > 12 + first_entry) + else if (num_entries > box_size + first_entry) { first_entry++; - print_entries (3, 12, first_entry, entryno, menu_entries); + print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); } } } else if (c == 7) { /* Page Up */ - first_entry -= 12; + first_entry -= box_size; if (first_entry < 0) { entryno += first_entry; @@ -463,20 +486,20 @@ if (entryno < 0) entryno = 0; } - print_entries (3, 12, first_entry, entryno, menu_entries); + print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); } else if (c == 3) { /* Page Down */ - first_entry += 12; + first_entry += box_size; if (first_entry + entryno + 1 >= num_entries) { - first_entry = num_entries - 12; + first_entry = num_entries - box_size; if (first_entry < 0) first_entry = 0; entryno = num_entries - first_entry - 1; } - print_entries (3, 12, first_entry, entryno, menu_entries); + print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); } if (config_entries) @@ -489,7 +512,7 @@ if ((c == 'd') || (c == 'o') || (c == 'O')) { if (! (current_term->flags & TERM_DUMB)) - print_entry (4 + entryno, 0, + print_entry (4 + entryno + row_start, 0, get_entry (menu_entries, first_entry + entryno, 0)); @@ -537,7 +560,7 @@ if (entryno >= num_entries) entryno--; - if (first_entry && num_entries < 12 + first_entry) + if (first_entry && num_entries < box_size + first_entry) first_entry--; } @@ -549,7 +572,7 @@ grub_printf ("\n"); } else - print_entries (3, 12, first_entry, entryno, menu_entries); + print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries); } cur_entry = menu_entries; @@ -570,7 +593,7 @@ if (current_term->flags & TERM_DUMB) grub_printf ("\r "); else - gotoxy (1, 21); + gotoxy (1 + col_start, 9 + box_size + row_start); /* Wipe out the previously entered password */ grub_memset (entered, 0, sizeof (entered)); @@ -714,6 +737,15 @@ cls (); setcursor (1); + /* if our terminal needed initialization, we should shut it down + * before booting the kernel, but we want to save what it was so + * we can come back if needed */ + prev_term = current_term; + if (current_term->shutdown) + { + current_term->shutdown(); + current_term = term_table; /* assumption: console is first */ + } while (1) { @@ -748,6 +780,13 @@ break; } + /* if we get back here, we should go back to what our term was before */ + current_term = prev_term; + if (current_term->startup) + /* if our terminal fails to initialize, fall back to console since + * it should always work */ + if (current_term->startup() == 0) + current_term = term_table; /* we know that console is first */ show_menu = 1; goto restart; } @@ -1050,6 +1089,16 @@ while (is_preset); } + /* go ahead and make sure the terminal is setup */ + if (current_term->startup) + { + /* If initialization fails, go back to default terminal */ + if (current_term->startup() == 0) + { + current_term = term_table; + } + } + if (! num_entries) { /* If no acceptable config file, goto command-line, starting diff -Naur grub-0.97.orig/stage2/term.h grub-0.97/stage2/term.h --- grub-0.97.orig/stage2/term.h 2003-07-09 08:45:53.000000000 -0300 +++ grub-0.97/stage2/term.h 2005-06-13 14:07:40.000000000 -0300 @@ -60,6 +60,8 @@ const char *name; /* The feature flags defined above. */ unsigned long flags; + /* Default for maximum number of lines if not specified */ + unsigned short max_lines; /* Put a character. */ void (*putchar) (int c); /* Check if any input character is available. */ @@ -79,6 +81,10 @@ void (*setcolor) (int normal_color, int highlight_color); /* Turn on/off the cursor. */ int (*setcursor) (int on); + /* function to start a terminal */ + int (*startup) (void); + /* function to use to shutdown a terminal */ + void (*shutdown) (void); }; /* This lists up available terminals. */ @@ -124,4 +130,24 @@ int hercules_setcursor (int on); #endif +#ifdef SUPPORT_GRAPHICS +extern int foreground, background, window_border, graphics_inited, saved_videomode; + +void graphics_set_splash(char *splashfile); +int set_videomode(int mode); +int get_videomode(void); +void graphics_putchar (int c); +int graphics_getxy(void); +void graphics_gotoxy(int x, int y); +void graphics_cls(void); +void graphics_setcolorstate (color_state state); +void graphics_setcolor (int normal_color, int highlight_color); +int graphics_setcursor (int on); +int graphics_init(void); +void graphics_end(void); + +int hex(int v); +void graphics_set_palette(int idx, int red, int green, int blue); +#endif /* SUPPORT_GRAPHICS */ + #endif /* ! GRUB_TERM_HEADER */ geexbox-1.0/packages/grub/patches/22_graphics-makefiles.diff0000644000175000017500000004524210446314261023064 0ustar aurelaureldiff -Nur grub-0.97.orig/configure grub-0.97/configure --- grub-0.97.orig/configure Sun May 8 05:48:12 2005 +++ grub-0.97/configure Tue Nov 29 09:21:35 2005 @@ -311,7 +311,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT PERL CC ac_ct_CC CFLAGS LDFLAGS CPPFLAGS EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CCAS RANLIB ac_ct_RANLIB STAGE1_CFLAGS STAGE2_CFLAGS GRUB_CFLAGS OBJCOPY ac_ct_OBJCOPY GRUB_LIBS CPP EGREP NETBOOT_SUPPORT_TRUE NETBOOT_SUPPORT_FALSE DISKLESS_SUPPORT_TRUE DISKLESS_SUPPORT_FALSE HERCULES_SUPPORT_TRUE HERCULES_SUPPORT_FALSE SERIAL_SUPPORT_TRUE SERIAL_SUPPORT_FALSE SERIAL_SPEED_SIMULATION_TRUE SERIAL_SPEED_SIMULATION_FALSE BUILD_EXAMPLE_KERNEL_TRUE BUILD_EXAMPLE_KERNEL_FALSE FSYS_CFLAGS NET_CFLAGS NET_EXTRAFLAGS NETBOOT_DRIVERS CCASFLAGS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT PERL CC ac_ct_CC CFLAGS LDFLAGS CPPFLAGS EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CCAS RANLIB ac_ct_RANLIB STAGE1_CFLAGS STAGE2_CFLAGS GRUB_CFLAGS OBJCOPY ac_ct_OBJCOPY GRUB_LIBS CPP EGREP NETBOOT_SUPPORT_TRUE NETBOOT_SUPPORT_FALSE DISKLESS_SUPPORT_TRUE DISKLESS_SUPPORT_FALSE GRAPHICS_SUPPORT_TRUE GRAPHICS_SUPPORT_FALSE HERCULES_SUPPORT_TRUE HERCULES_SUPPORT_FALSE SERIAL_SUPPORT_TRUE SERIAL_SUPPORT_FALSE SERIAL_SPEED_SIMULATION_TRUE SERIAL_SPEED_SIMULATION_FALSE BUILD_EXAMPLE_KERNEL_TRUE BUILD_EXAMPLE_KERNEL_FALSE FSYS_CFLAGS NET_CFLAGS NET_EXTRAFLAGS NETBOOT_DRIVERS CCASFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -914,6 +914,7 @@ set the default memory location for WD/SMC --enable-cs-scan=LIST probe for CS89x0 base address using LIST --enable-diskless enable diskless support + --disable-graphics disable graphics terminal support --disable-hercules disable hercules terminal support --disable-serial disable serial terminal support --enable-serial-speed-simulation @@ -5966,6 +5967,22 @@ fi +# Check whether --enable-graphics or --disable-graphics was given. +if test "${enable_graphics+set}" = set; then + enableval="$enable_graphics" + +fi; + + +if test "x$enable_graphics" != xno; then + GRAPHICS_SUPPORT_TRUE= + GRAPHICS_SUPPORT_FALSE='#' +else + GRAPHICS_SUPPORT_TRUE='#' + GRAPHICS_SUPPORT_FALSE= +fi + + # Check whether --enable-hercules or --disable-hercules was given. if test "${enable_hercules+set}" = set; then enableval="$enable_hercules" @@ -6270,6 +6287,13 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${GRAPHICS_SUPPORT_TRUE}" && test -z "${GRAPHICS_SUPPORT_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"GRAPHICS_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"GRAPHICS_SUPPORT\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${HERCULES_SUPPORT_TRUE}" && test -z "${HERCULES_SUPPORT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HERCULES_SUPPORT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -6907,6 +6931,8 @@ s,@NETBOOT_SUPPORT_FALSE@,$NETBOOT_SUPPORT_FALSE,;t t s,@DISKLESS_SUPPORT_TRUE@,$DISKLESS_SUPPORT_TRUE,;t t s,@DISKLESS_SUPPORT_FALSE@,$DISKLESS_SUPPORT_FALSE,;t t +s,@GRAPHICS_SUPPORT_TRUE@,$GRAPHICS_SUPPORT_TRUE,;t t +s,@GRAPHICS_SUPPORT_FALSE@,$GRAPHICS_SUPPORT_FALSE,;t t s,@HERCULES_SUPPORT_TRUE@,$HERCULES_SUPPORT_TRUE,;t t s,@HERCULES_SUPPORT_FALSE@,$HERCULES_SUPPORT_FALSE,;t t s,@SERIAL_SUPPORT_TRUE@,$SERIAL_SUPPORT_TRUE,;t t diff -Nur grub-0.97.orig/stage2/Makefile.in grub-0.97/stage2/Makefile.in --- grub-0.97.orig/stage2/Makefile.in Sun May 8 05:42:39 2005 +++ grub-0.97/stage2/Makefile.in Tue Nov 29 09:21:54 2005 @@ -100,7 +100,7 @@ libgrub_a-fsys_xfs.$(OBJEXT) libgrub_a-gunzip.$(OBJEXT) \ libgrub_a-md5.$(OBJEXT) libgrub_a-serial.$(OBJEXT) \ libgrub_a-stage2.$(OBJEXT) libgrub_a-terminfo.$(OBJEXT) \ - libgrub_a-tparm.$(OBJEXT) + libgrub_a-tparm.$(OBJEXT) libgrub_a-graphics.$(OBJEXT) libgrub_a_OBJECTS = $(am_libgrub_a_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) am__objects_1 = diskless_exec-asm.$(OBJEXT) \ @@ -125,7 +125,8 @@ diskless_exec-serial.$(OBJEXT) \ diskless_exec-smp-imps.$(OBJEXT) \ diskless_exec-stage2.$(OBJEXT) \ - diskless_exec-terminfo.$(OBJEXT) diskless_exec-tparm.$(OBJEXT) + diskless_exec-terminfo.$(OBJEXT) diskless_exec-tparm.$(OBJEXT) \ + diskless_exec-graphics.$(OBJEXT) am_diskless_exec_OBJECTS = $(am__objects_1) diskless_exec_OBJECTS = $(am_diskless_exec_OBJECTS) diskless_exec_DEPENDENCIES = ../netboot/libdrivers.a @@ -217,7 +218,8 @@ pre_stage2_exec-smp-imps.$(OBJEXT) \ pre_stage2_exec-stage2.$(OBJEXT) \ pre_stage2_exec-terminfo.$(OBJEXT) \ - pre_stage2_exec-tparm.$(OBJEXT) + pre_stage2_exec-tparm.$(OBJEXT) \ + pre_stage2_exec-graphics.$(OBJEXT) pre_stage2_exec_OBJECTS = $(am_pre_stage2_exec_OBJECTS) @NETBOOT_SUPPORT_TRUE@pre_stage2_exec_DEPENDENCIES = \ @NETBOOT_SUPPORT_TRUE@ ../netboot/libdrivers.a @@ -344,6 +346,8 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FSYS_CFLAGS = @FSYS_CFLAGS@ +GRAPHICS_SUPPORT_FALSE = @GRAPHICS_SUPPORT_FALSE@ +GRAPHICS_SUPPORT_TRUE = @GRAPHICS_SUPPORT_TRUE@ GRUB_CFLAGS = @GRUB_CFLAGS@ GRUB_LIBS = @GRUB_LIBS@ HERCULES_SUPPORT_FALSE = @HERCULES_SUPPORT_FALSE@ @@ -435,7 +439,7 @@ fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \ imgact_aout.h iso9660.h jfs.h mb_header.h mb_info.h md5.h \ nbi.h pc_slice.h serial.h shared.h smp-imps.h term.h \ - terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h + terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h graphics.h EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS) @@ -448,7 +452,7 @@ disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \ fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \ fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \ - terminfo.c tparm.c + terminfo.c tparm.c graphics.c libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \ -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \ @@ -479,8 +483,10 @@ @SERIAL_SUPPORT_TRUE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1 @HERCULES_SUPPORT_FALSE@HERCULES_FLAGS = @HERCULES_SUPPORT_TRUE@HERCULES_FLAGS = -DSUPPORT_HERCULES=1 +@GRAPHICS_SUPPORT_FALSE@GRAPHICS_FLAGS = +@GRAPHICS_SUPPORT_TRUE@GRAPHICS_FLAGS = -DSUPPORT_GRAPHICS=1 STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \ - $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) + $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) $(GRAPHICS_FLAGS) STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000 STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1 @@ -490,7 +496,8 @@ cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \ fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \ fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \ - hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c + hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c \ + graphics.c pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) @@ -766,6 +773,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_ufs2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_vstafs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_xfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-graphics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-gunzip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-hercules.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-md5.Po@am__quote@ @@ -820,6 +828,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_ufs2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_vstafs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_xfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-graphics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-gunzip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-serial.Po@am__quote@ @@ -850,6 +859,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_ufs2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_vstafs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_xfs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-graphics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-gunzip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-hercules.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-md5.Po@am__quote@ @@ -1367,6 +1377,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-tparm.obj `if test -f 'tparm.c'; then $(CYGPATH_W) 'tparm.c'; else $(CYGPATH_W) '$(srcdir)/tparm.c'; fi` +libgrub_a-graphics.o: graphics.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-graphics.o -MD -MP -MF "$(DEPDIR)/libgrub_a-graphics.Tpo" -c -o libgrub_a-graphics.o `test -f 'graphics.c' || echo '$(srcdir)/'`graphics.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgrub_a-graphics.Tpo" "$(DEPDIR)/libgrub_a-graphics.Po"; else rm -f "$(DEPDIR)/libgrub_a-graphics.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='graphics.c' object='libgrub_a-graphics.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-graphics.o `test -f 'graphics.c' || echo '$(srcdir)/'`graphics.c + +libgrub_a-graphics.obj: graphics.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-graphics.obj -MD -MP -MF "$(DEPDIR)/libgrub_a-graphics.Tpo" -c -o libgrub_a-graphics.obj `if test -f 'graphics.c'; then $(CYGPATH_W) 'graphics.c'; else $(CYGPATH_W) '$(srcdir)/graphics.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgrub_a-graphics.Tpo" "$(DEPDIR)/libgrub_a-graphics.Po"; else rm -f "$(DEPDIR)/libgrub_a-graphics.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='graphics.c' object='libgrub_a-graphics.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-graphics.obj `if test -f 'graphics.c'; then $(CYGPATH_W) 'graphics.c'; else $(CYGPATH_W) '$(srcdir)/graphics.c'; fi` + diskless_exec-bios.o: bios.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-bios.o -MD -MP -MF "$(DEPDIR)/diskless_exec-bios.Tpo" -c -o diskless_exec-bios.o `test -f 'bios.c' || echo '$(srcdir)/'`bios.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskless_exec-bios.Tpo" "$(DEPDIR)/diskless_exec-bios.Po"; else rm -f "$(DEPDIR)/diskless_exec-bios.Tpo"; exit 1; fi @@ -1731,6 +1755,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-tparm.obj `if test -f 'tparm.c'; then $(CYGPATH_W) 'tparm.c'; else $(CYGPATH_W) '$(srcdir)/tparm.c'; fi` +diskless_exec-graphics.o: graphics.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-graphics.o -MD -MP -MF "$(DEPDIR)/diskless_exec-graphics.Tpo" -c -o diskless_exec-graphics.o `test -f 'graphics.c' || echo '$(srcdir)/'`graphics.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskless_exec-graphics.Tpo" "$(DEPDIR)/diskless_exec-graphics.Po"; else rm -f "$(DEPDIR)/diskless_exec-graphics.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='graphics.c' object='diskless_exec-graphics.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-graphics.o `test -f 'graphics.c' || echo '$(srcdir)/'`graphics.c + +diskless_exec-graphics.obj: graphics.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-graphics.obj -MD -MP -MF "$(DEPDIR)/diskless_exec-graphics.Tpo" -c -o diskless_exec-graphics.obj `if test -f 'graphics.c'; then $(CYGPATH_W) 'graphics.c'; else $(CYGPATH_W) '$(srcdir)/graphics.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskless_exec-graphics.Tpo" "$(DEPDIR)/diskless_exec-graphics.Po"; else rm -f "$(DEPDIR)/diskless_exec-graphics.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='graphics.c' object='diskless_exec-graphics.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-graphics.obj `if test -f 'graphics.c'; then $(CYGPATH_W) 'graphics.c'; else $(CYGPATH_W) '$(srcdir)/graphics.c'; fi` + e2fs_stage1_5_exec-common.o: common.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(e2fs_stage1_5_exec_CFLAGS) $(CFLAGS) -MT e2fs_stage1_5_exec-common.o -MD -MP -MF "$(DEPDIR)/e2fs_stage1_5_exec-common.Tpo" -c -o e2fs_stage1_5_exec-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/e2fs_stage1_5_exec-common.Tpo" "$(DEPDIR)/e2fs_stage1_5_exec-common.Po"; else rm -f "$(DEPDIR)/e2fs_stage1_5_exec-common.Tpo"; exit 1; fi @@ -2598,6 +2636,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tparm.c' object='pre_stage2_exec-tparm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-tparm.obj `if test -f 'tparm.c'; then $(CYGPATH_W) 'tparm.c'; else $(CYGPATH_W) '$(srcdir)/tparm.c'; fi` + +pre_stage2_exec-graphics.o: graphics.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-graphics.o -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-graphics.Tpo" -c -o pre_stage2_exec-graphics.o `test -f 'graphics.c' || echo '$(srcdir)/'`graphics.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pre_stage2_exec-graphics.Tpo" "$(DEPDIR)/pre_stage2_exec-graphics.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-graphics.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='graphics.c' object='pre_stage2_exec-graphics.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-graphics.o `test -f 'graphics.c' || echo '$(srcdir)/'`graphics.c + +pre_stage2_exec-graphics.obj: graphics.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-graphics.obj -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-graphics.Tpo" -c -o pre_stage2_exec-graphics.obj `if test -f 'graphics.c'; then $(CYGPATH_W) 'graphics.c'; else $(CYGPATH_W) '$(srcdir)/graphics.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pre_stage2_exec-graphics.Tpo" "$(DEPDIR)/pre_stage2_exec-graphics.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-graphics.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='graphics.c' object='pre_stage2_exec-graphics.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-graphics.obj `if test -f 'graphics.c'; then $(CYGPATH_W) 'graphics.c'; else $(CYGPATH_W) '$(srcdir)/graphics.c'; fi` reiserfs_stage1_5_exec-common.o: common.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(reiserfs_stage1_5_exec_CFLAGS) $(CFLAGS) -MT reiserfs_stage1_5_exec-common.o -MD -MP -MF "$(DEPDIR)/reiserfs_stage1_5_exec-common.Tpo" -c -o reiserfs_stage1_5_exec-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c; \ geexbox-1.0/packages/grub/patches/30_256bytes-aligment.diff0000644000175000017500000000172110446314261022500 0ustar aurelaurel2006-05-02 Vesa Jaaskelainen * stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2 to GRUB Legacy. Problem reported by Gerardo Richarte. taken from upstream. Index: stage2/shared.h =================================================================== RCS file: /cvsroot/grub/grub/stage2/shared.h,v retrieving revision 1.99 retrieving revision 1.100 diff -u -r1.99 -r1.100 --- foo/stage2/shared.h 20 Jun 2004 13:48:47 -0000 1.99 +++ foo/stage2/shared.h 2 May 2006 20:46:24 -0000 1.100 @@ -499,7 +499,11 @@ unsigned char linear_reserved_field_position; unsigned long max_pixel_clock; - unsigned char reserved3[189]; + /* Reserved field to make structure to be 256 bytes long, VESA BIOS + Extension 3.0 Specification says to reserve 189 bytes here but + that doesn't make structure to be 256 bytes. So additional one is + added here. */ + unsigned char reserved3[189 + 1]; } __attribute__ ((packed)); geexbox-1.0/packages/grub/url0000644000175000017500000000005610446314261015261 0ustar aurelaurelftp://alpha.gnu.org/gnu/grub/grub-0.97.tar.gz geexbox-1.0/packages/i18n/0000755000175000017500000000000010446314262014354 5ustar aurelaurelgeexbox-1.0/packages/i18n/build0000755000175000017500000000012110446314262015373 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build i18n-fonts $SCRIPTS/build i18n-iconv geexbox-1.0/packages/i18n/config/0000755000175000017500000000000010446314262015621 5ustar aurelaurelgeexbox-1.0/packages/i18n/config/lang.conf0000644000175000017500000000352710446314262017420 0ustar aurelaurel#!/bin/sh CHARSETS="iso-8859-1 iso-8859-2 iso-8859-7 iso-8859-8 iso-8859-9 windows-1250 windows-1251 koi8-r gb2312 big5 euc-kr" LANGUAGES="bg br ca cs de el en es et fi fr he hu it ko nl no pl ro ru sk sr sv zh_CN zh_TW" DEFAULT_LANGUAGE=en DEFAULT_FONT=FreeSans.ttf # ISO-8859-1 Languages: br_name="Brazilian Portuguese" br_charset=iso-8859-1 ca_name=Catalan ca_charset=iso-8859-1 de_name=German de_charset=iso-8859-1 en_name=English en_charset=iso-8859-1 es_name=Spanish es_charset=iso-8859-1 et_name=Estonian et_charset=iso-8859-1 fi_name=Finnish fi_charset=iso-8859-1 fr_name=French fr_charset=iso-8859-1 it_name=Italian it_charset=iso-8859-1 nl_name=Dutch nl_charset=iso-8859-1 no_name=Norwegian no_charset=iso-8859-1 sv_name=Swedish sv_charset=iso-8859-1 ####################### # ISO-8859-2 Languages: cs_name=Czech cs_charset=iso-8859-2 hu_name=Hungarian hu_charset=iso-8859-2 pl_name=Polish pl_charset=iso-8859-2 ro_name=Romanian ro_charset=iso-8859-2 sk_name=Slovak sk_charset=iso-8859-2 ####################### # ISO-8859-7 Languages: el_name="Hellenic (Greek)" el_charset=iso-8859-7 ####################### # ISO-8859-8 Languages: he_name=Hebrew he_charset=iso-8859-8 ####################### # WINDOWS-1250 Languages: sr_name=Serbian sr_charset=windows-1250 ####################### # WINDOWS-1251 Languages: bg_name=Bulgarian bg_charset=windows-1251 ####################### # KOI8-R Languages: ru_name=Russian ru_charset=koi8-r ####################### # EUC-KR Languages: ko_name=Korean ko_charset=euc-kr ####################### # GB2312 Languages: zh_CN_name="Chinese - Simplified" zh_CN_charset=gb2312 ####################### # BIG5 Languages: zh_TW_name="Chinese - Traditional" zh_TW_charset=big5 ####################### # Fonts settings gb2312_font=gkai00mp.ttf big5_font=bkai00mp.ttf euc_kr_font=dotum.ttf iso_8859_8_fribidi=ISO8859-8 geexbox-1.0/packages/i18n/config/packages.ini0000644000175000017500000000131110446314262020074 0ustar aurelaurel[Fonts/] name=Extra fonts desc=This section contains fonts which were too big to be included desc=in the offical release. file=http://www.geexbox.org/fonts/ dir=i18n/fonts/ [Fonts/Asian/] name=Asian fonts [Fonts/Asian/Chinese Simplified (GB2312)] name=Chinese Simplified - GB2312 file=asian/arphic/gkai00mp.ttf.bz2 md5=a80284408ea4eafae8d1c7893c08eec7 license=asian/arphic/LICENSE [Fonts/Asian/Chinese Traditional (BIG5)] name=Chinese Traditional - BIG5 file=asian/arphic/bkai00mp.ttf.bz2 md5=a491ac3098f7c6500e48ab4c8e1c15a5 license=asian/arphic/LICENSE [Fonts/Asian/Korean (EUC-KR)] name=Korean - EUC-KR file=asian/baekmuk/dotum.ttf.bz2 md5=cba7b2660bf489790b06d9a513fe43c9 license=asian/baekmuk/COPYRIGHT geexbox-1.0/packages/i18n/install0000755000175000017500000000067710446314262015762 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/install i18n-fonts $2 $SCRIPTS/install i18n-iconv $2 $SCRIPTS/install i18n-texts $2 mkdir -p $INSTALL/etc cp $PACKAGES/$1/scripts/lang.funcs $INSTALL/etc case "$2" in generator) mkdir -p $GENERATOR_NAME/i18n cp $PACKAGES/$1/config/lang.conf $GENERATOR_NAME/i18n cp $PACKAGES/$1/scripts/lang.funcs $GENERATOR_NAME/i18n ;; *) cp $PACKAGES/$1/config/lang.conf $INSTALL/etc ;; esac geexbox-1.0/packages/i18n/scripts/0000755000175000017500000000000010446314262016043 5ustar aurelaurelgeexbox-1.0/packages/i18n/scripts/lang.funcs0000644000175000017500000000222710446314262020027 0ustar aurelaurel#!/bin/sh simplifylang() { local i tmp for i in $LANGUAGES; do eval tmp=\$${i}_name if [ "$1" = "$i" -o "$1" = "$tmp" ]; then echo $i return fi done } lang2charset() { local i lang charset=$1 if [ -z "$charset" ]; then if [ -n "$MENU_LANG" ]; then charset="$MENU_LANG" else charset="$DEFAULT_LANGUAGE" fi fi lang=`simplifylang $charset` if [ -n "$lang" ]; then eval charset=\$${lang}_charset fi for i in $CHARSETS; do if [ "$charset" = "$i" ]; then echo $charset return fi done echo "ERROR: Couldn't find a matching charset for '$1'." 1>&2 } lang2font() { local i tmp charset charset=`lang2charset $1` charset=`echo "$charset" | sed s%-%_%g` for i in ${charset}_${2}font ${charset}_font DEFAULT_FONT; do eval tmp=\$$i if [ -n "$tmp" ]; then echo $tmp return fi done } fribidi_mp_set_option() { local tmp name name=`echo $1 | sed s%-%_%g` eval tmp=\$${name}_fribidi if [ -n "$tmp" ]; then mp_set_option "${2}flip-hebrew" 1 mp_set_option "${2}fribidi-charset" "$tmp" else mp_set_option "${2}flip-hebrew" 0 fi } geexbox-1.0/packages/i18n-fonts/0000755000175000017500000000000010446314261015502 5ustar aurelaurelgeexbox-1.0/packages/i18n-fonts/install0000755000175000017500000000237510446314261017105 0ustar aurelaurel#!/bin/sh . config/options . $PACKAGES/i18n/config/lang.conf . $PACKAGES/i18n/scripts/lang.funcs $SCRIPTS/unpack theme-$THEME mkdir -p $INSTALL/etc mkdir -p $INSTALL/usr/share/fonts SUB_CHARSET=`lang2charset "$SUB_CHARSET"` MENU_CHARSET=`lang2charset "$MENU_LANG"` MENU_FONT=`lang2font "$MENU_LANG" menu` SUB_FONT=`lang2font "$SUB_CHARSET" sub` echo $MENU_LANG > $INSTALL/etc/lang echo $SUB_CHARSET > $INSTALL/etc/subfont case "$2" in generator) mkdir -p $GENERATOR_NAME/i18n/fonts cp -r $BUILD/$1/* $GENERATOR_NAME/i18n/fonts/ ;; installator) cp $BUILD/theme-$THEME/*.ttf $INSTALL/usr/share/fonts/themefont.ttf cp -r $BUILD/$1/* $INSTALL/usr/share/fonts/ ;; *) . $BUILD/theme-$THEME/config [ -z "$FONT_CHARSETS" ] && FONT_CHARSETS="iso-8859-1" for i in $FONT_CHARSETS; do if [ "$i" = "$MENU_CHARSET" ]; then cp $BUILD/theme-$THEME/*.ttf $INSTALL/usr/share/fonts/themefont.ttf MENU_FONT="themefont.ttf" break fi done [ -z "$SUB_FONT" -o -z "$MENU_FONT" ] && exit 1 cp -r $BUILD/$1/$SUB_FONT $INSTALL/usr/share/fonts/ if [ "$MENU_FONT" != "themefont.ttf" -a "$MENU_FONT" != "$SUB_FONT" ]; then cp -r $BUILD/$1/$MENU_FONT $INSTALL/usr/share/fonts/ fi ;; esac geexbox-1.0/packages/i18n-fonts/unpack0000755000175000017500000000034610446314261016714 0ustar aurelaurel#!/bin/sh . config/options FONTS_DIR=$BUILD/$1 mkdir -p $FONTS_DIR/freefont-ttf $SCRIPTS/extract $1 "freefont-ttf*" $FONTS_DIR/freefont-ttf mv $FONTS_DIR/freefont-ttf/sfd/FreeSans.ttf $FONTS_DIR rm -rf $FONTS_DIR/freefont-ttf geexbox-1.0/packages/i18n-fonts/url0000644000175000017500000000010110446314261016217 0ustar aurelaurelhttp://savannah.nongnu.org/download/freefont/freefont-ttf.tar.gz geexbox-1.0/packages/i18n-iconv/0000755000175000017500000000000010446314261015467 5ustar aurelaurelgeexbox-1.0/packages/i18n-iconv/build0000755000175000017500000000107510446314261016517 0ustar aurelaurel#!/bin/sh . config/options . $PACKAGES/i18n/config/lang.conf ICONV_DIR=$BUILD/$1 ICONV_PORTS="iconv-base iconv-extra" for j in $ICONV_PORTS; do $SCRIPTS/build $j done rm -rf $ICONV_DIR mkdir -p $ICONV_DIR for i in $CHARSETS; do for j in $ICONV_PORTS; do grep "^$i " $BUILD/$j*/charset.db | cut -d ' ' -f 2 | while read f; do echo "$i $f" >> $ICONV_DIR/charset.db case $f in *.cct) cp $BUILD/$j*/ccs/$f $ICONV_DIR/ ;; *.so) cp $BUILD/$j*/ces/$f $ICONV_DIR/ ;; esac done done done geexbox-1.0/packages/i18n-iconv/install0000755000175000017500000000136110446314261017064 0ustar aurelaurel#!/bin/sh . config/options . $PACKAGES/i18n/config/lang.conf . $PACKAGES/i18n/scripts/lang.funcs $SCRIPTS/install iconv-base MENU_CHARSET=`lang2charset "$MENU_LANG"` SUB_CHARSET=`lang2charset "$SUB_CHARSET"` [ -z "$SUB_CHARSET" -o -z "$MENU_CHARSET" ] && exit 1 mkdir -p $INSTALL/usr/share/iconv case "$2" in generator) mkdir -p $GENERATOR_NAME/i18n/iconv cp $BUILD/$1/* $GENERATOR_NAME/i18n/iconv/ ;; installator) cp $BUILD/$1/*.cct $INSTALL/usr/share/iconv/ cp $BUILD/$1/*.so $INSTALL/usr/share/iconv/ ;; *) for i in $SUB_CHARSET $MENU_CHARSET; do grep "^$i " $BUILD/$1/charset.db | cut -d ' ' -f 2 | while read f; do cp -f $BUILD/$1/$f $INSTALL/usr/share/iconv/ done done ;; esac geexbox-1.0/packages/i18n-iconv/need_build0000755000175000017500000000042010446314261017503 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build iconv-base $SCRIPTS/build iconv-extra STAMP=$STAMPS/$1/build for p in iconv-base iconv-extra; do test $STAMPS/$p/build -nt $STAMP && rm -f $STAMP done test $PACKAGES/i18n/config/lang.conf -nt $STAMP && rm -f $STAMP exit 0 geexbox-1.0/packages/i18n-texts/0000755000175000017500000000000010446314262015521 5ustar aurelaurelgeexbox-1.0/packages/i18n-texts/config/0000755000175000017500000000000010446314262016766 5ustar aurelaurelgeexbox-1.0/packages/i18n-texts/config/help_bg.txt0000644000175000017500000000134610446314261021132 0ustar aurelaurelПолезни команди m : Покажи/Скрий Менюто o : Покажи OSD Таймер s : Включи ТВ-Изход v : Покажи/Скрий Субтитри ЛÑво : Откажи / Върни Ñе ДÑÑно : ОК / Ðапред Долу : Ðазад 1 minute Горе : Ðапред 1 minute +/- : Забави звука +/- 100ms *// : УÑилване +/- 1 Команди при избиране на файлове d : избери целева Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ c : копирай в целта r : питай да премахнеш файл o : потвърди премахване на файл p : пуÑни цÑлата Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ñ u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_br.txt0000644000175000017500000000111510446314261021137 0ustar aurelaurelCOMANDOS UTEIS m : Mostrar/Esconder o menu o : Mostrar o tempo de reproducao s : Ativar saida para TV v : Mostrar/Esconder legenda Esquerda : Cancela / Retorna Direita : Ok / Avancar Para Cima : Rebobinar 1 minute Para Baixo : Avancar 1 minute +/- : Atraso do audio +/- 100ms *// : Volume +/- 1 COMANDOS DE SELECAO DE ARQUIVOS d : configura diretorio de destino c : copiar para o destino r : pedir para remover arquivo o : confirmar remocao de arquivo p : reproduzir todo diretorio l : reproduzir todo o diretorio e os subdiretorios u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_ca.txt0000644000175000017500000000105610446314261021123 0ustar aurelaurelTECLES UTILS m : Mostrar/Ocultar el Menu o : Mostrar temporitzador OSD s : Conmutar sortida a TV v : Mostrar/Ocultar Subtituls Esquerra : Cancel.lar / Endarrere Dreta : Aceptar / Endavant Avall : Endarrere 1 minute Amunt : Endavant 1 minute +/- : Retard del so +/- 100ms *// : Volum +/- 1 TECLES EN SELECCIO D'ARXIUS d : establir directori desti c : copiar a desti r : eliminar arxiu o : confirmar eliminacio d'arxius p : reproduir directori complet l : recursively view the entire directory u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_cs.txt0000644000175000017500000000076310446314261021151 0ustar aurelaurelUZITECNE PRIKAZY m : Zobraz/Skryj menu o : Zobraz OSD casovac s : Prepni TV vystup Left : Zrusit / Vzad Right : OK / Vpred Down : Posun vpred 1 minute Up : Posun vzad 1 minute +/- : Zpozdeni zvuku +/- 100ms *// : Hlasitost +/- 1 PRIKAZY v NABIDCE VYBER SOUBORU d : nastavit cilovy adresar c : kopirovat do ciloveho adrersare r : odstranit soubor o : potvrzeni odstraneni souboru p : prehrat(zobrazit) cely adresar l : Prohlednout cely adresar u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_de.txt0000644000175000017500000000117010446314261021125 0ustar aurelaurelNÜTZLICHE KOMMANDOS m : Zeigt/Verbirgt das Menü o : Zeigt den OSD Timer s : Aktiviert den TV-Ausgang v : Zeigt/Verbirgt Untertitel Links : Abbrechen / Gehe zurück Rechts : Ok / Gehe vorwärts Runter : Gehe 1 Minute zurück Hoch : Gehe 1 Minute vorwärts +/- : Audio Verzögerung +/- 100ms *// : Lautstärke +/- 1 KOMMANDOS WÄHREND DATEIAUSWAHL d : setzt das Ziel-Verzeichnis c : kopiert ins Ziel-Verzeichnis r : löscht die Datei o : bestätigt den Löschvorgang p : spielt/zeigt das gesamte Verzeichnis l : spielt/zeigt das gesamte Verzeichnis inkl. Unterordner u : zur Playlist hinzufügen i : Stream aufnehmen geexbox-1.0/packages/i18n-texts/config/help_el.txt0000644000175000017500000000205510446314261021140 0ustar aurelaurelΧÏήσιμες εντολές m : Εμφάνιση/ΑπόκÏυψη του Î¼ÎµÎ½Î¿Ï o : Εμφάνιση μετÏητή OSD s : Αλλαγή σε TV-Out v : Εμφάνιση/ΑπόκÏυψη υπότιτλων ΑÏιστεÏά : ΑκÏÏωση / Πίσω Δεξιά : Ok / ΜπÏοστά Κάτω : Πήγαινε πίσω 1 λεπτό Επάνω : Πήγαινε μπÏοστά 1 λεπτό +/- : ΚαθυστέÏηση ήχου +/- 100ms *// : Ένταση ήχου Εντολές στην "Επιλογή ΑÏχείου" d : ΚαθοÏισμός καταλόγου Ï€ÏοοÏÎ¹ÏƒÎ¼Î¿Ï c : ΑντιγÏαφή στον Ï€ÏοοÏισμό r : ΕÏώτηση για διαγÏαφή αÏχείου o : Επιβεβαίωση διαγÏαφής αÏχείου p : ΑναπαÏαγωγή/ΠÏοβολή όλου του καταλόγου l : ΑναπαÏαγωγή/ΠÏοβολή καταλόγου/υποκαταλόγων u : ΠÏοσθήκη στην λίστα αναπαÏαγωγής i : ΚαταγÏαφή Ïοής Ï€ÏογÏάμματος geexbox-1.0/packages/i18n-texts/config/help_en.txt0000644000175000017500000000100410446314261021133 0ustar aurelaurelUSEFUL COMMANDS m : Show/Hide the Menu o : Dislay OSD Timer s : Switch TV-Out v : Hide/Show Subtitles Left : Cancel / Go Backward Right : Ok / Go Forward Down : Go Backward 1 minute Up : Go Forward 1 minute +/- : Audio Delay +/- 100ms *// : Volume +/- 1 COMMANDS IN FILE SELECTION d : set destination directory c : copy to destination r : ask to remove file o : confirm file removal p : play/view the entire directory l : recursively view the entire directory u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_es.txt0000644000175000017500000000106510446314261021147 0ustar aurelaurelTECLAS UTILES m : Mostrar/Ocultar el Menu o : Mostrar temporizador OSD s : Conmutar salida a TV/CRT v : Mostrar/Ocultar Subtitulos Izquierda : Cancelar / Atras Derecha : Aceptar / Adelante Abajo : Atras 1 minute Arriba : Adelante 1 minute +/- : Retardo del sonido +/- 100ms *// : Volumen +/- 1 TECLAS EN SELECCION DE ARCHIVOS d : establecer directorio destino c : copiar a destino r : borrar archivo o : confirmar borrado de archivos p : reproducir directorio entero l : recursively view the entire directory u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_et.txt0000644000175000017500000000101610446314261021144 0ustar aurelaurelKasulikud käsud m : Näita/Peida Menüü o : Näita OSD Timerit s : Vaheta TV-Väljundit v : Näita/Peida Subtiitreid Left : Katkesta / Mine tagasi Right : Ok / Mine edasi Down : Mine tagasi 1 minut Up : Mine edasi 1 minut +/- : Heli Viivitus +/- 100ms *// : Helitugevus +/- 1 Käsud failisektsioonis d : määra sihtpunkt c : kopeeri sihtpunkti r : kustuta fail o : kinnita faili kustutamine p : mängi/vaata tervet kataloogi sisu l : rekrusiivselt vaata kataloogi sisu u : lisa playlisti i : salvesta stream geexbox-1.0/packages/i18n-texts/config/help_fi.txt0000644000175000017500000000110310446314261021127 0ustar aurelaurelHYÖDYLLISIÄ KOMENTOJA m : Näytä/piilota valikko o : Näytä OSD-ajastin s : Vaihda TV-ulostulo päälle/pois v : Näytä/piilota tekstitykset Vasen : Peru / mene takaisin Oikea : Ok / mene eteenpäin Alas : 1 minute takaisinpäin Ylös : 1 minute eteenpäin +/- : Äänen viive +/- 100ms *// : Äänenvoimakkuus +/- 1 KOMENNOT TIEDOSTOVALIKOIMASSA d : aseta kohdehakemisto c : kopioi kohteeseen r : kysy tiedoston poisto o : vahvista tiedoston poisto p : toista/katso koko hakemisto l : katso hakemisto rekursiivisesti u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_fr.txt0000644000175000017500000000113410446314261021144 0ustar aurelaurelCOMMANDES UTILES m : Affiche/Cache le Menu o : Affiche le Compteur OSD s : Active la Sortie TV v : Cache/Affiche les Sous-Titres Gauche : Annuler / Retour Arrière Droite : Ok / Avancer Bas : Retour Arrière 1 minute Haut : Avancer 1 minute +/- : Décalage Audio +/- 100ms *// : Volume +/- 1 COMMANDES DE SELECTION DE FICHIER d : répertoire de destination c : copie vers la destination r : demande de suppression o : confirmation de suppression p : lire/afficher le répertoire complet l : afficher récursivement le répertoire u : ajouter à la liste de lecture i : enregistrer le flux geexbox-1.0/packages/i18n-texts/config/help_he.txt0000644000175000017500000000125110446314261021131 0ustar aurelaurelפקודות שימושיות m : הצג\הסתר תפריט o : טיימר OSD הצג s : החלף ליצי×ת TV-Out v : הצג\הסתר כתוביות Left : ביטול / חזור ×חורה Right : ×ישור / לך קדימה Down : 1 חזור ×חורה minute Up : 1 לך קדימה minute +/- : 100 -/+ עיקוב שמעms *// : 1 -/+ עוצמת קול פקודות בבחירת קובץ d : הגדר תיקיית יעד c : העתק ליעד r : ש×ל מחיקת קובץ o : ×שר מחיקת קובץ p : הצג\הר××” ×ת כל התיקייה l : הצג ×ת כל התייקיה ב×ופן רקרוסיבי u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_hu.txt0000644000175000017500000000113710446314261021154 0ustar aurelaurelHASZNOS PARANCSOK m : Menü ki/be o : Eltelt idõ OSD-n ki/be s : TV kimenet ki/be v : Felirat ki/be balra nyíl : Mégsem / Vissza jobbra nyíl : Ok / Tovább lefele nyíl : Visszatekerés 1 minute felfele nyíl : Elõretekerés 1 minute +/- : Hang késleltetés/siettetés 100ms-mal *// : Hangerõ +/- 1 PARANCSOK FÃJL KIVÃLASZTÃSNÃL d : cél könyvtár beállítása c : cél könyvtárba másolás r : Fájl eltávolítása o : Fájl eltávolítasa megerõsítés p : A teljes könyvtár lejátszása l : recursively view the entire directory u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_it.txt0000644000175000017500000000103110446314261021145 0ustar aurelaurelCOMANDI m : Mostra/Nascondi Menu o : Vedi Tempo s : Abilita/Disablita TV-Out Freccia Sinistra : Annulla / Indietro Freccia Destra : Ok / Avanti Freccia Giu : Avanti 1 minute Freccia Su : Indietro 1 minute +/- : Audio Delay +/- 100ms *// : Volume +/- 1 COMANDI NELLA SEZIONE FILES d : imposta la directory di destinazione c : copia nella destinazione r : rimuovi il file o : conferma la rimozione del file p : visualizza l'intera directory l : visualizza la directory ricorsivamente u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_ko.txt0000644000175000017500000000103310446314261021144 0ustar aurelaurel유용한 명령어 m : 메뉴 보기/숨기기 o : OSD 시간 표시 s : TV-Out 스위치 v : 하위메뉴 숨기기/보기 Left : 취소 / 뒤로 Right : í™•ì¸ / 앞으로 Down : 1 minute 뒤로 Up : 1 minute 앞으로 +/- : +/- 100ms 오디오 ë”œë ˆì´ *// : 볼륨 +/- 1 COMMANDS IN FILE SELECTION d : set destination directory c : copy to destination r : ask to remove file o : confirm file removal p : play/view the entire directory l : recursively view the entire directory u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_nl.txt0000644000175000017500000000102110446314261021141 0ustar aurelaurelHANDIGE COMMANDOS m : Toon/Verberg het Menu o : Toon OSD Timer s : Activeer TV-Out v : Toon/Verberg Ondertitels Links : Annuleer / Spoel terug Rechts : Ok / Spoel door Onder : Spoel terug 1 minute Boven : Spoel door 1 minute +/- : Audio Delay +/- 100ms *// : Volume +/- 1 COMMANDS IN FILE SELECTION d : set destination directory c : copy to destination r : ask to remove file o : confirm file removal p : play the entire directory l : recursively view the entire directory u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_no.txt0000644000175000017500000000111510446314261021150 0ustar aurelaurelHurtigtaster For Menyvalg m : Vis/Skjul Meny o : Vis OSD tidsmÃ¥ler s : Bytt til TV-ut v : Vis/Skjul Undertekst Venstre : Avbryt / Spol tilbake Høyre : Ok / Spol Fram Ned : GÃ¥ tilbake 1 minutt Opp : GÃ¥ fram 1 minutt +/- : Lyd forsinkelse +/- 100ms *// : Volum +/- 1 Kommandoer I Forbindelse Med Filvalg d : velg destinasjons katalog c : kopier til destinasjon r : be om bekreftelse før sletting o : bekreft ved sletting p : spill/vis hele katalogen l : rekursivt se gjennom hele katalogen u : legg til spilliste i : ta opp en stream geexbox-1.0/packages/i18n-texts/config/help_pl.txt0000644000175000017500000000112610446314261021151 0ustar aurelaurelUÅ»YTECZNE KOMENDY m : Pokaż/Ukryj Menu o : WyÅ›wietl Menu OSD s : Przełącz TV-Out v : Ukryj/Pokaż Napisy Left : Anuluj / Wróć Right : Ok / Do Przodu Down : Do Tylu 1 minutÄ™ Up : Do Przodu 1 minutÄ™ +/- : Opóźnienie DzwiÄ™ku +/- 100ms *// : GÅ‚oÅ›ność +/- 1 POLECENIA W MENU WYBORU PLIKÓW Polecenia Menedżera Plików d : ustaw katalog przeznaczenia c : kopiuj w miejsce r : zapytaj o usuniÄ™cie pliku o : potwierdź usuniÄ™cie pliku p : odtwarzaj zawartość caÅ‚ego katalogu l : przeglÄ…daj rekursywnie caÅ‚y katalog u : dodaj do listy odtwarzania i : nagraj strumieÅ„ geexbox-1.0/packages/i18n-texts/config/help_ro.txt0000644000175000017500000000114110446314261021153 0ustar aurelaurelCOMENZI FOLOSITOARE m : Arată/Ascunde meniul o : AfiÅŸeaza timpul OSD s : Schimbă TV-Out v : Ascunde/Arată subtitrare Stânga : Anulare / ÃŽnapoi Dreapta : Ok / ÃŽnainte Jos : ÃŽnapoi 1 minut Sus : ÃŽnainte 1 minut +/- : ÃŽntârziere audio +/- 100ms *// : Volum +/- 1 COMENZI PENTRU SELECTAREA FIÅžIERELOR d : setează directorul destinaÅ£ie c : copiază la destinaÅ£ie r : întreabă înainte să ÅŸtergi fiÅŸierul o : confirmă ÅŸtergerea fiÅŸierului p : rulează întregul director l : vizualizare recursivă a întregului director u : adaugă la lista de ascultat i : înregistrare flux geexbox-1.0/packages/i18n-texts/config/help_ru.txt0000644000175000017500000000161010446314261021162 0ustar aurelaurelПОЛЕЗÐЫЕ КОМÐÐДЫ m : Показать/Скрыть меню o : Показать таймер s : Включить TV-выход Left : Отмена / Прокрутить назад Right : Ok / Прокрутить вперед Down : Прокрутить назад 1 minute Up : Прокрутить вперед 1 minute +/- : Ðудио-задержка +/- 100ms *// : ГромкоÑть +/- 1 КОМÐÐДЫ ПРИ ВЫБОРЕ ФÐЙЛОВ d : УÑтановить каталог Ð½Ð°Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ c : Скопировать в каталог Ð½Ð°Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ r : Ð—Ð°Ð¿Ñ€Ð¾Ñ Ð½Ð° удаление файла o : Подтвердить удаление файла p : ВоÑпроизвеÑти веÑÑŒ каталог l : РекурÑивно Ñмотреть веÑÑŒ каталог u : Добавить в плейлиÑÑ‚ i : ЗапиÑать поток geexbox-1.0/packages/i18n-texts/config/help_sk.txt0000644000175000017500000000101710446314261021152 0ustar aurelaurelUZITOCNE PRIKAZY m : Zobraz/Skry menu o : Zobraz OSD casovac s : Prepni TV vystup v : Zobraz/Skry titulky Left : Zrusit / Spat Right : OK / Dopredu Down : Posun vpred 1 minute Up : Posun vzad 1 minute +/- : Audio oneskorenie +/- 100ms *// : Hlasitost +/- 1 PRIKAZY PRI VYBERE SUBORU d : nastavenie cieloveho adresara c : kopirovanie do cieloveho adresara r : odstranit suboru o : potvrdenie odstranenia suboru p : prehrat cely adresar l : rekurzivne prehrat cely adresar u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_sr.txt0000644000175000017500000000104110446314261021156 0ustar aurelaurelKORISNE KOMANDE m : Prikaži/Sakrij meni o : Prikaži OSD Timer s : Prebaci na TV-Out v : Prikaži/Sakrij titlove Levo : Otkaži / Idi nazad Desno : Ok / Idi napred Dole : Idi nazad 1 minute Gore : Idi napred 1 minute +/- : Audio Delay +/- 100ms *// : JaÄina zvuka +/- 1 KOMANDE U SELEKCIJI FAJLOVA d : podesi odrediÅ¡ni direktorijum c : kopiraj u odrediÅ¡te r : pitaj da obriÅ¡eÅ¡ fajl o : potvrdi brisanje fajla p : reprodukuj/vidi ceo direktorijum l : rekurzivno vidi ceo direktorijum u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_sv.txt0000644000175000017500000000076310446314261021174 0ustar aurelaurelNYTTIGA KOMMANDON m : Dolj/Visa Menyn o : Visa OSD Timern s : Byt TV-ut v : Dolj/Visa Undertextning Left : Avbryt / Ga Bakat Right : Ok / Ga Framat Down : Ga Bakat 1 minute Up :Ga Framat 1 minute +/- : Ljud Korrigering +/- 100ms *// : Volym +/- 1 COMMANDS IN FILE SELECTION d : set destination directory c : copy to destination r : ask to remove file o : confirm file removal p : play the entire directory l : recursively view the entire directory u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_zh_CN.txt0000644000175000017500000000107310446314261021540 0ustar aurelaurel播放控制键 (USEFUL COMMANDS) m : 显示/éšè—èœå• o : åœ¨å±æ—¶é—´æ˜¾ç¤º s : å¼€/é—­ TV-Out v : 显示/éšè—字幕 Left : 快退/å–æ¶ˆå¿«é€€ Right : å¿«è¿›/å–æ¶ˆå¿«è¿› Down : 快退 1 minute Up : å¿«è¿› 1 minute +/- : 延迟声音 +/-100ms *// : 音é‡è°ƒèŠ‚ +/-1 文件选择相关命令 (COMMANDS IN FILE SELECTION) d : 设定目标目录 c : å¤åˆ¶åˆ°... r : 移动文件... (ask to remove file) o : 确认文件移动 (confirm file removal) p : 播放/查看整个目录 l : é‡å¤æ’­æ”¾æ•´ä¸ªç›®å½• u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/help_zh_TW.txt0000644000175000017500000000077510446314261021602 0ustar aurelaurelUSEFUL COMMANDS m : 顯示/éš±è— é¸å–® o : 顯示 OSD Timer s : 切æ›è‡³ TV-Out v : 顯示/éš±è— å­—å¹• Left : å–æ¶ˆ / å‘後快轉 Right : 確定 / å‘å‰å¿«è½‰ Down : å‘後快轉 1 minute Up : å‘å‰å¿«è½‰ 1 minute +/- : è²éŸ³ å»¶é² +/- 100ms *// : éŸ³é‡ +/- 1 COMMANDS IN FILE SELECTION d : 設定目的地目錄 c : æ‹·è²è‡³ç›®çš„地 r : è©¢å•移除檔案 o : ç¢ºèªæª”案移除 p : 播放/觀看整個目錄 l : é‡å¾©è§€çœ‹æ•´å€‹ç›®éŒ„ u : append to playlist i : record stream geexbox-1.0/packages/i18n-texts/config/menu_bg.conf0000644000175000017500000002142610446314261021255 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_br.conf0000644000175000017500000002077610446314261021277 0ustar aurelaurel Bem vindo ao MPlayer cmdlist name="recorder" title="Recorder Settings" ptr="" item-bg="-1" title-bg="-1" ptr-bg="164" > geexbox-1.0/packages/i18n-texts/config/menu_ca.conf0000644000175000017500000002071310446314261021246 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_cs.conf0000644000175000017500000002070210446314261021266 0ustar aurelaurel Welcome to MPlayer i geexbox-1.0/packages/i18n-texts/config/menu_de.conf0000644000175000017500000002102010446314262021244 0ustar aurelaurel Willkommen geexbox-1.0/packages/i18n-texts/config/menu_el.conf0000644000175000017500000002447410446314262021274 0ustar aurelaurel Καλώς ήÏθατε στον MPlayer geexbox-1.0/packages/i18n-texts/config/menu_en.conf0000644000175000017500000002055010446314262021265 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_es.conf0000644000175000017500000002075010446314262021274 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_et.conf0000644000175000017500000002064110446314262021274 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_fi.conf0000644000175000017500000002075710446314262021272 0ustar aurelaurel Tervetuloa MPlayeriin geexbox-1.0/packages/i18n-texts/config/menu_fr.conf0000644000175000017500000002140310446314262021270 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_he.conf0000644000175000017500000002127010446314262021257 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_hu.conf0000644000175000017500000002107010446314262021275 0ustar aurelaurel Üdvözöllek az MPlayer-ben geexbox-1.0/packages/i18n-texts/config/menu_it.conf0000644000175000017500000002073410446314262021303 0ustar aurelaurel Benvenuti in GeeXboX geexbox-1.0/packages/i18n-texts/config/menu_ko.conf0000644000175000017500000002070210446314262021273 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_nl.conf0000644000175000017500000002060410446314262021274 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_no.conf0000644000175000017500000002061610446314262021302 0ustar aurelaurel Velkommen til MPlayer geexbox-1.0/packages/i18n-texts/config/menu_pl.conf0000644000175000017500000002122710446314262021300 0ustar aurelaurel Witaj w MPlayer geexbox-1.0/packages/i18n-texts/config/menu_ro.conf0000644000175000017500000002130410446314262021301 0ustar aurelaurel Bine aÅ£i venit la MPlayer geexbox-1.0/packages/i18n-texts/config/menu_ru.conf0000644000175000017500000002354710446314262021322 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_sk.conf0000644000175000017500000002074010446314262021301 0ustar aurelaurel Vita vas MPlayer! geexbox-1.0/packages/i18n-texts/config/menu_sr.conf0000644000175000017500000002057710446314262021320 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_sv.conf0000644000175000017500000002061410446314262021314 0ustar aurelaurel Välkommen till MPlayer geexbox-1.0/packages/i18n-texts/config/menu_zh_CN.conf0000644000175000017500000002205710446314262021670 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/config/menu_zh_TW.conf0000644000175000017500000002157510446314262021726 0ustar aurelaurel Welcome to MPlayer geexbox-1.0/packages/i18n-texts/install0000755000175000017500000000114510446314262017116 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/etc/mplayer mkdir -p $INSTALL/usr/share/mplayer case "$2" in generator) mkdir -p $GENERATOR_NAME/i18n/texts cp $PACKAGES/$1/config/help_*.txt $GENERATOR_NAME/i18n/texts/ cp $PACKAGES/$1/config/menu_*.conf $GENERATOR_NAME/i18n/texts/ ;; installator) cp $PACKAGES/$1/config/help_*.txt $INSTALL/usr/share/mplayer cp $PACKAGES/$1/config/menu_*.conf $INSTALL/etc/mplayer ;; *) cp $PACKAGES/$1/config/help_$MENU_LANG.txt $INSTALL/usr/share/mplayer/ cp $PACKAGES/$1/config/menu_$MENU_LANG.conf $INSTALL/etc/mplayer/ ;; esac geexbox-1.0/packages/i810tvout/0000755000175000017500000000000010446314262015360 5ustar aurelaurelgeexbox-1.0/packages/i810tvout/arch0000644000175000017500000000000510446314262016213 0ustar aurelaureli386 geexbox-1.0/packages/i810tvout/build0000755000175000017500000000026010446314262016403 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build pciutils make -C $BUILD/$1* \ CC=$CC \ CFLAGS="$CFLAGS" \ LIBS="$LDFLAGS" \ i810tvout geexbox-1.0/packages/i810tvout/url0000644000175000017500000000007610446314262016110 0ustar aurelaurelhttp://i810tvout.geexbox.org/download/i810tvout-0.9.1.tar.bz2 geexbox-1.0/packages/iconv-base/0000755000175000017500000000000010446314262015623 5ustar aurelaurelgeexbox-1.0/packages/iconv-base/build0000755000175000017500000000126110446314262016650 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain export MODULEDIR="/usr/share/iconv" export TABLEDIR="/usr/share/iconv" export ICONV_BUILTIN_CHARSETS="utf-8" cd $BUILD/$1* make all cp lib/libiconv.* $LIB_PREFIX/lib cp lib/iconv.h $LIB_PREFIX/include cp ccs/iconv_mktbl $ROOT/$TOOLCHAIN/bin grep -v '#' ccs/charset.aliases | ./iconv_builtin -n $ICONV_BUILTIN_CHARSETS | cut -f 1 | while read i; do echo "$i $i.cct" >> charset.db done grep -v '#' ces/charset.aliases | ./iconv_builtin -n $ICONV_BUILTIN_CHARSETS | cut -f 1 | while read i; do echo "$i $i.so" >> charset.db grep '{"' ces/$i.c | cut -d '"' -f 2 | while read j; do echo "$i $j.cct" >> charset.db done done geexbox-1.0/packages/iconv-base/install0000755000175000017500000000015010446314262017213 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/usr/lib cp $BUILD/$1*/lib/libiconv.so.2 $INSTALL/usr/lib geexbox-1.0/packages/iconv-base/patches/0000755000175000017500000000000010446314262017252 5ustar aurelaurelgeexbox-1.0/packages/iconv-base/patches/10_GNUmakefiles.diff0000644000175000017500000001307610446314262022725 0ustar aurelaureldiff -Nur iconv-base-2.0.orig/GNUmakefile iconv-base-2.0/GNUmakefile --- iconv-base-2.0.orig/GNUmakefile Thu Jan 1 02:00:00 1970 +++ iconv-base-2.0/GNUmakefile Fri Mar 4 21:31:24 2005 @@ -0,0 +1,11 @@ +all: + $(MAKE) -C lib all + $(MAKE) -C ccs all + $(MAKE) -C ces all + $(MAKE) -C util all + +clean: + $(MAKE) -C lib clean + $(MAKE) -C ccs clean + $(MAKE) -C ces clean + $(MAKE) -C util clean diff -Nur iconv-base-2.0.orig/GNUmakefile.inc iconv-base-2.0/GNUmakefile.inc --- iconv-base-2.0.orig/GNUmakefile.inc Thu Jan 1 02:00:00 1970 +++ iconv-base-2.0/GNUmakefile.inc Fri Mar 4 21:31:24 2005 @@ -0,0 +1,8 @@ +ICONV_BUILTIN_CHARSETS ?= us-ascii utf-8 ucs-4-internal + +PREFIX ?= /usr + +MODULEDIR ?= ${PREFIX}/libexec/iconv +TABLEDIR ?= ${PREFIX}/share/iconv + +CFLAGS += -I../lib diff -Nur iconv-base-2.0.orig/ccs/GNUmakefile iconv-base-2.0/ccs/GNUmakefile --- iconv-base-2.0.orig/ccs/GNUmakefile Thu Jan 1 02:00:00 1970 +++ iconv-base-2.0/ccs/GNUmakefile Fri Mar 4 21:31:24 2005 @@ -0,0 +1,63 @@ +include ../GNUmakefile.inc + +CHARSETS_C = $(shell ../iconv_builtin -s .c $(ICONV_BUILTIN_CHARSETS) < charset.aliases) +CHARSETS_TBL = $(shell ../iconv_builtin -ns .cct $(ICONV_BUILTIN_CHARSETS) < charset.aliases) + +LIB = ccs +SRCS = ccs_builtin.c ${CHARSETS_C} + +SOBJS = ${SRCS:.c=.So} + +all: ${CHARSETS_TBL} + +lib: lib${LIB}.a ${SOBJS} + +lib${LIB}.a: ${SRCS:.c=.o} + @${AR} cq ${@} ${^} + +ccs_builtin.c: ${CHARSETS_C} + ../iconv_builtin -o ${@} ${<} + +.txt.cct: + ./iconv_mktbl -o ${@} ${<} + +.txt.c: + ./iconv_mktbl -Co ${@} ${<} + +us-ascii.cct: iso-8859-1.txt + ./iconv_mktbl -ao ${@} ${<} + +us-ascii.c: iso-8859-1.txt + ./iconv_mktbl -Cao ${@} ${<} + +jis_x0208-1983.cct: jis_x0208-1983.txt + ./iconv_mktbl -c 1 -u 2 -o ${@} ${<} + +jis_x0208-1983.c: jis_x0208-1983.txt + ./iconv_mktbl -C -c 1 -u 2 -o ${@} ${<} + +cns11643-plane1.cct: cns11643.txt + ./iconv_mktbl -p 0x1 -o ${@} ${<} + +cns11643-plane1.c: cns11643.txt + ./iconv_mktbl -C -p 0x1 -o ${@} ${<} + +cns11643-plane2.cct: cns11643.txt + ./iconv_mktbl -p 0x2 -o ${@} ${<} + +cns11643-plane2.c: cns11643.txt + ./iconv_mktbl -C -p 0x2 -o ${@} ${<} + +cns11643-plane14.cct: cns11643.txt + ./iconv_mktbl -p 0xE -o ${@} ${<} + +cns11643-plane14.c: cns11643.txt + ./iconv_mktbl -C -p 0xE -o ${@} ${<} + +.c.So: + ${CC} -fPIC -DPIC ${CFLAGS} -c ${^} -o ${@} + +clean: + rm -f *.o *.So *.so *.c + +.SUFFIXES: .cct .txt .So diff -Nur iconv-base-2.0.orig/ces/GNUmakefile iconv-base-2.0/ces/GNUmakefile --- iconv-base-2.0.orig/ces/GNUmakefile Thu Jan 1 02:00:00 1970 +++ iconv-base-2.0/ces/GNUmakefile Fri Mar 4 21:31:24 2005 @@ -0,0 +1,35 @@ +include ../GNUmakefile.inc + +CHARSETS_C = $(shell ../iconv_builtin -s .c $(ICONV_BUILTIN_CHARSETS) < charset.aliases) +CHARSETS_SO= $(shell ../iconv_builtin -ns .so $(ICONV_BUILTIN_CHARSETS) < charset.aliases) +CHARSETS_O = $(shell ../iconv_builtin -ns .o $(ICONV_BUILTIN_CHARSETS) < charset.aliases) + +LIB= ces +SRCS= ces_builtin.c ${CHARSETS_C} + +LDADD = -L../lib -liconv + +all: ${CHARSETS_SO} ${SRCS:.c=.So} + +lib: lib${LIB}.a + +lib${LIB}.a: ${SRCS:.c=.o} + @${AR} cq ${@} ${^} + +lib${LIB}_static.a: ${CHARSETS_O} + @${AR} cq ${@} ${^} + +ces_builtin.c: ${CHARSETS_C} ${CHARSETS_O} + ../iconv_builtin -mo ${@} \ + ${CHARSETS_C} PIC ${CHARSETS_O} + +.c.So: + ${CC} -fPIC -DPIC ${CFLAGS} -c ${^} -o ${@} + +.So.so: + ${CC} -shared -Wl,-x -o ${@} -Wl,-soname,${@} ${^} + +clean: + rm -f *.o *.So *.so *.lst ces_builtin.c + +.SUFFIXES: .So .so diff -Nur iconv-base-2.0.orig/lib/GNUmakefile iconv-base-2.0/lib/GNUmakefile --- iconv-base-2.0.orig/lib/GNUmakefile Thu Jan 1 02:00:00 1970 +++ iconv-base-2.0/lib/GNUmakefile Fri Mar 4 21:31:24 2005 @@ -0,0 +1,56 @@ +include ../GNUmakefile.inc + +LIB = iconv +SHLIB_MAJOR = 2 +SHLIB_MINOR = 0 + +SRCS = aliases.c ccs.c ces.c ces_euc.c ces_iso2022.c ces_table.c \ + converter.c iconv.c utils.c + +BUILTIN_CCS = $(shell cd ../ccs/ && $(MAKE) lib >/dev/null && ${AR} t libccs.a) +BUILTIN_CES = $(shell cd ../ces/ && $(MAKE) lib >/dev/null && ${AR} t libces.a) +BUILTIN_CES_STATIC = $(shell cd ../ces && $(MAKE) libces_static.a >/dev/null && ${AR} t libces_static.a) + +OBJS = $(patsubst %,../ccs/%,$(BUILTIN_CCS)) $(patsubst %,../ces/%,$(BUILTIN_CES)) $(SRCS:.c=.o) +STATICOBJS = $(patsubst %,../ces/%,$(BUILTIN_CES_STATIC)) + +SOBJS = ${OBJS:.o=.So} + +LIBDIR = ${PREFIX}/lib + +INCDIR = ${PREFIX}/include +INCS = iconv.h + +CFLAGS += -DICONV_MODULE_PATH=\"${MODULEDIR}\" \ + -DICONV_TABLE_PATH=\"${TABLEDIR}\" + +MAN3 = iconv.3 iconv_open.3 iconv_close.3 + +ALIASES = ../ccs/charset.aliases \ + ../ces/charset.aliases + +all: lib${LIB}.a lib${LIB}.so + +lib${LIB}.a: ${OBJS} ${STATICOBJS} + ${AR} cq ${@} ${^} + +lib${LIB}.so.${SHLIB_MAJOR}: ${SOBJS} + ${CC} ${LDFLAGS} -shared -Wl,-x -o ${@} -Wl,-soname,${@} ${^} + +lib${LIB}.so: lib${LIB}.so.${SHLIB_MAJOR} + ln -s lib${LIB}.so.${SHLIB_MAJOR} lib${LIB}.so + +aliases.c: aliases.h + +aliases.h: ${ALIASES} + cat ${^} | ../iconv_builtin ${BUILTIN_CCS} \ + ${BUILTIN_CES} PIC ${BUILTIN_CES_STATIC} > ${@} + +.c.So: + ${CC} -fPIC -DPIC ${CFLAGS} -c ${^} -o ${@} + +clean: + rm -f ../ccs/libccs.a ../ces/libces*.a *.o *.So + rm -f lib${LIB}.a lib${LIB}.so.${SHLIB_MAJOR} lib${LIB}.so + +.SUFFIXES: .So diff -Nur iconv-base-2.0.orig/util/GNUmakefile iconv-base-2.0/util/GNUmakefile --- iconv-base-2.0.orig/util/GNUmakefile Thu Jan 1 02:00:00 1970 +++ iconv-base-2.0/util/GNUmakefile Fri Mar 4 21:31:24 2005 @@ -0,0 +1,14 @@ +include ../GNUmakefile.inc + +PROG= iconv +SRCS= iconv.c iconv_stream.c + +LDADD= -L../lib/ -liconv -ldl + +all: $(PROG) + +$(PROG): $(SRCS:.c=.o) + $(CC) $(CFLAGS) $(LDFLAGS) -o $(@) $(^) $(LDADD) + +clean: + rm -f *.o iconv geexbox-1.0/packages/iconv-base/patches/20_linux.diff0000644000175000017500000000373710446314262021556 0ustar aurelaureldiff -Nur iconv-base-2.0.orig/ccs/endian.h iconv-base-2.0/ccs/endian.h --- iconv-base-2.0.orig/ccs/endian.h Sun Oct 29 15:45:37 2000 +++ iconv-base-2.0/ccs/endian.h Fri Mar 4 21:31:24 2005 @@ -30,7 +30,11 @@ * iconv (Charset Conversion Library) v2.0 */ +#ifdef __linux__ +#include +#else #include +#endif #if BYTE_ORDER == LITTLE_ENDIAN diff -Nur iconv-base-2.0.orig/lib/ccs.c iconv-base-2.0/lib/ccs.c --- iconv-base-2.0.orig/lib/ccs.c Sun Nov 26 17:16:20 2000 +++ iconv-base-2.0/lib/ccs.c Fri Mar 4 21:31:24 2005 @@ -30,12 +30,20 @@ * iconv (Charset Conversion Library) v2.0 */ +#include +#ifdef __linux__ +#include +#endif #include /* errno */ #include /* PATH_MAX */ #include /* snprintf */ #include /* free, malloc */ #include /* strncmp */ -#include /* ntohl, ntohs */ +#ifdef __linux__ +#include /* ntohl, ntohs */ +#else +#include +#endif #define ICONV_INTERNAL #include /* iconv_ccs */ diff -Nur iconv-base-2.0.orig/lib/ces.c iconv-base-2.0/lib/ces.c --- iconv-base-2.0.orig/lib/ces.c Sun Nov 26 17:16:52 2000 +++ iconv-base-2.0/lib/ces.c Fri Mar 4 21:33:27 2005 @@ -116,7 +116,7 @@ int res; char *pathlist; - if (issetugid() || !(pathlist = getenv("ICONV_MODULE_PATH"))) + if (/*issetugid() || */ !(pathlist = getenv("ICONV_MODULE_PATH"))) pathlist = ICONV_MODULE_PATH; snprintf(file, sizeof(file), "%s.so", name); if (iconv_filesize(pathlist, file, buffer) <= 0) diff -Nur iconv-base-2.0.orig/lib/utils.c iconv-base-2.0/lib/utils.c --- iconv-base-2.0.orig/lib/utils.c Wed Mar 9 15:21:54 2005 +++ iconv-base-2.0/lib/utils.c Wed Mar 9 15:22:02 2005 @@ -84,7 +84,7 @@ if (fd < 0) return NULL; - ptr = (const void *)mmap(NULL, size, PROT_READ, 0, fd, 0); + ptr = (const void *)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); close(fd); if (ptr == MAP_FAILED) return NULL; geexbox-1.0/packages/iconv-base/patches/30_oldperl.diff0000644000175000017500000000067610446314262022060 0ustar aurelaureldiff -Nur iconv-base-2.0.orig/iconv_builtin iconv-base-2.0/iconv_builtin --- iconv-base-2.0.orig/iconv_builtin 2000/12/01 10:15:21 1.1 +++ iconv-base-2.0/iconv_builtin 2000/12/01 10:15:46 @@ -83,7 +83,7 @@ %builtins = map { $pic = 1 if $_ eq 'PIC'; $_ => $pic } @ARGV; while () { - unless (/^([^[:space:]#]+)/) { + unless (/^([^\s#]+)/) { # line continuation or comment print $_ unless $opt_s || !$opt_n || /^#WARNING/; next; geexbox-1.0/packages/iconv-base/patches/40_converter.diff0000644000175000017500000000261310446314262022420 0ustar aurelaureldiff -Nur iconv-base-2.0.orig/lib/converter.c iconv-base-2.0/lib/converter.c --- iconv-base-2.0.orig/lib/converter.c.orig Sun Nov 26 22:10:22 2000 +++ iconv-base-2.0/lib/converter.c Mon Mar 18 19:49:56 2002 @@ -92,14 +92,14 @@ if (ch == UCS_CHAR_NONE) { /* Incomplete character in input buffer */ errno = EINVAL; - return res; + return (size_t)(-1); } if (ch == UCS_CHAR_INVALID) { /* Invalid character in source buffer */ *inbytesleft += *inbuf - ptr; *inbuf = ptr; errno = EILSEQ; - return res; + return (size_t)(-1); } size = ICONV_CES_CONVERT_FROM_UCS(&(uc->to), ch, outbuf, outbytesleft); @@ -116,7 +116,7 @@ *inbytesleft += *inbuf - ptr; *inbuf = ptr; errno = E2BIG; - return res; + return (size_t)(-1); } } return res; @@ -156,14 +156,24 @@ { if (inbuf && *inbuf && inbytesleft && *inbytesleft > 0 && outbuf && *outbuf && outbytesleft && *outbytesleft > 0) { - size_t len = *inbytesleft < *outbytesleft ? *inbytesleft - : *outbytesleft; + size_t result, len; + if (*inbytesleft < *outbytesleft) { + result = 0; + len = *inbytesleft; + } else { + result = (size_t)(-1); + errno = E2BIG; + len = *outbytesleft; + } bcopy(*inbuf, *outbuf, len); *inbuf += len; *inbytesleft -= len; *outbuf += len; *outbytesleft -= len; + + return result; } + return 0; } geexbox-1.0/packages/iconv-base/patches/50_disable-iso2022.diff0000644000175000017500000000075410446314262023117 0ustar aurelaureldiff -Nur iconv-base-2.0.orig/lib/GNUmakefile iconv-base-2.0/lib/GNUmakefile --- iconv-base-2.0.orig/lib/GNUmakefile Sat Mar 12 13:59:11 2005 +++ iconv-base-2.0/lib/GNUmakefile Sat Mar 12 13:59:23 2005 @@ -4,7 +4,7 @@ SHLIB_MAJOR = 2 SHLIB_MINOR = 0 -SRCS = aliases.c ccs.c ces.c ces_euc.c ces_iso2022.c ces_table.c \ +SRCS = aliases.c ccs.c ces.c ces_euc.c ces_table.c \ converter.c iconv.c utils.c BUILTIN_CCS = $(shell cd ../ccs/ && $(MAKE) lib >/dev/null && ${AR} t libccs.a) geexbox-1.0/packages/iconv-base/patches/60-gcc4-fix.diff0000644000175000017500000000670710446314262021745 0ustar aurelaurel+* fix gcc4 compliation - "error: invalid lvalue in increment" diff -Nur iconv-base-2.0.orig/ces/ucs-2-internal.c iconv-base-2.0/ces/ucs-2-internal.c --- iconv-base-2.0.orig/ces/ucs-2-internal.c Sun Nov 26 14:49:53 2000 +++ iconv-base-2.0/ces/ucs-2-internal.c Fri Mar 3 20:27:48 2006 @@ -43,7 +43,8 @@ return -1; /* No corresponding character in UCS-2 */ if (*outbytesleft < sizeof(ucs2_t)) return 0; /* No space in the output buffer */ - *((ucs2_t *)(*outbuf))++ = in; + *((ucs2_t *)(*outbuf)) = in; + *outbuf = (unsigned char *)((ucs2_t *)(*outbuf) + 1); (*outbytesleft) -= sizeof(ucs2_t); return 1; } @@ -52,10 +53,14 @@ convert_to_ucs(struct iconv_ces *ces, const unsigned char **inbuf, size_t *inbytesleft) { + ucs2_t out; + if (*inbytesleft < sizeof(ucs2_t)) return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ (*inbytesleft) -= sizeof(ucs2_t); - return *((const ucs2_t *)(*inbuf))++; + out = *((ucs2_t *)(*inbuf)); + *inbuf = (unsigned char *)((ucs2_t *)(*inbuf) + 1); + return out; } ICONV_CES_STATELESS_MODULE_DECL(ucs_2_internal); diff -Nur iconv-base-2.0.orig/ces/ucs-4-internal.c iconv-base-2.0/ces/ucs-4-internal.c --- iconv-base-2.0.orig/ces/ucs-4-internal.c Sun Nov 26 14:49:59 2000 +++ iconv-base-2.0/ces/ucs-4-internal.c Fri Mar 3 20:28:44 2006 @@ -41,7 +41,8 @@ return 1; /* No state reinitialization for table charsets */ if (*outbytesleft < sizeof(ucs4_t)) return 0; /* No space in the output buffer */ - *((ucs4_t *)(*outbuf))++ = in; + *((ucs4_t *)(*outbuf)) = in; + *outbuf = (unsigned char *)((ucs4_t *)(*outbuf) + 1); (*outbytesleft) -= sizeof(ucs4_t); return 1; } @@ -50,10 +51,14 @@ convert_to_ucs(struct iconv_ces *ces, const unsigned char **inbuf, size_t *inbytesleft) { + ucs4_t out; + if (*inbytesleft < sizeof(ucs4_t)) return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */ (*inbytesleft) -= sizeof(ucs4_t); - return *((const ucs4_t *)(*inbuf))++; + out = *((ucs4_t *)(*inbuf)); + *inbuf = (unsigned char *)((ucs4_t *)(*inbuf) + 1); + return out; } ICONV_CES_STATELESS_MODULE_DECL(ucs_4_internal); diff -Nur iconv-base-2.0.orig/lib/ces_euc.c iconv-base-2.0/lib/ces_euc.c --- iconv-base-2.0.orig/lib/ces_euc.c Sat Nov 18 22:21:43 2000 +++ iconv-base-2.0/lib/ces_euc.c Fri Mar 3 20:32:31 2006 @@ -65,7 +65,7 @@ } } state->nccs = num; - (iconv_ces_euc_state *)*data = state; + *data = state; return 0; } diff -Nur iconv-base-2.0.orig/lib/ces_table.c iconv-base-2.0/lib/ces_table.c --- iconv-base-2.0.orig/lib/ces_table.c Sun Nov 26 14:01:25 2000 +++ iconv-base-2.0/lib/ces_table.c Fri Mar 3 20:32:44 2006 @@ -47,7 +47,7 @@ if (res) free(ccs); else - (struct iconv_ccs *)(*data) = ccs; + *data = ccs; return res; } diff -Nur iconv-base-2.0.orig/util/iconv_stream.c iconv-base-2.0/util/iconv_stream.c --- iconv-base-2.0.orig/util/iconv_stream.c Sun Sep 3 22:38:36 2000 +++ iconv-base-2.0/util/iconv_stream.c Fri Mar 3 20:33:41 2006 @@ -114,7 +114,7 @@ if (left > size) left = size; memcpy(stream->buf_ptr, buf, left); - (const char *)buf += left; + buf = (const char *)buf + left; size -= left; stream->buf_ptr += left; res = iconv_write(handle, stream->buffer, @@ -141,7 +141,7 @@ return -1; res = 0; } - (const char *)buf += res; + buf = (const char *)buf + res; size -= res; } while (size && res); if (!size) geexbox-1.0/packages/iconv-base/url0000644000175000017500000000004410446314262016346 0ustar aurelaurelGEEXBOX_SRCS/iconv-base-2.0.tar.bz2 geexbox-1.0/packages/iconv-extra/0000755000175000017500000000000010446314262016034 5ustar aurelaurelgeexbox-1.0/packages/iconv-extra/build0000755000175000017500000000062510446314262017064 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build iconv-base cd $BUILD/$1* make all grep -v '#' ccs/charset.aliases | cut -f 1 | while read i; do echo "$i $i.cct" >> charset.db done grep -v '#' ces/charset.aliases | cut -f 1 | while read i; do echo "$i $i.so" >> charset.db grep '{"' ces/$i.c | cut -d '"' -f 2 | while read j; do echo "$i $j.cct" >> charset.db done done geexbox-1.0/packages/iconv-extra/patches/0000755000175000017500000000000010446314262017463 5ustar aurelaurelgeexbox-1.0/packages/iconv-extra/patches/10_GNUmakefiles.diff0000644000175000017500000000567710446314262023146 0ustar aurelaureldiff -Nur iconv-extra-2.0.orig/GNUmakefile iconv-extra-2.0/GNUmakefile --- iconv-extra-2.0.orig/GNUmakefile Thu Jan 1 02:00:00 1970 +++ iconv-extra-2.0/GNUmakefile Fri Mar 4 22:49:27 2005 @@ -0,0 +1,7 @@ +all: + $(MAKE) -C ccs all + $(MAKE) -C ces all + +clean: + $(MAKE) -C ccs clean + $(MAKE) -C ces clean diff -Nur iconv-extra-2.0.orig/ccs/GNUmakefile iconv-extra-2.0/ccs/GNUmakefile --- iconv-extra-2.0.orig/ccs/GNUmakefile Thu Jan 1 02:00:00 1970 +++ iconv-extra-2.0/ccs/GNUmakefile Fri Mar 4 22:51:32 2005 @@ -0,0 +1,64 @@ +CHARSETS_TBL = iso-8859-3.cct iso-8859-6.cct iso-8859-7.cct iso-8859-8.cct \ + iso-8859-9.cct iso-8859-10.cct iso-8859-13.cct iso-8859-14.cct \ + koi8-ru.cct gb12345.cct johab.cct adobe-stdenc.cct \ + adobe-symbol.cct adobe-zdingbats.cct mac-ce.cct \ + mac-croatian.cct mac-cyrillic.cct mac-dingbats.cct \ + mac-greek.cct mac-iceland.cct mac-japan.cct mac-roman.cct \ + mac-romania.cct mac-thai.cct mac-turkish.cct mac-ukraine.cct \ + cp424.cct cp500.cct cp856.cct cp1006.cct cp437.cct cp737.cct \ + cp857.cct cp860.cct cp861.cct cp862.cct cp863.cct cp864.cct \ + cp865.cct cp869.cct cp874.cct cp932.cct cp936.cct cp949.cct \ + cp950.cct windows-1250.cct windows-1251.cct windows-1252.cct \ + windows-1253.cct windows-1254.cct windows-1255.cct \ + windows-1256.cct windows-1257.cct windows-1258.cct cp037.cct \ + cp875.cct cp1026.cct cp10000.cct cp10006.cct cp10007.cct \ + cp10029.cct cp10079.cct cp10081.cct + +all: ${CHARSETS_TBL} + +.txt.cct: + iconv_mktbl -o ${@} ${<} + +adobe-stdenc.cct: adobe-stdenc.txt + iconv_mktbl -p '' -c 1 -u 0 -o ${@} ${<} + +adobe-symbol.cct: adobe-symbol.txt + iconv_mktbl -p '' -c 1 -u 0 -o ${@} ${<} + +adobe-zdingbats.cct: adobe-zdingbats.txt + iconv_mktbl -p '' -c 1 -u 0 -o ${@} ${<} + +mac-ce.cct: mac-ce.txt + iconv_mktbl -Mo ${@} ${<} + +mac-croatian.cct: mac-croatian.txt + iconv_mktbl -Mo ${@} ${<} + +mac-cyrillic.cct: mac-cyrillic.txt + iconv_mktbl -Mo ${@} ${<} + +mac-dingbats.cct: mac-dingbats.txt + iconv_mktbl -Mo ${@} ${<} + +mac-greek.cct: mac-greek.txt + iconv_mktbl -Mo ${@} ${<} + +mac-iceland.cct: mac-iceland.txt + iconv_mktbl -Mo ${@} ${<} + +mac-roman.cct: mac-roman.txt + iconv_mktbl -Mo ${@} ${<} + +mac-romania.cct: mac-romania.txt + iconv_mktbl -Mo ${@} ${<} + +mac-thai.cct: mac-thai.txt + iconv_mktbl -Mo ${@} ${<} + +mac-turkish.cct: mac-turkish.txt + iconv_mktbl -Mo ${@} ${<} + +mac-ukraine.cct: mac-ukraine.txt + iconv_mktbl -Mo ${@} ${<} + +.SUFFIXES: .cct .txt diff -Nur iconv-extra-2.0.orig/ces/GNUmakefile iconv-extra-2.0/ces/GNUmakefile --- iconv-extra-2.0.orig/ces/GNUmakefile Thu Jan 1 02:00:00 1970 +++ iconv-extra-2.0/ces/GNUmakefile Fri Mar 4 22:51:06 2005 @@ -0,0 +1,15 @@ +CHARSETS_SO = unicode-1-1-utf-7.so iso-2022-cn.so iso-2022-jp.so \ + iso-2022-jp-2.so iso-2022-kr.so + +all: ${CHARSETS_SO} + +.c.So: + ${CC} -fPIC -DPIC ${CFLAGS} -c ${^} -o ${@} + +.So.so: + @${CC} -shared -Wl,-x -o ${@} -Wl,-soname,${@} ${^} + +clean: + rm -f *.So *.so + +.SUFFIXES: .so .So geexbox-1.0/packages/iconv-extra/patches/20_gcc4-fix.diff0000644000175000017500000000212110446314262022216 0ustar aurelaurel+* fix gcc4 compliation - "error: invalid lvalue in increment" diff -Nur iconv-extra-2.0.orig/ces/unicode-1-1-utf-7.c iconv-extra-2.0/ces/unicode-1-1-utf-7.c --- iconv-extra-2.0.orig/ces/unicode-1-1-utf-7.c Tue Nov 21 00:41:22 2000 +++ iconv-extra-2.0/ces/unicode-1-1-utf-7.c Fri Mar 3 20:46:49 2006 @@ -230,7 +230,7 @@ if (*inbytesleft < 2) return UCS_CHAR_NONE; needbytes = 1; - ch = char_type(*(++((unsigned char *)*inbuf))); + ch = char_type(*(++(*inbuf))); (*inbytesleft) --; case utf7_printable: utf7_state[0] = 0; @@ -246,7 +246,7 @@ (*inbytesleft) += needbytes; return UCS_CHAR_NONE; } - switch (char_type(*(++(unsigned char *)*inbuf))) { + switch (char_type(*(++(*inbuf)))) { case utf7_shift_out: (*inbuf) ++; (*inbytesleft) -= 2; @@ -264,7 +264,7 @@ return UCS_CHAR_INVALID; } (*inbytesleft) --; - return *((unsigned char *)*inbuf) ++; + return *((*inbuf)++); #undef utf7_state } geexbox-1.0/packages/iconv-extra/url0000644000175000017500000000004510446314262016560 0ustar aurelaurelGEEXBOX_SRCS/iconv-extra-2.0.tar.bz2 geexbox-1.0/packages/initrd/0000755000175000017500000000000010446314263015067 5ustar aurelaurelgeexbox-1.0/packages/initrd/build0000755000175000017500000000126010446314262016112 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build genext2fs export INSTALL=$BUILD/$1/mnt rm -rf $INSTALL mkdir -p $INSTALL rm -f $BUILD/$1/$1 $BUILD/$1/$1.gz mkdir $INSTALL/bin mkdir $INSTALL/etc mkdir $INSTALL/ramfs mkdir $INSTALL/sbin mkdir $INSTALL/usr mkdir $INSTALL/usr/bin $SCRIPTS/install uClibc $SCRIPTS/install busybox $SCRIPTS/install udev $SCRIPTS/install iscd cp $PACKAGES/$1/scripts/linuxrc $INSTALL cp $PACKAGES/$1/scripts/console $INSTALL/sbin cp $PACKAGES/$1/scripts/nosystem $INSTALL/sbin cp $PACKAGES/$1/scripts/r[ow] $INSTALL/usr/bin ln -s /bin/busybox $INSTALL/bin/sh $BUILD/genext2fs*/genext2fs -d $INSTALL -b $RAMDISK_SIZE -i 512 $BUILD/$1/$1 gzip -9 $BUILD/$1/$1 geexbox-1.0/packages/initrd/config/0000755000175000017500000000000010446314262016333 5ustar aurelaurelgeexbox-1.0/packages/initrd/install0000755000175000017500000000065010446314263016464 0ustar aurelaurel#!/bin/sh . config/options test "$2" != installator && INSTALL="$INSTALL/boot" mkdir -p $INSTALL cp $BUILD/$1/$1.gz $INSTALL if [ "$2" != generator ]; then $SCRIPTS/build bootsplash $SCRIPTS/build theme-$THEME splashdat=$BUILD/theme-$THEME/bootsplash-$RESOLUTION.dat [ ! -f $splashdat ] && echo "Theme $THEME does not support resolution $RESOLUTION" && exit 1 cat $splashdat >> $ROOT/$INSTALL/$1.gz fi exit 0 geexbox-1.0/packages/initrd/need_build0000755000175000017500000000063610446314263017114 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build uClibc $SCRIPTS/build busybox $SCRIPTS/build udev $SCRIPTS/build iscd STAMP=$STAMPS/$1/build for p in uClibc busybox udev iscd; do test $STAMPS/$p/build -nt $STAMP && rm -f $STAMP done test $PACKAGES/initrd/config/dev -nt $STAMP && rm -f $STAMP for f in console linuxrc nosystem ro rw; do test $PACKAGES/initrd/scripts/$f -nt $STAMP && rm -f $STAMP done exit 0 geexbox-1.0/packages/initrd/scripts/0000755000175000017500000000000010446314263016556 5ustar aurelaurelgeexbox-1.0/packages/initrd/scripts/console0000755000175000017500000000026410446314263020150 0ustar aurelaurel#!/bin/sh /bin/busybox test ! -e /proc/cpuinfo && /bin/busybox mount -t proc none /proc /bin/busybox test ! -e /bin/cp && /bin/busybox --install -s while true; do /bin/sh done geexbox-1.0/packages/initrd/scripts/linuxrc0000755000175000017500000000716710446314263020203 0ustar aurelaurel#!/bin/sh busybox mount -t ramfs none /ramfs IFS=' ' for i in `busybox find /`; do if busybox test -d $i; then busybox mkdir -p /ramfs$i else busybox ln -s /initrd$i /ramfs$i fi done busybox mkdir /ramfs/initrd busybox pivot_root /ramfs /ramfs/initrd busybox mkdir -p /proc /sys /usr/bin /usr/sbin busybox mount -t proc none /proc busybox mount -t sysfs none /sys busybox --install -s echo geexbox > /proc/sys/kernel/hostname echo 0 > /proc/sys/dev/cdrom/autoclose echo 0 > /proc/sys/dev/cdrom/lock export PATH=/bin:/sbin:/usr/bin:/usr/sbin progress() { if test -f /proc/splash; then echo "show $1" > /proc/splash fi echo "### $2 ###" } progress 8000 "setting up ramfs tree" mkdir -p /dev mkdir -p /mnt mkdir -p /tmp mkdir -p /var/run mkdir -p /var/log mkdir -p /var/lock echo -n "" > /etc/mtab echo -n "" > /etc/fstab echo -n "" > /etc/mnts echo > /proc/sys/kernel/hotplug udevd --daemon udevstart grep -q installator /proc/cmdline && INSTALLATOR=yes grep -q debugging /proc/cmdline && DEBUG=yes BOOT=`sed 's/.*boot=\([^\ ]*\).*/\1/' /proc/cmdline` if test "$BOOT" = nfs; then progress 11000 "getting nfs tree" NFS=`sed 's/.*nfsroot=\([^\ ]*\).*/\1/' /proc/cmdline` GEEXBOX=/nfs mkdir -p $GEEXBOX udhcpc -q -H geexbox -n && mount -t nfs -o ro,nolock,nfsvers=2 $NFS $GEEXBOX if [ ! -f "$GEEXBOX/bin.tar.lzma" ]; then umount $GEEXBOX rmdir $GEEXBOX GEEXBOX= fi fi progress 12000 "searching cdrom drives" if [ "$BOOT" = cdrom ]; then for i in 0 1 2 3 4; do for DEV in `grep '^/dev/cdrom' /etc/mnts | cut -f1`; do CDROM=`grep "^$DEV " /etc/mnts | cut -f2-` if [ -d "$CDROM/GEEXBOX" ]; then GEEXBOX="$CDROM/GEEXBOX" ln -s "$DEV" /dev/cdrom break fi done [ -n "$GEEXBOX" ] && break sleep 1 done fi [ ! -e /dev/cdrom -a -b /dev/cdrom1 ] && ln -s /dev/cdrom1 /dev/cdrom if [ "$BOOT" != cdrom -a "$BOOT" != nfs ]; then if [ "$INSTALLATOR" != yes ]; then progress 17000 "boot device detection" for i in 0 1 2 3 4 5 6 7 8 9; do [ -z "$BOOTDISK" ] && BOOTDISK=`cd /dev; ls -l $BOOT | sed 's/.* \([^ ]*\)$/\1/'` [ -n "$BOOTDISK" ] && grep -q "^/dev/$BOOTDISK " /proc/mounts && break sleep 1 done for DEV in `grep '^/dev/disk' /etc/mnts | cut -f1`; do DIR=`grep "^$DEV " /etc/mnts | cut -f2-` if [ -d "$DIR/GEEXBOX" ]; then GEEXBOX="$DIR/GEEXBOX" [ "/dev/$BOOTDISK" = "$DEV" ] && break fi done fi fi if test -n "$GEEXBOX" ; then progress 25000 "copying system into ram" cp -a "$GEEXBOX/sbin" / progress 27000 "copying system into ram" cp -a "$GEEXBOX/etc" / progress 29000 "copying system into ram" cp -a "$GEEXBOX/usr" / progress 30500 "copying system into ram" cp -a "$GEEXBOX/var" / progress 31000 "copying system into ram" tar xaf "$GEEXBOX/bin.tar.lzma" -C / progress 42000 "copying system into ram" cp -a "$GEEXBOX/codecs" / progress 45000 "copying system into ram" cp -a "$GEEXBOX/firmwares" / progress 46000 "copying system into ram" INIT=/sbin/init else INIT=/sbin/nosystem progress 65535 "cleaning ram disk" fi if test "$BOOT" = nfs; then if test "$INSTALLATOR" = yes; then export NFS="$GEEXBOX" elif test -n "$GEEXBOX"; then umount "$GEEXBOX" fi fi if test "$BOOT" = cdrom; then export CDROM="${GEEXBOX%/GEEXBOX}" fi RUNLEVEL="geexbox" if test "$INSTALLATOR" = yes; then RUNLEVEL="install" elif test "$DEBUG" = yes; then RUNLEVEL="debug" fi if test "$DEBUG" = yes; then /sbin/console /dev/tty2 2>&1 & fi /bin/sh $INIT $RUNLEVEL /dev/tty1 2>&1 if test "$INSTALLATOR" = yes -o $? = 64; then reboot else poweroff fi geexbox-1.0/packages/initrd/scripts/nosystem0000755000175000017500000000050510446314263020365 0ustar aurelaurel#!/bin/sh /bin/busybox test ! -e /proc/cpuinfo && /bin/busybox mount -t proc none /proc /bin/busybox test ! -e /bin/cp && /bin/busybox --install -s echo "****" echo "**** ERROR: can't access GeeXboX second stage system !" echo "**** If booting from CD your CD drive is probably not recognized" echo "****" /bin/sh exit 1 geexbox-1.0/packages/initrd/scripts/ro0000755000175000017500000000003710446314263017124 0ustar aurelaurel#!/bin/sh /usr/bin/rw "$1" ro geexbox-1.0/packages/initrd/scripts/rw0000755000175000017500000000145410446314263017140 0ustar aurelaurel#!/bin/sh if [ "${1#/mnt/}" != "$1" ]; then DEV= for TMPDEV in `cut -f1 /etc/mnts`; do MNT=`grep "^$TMPDEV " /etc/mnts | cut -f2-` if [ "${1#$MNT}" != "$1" ]; then DEV=$TMPDEV break fi done [ -z "$DEV" ] && exit 1 if [ "$2" = ro ]; then COUNT=`sed -n "s%\([0-9]*\)\ $DEV%\1%p" /var/rw` [ "$COUNT" -lt "1" ] && exit 1 [ "$COUNT" -eq "1" ] && mount -o remount,ro "$DEV" "$MNT" COUNT=$(($COUNT-1)) sed -i "s%[0-9]*\ $DEV%$COUNT $DEV%" /var/rw else [ -f /var/rw ] && COUNT=`sed -n "s%\([0-9]*\)\ $DEV%\1%p" /var/rw` [ -z "$COUNT" -o "$COUNT" -le "0" ] && mount -o remount,rw "$DEV" "$MNT" if [ -z "$COUNT" ]; then echo "1 $DEV" >> /var/rw else COUNT=$(($COUNT+1)) sed -i "s%[0-9]*\ $DEV%$COUNT $DEV%" /var/rw fi fi fi geexbox-1.0/packages/installator/0000755000175000017500000000000010446314263016132 5ustar aurelaurelgeexbox-1.0/packages/installator/init.d/0000755000175000017500000000000010446314263017317 5ustar aurelaurelgeexbox-1.0/packages/installator/init.d/82_install0000755000175000017500000000017710446314263021231 0ustar aurelaurel#!/bin/sh # # start GeeXboX installator # # runlevels: install export UID=0 sleep 3 /bin/sh /sbin/installator geexbox exit 0 geexbox-1.0/packages/installator/install0000755000175000017500000000050710446314263017530 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/sbin cp $PACKAGES/$1/scripts/$1.sh $INSTALL/sbin/$1 sed -i "s/VERSION=.*/VERSION=$GEEXBOX_VERSION/" $INSTALL/sbin/$1 $SCRIPTS/install ncurses $SCRIPTS/install dialog $SCRIPTS/install util-linux $SCRIPTS/install dosfstools $SCRIPTS/install grub $2 $SCRIPTS/install syslinux binary geexbox-1.0/packages/installator/scripts/0000755000175000017500000000000010446314263017621 5ustar aurelaurelgeexbox-1.0/packages/installator/scripts/installator.sh0000755000175000017500000007562610446314263022534 0ustar aurelaurel#!/bin/sh # Detect whether partition ($1) mounted at ($2) with type ($3) is microsoft. detect_os_microsoft () { local longname if [ "$3" != ntfs -a "$3" != vfat -a "$3" != msdos ]; then return fi if [ -e "$2/ntldr" -a -e "$2/NTDETECT.COM" ]; then longname="Windows NT/2000/XP" elif [ -e "$2/windows/win.com" ]; then longname="Windows 95/98/Me" elif [ -d "$2/dos" ]; then longname="MS-DOS 5.x/6.x/Win3.1" else return fi echo "$1:$longname:chain" } detect_os () { local partname partition type mpoint mkdir -p tmpmnt for partname in `sed -n "s/\ *[0-9][0-9]*\ *[0-9][0-9]*\ *[0-9][0-9][0-9]*\ \([a-z]*[0-9][0-9]*\)/\1/p" /proc/partitions`; do partition="/dev/$partname" if ! grep -q "^$partition " /proc/mounts; then if mount -o ro $partition tmpmnt >/dev/null 2>&1; then type=$(grep "^$partition " /proc/mounts | cut -d " " -f 3) detect_os_microsoft $partition tmpmnt $type umount tmpmnt >/dev/null || return fi else mpoint=$(grep "^$partition " /proc/mounts | cut -d " " -f 2) type=$(grep "^$partition " /proc/mounts | cut -d " " -f 3) detect_os_microsoft $partition $mpoint $type fi done rmdir tmpmnt } # Usage: convert os_device # Convert an OS device to the corresponding GRUB drive. # This part is OS-specific. # -- taken from `grub-install` convert () { local tmp_drive tmp_disk tmp_part if test ! -e "$1"; then echo "$1: Not found or not a block device." 1>&2 exit 1 fi tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%'` tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%'` tmp_drive=`grep -v '^#' $device_map | grep "$tmp_disk *$" \ | sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%'` if [ -z "$tmp_drive" ]; then echo "$1 does not have any corresponding BIOS drive." 1>&2 exit 1 fi if [ -n "$tmp_part" ]; then # If a partition is specified, we need to translate it into the # GRUB's syntax. echo "$tmp_drive" | sed "s%)$%,$(($tmp_part-1)))%" else # If no partition is specified, just print the drive name. echo "$tmp_drive" fi } # Configure network interface and parameters before installing GeeXboX to disk. setup_network () { local title phy_type wifi_mode wep essid host_ip subnet gw_ip dns_ip smb_user smb_pwd val f title="$BACKTITLE : Network Configuration" f="$1/etc/network" # Get type of physical interface val=`grep PHY_TYPE $f | cut -d'"' -f2` phy_type=`$DIALOG --no-cancel --aspect 15 --default-item $val --stdout --backtitle "$title" --title "Network Physical Interface" --menu "\nGeeXboX can only use one network physical interface at a time. If you have more than one NIC, GeeXboX will use the first one. If you have both a traditional Ethernet adapter and a Wireless card, GeeXboX will use the wireless card by default. It is recommended to keep physical interface auto-detection but you may also want to force the use of one kind of interface.\n" 0 0 0 auto "Auto detection (recommended)" ethernet "Force using Ethernet card" wifi "Force using Wireless card"` || exit 1 # Get wireless settings only if required if [ $phy_type = "auto" -o $phy_type = "wifi" ]; then wifi_mode=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "Configuring WiFi Mode" --menu "\nAs you seem to be using your wireless adapter to connect this computer to your network, you will have to setup the networking mode.\n Are you connected to an access point (recommended) or directly to another computer ?\n" 0 0 0 managed "Connected to an access point (recommended)" ad-hoc "Direct Connection"` || exit 1 val=`grep WIFI_WEP $f | cut -d'"' -f2` wep=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "Configuring WEP key" --inputbox "\nAs you seem to be using your wireless adapter to connect this computer to your network, you may be using a WEP key. If so, please fill in the following input box with your access point WEP key or let it blank if you do not have one (open network).\n" 0 0 "$val"` || exit 1 val=`grep WIFI_ESSID $f | cut -d'"' -f2` essid=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "Configuring WiFi ESSID" --inputbox "\nAs you seem to be using your wireless adapter to connect this computer to your network, you probably are using an SSID. If so, please fill in the following input box with your SSID identifier or leave it blank if you do not have one (open network).\n" 0 0 "$val"` || exit 1 fi # get GeeXboX IP address val=`grep HOST $f | cut -d'"' -f2` host_ip=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "GeeXboX IP" --inputbox "\nGeeXboX needs to be allocated an IP address to be present on your network. Please fill in the following input box or leave it as it is for using DHCP autoconfiguration\n" 0 0 "$val"` || exit 1 # do not get more settings if DHCP if [ ! -z $host_ip ]; then val=`grep SUBNET $f | cut -d'"' -f2` subnet=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "GeeXboX Subnet" --inputbox "\nYou may want to connect GeeXboX to the Internet. Please fill in the following input box with your network Subnet mask or leave it blank if you do not want to set a subnet mask for this computer.\n" 0 0 "$val"` || exit 1 val=`grep GATEWAY $f | cut -d'"' -f2` gw_ip=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "GeeXboX GateWay" --inputbox "\nYou may want to connect GeeXboX to the Internet. Please fill in the following input box with your gateway IP address or leave it blank if you do not want to set a gateway for this computer.\n" 0 0 "$val"` || exit 1 val=`grep DNS_SERVER $f | cut -d'"' -f2` dns_ip=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "GeeXboX DNS Server" --inputbox "\nYou may want to connect GeeXboX to the Internet. Please fill in the following input box with your DNS Server IP address used for name resolving or leave it blank if you do not want to resolve names with this computer.\n" 0 0 "$val"` || exit 1 fi # get samba user name val=`grep SMB_USER $f | cut -d'"' -f2` smb_user=`$DIALOG --no-cancel --stdout --backtitle "$title" --title "Set Samba User name" --inputbox "\nWhen accessing to remote Samba shares, you may need to be authenticated. Most of Microsoft Windows computers let you anonymously access to remote shares using the guest account (SHARE). Please fill in the following input box with your user name for accesing to remote Samba shares or leave it blank if you do not have one.\n" 0 0 "$val"` || exit 1 # get samba password val=`grep SMB_PWD $f | cut -d'"' -f2` smb_pwd=`$DIALOG --no-cancel --stdout --backtitle "$title" --title "Set Samba Password" --inputbox "\nIf user needs to be authenticated through a password, please fill in the following input box with it or leave it blank if you do not have one.\n" 0 0 "$val"` || exit 1 sed -i "s%^PHY_TYPE=\".*\"\(.*\)%PHY_TYPE=\"$phy_type\"\1%" $f sed -i "s%^WIFI_MODE=\".*\"\(.*\)%WIFI_MODE=\"$wifi_mode\"\1%" $f sed -i "s%^WIFI_WEP=\".*\"\(.*\)%WIFI_WEP=\"$wep\"\1%" $f sed -i "s%^WIFI_ESSID=\".*\"\(.*\)%WIFI_ESSID=\"$essid\"\1%" $f sed -i "s%^HOST=.*%HOST=\"$host_ip\"%" $f sed -i "s%^SUBNET=.*%SUBNET=\"$subnet\"%" $f sed -i "s%^GATEWAY=.*%GATEWAY=\"$gw_ip\"%" $f sed -i "s%^DNS_SERVER=.*%DNS_SERVER=\"$dns_ip\"%" $f sed -i "s%^SMB_USER=.*%SMB_USER=\"$smb_user\"%" $f sed -i "s%^SMB_PWD=.*%SMB_PWD=\"$smb_pwd\"%" $f } # Configure TV card and scan for channels. setup_tvscan () { MPTVSCAN=/usr/bin/mptvscan title="$BACKTITLE : Analog TV Channels Scanner" for i in `$MPTVSCAN -i`; do INPUTS="$INPUTS $i ''" done for i in `$MPTVSCAN -s`; do NORMS="$NORMS $i ''" done for i in `$MPTVSCAN -c`; do CHANLISTS="$CHANLISTS $i ''" done while [ -z "$DONE" ]; do INPUT=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "TV Input Selection" --menu "\nBelow is the list of your TV card's available inputs. Please select the one you want to use for channels scan (should be Television)." 0 0 0 $INPUTS` NORM=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "TV Norm Selection" --menu "\nBelow is the list of your TV card's supported video standards. Please select the one you want to use, according to your localization." 0 0 0 $NORMS` CHANLIST=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "TV Chanlist Selection" --menu "\nBelow is the list of pre-configured chanlists for scan. Select the one corresponding to your location." 0 0 0 $CHANLISTS` $MPTVSCAN -a "-i$INPUT" "-s$NORM" "-c$CHANLIST" -p 2>/tmp/chans | $DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "Scanning Channels" --gauge "\nGeeXboX is currently scanning your channels. This operation may take a while. Please wait while processing ..." 0 0 CHANNELS=`sed -e 's/CHAN=//g' -e 's/:/ - /g' -e 's/\"//g' -e 's/$/\\\\n/g' /tmp/chans` $DIALOG --aspect 12 --stdout --yes-label "Accept" --no-label "Retry" --backtitle "$title" --title "Scan Done ..." --yesno "\nCongratulations, the TV channels scan is done. The following channels has been discoverd (if no channel has been found, you can then try again with new card/tuner/norm/chanlist settings).\n\n$CHANNELS" 0 0 && DONE=true done if [ -s /tmp/chans ]; then cat /tmp/chans >> $1/etc/tvcard fi rm -f /tmp/chans sed -i "s/^TVIN_STANDARD=.*/TVIN_STANDARD=$NORM/" $1/etc/tvcard sed -i "s/^CHANLIST=.*/CHANLIST=$CHANLIST/" $1/etc/tvcard } # Configure DVB card and scan for channels. setup_dvbscan () { DVB_LIST=/usr/share/dvb DVB_FILE=/usr/share/dvb.tar.lzma DVBSCAN=/usr/bin/dvbscan SCAN_ARGS="-x 0" # Scan FreeToAir channels only TITLE="$BACKTITLE : Digital TV Channels Scanner" CHANNELS_CONF="$1/etc/mplayer/channels.conf" if [ -f $DVB_FILE -a ! -d $DVB_LIST ]; then tar xaf $DVB_FILE -C /usr/share fi DVB_TYPE=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$TITLE" --title "DVB Card Type Selection" --menu "\nBelow is the list of available DVB card types. Please select the one you want to use for channels scan." 0 0 0 dvb-s "DVB Sattelite" dvb-t "DVB Terrestrial" dvb-c "DVB Cable" atsc "ATSC (US)"` # DVB Terrestrial cards if [ $DVB_TYPE = "dvb-t" ]; then for i in `ls $DVB_LIST/$DVB_TYPE`; do COUNTRIES="$COUNTRIES $i ''" done COUNTRY=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$TITLE" --title "Country Selection" --menu "\nBelow is the list of countries with known DVB-T transponders frequencies. Please select the one where you live." 0 0 0 $COUNTRIES` for i in `ls $DVB_LIST/$DVB_TYPE/$COUNTRY`; do CITIES="$CITIES $i ''" done CITY=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$TITLE" --title "City Selection" --menu "\nBelow is the list of locations from your country with known DVB-T transponders frequencies. If you live in place not present in this list, please contact your DVB provider, asking for your local transponders frequencies and send this information to the LinuxTV (http://www.linuxtv.org/) team. Otherwise, simply choose the town nearest to where you live." 0 0 0 $CITIES` $DVBSCAN $SCAN_ARGS $DVB_LIST/$DVB_TYPE/$COUNTRY/$CITY > $CHANNELS_CONF elif [ $DVB_TYPE = "dvb-s" ]; then for i in `ls $DVB_LIST/$DVB_TYPE`; do SATS="$SATS $i ''" done SAT=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$TITLE" --title "Satellite Selection" --menu "\nBelow is the list of known DVB-S satellite transponders you may be able to be connected to. If you are using another transponder which is not present in this list, please contact your DVB provider, asking for your transponder frequencies and send this information to the LinuxTV (http://www.linuxtv.org/) team. Otherwise, simply choose the one that fits your needs." 0 0 0 $SATS` $DVBSCAN $SCAN_ARGS $DVB_LIST/$DVB_TYPE/$SAT > $CHANNELS_CONF elif [ $DVB_TYPE = "dvb-c" ]; then for i in `ls $DVB_LIST/$DVB_TYPE`; do COUNTRIES="$COUNTRIES $i ''" done COUNTRY=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$TITLE" --title "Country Selection" --menu "\nBelow is the list of countries with known DVB-C transponders frequencies. Please select the one where you live." 0 0 0 $COUNTRIES` for i in `ls $DVB_LIST/$DVB_TYPE/$COUNTRY`; do CITIES="$CITIES $i ''" done CITY=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$TITLE" --title "City Selection" --menu "\nBelow is the list of locations from your country with known DVB-C transponders frequencies. If you live in place not present in this list, please contact your DVB provider, asking for your local transponders frequencies and send this information to the LinuxTV (http://www.linuxtv.org/) team. Otherwise, simply choose the town nearest to the place you live." 0 0 0 $CITIES` $DVBSCAN $SCAN_ARGS $DVB_LIST/$DVB_TYPE/$COUNTRY/$CITY > $CHANNELS_CONF elif [ $DVB_TYPE = "atsc" ]; then for i in `ls $DVB_LIST/$DVB_TYPE`; do ATSC="$ATSC $i ''" done FREQ=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$TITLE" --title "ATSC Transponder Selection" --menu "\nBelow is the list of known ATSC transponders you may be able to be connected to. If you are using another transponder which is not present in this list, please contact your ATSC provider, asking for your transponder frequencies and send this information to the LinuxTV (http://www.linuxtv.org/) team. Otherwise, simply choose the one that fits your needs." 0 0 0 $ATSC` $DVBSCAN $SCAN_ARGS $DVB_LIST/$DVB_TYPE/$FREQ > $CHANNELS_CONF fi if [ -s $CHANNELS_CONF ]; then # remove non-coherent detected channels grep -v "^\[.*\]:" $CHANNELS_CONF > /tmp/channels.conf mv /tmp/channels.conf $CHANNELS_CONF fi } # Configure recorder settings (recording path and encoding profile) setup_recorder () { title="$BACKTITLE : Recorder Configuration" f="$1/etc/recorder" mencoder_cfg="$1/etc/mplayer/mencoder.conf" . $f $DIALOG --aspect 12 --stdout --backtitle "$title" --title "Recording Capabilities (EXPERIMENTAL) ..." --yesno "\nGeeXboX allows you to record different kinds of media (TV, DVB, NetStreams ...) to disk, according to various encoding profiles (MPEG 1/2, DVD ...). You may want to use this feature and thus, need to specify an HDD location where to save the records.\n\nWARNING: This is an _EXPERIMENTAL_ feature. Be aware that your HDD will be mounted R/W while recording streams to it, leading to a potential risk of disk data corruption.\n\nWould you still configure GeeXboX recording capabilities ?\n" 0 0 || return # get list of encoding profiles for profile in `grep "^\[" $mencoder_cfg | grep -v common | grep -v dump | sed -e 's/\[//' -e 's/\]//'`; do profiles="$profiles $profile ''" done while [ -z "$DONE" ]; do # choose the encoding profile p=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "Recorder default encoding profile" --menu "\nGeeXboX lets you record video streams through various encoding profiles. They may vary in terms of encoding speed and quality. It is possible to choose one over an other at runtime through the GeeXboX recorder menu. Please choose the encoding profile you want to use as a default.\n" 0 0 0 $profiles` || exit 1 record_path=`$DIALOG --no-cancel --aspect 15 --stdout --backtitle "$title" --title "Recordings location" --inputbox "\nPlease type in the location where you want recordings to be saved to. Please note that the corresponding device (HDD) will be remounted R/W in order to attempt saving data to it.\n" 0 0 "$SAVE_PATH"` || exit 1 $DIALOG --aspect 12 --stdout --yes-label "Accept" --no-label "Retry" --backtitle "$title" --title "Configuration Done ..." --yesno "\nCongratulations, recording settings have been fully configured. Are you satisfied with the following settings:\n\nEncoding Profile: $p\nRecording Path: $record_path" 0 0 && DONE=true done sed -i "s%^RECORD_PROFILE.*%RECORD_PROFILE=$p%" $f sed -i "s%^SAVE_PATH.*%SAVE_PATH=\"$record_path\"%" $f } /bin/busybox mount -t proc none /proc /bin/busybox mount -t sysfs none /sys /bin/busybox --install -s if [ "$1" = geexbox ]; then DIALOG=/usr/bin/dialog CFDISK=/usr/bin/cfdisk SFDISK=/usr/bin/sfdisk MKDOSFS=/usr/bin/mkdosfs MKE2FS=/sbin/mke2fs GRUB=/usr/bin/grub SYSLINUX=/usr/bin/syslinux else DIALOG=`which dialog` CFDISK=`which cfdisk` SFDISK=`which sfdisk` MKDOSFS=`which mkdosfs` MKE2FS=`which mke2fs` GRUB=`which grub` SYSLINUX=`which syslinux` fi VERSION=`cat VERSION` BACKTITLE="GeeXboX $VERSION installator" if [ "$UID" != "0" ]; then echo "" echo "**** You need to be root to install GeeXboX ****" echo "" exit 1 fi if [ -z "$SFDISK" -o -z "$GRUB" -o -z "$DIALOG" ]; then echo "" echo "**** You need to have sfdisk, grub and dialog installed to install GeeXboX ****" echo "" exit 1 fi if [ ! -d "/sys/block" ]; then echo "" echo "**** You need to have a mounted sysfs at /sys. try executing: mount -t sysfs none /sys ****" echo "" exit 1 fi # disable kernel messages to avoid screen corruption echo 0 > /proc/sys/kernel/printk while true; do if [ -e /dev/.devfsd ]; then DISKS=`cat /proc/partitions | sed -n "s/\ *[0-9][0-9]*\ *[0-9][0-9]*\ *\([0-9][0-9]*\)\ \([a-z0-9/]*disc\).*$/\2 (\1_blocks)/p"` else DISKS=`cat /proc/partitions | sed -n "s/\ *[0-9][0-9]*\ *[0-9][0-9]*\ *\([0-9][0-9]*\)\ \([a-z]*\)$/\2 (\1_blocks)/p"` fi if [ -z "$DISKS" ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "ERROR" --yesno "\nNo disks found on this system.\nCheck again ?" 0 0 || exit 1 else DISKS="$DISKS refresh list" DISK=`$DIALOG --stdout --backtitle "$BACKTITLE" --title "Installation device" --menu "\nYou are going to install GeeXboX. For this you will need an empty partition with about 8 MB of free space.\nBe careful to choose the right disk! We won't take responsibility for any data loss." 0 0 0 $DISKS` || exit 1 [ $DISK != refresh ] && break fi done if [ "`cat /sys/block/$DISK/removable`" = 1 ]; then BOOTLOADER=`$DIALOG --stdout --aspect 15 --backtitle "$BACKTITLE" --title "Linux partition type" --menu "Which type of boot loader you want ? " 0 0 0 grub "GNU GRUB - Doesn't work with oldest BIOS" syslinux "Syslinux - For oldest BIOS compatbility"` || exit 1 TYPE=REMOVABLE else BOOTLOADER=grub TYPE=HDD fi if [ $BOOTLOADER = syslinux ]; then PART_MSG="FAT partition (type=06)" elif [ $BOOTLOADER = grub ]; then PART_MSG="FAT partition (type=0B) or Linux ext2/3 partition (type=83)" fi if [ -z "$CFDISK" ]; then CFDISK_MSG="As you don't have cfdisk installed, the installator won't be able to create the partition for you. You'll have to create it yourself before installing." else CFDISK_MSG="Please edit your partition table to create a $PART_MSG with about 8 MB of free space.\nRemember to write the changes when done. We won't take responsibility for any data loss." fi $DIALOG --stdout --backtitle "$BACKTITLE" --title "Installation device" --msgbox "$CFDISK_MSG" 0 0 || exit 1 if [ -n "$CFDISK" ]; then $CFDISK /dev/$DISK || exit 1 fi while [ ! -b "$DEV" ]; do DISKS="" for i in `$SFDISK -l /dev/$DISK | grep ${DISK%disc} | cut -f1 -d' '`; do case `$SFDISK --print-id ${i%%[0-9]*} ${i#${i%%[0-9]*}}` in 1|11|6|e|16|1e|b|c|1b|1c) #FAT12/16/32 are supported both in syslinux and grub. S=`$SFDISK -s "$i" | sed 's/\([0-9]*\)[0-9]\{3\}/\1/'` DISKS="$DISKS $i ${S}MB" ;; 83) #Linux is supported only in grub. if [ $BOOTLOADER = grub ]; then S=`$SFDISK -s "$i" | sed 's/\([0-9]*\)[0-9]\{3\}/\1/'` DISKS="$DISKS $i ${S}MB" fi ;; esac done if [ -z "$DISKS" ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "ERROR" --msgbox "\nYou don't have any $PART_MSG partition on your system. Please create a partition first using for example cfdisk.\n" 0 0 exit 1 else DEV=`$DIALOG --stdout --aspect 15 --backtitle "$BACKTITLE" --title "Installation device" --menu "Where do you want to install GeeXboX ?" 0 0 0 $DISKS` || exit 1 fi if [ ! -b "$DEV" ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "ERROR" --msgbox "\n'$DEV' is not a valid block device.\n" 0 0 fi done DEVNAME="${DEV#/dev/}" case `$SFDISK --print-id ${DEV%%[0-9]*} ${DEV#${DEV%%[0-9]*}}` in 1|11|6|e|16|1e|14|b|c|1b|1c) SUPPORTED_TYPES="vfat" PART_TYPE="FAT" ;; 83) # Linux SUPPORTED_TYPES="ext3 ext2" PART_TYPE="Linux" ;; esac mkdir di # Try to guess current partition type. MKFS_TYPE= for type in vfat ext3 ext2 auto; do if mount -o ro -t $type "$DEV" di; then MKFS_TYPE=`grep "^$DEV " /proc/mounts | cut -d " " -f 3` umount di break fi done NEED_FORMAT=yes if [ -z "$MKFS_TYPE" ]; then FORMAT_MSG="Partition is not formated. " else for type in $SUPPORTED_TYPES; do [ $type = $MKFS_TYPE ] && NEED_FORMAT=no done if [ "$NEED_FORMAT" = yes ]; then FORMAT_MSG="Partition format type ($MKFS_TYPE) is not supported in your partition type ($PART_TYPE). " else FORMAT_MSG="Partition is already formated. " fi fi $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "Formatting" --defaultno --yesno "$FORMAT_MSG\nDo you want to format '$DEV' ?\n" 0 0 && FORMAT=yes if [ "$FORMAT" = yes ]; then case `$SFDISK --print-id ${DEV%%[0-9]*} ${DEV#${DEV%%[0-9]*}}` in 1|11|6|e|16|1e|14) # FAT12 and FAT16 MKFS=$MKDOSFS MKFS_OPT="-n GEEXBOX" MKFS_TYPE=vfat MKFS_TYPENAME="FAT" ;; b|c|1b|1c) # FAT32 MKFS=$MKDOSFS MKFS_OPT="-n GEEXBOX -F 32" MKFS_TYPE=vfat MKFS_TYPENAME="FAT" ;; 83) # Linux MKFS_TYPE=`$DIALOG --stdout --aspect 15 --backtitle "$BACKTITLE" --title "Linux partition type" --menu "Which type of Linux partition you want ?" 0 0 0 ext2 "Linux ext2" ext3 "Linux ext3"` || exit 1 case $MKFS_TYPE in ext2) MKFS=$MKE2FS MKFS_OPT="-L GEEXBOX" MKFS_TYPENAME="Linux ext2" ;; ext3) MKFS=$MKE2FS MKFS_OPT="-L GEEXBOX -j" MKFS_TYPENAME="Linux ext3" ;; esac ;; esac if [ -z "$MKFS" -o ! -x $MKFS ]; then if [ "$NEED_FORMAT" = yes ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "ERROR" --msgbox "\n'$DEV' must be formated. As you don't have formatting tool installed, I won't be able to format the partition.\n" 0 0 rmdir di exit 1 else $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "Warning" --msgbox "\n'$DEV' needs to be a $MKFS_TYPENAME partition. As you don't have formatting tool installed, I won't be able to format the partition. Hopefully it is already formatted.\n" 0 0 fi else $MKFS $MKFS_OPT "$DEV" fi elif [ "$NEED_FORMAT" = yes ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "ERROR" --msgbox "\n'$DEV' needs to be a formatted.\n" 0 0 rmdir di exit 1 fi mount -t $MKFS_TYPE "$DEV" di if [ $? -ne 0 ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "ERROR" --msgbox "\nFailed to mount '$DEV' as $MKFS_TYPENAME partition.\n" 0 0 rmdir di exit 1 fi if [ -d disk ]; then cp -a disk/* di 2>/dev/null else if [ -n "$NFS" ]; then GEEXBOX="$NFS" else GEEXBOX="$CDROM/GEEXBOX" fi cp -a "$GEEXBOX" di/GEEXBOX 2>/dev/null cd di/GEEXBOX/boot mv vmlinuz initrd.gz isolinux.cfg boot.msg help.msg splash.rle ../../ cd ../../../ rm -rf di/GEEXBOX/boot fi # Setup network is only available when booting from GeeXboX. if [ "$1" = geexbox ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "Configure Network ?" --yesno "\nDo you want to configure your network parameters before installing GeeXboX to disk ?\n" 0 0 && setup_network "di/GEEXBOX" fi # Configure TV card and scan for channels. # (only available when booting from GeeXboX). if [ "$1" = geexbox ]; then if grep -q 'Class 0400:.*109e:' /proc/pci || grep -q 'Class 0480:.*1131:' /proc/pci || grep -q 'Class 0480:.*14f1:88' /proc/pci; then # Only scan if a TV card is detected /usr/bin/mptvscan -i >/dev/null 2>&1 if [ `echo $?` = 0 ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "Scan for Analog TV Channels ?" --yesno "\nDo you want to configure your analog tv card and scan for channels before installing GeeXboX to disk ?\n" 0 0 && setup_tvscan "di/GEEXBOX" fi fi fi # Configure DVB card and scan for channels. # (only available when booting from GeeXboX). if [ "$1" = geexbox ]; then # Only scan if a DVB card is detected if [ -f /var/dvbcard ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "Scan for Digital (DVB) TV Channels ?" --yesno "\nDo you want to configure your digital (DVB) tv card and scan for channels before installing GeeXboX to disk ?\n" 0 0 && setup_dvbscan "di/GEEXBOX" fi fi # Configure Recorder settings # (only available when booting from GeeXboX). if [ "$1" = geexbox ]; then # Only if MEncoder binary exists if [ -f /usr/bin/mencoder ]; then setup_recorder "di/GEEXBOX" fi fi VESA_MODE_OLD=`grep vga= di/isolinux.cfg | head -1 | sed "s%.*vga=\([^ ]*\).*%\1%"` VESA_RES=$((($VESA_MODE_OLD - 784) / 3)) VESA_DEPTH=$((($VESA_MODE_OLD - 784) % 3)) if [ $VESA_DEPTH != 0 -a $VESA_DEPTH != 1 -a $VESA_DEPTH != 2 ] || [ $VESA_RES != 0 -a $VESA_RES != 1 -a $VESA_RES != 2 -a $VESA_RES != 3 ]; then VESA_RES=1 VESA_DEPTH=2 fi VESA_RES=`$DIALOG --stdout --aspect 15 --backtitle "$BACKTITLE" --title "Screen Resolution" --default-item $VESA_RES --menu "Select from options below" 000 0 0 0 "640x480" 1 "800x600" 2 "1024x768" 3 "1280x1024" 4 "1600x1200"` VESA_DEPTH=`$DIALOG --stdout --aspect 15 --backtitle "$BACKTITLE" --title "Screen Color Depth" --default-item $VESA_DEPTH --menu "Select from options below" 000 0 0 0 "15 bit" 1 "16 bit" 2 "24 bit"` VESA_MODE=$((784 + VESA_RES*3 + VESA_DEPTH)) [ $VESA_MODE -ge 796 ] && VESA_MODE=$((VESA_MODE + 1)) if grep -q "splash=silent" di/isolinux.cfg; then SPLASH_ARGUMENT="" SPLASH_OLD="silent" else SPLASH_ARGUMENT="--defaultno" SPLASH_OLD="0" fi $DIALOG --aspect 15 --backtitle "$BACKTITLE" --defaultno --title "Bootsplash" $SPLASH_ARGUMENT --yesno "\nDo you want to disable bootsplash ?\n" 0 0 && SPLASH="0" || SPLASH="silent" grubprefix=/boot/grub grubdir=di$grubprefix device_map=$grubdir/device.map rm -rf $grubdir mkdir -p $grubdir tar xaf "di/GEEXBOX/usr/share/grub-i386-pc.tar.lzma" -C $grubdir if [ -f "di/GEEXBOX/usr/share/grub-splash.xpm.gz" ]; then cp -f "di/GEEXBOX/usr/share/grub-splash.xpm.gz" $grubdir || exit 1 disable_splashimage= else disable_splashimage="#" fi splashimage="$grubprefix/grub-splash.xpm.gz" if [ $BOOTLOADER = syslinux ]; then cp "di/GEEXBOX/usr/share/ldlinux.sys" di sed -e "s/boot=cdrom/boot=${DEV#/dev/}/" -e "s/vga=$VESA_MODE_OLD/vga=$VESA_MODE/" -e "s/splash=$SPLASH_OLD/splash=$SPLASH/" di/isolinux.cfg > di/syslinux.cfg rm di/isolinux.cfg elif [ $BOOTLOADER = grub ]; then cp $grubdir/stage2 $grubdir/stage2_single rm di/isolinux.cfg di/boot.msg di/help.msg di/splash.rle fi if [ $TYPE = HDD ]; then echo "quit" | $GRUB --batch --no-floppy --device-map=$device_map elif [ $TYPE = REMOVABLE ]; then echo "(hd0) ${DEV%%[0-9]*}" > $device_map fi rootdev=$(convert $DEV) if [ -z "$rootdev" ]; then $DIALOG --aspect 15 --backtitle "$BACKTITLE" --title "ERROR" --msgbox "\nCouldn't find my GRUB partition representation\n" 0 0 umount di rmdir di exit 1 fi if [ $BOOTLOADER = syslinux ]; then umount di $SYSLINUX "$DEV" mount -t $MKFS_TYPE "$DEV" di elif [ $BOOTLOADER = grub ]; then if [ $TYPE = HDD ]; then rootdev_single=$rootdev fake_device= elif [ $TYPE = REMOVABLE ]; then rootdev_single="(fd0)" fake_device="device $rootdev_single $DEV" fi $GRUB --batch --no-floppy --device-map=$device_map < $grubdir/single.lst < $grubdir/menu.lst <> $grubdir/menu.lst <> $grubdir/menu.lst <> $grubdir/menu.lst <> $grubdir/menu.lst < #include #include #include #include #include int main (int argc, char **argv) { int fd, capabilites; if (argc != 2) { fprintf (stderr, "usage: %s device\n", argv[0]); return 1; } fd = open (argv[1], O_RDONLY | O_NONBLOCK); if (fd < 0) { perror ("Can't open device"); return 2; } if ((capabilites=ioctl (fd, CDROM_GET_CAPABILITY)) < 0) { perror ("Can't get capabilities"); return 3; } if (capabilites & CDC_DVD) printf ("DVD\n"); else printf ("CD\n"); close (fd); return 0; } geexbox-1.0/packages/jpeg/0000755000175000017500000000000010446314263014523 5ustar aurelaurelgeexbox-1.0/packages/jpeg/build0000755000175000017500000000031110446314263015543 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX make libjpeg.a make install-lib geexbox-1.0/packages/jpeg/url0000644000175000017500000000006210446314263015246 0ustar aurelaurelftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz geexbox-1.0/packages/lcd4linux/0000755000175000017500000000000010446314263015504 5ustar aurelaurelgeexbox-1.0/packages/lcd4linux/arch0000644000175000017500000000000510446314263016337 0ustar aurelaureli386 geexbox-1.0/packages/lcd4linux/build0000755000175000017500000000036310446314263016533 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --without-x \ --with-drivers='all,!Curses' make geexbox-1.0/packages/lcd4linux/config/0000755000175000017500000000000010446314263016751 5ustar aurelaurelgeexbox-1.0/packages/lcd4linux/config/lcd4linux.conf0000644000175000017500000001001310446314263021521 0ustar aurelaurelDisplay BWCT { Driver 'BWCT' Size 'LCD_WIDTHxLCD_HEIGHT' Contrast 30 asc255bug 1 Icons 1 } Display CF631 { Driver 'Crystalfontz' Model '631' Port '/dev/tts/USB0' Speed 115200 Contrast 95 Backlight 255 Icons 1 } Display CF632 { Driver 'Crystalfontz' Model '632' Port '/dev/tts/0' Speed 19200 Icons 1 } Display CF633 { Icons 4 Driver 'Crystalfontz' Model '633' Port '/dev/tts/0' Speed 19200 Contrast 16 Backlight 50 } Display CT20x4 { Driver 'Beckmann+Egle' Model 'CT20x4' Port '/dev/tts/0' Size 'LCD_WIDTHxLCD_HEIGHT' # Contrast 7 # Backlight 1 Icons 1 } Display CW12232 { Driver 'Cwlinux' Model 'CW12232' Port '/dev/usb/tts/0' Speed 19200 Brightness 2 Icons 1 } # generic HD44780 display (LCD4Linux wiring) Display HD44780-generic { Driver 'HD44780' Model 'generic' Port '/dev/parport0' Size 'LCD_WIDTHxLCD_HEIGHT' asc255bug 0 Wire { RW 'GND' RS 'AUTOFD' ENABLE 'STROBE' ENABLE2 'GND' GPO 'INIT' } } Display HD44780-I2C { Driver 'HD44780' Model 'generic' Bus 'i2c' Port '/dev/i2c-0' Device '70' Bits '4' Size 'LCD_WIDTHxLCD_HEIGHT' asc255bug 0 Icons 1 Wire { RW 'DB5' RS 'DB4' ENABLE 'DB6' GPO 'GND' } } # HD44780 display from www.kernelconcepts.de Display HD44780-kernelconcepts { Driver 'HD44780' Model 'HD66712' Port '/dev/parport0' Size 'LCD_WIDTHxLCD_HEIGHT' Wire { RW 'AUTOFD' RS 'INIT' ENABLE 'STROBE' ENABLE2 'GND' GPO 'GND' } } # generic HD44780 display (WinAmp wiring) Display HD44780-winamp { Driver 'HD44780' Model 'generic' Port '/dev/parport0' Size 'LCD_WIDTHxLCD_HEIGHT' Wire { RW 'AUTOFD' RS 'INIT' ENABLE 'STROBE' ENABLE2 'GND' GPO 'GND' } } Display LCDTerm { Driver 'LCDTerm Port '/dev/tts/0' Speed 19200 Size 'LCD_WIDTHxLCD_HEIGHT' Icons 1 } Display LCM-162 { Driver 'HD44780' Model 'LCM-162' # Bus 'parport' Port '/dev/parport0' Size 'LCD_WIDTHxLCD_HEIGHT' asc255bug 0 Icons 1 } Display LK204 { Driver 'MatrixOrbital' Model 'LK204-24-USB' Port '/dev/usb/tts/0' # Port '/dev/tts/0' Speed 19200 Contrast 256/2 } Display M50530-24x8 { Driver 'M50530' Port '/dev/parport0' # Port '0x378' Size 'LCD_WIDTHxLCD_HEIGHT' Font '5x7' Duty 2 Wire.EX 'STROBE' Wire.IOC1 'SLCTIN' Wire.IOC2 'AUTOFD' Wire.GPO 'INIT' } Display MI240 { Driver 'MilfordInstruments' Model 'MI240' Port '/dev/tts/0' Speed 19200 } Display SC1602D { Driver 'HD44780' Port '/dev/parport0' Bits '8' Size 'LCD_WIDTHxLCD_HEIGHT' asc255bug 0 Icons 1 Wire { RW 'GND' RS 'AUTOFD' ENABLE 'STROBE' GPO 'INIT' } } Display SerDispLib { Driver 'serdisplib' Port 'PAR:/dev/parport0' #Port '/dev/tts/0' Model 'OPTREX323' Options '' } Display SimpleLCD { Driver 'SimpleLCD' Port '/dev/tts/0' Speed 1200 Options 0 Size 'LCD_WIDTHxLCD_HEIGHT' } Display T6963-240x64 { Driver 'T6963' Port '/dev/parports/0' Size '240x64' Wire.CE 'STROBE' Wire.CD 'SLCTIN' Wire.RD 'AUTOFD' Wire.WR 'INIT' } Display Trefon { Driver 'TREFON' Size 'LCD_WIDTHxLCD_HEIGHT' Backlight 1 Icons 1 } Display USBLCD { Driver 'USBLCD' # Port '/dev/lcd0' Port 'libusb' Size 'LCD_WIDTHxLCD_HEIGHT' asc255bug 1 Icons 1 } Variables { tick 500 } Widget MPlayerFileName { class 'Text' expression mplayer('ID_FILENAME') width LCD_WIDTH align 'M' speed 400 update tick } Widget MPlayerTimeBar { class 'Bar' expression mplayer('ID_VIDEO_PERCENT') length LCD_WIDTH max 100 direction 'E' update 100 } Layout MPlayer { Row1 { Col1 'MPlayerFileName' } Row2 { Col1 'MPlayerTimeBar' } } Layout 'MPlayer' geexbox-1.0/packages/lcd4linux/init.d/0000755000175000017500000000000010446314263016671 5ustar aurelaurelgeexbox-1.0/packages/lcd4linux/init.d/11_lcddisplay0000755000175000017500000000070710446314263021254 0ustar aurelaurel#!/bin/sh # # start lcd display # # runlevels: geexbox, debug # get options test -f /etc/lcddisplay || exit 1 . /etc/lcddisplay CONFIG=/etc/lcd4linux.conf if test "$LCD_ENABLED" = "yes" -a -f $CONFIG; then echo "### Starting LCD Display ###" # create the fifo for mplayer mkfifo /tmp/mp_streaminfo sed -i -e "s/LCD_WIDTH/$LCD_WIDTH/g" -e "s/LCD_HEIGHT/$LCD_HEIGHT/g" $CONFIG /usr/bin/lcd4linux -c "Display='$LCD_MODEL'" -f $CONFIG fi exit 0 geexbox-1.0/packages/lcd4linux/install0000755000175000017500000000043610446314263017103 0ustar aurelaurel#!/bin/sh . config/options mkdir -p $INSTALL/etc mkdir -p $INSTALL/usr/bin cp $BUILD/$1*/$1 $INSTALL/usr/bin cp $PACKAGES/$1/config/$1.conf $INSTALL/etc/ cat <$INSTALL/etc/lcddisplay LCD_ENABLED=$LCD_ENABLED LCD_MODEL=$LCD_MODEL LCD_WIDTH=$LCD_WIDTH LCD_HEIGHT=$LCD_HEIGHT EOF geexbox-1.0/packages/lcd4linux/patches/0000755000175000017500000000000010446314263017133 5ustar aurelaurelgeexbox-1.0/packages/lcd4linux/patches/10_access_error.diff0000644000175000017500000000076710446314263022751 0ustar aurelaureldiff -Naur lcd4linux-0.10.0.orig/cfg.c lcd4linux-0.10.0/cfg.c --- lcd4linux-0.10.0.orig/cfg.c 2006-04-10 01:33:40.000000000 +0200 +++ lcd4linux-0.10.0/cfg.c 2006-04-10 01:34:26.000000000 +0200 @@ -645,6 +645,7 @@ return 0; error = 0; +#if 0 if (!S_ISREG(stbuf.st_mode)) { error("security error: '%s' is not a regular file", file); error = -1; @@ -657,6 +658,7 @@ error("security error: group or other have access to '%s'", file); error = -1; } +#endif return error; } geexbox-1.0/packages/lcd4linux/patches/20_gcc4-fix.diff0000644000175000017500000000100510446314263021666 0ustar aurelaurel* This patch is only mandatory for LCD4linux v0.10.0, as it's been fixed in the CVS --- lcd4linux-0.10.0/lcd4linux_i2c.h.orig Wed Jun 1 14:09:13 2005 +++ lcd4linux-0.10.0/lcd4linux_i2c.h Wed Mar 29 14:05:56 2006 @@ -78,7 +78,7 @@ /* Transfer num messages. */ -extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num); +extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num); /* * Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor. geexbox-1.0/packages/lcd4linux/patches/30_plugin.diff0000644000175000017500000000453310446314263021572 0ustar aurelaurel--- lcd4linux-0.10.0.ori/configure Mon Mar 27 13:24:27 2006 +++ lcd4linux-0.10.0/configure Mon Mar 27 13:25:51 2006 @@ -6818,6 +6818,7 @@ PLUGIN_UPTIME="yes" PLUGIN_WIRELESS="yes" PLUGIN_XMMS="yes" + PLUGIN_MPLAYER="yes" ;; apm) PLUGIN_APM=$val @@ -6891,6 +6892,9 @@ xmms) PLUGIN_XMMS=$val ;; + mplayer) + PLUGIN_MPLAYER=$val + ;; *) { { echo "$as_me:$LINENO: error: Unknown plugin '$plugin'" >&5 echo "$as_me: error: Unknown plugin '$plugin'" >&2;} @@ -7800,6 +7804,14 @@ cat >>confdefs.h <<\_ACEOF #define PLUGIN_XMMS 1 +_ACEOF + +fi +if test "$PLUGIN_MPLAYER" = "yes"; then + PLUGINS="$PLUGINS plugin_mplayer.o" + +cat >>confdefs.h <<\_ACEOF +#define PLUGIN_MPLAYER 1 _ACEOF fi --- lcd4linux-0.10.0.ori/plugin.c Mon Mar 27 23:11:15 2006 +++ lcd4linux-0.10.0/plugin.c Mon Mar 27 23:17:06 2006 @@ -242,6 +242,8 @@ void plugin_exit_loadavg(void); int plugin_init_meminfo(void); void plugin_exit_meminfo(void); +int plugin_init_mplayer(void); +void plugin_exit_mplayer(void); int plugin_init_mysql(void); void plugin_exit_mysql(void); int plugin_init_netdev(void); @@ -311,6 +313,9 @@ #ifdef PLUGIN_MEMINFO plugin_init_meminfo(); #endif +#ifdef PLUGIN_MPLAYER + plugin_init_mplayer(); +#endif #ifdef PLUGIN_MYSQL plugin_init_mysql(); #endif @@ -389,6 +394,9 @@ #endif #ifdef PLUGIN_MEMINFO plugin_exit_meminfo(); +#endif +#ifdef PLUGIN_MPLAYER + plugin_exit_mplayer(); #endif #ifdef PLUGIN_MYSQL plugin_exit_mysql(); --- lcd4linux-0.10.0.ori/config.h.in Tue Mar 28 00:13:35 2006 +++ lcd4linux-0.10.0/config.h.in Tue Mar 28 00:13:55 2006 @@ -284,6 +284,9 @@ /* meminfo plugin */ #undef PLUGIN_MEMINFO +/* mplayer plugin */ +#undef PLUGIN_MPLAYER + /* mysql plugin */ #undef PLUGIN_MYSQL --- lcd4linux-0.10.0.ori/Makefile.am Wed Apr 5 11:09:17 2006 +++ lcd4linux-0.10.0/Makefile.am Wed Apr 5 11:12:06 2006 @@ -87,6 +87,7 @@ plugin_isdn.c \ plugin_loadavg.c \ plugin_meminfo.c \ +plugin_mplayer.c \ plugin_mysql.c \ plugin_netdev.c \ plugin_pop3.c \ @@ -117,5 +118,6 @@ README.Drivers \ README.Plugins \ README.KDE \ +plugin_mplayer.c \ plugin_sample.c geexbox-1.0/packages/lcd4linux/patches/40_greetz.diff0000644000175000017500000000115610446314263021573 0ustar aurelaurel--- lcd4linux-0.10.0.orig/drv_generic_text.c 2005-05-08 06:32:44.000000000 +0200 +++ lcd4linux-0.10.0/drv_generic_text.c 2006-03-29 01:47:52.000000000 +0200 @@ -364,16 +364,16 @@ int i; int flag = 0; - char *line1[] = { "* LCD4Linux " VERSION " *", - "LCD4Linux " VERSION, - "* LCD4Linux *", - "LCD4Linux", - "L4Linux", + char *line1[] = { "GeeXboX OMC Welcome", + "GeeXboX Welcome", + "GeeXboX OMC", + "GeeXboX", + "GB", NULL }; - char *line2[] = { "http://lcd4linux.bulix.org", - "lcd4linux.bulix.org", + char *line2[] = { "http://www.geexbox.org", + "www.geexbox.org", NULL }; geexbox-1.0/packages/lcd4linux/sources/0000755000175000017500000000000010446314263017167 5ustar aurelaurelgeexbox-1.0/packages/lcd4linux/sources/plugin_mplayer.c0000644000175000017500000000602310446314263022363 0ustar aurelaurel/* * MPlayer-Plugin for LCD4Linux, based on XMMS-Plugin by Markus Keil * Copyright (C) 2006 FoXCoRe * Copyright (C) 2003 Markus Keil */ /* * exported functions: * * int plugin_init_mplayer (void) * adds parser for /tmp/mp_streaminfo * */ /* * The Argument 'arg1' must be one of these Things (without quotes): * * 'ID_FILENAME' * 'ID_DEMUXER' * 'ID_LENGTH' * * For video stream : * 'ID_VIDEO_FORMAT' * 'ID_VIDEO_BITRATE' * 'ID_VIDEO_WIDTH' * 'ID_VIDEO_HEIGHT' * 'ID_VIDEO_FPS' * 'ID_VIDEO_ASPECT' * * For audio stream * 'ID_AUDIO_FORMAT' * 'ID_AUDIO_BITRATE' * 'ID_AUDIO_RATE' * 'ID_AUDIO_NCH' * 'ID_AUDIO_CODEC' * * MP3 Tags if available * 'ID_AUDIO_TITLE' * 'ID_AUDIO_ARTIST' * 'ID_AUDIO_ALBUM' * 'ID_AUDIO_YEAR' * 'ID_AUDIO_COMMENT' * 'ID_AUDIO_TRACK' * 'ID_AUDIO_GENRE' * * These arguments are case-sensitive */ #include "config.h" #include #include #include #include #include #include "hash.h" #include "debug.h" #include "plugin.h" const char STREAMINFO_FIFO[] = "/tmp/mp_streaminfo"; static HASH mplayer; static int parse_mplayer_info(char *tmpfile) { int age; FILE *streaminfo_fifo; char line[200]; /* reread every 100msec only */ age = hash_age(&mplayer, NULL); if (age >= 0 && age <= 100) return 0; /* Open Filestream for tmpfile */ streaminfo_fifo = fopen(tmpfile, "r"); /* Check for File */ if (!streaminfo_fifo) { error("Error: Cannot open %s! Use mkfifo to create it.", STREAMINFO_FIFO); return -1; } /* Read lines from the fifo */ while (fgets(line, sizeof(line), streaminfo_fifo)) { char *c, *key, *val; c = strchr(line, '='); if (c == NULL) continue; key = line; val = c + 1; /* strip leading blanks from key */ while (isspace(*key)) *key++ = '\0'; /* strip trailing blanks from key */ do *c = '\0'; while (isspace(*--c)); /* strip leading blanks from value */ while (isspace(*val)) *val++ = '\0'; /* strip trailing blanks from value */ for (c = val; *c != '\0'; c++); while (isspace(*--c)) *c = '\0'; hash_put(&mplayer, key, val); } fclose(streaminfo_fifo); return 0; } static void my_mplayer(RESULT * result, RESULT * arg1) { char *key, *val; if (parse_mplayer_info(STREAMINFO_FIFO) < 0) { SetResult(&result, R_STRING, ""); return; } key = R2S(arg1); val = hash_get(&mplayer, key, NULL); if (strcmp(val, "background.avi") == 0) val = "GeeXboX Open Media Center"; if (val == NULL) val = ""; SetResult(&result, R_STRING, val); } int plugin_init_mplayer(void) { hash_create(&mplayer); /* register mplayer info */ AddFunction("mplayer", 1, my_mplayer); return 0; } void plugin_exit_mplayer(void) { hash_destroy(&mplayer); } geexbox-1.0/packages/lcd4linux/url0000644000175000017500000000011710446314263016230 0ustar aurelaurelhttp://switch.dl.sourceforge.net/sourceforge/lcd4linux/lcd4linux-0.10.0.tar.gz geexbox-1.0/packages/libdts/0000755000175000017500000000000010446314263015057 5ustar aurelaurelgeexbox-1.0/packages/libdts/build0000755000175000017500000000027310446314263016106 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX make make install geexbox-1.0/packages/libdts/unpack0000755000175000017500000000011210446314263016260 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/fixconfigtools $BUILD/$1*/autotools geexbox-1.0/packages/libdts/url0000644000175000017500000000004110446314263015577 0ustar aurelaurelGEEXBOX_SRCS/libdts-0.0.2.tar.gz geexbox-1.0/packages/libexif/0000755000175000017500000000000010446314263015220 5ustar aurelaurelgeexbox-1.0/packages/libexif/build0000755000175000017500000000035510446314263016250 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-nls make -C libexif make -C libexif install geexbox-1.0/packages/libexif/url0000644000175000017500000000011310446314263015740 0ustar aurelaurelhttp://heanet.dl.sourceforge.net/sourceforge/libexif/libexif-0.5.12.tar.gz geexbox-1.0/packages/libirman/0000755000175000017500000000000010446314263015373 5ustar aurelaurelgeexbox-1.0/packages/libirman/build0000755000175000017500000000050110446314263016414 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --sysconfdir=/etc make libirman mkdir -p $LIB_PREFIX/lib $LIB_PREFIX/include cp irman.h $LIB_PREFIX/include cp libirman.a $LIB_PREFIX/lib geexbox-1.0/packages/libirman/url0000644000175000017500000000010510446314263016114 0ustar aurelaurelhttp://lirc.sourceforge.net/software/snapshots/libirman-0.4.4.tar.gz geexbox-1.0/packages/libmpcdec/0000755000175000017500000000000010446314263015520 5ustar aurelaurelgeexbox-1.0/packages/libmpcdec/build0000755000175000017500000000033210446314263016543 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-shared make make install geexbox-1.0/packages/libmpcdec/unpack0000755000175000017500000000025610446314263016732 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/fixconfigtools $BUILD/$1*/config sed -i 's/^noinst_PROGRAMS.*/noinst_PROGRAMS = /' $BUILD/$1*/src/Makefile.in geexbox-1.0/packages/libmpcdec/url0000644000175000017500000000007110446314263016243 0ustar aurelaurelhttp://files.musepack.net/source/libmpcdec-1.2.2.tar.bz2 geexbox-1.0/packages/libogg/0000755000175000017500000000000010446314263015041 5ustar aurelaurelgeexbox-1.0/packages/libogg/build0000755000175000017500000000033210446314263016064 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-shared make make install geexbox-1.0/packages/libogg/url0000644000175000017500000000007310446314263015566 0ustar aurelaurelhttp://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz geexbox-1.0/packages/libpcd/0000755000175000017500000000000010446314264015034 5ustar aurelaurelgeexbox-1.0/packages/libpcd/build0000755000175000017500000000041010446314264016054 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain make -C $BUILD/$1* \ CC=$CC \ AR=$AR \ RANLIB=$RANLIB \ libpcd.a mkdir -p $LIB_PREFIX/lib $LIB_PREFIX/include cp $BUILD/$1*/pcd.h $LIB_PREFIX/include cp $BUILD/$1*/libpcd.a $LIB_PREFIX/lib geexbox-1.0/packages/libpcd/patches/0000755000175000017500000000000010446314264016463 5ustar aurelaurelgeexbox-1.0/packages/libpcd/patches/10_crosscompile.diff0000644000175000017500000000077010446314264022323 0ustar aurelaurel--- libpcd-1.0.1.orig/GNUmakefile 2003-07-22 12:52:46.000000000 +0300 +++ libpcd-1.0.1/GNUmakefile 2004-12-03 12:17:32.000000000 +0200 @@ -6,6 +6,8 @@ libdir := $(DESTDIR)$(prefix)/lib CC := gcc +AR := ar +RANLIB := ranlib WARN := -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith CFLAGS ?= -g -O2 CFLAGS += $(WARN) @@ -30,8 +32,8 @@ libpcd.a: $(STATIC) rm -f $@ - ar rc $@ $(STATIC) - ranlib $@ + $(AR) rc $@ $(STATIC) + $(RANLIB) $@ libpcd.so.$(MINOR): $(SHARED) rm -f $@ geexbox-1.0/packages/libpcd/url0000644000175000017500000000007210446314264015560 0ustar aurelaurelhttp://dl.bytesex.org/releases/libpcd/libpcd_1.0.1.tar.gz geexbox-1.0/packages/libpng/0000755000175000017500000000000010446314264015052 5ustar aurelaurelgeexbox-1.0/packages/libpng/build0000755000175000017500000000035110446314264016076 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build zlib cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --without-x make make install geexbox-1.0/packages/libpng/url0000644000175000017500000000011710446314264015576 0ustar aurelaurelhttp://switch.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8-config.tar.gz geexbox-1.0/packages/libtheora/0000755000175000017500000000000010446314264015550 5ustar aurelaurelgeexbox-1.0/packages/libtheora/build0000755000175000017500000000042010446314264016571 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build libogg cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-shared \ --disable-oggtest make make install geexbox-1.0/packages/libtheora/unpack0000755000175000017500000000014410446314264016756 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain sed -i "s/examples//" $BUILD/$1*/Makefile.in geexbox-1.0/packages/libtheora/url0000644000175000017500000000010610446314264016272 0ustar aurelaurelhttp://downloads.xiph.org/releases/theora/libtheora-1.0alpha5.tar.bz2 geexbox-1.0/packages/libungif/0000755000175000017500000000000010446314264015376 5ustar aurelaurelgeexbox-1.0/packages/libungif/build0000755000175000017500000000040210446314264016417 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-shared \ --without-x make -C lib make -C lib install geexbox-1.0/packages/libungif/url0000644000175000017500000000011510446314264016120 0ustar aurelaurelhttp://switch.dl.sourceforge.net/sourceforge/libungif/libungif-4.1.4.tar.bz2 geexbox-1.0/packages/libupnp/0000755000175000017500000000000010446314264015250 5ustar aurelaurelgeexbox-1.0/packages/libupnp/build0000755000175000017500000000052610446314264016300 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-shared \ --enable-client \ --disable-device \ --disable-webserver \ --enable-tools make make install geexbox-1.0/packages/libupnp/url0000644000175000017500000000010710446314264015773 0ustar aurelaurelhttp://switch.dl.sourceforge.net/sourceforge/upnp/libupnp-1.3.1.tar.gz geexbox-1.0/packages/libvorbis/0000755000175000017500000000000010446314264015572 5ustar aurelaurelgeexbox-1.0/packages/libvorbis/build0000755000175000017500000000052610446314264016622 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build libogg CFLAGS="$CFLAGS -ffast-math -D_ISOC99_SOURCE -D__USE_EXTERN_INLINES" cd $BUILD/$1* ./configure --host=$TARGET_NAME \ --build=$HOST_NAME \ --prefix=$LIB_PREFIX \ --disable-shared \ --disable-oggtest make make install geexbox-1.0/packages/libvorbis/patches/0000755000175000017500000000000010446314264017221 5ustar aurelaurelgeexbox-1.0/packages/libvorbis/patches/10_use-lrint-for-ints.diff0000644000175000017500000001372710446314264024046 0ustar aurelaurel* use lrint() whenever the left-value is integer this allows the compliation to use lrint() inlined math macros without this patch, gcc 4.1.0 optimize rint() calls into lrint() but, we dont have function of lrint(), just inlined math macro. use lrintf() whenever the argument is float for the same reason. diff -Nur libvorbis-1.1.2.orig/lib/bitrate.c libvorbis-1.1.2/lib/bitrate.c --- libvorbis-1.1.2.orig/lib/bitrate.c Mon Nov 28 07:43:25 2005 +++ libvorbis-1.1.2/lib/bitrate.c Fri Mar 24 15:13:45 2006 @@ -39,9 +39,9 @@ bm->short_per_long=ci->blocksizes[1]/ci->blocksizes[0]; bm->managed=1; - bm->avg_bitsper= rint(1.*bi->avg_rate*halfsamples/ratesamples); - bm->min_bitsper= rint(1.*bi->min_rate*halfsamples/ratesamples); - bm->max_bitsper= rint(1.*bi->max_rate*halfsamples/ratesamples); + bm->avg_bitsper= lrint(1.*bi->avg_rate*halfsamples/ratesamples); + bm->min_bitsper= lrint(1.*bi->min_rate*halfsamples/ratesamples); + bm->max_bitsper= lrint(1.*bi->max_rate*halfsamples/ratesamples); bm->avgfloat=PACKETBLOBS/2; @@ -80,7 +80,7 @@ codec_setup_info *ci=vi->codec_setup; bitrate_manager_info *bi=&ci->bi; - int choice=rint(bm->avgfloat); + int choice=lrint(bm->avgfloat); long this_bits=oggpack_bytes(vbi->packetblob[choice])*8; long min_target_bits=(vb->W?bm->min_bitsper*bm->short_per_long:bm->min_bitsper); long max_target_bits=(vb->W?bm->max_bitsper*bm->short_per_long:bm->max_bitsper); @@ -132,7 +132,7 @@ slew=rint(choice-bm->avgfloat)/samples*vi->rate; if(slew<-slewlimit)slew=-slewlimit; if(slew>slewlimit)slew=slewlimit; - choice=rint(bm->avgfloat+= slew/vi->rate*samples); + choice=lrint(bm->avgfloat+= slew/vi->rate*samples); this_bits=oggpack_bytes(vbi->packetblob[choice])*8; } diff -Nur libvorbis-1.1.2.orig/lib/floor1.c libvorbis-1.1.2/lib/floor1.c --- libvorbis-1.1.2.orig/lib/floor1.c Mon Nov 28 07:43:25 2005 +++ libvorbis-1.1.2/lib/floor1.c Fri Mar 24 15:09:59 2006 @@ -506,8 +506,8 @@ double denom=1./(an*fx2-fx*fx); double a=(fy*fx2-fxy*fx)*denom; double b=(an*fxy-fx*fy)*denom; - *y0=rint(a+b*x0); - *y1=rint(a+b*x1); + *y0=lrint(a+b*x0); + *y1=lrint(a+b*x1); /* limit to our range! */ if(*y0>1023)*y0=1023; diff -Nur libvorbis-1.1.2.orig/lib/lsp.c libvorbis-1.1.2/lib/lsp.c --- libvorbis-1.1.2.orig/lib/lsp.c Mon Nov 28 07:43:25 2005 +++ libvorbis-1.1.2/lib/lsp.c Fri Mar 24 15:12:55 2006 @@ -143,8 +143,8 @@ /* set up for using all int later */ int i; - int ampoffseti=rint(ampoffset*4096.f); - int ampi=rint(amp*16.f); + int ampoffseti=lrintf(ampoffset*4096.f); + int ampi=lrintf(amp*16.f); long *ilsp=alloca(m*sizeof(*ilsp)); for(i=0;i>1; - int log2n=lookup->log2n=rint(log((float)n)/log(2.f)); + int log2n=lookup->log2n=lrint(log((float)n)/log(2.f)); lookup->n=n; lookup->trig=T; lookup->bitrev=bitrev; diff -Nur libvorbis-1.1.2.orig/lib/psy.c libvorbis-1.1.2/lib/psy.c --- libvorbis-1.1.2.orig/lib/psy.c Mon Nov 28 07:43:25 2005 +++ libvorbis-1.1.2/lib/psy.c Fri Mar 24 15:09:27 2006 @@ -271,7 +271,7 @@ memset(p,0,sizeof(*p)); p->eighth_octave_lines=gi->eighth_octave_lines; - p->shiftoc=rint(log(gi->eighth_octave_lines*8.f)/log(2.f))-1; + p->shiftoc=lrint(log(gi->eighth_octave_lines*8.f)/log(2.f))-1; p->firstoc=toOC(.25f*rate*.5/n)*(1<<(p->shiftoc+1))-gi->eighth_octave_lines; maxoc=toOC((n+.25f)*rate*.5/n)*(1<<(p->shiftoc+1))+.5f; @@ -293,7 +293,7 @@ /* set up the lookups for a given blocksize and sample rate */ for(i=0,j=0;ipartvals=rint(pow((float)look->parts,(float)dim)); + look->partvals=lrint(pow((float)look->parts,(float)dim)); look->stages=maxstage; look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap)); for(j=0;jpartvals;j++){ diff -Nur libvorbis-1.1.2.orig/lib/sharedbook.c libvorbis-1.1.2/lib/sharedbook.c --- libvorbis-1.1.2.orig/lib/sharedbook.c Mon Nov 28 07:43:25 2005 +++ libvorbis-1.1.2/lib/sharedbook.c Fri Mar 24 15:13:58 2006 @@ -53,7 +53,7 @@ val= -val; } exp= floor(log(val)/log(2.f)); - mant=rint(ldexp(val,(VQ_FMAN-1)-exp)); + mant=lrint(ldexp(val,(VQ_FMAN-1)-exp)); exp=(exp+VQ_FEXP_BIAS)<32767.f)ival=32767.f; if(ival<-32768.f)ival=-32768.f; diff -Nur libvorbis-1.1.2.orig/lib/vorbisfile.c libvorbis-1.1.2/lib/vorbisfile.c --- libvorbis-1.1.2.orig/lib/vorbisfile.c Mon Nov 28 07:43:25 2005 +++ libvorbis-1.1.2/lib/vorbisfile.c Fri Mar 24 15:12:35 2006 @@ -833,11 +833,11 @@ * so this is slightly transformed to make it work. */ br = bits/ov_time_total(vf,-1); - return(rint(br)); + return(lrintf(br)); }else{ if(vf->seekable){ /* return the actual bitrate */ - return(rint((vf->offsets[i+1]-vf->dataoffsets[i])*8/ov_time_total(vf,i))); + return(lrint((vf->offsets[i+1]-vf->dataoffsets[i])*8/ov_time_total(vf,i))); }else{ /* return nominal if set */ if(vf->vi[i].bitrate_nominal>0){ geexbox-1.0/packages/libvorbis/url0000644000175000017500000000010110446314264016307 0ustar aurelaurelhttp://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz geexbox-1.0/packages/linux/0000755000175000017500000000000010446314264014736 5ustar aurelaurelgeexbox-1.0/packages/linux/build0000755000175000017500000000100410446314264015756 0ustar aurelaurel#!/bin/sh . config/options $SCRIPTS/build toolchain $SCRIPTS/build module-init-tools DEPMOD=`ls -d $ROOT/$BUILD/module-init-tool*/depmod` LINUX=$(kernel_path) MODDIR=$LINUX/modules rm -rf $MODDIR mkdir -p $MODDIR case $TARGET_ARCH in i386) make bzImage -C "$LINUX" ;; ppc) unset LDFLAGS make vmlinux -C "$LINUX" ;; esac make modules -C "$LINUX" make INSTALL_MOD_PATH=$MODDIR DEPMOD=$DEPMOD modules_install -C "$LINUX" rm -f $MODDIR/lib/modules/*/build rm -f $MODDIR/lib/modules/*/source geexbox-1.0/packages/linux/config/0000755000175000017500000000000010446314264016203 5ustar aurelaurelgeexbox-1.0/packages/linux/config/linux.i386.conf0000644000175000017500000011772210446314264020713 0ustar aurelaurel# # Automatically generated make config: don't edit # Linux kernel version: 2.6.16 # CONFIG_X86_32=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_X86=y CONFIG_MMU=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_DMI=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 # # General setup # CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set # CONFIG_SWAP is not set # CONFIG_SYSVIPC is not set # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_UID16=y CONFIG_VM86=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y # CONFIG_ELF_CORE is not set CONFIG_BASE_FULL=y # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 CONFIG_SLAB=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # CONFIG_SLOB is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set # # Block layer # # CONFIG_LBD is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y # CONFIG_IOSCHED_AS is not set CONFIG_IOSCHED_DEADLINE=y # CONFIG_IOSCHED_CFQ is not set # CONFIG_DEFAULT_AS is not set CONFIG_DEFAULT_DEADLINE=y # CONFIG_DEFAULT_CFQ is not set # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="deadline" # # Processor type and features # CONFIG_X86_PC=y # CONFIG_X86_ELAN is not set # CONFIG_X86_VOYAGER is not set # CONFIG_X86_NUMAQ is not set # CONFIG_X86_SUMMIT is not set # CONFIG_X86_BIGSMP is not set # CONFIG_X86_VISWS is not set # CONFIG_X86_GENERICARCH is not set # CONFIG_X86_ES7000 is not set # CONFIG_M386 is not set # CONFIG_M486 is not set CONFIG_M586=y # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set # CONFIG_M686 is not set # CONFIG_MPENTIUMII is not set # CONFIG_MPENTIUMIII is not set # CONFIG_MPENTIUMM is not set # CONFIG_MPENTIUM4 is not set # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MCRUSOE is not set # CONFIG_MEFFICEON is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set # CONFIG_MCYRIXIII is not set # CONFIG_MVIAC3_2 is not set CONFIG_X86_GENERIC=y CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_L1_CACHE_SHIFT=7 CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_X86_PPRO_FENCE=y CONFIG_X86_F00F_BUG=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_CMPXCHG64=y CONFIG_X86_ALIGNMENT_16=y CONFIG_X86_INTEL_USERCOPY=y # CONFIG_HPET_TIMER is not set # CONFIG_SMP is not set CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set CONFIG_X86_UP_APIC=y CONFIG_X86_UP_IOAPIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y # CONFIG_X86_MCE is not set # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_X86_REBOOTFIXUPS is not set # CONFIG_MICROCODE is not set # CONFIG_X86_MSR is not set # CONFIG_X86_CPUID is not set # # Firmware Drivers # # CONFIG_EDD is not set # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set # CONFIG_HIGHMEM64G is not set CONFIG_VMSPLIT_3G=y # CONFIG_VMSPLIT_3G_OPT is not set # CONFIG_VMSPLIT_2G is not set # CONFIG_VMSPLIT_1G is not set CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set # CONFIG_SPARSEMEM_MANUAL is not set CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y CONFIG_SPARSEMEM_STATIC=y CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_MATH_EMULATION is not set CONFIG_MTRR=y # CONFIG_EFI is not set # CONFIG_REGPARM is not set # CONFIG_SECCOMP is not set # CONFIG_HZ_100 is not set # CONFIG_HZ_250 is not set CONFIG_HZ_1000=y CONFIG_HZ=1000 # CONFIG_KEXEC is not set CONFIG_PHYSICAL_START=0x100000 # CONFIG_DOUBLEFAULT is not set # # Power management options (ACPI, APM) # CONFIG_PM=y CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP_PROC_FS=y # CONFIG_ACPI_SLEEP_PROC_SLEEP is not set CONFIG_ACPI_AC=y CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y # CONFIG_ACPI_VIDEO is not set # CONFIG_ACPI_HOTKEY is not set CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y # CONFIG_ACPI_ASUS is not set # CONFIG_ACPI_IBM is not set # CONFIG_ACPI_TOSHIBA is not set CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_SYSTEM=y # CONFIG_X86_PM_TIMER is not set # CONFIG_ACPI_CONTAINER is not set # # APM (Advanced Power Management) BIOS Support # CONFIG_APM=y # CONFIG_APM_IGNORE_USER_SUSPEND is not set CONFIG_APM_DO_ENABLE=y CONFIG_APM_CPU_IDLE=y # CONFIG_APM_DISPLAY_BLANK is not set # CONFIG_APM_RTC_IS_GMT is not set # CONFIG_APM_ALLOW_INTS is not set # CONFIG_APM_REAL_MODE_POWER_OFF is not set # # CPU Frequency scaling # CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_TABLE=y # CONFIG_CPU_FREQ_DEBUG is not set # CONFIG_CPU_FREQ_STAT is not set CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set CONFIG_CPU_FREQ_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_GOV_POWERSAVE is not set # CONFIG_CPU_FREQ_GOV_USERSPACE is not set # CONFIG_CPU_FREQ_GOV_ONDEMAND is not set CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y # # CPUFreq processor drivers # CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_POWERNOW_K6=y CONFIG_X86_POWERNOW_K7=y CONFIG_X86_POWERNOW_K7_ACPI=y CONFIG_X86_POWERNOW_K8=y CONFIG_X86_POWERNOW_K8_ACPI=y CONFIG_X86_GX_SUSPMOD=y CONFIG_X86_SPEEDSTEP_CENTRINO=y CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y CONFIG_X86_SPEEDSTEP_ICH=y CONFIG_X86_SPEEDSTEP_SMI=y CONFIG_X86_P4_CLOCKMOD=y # CONFIG_X86_CPUFREQ_NFORCE2 is not set CONFIG_X86_LONGRUN=y CONFIG_X86_LONGHAUL=y # # shared options # # CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set CONFIG_X86_SPEEDSTEP_LIB=y # CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # CONFIG_PCI=y # CONFIG_PCI_GOBIOS is not set # CONFIG_PCI_GOMMCONFIG is not set # CONFIG_PCI_GODIRECT is not set CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_MMCONFIG=y # CONFIG_PCIEPORTBUS is not set # CONFIG_PCI_MSI is not set CONFIG_PCI_LEGACY_PROC=y CONFIG_ISA_DMA_API=y CONFIG_ISA=y # CONFIG_EISA is not set # CONFIG_MCA is not set # CONFIG_SCx200 is not set # # PCCARD (PCMCIA/CardBus) support # CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set # CONFIG_PCMCIA is not set CONFIG_CARDBUS=y # # PC-card bridges # CONFIG_YENTA=y CONFIG_YENTA_O2=y CONFIG_YENTA_RICOH=y CONFIG_YENTA_TI=y # CONFIG_YENTA_ENE_TUNE is not set CONFIG_YENTA_TOSHIBA=y CONFIG_PCMCIA_PROBE=y CONFIG_PCCARD_NONSTATIC=y # # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set # # Executable file formats # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_AOUT is not set # CONFIG_BINFMT_MISC is not set # # Networking # CONFIG_NET=y # # Networking options # # CONFIG_NETDEBUG is not set CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set CONFIG_UNIX=y # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IP_FIB_HASH=y # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set # CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set # CONFIG_INET_DIAG is not set # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set # # DCCP Configuration (EXPERIMENTAL) # # CONFIG_IP_DCCP is not set # # SCTP Configuration (EXPERIMENTAL) # # CONFIG_IP_SCTP is not set # # TIPC Configuration (EXPERIMENTAL) # # CONFIG_TIPC is not set # CONFIG_ATM is not set # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set # CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set # # Network testing # # CONFIG_NET_PKTGEN is not set # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set CONFIG_IEEE80211=y # CONFIG_IEEE80211_DEBUG is not set CONFIG_IEEE80211_CRYPT_WEP=y CONFIG_IEEE80211_CRYPT_CCMP=y CONFIG_IEEE80211_CRYPT_TKIP=y # # Device Drivers # # # Generic Driver Options # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # # Connector - unified userspace <-> kernelspace linker # # CONFIG_CONNECTOR is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # CONFIG_PARPORT=y CONFIG_PARPORT_PC=y # CONFIG_PARPORT_SERIAL is not set # CONFIG_PARPORT_PC_FIFO is not set # CONFIG_PARPORT_PC_SUPERIO is not set # CONFIG_PARPORT_GSC is not set # CONFIG_PARPORT_1284 is not set # # Plug and Play support # CONFIG_PNP=y # CONFIG_PNP_DEBUG is not set # # Protocols # CONFIG_ISAPNP=y CONFIG_PNPBIOS=y # CONFIG_PNPBIOS_PROC_FS is not set CONFIG_PNPACPI=y # # Block devices # # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_COW_COMMON is not set # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_SX8=y # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=2048 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set CONFIG_BLK_DEV_IDEFLOPPY=y # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_CMD640=y CONFIG_BLK_DEV_CMD640_ENHANCED=y CONFIG_BLK_DEV_IDEPNP=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y CONFIG_BLK_DEV_OPTI621=y CONFIG_BLK_DEV_RZ1000=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_AEC62XX=y CONFIG_BLK_DEV_ALI15X3=y # CONFIG_WDC_ALI15X3 is not set CONFIG_BLK_DEV_AMD74XX=y CONFIG_BLK_DEV_ATIIXP=y CONFIG_BLK_DEV_CMD64X=y CONFIG_BLK_DEV_TRIFLEX=y CONFIG_BLK_DEV_CY82C693=y # CONFIG_BLK_DEV_CS5520 is not set CONFIG_BLK_DEV_CS5530=y CONFIG_BLK_DEV_CS5535=y CONFIG_BLK_DEV_HPT34X=y # CONFIG_HPT34X_AUTODMA is not set CONFIG_BLK_DEV_HPT366=y # CONFIG_BLK_DEV_SC1200 is not set CONFIG_BLK_DEV_PIIX=y CONFIG_BLK_DEV_IT821X=y CONFIG_BLK_DEV_NS87415=y CONFIG_BLK_DEV_PDC202XX_OLD=y # CONFIG_PDC202XX_BURST is not set CONFIG_BLK_DEV_PDC202XX_NEW=y # CONFIG_BLK_DEV_SVWKS is not set CONFIG_BLK_DEV_SIIMAGE=y CONFIG_BLK_DEV_SIS5513=y CONFIG_BLK_DEV_SLC90E66=y # CONFIG_BLK_DEV_TRM290 is not set CONFIG_BLK_DEV_VIA82CXXX=y # CONFIG_IDE_ARM is not set # CONFIG_IDE_CHIPSETS is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # # CONFIG_RAID_ATTRS is not set CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set CONFIG_CHR_DEV_SG=y # CONFIG_CHR_DEV_SCH is not set # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_FC_ATTRS is not set # CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_SAS_ATTRS is not set # # SCSI low-level drivers # # CONFIG_ISCSI_TCP is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_7000FASST is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AACRAID is not set CONFIG_SCSI_AIC7XXX=y CONFIG_AIC7XXX_CMDS_PER_DEVICE=253 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 # CONFIG_AIC7XXX_DEBUG_ENABLE is not set CONFIG_AIC7XXX_DEBUG_MASK=0 # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set CONFIG_SCSI_SATA=y CONFIG_SCSI_SATA_AHCI=y CONFIG_SCSI_SATA_SVW=y CONFIG_SCSI_ATA_PIIX=y CONFIG_SCSI_SATA_MV=y CONFIG_SCSI_SATA_NV=y CONFIG_SCSI_PDC_ADMA=y CONFIG_SCSI_SATA_QSTOR=y CONFIG_SCSI_SATA_PROMISE=y CONFIG_SCSI_SATA_SX4=y CONFIG_SCSI_SATA_SIL=y CONFIG_SCSI_SATA_SIL24=y CONFIG_SCSI_SATA_SIS=y CONFIG_SCSI_SATA_ULI=y CONFIG_SCSI_SATA_VIA=y CONFIG_SCSI_SATA_VITESSE=y CONFIG_SCSI_SATA_INTEL_COMBINED=y CONFIG_SCSI_BUSLOGIC=y CONFIG_SCSI_OMIT_FLASHPOINT=y # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set # CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_PPA is not set # CONFIG_SCSI_IMM is not set # CONFIG_SCSI_NCR53C406A is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PSI240I is not set # CONFIG_SCSI_QLOGIC_FAS is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLA_FC is not set # CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_DC395x is not set CONFIG_SCSI_DC390T=y # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set # CONFIG_SCSI_ULTRASTOR is not set # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # # Old CD-ROM drivers (not SCSI, not IDE) # # CONFIG_CD_NO_IDESCSI is not set # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set # CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support # CONFIG_IEEE1394=y # # Subsystem Options # # CONFIG_IEEE1394_VERBOSEDEBUG is not set # CONFIG_IEEE1394_OUI_DB is not set # CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set # CONFIG_IEEE1394_EXPORT_FULL_API is not set # # Device Drivers # CONFIG_IEEE1394_PCILYNX=y CONFIG_IEEE1394_OHCI1394=y # # Protocol Drivers # # CONFIG_IEEE1394_VIDEO1394 is not set CONFIG_IEEE1394_SBP2=y # CONFIG_IEEE1394_SBP2_PHYS_DMA is not set # CONFIG_IEEE1394_ETH1394 is not set # CONFIG_IEEE1394_DV1394 is not set # CONFIG_IEEE1394_RAWIO is not set # # I2O device support # # CONFIG_I2O is not set # # Network device support # CONFIG_NETDEVICES=y # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # CONFIG_NET_SB1000 is not set # # ARCnet devices # # CONFIG_ARCNET is not set # # PHY device support # # CONFIG_PHYLIB is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_CASSINI is not set CONFIG_NET_VENDOR_3COM=y CONFIG_EL1=y CONFIG_EL2=y CONFIG_ELPLUS=y CONFIG_EL16=y CONFIG_EL3=y # CONFIG_3C515 is not set CONFIG_VORTEX=y CONFIG_TYPHOON=y # CONFIG_LANCE is not set CONFIG_NET_VENDOR_SMC=y CONFIG_WD80x3=m CONFIG_ULTRA=m # CONFIG_SMC9194 is not set # CONFIG_NET_VENDOR_RACAL is not set # # Tulip family network device support # CONFIG_NET_TULIP=y # CONFIG_DE2104X is not set CONFIG_TULIP=y # CONFIG_TULIP_MWI is not set # CONFIG_TULIP_MMIO is not set # CONFIG_TULIP_NAPI is not set CONFIG_DE4X5=y # CONFIG_WINBOND_840 is not set CONFIG_DM9102=y # CONFIG_ULI526X is not set # CONFIG_PCMCIA_XIRCOM is not set # CONFIG_PCMCIA_XIRTULIP is not set # CONFIG_AT1700 is not set # CONFIG_DEPCA is not set # CONFIG_HP100 is not set # CONFIG_NET_ISA is not set CONFIG_NET_PCI=y CONFIG_PCNET32=y CONFIG_AMD8111_ETH=y # CONFIG_AMD8111E_NAPI is not set CONFIG_ADAPTEC_STARFIRE=y # CONFIG_ADAPTEC_STARFIRE_NAPI is not set # CONFIG_AC3200 is not set # CONFIG_APRICOT is not set CONFIG_B44=y CONFIG_FORCEDETH=y # CONFIG_CS89x0 is not set # CONFIG_DGRS is not set CONFIG_EEPRO100=y # CONFIG_E100 is not set # CONFIG_FEALNX is not set CONFIG_NATSEMI=y CONFIG_NE2K_PCI=y CONFIG_8139CP=y CONFIG_8139TOO=y # CONFIG_8139TOO_PIO is not set CONFIG_8139TOO_TUNE_TWISTER=y CONFIG_8139TOO_8129=y # CONFIG_8139_OLD_RX_RESET is not set CONFIG_SIS900=y CONFIG_EPIC100=y # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set CONFIG_VIA_RHINE=y # CONFIG_VIA_RHINE_MMIO is not set # CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) # CONFIG_ACENIC=y CONFIG_ACENIC_OMIT_TIGON_I=y CONFIG_DL2K=y CONFIG_E1000=y # CONFIG_E1000_NAPI is not set # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set CONFIG_NS83820=y CONFIG_HAMACHI=y CONFIG_YELLOWFIN=y CONFIG_R8169=y # CONFIG_R8169_NAPI is not set CONFIG_SIS190=y CONFIG_SKGE=y CONFIG_SKY2=y # CONFIG_SK98LIN is not set CONFIG_VIA_VELOCITY=y CONFIG_TIGON3=y CONFIG_BNX2=y # # Ethernet (10000 Mbit) # # CONFIG_CHELSIO_T1 is not set # CONFIG_IXGB is not set # CONFIG_S2IO is not set # # Token Ring devices # # CONFIG_TR is not set # # Wireless LAN (non-hamradio) # CONFIG_NET_RADIO=y # # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set # CONFIG_ARLAN is not set # CONFIG_WAVELAN is not set # # Wireless 802.11b ISA/PCI cards support # CONFIG_IPW2100=m # CONFIG_IPW2100_MONITOR is not set # CONFIG_IPW2100_DEBUG is not set CONFIG_IPW2200=m # CONFIG_IPW2200_DEBUG is not set CONFIG_AIRO=y CONFIG_HERMES=y CONFIG_PLX_HERMES=y CONFIG_TMD_HERMES=y CONFIG_NORTEL_HERMES=y CONFIG_PCI_HERMES=y CONFIG_ATMEL=y CONFIG_PCI_ATMEL=y # # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support # CONFIG_PRISM54=y # CONFIG_HOSTAP is not set CONFIG_NET_WIRELESS=y # # Wan interfaces # # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_SHAPER is not set # CONFIG_NETCONSOLE is not set # CONFIG_NETPOLL is not set # CONFIG_NET_POLL_CONTROLLER is not set # # ISDN subsystem # # CONFIG_ISDN is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # # CONFIG_INPUT_MOUSEDEV is not set CONFIG_INPUT_JOYDEV=y # CONFIG_INPUT_TSDEV is not set CONFIG_INPUT_EVDEV=m # CONFIG_INPUT_EVBUG is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_INPUT_MOUSE is not set CONFIG_INPUT_JOYSTICK=y # CONFIG_JOYSTICK_ANALOG is not set # CONFIG_JOYSTICK_A3D is not set # CONFIG_JOYSTICK_ADI is not set # CONFIG_JOYSTICK_COBRA is not set # CONFIG_JOYSTICK_GF2K is not set CONFIG_JOYSTICK_GRIP=y # CONFIG_JOYSTICK_GRIP_MP is not set # CONFIG_JOYSTICK_GUILLEMOT is not set # CONFIG_JOYSTICK_INTERACT is not set CONFIG_JOYSTICK_SIDEWINDER=y # CONFIG_JOYSTICK_TMDC is not set # CONFIG_JOYSTICK_IFORCE is not set # CONFIG_JOYSTICK_WARRIOR is not set # CONFIG_JOYSTICK_MAGELLAN is not set # CONFIG_JOYSTICK_SPACEORB is not set # CONFIG_JOYSTICK_SPACEBALL is not set # CONFIG_JOYSTICK_STINGER is not set # CONFIG_JOYSTICK_TWIDJOY is not set # CONFIG_JOYSTICK_DB9 is not set # CONFIG_JOYSTICK_GAMECON is not set # CONFIG_JOYSTICK_TURBOGRAFX is not set # CONFIG_JOYSTICK_JOYDUMP is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set # # Hardware I/O ports # CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PCIPS2 is not set CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set CONFIG_GAMEPORT=y CONFIG_GAMEPORT_NS558=y # CONFIG_GAMEPORT_L4 is not set CONFIG_GAMEPORT_EMU10K1=y # CONFIG_GAMEPORT_FM801 is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=m # CONFIG_SERIAL_8250_ACPI is not set CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=m # CONFIG_SERIAL_JSM is not set # CONFIG_UNIX98_PTYS is not set CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_PRINTER is not set CONFIG_PPDEV=y # CONFIG_TIPAR is not set # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set # CONFIG_HW_RANDOM is not set # CONFIG_NVRAM is not set CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # CONFIG_SONYPI is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set # CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_MWAVE is not set # CONFIG_CS5535_GPIO is not set # CONFIG_RAW_DRIVER is not set # CONFIG_HPET is not set # CONFIG_HANGCHECK_TIMER is not set # # TPM devices # # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set # # I2C support # CONFIG_I2C=y CONFIG_I2C_CHARDEV=y # # I2C Algorithms # CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_ALGOPCF is not set # CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_ELEKTOR is not set # CONFIG_I2C_I801 is not set # CONFIG_I2C_I810 is not set # CONFIG_I2C_PIIX4 is not set # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set # CONFIG_SCx200_ACB is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set CONFIG_I2C_SIS96X=y # CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set # CONFIG_I2C_PCA_ISA is not set # # Miscellaneous I2C Chip support # # CONFIG_SENSORS_DS1337 is not set # CONFIG_SENSORS_DS1374 is not set # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCA9539 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set # CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # SPI support # # CONFIG_SPI is not set # CONFIG_SPI_MASTER is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Hardware Monitoring support # # CONFIG_HWMON is not set # CONFIG_HWMON_VID is not set # # Misc devices # # CONFIG_IBM_ASM is not set # # Multimedia Capabilities Port drivers # # # Multimedia devices # CONFIG_VIDEO_DEV=y # # Video For Linux # # # Video Adapters # # CONFIG_VIDEO_ADV_DEBUG is not set CONFIG_VIDEO_BT848=m CONFIG_VIDEO_BT848_DVB=y # CONFIG_VIDEO_SAA6588 is not set # CONFIG_VIDEO_PMS is not set # CONFIG_VIDEO_BWQCAM is not set # CONFIG_VIDEO_CQCAM is not set # CONFIG_VIDEO_CPIA is not set # CONFIG_VIDEO_SAA5246A is not set # CONFIG_VIDEO_SAA5249 is not set # CONFIG_TUNER_3036 is not set # CONFIG_VIDEO_STRADIS is not set # CONFIG_VIDEO_ZORAN is not set CONFIG_VIDEO_SAA7134=m # CONFIG_VIDEO_SAA7134_ALSA is not set CONFIG_VIDEO_SAA7134_DVB=m CONFIG_VIDEO_SAA7134_DVB_ALL_FRONTENDS=y # CONFIG_VIDEO_MXB is not set # CONFIG_VIDEO_DPC is not set # CONFIG_VIDEO_HEXIUM_ORION is not set # CONFIG_VIDEO_HEXIUM_GEMINI is not set CONFIG_VIDEO_CX88=m # CONFIG_VIDEO_CX88_ALSA is not set CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=y CONFIG_VIDEO_CX88_VP3054=m # CONFIG_VIDEO_EM28XX is not set # CONFIG_VIDEO_OVCAMCHIP is not set CONFIG_VIDEO_AUDIO_DECODER=m CONFIG_VIDEO_DECODER=m # # Radio Adapters # # CONFIG_RADIO_CADET is not set # CONFIG_RADIO_RTRACK is not set # CONFIG_RADIO_RTRACK2 is not set # CONFIG_RADIO_AZTECH is not set # CONFIG_RADIO_GEMTEK is not set # CONFIG_RADIO_GEMTEK_PCI is not set # CONFIG_RADIO_MAXIRADIO is not set # CONFIG_RADIO_MAESTRO is not set # CONFIG_RADIO_SF16FMI is not set # CONFIG_RADIO_SF16FMR2 is not set # CONFIG_RADIO_TERRATEC is not set # CONFIG_RADIO_TRUST is not set # CONFIG_RADIO_TYPHOON is not set # CONFIG_RADIO_ZOLTRIX is not set # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=y # # Supported SAA7146 based PCI Adapters # CONFIG_DVB_AV7110=m # CONFIG_DVB_AV7110_OSD is not set CONFIG_DVB_BUDGET=m CONFIG_DVB_BUDGET_CI=m CONFIG_DVB_BUDGET_AV=m # CONFIG_DVB_BUDGET_PATCH is not set # # Supported USB Adapters # CONFIG_DVB_USB=m # CONFIG_DVB_USB_DEBUG is not set CONFIG_DVB_USB_A800=m CONFIG_DVB_USB_DIBUSB_MB=m # CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set CONFIG_DVB_USB_DIBUSB_MC=m CONFIG_DVB_USB_UMT_010=m CONFIG_DVB_USB_CXUSB=m CONFIG_DVB_USB_DIGITV=m CONFIG_DVB_USB_VP7045=m CONFIG_DVB_USB_VP702X=m CONFIG_DVB_USB_NOVA_T_USB2=m CONFIG_DVB_USB_DTT200U=m CONFIG_DVB_TTUSB_BUDGET=m CONFIG_DVB_TTUSB_DEC=m CONFIG_DVB_CINERGYT2=m # CONFIG_DVB_CINERGYT2_TUNING is not set # # Supported FlexCopII (B2C2) Adapters # CONFIG_DVB_B2C2_FLEXCOP=m CONFIG_DVB_B2C2_FLEXCOP_PCI=m CONFIG_DVB_B2C2_FLEXCOP_USB=m # CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set # # Supported BT878 Adapters # CONFIG_DVB_BT8XX=m # # Supported Pluto2 Adapters # CONFIG_DVB_PLUTO2=m # # Supported DVB Frontends # # # Customise DVB Frontends # # # DVB-S (satellite) frontends # CONFIG_DVB_STV0299=m CONFIG_DVB_CX24110=m CONFIG_DVB_CX24123=m CONFIG_DVB_TDA8083=m CONFIG_DVB_MT312=m CONFIG_DVB_VES1X93=m CONFIG_DVB_S5H1420=m # # DVB-T (terrestrial) frontends # CONFIG_DVB_SP8870=m CONFIG_DVB_SP887X=m CONFIG_DVB_CX22700=m CONFIG_DVB_CX22702=m CONFIG_DVB_L64781=m CONFIG_DVB_TDA1004X=m CONFIG_DVB_NXT6000=m CONFIG_DVB_MT352=m CONFIG_DVB_DIB3000MB=m CONFIG_DVB_DIB3000MC=m # # DVB-C (cable) frontends # CONFIG_DVB_VES1820=m CONFIG_DVB_TDA10021=m CONFIG_DVB_STV0297=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m CONFIG_DVB_OR51211=m CONFIG_DVB_OR51132=m CONFIG_DVB_BCM3510=m CONFIG_DVB_LGDT330X=m CONFIG_VIDEO_SAA7146=m CONFIG_VIDEO_SAA7146_VV=m CONFIG_VIDEO_VIDEOBUF=m CONFIG_VIDEO_TUNER=m CONFIG_VIDEO_BUF=m CONFIG_VIDEO_BUF_DVB=m CONFIG_VIDEO_BTCX=m CONFIG_VIDEO_IR=m CONFIG_VIDEO_TVEEPROM=m # # Graphics support # CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ARC is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set CONFIG_FB_VESA=y CONFIG_VIDEO_SELECT=y # CONFIG_FB_HGA is not set # CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_I810 is not set # CONFIG_FB_INTEL is not set # CONFIG_FB_MATROX is not set # CONFIG_FB_RADEON_OLD is not set # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_GEODE is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y # CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Logo configuration # # CONFIG_LOGO is not set # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Bootsplash configuration # CONFIG_BOOTSPLASH=y # # Sound # CONFIG_SOUND=y # # Advanced Linux Sound Architecture # CONFIG_SND=y CONFIG_SND_TIMER=y CONFIG_SND_PCM=y CONFIG_SND_HWDEP=y CONFIG_SND_RAWMIDI=y # CONFIG_SND_SEQUENCER is not set # CONFIG_SND_MIXER_OSS is not set # CONFIG_SND_PCM_OSS is not set # CONFIG_SND_RTCTIMER is not set # CONFIG_SND_DYNAMIC_MINORS is not set # CONFIG_SND_SUPPORT_OLD_API is not set # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set # # Generic devices # CONFIG_SND_MPU401_UART=y CONFIG_SND_OPL3_LIB=y CONFIG_SND_OPL4_LIB=m CONFIG_SND_VX_LIB=y CONFIG_SND_AC97_CODEC=y CONFIG_SND_AC97_BUS=y # CONFIG_SND_DUMMY is not set # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set # # ISA devices # CONFIG_SND_AD1848_LIB=m CONFIG_SND_CS4231_LIB=m CONFIG_SND_AD1816A=m CONFIG_SND_AD1848=m CONFIG_SND_ALS100=m CONFIG_SND_AZT2320=m CONFIG_SND_CMI8330=m CONFIG_SND_CS4231=m CONFIG_SND_CS4232=m CONFIG_SND_CS4236=m CONFIG_SND_DT019X=m CONFIG_SND_ES968=m CONFIG_SND_ES1688=m CONFIG_SND_ES18XX=m CONFIG_SND_GUS_SYNTH=m CONFIG_SND_GUSCLASSIC=m CONFIG_SND_GUSEXTREME=m CONFIG_SND_GUSMAX=m CONFIG_SND_INTERWAVE=m CONFIG_SND_INTERWAVE_STB=m CONFIG_SND_OPL3SA2=m CONFIG_SND_OPTI92X_AD1848=m CONFIG_SND_OPTI92X_CS4231=m CONFIG_SND_OPTI93X=m CONFIG_SND_SB8=m CONFIG_SND_SB16=m CONFIG_SND_SBAWE=m CONFIG_SND_SB16_CSP=y CONFIG_SND_SGALAXY=m CONFIG_SND_SSCAPE=m CONFIG_SND_WAVEFRONT=m # # PCI devices # CONFIG_SND_AD1889=y CONFIG_SND_ALS4000=y CONFIG_SND_ALI5451=y CONFIG_SND_ATIIXP=y # CONFIG_SND_ATIIXP_MODEM is not set CONFIG_SND_AU8810=y CONFIG_SND_AU8820=y CONFIG_SND_AU8830=y CONFIG_SND_AZT3328=y # CONFIG_SND_BT87X is not set CONFIG_SND_CA0106=y CONFIG_SND_CMIPCI=y CONFIG_SND_CS4281=y CONFIG_SND_CS46XX=y CONFIG_SND_CS46XX_NEW_DSP=y CONFIG_SND_CS5535AUDIO=y CONFIG_SND_EMU10K1=y CONFIG_SND_EMU10K1X=y CONFIG_SND_ENS1370=y CONFIG_SND_ENS1371=y CONFIG_SND_ES1938=y CONFIG_SND_ES1968=y CONFIG_SND_FM801=y # CONFIG_SND_FM801_TEA575X is not set CONFIG_SND_HDA_INTEL=y # CONFIG_SND_HDSP is not set # CONFIG_SND_HDSPM is not set CONFIG_SND_ICE1712=y CONFIG_SND_ICE1724=y CONFIG_SND_INTEL8X0=y CONFIG_SND_INTEL8X0M=y # CONFIG_SND_KORG1212 is not set CONFIG_SND_MAESTRO3=y # CONFIG_SND_MIXART is not set CONFIG_SND_NM256=y # CONFIG_SND_PCXHR is not set # CONFIG_SND_RME32 is not set # CONFIG_SND_RME96 is not set # CONFIG_SND_RME9652 is not set CONFIG_SND_SONICVIBES=y CONFIG_SND_TRIDENT=y CONFIG_SND_VIA82XX=y # CONFIG_SND_VIA82XX_MODEM is not set CONFIG_SND_VX222=y CONFIG_SND_YMFPCI=y # # USB devices # # CONFIG_SND_USB_AUDIO is not set # CONFIG_SND_USB_USX2Y is not set # # Open Sound System # # CONFIG_SOUND_PRIME is not set # # USB support # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=y # CONFIG_USB_EHCI_SPLIT_ISO is not set # CONFIG_USB_EHCI_ROOT_HUB_TT is not set # CONFIG_USB_ISP116X_HCD is not set CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_BIG_ENDIAN is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_UHCI_HCD=y # CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers # # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' # # # may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_FREECOM=y CONFIG_USB_STORAGE_ISD200=y CONFIG_USB_STORAGE_DPCM=y CONFIG_USB_STORAGE_USBAT=y CONFIG_USB_STORAGE_SDDR09=y CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y CONFIG_USB_STORAGE_ALAUDA=y # CONFIG_USB_LIBUSUAL is not set # # USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y # CONFIG_USB_HIDINPUT_POWERBOOK is not set # CONFIG_HID_FF is not set # CONFIG_USB_HIDDEV is not set # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_ACECAD is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_ITMTOUCH is not set # CONFIG_USB_EGALAX is not set # CONFIG_USB_YEALINK is not set CONFIG_USB_XPAD=y # CONFIG_USB_ATI_REMOTE is not set # CONFIG_USB_ATI_REMOTE2 is not set # CONFIG_USB_KEYSPAN_REMOTE is not set # CONFIG_USB_APPLETOUCH is not set # # USB Imaging devices # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # # USB Multimedia devices # # CONFIG_USB_DABUSB is not set # CONFIG_USB_VICAM is not set # CONFIG_USB_DSBR is not set # CONFIG_USB_ET61X251 is not set # CONFIG_USB_IBMCAM is not set # CONFIG_USB_KONICAWC is not set # CONFIG_USB_OV511 is not set # CONFIG_USB_SE401 is not set # CONFIG_USB_SN9C102 is not set # CONFIG_USB_STV680 is not set # CONFIG_USB_PWC is not set # # USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set CONFIG_USB_PEGASUS=y CONFIG_USB_RTL8150=y # CONFIG_USB_USBNET is not set # CONFIG_USB_ZD1201 is not set # CONFIG_USB_MON is not set # # USB port drivers # # CONFIG_USB_USS720 is not set # # USB Serial Converter support # # CONFIG_USB_SERIAL is not set # # USB Miscellaneous drivers # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_IDMOUSE is not set # CONFIG_USB_SISUSBVGA is not set # CONFIG_USB_LD is not set # CONFIG_USB_TEST is not set # # USB DSL modem support # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # # CONFIG_MMC is not set # # InfiniBand support # # CONFIG_INFINIBAND is not set # # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) # # CONFIG_EDAC is not set # # File systems # CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XIP is not set CONFIG_EXT3_FS=y # CONFIG_EXT3_FS_XATTR is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_REISERFS_FS=y # CONFIG_REISERFS_CHECK is not set # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set # CONFIG_XFS_FS is not set # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_INOTIFY is not set # CONFIG_QUOTA is not set # CONFIG_DNOTIFY is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set CONFIG_FUSE_FS=y # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=y CONFIG_UDF_FS=y CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=y # CONFIG_MSDOS_FS is not set CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=850 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_NTFS_FS=y # CONFIG_NTFS_DEBUG is not set # CONFIG_NTFS_RW is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_TMPFS is not set # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # CONFIG_RELAYFS_FS is not set # CONFIG_CONFIGFS_FS is not set # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set CONFIG_HFS_FS=y CONFIG_HFSPLUS_FS=y # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set CONFIG_UFS_FS=y # # Network File Systems # CONFIG_NFS_FS=y # CONFIG_NFS_V3 is not set # CONFIG_NFS_V4 is not set # CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set CONFIG_LOCKD=y CONFIG_NFS_COMMON=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=y # CONFIG_SMB_NLS_DEFAULT is not set CONFIG_CIFS=y # CONFIG_CIFS_STATS is not set # CONFIG_CIFS_XATTR is not set # CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # CONFIG_9P_FS is not set # # Partition Types # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set # CONFIG_OSF_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y # CONFIG_BSD_DISKLABEL is not set # CONFIG_MINIX_SUBPARTITION is not set # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set # CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_KARMA_PARTITION is not set # CONFIG_EFI_PARTITION is not set # # Native Language Support # CONFIG_NLS=y CONFIG_NLS_DEFAULT="utf8" # CONFIG_NLS_CODEPAGE_437 is not set # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set CONFIG_NLS_CODEPAGE_850=y # CONFIG_NLS_CODEPAGE_852 is not set # CONFIG_NLS_CODEPAGE_855 is not set # CONFIG_NLS_CODEPAGE_857 is not set # CONFIG_NLS_CODEPAGE_860 is not set # CONFIG_NLS_CODEPAGE_861 is not set # CONFIG_NLS_CODEPAGE_862 is not set # CONFIG_NLS_CODEPAGE_863 is not set # CONFIG_NLS_CODEPAGE_864 is not set # CONFIG_NLS_CODEPAGE_865 is not set # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set # CONFIG_NLS_CODEPAGE_936 is not set # CONFIG_NLS_CODEPAGE_950 is not set # CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ASCII is not set CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set # CONFIG_NLS_ISO8859_5 is not set # CONFIG_NLS_ISO8859_6 is not set # CONFIG_NLS_ISO8859_7 is not set # CONFIG_NLS_ISO8859_9 is not set # CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set # CONFIG_NLS_ISO8859_15 is not set # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set CONFIG_NLS_UTF8=y # # Instrumentation Support # # CONFIG_PROFILING is not set # CONFIG_KPROBES is not set # # Kernel hacking # # CONFIG_PRINTK_TIME is not set # CONFIG_MAGIC_SYSRQ is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_DEBUG_BUGVERBOSE is not set CONFIG_EARLY_PRINTK=y CONFIG_X86_FIND_SMP_CONFIG=y CONFIG_X86_MPPARSE=y # # Security options # # CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # CONFIG_CRYPTO=y # CONFIG_CRYPTO_HMAC is not set # CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_MD4 is not set # CONFIG_CRYPTO_MD5 is not set # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set # CONFIG_CRYPTO_WP512 is not set # CONFIG_CRYPTO_TGR192 is not set # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set # CONFIG_CRYPTO_SERPENT is not set CONFIG_CRYPTO_AES=y # CONFIG_CRYPTO_AES_586 is not set # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set CONFIG_CRYPTO_ARC4=y # CONFIG_CRYPTO_KHAZAD is not set # CONFIG_CRYPTO_ANUBIS is not set # CONFIG_CRYPTO_DEFLATE is not set CONFIG_CRYPTO_MICHAEL_MIC=y # CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_TEST is not set # # Hardware crypto devices # # CONFIG_CRYPTO_DEV_PADLOCK is not set # # Library routines # CONFIG_CRC_CCITT=y # CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_X86_BIOS_REBOOT=y CONFIG_KTIME_SCALAR=y geexbox-1.0/packages/linux/config/linux.ppc.conf0000644000175000017500000010515210446314264020776 0ustar aurelaurel# # Automatically generated make config: don't edit # Linux kernel version: 2.6.16 # # CONFIG_PPC64 is not set CONFIG_PPC32=y CONFIG_PPC_MERGE=y CONFIG_MMU=y CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PPC=y CONFIG_EARLY_PRINTK=y CONFIG_GENERIC_NVRAM=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_PPC_OF=y CONFIG_PPC_UDBG_16550=y # CONFIG_GENERIC_TBSYNC is not set # CONFIG_DEFAULT_UIMAGE is not set # # Processor support # CONFIG_CLASSIC32=y # CONFIG_PPC_52xx is not set # CONFIG_PPC_82xx is not set # CONFIG_PPC_83xx is not set # CONFIG_40x is not set # CONFIG_44x is not set # CONFIG_8xx is not set # CONFIG_E200 is not set # CONFIG_E500 is not set CONFIG_6xx=y CONFIG_PPC_FPU=y CONFIG_ALTIVEC=y CONFIG_PPC_STD_MMU=y CONFIG_PPC_STD_MMU_32=y # CONFIG_SMP is not set # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 # # General setup # CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set # CONFIG_SWAP is not set # CONFIG_SYSVIPC is not set # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_EMBEDDED=y # CONFIG_KALLSYMS is not set CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y # CONFIG_ELF_CORE is not set CONFIG_BASE_FULL=y # CONFIG_FUTEX is not set # CONFIG_EPOLL is not set CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 CONFIG_SLAB=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # CONFIG_SLOB is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set # CONFIG_KMOD is not set # # Block layer # # CONFIG_LBD is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y # CONFIG_IOSCHED_AS is not set CONFIG_IOSCHED_DEADLINE=y # CONFIG_IOSCHED_CFQ is not set # CONFIG_DEFAULT_AS is not set CONFIG_DEFAULT_DEADLINE=y # CONFIG_DEFAULT_CFQ is not set # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="deadline" # # Platform support # CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_ISERIES is not set # CONFIG_EMBEDDED6xx is not set # CONFIG_APUS is not set CONFIG_PPC_CHRP=y CONFIG_PPC_PMAC=y CONFIG_MPIC=y CONFIG_PPC_RTAS=y # CONFIG_RTAS_ERROR_LOGGING is not set # CONFIG_RTAS_PROC is not set # CONFIG_MMIO_NVRAM is not set CONFIG_PPC_MPC106=y CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_TABLE=y # CONFIG_CPU_FREQ_DEBUG is not set # CONFIG_CPU_FREQ_STAT is not set CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set CONFIG_CPU_FREQ_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_GOV_POWERSAVE is not set # CONFIG_CPU_FREQ_GOV_USERSPACE is not set # CONFIG_CPU_FREQ_GOV_ONDEMAND is not set CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y CONFIG_CPU_FREQ_PMAC=y # CONFIG_PPC601_SYNC_FIX is not set # CONFIG_TAU is not set # CONFIG_WANT_EARLY_SERIAL is not set # # Kernel options # # CONFIG_HIGHMEM is not set # CONFIG_HZ_100 is not set # CONFIG_HZ_250 is not set CONFIG_HZ_1000=y CONFIG_HZ=1000 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set # CONFIG_KEXEC is not set CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set # CONFIG_SPARSEMEM_MANUAL is not set CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_PROC_DEVICETREE is not set # CONFIG_CMDLINE_BOOL is not set CONFIG_PM=y CONFIG_PM_LEGACY=y # CONFIG_PM_DEBUG is not set # CONFIG_SOFTWARE_SUSPEND is not set # CONFIG_SECCOMP is not set CONFIG_ISA_DMA_API=y # # Bus options # # CONFIG_ISA is not set CONFIG_GENERIC_ISA_DMA=y CONFIG_PPC_I8259=y CONFIG_PPC_INDIRECT_PCI=y CONFIG_PCI=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_LEGACY_PROC=y # # PCCARD (PCMCIA/CardBus) support # CONFIG_PCCARD=y # CONFIG_PCMCIA_DEBUG is not set # CONFIG_PCMCIA is not set CONFIG_CARDBUS=y # # PC-card bridges # CONFIG_YENTA=y CONFIG_YENTA_O2=y CONFIG_YENTA_RICOH=y CONFIG_YENTA_TI=y # CONFIG_YENTA_ENE_TUNE is not set CONFIG_YENTA_TOSHIBA=y CONFIG_PCCARD_NONSTATIC=y # # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set # # Advanced setup # # CONFIG_ADVANCED_OPTIONS is not set # # Default settings for advanced configuration options are used # CONFIG_HIGHMEM_START=0xfe000000 CONFIG_LOWMEM_SIZE=0x30000000 CONFIG_KERNEL_START=0xc0000000 CONFIG_TASK_SIZE=0x80000000 CONFIG_BOOT_LOAD=0x00800000 # # Networking # CONFIG_NET=y # # Networking options # # CONFIG_NETDEBUG is not set CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set CONFIG_UNIX=y # CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IP_FIB_HASH=y # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set # CONFIG_SYN_COOKIES is not set # CONFIG_INET_AH is not set # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set # CONFIG_INET_DIAG is not set # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_BIC=y # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set # # DCCP Configuration (EXPERIMENTAL) # # CONFIG_IP_DCCP is not set # # SCTP Configuration (EXPERIMENTAL) # # CONFIG_IP_SCTP is not set # # TIPC Configuration (EXPERIMENTAL) # # CONFIG_TIPC is not set # CONFIG_ATM is not set # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set # CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set # # Network testing # # CONFIG_NET_PKTGEN is not set # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set CONFIG_IEEE80211=y # CONFIG_IEEE80211_DEBUG is not set CONFIG_IEEE80211_CRYPT_WEP=y CONFIG_IEEE80211_CRYPT_CCMP=y CONFIG_IEEE80211_CRYPT_TKIP=y # # Device Drivers # # # Generic Driver Options # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # # Connector - unified userspace <-> kernelspace linker # # CONFIG_CONNECTOR is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # # CONFIG_PARPORT is not set # # Plug and Play support # # # Block devices # # CONFIG_BLK_DEV_FD is not set # CONFIG_MAC_FLOPPY is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_COW_COMMON is not set # CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_SX8=y # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=2048 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set CONFIG_BLK_DEV_IDEFLOPPY=y # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y CONFIG_BLK_DEV_OPTI621=y # CONFIG_BLK_DEV_SL82C105 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_AEC62XX=y CONFIG_BLK_DEV_ALI15X3=y # CONFIG_WDC_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set CONFIG_BLK_DEV_CMD64X=y CONFIG_BLK_DEV_TRIFLEX=y CONFIG_BLK_DEV_CY82C693=y # CONFIG_BLK_DEV_CS5520 is not set CONFIG_BLK_DEV_CS5530=y CONFIG_BLK_DEV_HPT34X=y # CONFIG_HPT34X_AUTODMA is not set CONFIG_BLK_DEV_HPT366=y # CONFIG_BLK_DEV_SC1200 is not set CONFIG_BLK_DEV_PIIX=y CONFIG_BLK_DEV_IT821X=y CONFIG_BLK_DEV_NS87415=y CONFIG_BLK_DEV_PDC202XX_OLD=y # CONFIG_PDC202XX_BURST is not set CONFIG_BLK_DEV_PDC202XX_NEW=y # CONFIG_BLK_DEV_SVWKS is not set CONFIG_BLK_DEV_SIIMAGE=y CONFIG_BLK_DEV_SLC90E66=y # CONFIG_BLK_DEV_TRM290 is not set CONFIG_BLK_DEV_VIA82CXXX=y CONFIG_BLK_DEV_IDE_PMAC=y CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y CONFIG_BLK_DEV_IDEDMA_PMAC=y # CONFIG_BLK_DEV_IDE_PMAC_BLINK is not set # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # # CONFIG_RAID_ATTRS is not set CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set CONFIG_CHR_DEV_SG=y # CONFIG_CHR_DEV_SCH is not set # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_FC_ATTRS is not set # CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_SAS_ATTRS is not set # # SCSI low-level drivers # # CONFIG_ISCSI_TCP is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set CONFIG_SCSI_AIC7XXX=y CONFIG_AIC7XXX_CMDS_PER_DEVICE=253 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 # CONFIG_AIC7XXX_DEBUG_ENABLE is not set CONFIG_AIC7XXX_DEBUG_MASK=0 # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set CONFIG_SCSI_SATA=y CONFIG_SCSI_SATA_AHCI=y CONFIG_SCSI_SATA_SVW=y CONFIG_SCSI_ATA_PIIX=y CONFIG_SCSI_SATA_MV=y CONFIG_SCSI_SATA_NV=y CONFIG_SCSI_PDC_ADMA=y CONFIG_SCSI_SATA_QSTOR=y CONFIG_SCSI_SATA_PROMISE=y CONFIG_SCSI_SATA_SX4=y CONFIG_SCSI_SATA_SIL=y CONFIG_SCSI_SATA_SIL24=y CONFIG_SCSI_SATA_SIS=y CONFIG_SCSI_SATA_ULI=y CONFIG_SCSI_SATA_VIA=y CONFIG_SCSI_SATA_VITESSE=y CONFIG_SCSI_SATA_INTEL_COMBINED=y CONFIG_SCSI_BUSLOGIC=y CONFIG_SCSI_OMIT_FLASHPOINT=y # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLA_FC is not set # CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_DC395x is not set CONFIG_SCSI_DC390T=y # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # CONFIG_SCSI_MESH is not set # CONFIG_SCSI_MAC53C94 is not set # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set # CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support # CONFIG_IEEE1394=y # # Subsystem Options # # CONFIG_IEEE1394_VERBOSEDEBUG is not set # CONFIG_IEEE1394_OUI_DB is not set # CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set # CONFIG_IEEE1394_EXPORT_FULL_API is not set # # Device Drivers # CONFIG_IEEE1394_PCILYNX=y CONFIG_IEEE1394_OHCI1394=y # # Protocol Drivers # # CONFIG_IEEE1394_VIDEO1394 is not set CONFIG_IEEE1394_SBP2=y # CONFIG_IEEE1394_SBP2_PHYS_DMA is not set # CONFIG_IEEE1394_ETH1394 is not set # CONFIG_IEEE1394_DV1394 is not set # CONFIG_IEEE1394_RAWIO is not set # # I2O device support # # CONFIG_I2O is not set # # Macintosh device drivers # CONFIG_ADB=y CONFIG_ADB_CUDA=y CONFIG_ADB_PMU=y # CONFIG_PMAC_APM_EMU is not set CONFIG_PMAC_MEDIABAY=y # CONFIG_PMAC_BACKLIGHT is not set # CONFIG_ADB_MACIO is not set CONFIG_INPUT_ADBHID=y # CONFIG_MAC_EMUMOUSEBTN is not set # CONFIG_THERM_WINDTUNNEL is not set # CONFIG_THERM_ADT746X is not set # CONFIG_WINDFARM is not set # CONFIG_ANSLCD is not set # # Network device support # CONFIG_NETDEVICES=y # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # # ARCnet devices # # CONFIG_ARCNET is not set # # PHY device support # # CONFIG_PHYLIB is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=y CONFIG_MACE=y # CONFIG_MACE_AAUI_PORT is not set CONFIG_BMAC=y CONFIG_HAPPYMEAL=y CONFIG_SUNGEM=y CONFIG_CASSINI=y CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=y CONFIG_TYPHOON=y # # Tulip family network device support # CONFIG_NET_TULIP=y # CONFIG_DE2104X is not set CONFIG_TULIP=y # CONFIG_TULIP_MWI is not set # CONFIG_TULIP_MMIO is not set # CONFIG_TULIP_NAPI is not set CONFIG_DE4X5=y # CONFIG_WINBOND_840 is not set CONFIG_DM9102=y # CONFIG_ULI526X is not set # CONFIG_PCMCIA_XIRCOM is not set # CONFIG_PCMCIA_XIRTULIP is not set # CONFIG_HP100 is not set CONFIG_NET_PCI=y CONFIG_PCNET32=y CONFIG_AMD8111_ETH=y # CONFIG_AMD8111E_NAPI is not set CONFIG_ADAPTEC_STARFIRE=y # CONFIG_ADAPTEC_STARFIRE_NAPI is not set CONFIG_B44=y CONFIG_FORCEDETH=y # CONFIG_DGRS is not set CONFIG_EEPRO100=y # CONFIG_E100 is not set # CONFIG_FEALNX is not set CONFIG_NATSEMI=y CONFIG_NE2K_PCI=y CONFIG_8139CP=y CONFIG_8139TOO=y # CONFIG_8139TOO_PIO is not set CONFIG_8139TOO_TUNE_TWISTER=y CONFIG_8139TOO_8129=y # CONFIG_8139_OLD_RX_RESET is not set CONFIG_SIS900=y CONFIG_EPIC100=y # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set CONFIG_VIA_RHINE=y # CONFIG_VIA_RHINE_MMIO is not set # # Ethernet (1000 Mbit) # CONFIG_ACENIC=y CONFIG_ACENIC_OMIT_TIGON_I=y # CONFIG_DL2K is not set CONFIG_E1000=y # CONFIG_E1000_NAPI is not set # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set CONFIG_R8169=y # CONFIG_R8169_NAPI is not set CONFIG_SIS190=y # CONFIG_SKGE is not set # CONFIG_SKY2 is not set CONFIG_SK98LIN=y CONFIG_VIA_VELOCITY=y CONFIG_TIGON3=y CONFIG_BNX2=y # CONFIG_MV643XX_ETH is not set # # Ethernet (10000 Mbit) # # CONFIG_CHELSIO_T1 is not set # CONFIG_IXGB is not set # CONFIG_S2IO is not set # # Token Ring devices # # CONFIG_TR is not set # # Wireless LAN (non-hamradio) # CONFIG_NET_RADIO=y # # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set # # Wireless 802.11b ISA/PCI cards support # CONFIG_IPW2100=m # CONFIG_IPW2100_MONITOR is not set # CONFIG_IPW2100_DEBUG is not set CONFIG_IPW2200=m # CONFIG_IPW2200_DEBUG is not set CONFIG_AIRO=y CONFIG_HERMES=y # CONFIG_APPLE_AIRPORT is not set CONFIG_PLX_HERMES=y CONFIG_TMD_HERMES=y CONFIG_NORTEL_HERMES=y CONFIG_PCI_HERMES=y CONFIG_ATMEL=y CONFIG_PCI_ATMEL=y # # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support # CONFIG_PRISM54=y # CONFIG_HOSTAP is not set CONFIG_NET_WIRELESS=y # # Wan interfaces # # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_SHAPER is not set # CONFIG_NETCONSOLE is not set # CONFIG_NETPOLL is not set # CONFIG_NET_POLL_CONTROLLER is not set # # ISDN subsystem # # CONFIG_ISDN is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # # CONFIG_INPUT_MOUSEDEV is not set CONFIG_INPUT_JOYDEV=y # CONFIG_INPUT_TSDEV is not set # CONFIG_INPUT_EVDEV is not set # CONFIG_INPUT_EVBUG is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_INPUT_MOUSE is not set CONFIG_INPUT_JOYSTICK=y # CONFIG_JOYSTICK_ANALOG is not set # CONFIG_JOYSTICK_A3D is not set # CONFIG_JOYSTICK_ADI is not set # CONFIG_JOYSTICK_COBRA is not set # CONFIG_JOYSTICK_GF2K is not set CONFIG_JOYSTICK_GRIP=y # CONFIG_JOYSTICK_GRIP_MP is not set # CONFIG_JOYSTICK_GUILLEMOT is not set # CONFIG_JOYSTICK_INTERACT is not set CONFIG_JOYSTICK_SIDEWINDER=y # CONFIG_JOYSTICK_TMDC is not set # CONFIG_JOYSTICK_IFORCE is not set # CONFIG_JOYSTICK_WARRIOR is not set # CONFIG_JOYSTICK_MAGELLAN is not set # CONFIG_JOYSTICK_SPACEORB is not set # CONFIG_JOYSTICK_SPACEBALL is not set # CONFIG_JOYSTICK_STINGER is not set # CONFIG_JOYSTICK_TWIDJOY is not set # CONFIG_JOYSTICK_JOYDUMP is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set # # Hardware I/O ports # CONFIG_SERIO=y # CONFIG_SERIO_I8042 is not set # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_PCIPS2 is not set CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set CONFIG_GAMEPORT=y CONFIG_GAMEPORT_NS558=y # CONFIG_GAMEPORT_L4 is not set CONFIG_GAMEPORT_EMU10K1=y # CONFIG_GAMEPORT_FM801 is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=m CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=m # CONFIG_SERIAL_PMACZILOG is not set # CONFIG_SERIAL_JSM is not set # CONFIG_UNIX98_PTYS is not set CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set # CONFIG_NVRAM is not set # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set # # I2C support # CONFIG_I2C=y # CONFIG_I2C_CHARDEV is not set # # I2C Algorithms # CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_ALGOPCF is not set # CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_HYDRA is not set # CONFIG_I2C_I801 is not set # CONFIG_I2C_I810 is not set # CONFIG_I2C_PIIX4 is not set CONFIG_I2C_POWERMAC=y # CONFIG_I2C_MPC is not set # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set # CONFIG_SCx200_ACB is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set # CONFIG_I2C_PCA_ISA is not set # # Miscellaneous I2C Chip support # # CONFIG_SENSORS_DS1337 is not set # CONFIG_SENSORS_DS1374 is not set # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCA9539 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_M41T00 is not set # CONFIG_SENSORS_MAX6875 is not set # CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # SPI support # # CONFIG_SPI is not set # CONFIG_SPI_MASTER is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Hardware Monitoring support # # CONFIG_HWMON is not set # CONFIG_HWMON_VID is not set # # Misc devices # # # Multimedia Capabilities Port drivers # # # Multimedia devices # CONFIG_VIDEO_DEV=y # # Video For Linux # # # Video Adapters # # CONFIG_VIDEO_ADV_DEBUG is not set CONFIG_VIDEO_BT848=m CONFIG_VIDEO_BT848_DVB=y # CONFIG_VIDEO_SAA6588 is not set # CONFIG_VIDEO_CPIA is not set # CONFIG_VIDEO_SAA5246A is not set # CONFIG_VIDEO_SAA5249 is not set # CONFIG_TUNER_3036 is not set # CONFIG_VIDEO_STRADIS is not set # CONFIG_VIDEO_ZORAN is not set CONFIG_VIDEO_SAA7134=m # CONFIG_VIDEO_SAA7134_ALSA is not set CONFIG_VIDEO_SAA7134_DVB=m CONFIG_VIDEO_SAA7134_DVB_ALL_FRONTENDS=y # CONFIG_VIDEO_MXB is not set # CONFIG_VIDEO_DPC is not set # CONFIG_VIDEO_HEXIUM_ORION is not set # CONFIG_VIDEO_HEXIUM_GEMINI is not set CONFIG_VIDEO_CX88=m # CONFIG_VIDEO_CX88_ALSA is not set CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=y CONFIG_VIDEO_CX88_VP3054=m # CONFIG_VIDEO_EM28XX is not set # CONFIG_VIDEO_OVCAMCHIP is not set CONFIG_VIDEO_AUDIO_DECODER=m CONFIG_VIDEO_DECODER=m # # Radio Adapters # # CONFIG_RADIO_GEMTEK_PCI is not set # CONFIG_RADIO_MAXIRADIO is not set # CONFIG_RADIO_MAESTRO is not set # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=y # # Supported SAA7146 based PCI Adapters # CONFIG_DVB_AV7110=m # CONFIG_DVB_AV7110_OSD is not set CONFIG_DVB_BUDGET=m CONFIG_DVB_BUDGET_CI=m CONFIG_DVB_BUDGET_AV=m # CONFIG_DVB_BUDGET_PATCH is not set # # Supported USB Adapters # CONFIG_DVB_USB=m # CONFIG_DVB_USB_DEBUG is not set CONFIG_DVB_USB_A800=m CONFIG_DVB_USB_DIBUSB_MB=m # CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set CONFIG_DVB_USB_DIBUSB_MC=m CONFIG_DVB_USB_UMT_010=m CONFIG_DVB_USB_CXUSB=m CONFIG_DVB_USB_DIGITV=m CONFIG_DVB_USB_VP7045=m CONFIG_DVB_USB_VP702X=m CONFIG_DVB_USB_NOVA_T_USB2=m CONFIG_DVB_USB_DTT200U=m CONFIG_DVB_TTUSB_BUDGET=m CONFIG_DVB_TTUSB_DEC=m CONFIG_DVB_CINERGYT2=m # CONFIG_DVB_CINERGYT2_TUNING is not set # # Supported FlexCopII (B2C2) Adapters # CONFIG_DVB_B2C2_FLEXCOP=m CONFIG_DVB_B2C2_FLEXCOP_PCI=m CONFIG_DVB_B2C2_FLEXCOP_USB=m # CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set # # Supported BT878 Adapters # CONFIG_DVB_BT8XX=m # # Supported Pluto2 Adapters # CONFIG_DVB_PLUTO2=m # # Supported DVB Frontends # # # Customise DVB Frontends # # # DVB-S (satellite) frontends # CONFIG_DVB_STV0299=m CONFIG_DVB_CX24110=m CONFIG_DVB_CX24123=m CONFIG_DVB_TDA8083=m CONFIG_DVB_MT312=m CONFIG_DVB_VES1X93=m CONFIG_DVB_S5H1420=m # # DVB-T (terrestrial) frontends # CONFIG_DVB_SP8870=m CONFIG_DVB_SP887X=m CONFIG_DVB_CX22700=m CONFIG_DVB_CX22702=m CONFIG_DVB_L64781=m CONFIG_DVB_TDA1004X=m CONFIG_DVB_NXT6000=m CONFIG_DVB_MT352=m CONFIG_DVB_DIB3000MB=m CONFIG_DVB_DIB3000MC=m # # DVB-C (cable) frontends # CONFIG_DVB_VES1820=m CONFIG_DVB_TDA10021=m CONFIG_DVB_STV0297=m # # ATSC (North American/Korean Terresterial DTV) frontends # CONFIG_DVB_NXT200X=m CONFIG_DVB_OR51211=m CONFIG_DVB_OR51132=m CONFIG_DVB_BCM3510=m CONFIG_DVB_LGDT330X=m CONFIG_VIDEO_SAA7146=m CONFIG_VIDEO_SAA7146_VV=m CONFIG_VIDEO_VIDEOBUF=m CONFIG_VIDEO_TUNER=m CONFIG_VIDEO_BUF=m CONFIG_VIDEO_BUF_DVB=m CONFIG_VIDEO_BTCX=m CONFIG_VIDEO_IR=m CONFIG_VIDEO_TVEEPROM=m # # Graphics support # CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_MACMODES=y CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set CONFIG_FB_OF=y # CONFIG_FB_CONTROL is not set # CONFIG_FB_PLATINUM is not set # CONFIG_FB_VALKYRIE is not set # CONFIG_FB_CT65550 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set # CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set # CONFIG_FB_RADEON_OLD is not set # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Logo configuration # # CONFIG_LOGO is not set # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Bootsplash configuration # CONFIG_BOOTSPLASH=y # # Sound # CONFIG_SOUND=y # CONFIG_DMASOUND_PMAC is not set # # Advanced Linux Sound Architecture # CONFIG_SND=y CONFIG_SND_TIMER=y CONFIG_SND_PCM=y CONFIG_SND_HWDEP=y CONFIG_SND_RAWMIDI=y # CONFIG_SND_SEQUENCER is not set # CONFIG_SND_MIXER_OSS is not set # CONFIG_SND_PCM_OSS is not set # CONFIG_SND_DYNAMIC_MINORS is not set # CONFIG_SND_SUPPORT_OLD_API is not set # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set # # Generic devices # CONFIG_SND_MPU401_UART=y CONFIG_SND_OPL3_LIB=y CONFIG_SND_VX_LIB=y CONFIG_SND_AC97_CODEC=y CONFIG_SND_AC97_BUS=y # CONFIG_SND_DUMMY is not set # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set # # PCI devices # CONFIG_SND_AD1889=y CONFIG_SND_ALS4000=y CONFIG_SND_ALI5451=y CONFIG_SND_ATIIXP=y # CONFIG_SND_ATIIXP_MODEM is not set CONFIG_SND_AU8810=y CONFIG_SND_AU8820=y CONFIG_SND_AU8830=y CONFIG_SND_AZT3328=y # CONFIG_SND_BT87X is not set CONFIG_SND_CA0106=y CONFIG_SND_CMIPCI=y CONFIG_SND_CS4281=y CONFIG_SND_CS46XX=y CONFIG_SND_CS46XX_NEW_DSP=y CONFIG_SND_EMU10K1=y CONFIG_SND_EMU10K1X=y CONFIG_SND_ENS1370=y CONFIG_SND_ENS1371=y CONFIG_SND_ES1938=y CONFIG_SND_ES1968=y CONFIG_SND_FM801=y # CONFIG_SND_FM801_TEA575X is not set CONFIG_SND_HDA_INTEL=y # CONFIG_SND_HDSP is not set # CONFIG_SND_HDSPM is not set CONFIG_SND_ICE1712=y CONFIG_SND_ICE1724=y CONFIG_SND_INTEL8X0=y CONFIG_SND_INTEL8X0M=y # CONFIG_SND_KORG1212 is not set CONFIG_SND_MAESTRO3=y # CONFIG_SND_MIXART is not set CONFIG_SND_NM256=y # CONFIG_SND_PCXHR is not set # CONFIG_SND_RME32 is not set # CONFIG_SND_RME96 is not set # CONFIG_SND_RME9652 is not set CONFIG_SND_SONICVIBES=y CONFIG_SND_TRIDENT=y CONFIG_SND_VIA82XX=y # CONFIG_SND_VIA82XX_MODEM is not set CONFIG_SND_VX222=y CONFIG_SND_YMFPCI=y # # ALSA PowerMac devices # CONFIG_SND_POWERMAC=y CONFIG_SND_POWERMAC_AUTO_DRC=y # # USB devices # # CONFIG_SND_USB_AUDIO is not set # CONFIG_SND_USB_USX2Y is not set # # Open Sound System # # CONFIG_SOUND_PRIME is not set # # USB support # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=y # CONFIG_USB_EHCI_SPLIT_ISO is not set # CONFIG_USB_EHCI_ROOT_HUB_TT is not set # CONFIG_USB_ISP116X_HCD is not set CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_BIG_ENDIAN is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_UHCI_HCD=y # CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers # # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' # # # may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_FREECOM=y CONFIG_USB_STORAGE_ISD200=y CONFIG_USB_STORAGE_DPCM=y CONFIG_USB_STORAGE_USBAT=y CONFIG_USB_STORAGE_SDDR09=y CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y CONFIG_USB_STORAGE_ALAUDA=y # CONFIG_USB_LIBUSUAL is not set # # USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y CONFIG_USB_HIDINPUT_POWERBOOK=y # CONFIG_HID_FF is not set # CONFIG_USB_HIDDEV is not set # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_ACECAD is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_ITMTOUCH is not set # CONFIG_USB_EGALAX is not set # CONFIG_USB_YEALINK is not set CONFIG_USB_XPAD=y # CONFIG_USB_ATI_REMOTE is not set # CONFIG_USB_ATI_REMOTE2 is not set # CONFIG_USB_KEYSPAN_REMOTE is not set # CONFIG_USB_APPLETOUCH is not set # # USB Imaging devices # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # # USB Multimedia devices # # CONFIG_USB_DABUSB is not set # CONFIG_USB_VICAM is not set # CONFIG_USB_DSBR is not set # CONFIG_USB_ET61X251 is not set # CONFIG_USB_IBMCAM is not set # CONFIG_USB_KONICAWC is not set # CONFIG_USB_OV511 is not set # CONFIG_USB_SE401 is not set # CONFIG_USB_SN9C102 is not set # CONFIG_USB_STV680 is not set # CONFIG_USB_PWC is not set # # USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set CONFIG_USB_PEGASUS=y CONFIG_USB_RTL8150=y # CONFIG_USB_USBNET is not set # CONFIG_USB_ZD1201 is not set # CONFIG_USB_MON is not set # # USB port drivers # # # USB Serial Converter support # # CONFIG_USB_SERIAL is not set # # USB Miscellaneous drivers # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_IDMOUSE is not set # CONFIG_USB_SISUSBVGA is not set # CONFIG_USB_LD is not set # CONFIG_USB_TEST is not set # # USB DSL modem support # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # # CONFIG_MMC is not set # # InfiniBand support # # CONFIG_INFINIBAND is not set # # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) # # # File systems # CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XIP is not set CONFIG_EXT3_FS=y # CONFIG_EXT3_FS_XATTR is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_REISERFS_FS=y # CONFIG_REISERFS_CHECK is not set # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_REISERFS_FS_XATTR is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set # CONFIG_XFS_FS is not set # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_INOTIFY is not set # CONFIG_QUOTA is not set # CONFIG_DNOTIFY is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set CONFIG_FUSE_FS=y # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=y CONFIG_UDF_FS=y CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=y # CONFIG_MSDOS_FS is not set CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=850 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_NTFS_FS=y # CONFIG_NTFS_DEBUG is not set # CONFIG_NTFS_RW is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_TMPFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # CONFIG_RELAYFS_FS is not set # CONFIG_CONFIGFS_FS is not set # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set CONFIG_HFS_FS=y CONFIG_HFSPLUS_FS=y # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set CONFIG_UFS_FS=y # # Network File Systems # CONFIG_NFS_FS=y # CONFIG_NFS_V3 is not set # CONFIG_NFS_V4 is not set # CONFIG_NFS_DIRECTIO is not set # CONFIG_NFSD is not set CONFIG_LOCKD=y CONFIG_NFS_COMMON=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=y # CONFIG_SMB_NLS_DEFAULT is not set CONFIG_CIFS=y # CONFIG_CIFS_STATS is not set # CONFIG_CIFS_XATTR is not set # CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # CONFIG_9P_FS is not set # # Partition Types # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set # CONFIG_OSF_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y # CONFIG_BSD_DISKLABEL is not set # CONFIG_MINIX_SUBPARTITION is not set # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set # CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_KARMA_PARTITION is not set # CONFIG_EFI_PARTITION is not set # # Native Language Support # CONFIG_NLS=y CONFIG_NLS_DEFAULT="utf8" # CONFIG_NLS_CODEPAGE_437 is not set # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set CONFIG_NLS_CODEPAGE_850=y # CONFIG_NLS_CODEPAGE_852 is not set # CONFIG_NLS_CODEPAGE_855 is not set # CONFIG_NLS_CODEPAGE_857 is not set # CONFIG_NLS_CODEPAGE_860 is not set # CONFIG_NLS_CODEPAGE_861 is not set # CONFIG_NLS_CODEPAGE_862 is not set # CONFIG_NLS_CODEPAGE_863 is not set # CONFIG_NLS_CODEPAGE_864 is not set # CONFIG_NLS_CODEPAGE_865 is not set # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set # CONFIG_NLS_CODEPAGE_936 is not set # CONFIG_NLS_CODEPAGE_950 is not set # CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ASCII is not set CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set # CONFIG_NLS_ISO8859_5 is not set # CONFIG_NLS_ISO8859_6 is not set # CONFIG_NLS_ISO8859_7 is not set # CONFIG_NLS_ISO8859_9 is not set # CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set # CONFIG_NLS_ISO8859_15 is not set # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set CONFIG_NLS_UTF8=y # # Library routines # CONFIG_CRC_CCITT=y # CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y # # Instrumentation Support # # CONFIG_PROFILING is not set # # Kernel hacking # # CONFIG_PRINTK_TIME is not set # CONFIG_MAGIC_SYSRQ is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_BOOTX_TEXT is not set # CONFIG_PPC_EARLY_DEBUG_LPAR is not set # CONFIG_PPC_EARLY_DEBUG_G5 is not set # CONFIG_PPC_EARLY_DEBUG_RTAS is not set # CONFIG_PPC_EARLY_DEBUG_MAPLE is not set # CONFIG_PPC_EARLY_DEBUG_ISERIES is not set # # Security options # # CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # CONFIG_CRYPTO=y # CONFIG_CRYPTO_HMAC is not set # CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_MD4 is not set # CONFIG_CRYPTO_MD5 is not set # CONFIG_CRYPTO_SHA1 is not set # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set # CONFIG_CRYPTO_WP512 is not set # CONFIG_CRYPTO_TGR192 is not set # CONFIG_CRYPTO_DES is not set # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set # CONFIG_CRYPTO_SERPENT is not set CONFIG_CRYPTO_AES=y # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set CONFIG_CRYPTO_ARC4=y # CONFIG_CRYPTO_KHAZAD is not set # CONFIG_CRYPTO_ANUBIS is not set # CONFIG_CRYPTO_DEFLATE is not set CONFIG_CRYPTO_MICHAEL_MIC=y # CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_TEST is not set # # Hardware crypto devices # geexbox-1.0/packages/linux/config/modules0000644000175000017500000000214610446314264017601 0ustar aurelaurel# Drivers for Wireless cards ipw2100 ipw2200 rt2400 rt2500 # Drivers for DVB cards ttusb_dec dvb-ttusb-budget dvb-usb-vp7045 dvb-usb-vp702x dvb-usb-umt-010 dvb-usb-nova-t-usb2 dvb-usb-dtt200u dvb-usb-digitv dvb-usb-dibusb-mc dvb-usb-dibusb-mb dvb-usb-cxusb dvb-usb-a800 cinergyT2 b2c2-flexcop-usb # Drivers for PnP ISA sound cards snd-interwave-stb snd-sb16 snd-sbawe snd-sscape # These are modules of some ISA non-PnP devices. # If some of these modules are needed uncomment the line and add correct # parameters for the module. # Drivers for ISA network adapter # wd mem_end=0xca000 mem=0xc8000 irq=5 io=0x2a0 # smc-ultra io=0x2a0 irq=7 # Drivers for ISA sound cards # Some ISA PnP cards may work fine, for other ones you need to add the # correct modules parameters. # snd-tea6330t # snd-ad1816a # snd-ad1848 # snd-cs4231 # snd-cs4232 # snd-cs4236 # snd-es1688 # snd-gusclassic # snd-gusextreme # snd-gusmax # snd-interwave # snd-opti92x-ad1848 # snd-opti92x-cs4231 # snd-opti93x # snd-es968 # snd-sb8 # snd-als100 # snd-azt2320 # snd-cmi8330 # snd-dt019x # snd-es18xx # snd-opl3sa2 # snd-sgalaxy # snd-wavefront geexbox-1.0/packages/linux/config/tvcard0000644000175000017500000000173010446314264017412 0ustar aurelaurel# # TV Card Options # # TV CARD/TUNER Model (AUTO for autodetection or look at the following urls) # http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.bttv # http://www.linuxhq.com/kernel/v2.6/2/Documentation/video4linux/CARDLIST.tuner TV_CARD=AUTO TV_TUNER=AUTO # TV Input Standard (ntsc/ntsc-m/ntsc-jp/pal/pal-bg/pal-dk/pal-i/pal-m/pal-n/ # pal-nc/pal-60/secam/secam-l/secam-dk) # Some card (SAA7134) need a special way to set the sub-mode. # Example for using secam-dk #TVIN_STANDARD=secam #TVIN_SUB_STANDARD=d # TVIN_STANDARD=pal # TV Channels # Syntax : CHAN="Channel Frequency:Channel Title" # Example: #CHAN="29:France 2" #CHAN="K08:Canal +" # TV Channels List # Available : us-bcast, us-cable, us-cable-hrc, japan-bcast, japan-cable, # europe-west, europe-east, italy, newzealand, australia, # ireland, france, china-bcast, southafrica, argentina, # australia-optus, russia CHANLIST=europe-west geexbox-1.0/packages/linux/init.d/0000755000175000017500000000000010446314264016123 5ustar aurelaurelgeexbox-1.0/packages/linux/init.d/20_modules0000755000175000017500000000033310446314264020021 0ustar aurelaurel#!/bin/sh # # load modules # # runlevels: geexbox, debug, install echo "### Loading kernel modules ###" IFS=' ' for module in `cat /etc/modules|grep "^[^#]"`; do eval "modprobe $module" >/dev/null 2>&1 done exit 0 geexbox-1.0/packages/linux/init.d/32_tvcard0000755000175000017500000000445410446314264017647 0ustar aurelaurel#!/bin/sh # # setup tv cards # # runlevels: geexbox, debug, install echo "### Setting up TV card ###" if ! grep -q 'Class 0400:.*109e:' /proc/pci && ! grep -q 'Class 0480:.*1131:' /proc/pci && ! grep -q 'Class 0480:.*14f1:88' /proc/pci; then # No supported TV card found exit 1 fi . /etc/tvcard [ -f /etc/radio ] && . /etc/radio CARD= test "$TV_CARD" != "AUTO" && CARD="card=$TV_CARD" TUNER= test "$TV_TUNER" != "AUTO" && TUNER="tuner=$TV_TUNER" RADIO_OPT= test "$RADIO" = yes && RADIO_OPT="radio=1" if grep -q 'Class 0400:.*109e:' /proc/pci; then # BT8x8 Card modprobe bttv $CARD $TUNER $RADIO_OPT >/dev/null 2>&1 if test "$TV_CARD" = "AUTO" \ -a -z "`dmesg | grep 'bttv0: detected'`"; then # Not autodetected test -z "$TUNER" && TUNER="tuner=3" rmmod bttv modprobe bttv card=1 $TUNER $RADIO_OPT >/dev/null 2>&1 fi echo "TV_WIDTH=768" > /var/tvcard echo "TV_HEIGHT=576" >> /var/tvcard elif grep -q 'Class 0480:.*1131:' /proc/pci; then # SAA7134 Card modprobe saa7134 $CARD $TUNER >/dev/null 2>&1 echo -n "" > /var/tvcard elif grep -q 'Class 0480:.*14f1:88' /proc/pci; then # Conexant BT881/CX88 Card modprobe tveeprom >/dev/null 2>&1 modprobe cx88xx $CARD $TUNER >/dev/null 2>&1 modprobe cx8800 >/dev/null 2>&1 # cx8800 module tries to autodetect/force tuner model according to eeprom. # It fails if eeprom is corrupted so force tuner module loading before cx8800 if test "$TV_CARD" != "AUTO" \ -a -n "`dmesg | grep 'tveeprom: Encountered bad packet header'`"; then rmmod cx8800 cx88xx tuner modprobe cx88xx $CARD $TUNER >/dev/null 2>&1 modprobe tuner >/dev/null 2>&1 modprobe cx8800 >/dev/null 2>&1 fi echo "TV_WIDTH=768" > /var/tvcard echo "TV_HEIGHT=576" >> /var/tvcard # CX88 driver reset color values to 0, so need to be forced. echo "TV_BRIGHTNESS=50" >> /var/tvcard echo "TV_CONTRAST=50" >> /var/tvcard echo "TV_HUE=100" >> /var/tvcard echo "TV_SATURATION=75" >> /var/tvcard fi TVIN_OPT= if test -n "$TVIN_STANDARD" -a -n "$TVIN_SUB_STANDARD"; then TVIN_OPT="$TVIN_STANDARD=$TVIN_SUB_STANDARD" fi modprobe tuner $TVIN_OPT >/dev/null 2>&1 modprobe tvaudio >/dev/null 2>&1 modprobe msp3400 >/dev/null 2>&1 modprobe tda7432 >/dev/null 2>&1 modprobe tda9875 >/dev/null 2>&1 modprobe tda9887 $TVIN_OPT >/dev/null 2>&1 exit 0 geexbox-1.0/packages/linux/init.d/34_dvbcard0000755000175000017500000000234410446314264017767 0ustar aurelaurel#!/bin/sh # # setup dvb cards # # runlevels: geexbox, debug, install echo "### Setting up DVB card ###" # DVB frontends drivers are auto-loaded by main device drivers # PCI DVB Devices if grep -q 'Class 0400:.*109e:' /proc/pci; then # BT8x8 Card modprobe dvb-bt8xx >/dev/null 2>&1 modprobe dst >/dev/null 2>&1 elif grep -q 'Class 0480:.*1131:' /proc/pci; then # SAA7134 Card modprobe saa7134-dvb >/dev/null 2>&1 # SAA7146 Cards modprobe saa7146 >/dev/null 2>&1 modprobe saa7146_vv >/dev/null 2>&1 modprobe dvb-ttpci >/dev/null 2>&1 modprobe budget >/dev/null 2>&1 modprobe budget-ci >/dev/null 2>&1 modprobe budget-av >/dev/null 2>&1 elif grep -q 'Class 0280:.*13d0:' /proc/pci; then # B2C2 Cards modprobe budget >/dev/null 2>&1 modprobe b2c2-flexcop-pci >/dev/null 2>&1 modprobe b2c2-flexcop >/dev/null 2>&1 elif grep -q 'Class 0480:.*14f1:88' /proc/pci; then # Conexant CX88 Card modprobe cx88-blackbird >/dev/null 2>&1 modprobe cx88-dvb >/dev/null 2>&1 elif grep -q 'Class 0480:.*0432:' /proc/pci; then # SCM Pluto2 Card modprobe pluto2 >/dev/null 2>&1 fi # ensure that DVB card has been discovered if test -n "`dmesg | grep 'DVB: registering new adapter'`"; then echo -n "" > /var/dvbcard fi exit 0 geexbox-1.0/packages/linux/install0000755000175000017500000000104510446314264016332 0ustar aurelaurel#!/bin/sh . config/options case "$2" in image) test "$3" != installator && INSTALL="$INSTALL/boot" mkdir -p $INSTALL case $TARGET_ARCH in i386) cp $BUILD/$1*/arch/$TARGET_ARCH/boot/bzImage $INSTALL/vmlinuz ;; ppc) cp $BUILD/$1*/vmlinux $INSTALL/vmlinux $STRIP $INSTALL/vmlinux ;; esac ;; modules) cp -r $BUILD/$1*/modules/* $INSTALL mkdir -p $INSTALL/etc cp $PACKAGES/$1/config/modules $INSTALL/etc cp $PACKAGES/$1/config/tvcard $INSTALL/etc ;; esac geexbox-1.0/packages/linux/need_unpack0000755000175000017500000000020710446314264017137 0ustar aurelaurel#!/bin/sh . config/options STAMP=$STAMPS/$1/unpack test $PACKAGES/$1/config/$1.$TARGET_ARCH.conf -nt $STAMP && rm -f $STAMP exit 0 geexbox-1.0/packages/linux/patches/0000755000175000017500000000000010446314264016365 5ustar aurelaurelgeexbox-1.0/packages/linux/patches/10_crosscompile.diff0000644000175000017500000000136010446314264022221 0ustar aurelaurelIndex: linux-2.6.16/arch/i386/boot/tools/build.c =================================================================== --- linux-2.6.16.orig/arch/i386/boot/tools/build.c 2006-03-20 18:41:36.000000000 +0100 +++ linux-2.6.16/arch/i386/boot/tools/build.c 2006-03-20 18:41:38.000000000 +0100 @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -41,6 +40,11 @@ #define DEFAULT_MAJOR_ROOT 0 #define DEFAULT_MINOR_ROOT 0 +#undef major +#define major(dev) ((int)(((dev) >> 8) & 0xff)) +#undef minor +#define minor(dev) ((int)((dev) & 0xff)) + /* Minimal number of setup sectors (see also bootsect.S) */ #define SETUP_SECTS 4 geexbox-1.0/packages/linux/patches/11_file2alias-crosscompile.diff0000644000175000017500000000163710446314264024242 0ustar aurelaurel* fixes file2alias cross compiling, as it compiles at host side. (there is no asm/types.h) diff -Nur linux-2.6.16.orig/include/linux/input.h linux-2.6.16/include/linux/input.h --- linux-2.6.16.orig/include/linux/input.h Mon Mar 20 07:53:29 2006 +++ linux-2.6.16/include/linux/input.h Sat Mar 25 12:50:00 2006 @@ -15,9 +15,9 @@ #include #include #else +#include #include #include -#include #endif /* diff -Nur linux-2.6.16.orig/scripts/mod/file2alias.c linux-2.6.16/scripts/mod/file2alias.c --- linux-2.6.16.orig/scripts/mod/file2alias.c Mon Mar 20 07:53:29 2006 +++ linux-2.6.16/scripts/mod/file2alias.c Sat Mar 25 12:54:22 2006 @@ -29,6 +29,9 @@ #include +typedef int32_t __s32; +typedef int16_t __s16; +typedef char __s8; typedef uint32_t __u32; typedef uint16_t __u16; typedef unsigned char __u8; geexbox-1.0/packages/linux/patches/12_fix-userland.diff0000644000175000017500000000167610446314264022134 0ustar aurelaurel* fixes including of and from userland (MPlayer) diff -Nur linux-2.6.16.orig/include/linux/input.h linux-2.6.16/include/linux/input.h --- linux-2.6.16.orig/include/linux/input.h Mon Mar 20 07:53:29 2006 +++ linux-2.6.16/include/linux/input.h Sat Mar 25 12:50:00 2006 @@ -796,6 +796,8 @@ #define FF_MAX 0x7f +#ifdef BITS_PER_LONG + struct input_device_id { kernel_ulong_t flags; @@ -814,6 +816,8 @@ kernel_ulong_t driver_info; }; + +#endif /* * Structure for hotplug & device<->driver matching. diff -Nur linux-2.6.16.orig/include/linux/rtc.h linux-2.6.16/include/linux/rtc.h --- linux-2.6.16.orig/include/linux/rtc.h Mon Mar 20 07:53:29 2006 +++ linux-2.6.16/include/linux/rtc.h Sat Mar 25 14:28:59 2006 @@ -11,7 +11,9 @@ #ifndef _LINUX_RTC_H_ #define _LINUX_RTC_H_ +#ifdef __KERNEL__ #include +#endif /* * The struct used to pass data via the following ioctl. Similar to the geexbox-1.0/packages/linux/patches/13_ppc-asm-include.diff0000644000175000017500000000123410446314264022503 0ustar aurelaureldefine PAGE_MASK for !KERNEL diff -Nur linux-2.6.16.11.orig/include/asm-powerpc/page.h linux-2.6.16.11/include/asm-powerpc/page.h --- linux-2.6.16.11.orig/include/asm-powerpc/page.h Mon Apr 24 23:20:24 2006 +++ linux-2.6.16.11/include/asm-powerpc/page.h Fri May 12 22:55:00 2006 @@ -10,7 +10,6 @@ * 2 of the License, or (at your option) any later version. */ -#ifdef __KERNEL__ #include #include @@ -37,6 +36,7 @@ */ #define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) +#ifdef __KERNEL__ /* * KERNELBASE is the virtual address of the start of the kernel, it's often * the same as PAGE_OFFSET, but _might not be_. geexbox-1.0/packages/linux/patches/20_lzma-vmlinux.diff0000644000175000017500000002567110446314264022176 0ustar aurelaurel* LZMA vmlinux unarchiver (http://www.geocities.com/mctiew/ffw/lzma.assorted3.tgz) Index: linux-2.6.16/arch/i386/boot/compressed/Makefile =================================================================== --- linux-2.6.16.orig/arch/i386/boot/compressed/Makefile 2006-03-20 18:41:35.000000000 +0100 +++ linux-2.6.16/arch/i386/boot/compressed/Makefile 2006-03-20 18:42:30.000000000 +0100 @@ -2,24 +2,33 @@ # linux/arch/i386/boot/compressed/Makefile # # create a compressed vmlinux image from the original vmlinux +# patched by Ming-Ching Tiew for kernel 2.6 +# requires program 'lzma' from LZMA SDK ( http://www.7-zip.org/ ) to work +# $ mkdir lzma +# $ cd lzma +# $ tar tvjf ../lzma417.tar.bz2 +# $ cd SRC/7zip/Compress/LZMA_Alone +# $ dos2unix makefile +# $ make +# $ su +# # cp lzma /usr/bin # - -targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o +targets := vmlinux vmlinux.bin vmlinux.bin.lzma head.o lzma_misc.o piggy.o EXTRA_AFLAGS := -traditional LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32 -$(obj)/vmlinux: $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE +$(obj)/vmlinux: $(obj)/head.o $(obj)/lzma_misc.o $(obj)/piggy.o FORCE $(call if_changed,ld) @: $(obj)/vmlinux.bin: vmlinux FORCE $(call if_changed,objcopy) -$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE - $(call if_changed,gzip) +$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE + $(call if_changed,lzma) LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T -$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE +$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.lzma FORCE $(call if_changed,ld) Index: linux-2.6.16/arch/i386/boot/compressed/lzma_misc.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.16/arch/i386/boot/compressed/lzma_misc.c 2006-03-20 18:42:30.000000000 +0100 @@ -0,0 +1,340 @@ +/* + * lzma_misc.c + * + * Decompress LZMA compressed vmlinuz + * Version 0.9 Copyright (c) Ming-Ching Tiew mctiew@yahoo.com + * Program adapted from misc.c for 2.6 kernel + * Date: 3 June 2005 + * Source released under GPL + */ + +#include +#include +#include +#include + +#define OF(args) args +#define STATIC static + +#undef memset +#undef memcpy + +/* + * Why do we do this? Don't ask me.. + * + * Incomprehensible are the ways of bootloaders. + */ +static void* memcpy(void *, __const void *, size_t); + +typedef unsigned char uch; +typedef unsigned short ush; +typedef unsigned long ulg; + +#define WSIZE 0x8000 /* Window size must be at least 32k, */ + /* and a power of two */ + +static uch *inbuf; /* input buffer */ + +static unsigned insize = 0; /* valid bytes in inbuf */ +static unsigned inptr = 0; /* index of next byte to be processed in inbuf */ + +#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf()) + +/* Diagnostic functions */ +#ifdef DEBUG +# define Assert(cond,msg) {if(!(cond)) error(msg);} +# define Trace(x) fprintf x +# define Tracev(x) {if (verbose) fprintf x ;} +# define Tracevv(x) {if (verbose>1) fprintf x ;} +# define Tracec(c,x) {if (verbose && (c)) fprintf x ;} +# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + +static int fill_inbuf(void); +static void error(char *m); + +/* + * This is set up by the setup-routine at boot-time + */ +static unsigned char *real_mode; /* Pointer to real-mode data */ + +#define RM_EXT_MEM_K (*(unsigned short *)(real_mode + 0x2)) +#ifndef STANDARD_MEMORY_BIOS_CALL +#define RM_ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0)) +#endif +#define RM_SCREEN_INFO (*(struct screen_info *)(real_mode+0)) + +extern char input_data[]; +extern int input_len; + +static long bytes_out = 0; +static uch *output_data; + +static void putstr(const char *); + +extern int end; +static long free_mem_ptr = (long)&end; +static long free_mem_end_ptr; + +#define INPLACE_MOVE_ROUTINE 0x1000 +#define LOW_BUFFER_START 0x2000 +#define LOW_BUFFER_MAX 0x90000 +#define HEAP_SIZE 0x3000 +static unsigned int low_buffer_end, low_buffer_size; +static int high_loaded =0; +static uch *high_buffer_start /* = (uch *)(((ulg)&end) + HEAP_SIZE)*/; + +static char *vidmem = (char *)0xb8000; +static int vidport; +static int lines, cols; + +static void scroll(void) +{ + int i; + + memcpy ( vidmem, vidmem + cols * 2, ( lines - 1 ) * cols * 2 ); + for ( i = ( lines - 1 ) * cols * 2; i < lines * cols * 2; i += 2 ) + vidmem[i] = ' '; +} + +static void putstr(const char *s) +{ + int x,y,pos; + char c; + + x = RM_SCREEN_INFO.orig_x; + y = RM_SCREEN_INFO.orig_y; + + while ( ( c = *s++ ) != '\0' ) { + if ( c == '\n' ) { + x = 0; + if ( ++y >= lines ) { + scroll(); + y--; + } + } else { + vidmem [ ( x + cols * y ) * 2 ] = c; + if ( ++x >= cols ) { + x = 0; + if ( ++y >= lines ) { + scroll(); + y--; + } + } + } + } + + RM_SCREEN_INFO.orig_x = x; + RM_SCREEN_INFO.orig_y = y; + + pos = (x + cols * y) * 2; /* Update cursor position */ + outb_p(14, vidport); + outb_p(0xff & (pos >> 9), vidport+1); + outb_p(15, vidport); + outb_p(0xff & (pos >> 1), vidport+1); +} + +static void* memcpy(void* __dest, __const void* __src, + size_t __n) +{ + int i; + char *d = (char *)__dest, *s = (char *)__src; + + for (i=0;i<__n;i++) d[i] = s[i]; + return __dest; +} + +/* =========================================================================== + * Fill the input buffer. This is called only when the buffer is empty + * and at least one byte is really needed. + */ +static int fill_inbuf(void) +{ + if (insize != 0) { + error("ran out of input data"); + } + + inbuf = input_data; + insize = input_len; + inptr = 1; + return inbuf[0]; +} + +static void error(char *x) +{ + putstr("\n\n"); + putstr(x); + putstr("\n\n -- System halted"); + + while(1); /* Halt */ +} + +#define STACK_SIZE (4096) + +long user_stack [STACK_SIZE]; + +struct { + long * a; + short b; + } stack_start = { & user_stack [STACK_SIZE] , __BOOT_DS }; + +static void setup_normal_output_buffer(void) +{ +#ifdef STANDARD_MEMORY_BIOS_CALL + if (RM_EXT_MEM_K < 1024) error("Less than 2MB of memory"); +#else + if ((RM_ALT_MEM_K > RM_EXT_MEM_K ? RM_ALT_MEM_K : RM_EXT_MEM_K) < 1024) error("Less than 2MB of memory"); +#endif + output_data = (char *)0x100000; /* Points to 1M */ + free_mem_end_ptr = (long)real_mode; +} + +struct moveparams { + uch *low_buffer_start; int lcount; + uch *high_buffer_start; int hcount; +}; + +static void setup_output_buffer_if_we_run_high(struct moveparams *mv) +{ + high_buffer_start = (uch *)(((ulg)&end) + HEAP_SIZE); +#ifdef STANDARD_MEMORY_BIOS_CALL + if (RM_EXT_MEM_K < (3*1024)) error("Less than 4MB of memory"); +#else + if ((RM_ALT_MEM_K > RM_EXT_MEM_K ? RM_ALT_MEM_K : RM_EXT_MEM_K) < + (3*1024)) + error("Less than 4MB of memory"); +#endif + mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START; + low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX + ? LOW_BUFFER_MAX : (unsigned int)real_mode) & ~0xfff; + low_buffer_size = low_buffer_end - LOW_BUFFER_START; + high_loaded = 1; + free_mem_end_ptr = (long)high_buffer_start; + if ( (0x100000 + low_buffer_size) > ((ulg)high_buffer_start)) { + high_buffer_start = (uch *)(0x100000 + low_buffer_size); + mv->hcount = 0; /* say: we need not to move high_buffer */ + } + else mv->hcount = -1; + mv->high_buffer_start = high_buffer_start; +} + +static void close_output_buffer_if_we_run_high(struct moveparams *mv) +{ + if (bytes_out > low_buffer_size) { + mv->lcount = low_buffer_size; + if (mv->hcount) + mv->hcount = bytes_out - low_buffer_size; + } else { + mv->lcount = bytes_out; + mv->hcount = 0; + } +} + +#define _LZMA_IN_CB +#include "../../../../lib/LzmaDecode.h" +#include "../../../../lib/LzmaDecode.c" + +static int read_byte(void *object, const unsigned char **buffer, SizeT *bufferSize); + + +/* + * Do the lzma decompression + */ +static int lzma_unzip(void) +{ + + unsigned int i; + CLzmaDecoderState state; + unsigned int uncompressedSize = 0; + unsigned char* p; + + ILzmaInCallback callback; + callback.Read = read_byte; + + // lzma args + i = get_byte(); + state.Properties.lc = i % 9, i = i / 9; + state.Properties.lp = i % 5, state.Properties.pb = i / 5; + + // skip dictionary size + for (i = 0; i < 4; i++) + get_byte(); + // get uncompressed size + p= (char*)&uncompressedSize; + for (i = 0; i < 4; i++) + *p++ = get_byte(); + + // skip high order bytes + for (i = 0; i < 4; i++) + get_byte(); + + // point it beyond uncompresedSize + state.Probs = (CProb*) (high_buffer_start + uncompressedSize); + // decompress kernel + if (LzmaDecode( &state, &callback, + (unsigned char*)high_buffer_start, uncompressedSize, &i) == LZMA_RESULT_OK) + { + if ( i != uncompressedSize ) + error( "kernel corrupted!\n"); + //copy it back to low_buffer + if( uncompressedSize > low_buffer_size ) + { + memcpy((char*)LOW_BUFFER_START, high_buffer_start, low_buffer_size); + memcpy(high_buffer_start, high_buffer_start+low_buffer_size, + uncompressedSize-low_buffer_size); + } + else + memcpy((char*)LOW_BUFFER_START, high_buffer_start, uncompressedSize ); + bytes_out = i; + return 0; + } + return 1; +} + + +static int read_byte(void *object, const unsigned char **buffer, SizeT *bufferSize) +{ + static unsigned int i = 0; + static unsigned char val; + *bufferSize = 1; + val = get_byte(); + *buffer = &val; + if ( i++ % ( 1024 * 50 ) == 0 ) + putstr("."); + return LZMA_RESULT_OK; +} + +asmlinkage int decompress_kernel(struct moveparams *mv, void *rmode) +{ + real_mode = rmode; + + if (RM_SCREEN_INFO.orig_video_mode == 7) { + vidmem = (char *) 0xb0000; + vidport = 0x3b4; + } else { + vidmem = (char *) 0xb8000; + vidport = 0x3d4; + } + + lines = RM_SCREEN_INFO.orig_video_lines; + cols = RM_SCREEN_INFO.orig_video_cols; + + if (free_mem_ptr < 0x100000) setup_normal_output_buffer(); + else setup_output_buffer_if_we_run_high(mv); + + putstr("LZMA vmlinuz: Ming-Ching Tiew ..."); + if( lzma_unzip() != 0 ) + { + error("inflate error\n"); + } + putstr("Ok, booting the kernel.\n"); + if (high_loaded) close_output_buffer_if_we_run_high(mv); + return high_loaded; +} Index: linux-2.6.16/scripts/Makefile.lib =================================================================== --- linux-2.6.16.orig/scripts/Makefile.lib 2006-03-20 18:41:35.000000000 +0100 +++ linux-2.6.16/scripts/Makefile.lib 2006-03-20 18:42:30.000000000 +0100 @@ -167,4 +167,8 @@ quiet_cmd_gzip = GZIP $@ cmd_gzip = gzip -f -9 < $< > $@ +# LZMA +# --------------------------------------------------------------------------- +quiet_cmd_lzma = LZMA $@ +cmd_lzma = lzma e $< $@ -lc7 -lp0 -pb0 2>/dev/null geexbox-1.0/packages/linux/patches/30_bash-only-feature.diff0000644000175000017500000000105410446314264023046 0ustar aurelaurelIndex: linux-2.6.16/scripts/gen_initramfs_list.sh =================================================================== --- linux-2.6.16.orig/scripts/gen_initramfs_list.sh 2006-03-20 18:41:34.000000000 +0100 +++ linux-2.6.16/scripts/gen_initramfs_list.sh 2006-03-20 18:42:40.000000000 +0100 @@ -56,9 +56,7 @@ parse() { local location="$1" - local name="${location/${srcdir}//}" - # change '//' into '/' - name="${name//\/\///}" + local name="$(echo "$location" | sed -e 's%$srcdir%%' -e 's%//*%/%g')" local mode="$2" local uid="$3" local gid="$4" geexbox-1.0/packages/linux/patches/40_no_dev_console.diff0000644000175000017500000000162710446314264022524 0ustar aurelaurelIndex: linux-2.6.16/init/main.c =================================================================== --- linux-2.6.16.orig/init/main.c 2006-03-20 06:53:29.000000000 +0100 +++ linux-2.6.16/init/main.c 2006-03-20 18:42:46.000000000 +0100 @@ -653,6 +653,8 @@ static int init(void * unused) { + char *console = "/dev_console"; + lock_kernel(); /* * init can run on any cpu. @@ -710,8 +712,12 @@ system_state = SYSTEM_RUNNING; numa_default_policy(); - if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) - printk(KERN_WARNING "Warning: unable to open an initial console.\n"); + if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) { + sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1); + if (sys_open(console, O_RDWR, 0) < 0) + printk(KERN_WARNING "Warning: unable to open an initial console.\n"); + sys_unlink(console); + } (void) sys_dup(0); (void) sys_dup(0); geexbox-1.0/packages/linux/patches/50_bootsplash-3.1.6-2.6.15.diff0000644000175000017500000023732310446314264023105 0ustar aurelaurelIndex: linux-2.6.16/drivers/char/keyboard.c =================================================================== --- linux-2.6.16.orig/drivers/char/keyboard.c 2006-03-20 06:53:29.000000000 +0100 +++ linux-2.6.16/drivers/char/keyboard.c 2006-03-20 18:42:50.000000000 +0100 @@ -1062,6 +1062,15 @@ if (keycode < BTN_MISC) printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode); +#ifdef CONFIG_BOOTSPLASH + /* This code has to be redone for some non-x86 platforms */ + if (down == 1 && (keycode == 0x3c || keycode == 0x01)) { /* F2 and ESC on PC keyboard */ + extern int splash_verbose(void); + if (splash_verbose()) + return; + } +#endif + #ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */ if (keycode == KEY_SYSRQ && (sysrq_down || (down == 1 && sysrq_alt))) { sysrq_down = down; Index: linux-2.6.16/drivers/char/n_tty.c =================================================================== --- linux-2.6.16.orig/drivers/char/n_tty.c 2006-03-20 06:53:29.000000000 +0100 +++ linux-2.6.16/drivers/char/n_tty.c 2006-03-20 18:42:50.000000000 +0100 @@ -1298,6 +1298,15 @@ tty->minimum_to_wake = (minimum - (b - buf)); if (!input_available_p(tty, 0)) { +#ifdef CONFIG_BOOTSPLASH + if (file->f_dentry->d_inode->i_rdev == MKDEV(TTY_MAJOR,0) || + file->f_dentry->d_inode->i_rdev == MKDEV(TTY_MAJOR,1) || + file->f_dentry->d_inode->i_rdev == MKDEV(TTYAUX_MAJOR,0) || + file->f_dentry->d_inode->i_rdev == MKDEV(TTYAUX_MAJOR,1)) { + extern int splash_verbose(void); + (void)splash_verbose(); + } +#endif if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { retval = -EIO; break; Index: linux-2.6.16/drivers/char/vt.c =================================================================== --- linux-2.6.16.orig/drivers/char/vt.c 2006-03-20 06:53:29.000000000 +0100 +++ linux-2.6.16/drivers/char/vt.c 2006-03-20 18:42:50.000000000 +0100 @@ -3234,6 +3234,31 @@ } } +#ifdef CONFIG_BOOTSPLASH +void con_remap_def_color(struct vc_data *vc, int new_color) +{ + unsigned short *sbuf = vc->vc_screenbuf; + unsigned c, len = vc->vc_screenbuf_size >> 1; + int old_color; + + if (sbuf) { + old_color = vc->vc_def_color << 8; + new_color <<= 8; + while(len--) { + c = *sbuf; + if (((c ^ old_color) & 0xf000) == 0) + *sbuf ^= (old_color ^ new_color) & 0xf000; + if (((c ^ old_color) & 0x0f00) == 0) + *sbuf ^= (old_color ^ new_color) & 0x0f00; + sbuf++; + } + new_color >>= 8; + } + vc->vc_def_color = vc->vc_color = new_color; + update_attr(vc); +} +#endif + /* * Visible symbols for modules */ Index: linux-2.6.16/drivers/video/bootsplash/bootsplash.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.16/drivers/video/bootsplash/bootsplash.c 2006-03-20 18:42:50.000000000 +0100 @@ -0,0 +1,984 @@ +/* + * linux/drivers/video/bootsplash/bootsplash.c - + * splash screen handling functions. + * + * (w) 2001-2004 by Volker Poplawski, , + * Stefan Reinauer, , + * Steffen Winterfeldt, , + * Michael Schroeder + * + * Ideas & SuSE screen work by Ken Wimer, + * + * For more information on this code check http://www.bootsplash.org/ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "../console/fbcon.h" +#include "bootsplash.h" +#include "decode-jpg.h" + +/* extern struct fb_ops vesafb_ops; */ +extern signed char con2fb_map[MAX_NR_CONSOLES]; + +#define SPLASH_VERSION "3.1.6-2004/03/31" + +/* These errors have to match fbcon-jpegdec.h */ +static unsigned char *jpg_errors[] = { + "no SOI found", + "not 8 bit", + "height mismatch", + "width mismatch", + "bad width or height", + "too many COMPPs", + "illegal HV", + "quant table selector", + "picture is not YCBCR 221111", + "unknow CID in scan", + "dct not sequential", + "wrong marker", + "no EOI", + "bad tables", + "depth mismatch" +}; + +static struct jpeg_decdata *decdata = 0; /* private decoder data */ + +static int splash_registered = 0; +static int splash_usesilent = 0; /* shall we display the silentjpeg? */ +int splash_default = 0xf01; + +static int splash_check_jpeg(unsigned char *jpeg, int width, int height, int depth); + +static int __init splash_setup(char *options) +{ + if(!strncmp("silent", options, 6)) { + printk(KERN_INFO "bootsplash: silent mode.\n"); + splash_usesilent = 1; + /* skip "silent," */ + if (strlen(options) == 6) + return 0; + options += 7; + } + if(!strncmp("verbose", options, 7)) { + printk(KERN_INFO "bootsplash: verbose mode.\n"); + splash_usesilent = 0; + return 0; + } + splash_default = simple_strtoul(options, NULL, 0); + return 0; +} + +__setup("splash=", splash_setup); + + +static int splash_hasinter(unsigned char *buf, int num) +{ + unsigned char *bufend = buf + num * 12; + while(buf < bufend) { + if (buf[1] > 127) /* inter? */ + return 1; + buf += buf[3] > 127 ? 24 : 12; /* blend? */ + } + return 0; +} + +static int boxextract(unsigned char *buf, unsigned short *dp, unsigned char *cols, int *blendp) +{ + dp[0] = buf[0] | buf[1] << 8; + dp[1] = buf[2] | buf[3] << 8; + dp[2] = buf[4] | buf[5] << 8; + dp[3] = buf[6] | buf[7] << 8; + *(unsigned int *)(cols + 0) = + *(unsigned int *)(cols + 4) = + *(unsigned int *)(cols + 8) = + *(unsigned int *)(cols + 12) = *(unsigned int *)(buf + 8); + if (dp[1] > 32767) { + dp[1] = ~dp[1]; + *(unsigned int *)(cols + 4) = *(unsigned int *)(buf + 12); + *(unsigned int *)(cols + 8) = *(unsigned int *)(buf + 16); + *(unsigned int *)(cols + 12) = *(unsigned int *)(buf + 20); + *blendp = 1; + return 24; + } + return 12; +} + +static void boxit(unsigned char *pic, int bytes, unsigned char *buf, int num, int percent, int overpaint) +{ + int x, y, i, p, doblend, r, g, b, a, add; + unsigned short data1[4]; + unsigned char cols1[16]; + unsigned short data2[4]; + unsigned char cols2[16]; + unsigned char *bufend; + unsigned short *picp; + unsigned int stipple[32], sti, stin, stinn, stixs, stixe, stiys, stiye; + int xs, xe, ys, ye, xo, yo; + + if (num == 0) + return; + bufend = buf + num * 12; + stipple[0] = 0xffffffff; + stin = 1; + stinn = 0; + stixs = stixe = 0; + stiys = stiye = 0; + while(buf < bufend) { + doblend = 0; + buf += boxextract(buf, data1, cols1, &doblend); + if (data1[0] == 32767 && data1[1] == 32767) { + /* box stipple */ + if (stinn == 32) + continue; + if (stinn == 0) { + stixs = data1[2]; + stixe = data1[3]; + stiys = stiye = 0; + } else if (stinn == 4) { + stiys = data1[2]; + stiye = data1[3]; + } + stipple[stinn++] = (cols1[ 0] << 24) | (cols1[ 1] << 16) | (cols1[ 2] << 8) | cols1[ 3] ; + stipple[stinn++] = (cols1[ 4] << 24) | (cols1[ 5] << 16) | (cols1[ 6] << 8) | cols1[ 7] ; + stipple[stinn++] = (cols1[ 8] << 24) | (cols1[ 9] << 16) | (cols1[10] << 8) | cols1[11] ; + stipple[stinn++] = (cols1[12] << 24) | (cols1[13] << 16) | (cols1[14] << 8) | cols1[15] ; + stin = stinn; + continue; + } + stinn = 0; + if (data1[0] > 32767) + buf += boxextract(buf, data2, cols2, &doblend); + if (data1[0] == 32767 && data1[1] == 32766) { + /* box copy */ + i = 12 * (short)data1[3]; + doblend = 0; + i += boxextract(buf + i, data1, cols1, &doblend); + if (data1[0] > 32767) + boxextract(buf + i, data2, cols2, &doblend); + } + if (data1[0] == 32767) + continue; + if (data1[2] > 32767) { + if (overpaint) + continue; + data1[2] = ~data1[2]; + } + if (data1[3] > 32767) { + if (percent == 65536) + continue; + data1[3] = ~data1[3]; + } + if (data1[0] > 32767) { + data1[0] = ~data1[0]; + for (i = 0; i < 4; i++) + data1[i] = (data1[i] * (65536 - percent) + data2[i] * percent) >> 16; + for (i = 0; i < 16; i++) + cols1[i] = (cols1[i] * (65536 - percent) + cols2[i] * percent) >> 16; + } + *(unsigned int *)cols2 = *(unsigned int *)cols1; + a = cols2[3]; + if (a == 0 && !doblend) + continue; + + if (stixs >= 32768) { + xo = xs = (stixs ^ 65535) + data1[0]; + xe = stixe ? stixe + data1[0] : data1[2]; + } else if (stixe >= 32768) { + xs = stixs ? data1[2] - stixs : data1[0]; + xe = data1[2] - (stixe ^ 65535); + xo = xe + 1; + } else { + xo = xs = stixs; + xe = stixe ? stixe : data1[2]; + } + if (stiys >= 32768) { + yo = ys = (stiys ^ 65535) + data1[1]; + ye = stiye ? stiye + data1[1] : data1[3]; + } else if (stiye >= 32768) { + ys = stiys ? data1[3] - stiys : data1[1]; + ye = data1[3] - (stiye ^ 65535); + yo = ye + 1; + } else { + yo = ys = stiys; + ye = stiye ? stiye : data1[3]; + } + xo = 32 - (xo & 31); + yo = stin - (yo % stin); + if (xs < data1[0]) + xs = data1[0]; + if (xe > data1[2]) + xe = data1[2]; + if (ys < data1[1]) + ys = data1[1]; + if (ye > data1[3]) + ye = data1[3]; + + for (y = ys; y <= ye; y++) { + sti = stipple[(y + yo) % stin]; + x = (xs + xo) & 31; + if (x) + sti = (sti << x) | (sti >> (32 - x)); + if (doblend) { + if ((p = data1[3] - data1[1]) != 0) + p = ((y - data1[1]) << 16) / p; + for (i = 0; i < 8; i++) + cols2[i + 8] = (cols1[i] * (65536 - p) + cols1[i + 8] * p) >> 16; + } + add = (xs & 1); + add ^= (add ^ y) & 1 ? 1 : 3; /* 2x2 ordered dithering */ + picp = (unsigned short *)(pic + xs * 2 + y * bytes); + for (x = xs; x <= xe; x++) { + if (!(sti & 0x80000000)) { + sti <<= 1; + picp++; + add ^= 3; + continue; + } + sti = (sti << 1) | 1; + if (doblend) { + if ((p = data1[2] - data1[0]) != 0) + p = ((x - data1[0]) << 16) / p; + for (i = 0; i < 4; i++) + cols2[i] = (cols2[i + 8] * (65536 - p) + cols2[i + 12] * p) >> 16; + a = cols2[3]; + } + r = cols2[0]; + g = cols2[1]; + b = cols2[2]; + if (a != 255) { + i = *picp; + r = ((i >> 8 & 0xf8) * (255 - a) + r * a) / 255; + g = ((i >> 3 & 0xfc) * (255 - a) + g * a) / 255; + b = ((i << 3 & 0xf8) * (255 - a) + b * a) / 255; + } + #define CLAMP(x) ((x) >= 256 ? 255 : (x)) + i = ((CLAMP(r + add*2+1) & 0xf8) << 8) | + ((CLAMP(g + add ) & 0xfc) << 3) | + ((CLAMP(b + add*2+1) ) >> 3); + *picp++ = i; + add ^= 3; + } + } + } +} + +static int splash_check_jpeg(unsigned char *jpeg, int width, int height, int depth) +{ + int size, err; + unsigned char *mem; + + size = ((width + 15) & ~15) * ((height + 15) & ~15) * (depth >> 3); + mem = vmalloc(size); + if (!mem) { + printk(KERN_INFO "bootsplash: no memory for decoded picture.\n"); + return -1; + } + if (!decdata) + decdata = vmalloc(sizeof(*decdata)); + if ((err = jpeg_decode(jpeg, mem, ((width + 15) & ~15), ((height + 15) & ~15), depth, decdata))) + printk(KERN_INFO "bootsplash: error while decompressing picture: %s (%d)\n",jpg_errors[err - 1], err); + vfree(mem); + return err ? -1 : 0; +} + +static void splash_free(struct vc_data *vc, struct fb_info *info) +{ + if (!vc->vc_splash_data) + return; + if (info->silent_screen_base) + info->screen_base = info->silent_screen_base; + info->silent_screen_base = 0; + if (vc->vc_splash_data->splash_silentjpeg) + vfree(vc->vc_splash_data->splash_sboxes); + vfree(vc->vc_splash_data); + vc->vc_splash_data = 0; + info->splash_data = 0; +} + +static int splash_mkpenguin(struct splash_data *data, int pxo, int pyo, int pwi, int phe, int pr, int pg, int pb) +{ + unsigned char *buf; + int i; + + if (pwi ==0 || phe == 0) + return 0; + buf = (unsigned char *)data + sizeof(*data); + pwi += pxo - 1; + phe += pyo - 1; + *buf++ = pxo; + *buf++ = pxo >> 8; + *buf++ = pyo; + *buf++ = pyo >> 8; + *buf++ = pwi; + *buf++ = pwi >> 8; + *buf++ = phe; + *buf++ = phe >> 8; + *buf++ = pr; + *buf++ = pg; + *buf++ = pb; + *buf++ = 0; + for (i = 0; i < 12; i++, buf++) + *buf = buf[-12]; + buf[-24] ^= 0xff; + buf[-23] ^= 0xff; + buf[-1] = 0xff; + return 2; +} + +static const int splash_offsets[3][16] = { + /* len, unit, size, state, fgcol, col, xo, yo, wi, he + boxcnt, ssize, sboxcnt, percent, overok, palcnt */ + /* V1 */ + { 20, -1, 16, -1, -1, -1, 8, 10, 12, 14, + -1, -1, -1, -1, -1, -1 }, + /* V2 */ + { 35, 8, 12, 9, 10, 11, 16, 18, 20, 22, + -1, -1, -1, -1, -1, -1 }, + /* V3 */ + { 38, 8, 12, 9, 10, 11, 16, 18, 20, 22, + 24, 28, 32, 34, 36, 37 }, +}; + +#define SPLASH_OFF_LEN offsets[0] +#define SPLASH_OFF_UNIT offsets[1] +#define SPLASH_OFF_SIZE offsets[2] +#define SPLASH_OFF_STATE offsets[3] +#define SPLASH_OFF_FGCOL offsets[4] +#define SPLASH_OFF_COL offsets[5] +#define SPLASH_OFF_XO offsets[6] +#define SPLASH_OFF_YO offsets[7] +#define SPLASH_OFF_WI offsets[8] +#define SPLASH_OFF_HE offsets[9] +#define SPLASH_OFF_BOXCNT offsets[10] +#define SPLASH_OFF_SSIZE offsets[11] +#define SPLASH_OFF_SBOXCNT offsets[12] +#define SPLASH_OFF_PERCENT offsets[13] +#define SPLASH_OFF_OVEROK offsets[14] +#define SPLASH_OFF_PALCNT offsets[15] + +static inline int splash_getb(unsigned char *pos, int off) +{ + return off == -1 ? 0 : pos[off]; +} + +static inline int splash_gets(unsigned char *pos, int off) +{ + return off == -1 ? 0 : pos[off] | pos[off + 1] << 8; +} + +static inline int splash_geti(unsigned char *pos, int off) +{ + return off == -1 ? 0 : + pos[off] | pos[off + 1] << 8 | pos[off + 2] << 16 | pos[off + 3] << 24; +} + +static int splash_getraw(unsigned char *start, unsigned char *end, int *update) +{ + unsigned char *ndata; + int version; + int splash_size; + int unit; + int width, height; + int silentsize; + int boxcnt; + int sboxcnt; + int palcnt; + int i, len; + const int *offsets; + struct vc_data *vc; + struct fb_info *info; + struct splash_data *sd; + + if (update) + *update = -1; + + if (!update || start[7] < '2' || start[7] > '3' || splash_geti(start, 12) != (int)0xffffffff) + printk(KERN_INFO "bootsplash %s: looking for picture...", SPLASH_VERSION); + + for (ndata = start; ndata < end; ndata++) { + if (ndata[0] != 'B' || ndata[1] != 'O' || ndata[2] != 'O' || ndata[3] != 'T') + continue; + if (ndata[4] != 'S' || ndata[5] != 'P' || ndata[6] != 'L' || ndata[7] < '1' || ndata[7] > '3') + continue; + version = ndata[7] - '0'; + offsets = splash_offsets[version - 1]; + len = SPLASH_OFF_LEN; + unit = splash_getb(ndata, SPLASH_OFF_UNIT); + if (unit >= MAX_NR_CONSOLES) + continue; + if (unit) { + vc_allocate(unit); + } + vc = vc_cons[unit].d; + info = registered_fb[(int)con2fb_map[unit]]; + width = info->var.xres; + height = info->var.yres; + splash_size = splash_geti(ndata, SPLASH_OFF_SIZE); + if (splash_size == (int)0xffffffff && version > 1) { + if ((sd = vc->vc_splash_data) != 0) { + int up = 0; + i = splash_getb(ndata, SPLASH_OFF_STATE); + if (i != 255) { + sd->splash_state = i; + up = -1; + } + i = splash_getb(ndata, SPLASH_OFF_FGCOL); + if (i != 255) { + sd->splash_fg_color = i; + up = -1; + } + i = splash_getb(ndata, SPLASH_OFF_COL); + if (i != 255) { + sd->splash_color = i; + up = -1; + } + boxcnt = sboxcnt = 0; + if (ndata + len <= end) { + boxcnt = splash_gets(ndata, SPLASH_OFF_BOXCNT); + sboxcnt = splash_gets(ndata, SPLASH_OFF_SBOXCNT); + } + if (boxcnt) { + i = splash_gets(ndata, len); + if (boxcnt + i <= sd->splash_boxcount && ndata + len + 2 + boxcnt * 12 <= end) { + + if (splash_geti(ndata, len + 2) != 0x7ffd7fff || !memcmp(ndata + len + 2, sd->splash_boxes + i * 12, 8)) { + + memcpy(sd->splash_boxes + i * 12, ndata + len + 2, boxcnt * 12); + up |= 1; + } + } + len += boxcnt * 12 + 2; + } + if (sboxcnt) { + i = splash_gets(ndata, len); + if (sboxcnt + i <= sd->splash_sboxcount && ndata + len + 2 + sboxcnt * 12 <= end) { + if (splash_geti(ndata, len + 2) != 0x7ffd7fff || !memcmp(ndata + len + 2, sd->splash_sboxes + i * 12, 8)) { + memcpy(sd->splash_sboxes + i * 12, ndata + len + 2, sboxcnt * 12); + up |= 2; + } + } + } + if (update) + *update = up; + } + return unit; + } + if (splash_size == 0) { + printk(KERN_INFO"...found, freeing memory.\n"); + if (vc->vc_splash_data) + splash_free(vc, info); + return unit; + } + boxcnt = splash_gets(ndata, SPLASH_OFF_BOXCNT); + palcnt = 3 * splash_getb(ndata, SPLASH_OFF_PALCNT); + if (ndata + len + splash_size > end) { + printk(KERN_INFO "...found, but truncated!\n"); + return -1; + } + if (!jpeg_check_size(ndata + len + boxcnt * 12 + palcnt, width, height)) { + ndata += len + splash_size - 1; + continue; + } + if (splash_check_jpeg(ndata + len + boxcnt * 12 + palcnt, width, height, info->var.bits_per_pixel)) + return -1; + silentsize = splash_geti(ndata, SPLASH_OFF_SSIZE); + if (silentsize) + printk(KERN_INFO" silentjpeg size %d bytes,", silentsize); + if (silentsize >= splash_size) { + printk(KERN_INFO " bigger than splashsize!\n"); + return -1; + } + splash_size -= silentsize; + if (!splash_usesilent) + silentsize = 0; + else if (height * 2 * info->fix.line_length > info->fix.smem_len) { + printk(KERN_INFO " does not fit into framebuffer.\n"); + silentsize = 0; + } + sboxcnt = splash_gets(ndata, SPLASH_OFF_SBOXCNT); + if (silentsize) { + unsigned char *simage = ndata + len + splash_size + 12 * sboxcnt; + if (!jpeg_check_size(simage, width, height) || + splash_check_jpeg(simage, width, height, info->var.bits_per_pixel)) { + printk(KERN_INFO " error in silent jpeg.\n"); + silentsize = 0; + } + } + if (vc->vc_splash_data) + splash_free(vc, info); + vc->vc_splash_data = sd = vmalloc(sizeof(*sd) + splash_size + (version < 3 ? 2 * 12 : 0)); + if (!sd) + break; + sd->splash_silentjpeg = 0; + sd->splash_sboxes = 0; + sd->splash_sboxcount = 0; + if (silentsize) { + sd->splash_silentjpeg = vmalloc(silentsize); + if (sd->splash_silentjpeg) { + memcpy(sd->splash_silentjpeg, ndata + len + splash_size, silentsize); + sd->splash_sboxes = vc->vc_splash_data->splash_silentjpeg; + sd->splash_silentjpeg += 12 * sboxcnt; + sd->splash_sboxcount = sboxcnt; + } + } + sd->splash_state = splash_getb(ndata, SPLASH_OFF_STATE); + sd->splash_fg_color = splash_getb(ndata, SPLASH_OFF_FGCOL); + sd->splash_color = splash_getb(ndata, SPLASH_OFF_COL); + sd->splash_overpaintok = splash_getb(ndata, SPLASH_OFF_OVEROK); + sd->splash_text_xo = splash_gets(ndata, SPLASH_OFF_XO); + sd->splash_text_yo = splash_gets(ndata, SPLASH_OFF_YO); + sd->splash_text_wi = splash_gets(ndata, SPLASH_OFF_WI); + sd->splash_text_he = splash_gets(ndata, SPLASH_OFF_HE); + sd->splash_percent = splash_gets(ndata, SPLASH_OFF_PERCENT); + if (version == 1) { + sd->splash_text_xo *= 8; + sd->splash_text_wi *= 8; + sd->splash_text_yo *= 16; + sd->splash_text_he *= 16; + sd->splash_color = (splash_default >> 8) & 0x0f; + sd->splash_fg_color = (splash_default >> 4) & 0x0f; + sd->splash_state = splash_default & 1; + } + if (sd->splash_text_xo + sd->splash_text_wi > width || sd->splash_text_yo + sd->splash_text_he > height) { + splash_free(vc, info); + printk(KERN_INFO " found, but has oversized text area!\n"); + return -1; + } +/* if (!vc_cons[unit].d || info->fbops != &vesafb_ops) { + splash_free(vc, info); + printk(KERN_INFO " found, but framebuffer can't handle it!\n"); + return -1; + } */ + printk(KERN_INFO "...found (%dx%d, %d bytes, v%d).\n", width, height, splash_size, version); + if (version == 1) { + printk(KERN_WARNING "bootsplash: Using deprecated v1 header. Updating your splash utility recommended.\n"); + printk(KERN_INFO "bootsplash: Find the latest version at http://www.bootsplash.org/\n"); + } + + /* fake penguin box for older formats */ + if (version == 1) + boxcnt = splash_mkpenguin(sd, sd->splash_text_xo + 10, sd->splash_text_yo + 10, sd->splash_text_wi - 20, sd->splash_text_he - 20, 0xf0, 0xf0, 0xf0); + else if (version == 2) + boxcnt = splash_mkpenguin(sd, splash_gets(ndata, 24), splash_gets(ndata, 26), splash_gets(ndata, 28), splash_gets(ndata, 30), splash_getb(ndata, 32), splash_getb(ndata, 33), splash_getb(ndata, 34)); + + memcpy((char *)sd + sizeof(*sd) + (version < 3 ? boxcnt * 12 : 0), ndata + len, splash_size); + sd->splash_boxcount = boxcnt; + sd->splash_boxes = (unsigned char *)sd + sizeof(*sd); + sd->splash_palette = sd->splash_boxes + boxcnt * 12; + sd->splash_jpeg = sd->splash_palette + palcnt; + sd->splash_palcnt = palcnt / 3; + sd->splash_dosilent = sd->splash_silentjpeg != 0; + return unit; + } + printk(KERN_INFO "...no good signature found.\n"); + return -1; +} + +int splash_verbose(void) +{ + struct vc_data *vc; + struct fb_info *info; + + if (!splash_usesilent) + return 0; + + vc = vc_cons[0].d; + + if (!vc || !vc->vc_splash_data || !vc->vc_splash_data->splash_state) + return 0; + if (fg_console != vc->vc_num) + return 0; + if (!vc->vc_splash_data->splash_silentjpeg || !vc->vc_splash_data->splash_dosilent) + return 0; + vc->vc_splash_data->splash_dosilent = 0; + info = registered_fb[(int)con2fb_map[0]]; + if (!info->silent_screen_base) + return 0; + splashcopy(info->silent_screen_base, info->screen_base, info->var.yres, info->var.xres, info->fix.line_length, info->fix.line_length); + info->screen_base = info->silent_screen_base; + info->silent_screen_base = 0; + return 1; +} + +static void splash_off(struct fb_info *info) +{ + if (info->silent_screen_base) + info->screen_base = info->silent_screen_base; + info->silent_screen_base = 0; + info->splash_data = 0; + if (info->splash_pic) + vfree(info->splash_pic); + info->splash_pic = 0; + info->splash_pic_size = 0; +} + +int splash_prepare(struct vc_data *vc, struct fb_info *info) +{ + int err; + int width, height, depth, size, sbytes; + + if (!vc->vc_splash_data || !vc->vc_splash_data->splash_state) { + if (decdata) + vfree(decdata); + decdata = 0; + splash_off(info); + return -1; + } + + width = info->var.xres; + height = info->var.yres; + depth = info->var.bits_per_pixel; + if (depth != 16) { /* Other targets might need fixing */ + splash_off(info); + return -2; + } + + sbytes = ((width + 15) & ~15) * (depth >> 3); + size = sbytes * ((height + 15) & ~15); + if (size != info->splash_pic_size) + splash_off(info); + if (!info->splash_pic) + info->splash_pic = vmalloc(size); + + if (!info->splash_pic) { + printk(KERN_INFO "bootsplash: not enough memory.\n"); + splash_off(info); + return -3; + } + + if (!decdata) + decdata = vmalloc(sizeof(*decdata)); + + if (vc->vc_splash_data->splash_silentjpeg && vc->vc_splash_data->splash_dosilent) { + /* fill area after framebuffer with other jpeg */ + if ((err = jpeg_decode(vc->vc_splash_data->splash_silentjpeg, info->splash_pic, + ((width + 15) & ~15), ((height + 15) & ~15), depth, decdata))) { + printk(KERN_INFO "bootsplash: error while decompressing silent picture: %s (%d)\n", jpg_errors[err - 1], err); + if (info->silent_screen_base) + info->screen_base = info->silent_screen_base; + vc->vc_splash_data->splash_dosilent = 0; + } else { + if (vc->vc_splash_data->splash_sboxcount) + boxit(info->splash_pic, sbytes, vc->vc_splash_data->splash_sboxes, + vc->vc_splash_data->splash_sboxcount, vc->vc_splash_data->splash_percent, 0); + + if (!info->silent_screen_base) + info->silent_screen_base = info->screen_base; + splashcopy(info->silent_screen_base, info->splash_pic, info->var.yres, info->var.xres, info->fix.line_length, sbytes); + info->screen_base = info->silent_screen_base + info->fix.line_length * info->var.yres; + } + } else if (info->silent_screen_base) + info->screen_base = info->silent_screen_base; + + if ((err = jpeg_decode(vc->vc_splash_data->splash_jpeg, info->splash_pic, + ((width + 15) & ~15), ((height + 15) & ~15), depth, decdata))) { + printk(KERN_INFO "bootsplash: error while decompressing picture: %s (%d) .\n", jpg_errors[err - 1], err); + splash_off(info); + return -4; + } + info->splash_pic_size = size; + info->splash_bytes = sbytes; + if (vc->vc_splash_data->splash_boxcount) + boxit(info->splash_pic, sbytes, vc->vc_splash_data->splash_boxes, vc->vc_splash_data->splash_boxcount, vc->vc_splash_data->splash_percent, 0); + if (vc->vc_splash_data->splash_state) + info->splash_data = vc->vc_splash_data; + else + splash_off(info); + return 0; +} + + +#ifdef CONFIG_PROC_FS + +#include + +static int splash_read_proc(char *buffer, char **start, off_t offset, int size, + int *eof, void *data); +static int splash_write_proc(struct file *file, const char *buffer, + unsigned long count, void *data); +static int splash_status(struct vc_data *vc); +static int splash_recolor(struct vc_data *vc); +static int splash_proc_register(void); + +static struct proc_dir_entry *proc_splash; + +static int splash_recolor(struct vc_data *vc) +{ + if (!vc->vc_splash_data) + return -1; + if (!vc->vc_splash_data->splash_state) + return 0; + con_remap_def_color(vc, vc->vc_splash_data->splash_color << 4 | vc->vc_splash_data->splash_fg_color); + if (fg_console == vc->vc_num) { + update_region(vc, vc->vc_origin + vc->vc_size_row * vc->vc_top, + vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2); + } + return 0; +} + +static int splash_status(struct vc_data *vc) +{ + struct fb_info *info; + printk(KERN_INFO "bootsplash: status on console %d changed to %s\n", vc->vc_num, vc->vc_splash_data && vc->vc_splash_data->splash_state ? "on" : "off"); + + info = registered_fb[(int) con2fb_map[vc->vc_num]]; + if (fg_console == vc->vc_num) + splash_prepare(vc, info); + if (vc->vc_splash_data && vc->vc_splash_data->splash_state) { + con_remap_def_color(vc, vc->vc_splash_data->splash_color << 4 | vc->vc_splash_data->splash_fg_color); + /* vc_resize also calls con_switch which resets yscroll */ + vc_resize(vc, vc->vc_splash_data->splash_text_wi / vc->vc_font.width, vc->vc_splash_data->splash_text_he / vc->vc_font.height); + if (fg_console == vc->vc_num) { + update_region(vc, vc->vc_origin + vc->vc_size_row * vc->vc_top, + vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2); + splash_clear_margins(vc->vc_splash_data, vc, info, 0); + } + } else { + /* Switch bootsplash off */ + con_remap_def_color(vc, 0x07); + vc_resize(vc, info->var.xres / vc->vc_font.width, info->var.yres / vc->vc_font.height); + } + return 0; +} + +static int splash_read_proc(char *buffer, char **start, off_t offset, int size, + int *eof, void *data) +{ + int len = 0; + off_t begin = 0; + struct vc_data *vc = vc_cons[0].d; + struct fb_info *info = registered_fb[(int)con2fb_map[0]]; + int color = vc->vc_splash_data ? vc->vc_splash_data->splash_color << 4 | + vc->vc_splash_data->splash_fg_color : splash_default >> 4; + int status = vc->vc_splash_data ? vc->vc_splash_data->splash_state & 1 : 0; + len += sprintf(buffer + len, "Splash screen v%s (0x%02x, %dx%d%s): %s\n", + SPLASH_VERSION, color, info->var.xres, info->var.yres, + (vc->vc_splash_data ? vc->vc_splash_data->splash_dosilent : 0)? ", silent" : "", + status ? "on" : "off"); + if (offset >= begin + len) + return 0; + + *start = buffer + (begin - offset); + + return (size < begin + len - offset ? size : begin + len - offset); +} + +static int splash_write_proc(struct file *file, const char *buffer, + unsigned long count, void *data) +{ + int new, unit; + struct vc_data *vc; + + if (!buffer || !splash_default) + return count; + + acquire_console_sem(); + if (!strncmp(buffer, "show", 4) || !strncmp(buffer, "hide", 4)) { + int pe, oldpe; + + vc = vc_cons[0].d; + if (buffer[4] == ' ' && buffer[5] == 'p') + pe = 0; + else if (buffer[4] == '\n') + pe = 65535; + else + pe = simple_strtoul(buffer + 5, NULL, 0); + if (pe < 0) + pe = 0; + if (pe > 65535) + pe = 65535; + if (*buffer == 'h') + pe = 65535 - pe; + pe += pe > 32767; + if (vc->vc_splash_data && vc->vc_splash_data->splash_percent != pe) { + struct fb_info *info; + struct fbcon_ops *ops; + + oldpe = vc->vc_splash_data->splash_percent; + vc->vc_splash_data->splash_percent = pe; + if (fg_console != 0 || !vc->vc_splash_data->splash_state) { + release_console_sem(); + return count; + } + info = registered_fb[(int) con2fb_map[vc->vc_num]]; + ops = info->fbcon_par; + if (ops->blank_state) { + release_console_sem(); + return count; + } + if (!vc->vc_splash_data->splash_overpaintok || pe == 65536 || pe < oldpe) { + if (splash_hasinter(vc->vc_splash_data->splash_boxes, vc->vc_splash_data->splash_boxcount)) + splash_status(vc); + else + splash_prepare(vc, info); + } else { + if (vc->vc_splash_data->splash_silentjpeg && vc->vc_splash_data->splash_dosilent && info->silent_screen_base) + boxit(info->silent_screen_base, info->fix.line_length, vc->vc_splash_data->splash_sboxes, vc->vc_splash_data->splash_sboxcount, vc->vc_splash_data->splash_percent, 1); + boxit(info->screen_base, info->fix.line_length, vc->vc_splash_data->splash_boxes, vc->vc_splash_data->splash_boxcount, vc->vc_splash_data->splash_percent, 1); + } + } + release_console_sem(); + return count; + } + if (!strncmp(buffer,"silent\n",7) || !strncmp(buffer,"verbose\n",8)) { + vc = vc_cons[0].d; + if (vc->vc_splash_data && vc->vc_splash_data->splash_silentjpeg) { + if (vc->vc_splash_data->splash_dosilent != (buffer[0] == 's')) { + vc->vc_splash_data->splash_dosilent = buffer[0] == 's'; + splash_status(vc); + } + } + release_console_sem(); + return count; + } + if (!strncmp(buffer,"freesilent\n",11)) { + vc = vc_cons[0].d; + if (vc->vc_splash_data && vc->vc_splash_data->splash_silentjpeg) { + printk(KERN_INFO "bootsplash: freeing silent jpeg\n"); + vc->vc_splash_data->splash_silentjpeg = 0; + vfree(vc->vc_splash_data->splash_sboxes); + vc->vc_splash_data->splash_sboxes = 0; + vc->vc_splash_data->splash_sboxcount = 0; + if (vc->vc_splash_data->splash_dosilent) + splash_status(vc); + vc->vc_splash_data->splash_dosilent = 0; + } + release_console_sem(); + return count; + } + + if (!strncmp(buffer, "BOOTSPL", 7)) { + int up = -1; + unit = splash_getraw((unsigned char *)buffer, (unsigned char *)buffer + count, &up); + if (unit >= 0) { + vc = vc_cons[unit].d; + if (up == -1) + splash_status(vc); + else { + struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]]; + struct fbcon_ops *ops = info->fbcon_par; + if (ops->blank_state) + up = 0; + if ((up & 2) != 0 && vc->vc_splash_data->splash_silentjpeg && vc->vc_splash_data->splash_dosilent && info->silent_screen_base) + boxit(info->silent_screen_base, info->fix.line_length, vc->vc_splash_data->splash_sboxes, vc->vc_splash_data->splash_sboxcount, vc->vc_splash_data->splash_percent, 1); + if ((up & 1) != 0) + boxit(info->screen_base, info->fix.line_length, vc->vc_splash_data->splash_boxes, vc->vc_splash_data->splash_boxcount, vc->vc_splash_data->splash_percent, 1); + } + } + release_console_sem(); + return count; + } + vc = vc_cons[0].d; + if (!vc->vc_splash_data) { + release_console_sem(); + return count; + } + if (buffer[0] == 't') { + vc->vc_splash_data->splash_state ^= 1; + splash_status(vc); + release_console_sem(); + return count; + } + new = simple_strtoul(buffer, NULL, 0); + if (new > 1) { + /* expert user */ + vc->vc_splash_data->splash_color = new >> 8 & 0xff; + vc->vc_splash_data->splash_fg_color = new >> 4 & 0x0f; + } + if ((new & 1) == vc->vc_splash_data->splash_state) + splash_recolor(vc); + else { + vc->vc_splash_data->splash_state = new & 1; + splash_status(vc); + } + release_console_sem(); + return count; +} + +static int splash_proc_register(void) +{ + if ((proc_splash = create_proc_entry("splash", 0, 0))) { + proc_splash->read_proc = splash_read_proc; + proc_splash->write_proc = splash_write_proc; + return 0; + } + return 1; +} + +# if 0 +static int splash_proc_unregister(void) +{ + if (proc_splash) + remove_proc_entry("splash", 0); + return 0; +} +# endif +#endif /* CONFIG_PROC_FS */ + +void splash_init(void) +{ + struct fb_info *info; + struct vc_data *vc; + int isramfs = 1; + int fd; + int len; + int max_len = 1024*1024*2; + char *mem; + + if (splash_registered) + return; + vc = vc_cons[0].d; + info = registered_fb[0]; + if (!vc || !info || info->var.bits_per_pixel != 16) + return; +#ifdef CONFIG_PROC_FS + splash_proc_register(); +#endif + splash_registered = 1; + if (vc->vc_splash_data) + return; + if ((fd = sys_open("/bootsplash", O_RDONLY, 0)) < 0) { + isramfs = 0; + fd = sys_open("/initrd.image", O_RDONLY, 0); + } + if (fd < 0) + return; + if ((len = (int)sys_lseek(fd, (off_t)0, 2)) <= 0) { + sys_close(fd); + return; + } + /* Don't look for more than the last 2MB */ + if (len > max_len) { + printk( KERN_INFO "bootsplash: scanning last %dMB of initrd for signature\n", + max_len>>20); + sys_lseek(fd, (off_t)(len - max_len), 0); + len = max_len; + } else { + sys_lseek(fd, (off_t)0, 0); + } + + mem = vmalloc(len); + if (mem) { + acquire_console_sem(); + if ((int)sys_read(fd, mem, len) == len && splash_getraw((unsigned char *)mem, (unsigned char *)mem + len, (int *)0) == 0 && vc->vc_splash_data) + vc->vc_splash_data->splash_state = splash_default & 1; + release_console_sem(); + vfree(mem); + } + sys_close(fd); + if (isramfs) + sys_unlink("/bootsplash"); + return; +} + Index: linux-2.6.16/drivers/video/bootsplash/bootsplash.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.16/drivers/video/bootsplash/bootsplash.h 2006-03-20 18:42:50.000000000 +0100 @@ -0,0 +1,44 @@ +/* + * linux/drivers/video/bootsplash/bootsplash.h - splash screen definition. + * + * (w) 2001-2003 by Volker Poplawski, + * Stefan Reinauer, + * + * + * idea and SuSE screen work by Ken Wimer, + */ + +#ifndef __BOOTSPLASH_H +#define __BOOTSPLASH_H + +struct fb_info; + +/* splash.c */ +extern int splash_prepare(struct vc_data *, struct fb_info *); +extern void splash_init(void); + +/* splash_render.c */ +extern void splash_putcs(struct splash_data *sd, struct vc_data *vc, struct fb_info *info, + const unsigned short *s, int count, int ypos, int xpos); +extern void splash_putc(struct splash_data *sd, struct vc_data *vc, struct fb_info *info, + int c, int ypos, int xpos); +extern void splashcopy(u8 *dst, u8 *src, int height, int width, int dstbytes, int srcbytes); +extern void splash_clear(struct splash_data *sd, struct vc_data *vc, struct fb_info *info, int sy, + int sx, int height, int width); +extern void splash_bmove(struct splash_data *sd, struct vc_data *vc, struct fb_info *info, int sy, + int sx, int dy, int dx, int height, int width); +extern void splash_clear_margins(struct splash_data *sd, struct vc_data *vc, struct fb_info *info, + int bottom_only); +extern int splash_cursor(struct splash_data *sd, struct fb_info *info, struct fb_cursor *cursor); +extern void splash_bmove_redraw(struct splash_data *sd, struct vc_data *vc, struct fb_info *info, + int y, int sx, int dx, int width); +extern void splash_blank(struct splash_data *sd, struct vc_data *vc, struct fb_info *info, + int blank); + +/* vt.c */ +extern void con_remap_def_color(struct vc_data *, int new_color); + +extern void acquire_console_sem(void); +extern void release_console_sem(void); + +#endif Index: linux-2.6.16/drivers/video/bootsplash/decode-jpg.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6.16/drivers/video/bootsplash/decode-jpg.c 2006-03-20 18:42:50.000000000 +0100 @@ -0,0 +1,958 @@ +/* + * linux/drivers/video/bootsplash/decode-jpg.c - a tiny jpeg decoder. + * + * (w) August 2001 by Michael Schroeder, + * + */ + +#include +#include +#include + +#include "decode-jpg.h" + +#define ISHIFT 11 + +#define IFIX(a) ((int)((a) * (1 << ISHIFT) + .5)) +#define IMULT(a, b) (((a) * (b)) >> ISHIFT) +#define ITOINT(a) ((a) >> ISHIFT) + +#ifndef __P +# define __P(x) x +#endif + +/* special markers */ +#define M_BADHUFF -1 +#define M_EOF 0x80 + +struct in { + unsigned char *p; + unsigned int bits; + int left; + int marker; + + int (*func) __P((void *)); + void *data; +}; + +/*********************************/ +struct dec_hufftbl; +struct enc_hufftbl; + +union hufftblp { + struct dec_hufftbl *dhuff; + struct enc_hufftbl *ehuff; +}; + +struct scan { + int dc; /* old dc value */ + + union hufftblp hudc; + union hufftblp huac; + int next; /* when to switch to next scan */ + + int cid; /* component id */ + int hv; /* horiz/vert, copied from comp */ + int tq; /* quant tbl, copied from comp */ +}; + +/*********************************/ + +#define DECBITS 10 /* seems to be the optimum */ + +struct dec_hufftbl { + int maxcode[17]; + int valptr[16]; + unsigned char vals[256]; + unsigned int llvals[1 << DECBITS]; +}; + +static void decode_mcus __P((struct in *, int *, int, struct scan *, int *)); +static int dec_readmarker __P((struct in *)); +static void dec_makehuff __P((struct dec_hufftbl *, int *, unsigned char *)); + +static void setinput __P((struct in *, unsigned char *)); +/*********************************/ + +#undef PREC +#define PREC int + +static void idctqtab __P((unsigned char *, PREC *)); +static void idct __P((int *, int *, PREC *, PREC, int)); +static void scaleidctqtab __P((PREC *, PREC)); + +/*********************************/ + +static void initcol __P((PREC[][64])); + +static void col221111 __P((int *, unsigned char *, int)); +static void col221111_16 __P((int *, unsigned char *, int)); + +/*********************************/ + +#define M_SOI 0xd8 +#define M_APP0 0xe0 +#define M_DQT 0xdb +#define M_SOF0 0xc0 +#define M_DHT 0xc4 +#define M_DRI 0xdd +#define M_SOS 0xda +#define M_RST0 0xd0 +#define M_EOI 0xd9 +#define M_COM 0xfe + +static unsigned char *datap; + +static int getbyte(void) +{ + return *datap++; +} + +static int getword(void) +{ + int c1, c2; + c1 = *datap++; + c2 = *datap++; + return c1 << 8 | c2; +} + +struct comp { + int cid; + int hv; + int tq; +}; + +#define MAXCOMP 4 +struct jpginfo { + int nc; /* number of components */ + int ns; /* number of scans */ + int dri; /* restart interval */ + int nm; /* mcus til next marker */ + int rm; /* next restart marker */ +}; + +static struct jpginfo info; +static struct comp comps[MAXCOMP]; + +static struct scan dscans[MAXCOMP]; + +static unsigned char quant[4][64]; + +static struct dec_hufftbl dhuff[4]; + +#define dec_huffdc (dhuff + 0) +#define dec_huffac (dhuff + 2) + +static struct in in; + +static int readtables(int till) +{ + int m, l, i, j, lq, pq, tq; + int tc, th, tt; + + for (;;) { + if (getbyte() != 0xff) + return -1; + if ((m = getbyte()) == till) + break; + + switch (m) { + case 0xc2: + return 0; + + case M_DQT: + lq = getword(); + while (lq > 2) { + pq = getbyte(); + tq = pq & 15; + if (tq > 3) + return -1; + pq >>= 4; + if (pq != 0) + return -1; + for (i = 0; i < 64; i++) + quant[tq][i] = getbyte(); + lq -= 64 + 1; + } + break; + + case M_DHT: + l = getword(); + while (l > 2) { + int hufflen[16], k; + unsigned char huffvals[256]; + + tc = getbyte(); + th = tc & 15; + tc >>= 4; + tt = tc * 2 + th; + if (tc > 1 || th > 1) + return -1; + for (i = 0; i < 16; i++) + hufflen[i] = getbyte(); + l -= 1 + 16; + k = 0; + for (i = 0; i < 16; i++) { + for (j = 0; j < hufflen[i]; j++) + huffvals[k++] = getbyte(); + l -= hufflen[i]; + } + dec_makehuff(dhuff + tt, hufflen, + huffvals); + } + break; + + case M_DRI: + l = getword(); + info.dri = getword(); + break; + + default: + l = getword(); + while (l-- > 2) + getbyte(); + break; + } + } + return 0; +} + +static void dec_initscans(void) +{ + int i; + + info.nm = info.dri + 1; + info.rm = M_RST0; + for (i = 0; i < info.ns; i++) + dscans[i].dc = 0; +} + +static int dec_checkmarker(void) +{ + int i; + + if (dec_readmarker(&in) != info.rm) + return -1; + info.nm = info.dri; + info.rm = (info.rm + 1) & ~0x08; + for (i = 0; i < info.ns; i++) + dscans[i].dc = 0; + return 0; +} + +int jpeg_check_size(unsigned char *buf, int width, int height) +{ + datap = buf; + getbyte(); + getbyte(); + readtables(M_SOF0); + getword(); + getbyte(); + if (height != getword() || width != getword()) + return 0; + return 1; +} + +int jpeg_decode(buf, pic, width, height, depth, decdata) +unsigned char *buf, *pic; +int width, height, depth; +struct jpeg_decdata *decdata; +{ + int i, j, m, tac, tdc; + int mcusx, mcusy, mx, my; + int max[6]; + + if (!decdata || !buf || !pic) + return -1; + datap = buf; + if (getbyte() != 0xff) + return ERR_NO_SOI; + if (getbyte() != M_SOI) + return ERR_NO_SOI; + if (readtables(M_SOF0)) + return ERR_BAD_TABLES; + getword(); + i = getbyte(); + if (i != 8) + return ERR_NOT_8BIT; + if (((getword() + 15) & ~15) != height) + return ERR_HEIGHT_MISMATCH; + if (((getword() + 15) & ~15) != width) + return ERR_WIDTH_MISMATCH; + if ((height & 15) || (width & 15)) + return ERR_BAD_WIDTH_OR_HEIGHT; + info.nc = getbyte(); + if (info.nc > MAXCOMP) + return ERR_TOO_MANY_COMPPS; + for (i = 0; i < info.nc; i++) { + int h, v; + comps[i].cid = getbyte(); + comps[i].hv = getbyte(); + v = comps[i].hv & 15; + h = comps[i].hv >> 4; + comps[i].tq = getbyte(); + if (h > 3 || v > 3) + return ERR_ILLEGAL_HV; + if (comps[i].tq > 3) + return ERR_QUANT_TABLE_SELECTOR; + } + if (readtables(M_SOS)) + return ERR_BAD_TABLES; + getword(); + info.ns = getbyte(); + if (info.ns != 3) + return ERR_NOT_YCBCR_221111; + for (i = 0; i < 3; i++) { + dscans[i].cid = getbyte(); + tdc = getbyte(); + tac = tdc & 15; + tdc >>= 4; + if (tdc > 1 || tac > 1) + return ERR_QUANT_TABLE_SELECTOR; + for (j = 0; j < info.nc; j++) + if (comps[j].cid == dscans[i].cid) + break; + if (j == info.nc) + return ERR_UNKNOWN_CID_IN_SCAN; + dscans[i].hv = comps[j].hv; + dscans[i].tq = comps[j].tq; + dscans[i].hudc.dhuff = dec_huffdc + tdc; + dscans[i].huac.dhuff = dec_huffac + tac; + } + + i = getbyte(); + j = getbyte(); + m = getbyte(); + + if (i != 0 || j != 63 || m != 0) + return ERR_NOT_SEQUENTIAL_DCT; + + if (dscans[0].cid != 1 || dscans[1].cid != 2 || dscans[2].cid != 3) + return ERR_NOT_YCBCR_221111; + + if (dscans[0].hv != 0x22 || dscans[1].hv != 0x11 || dscans[2].hv != 0x11) + return ERR_NOT_YCBCR_221111; + + mcusx = width >> 4; + mcusy = height >> 4; + + + idctqtab(quant[dscans[0].tq], decdata->dquant[0]); + idctqtab(quant[dscans[1].tq], decdata->dquant[1]); + idctqtab(quant[dscans[2].tq], decdata->dquant[2]); + initcol(decdata->dquant); + setinput(&in, datap); + +#if 0 + /* landing zone */ + img[len] = 0; + img[len + 1] = 0xff; + img[len + 2] = M_EOF; +#endif + + dec_initscans(); + + dscans[0].next = 6 - 4; + dscans[1].next = 6 - 4 - 1; + dscans[2].next = 6 - 4 - 1 - 1; /* 411 encoding */ + for (my = 0; my < mcusy; my++) { + for (mx = 0; mx < mcusx; mx++) { + if (info.dri && !--info.nm) + if (dec_checkmarker()) + return ERR_WRONG_MARKER; + + decode_mcus(&in, decdata->dcts, 6, dscans, max); + idct(decdata->dcts, decdata->out, decdata->dquant[0], IFIX(128.5), max[0]); + idct(decdata->dcts + 64, decdata->out + 64, decdata->dquant[0], IFIX(128.5), max[1]); + idct(decdata->dcts + 128, decdata->out + 128, decdata->dquant[0], IFIX(128.5), max[2]); + idct(decdata->dcts + 192, decdata->out + 192, decdata->dquant[0], IFIX(128.5), max[3]); + idct(decdata->dcts + 256, decdata->out + 256, decdata->dquant[1], IFIX(0.5), max[4]); + idct(decdata->dcts + 320, decdata->out + 320, decdata->dquant[2], IFIX(0.5), max[5]); + + switch (depth) { + case 24: + col221111(decdata->out, pic + (my * 16 * mcusx + mx) * 16 * 3, mcusx * 16 * 3); + break; + case 16: + col221111_16(decdata->out, pic + (my * 16 * mcusx + mx) * (16 * 2), mcusx * (16 * 2)); + break; + default: + return ERR_DEPTH_MISMATCH; + break; + } + } + } + + m = dec_readmarker(&in); + if (m != M_EOI) + return ERR_NO_EOI; + + return 0; +} + +/****************************************************************/ +/************** huffman decoder ***************/ +/****************************************************************/ + +static int fillbits __P((struct in *, int, unsigned int)); +static int dec_rec2 +__P((struct in *, struct dec_hufftbl *, int *, int, int)); + +static void setinput(in, p) +struct in *in; +unsigned char *p; +{ + in->p = p; + in->left = 0; + in->bits = 0; + in->marker = 0; +} + +static int fillbits(in, le, bi) +struct in *in; +int le; +unsigned int bi; +{ + int b, m; + + if (in->marker) { + if (le <= 16) + in->bits = bi << 16, le += 16; + return le; + } + while (le <= 24) { + b = *in->p++; + if (b == 0xff && (m = *in->p++) != 0) { + if (m == M_EOF) { + if (in->func && (m = in->func(in->data)) == 0) + continue; + } + in->marker = m; + if (le <= 16) + bi = bi << 16, le += 16; + break; + } + bi = bi << 8 | b; + le += 8; + } + in->bits = bi; /* tmp... 2 return values needed */ + return le; +} + +static int dec_readmarker(in) +struct in *in; +{ + int m; + + in->left = fillbits(in, in->left, in->bits); + if ((m = in->marker) == 0) + return 0; + in->left = 0; + in->marker = 0; + return m; +} + +#define LEBI_DCL int le, bi +#define LEBI_GET(in) (le = in->left, bi = in->bits) +#define LEBI_PUT(in) (in->left = le, in->bits = bi) + +#define GETBITS(in, n) ( \ + (le < (n) ? le = fillbits(in, le, bi), bi = in->bits : 0), \ + (le -= (n)), \ + bi >> le & ((1 << (n)) - 1) \ +) + +#define UNGETBITS(in, n) ( \ + le += (n) \ +) + + +static int dec_rec2(in, hu, runp, c, i) +struct in *in; +struct dec_hufftbl *hu; +int *runp; +int c, i; +{ + LEBI_DCL; + + LEBI_GET(in); + if (i) { + UNGETBITS(in, i & 127); + *runp = i >> 8 & 15; + i >>= 16; + } else { + for (i = DECBITS; (c = ((c << 1) | GETBITS(in, 1))) >= (hu->maxcode[i]); i++); + if (i >= 16) { + in->marker = M_BADHUFF; + return 0; + } + i = hu->vals[hu->valptr[i] + c - hu->maxcode[i - 1] * 2]; + *runp = i >> 4; + i &= 15; + } + if (i == 0) { /* sigh, 0xf0 is 11 bit */ + LEBI_PUT(in); + return 0; + } + /* receive part */ + c = GETBITS(in, i); + if (c < (1 << (i - 1))) + c += (-1 << i) + 1; + LEBI_PUT(in); + return c; +} + +#define DEC_REC(in, hu, r, i) ( \ + r = GETBITS(in, DECBITS), \ + i = hu->llvals[r], \ + i & 128 ? \ + ( \ + UNGETBITS(in, i & 127), \ + r = i >> 8 & 15, \ + i >> 16 \ + ) \ + : \ + ( \ + LEBI_PUT(in), \ + i = dec_rec2(in, hu, &r, r, i), \ + LEBI_GET(in), \ + i \ + ) \ +) + +static void decode_mcus(in, dct, n, sc, maxp) +struct in *in; +int *dct; +int n; +struct scan *sc; +int *maxp; +{ + struct dec_hufftbl *hu; + int i, r, t; + LEBI_DCL; + + memset(dct, 0, n * 64 * sizeof(*dct)); + LEBI_GET(in); + while (n-- > 0) { + hu = sc->hudc.dhuff; + *dct++ = (sc->dc += DEC_REC(in, hu, r, t)); + + hu = sc->huac.dhuff; + i = 63; + while (i > 0) { + t = DEC_REC(in, hu, r, t); + if (t == 0 && r == 0) { + dct += i; + break; + } + dct += r; + *dct++ = t; + i -= r + 1; + } + *maxp++ = 64 - i; + if (n == sc->next) + sc++; + } + LEBI_PUT(in); +} + +static void dec_makehuff(hu, hufflen, huffvals) +struct dec_hufftbl *hu; +int *hufflen; +unsigned char *huffvals; +{ + int code, k, i, j, d, x, c, v; + for (i = 0; i < (1 << DECBITS); i++) + hu->llvals[i] = 0; + +/* + * llvals layout: + * + * value v already known, run r, backup u bits: + * vvvvvvvvvvvvvvvv 0000 rrrr 1 uuuuuuu + * value unknown, size b bits, run r, backup u bits: + * 000000000000bbbb 0000 rrrr 0 uuuuuuu + * value and size unknown: + * 0000000000000000 0000 0000 0 0000000 + */ + code = 0; + k = 0; + for (i = 0; i < 16; i++, code <<= 1) { /* sizes */ + hu->valptr[i] = k; + for (j = 0; j < hufflen[i]; j++) { + hu->vals[k] = *huffvals++; + if (i < DECBITS) { + c = code << (DECBITS - 1 - i); + v = hu->vals[k] & 0x0f; /* size */ + for (d = 1 << (DECBITS - 1 - i); --d >= 0;) { + if (v + i < DECBITS) { /* both fit in table */ + x = d >> (DECBITS - 1 - v - + i); + if (v && x < (1 << (v - 1))) + x += (-1 << v) + 1; + x = x << 16 | (hu-> vals[k] & 0xf0) << 4 | + (DECBITS - (i + 1 + v)) | 128; + } else + x = v << 16 | (hu-> vals[k] & 0xf0) << 4 | + (DECBITS - (i + 1)); + hu->llvals[c | d] = x; + } + } + code++; + k++; + } + hu->maxcode[i] = code; + } + hu->maxcode[16] = 0x20000; /* always terminate decode */ +} + +/****************************************************************/ +/************** idct ***************/ +/****************************************************************/ + +#define ONE ((PREC)IFIX(1.)) +#define S2 ((PREC)IFIX(0.382683432)) +#define C2 ((PREC)IFIX(0.923879532)) +#define C4 ((PREC)IFIX(0.707106781)) + +#define S22 ((PREC)IFIX(2 * 0.382683432)) +#define C22 ((PREC)IFIX(2 * 0.923879532)) +#define IC4 ((PREC)IFIX(1 / 0.707106781)) + +#define C3IC1 ((PREC)IFIX(0.847759065)) /* c3/c1 */ +#define C5IC1 ((PREC)IFIX(0.566454497)) /* c5/c1 */ +#define C7IC1 ((PREC)IFIX(0.198912367)) /* c7/c1 */ + +#define XPP(a,b) (t = a + b, b = a - b, a = t) +#define XMP(a,b) (t = a - b, b = a + b, a = t) +#define XPM(a,b) (t = a + b, b = b - a, a = t) + +#define ROT(a,b,s,c) ( t = IMULT(a + b, s), \ + a = IMULT(a, c - s) + t, \ + b = IMULT(b, c + s) - t) + +#define IDCT \ +( \ + XPP(t0, t1), \ + XMP(t2, t3), \ + t2 = IMULT(t2, IC4) - t3, \ + XPP(t0, t3), \ + XPP(t1, t2), \ + XMP(t4, t7), \ + XPP(t5, t6), \ + XMP(t5, t7), \ + t5 = IMULT(t5, IC4), \ + ROT(t4, t6, S22, C22),\ + t6 -= t7, \ + t5 -= t6, \ + t4 -= t5, \ + XPP(t0, t7), \ + XPP(t1, t6), \ + XPP(t2, t5), \ + XPP(t3, t4) \ +) + +static unsigned char zig2[64] = { + 0, 2, 3, 9, 10, 20, 21, 35, + 14, 16, 25, 31, 39, 46, 50, 57, + 5, 7, 12, 18, 23, 33, 37, 48, + 27, 29, 41, 44, 52, 55, 59, 62, + 15, 26, 30, 40, 45, 51, 56, 58, + 1, 4, 8, 11, 19, 22, 34, 36, + 28, 42, 43, 53, 54, 60, 61, 63, + 6, 13, 17, 24, 32, 38, 47, 49 +}; + +void idct(in, out, quant, off, max) +int *in; +int *out; +PREC *quant; +PREC off; +int max; +{ + PREC t0, t1, t2, t3, t4, t5, t6, t7, t; + PREC tmp[64], *tmpp; + int i, j; + unsigned char *zig2p; + + t0 = off; + if (max == 1) { + t0 += in[0] * quant[0]; + for (i = 0; i < 64; i++) + out[i] = ITOINT(t0); + return; + } + zig2p = zig2; + tmpp = tmp; + for (i = 0; i < 8; i++) { + j = *zig2p++; + t0 += in[j] * quant[j]; + j = *zig2p++; + t5 = in[j] * quant[j]; + j = *zig2p++; + t2 = in[j] * quant[j]; + j = *zig2p++; + t7 = in[j] * quant[j]; + j = *zig2p++; + t1 = in[j] * quant[j]; + j = *zig2p++; + t4 = in[j] * quant[j]; + j = *zig2p++; + t3 = in[j] * quant[j]; + j = *zig2p++; + t6 = in[j] * quant[j]; + IDCT; + tmpp[0 * 8] = t0; + tmpp[1 * 8] = t1; + tmpp[2 * 8] = t2; + tmpp[3 * 8] = t3; + tmpp[4 * 8] = t4; + tmpp[5 * 8] = t5; + tmpp[6 * 8] = t6; + tmpp[7 * 8] = t7; + tmpp++; + t0 = 0; + } + for (i = 0; i < 8; i++) { + t0 = tmp[8 * i + 0]; + t1 = tmp[8 * i + 1]; + t2 = tmp[8 * i + 2]; + t3 = tmp[8 * i + 3]; + t4 = tmp[8 * i + 4]; + t5 = tmp[8 * i + 5]; + t6 = tmp[8 * i + 6]; + t7 = tmp[8 * i + 7]; + IDCT; + out[8 * i + 0] = ITOINT(t0); + out[8 * i + 1] = ITOINT(t1); + out[8 * i + 2] = ITOINT(t2); + out[8 * i + 3] = ITOINT(t3); + out[8 * i + 4] = ITOINT(t4); + out[8 * i + 5] = ITOINT(t5); + out[8 * i + 6] = ITOINT(t6); + out[8 * i + 7] = ITOINT(t7); + } +} + +static unsigned char zig[64] = { + 0, 1, 5, 6, 14, 15, 27, 28, + 2, 4, 7, 13, 16, 26, 29, 42, + 3, 8, 12, 17, 25, 30, 41, 4