Callbacks (Windows Embedded CE 6.0)
1/6/2010
The DVD-Video API contains two callback interfaces, IDVDNavDataStatusSink and IDVDNavigatorSink, which allow your application to react to events from the DVD-Video source data.
As the DVD-Video API reads from the DVD-Video volume, it watches for new programs, system parameter (SPRM) changes, read errors, and other changes or transitions in the data.
When one of these transitions occurs, the DVD-Video API will issue a callback to the appropriate IDVDNavDataStatusSink or IDVDNavigatorSink method. Your implementation of these methods will determine how your application responds to one of these events.
The DVD-Video API invokes callbacks at the exact moment in time when an event happens during playback. Because of this, you should design your callback functions so that they execute as quickly as possible.
Ideally, they should read parameter information passed in from the DVD-Video API and then pass it on to a function that executes in a different thread. The DVD-Video API callback functions will execute in the same thread as the other functions in the DVD-Video API, so execution delays in the callback function execution can hold up the entire API.
The more processing your application does in the callback function itself, the greater the risk that the navigation manger will not be able to provide data to the renderer quickly. This will prevent the renderer from provide a smooth and seamless presentation of the DVD-Video content.
By implementing small and quick callback functions, your application can rely on timely and dependable notifications from the DVD-Video API.
One scenario in which you may want to implement a callback that does some more involved processing is when you specifically want to interrupt playback while your application handles an event.
For example, in an IDVDNavigatorSink::OnDiskReadError callback you may want your application to interrupt playback to check the playback state and conditionally terminate playback or jump to another portion of the title.