![]() |
![]() |
![]() |
![]() |
This chapter describes how to work with track sessions and play audio media on the MME.
For information about support for video on iPod devicess, see “Video support” in the chapter Working with iPods.
This section is explains how to play video files and how to manage video attributes.
The MME supports playback of the following encoded video formats in MP4 files:
Video files in the library table are identified by their ftype set to FTYPEVIDEO (2) or FTYPEAUDIOVIDEO (3). To play a video file, you need to:
For information about:
![]() |
When video playback reaches the end of file, it leaves the last image on the screen. If you want videos to end with a cleared screen, you must have the client application issue the necessary instructions, such as, for example, a call to mme_stop(). |
The MME provides an array of functions for managing videos while they are playing, including:
The MME is designed to support the playing of:
![]() |
DVD and video support is platform-specific. If MME API functions that support DVD mediastores and video playback are called on a system that does not have the required io-media modules, these functions return an error with errorno set to ENOSYS.
Please contact us to discuss your DVD and video implementation requirements. |
When the MME synchronizes a DVD, it creates in the library:
The file IDs (fids) for entire DVDs can be found by examining the library table entries where the ftype column has the value 5 (FTYPE_DEVICE from mme/interface.h).
The example below shows an SQL query to select all DVD entries in the library:
SELECT fid, title FROM library WHERE ftype=5;
The MME supports playing an entire DVD or only a part of the DVD, subject to legal limitations that may either restrict access to some parts of a DVD or impose playback of other parts, such as the copyright notice and warning.
When playing a DVD-video, you can use mme_video_get_info() to get information, such as codec, capture format, and aspect ratio for the video, and mme_video_set_properties() to set the video properties for output.
To play an entire audio or video DVD, simply include the fid for that DVD in your track session. With the entire DVD in the track session, you can call mme_button() to move around on the DVD, play media, and manage behavior. The MME delivers the appropriate events at all transitions during the DVD playback.
To play specific parts of an audio or video DVD (title, chapter, etc.), you can place the fids for the parts of the DVD you want to play in a track session, then play the session. The MME will play only the specified part of the DVD, and deliver the event MME_EVENT_FINISHED when it has finished playing it.
Note that for DVD-videos legal restrictions may prevent playback of some parts of the DVD using this method. Similarly, attempts to use mme_button() to circumvent these restrictions will be rejected.
You can start playback at a title and specific chapter of an audio or video DVD by calling mme_seek_title_chapter() when you would use a command button:
Use mme_get_title_chapter() to get the number of titles and chapters in the current track, and the currently playing title and chapter numbers; use mme_seek_title_chapter() to seek to a specified title and chapter.
You can use these functions only if the MME_PLAYSUPPORT_NAVIGATION flag is set in the support member of the data structure mme_play_info_t. Call mme_play_get_info() to get this structure .
For sample code snippets, see the examples on the reference pages for mme_get_title_chapter() and mme_seek_title_chapter().
To set the default preferred language for a media item, call mme_media_set_def_lang() with the lang argument pointing to a string with the requested language. You can also use mme_media_get_def_lang() to find out the currently set langauge.
See also Configuring Internationalization in the MME Configuration Guide.
The MME API provides functions that facilitate managing access to DVDs, offering client applications the ability to get disk regions.
For information about setting region playback codes (RPC) on ATAPI DVD devices, see dvddrivectl in the MME Utilities Reference.
Region codes are used to set the regions for which a device is enabled, and to check the region of DVD-video discs before they are played. For example, if a user has a device enabled for regions 1 and 3, the HMI can check that a DVD-video disk is from one of these regions before allowing the user to play it.
Region codes are represented in bits 0 to 7, with bit 0 representing region 1, up to bit 7 representing region 8. The API takes a 32-bit region code, but the top 24 bits of the region are not currently used.
The function mme_dvd_get_disc_region() gets the region code of specific DVD-video discs that are inserted into the DVD drive. The bits that are returned from mme_dvd_get_disc_region() represent the regions in which the DVD-video disk may be played. If no bits are set, the DVD-video disk is regionless and can be played in any region.
![]() |
It is the responsibility of the user application to set and track device regions, and to inform the end user through the HMI of conditions where the regions for a DVD-video disk are incompatible with the regions set for the device. |
The DVD player runs on Intel x86 platforms; audio and video decoding are enhanced by Intel chips that support the Intel IPP library.
The DVD player requires the following QNX drivers:
The following binaries are specific to DVD playback:
![]() |
For information about video layers, see the Advanced Graphics Developer's Guide, in particular the chapter Working with Layers, Surfaces, and Contexts, and the “Layers” API. |
You can use the standard MME API to play DVDs with the software DVD player. All you need to do is start srv-dvdplayer in addition to your other MME components:
# srv-dvdplayer -c /etc/system/config/files.dat &
The -c option sets the path to the keys required for playing encrypted DVDs. See “Encrypted DVDs” below.
To get debug information for srv-dvdplayer, use the -D option. For example:
# srv-dvdplayer -DDD &
For more information, see srv-dvdplayer in the MME Utilities reference.
If you want to include starting srv-dvdplayer in a startup script, you should add start up instructions like those below before the io-media startup:
MM_INIT=not_the_default_path/lib/dll/mmedia srv-dvdplayer -c /etc/system/config/files.dat & waitfor /dev/dvdplayer
![]() |
By default, srv-dvdplayer looks in /lib/dll/mmedia for the multimedia filters, but, as with io-media-generic, you can force it to look elsewhere by using the $MM_INIT environment variable (shown above). |
After you have started srv-dvdplayer, you can follow the usual steps for creating a track session and playing the media:
![]() |
When creating the track session, you can identify a DVD in the mediastores table by its storage type, which is set to MME_STORAGETYPE_DVDVIDEO. |
Use the following functions to manage DVD playback and trick play, set video properties and get information:
Use the other standard MME functions to control other behavior and settings, such as volume level.
![]() |
Most commands for DVD playback and navigation are sent using the MME's mme_button() function, which behaves like the buttons on a DVD remote control. For more information about this and the other functions used for DVDs, see the MME API Library Reference. |
DVDs use the configuration settings for CDs. For more information, see the MME Configuration Guide.
For specific information about configuring the MME for video support, see “Configuring the MME for video support” below.
To play encrypted DVDs you must obtain commercial CSS decryption keys from the DVD Copy Control Association. To provide your encrypted keys to the DVD player, use the dvdkeymgr utility.
To play encrypted DVDs:
The utility dvdkeymgr takes the keys in the input file, keys.txt, located at path, and creates a CSS decryption binary file called files.dat. For example, the command line instructions below generates a files.dat file from the keys in the file /usr/keys.txt:
dvdkeymgr /usr/keys.txt
To enable srv-dvdplayer to play encrypted DVDs, after you have generated the files.dat file, you must place it in the same folder as srv-dvdplayer, or use srv-dvdplayer's -c option to point to the file.
For more information, see dvdkeymgr in the MME Utilities reference.
To configure the MME for video support, you must add the URL of a video output device to the MME's outputdevices table, as follows:
INSERT INTO outputdevices(type, permanent, name, devicepath) VALUES(1, 1, 'defaultoutput2', 'gf:deviceentry?param1¶m2');
The deviceentry string and its parameters correspond to the device entry in the /dev/io-display directory. It includes, in this order, separated by commas:
For example, in the deviceentry parameters in the string gf:8086,2772,0?layer=1&sublayer=2 ... identify the following:
If there is only one device, the device index can me omitted, and will default to 0 (zero).
![]() |
|
The URL to the video output device may contain optional modifiers after the question mark (“?”), each modifier separated by an ampersand (“&”), to set default values and behaviors on the device. Supported modifiers are listed below:
To specify the destination rectangle use:
To specify the aspect ratio of the pixels on the physical display use:
To set the color control on the output use:
After playback has started, you can use the mme_video_set_properties() function to adjust playback parameters.
When configuring video output for the software DVD player, you must specify the layer and sublayer modifiers in the output URL string. For example, the modifiers in the string gf:8086,2772,0?layer=1&sublayer=2 ... are interpreted as follows:
![]() |
The ARGB layer used for subtitles does not support scaling. To keep the video and subtitle layers correclty aligned on screen, both are centered and not scaled. |
The example below shows how to define in the mme database schema, an audio output device and a video output device.
INSERT INTO outputdevices(type, permanent, name, devicepath) VALUES(1, 1, 'rearoutputaudio', 'snd:/dev/snd/pcmC0D3p'); INSERT INTO outputdevices(type, permanent, name, devicepath) VALUES(2, 1, 'rearoutputvideo', 'gf:8086,2772,0?aspn=72&aspd=77&bright=-20&sat=-10');
![]() |
![]() |
![]() |
![]() |