                              Wine Documentation                               
Prev                    Chapter 13. Wine and Multimedia                    Next
-------------------------------------------------------------------------------

13.4. High level layers

The rest (basically the MMSYSTEM and WINMM DLLs entry points). It also provides
the skeleton for the core functionality for multimedia rendering. Note that
native MMSYSTEM and WINMM do not currently work under WINE and there is no plan
to support them (it would require to also fully support VxD, which is not done
yet). Moreover, native DLLs require 16 bit MCI and low level drivers. Wine
implements them as 32 bit drivers. MCI and low level drivers can either be 16
or 32 bit for Wine.

TODO:

  * it seems that some program check what's installed in registry against value
    returned by drivers. Wine is currently broken regarding this point.
   
  * add clean-up mechanisms when process detaches from MM DLLs
   
  * prepare for the 16/32 big split
   
  * check thread-safeness for MMSYSTEM and WINMM entry points
   
  * unicode entry points are badly supported
   
13.4.1. MCI skeleton

Implementation of what is needed to load/unload MCI drivers, and to pass
correct information to them. This is implemented in dlls/winmm/mci.c. The
mciSendString function uses command strings, which are translated into normal
MCI commands as used by mciSendCommand with the help of command tables. The API
can be found in dlls/winmm/mmsystem.c and dlls/winmm/mci.c. The functions there
(mciOpen,mciSysInfo) handle mid level driver allocation and calls. The
implementation is not complete.

MCI drivers are seen as regular WINE modules, and can be loaded (with a correct
load order between built-in, native, elfdll, so), as any other DLL. Please
note, that MCI drivers module names must bear the .drv extension to be
correctly understood.

The list of available MCI drivers is obtained as follows: 1. key 'mci' in
[option] section from .winerc (or wineconf) mci=CDAUDIO:SEQUENCER gives the
list of MCI drivers (names, in uppercase only) to be used in WINE. 2. This
list, when defined, supersedes the mci key in c:\windows\system.ini

Note that native VIDEODISC crashes when the module is loaded, which occurs when
the MCI procedures are initialised. Make sure that this is not in the list from
above. Try adding: mci=CDAUDIO:SEQUENCER:WAVEAUDIO:AVIVIDEO:MPEGVIDEO to the
[options] section of wine.conf.

TODO:

  * correctly handle the MCI_ALL_DEVICE_ID in functions.
   
  * finish mapping 16 <=> 32 of MCI structures and commands
   
  * MCI_SOUND is not handled correctly (should not be sent to MCI driver =>
    same behavior as MCI_BREAK)
   
  * implement auto-open feature (ie, when a string command is issued for a not
    yet opened device, MCI automatically opens it)
   
13.4.2. MCI multi-tasking

Multi-tasking capabilities used for the MCI drivers are provided in dlls/winmm/
mmsystem.c.

TODO:

  * mmTaskXXX functions are currently broken because the 16 loader does not
    support binary command lines => provide Wine's own mmtask.tsk not using
    binary command line.
   
  * the Wine native MCI drivers should use the mmThreadXXX API (but since all
    built-in MCI drivers are 32 bit, this would require a special flag to mark
    32 bit entry points)
   
13.4.3. Timers

It currently uses a service thread, run in the context of the calling process,
which should correctly mimic Windows behavior.

TODO:

  * Check if minimal time is satisfactory for most programs.
   
  * current implementation may let a timer tick (once) after it has been
    destroyed
   
13.4.4. MMIO

The API consists of the mmio* functions found in mdlls/winmm/mmio.c. Seems to
work ok in most of the cases. There's some linear/segmented issues with 16 bit
code. There are also some bugs when writting MMIO files.

13.4.5. sndPlayXXX functions

Seem to work correctly.

-------------------------------------------------------------------------------
Prev                                 Home                                  Next
Mid level drivers (MCI)               Up               Multimedia configuration
