Playback Options

LEADTOOLS provides a variety of methods for handling DVD video playback. This topic describes the various options available to programmers for resuming and stopping playback; as well as more specialized methods such as forward/reverse playback, title /chapter specific playback, and time based playback.

Resuming and Stopping Playback

There are several functions that apply to resuming or stopping DVD video playback. Depending on the situation, the programmer can call either IltmmDVDControl::Pause, IltmmDVDControl::Resume, IltmmDVDControl::StillOff, or IltmmDVDControl::Stop.

IltmmDVDControl::Pause is unique among these functions in that it is the only one that can both pause and resume playback, depending on the boolean value the programmer passes into it. Calling IltmmDVDControl::Pause with the State parameter set to FALSE resumes the playback from the current location. Conversely, calling IltmmDVDControl::Pause with the State parameter set to TRUE pauses the playback. Note that this function does support command synchronization.

When resuming playback from a menu, the programmer should call IltmmDVDControl::Resume. Calling the Resume function exits the current menu and resumes playback at the point the user left off. This function resolves properly only when called in a menu the user accessed while in playback. Note that this function does not support command synchronization.

IltmmDVDControl::StillOff relates specifically to still images. If the DVD Navigator receives a still image, it will automatically pause the playback and go into still-store mode. To resume playback, the programmer must call IltmmDVDControl::StillOff, which immediately cancels still mode and resumes playback from the current location. This function does nothing if called while the DVD Navigator is not in still-store mode. Note that this function does support command synchronization.

To halt DVD playback altogether, the programmer should call IltmmDVDControl::Stop. Doing so immediately stops the playback of any title or menu by moving the DVD Navigator into the DVD Stop domain. Note that this function does support command synchronization.

Forward and Reverse Playback

The LEAD Multimedia API includes functions that control both the playback speed and direction. Calling IltmmDVDControl::PlayForwards plays the DVD video forward at the speed the programmer passes into the function. Conversely, calling IltmmDVDControl::PlayBackwards reverses the playback direction, playing the DVD video backwards at the speed passed into the function. In both functions, the Speed parameter is a multiplier value. For example, passing in a value of 2.0 will play the DVD video back at twice normal speed, while passing in a value of 0.5 will play the DVD back at one half normal speed. These functions are useful in implementing a fast-forward or rewind feature in a DVD application. Note that neither IltmmDVDControl::PlayForwards nor IltmmDVDControl::PlayBackwards support command synchronization.

Title /Chapter specific Playback

Programmers have multiple options for developing specialized title and chapter specific playback solutions. The LEAD Multimedia API provides several functions that pertain to DVD video playback within set chapters. The most basic of these is IltmmDVDControl::PlayChapter, which the programmer calls to play a specific chapter within the current title. The programmer calls IltmmDVDControl::ReplayChapterto restart the playback from the beginning of the current chapter. Calling IltmmDVDControl::PlayNextChapter starts the playback from the beginning of the next chapter within the current title. Likewise, calling IltmmDVDControl::PlayPrevChapter starts the playback from the beginning of the previous chapter within the current title.

In addition to the functions above, the LEAD Multimedia API provides functions that control DVD video playback based upon titles. As above, the most basic of these is IltmmDVDControl::PlayTitle, which the programmer calls to start playback from the beginning of a specific title. Calling IltmmDVDControl::PlayChapterInTitle allows the programmer to specify both the title and the chapter within the title to begin playback from, effectively merging the functionality of IltmmDVDControl::PlayChapter and IltmmDVDControl::PlayTItle into a single function.

Finally, the programmer can play a specified number of chapters, beginning at a specified chapter within a specified title by calling IltmmDVDControl::PlayChaptersAutoStop. Once the specified number of chapters have been played, the DVD Navigator halts playback by sending an Auto Stop notification to the application. Note that this function will only work with One_Sequential_PGC_Titles.

None of the above functions support command synchronization.

Time based Playback

The LEAD Multimedia API also includes functions related to time-based DVD video playback. Calling IltmmDVDControl::PlayAtTime allows the programmer to start the playback of the current title at the specified time. Similarly, the programmer can call IltmmDVDControl::PlayAtTimeInTitle to begin the video playback at the specified time within the specified title.

To playback a specific length of video within a specific title, the programmer should call IltmmDVDControl::PlayPeriodInTitleAutoStop. Calling this function allows the programmer to begin the video playback of a specified title at a specified start time and run it until a specified end time is reached. Note that the specified start time must precede the specified end time. Otherwise, the function will fail and return an error.

None of the above functions support command synchronization.

DVD Source Playback

The DVD Source object can be used as an alternative to the default DVD Navigator object when playing DVDs. This allows the DVD playback to function like normal file playback. For example, only selected titles/chapters are played without menus from beginning to end. This is referred to as the DVD playlist. The entire DVD playlist can be viewed, for all practical purposes, as a single multimedia file. Once a playlist is defined it has a fixed duration and all file positions are within this playlist.

To use the DVD Source object, instruct the convert or play module to use it by calling the IltmmConvert::put_UseDVDSource or IltmmPlay::put_UseDVDSource functions with the value VARIANT_TRUE. The next time a DVD image is selected for playback, the DVD Source object will be used.

The default playlist is usually the main movie contained on the DVD. However, this might not be the case for some specialized DVDs. In order to program a custom playlist, it is necessary to obtain an IltmmDVDSource interface pointer into the DVD Source object. To do this, call IltmmConvert::GetSubObject or IltmmPlay::GetSubObject with the ltmmConvert_Object_SourceFilter or ltmmPlay_Object_SourceFilter object type parameters. Then it is possible to query the return value for the IltmmDVDSource interface.

The first thing to do is enumerate through the available titles. Obtain the number of titles by calling IltmmDVDSource::get_TitleCount. Then retrieve information about any title by retrieving the IltmmDVDTitle interface pointer from IltmmDVDSource::GetTitle.

Next, enumerate through the chapters contained with the title. Obtain the number of chapters by calling IltmmDVDTitle::get_ChapterCount. Then retrieve information about any title by retrieving the IltmmDVDChapter interface pointer from IltmmDVDTitle::GetChapter.

To determine whether a chapter is part of the current playlist call IltmmDVDChapter::get_Selected. Make the chapter part of the playlist by calling IltmmDVDChapter::put_Selected.

By default, no subpicture streams are enabled in the playlist. Enumerate and enable subpicture streams through IltmmDVDTitle::get_SubpictureStreamCount and IltmmDVDTitle::GetSubpictureStream. Similarly, select an alternative audio stream through IltmmDVDTitle::get_AudioStreamCount and IltmmDVDTitle::GetAudioStream.

Once the playlist is set up, it can be played and converted just like any other multimedia file. The DVD Source object has the ability to import/export its playlists through the IltmmDVDSource::put_PlayList and IltmmDVDSource::get_PlayList functions. This is useful for copying files between objects.

See Also

DVD Source for C++

DVD Source for C

Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Multimedia C API Help