## MMPM/2 Device Driver Reference

[prev][next][parent][TOC]

### Program Flow

1.The application opens the MPEG Digital Video Device through the media control interface (MCI).

2.The media control device (MCD) finds the PDDname and VSDname in the MMPM2.INI file and opens the VSD with the PDDname.

3.The VSD opens the PDD, reads in an .INI file, and passes the .INI file to the PDD. The filename is based on the first seven characters of the PDDname with the .INI extension. The .INI file is device-dependent. The types of information in the .INI file may include default key color, video alignment offsets, and video quality adjustments.

4.Through the DevInfo IOCTL, the VSD queries the PDD to determine its capabilities.

5.The application loads an MPEG file through the MCI.

a.Through the standard I/O Proc interfaces, the MCD identifies MPGIO as the I/O Proc for the MPEG file.

b.Through the standard compressor/decompressor (CODEC) interfaces, the MPEG I/O Proc (MPEGIO) selects the MPEG hardware decompressor (MPEGDC). The MCD tells the VSD handle to the MPEGDC so that it can call the VSD/PDD to play back the compressed Video MPEG data.

c.Through the VSD and the PDD, the hardware CODEC MPEGDC loads the device with its DSP/MicroCode from a file whose name matches the results of a query of the VSD/PDD.

d.The MCD opens the playback window, queries the VSD/PDD for the transparent/key color, and paints the window with the key color.

e.The MCD tells the VSD/PDD the source movie size and window location.

f.The MCD tells the VSD/PDD to enable the monitor window and color keying.

6.The application issues a play command through the MCI.

7.The MPEG I/O Proc reads part of the MPEG file.

8.The audio data is sent through the system to the audio PDD.

Note: MPEG audio data is passed to the audio device driver via the DDCMD_ READWRITE_PARM structure. Field ulParm1 contains the initial audio system clock reference (SCR), and ulParm2 contains the Presentation Time Stamp ( PTS).

9.The video data is sent through the system to the MPEG CODEC (MPEGDC). If this data is the first packet in the stream, MPEGDC will issue a VCA_ PlayStart IOCtl to the VSD/PDD to set up the device and initialize the stream time. As the data arrives, MPEGDC issues a VCA_PlayData IOCtl to the VSD/PDD.

10.As the audio PDD plays audio buffers, it reports back to the audio stream time, which is eventually sent to MPEGDC.

11.The audio time is passed on the next VCA_PlayData IOCtl to the VSD/PDD.

Note: When playing from the beginning of an MPEG file the audio time will begin at zero regardless of the files initial SCR value.

12.Steps 7 through 11 are repeated until the end of the MPEG data/file is reached-at which time, a VCA_PlayStop is issued indicating that the end of the file has been reached.