Media PLayer Functions Author: Andreas Vogel (andvogel@online.de) Version: 2007/03/14 Basics: Adding some media player functions to VOMP. This should enable VOMP to: - work as a picture viewer (for digicam pictures) - play audio (at least mp3) - play (mpeg) video For me the priorities are like above, i.e. Prio 1 for the (jpeg) pictures, afterwards audio, later video. It requires some extensions on the server side (of course). First Version (delivered 2007/03/14): Basic picture viewer functions You can add a list of directories to vomp.conf that will be used as base dirs to find media files. Example: [Media] Dir.1=/home/Andreas/pictest Dir.2=/home/video Dir.3=/home/bilder Dir.4=/media You can have up to 10 directories there. The recognition of media types is based on extensions today. In the moment it recognizes: JPEG,jpeg,JPG,jpg as Jpeg mp3,MP3 as mp3 (not played yet) In the vom main menu a new item is added (5 MediaPlayer). This will open a menu with the configured base dirs (/ if none configured). SELECTOR WINDOW You can traverse through the dirs with the normal keys. When pointing to a media file (currently only jpeg) you can activate the viewer with [OK] (normal view) or [PLAY] (slide show). PICTURE VIEWER When viewing a picture, this gets loaded from the server (currently still a little bit slow), scaled (jpeg libs allows for 1/2, 1/4 and 1/8 only - but seems to be OK for many photos), and displayed. With [OK] you can toggle the status line, With [RED] you can rotate the picture clockwise, [GREEN] brings up an info box with some picture data. [PLAY] starts the slideshow, |<- and ->| as well as [UP], [DOWN] travers trough all pictures within the directory. << and >> will slower/fasten the slide show (time getting displayed in the status line). II will pause the slide show [STOP] will pause and reset time to 5s. Version 2007/03/23 Added playing audio files. In the moment playing is (on the server side) limited to mp3 (MP3) files. The client side is prepared to play all MPEG1 files - although only tested for MP3 CBR/VBR stereo, 44,1kBit. Player control is similar to the other available players (recordings). You can use 0...9 to position by x0 percent in the file. |<- and ->| will skip each 10s back/ forward. In principle >> does also work - but seems not to be very usefull in the moment. [UP] and [DOWN] will move backward/forward in a play list. You can start playing all MP3's in a dir from the media view by pressing [PLAY], a single file by pressing OK. The player window will disappear app. 30s after the last key press. The players parses ID3V1,V2.2,V2.3 (thanks to Walt for the supported code) and displays selected info. It also parses VBR headers ("Xing") and uses this info for display and movements. If the player cannot parse the files, it tries to play them anyway, it will (for the display) assume 128kBit/s CBR. Currently the player uses the same media stream like the picture viewer -so no parallel viewing and listening is possible (will be changed soon). The media view has some minor changes: Added the option to sort also randomly (e.g. for playing audio files). Directories are marked with [ ] in the display, they are always displayed on top. Additionally some bug fixes (thanks to muellerph and Walt for reporting them) for error handling. Development Issues 1. Major Changes 1.1 Surface To be able to handle deeply nested directories, the number of views has been extended to 120. This made dynamic surface handling necessary. Therefore I changed the surface member. Box has a virtual getSurface method, that gets implemented by Widget and View. The View really has a surface member, Widgets have a parent (Box) member and query this for the surface. At the View there is a new unmap() method, that releases the surface. The next getSurface will acquire a new one and will redraw the view (calling it's draw method). This has to be used with care... 1.2. Jpeg The WJpeg has been extended to be able to load arbitrary jpeg data via a reader class. It will scale the jpeg if possible to fit onto the screen and will rotate it on demand. 1.3. VDR and server VDR has new commands to get a media list, to initialize picture data transfer and to transfer picture blocks (used a new command there for possible parallel action with audio later on...). On the server side the media list reading has been added and a simple file reader to retrieve the Jpeg data. 1.4. extensions New classes for Media, MediaList, VMediaList, VPicture, VPicturebanner, VPictureinfo. 2007/03/23 New classes for audioplayer, demuxeraudio, vaudioplayer 2. Problems 2.1. setting up devenv needed some changes... 2.2. -Wno-format was necessary to allow for %g for the date display 2.3. merging with today's CVS: I encountered big problems with the new timer handling. Dangerous situations: - timer retrieved from list, waiting to fire but destination gone (canceled timer), nextTimer will not be NULL there... - so need a add. check - cancel called within the timer firing - deadlock today, could delete timer from list.. OK -I added the patch. 2007/03/23 3. Open/Next Steps For me the next important steps would be: Audio Playing - basicly done 2007/03/23 Performance Improvements 1. have the transfer being handled in a separate thread (would save 50% on large files) 2. make a scaling (+pot. decoding) on the server side, could lower the sizes and fit better to the screen (but needs some jpeg stuff on the server - I will try to grep from mediamvp - worked on this already...). Picture Functions 1. Colour handling - we would need some colour profile for appropriate picture viewing... 4. sorting - multiple sort options for media lists.. done 2007/03/23 Translations English and German are there...