Compartilhar via


Using the Media Locator

 
Microsoft DirectShow 9.0

Using the Media Locator

The media locator is a helper object that verifies file names and searches for missing files on local or network directories. The media detector keeps a cache of directory paths where it has successfully found files in past searches. To locate a file, it searches the directories in its cache. Failing that, the media detector can display an Open File dialog for the user to locate a file manually. Assuming the user locates the file, the media locator adds the new directory to its cache. The media locator exposes the IMediaLocator interface.

Typically, your application does not directly create an instance of the media locator. Instead, the timeline and the render engine provide the following methods for validating file names using the media detector.

Both methods take flags that control the behavior of the media locator. For example, you can restrict the search to local directories.