Architectural Overview of DVDSample (Windows CE 5.0)

Send Feedback

DVDSample is designed around three major object classes, CDvdCore, CAppState, and CApp. The object, instantiated from CDvdCore, is used to monitor and control the interaction with the DVD drive and DVD-Video data.

Of the three main classes, CDvdCore is the only one that actually makes calls to the DVD-Video API. Objects instantiated from the other two classes are uses to control the appearance and behavior of the application's user interface.

The object instantiated from the CApp class represents the entire application. It manages the main application window and its message handler. The CApp object instantiates a CAppState object to manage the state and appearance of the DVDSample user interface.

The following diagram shows relationships between the object classes in DVDSample. As described in Examining the DVDSample Sample Application the classes CApp, CAppState, CDvdCore, CDVDLanguages, CParentLevels, CDvdVideo, CDevMon, and CDVDSampleEventSink belong to the DVDSample application. They are not part of the DVD-Video API.

Aa451183.dxdvd-dvdsample_arch(en-us,MSDN.10).gif

In the preceding diagram it is important to note that the CApp object and the CDvdCore object both have WndProc functions, indicating that each object manages its own message queue.

This is a critical aspect of the DVDSample architecture because it decouples the processing load for the user interface from the time-critical messages posted by the DVD renderer. The CDevMon object creates and manages its own thread and posts messages to CDvdCore:WndProc.

The DVD-Video API constantly issues callback messages through the IDVDNavDataStatusSink and IDVDNavigatorSink interfaces as the middleware reads data from the drive and sends it to the renderer through DMA transfers.

In DVDSample, a CDVDSampleEventSink object receives all of these messages and reacts to them by either taking some immediate trivial action or by posting appropriate messages to the CDvdCore message handler.

The message handler for CDvdCore behaves similarly. It takes simple immediate action when it can or it calls an IDVDCallback method in CAppState for tasks affect DVDSample's user interface.

As soon as a window message is sent to the window controlled by the CDvdCore object and the callback function returns, DVDSample is no longer processing the event data that came from the DVD-Video API in the same thread as the DVD-Video API itself.

This frees the DVD-Video API to continue playback while DVDSample updates the user interface.

Because the CDvdSampleEventSink object processes the callbacks quickly, the next event is always synchronized with the current playback state.

For more information about handling DVD-Video API callbacks, see Callbacks.

See Also

Examining the DVDSample Sample Application

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.