SharpDX.MediaFoundation The assembly provides managed MediaFoundation API. MediaFoundation MediaFoundation A default implementation of AsyncCallbackBase.

Callback interface to notify the application when an asynchronous method completes.

For more information about asynchronous methods in Microsoft Media Foundation, see Asynchronous Callback Methods.

This interface is also used to perform a work item in a Media Foundation work-queue. For more information, see Work Queues.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms699856 IMFAsyncCallback IMFAsyncCallback

Applies to: desktop apps | Metro style apps

Called when an asynchronous operation is completed.

Pointer to the interface. Pass this reference to the asynchronous End... method to complete the asynchronous call.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Within your implementation of Invoke, call the corresponding End... method.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970360 HRESULT IMFAsyncCallback::Invoke([In, Optional] IMFAsyncResult* pAsyncResult) IMFAsyncCallback::Invoke
Gets a flag indicating the behavior of the callback object's method. Default behavior should be . The a flag indicating the behavior of the callback object's method. bb970381 HRESULT IMFAsyncCallback::GetParameters([Out] MFASYNC_CALLBACK_FLAGS* pdwFlags,[Out] unsigned int* pdwQueue) IMFAsyncCallback::GetParameters Gets the identifier of the work queue on which the callback is dispatched. See remarks. The work queue identifier.

This value can specify one of the standard Media Foundation work queues, or a work queue created by the application. For list of standard Media Foundation work queues, see Work Queue Identifiers. To create a new work queue, call . The default value is .

If the work queue is not compatible with the value returned in pdwFlags, the Media Foundation platform returns when it tries to dispatch the callback. (See .)

bb970381 HRESULT IMFAsyncCallback::GetParameters([Out] MFASYNC_CALLBACK_FLAGS* pdwFlags,[Out] unsigned int* pdwQueue) IMFAsyncCallback::GetParameters
Decoder from compressed audio (mp3, wma...etc.) to PCM. This class was developed following the "Tutorial: Decoding Audio" Initializes a new instance of the class. Initializes a new instance of the class. The stream to read the compressed audio. Gets or sets the source stream. See remarks. The source. The source must be set before calling Gets the decoded PCM samples. See remarks. An enumerator of pointer to PCM decoded data with the same format as returned by . This method is only working as a single enumerator at a time. The must be set before calling Gets the decoded PCM samples. See remarks. The starting position in seconds. An enumerator of pointer to PCM decoded data with the same format as returned by . This method is only working as a single enumerator at a time. The must be set before calling Gets the total duration in seconds. The duration. Gets the PCM wave format output by this decoder. The wave format. ByteStream class used

Represents a byte stream from some data source, which might be a local file, a network file, or some other source. The interface supports the typical stream operations, such as reading, writing, and seeking.

The following functions return references for local files:

A byte stream for a media souce can be opened with read access. A byte stream for an archive media sink should be opened with both read and write access. (Read access may be required, because the archive sink might need to read portions of the file as it writes.)

Some implementations of this interface also expose one or more of the following interfaces:

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698720 IMFByteStream IMFByteStream

Represents a byte stream from some data source, which might be a local file, a network file, or some other source. The interface supports the typical stream operations, such as reading, writing, and seeking.

The following functions return references for local files:

A byte stream for a media souce can be opened with read access. A byte stream for an archive media sink should be opened with both read and write access. (Read access may be required, because the archive sink might need to read portions of the file as it writes.)

Some implementations of this interface also expose one or more of the following interfaces:

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698720 IMFByteStream IMFByteStream

Applies to: desktop apps | Metro style apps

Reads data from the stream.

Pointer to a buffer that receives the data. The caller must allocate the buffer.

Offset to begin reading from

Size of the buffer in bytes.

The number of bytes that are copied into the buffer

This method reads at most cb bytes from the current position in the stream and copies them into the buffer provided by the caller. The number of bytes that were read is returned in the pcbRead parameter. The method does not return an error code on reaching the end of the file, so the application should check the value in pcbRead after the method returns.

This method is synchronous. It blocks until the read operation completes.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698913 HRESULT IMFByteStream::Read([Out, Buffer] unsigned char* pb,[In] unsigned int cb,[Out] unsigned int* pcbRead) IMFByteStream::Read

Applies to: desktop apps | Metro style apps

Begins an asynchronous read operation from the stream.

Pointer to a buffer that receives the data. The caller must allocate the buffer.

Offset within the buffer to begin reading at.

Size of the buffer in bytes.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

If this method succeeds, it returns . Otherwise, it returns an error code.

When all of the data has been read into the buffer, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

Do not read from, write to, free, or reallocate the buffer while an asynchronous read is pending.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704810 HRESULT IMFByteStream::BeginRead([Out, Buffer] unsigned char* pb,[In] unsigned int cb,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFByteStream::BeginRead

Applies to: desktop apps | Metro style apps

Completes an asynchronous read operation.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The number of bytes that were read

Call this method after the method completes asynchronously.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704042 HRESULT IMFByteStream::EndRead([In] IMFAsyncResult* pResult,[Out] unsigned int* pcbRead) IMFByteStream::EndRead

Applies to: desktop apps | Metro style apps

Writes data to the stream.

Pointer to a buffer that contains the data to write.

The offset within the buffer to begin writing to.

Size of the buffer in bytes.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method writes the contents of the pb buffer to the stream, starting at the current stream position. The number of bytes that were written is returned in the pcbWritten parameter.

This method is synchronous. It blocks until the write operation completes.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703843 HRESULT IMFByteStream::Write([In, Buffer] const unsigned char* pb,[In] unsigned int cb,[Out] unsigned int* pcbWritten) IMFByteStream::Write

Applies to: desktop apps | Metro style apps

Begins an asynchronous write operation to the stream.

Pointer to a buffer containing the data to write.

The offset within the buffer to begin writing at.

Size of the buffer in bytes.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

If this method succeeds, it returns . Otherwise, it returns an error code.

When all of the data has been written to the stream, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

Do not reallocate, free, or write to the buffer while an asynchronous write is still pending.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms694005 HRESULT IMFByteStream::BeginWrite([In, Buffer] const unsigned char* pb,[In] unsigned int cb,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFByteStream::BeginWrite

Applies to: desktop apps | Metro style apps

Completes an asynchronous write operation.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The number of bytes that were written

Call this method when the method completes asynchronously.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703863 HRESULT IMFByteStream::EndWrite([In] IMFAsyncResult* pResult,[Out] unsigned int* pcbWritten) IMFByteStream::EndWrite

Applies to: desktop apps | Metro style apps

Moves the current position in the stream by a specified offset.

Specifies the origin of the seek as a member of the enumeration. The offset is calculated relative to this position.

Specifies the new position, as a byte offset from the seek origin.

Specifies zero or more flags. The following flags are defined.

ValueMeaning
MFBYTESTREAM_SEEK_FLAG_CANCEL_PENDING_IO

All pending I/O requests are canceled after the seek request completes successfully.

?

The new position after the seek

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697053 HRESULT IMFByteStream::Seek([In] MFBYTESTREAM_SEEK_ORIGIN SeekOrigin,[In] longlong llSeekOffset,[In] unsigned int dwSeekFlags,[Out] unsigned longlong* pqwCurrentPosition) IMFByteStream::Seek

Applies to: desktop apps | Metro style apps

Clears any internal buffers used by the stream. If you are writing to the stream, the buffered data is written to the underlying file or device.

If this method succeeds, it returns . Otherwise, it returns an error code.

If the byte stream is read-only, this method has no effect.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms694833 HRESULT IMFByteStream::Flush() IMFByteStream::Flush

Applies to: desktop apps | Metro style apps

Closes the stream and releases any resources associated with the stream, such as sockets or file handles. This method also cancels any pending asynchronous I/O requests.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703909 HRESULT IMFByteStream::Close() IMFByteStream::Close

Applies to: desktop apps | Metro style apps

Retrieves the characteristics of the byte stream.

The capabilities of the stream.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698962 HRESULT IMFByteStream::GetCapabilities([Out] unsigned int* pdwCapabilities) IMFByteStream::GetCapabilities

Applies to: desktop apps | Metro style apps

Retrieves the length of the stream.

The length of the stream, in bytes. If the length is unknown, this value is -1.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698941 HRESULT IMFByteStream::GetLength([Out] unsigned longlong* pqwLength) IMFByteStream::GetLength

Applies to: desktop apps | Metro style apps

Retrieves the current read or write position in the stream.

The current position, in bytes.

The methods that update the current position are Read, BeginRead, Write, BeginWrite, SetCurrentPosition, and Seek.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704059 HRESULT IMFByteStream::GetCurrentPosition([Out] unsigned longlong* pqwPosition) IMFByteStream::GetCurrentPosition

Applies to: desktop apps | Metro style apps

Queries whether the current position has reached the end of the stream.

true if the end of the stream has been reached

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697369 HRESULT IMFByteStream::IsEndOfStream([Out] BOOL* pfEndOfStream) IMFByteStream::IsEndOfStream
Instantiates a new instance from a . hh162754 HRESULT MFCreateMFByteStreamOnStreamEx([In] IUnknown* punkStream,[Out] IMFByteStream** ppByteStream) MFCreateMFByteStreamOnStreamEx Instantiates a new instance from a . hh162754 HRESULT MFCreateMFByteStreamOnStreamEx([In] IUnknown* punkStream,[Out] IMFByteStream** ppByteStream) MFCreateMFByteStreamOnStreamEx Instantiates a new instance from a . hh162754 HRESULT MFCreateMFByteStreamOnStreamEx([In] IUnknown* punkStream,[Out] IMFByteStream** ppByteStream) MFCreateMFByteStreamOnStreamEx

Applies to: desktop apps | Metro style apps

Reads data from the stream.

Pointer to a buffer that receives the data. The caller must allocate the buffer.

Offset into the buffer.

Size of the buffer in bytes.

The number of bytes that are copied into the buffer

This method reads at most cb bytes from the current position in the stream and copies them into the buffer provided by the caller. The number of bytes that were read is returned in the pcbRead parameter. The method does not return an error code on reaching the end of the file, so the application should check the value in pcbRead after the method returns.

This method is synchronous. It blocks until the read operation completes.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698913 HRESULT IMFByteStream::Read([Out, Buffer] unsigned char* pb,[In] unsigned int cb,[Out] unsigned int* pcbRead) IMFByteStream::Read

Applies to: desktop apps | Metro style apps

Begins an asynchronous read operation from the stream.

Pointer to a buffer that receives the data. The caller must allocate the buffer.

The offset in the buffer to begin reading from.

Size of the buffer in bytes.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

If this method succeeds, it returns . Otherwise, it returns an error code.

When all of the data has been read into the buffer, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

Do not read from, write to, free, or reallocate the buffer while an asynchronous read is pending.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704810 HRESULT IMFByteStream::BeginRead([Out, Buffer] unsigned char* pb,[In] unsigned int cb,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFByteStream::BeginRead

Applies to: desktop apps | Metro style apps

Completes an asynchronous read operation.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The number of bytes that were read

Call this method after the method completes asynchronously.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704042 HRESULT IMFByteStream::EndRead([In] IMFAsyncResult* pResult,[Out] unsigned int* pcbRead) IMFByteStream::EndRead

Applies to: desktop apps | Metro style apps

Writes data to the stream.

Pointer to a buffer that contains the data to write.

The offset within the buffer to begin writing at.

Size of the buffer in bytes.

The number of bytes that are written.

This method writes the contents of the pb buffer to the stream, starting at the current stream position. The number of bytes that were written is returned in the pcbWritten parameter.

This method is synchronous. It blocks until the write operation completes.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703843 HRESULT IMFByteStream::Write([In, Buffer] const unsigned char* pb,[In] unsigned int cb,[Out] unsigned int* pcbWritten) IMFByteStream::Write

Applies to: desktop apps | Metro style apps

Begins an asynchronous write operation to the stream.

Pointer to a buffer containing the data to write.

The offset within the buffer to begin writing at.

Size of the buffer in bytes.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

If this method succeeds, it returns . Otherwise, it returns an error code.

When all of the data has been written to the stream, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

Do not reallocate, free, or write to the buffer while an asynchronous write is still pending.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms694005 HRESULT IMFByteStream::BeginWrite([In, Buffer] const unsigned char* pb,[In] unsigned int cb,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFByteStream::BeginWrite

Applies to: desktop apps | Metro style apps

Completes an asynchronous write operation.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The number of bytes that were written

Call this method when the method completes asynchronously.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703863 HRESULT IMFByteStream::EndWrite([In] IMFAsyncResult* pResult,[Out] unsigned int* pcbWritten) IMFByteStream::EndWrite

Applies to: desktop apps | Metro style apps

Moves the current position in the stream by a specified offset.

Specifies the origin of the seek as a member of the enumeration. The offset is calculated relative to this position.

Specifies the new position, as a byte offset from the seek origin.

Specifies zero or more flags. The following flags are defined.

ValueMeaning
MFBYTESTREAM_SEEK_FLAG_CANCEL_PENDING_IO

All pending I/O requests are canceled after the seek request completes successfully.

?

The new position after the seek

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697053 HRESULT IMFByteStream::Seek([In] MFBYTESTREAM_SEEK_ORIGIN SeekOrigin,[In] longlong llSeekOffset,[In] unsigned int dwSeekFlags,[Out] unsigned longlong* pqwCurrentPosition) IMFByteStream::Seek

Applies to: desktop apps | Metro style apps

Clears any internal buffers used by the stream. If you are writing to the stream, the buffered data is written to the underlying file or device.

If this method succeeds, it returns . Otherwise, it returns an error code.

If the byte stream is read-only, this method has no effect.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms694833 HRESULT IMFByteStream::Flush() IMFByteStream::Flush

Applies to: desktop apps | Metro style apps

Closes the stream and releases any resources associated with the stream, such as sockets or file handles. This method also cancels any pending asynchronous I/O requests.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703909 HRESULT IMFByteStream::Close() IMFByteStream::Close
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the characteristics of the byte stream.

Receives a bitwise OR of zero or more flags. The following flags are defined.

ValueMeaning
MFBYTESTREAM_IS_READABLE
0x00000001

The byte stream can be read.

MFBYTESTREAM_IS_WRITABLE
0x00000002

The byte stream can be written to.

MFBYTESTREAM_IS_SEEKABLE
0x00000004

The byte stream can be seeked.

MFBYTESTREAM_IS_REMOTE
0x00000008

The byte stream is from a remote source, such as a network.

MFBYTESTREAM_IS_DIRECTORY
0x00000080

The byte stream represents a file directory.

MFBYTESTREAM_HAS_SLOW_SEEK
0x00000100

Seeking within this stream might be slow. For example, the byte stream might download from a network.

MFBYTESTREAM_IS_PARTIALLY_DOWNLOADED
0x00000200

The byte stream is currently downloading data to a local cache. Read operations on the byte stream might take longer until the data is completely downloaded.

This flag is cleared after all of the data has been downloaded.

If the MFBYTESTREAM_HAS_SLOW_SEEK flag is also set, it means the byte stream must download the entire file sequentially. Otherwise, the byte stream can respond to seek requests by restarting the download from a new point in the stream.

MFBYTESTREAM_SHARE_WRITE
0x00000400

Another thread or process can open this byte stream for writing. If this flag is present, the length of thebyte stream could change while it is being read.

This flag can affect the behavior of byte-stream handlers. For more information, see .

Note??Requires Windows?7 or later.

MFBYTESTREAM_DOES_NOT_USE_NETWORK
0x00000800

The byte stream is not currentlyusing the network to receive the content. Networking hardwaremay enter a power saving state when this bit is set.

Note??Requires Windows?8 or later.

?

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698962 HRESULT IMFByteStream::GetCapabilities([Out] unsigned int* pdwCapabilities) IMFByteStream::GetCapabilities

Retrieves the length of the stream.

Receives the length of the stream, in bytes. If the length is unknown, this value is -1.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698941 HRESULT IMFByteStream::GetLength([Out] unsigned longlong* pqwLength) IMFByteStream::GetLength

Sets the length of the stream.

Length of the stream in bytes.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697225 HRESULT IMFByteStream::SetLength([In] unsigned longlong qwLength) IMFByteStream::SetLength

Retrieves the current read or write position in the stream.

Receives the current position, in bytes.

If this method succeeds, it returns . Otherwise, it returns an error code.

The methods that update the current position are Read, BeginRead, Write, BeginWrite, SetCurrentPosition, and Seek.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704059 HRESULT IMFByteStream::GetCurrentPosition([Out] unsigned longlong* pqwPosition) IMFByteStream::GetCurrentPosition

Sets the current read or write position.

New position in the stream, as a byte offset from the start of the stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

?

If the new position is larger than the length of the stream, the method returns E_INVALIDARG.

Implementation notes: This method should update the current position in the stream by setting the current position to the value passed in to the qwPosition parameter. Other methods that can update the current position are Read, BeginRead, Write, BeginWrite, and Seek.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms695238 HRESULT IMFByteStream::SetCurrentPosition([In] unsigned longlong qwPosition) IMFByteStream::SetCurrentPosition

Queries whether the current position has reached the end of the stream.

Receives the value TRUE if the end of the stream has been reached, or otherwise.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697369 HRESULT IMFByteStream::IsEndOfStream([Out] BOOL* pfEndOfStream) IMFByteStream::IsEndOfStream

Reads data from the stream.

Pointer to a buffer that receives the data. The caller must allocate the buffer.

Size of the buffer in bytes.

Receives the number of bytes that are copied into the buffer. This parameter cannot be null.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method reads at most cb bytes from the current position in the stream and copies them into the buffer provided by the caller. The number of bytes that were read is returned in the pcbRead parameter. The method does not return an error code on reaching the end of the file, so the application should check the value in pcbRead after the method returns.

This method is synchronous. It blocks until the read operation completes.

Implementation notes: This method should update the current position in the stream by adding the number of bytes that were read, which is specified by the value returned in the pcbRead parameter, to the current position. Other methods that can update the current position are Read, Write, BeginWrite, Seek, and SetCurrentPosition.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698913 HRESULT IMFByteStream::Read([In] void* pb,[In] unsigned int cb,[Out] unsigned int* pcbRead) IMFByteStream::Read

Begins an asynchronous read operation from the stream.

Pointer to a buffer that receives the data. The caller must allocate the buffer.

Size of the buffer in bytes.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

If this method succeeds, it returns . Otherwise, it returns an error code.

When all of the data has been read into the buffer, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

Do not read from, write to, free, or reallocate the buffer while an asynchronous read is pending.

Implementation notes: This method should update the current position in the stream by adding the number of bytes that will be read, which is specified by the value returned in the pcbRead parameter, to the current position. Other methods that can update the current position are BeginRead, Write, BeginWrite, Seek, and SetCurrentPosition.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704810 HRESULT IMFByteStream::BeginRead([In] void* pb,[In] unsigned int cb,[In] IMFAsyncCallback* pCallback,[In] void* punkState) IMFByteStream::BeginRead

Completes an asynchronous read operation.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

Receives the number of bytes that were read.

If this method succeeds, it returns . Otherwise, it returns an error code.

Call this method after the method completes asynchronously.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704042 HRESULT IMFByteStream::EndRead([In] IMFAsyncResult* pResult,[Out] unsigned int* pcbRead) IMFByteStream::EndRead

Represents a byte stream from some data source, which might be a local file, a network file, or some other source. The interface supports the typical stream operations, such as reading, writing, and seeking.

No documentation. No documentation. No documentation. No documentation.

The following functions return references for local files:

A byte stream for a media souce can be opened with read access. A byte stream for an archive media sink should be opened with both read and write access. (Read access may be required, because the archive sink might need to read portions of the file as it writes.)

Some implementations of this interface also expose one or more of the following interfaces:

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698720 HRESULT IMFByteStream::Write([In] const void* pb,[In] unsigned int cb,[Out] unsigned int* pcbWritten) IMFByteStream::Write

Begins an asynchronous write operation to the stream.

Pointer to a buffer containing the data to write.

Size of the buffer in bytes.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

If this method succeeds, it returns . Otherwise, it returns an error code.

When all of the data has been written to the stream, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

Do not reallocate, free, or write to the buffer while an asynchronous write is still pending.

Implementation notes: This method should update the current position in the stream by adding the number of bytes that will be written to the stream, which is specified by the value returned in the pcbWritten, to the current position. Other methods that can update the current position are Read, BeginRead, Write, Seek, and SetCurrentPosition.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms694005 HRESULT IMFByteStream::BeginWrite([In] const void* pb,[In] unsigned int cb,[In] IMFAsyncCallback* pCallback,[In] void* punkState) IMFByteStream::BeginWrite

Completes an asynchronous write operation.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

Receives the number of bytes that were written.

If this method succeeds, it returns . Otherwise, it returns an error code.

Call this method when the method completes asynchronously.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703863 HRESULT IMFByteStream::EndWrite([In] IMFAsyncResult* pResult,[Out] unsigned int* pcbWritten) IMFByteStream::EndWrite

Moves the current position in the stream by a specified offset.

Specifies the origin of the seek as a member of the enumeration. The offset is calculated relative to this position.

Specifies the new position, as a byte offset from the seek origin.

Specifies zero or more flags. The following flags are defined.

ValueMeaning
MFBYTESTREAM_SEEK_FLAG_CANCEL_PENDING_IO

All pending I/O requests are canceled after the seek request completes successfully.

?

Receives the new position after the seek.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Implementation notes: This method should update the current position in the stream by adding the qwSeekOffset to the seek SeekOrigin position. This should be the same value passed back in the pqwCurrentPosition parameter. Other methods that can update the current position are Read, BeginRead, Write, BeginWrite, and SetCurrentPosition.

ms697053 HRESULT IMFByteStream::Seek([In] MFBYTESTREAM_SEEK_ORIGIN SeekOrigin,[In] longlong llSeekOffset,[In] unsigned int dwSeekFlags,[Out, Optional] unsigned longlong* pqwCurrentPosition) IMFByteStream::Seek

Clears any internal buffers used by the stream. If you are writing to the stream, the buffered data is written to the underlying file or device.

If this method succeeds, it returns . Otherwise, it returns an error code.

If the byte stream is read-only, this method has no effect.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms694833 HRESULT IMFByteStream::Flush() IMFByteStream::Flush

Closes the stream and releases any resources associated with the stream, such as sockets or file handles. This method also cancels any pending asynchronous I/O requests.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703909 HRESULT IMFByteStream::Close() IMFByteStream::Close

Applies to: desktop apps | Metro style apps

Retrieves the characteristics of the byte stream.

The capabilities of the stream.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698962 HRESULT IMFByteStream::GetCapabilities([Out] unsigned int* pdwCapabilities) IMFByteStream::GetCapabilities

Applies to: desktop apps | Metro style apps

Retrieves the length of the stream.

The length of the stream, in bytes. If the length is unknown, this value is -1.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698941 HRESULT IMFByteStream::GetLength([Out] unsigned longlong* pqwLength) IMFByteStream::GetLength

Applies to: desktop apps | Metro style apps

Retrieves the current read or write position in the stream.

The current position, in bytes.

The methods that update the current position are Read, BeginRead, Write, BeginWrite, SetCurrentPosition, and Seek.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704059 HRESULT IMFByteStream::GetCurrentPosition([Out] unsigned longlong* pqwPosition) IMFByteStream::GetCurrentPosition

Applies to: desktop apps | Metro style apps

Queries whether the current position has reached the end of the stream.

true if the end of the stream has been reached

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697369 HRESULT IMFByteStream::IsEndOfStream([Out] BOOL* pfEndOfStream) IMFByteStream::IsEndOfStream
Internal AsyncCallback Callback Return a pointer to the unmanaged version of this callback. The callback. A pointer to a shadow c++ callback HRESULT IMFAsyncCallback::GetParameters([Out] MFASYNC_CALLBACK_FLAGS* pdwFlags,[Out] unsigned int* pdwQueue) HRESULT IMFAsyncCallback::Invoke([In, Optional] IMFAsyncResult* pAsyncResult)

Receives state-change notifications from the presentation clock.

To receive state-change notifications from the presentation clock, implement this interface and call on the presentation clock.

This interface must be implemented by:

  • Presentation time sources. The presentation clock uses this interface to request change states from the time source.

  • Media sinks. Media sinks use this interface to get notifications when the presentation clock changes.

Other objects that need to be notified can implement this interface.

ms701593 IMFClockStateSink IMFClockStateSink
Called when the presentation clock pauses. The system time when the clock was paused, in 100-nanosecond units. When the presentation clock's Pause method is called, the clock notifies the presentation time source by calling the time source's OnClockPause method. This call occurs synchronously within the Pause method. If the time source returns an error from OnClockPause, the presentation clock's Pause method returns an error and the state change does not take place. For any object that is not the presentation time source, the OnClockPause method is called asynchronously, after the state change is completed. In that case, the return value from this method is ignored. HRESULT IMFClockStateSink::OnClockPause([In] longlong hnsSystemTime) Called when the presentation clock restarts from the same position while paused. The system time when the clock restarted, in 100-nanosecond units. This method is called if the presentation clock is paused and the Start method is called with the value PRESENTATION_CURRENT_POSITION. The clock notifies the presentation time source by calling the time source's OnClockRestart method. This call occurs synchronously within the Start method. If the time source returns an error from OnClockRestart, the presentation clock's Start method returns an error and the state change does not take place. For any object that is not the presentation time source, the OnClockRestart method is called asynchronously, after the state change is completed. In that case, the return value from this method is ignored. HRESULT IMFClockStateSink::OnClockRestart([In] longlong hnsSystemTime) Called when the rate changes on the presentation clock. The system time when the rate was set, in 100-nanosecond units. The new rate, as a multiplier of the normal playback rate. When the presentation clock's SetRate method is called, the clock notifies the presentation time source by calling the time source's OnClockSetRate method. This call occurs synchronously within the SetRate method. If the time source returns an error from OnClockSetRate, the presentation clock's SetRate method returns an error and the state change does not take place. For any object that is not the presentation time source, the OnClockSetRate method is called asynchronously, after the state change is completed. In that case, the return value from this method is ignored. HRESULT IMFClockStateSink::OnClockSetRate([In] longlong hnsSystemTime,[In] float flRate) Called when the presentation clock starts. The system time when the clock started, in 100-nanosecond units. The new starting time for the clock, in 100-nanosecond units. This parameter can also equal PRESENTATION_CURRENT_POSITION, indicating the clock has started or restarted from its current position. This method is called whe the presentation clock's Start method is called, with the following exception: If the clock is paused and Start is called with the value PRESENTATION_CURRENT_POSITION, OnClockRestart is called instead of OnClockStart. The clock notifies the presentation time source by calling the time source's OnClockStart method. This call occurs synchronously within the Start method. If the time source returns an error from OnClockStart, the presentation clock's Start method returns an error and the state change does not take place. For any object that is not the presentation time source, the OnClockStart method is called asynchronously, after the state change is completed. In that case, the return value from this method is ignored. The value given in llClockStartOffset is the presentation time when the clock starts, so it is relative to the start of the presentation. Media sinks should not render any data with a presentation time earlier than llClockStartOffSet. If a sample straddles the offset?that is, if the offset falls between the sample's start and stop times?the sink should either trim the sample so that only data after llClockStartOffset is rendered, or else simply drop the sample. HRESULT IMFClockStateSink::OnClockStart([In] longlong hnsSystemTime,[In] longlong llClockStartOffset) Called when the presentation clock stops. The system time when the clock stopped, in 100-nanosecond units. When the presentation clock's Stop method is called, the clock notifies the presentation time source by calling the presentation time source's OnClockStop method. This call occurs synchronously within the Stop method. If the time source returns an error from OnClockStop, the presentation clock's Stop method returns an error and the state change does not take place. For any object that is not the presentation time source, the OnClockStop method is called asynchronously, after the state change is completed. If an object is already stopped, it should return Ok from OnClockStop. It should not return an error code. Note??Although the header file mferror.h defines an error code named MF_E_SINK_ALREADYSTOPPED, it should not be returned in this situation. HRESULT IMFClockStateSink::OnClockStop([In] longlong hnsSystemTime) Internal ClockStateSink callback Return a pointer to the unmanaged version of this callback. The callback. A pointer to a shadow c++ callback HRESULT IMFClockStateSink::OnClockStop([In] longlong hnsSystemTime) HRESULT IMFClockStateSink::OnClockPause([In] longlong hnsSystemTime) HRESULT IMFClockStateSink::OnClockRestart([In] longlong hnsSystemTime) HRESULT IMFClockStateSink::OnClockStart([In] longlong hnsSystemTime,[In] longlong llClockStartOffset) HRESULT IMFClockStateSink::OnClockSetRate([In] longlong hnsSystemTime,[In] float flRate) Return a pointer to the unmanaged version of this callback. The callback. A pointer to a shadow c++ callback HRESULT IMFSampleGrabberSinkCallback::OnSetPresentationClock([in] IMFPresentationClock *pPresentationClock); HRESULT OnProcessSample([in] REFGUID guidMajorMediaType, [in] DWORD dwSampleFlags, [in] LONGLONG llSampleTime, [in] LONGLONG llSampleDuration, [in] const BYTE *pSampleBuffer, [in] DWORD dwSampleSize); HRESULT IMFSampleGrabberSinkCallback::OnShutdown(); Return a pointer to the unmanaged version of this callback. The callback. A pointer to a shadow c++ callback

Called when the sample-grabber sink receives a new media sample.

If you use the sample-grabber sink in a playback topology, this method should return quickly, or it might interfere with playback. Do not block the thread, wait on events, or perform other lengthy operations inside this method.

dd374518 IMFSampleGrabberSinkCallback2 IMFSampleGrabberSinkCallback2

Callback interface to get media data from the sample-grabber sink.

The sample-grabber sink enables an application to get data from the Media Foundation pipeline without implementing a custom media sink. To use the sample-grabber sink, the application must perform the following steps:

  1. Implement the interface.

  2. Call , passing in the interface reference. This function returns an object.

  3. Create a topology that includes an output node with the sink's object.

  4. Pass this topology to the Media Session.

During playback, the sample-grabber sink calls methods on the application's callback.

You cannot use the sample-grabber sink to get protected content.

ms697548 IMFSampleGrabberSinkCallback IMFSampleGrabberSinkCallback
Called when the sample-grabber sink is shut down. This method is called when the sink's Shutdown method is called. The OnShutdown method should return quickly, or it might interfere with playback. Do not block the thread, wait on events, or perform other lengthy operations inside this method. HRESULT IMFSampleGrabberSinkCallback::OnShutdown() Called when the presentation clock is set on the sample-grabber sink. Pointer to the presentation clock's PresentationClock interface. This method should return quickly, or it might interfere with playback. Do not block the thread, wait on events, or perform other lengthy operations inside this method. HRESULT IMFSampleGrabberSinkCallback::OnSetPresentationClock([In] IMFPresentationClock* pPresentationClock)

Applies to: desktop apps only

Gets the range of values for an image filter that the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device supports.

To find out which image filters the device supports, check the FilterCaps member of the structure. Call the method to get this value.

dd373915 IDXVAHD_Device IDXVAHD_Device

Gets the range of values for an image filter that the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device supports.

To find out which image filters the device supports, check the FilterCaps member of the structure. Call the method to get this value.

dd373915 IDXVAHD_Device IDXVAHD_Device

Applies to: desktop apps only

Creates a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

A reference to the interface of a Direct3D 9 device.

A reference to a structure that describes the video content. The driver uses this information as a hint when it creates the device.

A member of the enumeration, describing how the device will be used. The value indicates the desired trade-off between speed and video quality. The driver uses this flag as a hint when it creates the device.

Use the interface to get the device capabilities, create the video processor, and allocate video surfaces.

dd318412 HRESULT DXVAHD_CreateDevice([In] IDirect3DDevice9Ex* pD3DDevice,[In] const DXVAHD_CONTENT_DESC* pContentDesc,[In] DXVAHD_DEVICE_USAGE Usage,[In, Optional] __function__stdcall* pPlugin,[Out, Fast] IDXVAHD_Device** ppDevice) DXVAHD_CreateDevice
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Creates one or more Microsoft Direct3D video surfaces.

The width of each surface, in pixels.

The height of each surface, in pixels.

The pixel format, specified as a value or FOURCC code. For more information, see Video FOURCCs.

The memory pool in which the surface is created. This parameter must equal the InputPool member of the structure. Call the method to get this value.

Reserved. Set to 0.

The type of surface to create, specified as a member of the enumeration.

The number of surfaces to create.

A reference to an array of references. The NumSurfaces parameter specifies the number of elements in the array. The method fills the array with references to the new video surfaces. The caller must release the references.

Reserved. Set to null.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd373911 HRESULT IDXVAHD_Device::CreateVideoSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Usage,[In] DXVAHD_SURFACE_TYPE Type,[In] unsigned int NumSurfaces,[Out, Buffer] IDirect3DSurface9** ppSurfaces,[InOut, Optional] void** pSharedHandle) IDXVAHD_Device::CreateVideoSurface

Gets the capabilities of the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

A reference to a structure that receives the device capabilities.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd373914 HRESULT IDXVAHD_Device::GetVideoProcessorDeviceCaps([Out] DXVAHD_VPDEVCAPS* pCaps) IDXVAHD_Device::GetVideoProcessorDeviceCaps

Gets a list of the output formats supported by the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

The number of formats to retrieve. This parameter must equal the OutputFormatCount member of the structure. Call the method to get this value.

A reference to an array of values. The Count parameter specifies the number of elements in the array. The method fills the array with a list of output formats.

If this method succeeds, it returns . Otherwise, it returns an error code.

The list of formats can include both values, such as , and FOURCC codes, such as 'NV12'. For more information, see Video FOURCCs.

dd373917 HRESULT IDXVAHD_Device::GetVideoProcessorOutputFormats([In] unsigned int Count,[Out, Buffer] D3DFORMAT* pFormats) IDXVAHD_Device::GetVideoProcessorOutputFormats

Gets a list of the input formats supported by the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

The number of formats to retrieve. This parameter must equal the InputFormatCount member of the structure. Call the method to get this value.

A reference to an array of values. The Count parameter specifies the number of elements in the array. The method fills the array with a list of input formats.

If this method succeeds, it returns . Otherwise, it returns an error code.

The list of formats can include both values, such as , and FOURCC codes, such as 'NV12'. For more information, see Video FOURCCs.

dd373916 HRESULT IDXVAHD_Device::GetVideoProcessorInputFormats([In] unsigned int Count,[Out, Buffer] D3DFORMAT* pFormats) IDXVAHD_Device::GetVideoProcessorInputFormats

Gets the capabilities of one or more Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processors.

The number of elements in the pCaps array. This parameter must equal the VideoProcessorCount member of the structure. Call the method to get this value.

A reference to an array of structures. The method fills the structures with the capabilities of the video processors supported by the driver.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd373912 HRESULT IDXVAHD_Device::GetVideoProcessorCaps([In] unsigned int Count,[Out, Buffer] DXVAHD_VPCAPS* pCaps) IDXVAHD_Device::GetVideoProcessorCaps

Gets a list of custom rates that a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor supports. Custom rates are used for frame-rate conversion and inverse telecine (IVTC).

A that identifies the video processor to query. This must equal the valud of the VPGuid member from one of the structures retrieved by the method.

The number of rates to retrieve. This parameter must equal the CustomRateCount member of the structure for the video processor.

A reference to an array of structures. The Count parameter specifies the number of elements in the array. The method fills the array with a list of custom rates.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd373913 HRESULT IDXVAHD_Device::GetVideoProcessorCustomRates([In] const GUID* pVPGuid,[In] unsigned int Count,[Out, Buffer] DXVAHD_CUSTOM_RATE_DATA* pRates) IDXVAHD_Device::GetVideoProcessorCustomRates

Gets the range of values for an image filter that the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device supports.

The type of image filter, specified as a member of the enumeration.

A reference to a structure. The method fills the structure with the range of values for the specified filter.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The Filter parameter is invalid or the device does not support the specified filter.

?

To find out which image filters the device supports, check the FilterCaps member of the structure. Call the method to get this value.

dd373915 HRESULT IDXVAHD_Device::GetVideoProcessorFilterRange([In] DXVAHD_FILTER Filter,[Out] DXVAHD_FILTER_RANGE_DATA* pRange) IDXVAHD_Device::GetVideoProcessorFilterRange

Creates a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor.

A that identifies the video processor to create. This must equal the value of the VPGuid member from one of the structures retrieved by the method.

Receives a reference to the interface. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd373910 HRESULT IDXVAHD_Device::CreateVideoProcessor([In] const GUID* pVPGuid,[Out] IDXVAHD_VideoProcessor** ppVideoProcessor) IDXVAHD_Device::CreateVideoProcessor

Gets the capabilities of the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

dd373914 GetVideoProcessorDeviceCaps GetVideoProcessorDeviceCaps HRESULT IDXVAHD_Device::GetVideoProcessorDeviceCaps([Out] DXVAHD_VPDEVCAPS* pCaps)

Applies to: desktop apps only

Enables two threads to share the same Direct3D 9 device, and provides access to the DirectX Video Acceleration (DXVA) features of the device.

This interface is exposed by the Direct3D Device Manager. To create the Direct3D device manager, call .

To get this interface from the Enhanced Video Renderer (EVR), call . The service is . For the DirectShow EVR filter, call GetService on the filter's pins.

The Direct3D Device Manager supports Direct3D 9 devices only. It does not support DXGI devices.

ms704727 IDirect3DDeviceManager9 IDirect3DDeviceManager9

Enables two threads to share the same Direct3D 9 device, and provides access to the DirectX Video Acceleration (DXVA) features of the device.

This interface is exposed by the Direct3D Device Manager. To create the Direct3D device manager, call .

To get this interface from the Enhanced Video Renderer (EVR), call . The service is . For the DirectShow EVR filter, call GetService on the filter's pins.

The Direct3D Device Manager supports Direct3D 9 devices only. It does not support DXGI devices.

Windows Store apps must use IMFDXGIDeviceManager and Direct3D 11 Video APIs.

ms704727 IDirect3DDeviceManager9 IDirect3DDeviceManager9

Applies to: desktop apps only

Creates an instance of the Direct3D Device Manager.

If this function succeeds, it returns . Otherwise, it returns an error code.

bb970490 HRESULT DXVA2CreateDirect3DDeviceManager9([Out] unsigned int* pResetToken,[Out, Fast] IDirect3DDeviceManager9** ppDeviceManager) DXVA2CreateDirect3DDeviceManager9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the Direct3D device or notifies the device manager that the Direct3D device was reset.

Pointer to the interface of the Direct3D device.

Token received in the pResetToken parameter of the function.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid token

Direct3D device error.

?

When you first create the Direct3D device manager, call this method with a reference to the Direct3D device. The device manager does not create the device; the caller must provide the device reference initially.

Also call this method if the Direct3D device becomes lost and you need to reset the device or create a new device. This occurs if returns or . For more information about lost devices, see the Direct3D documentation.

The resetToken parameter ensures that only the component which originally created the device manager can invalidate the current device.

If this method succeeds, all open device handles become invalid.

ms693525 HRESULT IDirect3DDeviceManager9::ResetDevice([In] IDirect3DDevice9* pDevice,[In] unsigned int resetToken) IDirect3DDeviceManager9::ResetDevice

Gets a handle to the Direct3D device.

Receives the device handle.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

DXVA2_E_NOT_INITIALIZED

The Direct3D device manager was not initialized. The owner of the device must call .

?

To get the Direct3D device's reference, call with the handle returned in phDevice. Close the device handle when you are done using it, by calling .

To test whether a device handle is still valid, call .

ms698976 HRESULT IDirect3DDeviceManager9::OpenDeviceHandle([Out] void** phDevice) IDirect3DDeviceManager9::OpenDeviceHandle

Closes a Direct3D device handle. Call this method to release a device handle retrieved by the method.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_HANDLE

Invalid handle.

?

ms697332 HRESULT IDirect3DDeviceManager9::CloseDeviceHandle([In] void* hDevice) IDirect3DDeviceManager9::CloseDeviceHandle

Tests whether a Direct3D device handle is valid.

Handle to a Direct3D device. To get a device handle, call .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The device handle is valid.

E_HANDLE

The specified handle is not a Direct3D device handle.

DXVA2_E_NEW_VIDEO_DEVICE

The device handle is invalid.

?

If the method returns DXVA2_E_NEW_VIDEO_DEVICE, call to close the handle and then call OpenDeviceHandle again to get a new handle. The method invalidates all open device handles.

ms704778 HRESULT IDirect3DDeviceManager9::TestDevice([In] void* hDevice) IDirect3DDeviceManager9::TestDevice

Gives the caller exclusive access to the Direct3D device.

A handle to the Direct3D device. To get the device handle, call .

Receives a reference to the device's interface.

Specifies whether to wait for the device lock. If the device is already locked and this parameter is TRUE, the method blocks until the device is unlocked. Otherwise, if the device is locked and this parmater is , the method returns immediately with the error code DXVA2_E_VIDEO_DEVICE_LOCKED.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

DXVA2_E_NEW_VIDEO_DEVICE

The device handle is invalid.

DXVA2_E_NOT_INITIALIZED

The Direct3D device manager was not initialized. The owner of the device must call .

DXVA2_E_VIDEO_DEVICE_LOCKED

The device is locked and fBlock is .

E_HANDLE

The specified handle is not a Direct3D device handle.

?

When you are done using the Direct3D device, call to unlock to the device.

If the method returns DXVA2_E_NEW_VIDEO_DEVICE, call to close the handle and then call OpenDeviceHandle again to get a new handle. The method invalidates all open device handles.

If fBlock is TRUE, this method can potentially deadlock. For example, it will deadlock if a thread calls LockDevice and then waits on another thread that calls LockDevice. It will also deadlock if a thread calls LockDevice twice without calling UnlockDevice in between.

ms697056 HRESULT IDirect3DDeviceManager9::LockDevice([In] void* hDevice,[Out] IDirect3DDevice9** ppDevice,[In] BOOL fBlock) IDirect3DDeviceManager9::LockDevice

Unlocks the Direct3D device. Call this method to release the device after calling .

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The specified device handle is not locked, or is not a valid handle.

?

ms704707 HRESULT IDirect3DDeviceManager9::UnlockDevice([In] void* hDevice,[In] BOOL fSaveState) IDirect3DDeviceManager9::UnlockDevice

Gets a DirectX Video Acceleration (DXVA) service interface.

A handle to a Direct3D device. To get a device handle, call .

The interface identifier (IID) of the requested interface. The Direct3D device might support the following DXVA service interfaces:

Receives a reference to the requested interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

DXVA2_E_NEW_VIDEO_DEVICE

The device handle is invalid.

DXVA2_E_NOT_AVAILABLE

The Direct3D device does not support video acceleration.

DXVA2_E_NOT_INITIALIZED

The Direct3D device manager was not initialized. The owner of the device must call .

E_HANDLE

The specified handle is not a Direct3D device handle.

?

If the method returns DXVA2_E_NEW_VIDEO_DEVICE, call to close the handle and then call OpenDeviceHandle again to get a new handle. The method invalidates all open device handles.

ms696198 HRESULT IDirect3DDeviceManager9::GetVideoService([In] void* hDevice,[In] const GUID& riid,[Out] void** ppService) IDirect3DDeviceManager9::GetVideoService
A token that identifies this instance of the Direct3D device manager. Use this token when calling . The namespace provides a managed MediaFoundation for DirectX integration API. MediaFoundation MediaFoundation

Applies to: desktop apps only

Provides DirectX Video Acceleration (DXVA) services from a Direct3D device. To get a reference to this interface, call or .

This is the base interface for DXVA services. The Direct3D device can support any of the following DXVA services, which derive from :

  • Video decoding:
  • Video processing:
ms697049 IDirectXVideoAccelerationService IDirectXVideoAccelerationService

Provides DirectX Video Acceleration (DXVA) services from a Direct3D device. To get a reference to this interface, call or .

This is the base interface for DXVA services. The Direct3D device can support any of the following DXVA services, which derive from :

  • Video decoding:
  • Video processing:
ms697049 IDirectXVideoAccelerationService IDirectXVideoAccelerationService

Applies to: desktop apps only

Creates a DirectX Video Acceleration (DXVA) services object. Call this function if your application uses DXVA directly, without using DirectShow or Media Foundation.

A reference to the interface of a Direct3D device.

If this function succeeds, it returns . Otherwise, it returns an error code.

ms704721 HRESULT DXVA2CreateVideoService([In] IDirect3DDevice9* pDD,[In] const GUID& riid,[Out] void** ppService) DXVA2CreateVideoService
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Creates a DirectX Video Acceleration (DXVA) video processor or DXVA decoder render target.

The width of the surface, in pixels.

The height of the surface, in pixels.

The number of back buffers. The method creates BackBuffers + 1 surfaces.

The pixel format, specified as a value or FOURCC code. For more information, see the Direct3D documentation.

The memory pool in which to create the surface, specified as a value. For more information, see the Direct3D documentation. Decoders should generally use the value .

Reserved. Set this value to zero.

The type of surface to create. Use one of the following values.

ValueMeaning

Video decoder render target.

Video processor render target. Used for operations.

Software render target. This surface type is for use with software DXVA devices.

?

The address of an array of references allocated by the caller. The size of the array must be 1 + BackBuffers (enough for the back buffers plus one front buffer). The method fills the array with references. The caller must release all of the interface references. In addition, the front buffer holds a reference count on each of the back buffers. Therefore, the back buffers are never deleted until the front buffer is deleted.

A reference to a handle that is used to share the surfaces between Direct3D devices. Set this parameter to null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid parameter

E_FAIL

The DirectX Video Acceleration Manager is not initialized.

E_POINTER

null reference argument.

?

If the method returns E_FAIL, try calling to reset the DirectX Video Acceleration Manager.

ms696227 HRESULT IDirectXVideoAccelerationService::CreateSurface([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int BackBuffers,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Usage,[In] unsigned int DxvaType,[Out, Buffer] IDirect3DSurface9** ppSurface,[InOut, Optional] void** pSharedHandle) IDirectXVideoAccelerationService::CreateSurface

Applies to: desktop apps only

Provides access to DirectX Video Acceleration (DXVA) decoder services. Use this interface to query which hardware-accelerated decoding operations are available and to create DXVA video decoder devices.

To get a reference to this interface, call or with the interface identifier IID_IDirectXVideoDecoderService.

ms704820 IDirectXVideoDecoderService IDirectXVideoDecoderService

Provides access to DirectX Video Acceleration (DXVA) decoder services. Use this interface to query which hardware-accelerated decoding operations are available and to create DXVA video decoder devices.

To get a reference to this interface, call or with the interface identifier IID_IDirectXVideoDecoderService.

ms704820 IDirectXVideoDecoderService IDirectXVideoDecoderService

Applies to: desktop apps only

Creates a DirectX Video Acceleration (DXVA) services object. Call this function if your application uses DXVA directly, without using DirectShow or Media Foundation.

A reference to the interface of a Direct3D device.

If this function succeeds, it returns . Otherwise, it returns an error code.

ms704721 HRESULT DXVA2CreateVideoService([In] IDirect3DDevice9* pDD,[In] const GUID& riid,[Out] void** ppService) DXVA2CreateVideoService
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves an array of GUIDs that identifies the decoder devices supported by the graphics hardware.

Receives the number of GUIDs.

Receives an array of GUIDs. The size of the array is retrieved in the Count parameter. The method allocates the memory for the array. The caller must free the memory by calling CoTaskMemFree.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Error from the Direct3D device.

E_FAIL

If the Microsoft Basic Display Adapter is being used or the Direct3D?11 device type is the reference rasterizer. These devices do not support video decoders.

?

The following decoder GUIDs are defined. Some of these GUIDs have alternate names, shown in parentheses.

Description
DXVA2_ModeH264_A (DXVA2_ModeH264_MoComp_NoFGT)H.264 motion compensation (MoComp), no film grain technology (FGT).
DXVA2_ModeH264_B (DXVA2_ModeH264_MoComp_FGT)H.264 MoComp, FGT.
DXVA2_ModeH264_C (DXVA2_ModeH264_IDCT_NoFGT)H.264 inverse discrete cosine transform (IDCT), no FGT.
DXVA2_ModeH264_D (DXVA2_ModeH264_IDCT_FGT)H.264 IDCT, FGT.
DXVA2_ModeH264_E (DXVA2_ModeH264_VLD_NoFGT)H.264 VLD, no FGT.
DXVA2_ModeH264_F (DXVA2_ModeH264_VLD_FGT)H.264 variable-length decoder (VLD), FGT.
DXVA2_ModeMPEG2_IDCTMPEG-2 IDCT.
DXVA2_ModeMPEG2_MoCompMPEG-2 MoComp.
DXVA2_ModeMPEG2_VLDMPEG-2 VLD.
DXVA2_ModeVC1_A (DXVA2_ModeVC1_PostProc)VC-1 post processing.
DXVA2_ModeVC1_B (DXVA2_ModeVC1_MoComp)VC-1 MoComp.
DXVA2_ModeVC1_C (DXVA2_ModeVC1_IDCT)VC-1 IDCT.
DXVA2_ModeVC1_D (DXVA2_ModeVC1_VLD)VC-1 VLD.
DXVA2_ModeWMV8_A (DXVA2_ModeWMV8_PostProc)Windows Media Video 8 post processing.
DXVA2_ModeWMV8_B (DXVA2_ModeWMV8_MoComp)Windows Media Video 8 MoComp.
DXVA2_ModeWMV9_A (DXVA2_ModeWMV9_PostProc)Windows Media Video 9 post processing.
DXVA2_ModeWMV9_B (DXVA2_ModeWMV9_MoComp)Windows Media Video 9 MoComp.
DXVA2_ModeWMV9_C (DXVA2_ModeWMV9_IDCT)Windows Media Video 9 IDCT.

?

ms697067 HRESULT IDirectXVideoDecoderService::GetDecoderDeviceGuids([Out] unsigned int* pCount,[Out, Buffer, Optional] GUID** pGuids) IDirectXVideoDecoderService::GetDecoderDeviceGuids

Retrieves the supported render targets for a specified decoder device.

that identifies the decoder device. To get the available device GUIDs, call .

Receives the number of formats.

Receives an array of formats, specified as values. The size of the array is retrieved in the pCount parameter. The method allocates the memory for the array. The caller must free the memory by calling CoTaskMemFree.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms703193 HRESULT IDirectXVideoDecoderService::GetDecoderRenderTargets([In] const GUID& Guid,[Out] unsigned int* pCount,[Out, Buffer, Optional] D3DFORMAT** pFormats) IDirectXVideoDecoderService::GetDecoderRenderTargets

Gets the configurations that are available for a decoder device.

A that identifies the decoder device. To get the available device GUIDs, call .

A reference to a structure that describes the video content.

Reserved. Set to null.

Receives the number of configurations.

Receives an array of structures. The size of the array is retrieved in the pCount parameter. The caller must free the memory for the array by calling CoTaskMemFree. This parameter can be null if you simply want the number of configurations (returned in pCount) but not the GUIDs.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms699833 HRESULT IDirectXVideoDecoderService::GetDecoderConfigurations([In] const GUID& Guid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] void* pReserved,[Out] unsigned int* pCount,[Out, Buffer, Optional] DXVA2_ConfigPictureDecode** ppConfigs) IDirectXVideoDecoderService::GetDecoderConfigurations

Creates a video decoder device.

that specifies the decoder device to create. To get the available device GUIDs, call .

Pointer to a structure that describes the video content.

Pointer to a structure that specifies the decoder configuration.

Pointer to an array of references containing references to the decoder render targets. To create these surfaces, call . Specify for the DxvaType parameter.

Size of the ppDecoderRenderTargets array. This value cannot be zero.

Receives a reference to the decoder's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms696175 HRESULT IDirectXVideoDecoderService::CreateVideoDecoder([In] const GUID& Guid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] const DXVA2_ConfigPictureDecode* pConfig,[In, Buffer] IDirect3DSurface9** ppDecoderRenderTargets,[In] unsigned int NumRenderTargets,[Out] IDirectXVideoDecoder** ppDecode) IDirectXVideoDecoderService::CreateVideoDecoder

Creates a video decoder device.

that specifies the decoder device to create. To get the available device GUIDs, call .

Pointer to a structure that describes the video content.

Pointer to a structure that specifies the decoder configuration.

Pointer to an array of references containing references to the decoder render targets. To create these surfaces, call . Specify for the DxvaType parameter.

Size of the ppDecoderRenderTargets array. This value cannot be zero.

Receives a reference to the decoder's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms696175 HRESULT IDirectXVideoDecoderService::CreateVideoDecoder([In] const GUID& Guid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] const DXVA2_ConfigPictureDecode* pConfig,[In, Buffer] IDirect3DSurface9** ppDecoderRenderTargets,[In] unsigned int NumRenderTargets,[Out] IDirectXVideoDecoder** ppDecode) IDirectXVideoDecoderService::CreateVideoDecoder

Applies to: desktop apps only

Provides access to DirectX Video Acceleration (DXVA) video processing services.

Use this interface to query which hardware-accelerated video processing operations are available and to create DXVA video processor devices. To obtain a reference to this interface, call or with the interface identifier IID_IDirectXVideoProcessorService.

ms705631 IDirectXVideoProcessorService IDirectXVideoProcessorService

Provides access to DirectX Video Acceleration (DXVA) video processing services.

Use this interface to query which hardware-accelerated video processing operations are available and to create DXVA video processor devices. To obtain a reference to this interface, call or with the interface identifier IID_IDirectXVideoProcessorService.

ms705631 IDirectXVideoProcessorService IDirectXVideoProcessorService

Applies to: desktop apps only

Creates a DirectX Video Acceleration (DXVA) services object. Call this function if your application uses DXVA directly, without using DirectShow or Media Foundation.

A reference to the interface of a Direct3D device.

If this function succeeds, it returns . Otherwise, it returns an error code.

ms704721 HRESULT DXVA2CreateVideoService([In] IDirect3DDevice9* pDD,[In] const GUID& riid,[Out] void** ppService) DXVA2CreateVideoService
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Registers a software video processing device.

Pointer to an initialization function.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms696262 HRESULT IDirectXVideoProcessorService::RegisterVideoProcessorSoftwareDevice([In] void* pCallbacks) IDirectXVideoProcessorService::RegisterVideoProcessorSoftwareDevice

Gets an array of GUIDs which identify the video processors supported by the graphics hardware.

Pointer to a structure that describes the video content.

Receives the number of GUIDs.

Receives an array of GUIDs. The size of the array is retrieved in the pCount parameter. The method allocates the memory for the array. The caller must free the memory by calling CoTaskMemFree.

If this method succeeds, it returns . Otherwise, it returns an error code.

The following video processor GUIDs are predefined.

Description
DXVA2_VideoProcBobDeviceBob deinterlace device. This device uses a "bob" algorithm to deinterlace the video. Bob algorithms create missing field lines by interpolating the lines in a single field.
DXVA2_VideoProcProgressiveDeviceProgressive video device. This device is available for progressive video, which does not require a deinterlace algorithm.
DXVA2_VideoProcSoftwareDeviceReference (software) device.

?

The graphics device may define additional vendor-specific GUIDs. The driver provides the list of GUIDs in descending quality order. The mode with the highest quality is first in the list. To get the capabilities of each mode, call and pass in the for the mode.

ms695370 HRESULT IDirectXVideoProcessorService::GetVideoProcessorDeviceGuids([In] const DXVA2_VideoDesc* pVideoDesc,[Out] unsigned int* pCount,[Out, Buffer, Optional] GUID** pGuids) IDirectXVideoProcessorService::GetVideoProcessorDeviceGuids

Gets the render target formats that a video processor device supports. The list may include RGB and YUV formats.

A that identifies the video processor device. To get the list of video processor GUIDs, call .

A reference to a structure that describes the video content.

Receives the number of formats.

Receives an array of formats, specified as values. The size of the array is retrieved in the pCount parameter. The method allocates the memory for the array. The caller must free the memory by calling CoTaskMemFree.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms702118 HRESULT IDirectXVideoProcessorService::GetVideoProcessorRenderTargets([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[Out] unsigned int* pCount,[Out, Buffer, Optional] D3DFORMAT** pFormats) IDirectXVideoProcessorService::GetVideoProcessorRenderTargets

Gets a list of substream formats supported by a specified video processor device.

A that identifies the video processor device. To get the list of video processor GUIDs, call .

A reference to a structure that describes the video content.

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

Receives the number of elements returned in the ppFormats array.

Receives an array of values. The caller must free the array by calling CoTaskMemFree. The array can contain both RGB and YUB pixel formats.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms694271 HRESULT IDirectXVideoProcessorService::GetVideoProcessorSubStreamFormats([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[Out] unsigned int* pCount,[Out, Buffer, Optional] D3DFORMAT** pFormats) IDirectXVideoProcessorService::GetVideoProcessorSubStreamFormats

Gets the capabilities of a specified video processor device.

A that identifies the video processor device. To get the list of video processor GUIDs, call .

A reference to a structure that describes the video content.

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

A reference to a structure that receives the video processor capabilities.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms702988 HRESULT IDirectXVideoProcessorService::GetVideoProcessorCaps([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[Out] DXVA2_VideoProcessorCaps* pCaps) IDirectXVideoProcessorService::GetVideoProcessorCaps

Gets the range of values for a video processor (ProcAmp) setting.

A that identifies the video processor device. To get the list of video processor GUIDs, call .

A reference to a structure that describes the video content.

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

The ProcAmp setting to query. See ProcAmp Settings.

A reference to a structure that receives the range of values for the setting specified in ProcAmpCaps.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms702244 HRESULT IDirectXVideoProcessorService::GetProcAmpRange([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[In] unsigned int ProcAmpCap,[Out] DXVA2_ValueRange* pRange) IDirectXVideoProcessorService::GetProcAmpRange

Retrieves the range of values for an image filter supported by a video processor device.

A that identifies the video processor device. To get the list of video processor GUIDs, call .

A reference to a structure that describes the video content.

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

The filter setting to query. See DXVA Image Filter Settings.

A reference to a structure that receives range of values for the image filter setting specified in FilterSetting.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms694173 HRESULT IDirectXVideoProcessorService::GetFilterPropertyRange([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[In] unsigned int FilterSetting,[Out] DXVA2_ValueRange* pRange) IDirectXVideoProcessorService::GetFilterPropertyRange

Creates a video processor device.

A that specifies the video processor to create. To get the list of video processor GUIDs, call .

A reference to a structure that describes the video content.

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

The maximum number of substreams that will be used with this device.

Receives a reference to the video processor's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms694848 HRESULT IDirectXVideoProcessorService::CreateVideoProcessor([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[In] unsigned int MaxNumSubStreams,[Out] IDirectXVideoProcessor** ppVidProcess) IDirectXVideoProcessorService::CreateVideoProcessor
The namespace provides a managed MediaFoundation for Dsp API. MediaFoundation MediaFoundation

Provides information about the result of an asynchronous operation.

Use this interface to complete an asynchronous operation. You get a reference to this interface when your callback object's method is called. To complete the operation, pass the reference to the End... method that corresponds to the Begin... method that starts the operation. For example, if the asynchronous method is named BeginRead, call the EndRead method. For more information, see Calling Asynchronous Methods.

If you are implementing an asynchronous method, call to create an instance of this object. For more information, see Writing an Asynchronous Method.

Any custom implementation of this interface must inherit the structure.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms700196 IMFAsyncResult IMFAsyncResult
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns the state object specified by the caller in the asynchronous Begin method.

Receives a reference to the state object's interface. If the value is not null, the caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_POINTER

There is no state object associated with this asynchronous result.

?

The caller of the asynchronous method specifies the state object, and can use it for any caller-defined purpose. The state object can be null. If the state object is null, GetState returns E_POINTER.

If you are implementing an asynchronous method, set the state object on the through the punkState parameter of the function.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970576 HRESULT IMFAsyncResult::GetState([Out] void** ppunkState) IMFAsyncResult::GetState

Returns the status of the asynchronous operation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The operation completed successfully.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms702095 HRESULT IMFAsyncResult::GetStatus() IMFAsyncResult::GetStatus

Sets the status of the asynchronous operation.

The status of the asynchronous operation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If you implement an asynchronous method, call SetStatus to set the status code for the operation.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970435 HRESULT IMFAsyncResult::SetStatus([In] HRESULT hrStatus) IMFAsyncResult::SetStatus

Returns an object associated with the asynchronous operation. The type of object, if any, depends on the asynchronous method that was called.

Receives a reference to the object's interface. If no object is associated with the operation, this parameter receives the value null. If the value is not null, the caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_POINTER

There is no object associated with this asynchronous result.

?

Typically, this object is used by the component that implements the asynchronous method. It provides a way for the function that invokes the callback to pass information to the asynchronous End... method that completes the operation.

If you are implementing an asynchronous method, you can set the object through the punkObject parameter of the function.

If the asynchronous result object's internal reference is null, the method returns E_POINTER.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970500 HRESULT IMFAsyncResult::GetObjectW([Out] IUnknown** ppObject) IMFAsyncResult::GetObjectW

Returns the state object specified by the caller in the asynchronous Begin method, without incrementing the object's reference count.

Returns a reference to the state object's interface, or null if no object was set. This reference does not have an outstanding reference count. If you store this reference, you must call AddRef on the reference.

This method cannot be called remotely.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms696238 IUnknown* IMFAsyncResult::GetStateNoAddRef() IMFAsyncResult::GetStateNoAddRef
Gets the state object specified by the caller in the asynchronous Begin method. If the value is not null, the caller must dispose. The state.

The caller of the asynchronous method specifies the state object, and can use it for any caller-defined purpose. The state object can be null. If the state object is null, GetState returns E_POINTER.

If you are implementing an asynchronous method, set the state object on the through the punkState parameter of the function.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970576 HRESULT IMFAsyncResult::GetState([Out] IUnknown** ppunkState) IMFAsyncResult::GetState

Get or sets the status of the asynchronous operation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The operation completed successfully.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms702095 HRESULT IMFAsyncResult::GetStatus() IMFAsyncResult::GetStatus

Applies to: desktop apps | Metro style apps

Returns an object associated with the asynchronous operation. The type of object, if any, depends on the asynchronous method that was called.

Receives a reference to the object's interface. If no object is associated with the operation, this parameter receives the value null. If the value is not null, the caller must release the interface.

Typically, this object is used by the component that implements the asynchronous method. It provides a way for the function that invokes the callback to pass information to the asynchronous End... method that completes the operation.

If you are implementing an asynchronous method, you can set the object through the punkObject parameter of the function.

If the asynchronous result object's internal reference is null, the method returns E_POINTER.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970500 HRESULT IMFAsyncResult::GetObjectW([Out] IUnknown** ppObject) IMFAsyncResult::GetObjectW
No documentation. ff536174 AEC_INPUT_STREAM AEC_INPUT_STREAM No documentation. ff536174 AEC_CAPTURE_STREAM AEC_CAPTURE_STREAM No documentation. ff536174 AEC_REFERENCE_STREAM AEC_REFERENCE_STREAM

Specifies the processing mode for the voice capture DSP. This enumeration is used with the MFPKEY_WMAAECMA_SYSTEM_MODE property.

In all modes, the DSP applies noise suppression and automatic gain control by default. To disable noise suppression, set the MFPKEY_WMAAECMA_FEATR_NS property. To disable automatic gain control, set the MFPKEY_WMAAECMA_FEATR_AGC property.

ff819068 AEC_SYSTEM_MODE AEC_SYSTEM_MODE
No documentation. ff819068 SINGLE_CHANNEL_AEC SINGLE_CHANNEL_AEC No documentation. ff819068 ADAPTIVE_ARRAY_ONLY ADAPTIVE_ARRAY_ONLY No documentation. ff819068 OPTIBEAM_ARRAY_ONLY OPTIBEAM_ARRAY_ONLY No documentation. ff819068 ADAPTIVE_ARRAY_AND_AEC ADAPTIVE_ARRAY_AND_AEC No documentation. ff819068 OPTIBEAM_ARRAY_AND_AEC OPTIBEAM_ARRAY_AND_AEC No documentation. ff819068 SINGLE_CHANNEL_NSAGC SINGLE_CHANNEL_NSAGC No documentation. ff819068 MODE_NOT_SET MODE_NOT_SET

Specifies the type of voice activity detection (VAD) for the voice capture DSP. This enumeration is used with the MFPKEY_WMAAECMA_FEATR_VAD property.

ff819069 AEC_VAD_MODE AEC_VAD_MODE
No documentation. ff819069 AEC_VAD_DISABLED AEC_VAD_DISABLED No documentation. ff819069 AEC_VAD_NORMAL AEC_VAD_NORMAL No documentation. ff819069 AEC_VAD_FOR_AGC AEC_VAD_FOR_AGC No documentation. ff819069 AEC_VAD_FOR_SILENCE_SUPPRESSION AEC_VAD_FOR_SILENCE_SUPPRESSION No documentation. FILE_ACCESSMODE FILE_ACCESSMODE No documentation. ACCESSMODE_READ ACCESSMODE_READ No documentation. ACCESSMODE_WRITE ACCESSMODE_WRITE No documentation. ACCESSMODE_READWRITE ACCESSMODE_READWRITE No documentation. ACCESSMODE_WRITE_EXCLUSIVE ACCESSMODE_WRITE_EXCLUSIVE

Specifies how to open or create a file.

ms694164 FILE_OPENMODE FILE_OPENMODE

Open an existing file. Fail if the file does not exist.

ms694164 OPENMODE_FAIL_IF_NOT_EXIST OPENMODE_FAIL_IF_NOT_EXIST

Create a new file. Fail if the file already exists.

ms694164 OPENMODE_FAIL_IF_EXIST OPENMODE_FAIL_IF_EXIST

Open an existing file and truncate it, so that the size is zero bytes. Fail if the file does not already exist.

ms694164 OPENMODE_RESET_IF_EXIST OPENMODE_RESET_IF_EXIST

If the file does not exist, create a new file. If the file exists, open it.

ms694164 OPENMODE_APPEND_IF_EXIST OPENMODE_APPEND_IF_EXIST

Create a new file. If the file exists, overwrite the file.

ms694164 OPENMODE_DELETE_IF_EXIST OPENMODE_DELETE_IF_EXIST
No documentation. MF_AUVRHP_ROOMMODEL MF_AUVRHP_ROOMMODEL No documentation. VRHP_SMALLROOM VRHP_SMALLROOM No documentation. VRHP_MEDIUMROOM VRHP_MEDIUMROOM No documentation. VRHP_BIGROOM VRHP_BIGROOM No documentation. VRHP_CUSTUMIZEDROOM VRHP_CUSTUMIZEDROOM

Specifies how the voice capture DSP performs microphone array processing. This enumeration is used with the MFPKEY_WMAAECMA_FEATR_MICARR_MODE property.

ff819453 MIC_ARRAY_MODE MIC_ARRAY_MODE
No documentation. ff819453 MICARRAY_SINGLE_CHAN MICARRAY_SINGLE_CHAN No documentation. ff819453 MICARRAY_SIMPLE_SUM MICARRAY_SIMPLE_SUM No documentation. ff819453 MICARRAY_SINGLE_BEAM MICARRAY_SINGLE_BEAM No documentation. ff819453 MICARRAY_FIXED_BEAM MICARRAY_FIXED_BEAM No documentation. ff819453 MICARRAY_EXTERN_BEAM MICARRAY_EXTERN_BEAM When overridden in a derived class, sets the position within the current stream.

Namespace: System.IOAssembly: mscorlib (in mscorlib.dll)Public MustOverride Function Seek ( _ offset As Long, _ origin As SeekOrigin _ ) As LongDim instance As Stream Dim offset As Long Dim origin As SeekOrigin Dim returnValue As Long returnValue = instance.Seek(offset, origin)public abstract long Seek ( long offset, SeekOrigin origin )public: virtual long long Seek ( long long offset, SeekOrigin origin ) abstractpublic abstract long Seek ( long offset, SeekOrigin origin )public abstract function Seek ( offset : long, origin : SeekOrigin ) : longNot applicable.

Parameters
offset

A byte offset relative to the origin parameter.

origin

A value of type SeekOrigin indicating the reference point used to obtain the new position.

Return Value The new position within the current stream.
Exception typeCondition

IOException

An I/O error occurs.

NotSupportedException

The stream does not support seeking, such as if the stream is constructed from a pipe or console output.

ObjectDisposedException

Methods were called after the stream was closed.

For an example of creating a file and writing text to a file, see Writing Text to a File. For an example of reading text from a file, see Reading Text from a File. For an example of reading from and writing to a binary file, see Reading and Writing to a Newly Created Data File.

Use the CanSeek property to determine whether the current instance supports seeking.

If offset is negative, the new position is required to precede the position specified by origin by the number of bytes specified by offset. If offset is zero (0), the new position is required to be the position specified by origin. If offset is positive, the new position is required to follow the position specified by origin by the number of bytes specified by offset.

Classes derived from Stream that support seeking must override this method to provide the functionality described above.

Seeking to any location beyond the length of the stream is supported.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1. .NET FrameworkSupported in: 3.0, 2.0, 1.1, 1.0.NET Compact FrameworkSupported in: 2.0, 1.0XNA FrameworkSupported in: 1.0ReferenceStream ClassStream MembersSystem.IO NamespaceOther ResourcesFile and Stream I/OReading Text from a FileWriting Text to a File
system.io.stream.seek SEEK_ORIGIN SEEK_ORIGIN

A byte offset relative to the origin parameter.

system.io.stream.seek _msoBegin _msoBegin
No documentation. system.io.stream.seek _msoCurrent _msoCurrent

The enumeration contains members that specify the position type of a table of contents.

Currently, only is supported.

ff819475 TOC_POS_TYPE TOC_POS_TYPE
No documentation. ff819475 TOC_POS_INHEADER TOC_POS_INHEADER No documentation. ff819475 TOC_POS_TOPLEVELOBJECT TOC_POS_TOPLEVELOBJECT

Defines the data types used for the codec and DSP properties that are accessed by using the methods of the interface.

Most properties are accessed by using the methods of the interface. The data types of those properties are defined as constants used with VARIANTARG values.

ff819511 WMT_PROP_DATATYPE WMT_PROP_DATATYPE
No documentation. ff819511 WMT_PROP_TYPE_DWORD WMT_PROP_TYPE_DWORD No documentation. ff819511 WMT_PROP_TYPE_STRING WMT_PROP_TYPE_STRING No documentation. ff819511 WMT_PROP_TYPE_BINARY WMT_PROP_TYPE_BINARY No documentation. ff819511 WMT_PROP_TYPE_BOOL WMT_PROP_TYPE_BOOL No documentation. ff819511 WMT_PROP_TYPE_QWORD WMT_PROP_TYPE_QWORD No documentation. ff819511 WMT_PROP_TYPE_WORD WMT_PROP_TYPE_WORD No documentation. ff819511 WMT_PROP_TYPE_GUID WMT_PROP_TYPE_GUID No documentation. IClusterDetector IClusterDetector Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. No documentation. HRESULT IClusterDetector::Initialize([In] unsigned short wBaseEntryLevel,[In] unsigned short wClusterEntryLevel) IClusterDetector::Initialize No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT IClusterDetector::Detect([In] unsigned int dwMaxNumClusters,[In] float fMinClusterDuration,[In] float fMaxClusterDuration,[In] IToc* pSrcToc,[In] IToc** ppDstToc) IClusterDetector::Detect

Configures the "leaky bucket" parameters on a video encoder.

This interface is implemented by all of the encoder objects. You can get a reference to the interface for a Windows Media video encoder by calling the QueryInterface method of any other interface on the object, such as or . This interface is not implemented on any of the decoders.

ff819233 IWMCodecLeakyBucket IWMCodecLeakyBucket
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the buffer size in bits.

The buffer size, in bits.

This method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is not implemented on the audio encoder objects. If you call this method from the interface it returns E_NOTIMPL.

The buffer size is equal to the bit rate of the stream multiplied by the buffer window. For example, a stream with a bit rate of 28 kilobits per second with a buffer window of 3 seconds would have a buffer of 28000 bits per second x 3 seconds = 84000 bits.

This method is an alternative to setting the MFPKEY_VIDEOWINDOW property. Using this method does not alter the bit rate of the stream, but does alter the buffer window. Using the stream with a bit rate of 28000 bits per second from the previous example, setting the buffer size to 84000 using this method would have exactly the same effect as setting MFPKEY_VIDEOWINDOW to 3000 milliseconds (3 seconds).

ff819235 HRESULT IWMCodecLeakyBucket::SetBufferSizeBits([In] unsigned int ulBufferSize) IWMCodecLeakyBucket::SetBufferSizeBits

Retrieves the current size of the buffer in bits.

Pointer to a variable containing the buffer size, in bits.

This method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The buffer size is equal to the bit rate of the stream multiplied by the buffer window. For example, a stream with a bit rate of 28 kilobits per second with a buffer window of 3 seconds would have a buffer of 28000 bits per second x 3 seconds = 84000 bits.

ff819232 HRESULT IWMCodecLeakyBucket::GetBufferSizeBits([In] unsigned int* pulBufferSize) IWMCodecLeakyBucket::GetBufferSizeBits

Not implemented in this release.

This method always returns E_NOTIMPL.

ff819234 HRESULT IWMCodecLeakyBucket::SetBufferFullnessBits([In] unsigned int ulBufferFullness) IWMCodecLeakyBucket::SetBufferFullnessBits

Not implemented in this release.

This method always returns E_NOTIMPL.

ff819231 HRESULT IWMCodecLeakyBucket::GetBufferFullnessBits([In] unsigned int* pulBufferFullness) IWMCodecLeakyBucket::GetBufferFullnessBits

Gets the time stamp of the next video frame to be decoded.

This interface is implemented by the video decoders. You can obtain a reference to by calling the QueryInterface method of any other interface of the decoder object, such as or .

ff819237 IWMCodecOutputTimestamp IWMCodecOutputTimestamp
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Queries the decoder for the time stamp of the upcoming output sample. Use this method if you need to know the time of the sample before calling or to get the sample.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is important when decoding video using frame interpolation, because the rendering application cannot predict the time stamps of interpolated frames.

ff819236 HRESULT IWMCodecOutputTimestamp::GetNextOutputTime([In] longlong* prtTime) IWMCodecOutputTimestamp::GetNextOutputTime

Gets the private codec data that must be appended to the output media type. This codec data is required for properly decoding Windows Media Video content.

This interface is implemented by the video encoder object and the screen capture encoder object. You do not need codec private data to decode content of the subtype WMCMEDIASUBTYPE_WMV1 (Windows Media Video version 7). For any other output type, you must obtain a reference to the encoder's interface by calling the QueryInterface method of any other interface on the object, such as or .

ff819239 IWMCodecPrivateData IWMCodecPrivateData
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gives the codec the output media type without the codec data. This enables the codec to generate the private data.

Address of the partial output media type.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The that you pass to this method is only partial in that it does not include the appended private data. It must be complete in all other ways.

If you are setting properties on an encoder, you must finish that configuration before getting the private data. Changing properties invalidates any private data previously retrieved. If you change properties after getting the private data, retrieve it again and reset the output type.

You must call this method before calling to get the private data.

ff819240 HRESULT IWMCodecPrivateData::SetPartialOutputType([In] DMO_MEDIA_TYPE* pmt) IWMCodecPrivateData::SetPartialOutputType

Retrieves the codec data for the video content based on the output type passed using the method.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If you are setting properties on the encoder object, you must finish that configuration before getting the private data. Changing properties invalidates any private data that was previously retrieved. If you change properties after getting the private data, retrieve it again and reset the output type.

You must call this method after providing the codec with the output media type (without the private data appended) by calling .

After retrieving the private data, allocate a buffer the size of plus pcbData. Then copy the data from your partial output type to the beginning of the buffer and append the private data.

ff819238 HRESULT IWMCodecPrivateData::GetPrivateData([In] unsigned char* pbData,[In] unsigned int* pcbData) IWMCodecPrivateData::GetPrivateData

Gives the codec the output media type without the codec data. This enables the codec to generate the private data.

The that you pass to this method is only partial in that it does not include the appended private data. It must be complete in all other ways.

If you are setting properties on an encoder, you must finish that configuration before getting the private data. Changing properties invalidates any private data previously retrieved. If you change properties after getting the private data, retrieve it again and reset the output type.

You must call this method before calling to get the private data.

ff819240 SetPartialOutputType SetPartialOutputType HRESULT IWMCodecPrivateData::SetPartialOutputType([In] DMO_MEDIA_TYPE* pmt)

Provides methods that retrieve format-specific codec properties.

This interface is implemented by the video encoder objects. You can obtain a reference to by calling the QueryInterface method of any other interface on the object, such as or .

This interface enables you to receive information about a specific media type that is supported by a video encoder.

ff819243 IWMCodecProps IWMCodecProps
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a format property for an output media type. Use this method to get information about enumerated audio formats.

Pointer to the output media type.

Wide-character, null-terminated string containing the property name. The properties listed in the following table are supported only through the interface.

Property name constantMeaning
g_wszSpeechFormatCaps

Retrieves the speech modes available for the format (used only by the Windows Media Audio 9 Voice codec). Value contains flags identical to the values used to specify the mode for MFPKEY_WMAVOICE_ENC_MusicSpeechClassMode.

?

The properties in the following list are also supported. They are used with for video.

  • MFPKEY_VBRENABLED
  • MFPKEY_VBRQUALITY

Address of a variable that receives the data type of the property value.

Address of the byte buffer that receives the property value.

Pointer to the size of the value buffer, in bytes. If pValue is null, the method will set this value to the size required.

If this method succeeds, it returns . Otherwise, it returns an error code.

ff819242 HRESULT IWMCodecProps::GetFormatProp([In] DMO_MEDIA_TYPE* pmt,[In] const wchar_t* pszName,[In] WMT_PROP_DATATYPE* pType,[In] unsigned char* pValue,[In] unsigned int* pdwSize) IWMCodecProps::GetFormatProp

Retrieves a codec property specific to an output format.

The output format to which the property applies. Set this value to the FOURCC value of the desired video format.

Wide-character, null-terminated string containing the property name. The properties listed in the following table are supported only through the interface.

Property name constantMeaning
g_wszWMCPCodecName

Retrieves the name of the codec that is associated with the format (or FOURCC). This is an alternative to the interface.

g_wszWMCPSupportedVBRModes

Retrieves the encoding modes supported by the codec. The value returned contains one or more of the following flags:

  • WM_CODEC_ONEPASS_CBR
  • WM_CODEC_ONEPASS_VBR
  • WM_CODEC_TWOPASS_CBR
  • WM_CODEC_TWOPASS_VBR_UNCONSTRAINED
  • WM_CODEC_TWOPASS_VBR_PEAKCONSTRAINED

?

Address of a variable that receives the data type of the property value.

Address of the byte buffer that receives the property value.

Pointer to the size of the value buffer, in bytes. If pValue is null, the method will set this value to the size required.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819241 HRESULT IWMCodecProps::GetCodecProp([In] unsigned int dwFormat,[In] const wchar_t* pszName,[In] WMT_PROP_DATATYPE* pType,[In] unsigned char* pValue,[In] unsigned int* pdwSize) IWMCodecProps::GetCodecProp

Retrieves names and descriptive strings for codecs and formats.

This interface is implemented by all of the codec encoder objects. You can retrieve a reference to the interface for any encoder by calling the QueryInterface method of any other interface on the object, such as or , This interface is not implemented on any of the decoder DMOs.

ff819246 IWMCodecStrings IWMCodecStrings
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the name of a codec.

Pointer to the output media type. If null, the codec will use the media type that is currently set.

Size of szName buffer in wide characters.

Address of the wide-character buffer that receives the name. If null, pcchLength receives the required length.

Pointer to the required buffer length in wide characters, including the null terminating character.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819245 HRESULT IWMCodecStrings::GetName([In] DMO_MEDIA_TYPE* pmt,[In] unsigned int cchLength,[Out, Buffer, Optional] wchar_t* szName,[In] unsigned int* pcchLength) IWMCodecStrings::GetName

Retrieves the description of an output format.

Pointer to the output media type. If null, the codec will use the media type that is currently set.

Size of szDescription buffer, in wide characters.

Address of the wide-character buffer that receives the description. If null, pcchLength receives the required length.

Pointer to the required buffer length in wide characters, including the null terminating character.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819244 HRESULT IWMCodecStrings::GetDescription([In] DMO_MEDIA_TYPE* pmt,[In] unsigned int cchLength,[Out, Buffer, Optional] wchar_t* szDescription,[In] unsigned int* pcchLength) IWMCodecStrings::GetDescription

Sets properties on the color converter DSP.

ff819247 IWMColorConvProps IWMColorConvProps
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Specifies whether the input video stream is interlaced.

Specifies one of the following values.

ValueMeaning
0

Progressive video

2

Interlaced video

?

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

By default, the color converter uses the input media type to determine whether the video is interlaced. You can call this method to override the media type setting.

This method is equivalent to setting the MFPKEY_COLORCONV_MODE property.

ff819249 HRESULT IWMColorConvProps::SetMode([In] int lMode) IWMColorConvProps::SetMode

Sets the source and destination rectangles.

Specifies the left edge of the source rectangle, in pixels.

Specifies the top edge of the source rectangle, in pixels.

Specifies the left edge of the destination rectangle, in pixels.

Specifies the top edge of the destination rectangle, in pixels.

Specifies the width of the source and destination rectangles, in pixels.

Specifies the height of the source and destination rectangles, in pixels.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

By default, the color converter copies the entire video frame. When you call this method, the color converter crops the video to the source rectangle and copies that portion to the destination rectangle.

This method is equivalent to setting the following properties:

  • MFPKEY_COLORCONV_SRCLEFT
  • MFPKEY_COLORCONV_SRCTOP
  • MFPKEY_COLORCONV_DSTLEFT
  • MFPKEY_COLORCONV_DSTTOP
  • MFPKEY_COLORCONV_WIDTH
  • MFPKEY_COLORCONV_HEIGHT
ff819248 HRESULT IWMColorConvProps::SetFullCroppingParam([In] int lSrcCropLeft,[In] int lSrcCropTop,[In] int lDstCropLeft,[In] int lDstCropTop,[In] int lCropWidth,[In] int lCropHeight) IWMColorConvProps::SetFullCroppingParam

Specifies whether the input video stream is interlaced.

By default, the color converter uses the input media type to determine whether the video is interlaced. You can call this method to override the media type setting.

This method is equivalent to setting the MFPKEY_COLORCONV_MODE property.

ff819249 SetMode SetMode HRESULT IWMColorConvProps::SetMode([In] int lMode)
No documentation. IWMColorLegalizerProps IWMColorLegalizerProps Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. HRESULT IWMColorLegalizerProps::SetColorLegalizerQuality([In] int lquality) IWMColorLegalizerProps::SetColorLegalizerQuality No documentation. SetColorLegalizerQuality SetColorLegalizerQuality HRESULT IWMColorLegalizerProps::SetColorLegalizerQuality([In] int lquality) No documentation. IFileClient IFileClient Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. HRESULT IFileClient::GetObjectDiskSize([In] unsigned longlong* pqwSize) IFileClient::GetObjectDiskSize No documentation. No documentation. No documentation. HRESULT IFileClient::Write([In] IFileIo* pFio) IFileClient::Write No documentation. No documentation. No documentation. HRESULT IFileClient::Read([In] IFileIo* pFio) IFileClient::Read No documentation. IFileIo IFileIo Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT IFileIo::Initialize([In] FILE_ACCESSMODE eAccessMode,[In] FILE_OPENMODE eOpenMode,[In] const wchar_t* pwszFileName) IFileIo::Initialize No documentation. No documentation. No documentation. HRESULT IFileIo::GetLength([In] unsigned longlong* pqwLength) IFileIo::GetLength No documentation. No documentation. No documentation. HRESULT IFileIo::SetLength([In] unsigned longlong qwLength) IFileIo::SetLength No documentation. No documentation. No documentation. HRESULT IFileIo::GetCurrentPosition([In] unsigned longlong* pqwPosition) IFileIo::GetCurrentPosition No documentation. No documentation. No documentation. HRESULT IFileIo::SetCurrentPosition([In] unsigned longlong qwPosition) IFileIo::SetCurrentPosition No documentation. No documentation. No documentation. HRESULT IFileIo::IsEndOfStream([In] BOOL* pbEndOfStream) IFileIo::IsEndOfStream

The following code examples show how to read text from a text file. The second example notifies you when the end of the file is detected. This functionality can also be achieved by using the ReadAllLines or ReadAllText methods.

Example Imports System Imports System.IO Class Test Public Shared Sub Main() Try ' Create an instance of StreamReader to read from a file. Using sr As StreamReader = New StreamReader("TestFile.txt") Dim line As String ' Read and display the lines from the file until the end ' of the file is reached. Do line = sr.ReadLine() Console.WriteLine(Line) Loop Until line Is Nothing sr.Close() End Using Catch E As Exception ' Let the user know what went wrong. Console.WriteLine("The file could not be read:") Console.WriteLine(E.Message) End Try End Sub End Class using System; using System.IO; class Test { public static void Main() { try { // Create an instance of StreamReader to read from a file. // The using statement also closes the StreamReader. using (StreamReader sr = new StreamReader("TestFile.txt")) { String line; // Read and display lines from the file until the end of // the file is reached. while ((line = sr.ReadLine()) != null) { Console.WriteLine(line); } } } catch (Exception e) { // Let the user know what went wrong. Console.WriteLine("The file could not be read:"); Console.WriteLine(e.Message); } } } Option Explicit On Option Strict On Imports System Imports System.IO Public Class TextFromFile Private Const FILE_NAME As String = "MyFile.txt" Public Shared Sub Main() If Not File.Exists(FILE_NAME) Then Console.WriteLine("{0} does not exist.", FILE_NAME) Return End If Using sr As StreamReader = File.OpenText(FILE_NAME) Dim input As String input = sr.ReadLine() While Not input Is Nothing Console.WriteLine(input) input = sr.ReadLine() End While Console.WriteLine("The end of the stream has been reached.") sr.Close() End Using End Sub End Class using System; using System.IO; public class TextFromFile { private const string FILE_NAME = "MyFile.txt"; public static void Main(String[] args) { if (!File.Exists(FILE_NAME)) { Console.WriteLine("{0} does not exist.", FILE_NAME); return; } using (StreamReader sr = File.OpenText(FILE_NAME)) { String input; while ((input=sr.ReadLine())!=null) { Console.WriteLine(input); } Console.WriteLine ("The end of the stream has been reached."); sr.Close(); } } Robust Programming

This code creates a StreamReader that points to MyFile.txt through a call to File.OpenText. StreamReader.ReadLine returns each line as a string. When there are no more characters to read, a message is displayed to that effect, and the stream is closed.

Note

Visual Basic users may choose to use the methods and properties provided by the My.Computer.FileSystem object for file I/O. For more information, see My.Computer.FileSystem Object.

See AlsoTasksHow to: Create a Directory ListingHow to: Read and Write to a Newly Created Data FileHow to: Open and Append to a Log FileHow to: Write Text to a FileHow to: Read Characters from a StringHow to: Write Characters to a StringReferenceStreamReaderFile.OpenTextStreamReader.ReadLineConceptsBasic File I/O
No documentation. No documentation. No documentation. No documentation. db5x7c0d HRESULT IFileIo::Read([In] unsigned char* pbt,[In] unsigned int ul,[In] unsigned int* pulRead) IFileIo::Read

The following code examples show how to write text to a text file.

The first example shows how to add text to an existing file. The second example shows how to create a new text file and write a string to it. Similar functionality can be provided by the WriteAllText methods.

Note

Visual Basic users may choose to use the methods and properties provided by the My.Computer.FileSystem object for file I/O. For more information, see My.Computer.FileSystem Object.

Example Imports System Imports System.IO Class Test Public Shared Sub Main() ' Create an instance of StreamWriter to write text to a file. Using sw As StreamWriter = New StreamWriter("TestFile.txt") ' Add some text to the file. sw.Write("This is the ") sw.WriteLine("header for the file.") sw.WriteLine("-------------------") ' Arbitrary objects can also be written to the file. sw.Write("The date is: ") sw.WriteLine(DateTime.Now) sw.Close() End Using End Sub End Class using System; using System.IO; class Test { public static void Main() { // Create an instance of StreamWriter to write text to a file. // The using statement also closes the StreamWriter. using (StreamWriter sw = new StreamWriter("TestFile.txt")) { // Add some text to the file. sw.Write("This is the "); sw.WriteLine("header for the file."); sw.WriteLine("-------------------"); // Arbitrary objects can also be written to the file. sw.Write("The date is: "); sw.WriteLine(DateTime.Now); } } } Option Explicit On Option Strict On Imports System Imports System.IO Public Class TextToFile Private Const FILE_NAME As String = "MyFile.txt" Public Shared Sub Main() If File.Exists(FILE_NAME) Then Console.WriteLine("{0} already exists.", FILE_NAME) Return End If Using sw As StreamWriter = File.CreateText(FILE_NAME) sw.WriteLine("This is my file.") sw.WriteLine("I can write ints {0} or floats {1}, and so on.", 1, 4.2) sw.Close() End Using End Sub End Class using System; using System.IO; public class TextToFile { private const string FILE_NAME = "MyFile.txt"; public static void Main(String[] args) { if (File.Exists(FILE_NAME)) { Console.WriteLine("{0} already exists.", FILE_NAME); return; } using (StreamWriter sw = File.CreateText(FILE_NAME)) { sw.WriteLine ("This is my file."); sw.WriteLine ("I can write ints {0} or floats {1}, and so on.", 1, 4.2); sw.Close(); } } } See AlsoTasksHow to: Create a Directory ListingHow to: Read and Write to a Newly Created Data FileHow to: Open and Append to a Log FileHow to: Read Text from a FileHow to: Read Characters from a StringHow to: Write Characters to a StringReferenceStreamWriterFile.CreateTextConceptsBasic File I/O
No documentation. No documentation. No documentation. No documentation. 6ka1wd3w HRESULT IFileIo::Write([In] unsigned char* pbt,[In] unsigned int ul,[In] unsigned int* pulWritten) IFileIo::Write
Sets the current position of this stream to the given value.

Namespace: System.IOAssembly: mscorlib (in mscorlib.dll)Public Overrides Function Seek ( _ offset As Long, _ origin As SeekOrigin _ ) As LongDim instance As FileStream Dim offset As Long Dim origin As SeekOrigin Dim returnValue As Long returnValue = instance.Seek(offset, origin)public override long Seek ( long offset, SeekOrigin origin )public: virtual long long Seek ( long long offset, SeekOrigin origin ) overridepublic long Seek ( long offset, SeekOrigin origin )public override function Seek ( offset : long, origin : SeekOrigin ) : longNot applicable.

Parameters
offset

The point relative to origin from which to begin seeking.

origin

Specifies the beginning, the end, or the current position as a reference point for origin, using a value of type SeekOrigin.

Return Value The new position in the stream.
Exception typeCondition

IOException

An I/O error occurs.

NotSupportedException

The stream does not support seeking, such as if the FileStream is constructed from a pipe or console output.

ArgumentException

Attempted seeking before the beginning of the stream.

ObjectDisposedException

Methods were called after the stream was closed.

This method overrides Seek.

Note:

Use the CanSeek property to determine whether the current instance supports seeking. For additional information, see CanSeek.

Seeking to any location beyond the length of the stream is supported. When you seek beyond the length of the file, the file size grows. In Microsoft Windows NT and greater, any data added to the end of the file is set to zero. In Microsoft Windows 98 or earlier, any data added to the end of the file is not set to zero, which means that previously deleted data is visible to the stream.

For a list of common I/O tasks, see Common I/O Tasks.

The following code example shows how to write data to a file, byte by byte, and then verify that the data was written correctly.

Imports Microsoft.VisualBasic Imports System Imports System.IO Imports System.Text Class FStream Shared Sub Main() Const fileName As String = "Test#@@#.dat" ' Create random data to write to the file. Dim dataArray(100000) As Byte Dim randomGenerator As New Random() randomGenerator.NextBytes(dataArray) Dim fileStream As FileStream = _ new FileStream(fileName, FileMode.Create) Try ' Write the data to the file, byte by byte. For i As Integer = 0 To dataArray.Length - 1 fileStream.WriteByte(dataArray(i)) Next i ' Set the stream position to the beginning of the stream. fileStream.Seek(0, SeekOrigin.Begin) ' Read and verify the data. For i As Integer = 0 To _ CType(fileStream.Length, Integer) - 1 If dataArray(i) <> fileStream.ReadByte() Then Console.WriteLine("Error writing data.") Return End If Next i Console.WriteLine("The data was written to {0} " & _ "and verified.", fileStream.Name) Finally fileStream.Close() End Try End Sub End Class using System; using System.IO; class FStream { static void Main() { const string fileName = "Test#@@#.dat"; // Create random data to write to the file. byte[] dataArray = new byte[100000]; new Random().NextBytes(dataArray); using(FileStream fileStream = new FileStream(fileName, FileMode.Create)) { // Write the data to the file, byte by byte. for(int i = 0; i < dataArray.Length; i++) { fileStream.WriteByte(dataArray[i]); } // Set the stream position to the beginning of the file. fileStream.Seek(0, SeekOrigin.Begin); // Read and verify the data. for(int i = 0; i < fileStream.Length; i++) { if(dataArray[i] != fileStream.ReadByte()) { Console.WriteLine("Error writing data."); return; } } Console.WriteLine("The data was written to {0} " + "and verified.", fileStream.Name); } } } using namespace System; using namespace System::IO; int main() { String^ fileName = "Test@##@.dat"; // Create random data to write to the file. array<Byte>^dataArray = gcnew array<Byte>(100000); (gcnew Random)->NextBytes( dataArray ); FileStream^ fileStream = gcnew FileStream( fileName,FileMode::Create ); try { // Write the data to the file, byte by byte. for ( int i = 0; i < dataArray->Length; i++ ) { fileStream->WriteByte( dataArray[ i ] ); } // Set the stream position to the beginning of the file. fileStream->Seek( 0, SeekOrigin::Begin ); // Read and verify the data. for ( int i = 0; i < fileStream->Length; i++ ) { if ( dataArray[ i ] != fileStream->ReadByte() ) { Console::WriteLine( "Error writing data." ); return -1; } } Console::WriteLine( "The data was written to {0} " "and verified.", fileStream->Name ); } finally { fileStream->Close(); } } import System.*; import System.IO.*; class FStream { public static void main(String[] args) { final String fileName = "Test#@@#.dat"; // Create random data to write to the file. ubyte dataArray[] = new ubyte[100000]; new Random().NextBytes(dataArray); FileStream fileStream = new FileStream(fileName, FileMode.Create); try { // Write the data to the file, byte by byte. for(int i=0;i < dataArray.length;i++) { fileStream.WriteByte(dataArray[i]); } // Set the stream position to the beginning of the file. fileStream.Seek(0, SeekOrigin.Begin); // Read and verify the data. for(int i=0;i < fileStream.get_Length();i++) { if ( dataArray[i] != fileStream.ReadByte() ) { Console.WriteLine("Error writing data."); return; } } Console.WriteLine("The data was written to {0} " + "and verified.", fileStream.get_Name()); } finally { fileStream.Dispose(); } } //main } //FStream

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1. .NET FrameworkSupported in: 3.0, 2.0, 1.1, 1.0.NET Compact FrameworkSupported in: 2.0, 1.0XNA FrameworkSupported in: 1.0ReferenceFileStream ClassFileStream MembersSystem.IO NamespaceOther ResourcesFile and Stream I/OReading Text from a FileWriting Text to a File

The point relative to origin from which to begin seeking.

No documentation. No documentation. No documentation. No documentation. system.io.filestream.seek HRESULT IFileIo::Seek([In] SEEK_ORIGIN eSeekOrigin,[In] unsigned longlong qwSeekOffset,[In] unsigned int dwSeekFlags,[In] unsigned longlong* pqwCurrentPosition) IFileIo::Seek
Provides static methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects.

Namespace: System.IOAssembly: mscorlib (in mscorlib.dll)<ComVisibleAttribute(True)> _ Public NotInheritable Class File[ComVisibleAttribute(true)] public static class File[ComVisibleAttribute(true)] public ref class File abstract sealed/** @attribute ComVisibleAttribute(true) */ public final class FileComVisibleAttribute(true) public final class FileNot applicable.

Use the File class for typical operations such as copying, moving, renaming, creating, opening, deleting, and appending to files. You can also use the File class to get and set file attributes or DateTime information related to the creation, access, and writing of a file.

Many of the File methods return other I/O types when you create or open files. You can use these other types to further manipulate a file. For more information, see specific File members such as OpenText, CreateText, or Create.

Because all File methods are static, it might be more efficient to use a File method rather than a corresponding FileInfo instance method if you want to perform only one action. All File methods require the path to the file that you are manipulating.

The static methods of the File class perform security checks on all methods. If you are going to reuse an object several times, consider using the corresponding instance method of FileInfo instead, because the security check will not always be necessary.

By default, full read/write access to new files is granted to all users.

The following table describes the enumerations that are used to customize the behavior of various File methods.

Enumeration

Description

FileAccess

Specifies read and write access to a file.

FileShare

Specifies the level of access permitted for a file that is already in use.

FileMode

Specifies whether the contents of an existing file are preserved or overwritten, and whether requests to create an existing file cause an exception.

Note:

In members that accept a path as an input string, that path must be well-formed or an exception is raised. For example, if a path is fully qualified but begins with a space, the path is not trimmed in methods of the class. Therefore, the path is malformed and an exception is raised. Similarly, a path or a combination of paths cannot be fully qualified twice. For example, "c:\temp c:\windows" also raises an exception in most cases. Ensure that your paths are well-formed when using methods that accept a path string.

In members that accept a path, the path can refer to a file or just a directory. The specified path can also refer to a relative path or a Universal Naming Convention (UNC) path for a server and share name. For example, all the following are acceptable paths:

  • "c:\\MyDir\\MyFile.txt" in C#, or "c:\MyDir\MyFile.txt" in Visual Basic.

  • "c:\\MyDir" in C#, or "c:\MyDir" in Visual Basic.

  • "MyDir\\MySubdir" in C#, or "MyDir\MySubDir" in Visual Basic.

  • "\\\\MyServer\\MyShare" in C#, or "\\MyServer\MyShare" in Visual Basic.

For a list of common I/O tasks, see Common I/O Tasks.

The following example demonstrates some of the main members of the File class.

Imports System Imports System.IO Public Class Test Public Shared Sub Main() Dim path As String = "c:\temp\MyTest.txt" If File.Exists(path) = False Then ' Create a file to write to. Dim sw As StreamWriter = File.CreateText(path) sw.WriteLine("Hello") sw.WriteLine("And") sw.WriteLine("Welcome") sw.Flush() sw.Close() End If Try ' Open the file to read from. Dim sr As StreamReader = File.OpenText(path) Do While sr.Peek() >= 0 Console.WriteLine(sr.ReadLine()) Loop sr.Close() Dim path2 As String = path + "temp" ' Ensure that the target does not exist. File.Delete(path2) ' Copy the file. File.Copy(path, path2) Console.WriteLine("{0} was copied to {1}.", path, path2) ' Delete the newly created file. File.Delete(path2) Console.WriteLine("{0} was successfully deleted.", path2) Catch e As Exception Console.WriteLine("The process failed: {0}", e.ToString()) End Try End Sub End Class using System; using System.IO; class Test { public static void Main() { string path = @"c:\temp\MyTest.txt"; if (!File.Exists(path)) { // Create a file to write to. using (StreamWriter sw = File.CreateText(path)) { sw.WriteLine("Hello"); sw.WriteLine("And"); sw.WriteLine("Welcome"); } } // Open the file to read from. using (StreamReader sr = File.OpenText(path)) { string s = ""; while ((s = sr.ReadLine()) != null) { Console.WriteLine(s); } } try { string path2 = path + "temp"; // Ensure that the target does not exist. File.Delete(path2); // Copy the file. File.Copy(path, path2); Console.WriteLine("{0} was copied to {1}.", path, path2); // Delete the newly created file. File.Delete(path2); Console.WriteLine("{0} was successfully deleted.", path2); } catch (Exception e) { Console.WriteLine("The process failed: {0}", e.ToString()); } } } using namespace System; using namespace System::IO; int main() { String^ path = "c:\\temp\\MyTest.txt"; if ( !File::Exists( path ) ) { // Create a file to write to. StreamWriter^ sw = File::CreateText( path ); try { sw->WriteLine( "Hello" ); sw->WriteLine( "And" ); sw->WriteLine( "Welcome" ); } finally { if ( sw ) delete (IDisposable^)(sw); } } // Open the file to read from. StreamReader^ sr = File::OpenText( path ); try { String^ s = ""; while ( s = sr->ReadLine() ) { Console::WriteLine( s ); } } finally { if ( sr ) delete (IDisposable^)(sr); } try { String^ path2 = String::Concat( path, "temp" ); // Ensure that the target does not exist. File::Delete( path2 ); // Copy the file. File::Copy( path, path2 ); Console::WriteLine( "{0} was copied to {1}.", path, path2 ); // Delete the newly created file. File::Delete( path2 ); Console::WriteLine( "{0} was successfully deleted.", path2 ); } catch ( Exception^ e ) { Console::WriteLine( "The process failed: {0}", e ); } } import System.*; import System.IO.*; class Test { public static void main(String[] args) { String path = "c:\\temp\\MyTest.txt"; if (!(File.Exists(path))) { // Create a file to write to. StreamWriter sw = File.CreateText(path); try { sw.WriteLine("Hello"); sw.WriteLine("And"); sw.WriteLine("Welcome"); } finally { sw.Dispose(); } } // Open the file to read from. StreamReader sr = File.OpenText(path); try { String s = ""; while ((s = sr.ReadLine()) != null) { Console.WriteLine(s); } } finally { sr.Dispose(); } try { String path2 = path + "temp"; // Ensure that the target does not exist. File.Delete(path2); // Copy the file. File.Copy(path, path2); Console.WriteLine("{0} was copied to {1}.", path, path2); // Delete the newly created file. File.Delete(path2); Console.WriteLine("{0} was successfully deleted.", path2); } catch (System.Exception e) { Console.WriteLine("The process failed: {0}", e.ToString()); } } //main } //Test System.Object ??System.IO.FileAny public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1. .NET FrameworkSupported in: 3.0, 2.0, 1.1, 1.0.NET Compact FrameworkSupported in: 2.0, 1.0XNA FrameworkSupported in: 1.0ReferenceFile MembersSystem.IO NamespaceDriveInfoOther ResourcesFile and Stream I/OReading Text from a FileWriting Text to a FileBasic File I/OReading and Writing to a Newly Created Data File
No documentation. system.io.file HRESULT IFileIo::Close() IFileIo::Close
No documentation. SetLength SetLength HRESULT IFileIo::SetLength([In] unsigned longlong qwLength) No documentation. SetCurrentPosition SetCurrentPosition HRESULT IFileIo::SetCurrentPosition([In] unsigned longlong qwPosition) No documentation. IWMFrameInterpProps IWMFrameInterpProps Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. No documentation. HRESULT IWMFrameInterpProps::SetFrameRateIn([In] int lFrameRate,[In] int lScale) IWMFrameInterpProps::SetFrameRateIn No documentation. No documentation. No documentation. No documentation. HRESULT IWMFrameInterpProps::SetFrameRateOut([In] int lFrameRate,[In] int lScale) IWMFrameInterpProps::SetFrameRateOut No documentation. No documentation. No documentation. HRESULT IWMFrameInterpProps::SetFrameInterpEnabled([In] BOOL bFIEnabled) IWMFrameInterpProps::SetFrameInterpEnabled No documentation. No documentation. No documentation. HRESULT IWMFrameInterpProps::SetComplexityLevel([In] int iComplexity) IWMFrameInterpProps::SetComplexityLevel No documentation. SetFrameInterpEnabled SetFrameInterpEnabled HRESULT IWMFrameInterpProps::SetFrameInterpEnabled([In] BOOL bFIEnabled) No documentation. SetComplexityLevel SetComplexityLevel HRESULT IWMFrameInterpProps::SetComplexityLevel([In] int iComplexity) No documentation. IWMInterlaceProps IWMInterlaceProps Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. HRESULT IWMInterlaceProps::SetProcessType([In] int iProcessType) IWMInterlaceProps::SetProcessType No documentation. No documentation. No documentation. HRESULT IWMInterlaceProps::SetInitInverseTeleCinePattern([In] int iInitPattern) IWMInterlaceProps::SetInitInverseTeleCinePattern No documentation. No documentation. HRESULT IWMInterlaceProps::SetLastFrame() IWMInterlaceProps::SetLastFrame No documentation. SetProcessType SetProcessType HRESULT IWMInterlaceProps::SetProcessType([In] int iProcessType) No documentation. SetInitInverseTeleCinePattern SetInitInverseTeleCinePattern HRESULT IWMInterlaceProps::SetInitInverseTeleCinePattern([In] int iInitPattern)

Sets properties on the audio resampler DSP.

ff819250 IWMResamplerProps IWMResamplerProps
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Specifies the quality of the output.

Specifies the quality of the output. The valid range is 1 to 60, inclusive.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is equivalent to setting the MFPKEY_WMRESAMP_FILTERQUALITY property.

ff819251 HRESULT IWMResamplerProps::SetHalfFilterLength([In] int lhalfFilterLen) IWMResamplerProps::SetHalfFilterLength

Specifies the channel matrix.

Pointer to an array of floating-point values that represents a channel conversion matrix.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is equivalent to setting the MFPKEY_WMRESAMP_CHANNELMTX property, except that the matrix is represented differently:

  • Values are floating point.
  • The matrix is transposed.

To convert from the integer values given in the MFPKEY_WMRESAMP_CHANNELMTX property to floating-point values, use the following formula:

(float)pow(10.0,((double)Coeff)/(65536.0*20.0))

where Coeff is an integer coefficient.

ff819252 HRESULT IWMResamplerProps::SetUserChannelMtx([In] float* userChannelMtx) IWMResamplerProps::SetUserChannelMtx

Specifies the quality of the output.

This method is equivalent to setting the MFPKEY_WMRESAMP_FILTERQUALITY property.

ff819251 SetHalfFilterLength SetHalfFilterLength HRESULT IWMResamplerProps::SetHalfFilterLength([In] int lhalfFilterLen)

Specifies the channel matrix.

This method is equivalent to setting the MFPKEY_WMRESAMP_CHANNELMTX property, except that the matrix is represented differently:

  • Values are floating point.
  • The matrix is transposed.

To convert from the integer values given in the MFPKEY_WMRESAMP_CHANNELMTX property to floating-point values, use the following formula:

(float)pow(10.0,((double)Coeff)/(65536.0*20.0))

where Coeff is an integer coefficient.

ff819252 SetUserChannelMtx SetUserChannelMtx HRESULT IWMResamplerProps::SetUserChannelMtx([In] float* userChannelMtx)

Sets properties on the video resizer DSP.

ff819254 IWMResizerProps IWMResizerProps
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Specifies whether to use an algorithm that produces higher-quality video, or a faster algorithm.

Boolean value. If TRUE, the video resizer uses an algorithm that produces higher-quality video. If , the video resizer uses a faster algorithm.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is equivalent to setting the MFPKEY_RESIZE_QUALITY property.

ff819258 HRESULT IWMResizerProps::SetResizerQuality([In] int lquality) IWMResizerProps::SetResizerQuality

The SetInterlaceMode method specifies whether the input video stream is interlaced.

Boolean value. If TRUE, the video is interlaced. If , the video is progressive.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is equivalent to setting the MFPKEY_RESIZE_INTERLACE property.

ff819257 HRESULT IWMResizerProps::SetInterlaceMode([In] int lmode) IWMResizerProps::SetInterlaceMode

Sets the source rectangle.

Specifies the left edge of the source rectangle, in pixels.

Specifies the top edge of the source rectangle, in pixels.

Specifies the width of the source rectangle, in pixels.

Specifies the height of the source rectangle, in pixels.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

By default, the video resizer copies the entire video frame. When you call this method, the video resizer crops the video to the source rectangle and copies that portion to the output buffer.

This method is equivalent to setting the following properties:

  • MFPKEY_RESIZE_SRC_LEFT
  • MFPKEY_RESIZE_SRC_TOP
  • MFPKEY_RESIZE_SRC_WIDTH
  • MFPKEY_RESIZE_SRC_HEIGHT
ff819255 HRESULT IWMResizerProps::SetClipRegion([In] int lClipOriXSrc,[In] int lClipOriYSrc,[In] int lClipWidthSrc,[In] int lClipHeightSrc) IWMResizerProps::SetClipRegion

Sets the source and destination rectangles.

Specifies the left edge of the source rectangle, in pixels.

Specifies the top edge of the source rectangle, in pixels.

Specifies the width of the source rectangle, in pixels.

Specifies the height of the source rectangle, in pixels.

Specifies the left edge of the destination rectangle, in pixels.

Specifies the top edge of the destination rectangle, in pixels.

Specifies the width of the destination rectangle, in pixels.

Specifies the height of the destination rectangle, in pixels.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

By default, the video resizer copies the entire video frame. When you call this method, the video resizer crops the video to the source rectangle and copies that portion to the destination rectangle.

This method is equivalent to setting the following properties:

  • MFPKEY_RESIZE_SRC_LEFT
  • MFPKEY_RESIZE_SRC_TOP
  • MFPKEY_RESIZE_SRC_WIDTH
  • MFPKEY_RESIZE_SRC_HEIGHT
  • MFPKEY_RESIZE_DST_LEFT
  • MFPKEY_RESIZE_DST_TOP
  • MFPKEY_RESIZE_DST_WIDTH
  • MFPKEY_RESIZE_DST_HEIGHT
ff819256 HRESULT IWMResizerProps::SetFullCropRegion([In] int lClipOriXSrc,[In] int lClipOriYSrc,[In] int lClipWidthSrc,[In] int lClipHeightSrc,[In] int lClipOriXDst,[In] int lClipOriYDst,[In] int lClipWidthDst,[In] int lClipHeightDst) IWMResizerProps::SetFullCropRegion

Retrieves the source and destination rectangles.

Receives the left edge of the source rectangle, in pixels.

Receives the top edge of the source rectangle, in pixels.

Receives the width of the source rectangle, in pixels.

Receives the height of the source rectangle, in pixels.

Receives the left edge of the destination rectangle, in pixels.

Receives the top edge of the destination rectangle, in pixels.

Receives the width of the destination rectangle, in pixels.

Receives the height of the destination rectangle, in pixels.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819253 HRESULT IWMResizerProps::GetFullCropRegion([In] int* lClipOriXSrc,[In] int* lClipOriYSrc,[In] int* lClipWidthSrc,[In] int* lClipHeightSrc,[In] int* lClipOriXDst,[In] int* lClipOriYDst,[In] int* lClipWidthDst,[In] int* lClipHeightDst) IWMResizerProps::GetFullCropRegion

Specifies whether to use an algorithm that produces higher-quality video, or a faster algorithm.

This method is equivalent to setting the MFPKEY_RESIZE_QUALITY property.

ff819258 SetResizerQuality SetResizerQuality HRESULT IWMResizerProps::SetResizerQuality([In] int lquality)

The SetInterlaceMode method specifies whether the input video stream is interlaced.

This method is equivalent to setting the MFPKEY_RESIZE_INTERLACE property.

ff819257 SetInterlaceMode SetInterlaceMode HRESULT IWMResizerProps::SetInterlaceMode([In] int lmode)

Configures codec support for sample extensions.

ff819259 IWMSampleExtensionSupport IWMSampleExtensionSupport
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Configures whether the codec supports sample extensions.

Flag, true indicating to use extensions.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819260 HRESULT IWMSampleExtensionSupport::SetUseSampleExtensions([In] BOOL fUseExtensions) IWMSampleExtensionSupport::SetUseSampleExtensions

Configures whether the codec supports sample extensions.

ff819260 SetUseSampleExtensions SetUseSampleExtensions HRESULT IWMSampleExtensionSupport::SetUseSampleExtensions([In] BOOL fUseExtensions)

The interface represents an individual table of contents. It provides methods for adding entries to, and removing entries from the table of contents.

ff819187 IToc IToc
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The SetDescriptor method associates a descriptor with the table of contents.

Pointer to a structure that contains the descriptor.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819230 HRESULT IToc::SetDescriptor([In] TOC_DESCRIPTOR* pDescriptor) IToc::SetDescriptor

The GetDescriptor method retrieves the descriptor, previously set by SetDescriptor, of the table of contents.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819224 HRESULT IToc::GetDescriptor([In] TOC_DESCRIPTOR* pDescriptor) IToc::GetDescriptor

The SetDescription method associates a description with the table of contents.

Pointer to a null-terminated, wide-character string that contains the description.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You can use this method to associate any description with the table of contents. TOC parser does not inspect or interpret the description.

ff819229 HRESULT IToc::SetDescription([In] const wchar_t* pwszDescription) IToc::SetDescription

The GetDescription method retrieves the description, set by a previous call to SetDescription, of the table of contents.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The method returns this error code if pwszDescription is not null and the description, including its null terminator, is larger than the size specified by pwDescriptionSize. In that case, pwDescriptionSize serves as an output parameter and receives the size of the required buffer.

?

ff819223 HRESULT IToc::GetDescription([In] unsigned short* pwDescriptionSize,[Out, Buffer, Optional] wchar_t* pwszDescription) IToc::GetDescription

The SetContext method associates a caller-supplied context block with the table of contents.

The size, in bytes, of the context block.

Pointer to the first byte of the context block.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You can use this method to associate any information with the table of contents. The type of information you store in the context block is completely up to you. TOC Parser does not inspect or interpret the context block.

ff819228 HRESULT IToc::SetContext([In] unsigned int dwContextSize,[In] unsigned char* pbtContext) IToc::SetContext

The GetContext method retrieves a block of bytes that was previously associated with the table of contents by a call to SetContext.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The method returns this error code if pbtContext is not null and the context block is larger than the size specified by bdwContextSize. In that case, pdwContextSize serves as an output parameter and receives the size, in bytes, of the required buffer.

?

ff819221 HRESULT IToc::GetContext([In] unsigned int* pdwContextSize,[In] unsigned char* pbtContext) IToc::GetContext

The GetEntryListCount method retrieves the number of entry lists in the table of contents.

Pointer to a WORD that receives the number of entry lists.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819226 HRESULT IToc::GetEntryListCount([In] unsigned short* pwCount) IToc::GetEntryListCount

The GetEntryListByIndex method retrieves an entry list, specified by an index, from the table of contents.

The index of the entry list to retrieve.

Pointer to a variable that receives a reference to an interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819225 HRESULT IToc::GetEntryListByIndex([In] unsigned short wEntryListIndex,[In] ITocEntryList** ppEntryList) IToc::GetEntryListByIndex

The AddEntryList method adds an entry list to the table of contents and assigns an index to the entry list.

Pointer to an interface that represents the entry list to be added.

Receives the index of the added entry list.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819219 HRESULT IToc::AddEntryList([In] ITocEntryList* pEntryList,[In] unsigned short* pwEntryListIndex) IToc::AddEntryList

The AddEntryListByIndex method adds an entry list to the table of contents and associates a caller-supplied index with the entry list.

The index, specified by the caller, to be associated with the entry list.

Pointer to an interface that represents the entry list to be added.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819220 HRESULT IToc::AddEntryListByIndex([In] unsigned short wEntryListIndex,[In] ITocEntryList* pEntryList) IToc::AddEntryListByIndex

The RemoveEntryListByIndex method removes an entry list, specified by an index, from the table of contents.

The index of the entry list to be removed.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819227 HRESULT IToc::RemoveEntryListByIndex([In] unsigned short wEntryListIndex) IToc::RemoveEntryListByIndex

The represents a collection of tables of contents. It provides methods for adding, retrieving, and removing, tables of contents from the collection.

ff819188 ITocCollection ITocCollection
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The GetEntryCount method retrieves the number of tables of contents in the collection.

Pointer to a DWORD that receives the number of tables of contents.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

In the context of an interface, the word entry refers to an indivdual table of contents. That meaning of the word entry is in contrast to its meaning in the context of other interfaces in the TOC Parser technology. For example, in the context of an interface, the word entry refers to a block of information, in a table of contents, that represents a section of a video file.

ff819192 HRESULT ITocCollection::GetEntryCount([In] unsigned int* pdwEntryCount) ITocCollection::GetEntryCount

The GetEntryByIndex method retrieves a table of contents, specified by an index, from the collection.

Specifies the index of the table of contents to retrieve.

Pointer to a variable that receives a reference to an interface that represents the table of contents.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

In the context of an interface, the word entry refers to an indivdual table of contents. That meaning of the word entry is in contrast to its meaning in the context of other interfaces in the TOC Parser technology. For example, in the context of an interface, the word entry refers to a block of information, in a table of contents, that represents a section of a video file.

ff819191 HRESULT ITocCollection::GetEntryByIndex([In] unsigned int dwEntryIndex,[In] IToc** ppToc) ITocCollection::GetEntryByIndex

The AddEntry method adds an individual table of contents to the collection and assigns an index to the added table of contents.

Pointer to an interface that represents the table of contents to be added.

Pointer to a DWORD that receives the index of the added table of contents.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

In the context of an interface, the word entry refers to an indivdual table of contents. That meaning of the word entry is in contrast to its meaning in the context of other interfaces in the TOC Parser technology. For example, in the context of an interface, the word entry refers to a block of information, in a table of contents, that represents a section of a video file.

ff819189 HRESULT ITocCollection::AddEntry([In] IToc* pToc,[In] unsigned int* pdwEntryIndex) ITocCollection::AddEntry

The AddEntryByIndex adds an individual table of contents to the collection and associates a caller-supplied index with the table of contents.

The index, specified by the caller, to be associated with the table of contents.

Pointer to an interface that represents the table of contents to be added.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

In the context of an interface, the word entry refers to an indivdual table of contents. That meaning of the word entry is in contrast to its meaning in the context of other interfaces in the TOC Parser technology. For example, in the context of an interface, the word entry refers to a block of information, in a table of contents, that represents a section of a video file.

ff819190 HRESULT ITocCollection::AddEntryByIndex([In] unsigned int dwEntryIndex,[In] IToc* pToc) ITocCollection::AddEntryByIndex

The RemoveEntryByIndex method removes a table of contents, specified by an index, from the collection.

Specifies the index of the table of contents to be removed.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

In the context of an interface, the word entry refers to an indivdual table of contents. That meaning of the word entry is in contrast to its meaning in the context of other interfaces in the TOC Parser technology. For example, in the context of an interface, the word entry refers to a block of information, in a table of contents, that represents a section of a video file.

ff819193 HRESULT ITocCollection::RemoveEntryByIndex([In] unsigned int dwEntryIndex) ITocCollection::RemoveEntryByIndex

The interface represents an individual entry in a table of contents. It provides methods for setting and retrieving descriptive information for the entry.

ff819194 ITocEntry ITocEntry
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The SetTitle method sets the title of the entry.

Pointer to a null-terminated wide-character string that contains the title.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819209 HRESULT ITocEntry::SetTitle([In] const wchar_t* pwszTitle) ITocEntry::SetTitle

The GetTitle method retrieves the title, set by a previous call to SetTitle, of the entry.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The method returns this error code if pwszTitle is not null and the title, including its null terminator, is larger than the size specified by pwTitleSize. In that case, pwTitleSize serves as an output parameter and receives the size of the required buffer.

?

ff819204 HRESULT ITocEntry::GetTitle([In] unsigned short* pwTitleSize,[Out, Buffer, Optional] wchar_t* pwszTitle) ITocEntry::GetTitle

The SetDescriptor method associates a descriptor with the entry.

Pointer to a structure that contains the descriptor.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819206 HRESULT ITocEntry::SetDescriptor([In] TOC_ENTRY_DESCRIPTOR* pDescriptor) ITocEntry::SetDescriptor

The GetDescriptor method retrieves the descriptor, previously set by a call to SetDescriptor, of the entry.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819202 HRESULT ITocEntry::GetDescriptor([In] TOC_ENTRY_DESCRIPTOR* pDescriptor) ITocEntry::GetDescriptor

The SetSubEntries identifies a set of entries as being subentries of this entry.

The number of indices in the array pointed to by pwSubEntryIndices.

Pointer to an array of WORDs. Each WORD in the array specifies the index of an entry that is to be considered a subentry of this entry.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819208 HRESULT ITocEntry::SetSubEntries([In] unsigned int dwNumSubEntries,[In] unsigned short* pwSubEntryIndices) ITocEntry::SetSubEntries

The GetSubEntries method gets an array of subentry indices that were set by a previous call to SetSubEntries.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The method returns this error code if pwSubEntryIndices is not null and the number of subentries is larger than the number specified by pdwNumSubEntries. In that case, pdwNumSubEntries serves as an output parameter and receives the number of available subentry indices.

?

ff819203 HRESULT ITocEntry::GetSubEntries([In] unsigned int* pdwNumSubEntries,[In] unsigned short* pwSubEntryIndices) ITocEntry::GetSubEntries

The SetDescriptionData method associates a caller-supplied data block with the entry.

The size, in bytes, of the data block.

Pointer to the first byte of the data block.

Pointer to a that identifies the type of data in the block. This parameter can be null. See Remarks.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You can use this method to associate any information of your choice with the entry. The nature of the information you store in the description data block is completely up to you. TOC Parser does not inspect or interpret the description data block.

You can associate only one description data block with a given entry at a given time. However, you might want to design different types of description data blocks and identfy each type of block with a globally unique identifier (). That way, you could associate description data of a certain type with some of your entries and description data of a different type with other entries. If you do not need to distinguish between different types of description data blocks, you can set pguidType to null.

ff819205 HRESULT ITocEntry::SetDescriptionData([In] unsigned int dwDescriptionDataSize,[In] unsigned char* pbtDescriptionData,[In] GUID* pguidType) ITocEntry::SetDescriptionData

The GetDescriptionData method gets a description data block that was previously associated with the entry by a call to SetDescriptionData.

No documentation. No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The method returns this error code if pbtDescriptionData is not null and the context block is larger than the size specified by pdwDescriptionDataSize. In that case, pdwDescriptionDataSize serves as an output parameter and receives the size, in bytes, of the required buffer.

?

You can associate only one description data block with a given entry at a given time. However, you might want to design different types of description data blocks and identfy each type of block with a globally unique identifier (). That way, when you call SetDescriptionData, you can mark the data block as being of a specific type. When you call GetDescriptionData, you can determine the type of the data block retrieved by inspecting the value returned in pGuidType.

ff819201 HRESULT ITocEntry::GetDescriptionData([In] unsigned int* pdwDescriptionDataSize,[In] unsigned char* pbtDescriptionData,[In] GUID* pGuidType) ITocEntry::GetDescriptionData

The interface represents a list of entries in a table of contents. It provides methods for adding entries to, and removing entries from the list.

ff819195 ITocEntryList ITocEntryList
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The GetEntryCount method retrieves the number of entries in the list.

Pointer to a DWORD that receives the number of entries.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819199 HRESULT ITocEntryList::GetEntryCount([In] unsigned int* pdwEntryCount) ITocEntryList::GetEntryCount

The GetEntryByIndex method retrieves an entry, specified by an index, from the list.

The index of the entry to retrieve.

Pointer to a variable that receives a reference to an interface that represents the entry.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819198 HRESULT ITocEntryList::GetEntryByIndex([In] unsigned int dwEntryIndex,[In] ITocEntry** ppEntry) ITocEntryList::GetEntryByIndex

The AddEntry method adds an individual entry to the list and assigns an index to the entry.

Pointer to an interface that represents the entry to be added.

Pointer to a DWORD that receives the index of the added entry.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819196 HRESULT ITocEntryList::AddEntry([In] ITocEntry* pEntry,[In] unsigned int* pdwEntryIndex) ITocEntryList::AddEntry

The AddEntryByIndex method adds an individual entry to the list and associates a caller-supplied index with the entry.

The index of the entry to be added.

Pointer to an interface that represents the entry to be added.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819197 HRESULT ITocEntryList::AddEntryByIndex([In] unsigned int dwEntryIndex,[In] ITocEntry* pEntry) ITocEntryList::AddEntryByIndex

The RemoveEntryByIndex method removes an entry, specified by an index, from the list.

The index of the entry to be removed.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819200 HRESULT ITocEntryList::RemoveEntryByIndex([In] unsigned int dwEntryIndex) ITocEntryList::RemoveEntryByIndex

The interface represents a TOC Parser object. It provides methods for storing tables of contents in a video file and retrieving tables of contents from a video file.

ff819210 ITocParser ITocParser
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The Init method initializes the TOC Parser object and associates it with a media file.

Pointer to a null-terminated wide-character string that specifies the path of the media file. See Remarks.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The path that you pass in pwszFileName must be a long Universal Naming Convention (UNC) file path. A long UNC file path begins with "\\?\". The following line of code shows how to set the path for the file c:\experiment\seattle.wmv.

pTocParser->Init(L"\\\\?\\c:\\experiment\\seattle.wmv");

ff819216 HRESULT ITocParser::Init([In] const wchar_t* pwszFileName) ITocParser::Init

The GetTocCount method retrieves the number of tables of contents, of a specified position type, in the TOC Parser object.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819215 HRESULT ITocParser::GetTocCount([In] TOC_POS_TYPE enumTocPosType,[In] unsigned int* pdwTocCount) ITocParser::GetTocCount

The GetTocByIndex method retrieves a table of contents, specified by an index, from the TOC Parser object.

A member of the enumeration that specifies the position type of the table of contents to be retrieved.

The index of the table of contents to be retrieved.

Pointer to a variable that receives a reference to an interface that represents the retrieved table of contents.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819213 HRESULT ITocParser::GetTocByIndex([In] TOC_POS_TYPE enumTocPosType,[In] unsigned int dwTocIndex,[In] IToc** ppToc) ITocParser::GetTocByIndex

The GetTocByType retrieves all tables of contents of a specified type from the TOC Parser object.

A member of the enumeration that specifies the position type of the table of contents to be retrieved.

A globally unique identifier () that specifies the type of table of contents to retrieve. See Remarks.

Pointer to an interface that represents the colleciton of retrieved tables of contents.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You might want to design several different type of tables of contents. In that case, you can distinguish between types by creating a that represents each type. You can identify a table of contents as a particular type by setting the guidType member of a structure and then passing the structure to .

ff819214 HRESULT ITocParser::GetTocByType([In] TOC_POS_TYPE enumTocPosType,[In] GUID guidTocType,[In] ITocCollection** ppTocs) ITocParser::GetTocByType

The AddToc method adds a table of contents to the TOC Parser object and assigns an index to the added table of contents.

A member of the enumeration that specifies the position type of the table of contents to be added.

Pointer to an interface that represents the table of contents to be added.

Pointer to a DWORD that receives the index of the added table of contents.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819211 HRESULT ITocParser::AddToc([In] TOC_POS_TYPE enumTocPosType,[In] IToc* pToc,[In] unsigned int* pdwTocIndex) ITocParser::AddToc

The RemoveTocByIndex method removes a table of contents, specified by an index, from the TOC Parser object.

A member of the enumeration that specifies the position type of the table of contents to be removed.

The index of the table of contents to be removed.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819217 HRESULT ITocParser::RemoveTocByIndex([In] TOC_POS_TYPE enumTocPosType,[In] unsigned int dwTocIndex) ITocParser::RemoveTocByIndex

The RemoveTocByType method removes all tables of contents of a specified type from the TOC Parser object.

A member of the enumeration that specifies the position type of the tables of contents to be removed.

A globally unique identifier () that specifies the type of table of contents to removed. See Remarks.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You might want to design several different type of tables of contents. In that case, you can distinguish between types by creating a that represents each type. You can identify a table of contents as a particular type by setting the guidType member of a structure and then passing the structure to .

ff819218 HRESULT ITocParser::RemoveTocByType([In] TOC_POS_TYPE enumTocPosType,[In] GUID guidTocType) ITocParser::RemoveTocByType

The Commit method stores the current state of the TOC Parser object in its associated media file.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You can associate a TOC Parser object with a media file by calling . As you add, modify, or remove tables of contents from the TOC Parser object, those chages are made only to the TOC Parser object in memory, not to the media file. To store your changes in the media file, you must call .

ff819212 HRESULT ITocParser::Commit() ITocParser::Commit
Invalidates the entire surface of the control and causes the control to be redrawn.

Namespace: System.Windows.FormsAssembly: System.Windows.Forms (in system.windows.forms.dll)Public Sub InvalidateDim instance As Control instance.Invalidatepublic void Invalidate ()public: void Invalidate ()public void Invalidate ()public function Invalidate ()Not applicable.

Calling the Invalidate method does not force a synchronous paint; to force a synchronous paint, call the Update method after calling the Invalidate method. When this method is called with no parameters, the entire client area is added to the update region.

The following code example enables the user to drag an image or image file onto the form, and have it be displayed at the point on it is dropped. The OnPaint method is overridden to repaint the image each time the form is painted; otherwise the image would only persist until the next repainting. The DragEnter event-handling method determines the type of data being dragged into the form and provides the appropriate feedback. The DragDrop event-handling method displays the image on the form, if an Image can be created from the data. Because the DragEventArgs.X and DragEventArgs.Y values are screen coordinates, the example uses the PointToClient method to convert them to client coordinates.

Private picture As Image Private pictureLocation As Point Public Sub New() ' Enable drag-and-drop operations. Me.AllowDrop = True End Sub Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) MyBase.OnPaint(e) ' If there is an image and it has a location, ' paint it when the Form is repainted. If (Me.picture IsNot Nothing) And _ Not (Me.pictureLocation.Equals(Point.Empty)) Then e.Graphics.DrawImage(Me.picture, Me.pictureLocation) End If End Sub Private Sub Form1_DragDrop(ByVal sender As Object, _ ByVal e As DragEventArgs) Handles MyBase.DragDrop ' Handle FileDrop data. If e.Data.GetDataPresent(DataFormats.FileDrop) Then ' Assign the file names to a string array, in ' case the user has selected multiple files. Dim files As String() = CType(e.Data.GetData(DataFormats.FileDrop), String()) Try ' Assign the first image to the 'picture' variable. Me.picture = Image.FromFile(files(0)) ' Set the picture location equal to the drop point. Me.pictureLocation = Me.PointToClient(New Point(e.X, e.Y)) Catch ex As Exception MessageBox.Show(ex.Message) Return End Try End If ' Handle Bitmap data. If e.Data.GetDataPresent(DataFormats.Bitmap) Then Try ' Create an Image and assign it to the picture variable. Me.picture = CType(e.Data.GetData(DataFormats.Bitmap), Image) ' Set the picture location equal to the drop point. Me.pictureLocation = Me.PointToClient(New Point(e.X, e.Y)) Catch ex As Exception MessageBox.Show(ex.Message) Return End Try End If ' Force the form to be redrawn with the image. Me.Invalidate() End Sub Private Sub Form1_DragEnter(ByVal sender As Object, _ ByVal e As DragEventArgs) Handles MyBase.DragEnter ' If the data is a file or a bitmap, display the copy cursor. If e.Data.GetDataPresent(DataFormats.Bitmap) _ Or e.Data.GetDataPresent(DataFormats.FileDrop) Then e.Effect = DragDropEffects.Copy Else e.Effect = DragDropEffects.None End If End Sub private Image picture; private Point pictureLocation; public Form1() { // Enable drag-and-drop operations and // add handlers for DragEnter and DragDrop. this.AllowDrop = true; this.DragDrop += new DragEventHandler(this.Form1_DragDrop); this.DragEnter += new DragEventHandler(this.Form1_DragEnter); } protected override void OnPaint(PaintEventArgs e) { // If there is an image and it has a location, // paint it when the Form is repainted. base.OnPaint(e); if(this.picture != null && this.pictureLocation != Point.Empty) { e.Graphics.DrawImage(this.picture, this.pictureLocation); } } private void Form1_DragDrop(object sender, DragEventArgs e) { // Handle FileDrop data. if(e.Data.GetDataPresent(DataFormats.FileDrop) ) { // Assign the file names to a string array, in // case the user has selected multiple files. string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); try { // Assign the first image to the picture variable. this.picture = Image.FromFile(files[0]); // Set the picture location equal to the drop point. this.pictureLocation = this.PointToClient(new Point(e.X, e.Y) ); } catch(Exception ex) { MessageBox.Show(ex.Message); return; } } // Handle Bitmap data. if(e.Data.GetDataPresent(DataFormats.Bitmap) ) { try { // Create an Image and assign it to the picture variable. this.picture = (Image)e.Data.GetData(DataFormats.Bitmap); // Set the picture location equal to the drop point. this.pictureLocation = this.PointToClient(new Point(e.X, e.Y) ); } catch(Exception ex) { MessageBox.Show(ex.Message); return; } } // Force the form to be redrawn with the image. this.Invalidate(); } private void Form1_DragEnter(object sender, DragEventArgs e) { // If the data is a file or a bitmap, display the copy cursor. if (e.Data.GetDataPresent(DataFormats.Bitmap) || e.Data.GetDataPresent(DataFormats.FileDrop) ) { e.Effect = DragDropEffects.Copy; } else { e.Effect = DragDropEffects.None; } } private: Image^ picture; Point pictureLocation; public: Form1() { // Enable drag-and-drop operations and // add handlers for DragEnter and DragDrop. this->AllowDrop = true; this->DragDrop += gcnew DragEventHandler( this, &Form1::Form1_DragDrop ); this->DragEnter += gcnew DragEventHandler( this, &Form1::Form1_DragEnter ); } protected: virtual void OnPaint( PaintEventArgs^ e ) override { // If there is an image and it has a location, // paint it when the Form is repainted. Form::OnPaint( e ); if ( this->picture != nullptr && this->pictureLocation != Point::Empty ) { e->Graphics->DrawImage( this->picture, this->pictureLocation ); } } private: void Form1_DragDrop( Object^ /*sender*/, DragEventArgs^ e ) { // Handle FileDrop data. if ( e->Data->GetDataPresent( DataFormats::FileDrop ) ) { // Assign the file names to a String* array, in // case the user has selected multiple files. array<String^>^files = (array<String^>^)e->Data->GetData( DataFormats::FileDrop ); try { // Assign the first image to the picture variable. this->picture = Image::FromFile( files[ 0 ] ); // Set the picture location equal to the drop point. this->pictureLocation = this->PointToClient( Point(e->X,e->Y) ); } catch ( Exception^ ex ) { MessageBox::Show( ex->Message ); return; } } // Handle Bitmap data. if ( e->Data->GetDataPresent( DataFormats::Bitmap ) ) { try { // Create an Image and assign it to the picture variable. this->picture = dynamic_cast<Image^>(e->Data->GetData( DataFormats::Bitmap )); // Set the picture location equal to the drop point. this->pictureLocation = this->PointToClient( Point(e->X,e->Y) ); } catch ( Exception^ ex ) { MessageBox::Show( ex->Message ); return; } } // Force the form to be redrawn with the image. this->Invalidate(); } void Form1_DragEnter( Object^ /*sender*/, DragEventArgs^ e ) { // If the data is a file or a bitmap, display the copy cursor. if ( e->Data->GetDataPresent( DataFormats::Bitmap ) || e->Data->GetDataPresent( DataFormats::FileDrop ) ) { e->Effect = DragDropEffects::Copy; } else { e->Effect = DragDropEffects::None; } } private Image picture; private Point pictureLocation; public Form1() { // Enable drag-and-drop operations and // add handlers for DragEnter and DragDrop. this.set_AllowDrop(true); this.add_DragDrop(new DragEventHandler(this.Form1_DragDrop)); this.add_DragEnter(new DragEventHandler(this.Form1_DragEnter)); } //Form1 protected void OnPaint(PaintEventArgs e) { // If there is an image and it has a location, // paint it when the Form is repainted. super.OnPaint(e); if (this.picture != null && !this.pictureLocation.Equals(Point.Empty)) { e.get_Graphics().DrawImage(this.picture, this.pictureLocation); } } //OnPaint private void Form1_DragDrop(Object sender, DragEventArgs e) { // Handle FileDrop data. if (e.get_Data().GetDataPresent(DataFormats.FileDrop)) { // Assign the file names to a string array, in // case the user has selected multiple files. String files[] = (String[])(e.get_Data().GetData( DataFormats.FileDrop)); try { // Assign the first image to the picture variable. this.picture = Image.FromFile(files.toString()); // Set the picture location equal to the drop point. this.pictureLocation = this.PointToClient(new Point(e.get_X(), e.get_Y())); } catch (System.Exception ex) { MessageBox.Show(ex.get_Message()); return; } } // Handle Bitmap data. if (e.get_Data().GetDataPresent(DataFormats.Bitmap)) { try { // Create an Image and assign it to the picture variable. this.picture = (Image)e.get_Data().GetData(DataFormats.Bitmap); // Set the picture location equal to the drop point. this.pictureLocation = this.PointToClient(new Point(e.get_X(), e.get_Y())); } catch (System.Exception ex) { MessageBox.Show(ex.get_Message()); return; } } // Force the form to be redrawn with the image. this.Invalidate(); } //Form1_DragDrop private void Form1_DragEnter(Object sender, DragEventArgs e) { // If the data is a file or a bitmap, display the copy cursor. if (e.get_Data().GetDataPresent(DataFormats.Bitmap) || e.get_Data(). GetDataPresent(DataFormats.FileDrop)) { e.set_Effect(DragDropEffects.Copy); } else { e.set_Effect(DragDropEffects.None); } } //Form1_DragEnter

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1. .NET FrameworkSupported in: 3.0, 2.0, 1.1, 1.0.NET Compact FrameworkSupported in: 2.0, 1.0ReferenceControl ClassControl MembersSystem.Windows.Forms NamespaceRefreshUpdate
598t492a IWMValidate IWMValidate
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. HRESULT IWMValidate::SetIdentifier([In] GUID guidValidationID) IWMValidate::SetIdentifier No documentation. SetIdentifier SetIdentifier HRESULT IWMValidate::SetIdentifier([In] GUID guidValidationID) No documentation. IValidateBinding IValidateBinding Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT IValidateBinding::GetIdentifier([In] GUID guidLicensorID,[In, Buffer] unsigned char* pbEphemeron,[In] unsigned int cbEphemeron,[Out, Buffer, Optional] unsigned char** ppbBlobValidationID,[Out] unsigned int* pcbBlobSize) IValidateBinding::GetIdentifier

Controls the speed of the video decoder.

This interface is implemented by the video decoder objects. You can obtain a reference to by calling the QueryInterface method of any other interface of the decoder, such as or

ff819262 IWMVideoDecoderHurryup IWMVideoDecoderHurryup
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the speed mode of the video decoder.

The speed mode of the video decoder.

ValueMeaning
-1 (default)

The decoder will determine the decoding speed.

0

The decoder will decode in real time.

1 to 4

The decoder will decode faster than real time. The higher the value, the faster the decoding.

?

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819263 HRESULT IWMVideoDecoderHurryup::SetHurryup([In] int lHurryup) IWMVideoDecoderHurryup::SetHurryup

Retrieves the current speed mode of the video decoder.

Address of a variable that receives the decoder speed mode.

ValueMeaning
-1 (default)

The decoder will determine the decoding speed.

0

The decoder will decode in real time.

1 to 4

The decoder will decode faster than real time.

?

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819261 HRESULT IWMVideoDecoderHurryup::GetHurryup([In] int* plHurryup) IWMVideoDecoderHurryup::GetHurryup

Note??This interface is obsolete and should not be used.

Manages reconstructed video frames.

ff819266 IWMVideoDecoderReconBuffer IWMVideoDecoderReconBuffer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Note??This method is obsolete and should not be used.

Retrieves the size of the current reconstructed video frame.

Address of a variable that receives the frame size in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819265 HRESULT IWMVideoDecoderReconBuffer::GetReconstructedVideoFrameSize([In] unsigned int* pdwSize) IWMVideoDecoderReconBuffer::GetReconstructedVideoFrameSize

Note??This method is obsolete and should not be used.

Retrieves the current reconstructed video frame.

Address of a media buffer that receives the reconstructed video frame.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819264 HRESULT IWMVideoDecoderReconBuffer::GetReconstructedVideoFrame([In] IMediaBuffer* pBuf) IWMVideoDecoderReconBuffer::GetReconstructedVideoFrame

Note??This method is obsolete and should not be used.

Restores the current reconstructed video frame.

Address of an interface containing the reconstructed frame to restore.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ff819267 HRESULT IWMVideoDecoderReconBuffer::SetReconstructedVideoFrame([In] IMediaBuffer* pBuf) IWMVideoDecoderReconBuffer::SetReconstructedVideoFrame

Note??This method is obsolete and should not be used.

Restores the current reconstructed video frame.

ff819267 SetReconstructedVideoFrame SetReconstructedVideoFrame HRESULT IWMVideoDecoderReconBuffer::SetReconstructedVideoFrame([In] IMediaBuffer* pBuf)

Forces the encoder to encode the current frame as a key frame.

ff819268 IWMVideoForceKeyFrame IWMVideoForceKeyFrame
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Specifies that the current frame will be encoded as a key frame.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To force the encoder to make the current frame a key frame, call this method before calling or .

Each call to this method applies to a single frame. After processing this frame, the encoder resumes automatically assigning key frames (bounded by the maximum key frame distance).

ff819269 HRESULT IWMVideoForceKeyFrame::SetKeyFrame() IWMVideoForceKeyFrame::SetKeyFrame

Contains quality metrics for acoustic echo cancellation (AEC). This structure is used with the MFPKEY_WMAAECMA_RETRIEVE_TS_STATS property.

ff819067 AecQualityMetrics_Struct AecQualityMetrics_Struct
No documentation. ff819067 longlong i64Timestamp longlong i64Timestamp No documentation. ff819067 unsigned char ConvergenceFlag unsigned char ConvergenceFlag No documentation. ff819067 unsigned char MicClippedFlag unsigned char MicClippedFlag No documentation. ff819067 unsigned char MicSilenceFlag unsigned char MicSilenceFlag No documentation. ff819067 unsigned char PstvFeadbackFlag unsigned char PstvFeadbackFlag No documentation. ff819067 unsigned char SpkClippedFlag unsigned char SpkClippedFlag No documentation. ff819067 unsigned char SpkMuteFlag unsigned char SpkMuteFlag No documentation. ff819067 unsigned char GlitchFlag unsigned char GlitchFlag No documentation. ff819067 unsigned char DoubleTalkFlag unsigned char DoubleTalkFlag No documentation. ff819067 unsigned int uGlitchCount unsigned int uGlitchCount No documentation. ff819067 unsigned int uMicClipCount unsigned int uMicClipCount No documentation. ff819067 float fDuration float fDuration No documentation. ff819067 float fTSVariance float fTSVariance No documentation. ff819067 float fTSDriftRate float fTSDriftRate No documentation. ff819067 float fVoiceLevel float fVoiceLevel No documentation. ff819067 float fNoiseLevel float fNoiseLevel No documentation. ff819067 float fERLE float fERLE No documentation. ff819067 float fAvgERLE float fAvgERLE No documentation. ff819067 unsigned int dwReserved unsigned int dwReserved

The structure holds descriptive information for a table of contents.

You might want to design several different type of tables of contents. In that case, you can distinguish between types by creating a that represents each type. You can identify a table of contents as a particular type by setting the guidType member of a structure and then passing the structure to .

ff819464 TOC_DESCRIPTOR TOC_DESCRIPTOR

A globally unique identifier () that identifies an individual table of contents. This identifier has meaning only to the you, the developer. TOC Parser does not inspect or interpret this identifier.

ff819464 GUID guidID GUID guidID

Not used.

ff819464 unsigned short wStreamNumber unsigned short wStreamNumber

A globally unique identifier () that identifies a table of contents as belonging to a particular type. This identifier has meaning only to you, the developer. TOC Parser does not inspect or interpret this identifier. See Remarks.

ff819464 GUID guidType GUID guidType

An integer that identifies the language of a table of contents. This index has meaning only to you, the developer. TOC Parser does not inspect or interpret this index.

ff819464 unsigned short wLanguageIndex unsigned short wLanguageIndex

The structure holds descriptive information for an entry in a table of contents. An entry in a table of contents describes a portion of a media file. For example, an entry might describe a ten-second chunk of video that starts 90 seconds after the beginning of a video file.

ff819465 TOC_ENTRY_DESCRIPTOR TOC_ENTRY_DESCRIPTOR

The start time, in 100-nanosecond units, of the portion of a media file represented by an entry in a table of contents.

ff819465 unsigned longlong qwStartTime unsigned longlong qwStartTime

The end time, in 100-nanosecond units, of the portion of a media file represented by an entry in a table of contents.

ff819465 unsigned longlong qwEndTime unsigned longlong qwEndTime

Not used.

ff819465 unsigned longlong qwStartPacketOffset unsigned longlong qwStartPacketOffset

Not used.

ff819465 unsigned longlong qwEndPacketOffset unsigned longlong qwEndPacketOffset

The presentation time, in 100-nanosecond units, of a frame that is a good representation of the entry. This frame could be used for a thumbnail image that represents the entry.

ff819465 unsigned longlong qwRepresentativeFrameTime unsigned longlong qwRepresentativeFrameTime

Specifies how the output alpha values are calculated for Microsoft DirectX Video Acceleration High Definition (DXVA-HD) blit operations.

The Mode member of the structure has this enumeration type. That member specifies the alpha-fill mode for the input stream identified by the StreamNumber member of the same structure. To set the alpha-fill mode, call .

To find out which modes the device supports, call the method. If the device sets the flag in the FeatureCaps member of the structure, the DXVA-HD device supports any of the modes listed here. Otherwise, the alpha-fill mode must be .

dd318388 DXVAHD_ALPHA_FILL_MODE DXVAHD_ALPHA_FILL_MODE

Alpha values inside the target rectangle are set to opaque.

dd318388 DXVAHD_ALPHA_FILL_MODE_OPAQUE DXVAHD_ALPHA_FILL_MODE_OPAQUE

Alpha values inside the target rectangle are set to the alpha value specified in the background color. See .

dd318388 DXVAHD_ALPHA_FILL_MODE_BACKGROUND DXVAHD_ALPHA_FILL_MODE_BACKGROUND

Existing alpha values remain unchanged in the output surface.

dd318388 DXVAHD_ALPHA_FILL_MODE_DESTINATION DXVAHD_ALPHA_FILL_MODE_DESTINATION

Alpha values from the input stream are scaled and copied to the corresponding destination rectangle for that stream. If the input stream does not have alpha data, the DXVA-HD device sets the alpha values in the target rectangle to an opaque value. If the input stream is disabled or the source rectangle is empty, the alpha values in the target rectangle are not modified.

dd318388 DXVAHD_ALPHA_FILL_MODE_SOURCE_STREAM DXVAHD_ALPHA_FILL_MODE_SOURCE_STREAM

Specifies state parameters for blit operations when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

To set a state parameter, call the method. This method takes a value and a byte array as input. The byte array contains state data, the structure of which is defined by the value.

dd318389 DXVAHD_BLT_STATE DXVAHD_BLT_STATE
No documentation. dd318389 DXVAHD_BLT_STATE_TARGET_RECT DXVAHD_BLT_STATE_TARGET_RECT No documentation. dd318389 DXVAHD_BLT_STATE_BACKGROUND_COLOR DXVAHD_BLT_STATE_BACKGROUND_COLOR No documentation. dd318389 DXVAHD_BLT_STATE_OUTPUT_COLOR_SPACE DXVAHD_BLT_STATE_OUTPUT_COLOR_SPACE No documentation. dd318389 DXVAHD_BLT_STATE_ALPHA_FILL DXVAHD_BLT_STATE_ALPHA_FILL No documentation. dd318389 DXVAHD_BLT_STATE_CONSTRICTION DXVAHD_BLT_STATE_CONSTRICTION No documentation. dd318389 DXVAHD_BLT_STATE_PRIVATE DXVAHD_BLT_STATE_PRIVATE No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0012 __MIDL___MIDL_itf_dxva2api_0000_0000_0012 No documentation. DXVA2_PictureParametersBufferType DXVA2_PictureParametersBufferType No documentation. DXVA2_MacroBlockControlBufferType DXVA2_MacroBlockControlBufferType No documentation. DXVA2_ResidualDifferenceBufferType DXVA2_ResidualDifferenceBufferType No documentation. DXVA2_DeblockingControlBufferType DXVA2_DeblockingControlBufferType No documentation. DXVA2_InverseQuantizationMatrixBufferType DXVA2_InverseQuantizationMatrixBufferType No documentation. DXVA2_SliceControlBufferType DXVA2_SliceControlBufferType No documentation. DXVA2_BitStreamDateBufferType DXVA2_BitStreamDateBufferType No documentation. DXVA2_MotionVectorBuffer DXVA2_MotionVectorBuffer No documentation. DXVA2_FilmGrainBuffer DXVA2_FilmGrainBuffer No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0003 __MIDL___MIDL_itf_dxva2api_0000_0000_0003 No documentation. DXVA2_DeinterlaceTech_Unknown DXVA2_DeinterlaceTech_Unknown No documentation. DXVA2_DeinterlaceTech_BOBLineReplicate DXVA2_DeinterlaceTech_BOBLineReplicate No documentation. DXVA2_DeinterlaceTech_BOBVerticalStretch DXVA2_DeinterlaceTech_BOBVerticalStretch No documentation. DXVA2_DeinterlaceTech_BOBVerticalStretch4Tap DXVA2_DeinterlaceTech_BOBVerticalStretch4Tap No documentation. DXVA2_DeinterlaceTech_MedianFiltering DXVA2_DeinterlaceTech_MedianFiltering No documentation. DXVA2_DeinterlaceTech_EdgeFiltering DXVA2_DeinterlaceTech_EdgeFiltering No documentation. DXVA2_DeinterlaceTech_FieldAdaptive DXVA2_DeinterlaceTech_FieldAdaptive No documentation. DXVA2_DeinterlaceTech_PixelAdaptive DXVA2_DeinterlaceTech_PixelAdaptive No documentation. DXVA2_DeinterlaceTech_MotionVectorSteered DXVA2_DeinterlaceTech_MotionVectorSteered No documentation. DXVA2_DeinterlaceTech_InverseTelecine DXVA2_DeinterlaceTech_InverseTelecine No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0006 __MIDL___MIDL_itf_dxva2api_0000_0000_0006 No documentation. DXVA2_DetailFilterTech_Unsupported DXVA2_DetailFilterTech_Unsupported No documentation. DXVA2_DetailFilterTech_Unknown DXVA2_DetailFilterTech_Unknown No documentation. DXVA2_DetailFilterTech_Edge DXVA2_DetailFilterTech_Edge No documentation. DXVA2_DetailFilterTech_Sharpening DXVA2_DetailFilterTech_Sharpening

Defines video processing capabilities for a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

dd318415 DXVAHD_DEVICE_CAPS DXVAHD_DEVICE_CAPS

The device can blend video content in linear color space. Most video content is gamma corrected, resulting in nonlinear values. If the DXVA-HD device sets this flag, it means the device converts colors to linear space before blending, which produces better results.

dd318415 DXVAHD_DEVICE_CAPS_LINEAR_SPACE DXVAHD_DEVICE_CAPS_LINEAR_SPACE

The device supports the xvYCC color space for YCbCr data.

dd318415 DXVAHD_DEVICE_CAPS_xvYCC DXVAHD_DEVICE_CAPS_xvYCC

The device can perform range conversion when the input and output are both RGB but use different color ranges (0-255 or 16-235, for 8-bit RGB).

dd318415 DXVAHD_DEVICE_CAPS_RGB_RANGE_CONVERSION DXVAHD_DEVICE_CAPS_RGB_RANGE_CONVERSION

The device can apply a matrix conversion to YCbCr values when the input and output are both YCbCr. For example, the driver can convert colors from BT.601 to BT.709.

dd318415 DXVAHD_DEVICE_CAPS_YCbCr_MATRIX_CONVERSION DXVAHD_DEVICE_CAPS_YCbCr_MATRIX_CONVERSION

Specifies the type of Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

dd318417 DXVAHD_DEVICE_TYPE DXVAHD_DEVICE_TYPE

Hardware device. Video processing is performed in the GPU by the driver.

dd318417 DXVAHD_DEVICE_TYPE_HARDWARE DXVAHD_DEVICE_TYPE_HARDWARE

Software device. Video processing is performed in the CPU by a software plug-in.

dd318417 DXVAHD_DEVICE_TYPE_SOFTWARE DXVAHD_DEVICE_TYPE_SOFTWARE

Reference device. Video processing is performed in the CPU by a software plug-in.

dd318417 DXVAHD_DEVICE_TYPE_REFERENCE DXVAHD_DEVICE_TYPE_REFERENCE

Other. The device is neither a hardware device nor a software plug-in.

dd318417 DXVAHD_DEVICE_TYPE_OTHER DXVAHD_DEVICE_TYPE_OTHER

Specifies the intended use for a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

The graphics driver uses one of these enumeration constants as a hint when it creates the DXVA-HD device.

dd318420 DXVAHD_DEVICE_USAGE DXVAHD_DEVICE_USAGE

Normal video playback. The graphics driver should expose a set of capabilities that are appropriate for real-time video playback.

dd318420 DXVAHD_DEVICE_USAGE_PLAYBACK_NORMAL DXVAHD_DEVICE_USAGE_PLAYBACK_NORMAL

Optimal speed. The graphics driver should expose a minimal set of capabilities that are optimized for performance.

Use this setting if you want better performance and can accept some reduction in video quality. For example, you might use this setting in power-saving mode or to play video thumbnails.

dd318420 DXVAHD_DEVICE_USAGE_OPTIMAL_SPEED DXVAHD_DEVICE_USAGE_OPTIMAL_SPEED

Optimal quality. The grahics driver should expose its maximum set of capabilities.

Specify this setting to get the best video quality possible. It is appropriate for tasks such as video editing, when quality is more important than speed. It is not appropriate for real-time playback.

dd318420 DXVAHD_DEVICE_USAGE_OPTIMAL_QUALITY DXVAHD_DEVICE_USAGE_OPTIMAL_QUALITY

Defines features that a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device can support.

dd318422 DXVAHD_FEATURE_CAPS DXVAHD_FEATURE_CAPS

The device can set the alpha values on the video output. See .

dd318422 DXVAHD_FEATURE_CAPS_ALPHA_FILL DXVAHD_FEATURE_CAPS_ALPHA_FILL

The device can downsample the video output. See .

dd318422 DXVAHD_FEATURE_CAPS_CONSTRICTION DXVAHD_FEATURE_CAPS_CONSTRICTION

The device can perform luma keying. See .

dd318422 DXVAHD_FEATURE_CAPS_LUMA_KEY DXVAHD_FEATURE_CAPS_LUMA_KEY

The device can apply alpha values from color palette entries. See .

dd318422 DXVAHD_FEATURE_CAPS_ALPHA_PALETTE DXVAHD_FEATURE_CAPS_ALPHA_PALETTE

Defines the range of supported values for an image filter.

The multiplier enables the filter range to have a fractional step value.

For example, a hue filter might have an actual range of [-180.0 ... +180.0] with a step size of 0.25. The device would report the following range and multiplier:

  • Minimum: -720
  • Maximum: +720
  • Multiplier: 0.25

In this case, a filter value of 2 would be interpreted by the device as 0.50 (or 2 ? 0.25).

The device should use a multiplier that can be represented exactly as a base-2 fraction.

dd318428 DXVAHD_FILTER DXVAHD_FILTER

The minimum value of the filter.

dd318428 DXVAHD_FILTER_BRIGHTNESS DXVAHD_FILTER_BRIGHTNESS

The maximum value of the filter.

dd318428 DXVAHD_FILTER_CONTRAST DXVAHD_FILTER_CONTRAST

The default value of the filter.

dd318428 DXVAHD_FILTER_HUE DXVAHD_FILTER_HUE

A multiplier. Use the following formula to translate the filter setting into the actual filter value: Actual Value = Set Value???Multiplier.

dd318428 DXVAHD_FILTER_SATURATION DXVAHD_FILTER_SATURATION
No documentation. dd318428 DXVAHD_FILTER_NOISE_REDUCTION DXVAHD_FILTER_NOISE_REDUCTION No documentation. dd318428 DXVAHD_FILTER_EDGE_ENHANCEMENT DXVAHD_FILTER_EDGE_ENHANCEMENT No documentation. dd318428 DXVAHD_FILTER_ANAMORPHIC_SCALING DXVAHD_FILTER_ANAMORPHIC_SCALING

Defines capabilities related to image adjustment and filtering for a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

dd318426 DXVAHD_FILTER_CAPS DXVAHD_FILTER_CAPS

The device can adjust the brightness level.

dd318426 DXVAHD_FILTER_CAPS_BRIGHTNESS DXVAHD_FILTER_CAPS_BRIGHTNESS

The device can adjust the contrast level.

dd318426 DXVAHD_FILTER_CAPS_CONTRAST DXVAHD_FILTER_CAPS_CONTRAST

The device can adjust hue.

dd318426 DXVAHD_FILTER_CAPS_HUE DXVAHD_FILTER_CAPS_HUE

The device can adjust the saturation level.

dd318426 DXVAHD_FILTER_CAPS_SATURATION DXVAHD_FILTER_CAPS_SATURATION

The device can perform noise reduction.

dd318426 DXVAHD_FILTER_CAPS_NOISE_REDUCTION DXVAHD_FILTER_CAPS_NOISE_REDUCTION

The device can perform edge enhancement.

dd318426 DXVAHD_FILTER_CAPS_EDGE_ENHANCEMENT DXVAHD_FILTER_CAPS_EDGE_ENHANCEMENT

The device can perform anamorphic scaling. Anamorphic scaling can be used to stretch 4:3 content to a widescreen 16:9 aspect ratio.

dd318426 DXVAHD_FILTER_CAPS_ANAMORPHIC_SCALING DXVAHD_FILTER_CAPS_ANAMORPHIC_SCALING

Describes how a video stream is interlaced.

dd318431 DXVAHD_FRAME_FORMAT DXVAHD_FRAME_FORMAT

Frames are progressive.

dd318431 DXVAHD_FRAME_FORMAT_PROGRESSIVE DXVAHD_FRAME_FORMAT_PROGRESSIVE

Frames are interlaced. The top field of each frame is displayed first.

dd318431 DXVAHD_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST DXVAHD_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST

Frame are interlaced. The bottom field of each frame is displayed first.

dd318431 DXVAHD_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST DXVAHD_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST

Defines capabilities related to input formats for a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

These flags define video processing capabilities that are usually not needed, and therefore are not required for DXVA-HD devices to support.

The first three flags relate to RGB support for functions that are normally applied to YCbCr video: deinterlacing, color adjustment, and luma keying. A DXVA-HD device that supports these functions for YCbCr is not required to support them for RGB input. Supporting RGB input for these functions is an additional capability, reflected by these constants. The driver might convert the input to another color space, perform the indicated function, and then convert the result back to RGB.

Similarly, a device that supports de-interlacing is not required to support deinterlacing of palettized formats. This capability is indicated by the flag.

dd318433 DXVAHD_INPUT_FORMAT_CAPS DXVAHD_INPUT_FORMAT_CAPS

The device can deinterlace an input stream that contains interlaced RGB video.

dd318433 DXVAHD_INPUT_FORMAT_CAPS_RGB_INTERLACED DXVAHD_INPUT_FORMAT_CAPS_RGB_INTERLACED

The device can perform color adjustment on RGB video.

dd318433 DXVAHD_INPUT_FORMAT_CAPS_RGB_PROCAMP DXVAHD_INPUT_FORMAT_CAPS_RGB_PROCAMP

The device can perform luma keying on RGB video.

dd318433 DXVAHD_INPUT_FORMAT_CAPS_RGB_LUMA_KEY DXVAHD_INPUT_FORMAT_CAPS_RGB_LUMA_KEY

The device can deinterlace input streams with palettized color formats.

dd318433 DXVAHD_INPUT_FORMAT_CAPS_PALETTE_INTERLACED DXVAHD_INPUT_FORMAT_CAPS_PALETTE_INTERLACED

Specifies the inverse telecine (IVTC) capabilities of a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor.

dd318435 DXVAHD_ITELECINE_CAPS DXVAHD_ITELECINE_CAPS

The video processor can reverse 3:2 pulldown.

dd318435 DXVAHD_ITELECINE_CAPS_32 DXVAHD_ITELECINE_CAPS_32

The video processor can reverse 2:2 pulldown.

dd318435 DXVAHD_ITELECINE_CAPS_22 DXVAHD_ITELECINE_CAPS_22

The video processor can reverse 2:2:2:4 pulldown.

dd318435 DXVAHD_ITELECINE_CAPS_2224 DXVAHD_ITELECINE_CAPS_2224

The video processor can reverse 2:3:3:2 pulldown.

dd318435 DXVAHD_ITELECINE_CAPS_2332 DXVAHD_ITELECINE_CAPS_2332

The video processor can reverse 3:2:3:2:2 pulldown.

dd318435 DXVAHD_ITELECINE_CAPS_32322 DXVAHD_ITELECINE_CAPS_32322

The video processor can reverse 5:5 pulldown.

dd318435 DXVAHD_ITELECINE_CAPS_55 DXVAHD_ITELECINE_CAPS_55

The video processor can reverse 6:4 pulldown.

dd318435 DXVAHD_ITELECINE_CAPS_64 DXVAHD_ITELECINE_CAPS_64

The video processor can reverse 8:7 pulldown.

dd318435 DXVAHD_ITELECINE_CAPS_87 DXVAHD_ITELECINE_CAPS_87

The video processor can reverse 2:2:2:2:2:2:2:2:2:2:2:3 pulldown.

dd318435 DXVAHD_ITELECINE_CAPS_222222222223 DXVAHD_ITELECINE_CAPS_222222222223

The video processor can reverse other telecine modes not listed here.

dd318435 DXVAHD_ITELECINE_CAPS_OTHER DXVAHD_ITELECINE_CAPS_OTHER
No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0004 __MIDL___MIDL_itf_dxva2api_0000_0000_0004 No documentation. DXVA2_NoiseFilterLumaLevel DXVA2_NoiseFilterLumaLevel No documentation. DXVA2_NoiseFilterLumaThreshold DXVA2_NoiseFilterLumaThreshold No documentation. DXVA2_NoiseFilterLumaRadius DXVA2_NoiseFilterLumaRadius No documentation. DXVA2_NoiseFilterChromaLevel DXVA2_NoiseFilterChromaLevel No documentation. DXVA2_NoiseFilterChromaThreshold DXVA2_NoiseFilterChromaThreshold No documentation. DXVA2_NoiseFilterChromaRadius DXVA2_NoiseFilterChromaRadius No documentation. DXVA2_DetailFilterLumaLevel DXVA2_DetailFilterLumaLevel No documentation. DXVA2_DetailFilterLumaThreshold DXVA2_DetailFilterLumaThreshold No documentation. DXVA2_DetailFilterLumaRadius DXVA2_DetailFilterLumaRadius No documentation. DXVA2_DetailFilterChromaLevel DXVA2_DetailFilterChromaLevel No documentation. DXVA2_DetailFilterChromaThreshold DXVA2_DetailFilterChromaThreshold No documentation. DXVA2_DetailFilterChromaRadius DXVA2_DetailFilterChromaRadius No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0005 __MIDL___MIDL_itf_dxva2api_0000_0000_0005 No documentation. DXVA2_NoiseFilterTech_Unsupported DXVA2_NoiseFilterTech_Unsupported No documentation. DXVA2_NoiseFilterTech_Unknown DXVA2_NoiseFilterTech_Unknown No documentation. DXVA2_NoiseFilterTech_Median DXVA2_NoiseFilterTech_Median No documentation. DXVA2_NoiseFilterTech_Temporal DXVA2_NoiseFilterTech_Temporal No documentation. DXVA2_NoiseFilterTech_BlockNoise DXVA2_NoiseFilterTech_BlockNoise No documentation. DXVA2_NoiseFilterTech_MosquitoNoise DXVA2_NoiseFilterTech_MosquitoNoise

Describes how to map color data to a normalized [0...1] range.

These flags are used in the structure. They indicate whether the range of color values includes headroom (values above 100% white) and toeroom (values below reference black).

For YUV colors, these flags specify how to convert between Y'CbCr and Y'PbPr. The Y'PbPr color space has a range of [0..1] for Y' (luma) and [-0.5...0.5] for Pb/Pr (chroma).

ValueDescription
Should not be used for YUV data.

For 8-bit Y'CbCr components:

  • Y' range of [0...1] maps to [16..235] for 8-bit Y' values.

  • Pb/Pr ranges of [-0.5...0.5] map to [16...240] for 8-bit Cb/Cr values.

For samples with n bits of precision, the general equations are:

  • Y' = (Y' * 219 + 16) * 2 ^ (n-8)

  • Cb = (Pb * 224 + 128) * 2 ^ (n-8)

  • Cr = (Pr * 224 + 128) * 2 ^ (n-8)

The inverse equations to convert from Y'CbCr to Y'PbPr are:

  • Y' = (Y' / 2 ^ (n-8) - 16) / 219

  • Pb = (Cb / 2 ^ (n-8) - 128) / 224

  • Pr = (Cr / 2 ^ (n-8) - 128) / 224

For 8-bit Y'CbCr values, Y' range of [0..1] maps to [48...208].

?

For RGB colors, the flags differentiate various RGB spaces.

ValueDescription
sRGB
Studio RGB; ITU-R BT.709
ITU-R BT.1361 RGB

?

Video data might contain values above or below the nominal range.

Note??The values named and are a potential source of confusion. Wide refers to the possible range of analog values that can be represented, by mapping the nominal range [0...1] into a narrower range of digital values. Because the meaning of wide in this context is ambiguous, the equivalent values named and are preferred. These names explicitly convey the meaning of the enumeration, and are less likely to be misinterpreted.

This enumeration is equivalent to the DXVA_NominalRange enumeration used in DXVA 1.0, although it defines additional values.

If you are using the interface to describe the video format, the nominal range is specified in the attribute.

bb970561 DXVA2_NominalRange DXVA2_NominalRange
No documentation. bb970561 DXVA2_NominalRangeMask DXVA2_NominalRangeMask No documentation. bb970561 DXVA2_NominalRange_Unknown DXVA2_NominalRange_Unknown No documentation. bb970561 DXVA2_NominalRange_Normal DXVA2_NominalRange_Normal No documentation. bb970561 DXVA2_NominalRange_Wide DXVA2_NominalRange_Wide No documentation. bb970561 DXVA2_NominalRange_0_255 DXVA2_NominalRange_0_255 No documentation. bb970561 DXVA2_NominalRange_16_235 DXVA2_NominalRange_16_235 No documentation. bb970561 DXVA2_NominalRange_48_208 DXVA2_NominalRange_48_208

Specifies the output frame rates for an input stream, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

This enumeration type is used in the structure.

dd318437 DXVAHD_OUTPUT_RATE DXVAHD_OUTPUT_RATE
No documentation. dd318437 DXVAHD_OUTPUT_RATE_NORMAL DXVAHD_OUTPUT_RATE_NORMAL No documentation. dd318437 DXVAHD_OUTPUT_RATE_HALF DXVAHD_OUTPUT_RATE_HALF No documentation. dd318437 DXVAHD_OUTPUT_RATE_CUSTOM DXVAHD_OUTPUT_RATE_CUSTOM

Specifies the processing capabilities of a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor.

dd318439 DXVAHD_PROCESSOR_CAPS DXVAHD_PROCESSOR_CAPS

The video processor can perform blend deinterlacing.

In blend deinterlacing, the two fields from an interlaced frame are blended into a single progressive frame. A video processor uses blend deinterlacing when it deinterlaces at half rate, as when converting 60i to 30p. Blend deinterlacing does not require reference frames.

dd318439 DXVAHD_PROCESSOR_CAPS_DEINTERLACE_BLEND DXVAHD_PROCESSOR_CAPS_DEINTERLACE_BLEND

The video processor can perform bob deinterlacing.

In bob deinterlacing, missing field lines are interpolated from the lines above and below. Bob deinterlacing does not require reference frames.

dd318439 DXVAHD_PROCESSOR_CAPS_DEINTERLACE_BOB DXVAHD_PROCESSOR_CAPS_DEINTERLACE_BOB

The video processor can perform adaptive deinterlacing.

Adaptive deinterlacing uses spatial or temporal interpolation, and switches between the two on a field-by-field basis, depending on the amount of motion. If the video processor does not receive enough reference frames to perform adaptive deinterlacing, it falls back to bob deinterlacing.

dd318439 DXVAHD_PROCESSOR_CAPS_DEINTERLACE_ADAPTIVE DXVAHD_PROCESSOR_CAPS_DEINTERLACE_ADAPTIVE

The video processor can perform motion-compensated deinterlacing.

Motion-compensated deinterlacing uses motion vectors to recreate missing lines. If the video processor does not receive enough reference frames to perform motion-compensated deinterlacing, it falls back to bob deinterlacing.

dd318439 DXVAHD_PROCESSOR_CAPS_DEINTERLACE_MOTION_COMPENSATION DXVAHD_PROCESSOR_CAPS_DEINTERLACE_MOTION_COMPENSATION

The video processor can perform inverse telecine (IVTC).

If the video processor supports this capability, the ITelecineCaps member of the structure specifies which IVTC modes are supported.

dd318439 DXVAHD_PROCESSOR_CAPS_INVERSE_TELECINE DXVAHD_PROCESSOR_CAPS_INVERSE_TELECINE

The video processor can convert the frame rate by interpolating frames.

dd318439 DXVAHD_PROCESSOR_CAPS_FRAME_RATE_CONVERSION DXVAHD_PROCESSOR_CAPS_FRAME_RATE_CONVERSION
No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0013 __MIDL___MIDL_itf_dxva2api_0000_0000_0013 No documentation. DXVA2_VideoDecoderRenderTarget DXVA2_VideoDecoderRenderTarget No documentation. DXVA2_VideoProcessorRenderTarget DXVA2_VideoProcessorRenderTarget No documentation. DXVA2_VideoSoftwareRenderTarget DXVA2_VideoSoftwareRenderTarget No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0010 __MIDL___MIDL_itf_dxva2api_0000_0000_0010 No documentation. DXVA2_SampleData_RFF DXVA2_SampleData_RFF No documentation. DXVA2_SampleData_TFF DXVA2_SampleData_TFF No documentation. DXVA2_SampleData_RFF_TFF_Present DXVA2_SampleData_RFF_TFF_Present

Describes the content of a video sample. These flags are used in the structure.

This enumeration is equivalent to the DXVA_SampleFormat enumeration used in DXVA 1.0.

The following table shows the mapping from enumeration values, which are used in Media Foundation media types, to values.

Value Value
.
.
.
.
.
No exact match. Use as an initial value, then use the interlace flags from the media samples. For more information, see Video Interlacing.

?

With the exception of , each pair of corresponding enumeration values has the same numeric value.

The value has no equivalent in the enumeration.

ms699834 DXVA2_SampleFormat DXVA2_SampleFormat
No documentation. ms699834 DXVA2_SampleFormatMask DXVA2_SampleFormatMask No documentation. ms699834 DXVA2_SampleUnknown DXVA2_SampleUnknown No documentation. ms699834 DXVA2_SampleProgressiveFrame DXVA2_SampleProgressiveFrame No documentation. ms699834 DXVA2_SampleFieldInterleavedEvenFirst DXVA2_SampleFieldInterleavedEvenFirst No documentation. ms699834 DXVA2_SampleFieldInterleavedOddFirst DXVA2_SampleFieldInterleavedOddFirst No documentation. ms699834 DXVA2_SampleFieldSingleEven DXVA2_SampleFieldSingleEven No documentation. ms699834 DXVA2_SampleFieldSingleOdd DXVA2_SampleFieldSingleOdd No documentation. ms699834 DXVA2_SampleSubStream DXVA2_SampleSubStream

Specifies the luma key for an input stream, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

To use this state, the device must support luma keying, indicated by the capability flag. To query for this capability, call . If the device supports luma keying, it sets the flag in the FeatureCaps member of the structure.

If the device does not support luma keying, the method fails for this state.

If the input format is RGB, the device must also support the capability. This capability flag is set in the InputFormatCaps member of the structure. If the flag is not present, the device ignores the luma key value for RGB input.

The values of Lower and Upper give the lower and upper bounds of the luma key, using a nominal range of [0...1]. Given a format with n bits per channel, these values are converted to luma values as follows:

val = f * ((1 << n)-1)

Any pixel whose luma value falls within the upper and lower bounds (inclusive) is treated as transparent.

For example, if the pixel format uses 8-bit luma, the upper bound is calculated as follows:

BYTE Y = BYTE(max(min(1.0, Upper), 0.0) * 255.0)

Note that the value is clamped to the range [0...1] before multiplying by 255.

dd318766 DXVAHD_STREAM_STATE DXVAHD_STREAM_STATE

If TRUE, luma keying is enabled. Otherwise, luma keying is disabled. The default value is .

dd318766 DXVAHD_STREAM_STATE_D3DFORMAT DXVAHD_STREAM_STATE_D3DFORMAT

The lower bound for the luma key. The range is [0?1]. The default state value is 0.0.

dd318766 DXVAHD_STREAM_STATE_FRAME_FORMAT DXVAHD_STREAM_STATE_FRAME_FORMAT

The upper bound for the luma key. The range is [0?1]. The default state value is 0.0.

dd318766 DXVAHD_STREAM_STATE_INPUT_COLOR_SPACE DXVAHD_STREAM_STATE_INPUT_COLOR_SPACE
No documentation. dd318766 DXVAHD_STREAM_STATE_OUTPUT_RATE DXVAHD_STREAM_STATE_OUTPUT_RATE No documentation. dd318766 DXVAHD_STREAM_STATE_SOURCE_RECT DXVAHD_STREAM_STATE_SOURCE_RECT No documentation. dd318766 DXVAHD_STREAM_STATE_DESTINATION_RECT DXVAHD_STREAM_STATE_DESTINATION_RECT No documentation. dd318766 DXVAHD_STREAM_STATE_ALPHA DXVAHD_STREAM_STATE_ALPHA No documentation. dd318766 DXVAHD_STREAM_STATE_PALETTE DXVAHD_STREAM_STATE_PALETTE No documentation. dd318766 DXVAHD_STREAM_STATE_LUMA_KEY DXVAHD_STREAM_STATE_LUMA_KEY No documentation. dd318766 DXVAHD_STREAM_STATE_ASPECT_RATIO DXVAHD_STREAM_STATE_ASPECT_RATIO No documentation. dd318766 DXVAHD_STREAM_STATE_FILTER_BRIGHTNESS DXVAHD_STREAM_STATE_FILTER_BRIGHTNESS No documentation. dd318766 DXVAHD_STREAM_STATE_FILTER_CONTRAST DXVAHD_STREAM_STATE_FILTER_CONTRAST No documentation. dd318766 DXVAHD_STREAM_STATE_FILTER_HUE DXVAHD_STREAM_STATE_FILTER_HUE No documentation. dd318766 DXVAHD_STREAM_STATE_FILTER_SATURATION DXVAHD_STREAM_STATE_FILTER_SATURATION No documentation. dd318766 DXVAHD_STREAM_STATE_FILTER_NOISE_REDUCTION DXVAHD_STREAM_STATE_FILTER_NOISE_REDUCTION No documentation. dd318766 DXVAHD_STREAM_STATE_FILTER_EDGE_ENHANCEMENT DXVAHD_STREAM_STATE_FILTER_EDGE_ENHANCEMENT No documentation. dd318766 DXVAHD_STREAM_STATE_FILTER_ANAMORPHIC_SCALING DXVAHD_STREAM_STATE_FILTER_ANAMORPHIC_SCALING No documentation. dd318766 DXVAHD_STREAM_STATE_PRIVATE DXVAHD_STREAM_STATE_PRIVATE

Describes a DirectX surface type for DirectX Video Acceleration (DXVA).

ms699850 DXVA2_SurfaceType DXVA2_SurfaceType

The surface is a decoder render target.

ms699850 DXVA2_SurfaceType_DecoderRenderTarget DXVA2_SurfaceType_DecoderRenderTarget

The surface is a video processor render target.

ms699850 DXVA2_SurfaceType_ProcessorRenderTarget DXVA2_SurfaceType_ProcessorRenderTarget

The surface is a Direct3D texture render target.

ms699850 DXVA2_SurfaceType_D3DRenderTargetTexture DXVA2_SurfaceType_D3DRenderTargetTexture

Specifies the type of video surface created by a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

If the DXVA-HD device is a software plug-in and the surface type is , the device can support format types that are not supported natively by the graphics driver. For example, if the application requests an AYUV surface, the device could allocate a surface with a surface type of .

dd318772 DXVAHD_SURFACE_TYPE DXVAHD_SURFACE_TYPE

A surface for an input stream. This surface type is equivalent to an off-screen plain surface in Microsoft Direct3D. The application can use the surface in Direct3D calls.

dd318772 DXVAHD_SURFACE_TYPE_VIDEO_INPUT DXVAHD_SURFACE_TYPE_VIDEO_INPUT

A private surface for an input stream. This surface type is equivalent to an off-screen plain surface, except that the application cannot use the surface in Direct3D calls.

dd318772 DXVAHD_SURFACE_TYPE_VIDEO_INPUT_PRIVATE DXVAHD_SURFACE_TYPE_VIDEO_INPUT_PRIVATE

A surface for an output stream. This surface type is equivalent to an off-screen plain surface in Direct3D. The application can use the surface in Direct3D calls.

This surface type is recommended for video processing applications that need to lock the surface and access the surface memory. For video playback with optimal performance, a render-target surface or swap chain is recommended instead.

dd318772 DXVAHD_SURFACE_TYPE_VIDEO_OUTPUT DXVAHD_SURFACE_TYPE_VIDEO_OUTPUT

Describes how chroma values are positioned relative to the luma samples in a YUV video frame. These flags are used in the structure.

The following diagrams show the most common arrangements.

ms694252 DXVA2_VideoChromaSubSampling DXVA2_VideoChromaSubSampling
No documentation. ms694252 DXVA2_VideoChromaSubsamplingMask DXVA2_VideoChromaSubsamplingMask No documentation. ms694252 DXVA2_VideoChromaSubsampling_Unknown DXVA2_VideoChromaSubsampling_Unknown No documentation. ms694252 DXVA2_VideoChromaSubsampling_ProgressiveChroma DXVA2_VideoChromaSubsampling_ProgressiveChroma No documentation. ms694252 DXVA2_VideoChromaSubsampling_Horizontally_Cosited DXVA2_VideoChromaSubsampling_Horizontally_Cosited No documentation. ms694252 DXVA2_VideoChromaSubsampling_Vertically_Cosited DXVA2_VideoChromaSubsampling_Vertically_Cosited No documentation. ms694252 DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes No documentation. ms694252 DXVA2_VideoChromaSubsampling_MPEG2 DXVA2_VideoChromaSubsampling_MPEG2 No documentation. ms694252 DXVA2_VideoChromaSubsampling_MPEG1 DXVA2_VideoChromaSubsampling_MPEG1 No documentation. ms694252 DXVA2_VideoChromaSubsampling_DV_PAL DXVA2_VideoChromaSubsampling_DV_PAL No documentation. ms694252 DXVA2_VideoChromaSubsampling_Cosited DXVA2_VideoChromaSubsampling_Cosited No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0009 __MIDL___MIDL_itf_dxva2api_0000_0000_0009 No documentation. DXVA2_VPDev_HardwareDevice DXVA2_VPDev_HardwareDevice No documentation. DXVA2_VPDev_EmulatedDXVA1 DXVA2_VPDev_EmulatedDXVA1 No documentation. DXVA2_VPDev_SoftwareDevice DXVA2_VPDev_SoftwareDevice

Describes the intended lighting conditions for viewing video content. These flags are used in the structure.

This enumeration is equivalent to the DXVA_VideoLighting enumeration used in DXVA 1.0.

If you are using the interface to describe the video format, the video lighting is specified in the attribute.

ms703932 DXVA2_VideoLighting DXVA2_VideoLighting
No documentation. ms703932 DXVA2_VideoLightingMask DXVA2_VideoLightingMask No documentation. ms703932 DXVA2_VideoLighting_Unknown DXVA2_VideoLighting_Unknown No documentation. ms703932 DXVA2_VideoLighting_bright DXVA2_VideoLighting_bright No documentation. ms703932 DXVA2_VideoLighting_office DXVA2_VideoLighting_office No documentation. ms703932 DXVA2_VideoLighting_dim DXVA2_VideoLighting_dim No documentation. ms703932 DXVA2_VideoLighting_dark DXVA2_VideoLighting_dark

Specifies the color primaries of a video source. These flags are used in the structure.

Color primaries define how to convert RGB colors into the CIE XYZ color space, and can be used to translate colors between different RGB color spaces. An RGB color space is defined by the chromaticity coordinates (x,y) of the RGB primaries plus the white point, as listed in the following table.

Color space(Rx, Ry)(Gx, Gy)(Bx, By)White point (Wx, Wy)
BT.709(0.64, 0.33)(0.30, 0.60)(0.15, 0.06) D65 (0.3127, 0.3290)
BT.470-2 System M; EBU 3212 (0.64, 0.33)(0.29, 0.60)(0.15, 0.06) D65 (0.3127, 0.3290)
BT.470-4 System B,G(0.67, 0.33)(0.21, 0.71)(0.14, 0.08) CIE III.C (0.310, 0.316)
SMPTE 170M; SMPTE 240M; SMPTE C (0.63, 0.34)(0.31, 0.595)(0.155, 0.07) D65 (0.3127, 0.3291)

?

The z coordinates can be derived from x and y as follows: z = 1 - x - y. To convert between RGB colors to CIE XYZ tristimulus values, compute a matrix T as follows:

Given T, you can use the following formulas to convert between an RGB color value and a CIE XYZ tristimulus value. These formulas assume that the RGB components are linear (not gamma corrected) and are normalized to the range [0...1].

To convert colors directly from one RGB color space to another, use the following formula, where T1 is the matrix for color space RGB1, and T2 is the matrix for color space RGB2.

For a derivation of these formulas, refer to Charles Poynton, Digital Video and HDTV Algorithms and Interfaces (Morgan Kaufmann, 2003).

This enumeration is equivalent to the DXVA_VideoPrimaries enumeration used in DXVA 1.0.

If you are using the interface to describe the video format, the color primaries are specified in the attribute.

ms696997 DXVA2_VideoPrimaries DXVA2_VideoPrimaries
No documentation. ms696997 DXVA2_VideoPrimariesMask DXVA2_VideoPrimariesMask No documentation. ms696997 DXVA2_VideoPrimaries_Unknown DXVA2_VideoPrimaries_Unknown No documentation. ms696997 DXVA2_VideoPrimaries_reserved DXVA2_VideoPrimaries_reserved No documentation. ms696997 DXVA2_VideoPrimaries_BT709 DXVA2_VideoPrimaries_BT709 No documentation. ms696997 DXVA2_VideoPrimaries_BT470_2_SysM DXVA2_VideoPrimaries_BT470_2_SysM No documentation. ms696997 DXVA2_VideoPrimaries_BT470_2_SysBG DXVA2_VideoPrimaries_BT470_2_SysBG No documentation. ms696997 DXVA2_VideoPrimaries_SMPTE170M DXVA2_VideoPrimaries_SMPTE170M No documentation. ms696997 DXVA2_VideoPrimaries_SMPTE240M DXVA2_VideoPrimaries_SMPTE240M No documentation. ms696997 DXVA2_VideoPrimaries_EBU3213 DXVA2_VideoPrimaries_EBU3213 No documentation. ms696997 DXVA2_VideoPrimaries_SMPTE_C DXVA2_VideoPrimaries_SMPTE_C No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0008 __MIDL___MIDL_itf_dxva2api_0000_0000_0008 No documentation. DXVA2_VideoProcess_None DXVA2_VideoProcess_None No documentation. DXVA2_VideoProcess_YUV2RGB DXVA2_VideoProcess_YUV2RGB No documentation. DXVA2_VideoProcess_StretchX DXVA2_VideoProcess_StretchX No documentation. DXVA2_VideoProcess_StretchY DXVA2_VideoProcess_StretchY No documentation. DXVA2_VideoProcess_AlphaBlend DXVA2_VideoProcess_AlphaBlend No documentation. DXVA2_VideoProcess_SubRects DXVA2_VideoProcess_SubRects No documentation. DXVA2_VideoProcess_SubStreams DXVA2_VideoProcess_SubStreams No documentation. DXVA2_VideoProcess_SubStreamsExtended DXVA2_VideoProcess_SubStreamsExtended No documentation. DXVA2_VideoProcess_YUV2RGBExtended DXVA2_VideoProcess_YUV2RGBExtended No documentation. DXVA2_VideoProcess_AlphaBlendExtended DXVA2_VideoProcess_AlphaBlendExtended No documentation. DXVA2_VideoProcess_Constriction DXVA2_VideoProcess_Constriction No documentation. DXVA2_VideoProcess_NoiseFilter DXVA2_VideoProcess_NoiseFilter No documentation. DXVA2_VideoProcess_DetailFilter DXVA2_VideoProcess_DetailFilter No documentation. DXVA2_VideoProcess_PlanarAlpha DXVA2_VideoProcess_PlanarAlpha No documentation. DXVA2_VideoProcess_LinearScaling DXVA2_VideoProcess_LinearScaling No documentation. DXVA2_VideoProcess_GammaCompensated DXVA2_VideoProcess_GammaCompensated No documentation. DXVA2_VideoProcess_MaintainsOriginalFieldData DXVA2_VideoProcess_MaintainsOriginalFieldData No documentation. __MIDL___MIDL_itf_dxva2api_0000_0000_0007 __MIDL___MIDL_itf_dxva2api_0000_0000_0007 No documentation. DXVA2_ProcAmp_None DXVA2_ProcAmp_None No documentation. DXVA2_ProcAmp_Brightness DXVA2_ProcAmp_Brightness No documentation. DXVA2_ProcAmp_Contrast DXVA2_ProcAmp_Contrast No documentation. DXVA2_ProcAmp_Hue DXVA2_ProcAmp_Hue No documentation. DXVA2_ProcAmp_Saturation DXVA2_ProcAmp_Saturation

Specifies the conversion function from linear RGB to non-linear RGB (R'G'B'). These flags are used in the Structure.

The following table shows the formulas for the most common transfer functions. In these formulas, L is the linear value and L' is the non-linear (gamma corrected) value. These values are relative to a normalized range [0...1].

Color spaceTransfer function
sRGB (8-bit)

L' = 12.92L, for L < 0.031308

L' = 1.055L^1/2.4? 0.055, for L >= 0.031308

BT.470-2 System B, GL' = L^0.36
BT.470-2 System ML' = L^0.45
BT.709

L' = 4.50L, for L < 0.018

L' = 1.099L^0.45? 0.099, for L >= 0.018

scRGBL' = L
SMPTE 240M

L' = 4.0L, for L < 0.0228

L' = 1.1115L^0.45? 0.01115, for L >= 0.0228

?

The following table shows the inverse formulas to obtain the original gamma-corrected values:

Color spaceTransfer function
sRGB (8-bit)

L = 1/12.92L', for L' < 0.03928

L = ((L' + 0.055)/1055)^2.4, for L' >= 0.03928

BT.470-2 System B, GL = L'^1/0.36
BT.470-2 System ML = L'^1/0.45
BT.709

L = L'/4.50, for L' < 0.081

L = ((L' + 0.099) / 1.099)^1/0.45, for L' >= 0.081

scRGBL = L'
SMPTE 240M

L = L'/4.0, for L' < 0.0913

L= ((L' + 0.1115)/1.1115)^1/0.45, for L' >= 0.0913

?

This enumeration is equivalent to the DXVA_VideoTransferFunction enumeration used in DXVA 1.0.

If you are using the interface to describe the video format, the transfer function is specified in the attribute.

bb970392 DXVA2_VideoTransferFunction DXVA2_VideoTransferFunction

Bitmask to validate flag values. This value is not a valid flag.

bb970392 DXVA2_VideoTransFuncMask DXVA2_VideoTransFuncMask

Unknown. Treat as .

bb970392 DXVA2_VideoTransFunc_Unknown DXVA2_VideoTransFunc_Unknown

Linear RGB (gamma = 1.0).

bb970392 DXVA2_VideoTransFunc_10 DXVA2_VideoTransFunc_10

True 1.8 gamma, L' = L^1/1.8.

bb970392 DXVA2_VideoTransFunc_18 DXVA2_VideoTransFunc_18

True 2.0 gamma, L' = L^1/2.0.

bb970392 DXVA2_VideoTransFunc_20 DXVA2_VideoTransFunc_20

True 2.2 gamma, L' = L^1/2.2. This transfer function is used in ITU-R BT.470-2 System M (NTSC).

bb970392 DXVA2_VideoTransFunc_22 DXVA2_VideoTransFunc_22

ITU-R BT.709 transfer function. Gamma 2.2 curve with a linear segment in the lower range. This transfer function is used in BT.709, BT.601, SMPTE 296M, SMPTE 170M, BT.470, and SMPTE 274M. In addition BT-1361 uses this function within the range [0...1].

bb970392 DXVA2_VideoTransFunc_709 DXVA2_VideoTransFunc_709

SMPTE 240M transfer function. Gamma 2.2 curve with a linear segment in the lower range.

bb970392 DXVA2_VideoTransFunc_240M DXVA2_VideoTransFunc_240M

sRGB transfer function. Gamma 2.4 curve with a linear segment in the lower range.

bb970392 DXVA2_VideoTransFunc_sRGB DXVA2_VideoTransFunc_sRGB

True 2.8 gamma. L' = L^1/2.8. This transfer function is used in ITU-R BT.470-2 System B, G (PAL).

bb970392 DXVA2_VideoTransFunc_28 DXVA2_VideoTransFunc_28

Describes the conversion matrices between Y'PbPr (component video) and studio R'G'B'. These flags are used in the structure.

The transfer matrices are defined as follows.

BT.709 transfer matrices:

Y' 0.212600 0.715200 0.072200 R' Pb = -0.114572 -0.385428 0.500000 x G' Pr 0.500000 -0.454153 -0.045847 B' R' 1.000000 0.000000 1.574800 Y' G' = 1.000000 -0.187324 -0.468124 x Pb B' 1.000000 1.855600 0.000000 Pr

BT.601 transfer matrices:

Y' 0.299000 0.587000 0.114000 R' Pb = -0.168736 -0.331264 0.500000 x G' Pr 0.500000 -0.418688 -0.081312 B' R' 1.000000 0.000000 1.402000 Y' G' = 1.000000 -0.344136 -0.714136 x Pb B' 1.000000 1.772000 0.000000 Pr

SMPTE 240M (SMPTE RP 145) transfer matrices:

Y' 0.212000 0.701000 0.087000 R' Pb = -0.116000 -0.384000 0.500000 x G' Pr 0.500000 -0.445000 -0.055000 B' R' 1.000000 -0.000000 1.576000 Y' G' = 1.000000 -0.227000 -0.477000 x Pb B' 1.000000 1.826000 0.000000 Pr

This enumeration is equivalent to the DXVA_VideoTransferMatrix enumeration used in DXVA 1.0.

If you are using the interface to describe the video format, the video transfer matrix is specified in the attribute.

ms698715 DXVA2_VideoTransferMatrix DXVA2_VideoTransferMatrix
No documentation. ms698715 DXVA2_VideoTransferMatrixMask DXVA2_VideoTransferMatrixMask No documentation. ms698715 DXVA2_VideoTransferMatrix_Unknown DXVA2_VideoTransferMatrix_Unknown No documentation. ms698715 DXVA2_VideoTransferMatrix_BT709 DXVA2_VideoTransferMatrix_BT709 No documentation. ms698715 DXVA2_VideoTransferMatrix_BT601 DXVA2_VideoTransferMatrix_BT601 No documentation. ms698715 DXVA2_VideoTransferMatrix_SMPTE240M DXVA2_VideoTransferMatrix_SMPTE240M Functions

Creates an instance of the Direct3D Device Manager.

No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

Windows Store apps must use IMFDXGIDeviceManager and Direct3D 11 Video APIs.

bb970490 HRESULT DXVA2CreateDirect3DDeviceManager9([Out] unsigned int* pResetToken,[Out, Fast] IDirect3DDeviceManager9** ppDeviceManager) DXVA2CreateDirect3DDeviceManager9

Creates a DirectX Video Acceleration (DXVA) services object. Call this function if your application uses DXVA directly, without using DirectShow or Media Foundation.

A reference to the interface of a Direct3D device.

The interface identifier (IID) of the requested interface. Any of the following interfaces might be supported by the Direct3D device:

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

ms704721 HRESULT DXVA2CreateVideoService([In] IDirect3DDevice9* pDD,[In] const GUID& riid,[Out] void** ppService) DXVA2CreateVideoService

Creates a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

A reference to the interface of a Direct3D 9 device.

A reference to a structure that describes the video content. The driver uses this information as a hint when it creates the device.

A member of the enumeration, describing how the device will be used. The value indicates the desired trade-off between speed and video quality. The driver uses this flag as a hint when it creates the device.

A reference to an initialization function for a software device. Set this reference if you are using a software plug-in device. Otherwise, set this parameter to null. If the value is null, the driver creates the DXVA-HD device.

The function reference type is PDXVAHDSW_Plugin.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOINTERFACE

The Direct3D device does not support DXVA-HD.

?

Use the interface to get the device capabilities, create the video processor, and allocate video surfaces.

dd318412 HRESULT DXVAHD_CreateDevice([In] IDirect3DDevice9Ex* pD3DDevice,[In] const DXVAHD_CONTENT_DESC* pContentDesc,[In] DXVAHD_DEVICE_USAGE Usage,[In, Optional] __function__stdcall* pPlugin,[Out, Fast] IDXVAHD_Device** ppDevice) DXVAHD_CreateDevice

Represents a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor.

To get a reference to this interface, call the method.

dd373918 IDXVAHD_VideoProcessor IDXVAHD_VideoProcessor
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets a state parameter for a blit operation by a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

The state parameter to set, specified as a member of the enumeration.

The size, in bytes, of the buffer pointed to by pData.

A reference to a buffer that contains the state data. The meaning of the data depends on the State parameter. Each state has a corresponding data structure; for more information, see . The caller allocates the buffer and fills in the parameter data before calling this method.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd373921 HRESULT IDXVAHD_VideoProcessor::SetVideoProcessBltState([In] DXVAHD_BLT_STATE State,[In] unsigned int DataSize,[In, Buffer] const void* pData) IDXVAHD_VideoProcessor::SetVideoProcessBltState

Gets the value of a state parameter for blit operations performed by a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

The state parameter to query, specified as a member of the enumeration.

The size, in bytes, of the buffer pointed to by pData.

A reference to a buffer allocated by the caller. The method copies the state data into the buffer. The buffer must be large enough to hold the data structure that corresponds to the state parameter. For more information, see .

If this method succeeds, it returns . Otherwise, it returns an error code.

dd373919 HRESULT IDXVAHD_VideoProcessor::GetVideoProcessBltState([In] DXVAHD_BLT_STATE State,[In] unsigned int DataSize,[Out, Buffer] void* pData) IDXVAHD_VideoProcessor::GetVideoProcessBltState

Sets a state parameter for an input stream on a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

The zero-based index of the input stream. To get the maximum number of streams, call and check the MaxStreamStates member of the structure.

The state parameter to set, specified as a member of the enumeration.

The size, in bytes, of the buffer pointed to by pData.

A reference to a buffer that contains the state data. The meaning of the data depends on the State parameter. Each state has a corresponding data structure; for more information, see . The caller allocates the buffer and fills in the parameter data before calling this method.

If this method succeeds, it returns . Otherwise, it returns an error code.

Call this method to set state parameters that apply to individual input streams.

dd373922 HRESULT IDXVAHD_VideoProcessor::SetVideoProcessStreamState([In] unsigned int StreamNumber,[In] DXVAHD_STREAM_STATE State,[In] unsigned int DataSize,[In, Buffer] const void* pData) IDXVAHD_VideoProcessor::SetVideoProcessStreamState

Gets the value of a state parameter for an input stream on a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

The zero-based index of the input stream. To get the maximum number of streams, call and check the MaxStreamStates member of the structure.

The state parameter to query, specified as a member of the enumeration.

The size, in bytes, of the buffer pointed to by pData.

A reference to a buffer allocated by the caller. The method copies the state data into the buffer. The buffer must be large enough to hold the data structure that corresponds to the state parameter. For more information, see .

If this method succeeds, it returns . Otherwise, it returns an error code.

dd373920 HRESULT IDXVAHD_VideoProcessor::GetVideoProcessStreamState([In] unsigned int StreamNumber,[In] DXVAHD_STREAM_STATE State,[In] unsigned int DataSize,[Out, Buffer] void* pData) IDXVAHD_VideoProcessor::GetVideoProcessStreamState

Performs a video processing blit on one or more input samples and writes the result to a Microsoft Direct3D surface.

A reference to the interface of a Direct3D surface. The output of the video processing operation will be written to this surface. The following surface types can be used:

  • A video surface of type . See .
  • A render-target surface or texture surface created with usage.
  • A swap chain.
  • A swap chain with overlay support ().

Frame number of the output video frame, indexed from zero.

Number of input streams to process.

Pointer to an array of structures that contain information about the input streams. The caller allocates the array and fills in each structure. The number of elements in the array is given in the StreamCount parameter.

If this method succeeds, it returns . Otherwise, it returns an error code.

The maximum value of StreamCount is given in the MaxStreamStates member of the structure. The maximum numbr of streams that can be enabled at one time is given in the MaxInputStreams member of that structure.

dd373923 HRESULT IDXVAHD_VideoProcessor::VideoProcessBltHD([In] IDirect3DSurface9* pOutputSurface,[In] unsigned int OutputFrame,[In] unsigned int StreamCount,[In, Buffer] const DXVAHD_STREAM_DATA* pStreams) IDXVAHD_VideoProcessor::VideoProcessBltHD

Represents a DirectX Video Acceleration (DXVA) video decoder device.

To get a reference to this interface, call .

The methods make calls to the Direct3D device. Therefore, the flags that you specify when creating the device can affect the behavior of this interface. For example, if you specify the flag, the Direct3D global critical section will be held during decode operations.

ms694281 IDirectXVideoDecoder IDirectXVideoDecoder
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the DirectX Video Acceleration (DXVA) decoder service that created this decoder device.

Receives a reference to interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms694049 HRESULT IDirectXVideoDecoder::GetVideoDecoderService([Out] IDirectXVideoDecoderService** ppService) IDirectXVideoDecoder::GetVideoDecoderService

Retrieves the parameters that were used to create this device.

Receives the device . This parameter can be null.

Pointer to a structure that receives a description of the video format. This parameter can be null.

Pointer to a structure structure that receives the decoder configuration. This parameter can be null.

Receives an array of interface references. These references represent the decoder render targets. The method allocates the memory for the array and calls AddRef on each of the references. The caller must release the references and call CoTaskMemFree to free the memory for the array. This parameter can be null.

Receives the number of elements in the pppDecoderRenderTargets array. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument. At least one parameter must be non-null.

?

You can set any parameter to null if you are not interested in the result. At least one parameter must be non-null.

If you specify a non-null value for pppDecoderRenderTargets (to receive the render target surfaces), then pNumSurfaces cannot be null, because it receives the size of the array returned in pppDecoderRenderTargets.

ms697355 HRESULT IDirectXVideoDecoder::GetCreationParameters([Out, Optional] GUID* pDeviceGuid,[Out, Optional] DXVA2_VideoDesc* pVideoDesc,[Out, Optional] DXVA2_ConfigPictureDecode* pConfig,[Out, Buffer] IDirect3DSurface9*** pDecoderRenderTargets,[Out, Optional] unsigned int* pNumSurfaces) IDirectXVideoDecoder::GetCreationParameters

Retrieves a reference to a DirectX Video Acceleration (DXVA) decoder buffer.

Type of buffer to retrieve. Use one of the following values.

ValueMeaning

Picture decoding parameter buffer.

Macroblock control command buffer.

Residual difference block data buffer.

Deblocking filter control command buffer.

Inverse quantization matrix buffer.

Slice-control buffer.

Bitstream data buffer.

Motion vector buffer.

Film grain synthesis data buffer.

?

Receives a reference to the start of the memory buffer.

Receives the size of the buffer, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The method locks the Direct3D surface that contains the buffer. When you are done using the buffer, call to unlock the surface.

This method might block if too many operations have been queued on the GPU. The method unblocks when a free buffer becomes available.

ms703992 HRESULT IDirectXVideoDecoder::GetBuffer([In] unsigned int BufferType,[Out] void** ppBuffer,[Out] unsigned int* pBufferSize) IDirectXVideoDecoder::GetBuffer

Releases a buffer that was obtained by calling .

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms704764 HRESULT IDirectXVideoDecoder::ReleaseBuffer([In] unsigned int BufferType) IDirectXVideoDecoder::ReleaseBuffer

Starts the decoding operation.

Pointer to the interface of the render target where the decoded frame will be written.

Reserved; set to null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid surface type. See Remarks.

?

After this method is called, call to perform decoding operations. When all decoding operations have been executed, call .

Each call to BeginFrame must have a matching call to EndFrame, and BeginFrame calls cannot be nested.

DXVA 1.0 migration note: Unlike the IAMVideoAccelerator::BeginFrame method, which specifies the buffer as an index, this method takes a reference directly to the uncompressed buffer.

The surface pointed to by pRenderTarget must be created by calling with the value for DxvaType.

ms694840 HRESULT IDirectXVideoDecoder::BeginFrame([In] IDirect3DSurface9* pRenderTarget,[In, Optional] void* pvPVPData) IDirectXVideoDecoder::BeginFrame

Signals the end of the decoding operation.

Reserved.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697031 HRESULT IDirectXVideoDecoder::EndFrame([InOut, Optional] void** pHandleComplete) IDirectXVideoDecoder::EndFrame

Executes a decoding operation on the current frame.

Pointer to a structure that contains the information needed for the decoding operation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You must call before calling this method.

ms696258 HRESULT IDirectXVideoDecoder::Execute([In] const DXVA2_DecodeExecuteParams* pExecuteParams) IDirectXVideoDecoder::Execute

Retrieves the DirectX Video Acceleration (DXVA) decoder service that created this decoder device.

ms694049 GetVideoDecoderService GetVideoDecoderService HRESULT IDirectXVideoDecoder::GetVideoDecoderService([Out] IDirectXVideoDecoderService** ppService)

Sets the type of video memory for uncompressed video surfaces. This interface is used by video decoders and transforms.

The DirectShow enhanced video renderer (EVR) filter exposes this interface as a service on the filter's input pins. To obtain a reference to this interface, call with the service identifier .

A video decoder can use this interface to enumerate the EVR filter's preferred surface types and then select the surface type. The decoder should then create surfaces of that type to hold the results of the decoding operation.

This interface does not define a way to clear the surface type. In the case of DirectShow, disconnecting two filters invalidates the surface type.

ms703164 IDirectXVideoMemoryConfiguration IDirectXVideoMemoryConfiguration
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a supported video surface type.

Zero-based index of the surface type to retrieve. Surface types are indexed in order of preference, starting with the most preferred type.

Receives a member of the enumeration that specifies the surface type.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The index was out of range.

?

ms697493 HRESULT IDirectXVideoMemoryConfiguration::GetAvailableSurfaceTypeByIndex([In] unsigned int dwTypeIndex,[Out] DXVA2_SurfaceType* pdwType) IDirectXVideoMemoryConfiguration::GetAvailableSurfaceTypeByIndex

Sets the video surface type that a decoder will use for DirectX Video Acceleration (DVXA) 2.0.

Member of the enumeration specifying the surface type. Currently, the only supported value is .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The renderer does not support the specified surface type.

?

By calling this method, the caller agrees to create surfaces of the type specified in the dwType parameter.

In DirectShow, during pin connection, a video decoder that supports DVXA 2.0 should call SetSurface with the value . This notifies the video renderer that the decoder will provide the allocator and will create the Direct3D surfaces for decoding. For more information, see Supporting DXVA 2.0 in DirectShow.

The only way to undo the setting is to break the pin connection.

ms693977 HRESULT IDirectXVideoMemoryConfiguration::SetSurfaceType([In] DXVA2_SurfaceType dwType) IDirectXVideoMemoryConfiguration::SetSurfaceType

Sets the video surface type that a decoder will use for DirectX Video Acceleration (DVXA) 2.0.

By calling this method, the caller agrees to create surfaces of the type specified in the dwType parameter.

In DirectShow, during pin connection, a video decoder that supports DVXA 2.0 should call SetSurface with the value . This notifies the video renderer that the decoder will provide the allocator and will create the Direct3D surfaces for decoding. For more information, see Supporting DXVA 2.0 in DirectShow.

The only way to undo the setting is to break the pin connection.

ms693977 SetSurfaceType SetSurfaceType HRESULT IDirectXVideoMemoryConfiguration::SetSurfaceType([In] DXVA2_SurfaceType dwType)

Retrieves the parameters that were used to create this device.

You can set any parameter to null if you are not interested in the result. At least one parameter must be non-null.

ms704783 IDirectXVideoProcessor IDirectXVideoProcessor
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the DirectX Video Acceleration (DXVA) video processor service that created this video processor device.

Receives a reference to interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms700812 HRESULT IDirectXVideoProcessor::GetVideoProcessorService([Out] IDirectXVideoProcessorService** ppService) IDirectXVideoProcessor::GetVideoProcessorService

Retrieves the parameters that were used to create this device.

Receives the device . This parameter can be null.

Pointer to a structure allocated by the caller. The method fills the structure with a description of the video format. This parameter can be null.

Receives the render target format, specified as a value. For more information, see the Direct3D documentation. This parameter can be null.

Receives the maximum number of streams supported by the device. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument. At least one parameter must be non-null.

?

You can set any parameter to null if you are not interested in the result. At least one parameter must be non-null.

ms704783 HRESULT IDirectXVideoProcessor::GetCreationParameters([Out, Optional] GUID* pDeviceGuid,[Out, Optional] DXVA2_VideoDesc* pVideoDesc,[Out, Optional] D3DFORMAT* pRenderTargetFormat,[Out, Optional] unsigned int* pMaxNumSubStreams) IDirectXVideoProcessor::GetCreationParameters

Retrieves the capabilities of the video processor device.

Pointer to a structure that receives the video processor capabilities.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms704831 HRESULT IDirectXVideoProcessor::GetVideoProcessorCaps([Out] DXVA2_VideoProcessorCaps* pCaps) IDirectXVideoProcessor::GetVideoProcessorCaps

Retrieves the range of values for a video processor (ProcAmp) setting on this video processor device.

The ProcAmp setting to query. See ProcAmp Settings.

Pointer to a structure that receives the range of values for the setting specified in ProcAmpCaps.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms704610 HRESULT IDirectXVideoProcessor::GetProcAmpRange([In] unsigned int ProcAmpCap,[Out] DXVA2_ValueRange* pRange) IDirectXVideoProcessor::GetProcAmpRange

Retrieves the range of values for an image filter supported by this device.

Filter setting to query. For more information, see DXVA Image Filter Settings.

Pointer to a structure that receives the range of values for the setting specified in FilterSetting.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697209 HRESULT IDirectXVideoProcessor::GetFilterPropertyRange([In] unsigned int FilterSetting,[Out] DXVA2_ValueRange* pRange) IDirectXVideoProcessor::GetFilterPropertyRange

Performs a video process operation on one or more input samples and writes the result to a Direct3D9 surface.

A reference to the interface of a Direct3D surface. The output of the video processing operation will be written to this surface. The surface may be any of the following types:

  • A surface created by calling with the DXVA2_VideoProcessRenderTarget flag. You can also use the flag, but only when the device is DXVA2_VideoProcSoftwareDevice (software video processing device).
  • A surface created from a Direct3D device with the usage flag.
  • A Direct3D swap chain.

A reference to a structure that describes the video processing operation to perform.

A reference to an array of structures that contain the input samples. There must be at least one element in the array.

The maximum number of input samples is given by the constant MAX_DEINTERLACE_SURFACES, defined in the header file dxva2api.h.

The number of elements in the pSamples array.

Reserved; set to null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Internal driver error.

E_INVALIDARG

Invalid arguments.

?

When the method returns, the operation might not be complete.

If the method returns E_INVALIDARG, check for the following:

  • The number of input samples (NumSamples) must be less than or equal to MAX_DEINTERLACE_SURFACES.
  • The Direct3D surface must be a valid target for VideoProcessBlt. See the description of the pRT parameter for details.
  • The presentation time (TargetFrame) given in pBltParams must match the start and end times for the current picture from the primary stream. Specifically, it must be less than the end time and greater than or equal to the start time. Note that the first sample in pSamples might not be the current picture, if the pSamples array contains backward reference pictures. For more information, see Input Sample Order.
  • The target rectangle (TargetRect) given in pBltParams cannot be larger than the destination surface (pRT).
  • The constriction size (ConstrictionSize) given in pBltParams cannot be less than zero or larger than the target rectangle.
  • The alpha component of the background color must be opqaue.
  • The ProcAmp values given in pBltParams must be valid. For any ProcAmp settings that are supported by the driver, these values must fall within the ranges returned by the method.
  • The noise and detail filters given in pBltParams must be valid. For any filters that are supported by the driver, these values must fall within the ranges returned by the method.
  • The alpha value given in pBltParams must be in the range [0...1] inclusive.
  • For each input sample given in pSamples:
    • The start time cannot be greater than the end time.
    • A valid reference must be provided.
    • The source rectangle cannot be larger than the input surface.
    • The destination rectangle cannot be larger than than the destination surface.
    • The planar alpha must be in the range [0...1] inclusive.
  • For all rectangles (source, destination, and target), the rectangle cannot be inverted (left > right or top > bottom) or have negative values.
ms697022 HRESULT IDirectXVideoProcessor::VideoProcessBlt([In] IDirect3DSurface9* pRenderTarget,[In] const DXVA2_VideoProcessBltParams* pBltParams,[In, Buffer] const DXVA2_VideoSample* pSamples,[In] unsigned int NumSamples,[InOut, Optional] void** pHandleComplete) IDirectXVideoProcessor::VideoProcessBlt

Retrieves the DirectX Video Acceleration (DXVA) video processor service that created this video processor device.

ms700812 GetVideoProcessorService GetVideoProcessorService HRESULT IDirectXVideoProcessor::GetVideoProcessorService([Out] IDirectXVideoProcessorService** ppService)

Retrieves the capabilities of the video processor device.

ms704831 GetVideoProcessorCaps GetVideoProcessorCaps HRESULT IDirectXVideoProcessor::GetVideoProcessorCaps([Out] DXVA2_VideoProcessorCaps* pCaps)

Contains an initialization vector (IV) for 128-bit Advanced Encryption Standard CTR mode (AES-CTR) block cipher encryption.

For AES-CTR encyption, the pvPVPState member of the structure points to a structure.

The D3DAES_CTR_IV structure and the structure are equivalent.

ff728850 DXVA2_AES_CTR_IV DXVA2_AES_CTR_IV

The IV, in big-endian format.

ff728850 unsigned longlong IV unsigned longlong IV

The block count, in big-endian format.

ff728850 unsigned longlong Count unsigned longlong Count

Defines a 16-bit AYUV pixel value.

bb970388 DXVA2_AYUVSample16 DXVA2_AYUVSample16

Contains the Cr chroma value (also called V).

bb970388 unsigned short Cr unsigned short Cr

Contains the Cb chroma value (also called U).

bb970388 unsigned short Cb unsigned short Cb

Contains the luma value.

bb970388 unsigned short Y unsigned short Y

Contains the alpha value.

bb970388 unsigned short Alpha unsigned short Alpha

Defines an 8-bit AYUV pixel value.

bb970398 DXVA2_AYUVSample8 DXVA2_AYUVSample8

Contains the Cr chroma value (also called V).

bb970398 unsigned char Cr unsigned char Cr

Contains the Cb chroma value (also called U).

bb970398 unsigned char Cb unsigned char Cb

Contains the luma value.

bb970398 unsigned char Y unsigned char Y

Contains the alpha value.

bb970398 unsigned char Alpha unsigned char Alpha

Specifies how the output alpha values are calculated for blit operations when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

dd318391 DXVAHD_BLT_STATE_ALPHA_FILL_DATA DXVAHD_BLT_STATE_ALPHA_FILL_DATA

Specifies the alpha fill mode, as a member of the enumeration.

If the FeatureCaps member of the structure does not contain the flag, the alpha fill mode must be set to .

The default state value is .

dd318391 DXVAHD_ALPHA_FILL_MODE Mode DXVAHD_ALPHA_FILL_MODE Mode

Zero-based index of the input stream to use for the alpha values. This member is used when the alpha fill mode is ; otherwise, the value is ignored.

To get the maximum number of streams, call and check the MaxStreamStates member of the structure.

dd318391 unsigned int StreamNumber unsigned int StreamNumber

Specifies the background color for blit operations, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

The background color is used to fill the target rectangle wherever no video image appears. Areas outside the target rectangle are not affected. See .

The color space of the background color is determined by the color space of the output. See .

The alpha value of the background color is used only when the alpha fill mode is . Otherwise, the alpha value is ignored. See .

The default background color is full-range RGB black, with opaque alpha.

dd318392 DXVAHD_BLT_STATE_BACKGROUND_COLOR_DATA DXVAHD_BLT_STATE_BACKGROUND_COLOR_DATA

If TRUE, the BackgroundColor member specifies a YCbCr color. Otherwise, it specifies an RGB color. The default device state is (RGB color).

dd318392 BOOL YCbCr BOOL YCbCr

A union that specifies the background color. The default state value is (0.0, 0.0, 0.0, 1.0).

dd318392 DXVAHD_COLOR BackgroundColor DXVAHD_COLOR BackgroundColor

Specifies whether the output is downsampled in a blit operation, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

If the Enable member is TRUE, the device downsamples the composed target rectangle to the size given in the Size member, and then scales it back to the size of the target rectangle.

The width and height of Size must be greater than zero. If the size is larger than the target rectangle, downsampling does not occur.

To use this state, the device must support downsampling, indicated by the capability flag. To query for this capability, call . If the device supports downsampling, it sets the flag in the FeatureCaps member of the structure.

If the device does not support downsampling, the method fails for this state.

Downsampling is sometimes used to reduce the quality of premium content when other forms of content protection are not available.

dd318394 DXVAHD_BLT_STATE_CONSTRICTION_DATA DXVAHD_BLT_STATE_CONSTRICTION_DATA

If TRUE, downsampling is enabled. Otherwise, downsampling is disabled and the Size member is ignored. The default state value is (downsampling is disabled).

dd318394 BOOL Enable BOOL Enable

The sampling size. The default value is (1,1).

dd318394 SIZE Size SIZE Size

Specifies the output color space for blit operations, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

The RGB_Range member applies to RGB output, while the YCbCr_Matrix and YCbCr_xvYCC members apply to YCbCr (YUV) output. If the device performs color-space conversion on the background color, it uses the values that apply to both color spaces.

Extended YCbCr can be used with either transfer matrix. Extended YCbCr does not change the black point or white point?the black point is still 16 and the white point is still 235. However, extended YCbCr explicitly allows blacker-than-black values in the range 1?15, and whiter-than-white values in the range 236?254. When extended YCbCr is used, the driver should not clip the luma values to the nominal 16?235 range.

If the device supports extended YCbCr, it sets the capability flag in the DeviceCaps member of the structure. Otherwise, the device ignores the value of the YCbCr_xvYCC member and treats all YCbCr output as conventional YCbCr. To get the device's capabilities, call .

If the output format is a wide-gamut RGB format, output might fall outside the nominal [0...1] range of sRGB. This is particularly true if one or more input streams use extended YCbCr.

dd318395 DXVAHD_BLT_STATE_OUTPUT_COLOR_SPACE_DATA DXVAHD_BLT_STATE_OUTPUT_COLOR_SPACE_DATA
No documentation. dd318395 unsigned int Value unsigned int Value

Specifies whether the output is intended for playback or video processing (such as editing or authoring). The device can optimize the processing based on the type. The default state value is 0 (playback).

ValueMeaning
0

Playback.

1

Video processing.

?

dd318395 unsigned int Usage unsigned int Usage

Specifies the RGB color range. The default state value is 0 (full range).

ValueMeaning
0

Full range (0-255).

1

Limited range (16-235).

?

dd318395 unsigned int RGB_Range unsigned int RGB_Range

Specifies the YCbCr transfer matrix. The default state value is 0 (BT.601).

ValueMeaning
0

ITU-R BT.601.

1

ITU-R BT.709.

?

dd318395 unsigned int YCbCr_Matrix unsigned int YCbCr_Matrix

Specifies whether the output uses conventional YCbCr or extended YCbCr (xvYCC). The default state value is zero (conventional YCbCr).

ValueMeaning
0

Conventional YCbCr.

1

Extended YCbCr (xvYCC).

?

dd318395 unsigned int YCbCr_xvYCC unsigned int YCbCr_xvYCC
No documentation. dd318395 unsigned int Reserved unsigned int Reserved

Contains data for a private blit state for Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

Use this structure for proprietary or device-specific state parameters.

The caller allocates the pData array. Set the DataSize member to the size of the array in bytes. When retrieving the state data, you can set pData to null to get the size of the data. The device will return the size in the DataSize member.

dd318397 DXVAHD_BLT_STATE_PRIVATE_DATA DXVAHD_BLT_STATE_PRIVATE_DATA

A that identifies the private state. The meaning of this value is defined by the device.

dd318397 GUID Guid GUID Guid

The size, in bytes, of the buffer pointed to by the pData member.

dd318397 unsigned int DataSize unsigned int DataSize

A reference to a buffer that contains the private state data. The DXVA-HD runtime passes this buffer directly to the device without validation.

dd318397 void* pData void pData

Specifies the target rectangle for blitting, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

dd318400 DXVAHD_BLT_STATE_TARGET_RECT_DATA DXVAHD_BLT_STATE_TARGET_RECT_DATA

Specifies whether to use the target rectangle. The default state value is .

ValueMeaning
TRUE

Use the target rectangle specified by the TargetRect member.

Use the entire destination surface as the target rectangle. Ignore the TargetRect member.

?

dd318400 BOOL Enable BOOL Enable

Specifies the target rectangle. The target rectangle is the area within the destination surface where the output will be drawn. The target rectangle is given in pixel coordinates, relative to the destination surface. The default state value is an empty rectangle, (0, 0, 0, 0).

If the Enable member is , the TargetRect member is ignored.

dd318400 RECT TargetRect RECT TargetRect

Defines a color value for Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

This union can represent both RGB and YCbCr colors. The interpretation of the union depends on the context.

dd318402 DXVAHD_COLOR DXVAHD_COLOR

A structure that contains an RGB color value.

dd318402 DXVAHD_COLOR_RGBA RGB DXVAHD_COLOR_RGBA RGB

A structure that contains a YCbCr color value.

dd318402 DXVAHD_COLOR_YCbCrA YCbCr DXVAHD_COLOR_YCbCrA YCbCr

Specifies an RGB color value.

The RGB values have a nominal range of [0...1]. For an RGB format with n bits per channel, the value of each color component is calculated as follows:

val = f * ((1 << n)-1)

For example, for RGB-32 (8 bits per channel), val = BYTE(f * 255.0).

For full-range RGB, reference black is (0.0, 0.0, 0.0), which corresponds to (0, 0, 0) in an 8-bit representation. For limited-range RGB, reference black is (0.0625, 0.0625, 0.0625), which corresponds to (16, 16, 16) in an 8-bit representation. For wide-gamut formats, the values might fall outside of the [0...1] range.

dd318405 DXVAHD_COLOR_RGBA DXVAHD_COLOR_RGBA

The red value.

dd318405 float R float R

The green value.

dd318405 float G float G

The blue value.

dd318405 float B float B

The alpha value. Values range from 0 (transparent) to 1 (opaque).

dd318405 float A float A

Defines a color value for Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

This union can represent both RGB and YCbCr colors. The interpretation of the union depends on the context.

dd318402 DXVAHD_COLOR_YCbCrA DXVAHD_COLOR_YCbCrA

A structure that contains an RGB color value.

dd318402 float Y float Y

A structure that contains a YCbCr color value.

dd318402 float Cb float Cb
No documentation. dd318402 float Cr float Cr No documentation. dd318402 float A float A

Describes the configuration of a DXVA decoder device.

ms694823 DXVA2_ConfigPictureDecode DXVA2_ConfigPictureDecode

Defines the encryption protocol type for bit-stream data buffers. If no encryption is applied, the value is DXVA_NoEncrypt. If ConfigBitstreamRaw is 0, the value must be DXVA_NoEncrypt.

ms694823 GUID guidConfigBitstreamEncryption GUID guidConfigBitstreamEncryption

Defines the encryption protocol type for macroblock control data buffers. If no encryption is applied, the value is DXVA_NoEncrypt. If ConfigBitstreamRaw is 1, the value must be DXVA_NoEncrypt.

ms694823 GUID guidConfigMBcontrolEncryption GUID guidConfigMBcontrolEncryption

Defines the encryption protocol type for residual difference decoding data buffers (buffers containing spatial-domain data or sets of transform-domain coefficients for accelerator-based IDCT). If no encryption is applied, the value is DXVA_NoEncrypt. If ConfigBitstreamRaw is 1, the value must be DXVA_NoEncrypt.

ms694823 GUID guidConfigResidDiffEncryption GUID guidConfigResidDiffEncryption

Indicates whether the host-decoder sends raw bit-stream data. If the value is 1, the data for the pictures will be sent in bit-stream buffers as raw bit-stream content. If the value is 0, picture data will be sent using macroblock control command buffers. If either ConfigResidDiffHost or ConfigResidDiffAccelerator is 1, the value must be 0.

ms694823 unsigned int ConfigBitstreamRaw unsigned int ConfigBitstreamRaw

Specifies whether macroblock control commands are in raster scan order or in arbitrary order. If the value is 1, the macroblock control commands within each macroblock control command buffer are in raster-scan order. If the value is 0, the order is arbitrary. For some types of bit streams, forcing raster order either greatly increases the number of required macroblock control buffers that must be processed, or requires host reordering of the control information. Therefore, supporting arbitrary order can be more efficient.

ms694823 unsigned int ConfigMBcontrolRasterOrder unsigned int ConfigMBcontrolRasterOrder

Contains the host residual difference configuration. If the value is 1, some residual difference decoding data may be sent as blocks in the spatial domain from the host. If the value is 0, spatial domain data will not be sent.

ms694823 unsigned int ConfigResidDiffHost unsigned int ConfigResidDiffHost

Indicates the word size used to represent residual difference spatial-domain blocks for predicted (non-intra) pictures when using host-based residual difference decoding.

If ConfigResidDiffHost is 1 and ConfigSpatialResid8 is 1, the host will send residual difference spatial-domain blocks for non-intra macroblocks using 8-bit signed samples and for intra macroblocks in predicted (non-intra) pictures in a format that depends on the value of ConfigIntraResidUnsigned:

  • If ConfigIntraResidUnsigned is 0, spatial-domain blocks for intra macroblocks are sent as 8-bit signed integer values relative to a constant reference value of 2^(BPP?1).
  • If ConfigIntraResidUnsigned is 1, spatial-domain blocks for intra macroblocks are sent as 8-bit unsigned integer values relative to a constant reference value of 0.

If ConfigResidDiffHost is 1 and ConfigSpatialResid8 is 0, the host will send residual difference spatial-domain blocks of data for non-intra macroblocks using 16- bit signed samples and for intra macroblocks in predicted (non-intra) pictures in a format that depends on the value of ConfigIntraResidUnsigned:

  • If ConfigIntraResidUnsigned is 0, spatial domain blocks for intra macroblocks are sent as 16-bit signed integer values relative to a constant reference value of 2^(BPP?1).
  • If ConfigIntraResidUnsigned is 1, spatial domain blocks for intra macroblocks are sent as 16-bit unsigned integer values relative to a constant reference value of 0.

If ConfigResidDiffHost is 0, ConfigSpatialResid8 must be 0.

For intra pictures, spatial-domain blocks must be sent using 8-bit samples if bits-per-pixel (BPP) is 8, and using 16-bit samples if BPP > 8. If ConfigIntraResidUnsigned is 0, these samples are sent as signed integer values relative to a constant reference value of 2^(BPP?1), and if ConfigIntraResidUnsigned is 1, these samples are sent as unsigned integer values relative to a constant reference value of 0.

ms694823 unsigned int ConfigSpatialResid8 unsigned int ConfigSpatialResid8

If the value is 1, 8-bit difference overflow blocks are subtracted rather than added. The value must be 0 unless ConfigSpatialResid8 is 1.

The ability to subtract differences rather than add them enables 8-bit difference decoding to be fully compliant with the full ?255 range of values required in video decoder specifications, because +255 cannot be represented as the addition of two signed 8-bit numbers, but any number in the range ?255 can be represented as the difference between two signed 8-bit numbers (+255 = +127 minus ?128).

ms694823 unsigned int ConfigResid8Subtraction unsigned int ConfigResid8Subtraction

If the value is 1, spatial-domain blocks for intra macroblocks must be clipped to an 8-bit range on the host and spatial-domain blocks for non-intra macroblocks must be clipped to a 9-bit range on the host. If the value is 0, no such clipping is necessary by the host.

The value must be 0 unless ConfigSpatialResid8 is 0 and ConfigResidDiffHost is 1.

ms694823 unsigned int ConfigSpatialHost8or9Clipping unsigned int ConfigSpatialHost8or9Clipping

If the value is 1, any spatial-domain residual difference data must be sent in a chrominance-interleaved form matching the YUV format chrominance interleaving pattern. The value must be 0 unless ConfigResidDiffHost is 1 and the YUV format is NV12 or NV21.

ms694823 unsigned int ConfigSpatialResidInterleaved unsigned int ConfigSpatialResidInterleaved

Indicates the method of representation of spatial-domain blocks of residual difference data for intra blocks when using host-based difference decoding.

If ConfigResidDiffHost is 1 and ConfigIntraResidUnsigned is 0, spatial-domain residual difference data blocks for intra macroblocks must be sent as follows:

  • In a non-intra picture, if ConfigSpatialResid8 is 0, the spatial-domain residual difference data blocks for intra macroblocks are sent as 16-bit signed integer values relative to a constant reference value of 2^(BPP?1).
  • In a non-intra picture, if ConfigSpatialResid8 is 1, the spatial-domain residual difference data blocks for intra macroblocks are sent as 8-bit signed integer values relative to a constant reference value of 2^(BPP?1).
  • In an intra picture, if BPP is 8, the spatial-domain residual difference data blocks for intra macroblocks are sent as 8-bit signed integer values relative to a constant reference value of 2^(BPP?1), regardless of the value of ConfigSpatialResid8.

If ConfigResidDiffHost is 1 and ConfigIntraResidUnsigned is 1, spatial-domain residual difference data blocks for intra macroblocks must be sent as follows:

  • In a non-intra picture, if ConfigSpatialResid8 is 0, the spatial-domain residual difference data blocks for intra macroblocks must be sent as 16-bit unsigned integer values relative to a constant reference value of 0.
  • In a non-intra picture, if ConfigSpatialResid8 is 1, the spatial-domain residual difference data blocks for intra macroblocks are sent as 8-bit unsigned integer values relative to a constant reference value of 0.
  • In an intra picture, if BPP is 8, the spatial-domain residual difference data blocks for intra macroblocks are sent as 8-bit unsigned integer values relative to a constant reference value of 0, regardless of the value of ConfigSpatialResid8.

The value of the member must be 0 unless ConfigResidDiffHost is 1.

ms694823 unsigned int ConfigIntraResidUnsigned unsigned int ConfigIntraResidUnsigned

If the value is 1, transform-domain blocks of coefficient data may be sent from the host for accelerator-based IDCT. If the value is 0, accelerator-based IDCT will not be used. If both ConfigResidDiffHost and ConfigResidDiffAccelerator are 1, this indicates that some residual difference decoding will be done on the host and some on the accelerator, as indicated by macroblock-level control commands.

The value must be 0 if ConfigBitstreamRaw is 1.

ms694823 unsigned int ConfigResidDiffAccelerator unsigned int ConfigResidDiffAccelerator

If the value is 1, the inverse scan for transform-domain block processing will be performed on the host, and absolute indices will be sent instead for any transform coefficients. If the value is 0, the inverse scan will be performed on the accelerator.

The value must be 0 if ConfigResidDiffAccelerator is 0 or if Config4GroupedCoefs is 1.

ms694823 unsigned int ConfigHostInverseScan unsigned int ConfigHostInverseScan

If the value is 1, the IDCT specified in Annex W of ITU-T Recommendation H.263 is used. If the value is 0, any compliant IDCT can be used for off-host IDCT.

The H.263 annex does not comply with the IDCT requirements of MPEG-2 corrigendum 2, so the value must not be 1 for use with MPEG-2 video.

The value must be 0 if ConfigResidDiffAccelerator is 0, indicating purely host-based residual difference decoding.

ms694823 unsigned int ConfigSpecificIDCT unsigned int ConfigSpecificIDCT

If the value is 1, transform coefficients for off-host IDCT will be sent using the DXVA_TCoef4Group structure. If the value is 0, the DXVA_TCoefSingle structure is used. The value must be 0 if ConfigResidDiffAccelerator is 0 or if ConfigHostInverseScan is 1.

ms694823 unsigned int Config4GroupedCoefs unsigned int Config4GroupedCoefs

Specifies how many frames the decoder device processes at any one time.

ms694823 unsigned short ConfigMinRenderTargetBuffCount unsigned short ConfigMinRenderTargetBuffCount

Contains decoder-specific configuration information.

ms694823 unsigned short ConfigDecoderSpecific unsigned short ConfigDecoderSpecific

Describes a video stream for a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor.

The display driver can use the information in this structure to optimize the capabilities of the video processor. For example, some capabilities might not be exposed for high-definition (HD) content, for performance reasons.

Frame rates are expressed as ratios. For example, 30 frames per second (fps) is expressed as 30:1, and 29.97 fps is expressed as 30000/1001. For interlaced content, a frame consists of two fields, so that the frame rate is half the field rate.

If the application will composite two or more input streams, use the largest stream for the values of InputWidth and InputHeight.

dd318409 DXVAHD_CONTENT_DESC DXVAHD_CONTENT_DESC

A member of the enumeration that describes how the video stream is interlaced.

dd318409 DXVAHD_FRAME_FORMAT InputFrameFormat DXVAHD_FRAME_FORMAT InputFrameFormat

The frame rate of the input video stream, specified as a structure.

dd318409 DXVAHD_RATIONAL InputFrameRate DXVAHD_RATIONAL InputFrameRate

The width of the input frames, in pixels.

dd318409 unsigned int InputWidth unsigned int InputWidth

The height of the input frames, in pixels.

dd318409 unsigned int InputHeight unsigned int InputHeight

The frame rate of the output video stream, specified as a structure.

dd318409 DXVAHD_RATIONAL OutputFrameRate DXVAHD_RATIONAL OutputFrameRate

The width of the output frames, in pixels.

dd318409 unsigned int OutputWidth unsigned int OutputWidth

The height of the output frames, in pixels.

dd318409 unsigned int OutputHeight unsigned int OutputHeight

Specifies a custom rate for frame-rate conversion or inverse telecine (IVTC).

The CustomRate member gives the rate conversion factor, while the remaining members define the pattern of input and output samples.

Here are some example uses for this structure:

  • Frame rate conversion from 60p to 120p (doubling the frame rate).

    • CustomRate: 2/1
    • OutputFrames: 2
    • InputInterlaced:
    • InputFramesOrFields: 1
  • Reverse 2:3 pulldown (IVTC) from 60i to 24p.

    • CustomRate: 4/5
    • OutputFrames: 4
    • InputInterlaced: TRUE
    • InputFramesOrFields: 10

    (Ten interlaced fields are converted into four progressive frames.)

dd318414 DXVAHD_CUSTOM_RATE_DATA DXVAHD_CUSTOM_RATE_DATA

The ratio of the output frame rate to the input frame rate, expressed as a structure that holds a rational number.

dd318414 DXVAHD_RATIONAL CustomRate DXVAHD_RATIONAL CustomRate

The number of output frames that will be generated for every N input samples, where N = InputFramesOrFields.

dd318414 unsigned int OutputFrames unsigned int OutputFrames

If TRUE, the input stream must be interlaced. Otherwise, the input stream must be progressive.

dd318414 BOOL InputInterlaced BOOL InputInterlaced

The number of input fields or frames for every N output frames that will be generated, where N = OutputFrames.

dd318414 unsigned int InputFramesOrFields unsigned int InputFramesOrFields

Describes a buffer sent from a decoder to a DirectX Video Acceleration (DXVA) device.

This structure corresponds closely to the DXVA_BufferDescription structure in DXVA 1, but some of the fields are no longer used in DXVA 2.

ms704794 DXVA2_DecodeBufferDesc DXVA2_DecodeBufferDesc

Identifies the type of buffer passed to the accelerator. Must be one of the following values.

ValueMeaning

Picture decoding parameter buffer.

Macroblock control command buffer.

Residual difference block data buffer.

Deblocking filter control command buffer.

Inverse quantization matrix buffer.

Slice-control buffer.

Bitstream data buffer.

Motion vector buffer.

Film grain synthesis data buffer.

?

ms704794 unsigned int CompressedBufferType unsigned int CompressedBufferType

Reserved. Set to zero.

ms704794 unsigned int BufferIndex unsigned int BufferIndex

Specifies the offset of the relevant data from the beginning of the buffer, in bytes. Currently this value must be zero.

ms704794 unsigned int DataOffset unsigned int DataOffset

Specifies the amount of relevant data in the buffer, in bytes. The location of the last byte of content in the buffer is DataOffset + DataSize ? 1.

ms704794 unsigned int DataSize unsigned int DataSize

Specifies the macroblock address of the first macroblock in the buffer. The macroblock address is given in raster scan order.

ms704794 unsigned int FirstMBaddress unsigned int FirstMBaddress

Specifies the number of macroblocks of data in the buffer. This count includes skipped macroblocks. This value must be zero if the data buffer type is one of the following: picture decoding parameters, inverse-quantization matrix, AYUV, IA44/AI44, DPXD, Highlight, or DCCMD.

ms704794 unsigned int NumMBsInBuffer unsigned int NumMBsInBuffer

Reserved. Set to zero.

ms704794 unsigned int Width unsigned int Width

Reserved. Set to zero.

ms704794 unsigned int Height unsigned int Height

Reserved. Set to zero.

ms704794 unsigned int Stride unsigned int Stride

Reserved. Set to zero.

ms704794 unsigned int ReservedBits unsigned int ReservedBits

Pointer to a byte array that contains an initialization vector (IV) for encrypted data. If the decode buffer does not contain encrypted data, set this member to null. If the decode buffer contains encrypted data, the contents of pvPVPState depends on the type of encryption. For D3DCRYPTOTYPE_AES128_CTR, the pvPVPState member points to a structure.

ms704794 void* pvPVPState void pvPVPState

Contains parameters for the method.

ms704591 DXVA2_DecodeExecuteParams DXVA2_DecodeExecuteParams
No documentation. ms704591 unsigned int NumCompBuffers unsigned int NumCompBuffers No documentation. ms704591 DXVA2_DecodeBufferDesc* pCompressedBuffers DXVA2_DecodeBufferDesc pCompressedBuffers No documentation. ms704591 DXVA2_DecodeExtensionData* pExtensionData DXVA2_DecodeExtensionData pExtensionData

Contains private data for the method.

This structure corresponds to parameters of the IAMVideoAccelerator::Execute method in DirectX Video Acceleration (DXVA) version 1.

ms696173 DXVA2_DecodeExtensionData DXVA2_DecodeExtensionData
No documentation. ms696173 unsigned int Function unsigned int Function No documentation. ms696173 void* pPrivateInputData void pPrivateInputData No documentation. ms696173 unsigned int PrivateInputDataSize unsigned int PrivateInputDataSize No documentation. ms696173 void* pPrivateOutputData void pPrivateOutputData No documentation. ms696173 unsigned int PrivateOutputDataSize unsigned int PrivateOutputDataSize No documentation. DXVAHDETW_CREATEVIDEOPROCESSOR DXVAHDETW_CREATEVIDEOPROCESSOR No documentation. unsigned longlong pObject unsigned longlong pObject No documentation. unsigned longlong pD3D9Ex unsigned longlong pD3D9Ex No documentation. GUID VPGuid GUID VPGuid No documentation. DXVAHDETW_DESTROYVIDEOPROCESSOR DXVAHDETW_DESTROYVIDEOPROCESSOR No documentation. unsigned longlong pObject unsigned longlong pObject No documentation. DXVAHDETW_VIDEOPROCESSBLTHD DXVAHDETW_VIDEOPROCESSBLTHD No documentation. unsigned longlong pObject unsigned longlong pObject No documentation. unsigned longlong pOutputSurface unsigned longlong pOutputSurface No documentation. RECT TargetRect RECT TargetRect No documentation. D3DFORMAT OutputFormat D3DFORMAT OutputFormat No documentation. unsigned int ColorSpace unsigned int ColorSpace No documentation. unsigned int OutputFrame unsigned int OutputFrame No documentation. unsigned int StreamCount unsigned int StreamCount No documentation. BOOL Enter BOOL Enter No documentation. DXVAHDETW_VIDEOPROCESSBLTHD_STREAM DXVAHDETW_VIDEOPROCESSBLTHD_STREAM No documentation. unsigned longlong pObject unsigned longlong pObject No documentation. unsigned longlong pInputSurface unsigned longlong pInputSurface No documentation. RECT SourceRect RECT SourceRect No documentation. RECT DestinationRect RECT DestinationRect No documentation. D3DFORMAT InputFormat D3DFORMAT InputFormat No documentation. DXVAHD_FRAME_FORMAT FrameFormat DXVAHD_FRAME_FORMAT FrameFormat No documentation. unsigned int ColorSpace unsigned int ColorSpace No documentation. unsigned int StreamNumber unsigned int StreamNumber No documentation. unsigned int OutputIndex unsigned int OutputIndex No documentation. unsigned int InputFrameOrField unsigned int InputFrameOrField No documentation. unsigned int PastFrames unsigned int PastFrames No documentation. unsigned int FutureFrames unsigned int FutureFrames No documentation. DXVAHDETW_VIDEOPROCESSBLTSTATE DXVAHDETW_VIDEOPROCESSBLTSTATE No documentation. unsigned longlong pObject unsigned longlong pObject No documentation. DXVAHD_BLT_STATE State DXVAHD_BLT_STATE State No documentation. unsigned int DataSize unsigned int DataSize No documentation. BOOL SetState BOOL SetState No documentation. DXVAHDETW_VIDEOPROCESSSTREAMSTATE DXVAHDETW_VIDEOPROCESSSTREAMSTATE No documentation. unsigned longlong pObject unsigned longlong pObject No documentation. unsigned int StreamNumber unsigned int StreamNumber No documentation. DXVAHD_STREAM_STATE State DXVAHD_STREAM_STATE State No documentation. unsigned int DataSize unsigned int DataSize No documentation. BOOL SetState BOOL SetState

Describes the format of a video stream.

Most of the values in this structure can be translated directly to and from attributes. For a code example that fills in the values from an reference, see .

ms704798 DXVA2_ExtendedFormat DXVA2_ExtendedFormat

Use this member to access all of the bits in the union.

ms704798 unsigned int value unsigned int value

Describes the interlacing of the video frames. Contains a value from the enumeration.

ms704798 unsigned int SampleFormat unsigned int SampleFormat

Describes the chroma siting. Contains a value from the enumeration.

ms704798 unsigned int VideoChromaSubsampling unsigned int VideoChromaSubsampling

Describes the nominal range of the Y'CbCr or RGB color data. Contains a value from the enumeration.

ms704798 unsigned int NominalRange unsigned int NominalRange

Describes the transform from Y'PbPr (component video) to studio R'G'B'. Contains a value from the enumeration.

ms704798 unsigned int VideoTransferMatrix unsigned int VideoTransferMatrix

Describes the intended viewing conditions. Contains a value from the enumeration.

ms704798 unsigned int VideoLighting unsigned int VideoLighting

Describes the color primaries. Contains a value from the enumeration.

ms704798 unsigned int VideoPrimaries unsigned int VideoPrimaries

Describes the gamma correction transfer function. Contains a value from the enumeration.

ms704798 unsigned int VideoTransferFunction unsigned int VideoTransferFunction

Defines the range of supported values for an image filter.

The multiplier enables the filter range to have a fractional step value.

For example, a hue filter might have an actual range of [-180.0 ... +180.0] with a step size of 0.25. The device would report the following range and multiplier:

  • Minimum: -720
  • Maximum: +720
  • Multiplier: 0.25

In this case, a filter value of 2 would be interpreted by the device as 0.50 (or 2 ? 0.25).

The device should use a multiplier that can be represented exactly as a base-2 fraction.

dd318428 DXVAHD_FILTER_RANGE_DATA DXVAHD_FILTER_RANGE_DATA

The minimum value of the filter.

dd318428 int Minimum int Minimum

The maximum value of the filter.

dd318428 int Maximum int Maximum

The default value of the filter.

dd318428 int Default int Default

A multiplier. Use the following formula to translate the filter setting into the actual filter value: Actual Value = Set Value???Multiplier.

dd318428 float Multiplier float Multiplier

Contains parameters for a DirectX Video Acceleration (DXVA) image filter.

ms697015 DXVA2_FilterValues DXVA2_FilterValues

Filter level.

ms697015 DXVA2_Fixed32 Level DXVA2_Fixed32 Level

Filter threshold.

ms697015 DXVA2_Fixed32 Threshold DXVA2_Fixed32 Threshold

Filter radius.

ms697015 DXVA2_Fixed32 Radius DXVA2_Fixed32 Radius

Returns a structure that contains an opaque alpha value.

You can use this function for DirectX Video Acceleration (DXVA) operations that require alpha values expressed as fixed-point numbers.

aa473831 DXVA2_Fixed32 DXVA2_Fixed32
No documentation. aa473831 unsigned short Fraction unsigned short Fraction No documentation. aa473831 short Value short Value No documentation. aa473831 int ll int ll

Defines a video frequency.

The value 0/0 indicates an unknown frequency. Values of the form n/0, where n is not zero, are invalid. Values of the form 0/n, where n is not zero, indicate a frequency of zero.

ms693574 DXVA2_Frequency DXVA2_Frequency

Numerator of the frequency.

ms693574 unsigned int Numerator unsigned int Numerator

Denominator of the frequency.

ms693574 unsigned int Denominator unsigned int Denominator

Contains values for DirectX Video Acceleration (DXVA) video processing operations.

ms703115 DXVA2_ProcAmpValues DXVA2_ProcAmpValues

Brightness value.

ms703115 DXVA2_Fixed32 Brightness DXVA2_Fixed32 Brightness

Contrast value.

ms703115 DXVA2_Fixed32 Contrast DXVA2_Fixed32 Contrast

Hue value.

ms703115 DXVA2_Fixed32 Hue DXVA2_Fixed32 Hue

Saturation value.

ms703115 DXVA2_Fixed32 Saturation DXVA2_Fixed32 Saturation

Contains a rational number (ratio).

Values of the form 0/n are interpreted as zero. The value 0/0 is interpreted as zero. However, these values are not necessarily valid in all contexts.

Values of the form n/0, where n is nonzero, are invalid.

dd318756 DXVAHD_RATIONAL DXVAHD_RATIONAL

The numerator of the ratio.

dd318756 unsigned int Numerator unsigned int Numerator

The denominator of the ratio.

dd318756 unsigned int Denominator unsigned int Denominator

Contains per-stream data for the method.

dd318757 DXVAHD_STREAM_DATA DXVAHD_STREAM_DATA
No documentation. dd318757 BOOL Enable BOOL Enable No documentation. dd318757 unsigned int OutputIndex unsigned int OutputIndex No documentation. dd318757 unsigned int InputFrameOrField unsigned int InputFrameOrField No documentation. dd318757 unsigned int PastFrames unsigned int PastFrames No documentation. dd318757 unsigned int FutureFrames unsigned int FutureFrames No documentation. dd318757 IDirect3DSurface9** ppPastSurfaces IDirect3DSurface9 ppPastSurfaces No documentation. dd318757 IDirect3DSurface9* pInputSurface IDirect3DSurface9 pInputSurface No documentation. dd318757 IDirect3DSurface9** ppFutureSurfaces IDirect3DSurface9 ppFutureSurfaces

Specifies the planar alpha value for an input stream, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

For each pixel, the destination color value is computed as follows:

Cd = Cs * (As * Ap * Ae) + Cd * (1.0 - As * Ap * Ae)

where

  • Cd = Color value of the destination pixel.
  • Cs = Color value of source pixel.
  • As = Per-pixel source alpha.
  • Ap = Planar alpha value.
  • Ae = Palette-entry alpha value, or 1.0 (see Note).

Note??Palette-entry alpha values apply only to palettized color formats, and only when the device supports the capability. Otherwise, this factor equals 1.0.

The destination alpha value is computed according to the state. For more information, see .

To get the device capabilities, call and check the FeatureCaps member of the structure.

dd318759 DXVAHD_STREAM_STATE_ALPHA_DATA DXVAHD_STREAM_STATE_ALPHA_DATA

If TRUE, alpha blending is enabled. Otherwise, alpha blending is disabled. The default state value is .

dd318759 BOOL Enable BOOL Enable

Specifies the planar alpha value as a floating-point number from 0.0 (transparent) to 1.0 (opaque).

If the Enable member is , this member is ignored.

dd318759 float Alpha float Alpha

Specifies the pixel aspect ratio (PAR) for the source and destination rectangles.

Pixel aspect ratios of the form 0/n and n/0 are not valid.

If the Enable member is , the device ignores the values of SourceAspectRatio and DestinationAspectRatio.

dd318760 DXVAHD_STREAM_STATE_ASPECT_RATIO_DATA DXVAHD_STREAM_STATE_ASPECT_RATIO_DATA

If TRUE, the SourceAspectRatio and DestinationAspectRatio members contain valid values. Otherwise, the pixel aspect ratios are unspecified.

dd318760 BOOL Enable BOOL Enable

A structure that contains the source PAR. The default state value is 1:1 (square pixels).

dd318760 DXVAHD_RATIONAL SourceAspectRatio DXVAHD_RATIONAL SourceAspectRatio

A structure that contains the destination PAR. The default state value is 1:1 (square pixels).

dd318760 DXVAHD_RATIONAL DestinationAspectRatio DXVAHD_RATIONAL DestinationAspectRatio

Specifies the format for an input stream, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

dd318761 DXVAHD_STREAM_STATE_D3DFORMAT_DATA DXVAHD_STREAM_STATE_D3DFORMAT_DATA

The surface format, specified as a value. You can also use a FOURCC code to specify a format that is not defined in the enumeration. For more information, see Video FOURCCs.

The default state value is .

dd318761 D3DFORMAT Format D3DFORMAT Format

Specifies the destination rectangle for an input stream, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

dd318762 DXVAHD_STREAM_STATE_DESTINATION_RECT_DATA DXVAHD_STREAM_STATE_DESTINATION_RECT_DATA

Specifies whether to use the destination rectangle, or use the entire output surface. The default state value is .

ValueMeaning
TRUE

Use the destination rectangle given in the DestinationRect member.

Use the entire output surface as the destination rectangle.

?

dd318762 BOOL Enable BOOL Enable

The destination rectangle, which defines the portion of the output surface where the source rectangle is blitted. The destination rectangle is given in pixel coordinates, relative to the output surface. The default value is an empty rectangle, (0, 0, 0, 0).

If the Enable member is , the DestinationRect member is ignored.

dd318762 RECT DestinationRect RECT DestinationRect

Specifies the level for a filtering operation on a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) input stream.

For a list of image filters that are defined for DXVA-HD, see . The device might not support every type of image filter. To find out whether the device supports a particular filter, call the method and check the FilterCaps member of the structure.

dd318763 DXVAHD_STREAM_STATE_FILTER_DATA DXVAHD_STREAM_STATE_FILTER_DATA

If TRUE, the filter is enabled. Otherwise, the filter is disabled.

dd318763 BOOL Enable BOOL Enable

The level for the filter. The meaning of this value depends on the implementation. To get the range and default value of a particular filter, call the method.

If the Enable member is , the Level member is ignored.

dd318763 int Level int Level

Specifies how a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) input stream is interlaced.

Some devices do not support interlaced RGB. Interlaced RGB support is indicated by the capability flag. If the device does not support interlaced RGB, it treats all RGB input streams as progressive frames.

Some devices do not support interlaced formats with palettized color. This support is indicated by the flag. If the device does not support this capability, all palettized input streams are treated as progressive frames.

To get the device's capabilities, call and check the InputFormatCaps member of the structure.

dd318764 DXVAHD_STREAM_STATE_FRAME_FORMAT_DATA DXVAHD_STREAM_STATE_FRAME_FORMAT_DATA

The video interlacing, specified as a value.

The default state value is (progressive frames).

dd318764 DXVAHD_FRAME_FORMAT FrameFormat DXVAHD_FRAME_FORMAT FrameFormat

Specifies the color space for a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) input stream.

The RGB_Range member applies to RGB input, while the YCbCr_Matrix and YCbCr_xvYCC members apply to YCbCr (YUV) input.

In some situations, the device might perform an intermediate color conversion on the input stream. If so, it uses the flags that apply to both color spaces. For example, suppose the device converts from RGB to YCbCr. If the RGB_Range member is 0 and the YCbCr_Matrix member is 1, the device will convert from full-range RGB to BT.709 YCbCr.

If the device supports xvYCC, it returns the capability flag in the DeviceCaps member of the structure. Otherwise, the device ignores the value of YCbCr_xvYCC and treats all YCbCr input as conventional YCbCr. To get the device's capabilities, call .

dd318765 DXVAHD_STREAM_STATE_INPUT_COLOR_SPACE_DATA DXVAHD_STREAM_STATE_INPUT_COLOR_SPACE_DATA
No documentation. dd318765 unsigned int Value unsigned int Value

Specifies whether the input stream contains video or graphics. The device can optimize the processing based on the type. The default state value is 0 (video).

ValueMeaning
0

Video.

1

Graphics.

?

dd318765 unsigned int Type unsigned int Type

Specifies the RGB color range. The default state value is 0 (full range).

ValueMeaning
0

Full range (0-255).

1

Limited range (16-235).

?

dd318765 unsigned int RGB_Range unsigned int RGB_Range

Specifies the YCbCr transfer matrix. The default state value is 0 (BT.601).

ValueMeaning
0

ITU-R BT.601.

1

ITU-R BT.709.

?

dd318765 unsigned int YCbCr_Matrix unsigned int YCbCr_Matrix

Specifies whether the input stream uses conventional YCbCr or extended YCbCr (xvYCC). The default state value is 0 (conventional YCbCr).

ValueMeaning
0

Conventional YCbCr.

1

Extended YCbCr (xvYCC).

?

dd318765 unsigned int YCbCr_xvYCC unsigned int YCbCr_xvYCC
No documentation. dd318765 unsigned int Reserved unsigned int Reserved

Specifies the luma key for an input stream, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

To use this state, the device must support luma keying, indicated by the capability flag. To query for this capability, call . If the device supports luma keying, it sets the flag in the FeatureCaps member of the structure.

If the device does not support luma keying, the method fails for this state.

If the input format is RGB, the device must also support the capability. This capability flag is set in the InputFormatCaps member of the structure. If the flag is not present, the device ignores the luma key value for RGB input.

The values of Lower and Upper give the lower and upper bounds of the luma key, using a nominal range of [0...1]. Given a format with n bits per channel, these values are converted to luma values as follows:

val = f * ((1 << n)-1)

Any pixel whose luma value falls within the upper and lower bounds (inclusive) is treated as transparent.

For example, if the pixel format uses 8-bit luma, the upper bound is calculated as follows:

BYTE Y = BYTE(max(min(1.0, Upper), 0.0) * 255.0)

Note that the value is clamped to the range [0...1] before multiplying by 255.

dd318766 DXVAHD_STREAM_STATE_LUMA_KEY_DATA DXVAHD_STREAM_STATE_LUMA_KEY_DATA

If TRUE, luma keying is enabled. Otherwise, luma keying is disabled. The default value is .

dd318766 BOOL Enable BOOL Enable

The lower bound for the luma key. The range is [0?1]. The default state value is 0.0.

dd318766 float Lower float Lower

The upper bound for the luma key. The range is [0?1]. The default state value is 0.0.

dd318766 float Upper float Upper

Specifies the output frame rate for an input stream when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

The output rate might require the device to convert the frame rate of the input stream. If so, the value of RepeatFrame controls whether the device creates interpolated frames or simply repeats input frames.

dd318767 DXVAHD_STREAM_STATE_OUTPUT_RATE_DATA DXVAHD_STREAM_STATE_OUTPUT_RATE_DATA

Specifies how the device performs frame-rate conversion, if required. The default state value is (interpolation).

ValueMeaning
TRUE

The device repeats frames.

The device interpolates frames.

?

dd318767 BOOL RepeatFrame BOOL RepeatFrame

Specifies the output rate, as a member of the enumeration.

dd318767 DXVAHD_OUTPUT_RATE OutputRate DXVAHD_OUTPUT_RATE OutputRate

Specifies a custom output rate, as a structure. This member is ignored unless OutputRate equals . The default state value is 1/1.

To get the list of custom rates supported by the video processor, call . If a custom rate is used, it must be taken from this list.

dd318767 DXVAHD_RATIONAL CustomRate DXVAHD_RATIONAL CustomRate

Contains the color palette entries for an input stream, when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

This stream state is used for input streams that have a palettized color format. Palettized formats with 4 bits per pixel (bpp) use the first 16 entries in the list. Formats with 8 bpp use the first 256 entries.

If a pixel has a palette index greater than the number of entries, the device treats the pixel as being white with opaque alpha. For full-range RGB, this value will be (255, 255, 255, 255); for YCbCr the value will be (255, 235, 128, 128).

The caller allocates the pEntries array. Set the Count member to the number of elements in the array. When retrieving the state data, you can set the pEntries member to null to get the number of palette entries. The device will return the count in the Count member.

If the DXVA-HD device does not have the capability, every palette entry must have an alpha value of 0xFF (opaque). Otherwise, an error is returned from .

To get the device capabilities, call and check the FeatureCaps member of the structure.

dd318768 DXVAHD_STREAM_STATE_PALETTE_DATA DXVAHD_STREAM_STATE_PALETTE_DATA

The number of palette entries. The default state value is 0.

dd318768 unsigned int Count unsigned int Count

A reference to an array of values. For RGB streams, the palette entries use a (ARGB-32) representation. For YCbCr streams, the palette entries use an AYUV representation. The alpha channel is used for alpha blending; see .

dd318768 void* pEntries void pEntries

Contains data for a private stream state, for a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) input stream.

Use this structure for proprietary or device-specific state parameters.

The caller allocates the pData array. Set the DataSize member to the size of the array in bytes. When retrieving the state data, you can set the pData member to null to get the size of the data. The device will return the size in the DataSize member.

dd318769 DXVAHD_STREAM_STATE_PRIVATE_DATA DXVAHD_STREAM_STATE_PRIVATE_DATA

A that identifies the private stream state. The following is defined.

ValueMeaning
DXVAHD_STREAM_STATE_PRIVATE_IVTC

Retrieves statistics about inverse telecine. The state data (pData) is a structure.

?

A device can define additional GUIDs for use with custom stream states. The interpretation of the data is then defined by the device.

dd318769 GUID Guid GUID Guid

The size, in bytes, of the buffer pointed to by the pData member.

dd318769 unsigned int DataSize unsigned int DataSize

A reference to a buffer that contains the private state data. The DXVA-HD runtime passes this buffer directly to the device, without validation.

dd318769 void* pData void pData

Contains inverse telecine (IVTC) statistics from a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

If the DXVA-HD device supports IVTC statistics, it can detect when the input video contains telecined frames. You can use this information to enable IVTC in the device.

To enable IVTC statistics, do the following:

  1. Allocate a structure and set the Enable member to TRUE.
  2. Initialize a structure with these values:
    • Set Guid to DXVAHD_STREAM_STATE_PRIVATE_IVTC.
    • Set DataSize to sizeof().
    • Set pData to point to the structure.
  3. Call the method. Set the State parameter of that method to and the pData parameter to the address of the structure.

To get the most recent IVTC statistics from the device, call the method. The state parameter and data buffer are the same.

Typically, an application would use this feature as follows:

  1. Enable IVTC statistics.
  2. Begin sending interlaced video frames to the DXVA-HD device.
  3. At some point, query the device for the current IVTC statistics.
  4. If the device detects telecined frames, use a custom frame rate to perform IVTC. For more information, see .
dd318770 DXVAHD_STREAM_STATE_PRIVATE_IVTC_DATA DXVAHD_STREAM_STATE_PRIVATE_IVTC_DATA

Specifies whether IVTC statistics are enabled. The default state value is . Setting the value to TRUE enables IVTC statistics, and resets all of the IVTC statistical data to zero.

dd318770 BOOL Enable BOOL Enable

If the driver detects that the frames are telecined, and is able to perform inverse telecine, this field contains a member of the enumeration. Otherwise, the value is 0.

dd318770 unsigned int ITelecineFlags unsigned int ITelecineFlags

The number of consecutive telecined frames that the device has detected.

dd318770 unsigned int Frames unsigned int Frames

The index of the most recent input field. The value of this member equals the most recent value of the InputFrameOrField member of the structure.

dd318770 unsigned int InputField unsigned int InputField

Specifies the source rectangle for an input stream when using Microsoft DirectX Video Acceleration High Definition (DXVA-HD)

dd318771 DXVAHD_STREAM_STATE_SOURCE_RECT_DATA DXVAHD_STREAM_STATE_SOURCE_RECT_DATA

Specifies whether to blit the entire input surface or just the source rectangle. The default state value is .

ValueMeaning
TRUE

Use the source rectangle specified in the SourceRect member.

Blit the entire input surface. Ignore the SourceRect member.

?

dd318771 BOOL Enable BOOL Enable

The source rectangle, which defines the portion of the input sample that is blitted to the destination surface. The source rectangle is given in pixel coordinates, relative to the input surface. The default state value is an empty rectangle, (0, 0, 0, 0).

If the Enable member is , the SourceRect member is ignored.

dd318771 RECT SourceRect RECT SourceRect

Contains references to functions implemented by a software plug-in for Microsoft DirectX Video Acceleration High Definition (DXVA-HD).

If you provide a software plug-in for DXVA-HD, the plug-in must implement a set of functions that are defined by the function reference types in this structure.

At initialization, the DXVA-HD runtime calls the plug-in device's PDXVAHDSW_Plugin function. This function fills in a structure with references to the set of functions that are implemented by the plug-in device. When the application calls DXVA-HD methods, the DXVA-HD runtime calls the corresponding plug-in functions.

dd318386 DXVAHDSW_CALLBACKS DXVAHDSW_CALLBACKS

Function reference of type PDXVAHDSW_CreateDevice.

dd318386 __function__stdcall* CreateDevice __function__stdcall CreateDevice

Function reference of type PDXVAHDSW_ProposeVideoPrivateFormat.

dd318386 __function__stdcall* ProposeVideoPrivateFormat __function__stdcall ProposeVideoPrivateFormat

Function reference of type PDXVAHDSW_GetVideoProcessorDeviceCaps.

dd318386 __function__stdcall* GetVideoProcessorDeviceCaps __function__stdcall GetVideoProcessorDeviceCaps

Function reference of type PDXVAHDSW_GetVideoProcessorOutputFormats.

dd318386 __function__stdcall* GetVideoProcessorOutputFormats __function__stdcall GetVideoProcessorOutputFormats

Function reference of type PDXVAHDSW_GetVideoProcessorInputFormats.

dd318386 __function__stdcall* GetVideoProcessorInputFormats __function__stdcall GetVideoProcessorInputFormats

Function reference of type PDXVAHDSW_GetVideoProcessorCaps.

dd318386 __function__stdcall* GetVideoProcessorCaps __function__stdcall GetVideoProcessorCaps

Function reference of type PDXVAHDSW_GetVideoProcessorCustomRates.

dd318386 __function__stdcall* GetVideoProcessorCustomRates __function__stdcall GetVideoProcessorCustomRates

Function reference of type PDXVAHDSW_GetVideoProcessorFilterRange.

dd318386 __function__stdcall* GetVideoProcessorFilterRange __function__stdcall GetVideoProcessorFilterRange

Function reference of type PDXVAHDSW_DestroyDevice.

dd318386 __function__stdcall* DestroyDevice __function__stdcall DestroyDevice

Function reference of type PDXVAHDSW_CreateVideoProcessor.

dd318386 __function__stdcall* CreateVideoProcessor __function__stdcall CreateVideoProcessor

Function reference of type PDXVAHDSW_SetVideoProcessBltState.

dd318386 __function__stdcall* SetVideoProcessBltState __function__stdcall SetVideoProcessBltState

Function reference of type PDXVAHDSW_GetVideoProcessBltStatePrivate.

dd318386 __function__stdcall* GetVideoProcessBltStatePrivate __function__stdcall GetVideoProcessBltStatePrivate

Function reference of type PDXVAHDSW_SetVideoProcessStreamState.

dd318386 __function__stdcall* SetVideoProcessStreamState __function__stdcall SetVideoProcessStreamState

Function reference of type PDXVAHDSW_GetVideoProcessStreamStatePrivate.

dd318386 __function__stdcall* GetVideoProcessStreamStatePrivate __function__stdcall GetVideoProcessStreamStatePrivate

Function reference of type PDXVAHDSW_VideoProcessBltHD.

dd318386 __function__stdcall* VideoProcessBltHD __function__stdcall VideoProcessBltHD

Function reference of type PDXVAHDSW_DestroyVideoProcessor.

dd318386 __function__stdcall* DestroyVideoProcessor __function__stdcall DestroyVideoProcessor

Defines the range of supported values for a DirectX Video Acceleration (DXVA) operation.

All values in this structure are specified as structures.

ms704572 DXVA2_ValueRange DXVA2_ValueRange

Minimum supported value.

ms704572 DXVA2_Fixed32 MinValue DXVA2_Fixed32 MinValue

Maximum supported value.

ms704572 DXVA2_Fixed32 MaxValue DXVA2_Fixed32 MaxValue

Default value.

ms704572 DXVA2_Fixed32 DefaultValue DXVA2_Fixed32 DefaultValue

Minimum increment between values.

ms704572 DXVA2_Fixed32 StepSize DXVA2_Fixed32 StepSize

Describes a video stream for a DXVA decoder device or video processor device.

The InputSampleFreq member gives the frame rate of the decoded video stream, as received by the video renderer. The OutputFrameFreq member gives the frame rate of the video that is displayed after deinterlacing. If the input video is interlaced and the samples contain interleaved fields, the output frame rate is twice the input frame rate. If the input video is progressive or contains single fields, the output frame rate is the same as the input frame rate.

Decoders should set the values of InputSampleFreq and OutputFrameFreq if the frame rate is known. Otherwise, set these members to 0/0 to indicate an unknown frame rate.

ms694235 DXVA2_VideoDesc DXVA2_VideoDesc

Width of the video frame, in pixels.

ms694235 unsigned int SampleWidth unsigned int SampleWidth

Height of the video frame, in pixels.

ms694235 unsigned int SampleHeight unsigned int SampleHeight

Additional details about the video format, specified as a structure.

ms694235 DXVA2_ExtendedFormat SampleFormat DXVA2_ExtendedFormat SampleFormat

Surface format, specified as a value or FOURCC code. A FOURCC code can be constructed using the or MAKEFOURCC macros.

ms694235 D3DFORMAT Format D3DFORMAT Format

Frame rate of the input video stream, specified as a structure.

ms694235 DXVA2_Frequency InputSampleFreq DXVA2_Frequency InputSampleFreq

Frame rate of the output video, specified as a structure.

ms694235 DXVA2_Frequency OutputFrameFreq DXVA2_Frequency OutputFrameFreq

Level of data protection required when the user accessible bus (UAB) is present. If TRUE, the video must be protected when a UAB is present. If , the video is not required to be protected.

ms694235 unsigned int UABProtectionLevel unsigned int UABProtectionLevel

Reserved. Must be zero.

ms694235 unsigned int Reserved unsigned int Reserved

Contains parameters for the method.

ms698741 DXVA2_VideoProcessBltParams DXVA2_VideoProcessBltParams
No documentation. ms698741 longlong TargetFrame longlong TargetFrame No documentation. ms698741 RECT TargetRect RECT TargetRect No documentation. ms698741 SIZE ConstrictionSize SIZE ConstrictionSize No documentation. ms698741 unsigned int StreamingFlags unsigned int StreamingFlags No documentation. ms698741 DXVA2_AYUVSample16 BackgroundColor DXVA2_AYUVSample16 BackgroundColor No documentation. ms698741 DXVA2_ExtendedFormat DestFormat DXVA2_ExtendedFormat DestFormat No documentation. ms698741 DXVA2_ProcAmpValues ProcAmpValues DXVA2_ProcAmpValues ProcAmpValues No documentation. ms698741 DXVA2_Fixed32 Alpha DXVA2_Fixed32 Alpha No documentation. ms698741 DXVA2_FilterValues NoiseFilterLuma DXVA2_FilterValues NoiseFilterLuma No documentation. ms698741 DXVA2_FilterValues NoiseFilterChroma DXVA2_FilterValues NoiseFilterChroma No documentation. ms698741 DXVA2_FilterValues DetailFilterLuma DXVA2_FilterValues DetailFilterLuma No documentation. ms698741 DXVA2_FilterValues DetailFilterChroma DXVA2_FilterValues DetailFilterChroma No documentation. ms698741 unsigned int DestData unsigned int DestData

Describes the capabilities of a DirectX Video Acceleration (DVXA) video processor mode.

ms703795 DXVA2_VideoProcessorCaps DXVA2_VideoProcessorCaps

Identifies the type of device. The following values are defined.

ValueMeaning

DXVA 2.0 video processing is emulated by using DXVA 1.0. An emulated device may be missing significant processing capabilities and have lower image quality and performance.

Hardware device.

Software device.

?

ms703795 unsigned int DeviceCaps unsigned int DeviceCaps

The Direct3D memory pool used by the device.

ms703795 D3DPOOL InputPool D3DPOOL InputPool

Number of forward reference samples the device needs to perform deinterlacing. For the bob, progressive scan, and software devices, the value is zero.

ms703795 unsigned int NumForwardRefSamples unsigned int NumForwardRefSamples

Number of backward reference samples the device needs to perform deinterlacing. For the bob, progressive scan, and software devices, the value is zero.

ms703795 unsigned int NumBackwardRefSamples unsigned int NumBackwardRefSamples

Reserved. Must be zero.

ms703795 unsigned int Reserved unsigned int Reserved

Identifies the deinteracing technique used by the device. This value is a bitwise OR of one or more of the following flags.

ValueMeaning

The algorithm is unknown or proprietary.

The algorithm creates missing lines by repeating the line either above or below the missing line. This algorithm produces a jagged image and is not recommended.

The algorithm creates missing lines by averaging two lines. Slight vertical adjustments are made so that the resulting image does not bob up and down.

The algorithm creates missing lines by applying a [?1, 9, 9, ?1]/16 filter across four lines. Slight vertical adjustments are made so that the resulting image does not bob up and down.

The algorithm uses median filtering to recreate the pixels in the missing lines.

The algorithm uses an edge filter to create the missing lines. In this process, spatial directional filters are applied to determine the orientation of edges in the picture content. Missing pixels are created by filtering along (rather than across) the detected edges.

The algorithm uses spatial or temporal interpolation, switching between the two on a field-by-field basis, depending on the amount of motion.

The algorithm uses spatial or temporal interpolation, switching between the two on a pixel-by-pixel basis, depending on the amount of motion.

The algorithm identifies objects within a sequence of video fields. Before it recreates the missing pixels, it aligns the movement axes of the individual objects in the scene to make them parallel with the time axis.

The device can undo the 3:2 pulldown process used in telecine.

?

ms703795 unsigned int DeinterlaceTechnology unsigned int DeinterlaceTechnology

Specifies the available video processor (ProcAmp) operations. The value is a bitwise OR of ProcAmp Settings constants.

ms703795 unsigned int ProcAmpControlCaps unsigned int ProcAmpControlCaps

Specifies operations that the device can perform concurrently with the operation. The value is a bitwise OR of the following flags.

ValueMeaning

The device can convert the video from YUV color space to RGB color space, with at least 8 bits of precision for each RGB component.

The device can stretch or shrink the video horizontally. If this capability is present, aspect ratio correction can be performed at the same time as deinterlacing.

The device can stretch or shrink the video vertically. If this capability is present, image resizing and aspect ratio correction can be performed at the same time.

The device can alpha blend the video.

The device can operate on a subrectangle of the video frame. If this capability is present, source images can be cropped before further processing occurs.

The device can accept substreams in addition to the primary video stream, and can composite them.

The device can perform color adjustments on the primary video stream and substreams, at the same time that it deinterlaces the video and composites the substreams. The destination color space is defined in the DestFormat member of the structure. The source color space for each stream is defined in the SampleFormat member of the structure.

The device can convert the video from YUV to RGB color space when it writes the deinterlaced and composited pixels to the destination surface.

An RGB destination surface could be an off-screen surface, texture, Direct3D render target, or combined texture/render target surface. An RGB destination surface must use at least 8 bits for each color channel.

The device can perform an alpha blend operation with the destination surface when it writes the deinterlaced and composited pixels to the destination surface.

The device can downsample the output frame, as specified by the ConstrictionSize member of the structure.

The device can perform noise filtering.

The device can perform detail filtering.

The device can perform a constant alpha blend to the entire video stream when it composites the video stream and substreams.

The device can perform accurate linear RGB scaling, rather than performing them in nonlinear gamma space.

The device can correct the image to compensate for artifacts introduced when performing scaling in nonlinear gamma space.

The deinterlacing algorithm preserves the original field lines from the interlaced field picture, unless scaling is also applied.

For example, in deinterlacing algorithms such as bob and median filtering, the device copies the original field into every other scan line and then applies a filter to reconstruct the missing scan lines. As a result, the original field can be recovered by discarding the scan lines that were interpolated.

If the image is scaled vertically, however, the original field lines cannot be recovered. If the image is scaled horizontally (but not vertically), the resulting field lines will be equivalent to scaling the original field picture. (In other words, discarding the interpolated scan lines will yield the same result as stretching the original picture without deinterlacing.)

?

ms703795 unsigned int VideoProcessorOperations unsigned int VideoProcessorOperations

Specifies the supported noise filters. The value is a bitwise OR of the following flags.

ValueMeaning

Noise filtering is not supported.

Unknown or proprietary filter.

Median filter.

Temporal filter.

Block noise filter.

Mosquito noise filter.

?

ms703795 unsigned int NoiseFilterTechnology unsigned int NoiseFilterTechnology

Specifies the supported detail filters. The value is a bitwise OR of the following flags.

ValueMeaning

Detail filtering is not supported.

Unknown or proprietary filter.

Edge filter.

Sharpen filter.

?

ms703795 unsigned int DetailFilterTechnology unsigned int DetailFilterTechnology

Specifies an input sample for the method.

ms693598 DXVA2_VideoSample DXVA2_VideoSample
No documentation. ms693598 longlong Start longlong Start No documentation. ms693598 longlong End longlong End No documentation. ms693598 DXVA2_ExtendedFormat SampleFormat DXVA2_ExtendedFormat SampleFormat No documentation. ms693598 IDirect3DSurface9* SrcSurface IDirect3DSurface9 SrcSurface No documentation. ms693598 RECT SrcRect RECT SrcRect No documentation. ms693598 RECT DstRect RECT DstRect No documentation. ms693598 DXVA2_Fixed32 PlanarAlpha DXVA2_Fixed32 PlanarAlpha No documentation. ms693598 unsigned int SampleData unsigned int SampleData No documentation. ms693598 DXVA2_AYUVSample8 Pal[16] DXVA2_AYUVSample8 Pal

Specifies the capabilities of the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor.

dd318773 DXVAHD_VPCAPS DXVAHD_VPCAPS

A that identifies the video processor. This is defined by the device, and is used in various methods to specify the video processor.

dd318773 GUID VPGuid GUID VPGuid

The number of past reference frames required to perform the optimal video processing.

dd318773 unsigned int PastFrames unsigned int PastFrames

The number of future reference frames required to perform the optimal video processing.

dd318773 unsigned int FutureFrames unsigned int FutureFrames

A bitwise OR of zero or more flags from the enumeration.

dd318773 unsigned int ProcessorCaps unsigned int ProcessorCaps

A bitwise OR of zero or more flags from the enumeration.

dd318773 unsigned int ITelecineCaps unsigned int ITelecineCaps

The number of custom output frame rates. To get the list of custom frame rates, call the method. Custom frame rates are used for frame-rate conversion and inverse telecine.

dd318773 unsigned int CustomRateCount unsigned int CustomRateCount

Specifies the capabilities of a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

In DXVA-HD, the device stores state information for each input stream. These states persist between blits. With each blit, the application selects which streams to enable or disable. Disabling a stream does not affect the state information for that stream.

The MaxStreamStates member gives the maximum number of stream states that can be set by the application. The MaxInputStreams member gives the maximum number of streams that can be enabled during a blit. These two values can differ.

To set the state data for a stream, call .

dd318774 DXVAHD_VPDEVCAPS DXVAHD_VPDEVCAPS

Specifies the device type, as a member of the enumeration.

dd318774 DXVAHD_DEVICE_TYPE DeviceType DXVAHD_DEVICE_TYPE DeviceType

A bitwise OR of zero or more flags from the enumeration.

dd318774 unsigned int DeviceCaps unsigned int DeviceCaps

A bitwise OR of zero or more flags from the enumeration.

dd318774 unsigned int FeatureCaps unsigned int FeatureCaps

A bitwise OR of zero or more flags from the enumeration.

dd318774 unsigned int FilterCaps unsigned int FilterCaps

A bitwise OR of zero or more flags from the enumeration.

dd318774 unsigned int InputFormatCaps unsigned int InputFormatCaps

The memory pool that is required for the input video surfaces.

dd318774 D3DPOOL InputPool D3DPOOL InputPool

The number of supported output formats. To get the list of output formats, call the method.

dd318774 unsigned int OutputFormatCount unsigned int OutputFormatCount

The number of supported input formats. To get the list of input formats, call the method.

dd318774 unsigned int InputFormatCount unsigned int InputFormatCount

The number of video processors. Each video processor represents a distinct set of processing capabilities. To get the capabilities of each video processor, call the method. To create a video processor, call the method.

dd318774 unsigned int VideoProcessorCount unsigned int VideoProcessorCount

The maximum number of input streams that can be enabled at the same time.

dd318774 unsigned int MaxInputStreams unsigned int MaxInputStreams

The maximum number of input streams for which the device can store state data.

dd318774 unsigned int MaxStreamStates unsigned int MaxStreamStates
No documentation. __MIDL___MIDL_itf_mfidl_0000_0020_0001 __MIDL___MIDL_itf_mfidl_0000_0020_0001 No documentation. MF_ACTIVATE_CUSTOM_MIXER_ALLOWFAIL MF_ACTIVATE_CUSTOM_MIXER_ALLOWFAIL None. None None No documentation. __MIDL___MIDL_itf_mfidl_0000_0020_0002 __MIDL___MIDL_itf_mfidl_0000_0020_0002 No documentation. MF_ACTIVATE_CUSTOM_PRESENTER_ALLOWFAIL MF_ACTIVATE_CUSTOM_PRESENTER_ALLOWFAIL None. None None

Defines the ASF indexer options.

ms704695 MFASF_INDEXERFLAGS MFASF_INDEXERFLAGS

The indexer creates a new index object.

ms704695 MFASF_INDEXER_WRITE_NEW_INDEX MFASF_INDEXER_WRITE_NEW_INDEX

The indexer returns values for reverse playback.

ms704695 MFASF_INDEXER_READ_FOR_REVERSEPLAYBACK MFASF_INDEXER_READ_FOR_REVERSEPLAYBACK

The indexer creates an index object for a live ASF stream.

ms704695 MFASF_INDEXER_WRITE_FOR_LIVEREAD MFASF_INDEXER_WRITE_FOR_LIVEREAD
None. None None

Defines the ASF multiplexer options.

ms698843 MFASF_MULTIPLEXERFLAGS MFASF_MULTIPLEXERFLAGS

The multiplexer automatically adjusts the bit rate of the ASF content in response to the characteristics of the streams being multiplexed.

ms698843 MFASF_MULTIPLEXER_AUTOADJUST_BITRATE MFASF_MULTIPLEXER_AUTOADJUST_BITRATE
None. None None

Defines the selection options for an ASF stream.

ms694827 ASF_SELECTION_STATUS ASF_SELECTION_STATUS

No samples from the stream are delivered.

ms694827 ASF_STATUS_NOTSELECTED ASF_STATUS_NOTSELECTED

Only samples from the stream that are clean points are delivered.

ms694827 ASF_STATUS_CLEANPOINTSONLY ASF_STATUS_CLEANPOINTSONLY

All samples from the stream are delivered.

ms694827 ASF_STATUS_ALLDATAUNITS ASF_STATUS_ALLDATAUNITS

Defines the ASF splitter options.

ms700211 MFASF_SPLITTERFLAGS MFASF_SPLITTERFLAGS

The splitter delivers samples for the ASF content in reverse order to accommodate reverse playback.

ms700211 MFASF_SPLITTER_REVERSE MFASF_SPLITTER_REVERSE

The splitter delivers samples for streams that are protected with Windows Media Digital Rights Management.

ms700211 MFASF_SPLITTER_WMDRM MFASF_SPLITTER_WMDRM
None. None None

Defines status conditions for the method.

ms703127 ASF_STATUSFLAGS ASF_STATUSFLAGS
No documentation. ms703127 ASF_STATUSFLAGS_INCOMPLETE ASF_STATUSFLAGS_INCOMPLETE No documentation. ms703127 ASF_STATUSFLAGS_NONFATAL_ERROR ASF_STATUSFLAGS_NONFATAL_ERROR None. None None

Defines the ASF stream selector options.

ms696200 MFASF_STREAMSELECTORFLAGS MFASF_STREAMSELECTORFLAGS

The stream selector will not set thinning. Thinning is the process of removing samples from a stream to reduce the bit rate.

ms696200 MFASF_STREAMSELECTOR_DISABLE_THINNING MFASF_STREAMSELECTOR_DISABLE_THINNING

The stream selector will use the average bit rate of streams when selecting streams.

ms696200 MFASF_STREAMSELECTOR_USE_AVERAGE_BITRATE MFASF_STREAMSELECTOR_USE_AVERAGE_BITRATE
None. None None

Creates a work queue that is guaranteed to serialize work items. The serial work queue wraps an existing multithreaded work queue. The serial work queue enforces a first-in, first-out (FIFO) execution order.

When you are done using the work queue, call .

Multithreaded queues use a thread pool, which can reduce the total number of threads in the pipeline. However, they do not serialize work items. A serial work queue enables the application to get the benefits of the thread pool, without needing to perform manual serialization of its own work items.

hh162744 MFASYNC_CALLBACK_FLAGS MFASYNC_CALLBACK_FLAGS

The identifier of an existing work queue. This must be either a multithreaded queue or another serial work queue. Any of the following can be used:

  • The default work queue ()
  • The platform multithreaded queue (MFASYNC_CALLBACK_QUEUE_MULTITHREADED)
  • A multithreaded queue returned by the MFLockSharedWorkQueue function.
  • A serial queue created by the MFAllocateSerialWorkQueue function.
hh162744 MFASYNC_FAST_IO_PROCESSING_CALLBACK MFASYNC_FAST_IO_PROCESSING_CALLBACK

Receives an identifier for the new serial work queue. Use this identifier when queuing work items.

hh162744 MFASYNC_SIGNAL_CALLBACK MFASYNC_SIGNAL_CALLBACK
None. None None

Specifies the type of work queue for the function to create.

dd388081 MFASYNC_WORKQUEUE_TYPE MFASYNC_WORKQUEUE_TYPE
No documentation. dd388081 MF_STANDARD_WORKQUEUE MF_STANDARD_WORKQUEUE No documentation. dd388081 MF_WINDOW_WORKQUEUE MF_WINDOW_WORKQUEUE

Defines flags for serializing and deserializing attribute stores.

ms704675 MF_ATTRIBUTE_SERIALIZE_OPTIONS MF_ATTRIBUTE_SERIALIZE_OPTIONS

If this flag is set, references in the attribute store are marshaled to and from the stream. If this flag is absent, references in the attribute store are not marshaled or serialized.

ms704675 MF_ATTRIBUTE_SERIALIZE_UNKNOWN_BYREF MF_ATTRIBUTE_SERIALIZE_UNKNOWN_BYREF

Specifies how to compare the attributes on two objects.

ms703793 MF_ATTRIBUTES_MATCH_TYPE MF_ATTRIBUTES_MATCH_TYPE

Check whether all the attributes in pThis exist in pTheirs and have the same data, where pThis is the object whose Compare method is being called and pTheirs is the object given in the pTheirs parameter.

ms703793 MF_ATTRIBUTES_MATCH_OUR_ITEMS MF_ATTRIBUTES_MATCH_OUR_ITEMS

Check whether all the attributes in pTheirs exist in pThis and have the same data, where pThis is the object whose Compare method is being called and pTheirs is the object given in the pTheirs parameter.

ms703793 MF_ATTRIBUTES_MATCH_THEIR_ITEMS MF_ATTRIBUTES_MATCH_THEIR_ITEMS

Check whether both objects have identical attributes with the same data.

ms703793 MF_ATTRIBUTES_MATCH_ALL_ITEMS MF_ATTRIBUTES_MATCH_ALL_ITEMS

Check whether the attributes that exist in both objects have the same data.

ms703793 MF_ATTRIBUTES_MATCH_INTERSECTION MF_ATTRIBUTES_MATCH_INTERSECTION

Find the object with the fewest number of attributes, and check if those attributes exist in the other object and have the same data.

ms703793 MF_ATTRIBUTES_MATCH_SMALLER MF_ATTRIBUTES_MATCH_SMALLER

Defines the data type for a key/value pair.

ms694854 MF_ATTRIBUTE_TYPE MF_ATTRIBUTE_TYPE

Unsigned 32-bit integer.

ms694854 MF_ATTRIBUTE_UINT32 MF_ATTRIBUTE_UINT32

Unsigned 64-bit integer.

ms694854 MF_ATTRIBUTE_UINT64 MF_ATTRIBUTE_UINT64

Floating-point number.

ms694854 MF_ATTRIBUTE_DOUBLE MF_ATTRIBUTE_DOUBLE

value.

ms694854 MF_ATTRIBUTE_GUID MF_ATTRIBUTE_GUID

null-terminated wide-character string.

ms694854 MF_ATTRIBUTE_STRING MF_ATTRIBUTE_STRING

Byte array.

ms694854 MF_ATTRIBUTE_BLOB MF_ATTRIBUTE_BLOB

reference.

ms694854 MF_ATTRIBUTE_IUNKNOWN MF_ATTRIBUTE_IUNKNOWN

Specifies the origin for a seek request.

ms702091 MFBYTESTREAM_SEEK_ORIGIN MFBYTESTREAM_SEEK_ORIGIN

The seek position is specified relative to the start of the stream.

ms702091 msoBegin msoBegin

The seek position is specified relative to the current read/write position in the stream.

ms702091 msoCurrent msoCurrent

Contains flags that describe the characteristics of a clock. These flags are returned by the method.

ms699872 MFCLOCK_CHARACTERISTICS_FLAGS MFCLOCK_CHARACTERISTICS_FLAGS
No documentation. ms699872 MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ No documentation. ms699872 MFCLOCK_CHARACTERISTICS_FLAG_ALWAYS_RUNNING MFCLOCK_CHARACTERISTICS_FLAG_ALWAYS_RUNNING No documentation. ms699872 MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK None. None None

Defines properties of a clock.

ms703927 MFCLOCK_RELATIONAL_FLAGS MFCLOCK_RELATIONAL_FLAGS

Jitter values are always negative. In other words, the time returned by might jitter behind the actual clock time, but will never jitter ahead of the actual time. If this flag is not present, the clock might jitter in either direction.

ms703927 MFCLOCK_RELATIONAL_FLAG_JITTER_NEVER_AHEAD MFCLOCK_RELATIONAL_FLAG_JITTER_NEVER_AHEAD
None. None None

Defines the state of a clock.

ms700794 MFCLOCK_STATE MFCLOCK_STATE

The clock is invalid. A clock might be invalid for several reasons. Some clocks return this state before the first start. This state can also occur if the underlying device is lost.

ms700794 MFCLOCK_STATE_INVALID MFCLOCK_STATE_INVALID

The clock is running. While the clock is running, the time advances at the clock's frequency and current rate.

ms700794 MFCLOCK_STATE_RUNNING MFCLOCK_STATE_RUNNING

The clock is stopped. While stopped, the clock reports a time of 0.

ms700794 MFCLOCK_STATE_STOPPED MFCLOCK_STATE_STOPPED

The clock is paused. While paused, the clock reports the time it was paused.

ms700794 MFCLOCK_STATE_PAUSED MFCLOCK_STATE_PAUSED

Specifies how the topology loader connects a topology node. This enumeration is used with the attribute.

ms700178 MF_CONNECT_METHOD MF_CONNECT_METHOD
No documentation. ms700178 MF_CONNECT_DIRECT MF_CONNECT_DIRECT No documentation. ms700178 MF_CONNECT_ALLOW_CONVERTER MF_CONNECT_ALLOW_CONVERTER No documentation. ms700178 MF_CONNECT_ALLOW_DECODER MF_CONNECT_ALLOW_DECODER No documentation. ms700178 MF_CONNECT_RESOLVE_INDEPENDENT_OUTPUTTYPES MF_CONNECT_RESOLVE_INDEPENDENT_OUTPUTTYPES No documentation. ms700178 MF_CONNECT_AS_OPTIONAL MF_CONNECT_AS_OPTIONAL No documentation. ms700178 MF_CONNECT_AS_OPTIONAL_BRANCH MF_CONNECT_AS_OPTIONAL_BRANCH No documentation. _DMO_INPLACE_PROCESS_FLAGS _DMO_INPLACE_PROCESS_FLAGS No documentation. DMO_INPLACE_NORMAL DMO_INPLACE_NORMAL No documentation. DMO_INPLACE_ZERO DMO_INPLACE_ZERO None. None None No documentation. _DMO_INPUT_DATA_BUFFER_FLAGS _DMO_INPUT_DATA_BUFFER_FLAGS No documentation. DMO_INPUT_DATA_BUFFERF_SYNCPOINT DMO_INPUT_DATA_BUFFERF_SYNCPOINT No documentation. DMO_INPUT_DATA_BUFFERF_TIME DMO_INPUT_DATA_BUFFERF_TIME No documentation. DMO_INPUT_DATA_BUFFERF_TIMELENGTH DMO_INPUT_DATA_BUFFERF_TIMELENGTH None. None None

Media Foundation transforms (MFTs) are an evolution of the transform model first introduced with DirectX Media Objects (DMOs). This topic summarizes the main ways in which MFTs differ from DMOs. Read this topic if you are already familiar with the DMO interfaces, or if you want to convert an existing DMO into an MFT.

This topic contains the following sections:

  • Number
  • Format
  • Streaming
    • Allocating
    • Processing
    • Flushing
    • Stream
  • Miscellaneous
  • Flags
    • ProcessInput
    • ProcessOutput
    • GetInputStatus
    • GetOutputStatus
    • GetInputStreamInfo
    • GetOutputStreamInfo
    • SetInputType/SetOutputType
  • Error
  • Creating
  • Related
bb250374 _DMO_INPUT_STATUS_FLAGS _DMO_INPUT_STATUS_FLAGS
No documentation. bb250374 DMO_INPUT_STATUSF_ACCEPT_DATA DMO_INPUT_STATUSF_ACCEPT_DATA None. None None

The DMO_INPUT_STREAM_INFO_FLAGS enumeration defines flags that describe an input stream.

dd375502 _DMO_INPUT_STREAM_INFO_FLAGS _DMO_INPUT_STREAM_INFO_FLAGS

The stream requires whole samples. Samples must not span multiple buffers, and buffers must not contain partial samples.

dd375502 DMO_INPUT_STREAMF_WHOLE_SAMPLES DMO_INPUT_STREAMF_WHOLE_SAMPLES

Each buffer must contain exactly one sample.

dd375502 DMO_INPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER DMO_INPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER

All the samples in this stream must be the same size.

dd375502 DMO_INPUT_STREAMF_FIXED_SAMPLE_SIZE DMO_INPUT_STREAMF_FIXED_SAMPLE_SIZE

The DMO performs lookahead on the incoming data, and may hold multiple input buffers for this stream.

dd375502 DMO_INPUT_STREAMF_HOLDS_BUFFERS DMO_INPUT_STREAMF_HOLDS_BUFFERS
None. None None No documentation. _DMO_OUTPUT_DATA_BUFFER_FLAGS _DMO_OUTPUT_DATA_BUFFER_FLAGS No documentation. DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT No documentation. DMO_OUTPUT_DATA_BUFFERF_TIME DMO_OUTPUT_DATA_BUFFERF_TIME No documentation. DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH No documentation. DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE None. None None No documentation. _DMO_OUTPUT_STREAM_INFO_FLAGS _DMO_OUTPUT_STREAM_INFO_FLAGS No documentation. DMO_OUTPUT_STREAMF_WHOLE_SAMPLES DMO_OUTPUT_STREAMF_WHOLE_SAMPLES No documentation. DMO_OUTPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER DMO_OUTPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER No documentation. DMO_OUTPUT_STREAMF_FIXED_SAMPLE_SIZE DMO_OUTPUT_STREAMF_FIXED_SAMPLE_SIZE No documentation. DMO_OUTPUT_STREAMF_DISCARDABLE DMO_OUTPUT_STREAMF_DISCARDABLE No documentation. DMO_OUTPUT_STREAMF_OPTIONAL DMO_OUTPUT_STREAMF_OPTIONAL None. None None No documentation. _DMO_PROCESS_OUTPUT_FLAGS _DMO_PROCESS_OUTPUT_FLAGS No documentation. DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER None. None None

The interface supports quality control on a Microsoft DirectX Media Object (DMO).

A DMO exposes this interface if it can respond to late samples. When quality control is enabled, the DMO attempts to process samples on time, discarding late samples if necessary. When quality control is disabled, the DMO processes every sample. By default, quality control is disabled.

Applications use this interface to enable or disable quality control. Using quality control is appropriate when you are viewing media data in real time. If you are capturing data to a file, do not enable quality control, because the DMO might discard samples. It does not matter in file capture whether samples arrive late, and you do not want to lose the data.

To use quality control, perform the following steps:

  1. Call the method with the reference time of the earliest sample to be processed.
  2. Call the method with the flag.

To disable quality control, call SetStatus with no flag.

dd406839 _DMO_QUALITY_STATUS_FLAGS _DMO_QUALITY_STATUS_FLAGS
No documentation. dd406839 DMO_QUALITY_STATUS_ENABLED DMO_QUALITY_STATUS_ENABLED None. None None

The DMO_SET_TYPE_FLAGS enumeration defines flags for setting the media type on a stream.

The and flags are mutually exclusive. Do not set both flags.

dd375514 _DMO_SET_TYPE_FLAGS _DMO_SET_TYPE_FLAGS

Test the media type but do not set it.

dd375514 DMO_SET_TYPEF_TEST_ONLY DMO_SET_TYPEF_TEST_ONLY

Clear the media type that was set for the stream.

dd375514 DMO_SET_TYPEF_CLEAR DMO_SET_TYPEF_CLEAR
None. None None

The DMO_VIDEO_OUTPUT_STREAM_FLAGS enumeration defines flags that describe requested features, for video optimizations.

dd375517 _DMO_VIDEO_OUTPUT_STREAM_FLAGS _DMO_VIDEO_OUTPUT_STREAM_FLAGS

Requests that every output buffer passed to the DMO contain the previous data that was generated.

dd375517 DMO_VOSF_NEEDS_PREVIOUS_SAMPLE DMO_VOSF_NEEDS_PREVIOUS_SAMPLE
None. None None No documentation. EAllocationType EAllocationType No documentation. eAllocationTypeDynamic eAllocationTypeDynamic No documentation. eAllocationTypeRT eAllocationTypeRT No documentation. eAllocationTypePageable eAllocationTypePageable No documentation. eAllocationTypeIgnore eAllocationTypeIgnore

Contains flags that are used to configure the Microsoft DirectShow enhanced video renderer (EVR) filter.

dd318789 EVRFilterConfigPrefs EVRFilterConfigPrefs

Enables dynamic adjustments to video quality during playback.

dd318789 EVRFilterConfigPrefs_EnableQoS EVRFilterConfigPrefs_EnableQoS

Specifies the requested access mode for opening a file.

ms696239 MF_FILE_ACCESSMODE MF_FILE_ACCESSMODE

Read mode.

ms696239 MF_ACCESSMODE_READ MF_ACCESSMODE_READ

Write mode.

ms696239 MF_ACCESSMODE_WRITE MF_ACCESSMODE_WRITE

Read and write mode.

ms696239 MF_ACCESSMODE_READWRITE MF_ACCESSMODE_READWRITE

Specifies the behavior when opening a file.

ms694926 MF_FILE_FLAGS MF_FILE_FLAGS

Use the default behavior.

ms694926 MF_FILEFLAGS_NONE MF_FILEFLAGS_NONE

Open the file with no system caching.

ms694926 MF_FILEFLAGS_NOBUFFERING MF_FILEFLAGS_NOBUFFERING

Subsequent open operations can have write access to the file.

Note??Requires Windows?7 or later.

ms694926 MF_FILEFLAGS_ALLOW_WRITE_SHARING MF_FILEFLAGS_ALLOW_WRITE_SHARING
None. None None

Specifies how to open or create a file.

ms694164 MF_FILE_OPENMODE MF_FILE_OPENMODE

Open an existing file. Fail if the file does not exist.

ms694164 MF_OPENMODE_FAIL_IF_NOT_EXIST MF_OPENMODE_FAIL_IF_NOT_EXIST

Create a new file. Fail if the file already exists.

ms694164 MF_OPENMODE_FAIL_IF_EXIST MF_OPENMODE_FAIL_IF_EXIST

Open an existing file and truncate it, so that the size is zero bytes. Fail if the file does not already exist.

ms694164 MF_OPENMODE_RESET_IF_EXIST MF_OPENMODE_RESET_IF_EXIST

If the file does not exist, create a new file. If the file exists, open it.

ms694164 MF_OPENMODE_APPEND_IF_EXIST MF_OPENMODE_APPEND_IF_EXIST

Create a new file. If the file exists, overwrite the file.

ms694164 MF_OPENMODE_DELETE_IF_EXIST MF_OPENMODE_DELETE_IF_EXIST
No documentation. __MIDL___MIDL_itf_mfobjects_0000_0009_0001 __MIDL___MIDL_itf_mfobjects_0000_0009_0001 No documentation. MEUnknown MEUnknown No documentation. MEError MEError No documentation. MEExtendedType MEExtendedType No documentation. MENonFatalError MENonFatalError No documentation. MEGenericV1Anchor MEGenericV1Anchor No documentation. MESessionUnknown MESessionUnknown No documentation. MESessionTopologySet MESessionTopologySet No documentation. MESessionTopologiesCleared MESessionTopologiesCleared No documentation. MESessionStarted MESessionStarted No documentation. MESessionPaused MESessionPaused No documentation. MESessionStopped MESessionStopped No documentation. MESessionClosed MESessionClosed No documentation. MESessionEnded MESessionEnded No documentation. MESessionRateChanged MESessionRateChanged No documentation. MESessionScrubSampleComplete MESessionScrubSampleComplete No documentation. MESessionCapabilitiesChanged MESessionCapabilitiesChanged No documentation. MESessionTopologyStatus MESessionTopologyStatus No documentation. MESessionNotifyPresentationTime MESessionNotifyPresentationTime No documentation. MENewPresentation MENewPresentation No documentation. MELicenseAcquisitionStart MELicenseAcquisitionStart No documentation. MELicenseAcquisitionCompleted MELicenseAcquisitionCompleted No documentation. MEIndividualizationStart MEIndividualizationStart No documentation. MEIndividualizationCompleted MEIndividualizationCompleted No documentation. MEEnablerProgress MEEnablerProgress No documentation. MEEnablerCompleted MEEnablerCompleted No documentation. MEPolicyError MEPolicyError No documentation. MEPolicyReport MEPolicyReport No documentation. MEBufferingStarted MEBufferingStarted No documentation. MEBufferingStopped MEBufferingStopped No documentation. MEConnectStart MEConnectStart No documentation. MEConnectEnd MEConnectEnd No documentation. MEReconnectStart MEReconnectStart No documentation. MEReconnectEnd MEReconnectEnd No documentation. MERendererEvent MERendererEvent No documentation. MESessionStreamSinkFormatChanged MESessionStreamSinkFormatChanged No documentation. MESessionV1Anchor MESessionV1Anchor No documentation. MESourceUnknown MESourceUnknown No documentation. MESourceStarted MESourceStarted No documentation. MEStreamStarted MEStreamStarted No documentation. MESourceSeeked MESourceSeeked No documentation. MEStreamSeeked MEStreamSeeked No documentation. MENewStream MENewStream No documentation. MEUpdatedStream MEUpdatedStream No documentation. MESourceStopped MESourceStopped No documentation. MEStreamStopped MEStreamStopped No documentation. MESourcePaused MESourcePaused No documentation. MEStreamPaused MEStreamPaused No documentation. MEEndOfPresentation MEEndOfPresentation No documentation. MEEndOfStream MEEndOfStream No documentation. MEMediaSample MEMediaSample No documentation. MEStreamTick MEStreamTick No documentation. MEStreamThinMode MEStreamThinMode No documentation. MEStreamFormatChanged MEStreamFormatChanged No documentation. MESourceRateChanged MESourceRateChanged No documentation. MEEndOfPresentationSegment MEEndOfPresentationSegment No documentation. MESourceCharacteristicsChanged MESourceCharacteristicsChanged No documentation. MESourceRateChangeRequested MESourceRateChangeRequested No documentation. MESourceMetadataChanged MESourceMetadataChanged No documentation. MESequencerSourceTopologyUpdated MESequencerSourceTopologyUpdated No documentation. MESourceV1Anchor MESourceV1Anchor No documentation. MESinkUnknown MESinkUnknown No documentation. MEStreamSinkStarted MEStreamSinkStarted No documentation. MEStreamSinkStopped MEStreamSinkStopped No documentation. MEStreamSinkPaused MEStreamSinkPaused No documentation. MEStreamSinkRateChanged MEStreamSinkRateChanged No documentation. MEStreamSinkRequestSample MEStreamSinkRequestSample No documentation. MEStreamSinkMarker MEStreamSinkMarker No documentation. MEStreamSinkPrerolled MEStreamSinkPrerolled No documentation. MEStreamSinkScrubSampleComplete MEStreamSinkScrubSampleComplete No documentation. MEStreamSinkFormatChanged MEStreamSinkFormatChanged No documentation. MEStreamSinkDeviceChanged MEStreamSinkDeviceChanged No documentation. MEQualityNotify MEQualityNotify No documentation. MESinkInvalidated MESinkInvalidated No documentation. MEAudioSessionNameChanged MEAudioSessionNameChanged No documentation. MEAudioSessionVolumeChanged MEAudioSessionVolumeChanged No documentation. MEAudioSessionDeviceRemoved MEAudioSessionDeviceRemoved No documentation. MEAudioSessionServerShutdown MEAudioSessionServerShutdown No documentation. MEAudioSessionGroupingParamChanged MEAudioSessionGroupingParamChanged No documentation. MEAudioSessionIconChanged MEAudioSessionIconChanged No documentation. MEAudioSessionFormatChanged MEAudioSessionFormatChanged No documentation. MEAudioSessionDisconnected MEAudioSessionDisconnected No documentation. MEAudioSessionExclusiveModeOverride MEAudioSessionExclusiveModeOverride No documentation. MESinkV1Anchor MESinkV1Anchor No documentation. METrustUnknown METrustUnknown No documentation. MEPolicyChanged MEPolicyChanged No documentation. MEContentProtectionMessage MEContentProtectionMessage No documentation. MEPolicySet MEPolicySet No documentation. METrustV1Anchor METrustV1Anchor No documentation. MEWMDRMLicenseBackupCompleted MEWMDRMLicenseBackupCompleted No documentation. MEWMDRMLicenseBackupProgress MEWMDRMLicenseBackupProgress No documentation. MEWMDRMLicenseRestoreCompleted MEWMDRMLicenseRestoreCompleted No documentation. MEWMDRMLicenseRestoreProgress MEWMDRMLicenseRestoreProgress No documentation. MEWMDRMLicenseAcquisitionCompleted MEWMDRMLicenseAcquisitionCompleted No documentation. MEWMDRMIndividualizationCompleted MEWMDRMIndividualizationCompleted No documentation. MEWMDRMIndividualizationProgress MEWMDRMIndividualizationProgress No documentation. MEWMDRMProximityCompleted MEWMDRMProximityCompleted No documentation. MEWMDRMLicenseStoreCleaned MEWMDRMLicenseStoreCleaned No documentation. MEWMDRMRevocationDownloadCompleted MEWMDRMRevocationDownloadCompleted No documentation. MEWMDRMV1Anchor MEWMDRMV1Anchor No documentation. METransformUnknown METransformUnknown No documentation. METransformNeedInput METransformNeedInput No documentation. METransformHaveOutput METransformHaveOutput No documentation. METransformDrainComplete METransformDrainComplete No documentation. METransformMarker METransformMarker No documentation. MEReservedMax MEReservedMax

Defines the characteristics of a media source. These flags are retrieved by the method.

To skip forward or backward in a playlist, call or with the MF_TIME_FORMAT_ENTRY_RELATIVE time-format . This capability applies only when the flag is present.

ms694277 MFMEDIASOURCE_CHARACTERISTICS MFMEDIASOURCE_CHARACTERISTICS
No documentation. ms694277 MFMEDIASOURCE_IS_LIVE MFMEDIASOURCE_IS_LIVE No documentation. ms694277 MFMEDIASOURCE_CAN_SEEK MFMEDIASOURCE_CAN_SEEK No documentation. ms694277 MFMEDIASOURCE_CAN_PAUSE MFMEDIASOURCE_CAN_PAUSE No documentation. ms694277 MFMEDIASOURCE_HAS_SLOW_SEEK MFMEDIASOURCE_HAS_SLOW_SEEK No documentation. ms694277 MFMEDIASOURCE_HAS_MULTIPLE_PRESENTATIONS MFMEDIASOURCE_HAS_MULTIPLE_PRESENTATIONS No documentation. ms694277 MFMEDIASOURCE_CAN_SKIPFORWARD MFMEDIASOURCE_CAN_SKIPFORWARD No documentation. ms694277 MFMEDIASOURCE_CAN_SKIPBACKWARD MFMEDIASOURCE_CAN_SKIPBACKWARD

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Specifies options for the function.

The following typedef is defined for combining flags from this enumeration.

typedef UINT32 MFP_CREATION_OPTIONS;
dd757934 _MFP_CREATION_OPTIONS _MFP_CREATION_OPTIONS
No documentation. dd757934 MFP_OPTION_NONE MFP_OPTION_NONE No documentation. dd757934 MFP_OPTION_FREE_THREADED_CALLBACK MFP_OPTION_FREE_THREADED_CALLBACK No documentation. dd757934 MFP_OPTION_NO_MMCSS MFP_OPTION_NO_MMCSS No documentation. dd757934 MFP_OPTION_NO_REMOTE_DESKTOP_OPTIMIZATION MFP_OPTION_NO_REMOTE_DESKTOP_OPTIMIZATION

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Contains flags for the structure.

Some of these flags, marked [out], convey information back to the MFPlay player object. The application should set or clear these flags as appropriate, before returning from the callback method.

dd757935 _MFP_CREDENTIAL_FLAGS _MFP_CREDENTIAL_FLAGS
No documentation. dd757935 MFP_CREDENTIAL_PROMPT MFP_CREDENTIAL_PROMPT No documentation. dd757935 MFP_CREDENTIAL_SAVE MFP_CREDENTIAL_SAVE No documentation. dd757935 MFP_CREDENTIAL_DO_NOT_CACHE MFP_CREDENTIAL_DO_NOT_CACHE No documentation. dd757935 MFP_CREDENTIAL_CLEAR_TEXT MFP_CREDENTIAL_CLEAR_TEXT No documentation. dd757935 MFP_CREDENTIAL_PROXY MFP_CREDENTIAL_PROXY No documentation. dd757935 MFP_CREDENTIAL_LOGGED_ON_USER MFP_CREDENTIAL_LOGGED_ON_USER None. None None

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Contains flags that describe a media item.

The following typedef is defined for combining flags from this enumeration.

typedef UINT32 MFP_MEDIAITEM_CHARACTERISTICS;
dd757936 _MFP_MEDIAITEM_CHARACTERISTICS _MFP_MEDIAITEM_CHARACTERISTICS
No documentation. dd757936 MFP_MEDIAITEM_IS_LIVE MFP_MEDIAITEM_IS_LIVE No documentation. dd757936 MFP_MEDIAITEM_CAN_SEEK MFP_MEDIAITEM_CAN_SEEK No documentation. dd757936 MFP_MEDIAITEM_CAN_PAUSE MFP_MEDIAITEM_CAN_PAUSE No documentation. dd757936 MFP_MEDIAITEM_HAS_SLOW_SEEK MFP_MEDIAITEM_HAS_SLOW_SEEK

Not supported.

Note??Earlier versions of this documentation described the _MFT_DRAIN_TYPE enumeration incorrectly. The enumeration is not supported. For more information, see .

ms700116 _MFT_DRAIN_TYPE _MFT_DRAIN_TYPE
No documentation. ms700116 MFT_DRAIN_PRODUCE_TAILS MFT_DRAIN_PRODUCE_TAILS No documentation. ms700116 MFT_DRAIN_NO_TAILS MFT_DRAIN_NO_TAILS

Defines flags for the method.

The values in this enumeration are not bit flags, so they should not be combined with a bitwise OR. Also, the caller should test for these flags with the equality operator, not a bitwise AND:

// Correct. if (Buffer.dwStatus == ) { ... } // Incorrect. if ((Buffer.dwStatus & ) != 0) { ... }
ms702281 _MFT_INPUT_DATA_BUFFER_FLAGS _MFT_INPUT_DATA_BUFFER_FLAGS
No documentation. ms702281 MFT_INPUT_DATA_BUFFER_PLACEHOLDER MFT_INPUT_DATA_BUFFER_PLACEHOLDER None. None None

Indicates the status of an input stream on a Media Foundation transform (MFT).

ms703084 _MFT_INPUT_STATUS_FLAGS _MFT_INPUT_STATUS_FLAGS

The input stream can receive more data at this time. To deliver more input data, call .

ms703084 MFT_INPUT_STATUS_ACCEPT_DATA MFT_INPUT_STATUS_ACCEPT_DATA
None. None None

Describes an input stream on a Media Foundation transform (MFT).

Before the client sets the media types on the transform, the only flags guaranteed to be accurate are the and flags. For all other flags, the client should first set the media type on every non-optional stream.

In the default processing model, an MFT holds a reference count on the sample that it receives in ProcessInput. It does not process the sample immediately inside ProcessInput. When ProcessOutput is called, the MFT produces output data and then discards the input sample. The following variations on this model are defined:

  • If an MFT never holds onto input samples between ProcessInput and ProcessOutput, it can set the .

  • If an MFT holds some input samples beyond the next call to ProcessOutput, it can set the .

ms703975 _MFT_INPUT_STREAM_INFO_FLAGS _MFT_INPUT_STREAM_INFO_FLAGS

Each media sample ( interface) of input data must contain complete, unbroken units of data. The definition of a unit of data depends on the media type: For uncompressed video, a video frame; for compressed data, a compressed packet; for uncompressed audio, a single audio frame.

For uncompressed audio formats, this flag is always implied. (It is valid to set the flag, but not required.) An uncompressed audio frame should never span more than one media sample.

ms703975 MFT_INPUT_STREAM_WHOLE_SAMPLES MFT_INPUT_STREAM_WHOLE_SAMPLES

Each media sample that the client provides as input must contain exactly one unit of data, as defined for the flag.

If this flag is present, the flag must also be present.

An MFT that processes uncompressed audio should not set this flag. The MFT should accept buffers that contain more than a single audio frame, for efficiency.

ms703975 MFT_INPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER MFT_INPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER

All input samples must be the same size. The size is given in the cbSize member of the structure. The MFT must provide this value. During processing, the MFT should verify the size of input samples, and may drop samples with incorrect size.

ms703975 MFT_INPUT_STREAM_FIXED_SAMPLE_SIZE MFT_INPUT_STREAM_FIXED_SAMPLE_SIZE

The MFT might hold one or more input samples after is called. If this flag is present, the hnsMaxLatency member of the structure gives the maximum latency, and the cbMaxLookahead member gives the maximum number of bytes of lookahead.

ms703975 MFT_INPUT_STREAM_HOLDS_BUFFERS MFT_INPUT_STREAM_HOLDS_BUFFERS

The MFT does not hold input samples after the method returns. It releases the sample before the ProcessInput method returns.

If this flag is absent, the MFT might hold a reference count on the samples that are passed to the ProcessInput method. The client must not re-use or delete the buffer memory until the MFT releases the sample's reference.

If this flag is absent, it does not guarantee that the MFT holds a reference count on the input samples. It is valid for an MFT to release input samples in ProcessInput even if the MFT does not set this flag. However, setting this flag might enable to client to optimize how it re-uses buffers.

An MFT should not set this flag if it ever holds onto an input sample after returning from ProcessInput.

ms703975 MFT_INPUT_STREAM_DOES_NOT_ADDREF MFT_INPUT_STREAM_DOES_NOT_ADDREF

This input stream can be removed by calling .

ms703975 MFT_INPUT_STREAM_REMOVABLE MFT_INPUT_STREAM_REMOVABLE

This input stream is optional. The transform can produce output without receiving input from this stream. The caller can deselect the stream by not setting a media type or by setting a null media type. It is possible for every input stream on a transform to be optional, but at least one input must be selected in order to produce output.

ms703975 MFT_INPUT_STREAM_OPTIONAL MFT_INPUT_STREAM_OPTIONAL

The MFT can perform in-place processing. In this mode, the MFT directly modifies the input buffer. When the client calls ProcessOutput, the same sample that was delivered to this stream is returned in the output stream that has a matching stream identifier. This flag implies that the MFT holds onto the input buffer, so this flag cannot combined with the flag.

If this flag is present, the MFT must set the or flag for the output stream that corresponds to this input stream. (See ).

ms703975 MFT_INPUT_STREAM_PROCESSES_IN_PLACE MFT_INPUT_STREAM_PROCESSES_IN_PLACE
None. None None

Defines flags for the method.

The values in this enumeration are not bit flags, so they should not be combined with a bitwise OR. Also, the caller should test for these flags with the equality operator, not a bitwise AND:

// Correct. if (Buffer.dwStatus == ) { ... } // Incorrect. if ((Buffer.dwStatus & ) != 0) { ... }
ms702281 _MFT_OUTPUT_DATA_BUFFER_FLAGS _MFT_OUTPUT_DATA_BUFFER_FLAGS
No documentation. ms702281 MFT_OUTPUT_DATA_BUFFER_INCOMPLETE MFT_OUTPUT_DATA_BUFFER_INCOMPLETE No documentation. ms702281 MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE No documentation. ms702281 MFT_OUTPUT_DATA_BUFFER_STREAM_END MFT_OUTPUT_DATA_BUFFER_STREAM_END No documentation. ms702281 MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE None. None None

Indicates whether a Media Foundation transform (MFT) can produce output data.

ms701553 _MFT_OUTPUT_STATUS_FLAGS _MFT_OUTPUT_STATUS_FLAGS

There is a sample available for at least one output stream. To retrieve the available output samples, call .

ms701553 MFT_OUTPUT_STATUS_SAMPLE_READY MFT_OUTPUT_STATUS_SAMPLE_READY
None. None None

Describes an output stream on a Media Foundation transform (MFT).

Before the client sets the media types on the MFT, the only flag guaranteed to be accurate is the flag. For all other flags, the client should first set the media type on every non-optional stream.

The and flags define different behaviors for how the MFT can discard output data.

  • MFT_OUTPUT_STREAM_DISCARDABLE: The MFT discards output data only if the client calls ProcessOutput with the flag. The MFT never discards data when the client calls ProcessInput.

  • MFT_OUTPUT_STREAM_LAZY_READ: If the client continues to call ProcessInput without collecting the output from this stream, the MFT eventually discards the output. If all output streams have the flag, the MFT never refuses more input data.

If neither of these flags is set, the MFT never discards output data.

ms705618 _MFT_OUTPUT_STREAM_INFO_FLAGS _MFT_OUTPUT_STREAM_INFO_FLAGS

Each media sample ( interface) of output data from the MFT contains complete, unbroken units of data. The definition of a unit of data depends on the media type: For uncompressed video, a video frame; for compressed data, a compressed packet; for uncompressed audio, a single audio frame.

For uncompressed audio formats, this flag is always implied. (It is valid to set the flag, but not required.) An uncompressed audio frame should never span more than one media sample.

ms705618 MFT_OUTPUT_STREAM_WHOLE_SAMPLES MFT_OUTPUT_STREAM_WHOLE_SAMPLES

Each output sample contains exactly one unit of data, as defined for the flag.

If this flag is present, the flag must also be present.

An MFT that outputs uncompressed audio should not set this flag. For efficiency, it should output more than one audio frame at a time.

ms705618 MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER

All output samples are the same size.

ms705618 MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE

The MFT can discard the output data from this output stream, if requested by the client. To discard the output, set the flag in the method.

ms705618 MFT_OUTPUT_STREAM_DISCARDABLE MFT_OUTPUT_STREAM_DISCARDABLE

This output stream is optional. The client can deselect the stream by not setting a media type or by setting a null media type. When an optional stream is deselected, it does not produce any output data.

ms705618 MFT_OUTPUT_STREAM_OPTIONAL MFT_OUTPUT_STREAM_OPTIONAL

The MFT provides the output samples for this stream, either by allocating them internally or by operating directly on the input samples. The MFT cannot use output samples provided by the client for this stream.

If this flag is not set, the MFT must set cbSize to a nonzero value in the structure, so that the client can allocate the correct buffer size. For more information, see . This flag cannot be combined with the flag.

ms705618 MFT_OUTPUT_STREAM_PROVIDES_SAMPLES MFT_OUTPUT_STREAM_PROVIDES_SAMPLES

The MFT can either provide output samples for this stream or it can use samples that the client allocates. This flag cannot be combined with the flag.

If the MFT does not set this flag or the flag, the client must allocate the samples for this output stream. The MFT will not provide its own samples.

ms705618 MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES

The MFT does not require the client to process the output for this stream. If the client continues to send input data without getting the output from this stream, the MFT simply discards the previous input.

ms705618 MFT_OUTPUT_STREAM_LAZY_READ MFT_OUTPUT_STREAM_LAZY_READ

The MFT might remove this output stream during streaming. This flag typically applies to demultiplexers, where the input data contains multiple streams that can start and stop during streaming. For more information, see .

ms705618 MFT_OUTPUT_STREAM_REMOVABLE MFT_OUTPUT_STREAM_REMOVABLE
None. None None

Defines flags for the setting or testing the media type on a Media Foundation transform (MFT).

ms704051 _MFT_SET_TYPE_FLAGS _MFT_SET_TYPE_FLAGS

Test the proposed media type, but do not set it.

ms704051 MFT_SET_TYPE_TEST_ONLY MFT_SET_TYPE_TEST_ONLY
None. None None

Specifies how the user's credentials will be used.

ms697023 MFNetAuthenticationFlags MFNetAuthenticationFlags

The credentials will be used to authenticate with a proxy.

ms697023 MFNET_AUTHENTICATION_PROXY MFNET_AUTHENTICATION_PROXY

The credentials will be sent over the network unencrypted.

ms697023 MFNET_AUTHENTICATION_CLEAR_TEXT MFNET_AUTHENTICATION_CLEAR_TEXT

The credentials must be from a user who is currently logged on.

ms697023 MFNET_AUTHENTICATION_LOGGED_ON_USER MFNET_AUTHENTICATION_LOGGED_ON_USER

Describes options for the caching network credentials.

ms697386 MFNetCredentialOptions MFNetCredentialOptions

Allow the credential cache object to save credentials in persistant storage.

ms697386 MFNET_CREDENTIAL_SAVE MFNET_CREDENTIAL_SAVE

Do not allow the credential cache object to cache the credentials in memory. This flag cannot be combined with the flag.

ms697386 MFNET_CREDENTIAL_DONT_CACHE MFNET_CREDENTIAL_DONT_CACHE

The user allows credentials to be sent over the network in clear text.

By default, always returns the flag when the authentication flags include , even if cached credentials are available. If you set the option, the GetCredential method will not return for clear text, if cached credentials are available.

Do not set this flag without notifying the user that credentials might be sent in clear text.

ms697386 MFNET_CREDENTIAL_ALLOW_CLEAR_TEXT MFNET_CREDENTIAL_ALLOW_CLEAR_TEXT

Specifies how the credential manager should obtain user credentials.

The application implements the credential manager, which must expose the interface. If the flag is set, the credential manager should prompt the user for his or her name and password.

The credential cache object sets the flag if the cache does not yet contain valid credentials. It also sets this flag if the credentials will be sent as plain text, unless the credential manager previously set the option. (See .)

ms700813 MFNetCredentialRequirements MFNetCredentialRequirements

The credential manager should prompt the user to provide the credentials.

ms700813 REQUIRE_PROMPT REQUIRE_PROMPT

Note??Requires Windows?7 or later.

The credentials are saved to persistent storage. This flag acts as a hint for the application's UI. If the application prompts the user for credentials, the UI can indicate that the credentials have already been saved.

ms700813 REQUIRE_SAVE_SELECTED REQUIRE_SAVE_SELECTED

Specifies how the default proxy locator will specify the connection settings to a proxy server. The application must set these values in the MFNETSOURCE_PROXYSETTINGS property.

aa372538 MFNET_PROXYSETTINGS MFNET_PROXYSETTINGS
No documentation. aa372538 MFNET_PROXYSETTING_NONE MFNET_PROXYSETTING_NONE No documentation. aa372538 MFNET_PROXYSETTING_MANUAL MFNET_PROXYSETTING_MANUAL No documentation. aa372538 MFNET_PROXYSETTING_AUTO MFNET_PROXYSETTING_AUTO No documentation. aa372538 MFNET_PROXYSETTING_BROWSER MFNET_PROXYSETTING_BROWSER

Defines statistics collected by the network source. The values in this enumeration define property identifiers (PIDs) for the MFNETSOURCE_STATISTICS property.

To retrieve statistics from the network source, call with the service identifier and the interface identifier IID_IPropertyStore. The retrieved reference is an reference. To get the value of a network statistic, construct a PROPERTYKEY with fmtid equal to MFNETSOURCE_STATISTICS and pid equal to a value from this enumeration. Then call IPropertyStore::GetValue with the property key to retrieve the value of the statistic as a .

In the descriptions that follow, the data type and value-type tag for the are listed in parentheses.

ms697019 MFNETSOURCE_CACHE_STATE MFNETSOURCE_CACHE_STATE
No documentation. ms697019 MFNETSOURCE_CACHE_UNAVAILABLE MFNETSOURCE_CACHE_UNAVAILABLE No documentation. ms697019 MFNETSOURCE_CACHE_ACTIVE_WRITING MFNETSOURCE_CACHE_ACTIVE_WRITING No documentation. ms697019 MFNETSOURCE_CACHE_ACTIVE_COMPLETE MFNETSOURCE_CACHE_ACTIVE_COMPLETE

Indicates the type of control protocol that is used in streaming or downloading.

ms704031 MFNETSOURCE_PROTOCOL_TYPE MFNETSOURCE_PROTOCOL_TYPE

The protocol type has not yet been determined.

ms704031 MFNETSOURCE_UNDEFINED MFNETSOURCE_UNDEFINED

The protocol type is HTTP. This includes HTTPv9, WMSP, and HTTP download.

ms704031 MFNETSOURCE_HTTP MFNETSOURCE_HTTP

The protocol type is Real Time Streaming Protocol (RTSP).

ms704031 MFNETSOURCE_RTSP MFNETSOURCE_RTSP

The content is read from a file. The file might be local or on a remote share.

ms704031 MFNETSOURCE_FILE MFNETSOURCE_FILE

The protocol type is multicast.

Note??Requires Windows?7 or later.

ms704031 MFNETSOURCE_MULTICAST MFNETSOURCE_MULTICAST

Defines statistics collected by the network source. The values in this enumeration define property identifiers (PIDs) for the MFNETSOURCE_STATISTICS property.

To retrieve statistics from the network source, call with the service identifier and the interface identifier IID_IPropertyStore. The retrieved reference is an reference. To get the value of a network statistic, construct a PROPERTYKEY with fmtid equal to MFNETSOURCE_STATISTICS and pid equal to a value from this enumeration. Then call IPropertyStore::GetValue with the property key to retrieve the value of the statistic as a .

In the descriptions that follow, the data type and value-type tag for the are listed in parentheses.

ms697019 MFNETSOURCE_STATISTICS_IDS MFNETSOURCE_STATISTICS_IDS
No documentation. ms697019 MFNETSOURCE_RECVPACKETS_ID MFNETSOURCE_RECVPACKETS_ID No documentation. ms697019 MFNETSOURCE_LOSTPACKETS_ID MFNETSOURCE_LOSTPACKETS_ID No documentation. ms697019 MFNETSOURCE_RESENDSREQUESTED_ID MFNETSOURCE_RESENDSREQUESTED_ID No documentation. ms697019 MFNETSOURCE_RESENDSRECEIVED_ID MFNETSOURCE_RESENDSRECEIVED_ID No documentation. ms697019 MFNETSOURCE_RECOVEREDBYECCPACKETS_ID MFNETSOURCE_RECOVEREDBYECCPACKETS_ID No documentation. ms697019 MFNETSOURCE_RECOVEREDBYRTXPACKETS_ID MFNETSOURCE_RECOVEREDBYRTXPACKETS_ID No documentation. ms697019 MFNETSOURCE_OUTPACKETS_ID MFNETSOURCE_OUTPACKETS_ID No documentation. ms697019 MFNETSOURCE_RECVRATE_ID MFNETSOURCE_RECVRATE_ID No documentation. ms697019 MFNETSOURCE_AVGBANDWIDTHBPS_ID MFNETSOURCE_AVGBANDWIDTHBPS_ID No documentation. ms697019 MFNETSOURCE_BYTESRECEIVED_ID MFNETSOURCE_BYTESRECEIVED_ID No documentation. ms697019 MFNETSOURCE_PROTOCOL_ID MFNETSOURCE_PROTOCOL_ID No documentation. ms697019 MFNETSOURCE_TRANSPORT_ID MFNETSOURCE_TRANSPORT_ID No documentation. ms697019 MFNETSOURCE_CACHE_STATE_ID MFNETSOURCE_CACHE_STATE_ID No documentation. ms697019 MFNETSOURCE_LINKBANDWIDTH_ID MFNETSOURCE_LINKBANDWIDTH_ID No documentation. ms697019 MFNETSOURCE_CONTENTBITRATE_ID MFNETSOURCE_CONTENTBITRATE_ID No documentation. ms697019 MFNETSOURCE_SPEEDFACTOR_ID MFNETSOURCE_SPEEDFACTOR_ID No documentation. ms697019 MFNETSOURCE_BUFFERSIZE_ID MFNETSOURCE_BUFFERSIZE_ID No documentation. ms697019 MFNETSOURCE_BUFFERPROGRESS_ID MFNETSOURCE_BUFFERPROGRESS_ID No documentation. ms697019 MFNETSOURCE_LASTBWSWITCHTS_ID MFNETSOURCE_LASTBWSWITCHTS_ID No documentation. ms697019 MFNETSOURCE_SEEKRANGESTART_ID MFNETSOURCE_SEEKRANGESTART_ID No documentation. ms697019 MFNETSOURCE_SEEKRANGEEND_ID MFNETSOURCE_SEEKRANGEEND_ID No documentation. ms697019 MFNETSOURCE_BUFFERINGCOUNT_ID MFNETSOURCE_BUFFERINGCOUNT_ID No documentation. ms697019 MFNETSOURCE_INCORRECTLYSIGNEDPACKETS_ID MFNETSOURCE_INCORRECTLYSIGNEDPACKETS_ID No documentation. ms697019 MFNETSOURCE_SIGNEDSESSION_ID MFNETSOURCE_SIGNEDSESSION_ID No documentation. ms697019 MFNETSOURCE_MAXBITRATE_ID MFNETSOURCE_MAXBITRATE_ID No documentation. ms697019 MFNETSOURCE_RECEPTION_QUALITY_ID MFNETSOURCE_RECEPTION_QUALITY_ID No documentation. ms697019 MFNETSOURCE_RECOVEREDPACKETS_ID MFNETSOURCE_RECOVEREDPACKETS_ID No documentation. ms697019 MFNETSOURCE_VBR_ID MFNETSOURCE_VBR_ID No documentation. ms697019 MFNETSOURCE_DOWNLOADPROGRESS_ID MFNETSOURCE_DOWNLOADPROGRESS_ID No documentation. ms697019 MFNETSOURCE_UNPREDEFINEDPROTOCOLNAME_ID MFNETSOURCE_UNPREDEFINEDPROTOCOLNAME_ID

Describes the type of transport used in streaming or downloading data (TCP or UDP).

ms702233 MFNETSOURCE_TRANSPORT_TYPE MFNETSOURCE_TRANSPORT_TYPE

The data transport type is UDP.

ms702233 MFNETSOURCE_UDP MFNETSOURCE_UDP

The data transport type is TCP.

ms702233 MFNETSOURCE_TCP MFNETSOURCE_TCP

Specifies whether color data includes headroom and toeroom. Headroom allows for values beyond 1.0 white ("whiter than white"), and toeroom allows for values below reference 0.0 black ("blacker than black").

This enumeration is used with the attribute.

For more information about these values, see the remarks for the enumeration, which is the DirectX Video Acceleration (DXVA) equivalent of this enumeration.

ms705659 MFNominalRange MFNominalRange

Unknown nominal range.

ms705659 MFNominalRange_Unknown MFNominalRange_Unknown

Equivalent to .

ms705659 MFNominalRange_Normal MFNominalRange_Normal

Equivalent to .

ms705659 MFNominalRange_Wide MFNominalRange_Wide

The normalized range [0...1] maps to [0...255] for 8-bit samples or [0...1023] for 10-bit samples.

ms705659 MFNominalRange_0_255 MFNominalRange_0_255

The normalized range [0...1] maps to [16...235] for 8-bit samples or [64...940] for 10-bit samples.

ms705659 MFNominalRange_16_235 MFNominalRange_16_235

The normalized range [0..1] maps to [48...208] for 8-bit samples or [64...940] for 10-bit samples.

ms705659 MFNominalRange_48_208 MFNominalRange_48_208

The normalized range [0..1] maps to [64...127] for 8-bit samples or [256...508] for 10-bit samples. This range is used in the xRGB color space.

Note??Requires Windows?7 or later.

ms705659 MFNominalRange_64_127 MFNominalRange_64_127
No documentation. ms705659 MFNominalRange_Last MFNominalRange_Last No documentation. ms705659 MFNominalRange_ForceDWORD MFNominalRange_ForceDWORD

Defines the object types that are created by the source resolver.

ms704771 MF_OBJECT_TYPE MF_OBJECT_TYPE

Media source. You can query the object for the interface.

ms704771 MF_OBJECT_MEDIASOURCE MF_OBJECT_MEDIASOURCE

Byte stream. You can query the object for the interface.

ms704771 MF_OBJECT_BYTESTREAM MF_OBJECT_BYTESTREAM

Invalid type.

ms704771 MF_OBJECT_INVALID MF_OBJECT_INVALID

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Defines event types for the interface.

For each event type, the callback receives a reference to a data structure. The first part of the data structure is always an structure. The following table lists the data structure for each event type.

In your implementation of OnMediaPlayerEvent, you must cast the pEventHeader parameter to the correct structure type. A set of macros is defined for this purpose. These macros check the value of the event type and return null if there is a mismatch; otherwise they return a reference to the correct structure type.

Event type

Event structure

Pointer cast macro

MFP_GET_PLAY_EVENT

MFP_GET_PAUSE_EVENT

MFP_GET_STOP_EVENT

MFP_GET_POSITION_SET_EVENT

MFP_GET_RATE_SET_EVENT

MFP_GET_MEDIAITEM_CREATED_EVENT

MFP_GET_MEDIAITEM_SET_EVENT

MFP_GET_FRAME_STEP_EVENT

MFP_GET_MEDIAITEM_CLEARED_EVENT

MFP_GET_MF_EVENT

MFP_GET_ERROR_EVENT

MFP_GET_PLAYBACK_ENDED_EVENT

MFP_GET_ACQUIRE_USER_CREDENTIAL_EVENT

?

dd375532 MFP_EVENT_TYPE MFP_EVENT_TYPE
No documentation. dd375532 MFP_EVENT_TYPE_PLAY MFP_EVENT_TYPE_PLAY No documentation. dd375532 MFP_EVENT_TYPE_PAUSE MFP_EVENT_TYPE_PAUSE No documentation. dd375532 MFP_EVENT_TYPE_STOP MFP_EVENT_TYPE_STOP No documentation. dd375532 MFP_EVENT_TYPE_POSITION_SET MFP_EVENT_TYPE_POSITION_SET No documentation. dd375532 MFP_EVENT_TYPE_RATE_SET MFP_EVENT_TYPE_RATE_SET No documentation. dd375532 MFP_EVENT_TYPE_MEDIAITEM_CREATED MFP_EVENT_TYPE_MEDIAITEM_CREATED No documentation. dd375532 MFP_EVENT_TYPE_MEDIAITEM_SET MFP_EVENT_TYPE_MEDIAITEM_SET No documentation. dd375532 MFP_EVENT_TYPE_FRAME_STEP MFP_EVENT_TYPE_FRAME_STEP No documentation. dd375532 MFP_EVENT_TYPE_MEDIAITEM_CLEARED MFP_EVENT_TYPE_MEDIAITEM_CLEARED No documentation. dd375532 MFP_EVENT_TYPE_MF MFP_EVENT_TYPE_MF No documentation. dd375532 MFP_EVENT_TYPE_ERROR MFP_EVENT_TYPE_ERROR No documentation. dd375532 MFP_EVENT_TYPE_PLAYBACK_ENDED MFP_EVENT_TYPE_PLAYBACK_ENDED No documentation. dd375532 MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL

Specifies the object type for the interface.

dd375763 MF_Plugin_Type MF_Plugin_Type
No documentation. dd375763 MF_Plugin_Type_MFT MF_Plugin_Type_MFT No documentation. dd375763 MF_Plugin_Type_MediaSource MF_Plugin_Type_MediaSource

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Specifies the current playback state.

dd375562 MFP_MEDIAPLAYER_STATE MFP_MEDIAPLAYER_STATE
No documentation. dd375562 MFP_MEDIAPLAYER_STATE_EMPTY MFP_MEDIAPLAYER_STATE_EMPTY No documentation. dd375562 MFP_MEDIAPLAYER_STATE_STOPPED MFP_MEDIAPLAYER_STATE_STOPPED No documentation. dd375562 MFP_MEDIAPLAYER_STATE_PLAYING MFP_MEDIAPLAYER_STATE_PLAYING No documentation. dd375562 MFP_MEDIAPLAYER_STATE_PAUSED MFP_MEDIAPLAYER_STATE_PAUSED No documentation. dd375562 MFP_MEDIAPLAYER_STATE_SHUTDOWN MFP_MEDIAPLAYER_STATE_SHUTDOWN

Contains flags that define the behavior of the function.

ms697495 MFPMPSESSION_CREATION_FLAGS MFPMPSESSION_CREATION_FLAGS
No documentation. ms697495 MFPMPSESSION_UNPROTECTED_PROCESS MFPMPSESSION_UNPROTECTED_PROCESS None. None None

Defines actions that can be performed on a stream.

ms698977 MFPOLICYMANAGER_ACTION MFPOLICYMANAGER_ACTION

No action.

ms698977 PEACTION_NO PEACTION_NO

Play the stream.

ms698977 PEACTION_PLAY PEACTION_PLAY

Copy the stream.

ms698977 PEACTION_COPY PEACTION_COPY

Export the stream to another format.

ms698977 PEACTION_EXPORT PEACTION_EXPORT

Extract the data from the stream and pass it to the application. For example, acoustic echo cancellation requires this action.

ms698977 PEACTION_EXTRACT PEACTION_EXTRACT

Reserved.

ms698977 PEACTION_RESERVED1 PEACTION_RESERVED1

Reserved.

ms698977 PEACTION_RESERVED2 PEACTION_RESERVED2

Reserved.

ms698977 PEACTION_RESERVED3 PEACTION_RESERVED3

Last member of the enumeration.

ms698977 PEACTION_LAST PEACTION_LAST

Contains flags for the method.

If the decoder sets the flag, the quality manager tries to reduce latency through the media source and the media sink. For example, it might request the Enhanced Video Renderer (EVR) to drop frames. During this period, the quality manager stops calling the decoder's method, until samples are no longer arriving late at the sink. At that point, the quality manager resumes calling NotifyQualityEvent on the decoder.

dd743824 MF_QUALITY_ADVISE_FLAGS MF_QUALITY_ADVISE_FLAGS
No documentation. dd743824 MF_QUALITY_CANNOT_KEEP_UP MF_QUALITY_CANNOT_KEEP_UP None. None None

Specifies how aggressively a pipeline component should drop samples.

In drop mode, a component drops samples, more or less aggressively depending on the level of the drop mode. The specific algorithm used depends on the component. Mode 1 is the least aggressive mode, and mode 5 is the most aggressive. A component is not required to implement all five levels.

For example, suppose an encoded video stream has three B-frames between each pair of P-frames. A decoder might implement the following drop modes:

  • Mode 1: Drop one out of every three B frames.

  • Mode 2: Drop one out of every two B frames.

  • Mode 3: Drop all delta frames.

  • Modes 4 and 5: Unsupported.

The enhanced video renderer (EVR) can drop video frames before sending them to the EVR mixer.

ms704659 MF_QUALITY_DROP_MODE MF_QUALITY_DROP_MODE

Normal processing of samples. Drop mode is disabled.

ms704659 MF_DROP_MODE_NONE MF_DROP_MODE_NONE

First drop mode (least aggressive).

ms704659 MF_DROP_MODE_1 MF_DROP_MODE_1

Second drop mode.

ms704659 MF_DROP_MODE_2 MF_DROP_MODE_2

Third drop mode.

ms704659 MF_DROP_MODE_3 MF_DROP_MODE_3

Fourth drop mode.

ms704659 MF_DROP_MODE_4 MF_DROP_MODE_4

Fifth drop mode (most aggressive, if it is supported; see Remarks).

ms704659 MF_DROP_MODE_5 MF_DROP_MODE_5

Maximum number of drop modes. This value is not a valid flag.

ms704659 MF_NUM_DROP_MODES MF_NUM_DROP_MODES

Specifies the quality level for a pipeline component. The quality level determines how the component consumes or produces samples.

Each successive quality level decreases the amount of processing that is needed, while also reducing the resulting quality of the audio or video. The specific algorithm used to reduce quality depends on the component. Mode 1 is the least aggressive mode, and mode 5 is the most aggressive. A component is not required to implement all five levels. Also, the same quality level might not be comparable between two different components.

Video decoders can often reduce quality by leaving out certain post-processing steps. The enhanced video renderer (EVR) can sometimes reduce quality by switching to a different deinterlacing mode.

ms698949 MF_QUALITY_LEVEL MF_QUALITY_LEVEL

Normal quality.

ms698949 MF_QUALITY_NORMAL MF_QUALITY_NORMAL

One level below normal quality.

ms698949 MF_QUALITY_NORMAL_MINUS_1 MF_QUALITY_NORMAL_MINUS_1

Two levels below normal quality.

ms698949 MF_QUALITY_NORMAL_MINUS_2 MF_QUALITY_NORMAL_MINUS_2

Three levels below normal quality.

ms698949 MF_QUALITY_NORMAL_MINUS_3 MF_QUALITY_NORMAL_MINUS_3

Four levels below normal quality.

ms698949 MF_QUALITY_NORMAL_MINUS_4 MF_QUALITY_NORMAL_MINUS_4

Five levels below normal quality.

ms698949 MF_QUALITY_NORMAL_MINUS_5 MF_QUALITY_NORMAL_MINUS_5

Maximum number of quality levels. This value is not a valid flag.

ms698949 MF_NUM_QUALITY_LEVELS MF_NUM_QUALITY_LEVELS

Specifies the direction of playback (forward or reverse).

ms696225 MFRATE_DIRECTION MFRATE_DIRECTION

Forward playback.

ms696225 MFRATE_FORWARD MFRATE_FORWARD

Reverse playback.

ms696225 MFRATE_REVERSE MFRATE_REVERSE

Defines the version number for sample protection.

ms697061 SAMPLE_PROTECTION_VERSION SAMPLE_PROTECTION_VERSION

No sample protection.

ms697061 SAMPLE_PROTECTION_VERSION_NO SAMPLE_PROTECTION_VERSION_NO

Version 1.

ms697061 SAMPLE_PROTECTION_VERSION_BASIC_LOKI SAMPLE_PROTECTION_VERSION_BASIC_LOKI

Version 2.

ms697061 SAMPLE_PROTECTION_VERSION_SCATTER SAMPLE_PROTECTION_VERSION_SCATTER

Version 3.

ms697061 SAMPLE_PROTECTION_VERSION_RC4 SAMPLE_PROTECTION_VERSION_RC4

Contains flags for adding a topology to the sequencer source, or updating a topology already in the queue.

ms703884 MFSequencerTopologyFlags MFSequencerTopologyFlags

This topology is the last topology in the sequence.

ms703884 SequencerTopologyFlags_Last SequencerTopologyFlags_Last

Retrieves an interface from the enhanced video renderer (EVR), or from the video mixer or video presenter.

This method can be called only from inside the method. At any other time, the method returns .

The presenter can use this method to query the EVR and the mixer. The mixer can use it to query the EVR and the presenter. Which objects are queried depends on the caller and the service , as shown in the following table.

CallerService Objects queried
PresenterMR_VIDEO_RENDER_SERVICEEVR
PresenterMR_VIDEO_MIXER_SERVICEMixer
MixerMR_VIDEO_RENDER_SERVICEPresenter and EVR

?

The following interfaces are available from the EVR:

  • IMediaEventSink. This interface is documented in the DirectShow SDK documentation.

  • interface. This interface is available if the EVR has access to a clock (reference clock in DirectShow or presentation clock in Media Foundation). This interface might not be available. Presenter and mixers must be able to process data without a clock. If the interface is available, you can also get these related interfaces:

    • (Media Foundation EVR only)

The following interfaces are available from the mixer:

bb970504 MF_SERVICE_LOOKUP_TYPE MF_SERVICE_LOOKUP_TYPE

Specifies the scope of the search. Currently this parameter is ignored. Use the value .

bb970504 MF_SERVICE_LOOKUP_UPSTREAM MF_SERVICE_LOOKUP_UPSTREAM

Reserved, must be zero.

bb970504 MF_SERVICE_LOOKUP_UPSTREAM_DIRECT MF_SERVICE_LOOKUP_UPSTREAM_DIRECT

Service of the requested interface.

bb970504 MF_SERVICE_LOOKUP_DOWNSTREAM MF_SERVICE_LOOKUP_DOWNSTREAM

Interface identifier of the requested interface.

bb970504 MF_SERVICE_LOOKUP_DOWNSTREAM_DIRECT MF_SERVICE_LOOKUP_DOWNSTREAM_DIRECT

Array of interface references. If the method succeeds, each member of the array contains either a valid interface reference or null. The caller must release the interface references when the EVR calls (or earlier). If the method fails, every member of the array is null.

bb970504 MF_SERVICE_LOOKUP_ALL MF_SERVICE_LOOKUP_ALL

Pointer to a value that specifies the size of the ppvObjects array. The value must be at least 1. In the current implementation, there is no reason to specify an array size larger than one element. The value is not changed on output.

bb970504 MF_SERVICE_LOOKUP_GLOBAL MF_SERVICE_LOOKUP_GLOBAL

Defines flags for the method.

ms701845 MFSESSION_GETFULLTOPOLOGY_FLAGS MFSESSION_GETFULLTOPOLOGY_FLAGS
No documentation. ms701845 MFSESSION_GETFULLTOPOLOGY_CURRENT MFSESSION_GETFULLTOPOLOGY_CURRENT None. None None

Defines the behavior of the method.

These flags are optional, and are not mutually exclusive. If no flags are set, the Media Session resolves the topology and then adds it to the queue of pending presentations.

ms696169 MFSESSION_SETTOPOLOGY_FLAGS MFSESSION_SETTOPOLOGY_FLAGS
No documentation. ms696169 MFSESSION_SETTOPOLOGY_IMMEDIATE MFSESSION_SETTOPOLOGY_IMMEDIATE No documentation. ms696169 MFSESSION_SETTOPOLOGY_NORESOLUTION MFSESSION_SETTOPOLOGY_NORESOLUTION No documentation. ms696169 MFSESSION_SETTOPOLOGY_CLEAR_CURRENT MFSESSION_SETTOPOLOGY_CLEAR_CURRENT None. None None

Describes the current status of a call to the method.

ms701630 MFSHUTDOWN_STATUS MFSHUTDOWN_STATUS
No documentation. ms701630 MFSHUTDOWN_INITIATED MFSHUTDOWN_INITIATED No documentation. ms701630 MFSHUTDOWN_COMPLETED MFSHUTDOWN_COMPLETED

Specifies how the ASF file sink should apply Windows Media DRM.

ms703949 MFSINK_WMDRMACTION MFSINK_WMDRMACTION

Undefined action.

ms703949 MFSINK_WMDRMACTION_UNDEFINED MFSINK_WMDRMACTION_UNDEFINED

Encode the content using Windows Media DRM. Use this flag if the source content does not have DRM protection.

ms703949 MFSINK_WMDRMACTION_ENCODE MFSINK_WMDRMACTION_ENCODE

Transcode the content using Windows Media DRM. Use this flag if the source content has Windows Media DRM protection and you want to change the encoding parameters but not the DRM protection.

ms703949 MFSINK_WMDRMACTION_TRANSCODE MFSINK_WMDRMACTION_TRANSCODE

Transcrypt the content. Use this flag if the source content has DRM protection and you want to change the DRM protection; for example, if you want to convert from Windows Media DRM version 1 to Windows Media DRM version 7 or later.

ms703949 MFSINK_WMDRMACTION_TRANSCRYPT MFSINK_WMDRMACTION_TRANSCRYPT

Reserved. Do not use.

ms703949 MFSINK_WMDRMACTION_LAST MFSINK_WMDRMACTION_LAST
No documentation. __MIDL___MIDL_itf_mfreadwrite_0000_0003_0001 __MIDL___MIDL_itf_mfreadwrite_0000_0003_0001 No documentation. MF_SINK_WRITER_INVALID_STREAM_INDEX MF_SINK_WRITER_INVALID_STREAM_INDEX No documentation. MF_SINK_WRITER_ALL_STREAMS MF_SINK_WRITER_ALL_STREAMS No documentation. MF_SINK_WRITER_MEDIASINK MF_SINK_WRITER_MEDIASINK

Contains flags for the method.

dd375771 MF_SOURCE_READER_CONTROL_FLAG MF_SOURCE_READER_CONTROL_FLAG
No documentation. dd375771 MF_SOURCE_READER_CONTROLF_DRAIN MF_SOURCE_READER_CONTROLF_DRAIN None. None None

Contains flags that indicate the status of the method.

dd375773 MF_SOURCE_READER_FLAG MF_SOURCE_READER_FLAG
No documentation. dd375773 MF_SOURCE_READERF_ERROR MF_SOURCE_READERF_ERROR No documentation. dd375773 MF_SOURCE_READERF_ENDOFSTREAM MF_SOURCE_READERF_ENDOFSTREAM No documentation. dd375773 MF_SOURCE_READERF_NEWSTREAM MF_SOURCE_READERF_NEWSTREAM No documentation. dd375773 MF_SOURCE_READERF_NATIVEMEDIATYPECHANGED MF_SOURCE_READERF_NATIVEMEDIATYPECHANGED No documentation. dd375773 MF_SOURCE_READERF_CURRENTMEDIATYPECHANGED MF_SOURCE_READERF_CURRENTMEDIATYPECHANGED No documentation. dd375773 MF_SOURCE_READERF_STREAMTICK MF_SOURCE_READERF_STREAMTICK None. None None No documentation. ee663274 __MIDL___MIDL_itf_mfreadwrite_0000_0001_0001 __MIDL___MIDL_itf_mfreadwrite_0000_0001_0001 No documentation. ee663274 MF_SOURCE_READER_INVALID_STREAM_INDEX MF_SOURCE_READER_INVALID_STREAM_INDEX No documentation. ee663274 MF_SOURCE_READER_ALL_STREAMS MF_SOURCE_READER_ALL_STREAMS No documentation. ee663274 MF_SOURCE_READER_ANY_STREAM MF_SOURCE_READER_ANY_STREAM No documentation. ee663274 MF_SOURCE_READER_FIRST_AUDIO_STREAM MF_SOURCE_READER_FIRST_AUDIO_STREAM No documentation. ee663274 MF_SOURCE_READER_FIRST_VIDEO_STREAM MF_SOURCE_READER_FIRST_VIDEO_STREAM No documentation. ee663274 MF_SOURCE_READER_MEDIASOURCE MF_SOURCE_READER_MEDIASOURCE No documentation. __MIDL___MIDL_itf_mfidl_0000_0001_0001 __MIDL___MIDL_itf_mfidl_0000_0001_0001 No documentation. MF_RESOLUTION_MEDIASOURCE MF_RESOLUTION_MEDIASOURCE No documentation. MF_RESOLUTION_BYTESTREAM MF_RESOLUTION_BYTESTREAM No documentation. MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE No documentation. MF_RESOLUTION_KEEP_BYTE_STREAM_ALIVE_ON_FAIL MF_RESOLUTION_KEEP_BYTE_STREAM_ALIVE_ON_FAIL No documentation. MF_RESOLUTION_READ MF_RESOLUTION_READ No documentation. MF_RESOLUTION_WRITE MF_RESOLUTION_WRITE None. None None

Contains values that specify common video formats.

aa473799 MFStandardVideoFormat MFStandardVideoFormat

Reserved; do not use.

aa473799 MFStdVideoFormat_reserved MFStdVideoFormat_reserved

NTSC television (720 x 480i).

aa473799 MFStdVideoFormat_NTSC MFStdVideoFormat_NTSC

PAL television (720 x 576i).

aa473799 MFStdVideoFormat_PAL MFStdVideoFormat_PAL

DVD, NTSC standard (720 x 480).

aa473799 MFStdVideoFormat_DVD_NTSC MFStdVideoFormat_DVD_NTSC

DVD, PAL standard (720 x 576).

aa473799 MFStdVideoFormat_DVD_PAL MFStdVideoFormat_DVD_PAL

DV video, PAL standard.

aa473799 MFStdVideoFormat_DV_PAL MFStdVideoFormat_DV_PAL

DV video, NTSC standard.

aa473799 MFStdVideoFormat_DV_NTSC MFStdVideoFormat_DV_NTSC

ATSC digital television, SD (480i).

aa473799 MFStdVideoFormat_ATSC_SD480i MFStdVideoFormat_ATSC_SD480i

ATSC digital television, HD interlaced (1080i)

aa473799 MFStdVideoFormat_ATSC_HD1080i MFStdVideoFormat_ATSC_HD1080i

ATSC digital television, HD progressive (720p)

aa473799 MFStdVideoFormat_ATSC_HD720p MFStdVideoFormat_ATSC_HD720p

Defines stream marker information for the method. The PlaceMarker method places a marker on the stream between samples. The enumeration defines the marker type and the type of information associated with the marker.

If the Streaming Audio Renderer receives an marker, it inserts silence to cover the gap in the data.

ms703837 MFSTREAMSINK_MARKER_TYPE MFSTREAMSINK_MARKER_TYPE
No documentation. ms703837 MFSTREAMSINK_MARKER_DEFAULT MFSTREAMSINK_MARKER_DEFAULT No documentation. ms703837 MFSTREAMSINK_MARKER_ENDOFSEGMENT MFSTREAMSINK_MARKER_ENDOFSEGMENT No documentation. ms703837 MFSTREAMSINK_MARKER_TICK MFSTREAMSINK_MARKER_TICK No documentation. ms703837 MFSTREAMSINK_MARKER_EVENT MFSTREAMSINK_MARKER_EVENT

Contains flags for the method.

ms703005 MFTIMER_FLAGS MFTIMER_FLAGS
No documentation. ms703005 MFTIMER_RELATIVE MFTIMER_RELATIVE None. None None

Defines messages for a Media Foundation transform (MFT). To send a message to an MFT, call .

Some messages require specific actions from the MFT. These events have "MESSAGE" in the message name. Other messages are informational; they notify the MFT of some action by the client, and do not require any particular response from the MFT. These messages have "NOTIFY" in the messages name. Except where noted, an MFT should not rely on the client sending notification messages.

ms697223 MFT_MESSAGE_TYPE MFT_MESSAGE_TYPE
No documentation. ms697223 MFT_MESSAGE_COMMAND_FLUSH MFT_MESSAGE_COMMAND_FLUSH No documentation. ms697223 MFT_MESSAGE_COMMAND_DRAIN MFT_MESSAGE_COMMAND_DRAIN No documentation. ms697223 MFT_MESSAGE_SET_D3D_MANAGER MFT_MESSAGE_SET_D3D_MANAGER No documentation. ms697223 MFT_MESSAGE_DROP_SAMPLES MFT_MESSAGE_DROP_SAMPLES No documentation. ms697223 MFT_MESSAGE_NOTIFY_BEGIN_STREAMING MFT_MESSAGE_NOTIFY_BEGIN_STREAMING No documentation. ms697223 MFT_MESSAGE_NOTIFY_END_STREAMING MFT_MESSAGE_NOTIFY_END_STREAMING No documentation. ms697223 MFT_MESSAGE_NOTIFY_END_OF_STREAM MFT_MESSAGE_NOTIFY_END_OF_STREAM No documentation. ms697223 MFT_MESSAGE_NOTIFY_START_OF_STREAM MFT_MESSAGE_NOTIFY_START_OF_STREAM No documentation. ms697223 MFT_MESSAGE_COMMAND_MARKER MFT_MESSAGE_COMMAND_MARKER

Specifies whether the topology loader enables Microsoft DirectX Video Acceleration (DXVA) in the topology.

The value of this attribute is an enumeration constant. The default value is .

This attribute controls which MFTs receive a reference to the Direct3D device manager. To enable full video acceleration, set the value to . The value is defined for backward compatibility; it matches the behavior of all earlier versions of Microsoft Media Foundation.

The constant for this attribute is exported from mfuuid.lib.

dd375776 MFTOPOLOGY_DXVA_MODE MFTOPOLOGY_DXVA_MODE
No documentation. dd375776 MFTOPOLOGY_DXVA_DEFAULT MFTOPOLOGY_DXVA_DEFAULT No documentation. dd375776 MFTOPOLOGY_DXVA_NONE MFTOPOLOGY_DXVA_NONE No documentation. dd375776 MFTOPOLOGY_DXVA_FULL MFTOPOLOGY_DXVA_FULL

Specifies whether to load hardware-based Microsoft Media Foundation transforms (MFTs) in the topology.

This attribute is optional. Set the attribute before resolving the topology.

ValueDescription

The Topology Loader will load hardware-based MFTs, such as hardware decoders, when available.

The Topology Loader automatically falls back to software decoding if no hardware decoder is found, or if a hardware decoder fails to connect for some reason.

The Topology Loader will load only software MFTs, including software decoders.

?

The default value is , for compatibility with existing applications. The recommended value is .

If the Topology Loader inserts a hardware MFT into the topology, it sets the attribute on the topology node. To check whether a hardware MFT is present, enumerate the nodes in the resolved topology and check whether this attribute is present.

The constant for this attribute is exported from mfuuid.lib.

dd375780 MFTOPOLOGY_HARDWARE_MODE MFTOPOLOGY_HARDWARE_MODE
No documentation. dd375780 MFTOPOLOGY_HWMODE_SOFTWARE_ONLY MFTOPOLOGY_HWMODE_SOFTWARE_ONLY No documentation. dd375780 MFTOPOLOGY_HWMODE_USE_HARDWARE MFTOPOLOGY_HWMODE_USE_HARDWARE

Defines status flags for the attribute.

ms704637 MF_TOPOLOGY_RESOLUTION_STATUS_FLAGS MF_TOPOLOGY_RESOLUTION_STATUS_FLAGS
No documentation. ms704637 MF_TOPOLOGY_RESOLUTION_SUCCEEDED MF_TOPOLOGY_RESOLUTION_SUCCEEDED No documentation. ms704637 MF_OPTIONAL_NODE_REJECTED_MEDIA_TYPE MF_OPTIONAL_NODE_REJECTED_MEDIA_TYPE No documentation. ms704637 MF_OPTIONAL_NODE_REJECTED_PROTECTED_PROCESS MF_OPTIONAL_NODE_REJECTED_PROTECTED_PROCESS None. None None

Specifies the status of a topology during playback.

This enumeration is used with the event. The event always has an attribute whose value is a member of this enumeration.

For a single topology, the Media Session sends these status flags in numerical order, starting with . However, there is no guarantee about the ordering of the events across two different topologies. For example, you might get for a topology before you get for the previous topology.

aa370812 MF_TOPOSTATUS MF_TOPOSTATUS

This value is not used.

aa370812 MF_TOPOSTATUS_INVALID MF_TOPOSTATUS_INVALID

The topology is ready to start. After this status flag is received, you can use the Media Session's method to query the topology for services, such as rate control.

aa370812 MF_TOPOSTATUS_READY MF_TOPOSTATUS_READY

The Media Session has started to read data from the media sources in the topology.

aa370812 MF_TOPOSTATUS_STARTED_SOURCE MF_TOPOSTATUS_STARTED_SOURCE

The Media Session modified the topology, because the format of a stream changed.

aa370812 MF_TOPOSTATUS_DYNAMIC_CHANGED MF_TOPOSTATUS_DYNAMIC_CHANGED

The media sinks have switched from the previous topology to this topology. This status value is not sent for the first topology that is played. For the first topology, the event indicates that the media sinks have started receiving data.

aa370812 MF_TOPOSTATUS_SINK_SWITCHED MF_TOPOSTATUS_SINK_SWITCHED

Playback of this topology is complete. The Media Session might still use the topology internally. The Media Session does not completely release the topology until it sends the next status event or the event.

aa370812 MF_TOPOSTATUS_ENDED MF_TOPOSTATUS_ENDED

Defines the type of a topology node.

ms698973 MF_TOPOLOGY_TYPE MF_TOPOLOGY_TYPE

Output node. Represents a media sink in the topology.

ms698973 MF_TOPOLOGY_OUTPUT_NODE MF_TOPOLOGY_OUTPUT_NODE

Source node. Represents a media stream in the topology.

ms698973 MF_TOPOLOGY_SOURCESTREAM_NODE MF_TOPOLOGY_SOURCESTREAM_NODE

Transform node. Represents a Media Foundation Transform (MFT) in the topology.

ms698973 MF_TOPOLOGY_TRANSFORM_NODE MF_TOPOLOGY_TRANSFORM_NODE

Tee node. A tee node does not hold a reference to an object. Instead, it represents a fork in the stream. A tee node has one input and multiple outputs, and samples from the upstream node are delivered to all of the downstream nodes.

ms698973 MF_TOPOLOGY_TEE_NODE MF_TOPOLOGY_TEE_NODE

Reserved.

ms698973 MF_TOPOLOGY_MAX MF_TOPOLOGY_MAX

Defines at what times a transform in a topology is drained.

aa370822 MF_TOPONODE_DRAIN_MODE MF_TOPONODE_DRAIN_MODE

The transform is drained when the end of a stream is reached. It is not drained when markout is reached at the end of a segment.

aa370822 MF_TOPONODE_DRAIN_DEFAULT MF_TOPONODE_DRAIN_DEFAULT

The transform is drained whenever a topology ends.

aa370822 MF_TOPONODE_DRAIN_ALWAYS MF_TOPONODE_DRAIN_ALWAYS

The transform is never drained.

aa370822 MF_TOPONODE_DRAIN_NEVER MF_TOPONODE_DRAIN_NEVER

Defines when a transform in a topology is flushed.

ms704760 MF_TOPONODE_FLUSH_MODE MF_TOPONODE_FLUSH_MODE

The transform is flushed whenever the stream changes, including seeks and new segments.

ms704760 MF_TOPONODE_FLUSH_ALWAYS MF_TOPONODE_FLUSH_ALWAYS

The transform is flushed when seeking is performed on the stream.

ms704760 MF_TOPONODE_FLUSH_SEEK MF_TOPONODE_FLUSH_SEEK

The transform is never flushed during streaming. It is flushed only when the object is released.

ms704760 MF_TOPONODE_FLUSH_NEVER MF_TOPONODE_FLUSH_NEVER

Defines the profile flags that are set in the attribute.

These flags are checked by during topology building. Based on these flags, adjusts the transcode profile by modifying the configuration settings for the streams according to the input requirements of the encoder used in the topology.

For more information about the stream settings that an application can specify, see Using the Transcode API.

If the flag is specified, the following changes are made for the video stream:

  • If the frame rate of the media source specified in the pSrc parameter of and the frame rate specified by the application in the attribute differ by less than 1/1000, the profile uses the media source frame rate. This is because the pipeline considers the difference to be negligible.
  • If the application does not specify an interlaced mode by setting the attribute, the profile is changed to use progressive frames.

The flag must be accompanied with the required audio and video stream attributes provided by the application. For the audio stream, the required attributes are as follows:

For the video stream, the required attributes are as follows:

If these attributes are not set, creates the topology but Media Session fails to generate the encoded file. The failure code depends on the MFT node in the topology. For example, if the application does not set the frame size, the WMV encoder fails to encode the content and application gets the error code through the Media Session.

Use the flag when you want to transcode the file by using the input stream attributes. The input source stream attributes are copied to the output media type before the MFT node is inserted in the topology. If you set additional stream attributes, this flag does not overwrite the set values. Only the missing attributes are filled with the input source's attribute values. This flag is useful in remux scenario where you want to generate the output file in the same format as the input source. If you want to perform format conversion, make sure you set the attribute for the stream to specify the encoder that topology builder must use. The transform node is added in the topology unless is set. In this case, and the content is not encoded. Instead, if permitted by the container, the content is embedded in the specified container.

For example, assume that your input source is an MP3 file. You set the container to be MFTranscodeContainerType_ASF, you do not set any stream attributes, and you set the flag. In this case, the generated output file is an ASF file (.wma) containing MP3 media data. Note that if you use this flag, certain input stream attributes and the container type might not be compatible.

dd388918 MF_TRANSCODE_ADJUST_PROFILE_FLAGS MF_TRANSCODE_ADJUST_PROFILE_FLAGS
No documentation. dd388918 MF_TRANSCODE_ADJUST_PROFILE_DEFAULT MF_TRANSCODE_ADJUST_PROFILE_DEFAULT No documentation. dd388918 MF_TRANSCODE_ADJUST_PROFILE_USE_SOURCE_ATTRIBUTES MF_TRANSCODE_ADJUST_PROFILE_USE_SOURCE_ATTRIBUTES None. None None

Defines flags for the attribute.

dd388926 MF_TRANSCODE_TOPOLOGYMODE_FLAGS MF_TRANSCODE_TOPOLOGYMODE_FLAGS
No documentation. dd388926 MF_TRANSCODE_TOPOLOGYMODE_SOFTWARE_ONLY MF_TRANSCODE_TOPOLOGYMODE_SOFTWARE_ONLY No documentation. dd388926 MF_TRANSCODE_TOPOLOGYMODE_HARDWARE_ALLOWED MF_TRANSCODE_TOPOLOGYMODE_HARDWARE_ALLOWED None. None None

Contains flags for registering and enumeration Media Foundation transforms (MFTs).

These flags are used in the following functions:

  • : These flags control which Media Foundation transforms (MFTs) are enumerated, as well as the enumeration order.
  • : A subset of these flags are used when registering an MFT.

For registration, these flags describe the MFT that is being registered. Some flags do not apply in that context. For enumeration, these flags control which MFTs are selected in the enumeration. For more details about the precise meaning of these flags, see the reference topics for and

For registration, the , , and flags are mutually exclusive. For enumeration, these three flags can be combined.

dd389302 _MFT_ENUM_FLAG _MFT_ENUM_FLAG
No documentation. dd389302 MFT_ENUM_FLAG_SYNCMFT MFT_ENUM_FLAG_SYNCMFT No documentation. dd389302 MFT_ENUM_FLAG_ASYNCMFT MFT_ENUM_FLAG_ASYNCMFT No documentation. dd389302 MFT_ENUM_FLAG_HARDWARE MFT_ENUM_FLAG_HARDWARE No documentation. dd389302 MFT_ENUM_FLAG_FIELDOFUSE MFT_ENUM_FLAG_FIELDOFUSE No documentation. dd389302 MFT_ENUM_FLAG_LOCALMFT MFT_ENUM_FLAG_LOCALMFT No documentation. dd389302 MFT_ENUM_FLAG_TRANSCODE_ONLY MFT_ENUM_FLAG_TRANSCODE_ONLY No documentation. dd389302 MFT_ENUM_FLAG_SORTANDFILTER MFT_ENUM_FLAG_SORTANDFILTER No documentation. dd389302 MFT_ENUM_FLAG_ALL MFT_ENUM_FLAG_ALL None. None None

Defines flags for processing output samples in a Media Foundation transform (MFT).

ms700163 _MFT_PROCESS_OUTPUT_FLAGS _MFT_PROCESS_OUTPUT_FLAGS

Do not produce output for streams in which the pSample member of the structure is null. This flag is not valid unless the MFT has marked the output stream with the or flag. For more information, see .

ms700163 MFT_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER MFT_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER
None. None None

Indicates the status of a call to .

If the MFT sets this flag, the ProcessOutput method returns and no output data is produced. The client should respond as follows:

  1. Call to get the new number of streams.

  2. Call to get the new stream identifiers.

  3. Call and to set the media types on the new streams.

Until these steps are completed, all further calls to ProcessOutput return .

ms699875 _MFT_PROCESS_OUTPUT_STATUS _MFT_PROCESS_OUTPUT_STATUS
No documentation. ms699875 MFT_PROCESS_OUTPUT_STATUS_NEW_STREAMS MFT_PROCESS_OUTPUT_STATUS_NEW_STREAMS

Indicates whether the URL is from a trusted source.

ms705652 MF_URL_TRUST_STATUS MF_URL_TRUST_STATUS

The validity of the URL cannot be guaranteed because it is not signed. The application should warn the user.

ms705652 MF_LICENSE_URL_UNTRUSTED MF_LICENSE_URL_UNTRUSTED

The URL is the original one provided with the content.

ms705652 MF_LICENSE_URL_TRUSTED MF_LICENSE_URL_TRUSTED

The URL was originally signed and has been tampered with. The file should be considered corrupted, and the application should not navigate to the URL without issuing a strong warning the user.

ms705652 MF_LICENSE_URL_TAMPERED MF_LICENSE_URL_TAMPERED

Defines flags for the structure.

ms703973 MFVideoAlphaBitmapFlags MFVideoAlphaBitmapFlags
No documentation. ms703973 MFVideoAlphaBitmap_EntireDDS MFVideoAlphaBitmap_EntireDDS No documentation. ms703973 MFVideoAlphaBitmap_SrcColorKey MFVideoAlphaBitmap_SrcColorKey No documentation. ms703973 MFVideoAlphaBitmap_SrcRect MFVideoAlphaBitmap_SrcRect No documentation. ms703973 MFVideoAlphaBitmap_DestRect MFVideoAlphaBitmap_DestRect No documentation. ms703973 MFVideoAlphaBitmap_FilterMode MFVideoAlphaBitmap_FilterMode No documentation. ms703973 MFVideoAlphaBitmap_Alpha MFVideoAlphaBitmap_Alpha No documentation. ms703973 MFVideoAlphaBitmap_BitMask MFVideoAlphaBitmap_BitMask

Specifies the aspect-ratio mode.

ms703040 MFVideoAspectRatioMode MFVideoAspectRatioMode

Do not maintain the aspect ratio of the video. Stretch the video to fit the output rectangle.

ms703040 MFVideoARMode_None MFVideoARMode_None

Preserve the aspect ratio of the video by letterboxing or within the output rectangle.

ms703040 MFVideoARMode_PreservePicture MFVideoARMode_PreservePicture

Note??Currently the EVR ignores this flag.

Correct the aspect ratio if the physical size of the display device does not match the display resolution. For example, if the native resolution of the monitor is 1600 by 1200 (4:3) but the display resolution is 1280 by 1024 (5:4), the monitor will display non-square pixels.

If this flag is set, you must also set the flag.

ms703040 MFVideoARMode_PreservePixel MFVideoARMode_PreservePixel

Apply a non-linear horizontal stretch if the aspect ratio of the destination rectangle does not match the aspect ratio of the source rectangle.

The non-linear stretch algorithm preserves the aspect ratio in the middle of the picture and stretches (or shrinks) the image progressively more toward the left and right. This mode is useful when viewing 4:3 content full-screen on a 16:9 display, instead of pillar-boxing. Non-linear vertical stretch is not supported, because the visual results are generally poor.

This mode may cause performance degradation.

If this flag is set, you must also set the and flags.

ms703040 MFVideoARMode_NonLinearStretch MFVideoARMode_NonLinearStretch

Contains flags that define the chroma encoding scheme for Y'Cb'Cr' data.

These flags are used with the attribute.

For more information about these values, see the remarks for the enumeration, which is the DirectX Video Acceleration (DXVA) equivalent of this enumeration.

ms698989 MFVideoChromaSubsampling MFVideoChromaSubsampling

Unknown encoding scheme.

ms698989 MFVideoChromaSubsampling_Unknown MFVideoChromaSubsampling_Unknown

Chroma should be reconstructed as if the underlying video was progressive content, rather than skipping fields or applying chroma filtering to minimize artifacts from reconstructing 4:2:0 interlaced chroma.

ms698989 MFVideoChromaSubsampling_ProgressiveChroma MFVideoChromaSubsampling_ProgressiveChroma

Chroma samples are aligned horizontally with the luma samples, or with multiples of the luma samples. If this flag is not set, chroma samples are located 1/2 pixel to the right of the corresponding luma sample.

ms698989 MFVideoChromaSubsampling_Horizontally_Cosited MFVideoChromaSubsampling_Horizontally_Cosited

Chroma samples are aligned vertically with the luma samples, or with multiples of the luma samples. If this flag is not set, chroma samples are located 1/2 pixel down from the corresponding luma sample.

ms698989 MFVideoChromaSubsampling_Vertically_Cosited MFVideoChromaSubsampling_Vertically_Cosited

The U and V planes are aligned vertically. If this flag is not set, the chroma planes are assumed to be out of phase by 1/2 chroma sample, alternating between a line of U followed by a line of V.

ms698989 MFVideoChromaSubsampling_Vertically_AlignedChromaPlanes MFVideoChromaSubsampling_Vertically_AlignedChromaPlanes

Specifies the chroma encoding scheme for MPEG-2 video. Chroma samples are aligned horizontally with the luma samples, but are not aligned vertically. The U and V planes are aligned vertically.

ms698989 MFVideoChromaSubsampling_MPEG2 MFVideoChromaSubsampling_MPEG2

Specifies the chroma encoding scheme for MPEG-1 video.

ms698989 MFVideoChromaSubsampling_MPEG1 MFVideoChromaSubsampling_MPEG1

Specifies the chroma encoding scheme for PAL DV video.

ms698989 MFVideoChromaSubsampling_DV_PAL MFVideoChromaSubsampling_DV_PAL

Chroma samples are aligned vertically and horizontally with the luma samples. YUV formats such as 4:4:4, 4:2:2, and 4:1:1 are always cosited in both directions and should use this flag.

ms698989 MFVideoChromaSubsampling_Cosited MFVideoChromaSubsampling_Cosited

Reserved.

ms698989 MFVideoChromaSubsampling_Last MFVideoChromaSubsampling_Last

Reserved. This member forces the enumeration type to compile as a DWORD value.

ms698989 MFVideoChromaSubsampling_ForceDWORD MFVideoChromaSubsampling_ForceDWORD

Specifies the type of copy protection required for a video stream.

Use these flags with the attribute.

ms698900 MFVideoDRMFlags MFVideoDRMFlags

No copy protection is required.

ms698900 MFVideoDRMFlag_None MFVideoDRMFlag_None

Analog copy protection should be applied.

ms698900 MFVideoDRMFlag_AnalogProtected MFVideoDRMFlag_AnalogProtected

Digital copy protection should be applied.

ms698900 MFVideoDRMFlag_DigitallyProtected MFVideoDRMFlag_DigitallyProtected

Contains flags that describe a video stream.

These flags are used in the structure, which is part of the structure.

Developers are encouraged to use media type attributes instead of using the structure. The following table lists the attributes that correspond to the flags defined in this enumeration.

FlagsMedia Type Attribute

Use the attribute to specify a negative stride.

?

The following flags were defined to describe per-sample interlacing information, but are obsolete:

Instead, components should use sample attributes to describe per-sample interlacing information, as described in the topic Video Interlacing.

aa473786 MFVideoFlags MFVideoFlags
No documentation. aa473786 MFVideoFlag_PAD_TO_None MFVideoFlag_PAD_TO_None No documentation. aa473786 MFVideoFlag_PAD_TO_4x3 MFVideoFlag_PAD_TO_4x3 No documentation. aa473786 MFVideoFlag_PAD_TO_16x9 MFVideoFlag_PAD_TO_16x9 No documentation. aa473786 MFVideoFlag_SrcContentHintMask MFVideoFlag_SrcContentHintMask No documentation. aa473786 MFVideoFlag_SrcContentHintNone MFVideoFlag_SrcContentHintNone No documentation. aa473786 MFVideoFlag_SrcContentHint16x9 MFVideoFlag_SrcContentHint16x9 No documentation. aa473786 MFVideoFlag_SrcContentHint235_1 MFVideoFlag_SrcContentHint235_1 No documentation. aa473786 MFVideoFlag_AnalogProtected MFVideoFlag_AnalogProtected No documentation. aa473786 MFVideoFlag_DigitallyProtected MFVideoFlag_DigitallyProtected No documentation. aa473786 MFVideoFlag_ProgressiveContent MFVideoFlag_ProgressiveContent No documentation. aa473786 MFVideoFlag_FieldRepeatCountMask MFVideoFlag_FieldRepeatCountMask No documentation. aa473786 MFVideoFlag_FieldRepeatCountShift MFVideoFlag_FieldRepeatCountShift No documentation. aa473786 MFVideoFlag_ProgressiveSeqReset MFVideoFlag_ProgressiveSeqReset No documentation. aa473786 MFVideoFlag_PanScanEnabled MFVideoFlag_PanScanEnabled No documentation. aa473786 MFVideoFlag_LowerFieldFirst MFVideoFlag_LowerFieldFirst No documentation. aa473786 MFVideoFlag_BottomUpLinearRep MFVideoFlag_BottomUpLinearRep No documentation. aa473786 MFVideoFlags_DXVASurface MFVideoFlags_DXVASurface No documentation. aa473786 MFVideoFlags_RenderTargetSurface MFVideoFlags_RenderTargetSurface No documentation. aa473786 MFVideoFlags_ForceQWORD MFVideoFlags_ForceQWORD

Specifies how a video stream is interlaced.

In the descriptions that follow, upper field refers to the field that contains the leading half scan line. Lower field refers to the field that contains the first full scan line.

Scan lines in the lower field are 0.5 scan line lower than those in the upper field. In NTSC television, a frame consists of a lower field followed by an upper field. In PAL television, a frame consists of an upper field followed by a lower field.

The upper field is also called the even field, the top field, or field 2. The lower field is also called the odd field, the bottom field, or field 1.

If the interlace mode is or , each sample contains a single field, so each buffer contains only half the number of field lines given in the media type.

ms694269 MFVideoInterlaceMode MFVideoInterlaceMode

The type of interlacing is not known.

ms694269 MFVideoInterlace_Unknown MFVideoInterlace_Unknown

Progressive frames.

ms694269 MFVideoInterlace_Progressive MFVideoInterlace_Progressive

Interlaced frames. Each frame contains two fields. The field lines are interleaved, with the upper field appearing on the first line.

ms694269 MFVideoInterlace_FieldInterleavedUpperFirst MFVideoInterlace_FieldInterleavedUpperFirst

Interlaced frames. Each frame contains two fields. The field lines are interleaved, with the lower field appearing on the first line.

ms694269 MFVideoInterlace_FieldInterleavedLowerFirst MFVideoInterlace_FieldInterleavedLowerFirst

Interlaced frames. Each frame contains one field, with the upper field appearing first.

ms694269 MFVideoInterlace_FieldSingleUpper MFVideoInterlace_FieldSingleUpper

Interlaced frames. Each frame contains one field, with the lower field appearing first.

ms694269 MFVideoInterlace_FieldSingleLower MFVideoInterlace_FieldSingleLower

The stream contains a mix of interlaced and progressive modes.

ms694269 MFVideoInterlace_MixedInterlaceOrProgressive MFVideoInterlace_MixedInterlaceOrProgressive

Reserved.

ms694269 MFVideoInterlace_Last MFVideoInterlace_Last

Reserved. This member forces the enumeration type to compile as a DWORD value.

ms694269 MFVideoInterlace_ForceDWORD MFVideoInterlace_ForceDWORD

Describes the optimal lighting for viewing a particular set of video content.

This enumeration is used with the attribute.

ms696202 MFVideoLighting MFVideoLighting

The optimal lighting is unknown.

ms696202 MFVideoLighting_Unknown MFVideoLighting_Unknown

Bright lighting; for example, outdoors.

ms696202 MFVideoLighting_bright MFVideoLighting_bright

Medium brightness; for example, normal office lighting.

ms696202 MFVideoLighting_office MFVideoLighting_office

Dim; for example, a living room with a television and additional low lighting.

ms696202 MFVideoLighting_dim MFVideoLighting_dim

Dark; for example, a movie theater.

ms696202 MFVideoLighting_dark MFVideoLighting_dark

Reserved.

ms696202 MFVideoLighting_Last MFVideoLighting_Last

Reserved. This member forces the enumeration type to compile as a DWORD value.

ms696202 MFVideoLighting_ForceDWORD MFVideoLighting_ForceDWORD

Contains flags that are used to configure how the enhanced video renderer (EVR) performs deinterlacing.

To set these flags, call the method.

These flags control some trade-offs between video quality and rendering speed. The constants named "MFVideoMixPrefs_Allow..." enable lower-quality settings, but only when the quality manager requests a drop in quality. The constants named "MFVideoMixPrefs_Force..." force the EVR to use lower-quality settings regardless of what the quality manager requests. (For more information about the quality manager, see .)

Currently two lower-quality modes are supported, as described in the following table. Either is preferable to dropping an entire frame.

ModeDescription

Half interface

The EVR's video mixer skips the second field (relative to temporal order) of each interlaced frame. The video mixer still deinterlaces the first field, and this operation typically interpolates data from the second field. The overall frame rate is unaffected.

Bob deinterlacing

The video mixer uses bob deinterlacing, even if the driver supports a higher-quality deinterlacing algorithm.

?

dd388675 MFVideoMixPrefs MFVideoMixPrefs

Force the EVR to skip the second field (in temporal order) of every interlaced frame.

dd388675 MFVideoMixPrefs_ForceHalfInterlace MFVideoMixPrefs_ForceHalfInterlace

If the EVR is falling behind, allow it to skip the second field (in temporal order) of every interlaced frame.

dd388675 MFVideoMixPrefs_AllowDropToHalfInterlace MFVideoMixPrefs_AllowDropToHalfInterlace

If the EVR is falling behind, allow it to use bob deinterlacing, even if the driver supports a higher-quality deinterlacing mode.

dd388675 MFVideoMixPrefs_AllowDropToBob MFVideoMixPrefs_AllowDropToBob

Force the EVR to use bob deinterlacing, even if the driver supports a higher-quality mode.

dd388675 MFVideoMixPrefs_ForceBob MFVideoMixPrefs_ForceBob

Specifies whether to pad a video image so that it fits within a specified aspect ratio.

Use these flags with the attribute.

ms703091 MFVideoPadFlags MFVideoPadFlags

Do not pad the image.

ms703091 MFVideoPadFlag_PAD_TO_None MFVideoPadFlag_PAD_TO_None

Pad the image so that it can be displayed in a 4?3 area.

ms703091 MFVideoPadFlag_PAD_TO_4x3 MFVideoPadFlag_PAD_TO_4x3

Pad the image so that it can be displayed in a 16?9 area.

ms703091 MFVideoPadFlag_PAD_TO_16x9 MFVideoPadFlag_PAD_TO_16x9

Specifies the color primaries of a video source. The color primaries define how to convert colors from RGB color space to CIE XYZ color space.

This enumeration is used with the attribute.

For more information about these values, see the remarks for the enumeration, which is the DirectX Video Acceleration (DXVA) equivalent of this enumeration.

ms701628 MFVideoPrimaries MFVideoPrimaries

The color primaries are unknown.

ms701628 MFVideoPrimaries_Unknown MFVideoPrimaries_Unknown

Reserved.

ms701628 MFVideoPrimaries_reserved MFVideoPrimaries_reserved

ITU-R BT.709. Also used for sRGB and scRGB.

ms701628 MFVideoPrimaries_BT709 MFVideoPrimaries_BT709

ITU-R BT.470-4 System M (NTSC).

ms701628 MFVideoPrimaries_BT470_2_SysM MFVideoPrimaries_BT470_2_SysM

ITU-R BT.470-4 System B,G (NTSC).

ms701628 MFVideoPrimaries_BT470_2_SysBG MFVideoPrimaries_BT470_2_SysBG

SMPTE 170M.

ms701628 MFVideoPrimaries_SMPTE170M MFVideoPrimaries_SMPTE170M

SMPTE 240M.

ms701628 MFVideoPrimaries_SMPTE240M MFVideoPrimaries_SMPTE240M

EBU 3213.

ms701628 MFVideoPrimaries_EBU3213 MFVideoPrimaries_EBU3213

SMPTE C (SMPTE RP 145).

ms701628 MFVideoPrimaries_SMPTE_C MFVideoPrimaries_SMPTE_C

Reserved.

ms701628 MFVideoPrimaries_Last MFVideoPrimaries_Last

Reserved. This member forces the enumeration type to compile as a DWORD value.

ms701628 MFVideoPrimaries_ForceDWORD MFVideoPrimaries_ForceDWORD

Contains flags that define how the enhanced video renderer (EVR) displays the video.

To set these flags, call .

The flags named "MFVideoRenderPrefs_Allow..." cause the EVR to use lower-quality settings only when requested by the quality manager. (For more information, see .) The flags named "MFVideoRenderPrefs_Force..." cause the video mixer to use lower-quality settings regardless of the quality manager.

ms701834 MFVideoRenderPrefs MFVideoRenderPrefs

If this flag is set, the EVR does not draw the border color. By default, the EVR draws a border on areas of the destination rectangle that have no video. See .

ms701834 MFVideoRenderPrefs_DoNotRenderBorder MFVideoRenderPrefs_DoNotRenderBorder

If this flag is set, the EVR does not clip the video when the video window straddles two monitors. By default, if the video window straddles two monitors, the EVR clips the video to the monitor that contains the largest area of video.

ms701834 MFVideoRenderPrefs_DoNotClipToDevice MFVideoRenderPrefs_DoNotClipToDevice

Note??Requires Windows?7 or later.

Allow the EVR to limit its output to match GPU bandwidth.

ms701834 MFVideoRenderPrefs_AllowOutputThrottling MFVideoRenderPrefs_AllowOutputThrottling

Note??Requires Windows?7 or later.

Force the EVR to limit its output to match GPU bandwidth.

ms701834 MFVideoRenderPrefs_ForceOutputThrottling MFVideoRenderPrefs_ForceOutputThrottling

Note??Requires Windows?7 or later.

Force the EVR to batch Direct3D Present calls. This optimization enables the system to enter to idle states more frequently, which can reduce power consumption.

ms701834 MFVideoRenderPrefs_ForceBatching MFVideoRenderPrefs_ForceBatching

Note??Requires Windows?7 or later.

Allow the EVR to batch Direct3D Present calls.

ms701834 MFVideoRenderPrefs_AllowBatching MFVideoRenderPrefs_AllowBatching

Note??Requires Windows?7 or later.

Force the EVR to mix the video inside a rectangle that is smaller than the output rectangle. The EVR will then scale the result to the correct output size. The effective resolution will be lower if this setting is applied.

ms701834 MFVideoRenderPrefs_ForceScaling MFVideoRenderPrefs_ForceScaling

Note??Requires Windows?7 or later.

Allow the EVR to mix the video inside a rectangle that is smaller than the output rectangle.

ms701834 MFVideoRenderPrefs_AllowScaling MFVideoRenderPrefs_AllowScaling

Note??Requires Windows?7 or later.

Prevent the EVR from repainting the video window after a stop command. By default, the EVR repaints the video window black after a stop command.

ms701834 MFVideoRenderPrefs_DoNotRepaintOnStop MFVideoRenderPrefs_DoNotRepaintOnStop

Describes the intended aspect ratio for a video stream.

Use these flags with the attribute.

ms697451 MFVideoSrcContentHintFlags MFVideoSrcContentHintFlags

The aspect ratio is unknown.

ms697451 MFVideoSrcContentHintFlag_None MFVideoSrcContentHintFlag_None

The source is 16?9 content encoded within a 4?3 area.

ms697451 MFVideoSrcContentHintFlag_16x9 MFVideoSrcContentHintFlag_16x9

The source is 2.35:1 content encoded within a 16?9 or 4?3 area.

ms697451 MFVideoSrcContentHintFlag_235_1 MFVideoSrcContentHintFlag_235_1

Specifies the conversion function from linear RGB to non-linear RGB (R'G'B').

These flags are used with the attribute.

For more information about these values, see the remarks for the enumeration, which is the DirectX Video Acceleration (DXVA) equivalent of this enumeration.

ms705629 MFVideoTransferFunction MFVideoTransferFunction

Unknown. Treat as .

ms705629 MFVideoTransFunc_Unknown MFVideoTransFunc_Unknown

Linear RGB (gamma = 1.0).

ms705629 MFVideoTransFunc_10 MFVideoTransFunc_10

True 1.8 gamma, L' = L^1/1.8.

ms705629 MFVideoTransFunc_18 MFVideoTransFunc_18

True 2.0 gamma, L' = L^1/2.0.

ms705629 MFVideoTransFunc_20 MFVideoTransFunc_20

True 2.2 gamma, L' = L^1/2.2. This transfer function is used in ITU-R BT.470-2 System M (NTSC).

ms705629 MFVideoTransFunc_22 MFVideoTransFunc_22

ITU-R BT.709 transfer function. Gamma 2.2 curve with a linear segment in the lower range. This transfer function is used in BT.709, BT.601, SMPTE 296M, SMPTE 170M, BT.470, and SPMTE 274M. In addition BT-1361 uses this function within the range [0...1].

ms705629 MFVideoTransFunc_709 MFVideoTransFunc_709

SPMTE 240M transfer function. Gamma 2.2 curve with a linear segment in the lower range.

ms705629 MFVideoTransFunc_240M MFVideoTransFunc_240M

sRGB transfer function. Gamma 2.4 curve with a linear segment in the lower range.

ms705629 MFVideoTransFunc_sRGB MFVideoTransFunc_sRGB

True 2.8 gamma. L' = L^1/2.8. This transfer function is used in ITU-R BT.470-2 System B, G (PAL).

ms705629 MFVideoTransFunc_28 MFVideoTransFunc_28

Logarithmic transfer (100:1 range); for example, as used in H.264 video.

Note??Requires Windows?7 or later.

ms705629 MFVideoTransFunc_Log_100 MFVideoTransFunc_Log_100

Logarithmic transfer (316.22777:1 range); for example, as used in H.264 video.

Note??Requires Windows?7 or later.

ms705629 MFVideoTransFunc_Log_316 MFVideoTransFunc_Log_316

Symmetric ITU-R BT.709.

Note??Requires Windows?7 or later.

ms705629 MFVideoTransFunc_709_sym MFVideoTransFunc_709_sym

Reserved.

ms705629 MFVideoTransFunc_Last MFVideoTransFunc_Last

Reserved. This member forces the enumeration type to compile as a DWORD value.

ms705629 MFVideoTransFunc_ForceDWORD MFVideoTransFunc_ForceDWORD

Describes the conversion matrices between Y'PbPr (component video) and studio R'G'B'.

This enumeration is used with the attribute.

For more information about these values, see the remarks for the enumeration, which is the DirectX Video Acceleration (DXVA) equivalent of this enumeration.

ms694036 MFVideoTransferMatrix MFVideoTransferMatrix

Unknown transfer matrix. Treat as .

ms694036 MFVideoTransferMatrix_Unknown MFVideoTransferMatrix_Unknown

ITU-R BT.709 transfer matrix.

ms694036 MFVideoTransferMatrix_BT709 MFVideoTransferMatrix_BT709

ITU-R BT.601 transfer matrix. Also used for SMPTE 170 and ITU-R BT.470-2 System B,G.

ms694036 MFVideoTransferMatrix_BT601 MFVideoTransferMatrix_BT601

SMPTE 240M transfer matrix.

ms694036 MFVideoTransferMatrix_SMPTE240M MFVideoTransferMatrix_SMPTE240M

Reserved.

ms694036 MFVideoTransferMatrix_Last MFVideoTransferMatrix_Last

Reserved. This member forces the enumeration type to compile as a DWORD value.

ms694036 MFVideoTransferMatrix_ForceDWORD MFVideoTransferMatrix_ForceDWORD

Defines messages for an enhanced video renderer (EVR) presenter. This enumeration is used with the method.

ms698964 MFVP_MESSAGE_TYPE MFVP_MESSAGE_TYPE
No documentation. ms698964 MFVP_MESSAGE_FLUSH MFVP_MESSAGE_FLUSH No documentation. ms698964 MFVP_MESSAGE_INVALIDATEMEDIATYPE MFVP_MESSAGE_INVALIDATEMEDIATYPE No documentation. ms698964 MFVP_MESSAGE_PROCESSINPUTNOTIFY MFVP_MESSAGE_PROCESSINPUTNOTIFY No documentation. ms698964 MFVP_MESSAGE_BEGINSTREAMING MFVP_MESSAGE_BEGINSTREAMING No documentation. ms698964 MFVP_MESSAGE_ENDSTREAMING MFVP_MESSAGE_ENDSTREAMING No documentation. ms698964 MFVP_MESSAGE_ENDOFSTREAM MFVP_MESSAGE_ENDOFSTREAM No documentation. ms698964 MFVP_MESSAGE_STEP MFVP_MESSAGE_STEP No documentation. ms698964 MFVP_MESSAGE_CANCELSTEP MFVP_MESSAGE_CANCELSTEP

Contains flags that specify how to convert an audio media type.

ms703181 MFWaveFormatExConvertFlags MFWaveFormatExConvertFlags

Convert the media type to a structure if possible, or a structure otherwise.

ms703181 MFWaveFormatExConvertFlag_Normal MFWaveFormatExConvertFlag_Normal

Convert the media type to a structure.

ms703181 MFWaveFormatExConvertFlag_ForceExtensible MFWaveFormatExConvertFlag_ForceExtensible

The following constants identify the standard Media Foundation work queues.

Applications should use MFASYNC_CALLBACK_QUEUE_MULTITHREADED or use a work queue obtained from MFLockSharedWorkQueue if they want to control the execution priority. Note that the default platform work queue priorities can dynamically change when an application calls RegisterPlatformWithMMCSS. For more information about work queues, see Work Queues.

ms703102 MFASYNC_CALLBACK_QUEUE MFASYNC_CALLBACK_QUEUE
No documentation. ms703102 MFASYNC_CALLBACK_QUEUE_UNDEFINED MFASYNC_CALLBACK_QUEUE_UNDEFINED No documentation. ms703102 MFASYNC_CALLBACK_QUEUE_STANDARD MFASYNC_CALLBACK_QUEUE_STANDARD No documentation. ms703102 MFASYNC_CALLBACK_QUEUE_RT MFASYNC_CALLBACK_QUEUE_RT No documentation. ms703102 MFASYNC_CALLBACK_QUEUE_IO MFASYNC_CALLBACK_QUEUE_IO No documentation. ms703102 MFASYNC_CALLBACK_QUEUE_TIMER MFASYNC_CALLBACK_QUEUE_TIMER No documentation. ms703102 MFASYNC_CALLBACK_QUEUE_LONG_FUNCTION MFASYNC_CALLBACK_QUEUE_LONG_FUNCTION No documentation. ms703102 MFASYNC_CALLBACK_QUEUE_PRIVATE_MASK MFASYNC_CALLBACK_QUEUE_PRIVATE_MASK No documentation. ms703102 MFASYNC_CALLBACK_QUEUE_ALL MFASYNC_CALLBACK_QUEUE_ALL Functions Constant Maxpacketsize. MF_ASFPROFILE_MAXPACKETSIZE Constant Minpacketsize. MF_ASFPROFILE_MINPACKETSIZE Functions Constant PacketBoundary. MFASFSPLITTER_PACKET_BOUNDARY Functions Constant LeakyBucket1. MF_ASFSTREAMCONFIG_LEAKYBUCKET1 Constant LeakyBucket2. MF_ASFSTREAMCONFIG_LEAKYBUCKET2 Functions Constant MultisampledP1. MFAudioFormat_MSP1 Constant Drm. MFAudioFormat_DRM Constant Dts. MFAudioFormat_DTS Constant DolbyAc3Spdif. MFAudioFormat_Dolby_AC3_SPDIF Constant Wmaspdif. MFAudioFormat_WMASPDIF Constant Pcm. MFAudioFormat_PCM Constant Mp3. MFAudioFormat_MP3 Constant WMAudioLossless. MFAudioFormat_WMAudio_Lossless Constant Float. MFAudioFormat_Float Constant WMAudioV8. MFAudioFormat_WMAudioV8 Constant Base. MFAudioFormat_Base Constant Mpeg. MFAudioFormat_MPEG Constant Aac. MFAudioFormat_AAC Constant WMAudioV9. MFAudioFormat_WMAudioV9 Constant Adts. MFAudioFormat_ADTS Functions Constant EndpointId. MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ID Constant EndpointRole. MF_AUDIO_RENDERER_ATTRIBUTE_ENDPOINT_ROLE Constant Flags. MF_AUDIO_RENDERER_ATTRIBUTE_FLAGS Constant SessionId. MF_AUDIO_RENDERER_ATTRIBUTE_SESSION_ID Functions Constant ContentType. MF_BYTESTREAM_CONTENT_TYPE Constant Duration. MF_BYTESTREAM_DURATION Constant IfoFileUri. MF_BYTESTREAM_IFO_FILE_URI Constant LastModifiedTime. MF_BYTESTREAM_LAST_MODIFIED_TIME Constant OriginName. MF_BYTESTREAM_ORIGIN_NAME Constant HandlerAcceptsShareWrite. MF_BYTESTREAMHANDLER_ACCEPTS_SHARE_WRITE Functions Constant SourceTypeVideoCapture. MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID Constant SourceTypeAudioCapture. MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_GUID Constant FriendlyName. MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME Constant MediaType. MF_DEVSOURCE_ATTRIBUTE_MEDIA_TYPE Constant SourceType. MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE Constant SourceTypeAudcapEndpointId. MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ENDPOINT_ID Constant SourceTypeAudcapRole. MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_AUDCAP_ROLE Constant SourceTypeVidcapCategory. MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_CATEGORY Constant SourceTypeVidcapHwSource. MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_HW_SOURCE Constant SourceTypeVidcapMaxBuffers. MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_MAX_BUFFERS Constant SourceTypeVidcapSymbolicLink. MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK Functions Constant AudioBitRate. MF_MP2DLNA_AUDIO_BIT_RATE Constant EncodeQuality. MF_MP2DLNA_ENCODE_QUALITY Constant Statistics. MF_MP2DLNA_STATISTICS Constant UseMmcss. MF_MP2DLNA_USE_MMCSS Constant VideoBitRate. MF_MP2DLNA_VIDEO_BIT_RATE Functions Constant DoThinning. MF_EVENT_DO_THINNING Constant TransformContext. MF_EVENT_MFT_CONTEXT Constant TransformInputStreamId. MF_EVENT_MFT_INPUT_STREAM_ID Constant OutputNode. MF_EVENT_OUTPUT_NODE Constant PresentationTimeOffset. MF_EVENT_PRESENTATION_TIME_OFFSET Constant ScrubsampleTime. MF_EVENT_SCRUBSAMPLE_TIME Constant Sessioncaps. MF_EVENT_SESSIONCAPS Constant SessioncapsDelta. MF_EVENT_SESSIONCAPS_DELTA Constant SourceActualStart. MF_EVENT_SOURCE_ACTUAL_START Constant SourceCharacteristics. MF_EVENT_SOURCE_CHARACTERISTICS Constant SourceCharacteristicsOld. MF_EVENT_SOURCE_CHARACTERISTICS_OLD Constant SourceFakeStart. MF_EVENT_SOURCE_FAKE_START Constant SourceProjectstart. MF_EVENT_SOURCE_PROJECTSTART Constant SourceTopologyCanceled. MF_EVENT_SOURCE_TOPOLOGY_CANCELED Constant StartPresentationTime. MF_EVENT_START_PRESENTATION_TIME Constant StartPresentationTimeAtOutput. MF_EVENT_START_PRESENTATION_TIME_AT_OUTPUT Constant TopologyStatus. MF_EVENT_TOPOLOGY_STATUS Functions Constant SaRequiredSampleCount. MF_SA_REQUIRED_SAMPLE_COUNT Constant VideoZoomRect. VIDEO_ZOOM_RECT Functions Constant AllowBatching. EVRConfig_AllowBatching Constant AllowDropToBob. EVRConfig_AllowDropToBob Constant AllowDropToHalfInterlace. EVRConfig_AllowDropToHalfInterlace Constant AllowDropToThrottle. EVRConfig_AllowDropToThrottle Constant AllowScaling. EVRConfig_AllowScaling Constant ForceBatching. EVRConfig_ForceBatching Constant ForceBob. EVRConfig_ForceBob Constant ForceHalfInterlace. EVRConfig_ForceHalfInterlace Constant ForceScaling. EVRConfig_ForceScaling Constant ForceThrottle. EVRConfig_ForceThrottle Functions Constant MixerActivate. MF_ACTIVATE_CUSTOM_VIDEO_MIXER_ACTIVATE Constant MixerClsid. MF_ACTIVATE_CUSTOM_VIDEO_MIXER_CLSID Constant MixerFlags. MF_ACTIVATE_CUSTOM_VIDEO_MIXER_FLAGS Constant PresenterActivate. MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_ACTIVATE Constant PresenterClsid. MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_CLSID Constant PresenterFlags. MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_FLAGS Constant ActivateVideoWindow. MF_ACTIVATE_VIDEO_WINDOW Functions Constant Version. MF_VERSION

Creates an instance of the enhanced video renderer (EVR) media sink.

Interface identifier (IID) of the requested interface on the EVR.

Receives a reference to the requested interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This function creates the Media Foundation version of the EVR. To create the DirectShow EVR filter, call CoCreateInstance with the class identifier CLSID_EnhancedVideoRenderer.

ms703814 HRESULT MFCreateVideoRenderer([In] const GUID& riidRenderer,[Out, Optional] void** ppVideoRenderer) MFCreateVideoRenderer

Creates a media sample that manages a Direct3D surface.

A reference to the interface of the Direct3D surface. This parameter can be null.

Receives a reference to the sample's interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The media sample created by this function exposes the following interfaces in addition to :

If pUnkSurface is non-null, the sample contains a single media buffer, which holds a reference to the Direct3D surface. To get the Direct3D surface from the media buffer, call on the buffer, using the service identifier . The media buffer does not implement , nor does it implement the and Unlock methods.

Alternatively, you can set pUnkSurface to null, and later add a DirectX surface buffer to the sample by calling . To create a DirectX surface buffer, call .

ms703859 HRESULT MFCreateVideoSampleFromSurface([In, Optional] IUnknown* pUnkSurface,[Out, Optional] IMFSample** ppSample) MFCreateVideoSampleFromSurface

Creates the default video presenter for the enhanced video renderer (EVR).

Pointer to the owner of the object. If the object is aggregated, pass a reference to the aggregating object's interface. Otherwise, set this parameter to null.

Interface identifier (IID) of the video device interface that will be used for processing the video. Currently the only supported value is IID_IDirect3DDevice9.

IID of the requested interface on the video presenter. The video presenter exposes the interface.

Receives a reference to the requested interface on the video presenter. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms693842 HRESULT MFCreateVideoPresenter([In, Optional] IUnknown* pOwner,[In] const GUID& riidDevice,[In] const GUID& riid,[Out, Optional] void** ppVideoPresenter) MFCreateVideoPresenter

Creates the default video mixer for the enhanced video renderer (EVR).

Pointer to the owner of this object. If the object is aggregated, pass a reference to the aggregating object's interface. Otherwise, set this parameter to null.

Interface identifier (IID) of the video device interface that will be used for processing the video. Currently the only supported value is IID_IDirect3DDevice9.

IID of the requested interface on the video mixer. The video mixer exposes the interface.

Receives a reference to the requested interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms705653 HRESULT MFCreateVideoMixer([In, Optional] IUnknown* pOwner,[In] const GUID& riidDevice,[In] const GUID& riid,[Out, Optional] void** ppVideoMixer) MFCreateVideoMixer

Creates the default video mixer and video presenter for the enhanced video renderer (EVR).

Pointer to the owner of the video mixer. If the mixer is aggregated, pass a reference to the aggregating object's interface. Otherwise, set this parameter to null.

Pointer to the owner of the video presenter. If the presenter is aggregated, pass a reference to the aggregating object's interface. Otherwise, set this parameter to null.

Interface identifier (IID) of the requested interface on the video mixer. The video mixer exposes the interface.

Receives a reference to the requested interface on the video mixer. The caller must release the interface.

IID of the requested interface on the video presenter. The video presenter exposes the interface.

Receives a reference to the requested interface on the video presenter. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms694842 HRESULT MFCreateVideoMixerAndPresenter([In, Optional] IUnknown* pMixerOwner,[In, Optional] IUnknown* pPresenterOwner,[In] const GUID& riidMixer,[Out] void** ppvVideoMixer,[In] const GUID& riidPresenter,[Out] void** ppvVideoPresenter) MFCreateVideoMixerAndPresenter

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Creates a new instance of the MFPlay player object.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

Before calling this function, call CoIntialize(Ex) from the same thread to initialize the COM library.

Internally, calls to initialize the Microsoft Media Foundation platform. When the player object is destroyed, it calls to shut down the platform. It is not necessary for an application to call or when using MFPlay.

Note??If you use other Media Foundation APIs outside the life time of the player object, then your application should call and .

dd375520 HRESULT MFPCreateMediaPlayer([In, Optional] const wchar_t* pwszURL,[In] BOOL fStartPlayback,[In, Optional] unsigned int creationOptions,[In, Optional] IMFPMediaPlayerCallback* pCallback,[In, Optional] HWND hWnd,[Out, Optional] IMFPMediaPlayer** ppMediaPlayer) MFPCreateMediaPlayer

Creates the ASF profile object.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms705632 HRESULT MFCreateASFProfile([In] IMFASFProfile** ppIProfile) MFCreateASFProfile

Creates the ASF Splitter.

No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

bb970321 HRESULT MFCreateASFSplitter([In] IMFASFSplitter** ppISplitter) MFCreateASFSplitter

Creates an activation object that can be used to create the ASF media sink.

Null-terminated wide-character string that contains the output file name.

A reference to the interface of an initialized ASF Header Object object. Use this interface to configure the ASF media sink.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

bb970403 HRESULT MFCreateASFMediaSinkActivate([In] const wchar_t* pwszFileName,[In] IMFASFContentInfo* pContentInfo,[In] IMFActivate** ppIActivate) MFCreateASFMediaSinkActivate

Creates an activation object for the ASF streaming sink.

The ASF streaming sink enables an application to write streaming Advanced Systems Format (ASF) packets to an HTTP byte stream.

A reference to a byte stream object in which the ASF media sink writes the streamed content.

Receives a reference to the interface of the ASF streaming-media sink object. To create the media sink, the application must call on the received reference. The caller must release the interface reference.

If this function succeeds, it returns . Otherwise, it returns an error code.

To create the ASF streaming sink in another process, call .

An application can get a reference to the ASF ContentInfo Object by calling IUnknown::QueryInterface on the media sink object received in the ppIMediaSink parameter. The ContentInfo object is used to set the encoder configuration settings, provide stream properties supplied by an ASF profile, and add metadata information. These configuration settings populate the various ASF header objects of the encoded ASF file. For more information, see Setting Properties in the ContentInfo Object.

dd388087 HRESULT MFCreateASFStreamingMediaSink([In] IMFByteStream* pIByteStream,[In] IMFMediaSink** ppIMediaSink) MFCreateASFStreamingMediaSink

Creates a presentation descriptor from an ASF profile object.

Pointer to the interface of the ASF profile object.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms704656 HRESULT MFCreatePresentationDescriptorFromASFProfile([In] IMFASFProfile* pIProfile,[In] IMFPresentationDescriptor** ppIPD) MFCreatePresentationDescriptorFromASFProfile

Creates an ASF profile object from a presentation descriptor.

Pointer to the interface of the presentation descriptor that contains the profile information.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms694279 HRESULT MFCreateASFProfileFromPresentationDescriptor([In] IMFPresentationDescriptor* pIPD,[In] IMFASFProfile** ppIProfile) MFCreateASFProfileFromPresentationDescriptor

Creates an activation object that can be used to create a Windows Media Video (WMV) encoder.

A reference to the interface. This parameter specifies the encoded output format.

A reference to the interface of a property store that contains encoding parameters. Encoding parameters for the WMV encoder are defined in the header file wmcodecdsp.h. If you have an ASF ContentInfo object that contains an ASF profile object with all the streams for the output file, you can get the property store by calling .

Receives a reference to the interface. Use this interface to create the encoder. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

ms705622 HRESULT MFCreateWMVEncoderActivate([In] IMFMediaType* pMediaType,[In] IPropertyStore* pEncodingConfigurationProperties,[In] IMFActivate** ppActivate) MFCreateWMVEncoderActivate

Creates the ASF Multiplexer.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

bb970397 HRESULT MFCreateASFMultiplexer([In] IMFASFMultiplexer** ppIMultiplexer) MFCreateASFMultiplexer

Creates a byte stream to access the index in an ASF stream.

Pointer to the interface of a byte stream that contains the ASF stream.

Byte offset of the index within the ASF stream. To get this value, call .

Receives a reference to the interface. Use this interface to read from the index or write to the index. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table:

Return codeDescription

The call succeeded.

The offset specified in cbIndexStartOffset is invalid.

?

bb970563 HRESULT MFCreateASFIndexerByteStream([In] IMFByteStream* pIContentByteStream,[In] unsigned longlong cbIndexStartOffset,[In] IMFByteStream** pIIndexByteStream) MFCreateASFIndexerByteStream

Creates the ASF stream selector.

Pointer to the interface.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms698963 HRESULT MFCreateASFStreamSelector([In] IMFASFProfile* pIASFProfile,[In] IMFASFStreamSelector** ppSelector) MFCreateASFStreamSelector

Creates an activation object for the ASF streaming sink.

The ASF streaming sink enables an application to write streaming Advanced Systems Format (ASF) packets to an HTTP byte stream. The activation object can be used to create the ASF streaming sink in another process.

A reference to the interface of an activation object. The caller implements this interface. The method of the activation object must create a byte-stream object. The byte stream exposes the interface. The ASF streaming sink will write data to this byte stream.

A reference to an ASF ContentInfo Object that contains the properties that describe the ASF content. These settings can contain stream settings, encoding properties, and metadata. For more information about these properties, see Setting Properties in the ContentInfo Object.

Receives a reference to the interface of the activation object that is used to create the ASF streaming-media sink. To create the media sink, the application must call by using the received reference. The ActivateObject method also calls IMFActivate::Activate on the byte stream activate object specified by pByteStreamActivate, to create it so that the media sink can write streamed content in the byte stream. The caller must release the interface reference of the media sink activation object received in ppIActivate.

If this function succeeds, it returns . Otherwise, it returns an error code.

Starting in Windows?7, Media Foundation provides an ASF streaming sink that writes the content in a live streaming scenario. This function should be used in secure transcode scenarios where this media sink needs to be created and configured in the remote process. Like the ASF file sink, the new media sink performs ASF related tasks such as writing the ASF header, generating data packets (muxing). The content is written to a caller-implemented byte stream such as an HTTP byte stream. The caller must also provide an activation object that media sink can use to create the byte stream remotely.

In addition, it performs transcryption for streaming protected content. It hosts the Windows Media Digital Rights Management (DRM) for Network Devices Output Trust Authority (OTA) that handles the license request and response. For more information, see interface.

The new media sink does not perform any time adjustments. If the clock seeks, the timestamps are not changed.

dd388090 HRESULT MFCreateASFStreamingMediaSinkActivate([In] IMFActivate* pByteStreamActivate,[In] IMFASFContentInfo* pContentInfo,[In] IMFActivate** ppIActivate) MFCreateASFStreamingMediaSinkActivate

Creates an activation object that can be used to create a Windows Media Audio (WMA) encoder.

A reference to the interface. This parameter specifies the encoded output format.

A reference to the interface of a property store that contains encoding parameters. Encoding parameters for the WMV encoder are defined in the header file wmcodecdsp.h. If you have an ASF ContentInfo object that contains an ASF profile object with all the streams for the output file, you can get the property store by calling .

Receives a reference to the interface. Use this interface to create the encoder. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

ms702208 HRESULT MFCreateWMAEncoderActivate([In] IMFMediaType* pMediaType,[In] IPropertyStore* pEncodingConfigurationProperties,[In] IMFActivate** ppActivate) MFCreateWMAEncoderActivate

Creates the ASF Indexer object.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms704561 HRESULT MFCreateASFIndexer([In] IMFASFIndexer** ppIIndexer) MFCreateASFIndexer

Creates the ASF Header Object object.

No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

bb970315 HRESULT MFCreateASFContentInfo([In] IMFASFContentInfo** ppIContentInfo) MFCreateASFContentInfo

Creates the ASF media sink.

Pointer to a byte stream that will be used to write the ASF stream.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms703955 HRESULT MFCreateASFMediaSink([In] IMFByteStream* pIByteStream,[In] IMFMediaSink** ppIMediaSink) MFCreateASFMediaSink

Initializes Microsoft Media Foundation.

Version number. Use the value , defined in mfapi.h.

This parameter is optional when using C++ but required in C. The value must be one of the following flags:

ValueMeaning
MFSTARTUP_NOSOCKET

Do not initialize the sockets library.

MFSTARTUP_LITE

Equivalent to MFSTARTUP_NOSOCKET.

MFSTARTUP_FULL

Initialize the entire Media Foundation platform. This is the default value when dwFlags is not specified.

?

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The Version parameter requires a newer version of Media Foundation than the version that is running.

The Media Foundation platform is disabled because the system was started in "Safe Mode" (fail-safe boot).

E_NOTIMPL

Media Foundation is not implemented on the system. This error can occur if the media components are not present (See KB2703761 for more info).

?

An application must call this function before using Media Foundation. Before your application quits, call once for every previous call to .

Do not call or from work queue threads. For more information about work queues, see Work Queues.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms702238 HRESULT MFStartup([In] unsigned int Version,[In] unsigned int dwFlags) MFStartup

Unregisters a Media Foundation transform (MFT) from the caller's process.

The class identifier (CLSID) of the MFT.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

HRESULT_FROM_WIN32()

The MFT specified by the clsidMFT parameter was not registered in this process.

?

Use this function to unregister a local MFT that was previously registered through the function.

dd388659 HRESULT MFTUnregisterLocalByCLSID([In] GUID clsidMFT) MFTUnregisterLocalByCLSID

[This API is not supported and may be altered or unavailable in the future.]

Creates an audio media type from a structure.

Pointer to a structure that describes the audio format.

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The interface is deprecrated, so applications should avoid using this function. To create a media type from a structure, do the following:

  1. Call . This function returns a reference to the interface. The returned media type object is initially empty.
  2. Call to populate the media type from the structure.

Alternatively, you can call and then set the media type attributes directly.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
aa473812 HRESULT MFCreateAudioMediaType([In] const WAVEFORMATEX* pAudioFormat,[Out] IMFAudioMediaType** ppIAudioMediaType) MFCreateAudioMediaType

Cancels an asynchronous request to create a byte stream from a file.

A reference to the interface of the cancellation object. This reference is received in the ppCancelCookie parameter of the function.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

You can use this function to cancel a previous call to . Because that function is asynchronous, however, it might complete before the operation can be canceled. Therefore, your callback might still be invoked after you call this function.

ms702218 HRESULT MFCancelCreateFile([In] IUnknown* pCancelCookie) MFCancelCreateFile

Converts a video frame rate into a frame duration.

The numerator of the frame rate.

The denominator of the frame rate.

Receives the average duration of a video frame, in 100-nanosecond units.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function is useful for calculating time stamps on a sample, given the frame rate.

Also, average time per frame is used in the older and format structures. This function provides a standard conversion so that all components in the pipeline can use consistent values, if they need to translate between the older format structures and the media type attributes used in Media Foundation.

For certain common frame rates, the function gets the frame duration from a look-up table:

Frames per second (floating point)Frames per second (fractional)Average time per frame
59.9460000/1001166833
29.9730000/1001333667
23.97624000/1001417188
6060/1166667
3030/1333333
5050/1200000
2525/1400000
2424/1416667

?

Most video content uses one of the frame rates listed here. For other frame rates, the function calculates the duration.

aa370467 HRESULT MFFrameRateToAverageTimePerFrame([In] unsigned int unNumerator,[In] unsigned int unDenominator,[Out] unsigned longlong* punAverageTimePerFrame) MFFrameRateToAverageTimePerFrame

This function is not implemented.

Reserved.

Reserved.

Reserved.

Reserved.

Reserved.

Reserved.

Reserved.

Reserved.

Reserved.

Returns E_FAIL.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

aa473801 HRESULT MFCreateVideoMediaTypeFromBitMapInfoHeader([In] const BITMAPINFOHEADER* pbmihBitMapInfoHeader,[In] unsigned int dwPixelAspectRatioX,[In] unsigned int dwPixelAspectRatioY,[In] MFVideoInterlaceMode InterlaceMode,[In] unsigned longlong VideoFlags,[In] unsigned longlong qwFramesPerSecondNumerator,[In] unsigned longlong qwFramesPerSecondDenominator,[In] unsigned int dwMaxBitRate,[Out] IMFVideoMediaType** ppIVideoMediaType) MFCreateVideoMediaTypeFromBitMapInfoHeader

Attempts to cancel an asynchronous operation that was scheduled with or .

No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

Because work items are asynchronous, the work-item callback might still be invoked after is called.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows Phone 8.1: This API is supported.

ms701633 HRESULT MFCancelWorkItem([In] unsigned longlong Key) MFCancelWorkItem

Converts an array of 16-bit floating-point numbers into an array of 32-bit floating-point numbers.

Pointer to an array of float values. The array must contain at least dwCount elements.

Pointer to an array of 16-bit floating-point values, typed as WORD values. The array must contain at least dwCount elements.

Number of elements in the pSrc array to convert.

If this function succeeds, it returns . Otherwise, it returns an error code.

The function converts dwCount values in the pSrc array and writes them into the pDest array.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

bb970412 HRESULT MFConvertFromFP16Array([Out, Buffer] float* pDest,[In, Buffer] const unsigned short* pSrc,[In] unsigned int dwCount) MFConvertFromFP16Array

Adds information about a Media Foundation transform (MFT) to the registry.

Applications can enumerate the MFT by calling the or function.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

The registry entries created by this function are read by the following functions:

FunctionDescription
Enumerates MFTs by media type and category.
Extended version of .
Looks up an MFT by CLSID and retrieves the registry information.

?

This function does not register the CLSID of the MFT for the CoCreateInstance or CoGetClassObject functions.

To remove the entries from the registry, call . If you remove an MFT from the system, you should always call .

The formats given in the pInputTypes and pOutputTypes parameters are intended to help applications search for MFTs by format. Applications can use the or functions to enumerate MFTs that match a particular set of formats.

It is recommended to specify at least one input type in pInputTypes and one output type in the pOutputTypes parameter. Otherwise, the MFT might be skipped in the enumeration.

On 64-bit Windows, the 32-bit version of this function registers the MFT in the 32-bit node of the registry. For more information, see 32-bit and 64-bit Application Data in the Registry.

ms705640 HRESULT MFTRegister([In] GUID clsidMFT,[In] GUID guidCategory,[In] wchar_t* pszName,[In] unsigned int Flags,[In] unsigned int cInputTypes,[In, Buffer, Optional] MFT_REGISTER_TYPE_INFO* pInputTypes,[In] unsigned int cOutputTypes,[In, Buffer, Optional] MFT_REGISTER_TYPE_INFO* pOutputTypes,[In, Optional] IMFAttributes* pAttributes) MFTRegister

Creates an empty attribute store.

Receives a reference to the interface. The caller must release the interface.

The initial number of elements allocated for the attribute store. The attribute store grows as needed.

If this function succeeds, it returns . Otherwise, it returns an error code.

Attributes are used throughout Microsoft Media Foundation to configure objects, describe media formats, query object properties, and other purposes. For more information, see Attributes in Media Foundation.

For a complete list of all the defined attribute GUIDs in Media Foundation, see Media Foundation Attributes.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms701878 HRESULT MFCreateAttributes([Out, Fast] IMFAttributes** ppMFAttributes,[In] unsigned int cInitialSize) MFCreateAttributes

Converts a Media Foundation audio media type to a structure.

Pointer to the interface of the media type.

Receives a reference to the structure. The caller must release the memory allocated for the structure by calling CoTaskMemFree.

Receives the size of the structure.

Contains a flag from the enumeration.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

If the wFormatTag member of the returned structure is , you can cast the reference to a structure.

Windows Phone 8.1: This API is supported.

ms702177 HRESULT MFCreateWaveFormatExFromMFMediaType([In] IMFMediaType* pMFType,[Out] void** ppWF,[Out, Optional] unsigned int* pcbSize,[In] unsigned int Flags) MFCreateWaveFormatExFromMFMediaType

[This API is not supported and may be altered or unavailable in the future. Applications should avoid using the structure, and use media type attributes instead. For more information, see Video Media Types.]

Returns the FOURCC or value for an uncompressed video format.

No documentation.

Returns a FOURCC or value that identifies the video format. If the video format is compressed or not recognized, the return value is .

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

aa473806 unsigned int MFGetUncompressedVideoFormat([In] const MFVIDEOFORMAT* pVideoFormat) MFGetUncompressedVideoFormat

Puts an asynchronous operation on a work queue.

The identifier for the work queue. This value can specify one of the standard Media Foundation work queues, or a work queue created by the application. For list of standard Media Foundation work queues, see Work Queue Identifiers. To create a new work queue, call or .

A reference to the interface of an asynchronous result object. To create the result object, call .

Returns an value. Possible values include the following.

Return codeDescription

Success.

Invalid work queue identifier. For more information, see .

The function was not called, or was called.

?

To invoke the work-item, this function passes pResult to the function. The callback is specified when you create the result object specified by pResult.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697572 HRESULT MFPutWorkItemEx([In] unsigned int dwQueue,[In] IMFAsyncResult* pResult) MFPutWorkItemEx

[This API is not supported and may be altered or unavailable in the future. Applications should avoid using the structure, and use media type attributes instead. For more information, see Video Media Types.]

Creates an structure from a video media type.

No documentation. No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

aa473827 HRESULT MFCreateMFVideoFormatFromMFMediaType([In] IMFMediaType* pMFType,[Out] MFVIDEOFORMAT** ppMFVF,[Out, Optional] unsigned int* pcbSize) MFCreateMFVideoFormatFromMFMediaType

Enumerates Media Foundation transforms (MFTs) in the registry.

Starting in Windows?7, applications should use the function instead.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function returns a list of all the MFTs in the specified category that match the search criteria given by the pInputType, pOutputType, and pAttributes parameters. Any of those parameters can be null.

If no MFTs match the criteria, the method succeeds but returns the value zero in pcMFTs.

ms701774 HRESULT MFTEnum([In] GUID guidCategory,[In] unsigned int Flags,[In, Optional] MFT_REGISTER_TYPE_INFO* pInputType,[In, Optional] MFT_REGISTER_TYPE_INFO* pOutputType,[In, Optional] IMFAttributes* pAttributes,[Out, Buffer] GUID** ppclsidMFT,[Out] unsigned int* pcMFTs) MFTEnum

Completes an asynchronous request to associate a work queue with a Multimedia Class Scheduler Service (MMCSS) task.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The unique task identifier.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

Call this function when the function completes asynchronously.

To unregister the work queue from the MMCSS class, call .

ms696982 HRESULT MFEndRegisterWorkQueueWithMMCSS([In] IMFAsyncResult* pResult,[Out] unsigned int* pdwTaskId) MFEndRegisterWorkQueueWithMMCSS

Retrieves a media type that was wrapped in another media type by the function.

No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows Phone 8.1: This API is supported.

ms696190 HRESULT MFUnwrapMediaType([In] IMFMediaType* pWrap,[Out] IMFMediaType** ppOrig) MFUnwrapMediaType

Compares a full media type to a partial media type.

Pointer to the interface of the full media type.

Pointer to the interface of the partial media type.

If the full media type is compatible with the partial media type, the function returns TRUE. Otherwise, the function returns .

A pipeline component can return a partial media type to describe a range of possible formats the component might accept. A partial media type has at least a major type , but might be missing some of the other attributes that are needed to fully describe the type. The missing attributes represent "don't care" values for the partial type. For example, a partial video type might be missing the attributes for the width and height of the video.

This function returns TRUE if the following conditions are both true:

  • The partial media type contains a major type .
  • All of the attributes in the partial type exist in the full type and are set to the same value.

Otherwise, the function returns .

ms697237 BOOL MFCompareFullToPartialMediaType([In] IMFMediaType* pMFTypeFull,[In] IMFMediaType* pMFTypePartial) MFCompareFullToPartialMediaType

Converts the contents of an attribute store to a byte array.

Pointer to the interface of the attribute store.

Pointer to an array that receives the attribute data.

Size of the pBuf array, in bytes. To get the required size of the buffer, call .

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

The buffer given in pBuf is too small.

?

The function skips any attributes with reference values (); they are not stored in the array.

To convert the byte array back into an attribute store, call .

To write an attribute store to a stream, call the function.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms694877 HRESULT MFGetAttributesAsBlob([In] IMFAttributes* pAttributes,[Out, Buffer] unsigned char* pBuf,[In] unsigned int cbBufSize) MFGetAttributesAsBlob

Copies an image or image plane from one buffer to another.

Pointer to the start of the first row of pixels in the destination buffer.

Stride of the destination buffer, in bytes.

Pointer to the start of the first row of pixels in the source image.

Stride of the source image, in bytes.

Width of the image, in bytes.

Number of rows of pixels to copy.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function copies a single plane of the image. For planar YUV formats, you must call the function once for each plane. In this case, pDest and pSrc must point to the start of each plane.

This function is optimized if the MMX, SSE, or SSE2 instruction sets are available on the processor. The function performs a non-temporal store (the data is written to memory directly without polluting the cache).

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

Windows Phone 8.1: This API is supported.

bb970554 HRESULT MFCopyImage([Out, Buffer] unsigned char* pDest,[In] int lDestStride,[In, Buffer] const unsigned char* pSrc,[In] int lSrcStride,[In] unsigned int dwWidthInBytes,[In] unsigned int dwLines) MFCopyImage

Registers a Media Foundation transform (MFT) in the caller's process.

A reference to the interface of a class factory object. The class factory creates the MFT.

A that specifies the category of the MFT. For a list of MFT categories, see MFT_CATEGORY.

A wide-character null-terminated string that contains the friendly name of the MFT.

A bitwise OR of zero or more flags from the _MFT_ENUM_FLAG enumeration.

The number of elements in the pInputTypes array.

A reference to an array of structures. Each member of the array specifies an input format that the MFT supports. This parameter can be null if cInputTypes is zero.

The number of elements in the pOutputTypes array.

A reference to an array of structures. Each member of the array defines an output format that the MFT supports. This parameter can be null if cOutputTypes is zero.

If this function succeeds, it returns . Otherwise, it returns an error code.

The primary purpose of this function is to make an MFT available for automatic topology resolution without making the MFT available to other processes or applications.

After you call this function, the MFT can be enumerated by calling the function with the flag. The MFT can be enumerated from within the same process, but is not visible to other processes.

The pClassFactory parameter specifies a class factory object that creates the MFT. The class factory's IClassFactory::CreateInstance method must return an object that supports the interface.

Note??The function retrieves a list of references. However, the class factory does not need to support the interface. Instead, the function provides an implementation of that wraps the class factory.

To unregister the MFT from the current process, call .

If you need to register an MFT in the Protected Media Path (PMP) process, use the interface.

dd388656 HRESULT MFTRegisterLocal([In] IClassFactory* pClassFactory,[In] const GUID& guidCategory,[In] const wchar_t* pszName,[In] unsigned int Flags,[In] unsigned int cInputTypes,[In, Buffer, Optional] const MFT_REGISTER_TYPE_INFO* pInputTypes,[In] unsigned int cOutputTypes,[In, Buffer, Optional] const MFT_REGISTER_TYPE_INFO* pOutputTypes) MFTRegisterLocal

[This API is not supported and may be altered or unavailable in the future. Applications should avoid using the structure, and use media type attributes instead. For more information, see Video Media Types.]

Creates a video media type from an structure.

No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

Instead of using the structure to initialize a video media type, you can call and set the media type attributes directly.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

aa473781 HRESULT MFCreateVideoMediaType([In] const MFVIDEOFORMAT* pVideoFormat,[Out] IMFVideoMediaType** ppIVideoMediaType) MFCreateVideoMediaType

Gets information from the registry about a Media Foundation transform (MFT).

The CLSID of the MFT.

Receives a reference to a wide-character string containing the friendly name of the MFT. The caller must free the string by calling CoTaskMemFree. This parameter can be null.

Receives a reference to an array of structures. Each member of the array describes an input format that the MFT supports. The caller must free the array by calling CoTaskMemFree. This parameter can be null.

Receives the number of elements in the ppInputTypes array. If ppInputTypes is null, this parameter is ignored and can be null.

Receives a reference to an array of structures. Each member of the array describes an output format that the MFT supports. The caller must free the array by calling CoTaskMemFree. This parameter can be null.

Receives the number of elements in the ppOutputType array. If ppOutputTypes is null, this parameter is ignored and can be null.

Receives a reference to the interface of an attribute store. The caller must release the interface. The attribute store might contain attributes that are stored in the registry for the specified MFT. (For more information, see .) If no attributes are stored in the registry for this MFT, the attribute store is empty.

This parameter can be null.

If this function succeeds, it returns . Otherwise, it returns an error code.

ms703830 HRESULT MFTGetInfo([In] GUID clsidMFT,[Out, Optional] wchar_t** pszName,[Out, Buffer, Optional] MFT_REGISTER_TYPE_INFO** ppInputTypes,[Out, Optional] unsigned int* pcInputTypes,[Out, Buffer, Optional] MFT_REGISTER_TYPE_INFO** ppOutputTypes,[Out, Optional] unsigned int* pcOutputTypes,[Out, Optional] IMFAttributes** ppAttributes) MFTGetInfo

Completes an asynchronous request to unregister a work queue from a Multimedia Class Scheduler Service (MMCSS) task.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

Call this function when the function completes asynchronously.

ms704803 HRESULT MFEndUnregisterWorkQueueWithMMCSS([In] IMFAsyncResult* pResult) MFEndUnregisterWorkQueueWithMMCSS

Unregisters a work queue from a Multimedia Class Scheduler Service (MMCSS) task.

The identifier of the work queue. For private work queues, the identifier is returned by the function. For platform work queues, see Work Queue Identifiers.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

This function unregisters a work queue that was associated with an MMCSS class through the function.

This function is asynchronous. When the operation completes, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

ms704613 HRESULT MFBeginUnregisterWorkQueueWithMMCSS([In] unsigned int dwWorkQueueId,[In] IMFAsyncCallback* pDoneCallback,[In] IUnknown* pDoneState) MFBeginUnregisterWorkQueueWithMMCSS

Begins an asynchronous request to create a byte stream from a file.

The requested access mode, specified as a member of the enumeration.

The behavior of the function if the file already exists or does not exist, specified as a member of the enumeration.

Bitwise OR of values from the enumeration.

Pointer to a null-terminated string containing the file name.

Pointer to the interface of a callback object. The caller must implement this interface

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

Receives an reference or the value null. If the value is not null, you can cancel the asynchronous operation by passing this reference to the function. The caller must release the interface. This parameter is optional and can be null.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

When the request is completed, the callback object's method is called. The callback object should then call the function to get a reference to the byte stream.

ms702074 HRESULT MFBeginCreateFile([In] MF_FILE_ACCESSMODE AccessMode,[In] MF_FILE_OPENMODE OpenMode,[In] MF_FILE_FLAGS fFlags,[In] const wchar_t* pwszFilePath,[In] IMFAsyncCallback* pCallback,[In] IUnknown* pState,[Out] IUnknown** ppCancelCookie) MFBeginCreateFile

Queries whether a FOURCC code or value is a YUV format.

FOURCC code or value.

The function returns one of the following values.

Return codeDescription
TRUE

The value specifies a YUV format.

The value does not specify a recognized YUV format.

?

This function checks whether Format specifies a YUV format. Not every YUV format is recognized by this function. However, if a YUV format is not recognized by this function, it is probably not supported for video rendering or DirectX video acceleration (DXVA).

ms704010 BOOL MFIsFormatYUV([In] unsigned int Format) MFIsFormatYUV

[This API is not supported and may be altered or unavailable in the future. Applications should avoid using the structure, and use media type attributes instead. For more information, see Extended Color Information.]

Sets the extended color information in a structure.

No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function sets the following fields in the structure.

  • videoInfo.
  • videoInfo.
  • videoInfo.
  • videoInfo.
  • videoInfo.
  • videoInfo.SourceChromaSubsampling

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

bb970494 HRESULT MFConvertColorInfoFromDXVA([InOut] MFVIDEOFORMAT* pToFormat,[In] unsigned int dwFromDXVA) MFConvertColorInfoFromDXVA

Calculates the frame rate, in frames per second, from the average duration of a video frame.

The average duration of a video frame, in 100-nanosecond units.

Receives the numerator of the frame rate.

Receives the denominator of the frame rate.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

Average time per frame is used in the older and format structures. This function provides a standard conversion so that all components in the pipeline can use consistent values, if they need to translate between the older format structures and the media type attributes used in Media Foundation.

This function uses a look-up table for certain common durations. The table is listed in the Remarks section for the function.

bb970468 HRESULT MFAverageTimePerFrameToFrameRate([In] unsigned longlong unAverageTimePerFrame,[Out] unsigned int* punNumerator,[Out] unsigned int* punDenominator) MFAverageTimePerFrameToFrameRate

Completes an asynchronous request to create a byte stream from a file.

Pointer to the interface. Pass in the same reference that your callback object received in the Invoke method.

Receives a reference to the interface of the byte stream. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

Call this function when the function completes asynchronously.

ms703984 HRESULT MFEndCreateFile([In] IMFAsyncResult* pResult,[Out] IMFByteStream** ppFile) MFEndCreateFile

Locks a work queue.

The identifier for the work queue. The identifier is returned by the function.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function prevents the function from shutting down the work queue. Use this function to ensure that asynchronous operations on the work queue complete gracefully before the platform shuts down. The function blocks until the work queue is unlocked, or until a fixed wait period has elapsed. (The wait period is a few seconds.)

Call to unlock the work queue. Each call to must be matched by a corresponding call to .

Note??The function implicitly locks the work queue that it creates.

Windows Phone 8.1: This API is supported.

aa367740 HRESULT MFLockWorkQueue([In] unsigned int dwWorkQueue) MFLockWorkQueue

Creates a video media type from a structure.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, it returns . Otherwise, it returns an error code.

dd388121 HRESULT MFCreateVideoMediaTypeFromBitMapInfoHeaderEx([In, Buffer] const BITMAPINFOHEADER* pbmihBitMapInfoHeader,[In] unsigned int cbBitMapInfoHeader,[In] unsigned int dwPixelAspectRatioX,[In] unsigned int dwPixelAspectRatioY,[In] MFVideoInterlaceMode InterlaceMode,[In] unsigned longlong VideoFlags,[In] unsigned int dwFramesPerSecondNumerator,[In] unsigned int dwFramesPerSecondDenominator,[In] unsigned int dwMaxBitRate,[Out] IMFVideoMediaType** ppIVideoMediaType) MFCreateVideoMediaTypeFromBitMapInfoHeaderEx

Creates an asynchronous result object. Use this function if you are implementing an asynchronous method.

Pointer to the object stored in the asynchronous result. This reference is returned by the method. This parameter can be null.

Pointer to the interface. This interface is implemented by the caller of the asynchronous method.

Pointer to the interface of a state object. This value is provided by the caller of the asynchronous method. This parameter can be null.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

To invoke the callback specified in pCallback, call the function.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms698952 HRESULT MFCreateAsyncResult([In] IUnknown* punkObject,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState,[Out] IMFAsyncResult** ppAsyncResult) MFCreateAsyncResult

Initializes a media type from a structure.

Pointer to the interface of the media type to initialize. To create the uninitialized media type object, call .

Pointer to a structure that describes the media type. The caller must fill in the structure members before calling this function.

Size of the structure, in bytes.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

Windows Phone 8.1: This API is supported.

ms700801 HRESULT MFInitMediaTypeFromWaveFormatEx([In] IMFMediaType* pMFType,[In, Buffer] const WAVEFORMATEX* pWaveFormat,[In] unsigned int cbBufSize) MFInitMediaTypeFromWaveFormatEx

[This API is not supported and may be altered or unavailable in the future. Applications should avoid using the structure, and use media type attributes instead. For more information, see Extended Color Information.]

Converts the extended color information from an to the equivalent DirectX Video Acceleration (DXVA) color information.

No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

bb970405 HRESULT MFConvertColorInfoToDXVA([Out] unsigned int* pdwToDXVA,[In] const MFVIDEOFORMAT* pFromFormat) MFConvertColorInfoToDXVA

Creates a byte stream that is backed by a temporary local file.

The requested access mode, specified as a member of the enumeration.

The behavior of the function if the file already exists or does not exist, specified as a member of the enumeration.

Bitwise OR of values from the enumeration.

Receives a reference to the interface of the byte stream. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function creates a file in the system temporary folder, and then returns a byte stream object for that file. The full path name of the file is storted in the attribute. The file is created with the FILE_FLAG_DELETE_ON_CLOSE flag, and is deleted after the byte stream is released.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms695209 HRESULT MFCreateTempFile([In] MF_FILE_ACCESSMODE AccessMode,[In] MF_FILE_OPENMODE OpenMode,[In] MF_FILE_FLAGS fFlags,[Out] IMFByteStream** ppIByteStream) MFCreateTempFile

Retrieves the size of the buffer needed for the function.

No documentation. No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

Use this function to find the size of the array that is needed for the function.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms697064 HRESULT MFGetAttributesAsBlobSize([In] IMFAttributes* pAttributes,[Out] unsigned int* pcbBufSize) MFGetAttributesAsBlobSize

Gets a reference to the Microsoft Media Foundation plug-in manager.

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

dd388507 HRESULT MFGetPluginControl([Out] IMFPluginControl** ppPluginControl) MFGetPluginControl

Retrieves the timer interval for the function.

No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms694873 HRESULT MFGetTimerPeriodicity([Out] unsigned int* Periodicity) MFGetTimerPeriodicity

Creates a new work queue.

Receives an identifier for the work queue.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

E_FAIL

The application exceeded the maximum number of work queues.

The application did not call , or the application has already called .

?

When you are done using the work queue, call .

ms700204 HRESULT MFAllocateWorkQueue([Out] unsigned int* pdwWorkQueue) MFAllocateWorkQueue

[This API is not supported and may be altered or unavailable in the future. Applications should avoid using the structure, and use media type attributes instead. For more information, see Video Media Types.]

Initializes an structure for an uncompressed RGB video format.

No documentation. No documentation. No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function fills in some reasonable default values for the specified RGB format.

Developers are encouraged to use media type attributes instead of using the structure. See Media Type Attributes.

In general, you should avoid calling this function. If you know all of the format details, you can fill in the structure without this function. If you do not know all of the format details, attributes are preferable to using the structure.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

aa473797 HRESULT MFInitVideoFormat_RGB([In] MFVIDEOFORMAT* pVideoFormat,[In] unsigned int dwWidth,[In] unsigned int dwHeight,[In] unsigned int D3Dfmt) MFInitVideoFormat_RGB

Converts an array of 32-bit floating-point numbers into an array of 16-bit floating-point numbers.

Pointer to an array of 16-bit floating-point values, typed as WORD values. The array must contain at least dwCount elements.

Pointer to an array of float values. The array must contain at least dwCount elements.

Number of elements in the pSrc array to convert.

If this function succeeds, it returns . Otherwise, it returns an error code.

The function converts the values in the pSrc array and writes them into the pDest array.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

aa473816 HRESULT MFConvertToFP16Array([Out, Buffer] unsigned short* pDest,[In, Buffer] const float* pSrc,[In] unsigned int dwCount) MFConvertToFP16Array

Cancels a callback function that was set by the function.

No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

The callback is dispatched on another thread, and this function does not attempt to synchronize with the callback thread. Therefore, it is possible for the callback to be invoked after this function returns.

ms704741 HRESULT MFRemovePeriodicCallback([In] unsigned int dwKey) MFRemovePeriodicCallback

Sets a callback function to be called at a fixed interval.

Pointer to the callback function, of type MFPERIODICCALLBACK.

Pointer to a caller-provided object that implements , or null. This parameter is passed to the callback function.

Receives a key that can be used to cancel the callback. To cancel the callback, call and pass this key as the dwKey parameter.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

To get the timer interval for the periodic callback, call .

ms704699 HRESULT MFAddPeriodicCallback([In] __function__stdcall* Callback,[In] IUnknown* pContext,[Out, Optional] unsigned int* pdwKey) MFAddPeriodicCallback

Initializes the contents of an attribute store from a byte array.

Pointer to the interface of the attribute store.

Pointer to the array that contains the initialization data.

Size of the pBuf array, in bytes.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

E_INVALIDARG

The buffer is not valid.

?

Use this function to deserialize an attribute store that was serialized with the function.

This function deletes any attributes that were previously stored in pAttributes.

Windows Phone 8.1: This API is supported.

ms703978 HRESULT MFInitAttributesFromBlob([In] IMFAttributes* pAttributes,[In, Buffer] const unsigned char* pBuf,[In] unsigned int cbBufSize) MFInitAttributesFromBlob

Puts an asynchronous operation on a work queue.

The identifier for the work queue. This value can specify one of the standard Media Foundation work queues, or a work queue created by the application. For list of standard Media Foundation work queues, see Work Queue Identifiers. To create a new work queue, call or .

A reference to the interface. The caller must implement this interface.

A reference to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

Returns an value. Possible values include the following.

Return codeDescription

Success.

Invalid work queue. For more information, see .

The function was not called, or was called.

?

This function creates an asynchronous result object and puts the result object on the work queue. The work queue calls the method specified by pCallback.

ms702164 HRESULT MFPutWorkItem([In] unsigned int dwQueue,[In] IMFAsyncCallback* pCallback,[In] IUnknown* pState) MFPutWorkItem

Unregisters a Media Foundation transform (MFT).

The CLSID of the MFT.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function removes the registry entries created by the function.

It is safe to call twice with the same CLSID. If the CLSID is not found in the registry, the function succeeds and does nothing.

ms696199 HRESULT MFTUnregister([In] GUID clsidMFT) MFTUnregister

Retrieves the Multimedia Class Scheduler Service (MMCSS) task identifier currently associated with this work queue.

Identifier for the work queue. The identifier is retrieved by the function.

Receives the task identifier.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

To associate a work queue with an MMCSS task, call .

ms704780 HRESULT MFGetWorkQueueMMCSSTaskId([In] unsigned int dwWorkQueueId,[Out] unsigned int* pdwTaskId) MFGetWorkQueueMMCSSTaskId

Converts a Media Foundation media buffer into a buffer that is compatible with DirectX Media Objects (DMOs).

Pointer to the interface of the sample that contains the Media Foundation buffer. This parameter can be null.

Pointer to the interface of the Media Foundation buffer.

Offset in bytes from the start of the Media Foundation buffer. This offset defines where the DMO buffer starts. If this parameter is zero, the DMO buffer starts at the beginning of the Media Foundation buffer.

Receives a reference to the interface. This interface is documented in the DirectShow SDK documentation. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

E_INVALIDARG

Invalid argument. The pIMFMediaBuffer parameter must not be null.

?

The DMO buffer created by this function also exposes the interface. If pIMFSample is null, all of the methods return . Otherwise, they call through to the pIMFSample reference.

If the Media Foundation buffer specified by pIMFMediaBuffer exposes the interface, the DMO buffer also exposes .

ms696233 HRESULT MFCreateLegacyMediaBufferOnMFMediaBuffer([In, Optional] IMFSample* pSample,[In] IMFMediaBuffer* pMFMediaBuffer,[In] unsigned int cbOffset,[Out] IMediaBuffer** ppMediaBuffer) MFCreateLegacyMediaBufferOnMFMediaBuffer

Creates a media buffer that wraps an existing media buffer. The new media buffer points to the same memory as the original media buffer, or to an offset from the start of the memory.

A reference to the interface of the original media buffer.

The start of the new buffer, as an offset in bytes from the start of the original buffer.

The size of the new buffer. The value of cbOffset + dwLength must be less than or equal to the size of valid data the original buffer. (The size of the valid data is returned by the method.)

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

E_INVALIDARG

The requested offset or the requested length is not valid.

?

The maximum size of the wrapper buffer is limited to the size of the valid data in the original buffer. This might be less than the allocated size of the original buffer. To set the size of the valid data, call .

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

aa370450 HRESULT MFCreateMediaBufferWrapper([In] IMFMediaBuffer* pBuffer,[In] unsigned int cbOffset,[In] unsigned int dwLength,[Out] IMFMediaBuffer** ppBuffer) MFCreateMediaBufferWrapper

Unlocks the Media Foundation platform after it was locked by a call to the function.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

The application must call once for every call to .

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms703879 HRESULT MFUnlockPlatform() MFUnlockPlatform

Retrieves the image size for a video format. Given a structure, this function calculates the correct value of the biSizeImage member.

No documentation. No documentation. No documentation. No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

E_INVALIDARG

The structure is not valid, or the value of cbBufSize is too small.

?

Before calling this function, you must set at least the following members of the structure:

  • biCompression
  • biBitCount
  • biWidth
  • biHeight

Also, if biCompression is BI_BITFIELDS, the structure must be followed by an array of color masks.

This function fails if the structure describes a format that is not a video format. For example, it fails if biCompresson is BI_JPEG or BI_PNG .

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697582 HRESULT MFCalculateBitmapImageSize([In, Buffer] const BITMAPINFOHEADER* pBMIH,[In] unsigned int cbBufSize,[Out] unsigned int* pcbImageSize,[Out, Optional] BOOL* pbKnown) MFCalculateBitmapImageSize

Creates an event queue.

Receives a reference to the interface of the event queue. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

This function creates a helper object that you can use to implement the interface.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows Phone 8.1: This API is supported.

ms695252 HRESULT MFCreateEventQueue([Out] IMFMediaEventQueue** ppMediaEventQueue) MFCreateEventQueue

Creates a media buffer object that manages a Direct3D 9 surface.

Identifies the type of Direct3D 9 surface. Currently this value must be IID_IDirect3DSurface9.

A reference to the interface of the DirectX surface.

If TRUE, the buffer's method copies the buffer into a bottom-up format. The bottom-up format is compatible with GDI for uncompressed RGB images. If this parameter is , the ContiguousCopyTo method copies the buffer into a top-down format, which is compatible with DirectX.

For more information about top-down versus bottom-up images, see Image Stride.

Receives a reference to the interface. The caller must release the buffer.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

?

This function creates a media buffer object that holds a reference to the Direct3D surface specified in punkSurface. Locking the buffer gives the caller access to the surface memory. When the buffer object is destroyed, it releases the surface. For more information about media buffers, see Media Buffers.

Note??This function does not allocate the Direct3D surface itself.

The buffer object created by this function also exposes the interface. For more information, see DirectX Surface Buffer.

This function does not support DXGI surfaces.

ms703840 HRESULT MFCreateDXSurfaceBuffer([In] const GUID& riid,[In] IUnknown* punkSurface,[In] BOOL fBottomUpWhenLinear,[Out] IMFMediaBuffer** ppBuffer) MFCreateDXSurfaceBuffer

Associates a work queue with a Multimedia Class Scheduler Service (MMCSS) task.

The identifier of the work queue. For private work queues, the identifier is returned by the function. For platform work queues, see Work Queue Identifiers.

The name of the MMCSS task.For more information, see Multimedia Class Scheduler Service.

The unique task identifier. To obtain a new task identifier, set this value to zero.

A reference to the interface of a callback object. The caller must implement this interface.

A reference to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

This function is asynchronous. When the operation completes, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

To unregister the work queue from the MMCSS task, call .

ms701600 HRESULT MFBeginRegisterWorkQueueWithMMCSS([In] unsigned int dwWorkQueueId,[In] const wchar_t* wszClass,[In] unsigned int dwTaskId,[In] IMFAsyncCallback* pDoneCallback,[In] IUnknown* pDoneState) MFBeginRegisterWorkQueueWithMMCSS

Creates a partial video media type with a specified subtype.

Pointer to a that specifies the subtype. See Video Subtype GUIDs.

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function creates a media type and sets the major type equal to and the subtype equal to the value specified in pAMSubtype.

You can get the same result with the following steps:

  1. Call . This function returns a reference to the interface.
  2. Set the attribute to .
  3. Set the attribute to the subtype.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

aa473791 HRESULT MFCreateVideoMediaTypeFromSubtype([In] const GUID* pAMSubtype,[Out] IMFVideoMediaType** ppIVideoMediaType) MFCreateVideoMediaTypeFromSubtype

Creates an empty media sample.

Receives a reference to the interface of the media sample. The caller must release the interface.

Initially the sample does not contain any media buffers.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms702276 HRESULT MFCreateSample([Out] IMFSample** ppIMFSample) MFCreateSample

Creates a Media Foundation media type from another format representation.

that specifies which format representation to convert. The following value is defined.

Description
AM_MEDIA_TYPE_REPRESENTATIONConvert a DirectShow structure.

?

Pointer to a buffer that contains the format representation to convert. The layout of the buffer depends on the value of guidRepresentation.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

The specified in guidRepresentation is not supported.

?

If the original format is a DirectShow audio media type, and the format type is not recognized, the function sets the following attributes on the converted media type.

AttributeDescription
Contains the format type .
Contains the format block.

?

aa369931 HRESULT MFCreateMediaTypeFromRepresentation([In] GUID guidRepresentation,[In] void* pvRepresentation,[Out] IMFMediaType** ppIMediaType) MFCreateMediaTypeFromRepresentation

Calculates the minimum surface stride for a video format.

FOURCC code or value that specifies the video format. If you have a video subtype , you can use the first DWORD of the subtype.

Width of the image, in pixels.

Receives the minimum surface stride, in pixels.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function calculates the minimum stride needed to hold the image in memory. Use this function if you are allocating buffers in system memory. Surfaces allocated in video memory might require a larger stride, depending on the graphics card.

If you are working with a DirectX surface buffer, use the method to find the surface stride.

For planar YUV formats, this function returns the stride for the Y plane. Depending on the format, the chroma planes might have a different stride.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

aa473720 HRESULT MFGetStrideForBitmapInfoHeader([In] unsigned int format,[In] unsigned int dwWidth,[Out] int* pStride) MFGetStrideForBitmapInfoHeader

Registers a Media Foundation transform (MFT) in the caller's process.

The class identifier (CLSID) of the MFT.

A that specifies the category of the MFT. For a list of MFT categories, see MFT_CATEGORY.

A wide-character null-terminated string that contains the friendly name of the MFT.

A bitwise OR of zero or more flags from the _MFT_ENUM_FLAG enumeration.

The number of elements in the pInputTypes array.

A reference to an array of structures. Each member of the array specifies an input format that the MFT supports. This parameter can be null if cInputTypes is zero.

The number of elements in the pOutputTypes array.

A reference to an array of structures. Each member of the array defines an output format that the MFT supports. This parameter can be null if cOutputTypes is zero.

If this function succeeds, it returns . Otherwise, it returns an error code.

The primary purpose of this function is to make an MFT available for automatic topology resolution without making the MFT available to other processes or applications.

After you call this function, the MFT can be enumerated by calling the function with the flag. The MFT can be enumerated from within the same process, but is not visible to other processes.

To unregister the MFT from the current process, call .

If you need to register an MFT in the Protected Media Path (PMP) process, use the interface.

dd388657 HRESULT MFTRegisterLocalByCLSID([In] const GUID& clisdMFT,[In] const GUID& guidCategory,[In] const wchar_t* pszName,[In] unsigned int Flags,[In] unsigned int cInputTypes,[In, Buffer, Optional] const MFT_REGISTER_TYPE_INFO* pInputTypes,[In] unsigned int cOutputTypes,[In, Buffer, Optional] const MFT_REGISTER_TYPE_INFO* pOutputTypes) MFTRegisterLocalByCLSID

Frees a block of memory that was allocated by calling the function.

No documentation. aa473826 void MFHeapFree([In] void* pv) MFHeapFree

Allocates a block of memory.

Number of bytes to allocate.

Zero or more flags. For a list of valid flags, see HeapAlloc in the Windows SDK documentation.

Reserved. Set to null.

Reserved. Set to zero.

Reserved. Set to eAllocationTypeIgnore.

If the function succeeds, it returns a reference to the allocated memory block. If the function fails, it returns null.

In the current version of Media Foundation, this function is equivalent to calling the HeapAlloc function and specifying the heap of the calling process.

To free the allocated memory, call .

aa473790 void* MFHeapAlloc([In] unsigned int nSize,[In] unsigned int dwFlags,[In, Optional] char* pszFile,[In] int line,[In] EAllocationType eat) MFHeapAlloc

Creates an empty collection object.

Receives a reference to the collection object's interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms698852 HRESULT MFCreateCollection([Out] IMFCollection** ppIMFCollection) MFCreateCollection

Schedules an asynchronous operation to be completed after a specified interval.

Pointer to the interface. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

Time-out interval, in milliseconds. Set this parameter to a negative value. The callback is invoked after ?Timeout milliseconds. For example, if Timeout is ?5000, the callback is invoked after 5000 milliseconds.

Receives a key that can be used to cancel the timer. To cancel the timer, call and pass this key in the Key parameter.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

This function creates an asynchronous result object. When the timer interval elapses, the method specified by pCallback is called.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703045 HRESULT MFScheduleWorkItem([In] IMFAsyncCallback* pCallback,[In] IUnknown* pState,[In] longlong Timeout,[Out, Optional] unsigned longlong* pKey) MFScheduleWorkItem

Retrieves the Multimedia Class Scheduler Service (MMCSS) class currently associated with this work queue.

Identifier for the work queue. The identifier is retrieved by the function.

Pointer to a buffer that receives the name of the MMCSS class. This parameter can be null.

On input, specifies the size of the pwszClass buffer, in characters. On output, receives the required size of the buffer, in characters. The size includes the terminating null character.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

The pwszClass buffer is too small to receive the task name.

?

If the work queue is not associated with an MMCSS task, the function retrieves an empty string.

To associate a work queue with an MMCSS task, call .

ms701582 HRESULT MFGetWorkQueueMMCSSClass([In] unsigned int dwWorkQueueId,[Out, Buffer, Optional] wchar_t* pwszClass,[InOut] unsigned int* pcchClass) MFGetWorkQueueMMCSSClass

Retrieves the image size, in bytes, for an uncompressed video format.

FOURCC code or value that specifies the video format.

Width of the image, in pixels.

Height of the image, in pixels.

Receives the size of one frame, in bytes. If the format is compressed or is not recognized, this value is zero.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

This function is equivalent to the function.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll.

aa473798 HRESULT MFGetPlaneSize([In] unsigned int format,[In] unsigned int dwWidth,[In] unsigned int dwHeight,[Out] unsigned int* pdwPlaneSize) MFGetPlaneSize

Invokes a callback method to complete an asynchronous operation.

Pointer to the interface. To create this object, call .

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

Invalid work queue. For more information, see .

The function was called to shut down the Media Foundation platform.

?

If you are implementing an asynchronous method, use this function to invoke the caller's method.

The callback is invoked from a Media Foundation work queue. For more information, see Writing an Asynchronous Method.

The function shuts down the work queue threads, so the callback is not guaranteed to be invoked after is called.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms695400 HRESULT MFInvokeCallback([In] IMFAsyncResult* pAsyncResult) MFInvokeCallback

Shuts down the Microsoft Media Foundation platform. Call this function once for every call to . Do not call this function from work queue threads.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms694273 HRESULT MFShutdown() MFShutdown

Retrieves the image size, in bytes, for an uncompressed video format.

Media subtype for the video format. For a list of subtypes, see Media Type GUIDs.

Width of the image, in pixels.

Height of the image, in pixels.

Receives the size of each frame, in bytes. If the format is compressed or is not recognized, the value is zero.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

bb970318 HRESULT MFCalculateImageSize([In] const GUID& guidSubtype,[In] unsigned int unWidth,[In] unsigned int unHeight,[Out] unsigned int* pcbImageSize) MFCalculateImageSize

Gets the merit value of a hardware codec.

A reference to the interface of the Media Foundation transform (MFT) that represents the codec.

The size, in bytes, of the verifier array.

The address of a buffer that contains one of the following:

  • The class identifier (CLSID) of the MFT.
  • A null-terminated wide-character string that contains the symbol link for the underlying hardware device. Include the size of the terminating null in the value of cbVerifier.

Receives the merit value.

If this function succeeds, it returns . Otherwise, it returns an error code.

The function fails if the MFT does not represent a hardware device with a valid Output Protection Manager (OPM) certificate.

dd388506 HRESULT MFGetMFTMerit([InOut] IUnknown* pMFT,[In] unsigned int cbVerifier,[In, Buffer] const unsigned char* verifier,[Out] unsigned int* merit) MFGetMFTMerit

Creates a media type that wraps another media type.

A reference to the interface of the media type to wrap in a new media type.

A that specifies the major type for the new media type. For a list of possible values, see Major Media Types.

A that specifies the subtype for the new media type. For possible values, see:

  • Audio Subtypes
  • Video Subtypes

Applications can define custom subtype GUIDs.

Receives a reference to the interface of the new media type that wraps the original media type. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The original media type (pOrig) is stored in the new media type under the attribute. To extract the original media type, call .

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows Phone 8.1: This API is supported.

ms701782 HRESULT MFWrapMediaType([In] IMFMediaType* pOrig,[In] const GUID& MajorType,[In] const GUID& SubType,[Out] IMFMediaType** ppWrap) MFWrapMediaType

Validates the size of a buffer for a video format block.

that specifies the type of format block. It must be one of the following values:

FORMAT_DvInfo
FORMAT_MFVideoFormat
FORMAT_MPEG2Video
FORMAT_MPEGStreams
FORMAT_MPEGVideo
FORMAT_VideoInfo
FORMAT_VideoInfo2
FORMAT_WaveFormatEx

Pointer to a buffer that contains the format block.

Size of the pBlock buffer, in bytes.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The buffer that contains the format block is large enough.

The buffer that contains the format block is too small, or the format block is not valid.

This function does not support the specified format type.

?

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698993 HRESULT MFValidateMediaTypeSize([In] GUID FormatType,[In, Buffer, Optional] unsigned char* pBlock,[In] unsigned int cbSize) MFValidateMediaTypeSize

Schedules an asynchronous operation to be completed after a specified interval.

Pointer to the interface of an asynchronous result object. To create the result object, call .

Time-out interval, in milliseconds. Set this parameter to a negative value. The callback is invoked after ?Timeout milliseconds. For example, if Timeout is ?5000, the callback is invoked after 5000 milliseconds.

Receives a key that can be used to cancel the timer. To cancel the timer, call and pass this key in the Key parameter.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

When the timer interval elapses, the timer calls with the pResult reference to invoke the asynchronous callback. The callback is specified when you create the result object.

ms702259 HRESULT MFScheduleWorkItemEx([In] IMFAsyncResult* pResult,[In] longlong Timeout,[Out, Optional] unsigned longlong* pKey) MFScheduleWorkItemEx

Allocates system memory with a specified byte alignment and creates a media buffer to manage the memory.

Size of the buffer, in bytes.

Specifies the memory alignment for the buffer. Use one of the following constants.

ValueMeaning
MF_1_BYTE_ALIGNMENT
0x00000000

Align to 1 bytes.

MF_2_BYTE_ALIGNMENT
0x00000001

Align to 2 bytes.

MF_4_BYTE_ALIGNMENT
0x00000003

Align to 4 bytes.

MF_8_BYTE_ALIGNMENT
0x00000007

Align to 8 bytes.

MF_16_BYTE_ALIGNMENT
0x0000000F

Align to 16 bytes.

MF_32_BYTE_ALIGNMENT
0x0000001F

Align to 32 bytes.

MF_64_BYTE_ALIGNMENT
0x0000003F

Align to 64 bytes.

MF_128_BYTE_ALIGNMENT
0x0000007F

Align to 128 bytes.

MF_256_BYTE_ALIGNMENT
0x000000FF

Align to 256 bytes.

MF_512_BYTE_ALIGNMENT
0x000001FF

Align to 512 bytes.

?

Receives a reference to the interface of the media buffer. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

When the media buffer object is destroyed, it releases the allocated memory.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

bb970523 HRESULT MFCreateAlignedMemoryBuffer([In] unsigned int cbMaxLength,[In] unsigned int cbAligment,[Out] IMFMediaBuffer** ppBuffer) MFCreateAlignedMemoryBuffer

Unlocks a work queue.

Identifier for the work queue to be unlocked. The identifier is returned by the function.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

The application must call once for every call to and then once for every call to .

Windows Phone 8.1: This API is supported.

aa372543 HRESULT MFUnlockWorkQueue([In] unsigned int dwWorkQueue) MFUnlockWorkQueue

Blocks the function.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

This function prevents work queue threads from being shut down when is called. Use this function to ensure that asynchronous operations complete gracefully before the platform shuts down.

This function holds a lock on the Media Foundation platform. To unlock the platform, call . The application must call once for every call to .

The function blocks until the platform is unlocked, or until a fixed wait period has elapsed. (The wait period is a few seconds.) To avoid memory leaks, the application should unlock the platform before the wait period ends. For example, cancel any asynchronous operations that are waiting to complete and are holding a lock on the platform.

The default implementation of the interface automatically locks the Media Foundation platform when the result object is created. Releasing the interface unlocks the platform. Therefore, in most cases your application does not need to lock the platform directly. For more information, see Work Queues.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms693588 HRESULT MFLockPlatform() MFLockPlatform

Allocates system memory and creates a media buffer to manage it.

Size of the buffer, in bytes.

Receives a reference to the interface of the media buffer. The caller must release the interface.

The function allocates a buffer with a 1-byte memory alignment. To allocate a buffer that is aligned to a larger memory boundary, call .

When the media buffer object is destroyed, it releases the allocated memory.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms695212 HRESULT MFCreateMemoryBuffer([In] unsigned int cbMaxLength,[Out] IMFMediaBuffer** ppBuffer) MFCreateMemoryBuffer

Unregisters one or more Media Foundation transforms (MFTs) from the caller's process.

A reference to the interface of a class factory object. This parameter can be null.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

HRESULT_FROM_WIN32()

The MFT specified by the pClassFactory parameter was not registered in this process.

?

Use this function to unregister a local MFT that was previously registered through the function.

If the pClassFactory parameter is null, all local MFTs in the process are unregistered. Otherwise, the function unregisters the MFT associated with the class factory specified by the pClassFactory parameter. In that case, the pClassFactory parameter should equal a reference value that was previously passed to the function.

dd388658 HRESULT MFTUnregisterLocal([In, Optional] IClassFactory* pClassFactory) MFTUnregisterLocal

Creates a media event object.

The event type. See . For a list of event types, see Media Foundation Events.

The extended type. See . If the event type does not have an extended type, use the value GUID_NULL.

The event status. See

The value associated with the event, if any. See . This parameter can be null.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows Phone 8.1: This API is supported.

ms697521 HRESULT MFCreateMediaEvent([In] unsigned int met,[In] const GUID& guidExtendedType,[In] HRESULT hrStatus,[In, Optional] const PROPVARIANT* pvValue,[Out] IMFMediaEvent** ppEvent) MFCreateMediaEvent

[This API is not supported and may be altered or unavailable in the future. Applications should avoid using the structure, and use media type attributes instead. For more information, see Video Media Types.]

Initializes an structure for a standard video format such as DVD, analog television, or ATSC digital television.

No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

aa473783 HRESULT MFInitVideoFormat([In] MFVIDEOFORMAT* pVideoFormat,[In] MFStandardVideoFormat type) MFInitVideoFormat

Calculates ((a * b) + d) / c, where each term is a 64-bit signed value.

A multiplier.

Another multiplier.

The divisor.

The rounding factor.

Returns the result of the calculation. If numeric overflow occurs, the function returns _I64_MAX (positive overflow) or LLONG_MIN (negative overflow). If Mfplat.dll cannot be loaded, the function returns _I64_MAX.

Note??A previous version of this topic described the parameters incorrectly. The divisor is c and the rounding factor is d.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

dd388510 longlong MFllMulDiv([In] longlong a,[In] longlong b,[In] longlong c,[In] longlong d) MFllMulDiv

Creates a byte stream from a file.

The requested access mode, specified as a member of the enumeration.

The behavior of the function if the file already exists or does not exist, specified as a member of the enumeration.

Bitwise OR of values from the enumeration.

Pointer to a null-terminated string that contains the file name.

Receives a reference to the interface of the byte stream. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms696166 HRESULT MFCreateFile([In] MF_FILE_ACCESSMODE AccessMode,[In] MF_FILE_OPENMODE OpenMode,[In] MF_FILE_FLAGS fFlags,[In] const wchar_t* pwszFileURL,[Out] IMFByteStream** ppIByteStream) MFCreateFile

[This API is not supported and may be altered or unavailable in the future. Applications should avoid using the structure, and use media type attributes instead. For more information, see Video Media Types.]

Initializes a media type from an structure.

No documentation. No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

aa473795 HRESULT MFInitMediaTypeFromMFVideoFormat([In] IMFMediaType* pMFType,[In, Buffer] const MFVIDEOFORMAT* pMFVF,[In] unsigned int cbBufSize) MFInitMediaTypeFromMFVideoFormat

Creates an empty media type.

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The media type is created without any attributes.

Windows Phone 8.1: This API is supported.

ms693861 HRESULT MFCreateMediaType([Out, Fast] IMFMediaType** ppMFType) MFCreateMediaType

Creates a new work queue. This function extends the capabilities of the function by making it possible to create a work queue that has a message loop.

No documentation. No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

E_FAIL

The application exceeded the maximum number of work queues.

E_INVALIDARG

Invalid argument.

The application did not call , or the application has already called .

?

When you are done using the work queue, call .

The function is equivalent to calling with the value for the WorkQueueType parameter.

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd375150 HRESULT MFAllocateWorkQueueEx([In] MFASYNC_WORKQUEUE_TYPE WorkQueueType,[Out] unsigned int* pdwWorkQueue) MFAllocateWorkQueueEx

Gets a list of Microsoft Media Foundation transforms (MFTs) that match specified search criteria. This function extends the function.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

The Flags parameter controls which MFTs are enumerated, and the order in which they are returned. The flags for this parameter fall into several groups.

The first set of flags specifies how an MFT processes data.

FlagDescription

The MFT performs synchronous data processing in software. This is the original MFT processing model, and is compatible with Windows?Vista.

The MFT performs asynchronous data processing in software. This processing model requires Windows?7. For more information, see Asynchronous MFTs.

The MFT performs hardware-based data processing, using either the AVStream driver or a GPU-based proxy MFT. MFTs in this category always process data asynchronously. For more information, see Hardware MFTs.

?

Every MFT falls into exactly one of these categories. To enumerate a category, set the corresponding flag in the Flags parameter. You can combine these flags to enumerate more than one category. If none of these flags is specified, the default category is synchronous MFTs ().

Next, the following flags include MFTs that are otherwise excluded from the results. By default, flags that match these criteria are excluded from the results. Use any these flags to include them.

FlagDescription

Include MFTs that must be unlocked by the application.

Include MFTs that are registered in the caller's process through either the or function.

Include MFTs that are optimized for transcoding rather than playback.

?

The last flag is used to sort and filter the results:

FlagDescription

Sort and filter the results.

?

If the flag is set, the function sorts the results as follows:

  • Local: If the flag is set, local MFTs appear first in the list. To register a local MFT, call the or function.
  • Merit: MFTs with a merit value appear next on the list, in order of merit value (highest to lowest). For more information about merit, see .
  • Preferred: If an MFT is listed in the plug-in control's preferred list, it appears next in the list. For more information about the plug-in control, see .
  • If an MFT appears on the blocked list, it is excluded from the results. For more information about the blocked list, see .
  • Any other MFTs that match the search criteria appear at the end of the list, unsorted.

If you do not set the flag, the function returns an unsorted list.

Setting the Flags parameter to zero is equivalent to using the value | | .

Setting Flags to is equivalent to calling the function.

If no MFTs match the search criteria, the function returns , unless some other error occurs. Therefore, always check the count received in the pcMFTActivate parameter before you dereference the pppMFTActivate reference.

Note??There is no way to enumerate just local MFTs and nothing else. Setting Flags equal to is equivalent to including the flag. However, if you also sort the results by specifying the flag, local MFTs appear first in the list.

dd388652 HRESULT MFTEnumEx([In] GUID guidCategory,[In] unsigned int Flags,[In, Optional] const MFT_REGISTER_TYPE_INFO* pInputType,[In, Optional] const MFT_REGISTER_TYPE_INFO* pOutputType,[Out] void*** pppMFTActivate,[Out] unsigned int* pnumMFTActivate) MFTEnumEx

Creates the presentation clock. The presentation clock is used to schedule the time at which samples are rendered and to synchronize multiple streams.

Receives a reference to the clock's interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The caller must shut down the presentation clock by calling on the clock.

Typically applications do not create the presentation clock. The Media Session automatically creates the presentation clock. To get a reference to the presentation clock from the Media Session, call .

ms702174 HRESULT MFCreatePresentationClock([Out] IMFPresentationClock** ppPresentationClock) MFCreatePresentationClock

Creates a presentation time source that is based on the system time.

Receives a reference to the object's interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms705610 HRESULT MFCreateSystemTimeSource([Out] IMFPresentationTimeSource** ppSystemTimeSource) MFCreateSystemTimeSource

Enumerates a list of audio or video capture devices.

Pointer to an attribute store that contains search criteria. To create the attribute store, call . Set one or more of the following attributes on the attribute store:

ValueMeaning

Specifies whether to enumerate audio or video devices. (Required.)

For audio capture devices, specifies the device role. (Optional.)

For video capture devices, specifies the device category. (Optional.)

?

Receives an array of interface references. Each reference represents an activation object for a media source. The function allocates the memory for the array. The caller must release the references in the array and call CoTaskMemFree to free the memory for the array.

Receives the number of elements in the pppSourceActivate array. If no capture devices match the search criteria, this parameter receives the value 0.

If this function succeeds, it returns . Otherwise, it returns an error code.

Each returned reference represents a capture device, and can be used to create a media source for that device. You can also use the reference to query for attributes that describe the device. The following attributes might be set:

AttributeDescription
The display name of the device.
The major type and subtype GUIDs that describe the device's output format.
The type of capture device (audio or video).
The audio endpoint ID string. (Audio devices only.)
The device category. (Video devices only.)
Whether a device is a hardware or software device. (Video devices only.)
The symbolic link for the device driver. (Video devices only.)

?

To create a media source from an reference, call the method.

dd388503 HRESULT MFEnumDeviceSources([In] IMFAttributes* pAttributes,[Out] void*** pppSourceActivate,[Out] unsigned int* pcSourceActivate) MFEnumDeviceSources

Creates an empty transcode profile object.

The transcode profile stores configuration settings for the output file. These configuration settings are specified by the caller, and include audio and video stream properties, encoder settings, and container settings. To set these properties, the caller must call the appropriate methods.

The configured transcode profile is passed to the function. The underlying topology builder uses these settings to build the transcode topology.

No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

The function creates an empty transcode profile. You must configure the transcode profile setting attributes that define the media types and the container properties. Use the following methods to configure the profile:

For example code that uses this function, see the following topics:

  • Tutorial: Encoding an MP4 File
  • Tutorial: Encoding a WMA File
dd388113 HRESULT MFCreateTranscodeProfile([Out] IMFTranscodeProfile** ppTranscodeProfile) MFCreateTranscodeProfile

Creates a credential cache object. An application can use this object to implement a custom credential manager.

Receives a reference to the interface of the new credential cache object. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms704802 HRESULT MFCreateCredentialCache([Out] IMFNetCredentialCache** ppCache) MFCreateCredentialCache

Creates the sequencer source.

Reserved. Must be null.

Receives a reference to the interface of the sequencer source. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms704663 HRESULT MFCreateSequencerSource([In] IUnknown* pReserved,[Out] IMFSequencerSource** ppSequencerSource) MFCreateSequencerSource

Creates a Microsoft Media Foundation byte stream that wraps an reference.

A reference to the interface.

Receives a reference to the interface. The caller must release the interface.

Returns an value.

This function enables applications to pass an object to a Media Foundation API that takes an reference.

dd388095 HRESULT MFCreateMFByteStreamOnStream([In] IStream* pStream,[Out] IMFByteStream** ppByteStream) MFCreateMFByteStreamOnStream

Creates an activation object for the enhanced video renderer (EVR) media sink.

Handle to the window where the video will be displayed.

Receives a reference to the interface. Use this interface to create the EVR. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To create the EVR, call on the retrieved reference. (If you are using the Media Session, the Media Session automatically calls ActivateObject when you queue the topology.)

To configure the EVR, set any of the following attributes on the object before calling ActivateObject.

AttributeDescription
Activation object for a custom mixer.
CLSID for a custom mixer.
Flags for creating a custom mixer.
Activation object for a custom presenter.
CLSID for a custom presenter.
Flags for creating a custom presenter.

?

When is called, the activation objects sets the video window on the EVR by calling . Passing null for the hwndVideo parameter is not an error, but no video will render unless the EVR has a valid video window.

ms693543 HRESULT MFCreateVideoRendererActivate([In] HWND hwndVideo,[Out] IMFActivate** ppActivate) MFCreateVideoRendererActivate

Creates a default proxy locator.

The name of the protocol.

Note??In this release of Media Foundation, the default proxy locator does not support RTSP.

Pointer to the interface of a property store that contains the proxy configuration in the MFNETSOURCE_PROXYSETTINGS property.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms701595 HRESULT MFCreateProxyLocator([In] const wchar_t* pszProtocol,[In] IPropertyStore* pProxyConfig,[Out] IMFNetProxyLocator** ppProxyLocator) MFCreateProxyLocator

Creates an activation object for the sample grabber media sink.

Pointer to the interface, defining the media type for the sample grabber's input stream.

Pointer to the interface of a callback object. The caller must implement this interface.

Receives a reference to the interface. Use this interface to complete the creation of the sample grabber. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

To create the sample grabber sink, call on the reference received in the ppIActivate parameter.

Before calling ActivateObject, you can configure the sample grabber by setting any of the following attributes on the ppIActivate reference:

ms702068 HRESULT MFCreateSampleGrabberSinkActivate([In] IMFMediaType* pIMFMediaType,[In] IMFSampleGrabberSinkCallback* pIMFSampleGrabberSinkCallback,[Out] IMFActivate** ppIActivate) MFCreateSampleGrabberSinkActivate

Creates a media sink for authoring MP4 files.

A reference to the interface of a byte stream. The media sink writes the MP4 file to this byte stream. The byte stream must be writable and support seeking.

A reference to the interface of a video media type. This type specifies the format of the video stream.

This parameter can be null, but not if pAudioMediaType is null.

A reference to the interface of an audio media type. This type specifies the format of the audio stream.

This parameter can be null, but not if pVideoMediaType is null.

Receives a reference to the MP4 media sink's interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The MP4 media sink supports a maximum of one video stream and one audio stream. The initial stream formats are given in the pVideoMediaType and pAudioMediaType parameters. To create an MP4 file with one stream, set the other stream type to null. For example, to create an audio-only file, set pVideoMediaType to null.

The number of streams is fixed when you create the media sink. The sink does not support the method.

To author 3GP files, use the function.

dd388100 HRESULT MFCreateMPEG4MediaSink([In] IMFByteStream* pIByteStream,[In, Optional] IMFMediaType* pVideoMediaType,[In, Optional] IMFMediaType* pAudioMediaType,[Out] IMFMediaSink** ppIMediaSink) MFCreateMPEG4MediaSink

Creates the transcode sink activation object.

The transcode sink activation object can be used to create any of the following file sinks:

  • 3GP file sink
  • MP3 file sink
  • MP4 file sink

The transcode sink activation object exposes the interface.

No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

dd388115 HRESULT MFCreateTranscodeSinkActivate([Out] IMFActivate** ppActivate) MFCreateTranscodeSinkActivate

Queries an object for a specified service interface.

This function is a helper function that wraps the method. The function queries the object for the interface and, if successful, calls GetService on the object.

No documentation. No documentation. No documentation. No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The service requested cannot be found in the object represented by punkObject.

?

Windows Phone 8.1: This API is supported.

ms694284 HRESULT MFGetService([In] IUnknown* punkObject,[In] const GUID& guidService,[In] const GUID& riid,[Out] void** ppvObject) MFGetService

Retrieves the MIME types that are registered for the source resolver.

Pointer to a that receives the MIME types. Before calling this method, call PropVariantInit to initialize the . If the method succeeds, the contains an array of wide-character strings. The data type is VT_VECTOR | VT_LPWSTR. The caller must release the by calling PropVariantClear.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms699844 HRESULT MFGetSupportedMimeTypes([Out] PROPVARIANT* pPropVarMimeTypeArray) MFGetSupportedMimeTypes

Creates a media sink for authoring 3GP files.

A reference to the interface of a byte stream. The media sink writes the 3GP file to this byte stream. The byte stream must be writable and support seeking.

A reference to the interface of a video media type. This type specifies the format of the video stream.

This parameter can be null, but not if pAudioMediaType is null.

A reference to the interface of an audio media type. This type specifies the format of the audio stream.

This parameter can be null, but not if pVideoMediaType is null.

Receives a reference to the 3GP media sink's interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The 3GP media sink supports a maximum of one video stream and one audio stream. The initial stream formats are given in the pVideoMediaType and pAudioMediaType parameters. To create an MP4 file with one stream, set the other stream type to null. For example, to create an audio-only file, set pVideoMediaType to null.

The number of streams is fixed when you create the media sink. The sink does not support the method.

To author MP4 files, use the function.

dd388084 HRESULT MFCreate3GPMediaSink([In] IMFByteStream* pIByteStream,[In, Optional] IMFMediaType* pVideoMediaType,[In, Optional] IMFMediaType* pAudioMediaType,[Out] IMFMediaSink** ppIMediaSink) MFCreate3GPMediaSink

Creates a partial transcode topology.

The underlying topology builder creates a partial topology by connecting the required pipeline objects: source, encoder, and sink. The encoder and the sink are configured according to the settings specified by the caller in the transcode profile.

To create the transcode profile object, call the function and set the required attributes by calling the appropriate the methods.

The configured transcode profile is passed to the function, which creates the transcode topology with the appropriate settings. The caller can then set this topology on the Media Session and start the session to begin the encoding process. When the Media Session ends, the transcoded file is generated.

No documentation. No documentation. No documentation. No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function call succeeded, and ppTranscodeTopo receives a reference to the transcode topology.

E_INVALIDARG

pwszOutputFilePath contains invalid characters.

No streams are selected in the media source.

The profile does not contain the attribute.

For one or more streams, cannot find an encoder that accepts the media type given in the profile.

The profile does not specify a media type for any of the selected streams on the media source.

?

For example code that uses this function, see the following topics:

  • Tutorial: Encoding an MP4 File
  • Tutorial: Encoding a WMA File
dd388118 HRESULT MFCreateTranscodeTopology([In] IMFMediaSource* pSrc,[In] const wchar_t* pwszOutputFilePath,[In] IMFTranscodeProfile* pProfile,[Out] IMFTopology** ppTranscodeTopo) MFCreateTranscodeTopology

Creates the scheme handler for the network source.

Interface identifier (IID) of the interface to retrieve.

Receives a reference to the requested interface. The caller must release the interface. The scheme handler exposes the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

aa378396 HRESULT MFCreateNetSchemePlugin([In] const GUID& riid,[In] void** ppvHandler) MFCreateNetSchemePlugin

Creates an instance of the Media Session inside a Protected Media Path (PMP) process.

No documentation. No documentation. No documentation. No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

You can use the pConfiguration parameter to set any of the following attributes:

If this function cannot create the PMP Media Session because a trusted binary was revoked, the ppEnablerActivate parameter receives an interface reference. The application can use this reference to create a content enabler object, which can then be used to download an updated binary:

  1. Call with the interface identifier IID_IMFContentEnabler to get an interface reference.
  2. Use that interface to download the updated binary.
  3. Call again.

If the function successfully creates the PMP Media Session, the ppEnablerActivate parameter receives the value null.

Do not make calls to the PMP Media Session from a thread that is processing a window message sent from another thread. To test whether the current thread falls into this category, call InSendMessage.

ms703144 HRESULT MFCreatePMPMediaSession([In] unsigned int dwCreationFlags,[In] IMFAttributes* pConfiguration,[Out] IMFMediaSession** ppMediaSession,[Out, Optional] IMFActivate** ppEnablerActivate) MFCreatePMPMediaSession

[This API is not supported and may be altered or unavailable in the future. Instead, applications should use the PSCreateMemoryPropertyStore function to create property stores.]

Creates an empty property store object.

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms702984 HRESULT CreatePropertyStore([Out] IPropertyStore** ppStore) CreatePropertyStore

Creates an activation object for the Streaming Audio Renderer.

No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

To create the audio renderer, call on the retrieved reference.

Note??To avoid a memory leak, call before releasing the final reference to the audio renderer or the audio renderer activate object.

To configure the audio renderer, set any of the following attributes on the object before calling ActivateObject. (If you are using the Media Session, the Media Session automatically calls ActivateObject when you queue the topology.)

AttributeDescription
The audio endpoint device identifier.
The audio endpoint role.
Miscellaneous configuration flags.
The audio policy class.
MF_AUDIO_RENDERER_ATTRIBUTE_STREAM_CATEGORY The audio stream category.
MF_LOW_LATENCY Enables low-latency audio streaming.

?

ms702998 HRESULT MFCreateAudioRendererActivate([Out] IMFActivate** ppActivate) MFCreateAudioRendererActivate

Creates a media source for a hardware capture device.

Pointer to the interface of an attribute store, which is used to select the device. See Remarks.

Receives a reference to the media source's interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The pAttributes parameter specifies an attribute store. To create the attribute store, call the function. You must set the attribute, which specifies the type of device (audio or video).

For audio capture devices, optionally set one of the following attributes:

AttributeDescription

Specifies the audio endpoint ID of the audio capture device.

Specifies the device role. If this attribute is set, the function uses the default audio capture device for that device role.

Do not combine this attribute with the attribute.

?

If neither attribute is specified, the function selects the default audio capture device for the eCommunications role.

For video capture devices, you must set the following attribute:

AttributeDescription

Specifies the symbolic link to the device.

?

dd388091 HRESULT MFCreateDeviceSource([In] IMFAttributes* pAttributes,[Out] IMFMediaSource** ppSource) MFCreateDeviceSource

Queries whether a media presentation requires the Protected Media Path (PMP).

Pointer to the interface of a presentation descriptor. The presentation descriptor is created by the media source, and describes the presentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

This presentation requires a protected environment.

S_FALSE

This presentation does not require a protected environment.

?

If this function returns , it means the PMP is required for this presentation. Call to create the PMP session object.

If the function returns S_FALSE, you can use the unprotected pipeline. Call to create the regular Media Session object.

Internally, this function checks whether any of the stream descriptors in the presentation have the attribute with the value TRUE.

ms697052 HRESULT MFRequireProtectedEnvironment([In] IMFPresentationDescriptor* pPresentationDescriptor) MFRequireProtectedEnvironment

Creates a presentation descriptor.

Number of elements in the apStreamDescriptors array.

Array of interface references. Each reference represents a stream descriptor for one stream in the presentation.

Receives a reference to an interface of the presentation descriptor. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

If you are writing a custom media source, you can use this function to create the source presentation descriptor. The presentation descriptor is created with no streams selected. Generally, a media source should select at least one stream by default. To select a stream, call .

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows Phone 8.1: This API is supported.

ms695404 HRESULT MFCreatePresentationDescriptor([In] unsigned int cStreamDescriptors,[In, Buffer, Optional] IMFStreamDescriptor** apStreamDescriptors,[Out] IMFPresentationDescriptor** ppPresentationDescriptor) MFCreatePresentationDescriptor

Retrieves the URL schemes that are registered for the source resolver.

Pointer to a that receives the URL schemes. Before calling this method, call PropVariantInit to initialize the . If the method succeeds, the contains an array of wide-character strings. The data type is VT_VECTOR | VT_LPWSTR. The caller must release the by calling PropVariantClear.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms702236 HRESULT MFGetSupportedSchemes([Out] PROPVARIANT* pPropVarSchemeArray) MFGetSupportedSchemes

Gets a list of output formats from an audio encoder.

Specifies the subtype of the output media. The encoder uses this value as a filter when it is enumerating the available output types. For information about the audio subtypes, see Audio Subtype GUIDs.

Bitwise OR of zero or more flags from the _MFT_ENUM_FLAG enumeration.

A reference to the interface of an attribute store. The attribute store specifies the encoder configuration settings. This parameter can be null. The attribute store can hold any of the following attributes.

ValueMeaning

Set this attribute to unlock an encoder that has field-of-use descriptions.

Specifies a device conformance profile for a Windows Media encoder.

Sets the tradeoff between encoding quality and encoding speed.

?

Receives a reference to the interface of a collection object that contains a list of preferred audio media types. The collection contains references. The caller must release the interface reference.

This function assumes the encoder will be used in its default encoding mode, which is typically constant bit-rate (CBR) encoding. Therefore, the types returned by the function might not work with other modes, such as variable bit-rate (VBR) encoding.

Internally, this function works by calling to find a matching encoder, and then calling to get the encoder's output types.

dd388655 HRESULT MFTranscodeGetAudioOutputAvailableTypes([In] const GUID& guidSubType,[In] _MFT_ENUM_FLAG dwMFTFlags,[In, Optional] IMFAttributes* pCodecConfig,[Out] IMFCollection** ppAvailableTypes) MFTranscodeGetAudioOutputAvailableTypes

Creates an instance of the sample copier transform.

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The sample copier is a Media Foundation transform (MFT) that copies data from input samples to output samples without modifying the data. The following data is copied from the sample:

  • All Sample Attributes.
  • The time stamp and duration.
  • Sample flags (see ).
  • The data in the media buffers. If the input sample contains multiple buffers, the data is copied into a single buffer on the output sample.

This MFT is useful in the following situation:

  • One pipeline object, such as a media source, allocates media samples for output.
  • Another pipeline object, such as a media sink, allocates its own media samples for input. For example, the object might require buffers allocated from a special memory pool, such as video memory.

The following diagram shows this situation with a media source and a media sink.

In order for the media sink to receive data from the media source, the data must be copied into the media samples owned by the media sink. The sample copier can be used for this purpose.

A specific example of such a media sink is the Enhanced Video Renderer (EVR). The EVR allocates samples that contain Direct3D surface buffers, so it cannot receive video samples directly from a media source. Starting in Windows?7, the topology loader automatically handles this case by inserting the sample copier between the media source and the EVR.

dd388101 HRESULT MFCreateSampleCopierMFT([Out] IMFTransform** ppCopierMFT) MFCreateSampleCopierMFT

Creates a topology node.

The type of node to create, specified as a member of the enumeration.

Receives a reference to the node's interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

ms697574 HRESULT MFCreateTopologyNode([In] MF_TOPOLOGY_TYPE NodeType,[Out] IMFTopologyNode** ppNode) MFCreateTopologyNode

Creates the source resolver, which is used to create a media source from a URL or byte stream.

Receives a reference to the source resolver's interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

Note??Prior to Windows?7, this function was exported from mf.dll. Starting in Windows?7, this function is exported from mfplat.dll, and mf.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

Windows Phone 8.1: This API is supported.

ms697433 HRESULT MFCreateSourceResolver([Out, Fast] IMFSourceResolver** ppISourceResolver) MFCreateSourceResolver

Creates a topology object.

Receives a reference to the interface of the topology object. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms701584 HRESULT MFCreateTopology([Out] IMFTopology** ppTopo) MFCreateTopology

Gets the media type for a stream associated with a topology node.

A reference to the interface.

The identifier of the stream to query. This parameter is interpreted as follows:

  • Transform nodes: The value is the zero-based index of the input or output stream.
  • All other node types: The value must be zero.

If TRUE, the function gets an output type. If , the function gets an input type. This parameter is interpreted as follows:

  • Output nodes: The value must be TRUE.
  • Source nodes: The value must be .
  • Tee nodes: The value is ignored.
  • Transform nodes: If the value is TRUE, the dwStreamIndex parameter is the index for an output stream. Otherwise, dwStreamIndex is the index for an input stream.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The stream index is invalid.

?

This function gets the actual media type from the object that is associated with the topology node. The pNode parameter should specify a node that belongs to a fully resolved topology. If the node belongs to a partial topology, the function will probably fail.

Tee nodes do not have an associated object to query. For tee nodes, the function gets the node's input type, if available. Otherwise, if no input type is available, the function gets the media type of the node's primary output stream. The primary output stream is identified by the attribute.

dd388509 HRESULT MFGetTopoNodeCurrentType([In] IMFTopologyNode* pNode,[In] unsigned int dwStreamIndex,[In] BOOL fOutput,[Out] IMFMediaType** ppType) MFGetTopoNodeCurrentType

Creates a media-type handler that supports a single media type at a time.

Receives a reference to the interface of the media-type handler. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The media-type handler created by this function supports one media type at a time. Set the media type by calling . After the type is set, always checks against that type.

ms696988 HRESULT MFCreateSimpleTypeHandler([Out] IMFMediaTypeHandler** ppHandler) MFCreateSimpleTypeHandler

Creates a that can be used to seek within a sequencer source presentation.

Sequencer element identifier. This value specifies the segment in which to begin playback. The element identifier is returned in the method.

Starting position within the segment, in 100-nanosecond units.

Pointer to a . The method fills in the with the information needed for performing a seek operation. The caller must free the by calling PropVariantClear.

If this function succeeds, it returns . Otherwise, it returns an error code.

The returned in pvarSegmentOffset can be used for the pvarStartPosition parameter in the method. Use the time format MF_TIME_FORMAT_SEGMENT_OFFSET.

ms697268 HRESULT MFCreateSequencerSegmentOffset([In] unsigned int dwId,[In] longlong hnsOffset,[Out] PROPVARIANT* pvarSegmentOffset) MFCreateSequencerSegmentOffset

Shuts down a Media Foundation object and releases all resources associated with the object.

This function is a helper function that wraps the method. The function queries the object for the interface and, if successful, calls Shutdown on the object.

No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

This function is not related to the function, which shuts down the Media Foundation platform, as described in Initializing Media Foundation.

ms701968 HRESULT MFShutdownObject([In] IUnknown* pUnk) MFShutdownObject

Creates the remote desktop plug-in object. Use this object if the application is running in a Terminal Services client session.

Receives a reference to the interface of the plug-in object. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

E_ACCESSDENIED

Remote desktop connections are not allowed by the current session policy.

?

ms703133 HRESULT MFCreateRemoteDesktopPlugin([Out] IMFRemoteDesktopPlugin** ppPlugin) MFCreateRemoteDesktopPlugin

Creates a new instance of the topology loader.

Receives a reference to the interface of the topology loader. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms694159 HRESULT MFCreateTopoLoader([Out] IMFTopoLoader** ppObj) MFCreateTopoLoader

Creates a stream descriptor.

Stream identifier.

Number of elements in the apMediaTypes array.

Pointer to an array of interface references. These references are used to initialize the media type handler for the stream descriptor.

Receives a reference to the interface of the new stream descriptor. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

If you are writing a custom media source, you can use this function to create stream descriptors for the source. This function automatically creates the stream descriptor media type handler and initializes it with the list of types given in apMediaTypes. The function does not set the current media type on the handler, however. To set the type, call .

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Windows Phone 8.1: This API is supported.

ms698990 HRESULT MFCreateStreamDescriptor([In] unsigned int dwStreamIdentifier,[In] unsigned int cMediaTypes,[In, Buffer] IMFMediaType** apMediaTypes,[Out] IMFStreamDescriptor** ppDescriptor) MFCreateStreamDescriptor

Returns the system time.

Returns the system time, in 100-nanosecond units.

Windows Phone 8.1: This API is supported.

ms704625 longlong MFGetSystemTime() MFGetSystemTime

Creates an activation object that represents a hardware capture device.

Pointer to the interface of an attribute store, which is used to select the device. See Remarks.

Receives a reference to the interface. The caller must release the interface.

No documentation.

This function creates an activation object that can be used to create a media source for a hardware device. To create the media source itself, call .

The pAttributes parameter specifies an attribute store. To create the attribute store, call the function. You must set the attribute, which specifies the type of device (audio or video).

For audio capture devices, optionally set one of the following attributes:

AttributeDescription

Specifies the audio endpoint ID of the audio capture device.

Specifies the device role. If this attribute is set, the function uses the default audio capture device for that device role.

Do not combine this attribute with the attribute.

?

If neither attribute is specified, the function selects the default audio capture device for the eCommunications role.

For video capture devices, you must set the following attribute:

AttributeDescription

Specifies the symbolic link to the device.

?

dd388093 HRESULT MFCreateDeviceSourceActivate([In] IMFAttributes* pAttributes,[Out] IMFActivate** ppActivate) MFCreateDeviceSourceActivate

Deserializes a presentation descriptor from a byte array.

Size of the pbData array, in bytes.

Pointer to an array of bytes that contains the serialized presentation descriptor.

Receives a reference to the interface of the presentation descriptor. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms697044 HRESULT MFDeserializePresentationDescriptor([In] unsigned int cbData,[In, Buffer] unsigned char* pbData,[Out] IMFPresentationDescriptor** ppPD) MFDeserializePresentationDescriptor

[This API is not supported and may be altered or unavailable in the future. Instead, applications should use the PSCreateMemoryPropertyStore function to create named property stores.]

Creates an empty property store to hold name/value pairs.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

aa367379 HRESULT CreateNamedPropertyStore([Out] INamedPropertyStore** ppStore) CreateNamedPropertyStore

Creates the Media Session in the application's process.

No documentation. No documentation.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

If your application does not play protected content, you can use this function to create the Media Session in the application's process. To use the Media Session for protected content, you must call .

You can use the pConfiguration parameter to specify any of the following attributes:

  • MF_LOW_LATENCY
ms700174 HRESULT MFCreateMediaSession([In] IMFAttributes* pConfiguration,[Out] IMFMediaSession** ppMediaSession) MFCreateMediaSession

Creates a media source that aggregates a collection of media sources.

A reference to the interface of the collection object that contains a list of media sources.

Receives a reference to the interface of the aggregated media source. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The pSourceCollection collection does not contain any elements.

?

The aggregated media source is useful for combining streams from separate media sources. For example, you can use it to combine a video capture source and an audio capture source.

Windows Phone 8.1: This API is supported.

dd388085 HRESULT MFCreateAggregateSource([In] IMFCollection* pSourceCollection,[Out] IMFMediaSource** ppAggSource) MFCreateAggregateSource

Creates the protected media path (PMP) server object.

A member of the enumeration that specifies how to create the PMP session.

Receives a reference to the interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

ms696183 HRESULT MFCreatePMPServer([In] unsigned int dwCreationFlags,[Out] IMFPMPServer** ppPMPServer) MFCreatePMPServer

Serializes a presentation descriptor to a byte array.

Pointer to the interface of the presentation descriptor to serialize.

Receives the size of the ppbData array, in bytes.

Receives a reference to an array of bytes containing the serialized presentation descriptor. The caller must free the memory for the array by calling CoTaskMemFree.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The function succeeded.

?

To deserialize the presentation descriptor, pass the byte array to the function.

ms705608 HRESULT MFSerializePresentationDescriptor([In] IMFPresentationDescriptor* pPD,[Out] unsigned int* pcbData,[Out, Buffer] unsigned char** ppbData) MFSerializePresentationDescriptor

Creates the default implementation of the quality manager.

Receives a reference to the quality manager's interface. The caller must release the interface.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms701594 HRESULT MFCreateStandardQualityManager([Out] IMFQualityManager** ppQualityManager) MFCreateStandardQualityManager

Creates the Streaming Audio Renderer.

No documentation. No documentation.

If this function succeeds, it returns . Otherwise, it returns an error code.

To configure the audio renderer, set any of the following attributes on the interface specified in the pAudioAttributes parameter.

AttributeDescription
The audio endpoint device identifier.
The audio endpoint role.
Miscellaneous configuration flags.
The audio policy class.
MF_AUDIO_RENDERER_ATTRIBUTE_STREAM_CATEGORY The audio stream category.
MF_LOW_LATENCY Enables low-latency audio streaming.

?

ms701557 HRESULT MFCreateAudioRenderer([In] IMFAttributes* pAudioAttributes,[Out] IMFMediaSink** ppSink) MFCreateAudioRenderer

Creates the MP3 media sink.

A reference to the interface of a byte stream. The media sink writes the MP3 file to this byte stream. The byte stream must be writable.

Receives a reference to the interface of the MP3 media sink.. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

The MP3 media sink takes compressed MP3 audio samples as input, and writes an MP3 file with ID3 headers as output. The MP3 media sink does not perform MP3 audio encoding.

dd388098 HRESULT MFCreateMP3MediaSink([In] IMFByteStream* pTargetByteStream,[Out] IMFMediaSink** ppMediaSink) MFCreateMP3MediaSink

Creates the source reader from a byte stream.

A reference to the interface of a byte stream. This byte stream will provide the source data for the source reader.

Pointer to the interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be null.

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

Call CoInitialize(Ex) and before calling this function.

Internally, the source reader calls the method to create a media source from the byte stream. Therefore, a byte-stream handler must be registered for the byte stream. For more information about byte-stream handlers, see Scheme Handlers and Byte-Stream Handlers.

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

Windows Phone 8.1: This API is supported.

dd388106 HRESULT MFCreateSourceReaderFromByteStream([In] IMFByteStream* pByteStream,[In, Optional] IMFAttributes* pAttributes,[Out, Fast] IMFSourceReader** ppSourceReader) MFCreateSourceReaderFromByteStream

Creates the source reader from a URL.

The URL of a media file to open.

Pointer to the interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be null.

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

Call CoInitialize(Ex) and before calling this function.

Internally, the source reader calls the method to create a media source from the URL.

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

Windows Phone 8.1: This API is supported.

dd388110 HRESULT MFCreateSourceReaderFromURL([In] const wchar_t* pwszURL,[In, Optional] IMFAttributes* pAttributes,[Out, Fast] IMFSourceReader** ppSourceReader) MFCreateSourceReaderFromURL

Creates the source reader from a media source.

A reference to the interface of a media source.

Pointer to the interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be null.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The source contains protected content.

?

Call CoInitialize(Ex) and before calling this function.

By default, when the application releases the source reader, the source reader shuts down the media source by calling on the media source. At that point, the application can no longer use the media source.

To change this default behavior, set the attribute in the pAttributes parameter. If this attribute is TRUE, the application is responsible for shutting down the media source.

When using the Source Reader, do not call any of the following methods on the media source:

  • All methods

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

Windows Phone 8.1: This API is supported.

dd388108 HRESULT MFCreateSourceReaderFromMediaSource([In] IMFMediaSource* pMediaSource,[In, Optional] IMFAttributes* pAttributes,[Out, Fast] IMFSourceReader** ppSourceReader) MFCreateSourceReaderFromMediaSource

Creates the sink writer from a URL or byte stream.

A null-terminated string that contains the URL of the output file. This parameter can be null.

Pointer to the interface of a byte stream. This parameter can be null.

If this parameter is a valid reference, the sink writer writes to the provided byte stream. (The byte stream must be writable.) Otherwise, if pByteStream is null, the sink writer creates a new file named pwszOutputURL.

Pointer to the interface. You can use this parameter to configure the sink writer. For more information, see Sink Writer Attributes. This parameter can be null.

Receives a reference to the interface. The caller must release the interface.

Call CoInitialize(Ex) and before calling this function.

The first three parameters to this function can be null; however, only certain combinations are valid:

DescriptionpwszOutputURLpByteStreampAttributes
Specify a byte stream, with no URL.nullnon-nullRequired (must not be null).
Specify a URL, with no byte stream.not nullnullOptional (may be null).
Specify both a URL and a byte stream.non-nullnon-nullOptional (may be null).

?

The pAttributes parameter is required in the first case and optional in the others.

  • Case 1: Specify a byte stream without a URL. The pAttributes parameter must point to an attribute store that contains the attribute. The sink writer uses the attribute to determine the type of file container to write, such as ASF or MP4.
  • Case 2: Specify a URL without a byte stream. The sink writer creates a new file named pwszOutputURL. If pAttributes specifies an attribute store with the attribute, the sink writer uses that attribute to determine the type of file container. Otherwise, if the attribute is absent or pAttributes is null, the sink writer uses the file name extension to select the container type; for example, ".asf" for an ASF file.
  • Case 3: Specify both a URL and a byte stream. The sink writer writes to the byte stream. The URL provided in pwszOutputURL is informational only; the sink writer does not create a new file. If pAttributes specifies an attribute store with the attribute, the sink writer uses that attribute to determine the type of file container. Otherwise, the sink writer uses the file name extension to select the container type. The attribute overrides the URL file name extension in this case.

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

Windows Phone 8.1: This API is supported.

dd388105 HRESULT MFCreateSinkWriterFromURL([In, Optional] const wchar_t* pwszOutputURL,[In, Optional] IMFByteStream* pByteStream,[In, Optional] IMFAttributes* pAttributes,[Out] IMFSinkWriter** ppSinkWriter) MFCreateSinkWriterFromURL

Creates the sink writer from a media sink.

Pointer to the interface of a media sink.

Pointer to the interface. You can use this parameter to configure the sink writer. For more information, see Sink Writer Attributes. This parameter can be null.

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

Call CoInitialize(Ex) and before calling this function.

When you are done using the media sink, call the media sink's method. (The sink writer does not shut down the media sink.) Release the sink writer before calling Shutdown on the media sink.

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

Windows Phone 8.1: This API is supported.

dd388103 HRESULT MFCreateSinkWriterFromMediaSink([In] IMFMediaSink* pMediaSink,[In, Optional] IMFAttributes* pAttributes,[Out] IMFSinkWriter** ppSinkWriter) MFCreateSinkWriterFromMediaSink

Loads attributes from a stream into an attribute store.

Pointer to the interface of the attribute store.

Bitwise OR of zero or more flags from the enumeration.

Pointer to the interface of the stream from which to read the attributes.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Use this function to deserialize an attribute store that was serialized with the function.

If dwOptions contains the flag, the function deserializes references from the stream, as follows:

  • If the reference exposes the interface (through QueryInterface), the function calls to deserialize each reference.

  • Otherwise, the function calls CoUnmarshalInterface to deserialize a proxy for the object.

This function deletes any attributes that were previously stored in pAttr.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms703162 HRESULT MFDeserializeAttributesFromStream([In] IMFAttributes* pAttr,[In] unsigned int dwOptions,[In] IStream* pStm) MFDeserializeAttributesFromStream

Writes the contents of an attribute store to a stream.

Pointer to the interface of the attribute store.

Bitwise OR of zero or more flags from the enumeration.

Pointer to the interface of the stream where the attributes are saved.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If dwOptions contains the flag, the function serializes references in the attribute store, as follows:

  • If the reference exposes the interface (through QueryInterface), the function calls to serialize each reference.

  • Otherwise, the function calls CoMarshalInterface to serialize a proxy for the object.

If dwOptions does not include the flag, the function skips references in the attribute store.

To load the attributes from the stream, call .

The main purpose of this function is to marshal attributes across process boundaries.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

ms702278 HRESULT MFSerializeAttributesToStream([In] IMFAttributes* pAttr,[In] unsigned int dwOptions,[In] IStream* pStm) MFSerializeAttributesToStream

Creates a generic activation object for Media Foundation transforms (MFTs).

Receives a reference to the interface. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

Most applications will not use this function; it is used internally by the function.

An activation object is a helper object that creates another object, somewhat similar to a class factory. The function creates an activation object for MFTs. Before this activation object can create an MFT, the caller must initialize the activation object by setting one or more attributes on it.

AttributeDescription
Required. Contains the CLSID of the MFT. The activation object creates the MFT by passing this CLSID to the CoCreateInstance function.
Optional. Specifies the category of the MFT.
Contains various flags that describe the MFT. For hardware-based MFTs, set the flag. Otherwise, this attribute is optional.

Optional. Contains the merit value of a hardware codec.

If this attribute is set and its value is greater than zero, the activation object calls to get the trusted merit value for the MFT. If the trusted merit is less than the value of this attribute, the activation object's method fails and returns .

Required for hardware-based MFTs. Specifies the symbolic link for the hardware device. The device proxy uses this value to configure the MFT.

Optional. Contains an reference, which can be used to unlock the MFT. The interface is used with MFTs that have usage restrictions.

If this attribute is set and the attribute contains the flag, the activation object calls when it creates the MFT. An application can also set the attribute without setting the flag. In that case, the application must call Unlock.

Optional. Contains the encoding profile for an encoder. The value of this attribute is an reference.

If this attribute is set and the value of the attribute is or , the activation object uses the encoding profile to configure the MFT. The MFT must expose either ICodecAPI or for this purpose.

Optional. Specifies the preferred output format for an encoder.

If this attribute set and the value of the attribute is or , the activation object sets this media type on the MFT.

?

For more information about activation objects, see Activation Objects.

dd388120 HRESULT MFCreateTransformActivate([Out] IMFActivate** ppActivate) MFCreateTransformActivate

Enumerates a list of audio or video capture devices.

Pointer to an attribute store that contains search criteria. To create the attribute store, call . Set one or more of the following attributes on the attribute store:

ValueMeaning

Specifies whether to enumerate audio or video devices. (Required.)

For audio capture devices, specifies the device role. (Optional.)

For video capture devices, specifies the device category. (Optional.)

?

Receives an array of interface references. Each reference represents an activation object for a media source. The function allocates the memory for the array. The caller must release the references in the array and call CoTaskMemFree to free the memory for the array.

Receives the number of elements in the pppSourceActivate array. If no capture devices match the search criteria, this parameter receives the value 0.

If this function succeeds, it returns . Otherwise, it returns an error code.

Each returned reference represents a capture device, and can be used to create a media source for that device. You can also use the reference to query for attributes that describe the device. The following attributes might be set:

AttributeDescription
The display name of the device.
The major type and subtype GUIDs that describe the device's output format.
The type of capture device (audio or video).
The audio endpoint ID string. (Audio devices only.)
The device category. (Video devices only.)
Whether a device is a hardware or software device. (Video devices only.)
The symbolic link for the device driver. (Video devices only.)

?

To create a media source from an reference, call the method.

dd388503 HRESULT MFEnumDeviceSources([In] IMFAttributes* pAttributes,[Out, Buffer] IMFActivate*** pppSourceActivate,[Out] unsigned int* pcSourceActivate) MFEnumDeviceSources
Gets a list of Microsoft Media Foundation transforms (MFTs) that match specified search criteria. This function extends the function. A GUID that specifies the category of MFTs to enumerate. For a list of MFT categories, see . The bitwise OR of zero or more flags from the enumeration. A pointer to an structure that specifies an input media type to match.This parameter can be NULL. If NULL, all input types are matched. A pointer to an structure that specifies an output media type to match.This parameter can be NULL. If NULL, all output types are matched. Returns an array of objects. Each object represents an activation object for an MFT that matches the search criteria. The function allocates the memory for the array. The caller must release the pointers and call the Dispose for each element in the array. dd388652 HRESULT MFTEnumEx([In] GUID guidCategory,[In] unsigned int Flags,[In, Optional] const MFT_REGISTER_TYPE_INFO* pInputType,[In, Optional] const MFT_REGISTER_TYPE_INFO* pOutputType,[Out, Buffer] IMFActivate*** pppMFTActivate,[Out] unsigned int* pnumMFTActivate) MFTEnumEx

Applies to: desktop apps only

Creates an activation object for the sample grabber media sink.

Pointer to the interface, defining the media type for the sample grabber's input stream.

Pointer to the interface of a callback object. The caller must implement this interface.

Receives a reference to the interface. Use this interface to complete the creation of the sample grabber. The caller must release the interface.

If this function succeeds, it returns . Otherwise, it returns an error code.

To create the sample grabber sink, call on the reference received in the ppIActivate parameter.

Before calling ActivateObject, you can configure the sample grabber by setting any of the following attributes on the ppIActivate reference:

ms702068 HRESULT MFCreateSampleGrabberSinkActivate([In] IMFMediaType* pIMFMediaType,[In] IMFSampleGrabberSinkCallback* pIMFSampleGrabberSinkCallback,[Out] IMFActivate** ppIActivate) MFCreateSampleGrabberSinkActivate

Applies to: desktop apps | Metro style apps

Copies an image or image plane from one buffer to another.

Pointer to the start of the first row of pixels in the destination buffer.

Stride of the destination buffer, in bytes.

Pointer to the start of the first row of pixels in the source image.

Stride of the source image, in bytes.

Width of the image, in bytes.

Number of rows of pixels to copy.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function copies a single plane of the image. For planar YUV formats, you must call the function once for each plane. In this case, pDest and pSrc must point to the start of each plane.

This function is optimized if the MMX, SSE, or SSE2 instruction sets are available on the processor. The function performs a non-temporal store (the data is written to memory directly without polluting the cache).

Note??Prior to Windows?7, this function was exported from evr.dll. Starting in Windows?7, this function is exported from mfplat.dll, and evr.dll exports a stub function that calls into mfplat.dll. For more information, see Library Changes in Windows?7.

bb970554 HRESULT MFCopyImage([Out, Buffer] unsigned char* pDest,[In] int lDestStride,[In, Buffer] const unsigned char* pSrc,[In] int lSrcStride,[In] unsigned int dwWidthInBytes,[In] unsigned int dwLines) MFCopyImage
Functions Constant MetadataProvider. MF_METADATA_PROVIDER_SERVICE Constant PMPServer. MF_PMP_SERVER_CONTEXT Constant Qualiy. MF_QUALITY_SERVICES Constant RateControl. MF_RATE_CONTROL_SERVICE Constant RemoteProxy. MF_REMOTE_PROXY Constant Sami. MF_SAMI_SERVICE Constant SourcePresentationProvider. MF_SOURCE_PRESENTATION_PROVIDER_SERVICE Constant TimeCode. MF_TIMECODE_SERVICE Constant ToplogyNodeAttributeEditor. MF_TOPONODE_ATTRIBUTE_EDITOR_SERVICE Constant WorkQueue. MF_WORKQUEUE_SERVICES Constant SaveJob. MFNET_SAVEJOB_SERVICE Constant NetworkSourceStatistics. MFNETSOURCE_STATISTICS_SERVICE Constant AudioPolicy. MR_AUDIO_POLICY_SERVICE Constant Buffer. MR_BUFFER_SERVICE Constant PolicyVolume. MR_POLICY_VOLUME_SERVICE Constant StreamVolume. MR_STREAM_VOLUME_SERVICE Constant VideoAcceleration. MR_VIDEO_ACCELERATION_SERVICE Functions Constant ApproxEventOccurrenceTime. MF_SESSION_APPROX_EVENT_OCCURRENCE_TIME Constant ContentProtectionManager. MF_SESSION_CONTENT_PROTECTION_MANAGER Constant GlobalTime. MF_SESSION_GLOBAL_TIME Constant QualityManager. MF_SESSION_QUALITY_MANAGER Constant RemoteSourceMode. MF_SESSION_REMOTE_SOURCE_MODE Constant ServerContext. MF_SESSION_SERVER_CONTEXT Constant Topoloader. MF_SESSION_TOPOLOADER Functions Constant AacAudioProfileLevelIndication. MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION Constant AacPayloadType. MF_MT_AAC_PAYLOAD_TYPE Constant AllSamplesIndependent. MF_MT_ALL_SAMPLES_INDEPENDENT Constant AmFormatType. MF_MT_AM_FORMAT_TYPE Constant ArbitraryFormat. MF_MT_ARBITRARY_FORMAT Constant ArbitraryHeader. MF_MT_ARBITRARY_HEADER Constant AudioAvgBytesPerSecond. MF_MT_AUDIO_AVG_BYTES_PER_SECOND Constant AudioBitsPerSample. MF_MT_AUDIO_BITS_PER_SAMPLE Constant AudioBlockAlignment. MF_MT_AUDIO_BLOCK_ALIGNMENT Constant AudioChannelMask. MF_MT_AUDIO_CHANNEL_MASK Constant AudioFloatSamplesPerSecond. MF_MT_AUDIO_FLOAT_SAMPLES_PER_SECOND Constant AudioFolddownMatrix. MF_MT_AUDIO_FOLDDOWN_MATRIX Constant AudioNumChannels. MF_MT_AUDIO_NUM_CHANNELS Constant AudioPreferWaveformatex. MF_MT_AUDIO_PREFER_WAVEFORMATEX Constant AudioSamplesPerBlock. MF_MT_AUDIO_SAMPLES_PER_BLOCK Constant AudioSamplesPerSecond. MF_MT_AUDIO_SAMPLES_PER_SECOND Constant AudioValidBitsPerSample. MF_MT_AUDIO_VALID_BITS_PER_SAMPLE Constant AudioWmadrcAvgref. MF_MT_AUDIO_WMADRC_AVGREF Constant AudioWmadrcAvgtarget. MF_MT_AUDIO_WMADRC_AVGTARGET Constant AudioWmadrcPeakref. MF_MT_AUDIO_WMADRC_PEAKREF Constant AudioWmadrcPeaktarget. MF_MT_AUDIO_WMADRC_PEAKTARGET Constant AvgBitErrorRate. MF_MT_AVG_BIT_ERROR_RATE Constant AvgBitrate. MF_MT_AVG_BITRATE Constant Compressed. MF_MT_COMPRESSED Constant CustomVideoPrimaries. MF_MT_CUSTOM_VIDEO_PRIMARIES Constant DefaultStride. MF_MT_DEFAULT_STRIDE Constant DrmFlags. MF_MT_DRM_FLAGS Constant DvAauxCtrlPack0. MF_MT_DV_AAUX_CTRL_PACK_0 Constant DvAauxCtrlPack1. MF_MT_DV_AAUX_CTRL_PACK_1 Constant DvAauxSrcPack0. MF_MT_DV_AAUX_SRC_PACK_0 Constant DvAauxSrcPack1. MF_MT_DV_AAUX_SRC_PACK_1 Constant DvVauxCtrlPack. MF_MT_DV_VAUX_CTRL_PACK Constant DvVauxSrcPack. MF_MT_DV_VAUX_SRC_PACK Constant FixedSizeSamples. MF_MT_FIXED_SIZE_SAMPLES Constant FrameRate. MF_MT_FRAME_RATE Constant FrameRateRangeMax. MF_MT_FRAME_RATE_RANGE_MAX Constant FrameRateRangeMin. MF_MT_FRAME_RATE_RANGE_MIN Constant FrameSize. MF_MT_FRAME_SIZE Constant GeometricAperture. MF_MT_GEOMETRIC_APERTURE Constant ImageLossTolerant. MF_MT_IMAGE_LOSS_TOLERANT Constant InterlaceMode. MF_MT_INTERLACE_MODE Constant MajorType. MF_MT_MAJOR_TYPE Constant MaxKeyframeSpacing. MF_MT_MAX_KEYFRAME_SPACING Constant MinimumDisplayAperture. MF_MT_MINIMUM_DISPLAY_APERTURE Constant MpegSequenceHeader. MF_MT_MPEG_SEQUENCE_HEADER Constant MpegStartTimeCode. MF_MT_MPEG_START_TIME_CODE Constant Mpeg2Flags. MF_MT_MPEG2_FLAGS Constant Mpeg2Level. MF_MT_MPEG2_LEVEL Constant Mpeg2Profile. MF_MT_MPEG2_PROFILE Constant Mpeg4CurrentSampleEntry. MF_MT_MPEG4_CURRENT_SAMPLE_ENTRY Constant Mpeg4SampleDescription. MF_MT_MPEG4_SAMPLE_DESCRIPTION Constant Original4cc. MF_MT_ORIGINAL_4CC Constant OriginalWaveFormatTag. MF_MT_ORIGINAL_WAVE_FORMAT_TAG Constant PadControlFlags. MF_MT_PAD_CONTROL_FLAGS Constant Palette. MF_MT_PALETTE Constant PanScanAperture. MF_MT_PAN_SCAN_APERTURE Constant PanScanEnabled. MF_MT_PAN_SCAN_ENABLED Constant PixelAspectRatio. MF_MT_PIXEL_ASPECT_RATIO Constant SampleSize. MF_MT_SAMPLE_SIZE Constant SourceContentHint. MF_MT_SOURCE_CONTENT_HINT Constant Subtype. MF_MT_SUBTYPE Constant TransferFunction. MF_MT_TRANSFER_FUNCTION Constant UserData. MF_MT_USER_DATA Constant VideoChromaSiting. MF_MT_VIDEO_CHROMA_SITING Constant VideoLighting. MF_MT_VIDEO_LIGHTING Constant VideoNominalRange. MF_MT_VIDEO_NOMINAL_RANGE Constant VideoPrimaries. MF_MT_VIDEO_PRIMARIES Constant WrappedType. MF_MT_WRAPPED_TYPE Constant YuvMatrix. MF_MT_YUV_MATRIX Functions Constant Html. MFMediaType_HTML Constant Image. MFMediaType_Image Constant Protected. MFMediaType_Protected Constant Audio. MFMediaType_Audio Constant Sami. MFMediaType_SAMI Constant Script. MFMediaType_Script Constant Binary. MFMediaType_Binary Constant FileTransfer. MFMediaType_FileTransfer Constant Video. MFMediaType_Video Constant Default. MFMediaType_Default Functions Constant AppContext. MF_PD_APP_CONTEXT Constant AsfCodeclist. MF_PD_ASF_CODECLIST Constant AsfContentencryptionKeyid. MF_PD_ASF_CONTENTENCRYPTION_KEYID Constant AsfContentencryptionLicenseUrl. MF_PD_ASF_CONTENTENCRYPTION_LICENSE_URL Constant AsfContentencryptionSecretData. MF_PD_ASF_CONTENTENCRYPTION_SECRET_DATA Constant AsfContentencryptionType. MF_PD_ASF_CONTENTENCRYPTION_TYPE Constant AsfContentencryptionexEncryptionData. MF_PD_ASF_CONTENTENCRYPTIONEX_ENCRYPTION_DATA Constant AsfDataLength. MF_PD_ASF_DATA_LENGTH Constant AsfDataStartOffset. MF_PD_ASF_DATA_START_OFFSET Constant AsfFilepropertiesCreationTime. MF_PD_ASF_FILEPROPERTIES_CREATION_TIME Constant AsfFilepropertiesFileId. MF_PD_ASF_FILEPROPERTIES_FILE_ID Constant AsfFilepropertiesFlags. MF_PD_ASF_FILEPROPERTIES_FLAGS Constant AsfFilepropertiesMaxBitrate. MF_PD_ASF_FILEPROPERTIES_MAX_BITRATE Constant AsfFilepropertiesMaxPacketSize. MF_PD_ASF_FILEPROPERTIES_MAX_PACKET_SIZE Constant AsfFilepropertiesMinPacketSize. MF_PD_ASF_FILEPROPERTIES_MIN_PACKET_SIZE Constant AsfFilepropertiesPackets. MF_PD_ASF_FILEPROPERTIES_PACKETS Constant AsfFilepropertiesPlayDuration. MF_PD_ASF_FILEPROPERTIES_PLAY_DURATION Constant AsfFilepropertiesPreroll. MF_PD_ASF_FILEPROPERTIES_PREROLL Constant AsfFilepropertiesSendDuration. MF_PD_ASF_FILEPROPERTIES_SEND_DURATION Constant AsfInfoHasAudio. MF_PD_ASF_INFO_HAS_AUDIO Constant AsfInfoHasNonAudioVideo. MF_PD_ASF_INFO_HAS_NON_AUDIO_VIDEO Constant AsfInfoHasVideo. MF_PD_ASF_INFO_HAS_VIDEO Constant AsfLanglist. MF_PD_ASF_LANGLIST Constant AsfLanglistLegacyorder. MF_PD_ASF_LANGLIST_LEGACYORDER Constant AsfMarker. MF_PD_ASF_MARKER Constant AsfMetadataIsVbr. MF_PD_ASF_METADATA_IS_VBR Constant AsfMetadataLeakyBucketPairs. MF_PD_ASF_METADATA_LEAKY_BUCKET_PAIRS Constant AsfMetadataV8Bufferaverage. MF_PD_ASF_METADATA_V8_BUFFERAVERAGE Constant AsfMetadataV8Vbrpeak. MF_PD_ASF_METADATA_V8_VBRPEAK Constant AsfScript. MF_PD_ASF_SCRIPT Constant AudioEncodingBitrate. MF_PD_AUDIO_ENCODING_BITRATE Constant AudioIsvariablebitrate. MF_PD_AUDIO_ISVARIABLEBITRATE Constant Duration. MF_PD_DURATION Constant LastModifiedTime. MF_PD_LAST_MODIFIED_TIME Constant MimeType. MF_PD_MIME_TYPE Constant PlaybackBoundaryTime. MF_PD_PLAYBACK_BOUNDARY_TIME Constant PlaybackElementId. MF_PD_PLAYBACK_ELEMENT_ID Constant PmphostContext. MF_PD_PMPHOST_CONTEXT Constant PreferredLanguage. MF_PD_PREFERRED_LANGUAGE Constant SamiStylelist. MF_PD_SAMI_STYLELIST Constant TotalFileSize. MF_PD_TOTAL_FILE_SIZE Constant VideoEncodingBitrate. MF_PD_VIDEO_ENCODING_BITRATE Functions Constant GrlUnrecognizedFormat. MF_E_GRL_UNRECOGNIZED_FORMAT Constant SequencerUnknownSegmentId. MF_E_SEQUENCER_UNKNOWN_SEGMENT_ID Constant NetManualssNotSupported. MF_E_NET_MANUALSS_NOT_SUPPORTED Constant ByteStreamNotSeekable. MF_E_BYTESTREAM_NOT_SEEKABLE Constant AllProcessRestartRequired. MF_E_ALL_PROCESS_RESTART_REQUIRED Constant NetResourceGone. MF_E_NET_RESOURCE_GONE Constant InvalidPosition. MF_E_INVALID_POSITION Constant RtUnavailable. MF_E_RT_UNAVAILABLE Constant PolicyMgrActionOufOfBounds. MF_E_POLICY_MGR_ACTION_OUTOFBOUNDS Constant VideoRenSurfaceNotShared. MF_E_VIDEO_REN_SURFACE_NOT_SHARED Constant SignatureVerificationFailed. MF_E_SIGNATURE_VERIFICATION_FAILED Constant Mp3OufOfData. MF_E_MP3_OUTOFDATA Constant Mp3NotSupported. MF_E_MP3_NOTSUPPORTED Constant NetEol. MF_E_NET_EOL Constant TopoUnsupported. MF_E_TOPO_UNSUPPORTED Constant NetCachestreamNotFound. MF_E_NET_CACHESTREAM_NOT_FOUND Constant NotProtected. MF_E_NOT_PROTECTED Constant NetStreamGroupsNotSupported. MF_E_NET_STREAMGROUPS_NOT_SUPPORTED Constant NoDuration. MF_E_NO_DURATION Constant NetTooManyRedirects. MF_E_NET_TOO_MANY_REDIRECTS Constant AsfParsingincomplete. MF_E_ASF_PARSINGINCOMPLETE Constant HighSecurityLevelContentNotAllowEd. MF_E_HIGH_SECURITY_LEVEL_CONTENT_NOT_ALLOWED Constant InvalidName. MF_E_INVALIDNAME Constant NetInvalidPresentationDescriptor. MF_E_NET_INVALID_PRESENTATION_DESCRIPTOR Constant TransformAsyncLocked. MF_E_TRANSFORM_ASYNC_LOCKED Constant MultipleSubScribers. MF_E_MULTIPLE_SUBSCRIBERS Constant HwStreamNotConnected. MF_E_HW_STREAM_NOT_CONNECTED Constant FlushNeeded. MF_E_FLUSH_NEEDED Constant TransformNeedMoreInput. MF_E_TRANSFORM_NEED_MORE_INPUT Constant InvalidStateTransition. MF_E_INVALID_STATE_TRANSITION Constant NetRequireInput. MF_E_NET_REQUIRE_INPUT Constant DroptimeNotSupported. MF_E_DROPTIME_NOT_SUPPORTED Constant NetSessionNotFound. MF_E_NET_SESSION_NOT_FOUND Constant LicenseIncorrectRights. MF_E_LICENSE_INCORRECT_RIGHTS Constant BufferTooSmall. MF_E_BUFFERTOOSMALL Constant ProcessRestartRequired. MF_E_PROCESS_RESTART_REQUIRED Constant NoAudioPlaybackDevice. MF_E_NO_AUDIO_PLAYBACK_DEVICE Constant PeauthNotStarted. MF_E_PEAUTH_NOT_STARTED Constant AsfNoindex. MF_E_ASF_NOINDEX Constant ItaUnrecognizedDigitalVideoOutput. MF_E_ITA_UNRECOGNIZED_DIGITAL_VIDEO_OUTPUT Constant NetServerUnavailable. MF_E_NET_SERVER_UNAVAILABLE Constant InvalidMediaType. MF_E_INVALIDMEDIATYPE Constant RtWorkqueueClassNotSpecified. MF_E_RT_WORKQUEUE_CLASS_NOT_SPECIFIED Constant TransformPropertyArrayValueWrongNumDim. MF_E_TRANSFORM_PROPERTY_ARRAY_VALUE_WRONG_NUM_DIM Constant DrmUnsupported. MF_E_DRM_UNSUPPORTED Constant InvalidFileFormat. MF_E_INVALID_FILE_FORMAT Constant AllOcatorNotCommited. MF_E_ALLOCATOR_NOT_COMMITED Constant WmdrmotaDrmHeaderNotAvailable. MF_E_WMDRMOTA_DRM_HEADER_NOT_AVAILABLE Constant NetNoconnection. MF_E_NET_NOCONNECTION Constant MultipleBegin. MF_E_MULTIPLE_BEGIN Constant InsufficientBuffer. MF_E_INSUFFICIENT_BUFFER Constant NetTooMuchData. MF_E_NET_TOO_MUCH_DATA Constant RtWouldblock. MF_E_RT_WOULDBLOCK Constant AsfOpaquePacket. MF_E_ASF_OPAQUEPACKET Constant TopoMissingStreamDescriptor. MF_E_TOPO_MISSING_STREAM_DESCRIPTOR Constant SampleHasTooManyBuffers. MF_E_SAMPLE_HAS_TOO_MANY_BUFFERS Constant UnsupportedRate. MF_E_UNSUPPORTED_RATE Constant NoSampleTimestamp. MF_E_NO_SAMPLE_TIMESTAMP Constant RebootRequired. MF_E_REBOOT_REQUIRED Constant PropertyNotAllowEd. MF_E_PROPERTY_NOT_ALLOWED Constant ComponentRevoked. MF_E_COMPONENT_REVOKED Constant AsfIndexNotLoaded. MF_E_ASF_INDEXNOTLOADED Constant MediaSourceNotStarted. MF_E_MEDIA_SOURCE_NOT_STARTED Constant TopoStreamDescriptorNotSelected. MF_E_TOPO_STREAM_DESCRIPTOR_NOT_SELECTED Constant TransformCannotInitializeAcmDriver. MF_E_TRANSFORM_CANNOT_INITIALIZE_ACM_DRIVER Constant WmdrmotaActionMismatch. MF_E_WMDRMOTA_ACTION_MISMATCH Constant TransformNotPossibleForCurrentMediaTypeCombination. MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_MEDIATYPE_COMBINATION Constant InvalidStreamNumber. MF_E_INVALIDSTREAMNUMBER Constant TopoInvalidOptionalNode. MF_E_TOPO_INVALID_OPTIONAL_NODE Constant NetBadRequest. MF_E_NET_BAD_REQUEST Constant SampleallocatorCanceled. MF_E_SAMPLEALLOCATOR_CANCELED Constant NoMoreQualityLevels. MF_E_NO_MORE_QUALITY_LEVELS Constant NetIncompatibleServer. MF_E_NET_INCOMPATIBLE_SERVER Constant TransformProfileTruncated. MF_E_TRANSFORM_PROFILE_TRUNCATED Constant TopologyVerificationFailed. MF_E_TOPOLOGY_VERIFICATION_FAILED Constant UnsupportedRepresentation. MF_E_UNSUPPORTED_REPRESENTATION Constant NotAccepting. MF_E_NOTACCEPTING Constant InvalidStreamState. MF_E_INVALID_STREAM_STATE Constant OperationCancelled. MF_E_OPERATION_CANCELLED Constant NetRedirect. MF_E_NET_REDIRECT Constant Mp3NotFound. MF_E_MP3_NOTFOUND Constant NetInvalidPushTemplate. MF_E_NET_INVALID_PUSH_TEMPLATE Constant Mp3BadCrc. MF_E_MP3_BAD_CRC Constant NonPeProcess. MF_E_NON_PE_PROCESS Constant Mp3NotMp3. MF_E_MP3_NOTMP3 Constant StreamsInkExists. MF_E_STREAMSINK_EXISTS Constant MediaSourceNoStreamsSelected. MF_E_MEDIA_SOURCE_NO_STREAMS_SELECTED Constant VideoRenNoProcampHw. MF_E_VIDEO_REN_NO_PROCAMP_HW Constant OperationLNotSupported. MF_E_OPL_NOT_SUPPORTED Constant TransformNotPossibleForCurrentSpkrConfig. MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_SPKR_CONFIG Constant TransformTypeNotSet. MF_E_TRANSFORM_TYPE_NOT_SET Constant ClockInvalidContinuityKey. MF_E_CLOCK_INVALID_CONTINUITY_KEY Constant InvalidType. MF_E_INVALIDTYPE Constant NoClock. MF_E_NO_CLOCK Constant NotInitializeD. MF_E_NOT_INITIALIZED Constant HwMftFailedStartStreaming. MF_E_HW_MFT_FAILED_START_STREAMING Constant StateTransitionPending. MF_E_STATE_TRANSITION_PENDING Constant AsfFilesinkBitRateUnknown. MF_E_ASF_FILESINK_BITRATE_UNKNOWN Constant NoMoreDropModes. MF_E_NO_MORE_DROP_MODES Constant PolicyUnsupported. MF_E_POLICY_UNSUPPORTED Constant NoContentProtectionManager. MF_E_NO_CONTENT_PROTECTION_MANAGER Constant TransformPropertyValueIncompatible. MF_E_TRANSFORM_PROPERTY_VALUE_INCOMPATIBLE Constant SinkNoSamplesProcessed. MF_E_SINK_NO_SAMPLES_PROCESSED Constant InvalidWorkqueue. MF_E_INVALID_WORKQUEUE Constant DebuggingNotAllowEd. MF_E_DEBUGGING_NOT_ALLOWED Constant NoBitpump. MF_E_NO_BITPUMP Constant ByteStreamUnknownLength. MF_E_BYTESTREAM_UNKNOWN_LENGTH Constant NetSessionInvalid. MF_E_NET_SESSION_INVALID Constant NetProxyAccessDenied. MF_E_NET_PROXY_ACCESSDENIED Constant PlatformNotInitializeD. MF_E_PLATFORM_NOT_INITIALIZED Constant LateSample. MF_E_LATE_SAMPLE Constant ClockNoTimeSource. MF_E_CLOCK_NO_TIME_SOURCE Constant PeauthUntrusted. MF_E_PEAUTH_UNTRUSTED Constant ReverseUnsupported. MF_E_REVERSE_UNSUPPORTED Constant ThinningUnsupported. MF_E_THINNING_UNSUPPORTED Constant NetErrorFromProxy. MF_E_NET_ERROR_FROM_PROXY Constant NetUdpBlocked. MF_E_NET_UDP_BLOCKED Constant GrlInvalidFormat. MF_E_GRL_INVALID_FORMAT Constant ItaUnsupportedAction. MF_E_ITA_UNSUPPORTED_ACTION Constant InvalidCodecMerit. MF_E_INVALID_CODEC_MERIT Constant VideoDeviceLocked. MF_E_VIDEO_DEVICE_LOCKED Constant UnsupportedRateTransition. MF_E_UNSUPPORTED_RATE_TRANSITION Constant TransformProfileInvalidOrCorrupt. MF_E_TRANSFORM_PROFILE_INVALID_OR_CORRUPT Constant TopoMissingPresentationDescriptor. MF_E_TOPO_MISSING_PRESENTATION_DESCRIPTOR Constant UsermodeUntrusted. MF_E_USERMODE_UNTRUSTED Constant NetTimeout. MF_E_NET_TIMEOUT Constant StreamsInkRemoved. MF_E_STREAMSINK_REMOVED Constant NetRead. MF_E_NET_READ Constant NetUnsafeUrl. MF_E_NET_UNSAFE_URL Constant NetUnsupportedConfiguration. MF_E_NET_UNSUPPORTED_CONFIGURATION Constant UnsupportedFormat. MF_E_UNSUPPORTED_FORMAT Constant DrmHardwareInconsistent. MF_E_DRM_HARDWARE_INCONSISTENT Constant TopoLoopsInTopology. MF_E_TOPO_LOOPS_IN_TOPOLOGY Constant InvalidAsfStreamId. MF_E_INVALID_ASF_STREAMID Constant Attributenotfound. MF_E_ATTRIBUTENOTFOUND Constant QmInvalidState. MF_E_QM_INVALIDSTATE Constant MissingAsfLeakybucket. MF_E_MISSING_ASF_LEAKYBUCKET Constant NetWrite. MF_E_NET_WRITE Constant PropertyReadOnly. MF_E_PROPERTY_READ_ONLY Constant InvalidKey. MF_E_INVALID_KEY Constant PropertyNotEmpty. MF_E_PROPERTY_NOT_EMPTY Constant AudioServiceNotRunning. MF_E_AUDIO_SERVICE_NOT_RUNNING Constant PropertyEmpty. MF_E_PROPERTY_EMPTY Constant SinkAlreadystopped. MF_E_SINK_ALREADYSTOPPED Constant TopoCodecNotFound. MF_E_TOPO_CODEC_NOT_FOUND Constant PeauthPublickeyRevoked. MF_E_PEAUTH_PUBLICKEY_REVOKED Constant LicenseRestoreNoRights. MF_E_LICENSE_RESTORE_NO_RIGHTS Constant NoSourceInCache. MF_E_NO_SOURCE_IN_CACHE Constant SourceResolverMutuallyExclusiveFlags. MF_E_SOURCERESOLVER_MUTUALLY_EXCLUSIVE_FLAGS Constant AsfMissingData. MF_E_ASF_MISSINGDATA Constant UnsupportedStateTransition. MF_E_UNSUPPORTED_STATE_TRANSITION Constant TransformNotPossibleForCurrentInputMediaType. MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_INPUT_MEDIATYPE Constant PropertyTypeNotAllowEd. MF_E_PROPERTY_TYPE_NOT_ALLOWED Constant BadStartupVersion. MF_E_BAD_STARTUP_VERSION Constant UnsupportedByteStreamType. MF_E_UNSUPPORTED_BYTESTREAM_TYPE Constant NoSampleDuration. MF_E_NO_SAMPLE_DURATION Constant TransformNotPossibleForCurrentOutputMediaType. MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_OUTPUT_MEDIATYPE Constant TransformConflictsWithOtherCurrentlyEnabledFeatures. MF_E_TRANSFORM_CONFLICTS_WITH_OTHER_CURRENTLY_ENABLED_FEATURES Constant QualityknobWaitLonger. MF_E_QUALITYKNOB_WAIT_LONGER Constant TranscodeNoContainertype. MF_E_TRANSCODE_NO_CONTAINERTYPE Constant NoEventsAvailable. MF_E_NO_EVENTS_AVAILABLE Constant AsfUnsupportedStreamType. MF_E_ASF_UNSUPPORTED_STREAM_TYPE Constant TestSignedComponentsNotAllowEd. MF_E_TEST_SIGNED_COMPONENTS_NOT_ALLOWED Constant OutOfRange. MF_E_OUT_OF_RANGE Constant CannotFindKeyframeSample. MF_E_CANNOT_FIND_KEYFRAME_SAMPLE Constant StreamError. MF_E_STREAM_ERROR Constant GrlExtensibleEntryNotFound. MF_E_GRL_EXTENSIBLE_ENTRY_NOT_FOUND Constant WmdrmotaActionAlreadySet. MF_E_WMDRMOTA_ACTION_ALREADY_SET Constant AsfDroppedPacket. MF_E_ASF_DROPPED_PACKET Constant TranscodeProfileNoMatchingStreams. MF_E_TRANSCODE_PROFILE_NO_MATCHING_STREAMS Constant InvalidFormat. MF_E_INVALID_FORMAT Constant CannotIndexInPlace. MF_E_CANNOT_INDEX_IN_PLACE Constant RtThroughputNotAvailable. MF_E_RT_THROUGHPUT_NOT_AVAILABLE Constant PropertyVectorRequired. MF_E_PROPERTY_VECTOR_REQUIRED Constant SinkNoStreams. MF_E_SINK_NO_STREAMS Constant NetConnectionFailure. MF_E_NET_CONNECTION_FAILURE Constant NetBusy. MF_E_NET_BUSY Constant WmdrmotaInvalidPolicy. MF_E_WMDRMOTA_INVALID_POLICY Constant UnsupportedService. MF_E_UNSUPPORTED_SERVICE Constant NetServerAccessDenied. MF_E_NET_SERVER_ACCESSDENIED Constant VideoRenNoDeinterlaceHw. MF_E_VIDEO_REN_NO_DEINTERLACE_HW Constant SampleNotWritable. MF_E_SAMPLE_NOT_WRITABLE Constant InvalidProfile. MF_E_INVALID_PROFILE Constant GrlVersionTooLow. MF_E_GRL_VERSION_TOO_LOW Constant ItaUnrecognizedAnalogVideoProtectionGuid. MF_E_ITA_UNRECOGNIZED_ANALOG_VIDEO_PROTECTION_GUID Constant WmdrmotaNoAction. MF_E_WMDRMOTA_NO_ACTION Constant TopoCannotFindDecrementYptor. MF_E_TOPO_CANNOT_FIND_DECRYPTOR Constant BackupRestrictedLicense. MF_E_BACKUP_RESTRICTED_LICENSE Constant ItaErrorParsingSapParameters. MF_E_ITA_ERROR_PARSING_SAP_PARAMETERS Constant TrustDisabled. MF_E_TRUST_DISABLED Constant NetRedirectToProxy. MF_E_NET_REDIRECT_TO_PROXY Constant VideoRenCopyProtFailed. MF_E_VIDEO_REN_COPYPROT_FAILED Constant PeauthSessionNotStarted. MF_E_PEAUTH_SESSION_NOT_STARTED Constant UnsupportedTimeFormat. MF_E_UNSUPPORTED_TIME_FORMAT Constant NoVideoSampleAvailable. MF_E_NO_VIDEO_SAMPLE_AVAILABLE Constant TopoInvalidTimeAttributes. MF_E_TOPO_INVALID_TIME_ATTRIBUTES Constant MediaSourceWrongState. MF_E_MEDIA_SOURCE_WRONGSTATE Constant ItaUnrecognizedAnalogVideoOutput. MF_E_ITA_UNRECOGNIZED_ANALOG_VIDEO_OUTPUT Constant DisabledInSafemode. MF_E_DISABLED_IN_SAFEMODE Constant RtOufOfMemory. MF_E_RT_OUTOFMEMORY Constant NetRequireNetwork. MF_E_NET_REQUIRE_NETWORK Constant CannotCreateSink. MF_E_CANNOT_CREATE_SINK Constant EndOfStream. MF_E_END_OF_STREAM Constant NetClientClose. MF_E_NET_CLIENT_CLOSE Constant TransformPropertyPidNotRecognized. MF_E_TRANSFORM_PROPERTY_PID_NOT_RECOGNIZED Constant UnrecoverableErrorOccurred. MF_E_UNRECOVERABLE_ERROR_OCCURRED Constant UnsupportedCaption. MF_E_UNSUPPORTED_CAPTION Constant PeUntrusted. MF_E_PE_UNTRUSTED Constant GrlAbsent. MF_E_GRL_ABSENT Constant ClockStateAlreadySet. MF_E_CLOCK_STATE_ALREADY_SET Constant SampleallocatorEmpty. MF_E_SAMPLEALLOCATOR_EMPTY Constant NetProtocolDisabled. MF_E_NET_PROTOCOL_DISABLED Constant ItaOperationLDataNotInitializeD. MF_E_ITA_OPL_DATA_NOT_INITIALIZED Constant Unexpected. MF_E_UNEXPECTED Constant TimerOrphaned. MF_E_TIMER_ORPHANED Constant IncompatibleSampleProtection. MF_E_INCOMPATIBLE_SAMPLE_PROTECTION Constant OfflineMode. MF_E_OFFLINE_MODE Constant AlreadyInitializeD. MF_E_ALREADY_INITIALIZED Constant InvalidIndex. MF_E_INVALIDINDEX Constant AsfOufOfRange. MF_E_ASF_OUTOFRANGE Constant AudioPlaybackDeviceInvalidated. MF_E_AUDIO_PLAYBACK_DEVICE_INVALIDATED Constant TopoSinkActivatesUnsupported. MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED Constant NetRequireAsync. MF_E_NET_REQUIRE_ASYNC Constant TransformInputRemaining. MF_E_TRANSFORM_INPUT_REMAINING Constant NetProxyTimeout. MF_E_NET_PROXY_TIMEOUT Constant BadOperationLStructureFormat. MF_E_BAD_OPL_STRUCTURE_FORMAT Constant TransformPropertyValueOutOfRange. MF_E_TRANSFORM_PROPERTY_VALUE_OUT_OF_RANGE Constant PropertyNotFound. MF_E_PROPERTY_NOT_FOUND Constant TopoMissingSource. MF_E_TOPO_MISSING_SOURCE Constant NotAvailable. MF_E_NOT_AVAILABLE Constant NetBadControlData. MF_E_NET_BAD_CONTROL_DATA Constant LicenseRequired. MF_E_LICENSE_REQUIRED Constant NetInvalidPushPublishingPoint. MF_E_NET_INVALID_PUSH_PUBLISHING_POINT Constant AllOcatorAlreadyCommited. MF_E_ALLOCATOR_ALREADY_COMMITED Constant StreamsInksFixed. MF_E_STREAMSINKS_FIXED Constant NotFound. MF_E_NOT_FOUND Constant PropertyTypeNotSupported. MF_E_PROPERTY_TYPE_NOT_SUPPORTED Constant NetCacheNoData. MF_E_NET_CACHE_NO_DATA Constant AsfInvalidData. MF_E_ASF_INVALIDDATA Constant SessionPausewhilestopped. MF_E_SESSION_PAUSEWHILESTOPPED Constant RateChangePreempted. MF_E_RATE_CHANGE_PREEMPTED Constant AllOcatorNotInitializeD. MF_E_ALLOCATOR_NOT_INITIALIZED Constant TransformProfileMissing. MF_E_TRANSFORM_PROFILE_MISSING Constant UnsupportedD3DType. MF_E_UNSUPPORTED_D3D_TYPE Constant Shutdown. MF_E_SHUTDOWN Constant NewVideoDevice. MF_E_NEW_VIDEO_DEVICE Constant RtTooManyClassEs. MF_E_RT_TOO_MANY_CLASSES Constant KernelUntrusted. MF_E_KERNEL_UNTRUSTED Constant NetIncompatiblePushserver. MF_E_NET_INCOMPATIBLE_PUSHSERVER Constant TranscodeNoMatchingEncoder. MF_E_TRANSCODE_NO_MATCHING_ENCODER Constant NetInternalServerError. MF_E_NET_INTERNAL_SERVER_ERROR Constant TopoCannotConnect. MF_E_TOPO_CANNOT_CONNECT Constant CodeExpired. MF_E_CODE_EXPIRED Constant NetBwlevelNotSupported. MF_E_NET_BWLEVEL_NOT_SUPPORTED Constant Unauthorized. MF_E_UNAUTHORIZED Constant CannotParseByteStream. MF_E_CANNOT_PARSE_BYTESTREAM Constant UnsupportedScheme. MF_E_UNSUPPORTED_SCHEME Constant NoMoreTypes. MF_E_NO_MORE_TYPES Constant PeSessionsMaximumEd. MF_E_PE_SESSIONS_MAXED Constant NetworkResourceFailure. MF_E_NETWORK_RESOURCE_FAILURE Constant IndexNotCommitted. MF_E_INDEX_NOT_COMMITTED Constant MetadataTooLong. MF_E_METADATA_TOO_LONG Constant FormatChangeNotSupported. MF_E_FORMAT_CHANGE_NOT_SUPPORTED Constant StreamsInksOutOfSync. MF_E_STREAMSINKS_OUT_OF_SYNC Constant InvalidStreamData. MF_E_INVALID_STREAM_DATA Constant PropertyVectorNotAllowEd. MF_E_PROPERTY_VECTOR_NOT_ALLOWED Constant InvalidTimestamp. MF_E_INVALID_TIMESTAMP Constant NoIndex. MF_E_NO_INDEX Constant ClockNotSimple. MF_E_CLOCK_NOT_SIMPLE Constant TransformCannotChangeMediaTypeWhileProcessing. MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING Constant BandwidthOverrun. MF_E_BANDWIDTH_OVERRUN Constant NoPmpHost. MF_E_NO_PMP_HOST Constant MediaProcWrongState. MF_E_MEDIAPROC_WRONGSTATE Constant TransformPropertyValueSizeWrong. MF_E_TRANSFORM_PROPERTY_VALUE_SIZE_WRONG Constant WmdrmotaDrmEncryptionSchemeNotSupported. MF_E_WMDRMOTA_DRM_ENCRYPTION_SCHEME_NOT_SUPPORTED Constant TransformPropertyNotWriteAble. MF_E_TRANSFORM_PROPERTY_NOT_WRITEABLE Constant TransformStreamChange. MF_E_TRANSFORM_STREAM_CHANGE Constant GrlRenewalNotFound. MF_E_GRL_RENEWAL_NOT_FOUND Constant LicenseRestoreNeedsIndividualization. MF_E_LICENSE_RESTORE_NEEDS_INDIVIDUALIZATION Constant InvalidRequest. MF_E_INVALIDREQUEST Constant AudioPlaybackDeviceInUse. MF_E_AUDIO_PLAYBACK_DEVICE_IN_USE Constant NetCannotconnect. MF_E_NET_CANNOTCONNECT Constant LicenseOufOfDate. MF_E_LICENSE_OUTOFDATE Constant TransformPropertyVariantTypeWrong. MF_E_TRANSFORM_PROPERTY_VARIANT_TYPE_WRONG Constant AsfTooManyPayloads. MF_E_ASF_TOO_MANY_PAYLOADS Functions Constant BottomFieldFirst. MFSampleExtension_BottomFieldFirst Constant CleanPoint. MFSampleExtension_CleanPoint Constant DerivedFromTopField. MFSampleExtension_DerivedFromTopField Constant DeviceTimestamp. MFSampleExtension_DeviceTimestamp Constant Discontinuity. MFSampleExtension_Discontinuity Constant Interlaced. MFSampleExtension_Interlaced Constant PacketCrossOffsets. MFSampleExtension_PacketCrossOffsets Constant RepeatFirstField. MFSampleExtension_RepeatFirstField Constant SingleField. MFSampleExtension_SingleField Constant Token. MFSampleExtension_Token Constant DescrambleData. MFSampleExtension_DescrambleData Constant SampleKeyID. MFSampleExtension_SampleKeyID Constant GenKeyFunc. MFSampleExtension_GenKeyFunc Constant GenKeyCtx. MFSampleExtension_GenKeyCtx Functions Constant IgnoreClock. MF_SAMPLEGRABBERSINK_IGNORE_CLOCK Constant SampleTimeOffset. MF_SAMPLEGRABBERSINK_SAMPLE_TIME_OFFSET Functions Constant ReadwriteDisableConverters. MF_READWRITE_DISABLE_CONVERTERS Constant ReadwriteEnableHardwareTransforms. MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS Constant AsyncCallback. MF_SINK_WRITER_ASYNC_CALLBACK Constant DisableThrottling. MF_SINK_WRITER_DISABLE_THROTTLING Functions Constant AsyncCallback. MF_SOURCE_READER_ASYNC_CALLBACK Constant D3DManager. MF_SOURCE_READER_D3D_MANAGER Constant DisableDxva. MF_SOURCE_READER_DISABLE_DXVA Constant DisconnectMediasourceOnShutdown. MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN Constant EnableVideoProcessing. MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING Constant MediaSourceCharacteristics. MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS Constant MediaSourceConfig. MF_SOURCE_READER_MEDIASOURCE_CONFIG Functions Constant AsfExtstrmpropAvgBuffersize. MF_SD_ASF_EXTSTRMPROP_AVG_BUFFERSIZE Constant AsfExtstrmpropAvgDataBitrate. MF_SD_ASF_EXTSTRMPROP_AVG_DATA_BITRATE Constant AsfExtstrmpropLanguageIdIndex. MF_SD_ASF_EXTSTRMPROP_LANGUAGE_ID_INDEX Constant AsfExtstrmpropMaxBuffersize. MF_SD_ASF_EXTSTRMPROP_MAX_BUFFERSIZE Constant AsfExtstrmpropMaxDataBitrate. MF_SD_ASF_EXTSTRMPROP_MAX_DATA_BITRATE Constant AsfMetadataDeviceConformanceTemplate. MF_SD_ASF_METADATA_DEVICE_CONFORMANCE_TEMPLATE Constant AsfStreambitratesBitrate. MF_SD_ASF_STREAMBITRATES_BITRATE Constant Language. MF_SD_LANGUAGE Constant MutuallyExclusive. MF_SD_MUTUALLY_EXCLUSIVE Constant Protected. MF_SD_PROTECTED Constant SamiLanguage. MF_SD_SAMI_LANGUAGE Constant StreamName. MF_SD_STREAM_NAME Functions Constant DXVAMode. MF_TOPOLOGY_DXVA_MODE Constant DynamicChangeNotAllowed. MF_TOPOLOGY_DYNAMIC_CHANGE_NOT_ALLOWED Constant EnumerateSourceTypes. MF_TOPOLOGY_ENUMERATE_SOURCE_TYPES Constant HardwareMode. MF_TOPOLOGY_HARDWARE_MODE Constant NoMarkinMarkout. MF_TOPOLOGY_NO_MARKIN_MARKOUT Constant PlaybackFramerate. MF_TOPOLOGY_PLAYBACK_FRAMERATE Constant PlaybackMaxDimensions. MF_TOPOLOGY_PLAYBACK_MAX_DIMS Constant ProjectStart. MF_TOPOLOGY_PROJECTSTART Constant ProjectStop. MF_TOPOLOGY_PROJECTSTOP Constant ResolutionStatus. MF_TOPOLOGY_RESOLUTION_STATUS Constant StartTimeOnPresentationSwitch. MF_TOPOLOGY_START_TIME_ON_PRESENTATION_SWITCH Constant StaticPlaybackOptimizations. MF_TOPOLOGY_STATIC_PLAYBACK_OPTIMIZATIONS Functions Constant ConnectMethod. MF_TOPONODE_CONNECT_METHOD Constant D3DAWARE. MF_TOPONODE_D3DAWARE Constant Decoder. MF_TOPONODE_DECODER Constant Decryptor. MF_TOPONODE_DECRYPTOR Constant DisablePreroll. MF_TOPONODE_DISABLE_PREROLL Constant Discardable. MF_TOPONODE_DISCARDABLE Constant Drain. MF_TOPONODE_DRAIN Constant ErrorMajortype. MF_TOPONODE_ERROR_MAJORTYPE Constant ErrorSubtype. MF_TOPONODE_ERROR_SUBTYPE Constant Errorcode. MF_TOPONODE_ERRORCODE Constant Flush. MF_TOPONODE_FLUSH Constant Locked. MF_TOPONODE_LOCKED Constant MarkinHere. MF_TOPONODE_MARKIN_HERE Constant MarkoutHere. MF_TOPONODE_MARKOUT_HERE Constant Mediastart. MF_TOPONODE_MEDIASTART Constant Mediastop. MF_TOPONODE_MEDIASTOP Constant NoshutdownOnRemove. MF_TOPONODE_NOSHUTDOWN_ON_REMOVE Constant PresentationDescriptor. MF_TOPONODE_PRESENTATION_DESCRIPTOR Constant Primaryoutput. MF_TOPONODE_PRIMARYOUTPUT Constant Rateless. MF_TOPONODE_RATELESS Constant SequenceElementid. MF_TOPONODE_SEQUENCE_ELEMENTID Constant Source. MF_TOPONODE_SOURCE Constant StreamDescriptor. MF_TOPONODE_STREAM_DESCRIPTOR Constant Streamid. MF_TOPONODE_STREAMID Constant TransformObjectid. MF_TOPONODE_TRANSFORM_OBJECTID Constant WorkqueueId. MF_TOPONODE_WORKQUEUE_ID Constant WorkqueueMmcssClass. MF_TOPONODE_WORKQUEUE_MMCSS_CLASS Constant WorkqueueMmcssTaskid. MF_TOPONODE_WORKQUEUE_MMCSS_TASKID Functions Constant TranscodeAdjustProfile. MF_TRANSCODE_ADJUST_PROFILE Constant TranscodeContainertype. MF_TRANSCODE_CONTAINERTYPE Constant TranscodeDonotInsertEncoder. MF_TRANSCODE_DONOT_INSERT_ENCODER Constant TranscodeEncodingprofile. MF_TRANSCODE_ENCODINGPROFILE Constant TranscodeQualityvsspeed. MF_TRANSCODE_QUALITYVSSPEED Constant TranscodeSkipMetadataTransfer. MF_TRANSCODE_SKIP_METADATA_TRANSFER Constant TranscodeTopologymode. MF_TRANSCODE_TOPOLOGYMODE Functions Constant ActivateMftLocked. MF_ACTIVATE_MFT_LOCKED Constant D3DAware. MF_SA_D3D_AWARE Constant TransformAsync. MF_TRANSFORM_ASYNC Constant TransformAsyncUnlock. MF_TRANSFORM_ASYNC_UNLOCK Constant TransformCategoryAttribute. MF_TRANSFORM_CATEGORY_Attribute Constant TransformFlagsAttribute. MF_TRANSFORM_FLAGS_Attribute Constant MftCodecMeritAttribute. MFT_CODEC_MERIT_Attribute Constant MftConnectedStreamAttribute. MFT_CONNECTED_STREAM_ATTRIBUTE Constant MftConnectedToHwStream. MFT_CONNECTED_TO_HW_STREAM Constant MftEnumHardwareUrlAttribute. MFT_ENUM_HARDWARE_URL_Attribute Constant MftEnumTranscodeOnlyAttribute. MFT_ENUM_TRANSCODE_ONLY_ATTRIBUTE Constant MftFieldofuseUnlockAttribute. MFT_FIELDOFUSE_UNLOCK_Attribute Constant MftFriendlyNameAttribute. MFT_FRIENDLY_NAME_Attribute Constant MftHwTimestampWithQpcAttribute. MFT_HW_TIMESTAMP_WITH_QPC_Attribute Constant MftInputTypesAttributes. MFT_INPUT_TYPES_Attributes Constant MftOutputTypesAttributes. MFT_OUTPUT_TYPES_Attributes Constant MftPreferredEncoderProfile. MFT_PREFERRED_ENCODER_PROFILE Constant MftPreferredOutputtypeAttribute. MFT_PREFERRED_OUTPUTTYPE_Attribute Constant MftProcessLocalAttribute. MFT_PROCESS_LOCAL_Attribute Constant MftSupportDynamicFormatChange. MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE Constant MftTransformClsidAttribute. MFT_TRANSFORM_CLSID_Attribute Functions Constant AudioDecoder. MFT_CATEGORY_AUDIO_DECODER Constant Other. MFT_CATEGORY_OTHER Constant AudioEncoder. MFT_CATEGORY_AUDIO_ENCODER Constant Multiplexer. MFT_CATEGORY_MULTIPLEXER Constant Demultiplexer. MFT_CATEGORY_DEMULTIPLEXER Constant AudioEffect. MFT_CATEGORY_AUDIO_EFFECT Constant VideoProcessor. MFT_CATEGORY_VIDEO_PROCESSOR Constant VideoDecoder. MFT_CATEGORY_VIDEO_DECODER Constant VideoEffect. MFT_CATEGORY_VIDEO_EFFECT Constant VideoEncoder. MFT_CATEGORY_VIDEO_ENCODER Functions Constant Wmv1. MFVideoFormat_WMV1 Constant Wmv2. MFVideoFormat_WMV2 Constant Wmv3. MFVideoFormat_WMV3 Constant Mpeg2. MFVideoFormat_MPEG2 Constant Dvc. MFVideoFormat_DVC Constant M4S2. MFVideoFormat_M4S2 Constant Yvu9. MFVideoFormat_YVU9 Constant Iyuv. MFVideoFormat_IYUV Constant Wvc1. MFVideoFormat_WVC1 Constant Rgb8. MFVideoFormat_RGB8 Constant Base. MFVideoFormat_Base Constant H264. MFVideoFormat_H264 Constant Dv25. MFVideoFormat_DV25 Constant Dv50. MFVideoFormat_DV50 Constant Dvh1. MFVideoFormat_DVH1 Constant Dvhd. MFVideoFormat_DVHD Constant Dvsd. MFVideoFormat_DVSD Constant Dvsl. MFVideoFormat_DVSL Constant MultisampledS2. MFVideoFormat_MSS2 Constant P010. MFVideoFormat_P010 Constant YUY2. MFVideoFormat_YUY2 Constant Yv12. MFVideoFormat_YV12 Constant Yvyu. MFVideoFormat_YVYU Constant Rgb24. MFVideoFormat_RGB24 Constant Rgb32. MFVideoFormat_RGB32 Constant P016. MFVideoFormat_P016 Constant Y41P. MFVideoFormat_Y41P Constant Mjpg. MFVideoFormat_MJPG Constant P210. MFVideoFormat_P210 Constant P216. MFVideoFormat_P216 Constant I420. MFVideoFormat_I420 Constant Mp43. MFVideoFormat_MP43 Constant Mp4s. MFVideoFormat_MP4S Constant Mp4v. MFVideoFormat_MP4V Constant Mpg1. MFVideoFormat_MPG1 Constant MultisampledS1. MFVideoFormat_MSS1 Constant AI44. MFVideoFormat_AI44 Constant Argb32. MFVideoFormat_ARGB32 Constant NV11. MFVideoFormat_NV11 Constant NV12. MFVideoFormat_NV12 Constant Y210. MFVideoFormat_Y210 Constant Y216. MFVideoFormat_Y216 Constant Y410. MFVideoFormat_Y410 Constant Y416. MFVideoFormat_Y416 Constant Y41T. MFVideoFormat_Y41T Constant Y42T. MFVideoFormat_Y42T Constant Uyvy. MFVideoFormat_UYVY Constant Rgb555. MFVideoFormat_RGB555 Constant Rgb565. MFVideoFormat_RGB565 Constant AYUV. MFVideoFormat_AYUV

Enables the application to defer the creation of an object. This interface is exposed by activation objects.

Typically, the application calls some function that returns an reference and then passes that reference to another component. The other component calls ActivateObject at a later time to create the object. In the protected media path (PMP), the reference might be marshaled to the protected process, so that the object can be created in that process.

ms703039 IMFActivate IMFActivate

Provides a generic way to store key/value pairs on an object. The keys are s, and the values can be any of the following data types: UINT32, UINT64, double, , wide-character string, byte array, or reference. The standard implementation of this interface holds a thread lock while values are added, deleted, or retrieved.

For a list of predefined attribute s, see Media Foundation Attributes. Each attribute has an expected data type. The various "set" methods in do not validate the type against the attribute . It is the application's responsibility to set the correct type for the attribute.

To create an empty attribute store, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704598 IMFAttributes IMFAttributes
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the value associated with a key.

A that identifies which value to retrieve.

A reference to a that receives the value. The method fills the with a copy of the stored value, if the value is found. Call PropVariantClear to free the memory allocated by this method. This parameter can be null. If this parameter is null, the method searches for the key and returns if the key is found, but does not copy the value.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The specified key was not found.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970450 HRESULT IMFAttributes::GetItem([In] const GUID& guidKey,[In] void* pValue) IMFAttributes::GetItem

Retrieves the data type of the value associated with a key.

that identifies which value to query.

Receives a member of the enumeration.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970369 HRESULT IMFAttributes::GetItemType([In] const GUID& guidKey,[Out] MF_ATTRIBUTE_TYPE* pType) IMFAttributes::GetItemType

Queries whether a stored attribute value equals to a specified .

that identifies which value to query.

that contains the value to compare.

Receives a Boolean value indicating whether the attribute matches the value given in Value. See Remarks. This parameter must not be null. If this parameter is null, an access violation occurs.

The method sets pbResult to for any of the following reasons:

  • No attribute is found whose key matches the one given in guidKey.

  • The attribute's type does not match the type given in Value.

  • The attribute value does not match the value given in Value.

  • The method fails.

Otherwise, the method sets pbResult to TRUE.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970566 HRESULT IMFAttributes::CompareItem([In] const GUID& guidKey,[In] const PROPVARIANT& Value,[Out] BOOL* pbResult) IMFAttributes::CompareItem

Compares the attributes on this object with the attributes on another object.

Pointer to the interface of the object to compare with this object.

Member of the enumeration, specifying the type of comparison to make.

Receives a Boolean value. The value is TRUE if the two sets of attributes match in the way specified by the MatchType parameter. Otherwise, the value is .

If pThis is the object whose Compare method is called, and pTheirs is the object passed in as the pTheirs parameter, the following comparisons are defined by MatchType.

Match typeReturns TRUE if and only if
For every attribute in pThis, an attribute with the same key and value exists in pTheirs.
For every attribute in pTheirs, an attribute with the same key and value exists in pThis.
The key/value pairs are identical in both objects.
Take the intersection of the keys in pThis and the keys in pTheirs. The values associated with those keys are identical in both pThis and pTheirs.
Take the object with the smallest number of attributes. For every attribute in that object, an attribute with the same key and value exists in the other object.

?

The pTheirs and pbResult parameters must not be null. If either parameter is null, an access violation occurs.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970349 HRESULT IMFAttributes::Compare([In, Optional] IMFAttributes* pTheirs,[In] MF_ATTRIBUTES_MATCH_TYPE MatchType,[Out] BOOL* pbResult) IMFAttributes::Compare

Retrieves a UINT32 value associated with a key.

that identifies which value to retrieve. The attribute type must be .

Receives a UINT32 value. If the key is found and the data type is UINT32, the method copies the value into this parameter. Otherwise, the original value of this parameter is not changed.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970551 HRESULT IMFAttributes::GetUINT32([In] const GUID& guidKey,[Out] unsigned int* punValue) IMFAttributes::GetUINT32

Retrieves a UINT64 value associated with a key.

that identifies which value to retrieve. The attribute type must be .

Receives a UINT64 value. If the key is found and the data type is UINT64, the method copies the value into this parameter. Otherwise, the original value of this parameter is not changed.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970569 HRESULT IMFAttributes::GetUINT64([In] const GUID& guidKey,[Out] unsigned longlong* punValue) IMFAttributes::GetUINT64

Retrieves a double value associated with a key.

that identifies which value to retrieve. The attribute type must be .

Receives a double value. If the key is found and the data type is double, the method copies the value into this parameter. Otherwise, the original value of this parameter is not changed.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970418 HRESULT IMFAttributes::GetDouble([In] const GUID& guidKey,[Out] double* pfValue) IMFAttributes::GetDouble

Retrieves a value associated with a key.

that identifies which value to retrieve. The attribute type must be .

Receives a value. If the key is found and the data type is , the method copies the value into this parameter. Otherwise, the original value of this parameter is not changed.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970426 HRESULT IMFAttributes::GetGUID([In] const GUID& guidKey,[Out] GUID* pguidValue) IMFAttributes::GetGUID

Retrieves the length of a string value associated with a key.

that identifies which value to retrieve. The attribute type must be .

If the key is found and the value is a string type, this parameter receives the number of characters in the string, not including the terminating null character. To get the string value, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970425 HRESULT IMFAttributes::GetStringLength([In] const GUID& guidKey,[Out] unsigned int* pcchLength) IMFAttributes::GetStringLength

Retrieves a wide-character string associated with a key.

that identifies which value to retrieve. The attribute type must be .

Pointer to a wide-character array allocated by the caller. The array must be large enough to hold the string, including the terminating null character. If the key is found and the value is a string type, the method copies the string into this buffer. To find the length of the string, call .

The size of the pwszValue array, in characters. This value includes the terminating null character.

Receives the number of characters in the string, excluding the terminating null character. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_OUTOFMEMORY

The length of the string is too large to fit in a UINT32 value.

E_NOT_SUFFICIENT_BUFFER

The buffer is not large enough to hold the string.

The specified key was not found.

The attribute value is not a string.

?

You can also use the method, which allocates the buffer to hold the string.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970430 HRESULT IMFAttributes::GetString([In] const GUID& guidKey,[Out, Buffer] wchar_t* pwszValue,[In] unsigned int cchBufSize,[InOut, Optional] unsigned int* pcchLength) IMFAttributes::GetString

Gets a wide-character string associated with a key. This method allocates the memory for the string.

A that identifies which value to retrieve. The attribute type must be .

If the key is found and the value is a string type, this parameter receives a copy of the string. The caller must free the memory for the string by calling CoTaskMemFree.

Receives the number of characters in the string, excluding the terminating null character. This parameter must not be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The specified key was not found.

The attribute value is not a string.

?

To copy a string value into a caller-allocated buffer, use the method.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Note??An earlier version of the documentation incorrectly stated that the pcchLength parameter can be null. Setting this parameter to null might succeed in some cases, but is not guaranteed. The caller must pass a non-null reference for this parameter.

bb970406 HRESULT IMFAttributes::GetAllocatedString([In] const GUID& guidKey,[Out, Buffer, Optional] wchar_t** ppwszValue,[Out] unsigned int* pcchLength) IMFAttributes::GetAllocatedString

Retrieves the length of a byte array associated with a key.

that identifies which value to retrieve. The attribute type must be .

If the key is found and the value is a byte array, this parameter receives the size of the array, in bytes.

To get the byte array, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970459 HRESULT IMFAttributes::GetBlobSize([In] const GUID& guidKey,[Out] unsigned int* pcbBlobSize) IMFAttributes::GetBlobSize

Retrieves a byte array associated with a key. This method copies the array into a caller-allocated buffer.

that identifies which value to retrieve. The attribute type must be .

Pointer to a buffer allocated by the caller. If the key is found and the value is a byte array, the method copies the array into this buffer. To find the required size of the buffer, call .

The size of the pBuf buffer, in bytes.

Receives the size of the byte array. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOT_SUFFICIENT_BUFFER

The buffer is not large enough to the array.

The specified key was not found.

The attribute value is not a byte array.

?

You can also use the method, which allocates the buffer to hold the byte array.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970421 HRESULT IMFAttributes::GetBlob([In] const GUID& guidKey,[In] void* pBuf,[In] unsigned int cbBufSize,[InOut, Optional] unsigned int* pcbBlobSize) IMFAttributes::GetBlob

Retrieves a byte array associated with a key. This method allocates the memory for the array.

that identifies which value to retrieve. The attribute type must be .

If the key is found and the value is a byte array, this parameter receives a copy of the array. The caller must free the memory for the array by calling CoTaskMemFree.

Receives the size of the array, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The specified key was not found.

The attribute value is not a byte array.

?

To copy a byte array value into a caller-allocated buffer, use the method.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970382 HRESULT IMFAttributes::GetAllocatedBlob([In] const GUID& guidKey,[Out, Buffer, Optional] unsigned char** ppBuf,[Out] unsigned int* pcbSize) IMFAttributes::GetAllocatedBlob

Retrieves an interface reference associated with a key.

that identifies which value to retrieve. The attribute type must be .

Interface identifier (IID) of the interface to retrieve.

Receives a reference to the requested interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOINTERFACE

The attribute value is an reference but does not support requested interface.

The specified key was not found.

The attribute value is not an reference.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970481 HRESULT IMFAttributes::GetUnknown([In] const GUID& guidKey,[In] const GUID& riid,[Out] void** ppv) IMFAttributes::GetUnknown

Adds an attribute value with a specified key.

A that identifies the value to set. If this key already exists, the method overwrites the old value.

A that contains the attribute value. The method copies the value. The type must be one of the types listed in the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_OUTOFMEMORY

Insufficient memory.

Invalid attribute type.

?

This method checks whether the type is one of the attribute types defined in , and fails if an unsupported type is used. However, this method does not check whether the is the correct type for the specified attribute . (There is no programmatic way to associate attribute GUIDs with property types.) For a list of Media Foundation attributes and their data types, see Media Foundation Attributes.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970346 HRESULT IMFAttributes::SetItem([In] const GUID& guidKey,[In] const PROPVARIANT& Value) IMFAttributes::SetItem

Removes a key/value pair from the object's attribute list.

that identifies the value to delete.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If the specified key does not exist, the method returns .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970486 HRESULT IMFAttributes::DeleteItem([In] const GUID& guidKey) IMFAttributes::DeleteItem

Removes all key/value pairs from the object's attribute list.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms700200 HRESULT IMFAttributes::DeleteAllItems() IMFAttributes::DeleteAllItems

Associates a UINT32 value with a key.

that identifies the value to set. If this key already exists, the method overwrites the old value.

New value for this key.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To retrieve the UINT32 value, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970467 HRESULT IMFAttributes::SetUINT32([In] const GUID& guidKey,[In] unsigned int unValue) IMFAttributes::SetUINT32

Associates a UINT64 value with a key.

that identifies the value to set. If this key already exists, the method overwrites the old value.

New value for this key.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To retrieve the UINT64 value, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970439 HRESULT IMFAttributes::SetUINT64([In] const GUID& guidKey,[In] unsigned longlong unValue) IMFAttributes::SetUINT64

Associates a double value with a key.

that identifies the value to set. If this key already exists, the method overwrites the old value.

New value for this key.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To retrieve the double value, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970505 HRESULT IMFAttributes::SetDouble([In] const GUID& guidKey,[In] double fValue) IMFAttributes::SetDouble

Associates a value with a key.

that identifies the value to set. If this key already exists, the method overwrites the old value.

New value for this key.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_OUTOFMEMORY

Insufficient memory.

?

To retrieve the value, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970530 HRESULT IMFAttributes::SetGUID([In] const GUID& guidKey,[In] const GUID& guidValue) IMFAttributes::SetGUID

Associates a wide-character string with a key.

that identifies the value to set. If this key already exists, the method overwrites the old value.

Null-terminated wide-character string to associate with this key. The method stores a copy of the string.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To retrieve the string, call or .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970404 HRESULT IMFAttributes::SetString([In] const GUID& guidKey,[In, Buffer] const wchar_t* wszValue) IMFAttributes::SetString

Associates a byte array with a key.

that identifies the value to set. If this key already exists, the method overwrites the old value.

Pointer to a byte array to associate with this key. The method stores a copy of the array.

Size of the array, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To retrieve the byte array, call or .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970395 HRESULT IMFAttributes::SetBlob([In] const GUID& guidKey,[In] const void* pBuf,[In] unsigned int cbBufSize) IMFAttributes::SetBlob

Associates an reference with a key.

that identifies the value to set. If this key already exists, the method overwrites the old value.

reference to be associated with this key.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To retrieve the reference, call .

It is not an error to call SetUnknown with pUnknown equal to null. However, GetUnknown will return .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970533 HRESULT IMFAttributes::SetUnknown([In] const GUID& guidKey,[In, Optional] IUnknown* pUnknown) IMFAttributes::SetUnknown

Locks the attribute store so that no other thread can access it. If the attribute store is already locked by another thread, this method blocks until the other thread unlocks the object. After calling this method, call to unlock the object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method can cause a deadlock if a thread that calls LockStore waits on a thread that calls any other methods on the same object.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698926 HRESULT IMFAttributes::LockStore() IMFAttributes::LockStore

Unlocks the attribute store after a call to the method. While the object is unlocked, multiple threads can access the object's attributes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697545 HRESULT IMFAttributes::UnlockStore() IMFAttributes::UnlockStore

Retrieves the number of attributes that are set on this object.

Receives the number of attributes. This parameter must not be null. If this parameter is null, an access violation occurs.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To enumerate all of the attributes, call for each index value.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970413 HRESULT IMFAttributes::GetCount([Out] unsigned int* pcItems) IMFAttributes::GetCount

Retrieves an attribute at the specified index.

Index of the attribute to retrieve. To get the number of attributes, call .

Receives the that identifies this attribute.

Pointer to a that receives the value. This parameter can be null. If it is not null, the method fills the with a copy of the attribute value. Call PropVariantClear to free the memory allocated by this method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid index.

?

To enumerate all of an object's attributes in a thread-safe way, do the following:

  1. Call to prevent another thread from adding or deleting attributes.

  2. Call to find the number of attributes.

  3. Call GetItemByIndex to get each attribute by index.

  4. Call to unlock the attribute store.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970331 HRESULT IMFAttributes::GetItemByIndex([In] unsigned int unIndex,[Out] GUID* pguidKey,[InOut, Optional] PROPVARIANT* pValue) IMFAttributes::GetItemByIndex

Copies all of the attributes from this object into another attribute store.

A reference to the interface of the attribute store that receives the copy.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method deletes all of the attributes originally stored in pDest.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970330 HRESULT IMFAttributes::CopyAllItems([In, Optional] IMFAttributes* pDest) IMFAttributes::CopyAllItems
Initializes a new instance of the class. The initial number of elements allocated for the attribute store. The attribute store grows as needed. Default is 0

Attributes are used throughout Microsoft Media Foundation to configure objects, describe media formats, query object properties, and other purposes. For more information, see Attributes in Media Foundation.

For a complete list of all the defined attribute GUIDs in Media Foundation, see Media Foundation Attributes.

ms701878 HRESULT MFCreateAttributes([Out] IMFAttributes** ppMFAttributes,[In] unsigned int cInitialSize) MFCreateAttributes
Gets an item value GUID of the key. The value associated to this key. ms704598 HRESULT IMFAttributes::GetItem([In] const GUID& guidKey,[In] void* pValue) IMFAttributes::GetItem

Applies to: desktop apps | Metro style apps

Retrieves an attribute at the specified index.

Index of the attribute to retrieve. To get the number of attributes, call .

Receives the that identifies this attribute.

The value associated to this index

To enumerate all of an object's attributes in a thread-safe way, do the following:

  1. Call to prevent another thread from adding or deleting attributes.

  2. Call to find the number of attributes.

  3. Call GetItemByIndex to get each attribute by index.

  4. Call to unlock the attribute store.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970331 HRESULT IMFAttributes::GetItemByIndex([In] unsigned int unIndex,[Out] GUID* pguidKey,[InOut, Optional] PROPVARIANT* pValue) IMFAttributes::GetItemByIndex
Gets an item value GUID of the key. The value associated to this key. ms704598 HRESULT IMFAttributes::GetItem([In] const GUID& guidKey,[In] void* pValue) IMFAttributes::GetItem Gets an item value GUID of the key. The value associated to this key. ms704598 HRESULT IMFAttributes::GetItem([In] const GUID& guidKey,[In] void* pValue) IMFAttributes::GetItem

Applies to: desktop apps | Metro style apps

Adds an attribute value with a specified key.

A that identifies the value to set. If this key already exists, the method overwrites the old value.

A that contains the attribute value. The method copies the value. The type must be one of the types listed in the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_OUTOFMEMORY

Insufficient memory.

MF_E_INVALIDTYPE

Invalid attribute type.

?

This method checks whether the type is one of the attribute types defined in , and fails if an unsupported type is used. However, this method does not check whether the is the correct type for the specified attribute . (There is no programmatic way to associate attribute GUIDs with property types.) For a list of Media Foundation attributes and their data types, see Media Foundation Attributes.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970346 HRESULT IMFAttributes::SetItem([In] const GUID& guidKey,[In] const PROPVARIANT& Value) IMFAttributes::SetItem

Applies to: desktop apps | Metro style apps

Adds an attribute value with a specified key.

A that identifies the value to set. If this key already exists, the method overwrites the old value.

A that contains the attribute value. The method copies the value. The type must be one of the types listed in the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_OUTOFMEMORY

Insufficient memory.

MF_E_INVALIDTYPE

Invalid attribute type.

?

This method checks whether the type is one of the attribute types defined in , and fails if an unsupported type is used. However, this method does not check whether the is the correct type for the specified attribute . (There is no programmatic way to associate attribute GUIDs with property types.) For a list of Media Foundation attributes and their data types, see Media Foundation Attributes.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970346 HRESULT IMFAttributes::SetItem([In] const GUID& guidKey,[In] const PROPVARIANT& Value) IMFAttributes::SetItem

Retrieves the number of attributes that are set on this object.

To enumerate all of the attributes, call for each index value.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970413 GetCount GetCount HRESULT IMFAttributes::GetCount([Out] unsigned int* pcItems)
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Creates the object associated with this activation object.

Interface identifier (IID) of the requested interface.

Receives a reference to the requested interface. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

Some Microsoft Media Foundation objects must be shut down before being released. If so, the caller is responsible for shutting down the object that is returned in ppv. To shut down the object, do one of the following:

  • Call on the activation object, or
  • Call the object-specific shutdown method. This method will depend on the type of object. Possibilities include:
    • Media sources: Call .
    • Media sinks: Call .
    • Any object that supports the interface: Call .

The method is generic to all object types. If the object does not require a shutdown method, ShutdownObject succeeds and has no effect. If you do not know the specific shutdown method for the object (or do not know the object type), call .

After the first call to ActivateObject, subsequent calls return a reference to the same instance, until the client calls either ShutdownObject or .

ms694292 HRESULT IMFActivate::ActivateObject([In] const GUID& riid,[Out] void** ppv) IMFActivate::ActivateObject

Shuts down the created object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If you create an object by calling , call ShutdownObject when you are done using the object.

The component that calls ActivateObject?not the component that creates the activation object?is responsible for calling ShutdownObject. For example, in a typical playback application, the application creates activation objects for the media sinks, but the Media Session calls ActivateObject. Therefore the Media Session, not the application, calls ShutdownObject.

After ShutdownObject is called, the activation object releases all of its internal references to the created object. If you call ActivateObject again, the activation object will create a new instance of the other object.

ms695228 HRESULT IMFActivate::ShutdownObject() IMFActivate::ShutdownObject

Detaches the created object from the activation object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

Not implemented.

?

The activation object releases all of its internal references to the created object. If you call ActivateObject again, the activation object will create a new instance of the other object.

The DetachObject method does not shut down the created object. If the DetachObject method succeeds, the client must shut down the created object. This rule applies only to objects that have a shutdown method or that support the interface. See the remarks for .

Implementation of this method is optional. If the activation object does not support this method, the method returns E_NOTIMPL.

aa367342 HRESULT IMFActivate::DetachObject() IMFActivate::DetachObject

Provides methods to work with the header section of files conforming to the Advanced Systems Format (ASF) specification.

The ASF ContentInfo Object exposes this interface. To create the get a reference to the interface, call .

ms701620 IMFASFContentInfo IMFASFContentInfo
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the size of the header section of an Advanced Systems Format (ASF) file.

The interface of a buffer object containing the beginning of ASF content. The size of the valid data in the buffer must be at least MFASF_MIN_HEADER_BYTES in bytes.

Receives the size, in bytes, of the header section of the content. The value includes the size of the ASF Header Object plus the size of the header section of the Data Object. Therefore, the resulting value is the offset to the start of the data packets in the ASF Data Object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The buffer does not contain valid ASF data.

The buffer does not contain enough valid data.

?

The header of an ASF file or stream can be passed to the method to populate the ContentInfo object with the header information.

ms703043 HRESULT IMFASFContentInfo::GetHeaderSize([In] IMFMediaBuffer* pIStartOfContent,[In] unsigned longlong* cbHeaderSize) IMFASFContentInfo::GetHeaderSize

Parses the information in an ASF header and uses that information to set values in the ContentInfo object. You can pass the entire header in a single buffer or send it in several pieces.

Pointer to the interface of a buffer object containing some or all of the header. The buffer must contain at least 30 bytes, which is the size of the Header Object, not including the objects contained in the Header Object (that is, everything up to and including the Reserved2 field in the Header Object).

Offset, in bytes, of the first byte in the buffer relative to the beginning of the header.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The header is completely parsed and validated.

The input buffer does not contain valid ASF data.

The input buffer is to small.

MF_S_ASF_PARSEINPROGRESS

The method succeeded, but the header passed was incomplete. This is the successful return code for all calls but the last one when passing the header in pieces.

?

If you pass the header in pieces, the ContentInfo object will keep references to the buffer objects until the entire header is parsed. Therefore, do not write over the buffers passed into this method.

The start of the Header object has the following layout in memory:

Field NameSize in bytes
Object ID16
Object Size8
Number of Header Objects4
Reserved11
Reserved21

?

The first call to ParseHeader reads everything up to and including Rerserved2, so it requires a minimum of 30 bytes. (Note that the method reads only the Object ID and Object Size fields, so that method requires a minimum of 24 bytes.)

ms694306 HRESULT IMFASFContentInfo::ParseHeader([In] IMFMediaBuffer* pIHeaderBuffer,[In] unsigned longlong cbOffsetWithinHeader) IMFASFContentInfo::ParseHeader

Encodes the data in the MFASFContentInfo object into a binary Advanced Systems Format (ASF) header.

A reference to the interface of the buffer object that will receive the encoded header. Set to null to retrieve the size of the header.

Size of the encoded ASF header in bytes. If pIHeader is null, this value is set to the buffer size required to hold the encoded header.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The ASF Header Objects do not exist for the media that the ContentInfo object holds reference to.

The ASF Header Object size exceeds 10 MB.

The buffer passed in pIHeader is not large enough to hold the ASF Header Object information.

?

The size received in the pcbHeader parameter includes the padding size. The content information shrinks or expands the padding data depending on the size of the ASF Header Objects.

During this call, the stream properties are set based on the encoding properties of the profile. These properties are available through the interface.

ms701575 HRESULT IMFASFContentInfo::GenerateHeader([In] IMFMediaBuffer* pIHeader,[In] unsigned int* pcbHeader) IMFASFContentInfo::GenerateHeader

Retrieves an Advanced Systems Format (ASF) profile that describes the ASF content.

Receives an interface reference. The caller must release the interface. If the object does not have an ASF profile, this parameter receives the value null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The profile is set by calling either or .

The ASF profile object returned by this method does not include any of the MF_PD_ASF_xxx attributes (see Presentation Descriptor Attributes). To get these attributes, do the following:

  1. Call to get the ASF presentation descriptor. You can query the presentation descriptor for the MF_PD_ASF_xxx attributes.

  2. (Optional.) Call to convert the presentation descriptor into an ASF profile. The profile object created by this function contains the MF_PD_ASF_xxx attributes.

An ASF profile is a template for file encoding, and is intended mainly for creating ASF content. If you are reading an existing ASF file, it is recommended that you use the presentation descriptor to get information about the file. One exception is that the profile contains the mutual exclusion and stream prioritization objects, which are not exposed directly from the presentation descriptor.

ms698931 HRESULT IMFASFContentInfo::GetProfile([In] IMFASFProfile** ppIProfile) IMFASFContentInfo::GetProfile

Uses profile data from a profile object to configure settings in the ContentInfo object.

The interface of the profile object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If there is already information in the ContentInfo object when this method is called, it is replaced by the information from the profile object.

ms699846 HRESULT IMFASFContentInfo::SetProfile([In] IMFASFProfile* pIProfile) IMFASFContentInfo::SetProfile

Creates a presentation descriptor for ASF content.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms704860 HRESULT IMFASFContentInfo::GeneratePresentationDescriptor([In] IMFPresentationDescriptor** ppIPresentationDescriptor) IMFASFContentInfo::GeneratePresentationDescriptor

Retrieves a property store that can be used to set encoding properties.

Stream number to configure. Set to zero to configure file-level encoding properties.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms704750 HRESULT IMFASFContentInfo::GetEncodingConfigurationPropertyStore([In] unsigned short wStreamNumber,[In] IPropertyStore** ppIStore) IMFASFContentInfo::GetEncodingConfigurationPropertyStore

Retrieves an Advanced Systems Format (ASF) profile that describes the ASF content.

The profile is set by calling either or .

The ASF profile object returned by this method does not include any of the MF_PD_ASF_xxx attributes (see Presentation Descriptor Attributes). To get these attributes, do the following:

  1. Call to get the ASF presentation descriptor. You can query the presentation descriptor for the MF_PD_ASF_xxx attributes.

  2. (Optional.) Call to convert the presentation descriptor into an ASF profile. The profile object created by this function contains the MF_PD_ASF_xxx attributes.

An ASF profile is a template for file encoding, and is intended mainly for creating ASF content. If you are reading an existing ASF file, it is recommended that you use the presentation descriptor to get information about the file. One exception is that the profile contains the mutual exclusion and stream prioritization objects, which are not exposed directly from the presentation descriptor.

ms698931 GetProfile / SetProfile GetProfile HRESULT IMFASFContentInfo::GetProfile([In] IMFASFProfile** ppIProfile)

Retrieves the index settings for a specified stream and index type.

To read an existing ASF index, call before calling this method.

If an index exists for the stream and the value passed into pcbIndexDescriptor is smaller than the required size of the pbIndexDescriptor buffer, the method returns . The required buffer size is returned in the pcbIndexDescriptor parameter.

If there is no index for the specified stream, the method returns in the pfIsIndexed parameter.

ms704012 IMFASFIndexer IMFASFIndexer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets indexer options.

Bitwise OR of zero or more flags from the MFASF_INDEXER_FLAGS enumeration specifying the indexer options to use.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The indexer object was initialized before setting flags for it. For more information, see Remarks.

?

must be called before . Attempting to call SetFlags after Initialize will return as a result.

ms699840 HRESULT IMFASFIndexer::SetFlags([In] unsigned int dwFlags) IMFASFIndexer::SetFlags

Retrieves the flags that indicate the selected indexer options.

Receives a bitwise OR of zero or more flags from the MFASF_INDEXER_FLAGS enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

pdwFlags is null.

?

You must call this method before initializing the indexer object with .

ms701578 HRESULT IMFASFIndexer::GetFlags([In] unsigned int* pdwFlags) IMFASFIndexer::GetFlags

Initializes the indexer object. This method reads information in a ContentInfo object about the configuration of the content and the properties of the existing index, if present. Use this method before using the indexer for either writing or reading an index. You must make this call before using any of the other methods of the interface.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid ASF data.

Unexpected error.

?

The indexer needs to examine the data in the ContentInfo object to properly write or read the index for the content. The indexer will not make changes to the content information and will not hold any references to the interface.

In the ASF header, the maximum data-packet size must equal the minimum data-packet size. Otherwise, the method returns .

ms703030 HRESULT IMFASFIndexer::Initialize([In] IMFASFContentInfo* pIContentInfo) IMFASFIndexer::Initialize

Retrieves the offset of the index object from the start of the content.

Pointer to the interface of the ContentInfo object that describes the content.

Receives the offset of the index relative to the beginning of the content described by the ContentInfo object. This is the position relative to the beginning of the ASF file.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

pIContentInfo is null or pcbIndexOffset is null

?

The index continues from the offset retrieved by this method to the end of the file.

You must call to set up the indexer before calling this method.

If the index is retrieved by using more than one call to , the position of individual index portions is equal to the index offset plus the offset of the portion within the index.

ms699858 HRESULT IMFASFIndexer::GetIndexPosition([In] IMFASFContentInfo* pIContentInfo,[In] unsigned longlong* pcbIndexOffset) IMFASFIndexer::GetIndexPosition

Adds byte streams to be indexed.

An array of interface references. To get the byte stream, call .

The number of references in the ppIByteStreams array.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The indexer object has already been initialized and it has packets which have been indexed.

?

For a reading scenario, only one byte stream should be used by the indexer object. For an index generating scenario, it depends how many index objects are needed to be generated.

ms704843 HRESULT IMFASFIndexer::SetIndexByteStreams([In] IMFByteStream** ppIByteStreams,[In] unsigned int cByteStreams) IMFASFIndexer::SetIndexByteStreams

Retrieves the number of byte streams that are in use by the indexer object.

Receives the number of byte streams that are in use by the indexer object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

pcByteStreams is null.

?

ms701789 HRESULT IMFASFIndexer::GetIndexByteStreamCount([In] unsigned int* pcByteStreams) IMFASFIndexer::GetIndexByteStreamCount

Retrieves the index settings for a specified stream and index type.

Pointer to an structure that contains the stream number and index type for which to get the status.

A variable that retrieves a Boolean value specifying whether the index described by pIndexIdentifier has been created.

A buffer that receives the index descriptor. The index descriptor consists of an structure, optionally followed by index-specific data.

On input, specifies the size, in bytes, of the buffer that pbIndexDescriptor points to. The value can be zero if pbIndexDescriptor is null. On output, receives the size of the index descriptor, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The buffer size specified in pcbIndexDescriptor is too small.

?

To read an existing ASF index, call before calling this method.

If an index exists for the stream and the value passed into pcbIndexDescriptor is smaller than the required size of the pbIndexDescriptor buffer, the method returns . The required buffer size is returned in the pcbIndexDescriptor parameter.

If there is no index for the specified stream, the method returns in the pfIsIndexed parameter.

ms704012 HRESULT IMFASFIndexer::GetIndexStatus([In] ASF_INDEX_IDENTIFIER* pIndexIdentifier,[In] BOOL* pfIsIndexed,[In] unsigned char* pbIndexDescriptor,[In] unsigned int* pcbIndexDescriptor) IMFASFIndexer::GetIndexStatus

Configures the index for a stream.

The index descriptor to set. The index descriptor is an structure, optionally followed by index-specific data.

The size, in bytes, of the index descriptor.

A Boolean value. Set to TRUE to have the indexer create an index of the type specified for the stream specified in the index descriptor.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

At attempt was made to change the index status in a seek-only scenario. For more information, see Remarks.

?

You must make all calls to SetIndexStatus before making any calls to .

The indexer object is configured to create temporal indexes for each stream by default. Call this method only if you want to override the default settings.

You cannot use this method in an index reading scenario. You can only use this method when writing indexes.

ms702981 HRESULT IMFASFIndexer::SetIndexStatus([In] unsigned char* pbIndexDescriptor,[In] unsigned int cbIndexDescriptor,[In] BOOL fGenerateIndex) IMFASFIndexer::SetIndexStatus

Given a desired seek time, gets the offset from which the client should start reading data.

The value of the index entry for which to get the position. The format of this value varies depending on the type of index, which is specified in the index identifier. For time-based indexing, the variant type is VT_I8 and the value is the desired seek time, in 100-nanosecond units.

Pointer to an structure that identifies the stream number and index type.

Receives the offset within the data segment of the ASF Data Object. The offset is in bytes, and is relative to the start of packet 0. The offset gives the starting location from which the client should begin reading from the stream. This location might not correspond exactly to the requested seek time.

For reverse playback, if no key frame exists after the desired seek position, this parameter receives the value MFASFINDEXER_READ_FOR_REVERSEPLAYBACK_OUTOFDATASEGMENT. In that case, the seek position should be 1 byte pass the end of the data segment.

Receives the approximate time stamp of the data that is located at the offset returned in the pcbOffsetWithinData parameter. The accuracy of this value is equal to the indexing interval of the ASF index, typically about 1 second.

  • If the index type specified in pIndexIdentifier is GUID_NULL (time indexing), this parameter can be null.
  • For all other index types, this parameter must be null.

If the approximate time stamp cannot be determined, this parameter receives the value MFASFINDEXER_APPROX_SEEK_TIME_UNKNOWN.

Receives the payload number of the payload that contains the information for the specified stream. Packets can contain multiple payloads, each containing data for a different stream. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The requested seek time is out of range.

No index exists of the specified type for the specified stream.

?

ms703125 HRESULT IMFASFIndexer::GetSeekPositionForValue([In] const PROPVARIANT* pvarValue,[In] ASF_INDEX_IDENTIFIER* pIndexIdentifier,[In] unsigned longlong* pcbOffsetWithinData,[In] longlong* phnsApproxTime,[In] unsigned int* pdwPayloadNumberOfStreamWithinPacket) IMFASFIndexer::GetSeekPositionForValue

Accepts an ASF packet for the file and creates index entries for them.

Pointer to the interface of a media sample that contains the ASF packet.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The argument passed in is null.

The indexer is not initialized.

?

The ASF indexer creates indexes for a file internally. You can get the completed index for all data packets sent to the indexer by committing the index with and then calling to write the index entries into a media buffer. To determine the size of the index so you can allocate a buffer large enough to hold the index, call .

When this method creates index entries, they are immediately available for use by .

The media sample specified in pIASFPacketSample must hold a buffer that contains a single ASF packet. Get the sample from the ASF multiplexer by calling the method.

You cannot use this method while reading an index, only when writing an index.

ms705660 HRESULT IMFASFIndexer::GenerateIndexEntries([In] IMFSample* pIASFPacketSample) IMFASFIndexer::GenerateIndexEntries

Adds information about a new index to the ContentInfo object associated with ASF content. You must call this method before copying the index to the content so that the index will be readable by the indexer later.

Pointer to the interface of the ContentInfo object that describes the content.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The caller made an invalid request. For more information, see Remarks.

?

For the index to function properly, you must call this method after all ASF packets in the file have been passed to the indexer by using the method. After you call this method, you must retrieve the indexes by calling GetCompletedIndex and write them to the appropriate location in the file. Finally, you must generate a new ASF header by calling the method of the ASF ContentInfo object.

An application must use the CommitIndex method only when writing a new index otherwise CommitIndex may return as a result. For example, is returned if the application has flags other than set on the indexer object. CommitIndex can also return if the index entries have already been committed through an earlier CommitIndex call.

You cannot use this method in an index reading scenario. You can only use this method when writing indexes.

ms696994 HRESULT IMFASFIndexer::CommitIndex([In] IMFASFContentInfo* pIContentInfo) IMFASFIndexer::CommitIndex

Retrieves the size, in bytes, of the buffer required to store the completed index.

Receives the size of the index, in bytes

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The index has not been committed. For more information; see Remarks.

?

Use this method to get the size of the index and then allocate a buffer big enough to hold it.

The index must be committed with a call to before calling . If the index is not committed before GetIndexWriteSpace is called, then will be returned as a result.

Call to write the completed index into a media buffer.

You cannot use this method in a reading scenario. You can only use this method when writing indexes.

ms700198 HRESULT IMFASFIndexer::GetIndexWriteSpace([In] unsigned longlong* pcbIndexWriteSpace) IMFASFIndexer::GetIndexWriteSpace

Retrieves the completed index from the ASF indexer object.

Pointer to the interface of a media buffer that receives the index data.

The offset of the data to be retrieved, in bytes from the start of the index data. Set to 0 for the first call. If subsequent calls are needed (the buffer is not large enough to hold the entire index), set to the byte following the last one retrieved.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The index was not committed before attempting to get the completed index. For more information, see Remarks.

?

This method uses as much of the buffer as possible, and updates the length of the buffer appropriately.

If pIIndexBuffer is large enough to contain the entire buffer, cbOffsetWithinIndex should be 0, and the call needs to be made only once. Otherwise, there should be no gaps between successive buffers.

The user must write this data to the content at cbOffsetFromIndexStart bytes after the end of the ASF data object. You can call to determine the start position of the ASF index.

This call will not succeed unless has been called. After calling GetCompletedIndex, the caller must call and overwrite the existing ASF header with the new header; otherwise, the ASF header will not match the content, and the file is not guaranteed to play correctly.

You cannot use this method in an index reading scenario. You can only use this method when writing indexes.

ms702077 HRESULT IMFASFIndexer::GetCompletedIndex([In] IMFMediaBuffer* pIIndexBuffer,[In] unsigned longlong cbOffsetWithinIndex) IMFASFIndexer::GetCompletedIndex

Retrieves the next output ASF packet from the multiplexer.

The client needs to call this method, ideally after every call to , to get the output ASF packets. Call this method in a loop as long as the flag is received.

If no packets are ready, the method returns but does not return a sample in ppIPacket.

ms696243 IMFASFMultiplexer IMFASFMultiplexer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Initializes the multiplexer with the data from an ASF ContentInfo object.

Pointer to the interface of the MFASFContentInfo object that contains the header information of the new ASF file. The multiplexer will generate data packets for this file.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This call must be made once at the beginning of encoding, with pIContentInfo pointing to the ASF ContentInfo object that describes the content to be encoded. This enables the ASF multiplexer to see, among other things, which streams will be present in the encoding session. This call typically does not affect the data in the ASF ContentInfo object.

ms697469 HRESULT IMFASFMultiplexer::Initialize([In] IMFASFContentInfo* pIContentInfo) IMFASFMultiplexer::Initialize

Sets multiplexer options.

Bitwise OR of zero or more members of the enumeration. These flags specify which multiplexer options to use. For more information, see "Multiplexer Initialization and Leaky Bucket Settings" in Creating the Multiplexer Object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms703986 HRESULT IMFASFMultiplexer::SetFlags([In] unsigned int dwFlags) IMFASFMultiplexer::SetFlags

Retrieves flags indicating the configured multiplexer options.

Receives a bitwise OR of zero or more values from the enumeration. To set these flags, call .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms702166 HRESULT IMFASFMultiplexer::GetFlags([In] unsigned int* pdwFlags) IMFASFMultiplexer::GetFlags

Delivers input samples to the multiplexer.

The stream number of the stream to which the sample belongs.

Pointer to the interface of the input sample. The input sample contains the media data to be converted to ASF data packets. When possible, the time stamp of this sample should be accurate.

The adjustment to apply to the time stamp of the sample. This parameter is used if the caller wants to shift the sample time on pISample. This value should be positive if the time stamp should be pushed ahead and negative if the time stamp should be pushed back. This time stamp is added to sample time on pISample, and the resulting time is used by the multiplexer instead of the original sample time. If no adjustment is needed, set this value to 0.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

There are too many packets waiting to be retrieved from the multiplexer. Call to get the packets.

The sample that was processed violates the bandwidth limitations specified for the stream in the ASF ContentInfo object. When this error is generated, the sample is dropped.

The value passed in wStreamNumber is invalid.

The presentation time of the input media sample is earlier than the send time.

?

The application passes samples to ProcessSample, and the ASF multiplexer queues them internally until they are ready to be placed into ASF packets. Call to get the ASF data packet.

After each call to ProcessSample, call GetNextPacket in a loop to get all of the available data packets. For a code example, see Generating New ASF Data Packets.

ms696206 HRESULT IMFASFMultiplexer::ProcessSample([In] unsigned short wStreamNumber,[In] IMFSample* pISample,[In] longlong hnsTimestampAdjust) IMFASFMultiplexer::ProcessSample

Retrieves the next output ASF packet from the multiplexer.

Receives zero or more status flags. If more than one packet is waiting, the method sets the flag.

Receives a reference to the interface of the first output sample of the data packet. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The client needs to call this method, ideally after every call to , to get the output ASF packets. Call this method in a loop as long as the flag is received.

If no packets are ready, the method returns but does not return a sample in ppIPacket.

ms696243 HRESULT IMFASFMultiplexer::GetNextPacket([Out] ASF_STATUSFLAGS* pdwStatusFlags,[In] IMFSample** ppIPacket) IMFASFMultiplexer::GetNextPacket

Signals the multiplexer to process all queued output media samples. Call this method after passing the last sample to the multiplexer.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You must call Flush after the last sample has been passed into the ASF multiplexer and before you call . This causes all output media samples in progress to be completed. After calling Flush, call in a loop until all the pending media samples have been packetized.

ms696991 HRESULT IMFASFMultiplexer::Flush() IMFASFMultiplexer::Flush

Collects data from the multiplexer and updates the ASF ContentInfo object to include that information in the ASF Header Object.

Pointer to the interface of the ContentInfo object. This must be the same object that was used to initialize the multiplexer. The ContentInfo object represents the ASF Header Object of the file for which the multiplexer generated data packets.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

There are pending output media samples waiting in the multiplexer. Call to force the media samples to be packetized.

?

For non-live encoding scenarios (such as encoding to a file), the user should call End to update the specified ContentInfo object, adding data that the multiplexer has collected during the packet generation process. The user should then call and write the output header at the beginning of the ASF file (overwriting the header obtained at the beginning of the encoding session). For more information, see Writing an ASF Header Object for a New File.

During live encoding, it is usually not possible to rewrite the header, so this call is not required for live encoding. (The header in those cases will simply lack some of the information that was not available until the end of the encoding session.)

ms696172 HRESULT IMFASFMultiplexer::End([In] IMFASFContentInfo* pIContentInfo) IMFASFMultiplexer::End

Retrieves multiplexer statistics.

The stream number for which to obtain statistics.

Pointer to an structure that receives the statistics.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697232 HRESULT IMFASFMultiplexer::GetStatistics([In] unsigned short wStreamNumber,[In] ASF_MUX_STATISTICS* pMuxStats) IMFASFMultiplexer::GetStatistics

Sets the maximum time by which samples from various streams can be out of synchronization. The multiplexer will not accept a sample with a time stamp that is out of synchronization with the latest samples from any other stream by an amount that exceeds the synchronization tolerance.

Synchronization tolerance in milliseconds.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The synchronization tolerance is the maximum difference in presentation times at any given point between samples of different streams that the ASF multiplexer can accommodate. That is, if the synchronization tolerance is 3 seconds, no stream can be more than 3 seconds behind any other stream in the time stamps passed to the multiplexer. The multiplexer determines a default synchronization tolerance to use, but this method overrides it (usually to increase it). More tolerance means the potential for greater latency in the multiplexer. If the time stamps are synchronized among the streams, actual latency will be much lower than msSyncTolerance.

ms697206 HRESULT IMFASFMultiplexer::SetSyncTolerance([In] unsigned int msSyncTolerance) IMFASFMultiplexer::SetSyncTolerance

Sets the maximum time by which samples from various streams can be out of synchronization. The multiplexer will not accept a sample with a time stamp that is out of synchronization with the latest samples from any other stream by an amount that exceeds the synchronization tolerance.

The synchronization tolerance is the maximum difference in presentation times at any given point between samples of different streams that the ASF multiplexer can accommodate. That is, if the synchronization tolerance is 3 seconds, no stream can be more than 3 seconds behind any other stream in the time stamps passed to the multiplexer. The multiplexer determines a default synchronization tolerance to use, but this method overrides it (usually to increase it). More tolerance means the potential for greater latency in the multiplexer. If the time stamps are synchronized among the streams, actual latency will be much lower than msSyncTolerance.

ms697206 SetSyncTolerance SetSyncTolerance HRESULT IMFASFMultiplexer::SetSyncTolerance([In] unsigned int msSyncTolerance)

Configures an Advanced Systems Format (ASF) mutual exclusion object, which manages information about a group of streams in an ASF profile that are mutually exclusive. When streams or groups of streams are mutually exclusive, only one of them is read at a time, they are not read concurrently.

A common example of mutual exclusion is a set of streams that each include the same content encoded at a different bit rate. The stream that is used is determined by the available bandwidth to the reader.

An interface exists for every ASF mutual exclusion object. A reference to this interface is obtained when you create the object using the method.

An ASF profile object can support multiple mutual exclusions. Each must be configured using a separate ASF mutual exclusion object.

ms701603 IMFASFMutualExclusion IMFASFMutualExclusion
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the type of mutual exclusion represented by the Advanced Systems Format (ASF) mutual exclusion object.

A variable that receives the type identifier. For a list of predefined mutual exclusion type constants, see ASF Mutual Exclusion Type GUIDs.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Sometimes, content must be made mutually exclusive in more than one way. For example, a video file might contain audio streams of several bit rates for each of several languages. To handle this type of complex mutual exclusion, you must configure more than one ASF mutual exclusion object. For more information, see .

ms703095 HRESULT IMFASFMutualExclusion::GetType([In] GUID* pguidType) IMFASFMutualExclusion::GetType

Sets the type of mutual exclusion that is represented by the Advanced Systems Format (ASF) mutual exclusion object.

The type of mutual exclusion that is represented by the ASF mutual exclusion object. For a list of predefined mutual exclusion type constants, see ASF Mutual Exclusion Type GUIDs.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Sometimes, content must be made mutually exclusive in more than one way. For example, a video file might contain audio streams in several bit rates for each of several languages. To handle this type of complex mutual exclusion, you must configure more than one ASF mutual exclusion object. For more information, see .

ms697261 HRESULT IMFASFMutualExclusion::SetType([In] const GUID& guidType) IMFASFMutualExclusion::SetType

Retrieves the number of records in the Advanced Systems Format mutual exclusion object.

Receives the count of records.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Each record includes one or more streams. Every stream in a record is mutually exclusive of streams in every other record.

Use this method in conjunction with to retrieve the streams that are included in each record.

ms700201 HRESULT IMFASFMutualExclusion::GetRecordCount([In] unsigned int* pdwRecordCount) IMFASFMutualExclusion::GetRecordCount

Retrieves the stream numbers contained in a record in the Advanced Systems Format mutual exclusion object.

The number of the record for which to retrieve the stream numbers.

An array that receives the stream numbers. Set to null to get the number of elements required, which is indicated by the value of pcStreams on return. If this parameter is not null, the method will copy as many stream numbers to the array as there are elements indicated by the value of pcStreams.

On input, the number of elements in the array referenced by pwStreamNumArray. On output, the method sets this value to the count of stream numbers in the record. You can call GetStreamsForRecord with pwStreamNumArray set to null to retrieve the number of elements required to hold all of the stream numbers.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms703200 HRESULT IMFASFMutualExclusion::GetStreamsForRecord([In] unsigned int dwRecordNumber,[In] unsigned short* pwStreamNumArray,[In] unsigned int* pcStreams) IMFASFMutualExclusion::GetStreamsForRecord

Adds a stream number to a record in the Advanced Systems Format mutual exclusion object.

The record number to which the stream is added. A record number is set by the method.

The stream number to add to the record.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The specified stream number is already associated with the record.

?

Each record includes one or more streams. Every stream in a record is mutually exclusive of all streams in every other record.

ms703794 HRESULT IMFASFMutualExclusion::AddStreamForRecord([In] unsigned int dwRecordNumber,[In] unsigned short wStreamNumber) IMFASFMutualExclusion::AddStreamForRecord

Removes a stream number from a record in the Advanced Systems Format mutual exclusion object.

The record number from which to remove the stream number.

The stream number to remove from the record.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The stream number is not listed for the specified record.

?

ms703971 HRESULT IMFASFMutualExclusion::RemoveStreamFromRecord([In] unsigned int dwRecordNumber,[In] unsigned short wStreamNumber) IMFASFMutualExclusion::RemoveStreamFromRecord

Removes a record from the Advanced Systems Format (ASF) mutual exclusion object.

The index of the record to remove.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

When a record is removed, the ASF mutual exclusion object indexes the remaining records so that they are sequential starting with zero. You should enumerate the records to ensure that you have the correct index for each record. If the record removed is the one with the highest index, removing it has no effect on the other indexes.

ms704808 HRESULT IMFASFMutualExclusion::RemoveRecord([In] unsigned int dwRecordNumber) IMFASFMutualExclusion::RemoveRecord

Adds a record to the mutual exclusion object. A record specifies streams that are mutually exclusive with the streams in all other records.

Receives the index assigned to the new record. Record indexes are zero-based and sequential.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

A record can include one or more stream numbers. All of the streams in a record are mutually exclusive with all the streams in all other records in the ASF mutual exclusion object.

You can use records to create complex mutual exclusion scenarios by using multiple ASF mutual exclusion objects.

ms705615 HRESULT IMFASFMutualExclusion::AddRecord([In] unsigned int* pdwRecordNumber) IMFASFMutualExclusion::AddRecord

Creates a copy of the Advanced Systems Format mutual exclusion object.

Receives a reference to the interface of the new object. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The cloned object is a new object, completely independent of the object from which it was cloned.

ms696217 HRESULT IMFASFMutualExclusion::Clone([In] IMFASFMutualExclusion** ppIMutex) IMFASFMutualExclusion::Clone

Retrieves a stream from the profile by stream index, and/or retrieves the stream number for a stream index.

This method does not create a copy of the stream configuration object. The reference that is retrieved points to the object within the profile object. You must not make any changes to the stream configuration object using this reference, because doing so can affect the profile object in unexpected ways.

To change the configuration of the stream configuration object in the profile, you must first clone the stream configuration object by calling . Make whatever changes are required to the clone of the object and then add the updated object by calling the method.

ms700799 IMFASFProfile IMFASFProfile
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the number of streams in the profile.

Receives the number of streams in the profile.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms703024 HRESULT IMFASFProfile::GetStreamCount([In] unsigned int* pcStreams) IMFASFProfile::GetStreamCount

Retrieves a stream from the profile by stream index, and/or retrieves the stream number for a stream index.

The index of the stream to retrieve. Stream indexes are sequential and zero-based. You can get the number of streams that are in the profile by calling the method.

Receives the stream number of the requested stream. Stream numbers are one-based and are not necessarily sequential. This parameter can be set to null if the stream number is not required.

Receives a reference to the interface of the ASF stream configuration object. The caller must release the interface. This parameter can be null if you want to retrieve the stream number without accessing the stream configuration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method does not create a copy of the stream configuration object. The reference that is retrieved points to the object within the profile object. You must not make any changes to the stream configuration object using this reference, because doing so can affect the profile object in unexpected ways.

To change the configuration of the stream configuration object in the profile, you must first clone the stream configuration object by calling . Make whatever changes are required to the clone of the object and then add the updated object by calling the method.

ms700799 HRESULT IMFASFProfile::GetStream([In] unsigned int dwStreamIndex,[In] unsigned short* pwStreamNumber,[In] IMFASFStreamConfig** ppIStream) IMFASFProfile::GetStream

Retrieves an Advanced Systems Format (ASF) stream configuration object for a stream in the profile. This method references the stream by stream number instead of stream index.

The stream number for which to obtain the interface reference.

Receives a reference to the interface of the ASF stream configuration object. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method does not create a copy of the stream configuration object. The reference that is retrieved points to the object within the profile object. You must not make any changes to the stream configuration object using this reference, because doing so can affect the profile object in unexpected ways.

To change the configuration of the stream configuration object in the profile, you must first clone the stream configuration object by calling . Make whatever changes are required to the clone of the object and then add the updated object by calling the method.

ms694981 HRESULT IMFASFProfile::GetStreamByNumber([In] unsigned short wStreamNumber,[In] IMFASFStreamConfig** ppIStream) IMFASFProfile::GetStreamByNumber

Adds a stream to the profile or reconfigures an existing stream.

Pointer to the interface of a configured ASF stream configuration object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If the stream number in the ASF stream configuration object is already included in the profile, the information in the new object replaces the old one. If the profile does not contain a stream for the stream number, the ASF stream configuration object is added as a new stream.

ms703051 HRESULT IMFASFProfile::SetStream([In] IMFASFStreamConfig* pIStream) IMFASFProfile::SetStream

Removes a stream from the Advanced Systems Format (ASF) profile object.

Stream number of the stream to remove.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

After a stream is removed, the ASF profile object reassigns stream indexes so that the index values are sequential starting from zero. Any previously stored stream index numbers are no longer valid after deleting a stream.

ms704569 HRESULT IMFASFProfile::RemoveStream([In] unsigned short wStreamNumber) IMFASFProfile::RemoveStream

Creates an Advanced Systems Format (ASF) stream configuration object.

Pointer to the interface of a configured media type.

Receives a reference to the interface of the new ASF stream configuration object. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

ppIStream is null.

E_OUTOFMEMORY

stream configuration object could not be created due to insufficient memory.

?

The ASF stream configuration object created by this method is not included in the profile. To include the stream, you must first configure the stream configuration and then call .

ms696264 HRESULT IMFASFProfile::CreateStream([In] IMFMediaType* pIMediaType,[In] IMFASFStreamConfig** ppIStream) IMFASFProfile::CreateStream

Retrieves the number of Advanced Systems Format (ASF) mutual exclusion objects that are associated with the profile.

Receives the number of mutual exclusion objects.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Multiple mutual exclusion objects may be required for streams that are mutually exclusive in more than one way. For more information, see .

ms697361 HRESULT IMFASFProfile::GetMutualExclusionCount([In] unsigned int* pcMutexs) IMFASFProfile::GetMutualExclusionCount

Retrieves an Advanced Systems Format (ASF) mutual exclusion object from the profile.

Index of the mutual exclusion object in the profile.

Receives a reference to the interface of the ASF mutual exclusion object. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method does not create a copy of the mutual exclusion object. The returned reference refers to the mutual exclusion contained in the profile object. You must not make any changes to the mutual exclusion object using this reference, because doing so can affect the profile object in unexpected ways.

To change the configuration of the mutual exclusion object in the profile, you must first clone the mutual exclusion object by calling . Make whatever changes are required to the clone of the object, remove the old mutual exclusion object from the profile by calling the method, and then add the updated object by calling the method.

ms701598 HRESULT IMFASFProfile::GetMutualExclusion([In] unsigned int dwMutexIndex,[In] IMFASFMutualExclusion** ppIMutex) IMFASFProfile::GetMutualExclusion

Adds a configured Advanced Systems Format (ASF) mutual exclusion object to the profile.

Pointer to the interface of a configured ASF mutual exclusion object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You can create a mutual exclusion object by calling the method.

ms703965 HRESULT IMFASFProfile::AddMutualExclusion([In] IMFASFMutualExclusion* pIMutex) IMFASFProfile::AddMutualExclusion

Removes an Advanced Systems Format (ASF) mutual exclusion object from the profile.

The index of the mutual exclusion object to remove from the profile.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

When a mutual exclusion object is removed from the profile, the ASF profile object reassigns the mutual exclusion indexes so that they are sequential starting with zero. Any previously stored indexes are no longer valid after calling this method.

ms704007 HRESULT IMFASFProfile::RemoveMutualExclusion([In] unsigned int dwMutexIndex) IMFASFProfile::RemoveMutualExclusion

Creates a new Advanced Systems Format (ASF) mutual exclusion object. Mutual exclusion objects can be added to a profile by calling the AddMutualExclusion method.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The ASF mutual exclusion object created by this method is not associated with the profile. Call after configuring the object to make this association.

ms697002 HRESULT IMFASFProfile::CreateMutualExclusion([In] IMFASFMutualExclusion** ppIMutex) IMFASFProfile::CreateMutualExclusion

Note??This method is not supported.

Reserved.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms695410 HRESULT IMFASFProfile::GetStreamPrioritization([In] IMFASFStreamPrioritization** ppIStreamPrioritization) IMFASFProfile::GetStreamPrioritization

Note??This method is not supported.

Reserved.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms697516 HRESULT IMFASFProfile::AddStreamPrioritization([In] IMFASFStreamPrioritization* pIStreamPrioritization) IMFASFProfile::AddStreamPrioritization

Note??This method is not supported.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms701838 HRESULT IMFASFProfile::RemoveStreamPrioritization() IMFASFProfile::RemoveStreamPrioritization

Note??This method is not implemented.

Reserved.

Returns E_NOTIMPL.

ms694914 HRESULT IMFASFProfile::CreateStreamPrioritization([In] IMFASFStreamPrioritization** ppIStreamPrioritization) IMFASFProfile::CreateStreamPrioritization

Creates a copy of the Advanced Systems Format profile object.

Receives a reference to the interface of the new object. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

The cloned object is completely independent of the original.

ms704773 HRESULT IMFASFProfile::Clone([In] IMFASFProfile** ppIProfile) IMFASFProfile::Clone

Adds a stream to the profile or reconfigures an existing stream.

If the stream number in the ASF stream configuration object is already included in the profile, the information in the new object replaces the old one. If the profile does not contain a stream for the stream number, the ASF stream configuration object is added as a new stream.

ms703051 SetStream SetStream HRESULT IMFASFProfile::SetStream([In] IMFASFStreamConfig* pIStream)

Note??This method is not supported.

ms695410 GetStreamPrioritization GetStreamPrioritization HRESULT IMFASFProfile::GetStreamPrioritization([In] IMFASFStreamPrioritization** ppIStreamPrioritization)

Sends packetized Advanced Systems Format (ASF) data to the ASF splitter for processing.

After using this method to parse data, you must call to retrieve parsed media samples.

If your ASF data contains variable-sized packets, you must set the attribute on the buffers to indicate the sample boundaries, and the buffers cannot span multiple packets.

If the method returns ME_E_NOTACCEPTING, call GetNextSample to get the output samples, or call to clear the splitter.

The splitter might hold a reference count on the input buffer. Therefore, do not write over the valid data in the buffer after calling this method.

ms694299 IMFASFSplitter IMFASFSplitter
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Resets the Advanced Systems Format (ASF) splitter and configures it to parse data from an ASF data section.

Pointer to the interface of a ContentInfo object that describes the data to be parsed.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The pIContentInfo parameter is null.

?

ms704048 HRESULT IMFASFSplitter::Initialize([In] IMFASFContentInfo* pIContentInfo) IMFASFSplitter::Initialize

Sets option flags on the Advanced Systems Format (ASF) splitter.

A bitwise combination of zero or more members of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The splitter is not initialized.

E_INVALIDARG

The dwFlags parameter does not contain a valid flag.

The flag is set, but the content cannot be parsed in reverse.

?

This method can only be called after the splitter is initialized.

ms697337 HRESULT IMFASFSplitter::SetFlags([In] unsigned int dwFlags) IMFASFSplitter::SetFlags

Retrieves the option flags that are set on the ASF splitter.

Receives the option flags. This value is a bitwise OR of zero or more members of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

pdwFlags is null.

?

ms702288 HRESULT IMFASFSplitter::GetFlags([In] unsigned int* pdwFlags) IMFASFSplitter::GetFlags

Sets the streams to be parsed by the Advanced Systems Format (ASF) splitter.

An array of variables containing the list of stream numbers to select.

The number of valid elements in the stream number array.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

pwStreamNumbers is null and wNumStreams contains a value greater than zero.

Invalid stream number was passed in the array.

?

Calling this method supersedes any previous stream selections; only the streams specified in the pwStreamNumbers array will be selected.

By default, no streams are selected by the splitter.

You can obtain a list of the currently selected streams by calling the method.

ms701631 HRESULT IMFASFSplitter::SelectStreams([In] unsigned short* pwStreamNumbers,[In] unsigned short wNumStreams) IMFASFSplitter::SelectStreams

Gets a list of currently selected streams.

The address of an array of WORDs. This array receives the stream numbers of the selected streams. This parameter can be null.

On input, points to a variable that contains the number of elements in the pwStreamNumbers array. Set the variable to zero if pwStreamNumbers is null.

On output, receives the number of elements that were copied into pwStreamNumbers. Each element is the identifier of a selected stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

The pwStreamNumbers array is smaller than the number of selected streams. See Remarks.

?

To get the number of selected streams, set pwStreamNumbers to null. The method will return MF_E_BUFFERTOSMALL but will also set the value of *pwNumStreams equal to the number of selected streams. Then allocate an array of that size and call the method again, passing the array in the pwStreamNumbers parameter.

The following code shows these steps:

 DisplaySelectedStreams( *pSplitter)	
            { WORD count = 0;  hr = pSplitter->GetSelectedStreams(null, &count); if (hr == ) { WORD *pStreamIds = new (std::nothrow) WORD[count]; if (pStreamIds) { hr = pSplitter->GetSelectedStreams(pStreamIds, &count); if (SUCCEEDED(hr)) { for (WORD i = 0; i < count; i++) { printf("Selected stream ID: %d\n", pStreamIds[i]); } } delete [] pStreamIds; } else { hr = E_OUTOFMEMORY; } } return hr;	
            }	
            

Alternatively, you can allocate an array that is equal to the total number of streams and pass that to pwStreamNumbers.

Before calling this method, initialize *pwNumStreams to the number of elements in pwStreamNumbers. If pwStreamNumbers is null, set *pwNumStreams to zero.

By default, no streams are selected by the splitter. Select streams by calling the method.

ms705602 HRESULT IMFASFSplitter::GetSelectedStreams([In] unsigned short* pwStreamNumbers,[In] unsigned short* pwNumStreams) IMFASFSplitter::GetSelectedStreams

Sends packetized Advanced Systems Format (ASF) data to the ASF splitter for processing.

Pointer to the interface of a buffer object containing data to be parsed.

The offset into the data buffer where the splitter should begin parsing. This value is typically set to 0.

The length, in bytes, of the data to parse. This value is measured from the offset specified by cbBufferOffset. Set to 0 to process to the end of the buffer.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The pIBuffer parameter is null.

The specified offset value in cbBufferOffset is greater than the length of the buffer.

The total value of cbBufferOffset and cbLength is greater than the length of the buffer.

The method was not called or the call failed.

The splitter cannot process more input at this time.

?

After using this method to parse data, you must call to retrieve parsed media samples.

If your ASF data contains variable-sized packets, you must set the attribute on the buffers to indicate the sample boundaries, and the buffers cannot span multiple packets.

If the method returns ME_E_NOTACCEPTING, call GetNextSample to get the output samples, or call to clear the splitter.

The splitter might hold a reference count on the input buffer. Therefore, do not write over the valid data in the buffer after calling this method.

ms694299 HRESULT IMFASFSplitter::ParseData([In] IMFMediaBuffer* pIBuffer,[In] unsigned int cbBufferOffset,[In] unsigned int cbLength) IMFASFSplitter::ParseData

Retrieves a sample from the Advanced Systems Format (ASF) splitter after the data has been parsed.

Receives one of the following values.

ValueMeaning

More samples are ready to be retrieved. Call GetNextSample in a loop until the pdwStatusFlags parameter receives the value zero.

Zero

No additional samples are ready. Call to give more input data to the splitter.

?

If the method returns a sample in the ppISample parameter, this parameter receives the number of the stream to which the sample belongs.

Receives a reference to the interface of the parsed sample. The caller must release the interface. If no samples are ready, this parameter receives the value null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The ASF data in the buffer is invalid.

There is a gap in the ASF data.

?

Before calling this method, call to give input data to the splitter. If the input does not contain enough data for a complete sample, the GetNextSample method succeeds but returns null in the ppISample parameter.

The ASF splitter skips samples for unselected streams. To select streams, call .

ms700167 HRESULT IMFASFSplitter::GetNextSample([In] unsigned int* pdwStatusFlags,[In] unsigned short* pwStreamNumber,[In] IMFSample** ppISample) IMFASFSplitter::GetNextSample

Resets the Advanced Systems Format (ASF) splitter and releases all pending samples.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Any samples waiting to be retrieved when Flush is called are lost.

ms703013 HRESULT IMFASFSplitter::Flush() IMFASFSplitter::Flush

Retrieves the send time of the last sample received.

Receives the send time of the last sample received.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

pdwLastSendTime is null.

?

ms697272 HRESULT IMFASFSplitter::GetLastSendTime([In] unsigned int* pdwLastSendTime) IMFASFSplitter::GetLastSendTime

Retrieves information about an existing payload extension.

ms697305 IMFASFStreamConfig IMFASFStreamConfig
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the major media type of the stream.

Receives the major media type for the stream. For a list of possible values, see Major Media Types.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms697390 HRESULT IMFASFStreamConfig::GetStreamType([In] GUID* pguidStreamType) IMFASFStreamConfig::GetStreamType

Retrieves the stream number of the stream.

The method returns the stream number.

ms703172 unsigned short IMFASFStreamConfig::GetStreamNumber() IMFASFStreamConfig::GetStreamNumber

Assigns a stream number to the stream.

The number to assign to the stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Stream numbers start from 1 and do not need to be sequential.

ms697298 HRESULT IMFASFStreamConfig::SetStreamNumber([In] unsigned short wStreamNum) IMFASFStreamConfig::SetStreamNumber

Retrieves the media type of the stream.

Receives a reference to the interface of the media type object associated with the stream. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To reduce unnecessary copying, the method returns a reference to the media type that is stored internally by the object. Do not modify the returned media type, as the results are not defined.

ms697489 HRESULT IMFASFStreamConfig::GetMediaType([In] IMFMediaType** ppIMediaType) IMFASFStreamConfig::GetMediaType

Sets the media type for the Advanced Systems Format (ASF) stream configuration object.

Pointer to the interface of a configured media type object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Some validation of the media type is performed by this method. However, a media type can be successfully set, but cause an error when the stream is added to the profile.

ms697185 HRESULT IMFASFStreamConfig::SetMediaType([In] IMFMediaType* pIMediaType) IMFASFStreamConfig::SetMediaType

Retrieves the number of payload extensions that are configured for the stream.

Receives the number of payload extensions.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms696251 HRESULT IMFASFStreamConfig::GetPayloadExtensionCount([In] unsigned short* pcPayloadExtensions) IMFASFStreamConfig::GetPayloadExtensionCount

Retrieves information about an existing payload extension.

The payload extension index. Valid indexes range from 0, to one less than the number of extensions obtained by calling .

Receives a that identifies the payload extension. For a list of predefined payload extensions, see ASF Payload Extension GUIDs. Applications can also define custom payload extensions.

Receives the number of bytes added to each sample for the extension.

Pointer to a buffer that receives information about this extension system. This information is the same for all samples and is stored in the content header (not in each sample). This parameter can be null. To find the required size of the buffer, set this parameter to null; the size is returned in pcbExtensionSystemInfo.

On input, specifies the size of the buffer pointed to by pbExtensionSystemInfo. On output, receives the required size of the pbExtensionSystemInfo buffer in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

The buffer specified in pbExtensionSystemInfo is too small.

The wPayloadExtensionNumber parameter is out of range.

?

ms697305 HRESULT IMFASFStreamConfig::GetPayloadExtension([In] unsigned short wPayloadExtensionNumber,[In] GUID* pguidExtensionSystemID,[In] unsigned short* pcbExtensionDataSize,[In] unsigned char* pbExtensionSystemInfo,[In] unsigned int* pcbExtensionSystemInfo) IMFASFStreamConfig::GetPayloadExtension

Configures a payload extension for the stream.

Pointer to a that identifies the payload extension. For a list of predefined payload extensions, see ASF Payload Extension GUIDs. Applications can also define custom payload extensions.

Number of bytes added to each sample for the extension.

A reference to a buffer that contains information about this extension system. This information is the same for all samples and is stored in the content header (not with each sample). This parameter can be null if cbExtensionSystemInfo is 0.

Amount of data, in bytes, that describes this extension system. If this value is 0, then pbExtensionSystemInfo can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697229 HRESULT IMFASFStreamConfig::AddPayloadExtension([In] GUID guidExtensionSystemID,[In] unsigned short cbExtensionDataSize,[In] unsigned char* pbExtensionSystemInfo,[In] unsigned int cbExtensionSystemInfo) IMFASFStreamConfig::AddPayloadExtension

Removes all payload extensions that are configured for the stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

None.

ms699009 HRESULT IMFASFStreamConfig::RemoveAllPayloadExtensions() IMFASFStreamConfig::RemoveAllPayloadExtensions

Creates a copy of the Advanced Systems Format (ASF) stream configuration object.

Receives a reference to the interface of the new object. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The cloned object is completely independent of the original.

ms703117 HRESULT IMFASFStreamConfig::Clone([In] IMFASFStreamConfig** ppIStreamConfig) IMFASFStreamConfig::Clone

Retrieves the stream number of the stream.

ms703172 GetStreamNumber / SetStreamNumber GetStreamNumber unsigned short IMFASFStreamConfig::GetStreamNumber()

Retrieves the media type of the stream.

To reduce unnecessary copying, the method returns a reference to the media type that is stored internally by the object. Do not modify the returned media type, as the results are not defined.

ms697489 GetMediaType / SetMediaType GetMediaType HRESULT IMFASFStreamConfig::GetMediaType([In] IMFMediaType** ppIMediaType)

Note??This interface is not implemented.

Manages information about the relative priorities of a group of streams in an Advanced Systems Format (ASF) profile. This interface manages information about the relative priorities of a group of streams in an ASF profile. Priority is used in streaming to determine which streams should be dropped first when available bandwidth decreases.

The ASF stream prioritization object exposes this interface. The stream prioritization object maintains a list of stream numbers in priority order. The methods of this interface manipulate and interrogate that list. To obtain a reference to this interface, call the method.

ms698921 IMFASFStreamPrioritization IMFASFStreamPrioritization
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Note??This interface is not implemented in this version of Media Foundation.

Retrieves the number of entries in the stream priority list.

Receives the number of streams in the stream priority list.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970449 HRESULT IMFASFStreamPrioritization::GetStreamCount([In] unsigned int* pdwStreamCount) IMFASFStreamPrioritization::GetStreamCount

Note??This interface is not implemented in this version of Media Foundation.

Retrieves the stream number of a stream in the stream priority list.

Zero-based index of the entry to retrieve from the stream priority list. To get the number of entries in the priority list, call .

Receives the stream number of the stream priority entry.

Receives a Boolean value. If TRUE, the stream is mandatory.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

null reference argument or the dwStreamIndex parameter is out of range.

?

ms697005 HRESULT IMFASFStreamPrioritization::GetStream([In] unsigned int dwStreamIndex,[In] unsigned short* pwStreamNumber,[In] unsigned short* pwStreamFlags) IMFASFStreamPrioritization::GetStream

Note??This interface is not implemented in this version of Media Foundation.

Adds a stream to the stream priority list.

Stream number of the stream to add.

If TRUE, the stream is mandatory.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream number.

?

The stream priority list is built by appending entries to the list with each call to AddStream. The list is evaluated in descending order of importance. The most important stream should be added first, and the least important should be added last.

ms696987 HRESULT IMFASFStreamPrioritization::AddStream([In] unsigned short wStreamNumber,[In] unsigned short wStreamFlags) IMFASFStreamPrioritization::AddStream

Note??This interface is not implemented in this version of Media Foundation.

Removes a stream from the stream priority list.

Index of the entry in the stream priority list to remove. Values range from zero, to one less than the stream count retrieved by calling .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

When a stream is removed from the stream priority list, the index values of all streams that follow it in the list are decremented.

bb970482 HRESULT IMFASFStreamPrioritization::RemoveStream([In] unsigned int dwStreamIndex) IMFASFStreamPrioritization::RemoveStream

Note??This interface is not implemented in this version of Media Foundation.

Creates a copy of the ASF stream prioritization object.

Receives a reference to the interface of the new object. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The new object is completely independent of the original.

ms704679 HRESULT IMFASFStreamPrioritization::Clone([In] IMFASFStreamPrioritization** ppIStreamPrioritization) IMFASFStreamPrioritization::Clone

Sets the selection status of an output, overriding other selection criteria.

ms703122 IMFASFStreamSelector IMFASFStreamSelector
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the number of streams that are in the Advanced Systems Format (ASF) content.

Receives the number of streams in the content.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms704621 HRESULT IMFASFStreamSelector::GetStreamCount([In] unsigned int* pcStreams) IMFASFStreamSelector::GetStreamCount

Retrieves the number of outputs for the Advanced Systems Format (ASF) content.

Receives the number of outputs.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Outputs are streams in the ASF data section that will be parsed.

ms694076 HRESULT IMFASFStreamSelector::GetOutputCount([In] unsigned int* pcOutputs) IMFASFStreamSelector::GetOutputCount

Retrieves the number of streams associated with an output.

The output number for which to retrieve the stream count.

Receives the number of streams associated with the output.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid output number.

?

An output is a stream in an ASF data section that will be parsed. If mutual exclusion is used, mutually exclusive streams share the same output.

ms700815 HRESULT IMFASFStreamSelector::GetOutputStreamCount([In] unsigned int dwOutputNum,[In] unsigned int* pcStreams) IMFASFStreamSelector::GetOutputStreamCount

Retrieves the stream numbers for all of the streams that are associated with an output.

The output number for which to retrieve stream numbers.

Address of an array that receives the stream numbers associated with the output. The caller allocates the array. The array size must be at least as large as the value returned by the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid output number.

?

An output is a stream in an ASF data section that will be parsed. If mutual exclusion is used, mutually exclusive streams share the same output.

ms697025 HRESULT IMFASFStreamSelector::GetOutputStreamNumbers([In] unsigned int dwOutputNum,[In] unsigned short* rgwStreamNumbers) IMFASFStreamSelector::GetOutputStreamNumbers

Retrieves the output number associated with a stream.

The stream number for which to retrieve an output number.

Receives the output number.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream number.

?

Outputs are streams in the ASF data section that will be parsed.

ms701979 HRESULT IMFASFStreamSelector::GetOutputFromStream([In] unsigned short wStreamNum,[In] unsigned int* pdwOutput) IMFASFStreamSelector::GetOutputFromStream

Retrieves the manual output override selection that is set for a stream.

Stream number for which to retrieve the output override selection.

Receives the output override selection. The value is a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697510 HRESULT IMFASFStreamSelector::GetOutputOverride([In] unsigned int dwOutputNum,[In] ASF_SELECTION_STATUS* pSelection) IMFASFStreamSelector::GetOutputOverride

Sets the selection status of an output, overriding other selection criteria.

Output number for which to set selection.

Member of the enumeration specifying the level of selection for the output.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms703122 HRESULT IMFASFStreamSelector::SetOutputOverride([In] unsigned int dwOutputNum,[In] ASF_SELECTION_STATUS Selection) IMFASFStreamSelector::SetOutputOverride

Retrieves the number of mutual exclusion objects associated with an output.

Output number for which to retrieve the count of mutually exclusive relationships.

Receives the number of mutual exclusions.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms703918 HRESULT IMFASFStreamSelector::GetOutputMutexCount([In] unsigned int dwOutputNum,[In] unsigned int* pcMutexes) IMFASFStreamSelector::GetOutputMutexCount

Retrieves a mutual exclusion object for an output.

Output number for which to retrieve a mutual exclusion object.

Mutual exclusion number. This is an index of mutually exclusive relationships associated with the output. Set to a number between 0, and 1 less than the number of mutual exclusion objects retrieved by calling .

Receives a reference to the mutual exclusion object's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Outputs are streams in the ASF data section that will be parsed.

ms703819 HRESULT IMFASFStreamSelector::GetOutputMutex([In] unsigned int dwOutputNum,[In] unsigned int dwMutexNum,[In] IUnknown** ppMutex) IMFASFStreamSelector::GetOutputMutex

Selects a mutual exclusion record to use for a mutual exclusion object associated with an output.

The output number for which to set a stream.

Index of the mutual exclusion for which to select.

Record of the specified mutual exclusion to select.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

An output is a stream in an Advanced Systems Format (ASF) data section that will be parsed. If mutual exclusion is used, mutually exclusive streams share the same output.

An ASF file can contain multiple mutually exclusive relationships, such as a file with both language based and bit-rate based mutual exclusion. If an output is involved in multiple mutually exclusive relationships, a record from each must be selected.

ms704822 HRESULT IMFASFStreamSelector::SetOutputMutexSelection([In] unsigned int dwOutputNum,[In] unsigned int dwMutexNum,[In] unsigned short wSelectedRecord) IMFASFStreamSelector::SetOutputMutexSelection

Retrieves the number of bandwidth steps that exist for the content. This method is used for multiple bit rate (MBR) content.

Receives the number of bandwidth steps.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Bandwidth steps are bandwidth levels used for multiple bit rate (MBR) content. If you stream MBR content, you can choose the bandwidth step that matches the network conditions to avoid interruptions during playback.

ms698868 HRESULT IMFASFStreamSelector::GetBandwidthStepCount([In] unsigned int* pcStepCount) IMFASFStreamSelector::GetBandwidthStepCount

Retrieves the stream numbers that apply to a bandwidth step. This method is used for multiple bit rate (MBR) content.

Bandwidth step number for which to retrieve information. Set this value to a number between 0, and 1 less than the number of bandwidth steps returned by .

Receives the bit rate associated with the bandwidth step.

Address of an array that receives the stream numbers. The caller allocates the array. The array size must be at least as large as the value returned by the method.

Address of an array that receives the selection status of each stream, as an value. The members of this array correspond to the members of the rgwStreamNumbers array by index. The caller allocates the array. The array size must be at least as large as the value returned by the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Bandwidth steps are bandwidth levels used for MBR content. If you stream MBR content, you can choose the bandwidth step that matches the network conditions to avoid interruptions during playback.

ms700131 HRESULT IMFASFStreamSelector::GetBandwidthStep([In] unsigned int dwStepNum,[In] unsigned int* pdwBitrate,[In] unsigned short* rgwStreamNumbers,[In] ASF_SELECTION_STATUS* rgSelections) IMFASFStreamSelector::GetBandwidthStep

Retrieves the index of a bandwidth step that is appropriate for a specified bit rate. This method is used for multiple bit rate (MBR) content.

The bit rate to find a bandwidth step for.

Receives the step number. Use this number to retrieve information about the step by calling .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

In a streaming multiple bit rate (MBR) scenario, call this method with the current data rate of the network connection to determine the correct step to use. You can also call this method periodically throughout streaming to ensure that the best step is used.

ms704645 HRESULT IMFASFStreamSelector::BitrateToStepNumber([In] unsigned int dwBitrate,[In] unsigned int* pdwStepNum) IMFASFStreamSelector::BitrateToStepNumber

Sets options for the stream selector.

Bitwise OR of zero or more members of the MFASF_STREAMSELECTOR_FLAGS enumeration specifying the options to use.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms701635 HRESULT IMFASFStreamSelector::SetStreamSelectorFlags([In] unsigned int dwStreamSelectorFlags) IMFASFStreamSelector::SetStreamSelectorFlags

Sets options for the stream selector.

ms701635 SetStreamSelectorFlags SetStreamSelectorFlags HRESULT IMFASFStreamSelector::SetStreamSelectorFlags([In] unsigned int dwStreamSelectorFlags)

[This API is not supported and may be altered or unavailable in the future.]

Creates an audio media type from a structure.

The interface is deprecrated, so applications should avoid using this function. To create a media type from a structure, do the following:

  1. Call . This function returns a reference to the interface. The returned media type object is initially empty.
  2. Call to populate the media type from the structure.

Alternatively, you can call and then set the media type attributes directly.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
aa473812 IMFAudioMediaType IMFAudioMediaType

Represents a description of a media format.

To create a new media type, call .

All of the information in a media type is stored as attributes. To clone a media type, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704850 IMFMediaType IMFMediaType
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the major type of the format.

Receives the major type . The major type describes the broad category of the format, such as audio or video. For a list of possible values, see Major Media Types.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The major type is not set.

?

This method is equivalent to getting the attribute from the media type.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms701588 HRESULT IMFMediaType::GetMajorType([Out] GUID* pguidMajorType) IMFMediaType::GetMajorType

Queries whether the media type is a temporally compressed format. Temporal compression uses information from previously decoded samples when decompressing the current sample.

Receives a Boolean value. The value is TRUE if the format uses temporal compression, or if the format does not use temporal compression.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method returns in pfCompressed if the media type's attribute is TRUE. If the attribute is or not set, the method returns TRUE.

If the method returns TRUE in pfCompressed, it is a hint that the format has temporal compression applied to it. If the method returns , the format does not use temporal compression, although it might use intra-frame compression.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703821 HRESULT IMFMediaType::IsCompressedFormat([Out] BOOL* pfCompressed) IMFMediaType::IsCompressedFormat

Compares two media types and determines whether they are identical. If they are not identical, the method indicates how the two formats differ.

Pointer to the interface of the media type to compare.

Receives a bitwise OR of zero or more flags, indicating the degree of similarity between the two media types. The following flags are defined.

ValueMeaning
MF_MEDIATYPE_EQUAL_MAJOR_TYPES
0x00000001

The major types are the same. The major type is specified by the attribute.

MF_MEDIATYPE_EQUAL_FORMAT_TYPES
0x00000002

The subtypes are the same, or neither media type has a subtype. The subtype is specified by the attribute.

MF_MEDIATYPE_EQUAL_FORMAT_DATA
0x00000004

The attributes in one of the media types are a subset of the attributes in the other, and the values of these attributes match, excluding the value of the , , and attributes.

Specifically, the method takes the media type with the smaller number of attributes and checks whether each attribute from that type is present in the other media type and has the same value (not including , , and ).

To perform other comparisons, use the method. For example, the Compare method can test for identical attributes, or test the intersection of the two attribute sets. For more information, see .

MF_MEDIATYPE_EQUAL_FORMAT_USER_DATA
0x00000008

The user data is identical, or neither media type contains user data. User data is specified by the attribute.

?

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription
S_FALSE

The types are not equal. Examine the pdwFlags parameter to determine how the types differ.

The types are equal.

E_INVALIDARG

One or both media types are invalid.

?

Both of the media types must have a major type, or the method returns E_INVALIDARG.

If the method succeeds and all of the comparison flags are set in pdwFlags, the return value is . If the method succeeds but one or more comparison flags are not set, the method returns S_FALSE.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms696980 HRESULT IMFMediaType::IsEqual([In] IMFMediaType* pIMediaType,[Out] unsigned int* pdwFlags) IMFMediaType::IsEqual

Retrieves an alternative representation of the media type. Currently only the DirectShow structure is supported.

that specifies the representation to retrieve. The following values are defined.

ValueMeaning
AM_MEDIA_TYPE_REPRESENTATION

Convert the media type to a DirectShow structure. The method selects the most appropriate format structure (pbFormat).

FORMAT_MFVideoFormat

Convert the media type to a DirectShow structure with an format structure.

FORMAT_VideoInfo

Convert the media type to a DirectShow structure with a format structure.

FORMAT_VideoInfo2

Convert the media type to a DirectShow structure with a format structure.

?

Receives a reference to a structure that contains the representation. The method allocates the memory for the structure. The caller must release the memory by calling .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The details of the media type do not match the requested representation.

The media type is not valid.

The media type does not support the requested representation.

?

If you request a specific format structure in the guidRepresentation parameter, such as , you might lose some of the format information.

You can also use the MFInitAMMediaTypeFromMFMediaType function to convert a Media Foundation media type into a DirectShow media type.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms695248 HRESULT IMFMediaType::GetRepresentation([In] GUID guidRepresentation,[Out] void** ppvRepresentation) IMFMediaType::GetRepresentation

Frees memory that was allocated by the method.

No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703846 HRESULT IMFMediaType::FreeRepresentation([In] GUID guidRepresentation,[In] void* pvRepresentation) IMFMediaType::FreeRepresentation
Creates an empty media type.

The media type is created without any attributes.

ms693861 HRESULT MFCreateMediaType([Out] IMFMediaType** ppMFType) MFCreateMediaType

Applies to: desktop apps | Metro style apps

Converts a Media Foundation audio media type to a structure.

Receives the size of the structure.

Contains a flag from the enumeration.

a reference to the structure.

If the wFormatTag member of the returned structure is , you can cast the reference to a structure.

ms702177 HRESULT MFCreateWaveFormatExFromMFMediaType([In] IMFMediaType* pMFType,[Out] void** ppWF,[Out, Optional] unsigned int* pcbSize,[In] unsigned int Flags) MFCreateWaveFormatExFromMFMediaType

Gets the major type of the format.

This method is equivalent to getting the attribute from the media type.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms701588 GetMajorType GetMajorType HRESULT IMFMediaType::GetMajorType([Out] GUID* pguidMajorType)

Queries whether the media type is a temporally compressed format. Temporal compression uses information from previously decoded samples when decompressing the current sample.

This method returns in pfCompressed if the media type's attribute is TRUE. If the attribute is or not set, the method returns TRUE.

If the method returns TRUE in pfCompressed, it is a hint that the format has temporal compression applied to it. If the method returns , the format does not use temporal compression, although it might use intra-frame compression.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703821 IsCompressedFormat IsCompressedFormat HRESULT IMFMediaType::IsCompressedFormat([Out] BOOL* pfCompressed)
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. const WAVEFORMATEX* IMFAudioMediaType::GetAudioFormat() IMFAudioMediaType::GetAudioFormat No documentation. GetAudioFormat GetAudioFormat const WAVEFORMATEX* IMFAudioMediaType::GetAudioFormat()

Configures the audio session that is associated with the streaming audio renderer (SAR). Use this interface to change how the audio session appears in the Windows volume control.

The SAR exposes this interface as a service. To get a reference to the interface, call with the service identifier . You can call GetService directly on the SAR or call it on the Media Session.

ms705651 IMFAudioPolicy IMFAudioPolicy
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Assigns the audio session to a group of sessions.

A that identifies the session group. Groups are application-defined. To create a new session group, assign a new .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If two or more audio sessions share the same group, the Windows volume control displays one slider control for the entire group. Otherwise, it displays a slider for each session. For more information, see IAudioSessionControl::SetGroupingParam in the core audio API documentation.

ms696185 HRESULT IMFAudioPolicy::SetGroupingParam([In] const GUID& rguidClass) IMFAudioPolicy::SetGroupingParam

Retrieves the group of sessions to which this audio session belongs.

Receives a that identifies the session group.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If two or more audio sessions share the same group, the Windows volume control displays one slider control for the entire group. Otherwise, it displays a slider for each session. For more information, see IAudioSessionControl::SetGroupingParam in the core audio API documentation.

ms698967 HRESULT IMFAudioPolicy::GetGroupingParam([Out] GUID* pguidClass) IMFAudioPolicy::GetGroupingParam

Sets the display name of the audio session. The Windows volume control displays this name.

A null-terminated wide-character string that contains the display name.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If the application does not set a display name, Windows creates one.

ms697038 HRESULT IMFAudioPolicy::SetDisplayName([In] const wchar_t* pszName) IMFAudioPolicy::SetDisplayName

Retrieves the display name of the audio session. The Windows volume control displays this name.

Receives a reference to the display name string. The caller must free the memory allocated for the string by calling CoTaskMemFree.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If the application does not set a display name, Windows creates one.

ms698992 HRESULT IMFAudioPolicy::GetDisplayName([Out] wchar_t** pszName) IMFAudioPolicy::GetDisplayName

Sets the icon resource for the audio session. The Windows volume control displays this icon.

A wide-character string that specifies the icon. See Remarks.

If this method succeeds, it returns . Otherwise, it returns an error code.

The icon path has the format "path,index" or "path,-id", where path is the fully qualified path to a DLL, executable file, or icon file; index is the zero-based index of the icon within the file; and id is a resource identifier. Note that resource identifiers are preceded by a minus sign (-) to distinguish them from indexes. The path can contain environment variables, such as "%windir%". For more information, see IAudioSessionControl::SetIconPath in the Windows SDK.

ms694065 HRESULT IMFAudioPolicy::SetIconPath([In] const wchar_t* pszPath) IMFAudioPolicy::SetIconPath

Retrieves the icon resource for the audio session. The Windows volume control displays this icon.

Receives a reference to a wide-character string that specifies a shell resource. The format of the string is described in the topic . The caller must free the memory allocated for the string by calling CoTaskMemFree.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If the application did not set an icon path, the method returns an empty string ("").

For more information, see IAudioSessionControl::GetIconPath in the core audio API documentation.

ms704858 HRESULT IMFAudioPolicy::GetIconPath([Out] wchar_t** pszPath) IMFAudioPolicy::GetIconPath

Retrieves the group of sessions to which this audio session belongs.

If two or more audio sessions share the same group, the Windows volume control displays one slider control for the entire group. Otherwise, it displays a slider for each session. For more information, see IAudioSessionControl::SetGroupingParam in the core audio API documentation.

ms698967 GetGroupingParam / SetGroupingParam GetGroupingParam HRESULT IMFAudioPolicy::GetGroupingParam([Out] GUID* pguidClass)

Controls the volume levels of individual audio channels.

The streaming audio renderer (SAR) exposes this interface as a service. To get a reference to the interface, call with the service identifier . You can call GetService directly on the SAR or call it on the Media Session.

If your application does not require channel-level volume control, you can use the interface to control the master volume level of the audio session.

Volume is expressed as an attenuation level, where 0.0 indicates silence and 1.0 indicates full volume (no attenuation). For each channel, the attenuation level is the product of:

  • The master volume level of the audio session.
  • The volume level of the channel.

For example, if the master volume is 0.8 and the channel volume is 0.5, the attenuation for that channel is 0.8 ? 0.5 = 0.4. Volume levels can exceed 1.0 (positive gain), but the audio engine clips any audio samples that exceed zero decibels.

Use the following formula to convert the volume level to the decibel (dB) scale:

Attenuation (dB) = 20 * log10(Level)

For example, a volume level of 0.50 represents 6.02 dB of attenuation.

aa378344 IMFAudioStreamVolume IMFAudioStreamVolume
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the number of channels in the audio stream.

Receives the number of channels in the audio stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

aa373760 HRESULT IMFAudioStreamVolume::GetChannelCount([Out] unsigned int* pdwCount) IMFAudioStreamVolume::GetChannelCount

Sets the volume level for a specified channel in the audio stream.

Zero-based index of the audio channel. To get the number of channels, call .

Volume level for the channel.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

aa370771 HRESULT IMFAudioStreamVolume::SetChannelVolume([In] unsigned int dwIndex,[In] const float fLevel) IMFAudioStreamVolume::SetChannelVolume

Retrieves the volume level for a specified channel in the audio stream.

Zero-based index of the audio channel. To get the number of channels, call .

Receives the volume level for the channel.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

aa369737 HRESULT IMFAudioStreamVolume::GetChannelVolume([In] unsigned int dwIndex,[Out] float* pfLevel) IMFAudioStreamVolume::GetChannelVolume

Sets the individual volume levels for all of the channels in the audio stream.

Number of elements in the pfVolumes array. The value must equal the number of channels. To get the number of channels, call .

Address of an array of size dwCount, allocated by the caller. The array specifies the volume levels for all of the channels. Before calling the method, set each element of the array to the desired volume level for the channel.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

aa370454 HRESULT IMFAudioStreamVolume::SetAllVolumes([In] unsigned int dwCount,[In, Buffer] const float* pfVolumes) IMFAudioStreamVolume::SetAllVolumes

Retrieves the volume levels for all of the channels in the audio stream.

Number of elements in the pfVolumes array. The value must equal the number of channels. To get the number of channels, call .

Address of an array of size dwCount, allocated by the caller. The method fills the array with the volume level for each channel in the stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

aa373642 HRESULT IMFAudioStreamVolume::GetAllVolumes([In] unsigned int dwCount,[Out, Buffer] float* pfVolumes) IMFAudioStreamVolume::GetAllVolumes

Retrieves the number of channels in the audio stream.

aa373760 GetChannelCount GetChannelCount HRESULT IMFAudioStreamVolume::GetChannelCount([Out] unsigned int* pdwCount)

Represents a buffer that contains a two-dimensional surface, such as a video frame.

To get a reference to this interface, call QueryInterface on the media buffer.

To use a 2-D buffer, it is important to know the stride, which is the number of bytes needed to go from one row of pixels to the next. The stride may be larger than the image width, because the surface may contain padding bytes after each row of pixels. Stride can also be negative, if the pixels are oriented bottom-up in memory. For more information, see Image Stride.

Every video format defines a contiguous or packed representation. This representation is compatible with the standard layout of a DirectX surface in system memory, with no additional padding. For RGB video, the contiguous representation has a pitch equal to the image width in bytes, rounded up to the nearest DWORD boundary. For YUV video, the layout of the contiguous representation depends on the YUV format. For planar YUV formats, the Y plane might have a different pitch than the U and V planes.

If a media buffer supports the interface, the underlying buffer is not guaranteed to have a contiguous representation, because there might be additional padding bytes after each row of pixels. When a buffer is non-contiguous, the Lock and Lock2D methods have different behaviors:

  • The Lock2D method returns a reference to the underlying buffer. The buffer might not be contiguous.
  • The Lock method returns a buffer that is guaranteed to be contiguous. If the underlying buffer is not contiguous, the method copies the data into a new buffer, and the Unlock method copies it back into the original buffer.

Call the Lock2D method to access the 2-D buffer in its native format. The native format might not be contiguous. The buffer's method returns a contiguous representation of the buffer. However, this might require an internal copy from the native format. For 2-D buffers, therefore, you should use the Lock2D method and avoid the Lock method. Because the Lock method might cause up to two buffer copies, the Lock2D method is generally more efficient and should be used when possible. To find out if the underlying buffer is contiguous, call .

For uncompressed images, the amount of valid data in the buffer is determined by the width, height, and pixel layout of the image. For this reason, if you call Lock2D to access the buffer, do not rely on the values returned by or . Similarly, if you modify the data in the buffer, you do not have to call to update the size. Generally, you should avoid mixing calls to and methods on the same media buffer.

ms699894 IMF2DBuffer IMF2DBuffer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gives the caller access to the memory in the buffer.

Receives a reference to the first byte of the top row of pixels in the image. The top row is defined as the top row when the image is presented to the viewer, and might not be the first row in memory.

Receives the surface stride, in bytes. The stride might be negative, indicating that the image is oriented from the bottom up in memory.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Cannot lock the Direct3D surface.

The buffer cannot be locked at this time.

?

If p is a reference to the first byte in a row of pixels, p + (*plPitch) points to the first byte in the next row of pixels. A buffer might contain padding after each row of pixels, so the stride might be wider than the width of the image in bytes. Do not access the memory that is reserved for padding bytes, because it might not be read-accessible or write-accessible. For more information, see Image Stride.

The reference returned in pbScanline0 remains valid as long as the caller holds the lock. When you are done accessing the memory, call to unlock the buffer. You must call Unlock2D once for each call to Lock2D. After you unlock the buffer, the reference returned in pbScanline0 is no longer valid and should not be used. Generally, it is best to call Lock2D only when you need to access the buffer memory, and not earlier.

The values returned by the and methods do not apply to the buffer that is returned by the Lock2D method. For the same reason, you do not need to call after manipulating the data in the buffer returned by the Lock2D method.

The method fails while the Lock2D lock is held, and vice-versa. Applications should use only one of these methods at a time.

When the underlying buffer is a Direct3D surface, the method fails if the surface is not lockable.

ms700182 HRESULT IMF2DBuffer::Lock2D([Out] unsigned char** pbScanline0,[In] int* plPitch) IMF2DBuffer::Lock2D

Unlocks a buffer that was previously locked. Call this method once for each call to .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697066 HRESULT IMF2DBuffer::Unlock2D() IMF2DBuffer::Unlock2D

Retrieves a reference to the buffer memory and the surface stride.

Receives a reference to the first byte of the top row of pixels in the image.

Receives the stride, in bytes. For more information, see Image Stride.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

You must lock the buffer before calling this method.

?

Before calling this method, you must lock the buffer by calling . The reference returned in plPitch is valid only while the buffer remains locked.

ms694042 HRESULT IMF2DBuffer::GetScanline0AndPitch([Out] unsigned char** pbScanline0,[Out] int* plPitch) IMF2DBuffer::GetScanline0AndPitch

Queries whether the buffer is contiguous in its native format.

Receives a Boolean value. The value is TRUE if the buffer is contiguous, and otherwise.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

For a definition of contiguous as it applies to 2-D buffers, see the Remarks section in interface. For non-contiguous buffers, the method must perform an internal copy.

ms701629 HRESULT IMF2DBuffer::IsContiguousFormat([Out] BOOL* pfIsContiguous) IMF2DBuffer::IsContiguousFormat

Retrieves the number of bytes needed to store the contents of the buffer in contiguous format.

Receives the number of bytes needed to store the contents of the buffer in contiguous format.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

For a definition of contiguous as it applies to 2-D buffers, see the Remarks section in interface.

ms696971 HRESULT IMF2DBuffer::GetContiguousLength([Out] unsigned int* pcbLength) IMF2DBuffer::GetContiguousLength

Copies this buffer into the caller's buffer, converting the data to contiguous format.

Pointer to the destination buffer where the data will be copied. The caller allocates the buffer.

Size of the destination buffer, in bytes. To get the required size, call .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid size specified in pbDestBuffer.

?

If the original buffer is not contiguous, this method converts the contents into contiguous format during the copy. For a definition of contiguous as it applies to 2-D buffers, see the Remarks section in interface.

ms696215 HRESULT IMF2DBuffer::ContiguousCopyTo([Out, Buffer] unsigned char* pbDestBuffer,[In] unsigned int cbDestBuffer) IMF2DBuffer::ContiguousCopyTo

Copies data to this buffer from a buffer that has a contiguous format.

Pointer to the source buffer. The caller allocates the buffer.

Size of the source buffer, in bytes. To get the maximum size of the buffer, call .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method copies the contents of the source buffer into the buffer that is managed by this object. The source buffer must be in contiguous format. While copying, the method converts the contents into the destination buffer's native format, correcting for the buffer's pitch if necessary.

For a definition of contiguous as it applies to 2-D buffers, see the Remarks section in the interface topic.

ms700162 HRESULT IMF2DBuffer::ContiguousCopyFrom([In, Buffer] const unsigned char* pbSrcBuffer,[In] unsigned int cbSrcBuffer) IMF2DBuffer::ContiguousCopyFrom

Queries whether the buffer is contiguous in its native format.

For a definition of contiguous as it applies to 2-D buffers, see the Remarks section in interface. For non-contiguous buffers, the method must perform an internal copy.

ms701629 IsContiguousFormat IsContiguousFormat HRESULT IMF2DBuffer::IsContiguousFormat([Out] BOOL* pfIsContiguous)

Retrieves the number of bytes needed to store the contents of the buffer in contiguous format.

For a definition of contiguous as it applies to 2-D buffers, see the Remarks section in interface.

ms696971 GetContiguousLength GetContiguousLength HRESULT IMF2DBuffer::GetContiguousLength([Out] unsigned int* pcbLength)

Controls how a byte stream buffers data from a network.

To get a reference to this interface, call QueryInterface on the byte stream object.

If a byte stream implements this interface, a media source can use it to control how the byte stream buffers data. This interface is designed for byte streams that read data from a network.

A byte stream that implements this interface should also implement the interface. When the byte stream starts buffering, it sends an event. When it stops buffering, it sends an event.

The byte stream must send a matching event for every event. The byte stream must not send events unless the media source has enabled buffering by calling EnableBuffering with the value TRUE.

After the byte stream sends an event, it should send if any of the following occur:

  • The byte stream finishes buffering data.
  • The byte stream reaches the end of the stream.
  • The media source calls EnableBuffering with the value .
  • The media source calls StopBuffering.

The byte stream should not send any more buffering events after it reaches the end of the file.

If buffering is disabled, the byte stream does not send any buffering events. Internally, however, it might still buffer data while it waits for I/O requests to complete. Therefore, methods might take an indefinite length of time to complete.

If the byte stream is buffering data internally and the media source calls EnableBuffering with the value TRUE, the byte stream can send immediately.

After the presentation has started, the media source should forward and and events that it receives while started. The Media Session will pause the presentation clock while buffering is progress and restart the presentation clock when buffering completes. The media source should only forward these events while the presentation is playing. The purpose of sending these events to the Media Session is to pause the presentation time while the source buffers data.

aa372548 IMFByteStreamBuffering IMFByteStreamBuffering
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the buffering parameters.

Pointer to an structure that contains the buffering parameters. The byte stream uses this information to calculate how much data to buffer from the network.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

aa366520 HRESULT IMFByteStreamBuffering::SetBufferingParams([In] MFBYTESTREAM_BUFFERING_PARAMS* pParams) IMFByteStreamBuffering::SetBufferingParams

Enables or disables buffering.

Specifies whether the byte stream buffers data. If TRUE, buffering is enabled. If , buffering is disabled.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Before calling this method, call to set the buffering parameters on the byte stream.

aa369933 HRESULT IMFByteStreamBuffering::EnableBuffering([In] BOOL fEnable) IMFByteStreamBuffering::EnableBuffering

Stops any buffering that is in progress.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The byte stream successfully stopped buffering.

S_FALSE

No buffering was in progress.

?

If the byte stream is currently buffering data, it stops and sends an event. If the byte stream is not currently buffering, this method has no effect.

aa375256 HRESULT IMFByteStreamBuffering::StopBuffering() IMFByteStreamBuffering::StopBuffering

Sets the buffering parameters.

aa366520 SetBufferingParams SetBufferingParams HRESULT IMFByteStreamBuffering::SetBufferingParams([In] MFBYTESTREAM_BUFFERING_PARAMS* pParams)

Stops the background transfer of data to the local cache.

The byte stream resumes transferring data to the cache if the application does one of the following:

  • Reads data from the byte stream.
  • Calls the byte stream's method.
dd368786 IMFByteStreamCacheControl IMFByteStreamCacheControl
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Stops the background transfer of data to the local cache.

If this method succeeds, it returns . Otherwise, it returns an error code.

The byte stream resumes transferring data to the cache if the application does one of the following:

  • Reads data from the byte stream.
  • Calls the byte stream's method.
dd368786 HRESULT IMFByteStreamCacheControl::StopBackgroundTransfer() IMFByteStreamCacheControl::StopBackgroundTransfer

Creates a media source from a byte stream.

Applications do not use this interface directly. This interface is exposed by byte-stream handlers, which are used by the source resolver. When the byte-stream handler is given a byte stream, it parses the stream and creates a media source. Byte-stream handlers are registered by file name extension or MIME type.

ms699886 IMFByteStreamHandler IMFByteStreamHandler
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Begins an asynchronous request to create a media source from a byte stream.

Pointer to the byte stream's interface.

String that contains the original URL of the byte stream. This parameter can be null.

Bitwise OR of zero or more flags. See Source Resolver Flags.

Pointer to the interface of a property store. The byte-stream handler can use this property store to configure the object. This parameter can be null. For more information, see Configuring a Media Source.

Receives an reference or the value null. If the value is not null, you can cancel the asynchronous operation by passing this reference to the method. The caller must release the interface. This parameter can be null.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Unable to parse the byte stream.

?

The dwFlags parameter must contain the flag and should not contain the flag.

The byte-stream handler is responsible for parsing the stream and validating the contents. If the stream is not valid or the byte stream handler cannot parse the stream, the handler should return a failure code. The byte stream is not guaranteed to match the type of stream that the byte handler is designed to parse.

If the pwszURL parameter is not null, the byte-stream handler might use the URL during the resolution process. (For example, it might use the file name extension, if present.) Also, the byte stream might contain the attribute, specifying the MIME type.

When the operation completes, the byte-stream handler calls the method. The Invoke method should call to get a reference to the media source.

ms696214 HRESULT IMFByteStreamHandler::BeginCreateObject([In] IMFByteStream* pByteStream,[In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out, Optional] IUnknown** ppIUnknownCancelCookie,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFByteStreamHandler::BeginCreateObject

Completes an asynchronous request to create a media source.

Pointer to the interface. Pass in the same reference that your callback object received in the Invoke method.

Receives a member of the enumeration, specifying the type of object that was created.

Receives a reference to the interface of the media source. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_ABORT

The operation was canceled. See .

Unable to parse the byte stream.

?

Call this method from inside the method.

ms700217 HRESULT IMFByteStreamHandler::EndCreateObject([In] IMFAsyncResult* pResult,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFByteStreamHandler::EndCreateObject

Cancels the current request to create a media source.

Pointer to the interface that was returned in the ppIUnknownCancelCookie parameter of the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You can use this method to cancel a previous call to BeginCreateObject. Because that method is asynchronous, however, it might be completed before the operation can be canceled. Therefore, your callback might still be invoked after you call this method.

ms701576 HRESULT IMFByteStreamHandler::CancelObjectCreation([In] IUnknown* pIUnknownCancelCookie) IMFByteStreamHandler::CancelObjectCreation

Retrieves the maximum number of bytes needed to create the media source or determine that the byte stream handler cannot parse this stream.

Receives the maximum number of bytes that are required.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms704770 HRESULT IMFByteStreamHandler::GetMaxNumberOfBytesRequiredForResolution([Out] unsigned longlong* pqwBytes) IMFByteStreamHandler::GetMaxNumberOfBytesRequiredForResolution

Retrieves the maximum number of bytes needed to create the media source or determine that the byte stream handler cannot parse this stream.

ms704770 GetMaxNumberOfBytesRequiredForResolution GetMaxNumberOfBytesRequiredForResolution HRESULT IMFByteStreamHandler::GetMaxNumberOfBytesRequiredForResolution([Out] unsigned longlong* pqwBytes)

Retrieves the last clock time that was correlated with system time.

At some fixed interval, a clock correlates its internal clock ticks with the system time. (The system time is the time returned by the high-resolution performance counter.) This method returns:

  • The most recent clock time that was correlated with system time.
  • The system time when the correlation was performed.

The clock time is returned in the pllClockTime parameter and is expressed in units of the clock's frequency. If the clock's method returns the flag, the clock's frequency is 10 MHz (each clock tick is 100 nanoseconds). Otherwise, you can get the clock's frequency by calling . The frequency is given in the qwClockFrequency member of the structure returned by that method.

The system time is returned in the phnsSystemTime parameter, and is always expressed in 100-nanosecond units.

To find out how often the clock correlates its clock time with the system time, call GetProperties. The correlation interval is given in the qwCorrelationRate member of the structure. If qwCorrelationRate is zero, it means the clock performs the correlation whenever GetCorrelatedTime is called. Otherwise, you can calculate the current clock time by extrapolating from the last correlated time.

Some clocks support rate changes through the interface. If so, the clock time advances at a speed of frequency ? current rate. If a clock does not expose the interface, the rate is always 1.0.

For the presentation clock, the clock time is the presentation time, and is always relative to the starting time specified in . You can also get the presentation time by calling .

ms694122 IMFClock IMFClock
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the characteristics of the clock.

Receives a bitwise OR of values from the enumeration indicating the characteristics of the clock.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697050 HRESULT IMFClock::GetClockCharacteristics([Out] unsigned int* pdwCharacteristics) IMFClock::GetClockCharacteristics

Retrieves the last clock time that was correlated with system time.

Reserved, must be zero.

Receives the last known clock time, in units of the clock's frequency.

Receives the system time that corresponds to the clock time returned in pllClockTime, in 100-nanosecond units.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The clock does not have a time source.

?

At some fixed interval, a clock correlates its internal clock ticks with the system time. (The system time is the time returned by the high-resolution performance counter.) This method returns:

  • The most recent clock time that was correlated with system time.
  • The system time when the correlation was performed.

The clock time is returned in the pllClockTime parameter and is expressed in units of the clock's frequency. If the clock's method returns the flag, the clock's frequency is 10 MHz (each clock tick is 100 nanoseconds). Otherwise, you can get the clock's frequency by calling . The frequency is given in the qwClockFrequency member of the structure returned by that method.

The system time is returned in the phnsSystemTime parameter, and is always expressed in 100-nanosecond units.

To find out how often the clock correlates its clock time with the system time, call GetProperties. The correlation interval is given in the qwCorrelationRate member of the structure. If qwCorrelationRate is zero, it means the clock performs the correlation whenever GetCorrelatedTime is called. Otherwise, you can calculate the current clock time by extrapolating from the last correlated time.

Some clocks support rate changes through the interface. If so, the clock time advances at a speed of frequency ? current rate. If a clock does not expose the interface, the rate is always 1.0.

For the presentation clock, the clock time is the presentation time, and is always relative to the starting time specified in . You can also get the presentation time by calling .

ms694122 HRESULT IMFClock::GetCorrelatedTime([In] unsigned int dwReserved,[Out] longlong* pllClockTime,[Out] longlong* phnsSystemTime) IMFClock::GetCorrelatedTime

Retrieves the clock's continuity key. (Not supported.)

Receives the continuity key.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Continuity keys are currently not supported in Media Foundation. Clocks must return the value zero in the pdwContinuityKey parameter.

ms700188 HRESULT IMFClock::GetContinuityKey([Out] unsigned int* pdwContinuityKey) IMFClock::GetContinuityKey

Retrieves the current state of the clock.

Reserved, must be zero.

Receives the clock state, as a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms700206 HRESULT IMFClock::GetState([In] unsigned int dwReserved,[Out] MFCLOCK_STATE* peClockState) IMFClock::GetState

Retrieves the properties of the clock.

Pointer to an structure that receives the properties.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms701613 HRESULT IMFClock::GetProperties([Out] MFCLOCK_PROPERTIES* pClockProperties) IMFClock::GetProperties

Retrieves the characteristics of the clock.

ms697050 GetClockCharacteristics GetClockCharacteristics HRESULT IMFClock::GetClockCharacteristics([Out] unsigned int* pdwCharacteristics)

Retrieves the clock's continuity key. (Not supported.)

Continuity keys are currently not supported in Media Foundation. Clocks must return the value zero in the pdwContinuityKey parameter.

ms700188 GetContinuityKey GetContinuityKey HRESULT IMFClock::GetContinuityKey([Out] unsigned int* pdwContinuityKey)

Retrieves the properties of the clock.

ms701613 GetProperties GetProperties HRESULT IMFClock::GetProperties([Out] MFCLOCK_PROPERTIES* pClockProperties)

Retrieves an object in the collection.

This method does not remove the object from the collection. To remove an object, call .

ms701793 IMFCollection IMFCollection
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the number of objects in the collection.

Receives the number of objects in the collection.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697034 HRESULT IMFCollection::GetElementCount([Out] unsigned int* pcElements) IMFCollection::GetElementCount

Retrieves an object in the collection.

Zero-based index of the object to retrieve. Objects are indexed in the order in which they were added to the collection.

Receives a reference to the object's interface. The caller must release the interface. The retrieved reference value might be null.

This method does not remove the object from the collection. To remove an object, call .

ms701793 HRESULT IMFCollection::GetElement([In] unsigned int dwElementIndex,[Out] IUnknown** ppUnkElement) IMFCollection::GetElement

Adds an object to the collection.

Pointer to the object's interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If pUnkElement is null, a null reference is added to the collection.

ms695202 HRESULT IMFCollection::AddElement([In, Optional] IUnknown* pUnkElement) IMFCollection::AddElement

Removes an object from the collection.

Zero-based index of the object to remove. Objects are indexed in the order in which they were added to the collection.

Receives a reference to the interface of the object. The caller must release the interface. This parameter cannot be null, but the retrieved reference value might be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697010 HRESULT IMFCollection::RemoveElement([In] unsigned int dwElementIndex,[Out] IUnknown** ppUnkElement) IMFCollection::RemoveElement

Adds an object at the specified index in the collection.

The zero-based index where the object will be added to the collection.

The object to insert.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms703963 HRESULT IMFCollection::InsertElementAt([In] unsigned int dwIndex,[In, Optional] IUnknown* pUnknown) IMFCollection::InsertElementAt

Removes all items from the collection.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms700194 HRESULT IMFCollection::RemoveAllElements() IMFCollection::RemoveAllElements

Retrieves the number of objects in the collection.

ms697034 GetElementCount GetElementCount HRESULT IMFCollection::GetElementCount([Out] unsigned int* pcElements)

Implements one step that must be performed for the user to access media content. For example, the steps might be individualization followed by license acquisition. Each of these steps would be encapsulated by a content enabler object that exposes the interface.

ms697004 IMFContentEnabler IMFContentEnabler
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the type of operation that this content enabler performs.

Receives a that identifies the type of operation. An application can tailor its user interface (UI) strings for known operation types. See Remarks.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The following GUIDs are defined for the pType parameter.

ValueDescription
MFENABLETYPE_MF_RebootRequiredThe user must reboot his or her computer.
MFENABLETYPE_MF_UpdateRevocationInformationUpdate revocation information.
MFENABLETYPE_MF_UpdateUntrustedComponentUpdate untrusted components.
MFENABLETYPE_WMDRMV1_LicenseAcquisitionLicense acquisition for Windows Media Digital Rights Management (DRM) version 1.
MFENABLETYPE_WMDRMV7_IndividualizationIndividualization.
MFENABLETYPE_WMDRMV7_LicenseAcquisitionLicense acquisition for Windows Media DRM version 7 or later.

?

bb970471 HRESULT IMFContentEnabler::GetEnableType([Out] GUID* pType) IMFContentEnabler::GetEnableType

Retrieves a URL for performing a manual content enabling action.

Receives a reference to a buffer that contains the URL. The caller must release the memory for the buffer by calling CoTaskMemFree.

Receives the number of characters returned in ppwszURL, including the terminating null character.

Receives a member of the enumeration indicating whether the URL is trusted.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No URL is available.

?

If the enabling action can be performed by navigating to a URL, this method returns the URL. If no such URL exists, the method returns a failure code.

The purpose of the URL depends on the content enabler type, which is obtained by calling .

Enable typePurpose of URL
IndividualizationNot applicable.
License acquisitionURL to obtain the license. Call and submit the data to the URL as an HTTP POST request. To receive notification when the license is acquired, call .
RevocationURL to a webpage where the user can download and install an updated component.

?

bb970345 HRESULT IMFContentEnabler::GetEnableURL([Out, Buffer, Optional] wchar_t** ppwszURL,[Out] unsigned int* pcchURL,[InOut, Optional] MF_URL_TRUST_STATUS* pTrustStatus) IMFContentEnabler::GetEnableURL

Retrieves the data for a manual content enabling action.

Receives a reference to a buffer that contains the data. The caller must free the buffer by calling CoTaskMemFree.

Receives the size of the ppbData buffer.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No data is available.

?

The purpose of the data depends on the content enabler type, which is obtained by calling .

Enable typePurpose of data
IndividualizationNot applicable.
License acquisitionHTTP POST data.
Revocation structure.

?

bb970525 HRESULT IMFContentEnabler::GetEnableData([Out, Buffer, Optional] unsigned char** ppbData,[Out] unsigned int* pcbData) IMFContentEnabler::GetEnableData

Queries whether the content enabler can perform all of its actions automatically.

Receives a Boolean value. If TRUE, the content enabler can perform the enabing action automatically.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If this method returns TRUE in the pfAutomatic parameter, call the method to perform the enabling action.

If this method returns in the pfAutomatic parameter, the application must use manual enabling. To do so, call and to get the URL and data needed for manual enabling.

bb970334 HRESULT IMFContentEnabler::IsAutomaticSupported([Out] BOOL* pfAutomatic) IMFContentEnabler::IsAutomaticSupported

Performs a content enabling action without any user interaction.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is asynchronous. When the operation is complete, the content enabler sends an event. While the operation is in progress, the content enabler might send events.

To find out whether the content enabler supports this method, call .

ms699012 HRESULT IMFContentEnabler::AutomaticEnable() IMFContentEnabler::AutomaticEnable

Requests notification when the enabling action is completed.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

S_FALSE

The method succeeded and no action was required.

?

If you use a manual enabling action, call this method to be notified when the operation completes. If this method returns , the content enabler will send an event when the operation is completed. If the application cancels the operatation before completing it, call .

You do not have to call MonitorEnable when you use automatic enabling by calling .

ms698997 HRESULT IMFContentEnabler::MonitorEnable() IMFContentEnabler::MonitorEnable

Cancels a pending content enabling action.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The content enabler sends an event with a status code of E_CANCEL.

ms704633 HRESULT IMFContentEnabler::Cancel() IMFContentEnabler::Cancel

Retrieves the type of operation that this content enabler performs.

The following GUIDs are defined for the pType parameter.

ValueDescription
MFENABLETYPE_MF_RebootRequiredThe user must reboot his or her computer.
MFENABLETYPE_MF_UpdateRevocationInformationUpdate revocation information.
MFENABLETYPE_MF_UpdateUntrustedComponentUpdate untrusted components.
MFENABLETYPE_WMDRMV1_LicenseAcquisitionLicense acquisition for Windows Media Digital Rights Management (DRM) version 1.
MFENABLETYPE_WMDRMV7_IndividualizationIndividualization.
MFENABLETYPE_WMDRMV7_LicenseAcquisitionLicense acquisition for Windows Media DRM version 7 or later.

?

bb970471 GetEnableType GetEnableType HRESULT IMFContentEnabler::GetEnableType([Out] GUID* pType)

Queries whether the content enabler can perform all of its actions automatically.

If this method returns TRUE in the pfAutomatic parameter, call the method to perform the enabling action.

If this method returns in the pfAutomatic parameter, the application must use manual enabling. To do so, call and to get the URL and data needed for manual enabling.

bb970334 IsAutomaticSupported IsAutomaticSupported HRESULT IMFContentEnabler::IsAutomaticSupported([Out] BOOL* pfAutomatic)

Enables playback of protected content by providing the application with a reference to a content enabler object.

Applications that play protected content should implement this interface.

A content enabler is an object that performs some action that is required to play a piece of protected content. For example, the action might be obtaining a DRM license. Content enablers expose the interface, which defines a generic mechanism for content enabler. Content enablers are created inside the protected media path (PMP) process. However, they must be invoked from the application process. Therefore, the interface provides a way for the PMP Media Session to notify the application.

To use this interface, do the following:

  1. Implement the interface in your application.

  2. Create an attribute store by calling .

  3. Set the attribute on the attribute store. The attribute value is a reference to your implementation.

  4. Call and pass the attribute store in the pConfiguration parameter.

If the content requires a content enabler, the application's BeginEnableContent method is called. Usually this method called during the operation, before the Media Session raises the event. The application might receive multiple BeginEnableContent calls for a single piece of content. The event signals that the content-enabling process is complete for the current topology. The BeginEnableContent method can also be called outside of the SetTopology operation, but less commonly.

Many content enablers send machine-specific data to the network, which can have privacy implications. One of the purposes of the interface is to give applications an opportunity to display information to the user and enable to user to opt in or out of the process.

ms694217 IMFContentProtectionManager IMFContentProtectionManager
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Begins an asynchronous request to perform a content enabling action.

This method requests the application to perform a specific step needed to acquire rights to the content, using a content enabler object.

Pointer to the interface of a content enabler object. To create the content enabler, call and request the interface. The application should use the methods in to complete the content enabling action.

Pointer to the interface of the pending topology.

Pointer to the interface of a callback object. When the operation is complete, the application should call on the callback.

Reserved. Currently this parameter is always null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Do not block within this callback method. Instead, perform the content enabling action asynchronously on another thread. When the operation is finished, notify the protected media path (PMP) through the pCallback parameter.

If you return a success code from this method, you must call Invoke on the callback. Conversely, if you return an error code from this method, you must not call Invoke. If the operation fails after the method returns a success code, use status code on the object to report the error.

After the callback is invoked, the PMP will call the application's method to complete the asynchronous call.

This method is not necessarily called every time the application plays protected content. Generally, the method will not be called if the user has a valid, up-to-date license for the content. Internally, the input trust authority (ITA) determines whether BeginEnableContent is called, based on the content provider's DRM policy. For more information, see Protected Media Path.

ms696203 HRESULT IMFContentProtectionManager::BeginEnableContent([In] IMFActivate* pEnablerActivate,[In] IMFTopology* pTopo,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFContentProtectionManager::BeginEnableContent

Ends an asynchronous request to perform a content enabling action. This method is called by the protected media path (PMP) to complete an asynchronous call to .

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

When the BeginEnableContent method completes asynchronously, the application notifies the PMP by invoking the asynchronous callback. The PMP calls EndEnableContent on the application to get the result code. This method is called on the application's thread from inside the callback method. Therefore, it must not block the thread that invoked the callback.

The application must return the success or failure code of the asynchronous processing that followed the call to BeginEnableContent.

ms694267 HRESULT IMFContentProtectionManager::EndEnableContent([In] IMFAsyncResult* pResult) IMFContentProtectionManager::EndEnableContent

Enables the presenter for the enhanced video renderer (EVR) to request a specific frame from the video mixer.

The sample objects created by the function implement this interface. To retrieve a reference to this interface, call QueryInterface on the sample.

ms696237 IMFDesiredSample IMFDesiredSample
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Called by the mixer to get the time and duration of the sample requested by the presenter.

Receives the desired sample time that should be mixed.

Receives the sample duration that should be mixed.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No time stamp was set for this sample. See .

?

ms694058 HRESULT IMFDesiredSample::GetDesiredSampleTimeAndDuration([Out] longlong* phnsSampleTime,[Out] longlong* phnsSampleDuration) IMFDesiredSample::GetDesiredSampleTimeAndDuration

Called by the presenter to set the time and duration of the sample that it requests from the mixer.

The time of the requested sample.

The duration of the requested sample.

This value should be set prior to passing the buffer to the mixer for a Mix operation. The mixer sets the actual start and duration times on the sample before sending it back.

ms694296 void IMFDesiredSample::SetDesiredSampleTimeAndDuration([In] longlong hnsSampleTime,[In] longlong hnsSampleDuration) IMFDesiredSample::SetDesiredSampleTimeAndDuration

Clears the time stamps previously set by a call to .

After this method is called, the method returns .

This method also clears the time stamp and duration and removes all attributes from the sample.

ms703903 void IMFDesiredSample::Clear() IMFDesiredSample::Clear

Initializes the Digital Living Network Alliance (DLNA) media sink.

The DLNA media sink exposes this interface. To get a reference to this interface, call CoCreateInstance. The CLSID is CLSID_MPEG2DLNASink.

dd368787 IMFDLNASinkInit IMFDLNASinkInit
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Initializes the Digital Living Network Alliance (DLNA) media sink.

Pointer to a byte stream. The DLNA media sink writes data to this byte stream. The byte stream must be writable.

If TRUE, the DLNA media sink accepts PAL video formats. Otherwise, it accepts NTSC video formats.

This method can return one of these values.

Return codeDescription

The method succeeded.

The method was already called.

The media sink's method was called.

?

dd368788 HRESULT IMFDLNASinkInit::Initialize([In] IMFByteStream* pByteStream,[In] BOOL fPal) IMFDLNASinkInit::Initialize

Configures Windows Media Digital Rights Management (DRM) for Network Devices on a network sink.

The Advanced Systems Format (ASF) streaming media sink exposes this interface. To get a reference to the interface, perform the following tasks.

  1. Get the activation object for the ASF streaming media sink by calling .
  2. Create the media sink by calling the activation object ActivateObject method.
  3. Get an reference by calling QueryInterface on the media sink.

For more information, see Remarks.

To stream protected content over a network, the ASF streaming media sink provides an output trust authority (OTA) that supports Windows Media DRM for Network Devices and implements the interface. For this OTA, encryption occurs on each frame before multiplexing. The license request and response process takes place in the media sink.

The application gets a reference to and uses the methods to handle the license request and response. The application is also responsible for sending the license to the client.

To stream the content, the application does the following:

  1. Provide the HTTP byte stream to which the media sink writes the streamed content.

    To stream DRM-protected content over a network from a server to a client, an application must use the Microsoft Media Foundation Protected Media Path (PMP). The media sink and the application-provided HTTP byte stream exist in mfpmp.exe. Therefore, the byte stream must expose the interface so that it can be created out-of-process.

    Note??This might affect how the code is packaged. The DLL that contains the HTTP byte stream and other dependent DLLs must be signed for the Protected Environment (PE-signed).

  2. Set the MFPKEY_ASFMEDIASINK_DRMACTION property to . The media sink's property store is available to the application through the ASF ContentInfo. To get the property store, call .
  3. Get a reference to the interface by querying the media sink.
  4. To make a license request, call . This method calls into the OTA implementation and retrieves the license.

    When the clock starts for the first time or restarts , the encrypter that is used for encrypting samples is retrieved, and the license response is cached.

  5. To get the cached license response, call .
dd368789 IMFDRMNetHelper IMFDRMNetHelper
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the license response for the specified request.

Pointer to a byte array that contains the license request.

Size, in bytes, of the license request.

Receives a reference to a byte array that contains the license response. The caller must free the array by calling CoTaskMemFree.

Receives the size, in bytes, of the license response.

Receives the key identifier. The caller must release the string by calling SysFreeString.

The function returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media sink was shut down.

?

dd368791 HRESULT IMFDRMNetHelper::ProcessLicenseRequest([In, Buffer] unsigned char* pLicenseRequest,[In] unsigned int cbLicenseRequest,[Out, Buffer, Optional] unsigned char** ppLicenseResponse,[Out] unsigned int* pcbLicenseResponse,[Out] wchar_t** pbstrKID) IMFDRMNetHelper::ProcessLicenseRequest

Not implemented in this release.

Receives a reference to a byte array that contains the license response. The caller must free the array by calling CoTaskMemFree.

Receives the size, in bytes, of the license response.

The method returns E_NOTIMPL.

dd368790 HRESULT IMFDRMNetHelper::GetChainedLicenseResponse([Out, Buffer, Optional] unsigned char** ppLicenseResponse,[Out] unsigned int* pcbLicenseResponse) IMFDRMNetHelper::GetChainedLicenseResponse

Enables an application to use a Media Foundation transform (MFT) that has restrictions on its use.

If you register an MFT that requires unlocking, include the flag when you call the function.

dd368792 IMFFieldOfUseMFTUnlock IMFFieldOfUseMFTUnlock
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Unlocks a Media Foundation transform (MFT) so that the application can use it.

A reference to the interface of the MFT.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method authenticates the caller, using a private communication channel between the MFT and the object that implements the interface. The details of the communication depend entirely on the implementation.

dd368793 HRESULT IMFFieldOfUseMFTUnlock::Unlock([In, Optional] IUnknown* pUnkMFT) IMFFieldOfUseMFTUnlock::Unlock

Sets the number of input pins on the DirectShow Enhanced Video Renderer (EVR) filter. To get a reference to this interface, call QueryInterface on the DirectShow EVR filter.

The DirectShow EVR filter starts with one input pin, which corresponds to the reference stream. To create additional pins for video substreams, call SetNumberOfStreams.

The EVR media sink for Media Foundation does not support this interface. To add new streams to the EVR media sink, call .

ms694298 IEVRFilterConfig IEVRFilterConfig
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the number of input pins on the EVR filter.

Specifies the total number of input pins on the EVR filter. This value includes the input pin for the reference stream, which is created by default. For example, to mix one substream plus the reference stream, set this parameter to 2.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid number of streams. The minimum is one, and the maximum is 16.

VFW_E_WRONG_STATE

This method has already been called, or at least one pin is already connected.

?

After this method has been called, it cannot be called a second time on the same instance of the EVR filter. Also, the method fails if any input pins are connected.

ms698968 HRESULT IEVRFilterConfig::SetNumberOfStreams([In] unsigned int dwMaxStreams) IEVRFilterConfig::SetNumberOfStreams

Retrieves the number of input pins on the EVR filter. The EVR filter always has at least one input pin, which corresponds to the reference stream.

Receives the number of streams.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms701550 HRESULT IEVRFilterConfig::GetNumberOfStreams([Out] unsigned int* pdwMaxStreams) IEVRFilterConfig::GetNumberOfStreams

Retrieves the number of input pins on the EVR filter. The EVR filter always has at least one input pin, which corresponds to the reference stream.

ms701550 GetNumberOfStreams / SetNumberOfStreams GetNumberOfStreams HRESULT IEVRFilterConfig::GetNumberOfStreams([Out] unsigned int* pdwMaxStreams)

Gets the configuration parameters for the Microsoft DirectShow Enhanced Video Renderer Filter filter.

dd373925 IEVRFilterConfigEx IEVRFilterConfigEx
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the configuration parameters for the Microsoft DirectShow Enhanced Video Renderer Filter (EVR).

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

?

dd373926 HRESULT IEVRFilterConfigEx::SetConfigPrefs([In] unsigned int dwConfigFlags) IEVRFilterConfigEx::SetConfigPrefs

Gets the configuration parameters for the Microsoft DirectShow Enhanced Video Renderer Filter filter.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd373925 HRESULT IEVRFilterConfigEx::GetConfigPrefs([Out] unsigned int* pdwConfigFlags) IEVRFilterConfigEx::GetConfigPrefs

Gets or sets the configuration parameters for the Microsoft DirectShow Enhanced Video Renderer Filter filter.

dd373925 GetConfigPrefs / SetConfigPrefs GetConfigPrefs HRESULT IEVRFilterConfigEx::GetConfigPrefs([Out] unsigned int* pdwConfigFlags)

Optionally supported by media sinks to perform required tasks before shutdown. This interface is typically exposed by archive sinks?that is, media sinks that write to a file. It is used to perform tasks such as flushing data to disk or updating a file header.

To get a reference to this interface, call QueryInterface on the media sink.

If a media sink exposes this interface, the Media Session will call BeginFinalize on the sink before the session closes.

ms704715 IMFFinalizableMediaSink IMFFinalizableMediaSink

Implemented by media sink objects. This interface is the base interface for all Media Foundation media sinks. Stream sinks handle the actual processing of data on each stream.

ms694262 IMFMediaSink IMFMediaSink
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the characteristics of the media sink.

Receives a bitwise OR of zero or more flags. The following flags are defined:

ValueMeaning
MEDIASINK_FIXED_STREAMS
0x00000001

The media sink has a fixed number of streams. It does not support the and methods. This flag is a hint to the application.

MEDIASINK_CANNOT_MATCH_CLOCK
0x00000002

The media sink cannot match rates with an external clock.

For best results, this media sink should be used as the time source for the presentation clock. If any other time source is used, the media sink cannot match rates with the clock, with poor results (for example, glitching).

This flag should be used sparingly, because it limits how the pipeline can be configured.

For more information about the presentation clock, see Presentation Clock.

MEDIASINK_RATELESS
0x00000004

The media sink is rateless. It consumes samples as quickly as possible, and does not synchronize itself to a presentation clock.

Most archiving sinks are rateless.

MEDIASINK_CLOCK_REQUIRED
0x00000008

The media sink requires a presentation clock. The presentation clock is set by calling the media sink's method.

This flag is obsolete, because all media sinks must support the SetPresentationClock method, even if the media sink ignores the clock (as in a rateless media sink).

MEDIASINK_CAN_PREROLL
0x00000010

The media sink can accept preroll samples before the presentation clock starts. The media sink exposes the interface.

MEDIASINK_REQUIRE_REFERENCE_MEDIATYPE
0x00000020

The first stream sink (index 0) is a reference stream. The reference stream must have a media type before the media types can be set on the other stream sinks.

?

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media sink's Shutdown method has been called.

?

The characteristics of a media sink are fixed throughout the life time of the sink.

ms701973 HRESULT IMFMediaSink::GetCharacteristics([Out] unsigned int* pdwCharacteristics) IMFMediaSink::GetCharacteristics

Adds a new stream sink to the media sink.

Identifier for the new stream. The value is arbitrary but must be unique.

Pointer to the interface, specifying the media type for the stream. This parameter can be null.

Receives a reference to the new stream sink's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The specified stream identifier is not valid.

The media sink's Shutdown method has been called.

There is already a stream sink with the same stream identifier.

This media sink has a fixed set of stream sinks. New stream sinks cannot be added.

?

Not all media sinks support this method. If the media sink does not support this method, the method returns the MEDIASINK_FIXED_STREAMS flag.

If pMediaType is null, use the interface to set the media type. Call to get a reference to the interface.

ms694890 HRESULT IMFMediaSink::AddStreamSink([In] unsigned int dwStreamSinkIdentifier,[In, Optional] IMFMediaType* pMediaType,[Out] IMFStreamSink** ppStreamSink) IMFMediaSink::AddStreamSink

Removes a stream sink from the media sink.

Identifier of the stream to remove. The stream identifier is defined when you call to add the stream sink.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

This particular stream sink cannot be removed.

The stream number is not valid.

The media sink has not been initialized.

The media sink's Shutdown method has been called.

This media sink has a fixed set of stream sinks. Stream sinks cannot be removed.

?

After this method is called, the corresponding stream sink object is no longer valid. The and methods will no longer return that stream sink. You can re-use the stream identifier if you add another stream (by calling AddStreamSink).

Not all media sinks support this method. If the media sink does not support this method, the method returns the MEDIASINK_FIXED_STREAMS flag.

In some cases, the media sink supports this method but does not allow every stream sink to be removed. (For example, it might not allow stream 0 to be removed.)

ms705627 HRESULT IMFMediaSink::RemoveStreamSink([In] unsigned int dwStreamSinkIdentifier) IMFMediaSink::RemoveStreamSink

Gets the number of stream sinks on this media sink.

Receives the number of stream sinks.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media sink's Shutdown method has been called.

?

ms703020 HRESULT IMFMediaSink::GetStreamSinkCount([Out] unsigned int* pcStreamSinkCount) IMFMediaSink::GetStreamSinkCount

Gets a stream sink, specified by index.

Zero-based index of the stream. To get the number of streams, call .

Receives a reference to the stream's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid index.

The media sink's Shutdown method has been called.

?

Enumerating stream sinks is not a thread-safe operation, because stream sinks can be added or removed between calls to this method.

ms693512 HRESULT IMFMediaSink::GetStreamSinkByIndex([In] unsigned int dwIndex,[Out] IMFStreamSink** ppStreamSink) IMFMediaSink::GetStreamSinkByIndex

Gets a stream sink, specified by stream identifier.

Stream identifier of the stream sink.

Receives a reference to the stream's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The stream identifier is not valid.

The media sink's Shutdown method has been called.

?

If you add a stream sink by calling the method, the stream identifier is specified in the dwStreamSinkIdentifier parameter of that method. If the media sink has a fixed set of streams, the media sink assigns the stream identifiers.

To enumerate the streams by index number instead of stream identifier, call .

ms695360 HRESULT IMFMediaSink::GetStreamSinkById([In] unsigned int dwStreamSinkIdentifier,[Out] IMFStreamSink** ppStreamSink) IMFMediaSink::GetStreamSinkById

Sets the presentation clock on the media sink.

Pointer to the interface of the presentation clock, or null. If the value is null, the media sink stops listening to the presentaton clock that was previously set, if any.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The presentation clock does not have a time source. Call SetTimeSource on the presentation clock.

The media sink's Shutdown method has been called.

?

During streaming, the media sink attempts to match rates with the presentation clock. Ideally, the media sink presents samples at the correct time according to the presentation clock and does not fall behind. Rateless media sinks are an exception to this rule, as they consume samples as quickly as possible and ignore the clock. If the sink is rateless, the method returns the MEDIASINK_RATELESS flag.

The presentation clock must have a time source. Before calling this method, call on the presentation clock to set the presentation time source. Some media sinks provide time sources; therefore, the media sink might be the time source for its own presentation clock. Regardless of what object provides the time source, however, the media sink must attempt to match rates with the clock specified in pPresentationClock. If a media sink cannot match rates with an external time source, the media sink's method retrieves the MEDIASINK_CANNOT_MATCH_CLOCK flag. In this case, SetPresentationClock will still succeed, but the results will not be optimal. The sink might not render samples quickly enough to match rates with the presentation clock.

If pPresentationClock is non-null, the media sink must register for clock state notifications, by calling on the presentation clock. If the method is called again with a new presentation clock, or if pPresentationClock is null, the media sink must call to deregister itself from the previous clock.

All media sinks must support this method.

ms700160 HRESULT IMFMediaSink::SetPresentationClock([In, Optional] IMFPresentationClock* pPresentationClock) IMFMediaSink::SetPresentationClock

Gets the presentation clock that was set on the media sink.

Receives a reference to the presentation clock's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No clock has been set. To set the presentation clock, call .

The media sink's Shutdown method has been called.

?

ms705665 HRESULT IMFMediaSink::GetPresentationClock([Out] IMFPresentationClock** ppPresentationClock) IMFMediaSink::GetPresentationClock

Shuts down the media sink and releases the resources it is using.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media sink was shut down.

?

If the application creates the media sink, it is responsible for calling Shutdown to avoid memory or resource leaks. In most applications, however, the application creates an activation object for the media sink, and the Media Session uses that object to create the media sink. In that case, the Media Session ? not the application ? shuts down the media sink. (For more information, see Activation Objects.)

After this method returns, all methods on the media sink return , except for methods and methods. The sink will not raise any events after this method is called.

ms702084 HRESULT IMFMediaSink::Shutdown() IMFMediaSink::Shutdown

Gets the characteristics of the media sink.

The characteristics of a media sink are fixed throughout the life time of the sink.

ms701973 GetCharacteristics GetCharacteristics HRESULT IMFMediaSink::GetCharacteristics([Out] unsigned int* pdwCharacteristics)

Gets the number of stream sinks on this media sink.

ms703020 GetStreamSinkCount GetStreamSinkCount HRESULT IMFMediaSink::GetStreamSinkCount([Out] unsigned int* pcStreamSinkCount)

Gets the presentation clock that was set on the media sink.

ms705665 GetPresentationClock / SetPresentationClock GetPresentationClock HRESULT IMFMediaSink::GetPresentationClock([Out] IMFPresentationClock** ppPresentationClock)
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Notifies the media sink to asynchronously take any steps it needs to finish its tasks.

Pointer to the interface of an asynchronous object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Many archive media sinks have steps they need to do at the end of archiving to complete their file operations, such as updating the header (for some formats) or flushing all pending writes to disk. In some cases, this may include expensive operations such as indexing the content. BeginFinalize is an asynchronous way to initiate final tasks.

When the finalize operation is complete, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

ms705643 HRESULT IMFFinalizableMediaSink::BeginFinalize([In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFFinalizableMediaSink::BeginFinalize

Completes an asynchronous finalize operation.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Call this method after the method completes asynchronously.

ms694891 HRESULT IMFFinalizableMediaSink::EndFinalize([In] IMFAsyncResult* pResult) IMFFinalizableMediaSink::EndFinalize
No documentation. IDMOQualityControl IDMOQualityControl Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The SetNow method specifies the earliest time stamp that the DMO will deliver.

Reference time specifying the earliest time stamp to deliver.

Returns an value. Possible values include those in the following table.

Return codeDescription
E_FAIL

Failure

Success

?

If quality control is enabled, the DMO discards any samples whose time stamp is less than rtNow. Samples whose time stamp is rtNow or later are processed as efficiently as possible. Depending on the implementation, the DMO might drop some samples to keep pace.

If quality control is disabled, this method has no immediate effect. However, the DMO stores the specified reference time. It uses this value if quality control is enabled at a later time. To enable quality control, call the method.

If incoming samples are not time-stamped, the DMO never performs quality control. The application sets the time stamp in the method.

dd406841 HRESULT IDMOQualityControl::SetNow([In] longlong rtNow) IDMOQualityControl::SetNow

The SetStatus method enables or disables quality control.

Value that specifies whether to enable or disable quality control. Use to enable quality control, or zero to disable quality control.

Returns an value. Possible values include those in the following table.

Return codeDescription
E_INVALIDARG

Invalid argument

Success

?

With quality control enabled, the DMO attempts to deliver samples on time. It can skip late samples if necessary. With quality control disabled, the DMO delivers every sample. If you enable quality control, call the method to specify the earliest time stamp that the DMO should process. Otherwise, the call to SetStatus succeeds but the DMO does not perform quality control.

By default, quality control is disabled.

dd406842 HRESULT IDMOQualityControl::SetStatus([In] unsigned int dwFlags) IDMOQualityControl::SetStatus
No documentation. No documentation. No documentation. HRESULT IDMOQualityControl::GetStatus([Out] unsigned int* pdwFlags) IDMOQualityControl::GetStatus

The SetNow method specifies the earliest time stamp that the DMO will deliver.

If quality control is enabled, the DMO discards any samples whose time stamp is less than rtNow. Samples whose time stamp is rtNow or later are processed as efficiently as possible. Depending on the implementation, the DMO might drop some samples to keep pace.

If quality control is disabled, this method has no immediate effect. However, the DMO stores the specified reference time. It uses this value if quality control is enabled at a later time. To enable quality control, call the method.

If incoming samples are not time-stamped, the DMO never performs quality control. The application sets the time stamp in the method.

dd406841 SetNow SetNow HRESULT IDMOQualityControl::SetNow([In] longlong rtNow)
No documentation. GetStatus / SetStatus GetStatus HRESULT IDMOQualityControl::GetStatus([Out] unsigned int* pdwFlags) No documentation. IDMOVideoOutputOptimizations IDMOVideoOutputOptimizations Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The QueryOperationModePreferences method retrieves the DMO's preferred optimization features.

Zero-based index of an output stream on the DMO.

Pointer to a variable that receives the DMO's requested features. The returned value is a bitwise combination of zero or more flags from the DMO_VIDEO_OUTPUT_STREAM_FLAGS enumeration.

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index

E_POINTER

null reference argument

Success

?

dd406846 HRESULT IDMOVideoOutputOptimizations::QueryOperationModePreferences([In] unsigned int ulOutputStreamIndex,[Out] unsigned int* pdwRequestedCapabilities) IDMOVideoOutputOptimizations::QueryOperationModePreferences
No documentation. No documentation. No documentation. No documentation. HRESULT IDMOVideoOutputOptimizations::SetOperationMode([In] unsigned int ulOutputStreamIndex,[In] unsigned int dwEnabledFeatures) IDMOVideoOutputOptimizations::SetOperationMode

The GetCurrentOperationMode method retrieves the optimization features in effect.

Zero-based index of an output stream on the DMO.

Pointer to a variable that receives the current features. The returned value is a bitwise combination of zero or more flags from the DMO_VIDEO_OUTPUT_STREAM_FLAGS enumeration.

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index

E_POINTER

null reference argument

Success

?

dd406844 HRESULT IDMOVideoOutputOptimizations::GetCurrentOperationMode([In] unsigned int ulOutputStreamIndex,[Out] unsigned int* pdwEnabledFeatures) IDMOVideoOutputOptimizations::GetCurrentOperationMode
No documentation. No documentation. No documentation. No documentation. HRESULT IDMOVideoOutputOptimizations::GetCurrentSampleRequirements([In] unsigned int ulOutputStreamIndex,[Out] unsigned int* pdwRequestedFeatures) IDMOVideoOutputOptimizations::GetCurrentSampleRequirements No documentation. IEnumDMO IEnumDMO Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The Next method retrieves a specified number of items in the enumeration sequence.

Number of items to retrieve.

Array of size cItemsToFetch that is filled with the CLSIDs of the enumerated DMOs.

Array of size cItemsToFetch that is filled with the friendly names of the enumerated DMOs.

Pointer to a variable that receives the actual number of items retrieved. Can be null if cItemsToFetch equals 1.

Returns an value. Possible values include those in the following table.

Return codeDescription
E_INVALIDARG

Invalid argument.

E_OUTOFMEMORY

Insufficient memory.

E_POINTER

null reference argument.

S_FALSE

Retrieved fewer items than requested.

Retrieved the requested number of items.

?

If the method succeeds, the arrays given by the pCLSID and Names parameters are filled with CLSIDs and wide-character strings. The value of *pcItemsFetched specifies the number of items returned in these arrays.

The method returns if it retrieves the requested number of items (in other words, if *pcItemsFetched equals cItemsToFetch). Otherwise, it returns S_FALSE or an error code.

The caller must free the memory allocated for each string returned in the Names parameter, using the CoTaskMemFree function.

dd376587 HRESULT IEnumDMO::Next([In] unsigned int cItemsToFetch,[Out, Buffer] GUID* pCLSID,[Out, Buffer] wchar_t** Names,[Out] unsigned int* pcItemsFetched) IEnumDMO::Next

The Skip method skips over a specified number of items in the enumeration sequence.

Number of items to skip.

Returns if the number items skipped equals cItemsToSkip. Otherwise, returns S_FALSE.

dd376589 HRESULT IEnumDMO::Skip([In] unsigned int cItemsToSkip) IEnumDMO::Skip

The Reset method resets the enumeration sequence to the beginning.

Returns .

dd376588 HRESULT IEnumDMO::Reset() IEnumDMO::Reset

This method is not implemented.

Reserved.

Returns E_NOTIMPL.

dd376586 HRESULT IEnumDMO::Clone([Out] IEnumDMO** ppEnum) IEnumDMO::Clone

The GetBufferAndLength method retrieves the buffer and the size of the valid data in the buffer.

Either parameter can be null, in which case it does not receive a value. At least one parameter must be non-null. If both parameters are null, the method returns E_POINTER.

The value returned in the pcbLength parameter is the size of the valid data in the buffer, not the buffer's allocated size. To obtain the buffer's allocated size, call the method.

dd390167 IMediaBuffer IMediaBuffer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The SetLength method specifies the length of the data currently in the buffer.

Size of the data, in bytes. The value must not exceed the buffer's maximum size. Call the method to obtain the maximum size.

Returns if successful. Otherwise, returns an value indicating the cause of the error.

This method sets the size of the valid data currently in the buffer, not the buffer's allocated size.

dd390169 HRESULT IMediaBuffer::SetLength([In] unsigned int cbLength) IMediaBuffer::SetLength
No documentation. No documentation. No documentation. HRESULT IMediaBuffer::GetMaxLength([Out] unsigned int* pcbMaxLength) IMediaBuffer::GetMaxLength

The GetBufferAndLength method retrieves the buffer and the size of the valid data in the buffer.

Address of a reference that receives the buffer array. Can be null if pcbLength is not null.

Pointer to a variable that receives the size of the valid data, in bytes. Can be null if ppBuffer is not null.

Returns an value. Possible values include those in the following table.

Return codeDescription
E_POINTER

null reference argument

Success

?

Either parameter can be null, in which case it does not receive a value. At least one parameter must be non-null. If both parameters are null, the method returns E_POINTER.

The value returned in the pcbLength parameter is the size of the valid data in the buffer, not the buffer's allocated size. To obtain the buffer's allocated size, call the method.

dd390167 HRESULT IMediaBuffer::GetBufferAndLength([Out, Buffer, Optional] unsigned char** ppBuffer,[Out, Optional] unsigned int* pcbLength) IMediaBuffer::GetBufferAndLength

The SetLength method specifies the length of the data currently in the buffer.

This method sets the size of the valid data currently in the buffer, not the buffer's allocated size.

dd390169 SetLength SetLength HRESULT IMediaBuffer::SetLength([In] unsigned int cbLength)
No documentation. GetMaxLength GetMaxLength HRESULT IMediaBuffer::GetMaxLength([Out] unsigned int* pcbMaxLength)

The interface provides methods for manipulating a Microsoft DirectX Media Object (DMO).

dd406926 IMediaObject IMediaObject
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The GetStreamCount method retrieves the number of input and output streams.

Pointer to a variable that receives the number of input streams. Cannot be null.

Pointer to a variable that receives the number of output streams. Cannot be null.

Returns an value. Possible values include those in the following table.

Return codeDescription
E_POINTER

null reference argument

Success

?

The DMO might have zero input streams or zero output streams. The number of streams does not change; a DMO cannot dynamically add or remove streams.

dd406957 HRESULT IMediaObject::GetStreamCount([Out] unsigned int* pcInputStreams,[Out] unsigned int* pcOutputStreams) IMediaObject::GetStreamCount

The GetInputStreamInfo method retrieves information about an input stream, such as any restrictions on the number of samples per buffer, and whether the stream performs lookahead on the input data. This information never changes.

Zero-based index of an input stream on the DMO.

Pointer to a variable that receives a bitwise combination of zero or more DMO_INPUT_STREAM_INFO_FLAGS flags.

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index

E_POINTER

null reference argument

Success

?

The flag indicates that the DMO performs lookahead on the incoming data.

The application must be sure to allocate sufficient buffers for the DMO to process the input. Call the method to determine the buffer requirements.

dd406951 HRESULT IMediaObject::GetInputStreamInfo([In] unsigned int dwInputStreamIndex,[Out] unsigned int* pdwFlags) IMediaObject::GetInputStreamInfo
No documentation. No documentation. No documentation. No documentation. HRESULT IMediaObject::GetOutputStreamInfo([In] unsigned int dwOutputStreamIndex,[Out] unsigned int* pdwFlags) IMediaObject::GetOutputStreamInfo

The GetInputType method retrieves a preferred media type for a specified input stream.

Zero-based index of an input stream on the DMO.

Zero-based index on the set of acceptable media types.

Pointer to a structure allocated by the caller, or null. If this parameter is non-null, the method fills the structure with the media type. You can use the value null to test whether the type index is in range, by checking the return code.

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index.

DMO_E_NO_MORE_ITEMS

Type index is out of range.

E_OUTOFMEMORY

Insufficient memory.

E_POINTER

null reference argument.

Success.

?

Call this method to enumerate an input stream's preferred media types. The DMO assigns each media type an index value in order of preference. The most preferred type has an index of zero. To enumerate all the types, make successive calls while incrementing the type index until the method returns DMO_E_NO_MORE_ITEMS. The DMO is not guaranteed to enumerate every media type that it supports.

The format block in the returned type might be null. If so, the format type is GUID_NULL. Check the format type before dereferencing the format block.

If the method succeeds, call MoFreeMediaType to free the format block. (This function is also safe to call when the format block is null.)

To set the media type, call the method. Setting the media type on one stream can change another stream's preferred types. In fact, a stream might not have a preferred type until the type is set on another stream. For example, a decoder might not have a preferred output type until the input type is set. However, the DMO is not required to update its preferred types dynamically in this fashion. Thus, the types returned by this method are not guaranteed to be valid; they might fail when used in the SetInputType method.

To test whether a particular media type is acceptable, call SetInputType with the flag.

To test whether the dwTypeIndex parameter is in range, set pmt to null. The method returns if the index is in range, or DMO_E_NO_MORE_ITEMS if the index is out of range.

dd406952 HRESULT IMediaObject::GetInputType([In] unsigned int dwInputStreamIndex,[In] unsigned int dwTypeIndex,[Out, Optional] DMO_MEDIA_TYPE* pmt) IMediaObject::GetInputType
No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT IMediaObject::GetOutputType([In] unsigned int dwOutputStreamIndex,[In] unsigned int dwTypeIndex,[Out, Optional] DMO_MEDIA_TYPE* pmt) IMediaObject::GetOutputType

The SetInputType method sets the media type on an input stream, or tests whether a media type is acceptable.

Zero-based index of an input stream on the DMO.

Pointer to a structure that specifies the media type.

Bitwise combination of zero or more flags from the DMO_SET_TYPE_FLAGS enumeration.

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index

DMO_E_TYPE_NOT_ACCEPTED

Media type was not accepted

S_FALSE

Media type is not acceptable

Media type was set successfully, or is acceptable

?

Call this method to test, set, or clear the media type on an input stream:

  • To test the media type without setting it, use the flag. If the media type is not acceptable, the method returns S_FALSE.
  • To set the media type, set dwFlags to zero. If the media type is not acceptable, the method returns DMO_E_TYPE_NOT_ACCEPTED.
  • To clear the current media type (if any), use the flag and set pmt to null. When the method returns, the stream no longer has a media type. The DMO cannot process samples until the application sets a new media type.

The media types that are currently set on other streams can affect whether the media type is acceptable.

dd406962 HRESULT IMediaObject::SetInputType([In] unsigned int dwInputStreamIndex,[In, Optional] const DMO_MEDIA_TYPE* pmt,[In] unsigned int dwFlags) IMediaObject::SetInputType

The SetOutputType method sets the media type on an output stream, or tests whether a media type is acceptable.

Zero-based index of an output stream on the DMO.

Pointer to a structure that specifies the media type.

Bitwise combination of zero or more flags from the DMO_SET_TYPE_FLAGS enumeration.

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index

DMO_E_TYPE_NOT_ACCEPTED

Media type was not accepted

S_FALSE

Media type is not acceptable

Media type was set successfully, or is acceptable

?

Call this method to test, set, or clear the media type on an output stream:

  • To test the media type without setting it, use the flag. If the media type is not acceptable, the method returns S_FALSE.
  • To set the media type, set dwFlags to zero. If the media type is not acceptable, the method returns DMO_E_TYPE_NOT_ACCEPTED.
  • To clear the current media type (if any), use the flag and set pmt to null. When the method returns, the stream no longer has a media type. The DMO cannot process samples until the application sets a new media type, unless the stream is optional.

The media types that are currently set on other streams can affect whether the media type is acceptable.

dd406963 HRESULT IMediaObject::SetOutputType([In] unsigned int dwOutputStreamIndex,[In, Optional] const DMO_MEDIA_TYPE* pmt,[In] unsigned int dwFlags) IMediaObject::SetOutputType

The GetInputCurrentType method retrieves the media type that was set for an input stream, if any.

Zero-based index of an input stream on the DMO.

Pointer to a structure allocated by the caller. The method fills the structure with the media type.

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index.

DMO_E_TYPE_NOT_SET

Media type was not set.

E_OUTOFMEMORY

Insufficient memory.

Success.

?

The caller must set the media type for the stream before calling this method. To set the media type, call the method.

If the method succeeds, call MoFreeMediaType to free the format block.

dd406947 HRESULT IMediaObject::GetInputCurrentType([In] unsigned int dwInputStreamIndex,[Out] DMO_MEDIA_TYPE* pmt) IMediaObject::GetInputCurrentType

The GetOutputCurrentType method retrieves the media type that was set for an output stream, if any.

Zero-based index of an output stream on the DMO.

Pointer to a structure allocated by the caller. The method fills the structure with the media type.

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index.

DMO_E_TYPE_NOT_SET

Media type was not set.

E_OUTOFMEMORY

Insufficient memory.

Success.

?

The caller must set the media type for the stream before calling this method. To set the media type, call the method.

If the method succeeds, call MoFreeMediaType to free the format block.

dd406953 HRESULT IMediaObject::GetOutputCurrentType([In] unsigned int dwOutputStreamIndex,[Out] DMO_MEDIA_TYPE* pmt) IMediaObject::GetOutputCurrentType
No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT IMediaObject::GetInputSizeInfo([In] unsigned int dwInputStreamIndex,[Out] unsigned int* pcbSize,[Out] unsigned int* pcbMaxLookahead,[Out] unsigned int* pcbAlignment) IMediaObject::GetInputSizeInfo No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT IMediaObject::GetOutputSizeInfo([In] unsigned int dwOutputStreamIndex,[Out] unsigned int* pcbSize,[Out] unsigned int* pcbAlignment) IMediaObject::GetOutputSizeInfo No documentation. No documentation. No documentation. No documentation. HRESULT IMediaObject::GetInputMaxLatency([In] unsigned int dwInputStreamIndex,[Out] longlong* prtMaxLatency) IMediaObject::GetInputMaxLatency No documentation. No documentation. No documentation. No documentation. HRESULT IMediaObject::SetInputMaxLatency([In] unsigned int dwInputStreamIndex,[In] longlong rtMaxLatency) IMediaObject::SetInputMaxLatency No documentation. No documentation. HRESULT IMediaObject::Flush() IMediaObject::Flush

The Discontinuity method signals a discontinuity on the specified input stream.

Zero-based index of an input stream on the DMO.

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index

DMO_E_NOTACCEPTING

The DMO is not accepting input.

DMO_E_TYPE_NOT_SET

The input and output types have not been set.

Success

?

A discontinuity represents a break in the input. A discontinuity might occur because no more data is expected, the format is changing, or there is a gap in the data. After a discontinuity, the DMO does not accept further input on that stream until all pending data has been processed. The application should call the method until none of the streams returns the flag.

This method might fail if it is called before the client sets the input and output types on the DMO.

dd406944 HRESULT IMediaObject::Discontinuity([In] unsigned int dwInputStreamIndex) IMediaObject::Discontinuity

The AllocateStreamingResources method allocates any resources needed by the DMO. Calling this method is always optional.

Returns if successful. Otherwise, returns an value indicating the cause of the error.

An application can call this method as a streaming optimization. It gives the DMO an opportunity to perform any time-consuming initializations before streaming begins. If you call this method, do so after you set the media types on the DMO, but before you make the first calls to ProcessInput or ProcessOutput.

This method is optional in the following sense:

  • If the DMO does not support this method, the method returns .
  • If the application never calls this method, the DMO allocates resources within a call to or .

If the DMO supports this method, it should also support the method.

dd406943 HRESULT IMediaObject::AllocateStreamingResources() IMediaObject::AllocateStreamingResources

The FreeStreamingResources method frees resources allocated by the DMO. Calling this method is always optional.

Returns if successful. Otherwise, returns an value indicating the cause of the error.

This method releases any resources that the method initializes.

If the DMO does not support this method, the method returns . If you call this method during streaming, the method fails and the DMO does not release any resources.

Regardless of whether the method fails or succeeds, the application can continue to call other methods on the DMO. The DMO might need to re-initialize resources that were previously freed.

dd406946 HRESULT IMediaObject::FreeStreamingResources() IMediaObject::FreeStreamingResources

The GetInputStatus method queries whether an input stream can accept more input data.

Zero-based index of an input stream on the DMO.

Pointer to a variable that receives either zero or .

Returns an value. Possible values include those in the following table.

Return codeDescription
DMO_E_INVALIDSTREAMINDEX

Invalid stream index

Success

?

If the input stream will accept more data, the method returns the flag in the dwFlags parameter. Otherwise, it sets this parameter to zero. If the stream will accept more data, the application can call the method.

The status of an input stream can change only as the result of one of the following method calls.

Method Description
Signals a discontinuity on the specified input stream.
Flushes all internally buffered data.
Delivers a buffer to the specified input stream.
Generates output from the current input data.

?

dd406950 HRESULT IMediaObject::GetInputStatus([In] unsigned int dwInputStreamIndex,[Out] unsigned int* dwFlags) IMediaObject::GetInputStatus
No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT IMediaObject::ProcessInput([In] unsigned int dwInputStreamIndex,[In] IMediaBuffer* pBuffer,[In] unsigned int dwFlags,[In] longlong rtTimestamp,[In] longlong rtTimelength) IMediaObject::ProcessInput

The ProcessOutput method generates output from the current input data.

Bitwise combination of zero or more flags from the DMO_PROCESS_OUTPUT_FLAGS enumeration.

Number of output buffers.

Pointer to an array of structures containing the output buffers. Specify the size of the array in the cOutputBufferCount parameter.

Pointer to a variable that receives a reserved value (zero). The application should ignore this value.

Returns an value. Possible values include those in the following table.

Return codeDescription
E_FAIL

Failure

E_INVALIDARG

Invalid argument

E_POINTER

null reference argument

S_FALSE

No output was generated

Success

?

The pOutputBuffers parameter points to an array of structures. The application must allocate one structure for each output stream. To determine the number of output streams, call the method. Set the cOutputBufferCount parameter to this number.

Each structure contains a reference to a buffer's interface. The application allocates these buffers. The other members of the structure are status fields. The DMO sets these fields if the method succeeds. If the method fails, their values are undefined.

When the application calls ProcessOutput, the DMO processes as much input data as possible. It writes the output data to the output buffers, starting from the end of the data in each buffer. (To find the end of the data, call the method.) The DMO never holds a reference count on an output buffer.

If the DMO fills an entire output buffer and still has input data to process, the DMO returns the flag in the structure. The application should check for this flag by testing the dwStatus member of each structure.

If the method returns S_FALSE, no output was generated. However, a DMO is not required to return S_FALSE in this situation; it might return .

Discarding data:

You can discard data from a stream by setting the flag in the dwFlags parameter. For each stream that you want to discard, set the pBuffer member of the structure to null.

For each stream in which pBuffer is null:

  • If the flag is set, and the stream is discardable or optional, the DMO discards the data.
  • If the flag is set but the stream is neither discardable nor optional, the DMO discards the data if possible. It is not guaranteed to discard the data.
  • If the flag is not set, the DMO does not produce output data for that stream, but does not discard the data.

To check whether a stream is discardable or optional, call the method.

dd406960 HRESULT IMediaObject::ProcessOutput([In] unsigned int dwFlags,[In] unsigned int cOutputBufferCount,[Out, Buffer] DMO_OUTPUT_DATA_BUFFER* pOutputBuffers,[Out] unsigned int* pdwStatus) IMediaObject::ProcessOutput

The Lock method acquires or releases a lock on the DMO. Call this method to keep the DMO serialized when performing multiple operations.

Value that specifies whether to acquire or release the lock. If the value is non-zero, a lock is acquired. If the value is zero, the lock is released.

Returns an value. Possible values include those in the following table.

Return codeDescription
E_FAIL

Failure

Success

?

This method prevents other threads from calling methods on the DMO. If another thread calls a method on the DMO, the thread blocks until the lock is released.

If you are using the Active Template Library (ATL) to implement a DMO, the name of the Lock method conflicts with the CComObjectRootEx::Lock method. To work around this problem, define the preprocessor symbol FIX_LOCK_NAME before including the header file Dmo.h:

 #define FIX_LOCK_NAME	
            #include <dmo.h>	
            

This directive causes the preprocessor to rename the method to DMOLock. In your DMO, implement the method as DMOLock. In your implementation, call the ATL Lock or Unlock method, depending on the value of bLock. Applications can still invoke the method using the name Lock because the vtable order does not change.

dd406958 HRESULT IMediaObject::Lock([In] int bLock) IMediaObject::Lock
No documentation. IMediaObjectInPlace IMediaObjectInPlace Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The Process method processes a block of data. The application supplies a reference to a block of input data. The DMO processes the data in place.

Size of the data, in bytes.

Pointer to a buffer of size ulSize. On input, the buffer holds the input data. If the method returns successfully, the buffer contains the output data.

Start time of the data.

Either or . See Remarks for more information.

Returns an value. Possible values include those in the following table.

Return codeDescription
E_FAIL

Failure

S_FALSE

Success. There is still data to process.

Success. There is no remaining data to process.

?

If the method fails, the buffer might contain garbage. The application should not use the contents of the buffer.

The DMO might produce output data beyond the length of the input data. This is called an effect tail. For example, a reverb effect continues after the input reaches silence. If the DMO has an effect tail, this method returns S_FALSE.

While the application has input data for processing, call the Process method with the dwFlags parameter set to . If the last such call returns S_FALSE, call Process again, this time with a zeroed input buffer and the flag. The DMO will now fill the zeroed buffer with the effect tail. Continue calling Process in this way until the return value is , indicating that the DMO has finished processing the effect tail.

If the DMO has no effect tail, this method returns S_TRUE or an error code.

dd406942 HRESULT IMediaObjectInPlace::Process([In] unsigned int ulSize,[Out, Buffer] unsigned char* pData,[In] longlong refTimeStart,[In] unsigned int dwFlags) IMediaObjectInPlace::Process

The Clone method creates a copy of the DMO in its current state.

Address of a reference to receive the new DMO's interface.

Returns if successful. Otherwise, returns an value indicating the cause of the error.

If the method succeeds, the interface that it returns has an outstanding reference count. Be sure to release the interface when you are finished using it.

dd406940 HRESULT IMediaObjectInPlace::Clone([Out] IMediaObjectInPlace** ppMediaObject) IMediaObjectInPlace::Clone

The GetLatency method retrieves the latency introduced by this DMO.

Pointer to a variable that receives the latency, in 100-nanosecond units.

Returns if successful. Otherwise, returns an value indicating the cause of the error.

This method returns the average time required to process each buffer. This value usually depends on factors in the run-time environment, such as the processor speed and the CPU load. One possible way to implement this method is for the DMO to keep a running average based on historical data.

dd406941 HRESULT IMediaObjectInPlace::GetLatency([Out] longlong* pLatencyTime) IMediaObjectInPlace::GetLatency

The GetLatency method retrieves the latency introduced by this DMO.

This method returns the average time required to process each buffer. This value usually depends on factors in the run-time environment, such as the processor speed and the CPU load. One possible way to implement this method is for the DMO to keep a running average based on historical data.

dd406941 GetLatency GetLatency HRESULT IMediaObjectInPlace::GetLatency([Out] longlong* pLatencyTime)

Enables other components in the protected media path (PMP) to use the input protection system provided by an input trust authorities (ITA). An ITA is a component that implements an input protection system for media content. ITAs expose the interface.

An ITA translates policy from the content's native format into a common format that is used by other PMP components. It also provides a decrypter, if one is needed to decrypt the stream.

The topology contains one ITA instance for every protected stream in the media source. The ITA is obtained from the media source by calling .

ms697500 IMFInputTrustAuthority IMFInputTrustAuthority
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a decrypter transform.

Interface identifier (IID) of the interface being requested. Currently this value must be IID_IMFTransform, which requests the interface.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOINTERFACE

The decrypter does not support the requested interface.

This input trust authority (ITA) does not provide a decrypter.

?

The decrypter should be created in a disabled state, where any calls to automatically fail. After the input trust authority (ITA) has verified that it is running inside the protected media path (PMP), the ITA should enable the decrypter.

An ITA is not required to provide a decrypter. If the source content is not encrypted, the method should return . The PMP will then proceed without using a decrypter for that stream.

The ITA must create a new instance of its decrypter for each call to GetDecrypter. Do not return multiple references to the same decrypter. They must be separate instances because the Media Session might place them in two different branches of the topology.

bb970385 HRESULT IMFInputTrustAuthority::GetDecrypter([In] const GUID& riid,[Out] void** ppv) IMFInputTrustAuthority::GetDecrypter

Requests permission to perform a specified action on the stream.

The requested action, specified as a member of the enumeration.

Receives the value null or a reference to the interface. The interface is used to create a content enabler object. The caller must release the interface. For more information, see Remarks.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The user has permission to perform this action.

NS_E_DRM_NEEDS_INDIVIDUALIZATION

The user must individualize the application.

NS_E_LICENSE_REQUIRED

The user must obtain a license.

?

This method verifies whether the user has permission to perform a specified action on the stream. The ITA does any work needed to verify the user's right to perform the action, such as checking licenses.

To verify the user's rights, the ITA might need to perform additional steps that require interaction with the user or consent from the user. For example, it might need to acquire a new license or individualize a DRM component. In that case, the ITA creates an activation object for a content enabler and returns the activation object's interface in the ppContentEnablerActivate parameter. The activation object is responsible for creating a content enabler that exposes the interface. The content enabler is used as follows:

  1. The Media Session returns the reference to the application.

  2. The application calls to activate the content enabler.

  3. The application calls methods to perform whatever actions are needed, such as individualization or obtaining a license. The content enabler object must encapsulate this functionality through the interface.

  4. The Media Session calls RequestAccess again.

The return value signals whether the user has permission to perform the action:

  • If the user already has permission to perform the action, the method returns and sets *ppContentEnablerActivate to null.

  • If the user does not have permission, the method returns a failure code and sets *ppContentEnablerActivate to null.

  • If the ITA must perform additional steps that require interaction with the user, the method returns a failure code and returns the content enabler's reference in ppContentEnablerActivate.

The Media Session will not allow the action unless this method returns . However, a return value of does not guarantee that the action will be performed, because some other failure might occur after this method is called. When the action is definitely about to happen, the Media Session calls .

A stream can go to multiple outputs, so this method might be called multiple times with different actions, once for every output.

bb970453 HRESULT IMFInputTrustAuthority::RequestAccess([In] MFPOLICYMANAGER_ACTION Action,[Out] IMFActivate** ppContentEnablerActivate) IMFInputTrustAuthority::RequestAccess

Retrieves the policy that defines which output protection systems are allowed for this stream, and the configuration data for each protection system.

The action that will be performed on this stream, specified as a member of the enumeration.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970400 HRESULT IMFInputTrustAuthority::GetPolicy([In] MFPOLICYMANAGER_ACTION Action,[Out] IMFOutputPolicy** ppPolicy) IMFInputTrustAuthority::GetPolicy

Notifies the input trust authority (ITA) that a requested action is about to be performed.

Pointer to an structure that contains parameters for the BindAccess action.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Before calling this method, the Media Session calls to request an action. The BindAccess method notifies the ITA that the action is definitely about to occur, so that the ITA can update its internal state as needed. If the method returns a failure code, the Media Session cancels the action.

ms701551 HRESULT IMFInputTrustAuthority::BindAccess([In] MFINPUTTRUSTAUTHORITY_ACCESS_PARAMS* pParam) IMFInputTrustAuthority::BindAccess

Notifies the input trust authority (ITA) when the number of output trust authorities (OTAs) that will perform a specified action has changed.

Pointer to an structure that contains parameters for the UpdateAccess action.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The ITA can update its internal state if needed. If the method returns a failure code, the Media Session cancels the action.

ms697037 HRESULT IMFInputTrustAuthority::UpdateAccess([In] MFINPUTTRUSTAUTHORITY_ACCESS_PARAMS* pParam) IMFInputTrustAuthority::UpdateAccess

Resets the input trust authority (ITA) to its initial state.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

When this method is called, the ITA should disable any decrypter that was returned in the method.

ms703015 HRESULT IMFInputTrustAuthority::Reset() IMFInputTrustAuthority::Reset

Registers one or more Media Foundation transforms (MFTs) in the caller's process.

This method is similar to the function. It registers one or more MFTs in the caller's process. These MFTs can be enumerated by calling the function with the flag.

Unlike , however, this method also makes the MFT available in the Protected Media Path (PMP) process, and is therefore useful if you are using the Media Session inside the PMP. For more information, see the following topics:

  • Protected Media Path
dd374223 IMFLocalMFTRegistration IMFLocalMFTRegistration
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Registers one or more Media Foundation transforms (MFTs) in the caller's process.

A reference to an array of structures.

The number of elements in the pMFTs array.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method is similar to the function. It registers one or more MFTs in the caller's process. These MFTs can be enumerated by calling the function with the flag.

Unlike , however, this method also makes the MFT available in the Protected Media Path (PMP) process, and is therefore useful if you are using the Media Session inside the PMP. For more information, see the following topics:

  • Protected Media Path
dd374223 HRESULT IMFLocalMFTRegistration::RegisterMFTs([In, Buffer] MFT_REGISTRATION_INFO* pMFTs,[In] unsigned int cMFTs) IMFLocalMFTRegistration::RegisterMFTs

Represents a block of memory that contains media data. Use this interface to access the data in the buffer.

If the buffer contains 2-D image data (such as an uncompressed video frame), you should query the buffer for the interface. The methods on are optimized for 2-D data.

To get a buffer from a media sample, call one of the following methods:

To create a new buffer object, use one of the following functions.

FunctionDescription
Creates a buffer and allocates system memory.
Creates a media buffer that wraps an existing media buffer.
Creates a buffer that manages a DirectX surface.
Creates a buffer and allocates system memory with a specified alignment.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms696261 IMFMediaBuffer IMFMediaBuffer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gives the caller access to the memory in the buffer, for reading or writing

Receives the maximum amount of data that can be written to the buffer. This parameter can be null. The same value is returned by the method.

Receives the length of the valid data in the buffer, in bytes. This parameter can be null. The same value is returned by the method.

Receives a reference to the start of the buffer.

This method gives the caller access to the entire buffer, up to the maximum size returned in the pcbMaxLength parameter. The value returned in pcbCurrentLength is the size of any valid data already in the buffer, which might be less than the total buffer size.

The reference returned in ppbBuffer is guaranteed to be valid, and can safely be accessed across the entire buffer for as long as the lock is held. When you are done accessing the buffer, call to unlock the buffer. You must call Unlock once for each call to Lock. After you unlock the buffer, the reference returned in ppbBuffer is no longer valid, and should not be used. Generally, it is best to call Lock only when you need to access the buffer memory, and not earlier.

Locking the buffer does not prevent other threads from calling Lock, so you should not rely on this method to synchronize threads.

This method does not allocate any memory, or transfer ownership of the memory to the caller. Do not release or free the memory; the media buffer will free the memory when the media buffer is destroyed.

If you modify the contents of the buffer, update the current length by calling .

If the buffer supports the interface, you should use the method to lock the buffer. For 2-D buffers, the Lock2D method is more efficient than the Lock method. If the buffer is locked using Lock2D, the Lock method might return .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970366 HRESULT IMFMediaBuffer::Lock([Out] void** ppbBuffer,[Out, Optional] unsigned int* pcbMaxLength,[Out, Optional] unsigned int* pcbCurrentLength) IMFMediaBuffer::Lock

Unlocks a buffer that was previously locked. Call this method once for every call to .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

For Direct3D surface buffers, an error occurred when unlocking the surface.

?

It is an error to call Unlock if you did not call Lock previously.

After calling this method, do not use the reference returned by the Lock method. It is no longer guaranteed to be valid.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms696259 HRESULT IMFMediaBuffer::Unlock() IMFMediaBuffer::Unlock

Retrieves the length of the valid data in the buffer.

Receives the length of the valid data, in bytes. If the buffer does not contain any valid data, the value is zero.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698987 HRESULT IMFMediaBuffer::GetCurrentLength([Out] unsigned int* pcbCurrentLength) IMFMediaBuffer::GetCurrentLength

Sets the length of the valid data in the buffer.

Length of the valid data, in bytes. This value cannot be greater than the allocated size of the buffer, which is returned by the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The specified length is greater than the maximum size of the buffer.

?

Call this method if you write data into the buffer.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703202 HRESULT IMFMediaBuffer::SetCurrentLength([In] unsigned int cbCurrentLength) IMFMediaBuffer::SetCurrentLength

Retrieves the allocated size of the buffer.

Receives the allocated size of the buffer, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The buffer might or might not contain any valid data, and if there is valid data in the buffer, it might be smaller than the buffer's allocated size. To get the length of the valid data, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704840 HRESULT IMFMediaBuffer::GetMaxLength([Out] unsigned int* pcbMaxLength) IMFMediaBuffer::GetMaxLength

Retrieves the length of the valid data in the buffer.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698987 GetCurrentLength / SetCurrentLength GetCurrentLength HRESULT IMFMediaBuffer::GetCurrentLength([Out] unsigned int* pcbCurrentLength)

Retrieves the allocated size of the buffer.

The buffer might or might not contain any valid data, and if there is valid data in the buffer, it might be smaller than the buffer's allocated size. To get the length of the valid data, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704840 GetMaxLength GetMaxLength HRESULT IMFMediaBuffer::GetMaxLength([Out] unsigned int* pcbMaxLength)

Represents an event generated by a Media Foundation object. Use this interface to get information about the event.

To get a reference to this interface, call or on the event generator.

If you are implementing an object that generates events, call the function to create a new event object.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms702249 IMFMediaEvent IMFMediaEvent
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the event type. The event type indicates what happened to trigger the event. It also defines the meaning of the event value.

Receives the event type. For a list of event types, see Media Foundation Events.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms702255 HRESULT IMFMediaEvent::GetType([Out] MEDIA_EVENT_TYPES* pmet) IMFMediaEvent::GetType

Retrieves the extended type of the event.

Receives a that identifies the extended type.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

To define a custom event, create a new extended-type and send an event with that .

Some standard Media Foundation events also use the extended type to differentiate between types of event data.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697235 HRESULT IMFMediaEvent::GetExtendedType([Out] GUID* pguidExtendedType) IMFMediaEvent::GetExtendedType

Retrieves an that specifies the event status.

Receives the event status. If the operation that generated the event was successful, the value is a success code. A failure code means that an error condition triggered the event.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704650 HRESULT IMFMediaEvent::GetStatus([Out] HRESULT* phrStatus) IMFMediaEvent::GetStatus

Retrieves the value associated with the event, if any. The value is retrieved as a structure. The actual data type and the meaning of the value depend on the event.

Pointer to a structure. The method fills this structure with the data.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Before calling this method, call PropVariantInit to initialize the structure. After the method returns, call PropVariantClear to free the memory that was allocated for the data.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms693864 HRESULT IMFMediaEvent::GetValue([Out] PROPVARIANT* pvValue) IMFMediaEvent::GetValue

Retrieves the event type. The event type indicates what happened to trigger the event. It also defines the meaning of the event value.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms702255 GetType GetType HRESULT IMFMediaEvent::GetType([Out] MEDIA_EVENT_TYPES* pmet)

Retrieves the extended type of the event.

To define a custom event, create a new extended-type and send an event with that .

Some standard Media Foundation events also use the extended type to differentiate between types of event data.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697235 GetExtendedType GetExtendedType HRESULT IMFMediaEvent::GetExtendedType([Out] GUID* pguidExtendedType)

Retrieves an that specifies the event status.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704650 GetStatus GetStatus HRESULT IMFMediaEvent::GetStatus([Out] HRESULT* phrStatus)

Retrieves the value associated with the event, if any. The value is retrieved as a structure. The actual data type and the meaning of the value depend on the event.

Before calling this method, call PropVariantInit to initialize the structure. After the method returns, call PropVariantClear to free the memory that was allocated for the data.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms693864 GetValue GetValue HRESULT IMFMediaEvent::GetValue([Out] PROPVARIANT* pvValue)

Retrieves events from any Media Foundation object that generates events.

An object that supports this interface maintains a queue of events. The client of the object can retrieve the events either synchronously or asynchronously. The synchronous method is GetEvent. The asynchronous methods are BeginGetEvent and EndGetEvent.

ms701755 IMFMediaEventGenerator IMFMediaEventGenerator
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the next event in the queue. This method is synchronous.

Specifies one of the following values.

ValueMeaning
0

The method blocks until the event generator queues an event.

MF_EVENT_FLAG_NO_WAIT

The method returns immediately.

?

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

null reference argument.

There is a pending request.

There are no events in the queue.

The object was shut down.

?

This method executes synchronously.

If the queue already contains an event, the method returns immediately. If the queue does not contain an event, the behavior depends on the value of dwFlags:

  • If dwFlags is 0, the method blocks indefinitely until a new event is queued, or until the event generator is shut down.

  • If dwFlags is MF_EVENT_FLAG_NO_WAIT, the method fails immediately with the return code .

This method returns if you previously called and have not yet called .

ms704754 HRESULT IMFMediaEventGenerator::GetEvent([In] unsigned int dwFlags,[Out] IMFMediaEvent** ppEvent) IMFMediaEventGenerator::GetEvent

Begins an asynchronous request for the next event in the queue.

Pointer to the interface of a callback object. The client must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

null reference argument.

There is a pending request with the same callback reference and a different state object.

There is a pending request with a different callback reference.

The object was shut down.

MF_S_MULTIPLE_BEGIN

There is a pending request with the same callback reference and state object.

?

When a new event is available, the event generator calls the method. The Invoke method should call to get a reference to the interface, and use that interface to examine the event.

Do not call BeginGetEvent a second time before calling EndGetEvent. While the first call is still pending, additional calls to the same object will fail. Also, the method fails if an asynchronous request is still pending.

ms701637 HRESULT IMFMediaEventGenerator::BeginGetEvent([In] IMFAsyncCallback* pCallback,[In] void* punkState) IMFMediaEventGenerator::BeginGetEvent

Completes an asynchronous request for the next event in the queue.

Pointer to the interface. Pass in the same reference that your callback object received in the Invoke method.

Receives a reference to the interface. The caller must release the interface.

Call this method from inside your application's method. For example code, see .

ms698866 HRESULT IMFMediaEventGenerator::EndGetEvent([In] IMFAsyncResult* pResult,[Out] IMFMediaEvent** ppEvent) IMFMediaEventGenerator::EndGetEvent

Puts a new event in the object's queue.

Specifies the event type. The event type is returned by the event's method. For a list of event types, see Media Foundation Events.

The extended type. If the event does not have an extended type, use the value GUID_NULL. The extended type is returned by the event's method.

A success or failure code indicating the status of the event. This value is returned by the event's method.

Pointer to a that contains the event value. This parameter can be null. This value is returned by the event's method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The object was shut down.

?

ms696255 HRESULT IMFMediaEventGenerator::QueueEvent([In] unsigned int met,[In] const GUID& guidExtendedType,[In] HRESULT hrStatus,[In, Optional] const PROPVARIANT* pvValue) IMFMediaEventGenerator::QueueEvent

Applies to: desktop apps | Metro style apps

Retrieves the next event in the queue. This method is synchronous.

true if the method blocks until the event generator queues an event, false otherwise. a reference to the interface. The caller must release the interface.

This method executes synchronously.

If the queue already contains an event, the method returns immediately. If the queue does not contain an event, the behavior depends on the value of dwFlags:

  • If dwFlags is 0, the method blocks indefinitely until a new event is queued, or until the event generator is shut down.

  • If dwFlags is MF_EVENT_FLAG_NO_WAIT, the method fails immediately with the return code .

This method returns if you previously called and have not yet called .

ms704754 HRESULT IMFMediaEventGenerator::GetEvent([In] unsigned int dwFlags,[Out] IMFMediaEvent** ppEvent) IMFMediaEventGenerator::GetEvent

Applies to: desktop apps | Metro style apps

Begins an asynchronous request for the next event in the queue.

Pointer to the interface of a callback object. The client must implement this interface.

A reference to a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

When a new event is available, the event generator calls the method. The Invoke method should call to get a reference to the interface, and use that interface to examine the event.

Do not call BeginGetEvent a second time before calling EndGetEvent. While the first call is still pending, additional calls to the same object will fail. Also, the method fails if an asynchronous request is still pending.

ms701637 HRESULT IMFMediaEventGenerator::BeginGetEvent([In] IMFAsyncCallback* pCallback,[In] void* punkState) IMFMediaEventGenerator::BeginGetEvent

Shuts down the event queue.

Call this method when your component shuts down. After this method is called, all methods return .

This method removes all of the events from the queue.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698923 IMFMediaEventQueue IMFMediaEventQueue
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. No documentation. HRESULT IMFMediaEventQueue::GetEvent([In] unsigned int dwFlags,[Out] IMFMediaEvent** ppEvent) IMFMediaEventQueue::GetEvent

Begins an asynchronous request for the next event in the queue.

Call this method inside your implementation of . Pass the parameters from that method directly to this method.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The Shutdown method was called.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms696998 HRESULT IMFMediaEventQueue::BeginGetEvent([In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFMediaEventQueue::BeginGetEvent

Completes an asynchronous request for the next event in the queue.

Call this method inside your implementation of . Pass the parameters from that method directly to this method.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The Shutdown method was called.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms702986 HRESULT IMFMediaEventQueue::EndGetEvent([In] IMFAsyncResult* pResult,[Out] IMFMediaEvent** ppEvent) IMFMediaEventQueue::EndGetEvent

Puts an event in the queue.

Pointer to the interface of the event to be put in the queue.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The Shutdown method was called.

?

Call this method when your component needs to raise an event that contains attributes. To create the event object, call . Add attributes to the event by using methods from the interface. (The interface inherits .)

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704792 HRESULT IMFMediaEventQueue::QueueEvent([In] IMFMediaEvent* pEvent) IMFMediaEventQueue::QueueEvent

Creates an event, sets a as the event data, and puts the event in the queue.

Call this method inside your implementation of . Pass the parameters from that method directly to this method.

You can also call this method when your component needs to raise an event that does not contain attributes. If the event data is an reference, you can use . If the event contains attributes, use instead.

No documentation. No documentation. No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The Shutdown method was called.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704641 HRESULT IMFMediaEventQueue::QueueEventParamVar([In] unsigned int met,[In] const GUID& guidExtendedType,[In] HRESULT hrStatus,[In] const PROPVARIANT* pvValue) IMFMediaEventQueue::QueueEventParamVar

Creates an event, sets an reference as the event data, and puts the event in the queue.

Specifies the event type of the event to be added to the queue. The event type is returned by the event's method. For a list of event types, see Media Foundation Events.

The extended type of the event. If the event does not have an extended type, use the value GUID_NULL. The extended type is returned by the event's method.

A success or failure code indicating the status of the event. This value is returned by the event's method.

Pointer to the interface. The method sets this reference as the event value. The reference is returned by the event's method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The Shutdown method was called.

?

Call this method when your component needs to raise an event that contains an reference value and no attributes. If the event contains attributes, use instead.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704686 HRESULT IMFMediaEventQueue::QueueEventParamUnk([In] unsigned int met,[In] const GUID& guidExtendedType,[In] HRESULT hrStatus,[In] IUnknown* pUnk) IMFMediaEventQueue::QueueEventParamUnk

Shuts down the event queue.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Call this method when your component shuts down. After this method is called, all methods return .

This method removes all of the events from the queue.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698923 HRESULT IMFMediaEventQueue::Shutdown() IMFMediaEventQueue::Shutdown

Provides playback controls for protected and unprotected content. The Media Session and the protected media path (PMP) session objects expose this interface. This interface is the primary interface that applications use to control the Media Foundation pipeline.

To obtain a reference to this interface, call or .

ms705662 IMFMediaSession IMFMediaSession
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets a topology on the Media Session.

Bitwise OR of zero or more flags from the enumeration.

Pointer to the topology object's interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The operation cannot be performed in the Media Session's current state.

The Media Session has been shut down.

The topology has invalid values for one or more of the following attributes:

NS_E_DRM_DEBUGGING_NOT_ALLOWED

Protected content cannot be played while debugging.

?

If pTopology is a full topology, set the flag in the dwSetTopologyFlags parameter. Otherwise, the topology is assumed to be a partial topology. The Media Session uses the topology loader to resolve a partial topology into a full topology.

If the Media Session is currently paused or stopped, the SetTopology method does not take effect until the next call to .

If the Media Session is currently running, or on the next call to Start, the SetTopology method does the following:

  • If the flag is set in dwSetTopologyFlags, the Media Session ends the current presentation immediately, clears all pending topologies, and uses pTopology to start a new presentation.
  • Otherwise, the Media Session queues pTopology and starts the new presentation when the current presentation has completed. If there is no current presentation, the new presentation starts immediately.
  • Starting in Windows?7, you can also specify the flag to clear the current topology but leave any other pending topologies on the queue.

This method is asynchronous. If the method returns , the Media Session sends an event when the operation completes. If the Media Session is currently paused to stopped, the Media Session does not send the event until the next call to

ms704785 HRESULT IMFMediaSession::SetTopology([In] MFSESSION_SETTOPOLOGY_FLAGS dwSetTopologyFlags,[In, Optional] IMFTopology* pTopology) IMFMediaSession::SetTopology

Clears all of the presentations that are queued for playback in the Media Session.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The operation cannot be performed in the Media Session's current state.

The Media Session has been shut down.

?

This method is asynchronous. When the operation completes, the Media Session sends an event.

This method does not clear the current topology; it only removes topologies that are placed in the queue, waiting for playback. To remove the current topology, call with the flag.

ms705648 HRESULT IMFMediaSession::ClearTopologies() IMFMediaSession::ClearTopologies

Starts the Media Session.

Pointer to a that specifies the time format for the pvarStartPosition parameter. This parameter can be null. The value null is equivalent to passing in GUID_NULL.

The following time format GUIDs are defined:

ValueMeaning
GUID_NULL

Presentation time. The pvarStartPosition parameter must have one of the following types.

  • VT_I8: The pvarStartPosition parameter contains the starting position in 100-nanosecond units, relative to the start of the presentation.
  • VT_EMPTY: Playback starts from the current position.

All media sources support this time format.

MF_TIME_FORMAT_SEGMENT_OFFSET

Segment offset. This time format is supported by the Sequencer Source. The starting time is an offset within a segment.

Call the function to create the value for the pvarStartPosition parameter.

MF_TIME_FORMAT_ENTRY_RELATIVE

Note??Requires Windows?7 or later.

Skip to a playlist entry. The pvarStartPosition parameter specifies the index of the playlist entry, relative to the current entry. For example, the value 2 skips forward two entries. To skip backward, pass a negative value. The type is VT_I4.

If a media source supports this time format, the method returns one or both of the following flags:

?

Pointer to a that specifies the starting position for playback. The meaning and data type of this parameter are indicated by the pguidTimeFormat parameter.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The operation cannot be performed in the Media Session's current state.

The Media Session has been shut down.

?

When this method is called, the Media Session starts the presentation clock and begins to process media samples.

This method is asynchronous. When the method completes, the Media Session sends an event.

ms694908 HRESULT IMFMediaSession::Start([In, Optional] const GUID* pguidTimeFormat,[In, Optional] const PROPVARIANT* pvarStartPosition) IMFMediaSession::Start

Provides playback controls for protected and unprotected content. The Media Session and the protected media path (PMP) session objects expose this interface. This interface is the primary interface that applications use to control the Media Foundation pipeline.

To obtain a reference to this interface, call or .

No documentation. ms705662 HRESULT IMFMediaSession::Pause() IMFMediaSession::Pause

Provides playback controls for protected and unprotected content. The Media Session and the protected media path (PMP) session objects expose this interface. This interface is the primary interface that applications use to control the Media Foundation pipeline.

To obtain a reference to this interface, call or .

No documentation. ms705662 HRESULT IMFMediaSession::Stop() IMFMediaSession::Stop

Closes the Media Session and releases all of the resources it is using.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The Media Session has been shut down.

?

This method is asynchronous. When the operation completes, the Media Session sends an event.

After the Close method is called, the only valid methods on the Media Session are the following:

All other methods return , or else queue an event with that error code.

ms698928 HRESULT IMFMediaSession::Close() IMFMediaSession::Close

Shuts down the Media Session and releases all the resources used by the Media Session.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Call this method when you are done using the Media Session, before the final call to IUnknown::Release. Otherwise, your application will leak memory.

After this method is called, other methods return .

ms697318 HRESULT IMFMediaSession::Shutdown() IMFMediaSession::Shutdown

Retrieves the Media Session's presentation clock.

Receives a reference to the presentation clock's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_UNEXPECTED

The Media Session does not have a presentation clock.

The Media Session has been shut down.

?

The application can query the returned reference for the interface. However, the application should not use this interface to control the state of the presentation clock. Instead, the application should always call the transport control methods on the Media Session's interface, such as Start, Stop, and Pause.

bb970342 HRESULT IMFMediaSession::GetClock([Out] IMFClock** ppClock) IMFMediaSession::GetClock

Retrieves the capabilities of the Media Session, based on the current presentation.

Receives a bitwise OR of zero or more of the following flags.

ValueMeaning
MFSESSIONCAP_PAUSE

The Media Session can be paused.

MFSESSIONCAP_RATE_FORWARD

The Media Session supports forward playback at rates faster than 1.0.

MFSESSIONCAP_RATE_REVERSE

The Media Session supports reverse playback.

MFSESSIONCAP_SEEK

The Media Session can be seeked.

MFSESSIONCAP_START

The Media Session can be started.

?

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_POINTER

null reference argument.

The Media Session has been shut down.

?

ms696229 HRESULT IMFMediaSession::GetSessionCapabilities([Out] unsigned int* pdwCaps) IMFMediaSession::GetSessionCapabilities

Gets a topology from the Media Session.

This method can get the current topology or a queued topology.

Bitwise OR of zero or more flags from the enumeration.

The identifier of the topology. This parameter is ignored if the dwGetFullTopologyFlags parameter contains the flag. To get the identifier of a topology, call .

Receives a reference to the interface of the topology. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The Media Session has been shut down.

?

If the flag is specified in the dwGetFullTopologyFlags parameter, the method returns the topology for the current presentation. Otherwise, the method searches all of the queued topologies for one that matches the identifier given in the TopoId parameter.

This method can be used to retrieve the topology for the current presentation or any pending presentations. It cannot be used to retrieve a topology that has already ended.

The topology returned in ppFullTopo is a full topology, not a partial topology.

bb970422 HRESULT IMFMediaSession::GetFullTopology([In] unsigned int dwGetFullTopologyFlags,[In] unsigned longlong TopoId,[Out] IMFTopology** ppFullTopology) IMFMediaSession::GetFullTopology

Retrieves the Media Session's presentation clock.

The application can query the returned reference for the interface. However, the application should not use this interface to control the state of the presentation clock. Instead, the application should always call the transport control methods on the Media Session's interface, such as Start, Stop, and Pause.

bb970342 GetClock GetClock HRESULT IMFMediaSession::GetClock([Out] IMFClock** ppClock)

Retrieves the capabilities of the Media Session, based on the current presentation.

ms696229 GetSessionCapabilities GetSessionCapabilities HRESULT IMFMediaSession::GetSessionCapabilities([Out] unsigned int* pdwCaps)

Enables a media sink to receive samples before the presentation clock is started.

To get a reference to this interface, call QueryInterface on the media sink.

Media sinks can implement this interface to support seamless playback and transitions. If a media sink exposes this interface, it can receive samples before the presentation clock starts. It can then pre-process the samples, so that rendering can begin immediately when the clock starts. Prerolling helps to avoid glitches during playback.

If a media sink supports preroll, the media sink's method should return the MEDIASINK_CAN_PREROLL flag.

ms699832 IMFMediaSinkPreroll IMFMediaSinkPreroll
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Notifies the media sink that the presentation clock is about to start.

The upcoming start time for the presentation clock, in 100-nanosecond units. This time is the same value that will be given to the method when the presentation clock is started.

If this method succeeds, it returns . Otherwise, it returns an error code.

After this method is called, the media sink sends any number of events to request samples, until is has enough preroll data. When it has enough preroll data, the media sink sends an event. This event signals that the client can start the presentation clock.

During preroll, the media sink can prepare the samples that it receives, so that they are ready to be rendered. It does not actually render any samples until the clock starts.

ms703799 HRESULT IMFMediaSinkPreroll::NotifyPreroll([In] longlong hnsUpcomingStartTime) IMFMediaSinkPreroll::NotifyPreroll

Implemented by media source objects.

Media sources are objects that generate media data. For example, the data might come from a video file, a network stream, or a hardware device, such as a camera. Each media source contains one or more streams, and each stream delivers data of one type, such as audio or video.

In Windows?8, this interface is extended with IMFMediaSourceEx.

ms700189 IMFMediaSource IMFMediaSource
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the characteristics of the media source.

Receives a bitwise OR of zero or more flags from the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media source's Shutdown method has been called.

?

The characteristics of a media source can change at any time. If this happens, the source sends an event.

ms703148 HRESULT IMFMediaSource::GetCharacteristics([Out] unsigned int* pdwCharacteristics) IMFMediaSource::GetCharacteristics

Retrieves a copy of the media source's presentation descriptor. Applications use the presentation descriptor to select streams and to get information about the source content.

Receives a reference to the presentation descriptor's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media source's Shutdown method has been called.

?

The presentation descriptor contains the media source's default settings for the presentation. The application can change these settings by selecting or deselecting streams, or by changing the media type on a stream. Do not modify the presentation descriptor unless the source is stopped. The changes take affect when the source's method is called.

ms702261 HRESULT IMFMediaSource::CreatePresentationDescriptor([Out] IMFPresentationDescriptor** ppPresentationDescriptor) IMFMediaSource::CreatePresentationDescriptor

Starts, seeks, or restarts the media source by specifying where to start playback.

Pointer to the interface of the media source's presentation descriptor. To get the presentation descriptor, call . You can modify the presentation descriptor before calling Start, to select or deselect streams or change the media types.

Pointer to a that specifies the time format. The time format defines the units for the pvarStartPosition parameter. If the value is GUID_NULL, the time format is 100-nanosecond units. Some media sources might support additional time format GUIDs. This parameter can be null. If the value is null, it is equalivent to GUID_NULL.

Specifies where to start playback. The units of this parameter are indicated by the time format given in pguidTimeFormat. If the time format is GUID_NULL, the variant type must be VT_I8 or VT_EMPTY. Use VT_I8 to specify a new starting position, in 100-nanosecond units. Use VT_EMPTY to start from the current position. Other time formats might use other types.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The start position is past the end of the presentation (ASF media source).

A hardware device was unable to start streaming. This error code can be returned by a media source that represents a hardware device, such as a camera. For example, if the camera is already being used by another application, the method might return this error code.

The start request is not valid. For example, the start position is past the end of the presentation.

The media source's Shutdown method has been called.

The media source does not support the time format specified in pguidTimeFormat.

?

This method is asynchronous. If the operation succeeds, the media source sends the following events:

  • For each new stream, the source sends an event. This event is sent for the first Start call in which the stream appears. The event data is a reference to the stream's interface.
  • For each updated stream, the source sends an event. A stream is updated if the stream already existed when Start was called (for example, if the application seeks during playback). The event data is a reference to the stream's interface.
  • If the previous state was stopped, the source sends an event.
  • If the previous state was started or paused and the starting position is the current position (VT_EMPTY), the source sends an event.
  • If the previous state was started or paused, and a new starting position is specified, the source sends an event.
  • If the source sends an event, each media stream sends an event. If the source sends an event, each stream sends an event.

If the start operation fails asynchronously (after the method returns ), the media source sends an event that contains a failure code, without sending any of the other events listed here. If the method fails synchronously (returns an error code), no events are raised.

A call to Start results in a seek if the previous state was started or paused, and the new starting position is not VT_EMPTY. Not every media source can seek. If a media source can seek, the method returns the flag.

Events from the media source are not synchronized with events from the media streams. If you seek a media source, therefore, you can still receive samples from the earlier position after getting the event. If you need to synchronize the operations, wait for the stream event, , which marks the exact point in the stream where the seek occurs.

ms694101 HRESULT IMFMediaSource::Start([In, Optional] IMFPresentationDescriptor* pPresentationDescriptor,[In, Optional] const GUID* pguidTimeFormat,[In, Optional] const PROPVARIANT* pvarStartPosition) IMFMediaSource::Start

Stops all active streams in the media source.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media source's Shutdown method has been called.

?

This method is asynchronous. When the operation completes, the media source sends and event, and every active stream sends an event. If the method returns a failure code, no events are raised.

When a media source is stopped, its current position reverts to zero. After that, if the Start method is called with VT_EMPTY for the starting position, playback starts from the beginning of the presentation.

While the source is stopped, no streams produce data.

ms702045 HRESULT IMFMediaSource::Stop() IMFMediaSource::Stop

Pauses all active streams in the media source.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid state transition. The media source must be in the started state.

The media source's Shutdown method has been called.

?

This method is asynchronous. When the operation completes, the media source sends and event, and every active stream sends an event. If the method returns a failure code, no events are raised.

The media source must be in the started state. The method fails if the media source is paused or stopped.

While the source is paused, calls to succeed, but the streams will not deliver any samples until after the source is started again. Note that the source's event queue is not serialized with the stream event queues, so the client might receive some samples after the event, due to multi-threading issues. But the client will not receive any samples from a stream after the event.

Not every media source can pause. If a media source can pause, the method returns the flag.

ms694275 HRESULT IMFMediaSource::Pause() IMFMediaSource::Pause

Shuts down the media source and releases the resources it is using.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If the application creates the media source, either directly or through the source resolver, the application is responsible for calling Shutdown to avoid memory or resource leaks.

After this method is called, methods on the media source and all of its media streams return (except for methods).

ms703110 HRESULT IMFMediaSource::Shutdown() IMFMediaSource::Shutdown

Retrieves the characteristics of the media source.

The characteristics of a media source can change at any time. If this happens, the source sends an event.

ms703148 GetCharacteristics GetCharacteristics HRESULT IMFMediaSource::GetCharacteristics([Out] unsigned int* pdwCharacteristics)

Notifies the source when playback has reached the end of a segment. For timelines, this corresponds to reaching a mark-out point.

ms705639 IMFMediaSourcePresentationProvider IMFMediaSourcePresentationProvider
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Notifies the source when playback has reached the end of a segment. For timelines, this corresponds to reaching a mark-out point.

Pointer to the interface of the presentation descriptor for the segment that has ended.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms705639 HRESULT IMFMediaSourcePresentationProvider::ForceEndOfPresentation([In, Optional] IMFPresentationDescriptor* pPresentationDescriptor) IMFMediaSourcePresentationProvider::ForceEndOfPresentation

Enables an application to get a topology from the sequencer source. This interface is exposed by the sequencer source object.

ms699013 IMFMediaSourceTopologyProvider IMFMediaSourceTopologyProvider
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns a topology for a media source that builds an internal topology.

A reference to the interface of the media source's presentation descriptor. To get this reference, either call on the media source, or get the reference from the event.

Receives a reference to the topology's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument. For example, a null input parameter, or the presentation descriptor is not valid.

?

bb970383 HRESULT IMFMediaSourceTopologyProvider::GetMediaSourceTopology([In, Optional] IMFPresentationDescriptor* pPresentationDescriptor,[Out] IMFTopology** ppTopology) IMFMediaSourceTopologyProvider::GetMediaSourceTopology

Represents one stream in a media source.

Streams are created when a media source is started. For each stream, the media source sends an event with a reference to the stream's interface.

ms697561 IMFMediaStream IMFMediaStream
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a reference to the media source that created this media stream.

Receives a reference to the interface of the media source. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media source's Shutdown method has been called.

?

ms705668 HRESULT IMFMediaStream::GetMediaSource([Out] IMFMediaSource** ppMediaSource) IMFMediaStream::GetMediaSource

Retrieves a stream descriptor for this media stream.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media source's Shutdown method has been called.

?

Do not modify the stream descriptor. To change the presentation, call and modify the presentation descriptor.

ms697244 HRESULT IMFMediaStream::GetStreamDescriptor([Out] IMFStreamDescriptor** ppStreamDescriptor) IMFMediaStream::GetStreamDescriptor

Requests a sample from the media source.

Pointer to the interface to an object that is used as a token for the request. The caller must implement this object. This parameter can be null. See Remarks.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The end of the stream was reached.

The media source is stopped.

The source's Shutdown method has been called.

?

If pToken is not null, the media stream calls AddRef on pToken and places the token in a first-in, first-out queue.

When the next sample is available, the media stream stream does the following:

  1. Pulls the first token from the queue.
  2. Sets the attribute on the media sample. The attribute data is a reference to the token object.
  3. Sends an event. The event data is a reference to the media sample's interface.
  4. Calls Release on the token.

If the media stream cannot fulfill the caller's request for a sample, it simply releases the token object and skips steps 2 and 3.

The caller should monitor the reference count on the request token. If the media stream sends an event, get the attribute from the sample and match the attribute value against the token. If the token's reference count falls to zero and you did not receive an event, it means that the request was dropped.

Because the Media Foundation pipeline is multithreaded, the source's RequestSample method might get called after the source has stopped. If the media source is stopped, the method should return . The pipeline does not treat this return code as an error condition. If the source returns any other error code, the pipeline treats it as fatal error and halts the session.

Note??Earlier versions of the documentation listed the wrong error code for this case.

If the media source is paused, the method succeeds, but the stream does not deliver the sample until the source is started again.

If a media source enounters an error asynchronously while processing data, it should signal the error in one of the following ways (but not both):

  • Return an error code from the next RequestSample call.
  • Send an event.
ms696240 HRESULT IMFMediaStream::RequestSample([In] IUnknown* pToken) IMFMediaStream::RequestSample

Retrieves a reference to the media source that created this media stream.

ms705668 GetMediaSource GetMediaSource HRESULT IMFMediaStream::GetMediaSource([Out] IMFMediaSource** ppMediaSource)

Retrieves a stream descriptor for this media stream.

Do not modify the stream descriptor. To change the presentation, call and modify the presentation descriptor.

ms697244 GetStreamDescriptor GetStreamDescriptor HRESULT IMFMediaStream::GetStreamDescriptor([Out] IMFStreamDescriptor** ppStreamDescriptor)

Sets the object's media type.

For media sources, setting the media type means the source will generate data that conforms to that media type. For media sinks, setting the media type means the sink can receive data that conforms to that media type.

Any implementation of this method should check whether pMediaType differs from the object's current media type. If the types are identical, the method should return but avoid releasing and recreating resources unnecessarily. If the types are not identical, the method should validate the new type.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970432 IMFMediaTypeHandler IMFMediaTypeHandler
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Queries whether the object supports a specified media type.

Pointer to the interface of the media type to check.

Receives a reference to the interface of the closest matching media type, or receives the value null. If non-null, the caller must release the interface. This parameter can be null. See Remarks.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The object does not support this media type.

?

If the object supports the media type given in pMediaType, the method returns . For a media source, it means the source can generate data that conforms to that media type. For a media sink, it means the sink can receive data that conforms to that media type. If the object does not support the media type, the method fails.

The ppMediaType parameter is optional. If the method fails, the object might use ppMediaType to return a media type that the object does support, and which closely matches the one given in pMediaType. The method is not guaranteed to return a media type in ppMediaType. If no type is returned, this parameter receives a null reference. If the method succeeds, this parameter receives a null reference. If the caller sets ppMediaType to null, this parameter is ignored.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with SP2 and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970559 HRESULT IMFMediaTypeHandler::IsMediaTypeSupported([In] IMFMediaType* pMediaType,[Out] IMFMediaType** ppMediaType) IMFMediaTypeHandler::IsMediaTypeSupported

Retrieves the number of media types in the object's list of supported media types.

Receives the number of media types in the list.

If this method succeeds, it returns . Otherwise, it returns an error code.

To get the supported media types, call .

For a media source, the media type handler for each stream must contain at least one supported media type. For media sinks, the media type handler for each stream might contain zero media types. In that case, the application must provide the media type. To test whether a particular media type is supported, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970517 HRESULT IMFMediaTypeHandler::GetMediaTypeCount([Out] unsigned int* pdwTypeCount) IMFMediaTypeHandler::GetMediaTypeCount

Retrieves a media type from the object's list of supported media types.

Zero-based index of the media type to retrieve. To get the number of media types in the list, call .

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The dwIndex parameter is out of range.

?

Media types are returned in the approximate order of preference. The list of supported types is not guaranteed to be complete. To test whether a particular media type is supported, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970473 HRESULT IMFMediaTypeHandler::GetMediaTypeByIndex([In] unsigned int dwIndex,[Out] IMFMediaType** ppType) IMFMediaTypeHandler::GetMediaTypeByIndex

Sets the object's media type.

Pointer to the interface of the new media type.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid request.

?

For media sources, setting the media type means the source will generate data that conforms to that media type. For media sinks, setting the media type means the sink can receive data that conforms to that media type.

Any implementation of this method should check whether pMediaType differs from the object's current media type. If the types are identical, the method should return but avoid releasing and recreating resources unnecessarily. If the types are not identical, the method should validate the new type.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970432 HRESULT IMFMediaTypeHandler::SetCurrentMediaType([In] IMFMediaType* pMediaType) IMFMediaTypeHandler::SetCurrentMediaType

Retrieves the current media type of the object.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No media type is set.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970492 HRESULT IMFMediaTypeHandler::GetCurrentMediaType([Out] IMFMediaType** ppMediaType) IMFMediaTypeHandler::GetCurrentMediaType

Gets the major media type of the object.

Receives a that identifies the major type. For a list of possible values, see Major Media Types.

If this method succeeds, it returns . Otherwise, it returns an error code.

The major type identifies what kind of data is in the stream, such as audio or video. To get the specific details of the format, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970337 HRESULT IMFMediaTypeHandler::GetMajorType([Out] GUID* pguidMajorType) IMFMediaTypeHandler::GetMajorType

Retrieves the number of media types in the object's list of supported media types.

To get the supported media types, call .

For a media source, the media type handler for each stream must contain at least one supported media type. For media sinks, the media type handler for each stream might contain zero media types. In that case, the application must provide the media type. To test whether a particular media type is supported, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970517 GetMediaTypeCount GetMediaTypeCount HRESULT IMFMediaTypeHandler::GetMediaTypeCount([Out] unsigned int* pdwTypeCount)

Retrieves the current media type of the object.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970492 GetCurrentMediaType / SetCurrentMediaType GetCurrentMediaType HRESULT IMFMediaTypeHandler::GetCurrentMediaType([Out] IMFMediaType** ppMediaType)

Gets the major media type of the object.

The major type identifies what kind of data is in the stream, such as audio or video. To get the specific details of the format, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
bb970337 GetMajorType GetMajorType HRESULT IMFMediaTypeHandler::GetMajorType([Out] GUID* pguidMajorType)

Manages metadata for an object. Metadata is information that describes a media file, stream, or other content. Metadata consists of individual properties, where each property contains a descriptive name and a value. A property may be associated with a particular language.

To get this interface from a media source, use the interface.

ms696970 IMFMetadata IMFMetadata
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the language for setting and retrieving metadata.

Pointer to a null-terminated string containing an RFC 1766-compliant language tag.

If this method succeeds, it returns . Otherwise, it returns an error code.

For more information about language tags, see RFC 1766, "Tags for the Identification of Languages".

ms703982 HRESULT IMFMetadata::SetLanguage([In] const wchar_t* pwszRFC1766) IMFMetadata::SetLanguage

Gets the current language setting.

Receives a reference to a null-terminated string containing an RFC 1766-compliant language tag. The caller must release the string by calling CoTaskMemFree.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

The metadata provider does not support multiple languages.

No language was set.

?

For more information about language tags, see RFC 1766, "Tags for the Identification of Languages."

The and methods set and get metadata for the current language setting.

ms698978 HRESULT IMFMetadata::GetLanguage([Out] wchar_t** ppwszRFC1766) IMFMetadata::GetLanguage

Gets a list of the languages in which metadata is available.

A reference to a that receives the list of languages. The list is returned as an array of null-terminated wide-character strings. Each string in the array is an RFC 1766-compliant language tag.

The returned type is VT_VECTOR | VT_LPWSTR. The list might be empty, if no language tags are present. The caller must free the by calling PropVariantClear.

If this method succeeds, it returns . Otherwise, it returns an error code.

For more information about language tags, see RFC 1766, "Tags for the Identification of Languages".

To set the current language, call .

ms698736 HRESULT IMFMetadata::GetAllLanguages([Out] PROPVARIANT* ppvLanguages) IMFMetadata::GetAllLanguages

Sets the value of a metadata property.

Pointer to a null-terminated string containing the name of the property.

Pointer to a that contains the value of the property. For multivalued properties, use a with a VT_VECTOR type.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms696972 HRESULT IMFMetadata::SetProperty([In] const wchar_t* pwszName,[In] const PROPVARIANT* ppvValue) IMFMetadata::SetProperty

Gets the value of a metadata property.

A reference to a null-terminated string that containings the name of the property. To get the list of property names, call .

Pointer to a that receives the value of the property. The type depends on the property. For multivalued properties, the is a VT_VECTOR type. The caller must free the by calling PropVariantClear.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The requested property was not found.

?

ms694844 HRESULT IMFMetadata::GetProperty([In] const wchar_t* pwszName,[Out] PROPVARIANT* ppvValue) IMFMetadata::GetProperty

Deletes a metadata property.

Pointer to a null-terminated string containing the name of the property.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The property was not found.

?

For a media source, deleting a property from the metadata collection does not change the original content.

ms699021 HRESULT IMFMetadata::DeleteProperty([In] const wchar_t* pwszName) IMFMetadata::DeleteProperty

Gets a list of all the metadata property names on this object.

Pointer to a that receives an array of null-terminated wide-character strings. If no properties are available, the type is VT_EMPTY. Otherwise, the type is VT_VECTOR | VT_LPWSTR. The caller must free the by calling PropVariantClear.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms704581 HRESULT IMFMetadata::GetAllPropertyNames([Out] PROPVARIANT* ppvNames) IMFMetadata::GetAllPropertyNames

Gets a list of the languages in which metadata is available.

For more information about language tags, see RFC 1766, "Tags for the Identification of Languages".

To set the current language, call .

ms698736 GetAllLanguages GetAllLanguages HRESULT IMFMetadata::GetAllLanguages([Out] PROPVARIANT* ppvLanguages)

Gets a list of all the metadata property names on this object.

ms704581 GetAllPropertyNames GetAllPropertyNames HRESULT IMFMetadata::GetAllPropertyNames([Out] PROPVARIANT* ppvNames)

Gets metadata from a media source or other object.

If a media source supports this interface, it must expose the interface as a service. To get a reference to this interface from a media source, call . The service identifier is . Other types of object can expose this interface through QueryInterface.

Use this interface to get a reference to the interface.

ms705606 IMFMetadataProvider IMFMetadataProvider
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets a collection of metadata, either for an entire presentation, or for one stream in the presentation.

Pointer to the interface of the media source's presentation descriptor.

If this parameter is zero, the method retrieves metadata that applies to the entire presentation. Otherwise, this parameter specifies a stream identifier, and the method retrieves metadata for that stream. To get the stream identifier for a stream, call .

Reserved. Must be zero.

Receives a reference to the interface. Use this interface to access the metadata. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No metadata is available for the requested stream or presentation.

?

ms694097 HRESULT IMFMetadataProvider::GetMFMetadata([In, Optional] IMFPresentationDescriptor* pPresentationDescriptor,[In] unsigned int dwStreamIdentifier,[In] unsigned int dwFlags,[Out] IMFMetadata** ppMFMetadata) IMFMetadataProvider::GetMFMetadata

Contains data that is needed to implement the interface.

Any custom implementation of the interface must inherit this structure. For more information, see Custom Asynchronous Result Objects.

aa379769 MFASYNCRESULT MFASYNCRESULT
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets and retrieves user-name and password information for authentication purposes.

ms703848 IMFNetCredential IMFNetCredential
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the user name.

Pointer to a buffer that contains the user name. If fDataIsEncrypted is , the buffer is a wide-character string. Otherwise, the buffer contains encrypted data.

Size of pbData, in bytes. If fDataIsEncrypted is , the size includes the terminating null character.

If TRUE, the user name is encrypted. Otherwise, the user name is not encrypted.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms693551 HRESULT IMFNetCredential::SetUser([In, Buffer] unsigned char* pbData,[In] unsigned int cbData,[In] BOOL fDataIsEncrypted) IMFNetCredential::SetUser

Sets the password.

Pointer to a buffer that contains the password. If fDataIsEncrypted is , the buffer is a wide-character string. Otherwise, the buffer contains encrypted data.

Size of pbData, in bytes. If fDataIsEncrypted is , the size includes the terminating null character.

If TRUE, the password is encrypted. Otherwise, the password is not encrypted.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms699838 HRESULT IMFNetCredential::SetPassword([In, Buffer] unsigned char* pbData,[In] unsigned int cbData,[In] BOOL fDataIsEncrypted) IMFNetCredential::SetPassword

Retrieves the user name.

Pointer to a buffer that receives the user name. To find the required buffer size, set this parameter to null. If fEncryptData is , the buffer contains a wide-character string. Otherwise, the buffer contains encrypted data.

On input, specifies the size of the pbData buffer, in bytes. On output, receives the required buffer size. If fEncryptData is , the size includes the terminating null character.

If TRUE, the method returns an encrypted string. Otherwise, the method returns an unencrypted string.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If the user name is not available, the method might succeed and set *pcbData to zero.

ms694290 HRESULT IMFNetCredential::GetUser([Out, Buffer, Optional] unsigned char* pbData,[InOut] unsigned int* pcbData,[In] BOOL fEncryptData) IMFNetCredential::GetUser

Retrieves the password.

Pointer to a buffer that receives the password. To find the required buffer size, set this parameter to null. If fEncryptData is , the buffer contains a wide-character string. Otherwise, the buffer contains encrypted data.

On input, specifies the size of the pbData buffer, in bytes. On output, receives the required buffer size. If fEncryptData is , the size includes the terminating null character.

If TRUE, the method returns an encrypted string. Otherwise, the method returns an unencrypted string.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If the password is not available, the method might succeed and set *pcbData to zero.

ms702055 HRESULT IMFNetCredential::GetPassword([Out, Buffer, Optional] unsigned char* pbData,[InOut] unsigned int* pcbData,[In] BOOL fEncryptData) IMFNetCredential::GetPassword

Queries whether logged-on credentials should be used.

Receives a Boolean value. If logged-on credentials should be used, the value is TRUE. Otherwise, the value is .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms698960 HRESULT IMFNetCredential::LoggedOnUser([Out] BOOL* pfLoggedOnUser) IMFNetCredential::LoggedOnUser

Gets credentials from the credential cache.

This interface is implemented by the credential cache object. Applications that implement the interface can use this object to store the user's credentials. To create the credential cache object, call .

ms703796 IMFNetCredentialCache IMFNetCredentialCache
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the credential object for the specified URL.

A null-terminated wide-character string containing the URL for which the credential is needed.

A null-terminated wide-character string containing the realm for the authentication.

Bitwise OR of zero or more flags from the enumeration.

Receives a reference to the interface. The caller must release the interface.

Receives a bitwise OR of zero or more flags from the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms699842 HRESULT IMFNetCredentialCache::GetCredential([In] const wchar_t* pszUrl,[In] const wchar_t* pszRealm,[In] unsigned int dwAuthenticationFlags,[Out] IMFNetCredential** ppCred,[Out] unsigned int* pdwRequirementsFlags) IMFNetCredentialCache::GetCredential

Reports whether the credential object provided successfully passed the authentication challenge.

Pointer to the interface.

TRUE if the credential object succeeded in the authentication challenge; otherwise, .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is called by the network source into the credential manager.

ms704649 HRESULT IMFNetCredentialCache::SetGood([In] IMFNetCredential* pCred,[In] BOOL fGood) IMFNetCredentialCache::SetGood

Specifies how user credentials are stored.

Pointer to the interface. Obtain this reference by calling .

Bitwise OR of zero or more flags from the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If no flags are specified, the credentials are cached in memory. This method can be implemented by the credential manager and called by the network source.

ms693547 HRESULT IMFNetCredentialCache::SetUserOptions([In] IMFNetCredential* pCred,[In] unsigned int dwOptionsFlags) IMFNetCredentialCache::SetUserOptions

Implemented by applications to provide user credentials for a network source.

To use this interface, implement it in your application. Then create a property store object and set the MFNETSOURCE_CREDENTIAL_MANAGER property. The value of the property is a reference to your application's interface. Then pass the property store to one of the source resolver's creation functions, such as , in the pProps parameter.

Media Foundation does not provide a default implementation of this interface. Applications that support authentication must implement this interface.

ms693499 IMFNetCredentialManager IMFNetCredentialManager
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Begins an asynchronous request to retrieve the user's credentials.

Pointer to an structure.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms705663 HRESULT IMFNetCredentialManager::BeginGetCredentials([In] MFNetCredentialManagerGetParam* pParam,[In] IMFAsyncCallback* pCallback,[In] IUnknown* pState) IMFNetCredentialManager::BeginGetCredentials

Completes an asynchronous request to retrieve the user's credentials.

Pointer to an interface that contains the asynchronous result.

Receives a reference to the interface, which is used to retrieve the credentials. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms701589 HRESULT IMFNetCredentialManager::EndGetCredentials([In] IMFAsyncResult* pResult,[Out] IMFNetCredential** ppCred) IMFNetCredentialManager::EndGetCredentials

Specifies whether the user's credentials succeeded in the authentication challenge. The network source calls this method to informs the application whether the user's credentials were authenticated.

Pointer to the interface.

Boolean value. The value is TRUE if the credentials succeeded in the authentication challenge. Otherwise, the value is .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms705614 HRESULT IMFNetCredentialManager::SetGood([In] IMFNetCredential* pCred,[In] BOOL fGood) IMFNetCredentialManager::SetGood

Determines the proxy to use when connecting to a server. The network source uses this interface.

Applications can create the proxy locator configured by the application by implementing the interface and setting the MFNETSOURCE_PROXYLOCATORFACTORY property on the source resolver. Otherwise, the network source uses the default Media Foundation implementation.

To create the default proxy locator, call .

ms695417 IMFNetProxyLocator IMFNetProxyLocator
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Initializes the proxy locator object.

Null-terminated wide-character string containing the hostname of the destination server.

Null-terminated wide-character string containing the destination URL.

Reserved. Set to .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697016 HRESULT IMFNetProxyLocator::FindFirstProxy([In] const wchar_t* pszHost,[In] const wchar_t* pszUrl,[In] BOOL fReserved) IMFNetProxyLocator::FindFirstProxy

Determines the next proxy to use.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

S_FALSE

There are no more proxy objects.

?

ms700807 HRESULT IMFNetProxyLocator::FindNextProxy() IMFNetProxyLocator::FindNextProxy

Keeps a record of the success or failure of using the current proxy.

specifying the result of using the current proxy for connection.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms696180 HRESULT IMFNetProxyLocator::RegisterProxyResult([In] HRESULT hrOp) IMFNetProxyLocator::RegisterProxyResult

Retrieves the current proxy information including hostname and port.

Pointer to a buffer that receives a null-terminated string containing the proxy hostname and port. This parameter can be null.

On input, specifies the number of elements in the pszStr array. On output, receives the required size of the buffer.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOT_SUFFICIENT_BUFFER

The buffer specified in pszStr is too small.

?

ms697327 HRESULT IMFNetProxyLocator::GetCurrentProxy([Out, Buffer, Optional] wchar_t* pszStr,[In] unsigned int* pcchStr) IMFNetProxyLocator::GetCurrentProxy

Creates a new instance of the default proxy locator.

Receives a reference to the new proxy locator object's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697210 HRESULT IMFNetProxyLocator::Clone([In] IMFNetProxyLocator** ppProxyLocator) IMFNetProxyLocator::Clone

Creates a proxy locator object, which determines the proxy to use.

The network source uses this interface to create the proxy locator object. Applications can provide their own implementation of this interface by setting the MFNETSOURCE_PROXYLOCATORFACTORY property. on the source resolver. If the application does not set this property, the network source uses the default proxy locator provided by Media Foundation.

ms698907 IMFNetProxyLocatorFactory IMFNetProxyLocatorFactory
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Creates an interface proxy locator object based on the protocol name.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms694154 HRESULT IMFNetProxyLocatorFactory::CreateProxyLocator([In] const wchar_t* pszProtocol,[Out] IMFNetProxyLocator** ppProxyLocator) IMFNetProxyLocatorFactory::CreateProxyLocator

Retrieves a supported protocol by index

ms697058 IMFNetSchemeHandlerConfig IMFNetSchemeHandlerConfig
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the number of protocols supported by the network scheme plug-in.

Receives the number of protocols.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms701625 HRESULT IMFNetSchemeHandlerConfig::GetNumberOfSupportedProtocols([Out] unsigned int* pcProtocols) IMFNetSchemeHandlerConfig::GetNumberOfSupportedProtocols

Retrieves a supported protocol by index

Zero-based index of the protocol to retrieve. To get the number of supported protocols, call .

Receives a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The value passed in the nProtocolIndex parameter was greater than the total number of supported protocols, returned by GetNumberOfSupportedProtocols.

?

ms697058 HRESULT IMFNetSchemeHandlerConfig::GetSupportedProtocolType([In] unsigned int nProtocolIndex,[Out] MFNETSOURCE_PROTOCOL_TYPE* pnProtocolType) IMFNetSchemeHandlerConfig::GetSupportedProtocolType

Not implemented in this release.

This method returns .

ms705604 HRESULT IMFNetSchemeHandlerConfig::ResetProtocolRolloverSettings() IMFNetSchemeHandlerConfig::ResetProtocolRolloverSettings

Retrieves the number of protocols supported by the network scheme plug-in.

ms701625 GetNumberOfSupportedProtocols GetNumberOfSupportedProtocols HRESULT IMFNetSchemeHandlerConfig::GetNumberOfSupportedProtocols([Out] unsigned int* pcProtocols)

Stores the data needed to marshal an interface across a process boundary.

ms698988 IMFObjectReferenceStream IMFObjectReferenceStream
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Stores the data needed to marshal an interface across a process boundary.

Interface identifier of the interface to marshal.

Pointer to the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms698988 HRESULT IMFObjectReferenceStream::SaveReference([In] const GUID& riid,[In] IUnknown* pUnk) IMFObjectReferenceStream::SaveReference

Marshals an interface from data stored in the stream.

Interface identifier of the interface to marshal.

Receives a reference to the requested interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms705636 HRESULT IMFObjectReferenceStream::LoadReference([In] const GUID& riid,[In] void** ppv) IMFObjectReferenceStream::LoadReference

Encapsulates a usage policy from an input trust authority (ITA). Output trust authorities (OTAs) use this interface to query which protection systems they are required to enforce by the ITA.

ms698985 IMFOutputPolicy IMFOutputPolicy
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a list of the output protection systems that the output trust authority (OTA) must enforce, along with configuration data for each protection system.

Describes the output that is represented by the OTA calling this method. This value is a bitwise OR of zero or more of the following flags.

ValueMeaning
MFOUTPUTATTRIBUTE_BUS

Hardware bus.

MFOUTPUTATTRIBUTE_COMPRESSED

The output sends compressed data. If this flag is absent, the output sends uncompressed data.

MFOUTPUTATTRIBUTE_BUSIMPLEMENTATION

Reserved. Do not use.

MFOUTPUTATTRIBUTE_DIGITAL

The output sends a digital signal. If this flag is absent, the output sends an analog signal.

MFOUTPUTATTRIBUTE_NONSTANDARDIMPLEMENTATION

Reserved. Do not use.

MFOUTPUTATTRIBUTE_SOFTWARE

Reserved. Do not use.

MFOUTPUTATTRIBUTE_VIDEO

The output sends video data. If this flag is absent, the output sends audio data.

?

Indicates a specific family of output connectors that is represented by the OTA calling this method. Possible values include the following.

ValueMeaning
MFCONNECTOR_AGP

AGP bus.

MFCONNECTOR_COMPONENT

Component video.

MFCONNECTOR_COMPOSITE

Composite video.

MFCONNECTOR_D_JPN

Japanese D connector. (Connector conforming to the EIAJ RC-5237 standard.)

MFCONNECTOR_DISPLAYPORT_EMBEDDED

Embedded DisplayPort connector.

MFCONNECTOR_DISPLAYPORT_EXTERNAL

External DisplayPort connector.

MFCONNECTOR_DVI

Digital video interface (DVI) connector.

MFCONNECTOR_HDMI

High-definition multimedia interface (HDMI) connector.

MFCONNECTOR_LVDS

Low voltage differential signaling (LVDS) connector.

A connector using the LVDS interface to connect internally to a display device. The connection between the graphics adapter and the display device is permanent and not accessible to the user. Applications should not enable High-Bandwidth Digital Content Protection (HDCP) for this connector.

MFCONNECTOR_PCI

PCI bus.

MFCONNECTOR_PCI_Express

PCI Express bus.

MFCONNECTOR_PCIX

PCI-X bus.

MFCONNECTOR_SDI

Audio data sent over a connector via S/PDIF.

MFCONNECTOR_SPDIF

Serial digital interface connector.

MFCONNECTOR_SVIDEO

S-Video connector.

MFCONNECTOR_UDI_EMBEDDED

Embedded Unified Display Interface (UDI).

MFCONNECTOR_UDI_EXTERNAL

External UDI.

MFCONNECTOR_UNKNOWN

Unknown connector type. See Remarks.

MFCONNECTOR_VGA

VGA connector.

MFCONNECTOR_MIRACAST

Miracast wireless connector.

Supported in Windows?8.1 and later.

?

Pointer to an array of values that specify which output protection systems are supported by the OTA that is calling this method.

Number of elements in the rgGuidProtectionSchemasSupported array.

Receives a reference to the interface of a collection object. The caller must release the interface. Each object in the collection is an reference. Each reference defines an output protection system that the OTA must enforce.

If this method succeeds, it returns . Otherwise, it returns an error code.

The video OTA returns the MFCONNECTOR_UNKNOWN connector type unless the Direct3D device is in full-screen mode. (Direct3D windowed mode is not generally a secure video mode.) You can override this behavior by implementing a custom EVR presenter that implements the interface.

bb970362 HRESULT IMFOutputPolicy::GenerateRequiredSchemas([In] unsigned int dwAttributes,[In] GUID guidOutputSubType,[In] GUID* rgGuidProtectionSchemasSupported,[In] unsigned int cProtectionSchemasSupported,[Out] IMFCollection** ppRequiredProtectionSchemas) IMFOutputPolicy::GenerateRequiredSchemas

Retrieives a identifying the input trust authority (ITA) that created this output policy object.

Receives a that identifies the originating ITA.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

All of the policy objects and output schemas from the same ITA should return the same originator identifier (including dynamic policy changes). This value enables the OTA to distinguish policies that originate from different ITAs, so that the OTA can update dynamic policies correctly.

bb970379 HRESULT IMFOutputPolicy::GetOriginatorID([Out] GUID* pguidOriginatorID) IMFOutputPolicy::GetOriginatorID

Retrieves the minimum version of the global revocation list (GRL) that must be enforced by the protected environment for this policy.

Receives the minimum GRL version.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970389 HRESULT IMFOutputPolicy::GetMinimumGRLVersion([Out] unsigned int* pdwMinimumGRLVersion) IMFOutputPolicy::GetMinimumGRLVersion

Retrieives a identifying the input trust authority (ITA) that created this output policy object.

All of the policy objects and output schemas from the same ITA should return the same originator identifier (including dynamic policy changes). This value enables the OTA to distinguish policies that originate from different ITAs, so that the OTA can update dynamic policies correctly.

bb970379 GetOriginatorID GetOriginatorID HRESULT IMFOutputPolicy::GetOriginatorID([Out] GUID* pguidOriginatorID)

Retrieves the minimum version of the global revocation list (GRL) that must be enforced by the protected environment for this policy.

bb970389 GetMinimumGRLVersion GetMinimumGRLVersion HRESULT IMFOutputPolicy::GetMinimumGRLVersion([Out] unsigned int* pdwMinimumGRLVersion)

Encapsulates information about an output protection system and its corresponding configuration data.

If the configuration information for the output protection system does not require more than a DWORD of space, the configuration information is retrieved in the GetConfigurationData method. If more than a DWORD of configuration information is needed, it is stored using the interface.

ms703800 IMFOutputSchema IMFOutputSchema
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the output protection system that is represented by this object. Output protection systems are identified by value.

Receives the that identifies the output protection system.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970414 HRESULT IMFOutputSchema::GetSchemaType([Out] GUID* pguidSchemaType) IMFOutputSchema::GetSchemaType

Returns configuration data for the output protection system. The configuration data is used to enable or disable the protection system, and to set the protection levels.

Receives the configuration data. The meaning of this data depends on the output protection system.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970364 HRESULT IMFOutputSchema::GetConfigurationData([Out] unsigned int* pdwVal) IMFOutputSchema::GetConfigurationData

Retrieves a identifying the input trust authority (ITA) that generated this output schema object.

Receives a that identifies the originating ITA.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

All of the policy objects and output schemas from the same ITA should return the same originator identifier (including dynamic policy changes). This value enables the OTA to distinguish policies that originate from different ITAs, so that the OTA can update dynamic policies correctly.

bb970483 HRESULT IMFOutputSchema::GetOriginatorID([Out] GUID* pguidOriginatorID) IMFOutputSchema::GetOriginatorID

Retrieves the output protection system that is represented by this object. Output protection systems are identified by value.

bb970414 GetSchemaType GetSchemaType HRESULT IMFOutputSchema::GetSchemaType([Out] GUID* pguidSchemaType)

Returns configuration data for the output protection system. The configuration data is used to enable or disable the protection system, and to set the protection levels.

bb970364 GetConfigurationData GetConfigurationData HRESULT IMFOutputSchema::GetConfigurationData([Out] unsigned int* pdwVal)

Retrieves a identifying the input trust authority (ITA) that generated this output schema object.

All of the policy objects and output schemas from the same ITA should return the same originator identifier (including dynamic policy changes). This value enables the OTA to distinguish policies that originate from different ITAs, so that the OTA can update dynamic policies correctly.

bb970483 GetOriginatorID GetOriginatorID HRESULT IMFOutputSchema::GetOriginatorID([Out] GUID* pguidOriginatorID)

Encapsulates the functionality of one or more output protection systems that a trusted output supports. This interface is exposed by output trust authority (OTA) objects. Each OTA represents a single action that the trusted output can perform, such as play, copy, or transcode. An OTA can represent more than one physical output if each output performs the same action.

ms695254 IMFOutputTrustAuthority IMFOutputTrustAuthority
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the action that is performed by this output trust authority (OTA).

Receives a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970410 HRESULT IMFOutputTrustAuthority::GetAction([Out] MFPOLICYMANAGER_ACTION* pAction) IMFOutputTrustAuthority::GetAction

Sets one or more policy objects on the output trust authority (OTA).

The address of an array of references.

The number of elements in the ppPolicy array.

Receives either a reference to a buffer allocated by the OTA, or the value null. If this parameter receives a non-null value, the caller must release the buffer by calling CoTaskMemFree.

Note??Currently this parameter is reserved. An OTA should set the reference to null.

Receives the size of the ppbTicket buffer, in bytes. If ppbTicket receives the value null, pcbTicket receives the value zero.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

MF_S_WAIT_FOR_POLICY_SET

The policy was negotiated successfully, but the OTA will enforce it asynchronously.

The OTA does not support the requirements of this policy.

?

If the method returns MF_S_WAIT_FOR_POLICY_SET, the OTA sends an event when it enforces the policy.

bb970572 HRESULT IMFOutputTrustAuthority::SetPolicy([In, Buffer, Optional] IMFOutputPolicy** ppPolicy,[In] unsigned int nPolicy,[Out, Buffer, Optional] unsigned char** ppbTicket,[Out, Optional] unsigned int* pcbTicket) IMFOutputTrustAuthority::SetPolicy

Sets one or more policy objects on the output trust authority (OTA).

The address of an array of references.

The number of elements in the ppPolicy array.

Receives either a reference to a buffer allocated by the OTA, or the value null. If this parameter receives a non-null value, the caller must release the buffer by calling CoTaskMemFree.

Note??Currently this parameter is reserved. An OTA should set the reference to null.

Receives the size of the ppbTicket buffer, in bytes. If ppbTicket receives the value null, pcbTicket receives the value zero.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

MF_S_WAIT_FOR_POLICY_SET

The policy was negotiated successfully, but the OTA will enforce it asynchronously.

The OTA does not support the requirements of this policy.

?

If the method returns MF_S_WAIT_FOR_POLICY_SET, the OTA sends an event when it enforces the policy.

bb970572 HRESULT IMFOutputTrustAuthority::SetPolicy([In, Buffer, Optional] IMFOutputPolicy** ppPolicy,[In] unsigned int nPolicy,[Out, Buffer, Optional] unsigned char** ppbTicket,[Out, Optional] unsigned int* pcbTicket) IMFOutputTrustAuthority::SetPolicy

Retrieves the action that is performed by this output trust authority (OTA).

bb970410 GetAction GetAction HRESULT IMFOutputTrustAuthority::GetAction([Out] MFPOLICYMANAGER_ACTION* pAction)

Controls how media sources and transforms are enumerated in Microsoft Media Foundation.

To get a reference to this interface, call .

Media Foundation provides a set of built-in media sources and decoders. Applications can enumerate them as follows:

  • Media sources are enumerated through the Source Resolver.
  • Transforms, such as decoders, are enumerated through the and functions.

Applications might also enumerate these objects indirectly. For example, if an application uses the topology loader to resolve a partial topology, the topology loader calls to find the required decoders.

Third parties can implement their own custom media sources and decoders, and register them for enumeration so that other applications can use them.

To control the enumeration order, Media Foundation maintains two process-wide lists of CLSIDs: a preferred list and a blocked list. An object whose CLSID appears in the preferred list appears first in the enumeration order. An object whose CLSID appears on the blocked list is not enumerated.

The lists are initially populated from the registry. Applications can use the interface to modify the lists for the current process.

The preferred list contains a set of key/value pairs, where the keys are strings and the values are CLSIDs. These key/value pairs are defined as follows:

  • For media sources, the key name is a file name extension, protocol scheme, or MIME type. The value is the CLSID of a scheme handler or byte-stream handler for that media source.
  • For decoders, the key name is a media subtype in canonical string form. (For more information about media subtypes, see Media Types.) The value is the CLSID of the Media Foundation transform (MFT) that implements the decoder.

The following examples show the various types of key:

  • File extension: ".wmv"
  • Scheme: "http:"
  • MIME type: "video/mp4"
  • Media subtype: "{47504A4D-0000-0010-8000-00AA00389B71}"

To search the preferred list by key name, call the method. To enumerate the entire list, call the method in a loop.

The blocked list contains a list of CLSIDs. To enumerate the entire list, call the method in a loop. To check whether a specific CLSID appears on the list, call the method.

dd374302 IMFPluginControl IMFPluginControl
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Searches the preferred list for a class identifier (CLSID) that matches a specified key name.

Member of the enumeration, specifying the type of object.

The key name to match. For more information about the format of key names, see the Remarks section of .

Receives a CLSID from the preferred list.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

HRESULT_FROM_WIN32()

No CLSID matching this key was found.

?

dd374304 HRESULT IMFPluginControl::GetPreferredClsid([In] unsigned int pluginType,[In] const wchar_t* selector,[Out] GUID* clsid) IMFPluginControl::GetPreferredClsid

Gets a class identifier (CLSID) from the preferred list, specified by index value.

Member of the enumeration, specifying the type of object to enumerate.

The zero-based index of the CLSID to retrieve.

Receives the key name associated with the CLSID. The caller must free the memory for the returned string by calling the CoTaskMemFree function. For more information about the format of key names, see the Remarks section of .

Receives the CLSID at the specified index.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

HRESULT_FROM_WIN32()

The index parameter is out of range.

?

dd374305 HRESULT IMFPluginControl::GetPreferredClsidByIndex([In] unsigned int pluginType,[In] unsigned int index,[Out] wchar_t** selector,[Out] GUID* clsid) IMFPluginControl::GetPreferredClsidByIndex

Adds a class identifier (CLSID) to the preferred list or removes a CLSID from the list.

Member of the enumeration, specifying the type of object.

The key name for the CLSID. For more information about the format of key names, see the Remarks section of .

The CLSID to add to the list. If this parameter is null, the key/value entry specified by the selector parameter is removed from the list.

If this method succeeds, it returns . Otherwise, it returns an error code.

The preferred list is global to the caller's process. Calling this method does not affect the list in other process.

dd374308 HRESULT IMFPluginControl::SetPreferredClsid([In] unsigned int pluginType,[In] const wchar_t* selector,[In, Optional] const GUID* clsid) IMFPluginControl::SetPreferredClsid

Queries whether a class identifier (CLSID) appears in the blocked list.

Member of the enumeration, specifying the type of object for the query.

The CLSID to search for.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The specified CLSID appears in the blocked list.

E_INVALIDARG

Invalid argument.

HRESULT_FROM_WIN32()

The specified CLSID is not in the blocked list.

?

dd374306 HRESULT IMFPluginControl::IsDisabled([In] unsigned int pluginType,[In] const GUID& clsid) IMFPluginControl::IsDisabled

Gets a class identifier (CLSID) from the blocked list.

Member of the enumeration, specifying the type of object to enumerate.

The zero-based index of the CLSID to retrieve.

Receives the CLSID at the specified index.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

HRESULT_FROM_WIN32()

The index parameter is out of range.

?

dd374303 HRESULT IMFPluginControl::GetDisabledByIndex([In] unsigned int pluginType,[In] unsigned int index,[Out] GUID* clsid) IMFPluginControl::GetDisabledByIndex

Adds a class identifier (CLSID) to the blocked list, or removes a CLSID from the list.

Member of the enumeration, specifying the type of object.

The CLSID to add or remove.

Specifies whether to add or remove the CSLID. If the value is TRUE, the method adds the CLSID to the blocked list. Otherwise, the method removes it from the list.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

?

The blocked list is global to the caller's process. Calling this method does not affect the list in other processes.

dd374307 HRESULT IMFPluginControl::SetDisabled([In] unsigned int pluginType,[In] const GUID& clsid,[In] BOOL disabled) IMFPluginControl::SetDisabled

Note??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Represents a media item. A media item is an abstraction for a source of media data, such as a video file. Use this interface to get information about the source, or to change certain playback settings, such as the start and stop times. To get a reference to this interface, call one of the following methods:

dd374309 IMFPMediaItem IMFPMediaItem
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets a reference to the MFPlay player object that created the media item.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374313 HRESULT IMFPMediaItem::GetMediaPlayer([Out] IMFPMediaPlayer** ppMediaPlayer) IMFPMediaItem::GetMediaPlayer

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the URL that was used to create the media item.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

MF_E_NOTFOUND

No URL is associated with this media item.

The method was called.

?

This method applies when the application calls to create a media item. If the application calls to create a media item, the GetURL method for that media item returns MF_E_NOTFOUND.

dd374320 HRESULT IMFPMediaItem::GetURL([Out] wchar_t** ppwszURL) IMFPMediaItem::GetURL

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the object that was used to create the media item.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

MF_E_NOTFOUND

The media item was created from a URL, not from an object.

The method was called.

?

The object reference is set if the application uses to create the media item. Otherwise, GetObject returns MF_E_NOTFOUND.

dd374315 HRESULT IMFPMediaItem::GetObjectW([Out] IUnknown** ppIUnknown) IMFPMediaItem::GetObjectW

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the application-defined value stored in the media item.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

You can assign this value when you first create the media item, by specifying it in the dwUserData parameter of the or method. To update the value, call .

This method can be called after the player object is shut down.

dd374321 HRESULT IMFPMediaItem::GetUserData([Out] ULONG_PTR* pdwUserData) IMFPMediaItem::GetUserData

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Stores an application-defined value in the media item.

No documentation.

This method can return one of these values.

This method can be called after the player object is shut down.

dd374328 HRESULT IMFPMediaItem::SetUserData([In] ULONG_PTR dwUserData) IMFPMediaItem::SetUserData

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the start and stop times for the media item.

No documentation. No documentation. No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

The pguidStartPositionType and pguidStopPositionType parameters receive the units of time that are used. Currently, the only supported value is MFP_POSITIONTYPE_100NS.

ValueDescription
MFP_POSITIONTYPE_100NS100-nanosecond units. The time parameter (pvStartValue or pvStopValue) uses the following data type:
  • Variant type (vt): VT_I8
  • Variant member: hVal

?

dd374317 HRESULT IMFPMediaItem::GetStartStopPosition([Out, Optional] GUID* pguidStartPositionType,[Out, Optional] PROPVARIANT* pvStartValue,[Out, Optional] GUID* pguidStopPositionType,[Out, Optional] PROPVARIANT* pvStopValue) IMFPMediaItem::GetStartStopPosition

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Sets the start and stop time for the media item.

No documentation. No documentation. No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

Invalid start or stop time. Any of the following can cause this error:

  • Time less than zero.
  • Time greater than the total duration of the media item.
  • Stop time less than start time.

?

By default, a media item plays from the beginning to the end of the file. This method adjusts the start time and/or the stop time:

  • To set the start time, pass non-null values for pguidStartPositionType and pvStartValue.
  • To set the stop time, pass non-null values for pguidStopPositionType and pvStopValue.

The pguidStartPositionType and pguidStopPositionType parameters give the units of time that are used. Currently, the only supported value is MFP_POSITIONTYPE_100NS.

ValueDescription
MFP_POSITIONTYPE_100NS100-nanosecond units. The time parameter (pvStartValue or pvStopValue) uses the following data type:
  • Variant type (vt): VT_I8
  • Variant member: hVal

To clear a previously set time, use an empty (VT_EMPTY).

?

The adjusted start and stop times are used the next time that is called with this media item. If the media item is already set on the player, the change does not happen unless you call SetMediaItem again.

dd374325 HRESULT IMFPMediaItem::SetStartStopPosition([In, Optional] const GUID* pguidStartPositionType,[In, Optional] const PROPVARIANT* pvStartValue,[In, Optional] const GUID* pguidStopPositionType,[In, Optional] const PROPVARIANT* pvStopValue) IMFPMediaItem::SetStartStopPosition

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queries whether the media item contains a video stream.

No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

To select or deselect streams before playback starts, call .

dd374323 HRESULT IMFPMediaItem::HasVideo([Out, Optional] BOOL* pfHasVideo,[Out, Optional] BOOL* pfSelected) IMFPMediaItem::HasVideo

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queries whether the media item contains an audio stream.

No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

To select or deselect streams before playback starts, call .

dd374322 HRESULT IMFPMediaItem::HasAudio([Out, Optional] BOOL* pfHasAudio,[Out, Optional] BOOL* pfSelected) IMFPMediaItem::HasAudio

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queries whether the media item contains protected content.

Note??Currently does not support playing protected content.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374324 HRESULT IMFPMediaItem::IsProtected([Out] BOOL* pfProtected) IMFPMediaItem::IsProtected

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the duration of the media item.

No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

The method returns the total duration of the content, regardless of any values set through .

dd374312 HRESULT IMFPMediaItem::GetDuration([In] const GUID& guidPositionType,[Out] PROPVARIANT* pvDurationValue) IMFPMediaItem::GetDuration

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the number of streams (audio, video, and other) in the media item.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374314 HRESULT IMFPMediaItem::GetNumberOfStreams([Out] unsigned int* pdwStreamCount) IMFPMediaItem::GetNumberOfStreams

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queries whether a stream is selected to play.

No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

To select or deselect a stream, call .

dd374319 HRESULT IMFPMediaItem::GetStreamSelection([In] unsigned int dwStreamIndex,[Out] BOOL* pfEnabled) IMFPMediaItem::GetStreamSelection

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Selects or deselects a stream.

No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

You can use this method to change which streams are selected. The change goes into effect the next time that is called with this media item. If the media item is already set on the player, the change does not happen unless you call SetMediaItem again with this media item.

dd374326 HRESULT IMFPMediaItem::SetStreamSelection([In] unsigned int dwStreamIndex,[In] BOOL fEnabled) IMFPMediaItem::SetStreamSelection

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queries the media item for a stream attribute.

No documentation. No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

Stream attributes describe an individual stream (audio, video, or other) within the presentation. To get an attribute that applies to the entire presentation, call .

dd374318 HRESULT IMFPMediaItem::GetStreamAttribute([In] unsigned int dwStreamIndex,[In] const GUID& guidMFAttribute,[Out] PROPVARIANT* pvValue) IMFPMediaItem::GetStreamAttribute

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queries the media item for a presentation attribute.

No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

Presentation attributes describe the presentation as a whole. To get an attribute that applies to an individual stream within the presentation, call .

dd374316 HRESULT IMFPMediaItem::GetPresentationAttribute([In] const GUID& guidMFAttribute,[Out] PROPVARIANT* pvValue) IMFPMediaItem::GetPresentationAttribute

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets various flags that describe the media item.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374311 HRESULT IMFPMediaItem::GetCharacteristics([Out] unsigned int* pCharacteristics) IMFPMediaItem::GetCharacteristics

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Sets a media sink for the media item. A media sink is an object that consumes the data from one or more streams.

No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

By default, the MFPlay player object renders audio streams to the Streaming Audio Renderer (SAR) and video streams to the Enhanced Video Renderer (EVR). You can use the SetStreamSink method to provide a different media sink for an audio or video stream; or to support other stream types besides audio and video. You can also use it to configure the SAR or EVR before they are used.

Call this method before calling . Calling this method after SetMediaItem has no effect, unless you stop playback and call SetMediaItem again.

To reset the media item to use the default media sink, set pMediaSink to null.

dd374327 HRESULT IMFPMediaItem::SetStreamSink([In] unsigned int dwStreamIndex,[In, Optional] IUnknown* pMediaSink) IMFPMediaItem::SetStreamSink

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets a property store that contains metadata for the source, such as author or title.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd798056 HRESULT IMFPMediaItem::GetMetadata([Out] IPropertyStore** ppMetadataStore) IMFPMediaItem::GetMetadata

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets a reference to the MFPlay player object that created the media item.

dd374313 GetMediaPlayer GetMediaPlayer HRESULT IMFPMediaItem::GetMediaPlayer([Out] IMFPMediaPlayer** ppMediaPlayer)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the object that was used to create the media item.

The object reference is set if the application uses to create the media item. Otherwise, GetObject returns MF_E_NOTFOUND.

dd374315 GetObjectW GetObjectW HRESULT IMFPMediaItem::GetObjectW([Out] IUnknown** ppIUnknown)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the application-defined value stored in the media item.

You can assign this value when you first create the media item, by specifying it in the dwUserData parameter of the or method. To update the value, call .

This method can be called after the player object is shut down.

dd374321 GetUserData / SetUserData GetUserData HRESULT IMFPMediaItem::GetUserData([Out] ULONG_PTR* pdwUserData)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queries whether the media item contains protected content.

Note??Currently does not support playing protected content.

dd374324 IsProtected IsProtected HRESULT IMFPMediaItem::IsProtected([Out] BOOL* pfProtected)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the number of streams (audio, video, and other) in the media item.

dd374314 GetNumberOfStreams GetNumberOfStreams HRESULT IMFPMediaItem::GetNumberOfStreams([Out] unsigned int* pdwStreamCount)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets various flags that describe the media item.

dd374311 GetCharacteristics GetCharacteristics HRESULT IMFPMediaItem::GetCharacteristics([Out] unsigned int* pCharacteristics)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets a property store that contains metadata for the source, such as author or title.

dd798056 GetMetadata GetMetadata HRESULT IMFPMediaItem::GetMetadata([Out] IPropertyStore** ppMetadataStore)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Contains methods to play media files.

The MFPlay player object exposes this interface. To get a reference to this interface, call .

dd374329 IMFPMediaPlayer IMFPMediaPlayer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Starts playback.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The object's Shutdown method was called.

?

This method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is .

dd374354 HRESULT IMFPMediaPlayer::Play() IMFPMediaPlayer::Play

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Pauses playback. While playback is paused, the most recent video frame is displayed, and audio is silent.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The object's Shutdown method was called.

?

This method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is .

dd374353 HRESULT IMFPMediaPlayer::Pause() IMFPMediaPlayer::Pause

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Stops playback.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The object's Shutdown method was called.

?

This method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is .

The current media item is still valid. After playback stops, the playback position resets to the beginning of the current media item.

dd374368 HRESULT IMFPMediaPlayer::Stop() IMFPMediaPlayer::Stop

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Steps forward one video frame.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Cannot frame step. Reasons for this error code include:

  • There is no media item queued for playback.
  • The current media item does not contain video.

The object's Shutdown method was called.

The media source does not support frame stepping, or the current playback rate is negative.

?

This method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is .

The player object does not support frame stepping during reverse playback (that is, while the playback rate is negative).

dd374336 HRESULT IMFPMediaPlayer::FrameStep() IMFPMediaPlayer::FrameStep

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Sets the playback position.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

HRESULT_FROM_WIN32( )

The value of pvPositionValue is not valid.

No media item has been queued.

The object's Shutdown method was called.

?

If you call this method while playback is stopped, the new position takes effect after playback resumes.

This method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is .

If playback was started before SetPosition is called, playback resumes at the new position. If playback was paused, the video is refreshed to display the current frame at the new position.

If you make two consecutive calls to SetPosition with guidPositionType equal to MFP_POSITIONTYPE_100NS, and the second call is made before the first call has completed, the second call supersedes the first. The status code for the superseded call is set to S_FALSE in the event data for that call. This behavior prevents excessive latency from repeated calls to SetPosition, as each call may force the media source to perform a relatively lengthy seek operation.

dd374363 HRESULT IMFPMediaPlayer::SetPosition([In] const GUID& guidPositionType,[In] const PROPVARIANT* pvPositionValue) IMFPMediaPlayer::SetPosition

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current playback position.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

No media item has been queued.

The object's Shutdown method was called.

?

The playback position is calculated relative to the start time of the media item, which can be specified by calling . For example, if you set the start time to 20 seconds and the source duration is 60 seconds, the range of values returned by GetPosition is 0?40 seconds.

dd374345 HRESULT IMFPMediaPlayer::GetPosition([In] const GUID& guidPositionType,[Out] PROPVARIANT* pvPositionValue) IMFPMediaPlayer::GetPosition

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the playback duration of the current media item.

No documentation. No documentation.

This method can return one of these values.

Return codeDescription

The method succeeded.

The media source does not have a duration. This error can occur with a live source, such as a video camera.

There is no current media item.

?

This method calculates the playback duration, taking into account the start and stop times for the media item. To set the start and stop times, call on the media item. To get the actual duration of the underlying media file, regardless of start and stop times, call .

For example, suppose that you load a 30-second audio file and set the start time equal to 2 seconds and stop time equal to 10 seconds. The method will return 30 seconds, but the method will return 8 seconds.

dd374340 HRESULT IMFPMediaPlayer::GetDuration([In] const GUID& guidPositionType,[Out] PROPVARIANT* pvDurationValue) IMFPMediaPlayer::GetDuration

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Sets the playback rate.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The flRate parameter is zero.

The object's Shutdown method was called.

?

This method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is .

The method sets the nearest supported rate, which will depend on the underlying media source. For example, if flRate is 50 and the source's maximum rate is 8? normal rate, the method will set the rate to 8.0. The actual rate is indicated in the event data for the event.

To find the range of supported rates, call .

This method does not support playback rates of zero, although Media Foundation defines a meaning for zero rates in some other contexts.

The new rate applies only to the current media item. Setting a new media item resets the playback rate to 1.0.

dd374364 HRESULT IMFPMediaPlayer::SetRate([In] float flRate) IMFPMediaPlayer::SetRate

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current playback rate.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374346 HRESULT IMFPMediaPlayer::GetRate([Out] float* pflRate) IMFPMediaPlayer::GetRate

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the range of supported playback rates.

No documentation. No documentation. No documentation.

This method can return one of these values.

Return codeDescription

The method succeeded.

The current media item does not support playback in the requested direction (either forward or reverse).

?

Playback rates are expressed as a ratio of the current rate to the normal rate. For example, 1.0 indicates normal playback speed, 0.5 indicates half speed, and 2.0 indicates twice speed. Positive values indicate forward playback, and negative values indicate reverse playback.

dd374348 HRESULT IMFPMediaPlayer::GetSupportedRates([In] BOOL fForwardDirection,[Out] float* pflSlowestRate,[Out] float* pflFastestRate) IMFPMediaPlayer::GetSupportedRates

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current playback state of the MFPlay player object.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method can be called after the player object has been shut down.

Many of the methods complete asynchronously. While an asynchronous operation is pending, the current state is not updated until the operation completes. When the operation completes, the application receives an event callback, and the new state is given in the structure that is passed to the callback.

dd374347 HRESULT IMFPMediaPlayer::GetState([Out] MFP_MEDIAPLAYER_STATE* peState) IMFPMediaPlayer::GetState

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Creates a media item from a URL.

No documentation. No documentation. No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

Invalid request. This error can occur when fSync is and the application did not provide a callback interface. See Remarks.

The object's Shutdown method was called.

Unsupported protocol.

?

This method does not queue the media item for playback. To queue the item for playback, call .

The CreateMediaItemFromURL method can be called either synchronously or asynchronously:

  • If fSync is TRUE, the method completes synchronously. The reference is returned in the ppMediaItem parameter.
  • If fSync is , the method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is . The event data contains the reference for the new media item.

The callback interface is set when you first call to create the MFPlay player object. If you do not provide a callback interface, the fSync parameter must be TRUE. Otherwise, CreateMediaItemFromURL returns .

If you make multiple asynchronous calls to CreateMediaItemFromURL, they are not guaranteed to complete in the same order. Use the dwUserData parameter to match created media items with pending requests.

Currently, this method returns if the URL specifies any of the following protocols: rtsp*, mms*, or mcast. If you want to use the Media Foundation network source with MFPlay, first use the Source Resolver to create the source, and then call .

dd374335 HRESULT IMFPMediaPlayer::CreateMediaItemFromURL([In] const wchar_t* pwszURL,[In] BOOL fSync,[In] ULONG_PTR dwUserData,[Out, Optional] IMFPMediaItem** ppMediaItem) IMFPMediaPlayer::CreateMediaItemFromURL

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Creates a media item from an object.

No documentation. No documentation. No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

Invalid request. This error can occur when fSync is and the application did not provide a callback interface. See Remarks.

The object's Shutdown method was called.

?

The pIUnknownObj parameter must specify one of the following:

  • A reference to a media source. Media sources expose the interface. It is the caller's responsibility to call on the media source.
  • A reference to a byte stream. Byte streams expose the interface. Internally, the method calls the method to create a media source from the byte stream. Therefore, a byte-stream handler must be registered for the byte stream. For more information about byte-stream handlers, see Scheme Handlers and Byte-Stream Handlers.

This method does not queue the media item for playback. To queue the item for playback, call .

The CreateMediaItemFromObject method can be called either synchronously or asynchronously:

  • If fSync is TRUE, the method completes synchronously. The reference is returned in the ppMediaItem parameter.
  • If fSync is , the method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is . The event data contains the reference for the new media item.

The callback interface is set when you first call to create the MFPlay player object. If you do not provide a callback interface, the fSync parameter must be TRUE. Otherwise, CreateMediaItemFromObject returns .

If you make multiple asynchronous calls to CreateMediaItemFromObject, they are not guaranteed to complete in the same order. Use the dwUserData parameter to match created media items with pending requests.

dd374334 HRESULT IMFPMediaPlayer::CreateMediaItemFromObject([In] IUnknown* pIUnknownObj,[In] BOOL fSync,[In] ULONG_PTR dwUserData,[Out, Optional] IMFPMediaItem** ppMediaItem) IMFPMediaPlayer::CreateMediaItemFromObject

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queues a media item for playback.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

The media item contains protected content. MFPlay currently does not support protected content.

No audio playback device was found. This error can occur if the media source contains audio, but no audio playback devices are available on the system.

The object's Shutdown method was called.

?

This method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is .

To create a media item, call or . A media item must be used with the same MFPlay player object that created that item. If the media item was created by a different instance of the player object, SetMediaItem returns E_INVALIDARG.

dd374361 HRESULT IMFPMediaPlayer::SetMediaItem([In] IMFPMediaItem* pIMFPMediaItem) IMFPMediaPlayer::SetMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Clears the current media item.

Note??This method is currently not implemented.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method stops playback and releases the player object's references to the current media item.

This method completes asynchronously. When the operation completes, the application's callback method is invoked. The event type is .

dd374332 HRESULT IMFPMediaPlayer::ClearMediaItem() IMFPMediaPlayer::ClearMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets a reference to the current media item.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_FAIL

There is no current media item.

There is no current media item.

The object's Shutdown method was called.

?

The method is asynchronous. Therefore, while SetMediaItem is pending, GetMediaItem will not return the media item that was just set. Instead, the application should implement interface and handle the event. For more information, see Receiving Events From the Player.

The previous remark also applies to setting the media item in the function.

dd374342 HRESULT IMFPMediaPlayer::GetMediaItem([Out] IMFPMediaItem** ppIMFPMediaItem) IMFPMediaPlayer::GetMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current audio volume.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374351 HRESULT IMFPMediaPlayer::GetVolume([Out] float* pflVolume) IMFPMediaPlayer::GetVolume

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Sets the audio volume.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The flVolume parameter is invalid.

?

If you call this method before playback starts, the setting is applied after playback starts.

This method does not change the master volume level for the player's audio session. Instead, it adjusts the per-channel volume levels for audio stream(s) that belong to the current media item. Other streams in the audio session are not affected. For more information, see Managing the Audio Session.

dd374366 HRESULT IMFPMediaPlayer::SetVolume([In] float flVolume) IMFPMediaPlayer::SetVolume

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current audio balance.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374338 HRESULT IMFPMediaPlayer::GetBalance([Out] float* pflBalance) IMFPMediaPlayer::GetBalance

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Sets the audio balance.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The flBalance parameter is invalid.

?

If you call this method before playback starts, the setting is applied when playback starts.

dd374359 HRESULT IMFPMediaPlayer::SetBalance([In] float flBalance) IMFPMediaPlayer::SetBalance

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queries whether the audio is muted.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374343 HRESULT IMFPMediaPlayer::GetMute([Out] BOOL* pfMute) IMFPMediaPlayer::GetMute

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Mutes or unmutes the audio.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

If you call this method before playback starts, the setting is applied after playback starts.

This method does not mute the entire audio session to which the player belongs. It mutes only the streams from the current media item. Other streams in the audio session are not affected. For more information, see Managing the Audio Session.

dd374362 HRESULT IMFPMediaPlayer::SetMute([In] BOOL fMute) IMFPMediaPlayer::SetMute

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the size and aspect ratio of the video. These values are computed before any scaling is done to fit the video into the destination window.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The current media item does not contain video.

The object's Shutdown method was called.

?

At least one parameter must be non-null.

dd374344 HRESULT IMFPMediaPlayer::GetNativeVideoSize([Out, Optional] SIZE* pszVideo,[Out, Optional] SIZE* pszARVideo) IMFPMediaPlayer::GetNativeVideoSize

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the range of video sizes that can be displayed without significantly degrading performance or image quality.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The current media item does not contain video.

The object's Shutdown method was called.

?

At least one parameter must be non-null. Sizes are given in pixels.

dd374341 HRESULT IMFPMediaPlayer::GetIdealVideoSize([Out, Optional] SIZE* pszMin,[Out, Optional] SIZE* pszMax) IMFPMediaPlayer::GetIdealVideoSize

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Sets the video source rectangle.

MFPlay clips the video to this rectangle and stretches the rectangle to fill the video window.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The current media item does not contain video.

The object's Shutdown method was called.

?

MFPlay stretches the source rectangle to fill the entire video window. By default, MFPlay maintains the source's correct aspect ratio, letterboxing if needed. The letterbox color is controlled by the method.

This method fails if no media item is currently set, or if the current media item does not contain video.

To set the video position before playback starts, call this method inside your event handler for the event. For more information, see .

dd743247 HRESULT IMFPMediaPlayer::SetVideoSourceRect([In] const MFVideoNormalizedRect* pnrcSource) IMFPMediaPlayer::SetVideoSourceRect

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the video source rectangle.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The current media item does not contain video.

The object's Shutdown method was called.

?

dd743246 HRESULT IMFPMediaPlayer::GetVideoSourceRect([Out] MFVideoNormalizedRect* pnrcSource) IMFPMediaPlayer::GetVideoSourceRect

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Specifies whether the aspect ratio of the video is preserved during playback.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The current media item does not contain video.

The object's Shutdown method was called.

?

This method fails if no media item is currently set, or if the current media item does not contain video.

To set the aspect-ratio mode before playback starts, call this method inside your event handler for the event. For more information, see .

dd374358 HRESULT IMFPMediaPlayer::SetAspectRatioMode([In] unsigned int dwAspectRatioMode) IMFPMediaPlayer::SetAspectRatioMode

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current aspect-ratio correction mode. This mode controls whether the aspect ratio of the video is preserved during playback.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The current media item does not contain video.

The object's Shutdown method was called.

?

dd374337 HRESULT IMFPMediaPlayer::GetAspectRatioMode([Out] unsigned int* pdwAspectRatioMode) IMFPMediaPlayer::GetAspectRatioMode

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the window where the video is displayed.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

The video window is specified when you first call to create the MFPlay player object.

dd374350 HRESULT IMFPMediaPlayer::GetVideoWindow([Out] HWND* phwndVideo) IMFPMediaPlayer::GetVideoWindow

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Updates the video frame.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The current media item does not contain video.

The object's Shutdown method was called.

?

Call this method when your application's video playback window receives either a WM_PAINT or WM_SIZE message. This method performs two functions:

  • Ensures that the video frame is repainted while playback is paused or stopped.
  • Adjusts the displayed video to match the current size of the video window.

Important??Call the GDI BeginPaint function before calling UpdateVideo.

dd743248 HRESULT IMFPMediaPlayer::UpdateVideo() IMFPMediaPlayer::UpdateVideo

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Sets the color for the video border. The border color is used to letterbox the video.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The current media item does not contain video.

MF_E_SHUTDOWN

The object's Shutdown method was called.

?

This method fails if no media item is currently set, or if the current media item does not contain video.

To set the border color before playback starts, call this method inside your event handler for the event. For more information, see .

dd374360 HRESULT IMFPMediaPlayer::SetBorderColor([In] COLORREF Clr) IMFPMediaPlayer::SetBorderColor

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current color of the video border. The border color is used to letterbox the video.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The current media item does not contain video.

The object's Shutdown method was called.

?

dd374339 HRESULT IMFPMediaPlayer::GetBorderColor([Out] COLORREF* pClr) IMFPMediaPlayer::GetBorderColor

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Applies an audio or video effect to playback.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

This effect was already added.

?

The object specified in the pEffect parameter can implement either a video effect or an audio effect. The effect is applied to any media items set after the method is called. It is not applied to the current media item.

For each media item, the effect is applied to the first selected stream of the matching type (audio or video). If a media item has two selected streams of the same type, the second stream does not receive the effect. The effect is ignored if the media item does not contain a stream that matches the effect type. For example, if you set a video effect and play a file that contains just audio, the video effect is ignored, although no error is raised.

The effect is applied to all subsequent media items, until the application removes the effect. To remove an effect, call or .

If you set multiple effects of the same type (audio or video), they are applied in the same order in which you call InsertEffect.

dd374352 HRESULT IMFPMediaPlayer::InsertEffect([In] IUnknown* pEffect,[In] BOOL fOptional) IMFPMediaPlayer::InsertEffect

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Removes an effect that was added with the method.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The effect was not found.

?

The change applies to the next media item that is set on the player. The effect is not removed from the current media item.

dd374356 HRESULT IMFPMediaPlayer::RemoveEffect([In] IUnknown* pEffect) IMFPMediaPlayer::RemoveEffect

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Removes all effects that were added with the method.

If this method succeeds, it returns . Otherwise, it returns an error code.

The change applies to the next media item that is set on the player. The effects are not removed from the current media item.

dd374355 HRESULT IMFPMediaPlayer::RemoveAllEffects() IMFPMediaPlayer::RemoveAllEffects

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Shuts down the MFPlay player object and releases any resources the object is using.

If this method succeeds, it returns . Otherwise, it returns an error code.

After this method is called, most methods return . Also, any media items created from this instance of the player object are invalidated and most methods also return .

The player object automatically shuts itself down when its reference count reaches zero. You can use the Shutdown method to shut down the player before all of the references have been released.

dd374367 HRESULT IMFPMediaPlayer::Shutdown() IMFPMediaPlayer::Shutdown

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current playback rate.

dd374346 GetRate / SetRate GetRate HRESULT IMFPMediaPlayer::GetRate([Out] float* pflRate)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current playback state of the MFPlay player object.

This method can be called after the player object has been shut down.

Many of the methods complete asynchronously. While an asynchronous operation is pending, the current state is not updated until the operation completes. When the operation completes, the application receives an event callback, and the new state is given in the structure that is passed to the callback.

dd374347 GetState GetState HRESULT IMFPMediaPlayer::GetState([Out] MFP_MEDIAPLAYER_STATE* peState)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets a reference to the current media item.

The method is asynchronous. Therefore, while SetMediaItem is pending, GetMediaItem will not return the media item that was just set. Instead, the application should implement interface and handle the event. For more information, see Receiving Events From the Player.

The previous remark also applies to setting the media item in the function.

dd374342 GetMediaItem / SetMediaItem GetMediaItem HRESULT IMFPMediaPlayer::GetMediaItem([Out] IMFPMediaItem** ppIMFPMediaItem)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current audio volume.

dd374351 GetVolume / SetVolume GetVolume HRESULT IMFPMediaPlayer::GetVolume([Out] float* pflVolume)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current audio balance.

dd374338 GetBalance / SetBalance GetBalance HRESULT IMFPMediaPlayer::GetBalance([Out] float* pflBalance)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Queries whether the audio is muted.

dd374343 GetMute / SetMute GetMute HRESULT IMFPMediaPlayer::GetMute([Out] BOOL* pfMute)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the video source rectangle.

dd743246 GetVideoSourceRect / SetVideoSourceRect GetVideoSourceRect HRESULT IMFPMediaPlayer::GetVideoSourceRect([Out] MFVideoNormalizedRect* pnrcSource)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current aspect-ratio correction mode. This mode controls whether the aspect ratio of the video is preserved during playback.

dd374337 GetAspectRatioMode / SetAspectRatioMode GetAspectRatioMode HRESULT IMFPMediaPlayer::GetAspectRatioMode([Out] unsigned int* pdwAspectRatioMode)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the window where the video is displayed.

The video window is specified when you first call to create the MFPlay player object.

dd374350 GetVideoWindow GetVideoWindow HRESULT IMFPMediaPlayer::GetVideoWindow([Out] HWND* phwndVideo)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Gets the current color of the video border. The border color is used to letterbox the video.

dd374339 GetBorderColor / SetBorderColor GetBorderColor HRESULT IMFPMediaPlayer::GetBorderColor([Out] COLORREF* pClr)

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Callback interface for the interface.

To set the callback, pass an reference to the function in the pCallback parameter. The application implements the interface.

dd374330 IMFPMediaPlayerCallback IMFPMediaPlayerCallback
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Called by the MFPlay player object to notify the application of a playback event.

No documentation.

The specific type of playback event is given in the eEventType member of the structure. This structure contains information that is common to all of the event types. Some event types use extended structures. A set of macros is defined for casting the pEventHeader reference to the correct structure type. For more information, see .

It is safe to call and methods inside the OnMediaPlayer method. MFPlay is guaranteed not to reenter the OnMediaPlayer method. That is, calls to OnMediaPlayer are serialized, and the method will not be invoked again from inside OnMediaPlayer.

dd374331 void IMFPMediaPlayerCallback::OnMediaPlayerEvent([In] MFP_EVENT_HEADER* pEventHeader) IMFPMediaPlayerCallback::OnMediaPlayerEvent

Enables a media source to receive a reference to the interface.

If a media source exposes this interface, the Protected Media Path (PMP) Media Session calls SetPMPHost with a reference to the interface. The media source can use the interface to create objects in the PMP process.

ms702104 IMFPMPClient IMFPMPClient
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Provides a reference to the interface.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

The reference is apartment threaded. The media source must add the reference to the global interface table (GIT) before using it.

ms703915 HRESULT IMFPMPClient::SetPMPHost([In] IMFPMPHost* pPMPHost) IMFPMPClient::SetPMPHost

Provides a reference to the interface.

The reference is apartment threaded. The media source must add the reference to the global interface table (GIT) before using it.

ms703915 SetPMPHost SetPMPHost HRESULT IMFPMPClient::SetPMPHost([In] IMFPMPHost* pPMPHost)

Blocks the protected media path (PMP) process from ending.

When this method is called, it increments the lock count on the PMP process. For every call to this method, the application should make a corresponding call to , which decrements the lock count. When the PMP process is ready to exit, it waits for about 3 seconds, or until the lock count reaches zero, before exiting.

ms697003 IMFPMPHost IMFPMPHost
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Blocks the protected media path (PMP) process from ending.

If this method succeeds, it returns . Otherwise, it returns an error code.

When this method is called, it increments the lock count on the PMP process. For every call to this method, the application should make a corresponding call to , which decrements the lock count. When the PMP process is ready to exit, it waits for about 3 seconds, or until the lock count reaches zero, before exiting.

ms697003 HRESULT IMFPMPHost::LockProcess() IMFPMPHost::LockProcess

Decrements the lock count on the protected media path (PMP) process. Call this method once for each call to .

If this method succeeds, it returns . Otherwise, it returns an error code.

ms698984 HRESULT IMFPMPHost::UnlockProcess() IMFPMPHost::UnlockProcess

Creates an object in the protect media path (PMP) process, from a CLSID.

The CLSID of the object to create.

A reference to the interface. This parameter can be null. If this parameter is not null, the PMP host queries the created object for the IPersistStream interface and calls IPersistStream::Load, passing in the pStream reference.

The interface identifier (IID) of the interface to retrieve.

Receives a reference to the requested interface. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

You can use the pStream parameter to initialize the object after it is created.

ms698995 HRESULT IMFPMPHost::CreateObjectByCLSID([In] const GUID& clsid,[In] IStream* pStream,[In] const GUID& riid,[In] void** ppv) IMFPMPHost::CreateObjectByCLSID

Enables two instances of the Media Session to share the same protected media path (PMP) process.

If your application creates more than one instance of the Media Session, you can use this interface to share the same PMP process among several instances. This can be more efficient than re-creating the PMP process each time.

Use this interface as follows:

  1. Create the first instance of the PMP Media Session by calling .
  2. Retrieve an reference from the first Media Session by calling with the service identifier .
  3. Create the second instance of the PMP Media Session. Set the attribute on the pConfiguration parameter of the function. The attribute value is the reference retrieved in step 2.
ms702977 IMFPMPServer IMFPMPServer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Blocks the protected media path (PMP) process from ending.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

When this method is called, it increments the lock count on the PMP process. For every call to this method, the application should make a corresponding call to , which decrements the lock count. When the PMP process is ready to exit, it waits for about 3 seconds, or until the lock count reaches zero, before exiting.

ms701590 HRESULT IMFPMPServer::LockProcess() IMFPMPServer::LockProcess

Decrements the lock count on the protected media path (PMP) process. Call this method once for each call to .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms696204 HRESULT IMFPMPServer::UnlockProcess() IMFPMPServer::UnlockProcess

Creates an object in the protected media path (PMP) process.

CLSID of the object to create.

Interface identifier of the interface to retrieve.

Receives a reference to the requested interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms704806 HRESULT IMFPMPServer::CreateObjectByCLSID([In] const GUID& clsid,[In] const GUID& riid,[Out] void** ppObject) IMFPMPServer::CreateObjectByCLSID

Represents a presentation clock, which is used to schedule when samples are rendered and to synchronize multiple streams.

To create a new instance of the presentation clock, call the function. The presentation clock must have a time source, which is an object that provides the clock times. For example, the audio renderer is a time source that uses the sound card to drive the clock. Time sources expose the interface. To set the time source, call SetTimeSource. The presentation clock does not begin running until the Start method is called.

To get the presentation clock from the Media Session, call .

ms701581 IMFPresentationClock IMFPresentationClock
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the time source for the presentation clock. The time source is the object that drives the clock by providing the current time.

Pointer to the interface of the time source.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The time source does not have a frequency of 10 MHz.

The time source has not been initialized.

?

The presentation clock cannot start until it has a time source.

The time source is automatically registered to receive state change notifications from the clock, through the time source's interface, which all time sources must implement.

This time source have a frequency of 10 MHz. See . If not, the method returns .

ms694835 HRESULT IMFPresentationClock::SetTimeSource([In, Optional] IMFPresentationTimeSource* pTimeSource) IMFPresentationClock::SetTimeSource

Retrieves the clock's presentation time source.

Receives a reference to the time source's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No time source was set on this clock.

?

ms704730 HRESULT IMFPresentationClock::GetTimeSource([Out] IMFPresentationTimeSource** ppTimeSource) IMFPresentationClock::GetTimeSource

Retrieves the latest clock time.

Receives the latest clock time, in 100-nanosecond units. The time is relative to when the clock was last started.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The clock does not have a presentation time source. Call .

?

This method does not attempt to smooth out jitter or otherwise account for any inaccuracies in the clock time.

ms696209 HRESULT IMFPresentationClock::GetTime([Out] longlong* phnsClockTime) IMFPresentationClock::GetTime

Registers an object to be notified whenever the clock starts, stops, or pauses, or changes rate.

Pointer to the object's interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Before releasing the object, call to unregister the object for state-change notifications.

ms703129 HRESULT IMFPresentationClock::AddClockStateSink([In, Optional] IMFClockStateSink* pStateSink) IMFPresentationClock::AddClockStateSink

Unregisters an object that is receiving state-change notifications from the clock.

Pointer to the object's interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms703032 HRESULT IMFPresentationClock::RemoveClockStateSink([In, Optional] IMFClockStateSink* pStateSink) IMFPresentationClock::RemoveClockStateSink

Starts the presentation clock.

Initial starting time, in 100-nanosecond units. At the time the Start method is called, the clock's method returns this value, and the clock time increments from there. If the value is PRESENTATION_CURRENT_POSITION, the clock starts from its current position. Use this value if the clock is paused and you want to restart it from the same position.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No time source was set on this clock.

?

This method is valid in all states (stopped, paused, or running).

If the clock is paused and restarted from the same position (llClockStartOffset is PRESENTATION_CURRENT_POSITION), the presentation clock sends an notification. Otherwise, the clock sends an notification.

The presentation clock initiates the state change by calling OnClockStart or OnClockRestart on the clock's time source. This call is made synchronously. If it fails, the state change does not occur. If the call succeeds, the state changes, and the clock notifies the other state-change subscribers by calling their OnClockStart or OnClockRestart methods. These calls are made asynchronously.

If the clock is already running, calling Start again has the effect of seeking the clock to the new StartOffset position.

ms702290 HRESULT IMFPresentationClock::Start([In] longlong llClockStartOffset) IMFPresentationClock::Start

Stops the presentation clock. While the clock is stopped, the clock time does not advance, and the clock's method returns zero.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No time source was set on this clock.

The clock is already stopped.

?

This method is valid when the clock is running or paused.

The presentation clock initiates the state change by calling on the clock's time source. This call is made synchronously. If it fails, the state change does not occur. If the call succeeds, the state changes, and the clock notifies the other state-change subscribers by calling their OnClockStop methods. These calls are made asynchronously.

ms697195 HRESULT IMFPresentationClock::Stop() IMFPresentationClock::Stop

Pauses the presentation clock. While the clock is paused, the clock time does not advance, and the clock's returns the time at which the clock was paused.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No time source was set on this clock.

The clock is already paused.

The clock is stopped. This request is not valid when the clock is stopped.

?

This method is valid when the clock is running. It is not valid when the clock is paused or stopped.

The presentation clock initiates the state change by calling on the clock's time source. This call is made synchronously. If it fails, the state change does not occur. If the call succeeds, the state changes, and the clock notifies the other state-change subscribers by calling their OnClockPause methods. These calls are made asynchronously.

ms696201 HRESULT IMFPresentationClock::Pause() IMFPresentationClock::Pause

Retrieves the clock's presentation time source.

ms704730 GetTimeSource / SetTimeSource GetTimeSource HRESULT IMFPresentationClock::GetTimeSource([Out] IMFPresentationTimeSource** ppTimeSource)

Retrieves the latest clock time.

This method does not attempt to smooth out jitter or otherwise account for any inaccuracies in the clock time.

ms696209 GetTime GetTime HRESULT IMFPresentationClock::GetTime([Out] longlong* phnsClockTime)

Describes the details of a presentation. A presentation is a set of related media streams that share a common presentation time.

Presentation descriptors are used to configure media sources and some media sinks. To get the presentation descriptor from a media source, call . To create a new presentation descriptor, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703990 IMFPresentationDescriptor IMFPresentationDescriptor
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the number of stream descriptors in the presentation. Each stream descriptor contains information about one stream in the media source. To retrieve a stream descriptor, call the method.

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms701621 HRESULT IMFPresentationDescriptor::GetStreamDescriptorCount([Out] unsigned int* pdwDescriptorCount) IMFPresentationDescriptor::GetStreamDescriptorCount

Retrieves a stream descriptor for a stream in the presentation. The stream descriptor contains information about the stream.

Zero-based index of the stream. To find the number of streams in the presentation, call the method.

Receives a Boolean value. The value is TRUE if the stream is currently selected, or if the stream is currently deselected. If a stream is selected, the media source generates data for that stream when is called. The media source will not generated data for deselected streams. To select a stream, call .To deselect a stream, call .

Receives a reference to the stream descriptor's interface. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms694924 HRESULT IMFPresentationDescriptor::GetStreamDescriptorByIndex([In] unsigned int dwIndex,[Out] BOOL* pfSelected,[Out] IMFStreamDescriptor** ppDescriptor) IMFPresentationDescriptor::GetStreamDescriptorByIndex

Selects a stream in the presentation.

The stream number to select, indexed from zero. To find the number of streams in the presentation, call .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

dwDescriptorIndex is out of range.

?

If a stream is selected, the media source will generate data for that stream. The media source will not generated data for deselected streams. To deselect a stream, call .

To query whether a stream is selected, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms696272 HRESULT IMFPresentationDescriptor::SelectStream([In] unsigned int dwDescriptorIndex) IMFPresentationDescriptor::SelectStream

Deselects a stream in the presentation.

The stream number to deselect, indexed from zero. To find the number of streams in the presentation, call the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

dwDescriptorIndex is out of range.

?

If a stream is deselected, no data is generated for that stream. To select the stream again, call .

To query whether a stream is selected, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms696266 HRESULT IMFPresentationDescriptor::DeselectStream([In] unsigned int dwDescriptorIndex) IMFPresentationDescriptor::DeselectStream

Creates a copy of this presentation descriptor.

Receives a reference to the interface of the new presentation descriptor. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method performs a shallow copy of the presentation descriptor. The stream descriptors are not cloned. Therefore, use caution when modifying the presentation presentation descriptor or its stream descriptors.

If the original presentation descriptor is from a media source, do not modify the presentation descriptor unless the source is stopped. If you use the presentation descriptor to configure a media sink, do not modify the presentation descriptor after the sink is configured.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms694028 HRESULT IMFPresentationDescriptor::Clone([Out] IMFPresentationDescriptor** ppPresentationDescriptor) IMFPresentationDescriptor::Clone

Retrieves the number of stream descriptors in the presentation. Each stream descriptor contains information about one stream in the media source. To retrieve a stream descriptor, call the method.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms701621 GetStreamDescriptorCount GetStreamDescriptorCount HRESULT IMFPresentationDescriptor::GetStreamDescriptorCount([Out] unsigned int* pdwDescriptorCount)

Provides the clock times for the presentation clock.

This interface is implemented by presentation time sources. A presentation time source is an object that provides the clock time for the presentation clock. For example, the audio renderer is a presentation time source. The rate at which the audio renderer consumes audio samples determines the clock time. If the audio format is 44100 samples per second, the audio renderer will report that one second has passed for every 44100 audio samples it plays. In this case, the timing is provided by the sound card.

To set the presentation time source on the presentation clock, call with a reference to the time source's interface.

A presentation time source must also implement the interface. The presentaton clock uses this interface to notify the time source when the clock state changes.

Media Foundation provides a presentation time source that is based on the system clock. To create this object, call the function.

ms704711 IMFPresentationTimeSource IMFPresentationTimeSource
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the underlying clock that the presentation time source uses to generate its clock times.

Receives a reference to the clock's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

This time source does not expose an underlying clock.

?

A presentation time source must support stopping, starting, pausing, and rate changes. However, in many cases the time source derives its clock times from a hardware clock or other device. The underlying clock is always running, and might not support rate changes.

Optionally, a time source can expose the underlying clock by implementing this method. The underlying clock is always running, even when the presentation time source is paused or stopped. (Therefore, the underlying clock returns the flag in the method).

The underlying clock is useful if you want to make decisions based on the clock times while the presentation clock is stopped or paused.

If the time source does not expose an underlying clock, the method returns .

ms694071 HRESULT IMFPresentationTimeSource::GetUnderlyingClock([Out] IMFClock** ppClock) IMFPresentationTimeSource::GetUnderlyingClock

Retrieves the underlying clock that the presentation time source uses to generate its clock times.

A presentation time source must support stopping, starting, pausing, and rate changes. However, in many cases the time source derives its clock times from a hardware clock or other device. The underlying clock is always running, and might not support rate changes.

Optionally, a time source can expose the underlying clock by implementing this method. The underlying clock is always running, even when the presentation time source is paused or stopped. (Therefore, the underlying clock returns the flag in the method).

The underlying clock is useful if you want to make decisions based on the clock times while the presentation clock is stopped or paused.

If the time source does not expose an underlying clock, the method returns .

ms694071 GetUnderlyingClock GetUnderlyingClock HRESULT IMFPresentationTimeSource::GetUnderlyingClock([Out] IMFClock** ppClock)

Enables the quality manager to adjust the audio or video quality of a component in the pipeline.

This interface is exposed by pipeline components that can adjust their quality. Typically it is exposed by decoders and stream sinks. For example, the enhanced video renderer (EVR) implements this interface. However, media sources can also implement this interface.

To get a reference to this interface from a media source, call with the service identifier . For all other pipeline objects (transforms and media sinks), call QueryInterface.

The quality manager typically obtains this interface when the quality manager's method is called.

ms695241 IMFQualityAdvise IMFQualityAdvise
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the drop mode. In drop mode, a component drops samples, more or less aggressively depending on the level of the drop mode.

Requested drop mode, specified as a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The component does not support the specified mode or any higher modes.

?

If this method is called on a media source, the media source might switch between thinned and non-thinned output. If that occurs, the affected streams will send an event to indicate the transition. The operation is asynchronous; after SetDropMode returns, you might receive samples that were queued before the transition. The event marks the exact point in the stream where the transition occurs.

ms694861 HRESULT IMFQualityAdvise::SetDropMode([In] MF_QUALITY_DROP_MODE eDropMode) IMFQualityAdvise::SetDropMode

Sets the quality level. The quality level determines how the component consumes or produces samples.

Requested quality level, specified as a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The component does not support the specified quality level or any levels below it.

?

ms705619 HRESULT IMFQualityAdvise::SetQualityLevel([In] MF_QUALITY_LEVEL eQualityLevel) IMFQualityAdvise::SetQualityLevel

Retrieves the current drop mode.

Receives the drop mode, specified as a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms702987 HRESULT IMFQualityAdvise::GetDropMode([Out] MF_QUALITY_DROP_MODE* peDropMode) IMFQualityAdvise::GetDropMode

Retrieves the current quality level.

Receives the quality level, specified as a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms701591 HRESULT IMFQualityAdvise::GetQualityLevel([Out] MF_QUALITY_LEVEL* peQualityLevel) IMFQualityAdvise::GetQualityLevel

Drops samples over a specified interval of time.

Amount of time to drop, in 100-nanosecond units. This value is always absolute. If the method is called multiple times, do not add the times from previous calls.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The object does not support this method.

?

Ideally the quality manager can prevent a renderer from falling behind. But if this does occur, then simply lowering quality does not guarantee the renderer will ever catch up. As a result, audio and video might fall out of sync. To correct this problem, the quality manager can call DropTime to request that the renderer drop samples quickly over a specified time interval. After that period, the renderer stops dropping samples.

This method is primarily intended for the video renderer. Dropped audio samples cause audio glitching, which is not desirable.

If a component does not support this method, it should return .

ms697431 HRESULT IMFQualityAdvise::DropTime([In] longlong hnsAmountToDrop) IMFQualityAdvise::DropTime

Retrieves the current drop mode.

ms702987 GetDropMode / SetDropMode GetDropMode HRESULT IMFQualityAdvise::GetDropMode([Out] MF_QUALITY_DROP_MODE* peDropMode)

Retrieves the current quality level.

ms701591 GetQualityLevel / SetQualityLevel GetQualityLevel HRESULT IMFQualityAdvise::GetQualityLevel([Out] MF_QUALITY_LEVEL* peQualityLevel)

Enables a pipeline object to adjust its own audio or video quality, in response to quality messages.

This interface enables a pipeline object to respond to quality messages from the media sink. Currently, it is supported only for video decoders.

If a video decoder exposes but not , the quality manager controls quality adjustments for the decoder. In this case, the quality manager responds to events from the Enhanced Video Renderer (EVR) by calling methods on the decoder.

If the decoder exposes , the quality manager forwards the events to the decoder and does not adjust the decoder's quality settings. The decoder should respond to these events by adjusting its own quality settings internally.

The preceding remarks apply to the default implementation of the quality manager; custom quality managers can implement other behaviors.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd743249 IMFQualityAdvise2 IMFQualityAdvise2
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Forwards an event from the media sink.

No documentation. No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd743250 HRESULT IMFQualityAdvise2::NotifyQualityEvent([In, Optional] IMFMediaEvent* pEvent,[Out] unsigned int* pdwFlags) IMFQualityAdvise2::NotifyQualityEvent

Queries an object for the number of quality modes it supports. Quality modes are used to adjust the trade-off between quality and speed when rendering audio or video.

The default presenter for the enhanced video renderer (EVR) implements this interface. The EVR uses the interface to respond to quality messages from the quality manager.

dd374511 IMFQualityAdviseLimits IMFQualityAdviseLimits
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the maximum drop mode. A higher drop mode means that the object will, if needed, drop samples more aggressively to match the presentation clock.

Receives the maximum drop mode, specified as a member of the enumeration.

If this method succeeds, it returns . Otherwise, it returns an error code.

To get the current drop mode, call the method. To set the drop mode, call the method.

dd374512 HRESULT IMFQualityAdviseLimits::GetMaximumDropMode([Out] MF_QUALITY_DROP_MODE* peDropMode) IMFQualityAdviseLimits::GetMaximumDropMode

Gets the minimum quality level that is supported by the component.

Receives the minimum quality level, specified as a member of the enumeration.

If this method succeeds, it returns . Otherwise, it returns an error code.

To get the current quality level, call the method. To set the quality level, call the method.

dd374513 HRESULT IMFQualityAdviseLimits::GetMinimumQualityLevel([Out] MF_QUALITY_LEVEL* peQualityLevel) IMFQualityAdviseLimits::GetMinimumQualityLevel

Gets the maximum drop mode. A higher drop mode means that the object will, if needed, drop samples more aggressively to match the presentation clock.

To get the current drop mode, call the method. To set the drop mode, call the method.

dd374512 GetMaximumDropMode GetMaximumDropMode HRESULT IMFQualityAdviseLimits::GetMaximumDropMode([Out] MF_QUALITY_DROP_MODE* peDropMode)

Gets the minimum quality level that is supported by the component.

To get the current quality level, call the method. To set the quality level, call the method.

dd374513 GetMinimumQualityLevel GetMinimumQualityLevel HRESULT IMFQualityAdviseLimits::GetMinimumQualityLevel([Out] MF_QUALITY_LEVEL* peQualityLevel)

Adjusts playback quality. This interface is exposed by the quality manager.

Media Foundation provides a default quality manager that is tuned for playback. Applications can provide a custom quality manager to the Media Session by setting the attribute when creating the Media Session.

ms697558 IMFQualityManager IMFQualityManager
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Called when the Media Session is about to start playing a new topology.

Pointer to the interface of the new topology. If this parameter is null, the quality manager should release any references to the previous topology.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

In a typical quality manager this method does the following:

  1. Enumerates the nodes in the topology.

  2. Calls to get the node's underlying object.

  3. Queries for the interface.

The quality manager can then use the references to adjust audio-video quality as needed.

ms697409 HRESULT IMFQualityManager::NotifyTopology([In] IMFTopology* pTopology) IMFQualityManager::NotifyTopology

Called when the Media Session selects a presentation clock.

Pointer to the interface of the presentation clock. If this parameter is null, the quality manager should release any references to the presentation clock.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms702211 HRESULT IMFQualityManager::NotifyPresentationClock([In] IMFPresentationClock* pClock) IMFQualityManager::NotifyPresentationClock

Called when the media processor is about to deliver an input sample to a pipeline component.

Pointer to the interface of the topology node that represents the pipeline component.

Index of the input stream on the topology node.

Pointer to the interface of the input sample.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is called for every sample passing through every pipeline component. Therefore, the method must return quickly to avoid introducing too much latency into the pipeline.

ms703097 HRESULT IMFQualityManager::NotifyProcessInput([In] IMFTopologyNode* pNode,[In] int lInputIndex,[In] IMFSample* pSample) IMFQualityManager::NotifyProcessInput

Called after the media processor gets an output sample from a pipeline component.

Pointer to the interface of the topology node that represents the pipeline component.

Index of the output stream on the topology node.

Pointer to the interface of the output sample.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is called for every sample passing through every pipeline component. Therefore, the method must return quickly to avoid introducing too much latency into the pipeline.

ms700792 HRESULT IMFQualityManager::NotifyProcessOutput([In] IMFTopologyNode* pNode,[In] int lOutputIndex,[In] IMFSample* pSample) IMFQualityManager::NotifyProcessOutput

Called when a pipeline component sends an event.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms704768 HRESULT IMFQualityManager::NotifyQualityEvent([In] IUnknown* pObject,[In] IMFMediaEvent* pEvent) IMFQualityManager::NotifyQualityEvent

Called when the Media Session is shutting down.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The quality manager should release all references to the Media Session when this method is called.

ms703099 HRESULT IMFQualityManager::Shutdown() IMFQualityManager::Shutdown

Gets or sets the playback rate.

Objects can expose this interface as a service. To obtain a reference to the interface, call with the service identifier . The Media Session supports this interface. Media sources and transforms support this interface if they support rate changes. Media sinks do not need to support this interface. Media sinks are notified of rate changes through the method.

For more information, see About Rate Control.

To discover the playback rates that an object supports, use the interface

ms697193 IMFRateControl IMFRateControl
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the playback rate.

If TRUE, the media streams are thinned. Otherwise, the stream is not thinned. For media sources and demultiplexers, the object must thin the streams when this parameter is TRUE. For downstream transforms, such as decoders and multiplexers, this parameter is informative; it notifies the object that the input streams are thinned. For information, see About Rate Control.

The requested playback rate. Postive values indicate forward playback, negative values indicate reverse playback, and zero indicates scrubbing (the source delivers a single frame).

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The object does not support reverse playback.

The object does not support thinning.

The object does not support the requested playback rate.

The object cannot change to the new rate while in the running state.

?

The Media Session prevents some transitions between rate boundaries, depending on the current playback state:

Playback StateForward/ReverseForward/ZeroReverse/Zero
RunningNoNoNo
PausedNoYesNo
StoppedYesYesYes

?

If the transition is not supported, the method returns .

When a media source completes a call to SetRate, it sends the event. Other pipeline components do not send this event.

If a media source switches between thinned and non-thinned playback, the streams send an event to indicate the transition. Events from the media source are not synchronized with events from the media streams. After you receive the event, you can still receive samples that were queued before the stream switched to thinned or non-thinned mode. The event marks the exact point in the stream where the transition occurs.

When the Media Session completes a call to SetRate, it sends the event.

ms696979 HRESULT IMFRateControl::SetRate([In] BOOL fThin,[In] float flRate) IMFRateControl::SetRate

Gets the current playback rate.

Receives the current playback rate.

Receives the value TRUE if the stream is currently being thinned. If the object does not support thinning, this parameter always receives the value . This parameter can be null. For more information, see About Rate Control.

ms705641 HRESULT IMFRateControl::GetRate([Out] BOOL* pfThin,[Out] float* pflRate) IMFRateControl::GetRate

Queries the range of playback rates that are supported, including reverse playback.

To get a reference to this interface, call with the service identifier .

Applications can use this interface to discover the fastest and slowest playback rates that are possible, and to query whether a given playback rate is supported. Applications obtain this interface from the Media Session. Internally, the Media Session queries the objects in the pipeline. For more information, see How to Determine Supported Rates.

To get the current playback rate and to change the playback rate, use the interface.

Playback rates are expressed as a ratio the normal playback rate. Reverse playback is expressed as a negative rate. Playback is either thinned or non-thinned. In thinned playback, some of the source data is skipped (typically delta frames). In non-thinned playback, all of the source data is rendered.

You might need to implement this interface if you are writing a pipeline object (media source, transform, or media sink). For more information, see Implementing Rate Control.

ms701858 IMFRateSupport IMFRateSupport
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the slowest playback rate supported by the object.

Specifies whether to query to the slowest forward playback rate or reverse playback rate. The value is a member of the enumeration.

If TRUE, the method retrieves the slowest thinned playback rate. Otherwise, the method retrieves the slowest non-thinned playback rate. For information about thinning, see About Rate Control.

Receives the slowest playback rate that the object supports.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The object does not support reverse playback.

The object does not support thinning.

?

The value returned in plfRate represents a lower bound. Playback at this rate is not guaranteed. Call to check whether the boundary rate is supported. For example, a component that supports arbitrarily slow rates will return zero in pflRate, and applications should call IsRateSupported separately to determine whether the component supports rate 0.

If eDirection is , the method retrieves the slowest reverse playback rate. This is a negative value, assuming the object supports reverse playback.

ms704596 HRESULT IMFRateSupport::GetSlowestRate([In] MFRATE_DIRECTION eDirection,[In] BOOL fThin,[Out] float* pflRate) IMFRateSupport::GetSlowestRate

Gets the fastest playback rate supported by the object.

Specifies whether to query to the fastest forward playback rate or reverse playback rate. The value is a member of the enumeration.

If TRUE, the method retrieves the fastest thinned playback rate. Otherwise, the method retrieves the fastest non-thinned playback rate. For information about thinning, see About Rate Control.

Receives the fastest playback rate that the object supports.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The object does not support reverse playback.

The object does not support thinning.

?

For some formats (such as ASF), thinning means dropping all frames that are not I-frames. If a component produces stream data, such as a media source or a demultiplexer, it should pay attention to the fThin parameter and return if it cannot thin the stream.

If the component processes or receives a stream (most transforms or media sinks), it may ignore this parameter if it does not care whether the stream is thinned. In the Media Session's implementation of rate support, if the transforms do not explicitly support reverse playback, the Media Session will attempt to playback in reverse with thinning but not without thinning. Therefore, most applications will set fThin to TRUE when using the Media Session for reverse playback.

If eDirection is , the method retrieves the fastest reverse playback rate. This is a negative value, assuming the object supports reverse playback.

ms693505 HRESULT IMFRateSupport::GetFastestRate([In] MFRATE_DIRECTION eDirection,[In] BOOL fThin,[Out] float* pflRate) IMFRateSupport::GetFastestRate

Queries whether the object supports a specified playback rate.

If TRUE, the method queries whether the object supports the playback rate with thinning. Otherwise, the method queries whether the object supports the playback rate without thinning. For information about thinning, see About Rate Control.

The playback rate to query.

If the object does not support the playback rate given in flRate, this parameter receives the closest supported playback rate. If the method returns , this parameter receives the value given in flRate. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The object supports the specified rate.

The object does not support reverse playback.

The object does not support thinning.

The object does not support the specified rate.

?

ms696250 HRESULT IMFRateSupport::IsRateSupported([In] BOOL fThin,[In] float flRate,[InOut, Optional] float* pflNearestSupportedRate) IMFRateSupport::IsRateSupported

Creates an instance of either the sink writer or the source reader.

To get a reference to this interface, call the CoCreateInstance function. The CLSID is CLSID_MFReadWriteClassFactory. Call the function before using the interface.

As an alternative to using this interface, you can call any of the following functions:

Internally, these functions use the interface.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374514 IMFReadWriteClassFactory IMFReadWriteClassFactory
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Creates an instance of the sink writer or source reader, given a URL.

The CLSID of the object to create.

ValueMeaning
CLSID_MFSinkWriter

Create the sink writer. The ppvObject parameter receives an interface reference.

CLSID_MFSourceReader

Create the source reader. The ppvObject parameter receives an interface reference.

?

A null-terminated string that contains a URL. If clsid is CLSID_MFSinkWriter, the URL specifies the name of the output file. The sink writer creates a new file with this name. If clsid is CLSID_MFSourceReader, the URL specifies the input file for the source reader.

A reference to the interface. You can use this parameter to configure the sink writer or source reader. For more information, see the following topics:

  • Sink Writer Attributes
  • Source Reader Attributes

This parameter can be null.

The IID of the requested interface.

Receives a reference to the requested interface. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374516 HRESULT IMFReadWriteClassFactory::CreateInstanceFromURL([In] const GUID& clsid,[In] const wchar_t* pwszURL,[In, Optional] IMFAttributes* pAttributes,[In] const GUID& riid,[Out] void** ppvObject) IMFReadWriteClassFactory::CreateInstanceFromURL

Creates an instance of the sink writer or source reader, given an reference.

The CLSID of the object to create.

ValueMeaning
CLSID_MFSinkWriter

Create the sink writer. The ppvObject parameter receives an interface reference.

CLSID_MFSourceReader

Create the source reader. The ppvObject parameter receives an interface reference.

?

A reference to the interface of an object that is used to initialize the source reader or sink writer. The method queries this reference for one of the following interfaces.

ValueMeaning

Pointer to a byte stream.

If clsid is CLSID_MFSinkWriter, the sink writer writes data to this byte stream.

If clsid is CLSID_MFSourceReader, this byte stream provides the source data for the source reader.

Pointer to a media sink. Applies only when clsid is CLSID_MFSinkWriter.

Pointer to a media source. Applies only when clsid is CLSID_MFSourceReader.

?

A reference to the interface. You can use this parameter to configure the sink writer or source reader. For more information, see the following topics:

  • Sink Writer Attributes
  • Source Reader Attributes

This parameter can be null.

The IID of the requested interface.

Receives a reference to the requested interface. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374515 HRESULT IMFReadWriteClassFactory::CreateInstanceFromObject([In] const GUID& clsid,[In] IUnknown* punkObject,[In, Optional] IMFAttributes* pAttributes,[In] const GUID& riid,[Out] void** ppvObject) IMFReadWriteClassFactory::CreateInstanceFromObject

Notifies a pipeline object to register itself with the Multimedia Class Scheduler Service (MMCSS).

Any pipeline object that creates worker threads should implement this interface.

Media Foundation provides a mechanism for applications to associate branches in the topology with MMCSS tasks. A topology branch is defined by a source node in the topology and all of the nodes downstream from it. An application registers a topology branch with MMCSS by setting the attribute on the source node and then calling .

When the application registers a topology branch with MMCSS, the Media Session queries every pipeline object in that branch for the interface. If the object exposes the interface, the Media Session calls RegisterThreads.

When the application unregisters the topology branch, the Media Session calls UnregisterThreads.

If a pipeline object creates its own worker threads but does not implement this interface, it can cause priority inversions in the Media Foundation pipeline, because high-priority processing threads might be blocked while waiting for the component to process data on a thread with lower priority.

Pipeline objects that do not create worker threads do not need to implement this interface.

In Windows?8, this interface is extended with IMFRealTimeClientEx.

aa372146 IMFRealTimeClient IMFRealTimeClient
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Notifies the object to register its worker threads with the Multimedia Class Scheduler Service (MMCSS).

The MMCSS task identifier.

The name of the MMCSS task.

If this method succeeds, it returns . Otherwise, it returns an error code.

The object's worker threads should register themselves with MMCSS by calling AvSetMmThreadCharacteristics, using the task name and identifier specified in this method.

aa367059 HRESULT IMFRealTimeClient::RegisterThreads([In] unsigned int dwTaskIndex,[In] const wchar_t* wszClass) IMFRealTimeClient::RegisterThreads

Notifies the object to unregister its worker threads from the Multimedia Class Scheduler Service (MMCSS).

If this method succeeds, it returns . Otherwise, it returns an error code.

The object's worker threads should unregister themselves from MMCSS by calling AvRevertMmThreadCharacteristics.

aa371717 HRESULT IMFRealTimeClient::UnregisterThreads() IMFRealTimeClient::UnregisterThreads

Specifies the work queue for the topology branch that contains this object.

The identifier of the work queue, or the value . See Remarks.

If this method succeeds, it returns . Otherwise, it returns an error code.

An application can register a branch of the topology to use a private work queue. The Media Session notifies any pipeline object that supports by calling SetWorkQueue with the application's work queue identifier.

When the application unregisters the topology branch, the Media Session calls SetWorkQueue again with the value .

aa367678 HRESULT IMFRealTimeClient::SetWorkQueue([In] unsigned int dwWorkQueueId) IMFRealTimeClient::SetWorkQueue

Specifies the work queue for the topology branch that contains this object.

An application can register a branch of the topology to use a private work queue. The Media Session notifies any pipeline object that supports by calling SetWorkQueue with the application's work queue identifier.

When the application unregisters the topology branch, the Media Session calls SetWorkQueue again with the value .

aa367678 SetWorkQueue SetWorkQueue HRESULT IMFRealTimeClient::SetWorkQueue([In] unsigned int dwWorkQueueId)

Used by the Microsoft Media Foundation proxy/stub DLL to marshal certain asynchronous method calls across process boundaries.

Applications do not use or implement this interface.

bb970408 IMFRemoteAsyncCallback IMFRemoteAsyncCallback
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Used by the Microsoft Media Foundation proxy/stub DLL to marshal certain asynchronous method calls across process boundaries.

Applications do not use or implement this interface.

No documentation. No documentation. No documentation. bb970408 HRESULT IMFRemoteAsyncCallback::Invoke([In] HRESULT hr,[In, Optional] IUnknown* pRemoteResult) IMFRemoteAsyncCallback::Invoke

Modifies a topology for use in a Terminal Services environment.

To use this interface, do the following:

  1. Call GetSystemMetrics with the SM_REMOTESESSION flag. The function returns TRUE if the calling process is associated with a Terminal Services client session.
  2. If GetSystemMetrics returns TRUE, call . This function returns a reference to the interface.
  3. Call UpdateTopology with a reference to the topology.

The application must call UpdateTopology before calling on the Media Session.

ms698979 IMFRemoteDesktopPlugin IMFRemoteDesktopPlugin
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Modifies a topology for use in a Terminal Services environment.

Pointer to the interface of the topology.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

If the application is running in a Terminal Services client session, call this method before calling on the Media Session.

ms699001 HRESULT IMFRemoteDesktopPlugin::UpdateTopology([In] IMFTopology* pTopology) IMFRemoteDesktopPlugin::UpdateTopology

Retrieves a reference to the remote object for which this object is a proxy.

bb970370 IMFRemoteProxy IMFRemoteProxy
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a reference to the remote object for which this object is a proxy.

Interface identifier (IID) of the requested interface.

Receives a reference to the requested interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970370 HRESULT IMFRemoteProxy::GetRemoteObject([In] const GUID& riid,[Out] void** ppv) IMFRemoteProxy::GetRemoteObject

Retrieves a reference to the object that is hosting this proxy.

Interface identifier (IID) of the requested interface.

Receives a reference to the requested interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970549 HRESULT IMFRemoteProxy::GetRemoteHost([In] const GUID& riid,[Out] void** ppv) IMFRemoteProxy::GetRemoteHost

Sets the current style on the SAMI media source.

bb970574 IMFSAMIStyle IMFSAMIStyle
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the number of styles defined in the SAMI file.

Receives the number of SAMI styles in the file.

If this method succeeds, it returns . Otherwise, it returns an error code.

bb970341 HRESULT IMFSAMIStyle::GetStyleCount([Out] unsigned int* pdwCount) IMFSAMIStyle::GetStyleCount

Gets a list of the style names defined in the SAMI file.

Pointer to a that receives an array of null-terminated wide-character strings. The type is VT_VECTOR | VT_LPWSTR. The caller must clear the by calling PropVariantClear.

If this method succeeds, it returns . Otherwise, it returns an error code.

bb970547 HRESULT IMFSAMIStyle::GetStyles([Out] PROPVARIANT* pPropVarStyleArray) IMFSAMIStyle::GetStyles

Sets the current style on the SAMI media source.

Pointer to a null-terminated string containing the name of the style. To clear the current style, pass an empty string (""). To get the list of style names, call .

If this method succeeds, it returns . Otherwise, it returns an error code.

bb970574 HRESULT IMFSAMIStyle::SetSelectedStyle([In] const wchar_t* pwszStyle) IMFSAMIStyle::SetSelectedStyle

Gets the current style from the SAMI media source.

Receives a reference to a null-terminated string that contains the name of the style. If no style is currently set, the method returns an empty string. The caller must free the memory for the string by calling CoTaskMemFree.

If this method succeeds, it returns . Otherwise, it returns an error code.

bb970429 HRESULT IMFSAMIStyle::GetSelectedStyle([Out] wchar_t** ppwszStyle) IMFSAMIStyle::GetSelectedStyle

Gets the number of styles defined in the SAMI file.

bb970341 GetStyleCount GetStyleCount HRESULT IMFSAMIStyle::GetStyleCount([Out] unsigned int* pdwCount)

Gets a list of the style names defined in the SAMI file.

bb970547 GetStyles GetStyles HRESULT IMFSAMIStyle::GetStyles([Out] PROPVARIANT* pPropVarStyleArray)

Represents a media sample, which is a container object for media data. For video, a sample typically contains one video frame. For audio data, a sample typically contains multiple audio samples, rather than a single sample of audio.

A media sample contains zero or more buffers. Each buffer manages a block of memory, and is represented by the interface. A sample can have multiple buffers. The buffers are kept in an ordered list and accessed by index value. It is also valid to have an empty sample with no buffers.

To create a new media sample, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms702192 IMFSample IMFSample
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves flags associated with the sample.

Currently no flags are defined. Instead, metadata for samples is defined using attributes. To get attibutes from a sample, use the interface, which inherits. For a list of sample attributes, see Sample Attributes.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms701587 HRESULT IMFSample::GetSampleFlags([Out] unsigned int* pdwSampleFlags) IMFSample::GetSampleFlags

Sets flags associated with the sample.

Currently no flags are defined. Instead, metadata for samples is defined using attributes. To set attibutes on a sample, use the interface, which inherits. For a list of sample attributes, see Sample Attributes.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms696207 HRESULT IMFSample::SetSampleFlags([In] unsigned int dwSampleFlags) IMFSample::SetSampleFlags

Retrieves the presentation time of the sample.

Receives the presentation time, in 100-nanosecond units.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The sample does not have a presentation time.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms705645 HRESULT IMFSample::GetSampleTime([Out] longlong* phnsSampleTime) IMFSample::GetSampleTime
No documentation. No documentation. No documentation. HRESULT IMFSample::SetSampleTime([In] longlong hnsSampleTime) IMFSample::SetSampleTime

Retrieves the duration of the sample.

Receives the duration, in 100-nanosecond units.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The sample does not have a specified duration.

?

If the sample contains more than one buffer, the duration includes the data from all of the buffers.

If the retrieved duration is zero, or if the method returns , the duration is unknown. In that case, it might be possible to calculate the duration from the media type?for example, by using the video frame rate or the audio sampling rate.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703056 HRESULT IMFSample::GetSampleDuration([Out] longlong* phnsSampleDuration) IMFSample::GetSampleDuration

Sets the duration of the sample.

Duration of the sample, in 100-nanosecond units.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method succeeds if the duration is negative, although negative durations are probably not valid for most types of data. It is the responsibility of the object that consumes the sample to validate the duration.

The duration can also be zero. This might be valid for some types of data. For example, the sample might contain stream metadata with no buffers.

Until this method is called, the method returns .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms705626 HRESULT IMFSample::SetSampleDuration([In] longlong hnsSampleDuration) IMFSample::SetSampleDuration

Retrieves the number of buffers in the sample.

Receives the number of buffers in the sample. A sample might contain zero buffers.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms705655 HRESULT IMFSample::GetBufferCount([Out] unsigned int* pdwBufferCount) IMFSample::GetBufferCount

Gets a buffer from the sample, by index.

Note??In most cases, it is safer to use the method. If the sample contains more than one buffer, the ConvertToContiguousBuffer method replaces them with a single buffer, copies the original data into that buffer, and returns the new buffer to the caller. The copy operation occurs at most once. On subsequent calls, no data is copied.

No documentation. No documentation.

A sample might contain more than one buffer. Use the GetBufferByIndex method to enumerate the individual buffers.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697014 HRESULT IMFSample::GetBufferByIndex([In] unsigned int dwIndex,[Out] IMFMediaBuffer** ppBuffer) IMFSample::GetBufferByIndex

Converts a sample with multiple buffers into a sample with a single buffer.

Receives a reference to the interface. The caller must release the interface.

If the sample contains more than one buffer, this method copies the data from the original buffers into a new buffer, and replaces the original buffer list with the new buffer. The new buffer is returned in the ppBuffer parameter.

If the sample contains a single buffer, this method returns a reference to the original buffer. In typical use, most samples do not contain multiple buffers.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms698917 HRESULT IMFSample::ConvertToContiguousBuffer([Out] IMFMediaBuffer** ppBuffer) IMFSample::ConvertToContiguousBuffer

Adds a buffer to the end of the list of buffers in the sample.

Pointer to the buffer's interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

null reference argument.

?

For uncompressed video data, each buffer should contain a single video frame, and samples should not contain multiple frames. In general, storing multiple buffers in a sample is discouraged.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms697465 HRESULT IMFSample::AddBuffer([In] IMFMediaBuffer* pBuffer) IMFSample::AddBuffer

Removes a buffer at a specified index from the sample.

Index of the buffer. To find the number of buffers in the sample, call . Buffers are indexed from zero.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms705646 HRESULT IMFSample::RemoveBufferByIndex([In] unsigned int dwIndex) IMFSample::RemoveBufferByIndex

Removes all of the buffers from the sample.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703108 HRESULT IMFSample::RemoveAllBuffers() IMFSample::RemoveAllBuffers

Retrieves the total length of the valid data in all of the buffers in the sample. The length is calculated as the sum of the values retrieved by the method.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704584 HRESULT IMFSample::GetTotalLength([Out] unsigned int* pcbTotalLength) IMFSample::GetTotalLength

Copies the sample data to a buffer. This method concatenates the valid data from all of the buffers of the sample, in order.

Pointer to the interface of the destination buffer. The buffer must be large enough to hold the valid data in the sample. To get the size of the data in the sample, call .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

null reference argument.

The buffer is not large enough to contain the data.

?

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703119 HRESULT IMFSample::CopyToBuffer([In] IMFMediaBuffer* pBuffer) IMFSample::CopyToBuffer

Retrieves flags associated with the sample.

Currently no flags are defined. Instead, metadata for samples is defined using attributes. To get attibutes from a sample, use the interface, which inherits. For a list of sample attributes, see Sample Attributes.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms701587 GetSampleFlags / SetSampleFlags GetSampleFlags HRESULT IMFSample::GetSampleFlags([Out] unsigned int* pdwSampleFlags)

Retrieves the presentation time of the sample.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms705645 GetSampleTime / SetSampleTime GetSampleTime HRESULT IMFSample::GetSampleTime([Out] longlong* phnsSampleTime)

Retrieves the duration of the sample.

If the sample contains more than one buffer, the duration includes the data from all of the buffers.

If the retrieved duration is zero, or if the method returns , the duration is unknown. In that case, it might be possible to calculate the duration from the media type?for example, by using the video frame rate or the audio sampling rate.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703056 GetSampleDuration / SetSampleDuration GetSampleDuration HRESULT IMFSample::GetSampleDuration([Out] longlong* phnsSampleDuration)

Retrieves the number of buffers in the sample.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms705655 GetBufferCount GetBufferCount HRESULT IMFSample::GetBufferCount([Out] unsigned int* pdwBufferCount)

Retrieves the total length of the valid data in all of the buffers in the sample. The length is calculated as the sum of the values retrieved by the method.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms704584 GetTotalLength GetTotalLength HRESULT IMFSample::GetTotalLength([Out] unsigned int* pcbTotalLength)

Provides encryption for media data inside the protected media path (PMP).

ms703018 IMFSampleProtection IMFSampleProtection
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the version of sample protection that the component implements on input.

Receives a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970365 HRESULT IMFSampleProtection::GetInputProtectionVersion([Out] unsigned int* pdwVersion) IMFSampleProtection::GetInputProtectionVersion

Retrieves the version of sample protection that the component implements on output.

Receives a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970415 HRESULT IMFSampleProtection::GetOutputProtectionVersion([Out] unsigned int* pdwVersion) IMFSampleProtection::GetOutputProtectionVersion

Retrieves the sample protection certificate.

Specifies the version number of the sample protection scheme for which to receive a certificate. The version number is specified as a enumeration value.

Receives a reference to a buffer containing the certificate. The caller must free the memory for the buffer by calling CoTaskMemFree.

Receives the size of the ppCert buffer, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

Not implemented.

?

For certain version numbers of sample protection, the downstream component must provide a certificate. Components that do not support these version numbers can return E_NOTIMPL.

bb970503 HRESULT IMFSampleProtection::GetProtectionCertificate([In] unsigned int dwVersion,[Out, Buffer] unsigned char** ppCert,[Out] unsigned int* pcbCert) IMFSampleProtection::GetProtectionCertificate

Retrieves initialization information for sample protection from the upstream component.

Specifies the version number of the sample protection scheme. The version number is specified as a enumeration value.

Identifier of the output stream. The identifier corresponds to the output stream identifier returned by the interface.

Pointer to a certificate provided by the downstream component.

Size of the certificate, in bytes.

Receives a reference to a buffer that contains the initialization information for downstream component. The caller must free the memory for the buffer by calling CoTaskMemFree.

Receives the size of the ppbSeed buffer, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

Not implemented.

?

This method must be implemented by the upstream component. The method fails if the component does not support the requested sample protection version. Downstream components do not implement this method and should return E_NOTIMPL.

ms693577 HRESULT IMFSampleProtection::InitOutputProtection([In] unsigned int dwVersion,[In] unsigned int dwOutputId,[In] unsigned char* pbCert,[In] unsigned int cbCert,[In] unsigned char** ppbSeed,[In] unsigned int* pcbSeed) IMFSampleProtection::InitOutputProtection

Initializes sample protection on the downstream component.

Specifies the version number of the sample protection scheme. The version number is specified as a enumeration value.

Identifier of the input stream. The identifier corresponds to the output stream identifier returned by the interface.

Pointer to a buffer that contains the initialization data provided by the upstream component. To retrieve this buffer, call .

Size of the pbSeed buffer, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms696181 HRESULT IMFSampleProtection::InitInputProtection([In] unsigned int dwVersion,[In] unsigned int dwInputId,[In] unsigned char* pbSeed,[In] unsigned int cbSeed) IMFSampleProtection::InitInputProtection

Retrieves the version of sample protection that the component implements on input.

bb970365 GetInputProtectionVersion GetInputProtectionVersion HRESULT IMFSampleProtection::GetInputProtectionVersion([Out] unsigned int* pdwVersion)

Retrieves the version of sample protection that the component implements on output.

bb970415 GetOutputProtectionVersion GetOutputProtectionVersion HRESULT IMFSampleProtection::GetOutputProtectionVersion([Out] unsigned int* pdwVersion)

Persists media data from a source byte stream to an application-provided byte stream.

The byte stream used for HTTP download implements this interface. To get a reference to this interface, call on the byte stream, with the service identifier .

ms694247 IMFSaveJob IMFSaveJob
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Begins saving a Windows Media file to the application's byte stream.

Pointer to the interface of the application's byte stream. The data from the source byte stream is written to this byte stream.

Pointer to the interface of a callback object. The caller must implement this interface

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

When the operation completes, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

ms705664 HRESULT IMFSaveJob::BeginSave([In] IMFByteStream* pStream,[In] IMFAsyncCallback* pCallback,[In] IUnknown* pState) IMFSaveJob::BeginSave

Completes the operation started by .

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms701610 HRESULT IMFSaveJob::EndSave([In] IMFAsyncResult* pResult) IMFSaveJob::EndSave

Cancels the operation started by .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms703196 HRESULT IMFSaveJob::CancelSave() IMFSaveJob::CancelSave

Retrieves the percentage of content saved to the provided byte stream.

Receives the percentage of completion.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms700176 HRESULT IMFSaveJob::GetProgress([Out] unsigned int* pdwPercentComplete) IMFSaveJob::GetProgress

Retrieves the percentage of content saved to the provided byte stream.

ms700176 GetProgress GetProgress HRESULT IMFSaveJob::GetProgress([Out] unsigned int* pdwPercentComplete)

Creates a media source or a byte stream from a URL.

Applications do not use this interface. This interface is exposed by scheme handlers, which are used by the source resolver. A scheme handler is designed to parse one type of URL scheme. When the scheme handler is given a URL, it parses the resource that is located at that URL and creates either a media source or a byte stream.

ms701638 IMFSchemeHandler IMFSchemeHandler
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Begins an asynchronous request to create an object from a URL.

When the Source Resolver creates a media source from a URL, it passes the request to a scheme handler. The scheme handler might create a media source directly from the URL, or it might return a byte stream. If it returns a byte stream, the source resolver use a byte-stream handler to create the media source from the byte stream.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_ACCESSDENIED

Cannot open the URL with the requested access (read or write).

Unsupported byte stream type.

?

The dwFlags parameter must contain the flag or the flag. If the flag is set, the scheme handler might create the media source directly from the URL, or it might create a byte stream. The type of object is returned in the pObjectType parameter of the method. If the scheme handler returns a byte stream, the source resolver will pass the byte stream to a byte-stream handler, which will create the media source from the byte stream.

If the flag is set, the scheme handler will attempt to create a byte stream from the URL. However, if the scheme handler is designed to create a media source directly, rather than a byte stream, the method will fail.

The following table summarizes the behavior of these two flags when passed to this method:

FlagObject created
Media source or byte stream
Byte stream

?

The and flags can be combined, although in this case it is redundant.

When the operation completes, the scheme handler calls the method. The Invoke method should call to get a reference to the created object.

bb970433 HRESULT IMFSchemeHandler::BeginCreateObject([In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out, Optional] IUnknown** ppIUnknownCancelCookie,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFSchemeHandler::BeginCreateObject

Completes an asynchronous request to create an object from a URL.

Pointer to the interface. Pass in the same reference that your callback object received in the Invoke method.

Receives a member of the enumeration, specifying the type of object that was created.

Receives a reference to the interface of the object. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_ABORT

The operation was canceled.

?

Call this method from inside the method.

bb970550 HRESULT IMFSchemeHandler::EndCreateObject([In] IMFAsyncResult* pResult,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSchemeHandler::EndCreateObject

Cancels the current request to create an object from a URL.

Pointer to the interface that was returned in the ppIUnknownCancelCookie parameter of the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You can use this method to cancel a previous call to BeginCreateObject. Because that method is asynchronous, however, it might be completed before the operation can be canceled. Therefore, your callback might still be invoked after you call this method.

The operation cannot be canceled if BeginCreateObject returns null in the ppIUnknownCancelCookie parameter.

bb970419 HRESULT IMFSchemeHandler::CancelObjectCreation([In] IUnknown* pIUnknownCancelCookie) IMFSchemeHandler::CancelObjectCreation

Retrieves the client's certificate.

bb970528 IMFSecureChannel IMFSecureChannel
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the client's certificate.

Receives a reference to a buffer allocated by the object. The buffer contains the client's certificate. The caller must release the buffer by calling CoTaskMemFree.

Receives the size of the ppCert buffer, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970528 HRESULT IMFSecureChannel::GetCertificate([Out, Buffer] unsigned char** ppCert,[Out] unsigned int* pcbCert) IMFSecureChannel::GetCertificate

Passes the encrypted session key to the client.

Pointer to a buffer that contains the encrypted session key. This parameter can be null.

Size of the pbEncryptedSessionKey buffer, in bytes.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970477 HRESULT IMFSecureChannel::SetupSession([In, Buffer] unsigned char* pbEncryptedSessionKey,[In] unsigned int cbSessionKey) IMFSecureChannel::SetupSession

Maps a presentation descriptor to its associated sequencer element identifier and the topology it represents.

The topology returned in ppTopology is the original topology that the application specified in AppendTopology. The source nodes in this topology contain references to the native sources. Do not queue this topology on the Media Session. Instead, call to get the sequencer source's modified topology. The source nodes in the modified topology contain references to the sequencer source, rather than the native sources.

bb970514 IMFSequencerSource IMFSequencerSource
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Adds a topology to the end of the queue.

Pointer to the interface of the topology. This reference cannot be null. If an application passes null, the call fails with an E_INVALIDARG error code.

A combination of flags from the enumeration.

Receives the sequencer element identifier for this topology.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The source topology node is missing one of the following attributes:

?

The sequencer plays topologies in the order they are queued. You can queue as many topologies as you want to preroll.

The application must indicate to the sequencer when it has queued the last topology on the Media Session. To specify the last topology, set the SequencerTopologyFlags_Last flag in the dwFlags parameter when you append the topology. The sequencer uses this information to end playback with the pipeline. Otherwise, the sequencer waits indefinitely for a new topology to be queued.

ms697046 HRESULT IMFSequencerSource::AppendTopology([In] IMFTopology* pTopology,[In] unsigned int dwFlags,[Out] unsigned int* pdwId) IMFSequencerSource::AppendTopology

Deletes a topology from the queue.

The sequencer element identifier of the topology to delete.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970428 HRESULT IMFSequencerSource::DeleteTopology([In] unsigned int dwId) IMFSequencerSource::DeleteTopology

Maps a presentation descriptor to its associated sequencer element identifier and the topology it represents.

Pointer to the interface of the presentation descriptor.

Receives the sequencer element identifier. This value is assigned by the sequencer source when the application calls . This parameter is optional and can be null.

Receives a reference to the interface of the original topology that the application added to the sequencer source. The caller must release the interface. This parameter can receive the value null if the sequencer source has switched to the next presentation. This parameter is optional and can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The presentation descriptor is not valid.

MF_S_SEQUENCER_CONTEXT_CANCELED

This segment was canceled.

?

The topology returned in ppTopology is the original topology that the application specified in AppendTopology. The source nodes in this topology contain references to the native sources. Do not queue this topology on the Media Session. Instead, call to get the sequencer source's modified topology. The source nodes in the modified topology contain references to the sequencer source, rather than the native sources.

bb970514 HRESULT IMFSequencerSource::GetPresentationContext([In] IMFPresentationDescriptor* pPD,[Out, Optional] unsigned int* pId,[Out, Optional] IMFTopology** ppTopology) IMFSequencerSource::GetPresentationContext

Updates a topology in the queue.

Sequencer element identifier of the topology to update.

Pointer to the interface of the updated topology object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The sequencer source has been shut down.

?

This method is asynchronous. When the operation is completed, the sequencer source sends an event.

bb970402 HRESULT IMFSequencerSource::UpdateTopology([In] unsigned int dwId,[In] IMFTopology* pTopology) IMFSequencerSource::UpdateTopology

Updates the flags for a topology in the queue.

Sequencer element identifier of the topology to update.

Bitwise OR of flags from the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970564 HRESULT IMFSequencerSource::UpdateTopologyFlags([In] unsigned int dwId,[In] unsigned int dwFlags) IMFSequencerSource::UpdateTopologyFlags

Queries an object for a specified service interface.

A service is an interface that is exposed by one object but might be implemented by another object. The GetService method is equivalent to QueryInterface, with the following difference: when QueryInterface retrieves a reference to an interface, it is guaranteed that you can query the returned interface and get back the original interface. The GetService method does not make this guarantee, because the retrieved interface might be implemented by a separate object.

The function is a helper function that queries an object for and calls the GetService method.

ms694261 IMFGetService IMFGetService
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a service interface.

The service identifier (SID) of the service. For a list of service identifiers, see Service Interfaces.

The interface identifier (IID) of the interface being requested.

Receives the interface reference. The caller must release the interface.

ms696978 HRESULT IMFGetService::GetService([In] const GUID& guidService,[In] const GUID& riid,[Out] void** ppvObject) IMFGetService::GetService

Applies to: desktop apps | Metro style apps

Retrieves a service interface.

Type of the interface to retrieve

The service identifier (SID) of the service. For a list of service identifiers, see Service Interfaces.

An instance of T if the service is supported if the service is not supported ms696978 HRESULT IMFGetService::GetService([In] const GUID& guidService,[In] const GUID& riid,[Out] void** ppvObject) IMFGetService::GetService

Exposed by some Media Foundation objects that must be explicitly shut down.

The following types of object expose :

  • Content enablers ( interface)
  • Input trust authorities ( interface)
  • Presentation clocks ( interface)
  • Asynchronous MFTs

Any component that creates one of these objects is responsible for calling Shutdown on the object before releasing the object. Typically, applications do not create any of these objects directly, so it is not usually necessary to use this interface in an application.

To obtain a reference to this interface, call QueryInterface on the object.

If you are implementing a custom object, your object can expose this interface, but only if you can guarantee that your application will call Shutdown.

Media sources, media sinks, and synchronous MFTs should not implement this interface, because the Media Foundation pipeline will not call Shutdown on these objects. Asynchronous MFTs must implement this interface.

This interface is not related to the function, which shuts down the Media Foundation platform, as described in Initializing Media Foundation.

Some Media Foundation interfaces define a Shutdown method, which serves the same purpose as but is not directly related to it.

ms703054 IMFShutdown IMFShutdown
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Shuts down a Media Foundation object and releases all resources associated with the object.

If this method succeeds, it returns . Otherwise, it returns an error code.

The helper function is equivalent to calling this method.

ms701615 HRESULT IMFShutdown::Shutdown() IMFShutdown::Shutdown

Queries the status of an earlier call to the method.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

The Shutdown method has not been called on this object.

?

Until Shutdown is called, the GetShutdownStatus method returns .

If an object's Shutdown method is asynchronous, pStatus might receive the value . When the object is completely shut down, pStatus receives the value .

bb970451 HRESULT IMFShutdown::GetShutdownStatus([Out] MFSHUTDOWN_STATUS* pStatus) IMFShutdown::GetShutdownStatus

Queries the status of an earlier call to the method.

Until Shutdown is called, the GetShutdownStatus method returns .

If an object's Shutdown method is asynchronous, pStatus might receive the value . When the object is completely shut down, pStatus receives the value .

bb970451 GetShutdownStatus GetShutdownStatus HRESULT IMFShutdown::GetShutdownStatus([Out] MFSHUTDOWN_STATUS* pStatus)

Controls the master volume level of the audio session associated with the streaming audio renderer (SAR) and the audio capture source.

The SAR and the audio capture source expose this interface as a service. To get a reference to the interface, call . For the SAR, use the service identifier . For the audio capture source, use the service identifier MR_CAPTURE_POLICY_VOLUME_SERVICE. You can call GetService directly on the SAR or the audio capture source, or call it on the Media Session.

To control the volume levels of individual channels, use the interface. The interface is supported by the SAR only.

Volume is expressed as an attenuation level, where 0.0 indicates silence and 1.0 indicates full volume (no attenuation). For each channel, the attenuation level is the product of:

  • The master volume level of the audio session.

  • The volume level of the channel.

For example, if the master volume is 0.8 and the channel volume is 0.5, the attenuaton for that channel is 0.8 ? 0.5 = 0.4. Volume levels can exceed 1.0 (positive gain), but the audio engine clips any audio samples that exceed zero decibels. To change the volume level of individual channels, use the interface.

Use the following formula to convert the volume level to the decibel (dB) scale:

Attenuation (dB) = 20 * log10(Level)

For example, a volume level of 0.50 represents 6.02 dB of attenuation.

ms693496 IMFSimpleAudioVolume IMFSimpleAudioVolume
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the master volume level.

Volume level. Volume is expressed as an attenuation level, where 0.0 indicates silence and 1.0 indicates full volume (no attenuation).

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The audio renderer is not initialized.

The audio renderer was removed from the pipeline.

?

Events outside of the application can change the master volume level. For example, the user can change the volume from the system volume-control program (SndVol). If an external event changes the master volume, the audio renderer sends an event, which the Media Session forwards to the application.

bb970391 HRESULT IMFSimpleAudioVolume::SetMasterVolume([In] float fLevel) IMFSimpleAudioVolume::SetMasterVolume

Retrieves the master volume level.

Receives the volume level. Volume is expressed as an attenuation level, where 0.0 indicates silence and 1.0 indicates full volume (no attenuation).

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The audio renderer is not initialized.

The audio renderer was removed from the pipeline.

?

If an external event changes the master volume, the audio renderer sends an event, which the Media Session forwards to the application.

bb970319 HRESULT IMFSimpleAudioVolume::GetMasterVolume([Out] float* pfLevel) IMFSimpleAudioVolume::GetMasterVolume

Mutes or unmutes the audio.

Specify TRUE to mute the audio, or to unmute the audio.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The audio renderer is not initialized.

The audio renderer was removed from the pipeline.

?

This method does not change the volume level returned by the function.

bb970531 HRESULT IMFSimpleAudioVolume::SetMute([In] const BOOL bMute) IMFSimpleAudioVolume::SetMute

Queries whether the audio is muted.

Receives a Boolean value. If TRUE, the audio is muted; otherwise, the audio is not muted.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The audio renderer is not initialized.

The audio renderer was removed from the pipeline.

?

Calling to set the volume does not change whether the audio is muted.

bb970332 HRESULT IMFSimpleAudioVolume::GetMute([Out] BOOL* pbMute) IMFSimpleAudioVolume::GetMute

Retrieves the master volume level.

If an external event changes the master volume, the audio renderer sends an event, which the Media Session forwards to the application.

bb970319 GetMasterVolume / SetMasterVolume GetMasterVolume HRESULT IMFSimpleAudioVolume::GetMasterVolume([Out] float* pfLevel)

Queries whether the audio is muted.

Calling to set the volume does not change whether the audio is muted.

bb970332 GetMute / SetMute GetMute HRESULT IMFSimpleAudioVolume::GetMute([Out] BOOL* pbMute)

Implemented by the Microsoft Media Foundation sink writer object.

To create the sink writer, call one of the following functions:

Alternatively, use the interface.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

In Windows?8, this interface is extended with IMFSinkWriterEx.

dd374642 IMFSinkWriter IMFSinkWriter
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Adds a stream to the sink writer.

A reference to the interface of a media type. This media type specifies the format of the samples that will be written to the file. It does not need to match the input format. To set the input format, call .

Receives the zero-based index of the new stream.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374646 HRESULT IMFSinkWriter::AddStream([In] IMFMediaType* pTargetMediaType,[Out] unsigned int* pdwStreamIndex) IMFSinkWriter::AddStream

Sets the input format for a stream on the sink writer.

The zero-based index of the stream. The index is received by the pdwStreamIndex parameter of the method.

A reference to the interface of a media type. The media type specifies the input format.

A reference to the interface of an attribute store. Use the attribute store to configure the encoder. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The underlying media sink does not support the format, no conversion is possible, or a dynamic format change is not possible.

The dwStreamIndex parameter is invalid.

Could not find an encoder for the encoded format.

?

The input format does not have to match the target format that is written to the media sink. If the formats do not match, the method attempts to load an encoder that can encode from the input format to the target format.

After streaming begins?that is, after the first call to ?you can call this method at any time to change the input format. However, the underlying encoder and media sink must support dynamic format changes.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374653 HRESULT IMFSinkWriter::SetInputMediaType([In] unsigned int dwStreamIndex,[In] IMFMediaType* pInputMediaType,[In, Optional] IMFAttributes* pEncodingParameters) IMFSinkWriter::SetInputMediaType

Initializes the sink writer for writing.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The request is invalid.

?

Call this method after you configure the input streams and before you send any data to the sink writer.

You must call BeginWriting before calling any of the following methods:

The underlying media sink must have at least one input stream. Otherwise, BeginWriting returns . To add input streams, call the method.

If BeginWriting succeeds, any further calls to BeginWriting return .

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374647 HRESULT IMFSinkWriter::BeginWriting() IMFSinkWriter::BeginWriting

Delivers a sample to the sink writer.

The zero-based index of the stream for this sample.

A reference to the interface of the sample.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The request is invalid.

?

You must call before calling this method. Otherwise, the method returns .

By default, the sink writer limits the rate of incoming data by blocking the calling thread inside the WriteSample method. This prevents the application from delivering samples too quickly. To disable this behavior, set the attribute when you create the sink writer.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374654 HRESULT IMFSinkWriter::WriteSample([In] unsigned int dwStreamIndex,[In] IMFSample* pSample) IMFSinkWriter::WriteSample

Indicates a gap in an input stream.

The zero-based index of the stream.

The position in the stream where the gap in the data occurs. The value is given in 100-nanosecond units, relative to the start of the stream.

If this method succeeds, it returns . Otherwise, it returns an error code.

For video, call this method once for each missing frame. For audio, call this method at least once per second during a gap in the audio. Set the attribute on the first media sample after the gap.

Internally, this method calls on the media sink.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374652 HRESULT IMFSinkWriter::SendStreamTick([In] unsigned int dwStreamIndex,[In] longlong llTimestamp) IMFSinkWriter::SendStreamTick

Places a marker in the specified stream.

The zero-based index of the stream.

Pointer to an application-defined value. The value of this parameter is returned to the caller in the pvContext parameter of the caller's callback method. The application is responsible for any memory allocation associated with this data. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The request is invalid.

?

To use this method, you must provide an asynchronous callback when you create the sink writer. Otherwise, the method returns . For more information, see .

Markers provide a way to be notified when the media sink consumes all of the samples in a stream up to a certain point. The media sink does not process the marker until it has processed all of the samples that came before the marker. When the media sink processes the marker, the sink writer calls the application's OnMarker method. When the callback is invoked, you know that the sink has consumed all of the previous samples for that stream.

For example, to change the format midstream, call PlaceMarker at the point where the format changes. When OnMarker is called, it is safe to call to change the input type (assuming that the media sink supports dynamic format changes).

Internally, this method calls on the media sink.

Note??The pvContext parameter of the method is not passed to the pvarContextValue parameter of the method. These two parameters are not directly related.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374651 HRESULT IMFSinkWriter::PlaceMarker([In] unsigned int dwStreamIndex,[In] void* pvContext) IMFSinkWriter::PlaceMarker

Notifies the media sink that a stream has reached the end of a segment.

The zero-based index of a stream, or to signal that all streams have reached the end of a segment.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The request is invalid.

?

You must call before calling this method. Otherwise, the method returns .

This method sends an marker to the media sink for the specified streams. For more information, see .

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd743366 HRESULT IMFSinkWriter::NotifyEndOfSegment([In] unsigned int dwStreamIndex) IMFSinkWriter::NotifyEndOfSegment

Flushes one or more streams.

The zero-based index of the stream to flush, or to flush all of the streams.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The request is invalid.

?

You must call before calling this method. Otherwise, the method returns .

For each stream that is flushed, the sink writer drops all pending samples, flushes the encoder, and sends an marker to the media sink.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd743365 HRESULT IMFSinkWriter::Flush([In] unsigned int dwStreamIndex) IMFSinkWriter::Flush

Completes all writing operations on the sink writer.

If this method succeeds, it returns . Otherwise, it returns an error code.

Call this method after you send all of the input samples to the sink writer. The method performs any operations needed to create the final output from the media sink.

If you provide a callback interface when you create the sink writer, this method completes asynchronously. When the operation completes, the method of your callback is called. For more information, see . Otherwise, if you do not provide a callback, the Finalize method blocks until the operation completes.

Internally, this method calls to place end-of-segment markers for each stream on the media sink. It also calls and EndFinalize if the media sink supports the interface.

After this method is called, the following methods will fail:

If you do not call Finalize, the output from the media sink might be incomplete or invalid. For example, required file headers might be missing from the output file.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374648 HRESULT IMFSinkWriter::Finalize() IMFSinkWriter::Finalize

Queries the underlying media sink or encoder for an interface.

The zero-based index of a stream to query, or to query the media sink itself.

A service identifier , or GUID_NULL. If the value is GUID_NULL, the method calls QueryInterface to get the requested interface. Otherwise, the method calls . For a list of service identifiers, see Service Interfaces.

The interface identifier (IID) of the interface being requested.

Receives a reference to the requested interface. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

If the dwStreamIndex parameter equals , the method attempts to get the interface from the media sink. Otherwise, it attempts to get the interface from the encoder for the stream at the specified index. If that fails, or if no encoder is present, the method attempts to get the interface from the stream on the media sink.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374649 HRESULT IMFSinkWriter::GetServiceForStream([In] unsigned int dwStreamIndex,[In] const GUID& guidService,[In] const GUID& riid,[Out] void** ppvObject) IMFSinkWriter::GetServiceForStream

Gets statistics about the performance of the sink writer.

The zero-based index of a stream to query, or to query the media sink itself.

A reference to an structure. Before calling the method, set the cb member to the size of the structure in bytes. The method fills the structure with statistics from the sink writer.

This method can return one of these values.

Return codeDescription

Success.

Invalid stream number.

?

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374650 HRESULT IMFSinkWriter::GetStatistics([In] unsigned int dwStreamIndex,[Out] MF_SINK_WRITER_STATISTICS* pStats) IMFSinkWriter::GetStatistics

Called when the method completes.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374645 IMFSinkWriterCallback IMFSinkWriterCallback
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Called when the method completes.

No documentation.

Returns an value. Currently, the sink writer ignores the return value.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374644 HRESULT IMFSinkWriterCallback::OnFinalize([In] HRESULT hrStatus) IMFSinkWriterCallback::OnFinalize

Called when the method completes.

No documentation. No documentation.

Returns an value. Currently, the sink writer ignores the return value.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374645 HRESULT IMFSinkWriterCallback::OnMarker([In] unsigned int dwStreamIndex,[In] void* pvContext) IMFSinkWriterCallback::OnMarker

Called by the network source when the open operation begins or ends.

The networks source calls this method with the following event types.

For more information, see How to Get Events from the Network Source.

ms694870 IMFSourceOpenMonitor IMFSourceOpenMonitor
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Called by the network source when the open operation begins or ends.

Pointer to the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The networks source calls this method with the following event types.

For more information, see How to Get Events from the Network Source.

ms694870 HRESULT IMFSourceOpenMonitor::OnSourceEvent([In, Optional] IMFMediaEvent* pEvent) IMFSourceOpenMonitor::OnSourceEvent

Implemented by the Microsoft Media Foundation source reader object.

To create the source reader, call one of the following functions:

Alternatively, use the interface.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

In Windows?8, this interface is extended with IMFSourceReaderEx.

dd374655 IMFSourceReader IMFSourceReader
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Queries whether a stream is selected.

The stream to query. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

?

Receives TRUE if the stream is selected and will generate data. Receives if the stream is not selected and will not generate data.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374664 HRESULT IMFSourceReader::GetStreamSelection([In] unsigned int dwStreamIndex,[Out] BOOL* pfSelected) IMFSourceReader::GetStreamSelection

Selects or deselects one or more streams.

The stream to set. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFE

All streams.

?

Specify TRUE to select streams or to deselect streams. If a stream is deselected, it will not generate data.

If this method succeeds, it returns . Otherwise, it returns an error code.

There are two common uses for this method:

  • To change the default stream selection. Some media files contain multiple streams of the same type. For example, a file might include audio streams for multiple languages. You can use this method to change which of the streams is selected. To get information about each stream, call or .
  • If you will not need data from one of the streams, it is a good idea to deselect that stream. If the stream is selected, the media source might hold onto a queue of unread data, and the queue might grow indefinitely, consuming memory.

For an example of deselecting a stream, see Tutorial: Decoding Audio.

If a stream is deselected, the method returns for that stream. Other methods are valid for deselected streams.

Stream selection does not affect how the source reader loads or unloads decoders in memory. In particular, deselecting a stream does not force the source reader to unload the decoder for that stream.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374669 HRESULT IMFSourceReader::SetStreamSelection([In] unsigned int dwStreamIndex,[In] BOOL fSelected) IMFSourceReader::SetStreamSelection

Gets a format that is supported natively by the media source.

Specifies which stream to query. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

?

The zero-based index of the media type to retrieve.

Receives a reference to the interface. The caller must release the interface.

This method queries the underlying media source for its native output format. Potentially, each source stream can produce more than one output format. Use the dwMediaTypeIndex parameter to loop through the available formats. Generally, file sources offer just one format per stream, but capture devices might offer several formats.

The method returns a copy of the media type, so it is safe to modify the object received in the ppMediaType parameter.

To set the output type for a stream, call the method.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374661 HRESULT IMFSourceReader::GetNativeMediaType([In] unsigned int dwStreamIndex,[In] unsigned int dwMediaTypeIndex,[Out] IMFMediaType** ppMediaType) IMFSourceReader::GetNativeMediaType

Gets the current media type for a stream.

The stream to query. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

?

Receives a reference to the interface. The caller must release the interface.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374660 HRESULT IMFSourceReader::GetCurrentMediaType([In] unsigned int dwStreamIndex,[Out] IMFMediaType** ppMediaType) IMFSourceReader::GetCurrentMediaType

Sets the media type for a stream.

This media type defines that format that the Source Reader produces as output. It can differ from the native format provided by the media source. See Remarks for more information.

No documentation. No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

At least one decoder was found for the native stream type, but the type specified by pMediaType was rejected.

One or more sample requests are still pending.

The dwStreamIndex parameter is invalid.

Could not find a decoder for the native stream type.

?

For each stream, you can set the media type to any of the following:

  • One of the native types offered by the media source. To enumerate the native types, call .
  • If the native media type is compressed, you can specify a corresponding uncompressed format. The Source Reader will search for a decoder that can decode from the native format to the specified uncompressed format.

Audio resampling support was added to the source reader with Windows?8. In versions of Windows prior to Windows?8, the source reader does not support audio resampling. If you need to resample the audio in versions of Windows earlier than Windows?8, you can use the Audio Resampler DSP.

If you set the attribute to TRUE when you create the Source Reader, the Source Reader will convert YUV video to RGB-32. This conversion is not optimized for real-time video playback.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374667 HRESULT IMFSourceReader::SetCurrentMediaType([In] unsigned int dwStreamIndex,[In] void* pdwReserved,[In] IMFMediaType* pMediaType) IMFSourceReader::SetCurrentMediaType

Seeks to a new position in the media source.

A that specifies the time format. The time format defines the units for the varPosition parameter. The following value is defined for all media sources:

ValueMeaning
GUID_NULL

100-nanosecond units.

?

Some media sources might support additional values.

The position from which playback will be started. The units are specified by the guidTimeFormat parameter. If the guidTimeFormat parameter is GUID_NULL, set the variant type to VT_I8.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

One or more sample requests are still pending.

?

The SetCurrentPosition method does not guarantee exact seeking. The accuracy of the seek depends on the media content. If the media content contains a video stream, the SetCurrentPosition method typically seeks to the nearest key frame before the desired position. The distance between key frames depends on several factors, including the encoder implementation, the video content, and the particular encoding settings used to encode the content. The distance between key frame can vary within a single video file (for example, depending on scene complexity).

After seeking, the application should call and advance to the desired position.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374668 HRESULT IMFSourceReader::SetCurrentPosition([In] const GUID& guidTimeFormat,[In] const PROPVARIANT& varPosition) IMFSourceReader::SetCurrentPosition

Reads the next sample from the media source.

The stream to pull data from. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFE

Get the next available sample, regardless of which stream.

?

A bitwise OR of zero or more flags from the enumeration.

Receives the zero-based index of the stream.

Receives a bitwise OR of zero or more flags from the enumeration.

Receives the time stamp of the sample, or the time of the stream event indicated in pdwStreamFlags. The time is given in 100-nanosecond units.

Receives a reference to the interface or the value null (see Remarks). If this parameter receives a non-null reference, the caller must release the interface.

If the requested stream is not selected, the return code is . See .

This method can complete synchronously or asynchronously. If you provide a callback reference when you create the source reader, the method is asynchronous. Otherwise, the method is synchronous. For more information about setting the callback reference, see .

dd374665 HRESULT IMFSourceReader::ReadSample([In] unsigned int dwStreamIndex,[In] MF_SOURCE_READER_CONTROL_FLAG dwControlFlags,[Out, Optional] unsigned int* pdwActualStreamIndex,[Out, Optional] MF_SOURCE_READER_FLAG* pdwStreamFlags,[Out, Optional] longlong* pllTimestamp,[Out, Optional] IMFSample** ppSample) IMFSourceReader::ReadSample

Flushes one or more streams.

The stream to flush. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFE

All streams.

?

If this method succeeds, it returns . Otherwise, it returns an error code.

The Flush method discards all queued samples and cancels all pending sample requests.

This method can complete either synchronously or asynchronously. If you provide a callback reference when you create the source reader, the method is asynchronous. Otherwise, the method is synchronous. For more information about the setting the callback reference, see .

In synchronous mode, the method blocks until the operation is complete.

In asynchronous mode, the application's method is called when the flush operation completes. While a flush operation is pending, the method returns .

Note??In Windows?7, there was a bug in the implementation of this method, which causes OnFlush to be called before the flush operation completes. A hotfix is available that fixes this bug. For more information, see http://support.microsoft.com/kb/979567.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374659 HRESULT IMFSourceReader::Flush([In] unsigned int dwStreamIndex) IMFSourceReader::Flush

Queries the underlying media source or decoder for an interface.

The stream or object to query. If the value is , the method queries the media source. Otherwise, it queries the decoder that is associated with the specified stream. The following values are possible.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFF

The media source.

?

A service identifier . If the value is GUID_NULL, the method calls QueryInterface to get the requested interface. Otherwise, the method calls the method. For a list of service identifiers, see Service Interfaces.

The interface identifier (IID) of the interface being requested.

Receives a reference to the requested interface. The caller must release the interface.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374663 HRESULT IMFSourceReader::GetServiceForStream([In] unsigned int dwStreamIndex,[In] const GUID& guidService,[In] const GUID& riid,[Out] void** ppvObject) IMFSourceReader::GetServiceForStream

Gets an attribute from the underlying media source.

The stream or object to query. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFF

The media source.

?

A that identifies the attribute to retrieve. If the dwStreamIndex parameter equals , guidAttribute can specify one of the following:

  • A presentation descriptor attribute. For a list of values, see Presentation Descriptor Attributes.
  • . Use this value to get characteristics flags from the media source.

Otherwise, if the dwStreamIndex parameter specifies a stream, guidAttribute specifies a stream descriptor attribute. For a list of values, see Stream Descriptor Attributes.

A reference to a that receives the value of the attribute. Call the PropVariantClear function to free the .

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374662 HRESULT IMFSourceReader::GetPresentationAttribute([In] unsigned int dwStreamIndex,[In] const GUID& guidAttribute,[Out] PROPVARIANT* pvarAttribute) IMFSourceReader::GetPresentationAttribute
Creates the source reader from a URL The URL of a media file to open.

Pointer to the interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be null.

Call CoInitialize(Ex) and before calling this function.

Internally, the source reader calls the method to create a media source from the byte stream. Therefore, a byte-stream handler must be registered for the byte stream. For more information about byte-stream handlers, see Scheme Handlers and Byte-Stream Handlers.

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd388110 HRESULT MFCreateSourceReaderFromURL([In] const wchar_t* pwszURL,[In, Optional] IMFAttributes* pAttributes,[Out, Fast] IMFSourceReader** ppSourceReader) MFCreateSourceReaderFromURL
Creates the source reader from a byte stream.

A reference to the interface of a byte stream. This byte stream will provide the source data for the source reader.

Pointer to the interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be null.

Call CoInitialize(Ex) and before calling this function.

Internally, the source reader calls the method to create a media source from the byte stream. Therefore, a byte-stream handler must be registered for the byte stream. For more information about byte-stream handlers, see Scheme Handlers and Byte-Stream Handlers.

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd388106 HRESULT MFCreateSourceReaderFromByteStream([In] IMFByteStream* pByteStream,[In, Optional] IMFAttributes* pAttributes,[Out, Fast] IMFSourceReader** ppSourceReader) MFCreateSourceReaderFromByteStream
Creates the source reader from a byte stream.

A reference to the interface of a byte stream. This byte stream will provide the source data for the source reader.

Pointer to the interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be null.

Call CoInitialize(Ex) and before calling this function.

Internally, the source reader calls the method to create a media source from the byte stream. Therefore, a byte-stream handler must be registered for the byte stream. For more information about byte-stream handlers, see Scheme Handlers and Byte-Stream Handlers.

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd388106 HRESULT MFCreateSourceReaderFromByteStream([In] IMFByteStream* pByteStream,[In, Optional] IMFAttributes* pAttributes,[Out, Fast] IMFSourceReader** ppSourceReader) MFCreateSourceReaderFromByteStream
Creates the source reader from a Reference to the mediasource interface

Pointer to the interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be null.

Call CoInitialize(Ex) and before calling this function.

By default, when the application releases the source reader, the source reader shuts down the media source by calling on the media source. At that point, the application can no longer use the media source.

To change this default behavior, set the attribute in the pAttributes parameter. If this attribute is TRUE, the application is responsible for shutting down the media source.

When using the Source Reader, do not call any of the following methods on the media source:

  • All methods

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

Windows Phone 8.1: This API is supported.

dd388108 HRESULT MFCreateSourceReaderFromMediaSource([In] IMFMediaSource* pMediaSource,[In, Optional] IMFAttributes* pAttributes,[Out, Fast] IMFSourceReader** ppSourceReader) MFCreateSourceReaderFromMediaSource
Creates the source reader from a byte stream.

A reference to the interface of a byte stream. This byte stream will provide the source data for the source reader.

Pointer to the interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be null.

Call CoInitialize(Ex) and before calling this function.

Internally, the source reader calls the method to create a media source from the byte stream. Therefore, a byte-stream handler must be registered for the byte stream. For more information about byte-stream handlers, see Scheme Handlers and Byte-Stream Handlers.

This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd388106 HRESULT MFCreateSourceReaderFromByteStream([In] IMFByteStream* pByteStream,[In, Optional] IMFAttributes* pAttributes,[Out, Fast] IMFSourceReader** ppSourceReader) MFCreateSourceReaderFromByteStream

Applies to: desktop apps | Metro style apps

Gets a format that is supported natively by the media source.

Specifies which stream to query. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

?

The zero-based index of the media type to retrieve.

Receives a reference to the interface. The caller must release the interface.

This method queries the underlying media source for its native output format. Potentially, each source stream can produce more than one output format. Use the dwMediaTypeIndex parameter to loop through the available formats. Generally, file sources offer just one format per stream, but capture devices might offer several formats.

The method returns a copy of the media type, so it is safe to modify the object received in the ppMediaType parameter.

To set the output type for a stream, call the method.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374661 HRESULT IMFSourceReader::GetNativeMediaType([In] unsigned int dwStreamIndex,[In] unsigned int dwMediaTypeIndex,[Out] IMFMediaType** ppMediaType) IMFSourceReader::GetNativeMediaType

Applies to: desktop apps | Metro style apps

Selects or deselects one or more streams.

The stream to set. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFE

All streams.

?

Specify TRUE to select streams or to deselect streams. If a stream is deselected, it will not generate data.

If this method succeeds, it returns . Otherwise, it returns an error code.

There are two common uses for this method:

  • To change the default stream selection. Some media files contain multiple streams of the same type. For example, a file might include audio streams for multiple languages. You can use this method to change which of the streams is selected. To get information about each stream, call or .
  • If you will not need data from one of the streams, it is a good idea to deselect that stream. If the stream is selected, the media source might hold onto a queue of unread data, and the queue might grow indefinitely, consuming memory.

For an example of deselecting a stream, see Tutorial: Decoding Audio.

If a stream is deselected, the method returns MF_E_INVALIDREQUEST for that stream. Other methods are valid for deselected streams.

Stream selection does not affect how the source reader loads or unloads decoders in memory. In particular, deselecting a stream does not force the source reader to unload the decoder for that stream.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374669 HRESULT IMFSourceReader::SetStreamSelection([In] unsigned int dwStreamIndex,[In] BOOL fSelected) IMFSourceReader::SetStreamSelection

Applies to: desktop apps | Metro style apps

Sets the media type for a stream.

This media type defines that format that the Source Reader produces as output. It can differ from the native format provided by the media source. See Remarks for more information.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

MF_E_INVALIDMEDIATYPE

At least one decoder was found for the native stream type, but the type specified by pMediaType was rejected.

MF_E_INVALIDREQUEST

One or more sample requests are still pending.

MF_E_INVALIDSTREAMNUMBER

The dwStreamIndex parameter is invalid.

MF_E_TOPO_CODEC_NOT_FOUND

Could not find a decoder for the native stream type.

?

For each stream, you can set the media type to any of the following:

  • One of the native types offered by the media source. To enumerate the native types, call .
  • If the native media type is compressed, you can specify a corresponding uncompressed format. The Source Reader will search for a decoder that can decode from the native format to the specified uncompressed format.

The source reader does not support audio resampling. If you need to resample the audio, you can use the Audio Resampler DSP.

If you set the attribute to TRUE when you create the Source Reader, the Source Reader will convert YUV video to RGB-32. This conversion is not optimized for real-time video playback.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374667 HRESULT IMFSourceReader::SetCurrentMediaType([In] unsigned int dwStreamIndex,[In] unsigned int* pdwReserved,[In] IMFMediaType* pMediaType) IMFSourceReader::SetCurrentMediaType

Applies to: desktop apps | Metro style apps

Sets the media type for a stream.

This media type defines that format that the Source Reader produces as output. It can differ from the native format provided by the media source. See Remarks for more information.

No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

MF_E_INVALIDMEDIATYPE

At least one decoder was found for the native stream type, but the type specified by pMediaType was rejected.

MF_E_INVALIDREQUEST

One or more sample requests are still pending.

MF_E_INVALIDSTREAMNUMBER

The dwStreamIndex parameter is invalid.

MF_E_TOPO_CODEC_NOT_FOUND

Could not find a decoder for the native stream type.

?

For each stream, you can set the media type to any of the following:

  • One of the native types offered by the media source. To enumerate the native types, call .
  • If the native media type is compressed, you can specify a corresponding uncompressed format. The Source Reader will search for a decoder that can decode from the native format to the specified uncompressed format.

The source reader does not support audio resampling. If you need to resample the audio, you can use the Audio Resampler DSP.

If you set the attribute to TRUE when you create the Source Reader, the Source Reader will convert YUV video to RGB-32. This conversion is not optimized for real-time video playback.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374667 HRESULT IMFSourceReader::SetCurrentMediaType([In] unsigned int dwStreamIndex,[In] unsigned int* pdwReserved,[In] IMFMediaType* pMediaType) IMFSourceReader::SetCurrentMediaType

Applies to: desktop apps | Metro style apps

Seeks to a new position in the media source.

The position from which playback will be started. 100-nanosecond units.

The SetCurrentPosition method does not guarantee exact seeking. The accuracy of the seek depends on the media content. If the media content contains a video stream, the SetCurrentPosition method typically seeks to the nearest key frame before the desired position. The distance between key frames depends on several factors, including the encoder implementation, the video content, and the particular encoding settings used to encode the content. The distance between key frame can vary within a single video file (for example, depending on scene complexity).

After seeking, the application should call and advance to the desired position.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374668 HRESULT IMFSourceReader::SetCurrentPosition([In] const GUID& guidTimeFormat,[In] const PROPVARIANT& varPosition) IMFSourceReader::SetCurrentPosition

Applies to: desktop apps | Metro style apps

Gets the current media type for a stream.

The stream to query. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

?

Receives a reference to the interface. The caller must release the interface.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374660 HRESULT IMFSourceReader::GetCurrentMediaType([In] unsigned int dwStreamIndex,[Out] IMFMediaType** ppMediaType) IMFSourceReader::GetCurrentMediaType

Applies to: desktop apps | Metro style apps

Reads the next sample from the media source.

The stream to pull data from. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFE

Get the next available sample, regardless of which stream.

?

A bitwise OR of zero or more flags from the enumeration.

Receives the zero-based index of the stream.

Receives a bitwise OR of zero or more flags from the enumeration.

Receives the time stamp of the sample, or the time of the stream event indicated in pdwStreamFlags. The time is given in 100-nanosecond units.

Receives a reference to the interface or the value null (see Remarks). If this parameter receives a non-null reference, the caller must release the interface.

If the requested stream is not selected, the return code is MF_E_INVALIDREQUEST. See .

This method can complete synchronously or asynchronously. If you provide a callback reference when you create the source reader, the method is asynchronous. Otherwise, the method is synchronous. For more information about setting the callback reference, see .

Asynchronous Mode

In asynchronous mode:

  • All of the [out] parameters must be null. Otherwise, the method returns E_INVALIDARG.
  • The method returns immediately.
  • When the operation completes, the application's method is called.
  • If an error occurs, the method can fail either synchronously or asynchronously. Check the return value of ReadSample, and also check the hrStatus parameter of .
Synchronous Mode

In synchronous mode:

  • The pdwStreamFlags and ppSample parameters cannot be null. Otherwise, the method returns E_POINTER.
  • The pdwActualStreamIndex and pllTimestamp parameters can be null.
  • The method blocks until the next sample is available.

In synchronous mode, if the dwStreamIndex parameter is , you should pass a non-null value for pdwActualStreamIndex, so that you know which stream delivered the sample.

This method can return flags in the pdwStreamFlags parameter without returning a media sample in ppSample. Therefore, the ppSample parameter can receive a null reference even when the method succeeds. For example, when the source reader reaches the end of the stream, it returns the flag in pdwStreamFlags and sets ppSample to null.

If there is a gap in the stream, pdwStreamFlags receives the flag, ppSample is null, and pllTimestamp indicates the time when the gap occurred.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374665 HRESULT IMFSourceReader::ReadSample([In] unsigned int dwStreamIndex,[In] unsigned int dwControlFlags,[Out, Optional] unsigned int* pdwActualStreamIndex,[Out, Optional] unsigned int* pdwStreamFlags,[Out, Optional] longlong* pllTimestamp,[Out, Optional] IMFSample** ppSample) IMFSourceReader::ReadSample

Applies to: desktop apps | Metro style apps

Flushes one or more streams.

The stream to flush. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFE

All streams.

?

If this method succeeds, it returns . Otherwise, it returns an error code.

The Flush method discards all queued samples and cancels all pending sample requests.

This method can complete either synchronously or asynchronously. If you provide a callback reference when you create the source reader, the method is asynchronous. Otherwise, the method is synchronous. For more information about the setting the callback reference, see .

In synchronous mode, the method blocks until the operation is complete.

In asynchronous mode, the application's method is called when the flush operation completes. While a flush operation is pending, the method returns MF_E_NOTACCEPTING.

Note??In Windows?7, there was a bug in the implementation of this method, which causes OnFlush to be called before the flush operation completes. A hotfix is available that fixes this bug. For more information, see http://support.microsoft.com/kb/979567.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374659 HRESULT IMFSourceReader::Flush([In] unsigned int dwStreamIndex) IMFSourceReader::Flush

Applies to: desktop apps | Metro style apps

Queries the underlying media source or decoder for an interface.

The stream or object to query. If the value is , the method queries the media source. Otherwise, it queries the decoder that is associated with the specified stream. The following values are possible.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFF

The media source.

?

A service identifier . If the value is GUID_NULL, the method calls QueryInterface to get the requested interface. Otherwise, the method calls the method. For a list of service identifiers, see Service Interfaces.

The interface identifier (IID) of the interface being requested.

Receives a reference to the requested interface. The caller must release the interface.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374663 HRESULT IMFSourceReader::GetServiceForStream([In] unsigned int dwStreamIndex,[In] const GUID& guidService,[In] const GUID& riid,[Out] void** ppvObject) IMFSourceReader::GetServiceForStream

Applies to: desktop apps | Metro style apps

Gets an attribute from the underlying media source.

The stream or object to query. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFF

The media source.

?

A that identifies the attribute to retrieve. If the dwStreamIndex parameter equals , guidAttribute can specify one of the following:

  • A presentation descriptor attribute. For a list of values, see Presentation Descriptor Attributes.
  • . Use this value to get characteristics flags from the media source.

Otherwise, if the dwStreamIndex parameter specifies a stream, guidAttribute specifies a stream descriptor attribute. For a list of values, see Stream Descriptor Attributes.

a that receives the value of the attribute.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374662 HRESULT IMFSourceReader::GetPresentationAttribute([In] unsigned int dwStreamIndex,[In] const GUID& guidAttribute,[Out] PROPVARIANT* pvarAttribute) IMFSourceReader::GetPresentationAttribute

Applies to: desktop apps | Metro style apps

Gets an attribute from the underlying media source.

The stream or object to query. The value can be any of the following.

ValueMeaning
0?0xFFFFFFFB

The zero-based index of a stream.

0xFFFFFFFC

The first video stream.

0xFFFFFFFD

The first audio stream.

0xFFFFFFFF

The media source.

?

A that identifies the attribute to retrieve. If the dwStreamIndex parameter equals , guidAttribute can specify one of the following:

  • A presentation descriptor attribute. For a list of values, see Presentation Descriptor Attributes.
  • . Use this value to get characteristics flags from the media source.

Otherwise, if the dwStreamIndex parameter specifies a stream, guidAttribute specifies a stream descriptor attribute. For a list of values, see Stream Descriptor Attributes.

a that receives the value of the attribute.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374662 HRESULT IMFSourceReader::GetPresentationAttribute([In] unsigned int dwStreamIndex,[In] const GUID& guidAttribute,[Out] PROPVARIANT* pvarAttribute) IMFSourceReader::GetPresentationAttribute

Callback interface for the Microsoft Media Foundation source reader.

Use the attribute to set the callback reference when you first create the source reader object.

The callback methods can be called from any thread, so an object that implements this interface must be thread-safe.

If you do not specify a callback reference, the source reader operates synchronously.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374656 IMFSourceReaderCallback IMFSourceReaderCallback
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Called when the method completes.

No documentation. No documentation. No documentation. No documentation. No documentation.

Returns an value. Currently, the source reader ignores the return value.

The pSample parameter might be null. For example, when the source reader reaches the end of a stream, dwStreamFlags contains the flag, and pSample is null.

If there is a gap in the stream, dwStreamFlags contains the flag, pSample is null, and llTimestamp indicates the time when the gap occurred.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374658 HRESULT IMFSourceReaderCallback::OnReadSample([In] HRESULT hrStatus,[In] unsigned int dwStreamIndex,[In] unsigned int dwStreamFlags,[In] longlong llTimestamp,[In, Optional] IMFSample* pSample) IMFSourceReaderCallback::OnReadSample

Called when the method completes.

No documentation.

Returns an value. Currently, the source reader ignores the return value.

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd374657 HRESULT IMFSourceReaderCallback::OnFlush([In] unsigned int dwStreamIndex) IMFSourceReaderCallback::OnFlush

Called when the source reader receives certain events from the media source.

For stream events, the value is the zero-based index of the stream that sent the event. For source events, the value is .

A reference to the interface of the event.

Returns an value. Currently, the source reader ignores the return value.

In the current implementation, the source reader uses this method to forward the following events to the application:

This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.

dd743367 HRESULT IMFSourceReaderCallback::OnEvent([In] unsigned int dwStreamIndex,[In] IMFMediaEvent* pEvent) IMFSourceReaderCallback::OnEvent

Creates a media source or a byte stream from a URL. This method is synchronous.

The dwFlags parameter must contain either the flag or the flag, but should not contain both.

It is recommended that you do not set on the input argument dwFlags unless it is necessary for your scenario. For most use-cases, media sources do not need to be created with write capability. Creating a media source with write capability may have a lower probability of success than creating a media source without write capability. This is because there can be stricter checks on the content represented by the URL when creating a media source with write capability.

For local files, you can pass the file name in the pwszURL parameter; the file: scheme is not required.

Note??This method cannot be called remotely.

ms702279 IMFSourceResolver IMFSourceResolver
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Creates a media source or a byte stream from a URL. This method is synchronous.

Null-terminated string that contains the URL to resolve.

Bitwise OR of one or more flags. See Source Resolver Flags. See remarks below.

Pointer to the interface of a property store. The method passes the property store to the scheme handler or byte-stream handler that creates the object. The handler can use the property store to configure the object. This parameter can be null. For more information, see Configuring a Media Source.

Receives a member of the enumeration, specifying the type of object that was created.

Receives a reference to the object's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The dwFlags parameter contains mutually exclusive flags.

The URL scheme is not supported.

?

The dwFlags parameter must contain either the flag or the flag, but should not contain both.

It is recommended that you do not set on the input argument dwFlags unless it is necessary for your scenario. For most use-cases, media sources do not need to be created with write capability. Creating a media source with write capability may have a lower probability of success than creating a media source without write capability. This is because there can be stricter checks on the content represented by the URL when creating a media source with write capability.

For local files, you can pass the file name in the pwszURL parameter; the file: scheme is not required.

Note??This method cannot be called remotely.

ms702279 HRESULT IMFSourceResolver::CreateObjectFromURL([In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::CreateObjectFromURL

Creates a media source from a byte stream. This method is synchronous.

Pointer to the byte stream's interface.

Null-terminated string that contains the URL of the byte stream. The URL is optional and can be null. See Remarks for more information.

Bitwise OR of flags. See Source Resolver Flags.

Pointer to the interface of a property store. The method passes the property store to the byte-stream handler. The byte-stream handler can use the property store to configure the media source. This parameter can be null. For more information, see Configuring a Media Source.

Receives a member of the enumeration, specifying the type of object that was created.

Receives a reference to the media source's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The dwFlags parameter contains mutually exclusive flags.

This byte stream is not supported.

?

The dwFlags parameter must contain the flag and should not contain the flag.

The source resolver attempts to find one or more byte-stream handlers for the byte stream, based on the file name extension of the URL, or the MIME type of the byte stream (or both). The URL is specified in the optional pwszURL parameter, and the MIME type may be specified in the attribute on the byte stream. Byte-stream handlers are registered by file name extension or MIME type, or both, as described in Scheme Handlers and Byte-Stream Handlers. The caller should specify at least one of these values (both if possible):

  • Specify the URL in the pwszURL parameter.
  • Specify the MIME type by setting the attribute on the byte stream. (This attribute might be set already when you create the byte stream, depending on how the byte stream was created.)

Note??This method cannot be called remotely.

ms704671 HRESULT IMFSourceResolver::CreateObjectFromByteStream([In] IMFByteStream* pByteStream,[In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::CreateObjectFromByteStream

Begins an asynchronous request to create a media source or a byte stream from a URL.

Null-terminated string that contains the URL to resolve.

Bitwise OR of flags. See Source Resolver Flags.

Pointer to the interface of a property store. The method passes the property store to the scheme handler or byte-stream handler that creates the object. The handler can use the property store to configure the object. This parameter can be null. For more information, see Configuring a Media Source.

Receives an reference or the value null. If the value is not null, you can cancel the asynchronous operation by passing this reference to the method. The caller must release the interface. This parameter can be null.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The dwFlags parameter contains mutually exclusive flags.

The URL scheme is not supported.

?

The dwFlags parameter must contain either the flag or the flag, but should not contain both.

For local files, you can pass the file name in the pwszURL parameter; the file: scheme is not required.

When the operation completes, the source resolver calls the method. The Invoke method should call to get a reference to the object that was created.

The usage of the pProps parameter depends on the implementation of the media source.

ms702995 HRESULT IMFSourceResolver::BeginCreateObjectFromURL([In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out, Optional] IUnknown** ppIUnknownCancelCookie,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFSourceResolver::BeginCreateObjectFromURL

Completes an asynchronous request to create an object from a URL.

Pointer to the interface. Pass in the same reference that your callback object received in the Invoke method.

Receives a member of the enumeration, specifying the type of object that was created.

Receives a reference to the media source's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_ABORT

The operation was canceled.

?

Call this method from inside your application's method.

ms702134 HRESULT IMFSourceResolver::EndCreateObjectFromURL([In] IMFAsyncResult* pResult,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::EndCreateObjectFromURL

Begins an asynchronous request to create a media source from a byte stream.

A reference to the byte stream's interface.

A null-terminated string that contains the original URL of the byte stream. This parameter can be null.

A bitwise OR of one or more flags. See Source Resolver Flags.

A reference to the interface of a property store. The method passes the property store to the byte-stream handler. The byte-stream handler can use the property store to configure the media source. This parameter can be null. For more information, see Configuring a Media Source.

Receives an reference or the value null. If the value is not null, you can cancel the asynchronous operation by passing this reference to the method. The caller must release the interface. This parameter can be null.

A reference to the interface of a callback object. The caller must implement this interface.

A oointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The dwFlags parameter contains mutually exclusive flags.

The byte stream is not supported.

The byte stream does not support seeking.

?

The dwFlags parameter must contain the flag and should not contain the flag.

The source resolver attempts to find one or more byte-stream handlers for the byte stream, based on the file name extension of the URL, or the MIME type of the byte stream (or both). The URL is specified in the optional pwszURL parameter, and the MIME type may be specified in the attribute on the byte stream. Byte-stream handlers are registered by file name extension or MIME type, or both, as described in Scheme Handlers and Byte-Stream Handlers. The caller should specify at least one of these values.

When the operation completes, the source resolver calls the method. The Invoke method should call to get a reference to the media source.

ms698915 HRESULT IMFSourceResolver::BeginCreateObjectFromByteStream([In] IMFByteStream* pByteStream,[In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out, Optional] IUnknown** ppIUnknownCancelCookie,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFSourceResolver::BeginCreateObjectFromByteStream

Completes an asynchronous request to create a media source from a byte stream.

Pointer to the interface. Pass in the same reference that your callback object received in the Invoke method.

Receives a member of the enumeration, specifying the type of object that was created.

Receives a reference to the media source's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_ABORT

The application canceled the operation.

?

Call this method from inside your application's method.

ms697199 HRESULT IMFSourceResolver::EndCreateObjectFromByteStream([In] IMFAsyncResult* pResult,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::EndCreateObjectFromByteStream

Cancels an asynchronous request to create an object.

Pointer to the interface that was returned in the ppIUnknownCancelCookie parameter of the or method.

If this method succeeds, it returns . Otherwise, it returns an error code.

You can use this method to cancel a previous call to BeginCreateObjectFromByteStream or BeginCreateObjectFromURL. Because these methods are asynchronous, however, they might be completed before the operation can be canceled. Therefore, your callback might still be invoked after you call this method.

Note??This method cannot be called remotely.

ms698845 HRESULT IMFSourceResolver::CancelObjectCreation([In] IUnknown* pIUnknownCancelCookie) IMFSourceResolver::CancelObjectCreation
Initializes a new instance of the class which is used to create a media source from a URL or byte stream. ms697433 HRESULT MFCreateSourceResolver([Out] IMFSourceResolver** ppISourceResolver) MFCreateSourceResolver

Applies to: desktop apps | Metro style apps

Creates a media source or a byte stream from a URL. This method is synchronous.

Null-terminated string that contains the URL to resolve.

Bitwise OR of one or more flags. See Source Resolver Flags.

A reference to the object's interface. The caller must release the interface.

The dwFlags parameter must contain either the flag or the flag, but should not contain both.

For local files, you can pass the file name in the pwszURL parameter; the file: scheme is not required.

Note??This method cannot be called remotely.

ms702279 HRESULT IMFSourceResolver::CreateObjectFromURL([In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::CreateObjectFromURL

Applies to: desktop apps | Metro style apps

Creates a media source or a byte stream from a URL. This method is synchronous.

Null-terminated string that contains the URL to resolve.

Bitwise OR of one or more flags. See Source Resolver Flags.

Receives a member of the enumeration, specifying the type of object that was created.

A reference to the object's interface. The caller must release the interface.

The dwFlags parameter must contain either the flag or the flag, but should not contain both.

For local files, you can pass the file name in the pwszURL parameter; the file: scheme is not required.

Note??This method cannot be called remotely.

ms702279 HRESULT IMFSourceResolver::CreateObjectFromURL([In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::CreateObjectFromURL

Applies to: desktop apps | Metro style apps

Creates a media source or a byte stream from a URL. This method is synchronous.

Null-terminated string that contains the URL to resolve.

Bitwise OR of one or more flags. See Source Resolver Flags.

Pointer to the interface of a property store. The method passes the property store to the scheme handler or byte-stream handler that creates the object. The handler can use the property store to configure the object. This parameter can be null. For more information, see Configuring a Media Source.

Receives a member of the enumeration, specifying the type of object that was created.

A reference to the object's interface. The caller must release the interface.

The dwFlags parameter must contain either the flag or the flag, but should not contain both.

For local files, you can pass the file name in the pwszURL parameter; the file: scheme is not required.

Note??This method cannot be called remotely.

ms702279 HRESULT IMFSourceResolver::CreateObjectFromURL([In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::CreateObjectFromURL

Applies to: desktop apps | Metro style apps

Creates a media source from a byte stream. This method is synchronous.

Pointer to the byte stream's interface.

Null-terminated string that contains the URL of the byte stream. The URL is optional and can be null. See Remarks for more information.

Bitwise OR of flags. See Source Resolver Flags.

a reference to the media source's interface. The caller must release the interface.

The dwFlags parameter must contain the flag and should not contain the flag.

The source resolver attempts to find one or more byte-stream handlers for the byte stream, based on the file name extension of the URL, or the MIME type of the byte stream (or both). The URL is specified in the optional pwszURL parameter, and the MIME type may be specified in the attribute on the byte stream. Byte-stream handlers are registered by file name extension or MIME type, or both, as described in Scheme Handlers and Byte-Stream Handlers. The caller should specify at least one of these values (both if possible):

  • Specify the URL in the pwszURL parameter.
  • Specify the MIME type by setting the attribute on the byte stream. (This attribute might be set already when you create the byte stream, depending on how the byte stream was created.)

Note??This method cannot be called remotely.

ms704671 HRESULT IMFSourceResolver::CreateObjectFromByteStream([In] IMFByteStream* pByteStream,[In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::CreateObjectFromByteStream

Applies to: desktop apps | Metro style apps

Creates a media source from a byte stream. This method is synchronous.

Pointer to the byte stream's interface.

Null-terminated string that contains the URL of the byte stream. The URL is optional and can be null. See Remarks for more information.

Bitwise OR of flags. See Source Resolver Flags.

Receives a member of the enumeration, specifying the type of object that was created.

a reference to the media source's interface. The caller must release the interface.

The dwFlags parameter must contain the flag and should not contain the flag.

The source resolver attempts to find one or more byte-stream handlers for the byte stream, based on the file name extension of the URL, or the MIME type of the byte stream (or both). The URL is specified in the optional pwszURL parameter, and the MIME type may be specified in the attribute on the byte stream. Byte-stream handlers are registered by file name extension or MIME type, or both, as described in Scheme Handlers and Byte-Stream Handlers. The caller should specify at least one of these values (both if possible):

  • Specify the URL in the pwszURL parameter.
  • Specify the MIME type by setting the attribute on the byte stream. (This attribute might be set already when you create the byte stream, depending on how the byte stream was created.)

Note??This method cannot be called remotely.

ms704671 HRESULT IMFSourceResolver::CreateObjectFromByteStream([In] IMFByteStream* pByteStream,[In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::CreateObjectFromByteStream

Applies to: desktop apps | Metro style apps

Creates a media source from a byte stream. This method is synchronous.

Pointer to the byte stream's interface.

Null-terminated string that contains the URL of the byte stream. The URL is optional and can be null. See Remarks for more information.

Bitwise OR of flags. See Source Resolver Flags.

Pointer to the interface of a property store. The method passes the property store to the byte-stream handler. The byte-stream handler can use the property store to configure the media source. This parameter can be null. For more information, see Configuring a Media Source.

Receives a member of the enumeration, specifying the type of object that was created.

a reference to the media source's interface. The caller must release the interface.

The dwFlags parameter must contain the flag and should not contain the flag.

The source resolver attempts to find one or more byte-stream handlers for the byte stream, based on the file name extension of the URL, or the MIME type of the byte stream (or both). The URL is specified in the optional pwszURL parameter, and the MIME type may be specified in the attribute on the byte stream. Byte-stream handlers are registered by file name extension or MIME type, or both, as described in Scheme Handlers and Byte-Stream Handlers. The caller should specify at least one of these values (both if possible):

  • Specify the URL in the pwszURL parameter.
  • Specify the MIME type by setting the attribute on the byte stream. (This attribute might be set already when you create the byte stream, depending on how the byte stream was created.)

Note??This method cannot be called remotely.

ms704671 HRESULT IMFSourceResolver::CreateObjectFromByteStream([In] IMFByteStream* pByteStream,[In] const wchar_t* pwszURL,[In] unsigned int dwFlags,[In] IPropertyStore* pProps,[Out] MF_OBJECT_TYPE* pObjectType,[Out] IUnknown** ppObject) IMFSourceResolver::CreateObjectFromByteStream

Indicates whether the server SSL certificate must be verified by the caller, Media Foundation, or the implementation class.

dd374673 IMFSSLCertificateManager IMFSSLCertificateManager
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the client SSL certificate synchronously.

Pointer to a string that contains the URL for which a client-side SSL certificate is required. Media Foundation can resolve the scheme and send the request to the server.

Pointer to the buffer that stores the certificate.This caller must free the buffer by calling CoTaskMemFree.

Pointer to a DWORD variable that receives the number of bytes required to hold the certificate data in the buffer pointed by *ppbData.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374674 HRESULT IMFSSLCertificateManager::GetClientCertificate([In] const wchar_t* pszURL,[Out, Buffer] unsigned char** ppbData,[Out] unsigned int* pcbData) IMFSSLCertificateManager::GetClientCertificate

Starts an asynchronous call to get the client SSL certificate.

A null-terminated string that contains the URL for which a client-side SSL certificate is required. Media Foundation can resolve the scheme and send the request to the server.

A reference to the interface of a callback object. The caller must implement this interface.

A reference to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

If this method succeeds, it returns . Otherwise, it returns an error code.

When the operation completes, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

dd374671 HRESULT IMFSSLCertificateManager::BeginGetClientCertificate([In] const wchar_t* pszURL,[In] IMFAsyncCallback* pCallback,[In] IUnknown* pState) IMFSSLCertificateManager::BeginGetClientCertificate

Completes an asynchronous request to get the client SSL certificate.

A reference to the interface. Pass in the same reference that your callback object received in the method.

Receives a reference to the buffer that stores the certificate.The caller must free the buffer by calling CoTaskMemFree.

Receives the size of the ppbData buffer, in bytes.

If this method succeeds, it returns . Otherwise, it returns an error code.

Call this method after the method completes asynchronously.

dd374672 HRESULT IMFSSLCertificateManager::EndGetClientCertificate([In] IMFAsyncResult* pResult,[Out, Buffer] unsigned char** ppbData,[Out] unsigned int* pcbData) IMFSSLCertificateManager::EndGetClientCertificate

Indicates whether the server SSL certificate must be verified by the caller, Media Foundation, or the implementation class.

Pointer to a string that contains the URL that is sent to the server.

Pointer to a value. Set to TRUE if is used to verify the server certificate.Set to if Media Foundation verifies the server certificate by using the certificates in the Windows certificate store.

Pointer to a value. Set to TRUE if the SSL certificate for the client is available for immediate retrieval. Media Foundation calls to obtain the client certificate synchronously. If the value is set to , Media Foundation obtains the client SSL certificate with an asynchronous call to .

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374673 HRESULT IMFSSLCertificateManager::GetCertificatePolicy([In] const wchar_t* pszURL,[In] BOOL* pfOverrideAutomaticCheck,[In] BOOL* pfClientCertificateAvailable) IMFSSLCertificateManager::GetCertificatePolicy

Called by Media Foundation when the server SSL certificate has been received; indicates whether the server certificate is accepted.

Pointer to a string that contains the URL used to send the request to the server, and for which a server-side SSL certificate has been received.

Pointer to a buffer that contains the server SSL certificate.

Pointer to a DWORD variable that indicates the size of pbData in bytes.

Pointer to a variable that indicates whether the certificate is accepted.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374675 HRESULT IMFSSLCertificateManager::OnServerCertificate([In] const wchar_t* pszURL,[In, Buffer] unsigned char* pbData,[In] unsigned int cbData,[In] BOOL* pfIsGood) IMFSSLCertificateManager::OnServerCertificate

Gets information about one stream in a media source.

A presentation descriptor contains one or more stream descriptors. To get the stream descriptors from a presentation descriptor, call . To create a new stream descriptor, call .

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms701622 IMFStreamDescriptor IMFStreamDescriptor
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves an identifier for the stream.

Receives the stream identifier.

If this method succeeds, it returns . Otherwise, it returns an error code.

The stream identifier uniquely identifies a stream within a presentation. It does not change throughout the lifetime of the stream. For example, if the presentation changes while the source is running, the index number of the stream may change, but the stream identifier does not.

In general, stream identifiers do not have a specific meaning, other than to identify the stream. Some media sources may assign stream identifiers based on meaningful values, such as packet identifiers, but this depends on the implementation.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703852 HRESULT IMFStreamDescriptor::GetStreamIdentifier([Out] unsigned int* pdwStreamIdentifier) IMFStreamDescriptor::GetStreamIdentifier

Retrieves a media type handler for the stream. The media type handler can be used to enumerate supported media types for the stream, get the current media type, and set the media type.

Receives a reference to the interface. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms700210 HRESULT IMFStreamDescriptor::GetMediaTypeHandler([Out] IMFMediaTypeHandler** ppMediaTypeHandler) IMFStreamDescriptor::GetMediaTypeHandler

Retrieves an identifier for the stream.

The stream identifier uniquely identifies a stream within a presentation. It does not change throughout the lifetime of the stream. For example, if the presentation changes while the source is running, the index number of the stream may change, but the stream identifier does not.

In general, stream identifiers do not have a specific meaning, other than to identify the stream. Some media sources may assign stream identifiers based on meaningful values, such as packet identifiers, but this depends on the implementation.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms703852 GetStreamIdentifier GetStreamIdentifier HRESULT IMFStreamDescriptor::GetStreamIdentifier([Out] unsigned int* pdwStreamIdentifier)

Retrieves a media type handler for the stream. The media type handler can be used to enumerate supported media types for the stream, get the current media type, and set the media type.

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms700210 GetMediaTypeHandler GetMediaTypeHandler HRESULT IMFStreamDescriptor::GetMediaTypeHandler([Out] IMFMediaTypeHandler** ppMediaTypeHandler)

Called by the streaming media client before the Media Session starts streaming to specify the byte offset or the time offset.

dd374677 IMFStreamingSinkConfig IMFStreamingSinkConfig
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Called by the streaming media client before the Media Session starts streaming to specify the byte offset or the time offset.

A Boolean value that specifies whether qwSeekOffset gives a byte offset of a time offset.

ValueMeaning
TRUE

The qwSeekOffset parameter specifies a byte offset.

The qwSeekOffset parameter specifies the time position in 100-nanosecond units.

?

A byte offset or a time offset, depending on the value passed in fSeekOffsetIsByteOffset. Time offsets are specified in 100-nanosecond units.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374677 HRESULT IMFStreamingSinkConfig::StartStreaming([In] BOOL fSeekOffsetIsByteOffset,[In] unsigned longlong qwSeekOffset) IMFStreamingSinkConfig::StartStreaming

Represents a stream on a media sink object.

ms705657 IMFStreamSink IMFStreamSink
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the media sink that owns this stream sink.

Receives a reference to the media sink's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media sink's Shutdown method has been called.

This stream was removed from the media sink and is no longer valid.

?

ms699003 HRESULT IMFStreamSink::GetMediaSink([Out] IMFMediaSink** ppMediaSink) IMFStreamSink::GetMediaSink

Retrieves the stream identifier for this stream sink.

Receives the stream identifier. If this stream sink was added by calling , the stream identifier is in the dwStreamSinkIdentifier parameter of that method. Otherwise, the media sink defines the identifier.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media sink's Shutdown method has been called.

This stream was removed from the media sink and is no longer valid.

?

ms702129 HRESULT IMFStreamSink::GetIdentifier([Out] unsigned int* pdwIdentifier) IMFStreamSink::GetIdentifier

Retrieves the media type handler for the stream sink. You can use the media type handler to find which formats the stream supports, and to set the media type on the stream.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media sink's Shutdown method has been called.

This stream was removed from the media sink and is no longer valid.

?

If the stream sink currently does not support any media types, this method returns a media type handler that fails any calls to and .

ms700107 HRESULT IMFStreamSink::GetMediaTypeHandler([Out] IMFMediaTypeHandler** ppHandler) IMFStreamSink::GetMediaTypeHandler

Delivers a sample to the stream. The media sink processes the sample.

Pointer to the interface of a sample that contains valid data for the stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media sink is in the wrong state to receive a sample. For example, preroll is complete but the presenation clock has not started yet.

The sample has an invalid time stamp. See Remarks.

The media sink is paused or stopped and cannot process the sample.

The presentation clock was not set. Call .

The sample does not have a time stamp.

The stream sink has not been initialized.

The media sink's Shutdown method has been called.

This stream was removed from the media sink and is no longer valid.

?

Call this method when the stream sink sends an event.

This method can return for various reasons, depending on the implementation of the media sink:

  • Negative time stamps.

  • Time stamps that jump backward (within the same stream).

  • The time stamps for one stream have drifted too far from the time stamps on another stream within the same media sink (for example, an archive sink that multiplexes the streams).

Not every media sink returns an error code in these situations.

ms696208 HRESULT IMFStreamSink::ProcessSample([In, Optional] IMFSample* pSample) IMFStreamSink::ProcessSample

Places a marker in the stream.

Specifies the marker type, as a member of the enumeration.

Optional reference to a that contains additional information related to the marker. The meaning of this value depends on the marker type. This parameter can be null.

Optional reference to a that is attached to the event. Call to get this value from the event. The caller can use this information for any purpose. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media sink's Shutdown method has been called.

This stream was removed from the media sink and is no longer valid.

?

This method causes the stream sink to send an event after the stream sink consumes all of the samples that were delivered up to this point (before the call to PlaceMarker).

ms703026 HRESULT IMFStreamSink::PlaceMarker([In] MFSTREAMSINK_MARKER_TYPE eMarkerType,[In] const PROPVARIANT* pvarMarkerValue,[In] const PROPVARIANT* pvarContextValue) IMFStreamSink::PlaceMarker

Causes the stream sink to drop any samples that it has received and has not rendered yet.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The stream sink has not been initialized yet. You might need to set a media type.

The media sink's Shutdown method has been called.

This stream was removed from the media sink and is no longer valid.

?

If any samples are still queued from previous calls to the method, the media sink immediately discards them, without processing them. This can cause a glitch in the rendered output. The running state of the sink (running, paused, or stopped) does not change.

Any pending marker events from the method are dispatched immediately, with the status code E_ABORT.

This method is synchronous. It does not return until the sink has discarded all pending samples.

ms697054 HRESULT IMFStreamSink::Flush() IMFStreamSink::Flush

Retrieves the media sink that owns this stream sink.

ms699003 GetMediaSink GetMediaSink HRESULT IMFStreamSink::GetMediaSink([Out] IMFMediaSink** ppMediaSink)

Retrieves the stream identifier for this stream sink.

ms702129 GetIdentifier GetIdentifier HRESULT IMFStreamSink::GetIdentifier([Out] unsigned int* pdwIdentifier)

Retrieves the media type handler for the stream sink. You can use the media type handler to find which formats the stream supports, and to set the media type on the stream.

If the stream sink currently does not support any media types, this method returns a media type handler that fails any calls to and .

ms700107 GetMediaTypeHandler GetMediaTypeHandler HRESULT IMFStreamSink::GetMediaTypeHandler([Out] IMFMediaTypeHandler** ppHandler)

Converts between Society of Motion Picture and Television Engineers (SMPTE) time codes and 100-nanosecond time units.

If an object supports this interface, it must expose the interface as a service. To get a reference to the interface, call with the service identifier .

The Advanced Streaming Format (ASF) media source exposes this interface.

dd374678 IMFTimecodeTranslate IMFTimecodeTranslate
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Starts an asynchronous call to convert Society of Motion Picture and Television Engineers (SMPTE) time code to 100-nanosecond units.

Time in SMPTE time code to convert. The vt member of the structure is set to VT_I8. The hVal.QuadPart member contains the time in binary coded decimal (BCD) form. See Remarks.

Pointer to the interface of a callback object. The caller must implement this interface.

PPointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription
E_INVALIDARG

pPropVarTimecode is not VT_I8.

The object's Shutdown method was called.

The byte stream is not seekable. The time code cannot be read from the end of the byte stream.

?

When the asynchronous method completes, the callback object's method is called. At that point, the application must call to complete the asynchronous request.

The value of pPropVarTimecode is a 64-bit unsigned value typed as a LONGLONG. The upper DWORD contains the range. (A range is a continuous series of time codes.) The lower DWORD contains the time code in the form of a hexadecimal number 0xhhmmssff, where each 2-byte sequence is read as a decimal value.

void CreateTimeCode( DWORD dwFrames, DWORD dwSeconds, DWORD dwMinutes, DWORD dwHours, DWORD dwRange,  *pvar )	
            { ULONGLONG ullTimecode = ((ULONGLONG)dwRange) << 32; ullTimecode +=   dwFrames  % 10; ullTimecode += (( (ULONGLONG)dwFrames )  / 10) << 4; ullTimecode += (( (ULONGLONG)dwSeconds ) % 10) << 8; ullTimecode += (( (ULONGLONG)dwSeconds ) / 10) << 12; ullTimecode += (( (ULONGLONG)dwMinutes ) % 10) << 16; ullTimecode += (( (ULONGLONG)dwMinutes ) / 10) << 20; ullTimecode += (( (ULONGLONG)dwHours )   % 10) << 24; ullTimecode += (( (ULONGLONG)dwHours )   / 10) << 28; pvar->vt = VT_I8; pvar->hVal.QuadPart = (LONGLONG)ullTimecode;	
            }	
            
dd374680 HRESULT IMFTimecodeTranslate::BeginConvertTimecodeToHNS([In] const PROPVARIANT* pPropVarTimecode,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFTimecodeTranslate::BeginConvertTimecodeToHNS

Completes an asynchronous request to convert time in Society of Motion Picture and Television Engineers (SMPTE) time code to 100-nanosecond units.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

Receives the converted time.

If this method succeeds, it returns . Otherwise, it returns an error code.

Call this method after the method completes asynchronously.

dd374682 HRESULT IMFTimecodeTranslate::EndConvertTimecodeToHNS([In] IMFAsyncResult* pResult,[In] longlong* phnsTime) IMFTimecodeTranslate::EndConvertTimecodeToHNS

Starts an asynchronous call to convert time in 100-nanosecond units to Society of Motion Picture and Television Engineers (SMPTE) time code.

The time to convert, in 100-nanosecond units.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The object's Shutdown method was called.

The byte stream is not seekable. The time code cannot be read from the end of the byte stream.

?

When the asynchronous method completes, the callback object's method is called. At that point, the application must call to complete the asynchronous request.

dd374679 HRESULT IMFTimecodeTranslate::BeginConvertHNSToTimecode([In] longlong hnsTime,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState) IMFTimecodeTranslate::BeginConvertHNSToTimecode

Completes an asynchronous request to convert time in 100-nanosecond units to Society of Motion Picture and Television Engineers (SMPTE) time code.

A reference to the interface. Pass in the same reference that your callback object received in the method.

A reference to a that receives the converted time. The vt member of the structure is set to VT_I8. The hVal.QuadPart member contains the converted time in binary coded decimal (BCD) form. See Remarks.

If this method succeeds, it returns . Otherwise, it returns an error code.

Call this method after the method completes asynchronously.

The value of pPropVarTimecode is a 64-bit unsigned value typed as a LONGLONG. The upper DWORD contains the range. (A range is a continuous series of time codes.) The lower DWORD contains the time code in the form of a hexadecimal number 0xhhmmssff, where each 2-byte sequence is read as a decimal value.

 ParseTimeCode( const & var, DWORD *pdwRange, DWORD *pdwFrames, DWORD *pdwSeconds, DWORD *pdwMinutes, DWORD *pdwHours )	
            { if (var.vt != VT_I8) { return E_INVALIDARG; } ULONGLONG ullTimeCode = (ULONGLONG)var.hVal.QuadPart; DWORD dwTimecode = (DWORD)(ullTimeCode & 0xFFFFFFFF); *pdwRange   = (DWORD)(ullTimeCode >> 32); *pdwFrames  =     dwTimecode & 0x0000000F; *pdwFrames  += (( dwTimecode & 0x000000F0) >> 4 )  * 10; *pdwSeconds =   ( dwTimecode & 0x00000F00) >> 8; *pdwSeconds += (( dwTimecode & 0x0000F000) >> 12 ) * 10; *pdwMinutes =   ( dwTimecode & 0x000F0000) >> 16; *pdwMinutes += (( dwTimecode & 0x00F00000) >> 20 ) * 10; *pdwHours   =   ( dwTimecode & 0x0F000000) >> 24; *pdwHours   += (( dwTimecode & 0xF0000000) >> 28 ) * 10; return ;	
            }	
            
dd374681 HRESULT IMFTimecodeTranslate::EndConvertHNSToTimecode([In] IMFAsyncResult* pResult,[In] PROPVARIANT* pPropVarTimecode) IMFTimecodeTranslate::EndConvertHNSToTimecode

Sets a timer that invokes a callback at the specified time.

If the clock is stopped, the method returns MF_S_CLOCK_STOPPED. The callback will not be invoked until the clock is started.

ms696252 IMFTimer IMFTimer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets a timer that invokes a callback at the specified time.

Bitwise OR of zero or more flags from the enumeration.

The time at which the timer should fire, in units of the clock's frequency. The time is either absolute or relative to the current time, depending on the value of dwFlags.

Pointer to the interface of a callback object. The caller must implement this interface. The callback's Invoke method is called at the time specified in the llClockTime parameter.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

Receives a reference to the interface of a cancellation object. The caller must release the interface. To cancel the timer, pass this reference to the method. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The clock was shut down.

MF_S_CLOCK_STOPPED

The method succeeded, but the clock is stopped.

?

If the clock is stopped, the method returns MF_S_CLOCK_STOPPED. The callback will not be invoked until the clock is started.

ms696252 HRESULT IMFTimer::SetTimer([In] unsigned int dwFlags,[In] longlong llClockTime,[In] IMFAsyncCallback* pCallback,[In] IUnknown* punkState,[In] IUnknown** ppunkKey) IMFTimer::SetTimer

Cancels a timer that was set using the method.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Because the timer is dispatched asynchronously, the application's timer callback might get invoked even if this method succeeds.

ms696276 HRESULT IMFTimer::CancelTimer([In] IUnknown* punkKey) IMFTimer::CancelTimer

Converts a partial topology into a full topology. The topology loader exposes this interface.

To create the topology loader, call the function.

ms697375 IMFTopoLoader IMFTopoLoader
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Creates a fully loaded topology from the input partial topology.

A reference to the interface of the partial topology to be resolved.

Receives a reference to the interface of the completed topology. The caller must release the interface.

A reference to the interface of the previous full topology. The topology loader can re-use objects from this topology in the new topology. This parameter can be null. See Remarks.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

One or more output nodes contain references. The caller must bind the output nodes to media sinks. See Binding Output Nodes to Media Sinks.

?

This method creates any intermediate transforms that are needed to complete the topology. It also sets the input and output media types on all of the objects in the topology. If the method succeeds, the full topology is returned in the ppOutputTopo parameter.

You can use the pCurrentTopo parameter to provide a full topology that was previously loaded. If this topology contains objects that are needed in the new topology, the topology loader can re-use them without creating them again. This caching can potentially make the process faster. The objects from pCurrentTopo will not be reconfigured, so you can specify a topology that is actively streaming data. For example, while a topology is still running, you can pre-load the next topology.

Before calling this method, you must ensure that the output nodes in the partial topology have valid references, not references. The Media Session automatically performs this action inside the method. However, if you call Load before calling SetTopology, you must bind the output nodes manually. For more information, see Binding Output Nodes to Media Sinks.

ms693561 HRESULT IMFTopoLoader::Load([In] IMFTopology* pInputTopo,[Out] IMFTopology** ppOutputTopo,[In] IMFTopology* pCurrentTopo) IMFTopoLoader::Load

Gets the source nodes in the topology.

ms701611 IMFTopology IMFTopology
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the identifier of the topology.

Receives the identifier, as a TOPOID value.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms705620 HRESULT IMFTopology::GetTopologyID([Out] unsigned longlong* pID) IMFTopology::GetTopologyID

Adds a node to the topology.

Pointer to the node's interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

pNode is invalid, possibly because the node already exists in the topology.

?

ms697365 HRESULT IMFTopology::AddNode([In] IMFTopologyNode* pNode) IMFTopology::AddNode

Removes a node from the topology.

Pointer to the node's interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The specified node is not a member of this topology.

?

This method does not destroy the node, so the reference is still valid after the method returns.

The method breaks any connections between the specified node and other nodes.

ms694226 HRESULT IMFTopology::RemoveNode([In] IMFTopologyNode* pNode) IMFTopology::RemoveNode

Gets the number of nodes in the topology.

Receives the number of nodes.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms700175 HRESULT IMFTopology::GetNodeCount([Out] unsigned short* pwNodes) IMFTopology::GetNodeCount

Gets a node in the topology, specified by index.

The zero-based index of the node. To get the number of nodes in the topology, call .

Receives a reference to the node's interface. The caller must release the reference.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The index is less than zero.

No node can be found at the index wIndex.

?

ms701569 HRESULT IMFTopology::GetNode([In] unsigned short wIndex,[Out] IMFTopologyNode** ppNode) IMFTopology::GetNode

Removes all nodes from the topology.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

You do not need to clear a topology before disposing of it. The Clear method is called automatically when the topology is destroyed.

ms700800 HRESULT IMFTopology::Clear() IMFTopology::Clear

Converts this topology into a copy of another topology.

A reference to the interface of the topology to clone.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method does the following:

  • Removes all of the nodes from this topology.
  • Clones the nodes from pTopology and adds them to this topology. The cloned nodes have the same node identifiers as the nodes from pTopology.
  • Connects the cloned nodes to match the connections in pTopology.
  • Copies the attributes from pTopology to this topology.
  • Copies the topology identifier from pTopology to this topology.
ms702242 HRESULT IMFTopology::CloneFrom([In, Optional] IMFTopology* pTopology) IMFTopology::CloneFrom

Gets a node in the topology, specified by node identifier.

The identifier of the node to retrieve. To get a node's identifier, call .

Receives a reference to the node's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The topology does not contain a node with this identifier.

?

ms696224 HRESULT IMFTopology::GetNodeByID([In] unsigned longlong qwTopoNodeID,[Out] IMFTopologyNode** ppNode) IMFTopology::GetNodeByID

Gets the source nodes in the topology.

Receives a reference to the interface. The caller must release the reference. The collection contains references to all of the source nodes in the topology. Each reference can be queried for the interface. The collection might be empty.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms701611 HRESULT IMFTopology::GetSourceNodeCollection([Out] IMFCollection** ppCollection) IMFTopology::GetSourceNodeCollection

Gets the output nodes in the topology.

Receives a reference to the interface. The caller must release the reference. The collection contains references to all of the output nodes in the topology. Each reference can be queried for the interface. The collection might be empty.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms694029 HRESULT IMFTopology::GetOutputNodeCollection([Out] IMFCollection** ppCollection) IMFTopology::GetOutputNodeCollection

Gets the identifier of the topology.

ms705620 GetTopologyID GetTopologyID HRESULT IMFTopology::GetTopologyID([Out] unsigned longlong* pID)

Gets the number of nodes in the topology.

ms700175 GetNodeCount GetNodeCount HRESULT IMFTopology::GetNodeCount([Out] unsigned short* pwNodes)

Gets the source nodes in the topology.

ms701611 GetSourceNodeCollection GetSourceNodeCollection HRESULT IMFTopology::GetSourceNodeCollection([Out] IMFCollection** ppCollection)

Gets the output nodes in the topology.

ms694029 GetOutputNodeCollection GetOutputNodeCollection HRESULT IMFTopology::GetOutputNodeCollection([Out] IMFCollection** ppCollection)

Represents a node in a topology. The following node types are supported:

  • Output node. Represents a media sink.
  • Source node. Represents a media stream.
  • Transform node. Represents a Media Foundation Transform (MFT).
  • Tee node. Delivers a media stream to two or more nodes.

To create a new node, call the function.

ms693529 IMFTopologyNode IMFTopologyNode
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the object associated with this node.

A reference to the object's interface. Use the value null to clear an object that was previous set.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

All node types support this method, but the object reference is not used by every node type.

Node typeObject reference
Source node.Not used.
Transform node. or interface.
Output node or interface.
Tee node.Not used.

?

If the object supports , IPersistStorage, or IPersistPropertyBag, the method gets the object's CLSID and sets the attribute on the node.

ms702992 HRESULT IMFTopologyNode::SetObject([In, Optional] IUnknown* pObject) IMFTopologyNode::SetObject

Gets the object associated with this node.

Receives a reference to the object's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_FAIL

There is no object associated with this node.

?

ms693569 HRESULT IMFTopologyNode::GetObjectW([Out] IUnknown** ppObject) IMFTopologyNode::GetObjectW

Retrieves the node type.

Receives the node type, specified as a member of the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms697514 HRESULT IMFTopologyNode::GetNodeType([Out] MF_TOPOLOGY_TYPE* pType) IMFTopologyNode::GetNodeType

Retrieves the identifier of the node.

Receives the identifier.

If this method succeeds, it returns . Otherwise, it returns an error code.

When a node is first created, it is assigned an identifier. Node identifiers are unique within a topology, but can be reused across several topologies. The topology loader uses the identifier to look up nodes in the previous topology, so that it can reuse objects from the previous topology.

To find a node in a topology by its identifier, call .

ms701602 HRESULT IMFTopologyNode::GetTopoNodeID([Out] unsigned longlong* pID) IMFTopologyNode::GetTopoNodeID

Sets the identifier for the node.

The identifier for the node.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The TOPOID has already been set for this object.

?

When a node is first created, it is assigned an identifier. Typically there is no reason for an application to override the identifier. Within a topology, each node identifier should be unique.

bb970438 HRESULT IMFTopologyNode::SetTopoNodeID([In] unsigned longlong ullTopoID) IMFTopologyNode::SetTopoNodeID

Retrieves the number of input streams that currently exist on this node.

Receives the number of input streams.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The input streams may or may not be connected to output streams on other nodes. To get the node that is connected to a specified input stream, call .

The and methods add new input streams as needed.

ms700165 HRESULT IMFTopologyNode::GetInputCount([Out] unsigned int* pcInputs) IMFTopologyNode::GetInputCount

Retrieves the number of output streams that currently exist on this node.

Receives the number of output streams.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The output streams may or may not be connected to input streams on other nodes. To get the node that is connected to a specific output stream on this node, call .

The and methods add new input streams as needed.

ms704019 HRESULT IMFTopologyNode::GetOutputCount([Out] unsigned int* pcOutputs) IMFTopologyNode::GetOutputCount

Connects an output stream from this node to the input stream of another node.

Zero-based index of the output stream on this node.

Pointer to the interface of the node to connect to.

Zero-based index of the input stream on the other node.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_FAIL

The method failed.

E_INVALIDARG

Invalid parameter.

?

Node connections represent data flow from one node to the next. The streams are logical, and are specified by index.

If the node is already connected at the specified output, the method breaks the existing connection. If dwOutputIndex or dwInputIndexOnDownstreamNode specify streams that do not exist yet, the method adds as many streams as needed.

This method checks for certain invalid conditions:

  • An output node cannot have any output connections. If you call this method on an output node, the method returns E_FAIL.

  • A node cannot be connected to itself. If pDownstreamNode specifies the same node as the method call, the method returns E_INVALIDARG.

However, if the method succeeds, it does not guarantee that the node connection is valid. It is possible to create a partial topology that the topology loader cannot resolve. If so, the method will fail.

To break an existing node connection, call .

ms695284 HRESULT IMFTopologyNode::ConnectOutput([In] unsigned int dwOutputIndex,[In] IMFTopologyNode* pDownstreamNode,[In] unsigned int dwInputIndexOnDownstreamNode) IMFTopologyNode::ConnectOutput

Disconnects an output stream on this node.

Zero-based index of the output stream to disconnect.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The dwOutputIndex parameter is out of range.

The specified output stream is not connected to another node.

?

If the specified output stream is connected to another node, this method breaks the connection.

ms698991 HRESULT IMFTopologyNode::DisconnectOutput([In] unsigned int dwOutputIndex) IMFTopologyNode::DisconnectOutput

Retrieves the node that is connected to a specified input stream on this node.

Zero-based index of an input stream on this node.

Receives a reference to the interface of the node that is connected to the specified input stream. The caller must release the interface.

Receives the index of the output stream that is connected to this node's input stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The index is out of range.

The specified input stream is not connected to another node.

?

ms697020 HRESULT IMFTopologyNode::GetInput([In] unsigned int dwInputIndex,[Out] IMFTopologyNode** ppUpstreamNode,[Out] unsigned int* pdwOutputIndexOnUpstreamNode) IMFTopologyNode::GetInput

Retrieves the node that is connected to a specified output stream on this node.

Zero-based index of an output stream on this node.

Receives a reference to the interface of the node that is connected to the specified output stream. The caller must release the interface.

Receives the index of the input stream that is connected to this node's output stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The index is out of range.

The specified input stream is not connected to another node.

?

bb970327 HRESULT IMFTopologyNode::GetOutput([In] unsigned int dwOutputIndex,[Out] IMFTopologyNode** ppDownstreamNode,[Out] unsigned int* pdwInputIndexOnDownstreamNode) IMFTopologyNode::GetOutput

Sets the preferred media type for an output stream on this node.

Zero-based index of the output stream.

Pointer to the interface of the media type.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

This node is an output node.

?

The preferred type is a hint for the topology loader.

Do not call this method after loading a topology or setting a topology on the Media Session. Changing the preferred type on a running topology can cause connection errors.

If no output stream exists at the specified index, the method creates new streams up to and including the specified index number.

Output nodes cannot have outputs. If this method is called on an output node, it returns E_NOTIMPL

ms701546 HRESULT IMFTopologyNode::SetOutputPrefType([In] unsigned int dwOutputIndex,[In] IMFMediaType* pType) IMFTopologyNode::SetOutputPrefType

Retrieves the preferred media type for an output stream on this node.

Zero-based index of the output stream.

Receives a reference to the interface of the media type. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_FAIL

This node does not have a preferred output type.

E_INVALIDARG

Invalid stream index.

E_NOTIMPL

This node is an output node.

?

Output nodes cannot have outputs. If this method is called on an output node, it returns E_NOTIMPL.

The preferred output type provides a hint to the topology loader. In a fully resolved topology, there is no guarantee that every topology node will have a preferred output type. To get the actual media type for a node, you must get a reference to the node's underlying object. (For more information, see enumeration.)

ms701571 HRESULT IMFTopologyNode::GetOutputPrefType([In] unsigned int dwOutputIndex,[Out] IMFMediaType** ppType) IMFTopologyNode::GetOutputPrefType

Sets the preferred media type for an input stream on this node.

Zero-based index of the input stream.

Pointer to the interface of the media type.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

This node is a source node.

?

The preferred type is a hint for the topology loader.

Do not call this method after loading a topology or setting a topology on the Media Session. Changing the preferred type on a running topology can cause connection errors.

If no input stream exists at the specified index, the method creates new streams up to and including the specified index number.

Source nodes cannot have inputs. If this method is called on a source node, it returns E_NOTIMPL.

ms696223 HRESULT IMFTopologyNode::SetInputPrefType([In] unsigned int dwInputIndex,[In] IMFMediaType* pType) IMFTopologyNode::SetInputPrefType

Retrieves the preferred media type for an input stream on this node.

Zero-based index of the input stream.

Receives a reference to the interface of the media type. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_FAIL

This node does not have a preferred input type.

E_INVALIDARG

Invalid stream index.

E_NOTIMPL

This node is a source node.

?

Source nodes cannot have inputs. If this method is called on a source node, it returns E_NOTIMPL.

The preferred input type provides a hint to the topology loader. In a fully resolved topology, there is no guarantee that every topology node will have a preferred input type. To get the actual media type for a node, you must get a reference to the node's underlying object. (For more information, see enumeration.)

ms696221 HRESULT IMFTopologyNode::GetInputPrefType([In] unsigned int dwInputIndex,[Out] IMFMediaType** ppType) IMFTopologyNode::GetInputPrefType

Copies the data from another topology node into this node.

A reference to the interface of the node to copy.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The node types do not match.

?

The two nodes must have the same node type. To get the node type, call .

This method copies the object reference, preferred types, and attributes from pNode to this node. It also copies the TOPOID that uniquely identifies each node in a topology. It does not duplicate any of the connections from pNode to other nodes.

The purpose of this method is to copy nodes from one topology to another. Do not use duplicate nodes within the same topology.

ms700790 HRESULT IMFTopologyNode::CloneFrom([In, Optional] IMFTopologyNode* pNode) IMFTopologyNode::CloneFrom

Sets the object associated with this node.

All node types support this method, but the object reference is not used by every node type.

Node typeObject reference
Source node.Not used.
Transform node. or interface.
Output node or interface.
Tee node.Not used.

?

If the object supports , IPersistStorage, or IPersistPropertyBag, the method gets the object's CLSID and sets the attribute on the node.

ms702992 SetObject SetObject HRESULT IMFTopologyNode::SetObject([In, Optional] IUnknown* pObject)

Gets the object associated with this node.

ms693569 GetObjectW GetObjectW HRESULT IMFTopologyNode::GetObjectW([Out] IUnknown** ppObject)

Retrieves the node type.

ms697514 GetNodeType GetNodeType HRESULT IMFTopologyNode::GetNodeType([Out] MF_TOPOLOGY_TYPE* pType)

Retrieves or sets the identifier of the node.

When a node is first created, it is assigned an identifier. Node identifiers are unique within a topology, but can be reused across several topologies. The topology loader uses the identifier to look up nodes in the previous topology, so that it can reuse objects from the previous topology.

To find a node in a topology by its identifier, call .

ms701602 GetTopoNodeID / SetTopoNodeID GetTopoNodeID HRESULT IMFTopologyNode::GetTopoNodeID([Out] unsigned longlong* pID)

Retrieves the number of input streams that currently exist on this node.

The input streams may or may not be connected to output streams on other nodes. To get the node that is connected to a specified input stream, call .

The and methods add new input streams as needed.

ms700165 GetInputCount GetInputCount HRESULT IMFTopologyNode::GetInputCount([Out] unsigned int* pcInputs)

Retrieves the number of output streams that currently exist on this node.

The output streams may or may not be connected to input streams on other nodes. To get the node that is connected to a specific output stream on this node, call .

The and methods add new input streams as needed.

ms704019 GetOutputCount GetOutputCount HRESULT IMFTopologyNode::GetOutputCount([Out] unsigned int* pcOutputs)

Updates the attributes of one or more nodes in the current topology.

Currently the only attribute that can be updated is the attribute. The method ignores any other attributes.

aa371868 IMFTopologyNodeAttributeEditor IMFTopologyNodeAttributeEditor
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Updates the attributes of one or more nodes in the current topology.

Reserved.

The number of elements in the pUpdates array.

Pointer to an array of structures. Each element of the array updates one attribute on a node.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Currently the only attribute that can be updated is the attribute. The method ignores any other attributes.

aa371868 HRESULT IMFTopologyNodeAttributeEditor::UpdateNodeAttributes([In] unsigned longlong TopoId,[In] unsigned int cUpdates,[In, Buffer] MFTOPONODE_ATTRIBUTE_UPDATE* pUpdates) IMFTopologyNodeAttributeEditor::UpdateNodeAttributes

Enables a custom video mixer or video presenter to get interface references from the Enhanced Video Renderer (EVR). The mixer can also use this interface to get interface references from the presenter, and the presenter can use it to get interface references from the mixer.

To use this interface, implement the interface on your custom mixer or presenter. The EVR calls with a reference to the EVR's interface.

ms702001 IMFTopologyServiceLookup IMFTopologyServiceLookup
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves an interface from the enhanced video renderer (EVR), or from the video mixer or video presenter.

Specifies the scope of the search. Currently this parameter is ignored. Use the value .

Reserved, must be zero.

Service of the requested interface.

Interface identifier of the requested interface.

Array of interface references. If the method succeeds, each member of the array contains either a valid interface reference or null. The caller must release the interface references when the EVR calls (or earlier). If the method fails, every member of the array is null.

Pointer to a value that specifies the size of the ppvObjects array. The value must be at least 1. In the current implementation, there is no reason to specify an array size larger than one element. The value is not changed on output.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

E_NOINTERFACE

The requested interface is not available.

The method was not called from inside the method. See Remarks.

The object does not support the specified service .

?

This method can be called only from inside the method. At any other time, the method returns .

The presenter can use this method to query the EVR and the mixer. The mixer can use it to query the EVR and the presenter. Which objects are queried depends on the caller and the service , as shown in the following table.

CallerService Objects queried
PresenterMR_VIDEO_RENDER_SERVICEEVR
PresenterMR_VIDEO_MIXER_SERVICEMixer
MixerMR_VIDEO_RENDER_SERVICEPresenter and EVR

?

The following interfaces are available from the EVR:

  • IMediaEventSink. This interface is documented in the DirectShow SDK documentation.

  • interface. This interface is available if the EVR has access to a clock (reference clock in DirectShow or presentation clock in Media Foundation). This interface might not be available. Presenter and mixers must be able to process data without a clock. If the interface is available, you can also get these related interfaces:

    • (Media Foundation EVR only)

The following interfaces are available from the mixer:

bb970504 HRESULT IMFTopologyServiceLookup::LookupService([In] MF_SERVICE_LOOKUP_TYPE Type,[In] unsigned int dwIndex,[In] const GUID& guidService,[In] const GUID& riid,[Out, Buffer] void** ppvObjects,[InOut] unsigned int* pnObjects) IMFTopologyServiceLookup::LookupService

Signals the object to release the interface references obtained from the enhanced video renderer (EVR).

After this method is called, any interface references obtained during the previous call to are no longer valid. The object must release them.

ms693584 IMFTopologyServiceLookupClient IMFTopologyServiceLookupClient
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Signals the mixer or presenter to query the enhanced video renderer (EVR) for interface references.

Pointer to the interface. To query the EVR for an interface, call .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The reference is guaranteed to be valid only during the call to InitServicePointers. The mixer or presenter should not store a reference to this interface after the method returns.

When the EVR calls , the mixer or presenter should release any references it obtained from the EVR.

bb970502 HRESULT IMFTopologyServiceLookupClient::InitServicePointers([In] IMFTopologyServiceLookup* pLookup) IMFTopologyServiceLookupClient::InitServicePointers

Signals the object to release the interface references obtained from the enhanced video renderer (EVR).

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

After this method is called, any interface references obtained during the previous call to are no longer valid. The object must release them.

ms693584 HRESULT IMFTopologyServiceLookupClient::ReleaseServicePointers() IMFTopologyServiceLookupClient::ReleaseServicePointers

Tracks the reference counts on a video media sample. Video samples created by the function expose this interface.

Use this interface to determine whether it is safe to delete or re-use the buffer contained in a sample. One object assigns itself as the owner of the video sample by calling SetAllocator. When all objects release their reference counts on the sample, the owner's callback method is invoked.

ms697026 IMFTrackedSample IMFTrackedSample
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the owner for the sample.

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The owner was already set. This method cannot be called twice on the sample.

?

When this method is called, the sample holds an additional reference count on itself. When every other object releases its reference counts on the sample, the sample invokes the pSampleAllocator callback method. To get a reference to the sample, call on the asynchronous result object given to the callback's method.

After the callback is invoked, the sample clears the callback. To reinstate the callback, you must call SetAllocator again.

It is safe to pass in the sample's interface reference as the state object (pUnkState) for the callback. If pUnkState points to the sample, the SetAllocator method accounts for the additional reference count on pUnkState.

ms704797 HRESULT IMFTrackedSample::SetAllocator([In] IMFAsyncCallback* pSampleAllocator,[In] IUnknown* pUnkState) IMFTrackedSample::SetAllocator

Implemented by the transcode profile object.

The transcode profile stores configuration settings that the topology builder uses to generate the transcode topology for the output file. These configuration settings are specified by the caller and include audio and video stream properties, encoder settings, and container settings that are specified by the caller.

To create the transcode profile object, call . The configured transcode profile is passed to , which creates the transcode topology with the appropriate settings.

dd369139 IMFTranscodeProfile IMFTranscodeProfile
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets audio stream configuration settings in the transcode profile.

To get a list of compatible audio media types supported by the Media Foundation transform (MFT) encoder , call . You can get the attributes that are set on the required media type and set them on the transcode profile. To set the audio attributes properly, create a new attribute store and copy the attribute store from the required media media type by calling . This makes sure that the caller does not hold the references to the media type retrieved from the encoder. For example code, see .

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd369143 HRESULT IMFTranscodeProfile::SetAudioAttributes([In, Optional] IMFAttributes* pAttrs) IMFTranscodeProfile::SetAudioAttributes

Gets the audio stream settings that are currently set in the transcode profile.

Receives a reference to the interface of the attribute store containing the current audio stream settings. Caller must release the interface reference.

If this method succeeds, it returns . Otherwise, it returns an error code.

If there are no audio attributes set in the transcode profile, the call to GetAudioAttributes succeeds and ppAttrs receives null.

To get a specific attribute value, the caller must call the appropriate method depending on the data type of the attribute, and specify the attribute name. The following topics describe the audio attributes:

  • Audio Media Types
dd369140 HRESULT IMFTranscodeProfile::GetAudioAttributes([Out, Optional] IMFAttributes** ppAttrs) IMFTranscodeProfile::GetAudioAttributes

Sets video stream configuration settings in the transcode profile.

For example code, see .

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd369145 HRESULT IMFTranscodeProfile::SetVideoAttributes([In, Optional] IMFAttributes* pAttrs) IMFTranscodeProfile::SetVideoAttributes

Gets the video stream settings that are currently set in the transcode profile.

Receives a reference to the interface of the attribute store containing the current video stream settings. Caller must release the interface reference.

If this method succeeds, it returns . Otherwise, it returns an error code.

If there are no container attributes set in the transcode profile, the GetVideoAttributes method succeeds and ppAttrs receives null.

To get a specific attribute value, the caller must call the appropriate method depending on the data type of the attribute, and specify the attribute name. The following list shows the video attributes:

  • Video Media Types
dd369142 HRESULT IMFTranscodeProfile::GetVideoAttributes([Out, Optional] IMFAttributes** ppAttrs) IMFTranscodeProfile::GetVideoAttributes

Sets container configuration settings in the transcode profile.

For example code, see .

No documentation.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd369144 HRESULT IMFTranscodeProfile::SetContainerAttributes([In, Optional] IMFAttributes* pAttrs) IMFTranscodeProfile::SetContainerAttributes

Gets the container settings that are currently set in the transcode profile.

Receives a reference to the interface of the attribute store containing the current container type for the output file. Caller must release the interface reference.

If this method succeeds, it returns . Otherwise, it returns an error code.

If there are no container attributes set in the transcode profile, the call to GetContainerAttributes succeeds and ppAttrs receives null.

To get a specific attribute value, the caller must call the appropriate method depending on the data type of the attribute. The following list shows the container attributes:

dd369141 HRESULT IMFTranscodeProfile::GetContainerAttributes([Out, Optional] IMFAttributes** ppAttrs) IMFTranscodeProfile::GetContainerAttributes

Gets or sets the audio stream settings that are currently set in the transcode profile.

If there are no audio attributes set in the transcode profile, the call to GetAudioAttributes succeeds and ppAttrs receives null.

To get a specific attribute value, the caller must call the appropriate method depending on the data type of the attribute, and specify the attribute name. The following topics describe the audio attributes:

  • Audio Media Types
dd369140 GetAudioAttributes / SetAudioAttributes GetAudioAttributes HRESULT IMFTranscodeProfile::GetAudioAttributes([Out, Optional] IMFAttributes** ppAttrs)

Gets or sets the video stream settings that are currently set in the transcode profile.

If there are no container attributes set in the transcode profile, the GetVideoAttributes method succeeds and ppAttrs receives null.

To get a specific attribute value, the caller must call the appropriate method depending on the data type of the attribute, and specify the attribute name. The following list shows the video attributes:

  • Video Media Types
dd369142 GetVideoAttributes / SetVideoAttributes GetVideoAttributes HRESULT IMFTranscodeProfile::GetVideoAttributes([Out, Optional] IMFAttributes** ppAttrs)

Gets or sets the container settings that are currently set in the transcode profile.

If there are no container attributes set in the transcode profile, the call to GetContainerAttributes succeeds and ppAttrs receives null.

To get a specific attribute value, the caller must call the appropriate method depending on the data type of the attribute. The following list shows the container attributes:

dd369141 GetContainerAttributes / SetContainerAttributes GetContainerAttributes HRESULT IMFTranscodeProfile::GetContainerAttributes([Out, Optional] IMFAttributes** ppAttrs)

Implemented by the transcode sink activation object.

The transcode sink activation object can be used to create any of the following file sinks:

  • 3GP file sink
  • MP3 file sink
  • MP4 file sink

To use this interface, perform the following steps:

  1. Call to create the transcode sink activation object.
  2. Query the activation object for the interface.
  3. Call to create a transcode profile.
  4. Set the attribute on the transcode profile. The attribute must have one of the following values:
    • MFTranscodeContainerType_3GP
    • MFTranscodeContainerType_MP3
    • MFTranscodeContainerType_MPEG4
  5. Call and to specify the video and audio formats.
  6. Call to set the transcode profile.
  7. Call one of the following methods (but not both) to specify the output file:
  8. Call on the activation object to create the media sink.
dd369146 IMFTranscodeSinkInfoProvider IMFTranscodeSinkInfoProvider
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the name of the encoded output file.

Pointer to a null-terminated string that contains the name of the output file.

If this method succeeds, it returns . Otherwise, it returns an error code.

The media sink will create a local file with the specified file name.

Alternately, you can call to specify a byte stream that will receive the transcoded data. These two methods are mutually exclusive.

dd369149 HRESULT IMFTranscodeSinkInfoProvider::SetOutputFile([In] const wchar_t* pwszFileName) IMFTranscodeSinkInfoProvider::SetOutputFile

Sets an output byte stream for the transcode media sink.

A reference to the interface of a byte-stream activation object.

If this method succeeds, it returns . Otherwise, it returns an error code.

Call this method to provide a writeable byte stream that will receive the transcoded data.

Alternatively, you can provide the name of an output file, by calling . These two methods are mutually exclusive.

The pByteStreamActivate parameter must specify an activation object that creates a writeable byte stream. Internally, the transcode media sink calls to create the byte stream, as follows:

*pByteStream = null; hr = pByteStreamActivate->ActivateObject(IID_IMFByteStream, (void**)&pByteStream);

Currently, Microsoft Media Foundation does not provide any byte-stream activation objects. To use this method, an application must provide a custom implementation of .

dd369148 HRESULT IMFTranscodeSinkInfoProvider::SetOutputByteStream([In] IMFActivate* pByteStreamActivate) IMFTranscodeSinkInfoProvider::SetOutputByteStream

Sets the transcoding profile on the transcode sink activation object.

A reference to the interface. To get a reference to this interface, call .

If this method succeeds, it returns . Otherwise, it returns an error code.

Before calling this method, initialize the profile object as follows:

  • Set the attribute to specify the container type of the output file.
  • If the output file will have a video stream, set video attributes by calling the method.
  • If the output file will have an audio stream, set audio attributes by calling the method.
dd369150 HRESULT IMFTranscodeSinkInfoProvider::SetProfile([In] IMFTranscodeProfile* pProfile) IMFTranscodeSinkInfoProvider::SetProfile

Gets the media types for the audio and video streams specified in the transcode profile.

A reference to an structure.

If the method succeeds, the method assigns references to the pAudioMediaType and pVideoMediaType members of this structure. The method might set either member to null. If either member is non-null after the method returns, the caller must release the references.

If this method succeeds, it returns . Otherwise, it returns an error code.

Before calling this method, call to set the transcode profile. The GetSinkInfo method uses the profile to create media types for the audio and video streams.

dd369147 HRESULT IMFTranscodeSinkInfoProvider::GetSinkInfo([Out] MF_TRANSCODE_SINK_INFO* pSinkInfo) IMFTranscodeSinkInfoProvider::GetSinkInfo

Sets the name of the encoded output file.

The media sink will create a local file with the specified file name.

Alternately, you can call to specify a byte stream that will receive the transcoded data. These two methods are mutually exclusive.

dd369149 SetOutputFile SetOutputFile HRESULT IMFTranscodeSinkInfoProvider::SetOutputFile([In] const wchar_t* pwszFileName)

Sets an output byte stream for the transcode media sink.

Call this method to provide a writeable byte stream that will receive the transcoded data.

Alternatively, you can provide the name of an output file, by calling . These two methods are mutually exclusive.

The pByteStreamActivate parameter must specify an activation object that creates a writeable byte stream. Internally, the transcode media sink calls to create the byte stream, as follows:

*pByteStream = null; hr = pByteStreamActivate->ActivateObject(IID_IMFByteStream, (void**)&pByteStream);

Currently, Microsoft Media Foundation does not provide any byte-stream activation objects. To use this method, an application must provide a custom implementation of .

dd369148 SetOutputByteStream SetOutputByteStream HRESULT IMFTranscodeSinkInfoProvider::SetOutputByteStream([In] IMFActivate* pByteStreamActivate)

Sets the transcoding profile on the transcode sink activation object.

Before calling this method, initialize the profile object as follows:

  • Set the attribute to specify the container type of the output file.
  • If the output file will have a video stream, set video attributes by calling the method.
  • If the output file will have an audio stream, set audio attributes by calling the method.
dd369150 SetProfile SetProfile HRESULT IMFTranscodeSinkInfoProvider::SetProfile([In] IMFTranscodeProfile* pProfile)

Gets the media types for the audio and video streams specified in the transcode profile.

Before calling this method, call to set the transcode profile. The GetSinkInfo method uses the profile to create media types for the audio and video streams.

dd369147 GetSinkInfo GetSinkInfo HRESULT IMFTranscodeSinkInfoProvider::GetSinkInfo([Out] MF_TRANSCODE_SINK_INFO* pSinkInfo)

Implemented by all Media Foundation Transforms (MFTs).

ms696260 IMFTransform IMFTransform
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the minimum and maximum number of input and output streams for this Media Foundation transform (MFT).

Receives the minimum number of input streams.

Receives the maximum number of input streams. If there is no maximum, receives the value MFT_STREAMS_UNLIMITED.

Receives the minimum number of output streams.

Receives the maximum number of output streams. If there is no maximum, receives the value MFT_STREAMS_UNLIMITED.

If this method succeeds, it returns . Otherwise, it returns an error code.

If the MFT has a fixed number of streams, the minimum and maximum values are the same.

It is not recommended to create an MFT that supports zero inputs or zero outputs. An MFT with no inputs or no outputs may not be compatible with the rest of the Media Foundation pipeline. You should create a Media Foundation sink or source for this purpose instead.

When an MFT is first created, it is not guaranteed to have the minimum number of streams. To find the actual number of streams, call .

This method should not be called with null parameters, although in practice some implementations may allow null parameters.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetStreamLimits. See Creating Hybrid DMO/MFT Objects.

ms697040 HRESULT IMFTransform::GetStreamLimits([Out] unsigned int* pdwInputMinimum,[Out] unsigned int* pdwInputMaximum,[Out] unsigned int* pdwOutputMinimum,[Out] unsigned int* pdwOutputMaximum) IMFTransform::GetStreamLimits

Gets the current number of input and output streams on this Media Foundation transform (MFT).

Receives the number of input streams.

Receives the number of output streams.

If this method succeeds, it returns . Otherwise, it returns an error code.

The number of streams includes unselected streams?that is, streams with no media type or a null media type.

This method should not be called with null parameters, although in practice some implementations may allow null parameters.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetStreamCount. See Creating Hybrid DMO/MFT Objects.

ms697018 HRESULT IMFTransform::GetStreamCount([Out] unsigned int* pcInputStreams,[Out] unsigned int* pcOutputStreams) IMFTransform::GetStreamCount

Gets the stream identifiers for the input and output streams on this Media Foundation transform (MFT).

Number of elements in the pdwInputIDs array.

Pointer to an array allocated by the caller. The method fills the array with the input stream identifiers. The array size must be at least equal to the number of input streams. To get the number of input streams, call .

If the caller passes an array that is larger than the number of input streams, the MFT must not write values into the extra array entries.

Number of elements in the pdwOutputIDs array.

Pointer to an array allocated by the caller. The method fills the array with the output stream identifiers. The array size must be at least equal to the number of output streams. To get the number of output streams, call GetStreamCount.

If the caller passes an array that is larger than the number of output streams, the MFT must not write values into the extra array entries.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

Not implemented. See Remarks.

One or both of the arrays is too small.

?

Stream identifiers are necessary because some MFTs can add or remove streams, so the index of a stream may not be unique. Therefore, methods that operate on streams take stream identifiers.

This method can return E_NOTIMPL if both of the following conditions are true:

  • The transform has a fixed number of streams.
  • The streams are numbered consecutively from 0 to n ? 1, where n is the number of input streams or output streams. In other words, the first input stream is 0, the second is 1, and so on; and the first output stream is 0, the second is 1, and so on.

This method must be implemented if any of the following conditions is true:

  • The MFT can add or remove output streams.
  • The MFT allows the client to add or remove input streams.
  • The stream identifiers are not consecutive.

All input stream identifiers must be unique within an MFT, and all output stream identifiers must be unique. However, an input stream and an output stream can share the same identifier.

If the client adds an input stream, the client assigns the identifier, so the MFT must allow arbitrary identifiers, as long as they are unique. If the MFT creates an output stream, the MFT assigns the identifier.

By convention, if an MFT has exactly one fixed input stream and one fixed output stream, it should assign the identifier 0 to both streams.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetStreamIDs. See Creating Hybrid DMO/MFT Objects.

ms693988 HRESULT IMFTransform::GetStreamIDs([In] unsigned int dwInputIDArraySize,[Out, Buffer] unsigned int* pdwInputIDs,[In] unsigned int dwOutputIDArraySize,[Out, Buffer] unsigned int* pdwOutputIDs) IMFTransform::GetStreamIDs

Gets the buffer requirements and other information for an input stream on this Media Foundation transform (MFT).

Input stream identifier. To get the list of stream identifiers, call .

Pointer to an structure. The method fills the structure with information about the input stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream identifier.

?

It is valid to call this method before setting the media types.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetInputStreamInfo. See Creating Hybrid DMO/MFT Objects.

ms703894 HRESULT IMFTransform::GetInputStreamInfo([In] unsigned int dwInputStreamID,[Out] MFT_INPUT_STREAM_INFO* pStreamInfo) IMFTransform::GetInputStreamInfo

Gets the buffer requirements and other information for an output stream on this Media Foundation transform (MFT).

Output stream identifier. To get the list of stream identifiers, call .

Pointer to an structure. The method fills the structure with information about the output stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream number.

?

It is valid to call this method before setting the media types.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetOutputStreamInfo. See Creating Hybrid DMO/MFT Objects.

ms693880 HRESULT IMFTransform::GetOutputStreamInfo([In] unsigned int dwOutputStreamID,[Out] MFT_OUTPUT_STREAM_INFO* pStreamInfo) IMFTransform::GetOutputStreamInfo

Gets the global attribute store for this Media Foundation transform (MFT).

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

The MFT does not support attributes.

?

Use the reference retrieved by this method to get or set attributes that apply to the entire MFT. To get the attribute store for an input stream, call . To get the attribute store for an output stream, call .

Implementation of this method is optional unless the MFT needs to support a particular set of attributes. Exception: Hardware-based MFTs must implement this method. See Hardware MFTs.

ms703141 HRESULT IMFTransform::GetAttributes([Out] IMFAttributes** pAttributes) IMFTransform::GetAttributes

Gets the attribute store for an input stream on this Media Foundation transform (MFT).

Input stream identifier. To get the list of stream identifiers, call .

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

The MFT does not support input stream attributes.

Invalid stream identifier.

?

Implementation of this method is optional unless the MFT needs to support a particular set of attributes.

To get the attribute store for the entire MFT, call .

ms695366 HRESULT IMFTransform::GetInputStreamAttributes([In] unsigned int dwInputStreamID,[Out] IMFAttributes** pAttributes) IMFTransform::GetInputStreamAttributes

Gets the attribute store for an output stream on this Media Foundation transform (MFT).

Output stream identifier. To get the list of stream identifiers, call .

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

The MFT does not support output stream attributes.

Invalid stream identifier.

?

Implementation of this method is optional unless the MFT needs to support a particular set of attributes.

To get the attribute store for the entire MFT, call .

ms703886 HRESULT IMFTransform::GetOutputStreamAttributes([In] unsigned int dwOutputStreamID,[Out] IMFAttributes** pAttributes) IMFTransform::GetOutputStreamAttributes

Removes an input stream from this Media Foundation transform (MFT).

Identifier of the input stream to remove.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

The transform has a fixed number of input streams.

The stream is not removable, or the transform currently has the minimum number of input streams it can support.

Invalid stream identifier.

The transform has unprocessed input buffers for the specified stream.

?

If the transform has a fixed number of input streams, the method returns E_NOTIMPL.

An MFT might support this method but not allow certain input streams to be removed. If an input stream can be removed, the method returns the flag for that stream. Otherwise, the stream cannot be removed, and the method returns . The method also fails if the MFT currently has the minimum number of input streams that it requires. To find the minimum number of streams, call .

If the transform still has unprocessed input for that stream, the method might succeed or it might return . If the method succeeds, the MFT will continue to process the remaining input after the stream is removed. If the method returns , you must clear the input buffers before removing the stream. To clear the input buffers, either call or else call with the to flush the MFT. Then call the DeleteInputStream again. An MFT should never discard input buffers when DeleteInputStream is called.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTDeleteInputStream. See Creating Hybrid DMO/MFT Objects.

ms703159 HRESULT IMFTransform::DeleteInputStream([In] unsigned int dwStreamID) IMFTransform::DeleteInputStream

Adds one or more new input streams to this Media Foundation transform (MFT).

Number of streams to add.

Array of stream identifiers. The new stream identifiers must not match any existing input streams.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

E_NOTIMPL

The MFT has a fixed number of input streams.

?

If the new streams exceed the maximum number of input streams for this transform, the method returns E_INVALIDARG. To find the maximum number of input streams, call .

If any of the new stream identifiers conflicts with an existing input stream, the method returns E_INVALIDARG.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTAddInputStreams. See Creating Hybrid DMO/MFT Objects.

ms696211 HRESULT IMFTransform::AddInputStreams([In] unsigned int cStreams,[In] unsigned int* adwStreamIDs) IMFTransform::AddInputStreams

Gets an available media type for an input stream on this Media Foundation transform (MFT).

Input stream identifier. To get the list of stream identifiers, call .

Index of the media type to retrieve. Media types are indexed from zero and returned in approximate order of preference.

Receives a reference to the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

The MFT does not have a list of available input types.

Invalid stream identifier.

The dwTypeIndex parameter is out of range.

You must set the output types before setting the input types.

?

The MFT defines a list of available media types for each input stream and orders them by preference. This method enumerates the available media types for an input stream. To enumerate the available types, increment dwTypeIndex until the method returns .

Setting the media type on one stream might change the available types for another stream, or change the preference order. However, an MFT is not required to update the list of available types dynamically. The only guaranteed way to test whether you can set a particular input type is to call .

In some cases, an MFT cannot return a list of input types until one or more output types are set. If so, the method returns .

An MFT is not required to implement this method. However, most MFTs should implement this method, unless the supported types are simple and can be discovered through the function.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetInputAvailableType. See Creating Hybrid DMO/MFT Objects.

For encoders, after the output type is set, GetInputAvailableType must return a list of input types that are compatible with the current output type. This means that all types returned by GetInputAvailableType after the output type is set must be valid types for SetInputType.

Encoders should reject input types if the attributes of the input media type and output media type do not match, such as resolution setting with , nominal range setting with , or frame rate setting with

ms704814 HRESULT IMFTransform::GetInputAvailableType([In] unsigned int dwInputStreamID,[In] unsigned int dwTypeIndex,[Out] IMFMediaType** ppType) IMFTransform::GetInputAvailableType

Gets an available media type for an output stream on this Media Foundation transform (MFT).

Output stream identifier. To get the list of stream identifiers, call .

Index of the media type to retrieve. Media types are indexed from zero and returned in approximate order of preference.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

The MFT does not have a list of available output types.

Invalid stream identifier.

The dwTypeIndex parameter is out of range.

You must set the input types before setting the output types.

?

The MFT defines a list of available media types for each output stream and orders them by preference. This method enumerates the available media types for an output stream. To enumerate the available types, increment dwTypeIndex until the method returns MF_E_NO_MORE_TYPES.

Setting the media type on one stream can change the available types for another stream (or change the preference order). However, an MFT is not required to update the list of available types dynamically. The only guaranteed way to test whether you can set a particular input type is to call .

In some cases, an MFT cannot return a list of output types until one or more input types are set. If so, the method returns .

An MFT is not required to implement this method. However, most MFTs should implement this method, unless the supported types are simple and can be discovered through the function.

This method can return a partial media type. A partial media type contains an incomplete description of a format, and is used to provide a hint to the caller. For example, a partial type might include just the major type and subtype GUIDs. However, after the client sets the input types on the MFT, the MFT should generally return at least one complete output type, which can be used without further modification. For more information, see Complete and Partial Media Types.

Some MFTs cannot provide an accurate list of output types until the MFT receives the first input sample. For example, the MFT might need to read the first packet header to deduce the format. An MFT should handle this situation as follows:

  1. Before the MFT receives any input, it offers a list of one or more output types that it could possibly produce. For example, an MPEG-2 decoder might return a media type that describes the MPEG-2 main profile/main level.
  2. The client selects one of these types (generally the first) and sets it on the output stream.
  3. The client delivers the first input sample by calling .
  4. If the output type does not conform to the input data, the transform signals a format change in the ProcessOutput method. For more information about format changes, see .
  5. The calls GetOutputAvailableType again. At this point, the method should return an updated list of types that reflects the input data.
  6. The client selects a new output type from this list and calls SetOutputType.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetOutputAvailableType. See Creating Hybrid DMO/MFT Objects.

ms703812 HRESULT IMFTransform::GetOutputAvailableType([In] unsigned int dwOutputStreamID,[In] unsigned int dwTypeIndex,[Out] IMFMediaType** ppType) IMFTransform::GetOutputAvailableType

Sets, tests, or clears the media type for an input stream on this Media Foundation transform (MFT).

Input stream identifier. To get the list of stream identifiers, call .

Pointer to the interface, or null.

Zero or more flags from the _MFT_SET_TYPE_FLAGS enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The MFT cannot use the proposed media type.

Invalid stream identifier.

The proposed type is not valid. This error code indicates that the media type itself is not configured correctly; for example, it might contain mutually contradictory attributes.

The MFT cannot switch types while processing data. Try draining or flushing the MFT.

You must set the output types before setting the input types.

The MFT could not find a suitable DirectX Video Acceleration (DXVA) configuration.

?

This method can be used to set, test without setting, or clear the media type:

  • To set the media type, set dwFlags to zero and set pType to a non-null reference that specifies the media type.
  • To test the media type without setting it, set dwFlags to and set pType to a non-null reference that specifies the media type. If the media type is acceptable, the method return . Otherwise, it returns . Regardless of the return value, the current media type does not change.
  • To clear the media type, set pType to null.

Setting the media type on one stream may change the acceptable types on another stream.

An MFT may require the caller to set one or more output types before setting the input type. If so, the method returns .

If the MFT supports DirectX Video Acceleration (DXVA) but is unable to find a suitable DXVA configuration (for example, if the graphics driver does not have the right capabilities), the method should return . For more information, see Supporting DXVA 2.0 in Media Foundation.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTSetInputType. See Creating Hybrid DMO/MFT Objects.

ms700113 HRESULT IMFTransform::SetInputType([In] unsigned int dwInputStreamID,[In, Optional] IMFMediaType* pType,[In] unsigned int dwFlags) IMFTransform::SetInputType

Sets, tests, or clears the media type for an output stream on this Media Foundation transform (MFT).

Output stream identifier. To get the list of stream identifiers, call .

Pointer to the interface, or null.

Zero or more flags from the _MFT_SET_TYPE_FLAGS enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The transform cannot use the proposed media type.

Invalid stream identifier.

The proposed type is not valid. This error code indicates that the media type itself is not configured correctly; for example, it might contain mutually contradictory flags.

The MFT cannot switch types while processing data. Try draining or flushing the MFT.

You must set the input types before setting the output types.

The MFT could not find a suitable DirectX Video Acceleration (DXVA) configuration.

?

This method can be used to set, test without setting, or clear the media type:

  • To set the media type, set dwFlags to zero and set pType to a non-null reference that specifies the media type.
  • To test the media type without setting it, set dwFlags to and set pType to a non-null reference that specifies the media type. If the media type is acceptable, the method return . Otherwise, it returns . Regardless of the return value, the current media type does not change.
  • To clear the media type, set pType to null.

Setting the media type on one stream may change the acceptable types on another stream.

An MFT may require the caller to set one or more input types before setting the output type. If so, the method returns .

If the MFT supports DirectX Video Acceleration (DXVA) but is unable to find a suitable DXVA configuration (for example, if the graphics driver does not have the right capabilities), the method should return . For more information, see Supporting DXVA 2.0 in Media Foundation.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTSetOutputType. See Creating Hybrid DMO/MFT Objects.

ms702016 HRESULT IMFTransform::SetOutputType([In] unsigned int dwOutputStreamID,[In, Optional] IMFMediaType* pType,[In] unsigned int dwFlags) IMFTransform::SetOutputType

Gets the current media type for an input stream on this Media Foundation transform (MFT).

Input stream identifier. To get the list of stream identifiers, call .

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream identifier.

The input media type has not been set.

?

If the specified input stream does not yet have a media type, the method returns . Most MFTs do not set any default media types when first created. Instead, the client must set the media type by calling .

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetInputCurrentType. See Creating Hybrid DMO/MFT Objects.

ms705607 HRESULT IMFTransform::GetInputCurrentType([In] unsigned int dwInputStreamID,[Out] IMFMediaType** ppType) IMFTransform::GetInputCurrentType

Gets the current media type for an output stream on this Media Foundation transform (MFT).

Output stream identifier. To get the list of stream identifiers, call .

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream identifier.

The output media type has not been set.

?

If the specified output stream does not yet have a media type, the method returns . Most MFTs do not set any default media types when first created. Instead, the client must set the media type by calling .

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetOutputCurrentType. See Creating Hybrid DMO/MFT Objects.

ms696985 HRESULT IMFTransform::GetOutputCurrentType([In] unsigned int dwOutputStreamID,[Out] IMFMediaType** ppType) IMFTransform::GetOutputCurrentType

Queries whether an input stream on this Media Foundation transform (MFT) can accept more data.

Input stream identifier. To get the list of stream identifiers, call .

Receives a member of the _MFT_INPUT_STATUS_FLAGS enumeration, or zero. If the value is , the stream specified in dwInputStreamID can accept more input data.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream identifier.

The media type is not set on one or more streams.

?

If the method returns the flag, you can deliver an input sample to the specified stream by calling . If the method succeeds but does not return any flags in the pdwFlags parameter, it means the input stream already has as much data as it can accept.

Use this method to test whether the input stream is ready to accept more data, without incurring the overhead of allocating a new sample and calling ProcessInput.

After the client has set valid media types on all of the streams, the MFT should always be in one of two states: Able to accept more input, or able to produce more output (or both).

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetInputStatus. See Creating Hybrid DMO/MFT Objects.

ms697478 HRESULT IMFTransform::GetInputStatus([In] unsigned int dwInputStreamID,[Out] unsigned int* pdwFlags) IMFTransform::GetInputStatus

Queries whether the Media Foundation transform (MFT) is ready to produce output data.

Receives a member of the _MFT_OUTPUT_STATUS_FLAGS enumeration, or zero. If the value is , the MFT can produce an output sample.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

Not implemented.

The media type is not set on one or more streams.

?

If the method returns the flag, it means you can generate one or more output samples by calling .

MFTs are not required to implement this method. If the method returns E_NOTIMPL, you must call ProcessOutput to determine whether the transform has output data.

If the MFT has more than one output stream, but it does not produce samples at the same time for each stream, it can set the flag when just one stream is ready. However, if the MFT normally produces samples at the same time for each output stream, it should not set this flag until all streams are ready.

After the client has set valid media types on all of the streams, the MFT should always be in one of two states: Able to accept more input, or able to produce more output.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetOutputStatus. See Creating Hybrid DMO/MFT Objects.

ms696269 HRESULT IMFTransform::GetOutputStatus([Out] unsigned int* pdwFlags) IMFTransform::GetOutputStatus

Sets the range of time stamps the client needs for output.

Specifies the earliest time stamp. The Media Foundation transform (MFT) will accept input until it can produce an output sample that begins at this time; or until it can produce a sample that ends at this time or later. If there is no lower bound, use the value MFT_OUTPUT_BOUND_LOWER_UNBOUNDED.

Specifies the latest time stamp. The MFT will not produce an output sample with time stamps later than this time. If there is no upper bound, use the value MFT_OUTPUT_BOUND_UPPER_UNBOUNDED.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

Not implemented.

The media type is not set on one or more streams.

?

This method can be used to optimize preroll, especially in formats that have gaps between time stamps, or formats where the data must start on a sync point, such as MPEG-2. Calling this method is optional, and implementation of this method by an MFT is optional. If the MFT does not implement the method, the return value is E_NOTIMPL.

If an MFT implements this method, it must limit its output data to the range of times specified by hnsLowerBound and hnsUpperBound. The MFT discards any input data that is not needed to produce output within this range. If the sample boundaries do not exactly match the range, the MFT should split the output samples, if possible. Otherwise, the output samples can overlap the range.

For example, suppose the output range is 100 to 150 milliseconds (ms), and the output format is video with each frame lasting 33 ms. A sample with a time stamp of 67 ms overlaps the range (67 + 33 = 100) and is produced as output. A sample with a time stamp of 66 ms is discarded (66 + 33 = 99). Similarly, a sample with a time stamp of 150 ms is produced as output, but a sample with a time stamp of 151 is discarded.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTSetOutputBounds. See Creating Hybrid DMO/MFT Objects.

ms693812 HRESULT IMFTransform::SetOutputBounds([In] longlong hnsLowerBound,[In] longlong hnsUpperBound) IMFTransform::SetOutputBounds

Sends an event to an input stream on this Media Foundation transform (MFT).

Input stream identifier. To get the list of stream identifiers, call .

Pointer to the interface of an event object.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOTIMPL

Not implemented.

Invalid stream number.

The media type is not set on one or more streams.

MF_S_TRANSFORM_DO_NOT_PROPAGATE_EVENT

The pipeline should not propagate the event.

?

An MFT can handle sending the event downstream, or it can let the pipeline do this, as indicated by the return value:

  • E_NOTIMPL: The MFT ignores all events, and the pipeline should send all events downstream. After the pipeline receives this return value, it might not call ProcessEvent again.
  • : The MFT has examined this event, but the pipeline should send the event downstream. Internally, the MFT might respond to the event in some way, or it might ignore the event.
  • MF_S_TRANSFORM_DO_NOT_PROPAGATE_EVENT: The pipeline should not propagate this event downstream. Either the MFT will send the event downstream, or else the MFT will consume the event and not send it downstream. The MFT should only consume the event if the event should stop at this MFT and not travel any further downstream. But in most cases, the event should travel downstream.

To send the event downstream, the MFT adds the event to the collection object that is provided by the client in the pEvents member of the structure, when the client calls .

Events must be serialized with the samples that come before and after them. Attach the event to the output sample that follows the event. (The pipeline will process the event first, and then the sample.) If an MFT holds back one or more samples between calls to and ProcessOutput, the MFT should handle sending all events downstream, because in this situation the pipeline cannot correlate input samples with output samples.

If an MFT does not hold back samples and does not need to examine any events, it can return E_NOTIMPL.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTProcessEvent. See Creating Hybrid DMO/MFT Objects.

ms695394 HRESULT IMFTransform::ProcessEvent([In] unsigned int dwInputStreamID,[In, Optional] IMFMediaEvent* pEvent) IMFTransform::ProcessEvent

Sends a message to the Media Foundation transform (MFT).

The message to send, specified as a member of the enumeration.

Message parameter. The meaning of this parameter depends on the message type.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream number. Applies to the message.

The media type is not set on one or more streams.

?

Before calling this method, set the media types on all input and output streams.

The MFT might ignore certain message types. If so, the method returns . An error code indicates that the transform handles this message type but was unable to process the message in this instance.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTProcessMessage. See Creating Hybrid DMO/MFT Objects.

ms701863 HRESULT IMFTransform::ProcessMessage([In] MFT_MESSAGE_TYPE eMessage,[In] ULONG_PTR ulParam) IMFTransform::ProcessMessage

Delivers data to an input stream on this Media Foundation transform (MFT).

Input stream identifier. To get the list of stream identifiers, call .

Pointer to the interface of the input sample. The sample must contain at least one media buffer that contains valid input data.

Reserved. Must be zero.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument.

Invalid stream identifier.

The input sample requires a valid sample duration. To set the duration, call .

Some MFTs require that input samples have valid durations. Some MFTs do not require sample durations.

The input sample requires a time stamp. To set the time stamp, call .

Some MFTs require that input samples have valid time stamps. Some MFTs do not require time stamps.

The transform cannot process more input at this time.

The media type is not set on one or more streams.

The media type is not supported for DirectX Video Acceleration (DXVA). A DXVA-enabled decoder might return this error code.

?

Note??If you are converting a DirectX Media Object (DMO) to an MFT, be aware that S_FALSE is not a valid return code for , unlike the method.

In most cases, if the method succeeds, the MFT stores the sample and holds a reference count on the reference. Do not re-use the sample until the MFT releases the sample. Instead of storing the sample, however, an MFT might copy the sample data into a new buffer. In that case, the MFT should set the flag in the method.

If the MFT already has enough input data to produce an output sample, it does not accept new input data, and ProcessInput returns . At that point, the client should clear the pending input data by doing one of the following:

  • Generate new output by calling .
  • Flush the input data by calling with the MFT_MESSAGE_COMMAND_FLUSH message.

An exception to this rule is the flag. When this flag is present, the transform will discard stored samples if you give it more input. For more information, see . A transform should never queue any more input data than is required to produce the correct output.

An MFT can process the input data in the ProcessInput method. However, most MFTs wait until the client calls ProcessOutput.

After the client has set valid media types on all of the streams, the MFT should always be in one of two states: Able to accept more input, or able to produce more output. It should never be in both states or neither state. An MFT should only accept as much input as it needs to generate at least one output sample, at which point ProcessInput returns . When ProcessInput returns , the client can assume that the MFT is ready to produce output.

If an MFT encounters a non-fatal error in the input data, it can simply drop the data and attempt to recover when it gets the more input data. To request more input data, the MFT returns from the method. If the MFT drops any data, it should set the attribute attribute on the next output sample, to notify the caller that there is a gap in the data stream.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTProcessInput. See Creating Hybrid DMO/MFT Objects.

ms703131 HRESULT IMFTransform::ProcessInput([In] unsigned int dwInputStreamID,[In] IMFSample* pSample,[In] unsigned int dwFlags) IMFTransform::ProcessInput

Generates output from the current input data.

Bitwise OR of zero or more flags from the _MFT_PROCESS_OUTPUT_FLAGS enumeration.

Number of elements in the pOutputSamples array. The value must be at least 1.

Pointer to an array of structures, allocated by the caller. The MFT uses this array to return output data to the caller.

Receives a bitwise OR of zero or more flags from the _MFT_PROCESS_OUTPUT_STATUS enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_UNEXPECTED

The ProcessOutput method was called on an asynchronous MFT that was not expecting this method call.

Invalid stream identifier in the dwStreamID member of one or more structures.

The transform cannot produce output data until it receives more input data.

The format has changed on an output stream, or there is a new preferred format, or there is a new output stream.

You must set the media type on one or more streams of the MFT.

?

Note??If you are converting a DirectX Media Object (DMO) to an MFT, be aware that S_FALSE is not a valid return code for , unlike the method.

The size of the pOutputSamples array must be equal to or greater than the number of selected output streams. The number of selected output streams equals the total number of output streams minus the number of deselected streams. A stream is deselected if it has the flag and the caller does not set a media type (or sets the media type to null). For more information, see _MFT_OUTPUT_STREAM_INFO_FLAGS enumeration.

This method generates output samples and can also generate events. If the method succeeds, at least one of the following conditions is true:

  • One or more samples in the pOutputSamples array contains output data.
  • One or more members of the pOutputSamples array contains a non-empty collection of events.

If MFT_UNIQUE_METHOD_NAMES is defined before including Mftransform.h, this method is renamed MFTProcessOutput. See Creating Hybrid DMO/MFT Objects.

ms704014 HRESULT IMFTransform::ProcessOutput([In] _MFT_PROCESS_OUTPUT_FLAGS dwFlags,[In] unsigned int cOutputBufferCount,[In] MFT_OUTPUT_DATA_BUFFER* pOutputSamples,[Out] _MFT_PROCESS_OUTPUT_STATUS* pdwStatus) IMFTransform::ProcessOutput
Initializes a new instance of the class. Guid of the Media Foundation Transform. Gets the stream identifiers for the input and output streams on this Media Foundation transform (MFT). An array allocated by the caller. The method fills the array with the input stream identifiers. The array size must be at least equal to the number of input streams. To get the number of input streams, call .If the caller passes an array that is larger than the number of input streams, the MFT must not write values into the extra array entries. An array allocated by the caller. The method fills the array with the output stream identifiers. The array size must be at least equal to the number of output streams. To get the number of output streams, call .If the caller passes an array that is larger than the number of output streams, the MFT must not write values into the extra array entries. true if Both streams IDs for input and output are valid, false otherwise ms693988 HRESULT IMFTransform::GetStreamIDs([In] unsigned int dwInputIDArraySize,[Out, Buffer] unsigned int* pdwInputIDs,[In] unsigned int dwOutputIDArraySize,[Out, Buffer] unsigned int* pdwOutputIDs) IMFTransform::GetStreamIDs Gets an available media type for an output stream on this Media Foundation transform (MFT). Output stream identifier. To get the list of stream identifiers, call . Index of the media type to retrieve. Media types are indexed from zero and returned in approximate order of preference. Receives a pointer to the interface. The caller must release the interface. true if A media type for an output stream is available, false otherwise ms703812 HRESULT IMFTransform::GetOutputAvailableType([In] unsigned int dwOutputStreamID,[In] unsigned int dwTypeIndex,[Out] IMFMediaType** ppType) IMFTransform::GetOutputAvailableType Generates output from the current input data. Bitwise OR of zero or more flags from the enumeration. Pointer to an array of structures, allocated by the caller. The MFT uses this array to return output data to the caller. Receives a bitwise OR of zero or more flags from the enumeration. true if the transform cannot produce output data until it receives more input data, false otherwise ms704014 HRESULT IMFTransform::ProcessOutput([In] _MFT_PROCESS_OUTPUT_FLAGS dwFlags,[In] unsigned int cOutputBufferCount,[In] MFT_OUTPUT_DATA_BUFFER* pOutputSamples,[Out] _MFT_PROCESS_OUTPUT_STATUS* pdwStatus) IMFTransform::ProcessOutput

Gets the global attribute store for this Media Foundation transform (MFT).

Use the reference retrieved by this method to get or set attributes that apply to the entire MFT. To get the attribute store for an input stream, call . To get the attribute store for an output stream, call .

Implementation of this method is optional unless the MFT needs to support a particular set of attributes. Exception: Hardware-based MFTs must implement this method. See Hardware MFTs.

ms703141 GetAttributes GetAttributes HRESULT IMFTransform::GetAttributes([Out] IMFAttributes** pAttributes)

Queries whether the Media Foundation transform (MFT) is ready to produce output data.

If the method returns the flag, it means you can generate one or more output samples by calling .

MFTs are not required to implement this method. If the method returns E_NOTIMPL, you must call ProcessOutput to determine whether the transform has output data.

If the MFT has more than one output stream, but it does not produce samples at the same time for each stream, it can set the flag when just one stream is ready. However, if the MFT normally produces samples at the same time for each output stream, it should not set this flag until all streams are ready.

After the client has set valid media types on all of the streams, the MFT should always be in one of two states: Able to accept more input, or able to produce more output.

If MFT_UNIQUE_METHOD_NAMES is defined before including mftransform.h, this method is renamed MFTGetOutputStatus. See Creating Hybrid DMO/MFT Objects.

ms696269 GetOutputStatus GetOutputStatus HRESULT IMFTransform::GetOutputStatus([Out] unsigned int* pdwFlags)

Implemented by components that provide input trust authorities (ITAs). This interface is used to get the ITA for each of the component's streams.

ms697279 IMFTrustedInput IMFTrustedInput
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the input trust authority (ITA) for a specified stream.

The stream identifier for which the ITA is being requested.

The interface identifier (IID) of the interface being requested. Currently the only supported value is IID_IMFInputTrustAuthority.

Receives a reference to the ITA's interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_NOINTERFACE

The ITA does not expose the requested interface.

?

bb970501 HRESULT IMFTrustedInput::GetInputTrustAuthority([In] unsigned int dwStreamID,[In] const GUID& riid,[Out] IUnknown** ppunkObject) IMFTrustedInput::GetInputTrustAuthority

Implemented by components that provide output trust authorities (OTAs). Any Media Foundation transform (MFT) or media sink that is designed to work within the protected media path (PMP) and also sends protected content outside the Media Foundation pipeline must implement this interface.

The policy engine uses this interface to negotiate what type of content protection should be applied to the content. Applications do not use this interface directly.

If an MFT supports , it must expose the interface through QueryInterface. The interface applies to all of the input streams on the MFT. (There is no mechanism to return a separate reference for each stream.) The MFT must apply the output policies to all of its input streams. If the MFT sends different streams to separate connectors, it must report all of the connector attributes.

ms694305 IMFTrustedOutput IMFTrustedOutput
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the number of output trust authorities (OTAs) provided by this trusted output. Each OTA reports a single action.

Receives the number of OTAs.

If this method succeeds, it returns . Otherwise, it returns an error code.

bb970384 HRESULT IMFTrustedOutput::GetOutputTrustAuthorityCount([Out] unsigned int* pcOutputTrustAuthorities) IMFTrustedOutput::GetOutputTrustAuthorityCount

Gets an output trust authority (OTA), specified by index.

Zero-based index of the OTA to retrieve. To get the number of OTAs provided by this object, call .

Receives a reference to the interface of the OTA. The caller must release the interface.

If this method succeeds, it returns . Otherwise, it returns an error code.

bb970401 HRESULT IMFTrustedOutput::GetOutputTrustAuthorityByIndex([In] unsigned int dwIndex,[Out] IMFOutputTrustAuthority** ppauthority) IMFTrustedOutput::GetOutputTrustAuthorityByIndex

Queries whether this output is a policy sink, meaning it handles the rights and restrictions required by the input trust authority (ITA).

Receives a Boolean value. If TRUE, this object is a policy sink. If , the policy must be enforced further downstream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

A trusted output is generally considered to be a policy sink if it does not pass the media content that it receives anywhere else; or, if it does pass the media content elsewhere, either it protects the content using some proprietary method such as encryption, or it sufficiently devalues the content so as not to require protection.

bb970324 HRESULT IMFTrustedOutput::IsFinal([Out] BOOL* pfIsFinal) IMFTrustedOutput::IsFinal

Gets the number of output trust authorities (OTAs) provided by this trusted output. Each OTA reports a single action.

bb970384 GetOutputTrustAuthorityCount GetOutputTrustAuthorityCount HRESULT IMFTrustedOutput::GetOutputTrustAuthorityCount([Out] unsigned int* pcOutputTrustAuthorities)

Queries whether this output is a policy sink, meaning it handles the rights and restrictions required by the input trust authority (ITA).

A trusted output is generally considered to be a policy sink if it does not pass the media content that it receives anywhere else; or, if it does pass the media content elsewhere, either it protects the content using some proprietary method such as encryption, or it sufficiently devalues the content so as not to require protection.

bb970324 IsFinal IsFinal HRESULT IMFTrustedOutput::IsFinal([Out] BOOL* pfIsFinal)

Enables a plug-in component for the enhanced video renderer (EVR) to work with protected media.

To work in the protected media path (PMP), a custom EVR mixer or presenter must implement this interface. The EVR obtains a reference to this interface by calling QueryInterface on the plug-in component.

This interface is required only if the plug-in is a trusted component, designed to work in the PMP. It is not required for playing clear content in an unprotected process.

aa473784 IEVRTrustedVideoPlugin IEVRTrustedVideoPlugin
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Queries whether the plug-in has any transient vulnerabilities at this time.

Receives a Boolean value. If TRUE, the plug-in has no transient vulnerabilities at the moment and can receive protected content. If , the plug-in has a transient vulnerability. If the method fails, the EVR treats the value as (untrusted).

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method provides a way for the plug-in to report temporary conditions that would cause the input trust authority (ITA) to distrust the plug-in. For example, if an EVR presenter is in windowed mode, it is vulnerable to GDI screen captures.

To disable screen capture in Direct3D, the plug-in must do the following:

  • Create the Direct3D device in full-screen exlusive mode.

  • Specify the flag when you create the device. For more information, see in the DirectX documentation.

In addition, the graphics adapter must support the Windows Vista Display Driver Model (WDDM) and the Direct3D extensions for Windows Vista (sometimes called D3D9Ex or D3D9L).

If these conditions are met, the presenter can return TRUE in the pYes parameter. Otherwise, it should return .

The EVR calls this method whenever the device changes. If the plug-in returns , the EVR treats this condition as if the plug-in had a new output connector of unknown type. The policy object can then allow or block playback, depending on the ITA's policy.

This method should be used only to report transient conditions. A plug-in that is never in a trusted state should not implement the interface at all.

aa473794 HRESULT IEVRTrustedVideoPlugin::IsInTrustedVideoMode([In] BOOL* pYes) IEVRTrustedVideoPlugin::IsInTrustedVideoMode

Queries whether the plug-in can limit the effective video resolution.

Receives a Boolean value. If TRUE, the plug-in can limit the effective video resolution. Otherwise, the plug-in cannot limit the video resolution. If the method fails, the EVR treats the value as (not supported).

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Constriction is a protection mechanism that limits the effective resolution of the video frame to a specified maximum number of pixels.

Video constriction can be implemented by either the mixer or the presenter.

If the method returns TRUE, the EVR might call at any time.

aa473782 HRESULT IEVRTrustedVideoPlugin::CanConstrict([In] BOOL* pYes) IEVRTrustedVideoPlugin::CanConstrict

Limits the effective video resolution.

Maximum number of source pixels that may appear in the final video image, in thousands of pixels. If the value is zero, the video is disabled. If the value is MAXDWORD (0xFFFFFFFF), video constriction is removed and the video may be rendered at full resolution.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method limits the effective resolution of the video image. The actual resolution on the target device might be higher, due to stretching the image.

The EVR might call this method at any time if the method returns TRUE.

aa473833 HRESULT IEVRTrustedVideoPlugin::SetConstriction([In] unsigned int dwKPix) IEVRTrustedVideoPlugin::SetConstriction

Enables or disables the ability of the plug-in to export the video image.

Boolean value. Specify TRUE to disable image exporting, or to enable it.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

An EVR plug-in might expose a way for the application to get a copy of the video frames. For example, the standard EVR presenter implements .

If the plug-in supports image exporting, this method enables or disables it. Before this method has been called for the first time, the EVR assumes that the mechanism is enabled.

If the plug-in does not support image exporting, this method should return and ignore the value of bDisable. If the method fails, the EVR treats it as a failure to enforce the policy, which will probably cause playback to stop.

While image exporting is disabled, any associated export method, such as GetCurrentImage, should return .

aa473830 HRESULT IEVRTrustedVideoPlugin::DisableImageExport([In] BOOL bDisable) IEVRTrustedVideoPlugin::DisableImageExport

Limits the effective video resolution.

This method limits the effective resolution of the video image. The actual resolution on the target device might be higher, due to stretching the image.

The EVR might call this method at any time if the method returns TRUE.

aa473833 SetConstriction SetConstriction HRESULT IEVRTrustedVideoPlugin::SetConstriction([In] unsigned int dwKPix)

Returns the device identifier supported by a video renderer component. This interface is implemented by mixers and presenters for the enhanced video renderer (EVR). If you replace either of these components, the mixer and presenter must report the same device identifier.

ms703065 IMFVideoDeviceID IMFVideoDeviceID
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns the identifier of the video device supported by an EVR mixer or presenter.

Receives the device identifier. Generally, the value is IID_IDirect3DDevice9.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The video renderer has been shut down.

?

If a mixer or presenter uses Direct3D 9, it must return the value IID_IDirect3DDevice9 in pDeviceID. The EVR's default mixer and presenter both return this value. If you write a custom mixer or presenter, it can return some other value. However, the mixer and presenter must use matching device identifiers.

ms704630 HRESULT IMFVideoDeviceID::GetDeviceID([Out] GUID* pDeviceID) IMFVideoDeviceID::GetDeviceID

Returns the identifier of the video device supported by an EVR mixer or presenter.

If a mixer or presenter uses Direct3D 9, it must return the value IID_IDirect3DDevice9 in pDeviceID. The EVR's default mixer and presenter both return this value. If you write a custom mixer or presenter, it can return some other value. However, the mixer and presenter must use matching device identifiers.

ms704630 GetDeviceID GetDeviceID HRESULT IMFVideoDeviceID::GetDeviceID([Out] GUID* pDeviceID)

Sets the source and destination rectangles for the video.

The source rectangle defines which portion of the video is displayed. It is specified in normalized coordinates. For more information, see structure. To display the entire video image, set the source rectangle to {0, 0, 1, 1}. The default source rectangle is {0, 0, 1, 1}.

The destination rectangle defines a rectangle within the clipping window where the video appears. It is specified in pixels, relative to the client area of the window. To fill the entire window, set the destination rectangle to {0, 0, width, height}, where width and height are dimensions of the window client area. The default destination rectangle is {0, 0, 0, 0}.

To update just one of these rectangles, set the other parameter to null. You can set pnrcSource or prcDest to null, but not both.

Before setting the destination rectangle (prcDest), you must set the video window by calling . (For the Media Foundation version of the EVR, you can also provide the video window in the function.) If no video window was provided, SetVideoPosition returns E_POINTER.

ms697352 IMFVideoDisplayControl IMFVideoDisplayControl
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the size and aspect ratio of the video, prior to any stretching by the video renderer.

Receives the size of the native video rectangle. This parameter can be null.

Receives the aspect ratio of the video. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_POINTER

At least one of the parameters must be non-null.

The video renderer has been shut down.

?

If no media types have been set on any video streams, the method succeeds but all parameters are set to zero.

You can set pszVideo or pszARVideo to null, but not both.

ms694294 HRESULT IMFVideoDisplayControl::GetNativeVideoSize([InOut, Optional] SIZE* pszVideo,[InOut, Optional] SIZE* pszARVideo) IMFVideoDisplayControl::GetNativeVideoSize

Gets the range of sizes that the enhanced video renderer (EVR) can display without significantly degrading performance or image quality.

Receives the minimum ideal size. This parameter can be null.

Receives the maximum ideal size. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_POINTER

At least one parameter must be non-null.

The video renderer has been shut down.

?

You can set pszMin or pszMax to null, but not both.

ms703076 HRESULT IMFVideoDisplayControl::GetIdealVideoSize([InOut, Optional] SIZE* pszMin,[InOut, Optional] SIZE* pszMax) IMFVideoDisplayControl::GetIdealVideoSize

Sets the source and destination rectangles for the video.

Pointer to an structure that specifies the source rectangle. This parameter can be null. If this parameter is null, the source rectangle does not change.

Specifies the destination rectangle. This parameter can be null. If this parameter is null, the destination rectangle does not change.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_POINTER

At least one parameter must be non-null.

The video renderer has been shut down.

?

The source rectangle defines which portion of the video is displayed. It is specified in normalized coordinates. For more information, see structure. To display the entire video image, set the source rectangle to {0, 0, 1, 1}. The default source rectangle is {0, 0, 1, 1}.

The destination rectangle defines a rectangle within the clipping window where the video appears. It is specified in pixels, relative to the client area of the window. To fill the entire window, set the destination rectangle to {0, 0, width, height}, where width and height are dimensions of the window client area. The default destination rectangle is {0, 0, 0, 0}.

To update just one of these rectangles, set the other parameter to null. You can set pnrcSource or prcDest to null, but not both.

Before setting the destination rectangle (prcDest), you must set the video window by calling . (For the Media Foundation version of the EVR, you can also provide the video window in the function.) If no video window was provided, SetVideoPosition returns E_POINTER.

ms697352 HRESULT IMFVideoDisplayControl::SetVideoPosition([In, Optional] const MFVideoNormalizedRect* pnrcSource,[In, Optional] const RECT* prcDest) IMFVideoDisplayControl::SetVideoPosition

Gets the source and destination rectangles for the video.

Pointer to an structure that receives the source rectangle.

Receives the current destination rectangle.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_POINTER

One or more required parameters are null.

The video renderer has been shut down.

?

bb970409 HRESULT IMFVideoDisplayControl::GetVideoPosition([Out] MFVideoNormalizedRect* pnrcSource,[Out] RECT* prcDest) IMFVideoDisplayControl::GetVideoPosition

Specifies how the enhanced video renderer (EVR) handles the aspect ratio of the source video.

Bitwise OR of one or more flags from the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid flags.

The video renderer has been shut down.

?

ms704027 HRESULT IMFVideoDisplayControl::SetAspectRatioMode([In] unsigned int dwAspectRatioMode) IMFVideoDisplayControl::SetAspectRatioMode

Queries how the enhanced video renderer (EVR) handles the aspect ratio of the source video.

Receives a bitwise OR of one or more flags from the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The video renderer has been shut down.

?

ms702253 HRESULT IMFVideoDisplayControl::GetAspectRatioMode([Out] unsigned int* pdwAspectRatioMode) IMFVideoDisplayControl::GetAspectRatioMode

Sets the clipping window for the video.

Handle to the window where the enhanced video renderer (EVR) will draw the video.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

hwndVideo does not specify a valid window.

S_FALSE

DWM thumbnails were not enabled/disabled.

?

The EVR will not display any video unless the application calls this method with a valid window handle.

For protected content, this method might disable Desktop Window Manager (DWM) thumbnail previews for the window. If thumbnail previews cannot be disabled, the method returns S_FALSE.

ms697051 HRESULT IMFVideoDisplayControl::SetVideoWindow([In] HWND hwndVideo) IMFVideoDisplayControl::SetVideoWindow

Gets the clipping window for the video.

Receives a handle to the window where the enhanced video renderer (EVR) will draw the video.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The video renderer has been shut down.

?

There is no default clipping window. The application must set the clipping window.

ms694138 HRESULT IMFVideoDisplayControl::GetVideoWindow([Out] HWND* phwndVideo) IMFVideoDisplayControl::GetVideoWindow

Repaints the current video frame. Call this method whenever the application receives a WM_PAINT message.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The EVR cannot repaint the frame at this time. This error can occur while the EVR is switching between full-screen and windowed mode. The caller can safely ignore this error.

The video renderer has been shut down.

?

ms703113 HRESULT IMFVideoDisplayControl::RepaintVideo() IMFVideoDisplayControl::RepaintVideo

Gets a copy of the current image being displayed by the video renderer.

Pointer to a structure that receives a description of the bitmap. Set the biSize member of the structure to sizeof() before calling the method.

Receives a reference to a buffer that contains a packed Windows device-independent bitmap (DIB). The caller must free the memory for the bitmap by calling CoTaskMemFree.

Receives the size of the buffer returned in pDib, in bytes.

Receives the time stamp of the captured image.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The content is protected and the license does not permit capturing the image.

The video renderer has been shut down.

?

This method can be called at any time. However, calling the method too frequently degrades the video playback performance.

This method retrieves a copy of the final composited image, which includes any substreams, alpha-blended bitmap, aspect ratio correction, background color, and so forth.

In windowed mode, the bitmap is the size of the destination rectangle specified in . In full-screen mode, the bitmap is the size of the display.

ms695342 HRESULT IMFVideoDisplayControl::GetCurrentImage([InOut] BITMAPINFOHEADER* pBih,[Out, Buffer, Optional] unsigned char** pDib,[Out] unsigned int* pcbDib,[InOut, Optional] longlong* pTimeStamp) IMFVideoDisplayControl::GetCurrentImage

Sets the border color for the video.

Specifies the border color as a value.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The video renderer has been shut down.

?

By default, if the video window straddles two monitors, the enhanced video renderer (EVR) clips the video to one monitor and draws the border color on the remaining portion of the window. (To change the clipping behavior, call .)

The border color is not used for letterboxing. To change the letterbox color, call .

ms697024 HRESULT IMFVideoDisplayControl::SetBorderColor([In] COLORREF Clr) IMFVideoDisplayControl::SetBorderColor

Gets the border color for the video.

Receives the border color, as a value.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The video renderer has been shut down.

?

The border color is used for areas where the enhanced video renderer (EVR) does not draw any video.

The border color is not used for letterboxing. To get the letterbox color, call .

ms694894 HRESULT IMFVideoDisplayControl::GetBorderColor([Out] COLORREF* pClr) IMFVideoDisplayControl::GetBorderColor

Sets various preferences related to video rendering.

Bitwise OR of zero or more flags from the enumeration.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid flags.

The video renderer has been shut down.

?

ms698981 HRESULT IMFVideoDisplayControl::SetRenderingPrefs([In] unsigned int dwRenderFlags) IMFVideoDisplayControl::SetRenderingPrefs

Controls how the Enhanced Video Renderer (EVR) displays video.

The EVR presenter implements this interface. To get a reference to the interface, call . The service identifier is MR_VIDEO_RENDER_SERVICE. Call GetService on any of the following objects:

  • The Media Session, if the topology contains an instance of the EVR.
  • The EVR media sink.
  • The DirectShow EVR filter.
  • The EVR presenter.

If you implement a custom presenter for the EVR, the presenter can optionally expose this interface as a service.

No documentation. No documentation. ms704002 HRESULT IMFVideoDisplayControl::GetRenderingPrefs([Out] unsigned int* pdwRenderFlags) IMFVideoDisplayControl::GetRenderingPrefs

[This API is not supported and may be altered or unavailable in the future. ]

Sets or unsets full-screen rendering mode.

To implement full-screen playback, an application should simply resize the video window to cover the entire area of the monitor. Also set the window to be a topmost window, so that the application receives all mouse-click messages. For more information about topmost windows, see the documentation for the SetWindowPos function.

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The video renderer has been shut down.

?

The default EVR presenter implements full-screen mode using Direct3D exclusive mode.

If you use this method to switch to full-screen mode, set the application window to be a topmost window and resize the window to cover the entire monitor. This ensures that the application window receives all mouse-click messages. Also set the keyboard focus to the application window. When you switch out of full-screen mode, restore the window's original size and position.

By default, the cursor is still visible in full-screen mode. To hide the cursor, call ShowCursor.

The transition to and from full-screen mode occurs asynchronously. To get the current mode, call .

ms701561 HRESULT IMFVideoDisplayControl::SetFullscreen([In] BOOL fFullscreen) IMFVideoDisplayControl::SetFullscreen

Queries whether the enhanced video renderer (EVR) is currently in full-screen mode.

Receives a Boolean value. If TRUE, the EVR is in full-screen mode. If , the EVR will display the video inside the application-provided clipping window.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The EVR is currently switching between full-screen and windowed mode.

?

ms704817 HRESULT IMFVideoDisplayControl::GetFullscreen([Out] BOOL* pfFullscreen) IMFVideoDisplayControl::GetFullscreen

Queries how the enhanced video renderer (EVR) handles the aspect ratio of the source video.

ms702253 GetAspectRatioMode / SetAspectRatioMode GetAspectRatioMode HRESULT IMFVideoDisplayControl::GetAspectRatioMode([Out] unsigned int* pdwAspectRatioMode)

Gets or sets the clipping window for the video.

There is no default clipping window. The application must set the clipping window.

ms694138 GetVideoWindow / SetVideoWindow GetVideoWindow HRESULT IMFVideoDisplayControl::GetVideoWindow([Out] HWND* phwndVideo)

Gets or sets the border color for the video.

The border color is used for areas where the enhanced video renderer (EVR) does not draw any video.

The border color is not used for letterboxing. To get the letterbox color, call .

ms694894 GetBorderColor / SetBorderColor GetBorderColor HRESULT IMFVideoDisplayControl::GetBorderColor([Out] COLORREF* pClr)

Controls how the Enhanced Video Renderer (EVR) displays video.

The EVR presenter implements this interface. To get a reference to the interface, call . The service identifier is MR_VIDEO_RENDER_SERVICE. Call GetService on any of the following objects:

  • The Media Session, if the topology contains an instance of the EVR.
  • The EVR media sink.
  • The DirectShow EVR filter.
  • The EVR presenter.

If you implement a custom presenter for the EVR, the presenter can optionally expose this interface as a service.

ms704002 GetRenderingPrefs / SetRenderingPrefs GetRenderingPrefs HRESULT IMFVideoDisplayControl::GetRenderingPrefs([Out] unsigned int* pdwRenderFlags)

Queries whether the enhanced video renderer (EVR) is currently in full-screen mode.

ms704817 GetFullscreen / SetFullscreen GetFullscreen HRESULT IMFVideoDisplayControl::GetFullscreen([Out] BOOL* pfFullscreen)

Represents a description of a video format.

If the major type of a media type is , you can query the media type object for the interface.

Applications should avoid using this interface except when a method or function requires an reference as a parameter. You can get all of the format information from a video media type through the interface, which inherits.

aa473814 IMFVideoMediaType IMFVideoMediaType
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Represents a description of a video format.

No documentation.

If the major type of a media type is , you can query the media type object for the interface.

Applications should avoid using this interface except when a method or function requires an reference as a parameter. You can get all of the format information from a video media type through the interface, which inherits.

aa473814 const MFVIDEOFORMAT* IMFVideoMediaType::GetVideoFormat() IMFVideoMediaType::GetVideoFormat

[This API is not supported and may be altered or unavailable in the future. Instead, applications should set the attribute on the media type to specify the surface stride and then call .]

Retrieves an alternative representation of the media type.

No documentation. No documentation. No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is equivalent to but includes the lStride parameter.

Instead of calling this method, applications should set the attribute on the media type to specify the surface stride and then call .

bb970371 HRESULT IMFVideoMediaType::GetVideoRepresentation([In] GUID guidRepresentation,[Out] void** ppvRepresentation,[In] int lStride) IMFVideoMediaType::GetVideoRepresentation

Represents a description of a video format.

If the major type of a media type is , you can query the media type object for the interface.

Applications should avoid using this interface except when a method or function requires an reference as a parameter. You can get all of the format information from a video media type through the interface, which inherits.

aa473814 GetVideoFormat GetVideoFormat const MFVIDEOFORMAT* IMFVideoMediaType::GetVideoFormat()

Alpha-blends a static bitmap image with the video displayed by the Enhanced Video Renderer (EVR).

The EVR mixer implements this interface. To get a reference to the interface, call . The service identifier is MR_VIDEO_MIXER_SERVICE. Call GetService on any of the following objects:

  • The Media Session, if the topology contains an instance of the EVR.
  • The EVR media sink.
  • The DirectShow EVR filter.
  • The EVR mixer.

If you implement a custom mixer for the EVR, the mixer can optionally expose this interface as a service.

ms697041 IMFVideoMixerBitmap IMFVideoMixerBitmap
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets a bitmap image for the enhanced video renderer (EVR) to alpha-blend with the video.

Pointer to an structure that contains information about the bitmap, the source and destination rectangles, the color key, and other information.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The blending parameters defined in the pBmpParms structure are not valid.

?

The application can provide the image either as a GDI bitmap or as a Direct3D surface. The EVR mixer blends the image with the next video frame and all subsequent frames, until the image is changed or removed. The image can contain embedded per-pixel alpha information so that transparent regions can be defined. Transparent areas can also be identified using a color key value.

If you use a Direct3D surface, the surface format must be 32-bit RGB, either or , and the surface must be allocated from the memory pool.

There is no defined limit to how frequently you can pass images to the video renderer. However, changing the image several times per second can impact the performance and smoothness of the video.

ms701866 HRESULT IMFVideoMixerBitmap::SetAlphaBitmap([In] const MFVideoAlphaBitmap* pBmpParms) IMFVideoMixerBitmap::SetAlphaBitmap

Removes the current bitmap and releases any resources associated with it.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No bitmap is currently set.

?

ms699004 HRESULT IMFVideoMixerBitmap::ClearAlphaBitmap() IMFVideoMixerBitmap::ClearAlphaBitmap

Updates the current alpha-blending settings, including the source and destination rectangles, the color key, and other information. You can update some or all of the blending parameters.

Pointer to an structure that contains the blending parameters.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The blending parameters defined in the pBmpParms structure are not valid.

No bitmap is currently set. You must call to set a bitmap.

?

The video must be playing for the changes to take effect.

ms696236 HRESULT IMFVideoMixerBitmap::UpdateAlphaBitmapParameters([In] const MFVideoAlphaBitmapParams* pBmpParms) IMFVideoMixerBitmap::UpdateAlphaBitmapParameters

Retrieves the current settings that the enhanced video renderer (EVR) uses to alpha-blend the bitmap with the video.

Pointer to an structure that receives the current blending parameters.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

No bitmap is currently set. You must call to set a bitmap.

?

This method returns the current values of all the blending parameters, not just those that the application specified. Ignore the dwFlags member of the structure.

ms693566 HRESULT IMFVideoMixerBitmap::GetAlphaBitmapParameters([Out] MFVideoAlphaBitmapParams* pBmpParms) IMFVideoMixerBitmap::GetAlphaBitmapParameters

Sets a bitmap image for the enhanced video renderer (EVR) to alpha-blend with the video.

The application can provide the image either as a GDI bitmap or as a Direct3D surface. The EVR mixer blends the image with the next video frame and all subsequent frames, until the image is changed or removed. The image can contain embedded per-pixel alpha information so that transparent regions can be defined. Transparent areas can also be identified using a color key value.

If you use a Direct3D surface, the surface format must be 32-bit RGB, either or , and the surface must be allocated from the memory pool.

There is no defined limit to how frequently you can pass images to the video renderer. However, changing the image several times per second can impact the performance and smoothness of the video.

ms701866 SetAlphaBitmap SetAlphaBitmap HRESULT IMFVideoMixerBitmap::SetAlphaBitmap([In] const MFVideoAlphaBitmap* pBmpParms)

Retrieves the current settings that the enhanced video renderer (EVR) uses to alpha-blend the bitmap with the video.

This method returns the current values of all the blending parameters, not just those that the application specified. Ignore the dwFlags member of the structure.

ms693566 GetAlphaBitmapParameters GetAlphaBitmapParameters HRESULT IMFVideoMixerBitmap::GetAlphaBitmapParameters([Out] MFVideoAlphaBitmapParams* pBmpParms)

Controls how the Enhanced Video Renderer (EVR) mixes video substreams. Applications can use this interface to control video mixing during playback.

The EVR mixer implements this interface. To get a reference to the interface, call . The service identifier is MR_VIDEO_MIXER_SERVICE. Call GetService on any of the following objects:

  • The Media Session, if the topology contains an instance of the EVR.
  • The EVR media sink.
  • The DirectShow EVR filter.
  • The EVR mixer.

If you implement a custom mixer for the EVR, the mixer can optionally expose this interface as a service.

ms700190 IMFVideoMixerControl IMFVideoMixerControl
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the z-order of a video stream.

Identifier of the stream. For the EVR media sink, the stream identifier is defined when the method is called. For the DirectShow EVR filter, the stream identifier corresponds to the pin index. The reference stream is always stream 0.

Z-order value. The z-order of the reference stream must be zero. The maximum z-order value is the number of streams minus one.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The value of dwZ is larger than the maximum z-order value.

Invalid z-order for this stream. For the reference stream, dwZ must be zero. For all other streams, dwZ must be greater than zero.

Invalid stream identifier.

?

The EVR draws the video streams in the order of their z-order values, starting with zero. The reference stream must be first in the z-order, and the remaining streams can be in any order.

ms697453 HRESULT IMFVideoMixerControl::SetStreamZOrder([In] unsigned int dwStreamID,[In] unsigned int dwZ) IMFVideoMixerControl::SetStreamZOrder

Retrieves the z-order of a video stream.

Identifier of the stream. For the EVR media sink, the stream identifier is defined when the method is called. For the DirectShow EVR filter, the stream identifier corresponds to the pin index. The reference stream is always stream 0.

Receives the z-order value.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream identifier.

?

ms701614 HRESULT IMFVideoMixerControl::GetStreamZOrder([In] unsigned int dwStreamID,[Out] unsigned int* pdwZ) IMFVideoMixerControl::GetStreamZOrder

Sets the position of a video stream within the composition rectangle.

Identifier of the stream. For the EVR media sink, the stream identifier is defined when the method is called. For the DirectShow EVR filter, the stream identifier corresponds to the pin index. The reference stream is always stream 0.

Pointer to an structure that defines the bounding rectangle for the video stream.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The coordinates of the bounding rectangle given in pnrcOutput are not valid.

Invalid stream identifier.

?

The mixer draws each video stream inside a bounding rectangle that is specified relative to the final video image. This bounding rectangle is given in normalized coordinates. For more information, see structure.

The coordinates of the bounding rectangle must fall within the range [0.0, 1.0]. Also, the X and Y coordinates of the upper-left corner cannot exceed the X and Y coordinates of the lower-right corner. In other words, the bounding rectangle must fit entirely within the composition rectangle and cannot be flipped vertically or horizontally.

The following diagram shows how the EVR mixes substreams.

The output rectangle for the stream is specified by calling SetStreamOutputRect. The source rectangle is specified by calling . The mixer applies the output rectangle first, when it mixes the streams into a single bounding rectangle. This bounding rectangle is called composition space. Then the presenter applies the source rectangle to the composited image.

ms698959 HRESULT IMFVideoMixerControl::SetStreamOutputRect([In] unsigned int dwStreamID,[In] const MFVideoNormalizedRect* pnrcOutput) IMFVideoMixerControl::SetStreamOutputRect

Retrieves the position of a video stream within the composition rectangle.

The identifier of the stream. For the EVR media sink, the stream identifier is defined when the method is called. For the DirectShow EVR filter, the stream identifier corresponds to the pin index. The reference stream is always stream 0.

Pointer to an structure that receives the bounding rectangle, in normalized coordinates.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid stream identifier.

?

ms698911 HRESULT IMFVideoMixerControl::GetStreamOutputRect([In] unsigned int dwStreamID,[Out] MFVideoNormalizedRect* pnrcOutput) IMFVideoMixerControl::GetStreamOutputRect

Controls preferences for video deinterlacing.

The default video mixer for the Enhanced Video Renderer (EVR) implements this interface.

To get a reference to the interface, call on any of the following objects, using the MR_VIDEO_MIXER_SERVICE service identifier:

  • The Media Session, if the topology contains an instance of the EVR.
  • The EVR media sink.
  • The DirectShow EVR filter.
  • The EVR mixer.
dd374894 IMFVideoMixerControl2 IMFVideoMixerControl2
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the preferences for video deinterlacing.

Bitwise OR of zero or more flags from the enumeration.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374898 HRESULT IMFVideoMixerControl2::SetMixingPrefs([In] unsigned int dwMixFlags) IMFVideoMixerControl2::SetMixingPrefs

Gets the current preferences for video deinterlacing.

Receives a bitwise OR of zero or more flags from the enumeration.

If this method succeeds, it returns . Otherwise, it returns an error code.

dd374896 HRESULT IMFVideoMixerControl2::GetMixingPrefs([Out] unsigned int* pdwMixFlags) IMFVideoMixerControl2::GetMixingPrefs

Gets or sets the current preferences for video deinterlacing.

dd374896 GetMixingPrefs / SetMixingPrefs GetMixingPrefs HRESULT IMFVideoMixerControl2::GetMixingPrefs([Out] unsigned int* pdwMixFlags)

Maps a position on an input video stream to the corresponding position on an output video stream.

To obtain a reference to this interface, call on the renderer with the service MR_VIDEO_RENDER_SERVICE.

ms695386 IMFVideoPositionMapper IMFVideoPositionMapper
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Maps output image coordinates to input image coordinates. This method provides the reverse transformation for components that map coordinates on the input image to different coordinates on the output image.

X-coordinate of the output image, normalized to the range [0...1].

Y-coordinate of the output image, normalized to the range [0...1].

Output stream index for the coordinate mapping.

Input stream index for the coordinate mapping.

Receives the mapped x-coordinate of the input image, normalized to the range [0...1].

Receives the mapped y-coordinate of the input image, normalized to the range [0...1].

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The video renderer has been shut down.

?

In the following diagram, R(dest) is the destination rectangle for the video. You can obtain this rectangle by calling . The rectangle R1 is a substream within the video. The point P has pixel coordinates (x,y) relative to R(dest).

The position of P relative to R(dest) in normalized coordinates is calculated as follows:

float xn = float(x + 0.5) / widthDest; float xy = float(y + 0.5) / heightDest;

where widthDest and heightDest are the width and height of R(dest) in pixels.

To calculate the position of P relative to R1, call MapOutputCoordinateToInputStream as follows:

float x1 = 0, y1 = 0; hr = pMap->MapOutputCoordinateToInputStream(xn, yn, 0, dwInputStreamIndex, &x1, &y1);

The values returned in x1 and y1 are normalized to the range [0...1]. To convert back to pixel coordinates, scale these values by the size of R1:

int scaledx = int(floor(x1 * widthR1)); int scaledy = int(floor(xy * heightR1));

Note that x1 and y1 might fall outside the range [0...1] if P lies outside of R1.

ms703892 HRESULT IMFVideoPositionMapper::MapOutputCoordinateToInputStream([In] float xOut,[In] float yOut,[In] unsigned int dwOutputStreamIndex,[In] unsigned int dwInputStreamIndex,[Out] float* pxIn,[Out] float* pyIn) IMFVideoPositionMapper::MapOutputCoordinateToInputStream

Represents a video presenter. A video presenter is an object that receives video frames, typically from a video mixer, and presents them in some way, typically by rendering them to the display. The enhanced video renderer (EVR) provides a default video presenter, and applications can implement custom presenters.

The video presenter receives video frames as soon as they are available from upstream. The video presenter is responsible for presenting frames at the correct time and for synchronizing with the presentation clock.

ms700214 IMFVideoPresenter IMFVideoPresenter
Sends a message to the video presenter. Messages are used to signal the presenter that it must perform some action, or that some event has occurred. Specifies the message as a member of the VpMessageType enumeration. Message parameter. The meaning of this parameter depends on the message type. HRESULT IMFVideoPresenter::ProcessMessage([In] MFVP_MESSAGE_TYPE eMessage,[In] ULONG_PTR ulParam) Retrieves the presenter's media type. Receives a pointer to the IMFVideoMediaType interface. The caller must release the interface. HRESULT IMFVideoPresenter::GetCurrentMediaType([out] IMFVideoMediaType **ppMediaType

Sets one or more color adjustment (ProcAmp) settings.

Before calling this method, set the video processor mode. To select a video processor mode, call . Otherwise, the EVR automatically selects a mode when streaming begins.

To find out which ProcAmp settings the driver supports, call .

bb970441 IMFVideoProcessor IMFVideoProcessor
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the video processor modes that the video driver supports.

Receives the number of video processor modes.

Receives a reference to an array of GUIDs. The number of elements in the array is returned in the lpdwNumProcessingModes parameter. The caller must release the memory for the array by calling CoTaskMemFree. This parameter can be null.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media type for the reference stream is not set.

?

Video processor modes are identified by . For a list of predefined GUIDs, see . A driver can define additional vendor-specific GUIDs. To get the capabilities of each mode, pass the to the method.

Before calling this method, you must set the media type for the reference stream. Which modes are available might depend on the media type of the reference stream.

bb970329 HRESULT IMFVideoProcessor::GetAvailableVideoProcessorModes([InOut] unsigned int* lpdwNumProcessingModes,[Out, Buffer, Optional] GUID** ppVideoProcessingModes) IMFVideoProcessor::GetAvailableVideoProcessorModes

Retrieves the capabilities of a video processor mode.

Pointer to a that identifies the video processor mode. To get a list of available modes, call .

Pointer to a structure that receives the capabilities.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media type for the reference stream is not set.

?

Before calling this method, you must set the media type for the reference stream.

bb970465 HRESULT IMFVideoProcessor::GetVideoProcessorCaps([In] GUID* lpVideoProcessorMode,[Out] DXVA2_VideoProcessorCaps* lpVideoProcessorCaps) IMFVideoProcessor::GetVideoProcessorCaps

Retrieves the application's preferred video processor mode. To set the preferred mode, call .

No documentation.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media type for the reference stream is not set.

S_FALSE

The application has not specified a preferred video processor mode.

?

bb970545 HRESULT IMFVideoProcessor::GetVideoProcessorMode([Out] GUID* lpMode) IMFVideoProcessor::GetVideoProcessorMode

Sets the preferred video processor mode. The EVR will attempt to use this mode when playback starts.

Pointer to a that identifies the video processor mode. To get a list of available modes, call .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The requested mode is not valid.

The mixer has already allocated Direct3D resources and cannot change modes.

The media type for the reference stream is not set.

?

Before calling this method, set the media type for the reference stream as follows:

  • DirectShow EVR filter: Connect pin 0.

  • EVR media sink: Set the media type for stream 0.

  • Mixer (standalone): Set the media type for input stream 0 and set the media type for the output stream.

Which modes are available might depend on the reference stream's media type.

Call this method before video playback begins.

bb970396 HRESULT IMFVideoProcessor::SetVideoProcessorMode([In] GUID* lpMode) IMFVideoProcessor::SetVideoProcessorMode

Retrieves the range of values for a color adjustment (ProcAmp) setting.

The ProcAmp setting to query. For a list of possible values, see ProcAmp Settings.

Pointer to a structure that receives range of values for the specified ProcAmp setting.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid value for dwProperty.

No video processor mode has been set.

The media type for the reference stream is not set.

?

This method returns the range of values that the current video processor mode supports for the specified ProcAmp setting.

This method fails if the video processor mode has not been set on the mixer. To select a video processor mode, call . Otherwise, the EVR automatically selects a mode when streaming begins.

To find out which ProcAmp settings the driver supports, call .

bb970317 HRESULT IMFVideoProcessor::GetProcAmpRange([In] unsigned int dwProperty,[Out] DXVA2_ValueRange* pPropRange) IMFVideoProcessor::GetProcAmpRange

Retrieves the current settings for one or more color adjustment (ProcAmp) settings.

Bitwise OR of one or more flags, specifying which operations to query. For a list of flags, see ProcAmp Settings.

Pointer to a structure. The method fills the structure with the current value of each operation specified in dwFlags.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The media type for the reference stream is not set.

?

Before calling this method, you must set the media type for the reference stream.

Until the mixer's video processor mode is set, the returned values are all zero. After the processor mode is set, the returned values reflect the current mode. To select a video processor mode, call . Otherwise, the EVR automatically selects a mode when streaming begins.

To find out which ProcAmp settings the driver supports, call .

bb970527 HRESULT IMFVideoProcessor::GetProcAmpValues([In] unsigned int dwFlags,[Out] DXVA2_ProcAmpValues* Values) IMFVideoProcessor::GetProcAmpValues

Sets one or more color adjustment (ProcAmp) settings.

Bitwise OR of one or more flags, specifying which ProcAmp values to set. For a list of flags, see ProcAmp Settings.

Pointer to a structure. For each flag that you set in dwFlags, set the corresponding structure member to the desired value. To get the valid range of values for each operation, call . The method ignores any structure members for which the corresponding flag is not set in dwFlags.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The dwFlags parameter is invalid, or one or more values in pValues is not within the correct range.

The media type for the reference stream is not set.

?

Before calling this method, set the video processor mode. To select a video processor mode, call . Otherwise, the EVR automatically selects a mode when streaming begins.

To find out which ProcAmp settings the driver supports, call .

bb970441 HRESULT IMFVideoProcessor::SetProcAmpValues([In] unsigned int dwFlags,[In] DXVA2_ProcAmpValues* pValues) IMFVideoProcessor::SetProcAmpValues

Retrieves the range of values for a specified image filter setting.

The image filtering parameter to query. For a list of possible values, see DXVA Image Filter Settings.

Pointer to a structure that receives range of values for the specified image filtering parameter.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

DDERR_UNSUPPORTED

The driver does not support this filter setting.

E_INVALIDARG

Invalid value for dwProperty.

No video processor mode has been set.

The specified operation is not available.

The media type for the reference stream is not set.

?

This method returns the range of values that the current video processor mode supports for the specified image filter setting.

This method fails if the video processor mode has not been set on the mixer. To select a video processor mode, call . Otherwise, the EVR automatically selects a mode when streaming begins.

To find out which image filters the driver supports, call .

bb970350 HRESULT IMFVideoProcessor::GetFilteringRange([In] unsigned int dwProperty,[Out] DXVA2_ValueRange* pPropRange) IMFVideoProcessor::GetFilteringRange

Retrieves the current setting for an image filter.

The filter setting to query. For a list of possible values, see DXVA Image Filter Settings.

Pointer to a structure that receives the current value.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The value of dwProperty is invalid.

The media type for the reference stream is not set.

?

Before calling this method, you must set the media type for the reference stream.

Until the mixer's video processor mode is set, the returned values are all zero. After the processor mode is set, the returned values reflect the current mode. To select a video processor mode, call . Otherwise, the EVR automatically selects a mode when streaming begins.

To find out which image filters the driver supports, call .

bb970348 HRESULT IMFVideoProcessor::GetFilteringValue([In] unsigned int dwProperty,[Out] DXVA2_Fixed32* pValue) IMFVideoProcessor::GetFilteringValue

Sets a parameter for an image filter.

The image filtering parameter to set. For a list of possible values, see DXVA Image Filter Settings.

Pointer to a structure that specifies the new value. To get the valid range of values for each parameter, call .

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The value of dwProperty is invalid.

The media type for the reference stream is not set.

?

Before calling this method, set the video processor mode. To select a video processor mode, call . Otherwise, the EVR automatically selects a mode when streaming begins.

To find out which image filters the driver supports, call .

bb970520 HRESULT IMFVideoProcessor::SetFilteringValue([In] unsigned int dwProperty,[In] DXVA2_Fixed32* pValue) IMFVideoProcessor::SetFilteringValue

Retrieves the background color for the composition rectangle. The background color is used for letterboxing the video image.

Pointer to a value that receives the background color.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970532 HRESULT IMFVideoProcessor::GetBackgroundColor([Out] COLORREF* lpClrBkg) IMFVideoProcessor::GetBackgroundColor

Sets the background color for the composition rectangle. The background color is used for letterboxing the video image.

Background color, specified as a value. Use the RGB macro to create this value.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

bb970577 HRESULT IMFVideoProcessor::SetBackgroundColor([In] COLORREF ClrBkg) IMFVideoProcessor::SetBackgroundColor

Retrieves the application's preferred video processor mode. To set the preferred mode, call .

bb970545 GetVideoProcessorMode / SetVideoProcessorMode GetVideoProcessorMode HRESULT IMFVideoProcessor::GetVideoProcessorMode([Out] GUID* lpMode)

Retrieves the background color for the composition rectangle. The background color is used for letterboxing the video image.

bb970532 GetBackgroundColor / SetBackgroundColor GetBackgroundColor HRESULT IMFVideoProcessor::GetBackgroundColor([Out] COLORREF* lpClrBkg)

Sets a new mixer or presenter for the Enhanced Video Renderer (EVR).

Both the EVR media sink and the DirectShow EVR filter implement this interface. To get a reference to the interface, call QueryInterface on the media sink or the filter. Do not use to get a reference to this interface.

The EVR activation object returned by the function does not expose this interface. Instead, the activation object supports attributes that specify a custom mixer or presenter. For more information, see Enhanced Video Renderer Attributes.

ms698954 IMFVideoRenderer IMFVideoRenderer
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets a new mixer or presenter for the enhanced video renderer (EVR).

Pointer to the interface of the mixer to use. This parameter can be null. If this parameter is null, the EVR uses its default mixer.

Pointer to the interface of the presenter to use. This parameter can be null. If this parameter is null, the EVR uses its default presenter.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Either the mixer or the presenter is invalid.

The mixer and presenter cannot be replaced in the current state. (EVR media sink.)

The video renderer has been shut down.

VFW_E_WRONG_STATE

One or more input pins are connected. (DirectShow EVR filter.)

?

Call this method directly after creating the EVR, before you do any of the following:

  • Call on the EVR.

  • Call on the EVR.

  • Connect any pins on the EVR filter, or set any media types on EVR media sink.

The EVR filter returns VFW_E_WRONG_STATE if any of the filter's pins are connected. The EVR media sink returns if a media type is set on any of the streams, or the presentation clock is running or paused.

The device identifiers for the mixer and the presenter must match. The method returns the device identifier. If they do not match, the method returns E_INVALIDARG.

If the video renderer is in the protected media path (PMP), the mixer and presenter objects must be certified safe components and pass any trust authority verification that is being enforced. Otherwise, this method will fail.

ms704667 HRESULT IMFVideoRenderer::InitializeRenderer([In, Optional] IMFTransform* pVideoMixer,[In, Optional] IMFVideoPresenter* pVideoPresenter) IMFVideoRenderer::InitializeRenderer

Allocates video samples for a video media sink.

The stream sinks on the enhanced video renderer (EVR) expose this interface as a service. To obtain a reference to the interface, call using the service identifier . Custom media sinks can also implement this interface. The Media Session uses this interface to allocate samples for the EVR, unless the upstream decoder supports DirectX Video Acceleration (DXVA).

aa473823 IMFVideoSampleAllocator IMFVideoSampleAllocator
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Specifies the Direct3D device manager for the video media sink to use.

Pointer to the interface of the Direct3D device manager. The media sink queries this reference for the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

The media sink uses the Direct3D device manager to obtain a reference to the Direct3D device, which it uses to allocate Direct3D surfaces. The device manager enables multiple objects in the pipeline (such as a video renderer and a video decoder) to share the same Direct3D device.

aa473819 HRESULT IMFVideoSampleAllocator::SetDirectXManager([In] IUnknown* pManager) IMFVideoSampleAllocator::SetDirectXManager

Releases all of the video samples that have been allocated.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

aa473807 HRESULT IMFVideoSampleAllocator::UninitializeSampleAllocator() IMFVideoSampleAllocator::UninitializeSampleAllocator

Specifies the number of samples to allocate and the media type for the samples.

Number of samples to allocate.

Pointer to the interface of a media type that describes the video format.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid media type.

?

bb970496 HRESULT IMFVideoSampleAllocator::InitializeSampleAllocator([In] unsigned int cRequestedFrames,[In] IMFMediaType* pMediaType) IMFVideoSampleAllocator::InitializeSampleAllocator

Gets a video sample from the allocator.

Receives a reference to the interface. The caller must release the interface.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The allocator was not initialized. Call or InitializeSampleAllocatorEx::InitializeSampleAllocatorEx.

No samples are available.

?

bb970553 HRESULT IMFVideoSampleAllocator::AllocateSample([In] IMFSample** ppSample) IMFVideoSampleAllocator::AllocateSample

Specifies the Direct3D device manager for the video media sink to use.

The media sink uses the Direct3D device manager to obtain a reference to the Direct3D device, which it uses to allocate Direct3D surfaces. The device manager enables multiple objects in the pipeline (such as a video renderer and a video decoder) to share the same Direct3D device.

aa473819 SetDirectXManager SetDirectXManager HRESULT IMFVideoSampleAllocator::SetDirectXManager([In] IUnknown* pManager)

Enables an application to track video samples allocated by the enhanced video renderer (EVR).

The stream sinks on the EVR expose this interface as a service. To get a reference to the interface, call the method, using the service identifier.

dd374900 IMFVideoSampleAllocatorCallback IMFVideoSampleAllocatorCallback
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Sets the callback object that receives notification whenever a video sample is returned to the allocator.

A reference to the interface that receives notification, or null to remove the callback.

If this method succeeds, it returns . Otherwise, it returns an error code.

To get a video sample from the allocator, call the method. When the sample is released, it returns to the pool of available samples. When this happens, the allocator invokes the callback.

The allocator holds at most one callback reference. Calling this method again replaces the previous callback reference.

dd374904 HRESULT IMFVideoSampleAllocatorCallback::SetCallback([In] IMFVideoSampleAllocatorNotify* pNotify) IMFVideoSampleAllocatorCallback::SetCallback

Gets the number of video samples that are currently available for use.

Receives the number of available samples.

If this method succeeds, it returns . Otherwise, it returns an error code.

To get a video sample from the allocator, call the method. The AllocateSample method removes a sample from the sample pool and returns it to the caller. When a sample is released, it returns to the pool. The GetFreeSampleCount method returns the count of samples that remain in the sample pool.

dd374902 HRESULT IMFVideoSampleAllocatorCallback::GetFreeSampleCount([In] int* plSamples) IMFVideoSampleAllocatorCallback::GetFreeSampleCount

Sets the callback object that receives notification whenever a video sample is returned to the allocator.

To get a video sample from the allocator, call the method. When the sample is released, it returns to the pool of available samples. When this happens, the allocator invokes the callback.

The allocator holds at most one callback reference. Calling this method again replaces the previous callback reference.

dd374904 SetCallback SetCallback HRESULT IMFVideoSampleAllocatorCallback::SetCallback([In] IMFVideoSampleAllocatorNotify* pNotify)

The callback for the interface.

dd374906 IMFVideoSampleAllocatorNotify IMFVideoSampleAllocatorNotify
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Called when a video sample is returned to the allocator.

If this method succeeds, it returns . Otherwise, it returns an error code.

To get a video sample from the allocator, call the method. When the sample is released and then returned to the pool of available samples, the allocator invokes the NotifyRelease method.

dd374908 HRESULT IMFVideoSampleAllocatorNotify::NotifyRelease() IMFVideoSampleAllocatorNotify::NotifyRelease

This interface is not supported.

ms704789 IEVRVideoStreamControl IEVRVideoStreamControl
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Note??This method is not supported.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms700170 HRESULT IEVRVideoStreamControl::SetStreamActiveState([In] BOOL fActive) IEVRVideoStreamControl::SetStreamActiveState

Note??This method is not supported.

If this method succeeds, it returns . Otherwise, it returns an error code.

ms703876 HRESULT IEVRVideoStreamControl::GetStreamActiveState([Out] BOOL* lpfActive) IEVRVideoStreamControl::GetStreamActiveState

Note??This method is not supported.

ms703876 GetStreamActiveState / SetStreamActiveState GetStreamActiveState HRESULT IEVRVideoStreamControl::GetStreamActiveState([Out] BOOL* lpfActive)

Registers the topology work queues with the Multimedia Class Scheduler Service (MMCSS).

Each source node in the topology defines one branch of the topology. The branch includes every topology node that receives data from that node. An application can assign each branch of a topology its own work queue and then associate those work queues with MMCSS tasks.

To use this method, perform the following steps.

  1. Create the topology.
  2. Set the following attributes on the source nodes in the topology.
    • . Specifies an identifier for the work queue. The Media Session will allocate a new work queue.
    • . Specifies the MMCSS class.
    • . Specifies the MMCSS task identifier (optional). If this attribute is not set, MMCSS assigns a new task identifier.
  3. Queue the topology by calling .
  4. Wait for the event with the status.
  5. Call BeginRegisterTopologyWorkQueuesWithMMCSS. This method registers all of the topology work queues with MMCSS.

The BeginRegisterTopologyWorkQueuesWithMMCSS method is asynchronous. When the operation completes, the callback object's method is called. Within the callback method, call to complete the asynchronous request. After this operation completes, the Media Session automatically registers the work queues for every new topology that is queued on the Media Session. The application does not need to call the method again for new topologies.

To unregister the topology work queues from MMCSS, call .

ms697485 IMFWorkQueueServices IMFWorkQueueServices
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Registers the topology work queues with the Multimedia Class Scheduler Service (MMCSS).

A reference to the interface of a callback object. The caller must implement this interface.

A reference to the interface of a state object defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

If this method succeeds, it returns . Otherwise, it returns an error code.

Each source node in the topology defines one branch of the topology. The branch includes every topology node that receives data from that node. An application can assign each branch of a topology its own work queue and then associate those work queues with MMCSS tasks.

To use this method, perform the following steps.

  1. Create the topology.
  2. Set the following attributes on the source nodes in the topology.
    • . Specifies an identifier for the work queue. The Media Session will allocate a new work queue.
    • . Specifies the MMCSS class.
    • . Specifies the MMCSS task identifier (optional). If this attribute is not set, MMCSS assigns a new task identifier.
  3. Queue the topology by calling .
  4. Wait for the event with the status.
  5. Call BeginRegisterTopologyWorkQueuesWithMMCSS. This method registers all of the topology work queues with MMCSS.

The BeginRegisterTopologyWorkQueuesWithMMCSS method is asynchronous. When the operation completes, the callback object's method is called. Within the callback method, call to complete the asynchronous request. After this operation completes, the Media Session automatically registers the work queues for every new topology that is queued on the Media Session. The application does not need to call the method again for new topologies.

To unregister the topology work queues from MMCSS, call .

ms697485 HRESULT IMFWorkQueueServices::BeginRegisterTopologyWorkQueuesWithMMCSS([In] IMFAsyncCallback* pCallback,[In] IUnknown* pState) IMFWorkQueueServices::BeginRegisterTopologyWorkQueuesWithMMCSS

Completes an asynchronous request to register the topology work queues with the Multimedia Class Scheduler Service (MMCSS).

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Call this method when the method completes asynchronously.

ms696983 HRESULT IMFWorkQueueServices::EndRegisterTopologyWorkQueuesWithMMCSS([In] IMFAsyncResult* pResult) IMFWorkQueueServices::EndRegisterTopologyWorkQueuesWithMMCSS

Unregisters the topology work queues from the Multimedia Class Scheduler Service (MMCSS).

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is asynchronous. When the operation completes, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

ms702139 HRESULT IMFWorkQueueServices::BeginUnregisterTopologyWorkQueuesWithMMCSS([In] IMFAsyncCallback* pCallback,[In] IUnknown* pState) IMFWorkQueueServices::BeginUnregisterTopologyWorkQueuesWithMMCSS

Completes an asynchronous request to unregister the topology work queues from the Multimedia Class Scheduler Service (MMCSS).

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Call this method when the method completes asynchronously.

ms698872 HRESULT IMFWorkQueueServices::EndUnregisterTopologyWorkQueuesWithMMCSS([In] IMFAsyncResult* pResult) IMFWorkQueueServices::EndUnregisterTopologyWorkQueuesWithMMCSS

Retrieves the Multimedia Class Scheduler Service (MMCSS) class for a specified branch of the current topology.

Identifies the work queue assigned to this topology branch. The application defines this value by setting the attribute on the source node for the branch.

Pointer to a buffer that receives the name of the MMCSS class. This parameter can be null.

On input, specifies the size of the pwszClass buffer, in characters. On output, receives the required size of the buffer, in characters. The size includes the terminating null character.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

There is no work queue with the specified identifier.

The pwszClass buffer is too small to receive the class name.

?

ms704762 HRESULT IMFWorkQueueServices::GetTopologyWorkQueueMMCSSClass([In] unsigned int dwTopologyWorkQueueId,[Out, Buffer] wchar_t* pwszClass,[InOut] unsigned int* pcchClass) IMFWorkQueueServices::GetTopologyWorkQueueMMCSSClass

Retrieves the Multimedia Class Scheduler Service (MMCSS) task identifier for a specified branch of the current topology.

Identifies the work queue assigned to this topology branch. The application defines this value by setting the attribute on the source node for the branch.

Receives the task identifier.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms694202 HRESULT IMFWorkQueueServices::GetTopologyWorkQueueMMCSSTaskId([In] unsigned int dwTopologyWorkQueueId,[Out] unsigned int* pdwTaskId) IMFWorkQueueServices::GetTopologyWorkQueueMMCSSTaskId

Associates a platform work queue with a Multimedia Class Scheduler Service (MMCSS) task.

The platform work queue to register with MMCSS. See Work Queue Identifiers. To register all of the standard work queues to the same MMCSS task, set this parameter to .

The name of the MMCSS task to be performed.

The unique task identifier. To obtain a new task identifier, set this value to zero.

A reference to the interface of a callback object. The caller must implement this interface.

A reference to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method is asynchronous. When the operation completes, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

To unregister the work queue from the MMCSS class, call .

ms702114 HRESULT IMFWorkQueueServices::BeginRegisterPlatformWorkQueueWithMMCSS([In] unsigned int dwPlatformWorkQueue,[In] const wchar_t* wszClass,[In] unsigned int dwTaskId,[In] IMFAsyncCallback* pCallback,[In] IUnknown* pState) IMFWorkQueueServices::BeginRegisterPlatformWorkQueueWithMMCSS

Completes an asynchronous request to associate a platform work queue with a Multimedia Class Scheduler Service (MMCSS) task.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The unique task identifier.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Call this function when the method completes asynchronously.

To unregister the work queue from the MMCSS class, call .

ms702284 HRESULT IMFWorkQueueServices::EndRegisterPlatformWorkQueueWithMMCSS([In] IMFAsyncResult* pResult,[Out] unsigned int* pdwTaskId) IMFWorkQueueServices::EndRegisterPlatformWorkQueueWithMMCSS

Unregisters a platform work queue from a Multimedia Class Scheduler Service (MMCSS) task.

Platform work queue to register with MMCSS. See .

Pointer to the interface of a callback object. The caller must implement this interface.

Pointer to the interface of a state object, defined by the caller. This parameter can be null. You can use this object to hold state information. The object is returned to the caller when the callback is invoked.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

This method is asynchronous. When the operation completes, the callback object's method is called. At that point, the application should call to complete the asynchronous request.

ms704603 HRESULT IMFWorkQueueServices::BeginUnregisterPlatformWorkQueueWithMMCSS([In] unsigned int dwPlatformWorkQueue,[In] IMFAsyncCallback* pCallback,[In] IUnknown* pState) IMFWorkQueueServices::BeginUnregisterPlatformWorkQueueWithMMCSS

Completes an asynchronous request to unregister a platform work queue from a Multimedia Class Scheduler Service (MMCSS) task.

Pointer to the interface. Pass in the same reference that your callback object received in the method.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

Call this method when the method completes asynchronously.

ms704734 HRESULT IMFWorkQueueServices::EndUnregisterPlatformWorkQueueWithMMCSS([In] IMFAsyncResult* pResult) IMFWorkQueueServices::EndUnregisterPlatformWorkQueueWithMMCSS

Retrieves the Multimedia Class Scheduler Service (MMCSS) class for a specified platform work queue.

Platform work queue to query. See .

Pointer to a buffer that receives the name of the MMCSS class. This parameter can be null.

On input, specifies the size of the pwszClass buffer, in characters. On output, receives the required size of the buffer, in characters. The size includes the terminating null character.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The pwszClass buffer is too small to receive the class name.

?

ms705624 HRESULT IMFWorkQueueServices::GetPlaftormWorkQueueMMCSSClass([In] unsigned int dwPlatformWorkQueueId,[Out, Buffer] wchar_t* pwszClass,[InOut] unsigned int* pcchClass) IMFWorkQueueServices::GetPlaftormWorkQueueMMCSSClass

Retrieves the Multimedia Class Scheduler Service (MMCSS) task identifier for a specified platform work queue.

Platform work queue to query. See .

Receives the task identifier.

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

ms700183 HRESULT IMFWorkQueueServices::GetPlatformWorkQueueMMCSSTaskId([In] unsigned int dwPlatformWorkQueueId,[Out] unsigned int* pdwTaskId) IMFWorkQueueServices::GetPlatformWorkQueueMMCSSTaskId

Specifies the protection level for Analog Copy Protection (ACP).

This enumeration is numerically equivalent to the COPP_ACP_Protection_Level enumeration used in Certified Output Protection Protocol. The flag corresponds to COPP_ACP_Level0.

dd388935 OPM_ACP_PROTECTION_LEVEL OPM_ACP_PROTECTION_LEVEL

ACP is disabled.

dd388935 OPM_ACP_OFF OPM_ACP_OFF

ACP protection level 1.

dd388935 OPM_ACP_LEVEL_ONE OPM_ACP_LEVEL_ONE

ACP protection level 2.

dd388935 OPM_ACP_LEVEL_TWO OPM_ACP_LEVEL_TWO

ACP protection level 3.

dd388935 OPM_ACP_LEVEL_THREE OPM_ACP_LEVEL_THREE
No documentation. __MIDL___MIDL_itf_opmapi_0000_0000_0006 __MIDL___MIDL_itf_opmapi_0000_0000_0006 No documentation. OPM_BUS_TYPE_OTHER OPM_BUS_TYPE_OTHER No documentation. OPM_BUS_TYPE_PCI OPM_BUS_TYPE_PCI No documentation. OPM_BUS_TYPE_PCIX OPM_BUS_TYPE_PCIX No documentation. OPM_BUS_TYPE_PCIEXPRESS OPM_BUS_TYPE_PCIEXPRESS No documentation. OPM_BUS_TYPE_AGP OPM_BUS_TYPE_AGP No documentation. OPM_BUS_IMPLEMENTATION_MODIFIER_INSIDE_OF_CHIPSET OPM_BUS_IMPLEMENTATION_MODIFIER_INSIDE_OF_CHIPSET No documentation. OPM_BUS_IMPLEMENTATION_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP OPM_BUS_IMPLEMENTATION_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP No documentation. OPM_BUS_IMPLEMENTATION_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET OPM_BUS_IMPLEMENTATION_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET No documentation. OPM_BUS_IMPLEMENTATION_MODIFIER_DAUGHTER_BOARD_CONNECTOR OPM_BUS_IMPLEMENTATION_MODIFIER_DAUGHTER_BOARD_CONNECTOR No documentation. OPM_BUS_IMPLEMENTATION_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE OPM_BUS_IMPLEMENTATION_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE No documentation. OPM_BUS_IMPLEMENTATION_MODIFIER_NON_STANDARD OPM_BUS_IMPLEMENTATION_MODIFIER_NON_STANDARD No documentation. OPM_COPP_COMPATIBLE_BUS_TYPE_INTEGRATED OPM_COPP_COMPATIBLE_BUS_TYPE_INTEGRATED No documentation. __MIDL___MIDL_itf_opmapi_0000_0000_0007 __MIDL___MIDL_itf_opmapi_0000_0000_0007 No documentation. OPM_CGMSA_OFF OPM_CGMSA_OFF No documentation. OPM_CGMSA_COPY_FREELY OPM_CGMSA_COPY_FREELY No documentation. OPM_CGMSA_COPY_NO_MORE OPM_CGMSA_COPY_NO_MORE No documentation. OPM_CGMSA_COPY_ONE_GENERATION OPM_CGMSA_COPY_ONE_GENERATION No documentation. OPM_CGMSA_COPY_NEVER OPM_CGMSA_COPY_NEVER No documentation. OPM_CGMSA_REDISTRIBUTION_CONTROL_REQUIRED OPM_CGMSA_REDISTRIBUTION_CONTROL_REQUIRED No documentation. __MIDL___MIDL_itf_opmapi_0000_0000_0004 __MIDL___MIDL_itf_opmapi_0000_0000_0004 No documentation. OPM_CONNECTOR_TYPE_OTHER OPM_CONNECTOR_TYPE_OTHER No documentation. OPM_CONNECTOR_TYPE_VGA OPM_CONNECTOR_TYPE_VGA No documentation. OPM_CONNECTOR_TYPE_SVIDEO OPM_CONNECTOR_TYPE_SVIDEO No documentation. OPM_CONNECTOR_TYPE_COMPOSITE_VIDEO OPM_CONNECTOR_TYPE_COMPOSITE_VIDEO No documentation. OPM_CONNECTOR_TYPE_COMPONENT_VIDEO OPM_CONNECTOR_TYPE_COMPONENT_VIDEO No documentation. OPM_CONNECTOR_TYPE_DVI OPM_CONNECTOR_TYPE_DVI No documentation. OPM_CONNECTOR_TYPE_HDMI OPM_CONNECTOR_TYPE_HDMI No documentation. OPM_CONNECTOR_TYPE_LVDS OPM_CONNECTOR_TYPE_LVDS No documentation. OPM_CONNECTOR_TYPE_D_JPN OPM_CONNECTOR_TYPE_D_JPN No documentation. OPM_CONNECTOR_TYPE_SDI OPM_CONNECTOR_TYPE_SDI No documentation. OPM_CONNECTOR_TYPE_DISPLAYPORT_EXTERNAL OPM_CONNECTOR_TYPE_DISPLAYPORT_EXTERNAL No documentation. OPM_CONNECTOR_TYPE_DISPLAYPORT_EMBEDDED OPM_CONNECTOR_TYPE_DISPLAYPORT_EMBEDDED No documentation. OPM_CONNECTOR_TYPE_UDI_EXTERNAL OPM_CONNECTOR_TYPE_UDI_EXTERNAL No documentation. OPM_CONNECTOR_TYPE_UDI_EMBEDDED OPM_CONNECTOR_TYPE_UDI_EMBEDDED No documentation. OPM_COPP_COMPATIBLE_CONNECTOR_TYPE_INTERNAL OPM_COPP_COMPATIBLE_CONNECTOR_TYPE_INTERNAL

The DXGKMDT_OPM_DPCP_PROTECTION_LEVEL enumeration indicates the protection levels for a protected output that supports DisplayPort Content Protection (DPCP).

DPCP protects digital video signals from DisplayPort output connectors. For more information about DisplayPort, see the DisplayPort article.

ff560861 OPM_DPCP_PROTECTION_LEVEL OPM_DPCP_PROTECTION_LEVEL

Indicates that DPCP does not protect the output's signal.

ff560861 OPM_DPCP_OFF OPM_DPCP_OFF

Indicates that DPCP protects the output's signal.

ff560861 OPM_DPCP_ON OPM_DPCP_ON
No documentation. __MIDL___MIDL_itf_opmapi_0000_0000_0005 __MIDL___MIDL_itf_opmapi_0000_0000_0005 No documentation. OPM_DVI_CHARACTERISTIC_1_0 OPM_DVI_CHARACTERISTIC_1_0 No documentation. OPM_DVI_CHARACTERISTIC_1_1_OR_ABOVE OPM_DVI_CHARACTERISTIC_1_1_OR_ABOVE No documentation. __MIDL___MIDL_itf_opmapi_0000_0000_0002 __MIDL___MIDL_itf_opmapi_0000_0000_0002 No documentation. OPM_HDCP_FLAG_NONE OPM_HDCP_FLAG_NONE No documentation. OPM_HDCP_FLAG_REPEATER OPM_HDCP_FLAG_REPEATER

The DXGKMDT_OPM_HDCP_PROTECTION_LEVEL enumeration indicates the protection levels for a protected output that supports High-bandwidth Digital Content Protection (HDCP).

HDCP protects digital video signals from digital video output connectors. Currently, OPM can use HDCP to protect data from Digital Video Interface (DVI) and High-Definition Multimedia Interface (HDMI) connector outputs. For more information about the HDCP system, see the HDCP Specification Revision 1.1.

ff560878 OPM_HDCP_PROTECTION_LEVEL OPM_HDCP_PROTECTION_LEVEL

Indicates that HDCP does not protect the output's signal.

ff560878 OPM_HDCP_OFF OPM_HDCP_OFF

Indicates that HDCP protects the output's signal.

ff560878 OPM_HDCP_ON OPM_HDCP_ON

Specifies the aspect ratio for ETSI EN 300 294.

This enumeration is numerically equivalent to the COPP_ImageAspectRatio_EN300294 enumeration used in Certified Output Protection Protocol (COPP).

dd388963 OPM_IMAGE_ASPECT_RATIO_EN300294 OPM_IMAGE_ASPECT_RATIO_EN300294

Full format 4:3.

dd388963 OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3 OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3

Box 14:9 center.

dd388963 OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_CENTER OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_CENTER

Box 14:9 top.

dd388963 OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_TOP OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_TOP

Box 16:9 center.

dd388963 OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_CENTER OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_CENTER

Box 16:9 top.

dd388963 OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_TOP OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_TOP

Box > 16:9 center.

dd388963 OPM_ASPECT_RATIO_EN300294_BOX_GT_16_BY_9_CENTER OPM_ASPECT_RATIO_EN300294_BOX_GT_16_BY_9_CENTER

Full format 4:3 (shoot and protect 14:9 center).

dd388963 OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3_PROTECTED_CENTER OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3_PROTECTED_CENTER

Full format 16:9 (anamorphic).

dd388963 OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_16_BY_9_ANAMORPHIC OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_16_BY_9_ANAMORPHIC
No documentation. __MIDL___MIDL_itf_opmapi_0000_0000_0001 __MIDL___MIDL_itf_opmapi_0000_0000_0001 No documentation. OPM_OMAC_SIZE OPM_OMAC_SIZE No documentation. OPM_128_BIT_RANDOM_NUMBER_SIZE OPM_128_BIT_RANDOM_NUMBER_SIZE No documentation. OPM_ENCRYPTED_INITIALIZATION_PARAMETERS_SIZE OPM_ENCRYPTED_INITIALIZATION_PARAMETERS_SIZE No documentation. OPM_CONFIGURE_SETTING_DATA_SIZE OPM_CONFIGURE_SETTING_DATA_SIZE No documentation. OPM_GET_INFORMATION_PARAMETERS_SIZE OPM_GET_INFORMATION_PARAMETERS_SIZE No documentation. OPM_REQUESTED_INFORMATION_SIZE OPM_REQUESTED_INFORMATION_SIZE No documentation. OPM_HDCP_KEY_SELECTION_VECTOR_SIZE OPM_HDCP_KEY_SELECTION_VECTOR_SIZE No documentation. OPM_PROTECTION_TYPE_SIZE OPM_PROTECTION_TYPE_SIZE No documentation. __MIDL___MIDL_itf_opmapi_0000_0000_0009 __MIDL___MIDL_itf_opmapi_0000_0000_0009 No documentation. OPM_PROTECTION_STANDARD_OTHER OPM_PROTECTION_STANDARD_OTHER No documentation. OPM_PROTECTION_STANDARD_NONE OPM_PROTECTION_STANDARD_NONE No documentation. OPM_PROTECTION_STANDARD_IEC61880_525I OPM_PROTECTION_STANDARD_IEC61880_525I No documentation. OPM_PROTECTION_STANDARD_IEC61880_2_525I OPM_PROTECTION_STANDARD_IEC61880_2_525I No documentation. OPM_PROTECTION_STANDARD_IEC62375_625P OPM_PROTECTION_STANDARD_IEC62375_625P No documentation. OPM_PROTECTION_STANDARD_EIA608B_525 OPM_PROTECTION_STANDARD_EIA608B_525 No documentation. OPM_PROTECTION_STANDARD_EN300294_625I OPM_PROTECTION_STANDARD_EN300294_625I No documentation. OPM_PROTECTION_STANDARD_CEA805A_TYPEA_525P OPM_PROTECTION_STANDARD_CEA805A_TYPEA_525P No documentation. OPM_PROTECTION_STANDARD_CEA805A_TYPEA_750P OPM_PROTECTION_STANDARD_CEA805A_TYPEA_750P No documentation. OPM_PROTECTION_STANDARD_CEA805A_TYPEA_1125I OPM_PROTECTION_STANDARD_CEA805A_TYPEA_1125I No documentation. OPM_PROTECTION_STANDARD_CEA805A_TYPEB_525P OPM_PROTECTION_STANDARD_CEA805A_TYPEB_525P No documentation. OPM_PROTECTION_STANDARD_CEA805A_TYPEB_750P OPM_PROTECTION_STANDARD_CEA805A_TYPEB_750P No documentation. OPM_PROTECTION_STANDARD_CEA805A_TYPEB_1125I OPM_PROTECTION_STANDARD_CEA805A_TYPEB_1125I No documentation. OPM_PROTECTION_STANDARD_ARIBTRB15_525I OPM_PROTECTION_STANDARD_ARIBTRB15_525I No documentation. OPM_PROTECTION_STANDARD_ARIBTRB15_525P OPM_PROTECTION_STANDARD_ARIBTRB15_525P No documentation. OPM_PROTECTION_STANDARD_ARIBTRB15_750P OPM_PROTECTION_STANDARD_ARIBTRB15_750P No documentation. OPM_PROTECTION_STANDARD_ARIBTRB15_1125I OPM_PROTECTION_STANDARD_ARIBTRB15_1125I No documentation. __MIDL___MIDL_itf_opmapi_0000_0000_0008 __MIDL___MIDL_itf_opmapi_0000_0000_0008 No documentation. OPM_PROTECTION_TYPE_OTHER OPM_PROTECTION_TYPE_OTHER No documentation. OPM_PROTECTION_TYPE_NONE OPM_PROTECTION_TYPE_NONE No documentation. OPM_PROTECTION_TYPE_COPP_COMPATIBLE_HDCP OPM_PROTECTION_TYPE_COPP_COMPATIBLE_HDCP No documentation. OPM_PROTECTION_TYPE_ACP OPM_PROTECTION_TYPE_ACP No documentation. OPM_PROTECTION_TYPE_CGMSA OPM_PROTECTION_TYPE_CGMSA No documentation. OPM_PROTECTION_TYPE_HDCP OPM_PROTECTION_TYPE_HDCP No documentation. OPM_PROTECTION_TYPE_DPCP OPM_PROTECTION_TYPE_DPCP No documentation. __MIDL___MIDL_itf_opmapi_0000_0000_0003 __MIDL___MIDL_itf_opmapi_0000_0000_0003 No documentation. OPM_STATUS_NORMAL OPM_STATUS_NORMAL No documentation. OPM_STATUS_LINK_LOST OPM_STATUS_LINK_LOST No documentation. OPM_STATUS_RENEGOTIATION_REQUIRED OPM_STATUS_RENEGOTIATION_REQUIRED No documentation. OPM_STATUS_TAMPERING_DETECTED OPM_STATUS_TAMPERING_DETECTED No documentation. OPM_STATUS_REVOKED_HDCP_DEVICE_ATTACHED OPM_STATUS_REVOKED_HDCP_DEVICE_ATTACHED None. None None

Specifies whether the interface will use Output Protection Manager (OPM) semantics or Certified Output Protection Protocol (COPP) semantics.

dd388979 OPM_VIDEO_OUTPUT_SEMANTICS OPM_VIDEO_OUTPUT_SEMANTICS
No documentation. dd388979 OPM_VOS_COPP_SEMANTICS OPM_VOS_COPP_SEMANTICS No documentation. dd388979 OPM_VOS_OPM_SEMANTICS OPM_VOS_OPM_SEMANTICS Functions

Creates an Output Protection Manager (OPM) object for each physical monitor that is associated with a particular handle.

The monitor handle for which to create OPM objects. There are several functions that return values. For more information, see the topic Multiple Display Monitors Functions in the Windows graphics device interface (GDI) documentation.

A member of the enumeration.

ValueMeaning

The returned references will use OPM semantics.

The returned references will use Certified Output Protection Protocol (COPP) semantics.

?

Receives the number of references returned in the pppOPMVideoOutputArray parameter.

Receives a reference to an array of references. Each reference is associated with a single physical monitor. The caller must release each reference in the array, and call CoTaskMemFree to free the array.

If this function succeeds, it returns . Otherwise, it returns an error code.

A single handle can be associated with several physical monitors. Each physical monitor has its own connector. The application must set the protection mechanism individually for each physical monitor, using the references returned in pppOPMVideoOutputArray.

The interface has two modes of behavior, depending on the value of the vos parameter. If vos is , uses COPP semantics. This mode is intended for backward compatibility with COPP. If vos is , uses the newer OPM semantics. Differences in behavior are noted on the reference page for each method. The mode does not change during the lifetime of the object.

dd388932 HRESULT OPMGetVideoOutputsFromHMONITOR([In] HMONITOR hMonitor,[In] OPM_VIDEO_OUTPUT_SEMANTICS vos,[Out] unsigned int* pulNumVideoOutputs,[Out, Buffer] IOPMVideoOutput*** pppOPMVideoOutputArray) OPMGetVideoOutputsFromHMONITOR

Creates an Output Protection Manager (OPM) object for each physical monitor that is associated with a particular Direct3D device.

Pointer to the interface of a Direct3D device.

A member of the enumeration.

ValueMeaning

The returned references will use OPM semantics.

The returned references will use Certified Output Protection Protocol (COPP) semantics.

?

Receives the number of references returned in the pppOPMVideoOutputArray parameter.

Receives a reference to an array of references. Each reference is associated with a single physical monitor. The caller must release each reference in the array, and call CoTaskMemFree to free the array.

If this function succeeds, it returns . Otherwise, it returns an error code.

A single Direct3D device can be associated with several physical monitors. Each physical monitor has its own connector. The application must set the protection mechanism individually for each physical monitor, by using the references returned in pppOPMVideoOutputArray.

The interface has two modes of behavior, depending on the value of the vos parameter. If vos is , uses COPP semantics. This mode is intended for backward compatibility with COPP. If vos is , uses the newer OPM semantics. Differences in behavior are noted on the reference page for each method. The mode does not change during the lifetime of the object.

dd388933 HRESULT OPMGetVideoOutputsFromIDirect3DDevice9Object([In] IDirect3DDevice9* pDirect3DDevice9,[In] OPM_VIDEO_OUTPUT_SEMANTICS vos,[Out] unsigned int* pulNumVideoOutputs,[Out, Buffer] IOPMVideoOutput*** pppOPMVideoOutputArray) OPMGetVideoOutputsFromIDirect3DDevice9Object

Represents a video output for an Output Protection Manager (OPM) session.

To get a reference to this interface, call one of the following functions:

dd374909 IOPMVideoOutput IOPMVideoOutput
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Begins the initialization sequence for an Output Protection Manager (OPM) session.

Pointer to an structure. The structure receives a 128-bit random number generated by the display driver. This number is required for the method.

Receives a reference to a buffer containing the display driver's certificate. The method allocates the memory for the buffer. The caller must release the memory by calling CoTaskMemFree.

Receives the length of the buffer pointed to by ppbCertificate.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method is equivalent to the IAMCertifiedOutputProtection::KeyExchange method in Certified Output Protection Protocol (COPP).

The method returns a certificate chain that contains the driver's 2048-bit RSA public key. The caller must validate the certificate chain and then call to establish the OPM session.

This method supports both OPM semantics and COPP semantics. COPP semantics are supported for backward compatibility; new applications should use OPM semantics.

dd374918 HRESULT IOPMVideoOutput::StartInitialization([Out] OPM_RANDOM_NUMBER* prnRandomNumber,[Out, Buffer] unsigned char** ppbCertificate,[Out] unsigned int* pulCertificateLength) IOPMVideoOutput::StartInitialization

Completes the initialization sequence for an Output Protection Manager (OPM) session.

Pointer to an structure. Initialize this structure as described in the Remarks session.

Returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

An unexpected error occurred the display driver.

The encrypted parameters in pParameters are incorrect.

?

This method is equivalent to the IAMCertifiedOutputProtection::SessionSequenceStart method in Certified Output Protection Protocol (COPP).

The pParameters parameter points to an structure that contains a 256-byte array. Before calling the method, prepare this array as follows. First, concatenate the following numbers:

  • The 128-bit number returned in the prnRandomNumber parameter of the method.
  • The AES signing key. This value is a 128-bit random number generated by the application.
  • The initial sequence number for OPM status requests. This value is a 32-bit random number generated by the application.
  • The initial sequence number for OPM commands. This value is a 32-bit random number generated by the application.

Encrypt this number with RAEAS-OAEP, encryption using the display driver's public encryption key. The public encryption key is contained in the certificate returned in the ppbCertificate parameter of the StartInitialization method.

The application must use cryptographically secure random numbers. The CryptGenRandom function is recommended, although not required.

dd374914 HRESULT IOPMVideoOutput::FinishInitialization([In] const OPM_ENCRYPTED_INITIALIZATION_PARAMETERS* pParameters) IOPMVideoOutput::FinishInitialization

Sends an Output Protection Manager (OPM) status request to the display driver.

Pointer to an structure. Fill in this structure with data for the status request. For a list of status requests, see OPM Status Requests.

Pointer to an structure. On return, the method fills in this structure with the results of the status request.

Returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The OPM object was created with Certified Output Protection Protocol (COPP) semantics.

?

This method is equivalent to the IAMCertifiedOutputProtection::ProtectionStatus method in COPP.

The interface supports both OPM semantics and COPP semantics. The GetInformation method applies only when OPM semantics are used. If the interface reference was created with COPP semantics, GetInformation returns . In that case, call instead.

dd374916 HRESULT IOPMVideoOutput::GetInformation([In] const OPM_GET_INFO_PARAMETERS* pParameters,[Out] OPM_REQUESTED_INFORMATION* pRequestedInformation) IOPMVideoOutput::GetInformation

Sends an Output Protection Manager (OPM) status request to the display driver. Use this method when OPM is emulating Certified Output Protection Manager (COPP).

Pointer to an structure. Fill in this structure with data for the status request. For a list of status requests, see OPM Status Requests.

Pointer to an structure. On return, the method fills in this structure with the results of the status request.

Returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The OPM object was created with OPM semantics, not COPP semantics.

?

This method is equivalent to the IAMCertifiedOutputProtection::ProtectionStatus method in COPP.

The interface supports both OPM semantics and COPP semantics. The COPPCompatibleGetInformation method applies only when COPP semantics are used. If the interface reference was created with OPM semantics, COPPCompatibleGetInformation returns . In that case, call instead.

dd374913 HRESULT IOPMVideoOutput::COPPCompatibleGetInformation([In] const OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS* pParameters,[Out] OPM_REQUESTED_INFORMATION* pRequestedInformation) IOPMVideoOutput::COPPCompatibleGetInformation

Configures a video output. This method sends an Output Protection Manager (OPM) or Certified Output Protection Protocol (COPP) command to the driver.

Pointer to an structure that contains the command. For a list of OPM commands, see OPM Commands.

The size of the pbAdditionalParameters buffer, in bytes.

Pointer to a buffer that contains additional information for the command.

If this method succeeds, it returns . Otherwise, it returns an error code.

This method is equivalent to the IAMCertifiedOutputProtection::ProtectionCommand method in COPP.

This method supports both OPM semantics and COPP semantics. COPP semantics are supported for backward compatibility; new applications should use OPM semantics.

dd374911 HRESULT IOPMVideoOutput::Configure([In] const OPM_CONFIGURE_PARAMETERS* pParameters,[In] unsigned int ulAdditionalParametersSize,[In, Buffer, Optional] const unsigned char* pbAdditionalParameters) IOPMVideoOutput::Configure

Contains the result from an OPM_GET_ACP_AND_CGMSA_SIGNALING query.

The layout of this structure is identical to the DXVA_COPPStatusSignalingCmdData structure used in Certified Output Protection Protocol (COPP).

dd388934 OPM_ACP_AND_CGMSA_SIGNALING OPM_ACP_AND_CGMSA_SIGNALING
No documentation. dd388934 OPM_RANDOM_NUMBER rnRandomNumber OPM_RANDOM_NUMBER rnRandomNumber No documentation. dd388934 unsigned int ulStatusFlags unsigned int ulStatusFlags No documentation. dd388934 unsigned int ulAvailableTVProtectionStandards unsigned int ulAvailableTVProtectionStandards No documentation. dd388934 unsigned int ulActiveTVProtectionStandard unsigned int ulActiveTVProtectionStandard No documentation. dd388934 unsigned int ulReserved unsigned int ulReserved No documentation. dd388934 unsigned int ulAspectRatioValidMask1 unsigned int ulAspectRatioValidMask1 No documentation. dd388934 unsigned int ulAspectRatioData1 unsigned int ulAspectRatioData1 No documentation. dd388934 unsigned int ulAspectRatioValidMask2 unsigned int ulAspectRatioValidMask2 No documentation. dd388934 unsigned int ulAspectRatioData2 unsigned int ulAspectRatioData2 No documentation. dd388934 unsigned int ulAspectRatioValidMask3 unsigned int ulAspectRatioValidMask3 No documentation. dd388934 unsigned int ulAspectRatioData3 unsigned int ulAspectRatioData3 No documentation. dd388934 unsigned int ulReserved2[4] unsigned int ulReserved2 No documentation. dd388934 unsigned int ulReserved3[4] unsigned int ulReserved3

Contains the result of an OPM_GET_ACTUAL_OUTPUT_FORMAT query in Output Protection Manager (OPM).

The refresh rate is expressed as a fraction. For example, if the refresh rate is 72 Hz, FreqNumerator = 72 and FreqDenominator = 1. For NTSC television, the values are FreqNumerator = 60000 and FreqDenominator = 1001 (59.94 fields per second).

The layout of this structure is identical to the DXVA_COPPStatusDisplayData structure used in Certified Output Protection Protocol (COPP).

dd388936 OPM_ACTUAL_OUTPUT_FORMAT OPM_ACTUAL_OUTPUT_FORMAT
No documentation. dd388936 OPM_RANDOM_NUMBER rnRandomNumber OPM_RANDOM_NUMBER rnRandomNumber No documentation. dd388936 unsigned int ulStatusFlags unsigned int ulStatusFlags No documentation. dd388936 unsigned int ulDisplayWidth unsigned int ulDisplayWidth No documentation. dd388936 unsigned int ulDisplayHeight unsigned int ulDisplayHeight No documentation. dd388936 DXVA2_SampleFormat dsfSampleInterleaveFormat DXVA2_SampleFormat dsfSampleInterleaveFormat No documentation. dd388936 D3DFORMAT d3dFormat D3DFORMAT d3dFormat No documentation. dd388936 unsigned int ulFrequencyNumerator unsigned int ulFrequencyNumerator No documentation. dd388936 unsigned int ulFrequencyDenominator unsigned int ulFrequencyDenominator

Contains an Output Protection Manager (OPM) or Certified Output Protection Manager (COPP) command.

The layout of this structure is identical to the AMCOPPCommand structure used in Certified Output Protection Protocol (COPP).

Initialize this structure as follows.

  1. Fill in all the structure members except the omac member.
  2. Use the OMAC 1 algorithm to calculate a message authentication code (MAC) for the block of data that appears after the omac member (excluding the omac member).
  3. Copy the MAC to the omac member.
dd388939 OPM_CONFIGURE_PARAMETERS OPM_CONFIGURE_PARAMETERS
No documentation. dd388939 OPM_OMAC omac OPM_OMAC omac No documentation. dd388939 GUID guidSetting GUID guidSetting No documentation. dd388939 unsigned int ulSequenceNumber unsigned int ulSequenceNumber No documentation. dd388939 unsigned int cbParametersSize unsigned int cbParametersSize No documentation. dd388939 unsigned char abParameters[4056] unsigned char abParameters

The DXGKMDT_OPM_CONNECTED_HDCP_DEVICE_INFORMATION structure contains High-bandwidth Digital Content Protection (HDCP) information that is retrieved in a call to the DxgkDdiOPMGetInformation function.

ff560854 OPM_CONNECTED_HDCP_DEVICE_INFORMATION OPM_CONNECTED_HDCP_DEVICE_INFORMATION
No documentation. ff560854 OPM_RANDOM_NUMBER rnRandomNumber OPM_RANDOM_NUMBER rnRandomNumber No documentation. ff560854 unsigned int ulStatusFlags unsigned int ulStatusFlags No documentation. ff560854 unsigned int ulHDCPFlags unsigned int ulHDCPFlags No documentation. ff560854 OPM_HDCP_KEY_SELECTION_VECTOR ksvB OPM_HDCP_KEY_SELECTION_VECTOR ksvB No documentation. ff560854 unsigned char Reserved[11] unsigned char Reserved No documentation. ff560854 unsigned char Reserved2[16] unsigned char Reserved2 No documentation. ff560854 unsigned char Reserved3[16] unsigned char Reserved3

The DXGKMDT_OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS structure contains parameters that are used to retrieve information from a protected output object in a call to the DxgkDdiOPMGetCOPPCompatibleInformation function.

ff560859 OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS
No documentation. ff560859 OPM_RANDOM_NUMBER rnRandomNumber OPM_RANDOM_NUMBER rnRandomNumber No documentation. ff560859 GUID guidInformation GUID guidInformation No documentation. ff560859 unsigned int ulSequenceNumber unsigned int ulSequenceNumber No documentation. ff560859 unsigned int cbParametersSize unsigned int cbParametersSize No documentation. ff560859 unsigned char abParameters[4056] unsigned char abParameters

Contains initialization parameters for an Output Protection Manager (OPM) session.

The layout of this structure is identical to the AMCOPPSignature structure used in Certified Output Protection Protocol (COPP).

dd388944 OPM_ENCRYPTED_INITIALIZATION_PARAMETERS OPM_ENCRYPTED_INITIALIZATION_PARAMETERS
No documentation. dd388944 unsigned char abEncryptedInitializationParameters[256] unsigned char abEncryptedInitializationParameters

Contains the result from an OPM_GET_CODEC_INFO query.

dd388951 OPM_GET_CODEC_INFO_INFORMATION OPM_GET_CODEC_INFO_INFORMATION
No documentation. dd388951 OPM_RANDOM_NUMBER rnRandomNumber OPM_RANDOM_NUMBER rnRandomNumber No documentation. dd388951 unsigned int Merit unsigned int Merit

Contains information for the OPM_GET_CODEC_INFO command.

dd388952 OPM_GET_CODEC_INFO_PARAMETERS OPM_GET_CODEC_INFO_PARAMETERS
No documentation. dd388952 unsigned int cbVerifier unsigned int cbVerifier No documentation. dd388952 unsigned char Verifier[4052] unsigned char Verifier

Contains parameters for the method.

Initialize this structure as follows:

  1. Generate a cryptographically secure 128-bit random number and copy it to the rnRandomNumber member. Do not re-use this number after calling GetInformation.
  2. Fill in the remaining structure members, except for the omac member.
  3. Use the OMAC 1 algorithm to calculate a message authentication code (MAC) for the block of data that appears after the omac member (excluding the omac member).
  4. Copy the MAC to the omac member.
dd388957 OPM_GET_INFO_PARAMETERS OPM_GET_INFO_PARAMETERS
No documentation. dd388957 OPM_OMAC omac OPM_OMAC omac No documentation. dd388957 OPM_RANDOM_NUMBER rnRandomNumber OPM_RANDOM_NUMBER rnRandomNumber No documentation. dd388957 GUID guidInformation GUID guidInformation No documentation. dd388957 unsigned int ulSequenceNumber unsigned int ulSequenceNumber No documentation. dd388957 unsigned int cbParametersSize unsigned int cbParametersSize No documentation. dd388957 unsigned char abParameters[4056] unsigned char abParameters

Contains the key selection vector (KSV) for a High-Bandwidth Digital Content Protection (HDCP) receiver.

dd388961 OPM_HDCP_KEY_SELECTION_VECTOR OPM_HDCP_KEY_SELECTION_VECTOR

A buffer that contains the device's KSV. (This is the value named Bksv in the HDCP specification.)

dd388961 unsigned char abKeySelectionVector[5] unsigned char abKeySelectionVector

The DXGKMDT_OPM_OMAC structure contains a One-key Cipher Block Chaining (CBC)-mode message authentication code (OMAC) for message authenticity.

For more information about OMAC, see the OMAC-1 algorithm.

The OMAC-1 parameters that OPM and COPP use are:

  • E = AES (Advanced Encryption Standard)

  • t = 128 bits

  • K = The 128-bit key that the display miniport driver receives when DxgkDdiOPMSetSigningKeyAndSequenceNumbers is called.

  • n = 128 bits

For information about AES, see the RSA Laboratories website.

ff560887 OPM_OMAC OPM_OMAC

A 16-byte array that comprises the OMAC.

ff560887 unsigned char abOMAC[16] unsigned char abOMAC

Contains the result from an OPM_GET_OUTPUT_ID status request.

dd388965 OPM_OUTPUT_ID_DATA OPM_OUTPUT_ID_DATA
No documentation. dd388965 OPM_RANDOM_NUMBER rnRandomNumber OPM_RANDOM_NUMBER rnRandomNumber No documentation. dd388965 unsigned int ulStatusFlags unsigned int ulStatusFlags No documentation. dd388965 unsigned longlong OutputId unsigned longlong OutputId

Contains a 128-bit random number for use with Output Protection Manager (OPM).

Always use a cryptographically secure random-number generator to fill in this structure. The CryptGenRandom function is recommended, although not required.

dd388967 OPM_RANDOM_NUMBER OPM_RANDOM_NUMBER
No documentation. dd388967 unsigned char abRandomNumber[16] unsigned char abRandomNumber

Contains the result of an Output Protection Manager (OPM) status request.

The layout of this structure is identical to the AMCOPPStatusOutput structure used in Certified Output Protection Protocol (COPP).

dd388968 OPM_REQUESTED_INFORMATION OPM_REQUESTED_INFORMATION
No documentation. dd388968 OPM_OMAC omac OPM_OMAC omac No documentation. dd388968 unsigned int cbRequestedInformationSize unsigned int cbRequestedInformationSize No documentation. dd388968 unsigned char abRequestedInformation[4076] unsigned char abRequestedInformation

Contains information for the OPM_SET_ACP_AND_CGMSA_SIGNALING command in Output Protection Manager (OPM).

This command causes the driver to insert Wide Screen Signaling (WSS) codes or other data packets in the television signal, as required by some Analog Copy Protection (ACP) and Copy Generation Management System ? Analog (CGMS-A) specifications. For example:

  • ETSI EN 300 294 (625i PAL): Data packets are inserted into line 23 of the signal.
  • CEA-608-B (NTSC): Data packets are inserted into line 21 of the vertical blanking interval (VBI).

The layout of this structure is identical to the DXVA_COPPSetSignalingCmdData structure used in Certified Output Protection Manager (COPP).

dd388970 OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS
No documentation. dd388970 unsigned int ulNewTVProtectionStandard unsigned int ulNewTVProtectionStandard No documentation. dd388970 unsigned int ulAspectRatioChangeMask1 unsigned int ulAspectRatioChangeMask1 No documentation. dd388970 unsigned int ulAspectRatioData1 unsigned int ulAspectRatioData1 No documentation. dd388970 unsigned int ulAspectRatioChangeMask2 unsigned int ulAspectRatioChangeMask2 No documentation. dd388970 unsigned int ulAspectRatioData2 unsigned int ulAspectRatioData2 No documentation. dd388970 unsigned int ulAspectRatioChangeMask3 unsigned int ulAspectRatioChangeMask3 No documentation. dd388970 unsigned int ulAspectRatioData3 unsigned int ulAspectRatioData3 No documentation. dd388970 unsigned int ulReserved3 unsigned int ulReserved3 No documentation. dd388970 unsigned int ulReserved[4] unsigned int ulReserved No documentation. dd388970 unsigned int ulReserved2[4] unsigned int ulReserved2

Contains parameters for the OPM_SET_HDCP_SRM command. This command updates the system renewability message (SRM) for High-Bandwidth Digital Content Protection (HDCP).

dd388972 OPM_SET_HDCP_SRM_PARAMETERS OPM_SET_HDCP_SRM_PARAMETERS
No documentation. dd388972 unsigned int ulSRMVersion unsigned int ulSRMVersion

The DXGKMDT_OPM_SET_PROTECTION_LEVEL_PARAMETERS structure contains parameters to set the protection level of a protected output in a call to the DxgkDdiOPMConfigureProtectedOutput function.

ff560921 OPM_SET_PROTECTION_LEVEL_PARAMETERS OPM_SET_PROTECTION_LEVEL_PARAMETERS
No documentation. ff560921 unsigned int ulProtectionType unsigned int ulProtectionType No documentation. ff560921 unsigned int ulProtectionLevel unsigned int ulProtectionLevel No documentation. ff560921 unsigned int Reserved unsigned int Reserved No documentation. ff560921 unsigned int Reserved2 unsigned int Reserved2

Contains the result from an Output Protection Manager (OPM) status request.

The layout of this structure is identical to the DXVA_COPPStatusData structure used in Certified Output Protection Protocol (COPP).

dd388976 OPM_STANDARD_INFORMATION OPM_STANDARD_INFORMATION
No documentation. dd388976 OPM_RANDOM_NUMBER rnRandomNumber OPM_RANDOM_NUMBER rnRandomNumber No documentation. dd388976 unsigned int ulStatusFlags unsigned int ulStatusFlags No documentation. dd388976 unsigned int ulInformation unsigned int ulInformation No documentation. dd388976 unsigned int ulReserved unsigned int ulReserved No documentation. dd388976 unsigned int ulReserved2 unsigned int ulReserved2

Contains an image that is stored as metadata for a media source. This structure is used as the data item for the WM/Picture metadata attribute.

The WM/Picture attribute is defined in the Windows Media Format SDK. The attribute contains a picture related to the content, such as album art.

To get this attribute from a media source, call , passing in the constant g_wszWMPicture for the pwszName parameter. The method retrieves a that contains a binary array (VT_BLOB). The layout of the array is as follows:

  • structure.
  • Null-terminated wide-character string that contains the MIME type.
  • Null-terminated wide-character string that contains a description.
  • Image data.

This format differs from the WM_PICTURE structure used in the Windows Media Format SDK. The WM_PICTURE structure contains internal references to two strings and the image data. If the structure is copied, these references become invalid. The structure does not contain internal references, so it is safe to copy the structure.

ms696178 ASF_FLAT_PICTURE ASF_FLAT_PICTURE
No documentation. ms696178 unsigned char bPictureType unsigned char bPictureType No documentation. ms696178 unsigned int dwDataLen unsigned int dwDataLen

Contains synchronized lyrics stored as metadata for a media source. This structure is used as the data item for the WM/Lyrics_Synchronised metadata attribute.

The WM/Lyrics_Synchronised attribute is defined in the Windows Media Format SDK. The attribute contains lyrics synchronized to times in the source file.

To get this attribute from a media source, call , passing in the constant g_wszWMLyrics_Synchronised for the pwszName parameter. The method retrieves a that contains a binary array (VT_BLOB). The layout of the array is as follows:

  • structure.

  • Null-terminated wide-character string that contains a description.

  • Lyric data. The format of the lyric data is described in the Windows Media Format SDK documentation.

This format differs from the WM_SYNCHRONISED_LYRICS structure used in the Windows Media Format SDK. The WM_SYNCHRONISED_LYRICS structure contains internal references to two strings and the lyric data. If the structure is copied, these references become invalid. The structure does not contain internal references, so it is safe to copy the structure.

ms697057 ASF_FLAT_SYNCHRONISED_LYRICS ASF_FLAT_SYNCHRONISED_LYRICS

Specifies the format of time stamps in the lyrics. This member is equivalent to the bTimeStampFormat member in the WM_SYNCHRONISED_LYRICS structure. The WM_SYNCHRONISED_LYRICS structure is documented in the Windows Media Format SDK.

ms697057 unsigned char bTimeStampFormat unsigned char bTimeStampFormat

Specifies the type of synchronized strings that are in the lyric data. This member is equivalent to the bContentType member in the WM_SYNCHRONISED_LYRICS structure.

ms697057 unsigned char bContentType unsigned char bContentType

Size, in bytes, of the lyric data.

ms697057 unsigned int dwLyricsLen unsigned int dwLyricsLen

Describes the indexing configuration for a stream and type of index.

ms696174 ASF_INDEX_DESCRIPTOR ASF_INDEX_DESCRIPTOR

structure that identifies the stream number and the type of index.

ms696174 ASF_INDEX_IDENTIFIER Identifier ASF_INDEX_IDENTIFIER Identifier

Number of bytes used for each index entry. If the value is MFASFINDEXER_PER_ENTRY_BYTES_DYNAMIC, the index entries have variable size.

ms696174 unsigned short cPerEntryBytes unsigned short cPerEntryBytes

Optional text description of the index.

ms696174 wchar_t szDescription[32] wchar_t szDescription

Indexing interval. The units of this value depend on the index type. A value of MFASFINDEXER_NO_FIXED_INTERVAL indicates that there is no fixed indexing interval.

ms696174 unsigned int dwInterval unsigned int dwInterval

Specifies an index for the ASF indexer object.

The index object of an ASF file can contain a number of distinct indexes. Each index is identified by the type of index and the stream number. No ASF index object can contain more than one index for a particular combination of stream number and index type.

ms700100 ASF_INDEX_IDENTIFIER ASF_INDEX_IDENTIFIER

The type of index. Currently this value must be GUID_NULL, which specifies time-based indexing.

ms700100 GUID guidIndexType GUID guidIndexType

The stream number to which this structure applies.

ms700100 unsigned short wStreamNumber unsigned short wStreamNumber

Contains statistics about the progress of the ASF multiplexer.

Use to retrieve this structure.

ms696231 ASF_MUX_STATISTICS ASF_MUX_STATISTICS

Number of frames written by the ASF multiplexer.

ms696231 unsigned int cFramesWritten unsigned int cFramesWritten

Number of frames dropped by the ASF multiplexer.

ms696231 unsigned int cFramesDropped unsigned int cFramesDropped

Describes a 4:4:4:4 Y'Cb'Cr' sample.

ms701580 MFAYUVSample MFAYUVSample

Cr (chroma difference) value.

ms701580 unsigned char bCrValue unsigned char bCrValue

Cb (chroma difference) value.

ms701580 unsigned char bCbValue unsigned char bCbValue

Y (luma) value.

ms701580 unsigned char bYValue unsigned char bYValue

Alpha value.

ms701580 unsigned char bSampleAlpha8 unsigned char bSampleAlpha8

Specifies the buffering parameters for a network byte stream.

aa370446 MFBYTESTREAM_BUFFERING_PARAMS MFBYTESTREAM_BUFFERING_PARAMS

Size of the file, in bytes. If the total size is unknown, set this member to -1.

aa370446 unsigned longlong cbTotalFileSize unsigned longlong cbTotalFileSize

Size of the playable media data in the file, excluding any trailing data that is not useful for playback. If this value is unknown, set this member to -1.

aa370446 unsigned longlong cbPlayableDataSize unsigned longlong cbPlayableDataSize

Pointer to an array of structures. Each member of the array gives the buffer window for a particular bit rate.

aa370446 MF_LEAKY_BUCKET_PAIR* prgBuckets MF_LEAKY_BUCKET_PAIR prgBuckets

The number of elements in the prgBuckets array.

aa370446 unsigned int cBuckets unsigned int cBuckets

Amount of data to buffer from the network, in 100-nanosecond units. This value is in addition to the buffer windows defined in the prgBuckets member.

aa370446 unsigned longlong qwNetBufferingTime unsigned longlong qwNetBufferingTime

Amount of additional data to buffer when seeking, in 100-nanosecond units. This value reflects the fact that downloading must start from the previous key frame before the seek point. If the value is unknown, set this member to zero.

aa370446 unsigned longlong qwExtraBufferingTimeDuringSeek unsigned longlong qwExtraBufferingTimeDuringSeek

The playback duration of the file, in 100-nanosecond units. If the duration is unknown, set this member to zero.

aa370446 unsigned longlong qwPlayDuration unsigned longlong qwPlayDuration

Playback rate.

aa370446 float dRate float dRate

Defines the properties of a clock.

ms695206 MFCLOCK_PROPERTIES MFCLOCK_PROPERTIES

The interval at which the clock correlates its clock time with the system time, in 100-nanosecond units. If the value is zero, the correlation is made whenever the method is called.

ms695206 unsigned longlong qwCorrelationRate unsigned longlong qwCorrelationRate

The unique identifier of the underlying device that provides the time. If two clocks have the same unique identifier, they are based on the same device. If the underlying device is not shared between two clocks, the value can be GUID_NULL.

ms695206 GUID guidClockId GUID guidClockId

A bitwise OR of flags from the enumeration.

ms695206 unsigned int dwClockFlags unsigned int dwClockFlags

The clock frequency in Hz. A value of MFCLOCK_FREQUENCY_HNS means that the clock has a frequency of 10 MHz (100-nanosecond ticks), which is the standard MFTIME time unit in Media Foundation. If the method returns the flag, the value of this field must be MFCLOCK_FREQUENCY_HNS.

ms695206 unsigned longlong qwClockFrequency unsigned longlong qwClockFrequency

The amount of inaccuracy that may be present on the clock, in parts per billion (ppb). For example, an inaccuracy of 50 ppb means the clock might drift up to 50 seconds per billion seconds of real time. If the tolerance is not known, the value is MFCLOCK_TOLERANCE_UNKNOWN. This constant is equal to 50 parts per million (ppm).

ms695206 unsigned int dwClockTolerance unsigned int dwClockTolerance

The amount of jitter that may be present, in 100-nanosecond units. Jitter is the variation in the frequency due to sampling the underlying clock. Jitter does not include inaccuracies caused by drift, which is reflected in the value of dwClockTolerance.

For clocks based on a single device, the minimum jitter is the length of the tick period (the inverse of the frequency). For example, if the frequency is 10 Hz, the jitter is 0.1 second, which is 1,000,000 in MFTIME units. This value reflects the fact that the clock might be sampled just before the next tick, resulting in a clock time that is one period less than the actual time. If the frequency is greater than 10 MHz, the jitter should be set to 1 (the minimum value).

If a clock's underlying hardware device does not directly time stamp the incoming data, the jitter also includes the time required to dispatch the driver's interrupt service routine (ISR). In that case, the expected jitter should include the following values:

ValueMeaning
MFCLOCK_JITTER_ISR

Jitter due to time stamping during the device driver's ISR.

MFCLOCK_JITTER_DPC

Jitter due to time stamping during the deferred procedure call (DPC) processing.

MFCLOCK_JITTER_PASSIVE

Jitter due to dropping to normal thread execution before time stamping.

?

ms695206 unsigned int dwClockJitter unsigned int dwClockJitter

The structure describes the format of the data used by a stream in a Microsoft DirectX Media Object (DMO).

This structure is identical to the DirectShow structure. The bFixedSizeSamples, bTemporalCompression, and lSampleSize members are for compatibility with DirectShow. Other DMO clients are not required to use them.

dd375504 DMO_MEDIA_TYPE DMO_MEDIA_TYPE

Major type of the stream.

dd375504 GUID majortype GUID majortype

Subtype of the stream.

dd375504 GUID subtype GUID subtype

If TRUE, samples are of a fixed size. This field is informational only. For audio, it is generally set to TRUE. For video, it is usually TRUE for uncompressed video and for compressed video.

dd375504 BOOL bFixedSizeSamples BOOL bFixedSizeSamples

If TRUE, samples are compressed using temporal (interframe) compression. (A value of TRUE indicates that not all frames are key frames.) This field is informational only.

dd375504 BOOL bTemporalCompression BOOL bTemporalCompression

Size of the sample in bytes. For compressed data, the value can be zero.

dd375504 unsigned int lSampleSize unsigned int lSampleSize

specifying the format type. The pbFormat member points to the corresponding format structure. Format types include the following.

Format typeFormat structure
FORMAT_DvInfo

DVINFO

FORMAT_MPEG2Video

FORMAT_MPEGVideo

FORMAT_None

None.

FORMAT_VideoInfo

FORMAT_VideoInfo2

FORMAT_WaveFormatEx

?

dd375504 GUID formattype GUID formattype

Not used. Set to null.

dd375504 IUnknown* pUnk IUnknown pUnk

Size of the format block of the media type.

dd375504 unsigned int cbFormat unsigned int cbFormat

Pointer to the format structure. The structure type is specified by the formattype member. The format structure must be present, unless formattype is GUID_NULL or FORMAT_None.

dd375504 unsigned char* pbFormat unsigned char pbFormat
No documentation. DMO_OUTPUT_DATA_BUFFER DMO_OUTPUT_DATA_BUFFER No documentation. IMediaBuffer* pBuffer IMediaBuffer pBuffer No documentation. unsigned int dwStatus unsigned int dwStatus No documentation. longlong rtTimestamp longlong rtTimestamp No documentation. longlong rtTimelength longlong rtTimelength

Contains coefficients used to transform multichannel audio into a smaller number of audio channels. This process is called fold-down.

To specify this information in the media type, set the attribute.

The ASF media source supports fold-down from six channels (5.1 audio) to two channels (stereo). It gets the information from the g_wszFold6To2Channels3 attribute in the ASF header. This attribute is documented in the Windows Media Format SDK documentation.

aa369731 MFFOLDDOWN_MATRIX MFFOLDDOWN_MATRIX

Size of the structure, in bytes.

aa369731 unsigned int cbSize unsigned int cbSize

Number of source channels.

aa369731 unsigned int cSrcChannels unsigned int cSrcChannels

Number of destination channels.

aa369731 unsigned int cDstChannels unsigned int cDstChannels

Specifies the assignment of audio channels to speaker positions in the transformed audio. This member is a bitwise OR of flags that define the speaker positions. For a list of valid flags, see attribute.

aa369731 unsigned int dwChannelMask unsigned int dwChannelMask

Array that contains the fold-down coefficients. The number of coefficients is cSrcChannels?cDstChannels. If the number of coefficients is less than the size of the array, the remaining elements in the array are ignored. For more information about how the coefficients are applied, see Windows Media Audio Professional Codec Features.

aa369731 int Coeff[64] int Coeff

Describes an action requested by an output trust authority (OTA). The request is sent to an input trust authority (ITA).

ms695312 MFINPUTTRUSTAUTHORITY_ACCESS_ACTION MFINPUTTRUSTAUTHORITY_ACCESS_ACTION

Specifies the action as a member of the enumeration.

ms695312 MFPOLICYMANAGER_ACTION Action MFPOLICYMANAGER_ACTION Action

Pointer to a buffer that contains a ticket object, provided by the OTA.

ms695312 unsigned char* pbTicket unsigned char pbTicket

Size of the ticket object, in bytes.

ms695312 unsigned int cbTicket unsigned int cbTicket

Contains parameters for the or method.

ms697403 MFINPUTTRUSTAUTHORITY_ACCESS_PARAMS MFINPUTTRUSTAUTHORITY_ACCESS_PARAMS
No documentation. ms697403 unsigned int dwSize unsigned int dwSize No documentation. ms697403 unsigned int dwVer unsigned int dwVer No documentation. ms697403 unsigned int cbSignatureOffset unsigned int cbSignatureOffset No documentation. ms697403 unsigned int cbSignatureSize unsigned int cbSignatureSize No documentation. ms697403 unsigned int cbExtensionOffset unsigned int cbExtensionOffset No documentation. ms697403 unsigned int cbExtensionSize unsigned int cbExtensionSize No documentation. ms697403 unsigned int cActions unsigned int cActions No documentation. ms697403 MFINPUTTRUSTAUTHORITY_ACCESS_ACTION rgOutputActions[1] MFINPUTTRUSTAUTHORITY_ACCESS_ACTION rgOutputActions

Specifies the buffering requirements of a file.

This structure describes the buffering requirements for content encoded at the bit rate specified in the dwBitrate. The msBufferWindow member indicates how much data should be buffered before starting playback. The size of the buffer in bytes is msBufferWinow?dwBitrate / 8000.

aa371870 MF_LEAKY_BUCKET_PAIR MF_LEAKY_BUCKET_PAIR

Bit rate, in bits per second.

aa371870 unsigned int dwBitrate unsigned int dwBitrate

Size of the buffer window, in milliseconds.

aa371870 unsigned int msBufferWindow unsigned int msBufferWindow

Contains encoding statistics from the Digital Living Network Alliance (DLNA) media sink.

This structure is used with the attribute.

dd388511 MFMPEG2DLNASINKSTATS MFMPEG2DLNASINKSTATS
No documentation. dd388511 unsigned longlong cBytesWritten unsigned longlong cBytesWritten No documentation. dd388511 BOOL fPAL BOOL fPAL No documentation. dd388511 unsigned int fccVideo unsigned int fccVideo No documentation. dd388511 unsigned int dwVideoWidth unsigned int dwVideoWidth No documentation. dd388511 unsigned int dwVideoHeight unsigned int dwVideoHeight No documentation. dd388511 unsigned longlong cVideoFramesReceived unsigned longlong cVideoFramesReceived No documentation. dd388511 unsigned longlong cVideoFramesEncoded unsigned longlong cVideoFramesEncoded No documentation. dd388511 unsigned longlong cVideoFramesSkipped unsigned longlong cVideoFramesSkipped No documentation. dd388511 unsigned longlong cBlackVideoFramesEncoded unsigned longlong cBlackVideoFramesEncoded No documentation. dd388511 unsigned longlong cVideoFramesDuplicated unsigned longlong cVideoFramesDuplicated No documentation. dd388511 unsigned int cAudioSamplesPerSec unsigned int cAudioSamplesPerSec No documentation. dd388511 unsigned int cAudioChannels unsigned int cAudioChannels No documentation. dd388511 unsigned longlong cAudioBytesReceived unsigned longlong cAudioBytesReceived No documentation. dd388511 unsigned longlong cAudioFramesEncoded unsigned longlong cAudioFramesEncoded

Contains format data for a binary stream in an Advanced Streaming Format (ASF) file.

This structure is used with the media type attribute.

This structure corresponds to the first 60 bytes of the Type-Specific Data field of the Stream Properties Object, in files where the stream type is ASF_Binary_Media. For more information, see the ASF specification.

The Format Data field of the Type-Specific Data field is contained in the attribute of the media type.

dd388931 MT_ARBITRARY_HEADER MT_ARBITRARY_HEADER

Major media type. This value is the stored in the Major Media Type field of the Type-Specific Data field of the ASF file. It might not match the major type from the Media Foundation media type.

dd388931 GUID majortype GUID majortype

Media subtype.

dd388931 GUID subtype GUID subtype

If TRUE, samples have a fixed size in bytes. Otherwise, samples have variable size.

dd388931 BOOL bFixedSizeSamples BOOL bFixedSizeSamples

If TRUE, the data in this stream uses temporal compression. Otherwise, samples are independent of each other.

dd388931 BOOL bTemporalCompression BOOL bTemporalCompression

If bFixedSizeSamples is TRUE, this member specifies the sample size in bytes. Otherwise, the value is ignored and should be 0.

dd388931 unsigned int lSampleSize unsigned int lSampleSize

Format type . This identifies the structure of the additional format data, which is stored in the attribute of the media type. If no additional format data is present, formattype equals GUID_NULL.

dd388931 GUID formattype GUID formattype

Defines custom color primaries for a video source. The color primaries define how to convert colors from RGB color space to CIE XYZ color space.

This structure is used with the attribute.

ms696187 MT_CUSTOM_VIDEO_PRIMARIES MT_CUSTOM_VIDEO_PRIMARIES

Red x-coordinate.

ms696187 float fRx float fRx

Red y-coordinate.

ms696187 float fRy float fRy

Green x-coordinate.

ms696187 float fGx float fGx

Green y-coordinate.

ms696187 float fGy float fGy

Blue x-coordinate.

ms696187 float fBx float fBx

Blue y-coordinate.

ms696187 float fBy float fBy

White point x-coordinate.

ms696187 float fWx float fWx

White point y-coordinate.

ms696187 float fWy float fWy

Contains the authentication information for the credential manager.

ms701554 MFNetCredentialManagerGetParam MFNetCredentialManagerGetParam

The response code of the authentication challenge. For example, NS_E_PROXY_ACCESSDENIED.

ms701554 HRESULT hrOp HRESULT hrOp

Set this flag to TRUE if the currently logged on user's credentials should be used as the default credentials.

ms701554 BOOL fAllowLoggedOnUser BOOL fAllowLoggedOnUser

If TRUE, the authentication package will send unencrypted credentials over the network. Otherwise, the authentication package encrypts the credentials.

ms701554 BOOL fClearTextPackage BOOL fClearTextPackage

The original URL that requires authentication.

ms701554 const wchar_t* pszUrl wchar_t pszUrl

The name of the site or proxy that requires authentication.

ms701554 const wchar_t* pszSite wchar_t pszSite

The name of the realm for this authentication.

ms701554 const wchar_t* pszRealm wchar_t pszRealm

The name of the authentication package. For example, "Digest" or "MBS_BASIC".

ms701554 const wchar_t* pszPackage wchar_t pszPackage

The number of times that the credential manager should retry after authentication fails.

ms701554 int nRetries int nRetries

Specifies a rectangular area within a video frame.

ms703850 MFOffset MFOffset

An structure that contains the x-coordinate of the upper-left corner of the rectangle. This coordinate might have a fractional value.

ms703850 unsigned short fract unsigned short fract

An structure that contains the y-coordinate of the upper-left corner of the rectangle. This coordinate might have a fractional value.

ms703850 short value short value

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent if the application plays a media file from a server that requires authentication. The application can respond by providing the user credentials.

To get a reference to this structure, cast the pEventHeader parameter of the callback method. You can use the MFP_GET_ACQUIRE_USER_CREDENTIAL_EVENT macro for this purpose.

If the flags member contains the flag, the application should do the following:

  1. Prompt the user to enter a user name and password.
  2. Store the user name in the credentials object by calling on the pCredential reference.
  3. Store the password by calling on the pCredential reference.

To cancel authentication, set fProceedWithAuthentication equal to .

By default, MFPlay uses the network source's implementation of to manage credentials. An application can provide its own implementation of this interface as follows:

  1. Call QueryInterface on the reference to get the interface.
  2. Call IPropertyStore::SetValue to set the MFNETSOURCE_CREDENTIAL_MANAGER property.
dd375527 MFP_ACQUIRE_USER_CREDENTIAL_EVENT MFP_ACQUIRE_USER_CREDENTIAL_EVENT
No documentation. dd375527 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375527 ULONG_PTR dwUserData ULONG_PTR dwUserData No documentation. dd375527 BOOL fProceedWithAuthentication BOOL fProceedWithAuthentication No documentation. dd375527 HRESULT hrAuthenticationStatus HRESULT hrAuthenticationStatus No documentation. dd375527 const wchar_t* pwszURL wchar_t pwszURL No documentation. dd375527 const wchar_t* pwszSite wchar_t pwszSite No documentation. dd375527 const wchar_t* pwszRealm wchar_t pwszRealm No documentation. dd375527 const wchar_t* pwszPackage wchar_t pwszPackage No documentation. dd375527 int nRetries int nRetries No documentation. dd375527 unsigned int flags unsigned int flags No documentation. dd375527 IMFNetCredential* pCredential IMFNetCredential pCredential

Contains one palette entry in a color table.

This union can be used to represent both RGB palettes and Y'Cb'Cr' palettes. The video format that defines the palette determines which union member should be used.

ms698970 MFPaletteEntry MFPaletteEntry

structure that contains an RGB color.

ms698970 MFARGB ARGB MFARGB ARGB

structure that contains a Y'Cb'Cr' color.

ms698970 MFAYUVSample AYCbCr MFAYUVSample AYCbCr

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent if an error occurs during playback.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_ERROR_EVENT macro for this purpose.

This event is not used to signal the failure of an asynchronous method. If an asynchronous method fails, the error is reported in the standard event listed for that method. The event is used for errors that happen outside the context of an asynchronous method call.

dd375530 MFP_ERROR_EVENT MFP_ERROR_EVENT
No documentation. dd375530 MFP_EVENT_HEADER header MFP_EVENT_HEADER header

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Contains information that is common to every type of MFPlay event.

dd375531 MFP_EVENT_HEADER MFP_EVENT_HEADER
No documentation. dd375531 MFP_EVENT_TYPE eEventType MFP_EVENT_TYPE eEventType No documentation. dd375531 HRESULT hrEvent HRESULT hrEvent No documentation. dd375531 IMFPMediaPlayer* pMediaPlayer IMFPMediaPlayer pMediaPlayer No documentation. dd375531 MFP_MEDIAPLAYER_STATE eState MFP_MEDIAPLAYER_STATE eState No documentation. dd375531 IPropertyStore* pPropertyStore IPropertyStore pPropertyStore

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the method completes.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_FRAME_STEP_EVENT macro for this purpose.

dd375533 MFP_FRAME_STEP_EVENT MFP_FRAME_STEP_EVENT
No documentation. dd375533 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375533 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the method completes.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_MEDIAITEM_CLEARED_EVENT macro for this purpose.

dd375549 MFP_MEDIAITEM_CLEARED_EVENT MFP_MEDIAITEM_CLEARED_EVENT
No documentation. dd375549 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375549 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the or method completes.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_MEDIAITEM_CREATED_EVENT macro for this purpose.

Media items are created asynchronously. If multiple items are created, the operations can complete in any order, not necessarily in the same order as the method calls. You can use the dwUserData member to identify the items, if you have simultaneous requests pending.

dd375560 MFP_MEDIAITEM_CREATED_EVENT MFP_MEDIAITEM_CREATED_EVENT
No documentation. dd375560 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375560 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem No documentation. dd375560 ULONG_PTR dwUserData ULONG_PTR dwUserData

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the method completes.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_MEDIAITEM_SET_EVENT macro for this purpose.

If one or more streams could not be connected to a media sink, the event property store contains the MFP_PKEY_StreamRenderingResults property. The value of the property is an array of values, indicating which streams were connected successfully. The event property store can be accessed through the header.pPropertyStore member.

dd375561 MFP_MEDIAITEM_SET_EVENT MFP_MEDIAITEM_SET_EVENT
No documentation. dd375561 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375561 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. The MFPlay player object uses this event to forward certain events from the Media Foundation pipeline to the application.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_MF_EVENT macro for this purpose.

If MFEventType is , the following property may be stored in the event property store, which can be accessed through the header.pPropertyStore member.

PropertyDescription
MFP_PKEY_StreamIndex The index of the stream whose format changed.

?

dd375563 MFP_MF_EVENT MFP_MF_EVENT
No documentation. dd375563 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375563 unsigned int MFEventType unsigned int MFEventType No documentation. dd375563 IMFMediaEvent* pMFMediaEvent IMFMediaEvent pMFMediaEvent No documentation. dd375563 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the method completes.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_PAUSE_EVENT macro for this purpose.

dd375564 MFP_PAUSE_EVENT MFP_PAUSE_EVENT
No documentation. dd375564 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375564 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the current media item finishes playing.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_PLAYBACK_ENDED_EVENT macro for this purpose.

dd375566 MFP_PLAYBACK_ENDED_EVENT MFP_PLAYBACK_ENDED_EVENT
No documentation. dd375566 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375566 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the method completes.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_PLAY_EVENT macro for this purpose.

dd375567 MFP_PLAY_EVENT MFP_PLAY_EVENT
No documentation. dd375567 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375567 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the method completes.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_POSITION_SET_EVENT macro for this purpose.

dd375568 MFP_POSITION_SET_EVENT MFP_POSITION_SET_EVENT
No documentation. dd375568 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375568 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the method completes.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_RATE_SET_EVENT macro for this purpose.

dd375569 MFP_RATE_SET_EVENT MFP_RATE_SET_EVENT
No documentation. dd375569 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375569 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem No documentation. dd375569 float flRate float flRate

Important??Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

Event structure for the event. This event is sent when the method completes.

To get a reference to this structure, cast the pEventHeader parameter of the method. You can use the MFP_GET_STOP_EVENT macro for this purpose.

dd375570 MFP_STOP_EVENT MFP_STOP_EVENT
No documentation. dd375570 MFP_EVENT_HEADER header MFP_EVENT_HEADER header No documentation. dd375570 IMFPMediaItem* pMediaItem IMFPMediaItem pMediaItem

Represents a ratio.

aa473788 MFRatio MFRatio

Numerator of the ratio.

aa473788 unsigned int Numerator unsigned int Numerator

Denominator of the ratio.

aa473788 unsigned int Denominator unsigned int Denominator

Contains information about a revoked component.

aa376487 MFRR_COMPONENT_HASH_INFO MFRR_COMPONENT_HASH_INFO

Specifies the reason for the revocation. The following values are defined.

ValueMeaning
MF_BOOT_DRIVER_VERIFICATION_FAILED

A boot driver could not be verified.

MF_COMPONENT_CERT_REVOKED

A certificate in a trusted component's certificate chain was revoked.

MF_COMPONENT_HS_CERT_REVOKED

The high-security certificate for authenticating the protected environment (PE) was revoked.

The high-security certificate is typically used by ITAs that handle high-definition content and next-generation formats such as HD-DVD.

MF_COMPONENT_INVALID_EKU

A certificate's extended key usage (EKU) object is invalid.

MF_COMPONENT_INVALID_ROOT

The root certificate is not valid.

MF_COMPONENT_LS_CERT_REVOKED

The low-security certificate for authenticating the PE was revoked.

The low-security certificate is typically used by ITAs that handle standard-definition content and current-generation formats.

MF_COMPONENT_REVOKED

A trusted component was revoked.

MF_GRL_ABSENT

The GRL was not found.

MF_GRL_LOAD_FAILED

Could not load the global revocation list (GRL).

MF_INVALID_GRL_SIGNATURE

The GRL signature is invalid.

MF_MINCRYPT_FAILURE

A certificate chain was not well-formed, or a boot driver is unsigned or is signed with an untrusted certificate.

MF_TEST_SIGNED_COMPONENT_LOADING

A component was signed by a test certificate.

?

In addition, one of the following flags might be present, indicating the type of component that failed to load.

ValueMeaning
MF_USER_MODE_COMPONENT_LOAD

User-mode component.

MF_KERNEL_MODE_COMPONENT_LOAD

Kernel-mode component.

?

aa376487 unsigned int ulReason unsigned int ulReason

Contains a hash of the file header.

aa376487 wchar_t rgHeaderHash[43] wchar_t rgHeaderHash

Contains a hash of the public key in the component's certificate.

aa376487 wchar_t rgPublicKeyHash[43] wchar_t rgPublicKeyHash

File name of the revoked component.

aa376487 wchar_t wszName[260] wchar_t wszName

Contains information about one or more revoked components.

aa375568 MFRR_COMPONENTS MFRR_COMPONENTS

Revocation information version.

aa375568 unsigned int dwRRInfoVersion unsigned int dwRRInfoVersion

Number of elements in the pRRComponents array.

aa375568 unsigned int dwRRComponents unsigned int dwRRComponents

Array of structures.

aa375568 MFRR_COMPONENT_HASH_INFO* pRRComponents MFRR_COMPONENT_HASH_INFO pRRComponents

Contains statistics about the performance of the sink writer.

dd375769 MF_SINK_WRITER_STATISTICS MF_SINK_WRITER_STATISTICS

The size of the structure, in bytes.

dd375769 unsigned int cb unsigned int cb

The time stamp of the most recent sample given to the sink writer. The sink writer updates this value each time the application calls .

dd375769 longlong llLastTimestampReceived longlong llLastTimestampReceived

The time stamp of the most recent sample to be encoded. The sink writer updates this value whenever it calls on the encoder.

dd375769 longlong llLastTimestampEncoded longlong llLastTimestampEncoded

The time stamp of the most recent sample given to the media sink. The sink writer updates this value whenever it calls on the media sink.

dd375769 longlong llLastTimestampProcessed longlong llLastTimestampProcessed

The time stamp of the most recent stream tick. The sink writer updates this value whenever the application calls .

dd375769 longlong llLastStreamTickReceived longlong llLastStreamTickReceived

The system time of the most recent sample request from the media sink. The sink writer updates this value whenever it receives an event from the media sink. The value is the current system time.

dd375769 longlong llLastSinkSampleRequest longlong llLastSinkSampleRequest

The number of samples received.

dd375769 unsigned longlong qwNumSamplesReceived unsigned longlong qwNumSamplesReceived

The number of samples encoded.

dd375769 unsigned longlong qwNumSamplesEncoded unsigned longlong qwNumSamplesEncoded

The number of samples given to the media sink.

dd375769 unsigned longlong qwNumSamplesProcessed unsigned longlong qwNumSamplesProcessed

The number of stream ticks received.

dd375769 unsigned longlong qwNumStreamTicksReceived unsigned longlong qwNumStreamTicksReceived

The amount of data, in bytes, currently waiting to be processed.

dd375769 unsigned int dwByteCountQueued unsigned int dwByteCountQueued

The total amount of data, in bytes, that has been sent to the media sink.

dd375769 unsigned longlong qwByteCountProcessed unsigned longlong qwByteCountProcessed

The number of pending sample requests.

dd375769 unsigned int dwNumOutstandingSinkSampleRequests unsigned int dwNumOutstandingSinkSampleRequests

The average rate, in media samples per 100-nanoseconds, at which the application sent samples to the sink writer.

dd375769 unsigned int dwAverageSampleRateReceived unsigned int dwAverageSampleRateReceived

The average rate, in media samples per 100-nanoseconds, at which the sink writer sent samples to the encoder.

dd375769 unsigned int dwAverageSampleRateEncoded unsigned int dwAverageSampleRateEncoded

The average rate, in media samples per 100-nanoseconds, at which the sink writer sent samples to the media sink.

dd375769 unsigned int dwAverageSampleRateProcessed unsigned int dwAverageSampleRateProcessed

Not for application use.

This structure is used internally by the Microsoft Media Foundation AVStream proxy.

dd940437 STREAM_MEDIUM STREAM_MEDIUM

Reserved.

dd940437 GUID gidMedium GUID gidMedium

Reserved.

dd940437 unsigned int unMediumInstance unsigned int unMediumInstance

Contains information about an input stream on a Media Foundation transform (MFT). To get these values, call .

Before the media types are set, the only values that should be considered valid are the and flags in the dwFlags member.

  • The flag indicates that the stream can be deleted.

  • The flag indicates that the stream is optional and does not require a media type.

After you set a media type on all of the input and output streams (not including optional streams), all of the values returned by the GetInputStreamInfo method are valid. They might change if you set different media types.

ms704067 MFT_INPUT_STREAM_INFO MFT_INPUT_STREAM_INFO
No documentation. ms704067 longlong hnsMaxLatency longlong hnsMaxLatency No documentation. ms704067 unsigned int dwFlags unsigned int dwFlags No documentation. ms704067 unsigned int cbSize unsigned int cbSize No documentation. ms704067 unsigned int cbMaxLookahead unsigned int cbMaxLookahead No documentation. ms704067 unsigned int cbAlignment unsigned int cbAlignment

Specifies a new attribute value for a topology node.

Due to an error in the structure declaration, the u64 member is declared as a 32-bit integer, not a 64-bit integer. Therefore, any 64-bit value passed to the method is truncated to 32 bits.

aa371336 MFTOPONODE_ATTRIBUTE_UPDATE MFTOPONODE_ATTRIBUTE_UPDATE

The identifier of the topology node to update. To get the identifier of a topology node, call .

aa371336 unsigned longlong NodeId unsigned longlong NodeId

that specifies the attribute to update.

aa371336 GUID guidAttributeKey GUID guidAttributeKey

Attribute type, specified as a member of the enumeration.

aa371336 MF_ATTRIBUTE_TYPE attrType MF_ATTRIBUTE_TYPE attrType

Attribute value (unsigned 32-bit integer). This member is used when attrType equals .

aa371336 unsigned int u32 unsigned int u32

Attribute value (unsigned 32-bit integer). This member is used when attrType equals . See Remarks.

aa371336 unsigned longlong u64 unsigned longlong u64

Attribute value (floating point). This member is used when attrType equals .

aa371336 double d double d

Contains information about an output buffer for a Media Foundation transform. This structure is used in the method.

You must provide an structure for each selected output stream.

MFTs can support two different allocation models for output samples:

  • The MFT allocates the output sample.
  • The client allocates the output sample.

To find which model the MFT supports for a given output stream, call and check the value of dwFlags.

FlagAllocation Model
The MFT allocates the output samples for the stream. Set pSample to null for this stream.
The MFT supports both allocation models.
Neither (default)The client must allocate the output samples for the stream.

?

The behavior of ProcessOutput depends on the initial value of pSample and the value of the dwFlags parameter in the ProcessOutput method.

  • If pSample is null and dwFlags contains the flag, the MFT discards the output data.

    Restriction: This output stream must have the or flag. (To get the flags for the output stream, call the method.)

  • If pSample is null and dwFlags does not contain the , the MFT provides a sample for the output data. The MFT sets pSample to point to the sample that it provides. The MFT can either allocate a new sample or re-use an input sample.

    Restriction: This output stream must have the or flag.

  • If pSample is non-null, the MFT uses the sample provided by the caller.

    Restriction: This output stream must not have the flag.

Any other combinations are invalid and cause ProcessOutput to return E_INVALIDARG.

Each call to ProcessOutput can produce zero or more events and up to one sample per output stream.

ms697247 MFT_OUTPUT_DATA_BUFFER MFT_OUTPUT_DATA_BUFFER
No documentation. ms697247 unsigned int dwStreamID unsigned int dwStreamID No documentation. ms697247 IMFSample* pSample IMFSample pSample No documentation. ms697247 unsigned int dwStatus unsigned int dwStatus No documentation. ms697247 IMFCollection* pEvents IMFCollection pEvents

Contains information about an output stream on a Media Foundation transform (MFT). To get these values, call .

Before the media types are set, the only values that should be considered valid is the flag in the dwFlags member. This flag indicates that the stream is optional and does not require a media type.

After you set a media type on all of the input and output streams (not including optional streams), all of the values returned by the GetOutputStreamInfo method are valid. They might change if you set different media types.

ms696974 MFT_OUTPUT_STREAM_INFO MFT_OUTPUT_STREAM_INFO
No documentation. ms696974 unsigned int dwFlags unsigned int dwFlags No documentation. ms696974 unsigned int cbSize unsigned int cbSize No documentation. ms696974 unsigned int cbAlignment unsigned int cbAlignment

Contains information about the audio and video streams for the transcode sink activation object.

To get the information stored in this structure, call .

The method assigns references to the pAudioMediaType and pVideoMediaType members of this structure. The method might set either member to null. If either member is non-null after the method returns, the caller must release the references.

dd388923 MF_TRANSCODE_SINK_INFO MF_TRANSCODE_SINK_INFO
No documentation. dd388923 unsigned int dwVideoStreamID unsigned int dwVideoStreamID No documentation. dd388923 IMFMediaType* pVideoMediaType IMFMediaType pVideoMediaType No documentation. dd388923 unsigned int dwAudioStreamID unsigned int dwAudioStreamID No documentation. dd388923 IMFMediaType* pAudioMediaType IMFMediaType pAudioMediaType

Contains media type information for registering a Media Foundation transform (MFT).

ms694919 MFT_REGISTER_TYPE_INFO MFT_REGISTER_TYPE_INFO

The major media type. For a list of possible values, see Major Media Types.

ms694919 GUID guidMajorType GUID guidMajorType

The media subtype. For a list of possible values, see the following topics:

  • Audio Subtype GUIDs
  • Video Subtype GUIDs
ms694919 GUID guidSubtype GUID guidSubtype

Contains parameters for the method.

dd388673 MFT_REGISTRATION_INFO MFT_REGISTRATION_INFO
No documentation. dd388673 GUID clsid GUID clsid No documentation. dd388673 GUID guidCategory GUID guidCategory No documentation. dd388673 unsigned int uiFlags unsigned int uiFlags No documentation. dd388673 const wchar_t* pszName wchar_t pszName No documentation. dd388673 unsigned int cInTypes unsigned int cInTypes No documentation. dd388673 MFT_REGISTER_TYPE_INFO* pInTypes MFT_REGISTER_TYPE_INFO pInTypes No documentation. dd388673 unsigned int cOutTypes unsigned int cOutTypes No documentation. dd388673 MFT_REGISTER_TYPE_INFO* pOutTypes MFT_REGISTER_TYPE_INFO pOutTypes

Specifies a bitmap for the enhanced video renderer (EVR) to alpha-blend with the video.

To specify a GDI bitmap, create a device context and call SelectObject to select the bitmap into the DC. Then set the hdc member of the structure equal to the handle to the DC and set the GetBitmapFromDC member to TRUE.

ms697428 MFVideoAlphaBitmap MFVideoAlphaBitmap

If TRUE, the hdc member is used. Otherwise, the pDDs member is used.

ms697428 BOOL GetBitmapFromDC BOOL GetBitmapFromDC

A union that contains the following members.

hdc

Handle to the device context (DC) of a GDI bitmap. If GetBitmapFromDC is , this member is ignored.

pDDs

Pointer to the interface of a Direct3D surface that contains the bitmap. If GetBitmapFromDC is TRUE, this member is ignored.

ms697428 MFVideoAlphaBitmap_INNER_0 bitmap MFVideoAlphaBitmap_INNER_0 bitmap

structure that specifies the parameters for the alpha-blending operation.

ms697428 MFVideoAlphaBitmapParams params MFVideoAlphaBitmapParams params

Specifies a bitmap for the enhanced video renderer (EVR) to alpha-blend with the video.

To specify a GDI bitmap, create a device context and call SelectObject to select the bitmap into the DC. Then set the hdc member of the structure equal to the handle to the DC and set the GetBitmapFromDC member to TRUE.

ms697428 MFVideoAlphaBitmap_INNER_0 MFVideoAlphaBitmap_INNER_0

If TRUE, the hdc member is used. Otherwise, the pDDs member is used.

ms697428 HDC hdc HDC hdc

A union that contains the following members.

hdc

Handle to the device context (DC) of a GDI bitmap. If GetBitmapFromDC is , this member is ignored.

pDDs

Pointer to the interface of a Direct3D surface that contains the bitmap. If GetBitmapFromDC is TRUE, this member is ignored.

ms697428 IDirect3DSurface9* pDDS IDirect3DSurface9 pDDS

Specifies how the enhanced video renderer (EVR) alpha-blends a bitmap with the video.

ms696249 MFVideoAlphaBitmapParams MFVideoAlphaBitmapParams

Bitwise OR of one or more flags from the enumeration. These flags indicate which of the other structure members contain valid information.

ms696249 unsigned int dwFlags unsigned int dwFlags

Source color key. This member is used if the dwFlags member contains the flag. Any pixels in the bitmap that match the color key are rendered as transparent pixels.

You cannot specify a color key if you are alpha-blending a Direct3D surface with per-pixel alpha ().

ms696249 COLORREF clrSrcKey COLORREF clrSrcKey

Source rectangle. The source rectangle defines the region of the bitmap that is alpha-blended with the video. The source rectangle is given in pixels and is relative to the original bitmap.

If you are alpha-blending a GDI bitmap, you must fill in this structure when you call .

If you are alpha-blending a Direct3D surface and the dwFlags member contains the flag, the rcSrc member is ignored. If the flag is absent, you must fill in the rcSrc member.

After setting the initiali bitmap, you can update the source rectangle by calling . To update the source rectangle, set the flag in the dwFlags member.

The source rectangle cannot be an empty rectangle, and cannot exceed the bounds of the bitmap.

ms696249 RECT rcSrc RECT rcSrc

Destination rectangle. The destination rectangle defines the region of the composited video image that receives the alpha-blended bitmap. The destination rectangle is specified as a normalized rectangle using the structure.

This member is used if the dwFlags member contains the flag. Otherwise, the default destination rectangle is {0, 0, 1, 1}.

ms696249 MFVideoNormalizedRect nrcDest MFVideoNormalizedRect nrcDest

Alpha blending value. This member is used if the dwFlags member contains the flag. Otherwise, the default value is 1.0 (opaque). The valid range is 0.0 to 1.0, inclusive.

This value is applied to the entire bitmap image. To create transparent regions, use the clrSrcKey member or use a DirectDraw surface with per-pixel alpha.

ms696249 float fAlpha float fAlpha

Direct3D filtering mode to use when performing the alpha-blend operation. Specify the filter mode as a value. For more information, see the Direct3D documentation.

This member is used if the dwFlags member contains the flag. Otherwise, the default value is .

Point filtering is particularly useful for images that contain text and will not be stretched.

ms696249 unsigned int dwFilterMode unsigned int dwFilterMode

Specifies a rectangular area within a video frame.

ms703850 MFVideoArea MFVideoArea

An structure that contains the x-coordinate of the upper-left corner of the rectangle. This coordinate might have a fractional value.

ms703850 MFOffset OffsetX MFOffset OffsetX

An structure that contains the y-coordinate of the upper-left corner of the rectangle. This coordinate might have a fractional value.

ms703850 MFOffset OffsetY MFOffset OffsetY

A structure that contains the width and height of the rectangle.

ms703850 SIZE Area SIZE Area

Contains information about a video compression format. This structure is used in the structure.

For uncompressed video formats, set the structure members to zero.

aa473839 MFVideoCompressedInfo MFVideoCompressedInfo
No documentation. aa473839 longlong AvgBitrate longlong AvgBitrate No documentation. aa473839 longlong AvgBitErrorRate longlong AvgBitErrorRate No documentation. aa473839 unsigned int MaxKeyFrameSpacing unsigned int MaxKeyFrameSpacing

Describes a video format.

Applications should avoid using this structure. Instead, it is recommended that applications use attributes to describe the video format. For a list of media type attributes, see Media Type Attributes. With attributes, you can set just the format information that you know, which is easier (and more likely to be accurate) than trying to fill in complete format information for the structure.

To initialize a media type object from an structure, call .

You can use the structure as the format block for a DirectShow media type. Set the format to FORMAT_MFVideoFormat.

aa473808 MFVIDEOFORMAT MFVIDEOFORMAT

Size of the structure, in bytes. This value includes the size of the palette entries that may appear after the surfaceInfo member.

aa473808 unsigned int dwSize unsigned int dwSize

structure. This structure contains information that applies to both compressed and uncompressed formats.

aa473808 MFVideoInfo videoInfo MFVideoInfo videoInfo

Video subtype. See Video Subtype GUIDs.

aa473808 GUID guidFormat GUID guidFormat

structure. This structure contains information that applies only to compressed formats.

aa473808 MFVideoCompressedInfo compressedInfo MFVideoCompressedInfo compressedInfo

structure. This structure contains information that applies only to uncompressed formats.

aa473808 MFVideoSurfaceInfo surfaceInfo MFVideoSurfaceInfo surfaceInfo

Contains video format information that applies to both compressed and uncompressed formats.

This structure is used in the structure.

Developers are encouraged to use media type attributes instead of using the structure. The following table lists the attributes that correspond to the members of this structure.

Structure MemberMedia Type Attribute
dwWidth, dwHeight
PixelAspectRatio
SourceChromaSubsampling
InterlaceMode
TransferFunction
ColorPrimaries
TransferMatrix
SourceLighting
FramesPerSecond
NominalRange
GeometricAperture
MinimumDisplayAperture
PanScanAperture
VideoFlagsSee .

?

aa473804 MFVideoInfo MFVideoInfo
No documentation. aa473804 unsigned int dwWidth unsigned int dwWidth No documentation. aa473804 unsigned int dwHeight unsigned int dwHeight No documentation. aa473804 MFRatio PixelAspectRatio MFRatio PixelAspectRatio No documentation. aa473804 MFVideoChromaSubsampling SourceChromaSubsampling MFVideoChromaSubsampling SourceChromaSubsampling No documentation. aa473804 MFVideoInterlaceMode InterlaceMode MFVideoInterlaceMode InterlaceMode No documentation. aa473804 MFVideoTransferFunction TransferFunction MFVideoTransferFunction TransferFunction No documentation. aa473804 MFVideoPrimaries ColorPrimaries MFVideoPrimaries ColorPrimaries No documentation. aa473804 MFVideoTransferMatrix TransferMatrix MFVideoTransferMatrix TransferMatrix No documentation. aa473804 MFVideoLighting SourceLighting MFVideoLighting SourceLighting No documentation. aa473804 MFRatio FramesPerSecond MFRatio FramesPerSecond No documentation. aa473804 MFNominalRange NominalRange MFNominalRange NominalRange No documentation. aa473804 MFVideoArea GeometricAperture MFVideoArea GeometricAperture No documentation. aa473804 MFVideoArea MinimumDisplayAperture MFVideoArea MinimumDisplayAperture No documentation. aa473804 MFVideoArea PanScanAperture MFVideoArea PanScanAperture No documentation. aa473804 unsigned longlong VideoFlags unsigned longlong VideoFlags

Defines a normalized rectangle, which is used to specify sub-rectangles in a video rectangle. When a rectangle N is normalized relative to some other rectangle R, it means the following:

  • The coordinate (0.0, 0.0) on N is mapped to the upper-left corner of R.

  • The coordinate (1.0, 1.0) on N is mapped to the lower-right corner of R.

Any coordinates of N that fall outside the range [0...1] are mapped to positions outside the rectangle R. A normalized rectangle can be used to specify a region within a video rectangle without knowing the resolution or even the aspect ratio of the video. For example, the upper-left quadrant is defined as {0.0, 0.0, 0.5, 0.5}.

ms703049 MFVideoNormalizedRect MFVideoNormalizedRect

X-coordinate of the upper-left corner of the rectangle.

ms703049 float left float left

Y-coordinate of the upper-left corner of the rectangle.

ms703049 float top float top

X-coordinate of the lower-right corner of the rectangle.

ms703049 float right float right

Y-coordinate of the lower-right corner of the rectangle.

ms703049 float bottom float bottom

Contains information about an uncompressed video format. This structure is used in the structure.

aa473817 MFVideoSurfaceInfo MFVideoSurfaceInfo
No documentation. aa473817 unsigned int Format unsigned int Format No documentation. aa473817 unsigned int PaletteEntries unsigned int PaletteEntries No documentation. aa473817 MFPaletteEntry Palette[1] MFPaletteEntry Palette Associate an attribute key with a type used to retrieve keys from a instance. Initializes a new instance of the struct. The attribute GUID. The attribute type. Initializes a new instance of the struct. The attribute GUID. The attribute type. The attribute name, useful for debugging. Gets the attribute GUID. The attribute GUID. Gets the attribute type. The attribute type. Gets the attribute name. Generic version of . Type of the value of this key. Initializes a new instance of the class. The attribute GUID. Initializes a new instance of the class. The GUID. The attribute name, useful for debugging. Initializes a new instance of the class. The GUID. Initializes a new instance of the class. The GUID. /// The attribute name, useful for debugging.

Applies to: desktop apps | Metro style apps

Initializes Microsoft Media Foundation.

If true, do not initialize the sockets library, else full initialization. Default is false ms702238 HRESULT MFStartup([In] unsigned int Version,[In] unsigned int dwFlags) MFStartup

An application must call this function before using Media Foundation. Before your application quits, call once for every previous call to .

Do not call or from work queue threads. For more information about work queues, see Work Queues.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.

Applies to: desktop apps | Metro style apps

Shuts down the Microsoft Media Foundation platform. Call this function once for every call to . Do not call this function from work queue threads.

If this function succeeds, it returns . Otherwise, it returns an error code.

This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows?XP with Service Pack?2 (SP2) and later.
  • Windows?XP Media Center Edition?2005 with KB900325 (Windows?XP Media Center Edition?2005) and KB925766 (October 2006 Update Rollup for Windows?XP Media Center Edition) installed.
ms694273 HRESULT MFShutdown() MFShutdown
Specialized callback for . This callback automatically starts the callback on the session, handles on invoke, dispatch the asynchronous event to an external action to be implemented by the client and stops the callback when the event is received. Initializes a new instance of the class. The session. The event callback. The object must be disposed by the callback when finished with it. session or eventCallback The namespace provides a managed MediaFoundation API. MediaFoundation MediaFoundation The namespace provides a managed MediaFoundation for OPM API. MediaFoundation MediaFoundation Resource characteristics returned by . hh447939 HRESULT IMFMediaEngineEx::GetResourceCharacteristics([Out] unsigned int* pCharacteristics) IMFMediaEngineEx::GetResourceCharacteristics None flag. The media resource represents a live data source, such as a video camera. If playback is stopped and then restarted, there will be a gap in the content. The media resource supports seeking. To get the seekable range, call IMFMediaEngine::GetSeekable. The media resource can be paused. Seeking this resource can take a long time. For example, it might download through HTTP. Return a pointer to the unmanaged version of this callback. The callback. A pointer to a shadow c++ callback HRESULT IMFVideoPresenter::ProcessMessage([In] MFVP_MESSAGE_TYPE eMessage,[In] ULONG_PTR ulParam) HRESULT GetCurrentMediaType([out] IMFVideoMediaType **ppMediaType) A Work Queue Identifier ms703102 Work Queue Identifiers Work Queue Identifiers The default queue associated to the . The identifier. Initializes a new instance of the struct. The id. Initializes a new instance of the struct. The id. Performs an implicit conversion from to . The id. The result of the conversion. Performs an implicit conversion from to . The type. The result of the conversion. Performs an explicit conversion from to . The work queue Id. The result of the conversion. Performs an explicit conversion from to . The work queue Id. The result of the conversion.