Düzenle

Aracılığıyla paylaş


Source Resolver Flags

Defines the behavior of the source resolver. These flags are also used by scheme handlers and byte stream handlers.

Constant/value Description
MF_RESOLUTION_MEDIASOURCE
0x00000001
Attempt to create a media source.
MF_RESOLUTION_BYTESTREAM
0x00000002
Attempt to create a byte stream.
MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE
0x00000010
If source resolution fails using the byte-stream handler that is registered for the MIME type or file name extension, the source resolver enumerates through all of the registered byte-stream handlers.
Byte-stream handlers are registered by file name extension or MIME type. Initially, the source resolver attempts to use a handler that matches the file name extension or the MIME type. If that fails, then by default the entire source resolution fails and the source resolver returns an error code to the application. If this flag is specified, however, the source resolver continues to enumerates through all of the registered byte-stream handlers. Possibly a mis-matched handler can successfully create the media source.
This flag cannot be combined with the MF_RESOLUTION_KEEP_BYTE_STREAM_ALIVE_ON_FAIL flag. See Remarks for more information.
MF_RESOLUTION_KEEP_BYTE_STREAM_ALIVE_ON_FAIL
0x00000020
If the source resolution fails, the source resolver does not close the byte stream. By default, the source resolver closes the byte stream on failure.
If this flag is used and the source resolution fails, the caller should call the method again and set the MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE flag.
This flag cannot be combined with the MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE flag. See Remarks for more information.
MF_RESOLUTION_READ
0x00010000
Requests read access to the source.
MF_RESOLUTION_WRITE
0x00020000
Requests write access to the source.
MF_RESOLUTION_DISABLE_LOCAL_PLUGINS
0x00000040
The source resolver will not use locally registered scheme or bytestream handler plugins.
Requires Windows 8.

Remarks

The application sets these flags when it uses the IMFSourceResolver interface. The source resolver passes the same flags to the IMFByteStreamHandler::BeginCreateObject and IMFSchemeHandler::BeginCreateObject methods.

You must specify one of the MF_RESOLUTION_MEDIASOURCE or MF_RESOLUTION_BYTESTREAM flags. The remaining flags are all optional.

The MF_RESOLUTION_KEEP_BYTE_STREAM_ALIVE_ON_FAIL flag is defined for the following scenario:

  1. The application attempts to open a source over the network. The application sets the MF_RESOLUTION_KEEP_BYTE_STREAM_ALIVE_ON_FAIL flag.

  2. The source's URL contains the wrong file name extension. Because the file name extension is wrong, the default byte-stream handler cannot create the media source. Because the application set the MF_RESOLUTION_KEEP_BYTE_STREAM_ALIVE_ON_FAIL flag, the source resolver caches the byte stream.

  3. The source resolver returns an error code to the application.

  4. The client opens the source again, this time setting the MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE flag. This flag causes the source resolver to try all of the registered handlers instead of just the default handler. Because the byte stream was cached, the source resolver does not have to open the byte stream again.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Header
Mfidl.h

See also

Media Foundation Constants

IMFByteStreamHandler

IMFSchemeHandler

IMFSourceResolver

Source Resolver