SharpDX.MediaFoundation

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] 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)
Creates an activation object for a Windows Runtime class.

The class identifier that is associated with the activatable runtime class.

An optional friendly name for the activation object. The friendly name is stored in the object's attribute. This parameter can be null.

To create the Windows Runtime object, call or IClassFactory::CreateInstance.

hh162753 HRESULT MFCreateMediaExtensionActivate([In] const wchar_t* szActivatableClassId,[In, Optional] IUnknown* pConfiguration,[In] const GUID& riid,[Out] void** ppvObject) MFCreateMediaExtensionActivate

Creates the object associated with this activation object.

Interface identifier (IID) of the requested interface.

A reference to the requested interface. The caller must release the interface.

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
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
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 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:

  • MFBeginCreateFile
  • MFCreateFile
  • MFCreateTempFile

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:

  • MFBeginCreateFile
  • MFCreateFile
  • MFCreateTempFile

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:

  • MFBeginCreateFile
  • MFCreateFile
  • MFCreateTempFile

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] 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 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) The namespace provides a managed MediaFoundation for DirectX integration API. MediaFoundation MediaFoundation The namespace provides a managed MediaFoundation for Dsp API. MediaFoundation MediaFoundation

Enables two threads to share the same Microsoft Direct3D?11 device.

This interface is exposed by the Microsoft DirectX Graphics Infrastructure (DXGI) Device Manager. To create the DXGI Device Manager, call the function.

When you create an with , a Direct3D?11 device is not associated with the device manager. To associate a Direct3D?11 device with the device manager, call , passing in the reference to the Direct3D?11 device. To create a Direct3D?11 device, call . The device should be created with the device creation flag which is defined in the enumeration.

For Microsoft Direct3D?9 devices, use the IDirect3DDeviceManager9 interface.

Windows Store apps must use and Direct3D 11 Video APIs.

hh447906 IMFDXGIDeviceManager IMFDXGIDeviceManager
A token that identifies this instance of the DXGI Device Manager. Use this token when calling

[This documentation is preliminary and is subject to change.]

Applies to: desktop apps | Metro style apps

Creates an instance of the Microsoft DirectX Graphics Infrastructure (DXGI) Device Manager.

hh162750 HRESULT MFCreateDXGIDeviceManager([Out] unsigned int* resetToken,[Out] IMFDXGIDeviceManager** ppDeviceManager) MFCreateDXGIDeviceManager

[This documentation is preliminary and is subject to change.]

Applies to: desktop apps | Metro style apps

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

A reference to the interface of the DXGI device.

When you first create the DXGI 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.

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

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

hh447911 HRESULT IMFDXGIDeviceManager::ResetDevice([In] IUnknown* pUnkDevice,[In] unsigned int resetToken) IMFDXGIDeviceManager::ResetDevice

[This documentation is preliminary and is subject to change.]

Applies to: desktop apps | Metro style apps

Unlocks the Microsoft Direct3D device.

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

Call this method to release the device after calling .

hh447913 HRESULT IMFDXGIDeviceManager::UnlockDevice([In] void* hDevice,[In] BOOL fSaveState) IMFDXGIDeviceManager::UnlockDevice
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.

Closes a Microsoft Direct3D device handle.

A handle to the Direct3D device.

This method can return one of these values.

Return codeDescription

Success.

E_HANDLE

The specified handle is not a Direct3D device handle.

?

Call this method to release a device handle that was retrieved by the method.

hh447907 HRESULT IMFDXGIDeviceManager::CloseDeviceHandle([In] void* hDevice) IMFDXGIDeviceManager::CloseDeviceHandle

Queries the Microsoft Direct3D device for an interface.

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

The interface identifier (IID) of the requested interface. The Direct3D device supports the following interfaces:

  • . To get a reference to the Direct3D11 device, use IID_ID3D11Device as the riid.
  • . To get a reference to the Direct3D11 video device, use IID_ID3D11VideoDevice as the riid.

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

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

For more info see, Supporting Direct3D 11 Video Decoding in Media Foundation.

hh447908 HRESULT IMFDXGIDeviceManager::GetVideoService([In] void* hDevice,[In] const GUID& riid,[Out] void** ppService) IMFDXGIDeviceManager::GetVideoService

Gives the caller exclusive access to the Microsoft Direct3D device.

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

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

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 parameter is , the method returns immediately with the error code DXVA2_E_VIDEO_DEVICE_LOCKED.

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

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

If the method returns , 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.

hh447909 HRESULT IMFDXGIDeviceManager::LockDevice([In] void* hDevice,[In] const GUID& riid,[Out] void** ppUnkDevice,[In] BOOL fBlock) IMFDXGIDeviceManager::LockDevice

Gets a handle to the Microsoft Direct3D device.

Receives the device handle.

hh447910 HRESULT IMFDXGIDeviceManager::OpenDeviceHandle([Out] void** phDevice) IMFDXGIDeviceManager::OpenDeviceHandle

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

A reference to the interface of the DXGI device.

The token that was received in the pResetToken parameter of the function.

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

When you first create the DXGI 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.

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

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

To create a Microsoft Direct3D?11 device, call .

The device should be created with the device creation flag which is defined in the enumeration.

It is recommended that you use multi-thread protection on the device context to prevent deadlock issues that can sometimes happen when you call or . To set multi-thread protection, first call QueryInterface on to get an reference. Then call , passing in true for bMTProtect.

hh447911 HRESULT IMFDXGIDeviceManager::ResetDevice([In] IUnknown* pUnkDevice,[In] unsigned int resetToken) IMFDXGIDeviceManager::ResetDevice

Tests whether a Microsoft Direct3D device handle is valid.

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

This method can return one of these values.

Return codeDescription

Success.

E_HANDLE

The specified handle is not a Direct3D device handle.

The device handle is invalid.

?

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

hh447912 HRESULT IMFDXGIDeviceManager::TestDevice([In] void* hDevice) IMFDXGIDeviceManager::TestDevice

Unlocks the Microsoft Direct3D device.

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

Reserved.

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

Call this method to release the device after calling .

hh447913 HRESULT IMFDXGIDeviceManager::UnlockDevice([In] void* hDevice,[In] BOOL fSaveState) IMFDXGIDeviceManager::UnlockDevice

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::GetObject([Out] IUnknown** ppObject) IMFAsyncResult::GetObject

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

Creates an instance of the Media Engine.

Before using this interface, call CoInitializeEx and .

To get a reference to this interface, call CoCreateInstance. The class identifier is .

hh447919 IMFMediaEngineClassFactory IMFMediaEngineClassFactory
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. Constant ClsidMFMediaEngineClassFactory. CLSID_MFMediaEngineClassFactory

Creates a new instance of the Media Engine.

A bitwise OR of zero or more flags from the enumeration.

A reference to the interface of an attribute store.

This parameter specifies configuration attributes for the Media Engine. Call to create the attribute store. Then, set one or more attributes from the list of Media Engine Attributes. For details, see Remarks.

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

This method can return one of these values.

Return codeDescription

Success.

A required attribute was missing from pAttr, or an invalid combination of attributes was used.

?

Before calling this method, call .

The Media Engine supports three distinct modes:

ModeDescription
Frame-server mode

In this mode, the Media Engine delivers uncompressed video frames to the application. The application is responsible for displaying each frame, using Microsoft Direct3D or any other rendering technique.

The Media Engine renders the audio; the application is not responsible for audio rendering.

Frame-server mode is the default mode.

Rendering mode

In this mode, the Media Engine renders both audio and video. The video is rendered to a window or Microsoft DirectComposition visual provided by the application.

To enable rendering mode, set either the MF_MEDIA_ENGINE_PLAYBACK_HWND attribute or the MF_MEDIA_ENGINE_PLAYBACK_VISUAL attribute.

Audio mode

In this mode, the Media Engine renders audio only, with no video.

To enable audio mode, set the flag in the dwFlags parameter.

?

hh447921 HRESULT IMFMediaEngineClassFactory::CreateInstance([In] MF_MEDIA_ENGINE_CREATEFLAGS dwFlags,[In] IMFAttributes* pAttr,[Out, Fast] IMFMediaEngine** ppPlayer) IMFMediaEngineClassFactory::CreateInstance

Creates a time range object.

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

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

hh447922 HRESULT IMFMediaEngineClassFactory::CreateTimeRange([Out, Fast] IMFMediaTimeRange** ppTimeRange) IMFMediaEngineClassFactory::CreateTimeRange

Creates a media error object.

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

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

hh447920 HRESULT IMFMediaEngineClassFactory::CreateError([Out, Fast] IMFMediaError** ppError) IMFMediaEngineClassFactory::CreateError

Extends the interface.

The interface contains methods that map to the HTML5 media elements. The provides additional functionality that does not correspond directly to HTML5.

hh447923 IMFMediaEngineEx IMFMediaEngineEx

Enables an application to play audio or video files.

The Media Engine implements this interface. To create an instance of the Media Engine, call .

This interface is extended with .

hh447918 IMFMediaEngine IMFMediaEngine
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 most recent error status.

Receives either a reference to the interface, or the value null. If the value is non-null, the caller must release the interface.

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

This method returns the last error status, if any, that resulted from loading the media source. If there has not been an error, ppError receives the value null.

This method corresponds to the error attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh447985 HRESULT IMFMediaEngine::GetError([Out] IMFMediaError** ppError) IMFMediaEngine::GetError

Sets the current error code.

The error code, as an value.

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

hh448012 HRESULT IMFMediaEngine::SetErrorCode([In] MF_MEDIA_ENGINE_ERR error) IMFMediaEngine::SetErrorCode

Sets the URL of a media resource.

The URL of the media resource.

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

This method corresponds to setting the src attribute of the HTMLMediaElement interface in HTML5.

The URL specified by this method takes precedence over media resources specified in the method. To load the URL, call .

This method asynchronously loads the URL. When the operation starts, the Media Engine sends an event. If no errors occur during the Load operation, several other events are generated, including the following.

If the Media Engine is unable to load the URL, the Media Engine sends an event.

For more information about event handling in the Media Engine, see .

Windows?Phone?8: This API is supported.

hh448017 HRESULT IMFMediaEngine::SetSourceElements([In] IMFMediaEngineSrcElements* pSrcElements) IMFMediaEngine::SetSourceElements

Sets the URL of a media resource.

The URL of the media resource.

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

This method corresponds to setting the src attribute of the HTMLMediaElement interface in HTML5.

The URL specified by this method takes precedence over media resources specified in the method. To load the URL, call .

This method asynchronously loads the URL. When the operation starts, the Media Engine sends an event. If no errors occur during the Load operation, several other events are generated, including the following.

If the Media Engine is unable to load the URL, the Media Engine sends an event.

For more information about event handling in the Media Engine, see .

Windows?Phone?8: This API is supported.

hh448017 HRESULT IMFMediaEngine::SetSource([In] void* pUrl) IMFMediaEngine::SetSource

Gets the URL of the current media resource, or an empty string if no media resource is present.

Receives a BSTR that contains the URL of the current media resource. If there is no media resource, ppUrl receives an empty string. The caller must free the BSTR by calling SysFreeString.

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

This method corresponds to the currentSrc attribute of the HTMLMediaElement interface in HTML5.

Initially, the current media resource is empty. It is updated when the Media Engine performs the resource selection algorithm.

Windows?Phone?8: This API is supported.

hh447981 HRESULT IMFMediaEngine::GetCurrentSource([Out] wchar_t** ppUrl) IMFMediaEngine::GetCurrentSource

Gets the current network state of the media engine.

Returns an enumeration value.

This method corresponds to the networkState attribute of the HTMLMediaElement interface in HTML5.

hh447989 unsigned short IMFMediaEngine::GetNetworkState() IMFMediaEngine::GetNetworkState

Gets the preload flag.

Returns an enumeration value.

This method corresponds to the preload attribute of the HTMLMediaElement interface in HTML5. The value is a hint to the user-agent whether to preload the media resource.

hh447992 MF_MEDIA_ENGINE_PRELOAD IMFMediaEngine::GetPreload() IMFMediaEngine::GetPreload

Sets the preload flag.

An value equal to the preload flag.

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

This method corresponds to setting the preload attribute of the HTMLMediaElement interface in HTML5. The value is a hint to the user-agent whether to preload the media resource.

hh448016 HRESULT IMFMediaEngine::SetPreload([In] MF_MEDIA_ENGINE_PRELOAD Preload) IMFMediaEngine::SetPreload

Queries how much resource data the media engine has buffered.

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 method corresponds to the buffered attribute of the HTMLMediaElement interface in HTML5.

The returned interface represents a list of time ranges. The time ranges indicate which portions of the media resource have been downloaded. The time range list can be empty.

hh447980 HRESULT IMFMediaEngine::GetBuffered([Out] IMFMediaTimeRange** ppBuffered) IMFMediaEngine::GetBuffered

Loads the current media source.

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

The main purpose of this method is to reload a list of source elements after updating the list. For more information, see SetSourceElements. Otherwise, calling this method is generally not required. To load a new media source, call or .

The Load method explictly invokes the Media Engine's media resource loading algorithm. Before calling this method, you must set the media resource by calling or .

This method completes asynchronously. When the Load operation starts, the Media Engine sends an event. If no errors occur during the Load operation, several other events are generated, including the following.

If the Media Engine is unable to load the file, the Media Engine sends an event.

For more information about event handling in the Media Engine, see .

This method corresponds to the load method of the HTMLMediaElement interface in HTML5.

hh448005 HRESULT IMFMediaEngine::Load() IMFMediaEngine::Load

Queries how likely it is that the Media Engine can play a specified type of media resource.

A string that contains a MIME type with an optional codecs parameter, as defined in RFC 4281.

Receives an enumeration value.

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

This method corresponds to the canPlayType attribute of the HTMLMediaElement interface in HTML5.

The canPlayType attribute defines the following values.

ValueDescription
"" (empty string)The user-agent cannot play the resource, or the resource type is "application/octet-stream".
"probably"The user-agent probably can play the resource.
"maybe"Neither of the previous values applies.

?

The value "probably" is used because a MIME type for a media resource is generally not a complete description of the resource. For example, "video/mp4" specifies an MP4 file with video, but does not describe the codec. Even with the optional codecs parameter, the MIME type omits some information, such as the actual coded bit rate. Therefore, it is usually impossible to be certain that playback is possible until the actual media resource is opened.

hh447978 HRESULT IMFMediaEngine::CanPlayType([In] wchar_t* type,[Out] MF_MEDIA_ENGINE_CANPLAY* pAnswer) IMFMediaEngine::CanPlayType

Gets the ready state, which indicates whether the current media resource can be rendered.

Returns an enumeration value.

This method corresponds to the readyState attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh447993 unsigned short IMFMediaEngine::GetReadyState() IMFMediaEngine::GetReadyState

Queries whether the Media Engine is currently seeking to a new playback position.

Returns TRUE if the Media Engine is seeking, or otherwise.

This method corresponds to the seeking attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh448004 BOOL IMFMediaEngine::IsSeeking() IMFMediaEngine::IsSeeking

Gets the current playback position.

Returns the playback position, in seconds.

This method corresponds to the currentTime attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh447982 double IMFMediaEngine::GetCurrentTime() IMFMediaEngine::GetCurrentTime

Seeks to a new playback position.

The new playback position, in seconds.

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

This method corresponds to setting the currentTime attribute of the HTMLMediaElement interface in HTML5.

The method completes asynchronously. When the seek operation starts, the Media Engine sends an event. When the seek operation completes, the Media Engine sends an event. See IMFMediaEventNotify::EventNotify.

Windows?Phone?8: This API is supported.

hh448010 HRESULT IMFMediaEngine::SetCurrentTime([In] double seekTime) IMFMediaEngine::SetCurrentTime

Gets the initial playback position.

Returns the initial playback position, in seconds.

This method corresponds to the initialTime attribute of the HTMLMediaElement interface in HTML5.

hh447995 double IMFMediaEngine::GetStartTime() IMFMediaEngine::GetStartTime

Gets the duration of the media resource.

Returns the duration, in seconds. If no media data is available, the method returns not-a-number (NaN). If the duration is unbounded, the method returns an infinite value.

This method corresponds to the duration attribute of the HTMLMediaElement interface in HTML5.

If the duration changes, the Media Engine sends an event. See .

Windows?Phone?8: This API is supported.

hh447984 double IMFMediaEngine::GetDuration() IMFMediaEngine::GetDuration

Queries whether playback is currently paused.

Returns TRUE if playback is paused, or otherwise.

This method corresponds to the paused attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh448003 BOOL IMFMediaEngine::IsPaused() IMFMediaEngine::IsPaused

Gets the default playback rate.

Returns the default playback rate, as a multiple of normal (1?) playback. A negative value indicates reverse playback.

This method corresponds to getting the defaultPlaybackRate attribute of the HTMLMediaElement interface in HTML5.

The default playback rate is used for the next call to the method. To change the current playback rate, call .

hh447983 double IMFMediaEngine::GetDefaultPlaybackRate() IMFMediaEngine::GetDefaultPlaybackRate

Sets the default playback rate.

The default playback rate, as a multiple of normal (1?) playback. A negative value indicates reverse playback.

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

This method corresponds to setting the defaultPlaybackRate attribute of the HTMLMediaElement interface in HTML5.

hh448011 HRESULT IMFMediaEngine::SetDefaultPlaybackRate([In] double Rate) IMFMediaEngine::SetDefaultPlaybackRate

Gets the current playback rate.

Returns the playback rate, as a multiple of normal (1?) playback. A negative value indicates reverse playback.

This method corresponds to getting the playbackRate attribute of the HTMLMediaElement interface in HTML5.

hh447990 double IMFMediaEngine::GetPlaybackRate() IMFMediaEngine::GetPlaybackRate

Sets the current playback rate.

The playback rate, as a multiple of normal (1?) playback. A negative value indicates reverse playback.

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

This method corresponds to setting the playbackRate attribute of the HTMLMediaElement interface in HTML5.

hh448015 HRESULT IMFMediaEngine::SetPlaybackRate([In] double Rate) IMFMediaEngine::SetPlaybackRate

Gets the time ranges that have been rendered.

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 method corresponds to the played attribute of the HTMLMediaElement interface in HTML5.

hh447991 HRESULT IMFMediaEngine::GetPlayed([Out] IMFMediaTimeRange** ppPlayed) IMFMediaEngine::GetPlayed

Gets the time ranges to which the Media Engine can currently seek.

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 method corresponds to the seekable attribute of the HTMLMediaElement interface in HTML5.

To find out whether the media source supports seeking, call .

hh447994 HRESULT IMFMediaEngine::GetSeekable([Out] IMFMediaTimeRange** ppSeekable) IMFMediaEngine::GetSeekable

Queries whether playback has ended.

Returns TRUE if the direction of playback is forward and playback has reached the end of the media resource. Returns otherwise.

This method corresponds to the ended attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh448002 BOOL IMFMediaEngine::IsEnded() IMFMediaEngine::IsEnded

Queries whether the Media Engine automatically begins playback.

Returns TRUE if the Media Engine automatically begins playback, or otherwise.

This method corresponds to the autoplay attribute of the HTMLMediaElement interface in HTML5.

If this method returns TRUE, playback begins automatically after the method completes. Otherwise, playback begins when the application calls .

hh447979 BOOL IMFMediaEngine::GetAutoPlay() IMFMediaEngine::GetAutoPlay

Specifies whether the Media Engine automatically begins playback.

If TRUE, the Media Engine automatically begins playback after it loads a media source. Otherwise, playback does not begin until the application calls .

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

This method corresponds to setting the autoplay attribute of the HTMLMediaElement interface in HTML5.

hh448009 HRESULT IMFMediaEngine::SetAutoPlay([In] BOOL AutoPlay) IMFMediaEngine::SetAutoPlay

Queries whether the Media Engine will loop playback.

Returns TRUE if looping is enabled, or otherwise.

This method corresponds to getting the loop attribute of the HTMLMediaElement interface in HTML5.

If looping is enabled, the Media Engine seeks to the start of the content when playback reaches the end.

Windows?Phone?8: This API is supported.

hh447986 BOOL IMFMediaEngine::GetLoop() IMFMediaEngine::GetLoop

Specifies whether the Media Engine loops playback.

Specify TRUE to enable looping, or to disable looping.

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

If Loop is TRUE, playback loops back to the beginning when it reaches the end of the source.

This method corresponds to setting the loop attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh448013 HRESULT IMFMediaEngine::SetLoop([In] BOOL Loop) IMFMediaEngine::SetLoop

Starts playback.

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

This method corresponds to the play method of the HTMLMediaElement interface in HTML5.

The method completes asynchronously. When the operation starts, the Media Engine sends an event. When playback is under way, the Media Engine sends an event. See IMFMediaEventNotify::EventNotify.

Windows?Phone?8: This API is supported.

hh448008 HRESULT IMFMediaEngine::Play() IMFMediaEngine::Play

Pauses playback.

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

This method corresponds to the pause method of the HTMLMediaElement interface in HTML5.

The method completes asynchronously. When the transition to paused is complete, the Media Engine sends an event. See IMFMediaEventNotify::EventNotify.

Windows?Phone?8: This API is supported.

hh448007 HRESULT IMFMediaEngine::Pause() IMFMediaEngine::Pause

Queries whether the audio is muted.

Returns TRUE if the audio is muted, or otherwise.

Windows?Phone?8: This API is supported.

hh447987 BOOL IMFMediaEngine::GetMuted() IMFMediaEngine::GetMuted

Mutes or unmutes the audio.

Specify TRUE to mute the audio, or to unmute the audio.

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

Windows?Phone?8: This API is supported.

hh448014 HRESULT IMFMediaEngine::SetMuted([In] BOOL Muted) IMFMediaEngine::SetMuted

Gets the audio volume level.

Returns the volume level. Volume is expressed as an attenuation level, where 0.0 indicates silence and 1.0 indicates full volume (no attenuation).

Windows?Phone?8: This API is supported.

hh447997 double IMFMediaEngine::GetVolume() IMFMediaEngine::GetVolume

Sets the audio volume level.

The volume level. Volume is expressed as an attenuation level, where 0.0 indicates silence and 1.0 indicates full volume (no attenuation).

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

When the audio balance changes, the Media Engine sends an event. See IMFMediaEventNotify::EventNotify.

Windows?Phone?8: This API is supported.

hh448019 HRESULT IMFMediaEngine::SetVolume([In] double Volume) IMFMediaEngine::SetVolume

Queries whether the current media resource contains a video stream.

Returns TRUE if the current media resource contains a video stream. Returns if there is no media resource or the media resource does not contain a video stream.

Windows?Phone?8: This API is supported.

hh448001 BOOL IMFMediaEngine::HasVideo() IMFMediaEngine::HasVideo

Queries whether the current media resource contains an audio stream.

Returns TRUE if the current media resource contains an audio stream. Returns if there is no media resource or the media resource does not contain an audio stream.

Windows?Phone?8: This API is supported.

hh447998 BOOL IMFMediaEngine::HasAudio() IMFMediaEngine::HasAudio

Gets the size of the video frame, adjusted for aspect ratio.

Receives the width in pixels.

Receives the height in pixels.

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

This method adjusts for the correct picture aspect ratio. For example, if the encoded frame is 720 ? 420 and the picture aspect ratio is 4:3, the method will return a size equal to 640 ? 480 pixels.

Windows?Phone?8: This API is supported.

hh447988 HRESULT IMFMediaEngine::GetNativeVideoSize([Out, Optional] unsigned int* cx,[Out, Optional] unsigned int* cy) IMFMediaEngine::GetNativeVideoSize

Gets the picture aspect ratio of the video stream.

Receives the x component of the aspect ratio.

Receives the y component of the aspect ratio.

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

The Media Engine automatically converts the pixel aspect ratio to 1:1 (square pixels).

Windows?Phone?8: This API is supported.

hh447996 HRESULT IMFMediaEngine::GetVideoAspectRatio([Out, Optional] unsigned int* cx,[Out, Optional] unsigned int* cy) IMFMediaEngine::GetVideoAspectRatio

Shuts down the Media Engine and releases the resources it is using.

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

Windows?Phone?8: This API is supported.

hh448020 HRESULT IMFMediaEngine::Shutdown() IMFMediaEngine::Shutdown

Copies the current video frame to a DXGI surface or WIC bitmap.

A reference to the interface of the destination surface.

A reference to an structure that specifies the source rectangle.

A reference to a structure that specifies the destination rectangle.

A reference to an structure that specifies the border color.

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

In frame-server mode, call this method to blit the video frame to a DXGI or WIC surface. The application can call this method at any time after the Media Engine loads a video resource. Typically, however, the application calls first, to determine whether a new frame is available. If OnVideoStreamTick returns , the application then calls TransferVideoFrame.

The Media Engine scales and letterboxes the video to fit the destination rectangle. It fills the letterbox area with the border color.

For protected content, call the method instead of this method.

Windows?Phone?8: This API is supported.

hh448021 HRESULT IMFMediaEngine::TransferVideoFrame([In] IUnknown* pDstSurf,[In, Optional] const MFVideoNormalizedRect* pSrc,[In] const RECT* pDst,[In, Optional] const MFARGB* pBorderClr) IMFMediaEngine::TransferVideoFrame

Queries the Media Engine to find out whether a new video frame is ready.

If a new frame is ready, receives the presentation time of the frame.

This method can return one of these values.

Return codeDescription
S_FALSE

The method succeeded, but the Media Engine does not have a new frame.

A new video frame is ready for display.

?

In frame-server mode, the application should call this method whenever a vertical blank occurs in the display device. If the method returns , call to blit the frame to the render target. If the method returns S_FALSE, wait for the next vertical blank and call the method again.

Do not call this method in rendering mode or audio-only mode.

Windows?Phone?8: This API is supported.

hh448006 HRESULT IMFMediaEngine::OnVideoStreamTick([Out] longlong* pPts) IMFMediaEngine::OnVideoStreamTick
Initializes an instance of the class. hh447921 HRESULT IMFMediaEngineClassFactory::CreateInstance([In] MF_MEDIA_ENGINE_CREATEFLAGS dwFlags,[In] IMFAttributes* pAttr,[Out, Fast] IMFMediaEngine** ppPlayer) IMFMediaEngineClassFactory::CreateInstance

[This documentation is preliminary and is subject to change.]

Applies to: desktop apps | Metro style apps

Queries the Media Engine to find out whether a new video frame is ready.

If a new frame is ready, receives the presentation time of the frame.

true if new video frame is ready for display.

In frame-server mode, the application should call this method whenever a vertical blank occurs in the display device. If the method returns , call to blit the frame to the render target. If the method returns S_FALSE, wait for the next vertical blank and call the method again.

Do not call this method in rendering mode or audio-only mode.

hh448006 HRESULT IMFMediaEngine::OnVideoStreamTick([Out] longlong* pPts) IMFMediaEngine::OnVideoStreamTick

Gets the most recent error status.

This method returns the last error status, if any, that resulted from loading the media source. If there has not been an error, ppError receives the value null.

This method corresponds to the error attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh447985 GetError GetError HRESULT IMFMediaEngine::GetError([Out] IMFMediaError** ppError)

Sets the current error code.

hh448012 SetErrorCode SetErrorCode HRESULT IMFMediaEngine::SetErrorCode([In] MF_MEDIA_ENGINE_ERR error)

Sets the URL of a media resource.

This method corresponds to setting the src attribute of the HTMLMediaElement interface in HTML5.

The URL specified by this method takes precedence over media resources specified in the method. To load the URL, call .

This method asynchronously loads the URL. When the operation starts, the Media Engine sends an event. If no errors occur during the Load operation, several other events are generated, including the following.

If the Media Engine is unable to load the URL, the Media Engine sends an event.

For more information about event handling in the Media Engine, see .

Windows?Phone?8: This API is supported.

hh448017 SetSourceElements SetSourceElements HRESULT IMFMediaEngine::SetSourceElements([In] IMFMediaEngineSrcElements* pSrcElements)

Gets the current network state of the media engine.

This method corresponds to the networkState attribute of the HTMLMediaElement interface in HTML5.

hh447989 GetNetworkState GetNetworkState unsigned short IMFMediaEngine::GetNetworkState()

Gets or sets the preload flag.

This method corresponds to the preload attribute of the HTMLMediaElement interface in HTML5. The value is a hint to the user-agent whether to preload the media resource.

hh447992 GetPreload / SetPreload GetPreload MF_MEDIA_ENGINE_PRELOAD IMFMediaEngine::GetPreload()

Queries how much resource data the media engine has buffered.

This method corresponds to the buffered attribute of the HTMLMediaElement interface in HTML5.

The returned interface represents a list of time ranges. The time ranges indicate which portions of the media resource have been downloaded. The time range list can be empty.

hh447980 GetBuffered GetBuffered HRESULT IMFMediaEngine::GetBuffered([Out] IMFMediaTimeRange** ppBuffered)

Gets the ready state, which indicates whether the current media resource can be rendered.

This method corresponds to the readyState attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh447993 GetReadyState GetReadyState unsigned short IMFMediaEngine::GetReadyState()

Queries whether the Media Engine is currently seeking to a new playback position.

This method corresponds to the seeking attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh448004 IsSeeking IsSeeking BOOL IMFMediaEngine::IsSeeking()

Gets or sets the current playback position.

This method corresponds to the currentTime attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh447982 GetCurrentTime / SetCurrentTime GetCurrentTime double IMFMediaEngine::GetCurrentTime()

Gets the initial playback position.

This method corresponds to the initialTime attribute of the HTMLMediaElement interface in HTML5.

hh447995 GetStartTime GetStartTime double IMFMediaEngine::GetStartTime()

Gets the duration of the media resource.

This method corresponds to the duration attribute of the HTMLMediaElement interface in HTML5.

If the duration changes, the Media Engine sends an event. See .

Windows?Phone?8: This API is supported.

hh447984 GetDuration GetDuration double IMFMediaEngine::GetDuration()

Queries whether playback is currently paused.

This method corresponds to the paused attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh448003 IsPaused IsPaused BOOL IMFMediaEngine::IsPaused()

Gets or sets the default playback rate.

This method corresponds to getting the defaultPlaybackRate attribute of the HTMLMediaElement interface in HTML5.

The default playback rate is used for the next call to the method. To change the current playback rate, call .

hh447983 GetDefaultPlaybackRate / SetDefaultPlaybackRate GetDefaultPlaybackRate double IMFMediaEngine::GetDefaultPlaybackRate()

Gets or sets the current playback rate.

This method corresponds to getting the playbackRate attribute of the HTMLMediaElement interface in HTML5.

hh447990 GetPlaybackRate / SetPlaybackRate GetPlaybackRate double IMFMediaEngine::GetPlaybackRate()

Gets the time ranges that have been rendered.

This method corresponds to the played attribute of the HTMLMediaElement interface in HTML5.

hh447991 GetPlayed GetPlayed HRESULT IMFMediaEngine::GetPlayed([Out] IMFMediaTimeRange** ppPlayed)

Gets the time ranges to which the Media Engine can currently seek.

This method corresponds to the seekable attribute of the HTMLMediaElement interface in HTML5.

To find out whether the media source supports seeking, call .

hh447994 GetSeekable GetSeekable HRESULT IMFMediaEngine::GetSeekable([Out] IMFMediaTimeRange** ppSeekable)

Queries whether playback has ended.

This method corresponds to the ended attribute of the HTMLMediaElement interface in HTML5.

Windows?Phone?8: This API is supported.

hh448002 IsEnded IsEnded BOOL IMFMediaEngine::IsEnded()

Queries whether the Media Engine automatically begins playback.

This method corresponds to the autoplay attribute of the HTMLMediaElement interface in HTML5.

If this method returns TRUE, playback begins automatically after the method completes. Otherwise, playback begins when the application calls .

hh447979 GetAutoPlay / SetAutoPlay GetAutoPlay BOOL IMFMediaEngine::GetAutoPlay()

Queries whether the Media Engine will loop playback.

This method corresponds to getting the loop attribute of the HTMLMediaElement interface in HTML5.

If looping is enabled, the Media Engine seeks to the start of the content when playback reaches the end.

Windows?Phone?8: This API is supported.

hh447986 GetLoop / SetLoop GetLoop BOOL IMFMediaEngine::GetLoop()

Queries whether the audio is muted.

Windows?Phone?8: This API is supported.

hh447987 GetMuted / SetMuted GetMuted BOOL IMFMediaEngine::GetMuted()

Gets or sets the audio volume level.

Windows?Phone?8: This API is supported.

hh447997 GetVolume / SetVolume GetVolume double IMFMediaEngine::GetVolume()
Media engine playback event.

[This documentation is preliminary and is subject to change.]

Applies to: desktop apps | Metro style apps

Sets the URL of a media resource.

The URL of the media resource.

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

This method corresponds to setting the src attribute of the HTMLMediaElement interface in HTML5.

The URL specified by this method takes precedence over media resources specified in the method. To load the URL, call .

This method asynchronously loads the URL. When the operation starts, the Media Engine sends an event. If no errors occur during the Load operation, several other events are generated, including the following.

If the Media Engine is unable to load the URL, the Media Engine sends an event.

For more information about event handling in the Media Engine, see .

hh448017 HRESULT IMFMediaEngine::SetSource([In] wchar_t* pUrl) IMFMediaEngine::SetSource

Notifies the application when a playback event occurs.

hh447963 IMFMediaEngineNotify IMFMediaEngineNotify

[This documentation is preliminary and is subject to change.]

Applies to: desktop apps | Metro style apps

Notifies the application when a playback event occurs.

A member of the enumeration that specifies the event.

The first event parameter. The meaning of this parameter depends on the event code.

The second event parameter. The meaning of this parameter depends on the event code.

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

hh447963 HRESULT IMFMediaEngineNotify::EventNotify([In] unsigned int event,[In] ULONG_PTR param1,[In] unsigned int param2) IMFMediaEngineNotify::EventNotify

[This documentation is preliminary and is subject to change.]

Applies to: desktop apps | Metro style apps

Opens a media resource from a byte stream.

A reference to the interface of the byte stream.

The URL of the byte stream.

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

hh447956 HRESULT IMFMediaEngineEx::SetSourceFromByteStream([In] IMFByteStream* pByteStream,[In] wchar_t* pURL) IMFMediaEngineEx::SetSourceFromByteStream
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.

Opens a media resource from a byte stream.

A reference to the interface of the byte stream.

The URL of the byte stream.

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

Windows?Phone?8: This API is supported.

hh447956 HRESULT IMFMediaEngineEx::SetSourceFromByteStream([In] IMFByteStream* pByteStream,[In] void* pURL) IMFMediaEngineEx::SetSourceFromByteStream

Gets a playback statistic from the Media Engine.

A member of the enumeration that identifies the statistic to get.

A reference to a that receives the statistic. The data type and meaning of this value depends on the value of StatisticID. The caller must free the by calling PropVariantClear.

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

hh447940 HRESULT IMFMediaEngineEx::GetStatistics([In] MF_MEDIA_ENGINE_STATISTIC StatisticID,[Out] PROPVARIANT* pStatistic) IMFMediaEngineEx::GetStatistics

Updates the source rectangle, destination rectangle, and border color for the video.

A reference to an structure that specifies the source rectangle. The source rectangle defines the area of the video frame that is displayed. If this parameter is null, the entire video frame is displayed.

A reference to a structure that specifies the destination rectangle. The destination rectangle defines the area of the window or DirectComposition visual where the video is drawn.

A reference to an structure that specifies the border color.

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

In rendering mode, call this method to reposition the video, update the border color, or repaint the video frame. If all of the parameters are null, the method repaints the most recent video frame.

In frame-server mode, this method has no effect.

See Video Processor MFT for info regarding source and destination rectangles in the Video Processor MFT.

hh447961 HRESULT IMFMediaEngineEx::UpdateVideoStream([In, Optional] const MFVideoNormalizedRect* pSrc,[In, Optional] const RECT* pDst,[In, Optional] const MFARGB* pBorderClr) IMFMediaEngineEx::UpdateVideoStream

Gets the audio balance.

Returns the balance. The value can be any number in the following range (inclusive).

Return valueDescription
-1

The left channel is at full volume; the right channel is silent.

1

The right channel is at full volume; the left channel is silent.

?

If the value is zero, the left and right channels are at equal volumes. The default value is zero.

Windows?Phone?8: This API is supported.

hh447934 double IMFMediaEngineEx::GetBalance() IMFMediaEngineEx::GetBalance

Sets the audio balance.

The audio balance. The value can be any number in the following range (inclusive).

ValueMeaning
-1

The left channel is at full volume; the right channel is silent.

1

The right channel is at full volume; the left channel is silent.

?

If the value is zero, the left and right channels are at equal volumes. The default value is zero.

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

When the audio balance changes, the Media Engine sends an event. See IMFMediaEventNotify::EventNotify.

Windows?Phone?8: This API is supported.

hh447954 HRESULT IMFMediaEngineEx::SetBalance([In] double balance) IMFMediaEngineEx::SetBalance

Queries whether the Media Engine can play at a specified playback rate.

The requested playback rate.

Returns TRUE if the playback rate is supported, or otherwise.

Playback rates are expressed as a ratio of the current rate to the normal rate. For example, 1.0 is normal playback speed, 0.5 is half speed, and 2.0 is 2? speed. Positive values mean forward playback, and negative values mean reverse playback.

The results of this method can vary depending on the media resource that is currently loaded. Some media formats might support faster playback rates than others. Also, some formats might not support reverse play.

hh447949 BOOL IMFMediaEngineEx::IsPlaybackRateSupported([In] double rate) IMFMediaEngineEx::IsPlaybackRateSupported

Steps forward or backward one frame.

Specify TRUE to step forward or to step backward.

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

The frame-step direction is independent of the current playback direction.

This method completes asynchronously. When the operation completes, the Media Engine sends an event and enters the paused state.

hh447933 HRESULT IMFMediaEngineEx::FrameStep([In] BOOL Forward) IMFMediaEngineEx::FrameStep

Gets various flags that describe the media resource.

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

ValueMeaning
0x00000001

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.

0x00000002

The media resource supports seeking. To get the seekable range, call .

0x00000003

The media resource can be paused.

0x00000004

Seeking this resource can take a long time. For example, it might download through HTTP.

?

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

hh447939 HRESULT IMFMediaEngineEx::GetResourceCharacteristics([Out] RESOURCE_CHARACTERISTICS* pCharacteristics) IMFMediaEngineEx::GetResourceCharacteristics

Gets a presentation attribute from the media resource.

The attribute to query. For a list of presentation attributes, see Presentation Descriptor Attributes.

A reference to a that receives the value. The method fills the with a copy of the stored value. The caller must free the by calling PropVariantClear.

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

hh447938 HRESULT IMFMediaEngineEx::GetPresentationAttribute([In] const GUID& guidMFAttribute,[Out] PROPVARIANT* pvValue) IMFMediaEngineEx::GetPresentationAttribute

Gets the number of streams in the media resource.

Receives the number of streams.

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

hh447937 HRESULT IMFMediaEngineEx::GetNumberOfStreams([Out] unsigned int* pdwStreamCount) IMFMediaEngineEx::GetNumberOfStreams

Gets a stream-level attribute from the media resource.

The zero-based index of the stream. To get the number of streams, call .

The attribute to query. Possible values are listed in the following topics:

  • Stream Descriptor Attributes
  • Media Type Attributes

A reference to a that receives the value. The method fills the with a copy of the stored value. Call PropVariantClear to free the memory allocated by the method.

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

hh447943 HRESULT IMFMediaEngineEx::GetStreamAttribute([In] unsigned int dwStreamIndex,[In] const GUID& guidMFAttribute,[Out] PROPVARIANT* pvValue) IMFMediaEngineEx::GetStreamAttribute

Queries whether a stream is selected to play.

The zero-based index of the stream. To get the number of streams, call .

Receives a Boolean value.

ValueMeaning
TRUE

The stream is selected. During playback, this stream will play.

The stream is not selected. During playback, this stream will not play.

?

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

hh447944 HRESULT IMFMediaEngineEx::GetStreamSelection([In] unsigned int dwStreamIndex,[Out] BOOL* pEnabled) IMFMediaEngineEx::GetStreamSelection

Selects or deselects a stream for playback.

The zero-based index of the stream. To get the number of streams, call .

Specifies whether to select or deselect the stream.

ValueMeaning
TRUE

The stream is selected. During playback, this stream will play.

The stream is not selected. During playback, this stream will not play.

?

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

hh447959 HRESULT IMFMediaEngineEx::SetStreamSelection([In] unsigned int dwStreamIndex,[In] BOOL Enabled) IMFMediaEngineEx::SetStreamSelection

Applies the stream selections from previous calls to SetStreamSelection.

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

jj151917 HRESULT IMFMediaEngineEx::ApplyStreamSelections() IMFMediaEngineEx::ApplyStreamSelections

Queries whether the media resource contains protected content.

Receives the value TRUE if the media resource contains protected content, or otherwise.

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

hh447950 HRESULT IMFMediaEngineEx::IsProtected([Out] BOOL* pProtected) IMFMediaEngineEx::IsProtected

Inserts a video effect.

One of the following:

  • A reference to the interface of a Media Foundation transform (MFT) that implements the video effect.
  • A reference to the interface of an activation object. The activation object must create an MFT for the video effect.

Specifies whether the effect is optional.

ValueMeaning
TRUE

The effect is optional. If the Media Engine cannot add the effect, it ignores the effect and continues playback.

The effect is required. If the Media Engine object cannot add the effect, a playback error occurs.

?

This method can return one of these values.

Return codeDescription

Success.

The maximum number of video effects was reached.

?

The effect is applied when the next media resource is loaded.

hh447948 HRESULT IMFMediaEngineEx::InsertVideoEffect([In] IUnknown* pEffect,[In] BOOL fOptional) IMFMediaEngineEx::InsertVideoEffect

Inserts an audio effect.

One of the following:

  • A reference to the interface of a Media Foundation transform (MFT) that implements the audio effect.
  • A reference to the interface of an activation object. The activation object must create an MFT for the audio effect.

Specifies whether the effect is optional.

ValueMeaning
TRUE

The effect is optional. If the Media Engine cannot add the effect, it ignores the effect and continues playback.

The effect is required. If the Media Engine object cannot add the effect, a playback error occurs.

?

This method can return one of these values.

Return codeDescription

Success.

The maximum number of audio effects was reached.

?

The effect is applied when the next media resource is loaded.

hh447947 HRESULT IMFMediaEngineEx::InsertAudioEffect([In] IUnknown* pEffect,[In] BOOL fOptional) IMFMediaEngineEx::InsertAudioEffect

Removes all audio and video effects.

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

Call this method to remove all of the effects that were added with the InsertAudioEffect and InsertVideoEffect methods.

hh447952 HRESULT IMFMediaEngineEx::RemoveAllEffects() IMFMediaEngineEx::RemoveAllEffects

Specifies a presentation time when the Media Engine will send a marker event.

The presentation time for the marker event, in seconds.

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

When playback reaches the time specified by timeToFire, the Media Engine sends an event through the method. Calling this method cancels any previous marker that is still pending.

If the application seeks past the marker point, the Media Engine cancels the marker and does not send the event.

During forward playback, set timeToFire to a value greater than the current playback position. During reverse playback, set timeToFire to a value less than the playback position.

To cancel a marker, call .

hh447960 HRESULT IMFMediaEngineEx::SetTimelineMarkerTimer([In] double timeToFire) IMFMediaEngineEx::SetTimelineMarkerTimer

Gets the time of the next timeline marker, if any.

Receives the marker time, in seconds. If no marker is set, this parameter receives the value NaN.

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

hh447945 HRESULT IMFMediaEngineEx::GetTimelineMarkerTimer([Out] double* pTimeToFire) IMFMediaEngineEx::GetTimelineMarkerTimer

Cancels the next pending timeline marker.

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

Call this method to cancel the method.

hh447929 HRESULT IMFMediaEngineEx::CancelTimelineMarkerTimer() IMFMediaEngineEx::CancelTimelineMarkerTimer

Queries whether the media resource contains stereoscopic 3D video.

Returns TRUE if the media resource contains 3D video, or otherwise.

hh447951 BOOL IMFMediaEngineEx::IsStereo3D() IMFMediaEngineEx::IsStereo3D

For stereoscopic 3D video, gets the layout of the two views within a video frame.

Receives a member of the enumeration.

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

hh447941 HRESULT IMFMediaEngineEx::GetStereo3DFramePackingMode([Out] MF_MEDIA_ENGINE_S3D_PACKING_MODE* packMode) IMFMediaEngineEx::GetStereo3DFramePackingMode

For stereoscopic 3D video, sets the layout of the two views within a video frame.

A member of the enumeration that specifies the layout. The two views can be arranged side-by-side, or top-to-bottom.

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

hh447957 HRESULT IMFMediaEngineEx::SetStereo3DFramePackingMode([In] MF_MEDIA_ENGINE_S3D_PACKING_MODE packMode) IMFMediaEngineEx::SetStereo3DFramePackingMode

For stereoscopic 3D video, queries how the Media Engine renders the 3D video content.

Receives a member of the enumeration.

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

hh447942 HRESULT IMFMediaEngineEx::GetStereo3DRenderMode([Out] MF3DVideoOutputType* outputType) IMFMediaEngineEx::GetStereo3DRenderMode

For stereoscopic 3D video, specifies how the Media Engine renders the 3D video content.

A member of the enumeration that specifies the 3D video rendering mode.

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

hh447958 HRESULT IMFMediaEngineEx::SetStereo3DRenderMode([In] MF3DVideoOutputType outputType) IMFMediaEngineEx::SetStereo3DRenderMode

Enables or disables windowless swap-chain mode.

If TRUE, windowless swap-chain mode is enabled.

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

In windowless swap-chain mode, the Media Engine creates a windowless swap chain and presents video frames to the swap chain. To render the video, call to get a handle to the swap chain, and then associate the handle with a Microsoft DirectComposition visual.

hh447932 HRESULT IMFMediaEngineEx::EnableWindowlessSwapchainMode([In] BOOL fEnable) IMFMediaEngineEx::EnableWindowlessSwapchainMode

Gets a handle to the windowless swap chain.

Receives a handle to the swap chain.

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

To enable windowless swap-chain mode, call .

hh447946 HRESULT IMFMediaEngineEx::GetVideoSwapchainHandle([Out] void** phSwapchain) IMFMediaEngineEx::GetVideoSwapchainHandle

Enables or disables mirroring of the video.

If TRUE, the video is mirrored horizontally. Otherwise, the video is displayed normally.

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

hh447931 HRESULT IMFMediaEngineEx::EnableHorizontalMirrorMode([In] BOOL fEnable) IMFMediaEngineEx::EnableHorizontalMirrorMode

Gets the audio stream category used for the next call to SetSource or Load.

No documentation.

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

For information on audio stream categories, see enumeration.

jj128310 HRESULT IMFMediaEngineEx::GetAudioStreamCategory([Out] unsigned int* pCategory) IMFMediaEngineEx::GetAudioStreamCategory

Sets the audio stream category for the next call to SetSource or Load.

No documentation.

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

For information on audio stream categories, see enumeration.

jj128313 HRESULT IMFMediaEngineEx::SetAudioStreamCategory([In] unsigned int category) IMFMediaEngineEx::SetAudioStreamCategory

Gets the audio device endpoint role used for the next call to SetSource or Load.

No documentation.

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

For information on audio endpoint roles, see ERole enumeration.

jj128309 HRESULT IMFMediaEngineEx::GetAudioEndpointRole([Out] unsigned int* pRole) IMFMediaEngineEx::GetAudioEndpointRole

Sets the audio device endpoint used for the next call to SetSource or Load.

No documentation.

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

For information on audio endpoint roles, see ERole enumeration.

jj128312 HRESULT IMFMediaEngineEx::SetAudioEndpointRole([In] unsigned int role) IMFMediaEngineEx::SetAudioEndpointRole

Gets the real time mode used for the next call to SetSource or Load.

No documentation.

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

jj128311 HRESULT IMFMediaEngineEx::GetRealTimeMode([Out] BOOL* pfEnabled) IMFMediaEngineEx::GetRealTimeMode

Sets the real time mode used for the next call to SetSource or Load.

No documentation.

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

jj128315 HRESULT IMFMediaEngineEx::SetRealTimeMode([In] BOOL fEnable) IMFMediaEngineEx::SetRealTimeMode

Seeks to a new playback position using the specified .

No documentation. No documentation.

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

jj128314 HRESULT IMFMediaEngineEx::SetCurrentTimeEx([In] double seekTime,[In] MF_MEDIA_ENGINE_SEEK_MODE seekMode) IMFMediaEngineEx::SetCurrentTimeEx

Enables or disables the time update timer.

If TRUE, the update timer is enabled. Otherwise, the timer is disabled.

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

jj128308 HRESULT IMFMediaEngineEx::EnableTimeUpdateTimer([In] BOOL fEnableTimer) IMFMediaEngineEx::EnableTimeUpdateTimer

Gets or sets the audio balance.

Windows?Phone?8: This API is supported.

hh447934 GetBalance / SetBalance GetBalance double IMFMediaEngineEx::GetBalance()

Gets various flags that describe the media resource.

hh447939 GetResourceCharacteristics GetResourceCharacteristics HRESULT IMFMediaEngineEx::GetResourceCharacteristics([Out] RESOURCE_CHARACTERISTICS* pCharacteristics)

Gets the number of streams in the media resource.

hh447937 GetNumberOfStreams GetNumberOfStreams HRESULT IMFMediaEngineEx::GetNumberOfStreams([Out] unsigned int* pdwStreamCount)

Queries whether the media resource contains protected content.

hh447950 IsProtected IsProtected HRESULT IMFMediaEngineEx::IsProtected([Out] BOOL* pProtected)

Gets or sets the time of the next timeline marker, if any.

hh447945 GetTimelineMarkerTimer / SetTimelineMarkerTimer GetTimelineMarkerTimer HRESULT IMFMediaEngineEx::GetTimelineMarkerTimer([Out] double* pTimeToFire)

Queries whether the media resource contains stereoscopic 3D video.

hh447951 IsStereo3D IsStereo3D BOOL IMFMediaEngineEx::IsStereo3D()

For stereoscopic 3D video, gets the layout of the two views within a video frame.

hh447941 GetStereo3DFramePackingMode / SetStereo3DFramePackingMode GetStereo3DFramePackingMode HRESULT IMFMediaEngineEx::GetStereo3DFramePackingMode([Out] MF_MEDIA_ENGINE_S3D_PACKING_MODE* packMode)

For stereoscopic 3D video, queries how the Media Engine renders the 3D video content.

hh447942 GetStereo3DRenderMode / SetStereo3DRenderMode GetStereo3DRenderMode HRESULT IMFMediaEngineEx::GetStereo3DRenderMode([Out] MF3DVideoOutputType* outputType)

Gets a handle to the windowless swap chain.

To enable windowless swap-chain mode, call .

hh447946 GetVideoSwapchainHandle GetVideoSwapchainHandle HRESULT IMFMediaEngineEx::GetVideoSwapchainHandle([Out] void** phSwapchain)

Gets or sets the audio stream category used for the next call to SetSource or Load.

For information on audio stream categories, see enumeration.

jj128310 GetAudioStreamCategory / SetAudioStreamCategory GetAudioStreamCategory HRESULT IMFMediaEngineEx::GetAudioStreamCategory([Out] unsigned int* pCategory)

Gets or sets the audio device endpoint role used for the next call to SetSource or Load.

For information on audio endpoint roles, see ERole enumeration.

jj128309 GetAudioEndpointRole / SetAudioEndpointRole GetAudioEndpointRole HRESULT IMFMediaEngineEx::GetAudioEndpointRole([Out] unsigned int* pRole)

Gets or sets the real time mode used for the next call to SetSource or Load.

jj128311 GetRealTimeMode / SetRealTimeMode GetRealTimeMode HRESULT IMFMediaEngineEx::GetRealTimeMode([Out] BOOL* pfEnabled)
Internal MediaEngineNotify Callback Return a pointer to the unmanaged version of this callback. The callback. A pointer to a shadow c++ callback HRESULT IMFMediaEngineNotify::EventNotify([In] unsigned int event,[In] ULONG_PTR param1,[In] unsigned int param2)

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 ()
  • A multithreaded queue returned by the function.
  • A serial queue created by the 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
No documentation. hh162744 MFASYNC_BLOCKING_CALLBACK MFASYNC_BLOCKING_CALLBACK No documentation. hh162744 MFASYNC_REPLY_CALLBACK MFASYNC_REPLY_CALLBACK No documentation. hh162744 MFASYNC_LOCALIZE_REMOTE_CALLBACK MFASYNC_LOCALIZE_REMOTE_CALLBACK None. None None

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 values for audio constriction.

Values defined by the enumeration matches the EAudioConstriction enumeration defined audioenginebaseapo.h.

jj128334 MFAudioConstriction MFAudioConstriction

Audio is not constricted.

jj128334 MFaudioConstrictionOff MFaudioConstrictionOff

Audio is down sampled to 48 kHz/16-bit.

jj128334 MFaudioConstriction48_16 MFaudioConstriction48_16

Audio is down sampled to 44 kHz/16-bit.

jj128334 MFaudioConstriction44_16 MFaudioConstriction44_16

Audio is down sampled to 14hKz/16-bit.

jj128334 MFaudioConstriction14_14 MFaudioConstriction14_14

Audio is muted.

jj128334 MFaudioConstrictionMute MFaudioConstrictionMute

Contains flags for the method.

hh162742 MF2DBuffer_LockFlags MF2DBuffer_LockFlags
No documentation. hh162742 MF2DBuffer_LockFlags_LockTypeMask MF2DBuffer_LockFlags_LockTypeMask No documentation. hh162742 MF2DBuffer_LockFlags_Read MF2DBuffer_LockFlags_Read No documentation. hh162742 MF2DBuffer_LockFlags_Write MF2DBuffer_LockFlags_Write No documentation. hh162742 MF2DBuffer_LockFlags_ReadWrite MF2DBuffer_LockFlags_ReadWrite

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
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 No documentation. DMO_INPUT_DATA_BUFFERF_DISCONTINUITY DMO_INPUT_DATA_BUFFERF_DISCONTINUITY 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_DISCONTINUITY DMO_OUTPUT_DATA_BUFFERF_DISCONTINUITY 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 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

Specifies the likelihood that the Media Engine can play a specified type of media resource.

hh162836 MF_MEDIA_ENGINE_CANPLAY MF_MEDIA_ENGINE_CANPLAY

The Media Engine cannot play the resource.

hh162836 MF_MEDIA_ENGINE_CANPLAY_NOT_SUPPORTED MF_MEDIA_ENGINE_CANPLAY_NOT_SUPPORTED

The Media Engine might be able to play the resource.

hh162836 MF_MEDIA_ENGINE_CANPLAY_MAYBE MF_MEDIA_ENGINE_CANPLAY_MAYBE

The Media Engine can probably play the resource.

hh162836 MF_MEDIA_ENGINE_CANPLAY_PROBABLY MF_MEDIA_ENGINE_CANPLAY_PROBABLY

Contains flags for the method.

hh162839 MF_MEDIA_ENGINE_CREATEFLAGS MF_MEDIA_ENGINE_CREATEFLAGS
No documentation. hh162839 MF_MEDIA_ENGINE_AUDIOONLY MF_MEDIA_ENGINE_AUDIOONLY No documentation. hh162839 MF_MEDIA_ENGINE_WAITFORSTABLE_STATE MF_MEDIA_ENGINE_WAITFORSTABLE_STATE No documentation. hh162839 MF_MEDIA_ENGINE_FORCEMUTE MF_MEDIA_ENGINE_FORCEMUTE No documentation. hh162839 MF_MEDIA_ENGINE_REAL_TIME_MODE MF_MEDIA_ENGINE_REAL_TIME_MODE No documentation. hh162839 MF_MEDIA_ENGINE_DISABLE_LOCAL_PLUGINS MF_MEDIA_ENGINE_DISABLE_LOCAL_PLUGINS No documentation. hh162839 MF_MEDIA_ENGINE_CREATEFLAGS_MASK MF_MEDIA_ENGINE_CREATEFLAGS_MASK None. None None

Defines error status codes for the Media Engine.

The values greater than zero correspond to error codes defined for the MediaError object in HTML5.

hh162841 MF_MEDIA_ENGINE_ERR MF_MEDIA_ENGINE_ERR

No error.

hh162841 MF_MEDIA_ENGINE_ERR_NOERROR MF_MEDIA_ENGINE_ERR_NOERROR

The process of fetching the media resource was stopped at the user's request.

hh162841 MF_MEDIA_ENGINE_ERR_ABORTED MF_MEDIA_ENGINE_ERR_ABORTED

A network error occurred while fetching the media resource.

hh162841 MF_MEDIA_ENGINE_ERR_NETWORK MF_MEDIA_ENGINE_ERR_NETWORK

An error occurred while decoding the media resource.

hh162841 MF_MEDIA_ENGINE_ERR_DECODE MF_MEDIA_ENGINE_ERR_DECODE

The media resource is not supported.

hh162841 MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED

An error occurred while encrypting the media resource.

Supported in Windows?8.1 and later.

hh162841 MF_MEDIA_ENGINE_ERR_ENCRYPTED MF_MEDIA_ENGINE_ERR_ENCRYPTED

Defines event codes for the Media Engine.

The application receives Media Engine events through the method. The EventNotify method includes two event parameters, param1 and param2. The meaning of the parameters depends on the event code. If the event description does not list any parameters, ignore the values of param1 and param2.

Values below 1000 correspond to events defined in HTML 5 for media elements.

hh162842 MF_MEDIA_ENGINE_EVENT MF_MEDIA_ENGINE_EVENT

The Media Engine has started to load the source. See .

hh162842 MF_MEDIA_ENGINE_EVENT_LOADSTART MF_MEDIA_ENGINE_EVENT_LOADSTART

The Media Engine is loading the source.

hh162842 MF_MEDIA_ENGINE_EVENT_PROGRESS MF_MEDIA_ENGINE_EVENT_PROGRESS

The Media Engine has suspended a load operation.

hh162842 MF_MEDIA_ENGINE_EVENT_SUSPEND MF_MEDIA_ENGINE_EVENT_SUSPEND

The Media Engine cancelled a load operation that was in progress.

hh162842 MF_MEDIA_ENGINE_EVENT_ABORT MF_MEDIA_ENGINE_EVENT_ABORT

An error occurred.

Event ParameterDescription
param1A member of the enumeration.
param2An error code, or zero.

?

hh162842 MF_MEDIA_ENGINE_EVENT_ERROR MF_MEDIA_ENGINE_EVENT_ERROR

The Media Engine has switched to the state. This can occur when the method is called, or if an error occurs during the Load method. See .

hh162842 MF_MEDIA_ENGINE_EVENT_EMPTIED MF_MEDIA_ENGINE_EVENT_EMPTIED

The Load algorithm is stalled, waiting for data.

hh162842 MF_MEDIA_ENGINE_EVENT_STALLED MF_MEDIA_ENGINE_EVENT_STALLED

The Media Engine is switching to the playing state. See .

hh162842 MF_MEDIA_ENGINE_EVENT_PLAY MF_MEDIA_ENGINE_EVENT_PLAY

The media engine has paused. See .

hh162842 MF_MEDIA_ENGINE_EVENT_PAUSE MF_MEDIA_ENGINE_EVENT_PAUSE

The Media Engine has loaded enough source data to determine the duration and dimensions of the source.

hh162842 MF_MEDIA_ENGINE_EVENT_LOADEDMETADATA MF_MEDIA_ENGINE_EVENT_LOADEDMETADATA

The Media Engine has loaded enough data to render some content (for example, a video frame).

hh162842 MF_MEDIA_ENGINE_EVENT_LOADEDDATA MF_MEDIA_ENGINE_EVENT_LOADEDDATA

Playback has stopped because the next frame is not available.

hh162842 MF_MEDIA_ENGINE_EVENT_WAITING MF_MEDIA_ENGINE_EVENT_WAITING

Playback has started. See .

hh162842 MF_MEDIA_ENGINE_EVENT_PLAYING MF_MEDIA_ENGINE_EVENT_PLAYING

Playback can start, but the Media Engine might need to stop to buffer more data.

hh162842 MF_MEDIA_ENGINE_EVENT_CANPLAY MF_MEDIA_ENGINE_EVENT_CANPLAY

The Media Engine can probably play through to the end of the resource, without stopping to buffer data.

hh162842 MF_MEDIA_ENGINE_EVENT_CANPLAYTHROUGH MF_MEDIA_ENGINE_EVENT_CANPLAYTHROUGH

The Media Engine has started seeking to a new playback position. See .

hh162842 MF_MEDIA_ENGINE_EVENT_SEEKING MF_MEDIA_ENGINE_EVENT_SEEKING

The Media Engine has seeked to a new playback position. See .

hh162842 MF_MEDIA_ENGINE_EVENT_SEEKED MF_MEDIA_ENGINE_EVENT_SEEKED

The playback position has changed. See .

hh162842 MF_MEDIA_ENGINE_EVENT_TIMEUPDATE MF_MEDIA_ENGINE_EVENT_TIMEUPDATE

Playback has reached the end of the source. This event is not sent if the GetLoopis TRUE.

hh162842 MF_MEDIA_ENGINE_EVENT_ENDED MF_MEDIA_ENGINE_EVENT_ENDED

The playback rate has changed. See .

hh162842 MF_MEDIA_ENGINE_EVENT_RATECHANGE MF_MEDIA_ENGINE_EVENT_RATECHANGE

The duration of the media source has changed. See .

hh162842 MF_MEDIA_ENGINE_EVENT_DURATIONCHANGE MF_MEDIA_ENGINE_EVENT_DURATIONCHANGE

The audio volume changed. See .

hh162842 MF_MEDIA_ENGINE_EVENT_VOLUMECHANGE MF_MEDIA_ENGINE_EVENT_VOLUMECHANGE

The output format of the media source has changed.

Event ParameterDescription
param1Zero if the video format changed, 1 if the audio format changed.
param2Zero.

?

hh162842 MF_MEDIA_ENGINE_EVENT_FORMATCHANGE MF_MEDIA_ENGINE_EVENT_FORMATCHANGE

The Media Engine flushed any pending events from its queue.

hh162842 MF_MEDIA_ENGINE_EVENT_PURGEQUEUEDEVENTS MF_MEDIA_ENGINE_EVENT_PURGEQUEUEDEVENTS

The playback position reached a timeline marker. See .

hh162842 MF_MEDIA_ENGINE_EVENT_TIMELINE_MARKER MF_MEDIA_ENGINE_EVENT_TIMELINE_MARKER

The audio balance changed. See .

hh162842 MF_MEDIA_ENGINE_EVENT_BALANCECHANGE MF_MEDIA_ENGINE_EVENT_BALANCECHANGE

The Media Engine has finished downloading the source data.

hh162842 MF_MEDIA_ENGINE_EVENT_DOWNLOADCOMPLETE MF_MEDIA_ENGINE_EVENT_DOWNLOADCOMPLETE

The media source has started to buffer data.

hh162842 MF_MEDIA_ENGINE_EVENT_BUFFERINGSTARTED MF_MEDIA_ENGINE_EVENT_BUFFERINGSTARTED

The media source has stopped buffering data.

hh162842 MF_MEDIA_ENGINE_EVENT_BUFFERINGENDED MF_MEDIA_ENGINE_EVENT_BUFFERINGENDED

The method completed.

hh162842 MF_MEDIA_ENGINE_EVENT_FRAMESTEPCOMPLETED MF_MEDIA_ENGINE_EVENT_FRAMESTEPCOMPLETED

The Media Engine's Load algorithm is waiting to start.

Event ParameterDescription
param1A handle to a waitable event, of type HANDLE.
param2Zero.

?

If Media Engine is created with the flag, the Media Engine sends the event at the start of the Load algorithm. The param1 parameter is a handle to a waitable event. The Load thread waits for the application to signal the event by calling SetEvent.

If the Media Engine is not created with the , it does not send this event, and the Load thread does not wait to be signalled.

hh162842 MF_MEDIA_ENGINE_EVENT_NOTIFYSTABLESTATE MF_MEDIA_ENGINE_EVENT_NOTIFYSTABLESTATE

The first frame of the media source is ready to render.

hh162842 MF_MEDIA_ENGINE_EVENT_FIRSTFRAMEREADY MF_MEDIA_ENGINE_EVENT_FIRSTFRAMEREADY

Raised when a new track is added or removed.

Supported in Windows?8.1 and later.

hh162842 MF_MEDIA_ENGINE_EVENT_TRACKSCHANGE MF_MEDIA_ENGINE_EVENT_TRACKSCHANGE

Raised when there is new information about the Output Protection Manager (OPM).

This event will be raised when an OPM failure occurs, but ITA allows fallback without the OPM. In this case, constriction can be applied.

This event will not be raised when there is an OPM failure and the fallback also fails. For example, if ITA blocks playback entirely when OPM cannot be established.

Supported in Windows?8.1 and later.

hh162842 MF_MEDIA_ENGINE_EVENT_OPMINFO MF_MEDIA_ENGINE_EVENT_OPMINFO
No documentation. hh162842 MF_MEDIA_ENGINE_EVENT_RESOURCELOST MF_MEDIA_ENGINE_EVENT_RESOURCELOST

Specifies media engine extension types.

hh162844 MF_MEDIA_ENGINE_EXTENSION_TYPE MF_MEDIA_ENGINE_EXTENSION_TYPE
hh162844 MF_MEDIA_ENGINE_EXTENSION_TYPE_MEDIASOURCE MF_MEDIA_ENGINE_EXTENSION_TYPE_MEDIASOURCE
hh162844 MF_MEDIA_ENGINE_EXTENSION_TYPE_BYTESTREAM MF_MEDIA_ENGINE_EXTENSION_TYPE_BYTESTREAM

Specifies the content protection requirements for a video frame.

hh162845 MF_MEDIA_ENGINE_FRAME_PROTECTION_FLAGS MF_MEDIA_ENGINE_FRAME_PROTECTION_FLAGS

The video frame should be protected.

hh162845 MF_MEDIA_ENGINE_FRAME_PROTECTION_FLAG_PROTECTED MF_MEDIA_ENGINE_FRAME_PROTECTION_FLAG_PROTECTED

Direct3D surface protection must be applied to any surface that contains the frame.

hh162845 MF_MEDIA_ENGINE_FRAME_PROTECTION_FLAG_REQUIRES_SURFACE_PROTECTION MF_MEDIA_ENGINE_FRAME_PROTECTION_FLAG_REQUIRES_SURFACE_PROTECTION

Direct3D anti-screen-scrape protection must be applied to any surface that contains the frame.

hh162845 MF_MEDIA_ENGINE_FRAME_PROTECTION_FLAG_REQUIRES_ANTI_SCREEN_SCRAPE_PROTECTION MF_MEDIA_ENGINE_FRAME_PROTECTION_FLAG_REQUIRES_ANTI_SCREEN_SCRAPE_PROTECTION
None. None None

Defines network status codes for the Media Engine.

hh162846 MF_MEDIA_ENGINE_NETWORK MF_MEDIA_ENGINE_NETWORK

The initial state.

hh162846 MF_MEDIA_ENGINE_NETWORK_EMPTY MF_MEDIA_ENGINE_NETWORK_EMPTY

The Media Engine has started the resource selection algorithm, and has selected a media resource, but is not using the network.

hh162846 MF_MEDIA_ENGINE_NETWORK_IDLE MF_MEDIA_ENGINE_NETWORK_IDLE

The Media Engine is loading a media resource.

hh162846 MF_MEDIA_ENGINE_NETWORK_LOADING MF_MEDIA_ENGINE_NETWORK_LOADING

The Media Engine has started the resource selection algorithm, but has not selected a media resource.

hh162846 MF_MEDIA_ENGINE_NETWORK_NO_SOURCE MF_MEDIA_ENGINE_NETWORK_NO_SOURCE

Defines preload hints for the Media Engine. These values correspond to the preload attribute of the HTMLMediaElement interface in HTML5.

hh162851 MF_MEDIA_ENGINE_PRELOAD MF_MEDIA_ENGINE_PRELOAD

The preload attribute is missing.

hh162851 MF_MEDIA_ENGINE_PRELOAD_MISSING MF_MEDIA_ENGINE_PRELOAD_MISSING

The preload attribute is an empty string. This value is equivalent to .

hh162851 MF_MEDIA_ENGINE_PRELOAD_EMPTY MF_MEDIA_ENGINE_PRELOAD_EMPTY

The preload attribute is "none". This value is a hint to the user agent not to preload the resource.

hh162851 MF_MEDIA_ENGINE_PRELOAD_NONE MF_MEDIA_ENGINE_PRELOAD_NONE

The preload attribute is "metadata". This value is a hint to the user agent to fetch the resource metadata.

hh162851 MF_MEDIA_ENGINE_PRELOAD_METADATA MF_MEDIA_ENGINE_PRELOAD_METADATA

The preload attribute is "auto". This value is a hint to the user agent to preload the entire resource.

hh162851 MF_MEDIA_ENGINE_PRELOAD_AUTOMATIC MF_MEDIA_ENGINE_PRELOAD_AUTOMATIC

Contains flags that specify whether the Media Engine will play protected content, and whether the Media Engine will use the Protected Media Path (PMP).

These flags are used with the attribute.

hh162852 MF_MEDIA_ENGINE_PROTECTION_FLAGS MF_MEDIA_ENGINE_PROTECTION_FLAGS
No documentation. hh162852 MF_MEDIA_ENGINE_ENABLE_PROTECTED_CONTENT MF_MEDIA_ENGINE_ENABLE_PROTECTED_CONTENT No documentation. hh162852 MF_MEDIA_ENGINE_USE_PMP_FOR_ALL_CONTENT MF_MEDIA_ENGINE_USE_PMP_FOR_ALL_CONTENT No documentation. hh162852 MF_MEDIA_ENGINE_USE_UNPROTECTED_PMP MF_MEDIA_ENGINE_USE_UNPROTECTED_PMP None. None None

Defines ready-state values for the Media Engine.

These values correspond to constants defined for the HTMLMediaElement.readyState attribute in HTML5.

hh162853 MF_MEDIA_ENGINE_READY MF_MEDIA_ENGINE_READY

No data is available.

hh162853 MF_MEDIA_ENGINE_READY_HAVE_NOTHING MF_MEDIA_ENGINE_READY_HAVE_NOTHING

Some metadata is available, including the duration and, for video files, the video dimensions. No media data is available.

hh162853 MF_MEDIA_ENGINE_READY_HAVE_METADATA MF_MEDIA_ENGINE_READY_HAVE_METADATA

There is media data for the current playback position, but not enough data for playback or seeking.

hh162853 MF_MEDIA_ENGINE_READY_HAVE_CURRENT_DATA MF_MEDIA_ENGINE_READY_HAVE_CURRENT_DATA

There is enough media data to enable some playback or seeking. The amount of data might be a little as the next video frame.

hh162853 MF_MEDIA_ENGINE_READY_HAVE_FUTURE_DATA MF_MEDIA_ENGINE_READY_HAVE_FUTURE_DATA

There is enough data to play the resource, based on the current rate at which the resource is being fetched.

hh162853 MF_MEDIA_ENGINE_READY_HAVE_ENOUGH_DATA MF_MEDIA_ENGINE_READY_HAVE_ENOUGH_DATA

Specifies the layout for a packed 3D video frame.

hh162854 MF_MEDIA_ENGINE_S3D_PACKING_MODE MF_MEDIA_ENGINE_S3D_PACKING_MODE

None.

hh162854 MF_MEDIA_ENGINE_S3D_PACKING_MODE_NONE MF_MEDIA_ENGINE_S3D_PACKING_MODE_NONE

The views are packed side-by-side in a single frame.

hh162854 MF_MEDIA_ENGINE_S3D_PACKING_MODE_SIDE_BY_SIDE MF_MEDIA_ENGINE_S3D_PACKING_MODE_SIDE_BY_SIDE

The views are packed top-to-bottom in a single frame.

hh162854 MF_MEDIA_ENGINE_S3D_PACKING_MODE_TOP_BOTTOM MF_MEDIA_ENGINE_S3D_PACKING_MODE_TOP_BOTTOM

Defines values for the media engine seek mode.

This enumeration is used with the MediaEngineEx::SetCurrentTimeEx.

jj128345 MF_MEDIA_ENGINE_SEEK_MODE MF_MEDIA_ENGINE_SEEK_MODE

Specifies normal seek.

jj128345 MF_MEDIA_ENGINE_SEEK_MODE_NORMAL MF_MEDIA_ENGINE_SEEK_MODE_NORMAL

Specifies an approximate seek.

jj128345 MF_MEDIA_ENGINE_SEEK_MODE_APPROXIMATE MF_MEDIA_ENGINE_SEEK_MODE_APPROXIMATE

Identifies statistics that the Media Engine tracks during playback. To get a playback statistic from the Media Engine, call .

In the descriptions that follow, the data type and value-type tag for the are listed in parentheses.

hh162855 MF_MEDIA_ENGINE_STATISTIC MF_MEDIA_ENGINE_STATISTIC
No documentation. hh162855 MF_MEDIA_ENGINE_STATISTIC_FRAMES_RENDERED MF_MEDIA_ENGINE_STATISTIC_FRAMES_RENDERED No documentation. hh162855 MF_MEDIA_ENGINE_STATISTIC_FRAMES_DROPPED MF_MEDIA_ENGINE_STATISTIC_FRAMES_DROPPED No documentation. hh162855 MF_MEDIA_ENGINE_STATISTIC_BYTES_DOWNLOADED MF_MEDIA_ENGINE_STATISTIC_BYTES_DOWNLOADED No documentation. hh162855 MF_MEDIA_ENGINE_STATISTIC_BUFFER_PROGRESS MF_MEDIA_ENGINE_STATISTIC_BUFFER_PROGRESS No documentation. hh162855 MF_MEDIA_ENGINE_STATISTIC_FRAMES_PER_SECOND MF_MEDIA_ENGINE_STATISTIC_FRAMES_PER_SECOND No documentation. hh162855 MF_MEDIA_ENGINE_STATISTIC_PLAYBACK_JITTER MF_MEDIA_ENGINE_STATISTIC_PLAYBACK_JITTER No documentation. hh162855 MF_MEDIA_ENGINE_STATISTIC_FRAMES_CORRUPTED MF_MEDIA_ENGINE_STATISTIC_FRAMES_CORRUPTED No documentation. hh162855 MF_MEDIA_ENGINE_STATISTIC_TOTAL_FRAME_DELAY MF_MEDIA_ENGINE_STATISTIC_TOTAL_FRAME_DELAY No documentation. __MIDL___MIDL_itf_mfobjects_0000_0012_0001 __MIDL___MIDL_itf_mfobjects_0000_0012_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. MECaptureAudioSessionVolumeChanged MECaptureAudioSessionVolumeChanged No documentation. MECaptureAudioSessionDeviceRemoved MECaptureAudioSessionDeviceRemoved No documentation. MECaptureAudioSessionFormatChanged MECaptureAudioSessionFormatChanged No documentation. MECaptureAudioSessionDisconnected MECaptureAudioSessionDisconnected No documentation. MECaptureAudioSessionExclusiveModeOverride MECaptureAudioSessionExclusiveModeOverride No documentation. MECaptureAudioSessionServerShutdown MECaptureAudioSessionServerShutdown No documentation. MESinkV2Anchor MESinkV2Anchor 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. MEByteStreamCharacteristicsChanged MEByteStreamCharacteristicsChanged No documentation. MEVideoCaptureDeviceRemoved MEVideoCaptureDeviceRemoved No documentation. MEVideoCaptureDevicePreempted MEVideoCaptureDevicePreempted No documentation. MEStreamSinkFormatInvalidated MEStreamSinkFormatInvalidated No documentation. MEEncodingParameters MEEncodingParameters No documentation. MEContentProtectionMetadata MEContentProtectionMetadata 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 IMFMediaSession::Start 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 No documentation. ms694277 MFMEDIASOURCE_DOES_NOT_USE_NETWORK MFMEDIASOURCE_DOES_NOT_USE_NETWORK

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 No documentation. __MIDL___MIDL_itf_mfreadwrite_0000_0001_0002 __MIDL___MIDL_itf_mfreadwrite_0000_0001_0002 No documentation. MF_SOURCE_READER_CURRENT_TYPE_INDEX MF_SOURCE_READER_CURRENT_TYPE_INDEX

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

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

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 DXVA2_NominalRange 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

Defines protection levels for MFPROTECTION_ACP.

jj128346 MF_OPM_ACP_PROTECTION_LEVEL MF_OPM_ACP_PROTECTION_LEVEL

Specifies ACP is disabled.

jj128346 MF_OPM_ACP_OFF MF_OPM_ACP_OFF

Specifies ACP is level one.

jj128346 MF_OPM_ACP_LEVEL_ONE MF_OPM_ACP_LEVEL_ONE

Specifies ACP is level two.

jj128346 MF_OPM_ACP_LEVEL_TWO MF_OPM_ACP_LEVEL_TWO

Specifies ACP is level three.

jj128346 MF_OPM_ACP_LEVEL_THREE MF_OPM_ACP_LEVEL_THREE

Reserved.

jj128346 MF_OPM_ACP_FORCE_ULONG MF_OPM_ACP_FORCE_ULONG

Defines protection levels for MFPROTECTION_CGMSA.

These flags are equivalent to the OPM_CGMSA_Protection_Level enumeration constants used in the Output Protection Protocol (OPM).

jj128347 MF_OPM_CGMSA_PROTECTION_LEVEL MF_OPM_CGMSA_PROTECTION_LEVEL

CGMS-A is disabled.

jj128347 MF_OPM_CGMSA_OFF MF_OPM_CGMSA_OFF

The protection level is Copy Freely.

jj128347 MF_OPM_CGMSA_COPY_FREELY MF_OPM_CGMSA_COPY_FREELY

The protection level is Copy No More.

jj128347 MF_OPM_CGMSA_COPY_NO_MORE MF_OPM_CGMSA_COPY_NO_MORE

The protection level is Copy One Generation.

jj128347 MF_OPM_CGMSA_COPY_ONE_GENERATION MF_OPM_CGMSA_COPY_ONE_GENERATION

The protection level is Copy Never.

jj128347 MF_OPM_CGMSA_COPY_NEVER MF_OPM_CGMSA_COPY_NEVER

Redistribution control (also called the broadcast flag) is required. This flag can be combined with the other flags.

jj128347 MF_OPM_CGMSA_REDISTRIBUTION_CONTROL_REQUIRED MF_OPM_CGMSA_REDISTRIBUTION_CONTROL_REQUIRED

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

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 No documentation. __MIDL___MIDL_itf_mfreadwrite_0000_0004_0001 __MIDL___MIDL_itf_mfreadwrite_0000_0004_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 No documentation. dd375773 MF_SOURCE_READERF_ALLEFFECTSREMOVED MF_SOURCE_READERF_ALLEFFECTSREMOVED 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_DISABLE_LOCAL_PLUGINS MF_RESOLUTION_DISABLE_LOCAL_PLUGINS No documentation. MF_RESOLUTION_PLUGIN_CONTROL_POLICY_APPROVED_ONLY MF_RESOLUTION_PLUGIN_CONTROL_POLICY_APPROVED_ONLY No documentation. MF_RESOLUTION_PLUGIN_CONTROL_POLICY_WEB_ONLY MF_RESOLUTION_PLUGIN_CONTROL_POLICY_WEB_ONLY No documentation. MF_RESOLUTION_READ MF_RESOLUTION_READ No documentation. MF_RESOLUTION_WRITE MF_RESOLUTION_WRITE None. None None

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

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_COMMAND_TICK MFT_MESSAGE_COMMAND_TICK 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

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

Regenerates the last output sample.

Note Requires Windows?8.

ms700163 MFT_PROCESS_OUTPUT_REGENERATE_LAST_OUTPUT MFT_PROCESS_OUTPUT_REGENERATE_LAST_OUTPUT
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

Specifies how 3D video frames are stored in memory.

This enumeration is used with the attribute.

hh162802 MFVideo3DFormat MFVideo3DFormat

The base view is stored in a single buffer. The other view is discarded.

hh162802 MFVideo3DSampleFormat_BaseView MFVideo3DSampleFormat_BaseView

Each media sample contains multiple buffers, one for each view.

hh162802 MFVideo3DSampleFormat_MultiView MFVideo3DSampleFormat_MultiView

Each media sample contains one buffer, with both views packed side-by-side into a single frame.

hh162802 MFVideo3DSampleFormat_Packed_LeftRight MFVideo3DSampleFormat_Packed_LeftRight

Each media sample contains one buffer, with both views packed top-and-bottom into a single frame.

hh162802 MFVideo3DSampleFormat_Packed_TopBottom MFVideo3DSampleFormat_Packed_TopBottom

Specifies how to output a 3D stereoscopic video stream.

This enumeration is used with the attribute.

hh162743 MF3DVideoOutputType MF3DVideoOutputType

Output the base view only. Discard the other view.

hh162743 MF3DVideoOutputType_BaseView MF3DVideoOutputType_BaseView

Output a stereo view (two buffers).

hh162743 MF3DVideoOutputType_Stereo MF3DVideoOutputType_Stereo

Specifies how a 3D video frame is stored in a media sample.

This enumeration is used with the attribute.

The exact layout of the views in memory is specified by the following media type attributes:

hh162803 MFVideo3DSampleFormat MFVideo3DSampleFormat

Each view is stored in a separate buffer. The sample contains one buffer per view.

hh162803 MFSampleExtension_3DVideo_MultiView MFSampleExtension_3DVideo_MultiView

All of the views are stored in the same buffer. The sample contains a single buffer.

hh162803 MFSampleExtension_3DVideo_Packed MFSampleExtension_3DVideo_Packed

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 DXVA2_VideoChromaSubSampling 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

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

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 DXVA2_VideoPrimaries 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

Describes the rotation of the video image in the counter-clockwise direction.

This enumeration is used with the attribute.

hh162805 MFVideoRotationFormat MFVideoRotationFormat

The image is not rotated.

hh162805 MFVideoRotationFormat_0 MFVideoRotationFormat_0

The image is rotated 90 degrees counter-clockwise.

hh162805 MFVideoRotationFormat_90 MFVideoRotationFormat_90

The image is rotated 180 degrees.

hh162805 MFVideoRotationFormat_180 MFVideoRotationFormat_180

The image is rotated 270 degrees counter-clockwise.

hh162805 MFVideoRotationFormat_270 MFVideoRotationFormat_270

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 DXVA2_VideoTransferFunction 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 DXVA2_VideoTransferMatrix 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

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 or use a work queue obtained from 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_MULTITHREADED MFASYNC_CALLBACK_QUEUE_MULTITHREADED 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 Functions Functions Functions Constant MultisampledP1. MFAudioFormat_MSP1 Constant Drm. MFAudioFormat_DRM Constant Dts. MFAudioFormat_DTS Constant AmrWp. MFAudioFormat_AMR_WP Constant Float. MFAudioFormat_Float Constant WMAudioV9. MFAudioFormat_WMAudioV9 Constant DolbyDDPlus. MFAudioFormat_Dolby_DDPlus Constant AmrWb. MFAudioFormat_AMR_WB Constant Pcm. MFAudioFormat_PCM Constant Base. MFAudioFormat_Base Constant Mp3. MFAudioFormat_MP3 Constant DolbyAc3. MFAudioFormat_Dolby_AC3 Constant Wmaspdif. MFAudioFormat_WMASPDIF Constant WMAudioLossless. MFAudioFormat_WMAudio_Lossless Constant Mpeg. MFAudioFormat_MPEG Constant DolbyAc3Spdif. MFAudioFormat_Dolby_AC3_SPDIF Constant Aac. MFAudioFormat_AAC Constant Adts. MFAudioFormat_ADTS Constant AmrNb. MFAudioFormat_AMR_NB Constant WMAudioV8. MFAudioFormat_WMAudioV8 Functions Functions Constant ContentType. MF_BYTESTREAM_CONTENT_TYPE Constant Duration. MF_BYTESTREAM_DURATION Constant EffectiveUrl. MF_BYTESTREAM_EFFECTIVE_URL 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 Functions Functions Functions Functions Constant TransformContext. MF_EVENT_MFT_CONTEXT Constant TransformInputStreamId. MF_EVENT_MFT_INPUT_STREAM_ID Functions Constant SaRequiredSampleCount. MF_SA_REQUIRED_SAMPLE_COUNT Functions Functions Functions Constant UserDataPayload. MF_USER_DATA_PAYLOAD Constant LocalPluginControlPolicy. MF_LOCAL_PLUGIN_CONTROL_POLICY Constant SourceStreamSupportsHardwareConnection. MF_SOURCE_STREAM_SUPPORTS_HW_CONNECTION Constant SupportsHardwareConnection. MF_STREAM_SINK_SUPPORTS_HW_CONNECTION Constant SupportsRotation. MF_STREAM_SINK_SUPPORTS_ROTATION Functions Constant AudioCategory. MF_MEDIA_ENGINE_AUDIO_CATEGORY Constant AudioEndpointRole. MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE Constant Callback. MF_MEDIA_ENGINE_CALLBACK Constant ContentProtectionFlags. MF_MEDIA_ENGINE_CONTENT_PROTECTION_FLAGS Constant ContentProtectionManager. MF_MEDIA_ENGINE_CONTENT_PROTECTION_MANAGER Constant DxgiManager. MF_MEDIA_ENGINE_DXGI_MANAGER Constant Extension. MF_MEDIA_ENGINE_EXTENSION Constant VideoOutputFormat. MF_MEDIA_ENGINE_VIDEO_OUTPUT_FORMAT Functions Constant Version. MF_VERSION

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

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

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

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

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

Puts an asynchronous operation on a work queue, with a specified priority.

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 MFAllocateWorkQueue or MFAllocateWorkQueueEx.

The priority of the work item. Work items are performed in order of priority.

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 identifier.

The function was not called, or was called.

?

Windows Phone 8.1: This API is supported.

hh162784 HRESULT MFPutWorkItem2([In] unsigned int dwQueue,[In] int Priority,[In] IMFAsyncCallback* pCallback,[In, Optional] IUnknown* pState) MFPutWorkItem2

Unlocks a work queue.

Identifier for the work queue to be unlocked. The identifier is returned by the MFAllocateWorkQueue 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 MFAllocateWorkQueue and then once for every call to .

Windows Phone 8.1: This API is supported.

aa372543 HRESULT MFUnlockWorkQueue([In] unsigned int dwWorkQueue) MFUnlockWorkQueue

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 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

Creates an activation object for a Windows Runtime class.

The class identifier that is associated with the activatable runtime class.

A reference to an optional IPropertySet object, which is used to configure the Windows Runtime class. This parameter can be null.

The interface identifier (IID) of the interface being requested. The activation object created by this function supports the following interfaces:

  • IPersistStream

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

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

To create the Windows Runtime object, call or IClassFactory::CreateInstance.

Windows Phone 8.1: This API is supported.

hh162753 HRESULT MFCreateMediaExtensionActivate([In] const wchar_t* szActivatableClassId,[In, Optional] IUnknown* pConfiguration,[In] const GUID& riid,[Out] void** ppvObject) MFCreateMediaExtensionActivate

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

Attempts to cancel an asynchronous operation that was scheduled with MFScheduleWorkItem or MFScheduleWorkItemEx.

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

Creates an object that allocates video samples that are compatible with Microsoft DirectX Graphics Infrastructure (DXGI).

The identifier of the interface to retrieve. Specify one of the following values.

ValueMeaning
IID_IUnknown

Retrieve an reference.

IID_IMFVideoSampleAllocator

Retrieve an reference.

IID_IMFVideoSampleAllocatorEx

Retrieve an reference.

IID_IMFVideoSampleAllocatorCallback

Retrieve an reference.

?

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

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

This function creates an allocator for DXGI video surfaces. The buffers created by this allocator expose the interface. To create an allocator for Microsoft Direct3D?9 video surfaces, call MFCreateVideoSampleAllocator.

Windows Phone 8.1: This API is supported.

hh162763 HRESULT MFCreateVideoSampleAllocatorEx([In] const GUID& riid,[Out] void** ppSampleAllocator) MFCreateVideoSampleAllocatorEx

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

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

Queues a work item that waits for an event to be signaled.

A handle to an event object. To create an event object, call CreateEvent or CreateEventEx.

The priority of the work item. Work items are performed in order of priority.

A reference to the interface of an asynchronous result object. To create the result object, call .

Receives a key that can be used to cancel the wait. To cancel the wait, call and pass this key in the Key parameter. This parameter can be null.

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

This function enables a component to wait for an event without blocking the current thread.

The function puts a work item on the specified work queue. This work item waits for the event given in hEvent to be signaled. When the event is signaled, the work item invokes a callback. (The callback is contained in the result object given in pResult. For more information, see ).

The work item is dispatched on a work queue by the method of the callback. The work queue can be any of the following:

  • The default work queue ().
  • The platform multithreaded queue ().
  • A multithreaded queue returned by the function.
  • A serial queue created by the function.

Do not use any of the following work queues: , , , or .

Windows Phone 8.1: This API is supported.

hh162783 HRESULT MFPutWaitingWorkItem([In] void* hEvent,[In] int Priority,[In] IMFAsyncResult* pResult,[Out, Optional] unsigned longlong* pKey) MFPutWaitingWorkItem

Allocates a system-memory buffer that is optimal for a specified media type.

A reference to the interface of the media type.

The sample duration. This value is required for audio formats.

The minimum size of the buffer, in bytes. The actual buffer size might be larger. Specify zero to allocate the default buffer size for the media type.

The minimum memory alignment for the buffer. Specify zero to use the default memory alignment.

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

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

For video formats, if the format is recognized, the function creates a 2-D buffer that implements the interface. Otherwise it creates a linear buffer. To get the interface, call QueryInterface on the reference returned in ppBuffer. If the QueryInterface method fails, use the interface to access the buffer memory.

For audio formats, the function allocates a buffer that is large enough to contain llDuration audio samples, or dwMinLength, whichever is larger.

This function always allocates system memory. For Direct3D surfaces, use the or MFCreateDXSurfaceBuffer function.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

hh162752 HRESULT MFCreateMediaBufferFromMediaType([In] IMFMediaType* pMediaType,[In] longlong llDuration,[In] unsigned int dwMinLength,[In] unsigned int dwMinAlignment,[Out] IMFMediaBuffer** ppBuffer) MFCreateMediaBufferFromMediaType

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

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

Locks the shared Microsoft DirectX Graphics Infrastructure (DXGI) Device Manager.

Receives a token that identifies this instance of the DXGI Device Manager. Use this token when calling . 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.

This function obtains a reference to a DXGI Device Manager instance that can be shared between components. The Microsoft Media Foundation platform creates this instance of the DXGI Device Manager as a singleton object. Alternatively, you can create a new DXGI Device Manager by calling .

The first time this function is called, the Media Foundation platform creates the shared DXGI Device Manager.

When you are done use the reference, call the .

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

hh162770 HRESULT MFLockDXGIDeviceManager([Out, Optional] unsigned int* pResetToken,[Out] IMFDXGIDeviceManager** ppManager) MFLockDXGIDeviceManager

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

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

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

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

Locks a work queue.

The identifier for the work queue. The identifier is returned by the MFAllocateWorkQueue 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 MFAllocateWorkQueue 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 an instance of the Microsoft DirectX Graphics Infrastructure (DXGI) Device Manager.

Receives a token that identifies this instance of the DXGI Device Manager. Use this token when calling .

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

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

When you create an with , a Microsoft Direct3D?11 device is not associated with the device manager. To associate a Direct3D?11 device with the device manager, call , passing in the reference to the Direct3D?11 device. To create a Direct3D?11 device, call . The device should be created with the device creation flag which is defined in the enumeration.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

hh162750 HRESULT MFCreateDXGIDeviceManager([Out] unsigned int* resetToken,[Out, Fast] IMFDXGIDeviceManager** ppDeviceManager) MFCreateDXGIDeviceManager

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

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

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

Creates a system-memory buffer object to hold 2D image data.

Width of the image, in pixels.

Height of the image, in pixels.

A FOURCC code or D3DFORMAT value that specifies the video format. If you have a video subtype , you can use the first DWORD of the subtype.

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.

This function can return one of these values.

Return codeDescription

Success.

Unrecognized video format.

?

The returned buffer object also exposes the interface.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

hh162746 HRESULT MFCreate2DMediaBuffer([In] unsigned int dwWidth,[In] unsigned int dwHeight,[In] unsigned int dwFourCC,[In] BOOL fBottomUp,[Out] IMFMediaBuffer** ppBuffer) MFCreate2DMediaBuffer

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

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.

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 ()
  • A multithreaded queue returned by the function.
  • A serial queue created by the function.

Receives an identifier for the new serial work queue. Use this identifier when queuing work items.

This function can return one of these values.

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 .

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 HRESULT MFAllocateSerialWorkQueue([In] unsigned int dwWorkQueue,[Out] unsigned int* pdwWorkQueue) MFAllocateSerialWorkQueue

Obtains and locks a shared work queue.

The name of the MMCSS task.

The base priority of the work-queue threads. If the regular-priority queue is being used (wszClass=""), then the value 0 must be passed in.

The MMCSS task identifier. On input, specify an existing MCCSS task group ID , or use the value zero to create a new task group. If the regular priority queue is being used (wszClass=""), then null must be passed in. On output, receives the actual task group ID.

Receives an identifier for the new work queue. Use this identifier when queuing work items.

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

A multithreaded work queue uses a thread pool to dispatch work items. Whenever a thread becomes available, it dequeues the next work item from the queue. Work items are dequeued in first-in-first-out order, but work items are not serialized. In other words, the work queue does not wait for a work item to complete before it starts the next work item.

Within a single process, the Microsoft Media Foundation platform creates up to one multithreaded queue for each Multimedia Class Scheduler Service (MMCSS) task. The function checks whether a matching work queue already exists. If not, the function creates a new work queue and registers the work queue with MMCSS. The function returns the MMCSS task identifier (pdwTaskId) and the work queue identifier (pID). To queue a work item, pass the work queue identifier to any of the following functions:

  • MFPutWorkItem
  • MFPutWorkItemEx

The function also locks the queue. Before the process exits, call to unlock the work queue.

If the regular priority queue is being used (wszClass=""), then null must be passed in to pdwTaskId and the value 0 must be passed into BasePriority.

Windows Phone 8.1: This API is supported.

hh162771 HRESULT MFLockSharedWorkQueue([In] const wchar_t* wszClass,[In] int BasePriority,[InOut] unsigned int* pdwTaskId,[Out] unsigned int* pID) MFLockSharedWorkQueue

Creates a media buffer to manage a Microsoft DirectX Graphics Infrastructure (DXGI) surface.

Identifies the type of DXGI surface. This value must be IID_ID3D11Texture2D.

A reference to the interface of the DXGI surface.

The zero-based index of a subresource of the surface. The media buffer object is associated with this subresource.

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 Direct3D.

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.

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

The returned buffer object supports the following interfaces:

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

hh162751 HRESULT MFCreateDXGISurfaceBuffer([In] const GUID& riid,[In] IUnknown* punkSurface,[In] unsigned int uSubresourceIndex,[In] BOOL fBottomUpWhenLinear,[Out] IMFMediaBuffer** ppBuffer) MFCreateDXGISurfaceBuffer

Unlocks the shared Microsoft DirectX Graphics Infrastructure (DXGI) Device Manager.

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

Call this function after a successful call to the function.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

hh162800 HRESULT MFUnlockDXGIDeviceManager() MFUnlockDXGIDeviceManager

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

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

Puts an asynchronous operation on a work queue, with a specified priority.

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 MFAllocateWorkQueue or MFAllocateWorkQueueEx.

The priority of the work item. Work items are performed in order of priority.

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.

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.

Windows Phone 8.1: This API is supported.

hh162785 HRESULT MFPutWorkItemEx2([In] unsigned int dwQueue,[In] int Priority,[In] IMFAsyncResult* pResult) MFPutWorkItemEx2

Creates a Microsoft Media Foundation byte stream that wraps an IRandomAccessStream object.

No documentation. No documentation.

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

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

hh162754 HRESULT MFCreateMFByteStreamOnStreamEx([In] IUnknown* punkStream,[Out, Fast] IMFByteStream** ppByteStream) MFCreateMFByteStreamOnStreamEx

Create an from properties.

No documentation. No documentation.

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

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

jj247579 HRESULT MFCreateMediaTypeFromProperties([In] IUnknown* punkStream,[Out] IMFMediaType** ppMediaType) MFCreateMediaTypeFromProperties

Creates an IRandomAccessStream object that wraps a Microsoft Media Foundation byte stream.

No documentation. No documentation. No documentation.

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

The returned byte stream object exposes the interface. To get the original reference, call using the service identifier MF_WRAPPED_OBJECT.

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

hh162760 HRESULT MFCreateStreamOnMFByteStreamEx([In] IMFByteStream* pByteStream,[In] const GUID& riid,[Out] void** ppv) MFCreateStreamOnMFByteStreamEx

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

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 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

Creates properties from a .

No documentation. No documentation. No documentation.

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

Windows?Phone?8: This API is supported.

Windows Phone 8.1: This API is supported.

jj247580 HRESULT MFCreatePropertiesFromMediaType([In] IMFMediaType* pMediaType,[In] const GUID& riid,[Out] void** ppv) MFCreatePropertiesFromMediaType

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

Creates an object that tracks the reference counts on a video media sample.

No documentation. No documentation.

Windows Phone 8.1: This API is supported.

hh162761 HRESULT MFCreateTrackedSample([Out] IMFTrackedSample** ppMFSample) MFCreateTrackedSample

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

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 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 MF_TRANSCODE_CONTAINERTYPE attribute. The sink writer uses the MF_TRANSCODE_CONTAINERTYPE 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 MF_TRANSCODE_CONTAINERTYPE attribute, the sink writer uses that attribute to determine the type of file container. Otherwise, if the MF_TRANSCODE_CONTAINERTYPE 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 MF_TRANSCODE_CONTAINERTYPE 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 MF_TRANSCODE_CONTAINERTYPE 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 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

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 IMFObjectReferenceStream interface (through QueryInterface), the function calls IMFObjectReferenceStream::LoadReference 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 IMFObjectReferenceStream interface (through QueryInterface), the function calls IMFObjectReferenceStream::SaveReference 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
Functions Constant MetadataProvider. MF_METADATA_PROVIDER_SERVICE Constant Qualiy. MF_QUALITY_SERVICES Constant RateControl. MF_RATE_CONTROL_SERVICE Constant NetworkSourceStatistics. MFNETSOURCE_STATISTICS_SERVICE Functions 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 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 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 H264Capabilities. MF_MT_H264_CAPABILITIES Constant H264MaxCodecConfigDelay. MF_MT_H264_MAX_CODEC_CONFIG_DELAY Constant H264MaxMbPerSec. MF_MT_H264_MAX_MB_PER_SEC Constant H264RateControlModes. MF_MT_H264_RATE_CONTROL_MODES Constant H264SimulcastSupport. MF_MT_H264_SIMULCAST_SUPPORT Constant H264SupportedRateControlModes. MF_MT_H264_SUPPORTED_RATE_CONTROL_MODES Constant H264SupportedSliceModes. MF_MT_H264_SUPPORTED_SLICE_MODES Constant H264SupportedSyncFrameTypes. MF_MT_H264_SUPPORTED_SYNC_FRAME_TYPES Constant H264SupportedUsages. MF_MT_H264_SUPPORTED_USAGES Constant H264SvcCapabilities. MF_MT_H264_SVC_CAPABILITIES Constant H264Usage. MF_MT_H264_USAGE 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 Mpeg2ContentPACKET. MF_MT_MPEG2_CONTENT_PACKET Constant Mpeg2Flags. MF_MT_MPEG2_FLAGS Constant Mpeg2Level. MF_MT_MPEG2_LEVEL Constant Mpeg2Profile. MF_MT_MPEG2_PROFILE Constant Mpeg2STANDARD. MF_MT_MPEG2_STANDARD Constant Mpeg2TIMECODE. MF_MT_MPEG2_TIMECODE Constant Mpeg4CurrentSampleEntry. MF_MT_MPEG4_CURRENT_SAMPLE_ENTRY Constant Mpeg4SampleDescription. MF_MT_MPEG4_SAMPLE_DESCRIPTION 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 TimestampCanBeDTS. MF_MT_TIMESTAMP_CAN_BE_DTS Constant TransferFunction. MF_MT_TRANSFER_FUNCTION Constant UserData. MF_MT_USER_DATA Constant Video3d. MF_MT_VIDEO_3D Constant Video3dFirstIsLeft. MF_MT_VIDEO_3D_FIRST_IS_LEFT Constant Video3dFormat. MF_MT_VIDEO_3D_FORMAT Constant Video3dLeftIsBase. MF_MT_VIDEO_3D_LEFT_IS_BASE Constant Video3dNumViews. MF_MT_VIDEO_3D_NUM_VIEWS 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 VideoRotation. MF_MT_VIDEO_ROTATION Constant WrappedType. MF_MT_WRAPPED_TYPE Constant YuvMatrix. MF_MT_YUV_MATRIX Functions Constant Protected. MFMediaType_Protected Constant Audio. MFMediaType_Audio Constant FileTransfer. MFMediaType_FileTransfer Constant Image. MFMediaType_Image Constant Html. MFMediaType_HTML Constant Binary. MFMediaType_Binary Constant Video. MFMediaType_Video Constant Sami. MFMediaType_SAMI Constant Default. MFMediaType_Default Constant Script. MFMediaType_Script Constant Stream. MFMediaType_Stream Functions Constant MoovBeforeMdat. MF_MPEG4SINK_MOOV_BEFORE_MDAT Constant SpsppsPassthrough. MF_MPEG4SINK_SPSPPS_PASSTHROUGH Functions Constant LengthInformation. MF_NALU_LENGTH_INFORMATION Constant LengthSet. MF_NALU_LENGTH_SET Functions 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 PreferredLanguage. MF_PD_PREFERRED_LANGUAGE Constant TotalFileSize. MF_PD_TOTAL_FILE_SIZE Constant VideoEncodingBitrate. MF_PD_VIDEO_ENCODING_BITRATE Functions Constant GraphicsTransferAesEncryption. MFPROTECTION_GRAPHICS_TRANSFER_AES_ENCRYPTION Constant VideoFrames. MFPROTECTION_VIDEO_FRAMES Constant BestEffort. MFPROTECTIONATTRIBUTE_BEST_EFFORT Constant FailOver. MFPROTECTIONATTRIBUTE_FAIL_OVER Functions Constant VideoDeviceLocked. MF_E_VIDEO_DEVICE_LOCKED Constant NonPeProcess. MF_E_NON_PE_PROCESS Constant TopoInvalidTimeAttributes. MF_E_TOPO_INVALID_TIME_ATTRIBUTES Constant LicenseRestoreNoRights. MF_E_LICENSE_RESTORE_NO_RIGHTS Constant SequencerUnknownSegmentId. MF_E_SEQUENCER_UNKNOWN_SEGMENT_ID Constant ResolutionRequiresPmpCreationCallback. MF_E_RESOLUTION_REQUIRES_PMP_CREATION_CALLBACK Constant NoSourceInCache. MF_E_NO_SOURCE_IN_CACHE Constant NetWrite. MF_E_NET_WRITE Constant OfflineMode. MF_E_OFFLINE_MODE Constant CaptureEngineInvalidOperation. MF_E_CAPTURE_ENGINE_INVALID_OP Constant PeauthPublickeyRevoked. MF_E_PEAUTH_PUBLICKEY_REVOKED Constant AsfMissingData. MF_E_ASF_MISSINGDATA Constant NetManualssNotSupported. MF_E_NET_MANUALSS_NOT_SUPPORTED Constant CaptureSourceNoAudioStreamPresent. MF_E_CAPTURE_SOURCE_NO_AUDIO_STREAM_PRESENT Constant AudioRecordingDeviceInvalidated. MF_E_AUDIO_RECORDING_DEVICE_INVALIDATED Constant CaptureNoSamplesInQueue. MF_E_CAPTURE_NO_SAMPLES_IN_QUEUE Constant BackupRestrictedLicense. MF_E_BACKUP_RESTRICTED_LICENSE Constant TransformNotPossibleForCurrentInputMediaType. MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_INPUT_MEDIATYPE Constant DrmUnsupported. MF_E_DRM_UNSUPPORTED Constant TranscodeNoContainertype. MF_E_TRANSCODE_NO_CONTAINERTYPE Constant GrlUnrecognizedFormat. MF_E_GRL_UNRECOGNIZED_FORMAT Constant SinkHeadersNotFound. MF_E_SINK_HEADERS_NOT_FOUND Constant ComponentRevoked. MF_E_COMPONENT_REVOKED Constant BadStartupVersion. MF_E_BAD_STARTUP_VERSION Constant NetResourceGone. MF_E_NET_RESOURCE_GONE Constant MediaSourceWrongState. MF_E_MEDIA_SOURCE_WRONGSTATE Constant StreamsInksOutOfSync. MF_E_STREAMSINKS_OUT_OF_SYNC Constant UnsupportedByteStreamType. MF_E_UNSUPPORTED_BYTESTREAM_TYPE Constant RtTooManyClassEs. MF_E_RT_TOO_MANY_CLASSES Constant NoSampleDuration. MF_E_NO_SAMPLE_DURATION Constant TransformPropertyValueSizeWrong. MF_E_TRANSFORM_PROPERTY_VALUE_SIZE_WRONG Constant GrlExtensibleEntryNotFound. MF_E_GRL_EXTENSIBLE_ENTRY_NOT_FOUND Constant TransformNotPossibleForCurrentOutputMediaType. MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_OUTPUT_MEDIATYPE Constant RtUnavailable. MF_E_RT_UNAVAILABLE Constant PolicyMgrActionOufOfBounds. MF_E_POLICY_MGR_ACTION_OUTOFBOUNDS Constant SignatureVerificationFailed. MF_E_SIGNATURE_VERIFICATION_FAILED Constant NewVideoDevice. MF_E_NEW_VIDEO_DEVICE Constant LicenseRestoreNeedsIndividualization. MF_E_LICENSE_RESTORE_NEEDS_INDIVIDUALIZATION Constant NetInvalidPushTemplate. MF_E_NET_INVALID_PUSH_TEMPLATE Constant Mp3NotFound. MF_E_MP3_NOTFOUND Constant TopoInvalidOptionalNode. MF_E_TOPO_INVALID_OPTIONAL_NODE Constant MediaProcWrongState. MF_E_MEDIAPROC_WRONGSTATE Constant StreamsInkRemoved. MF_E_STREAMSINK_REMOVED Constant NetRequireAsync. MF_E_NET_REQUIRE_ASYNC Constant PeauthNotStarted. MF_E_PEAUTH_NOT_STARTED Constant DrmMigrationNotSupported. MF_E_DRM_MIGRATION_NOT_SUPPORTED Constant MultipleBegin. MF_E_MULTIPLE_BEGIN Constant StateTransitionPending. MF_E_STATE_TRANSITION_PENDING Constant TopoUnsupported. MF_E_TOPO_UNSUPPORTED Constant OutOfRange. MF_E_OUT_OF_RANGE Constant TransformPropertyValueIncompatible. MF_E_TRANSFORM_PROPERTY_VALUE_INCOMPATIBLE Constant CaptureSourceDeviceExtendedpropOperationInProgress. MF_E_CAPTURE_SOURCE_DEVICE_EXTENDEDPROP_OP_IN_PROGRESS Constant NotProtected. MF_E_NOT_PROTECTED Constant Attributenotfound. MF_E_ATTRIBUTENOTFOUND Constant WmdrmotaActionAlreadySet. MF_E_WMDRMOTA_ACTION_ALREADY_SET Constant NoAudioRecordingDevice. MF_E_NO_AUDIO_RECORDING_DEVICE Constant AsfDroppedPacket. MF_E_ASF_DROPPED_PACKET Constant NetErrorFromProxy. MF_E_NET_ERROR_FROM_PROXY Constant NetStreamGroupsNotSupported. MF_E_NET_STREAMGROUPS_NOT_SUPPORTED Constant NetTooManyRedirects. MF_E_NET_TOO_MANY_REDIRECTS Constant ItaOperationLDataNotInitializeD. MF_E_ITA_OPL_DATA_NOT_INITIALIZED Constant RtThroughputNotAvailable. MF_E_RT_THROUGHPUT_NOT_AVAILABLE Constant AsfParsingincomplete. MF_E_ASF_PARSINGINCOMPLETE Constant HighSecurityLevelContentNotAllowEd. MF_E_HIGH_SECURITY_LEVEL_CONTENT_NOT_ALLOWED Constant VideoRecordingDeviceInvalidated. MF_E_VIDEO_RECORDING_DEVICE_INVALIDATED Constant NetBadRequest. MF_E_NET_BAD_REQUEST Constant InvalidTimestamp. MF_E_INVALID_TIMESTAMP Constant SampleHasTooManyBuffers. MF_E_SAMPLE_HAS_TOO_MANY_BUFFERS Constant NetProtocolDisabled. MF_E_NET_PROTOCOL_DISABLED Constant SinkNoStreams. MF_E_SINK_NO_STREAMS Constant ItaUnrecognizedDigitalVideoOutput. MF_E_ITA_UNRECOGNIZED_DIGITAL_VIDEO_OUTPUT Constant UnsupportedRateTransition. MF_E_UNSUPPORTED_RATE_TRANSITION Constant NetInvalidPresentationDescriptor. MF_E_NET_INVALID_PRESENTATION_DESCRIPTOR Constant SinkNoSamplesProcessed. MF_E_SINK_NO_SAMPLES_PROCESSED Constant BufferTooSmall. MF_E_BUFFERTOOSMALL Constant MultipleSubScribers. MF_E_MULTIPLE_SUBSCRIBERS Constant ByteStreamNotSeekable. MF_E_BYTESTREAM_NOT_SEEKABLE Constant FlushNeeded. MF_E_FLUSH_NEEDED Constant TransformNeedMoreInput. MF_E_TRANSFORM_NEED_MORE_INPUT Constant NetRequireInput. MF_E_NET_REQUIRE_INPUT Constant NetSessionNotFound. MF_E_NET_SESSION_NOT_FOUND Constant InvalidRequest. MF_E_INVALIDREQUEST Constant AllOcatorAlreadyCommited. MF_E_ALLOCATOR_ALREADY_COMMITED Constant NetServerAccessDenied. MF_E_NET_SERVER_ACCESSDENIED Constant WmdrmotaInvalidPolicy. MF_E_WMDRMOTA_INVALID_POLICY Constant NoDuration. MF_E_NO_DURATION Constant PropertyVectorRequired. MF_E_PROPERTY_VECTOR_REQUIRED Constant NetConnectionFailure. MF_E_NET_CONNECTION_FAILURE Constant ProcessRestartRequired. MF_E_PROCESS_RESTART_REQUIRED Constant PropertyEmpty. MF_E_PROPERTY_EMPTY Constant NoAudioPlaybackDevice. MF_E_NO_AUDIO_PLAYBACK_DEVICE Constant NoMoreDropModes. MF_E_NO_MORE_DROP_MODES Constant Mp3OufOfData. MF_E_MP3_OUTOFDATA Constant AsfNoindex. MF_E_ASF_NOINDEX Constant VideoRenNoDeinterlaceHw. MF_E_VIDEO_REN_NO_DEINTERLACE_HW Constant TransformStreamChange. MF_E_TRANSFORM_STREAM_CHANGE Constant SampleNotWritable. MF_E_SAMPLE_NOT_WRITABLE Constant InvalidProfile. MF_E_INVALID_PROFILE Constant NetServerUnavailable. MF_E_NET_SERVER_UNAVAILABLE Constant InvalidMediaType. MF_E_INVALIDMEDIATYPE Constant Unexpected. MF_E_UNEXPECTED Constant NetClientClose. MF_E_NET_CLIENT_CLOSE Constant InvalidIndex. MF_E_INVALIDINDEX Constant GrlVersionTooLow. MF_E_GRL_VERSION_TOO_LOW Constant InvalidStreamData. MF_E_INVALID_STREAM_DATA Constant ItaUnrecognizedAnalogVideoProtectionGuid. MF_E_ITA_UNRECOGNIZED_ANALOG_VIDEO_PROTECTION_GUID Constant CaptureSourceNoVideoStreamPresent. MF_E_CAPTURE_SOURCE_NO_VIDEO_STREAM_PRESENT Constant TransformPropertyArrayValueWrongNumDim. MF_E_TRANSFORM_PROPERTY_ARRAY_VALUE_WRONG_NUM_DIM Constant WmdrmotaNoAction. MF_E_WMDRMOTA_NO_ACTION Constant UnsupportedCharacteristics. MF_E_UNSUPPORTED_CHARACTERISTICS Constant TranscodeProfileNoMatchingStreams. MF_E_TRANSCODE_PROFILE_NO_MATCHING_STREAMS Constant HwStreamNotConnected. MF_E_HW_STREAM_NOT_CONNECTED Constant InvalidFormat. MF_E_INVALID_FORMAT Constant ItaErrorParsingSapParameters. MF_E_ITA_ERROR_PARSING_SAP_PARAMETERS Constant TrustDisabled. MF_E_TRUST_DISABLED Constant NetProxyAccessDenied. MF_E_NET_PROXY_ACCESSDENIED Constant InvalidFileFormat. MF_E_INVALID_FILE_FORMAT Constant VideoRenCopyProtFailed. MF_E_VIDEO_REN_COPYPROT_FAILED Constant StreamError. MF_E_STREAM_ERROR Constant NetRead. MF_E_NET_READ Constant AllOcatorNotCommited. MF_E_ALLOCATOR_NOT_COMMITED Constant InsufficientBuffer. MF_E_INSUFFICIENT_BUFFER Constant NetInternalServerError. MF_E_NET_INTERNAL_SERVER_ERROR Constant PeauthSessionNotStarted. MF_E_PEAUTH_SESSION_NOT_STARTED Constant NetTooMuchData. MF_E_NET_TOO_MUCH_DATA Constant UnsupportedTimeFormat. MF_E_UNSUPPORTED_TIME_FORMAT Constant RtWouldblock. MF_E_RT_WOULDBLOCK Constant CaptureSinkRotateError. MF_E_CAPTURE_SINK_ROTATE_ERROR Constant InvalidStateTransition. MF_E_INVALID_STATE_TRANSITION Constant NetBadControlData. MF_E_NET_BAD_CONTROL_DATA Constant NoVideoSampleAvailable. MF_E_NO_VIDEO_SAMPLE_AVAILABLE Constant TransformCannotChangeMediaTypeWhileProcessing. MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING Constant TopoMissingStreamDescriptor. MF_E_TOPO_MISSING_STREAM_DESCRIPTOR Constant UnsupportedRate. MF_E_UNSUPPORTED_RATE Constant TestSignedComponentsNotAllowEd. MF_E_TEST_SIGNED_COMPONENTS_NOT_ALLOWED Constant ContentProtectionSystemNotEnabled. MF_E_CONTENT_PROTECTION_SYSTEM_NOT_ENABLED Constant DxgiDeviceNotInitializeD. MF_E_DXGI_DEVICE_NOT_INITIALIZED Constant DisabledInSafemode. MF_E_DISABLED_IN_SAFEMODE Constant AsfOpaquePacket. MF_E_ASF_OPAQUEPACKET Constant TransformPropertyNotWriteAble. MF_E_TRANSFORM_PROPERTY_NOT_WRITEABLE Constant PropertyNotAllowEd. MF_E_PROPERTY_NOT_ALLOWED Constant CannotCreateSink. MF_E_CANNOT_CREATE_SINK Constant AsfInvalidData. MF_E_ASF_INVALIDDATA Constant RebootRequired. MF_E_REBOOT_REQUIRED Constant WmdrmotaDrmHeaderNotAvailable. MF_E_WMDRMOTA_DRM_HEADER_NOT_AVAILABLE Constant AsfIndexNotLoaded. MF_E_ASF_INDEXNOTLOADED Constant Shutdown. MF_E_SHUTDOWN Constant MediaSourceNotStarted. MF_E_MEDIA_SOURCE_NOT_STARTED Constant ItaUnrecognizedAnalogVideoOutput. MF_E_ITA_UNRECOGNIZED_ANALOG_VIDEO_OUTPUT Constant NoSampleTimestamp. MF_E_NO_SAMPLE_TIMESTAMP Constant LateSample. MF_E_LATE_SAMPLE Constant TransformPropertyPidNotRecognized. MF_E_TRANSFORM_PROPERTY_PID_NOT_RECOGNIZED Constant UnrecoverableErrorOccurred. MF_E_UNRECOVERABLE_ERROR_OCCURRED Constant PropertyTypeNotAllowEd. MF_E_PROPERTY_TYPE_NOT_ALLOWED Constant UnsupportedCaption. MF_E_UNSUPPORTED_CAPTION Constant AudioServiceNotRunning. MF_E_AUDIO_SERVICE_NOT_RUNNING Constant WmdrmotaActionMismatch. MF_E_WMDRMOTA_ACTION_MISMATCH Constant PropertyTypeNotSupported. MF_E_PROPERTY_TYPE_NOT_SUPPORTED Constant RtWorkqueueClassNotSpecified. MF_E_RT_WORKQUEUE_CLASS_NOT_SPECIFIED Constant PeUntrusted. MF_E_PE_UNTRUSTED Constant GrlAbsent. MF_E_GRL_ABSENT Constant ClockStateAlreadySet. MF_E_CLOCK_STATE_ALREADY_SET Constant InvalidStreamNumber. MF_E_INVALIDSTREAMNUMBER Constant SampleallocatorEmpty. MF_E_SAMPLEALLOCATOR_EMPTY Constant AudioPlaybackDeviceInUse. MF_E_AUDIO_PLAYBACK_DEVICE_IN_USE Constant SampleallocatorCanceled. MF_E_SAMPLEALLOCATOR_CANCELED Constant TopoStreamDescriptorNotSelected. MF_E_TOPO_STREAM_DESCRIPTOR_NOT_SELECTED Constant NetIncompatibleServer. MF_E_NET_INCOMPATIBLE_SERVER Constant TransformProfileTruncated. MF_E_TRANSFORM_PROFILE_TRUNCATED Constant EndOfStream. MF_E_END_OF_STREAM Constant TimerOrphaned. MF_E_TIMER_ORPHANED Constant NetCachestreamNotFound. MF_E_NET_CACHESTREAM_NOT_FOUND Constant TransformNotPossibleForCurrentSpkrConfig. MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_SPKR_CONFIG Constant LicenseRequired. MF_E_LICENSE_REQUIRED Constant UnsupportedRepresentation. MF_E_UNSUPPORTED_REPRESENTATION Constant Mp3NotSupported. MF_E_MP3_NOTSUPPORTED Constant AlreadyInitializeD. MF_E_ALREADY_INITIALIZED Constant InvalidStreamState. MF_E_INVALID_STREAM_STATE Constant OperationCancelled. MF_E_OPERATION_CANCELLED Constant CaptureSourceNoIndependentPhotoStreamPresent. MF_E_CAPTURE_SOURCE_NO_INDEPENDENT_PHOTO_STREAM_PRESENT Constant Mp3BadCrc. MF_E_MP3_BAD_CRC Constant UnsupportedService. MF_E_UNSUPPORTED_SERVICE Constant AudioPlaybackDeviceInvalidated. MF_E_AUDIO_PLAYBACK_DEVICE_INVALIDATED Constant DxgiVideoDeviceLocked. MF_E_DXGI_VIDEO_DEVICE_LOCKED Constant NetworkResourceFailure. MF_E_NETWORK_RESOURCE_FAILURE Constant Mp3NotMp3. MF_E_MP3_NOTMP3 Constant StreamsInkExists. MF_E_STREAMSINK_EXISTS Constant NetUdpBlocked. MF_E_NET_UDP_BLOCKED Constant MediaSourceNoStreamsSelected. MF_E_MEDIA_SOURCE_NO_STREAMS_SELECTED Constant NetInvalidPushPublishingPoint. MF_E_NET_INVALID_PUSH_PUBLISHING_POINT Constant CaptureSinkOutputNotSet. MF_E_CAPTURE_SINK_OUTPUT_NOT_SET Constant VideoRenNoProcampHw. MF_E_VIDEO_REN_NO_PROCAMP_HW Constant TransformTypeNotSet. MF_E_TRANSFORM_TYPE_NOT_SET Constant TopoSinkActivatesUnsupported. MF_E_TOPO_SINK_ACTIVATES_UNSUPPORTED Constant ClockInvalidContinuityKey. MF_E_CLOCK_INVALID_CONTINUITY_KEY Constant NoIndex. MF_E_NO_INDEX Constant InvalidType. MF_E_INVALIDTYPE Constant InvalidWorkqueue. MF_E_INVALID_WORKQUEUE Constant InvalidKey. MF_E_INVALID_KEY Constant NetCacheNoData. MF_E_NET_CACHE_NO_DATA Constant NoClock. MF_E_NO_CLOCK Constant NotInitializeD. MF_E_NOT_INITIALIZED Constant UnsupportedStateTransition. MF_E_UNSUPPORTED_STATE_TRANSITION Constant TransformInputRemaining. MF_E_TRANSFORM_INPUT_REMAINING Constant NetProxyTimeout. MF_E_NET_PROXY_TIMEOUT Constant TransformCannotInitializeAcmDriver. MF_E_TRANSFORM_CANNOT_INITIALIZE_ACM_DRIVER Constant BadOperationLStructureFormat. MF_E_BAD_OPL_STRUCTURE_FORMAT Constant HwMftFailedStartStreaming. MF_E_HW_MFT_FAILED_START_STREAMING Constant PropertyNotFound. MF_E_PROPERTY_NOT_FOUND Constant TopoMissingSource. MF_E_TOPO_MISSING_SOURCE Constant GrlInvalidFormat. MF_E_GRL_INVALID_FORMAT Constant OperationInProgress. MF_E_OPERATION_IN_PROGRESS Constant AsfFilesinkBitRateUnknown. MF_E_ASF_FILESINK_BITRATE_UNKNOWN Constant NotAvailable. MF_E_NOT_AVAILABLE Constant NotAccepting. MF_E_NOTACCEPTING Constant NetRedirect. MF_E_NET_REDIRECT Constant NetUnsupportedConfiguration. MF_E_NET_UNSUPPORTED_CONFIGURATION Constant NetEol. MF_E_NET_EOL Constant InvalidPosition. MF_E_INVALID_POSITION Constant StreamsInksFixed. MF_E_STREAMSINKS_FIXED Constant InvalidAsfStreamId. MF_E_INVALID_ASF_STREAMID Constant NoContentProtectionManager. MF_E_NO_CONTENT_PROTECTION_MANAGER Constant UnsupportedFormat. MF_E_UNSUPPORTED_FORMAT Constant NotFound. MF_E_NOT_FOUND Constant VideoRecordingDevicePreempted. MF_E_VIDEO_RECORDING_DEVICE_PREEMPTED Constant CannotParseByteStream. MF_E_CANNOT_PARSE_BYTESTREAM Constant NetNoconnection. MF_E_NET_NOCONNECTION Constant ClockNoTimeSource. MF_E_CLOCK_NO_TIME_SOURCE Constant DebuggingNotAllowEd. MF_E_DEBUGGING_NOT_ALLOWED Constant SourceResolverMutuallyExclusiveFlags. MF_E_SOURCERESOLVER_MUTUALLY_EXCLUSIVE_FLAGS Constant RateChangePreempted. MF_E_RATE_CHANGE_PREEMPTED Constant NoBitpump. MF_E_NO_BITPUMP Constant AllOcatorNotInitializeD. MF_E_ALLOCATOR_NOT_INITIALIZED Constant LicenseOufOfDate. MF_E_LICENSE_OUTOFDATE Constant TransformProfileMissing. MF_E_TRANSFORM_PROFILE_MISSING Constant TransformNotPossibleForCurrentMediaTypeCombination. MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_MEDIATYPE_COMBINATION Constant ByteStreamUnknownLength. MF_E_BYTESTREAM_UNKNOWN_LENGTH Constant Unauthorized. MF_E_UNAUTHORIZED Constant UnsupportedD3DType. MF_E_UNSUPPORTED_D3D_TYPE Constant TopologyVerificationFailed. MF_E_TOPOLOGY_VERIFICATION_FAILED Constant NoPmpHost. MF_E_NO_PMP_HOST Constant CaptureEngineAllEffectsRemoved. MF_E_CAPTURE_ENGINE_ALL_EFFECTS_REMOVED Constant KernelUntrusted. MF_E_KERNEL_UNTRUSTED Constant UnsupportedContentProtectionSystem. MF_E_UNSUPPORTED_CONTENT_PROTECTION_SYSTEM Constant NetIncompatiblePushserver. MF_E_NET_INCOMPATIBLE_PUSHSERVER Constant TranscodeNoMatchingEncoder. MF_E_TRANSCODE_NO_MATCHING_ENCODER Constant TranscodeInvalidProfile. MF_E_TRANSCODE_INVALID_PROFILE Constant CapturePropertySetDuringPhoto. MF_E_CAPTURE_PROPERTY_SET_DURING_PHOTO Constant AudioRecordingDeviceInUse. MF_E_AUDIO_RECORDING_DEVICE_IN_USE Constant NetSessionInvalid. MF_E_NET_SESSION_INVALID Constant CodeExpired. MF_E_CODE_EXPIRED Constant ReverseUnsupported. MF_E_REVERSE_UNSUPPORTED Constant TransformPropertyVariantTypeWrong. MF_E_TRANSFORM_PROPERTY_VARIANT_TYPE_WRONG Constant ThinningUnsupported. MF_E_THINNING_UNSUPPORTED Constant NetBwlevelNotSupported. MF_E_NET_BWLEVEL_NOT_SUPPORTED Constant CaptureSinkMirrorError. MF_E_CAPTURE_SINK_MIRROR_ERROR Constant BandwidthOverrun. MF_E_BANDWIDTH_OVERRUN Constant NetBusy. MF_E_NET_BUSY Constant ItaUnsupportedAction. MF_E_ITA_UNSUPPORTED_ACTION Constant AllProcessRestartRequired. MF_E_ALL_PROCESS_RESTART_REQUIRED Constant InvalidCodecMerit. MF_E_INVALID_CODEC_MERIT Constant InvalidName. MF_E_INVALIDNAME Constant QualityknobWaitLonger. MF_E_QUALITYKNOB_WAIT_LONGER Constant CannotFindKeyframeSample. MF_E_CANNOT_FIND_KEYFRAME_SAMPLE Constant DxgiNewVideoDevice. MF_E_DXGI_NEW_VIDEO_DEVICE Constant TransformProfileInvalidOrCorrupt. MF_E_TRANSFORM_PROFILE_INVALID_OR_CORRUPT Constant InvalidAkeChannelParameters. MF_E_INVALID_AKE_CHANNEL_PARAMETERS Constant PeauthUntrusted. MF_E_PEAUTH_UNTRUSTED Constant TopoMissingPresentationDescriptor. MF_E_TOPO_MISSING_PRESENTATION_DESCRIPTOR Constant UsermodeUntrusted. MF_E_USERMODE_UNTRUSTED Constant NetRequireNetwork. MF_E_NET_REQUIRE_NETWORK Constant UnsupportedScheme. MF_E_UNSUPPORTED_SCHEME Constant NoMoreTypes. MF_E_NO_MORE_TYPES Constant NetTimeout. MF_E_NET_TIMEOUT Constant CannotIndexInPlace. MF_E_CANNOT_INDEX_IN_PLACE Constant NoCaptureDevicesAvailable. MF_E_NO_CAPTURE_DEVICES_AVAILABLE Constant PolicyUnsupported. MF_E_POLICY_UNSUPPORTED Constant PeSessionsMaximumEd. MF_E_PE_SESSIONS_MAXED Constant IndexNotCommitted. MF_E_INDEX_NOT_COMMITTED Constant MetadataTooLong. MF_E_METADATA_TOO_LONG Constant FormatChangeNotSupported. MF_E_FORMAT_CHANGE_NOT_SUPPORTED Constant SinkAlreadystopped. MF_E_SINK_ALREADYSTOPPED Constant TopoCannotConnect. MF_E_TOPO_CANNOT_CONNECT Constant PropertyVectorNotAllowEd. MF_E_PROPERTY_VECTOR_NOT_ALLOWED Constant TransformAsyncLocked. MF_E_TRANSFORM_ASYNC_LOCKED Constant DroptimeNotSupported. MF_E_DROPTIME_NOT_SUPPORTED Constant NetUnsafeUrl. MF_E_NET_UNSAFE_URL Constant RtOufOfMemory. MF_E_RT_OUTOFMEMORY Constant OperationLNotSupported. MF_E_OPL_NOT_SUPPORTED Constant TransformConflictsWithOtherCurrentlyEnabledFeatures. MF_E_TRANSFORM_CONFLICTS_WITH_OTHER_CURRENTLY_ENABLED_FEATURES Constant ClockNotSimple. MF_E_CLOCK_NOT_SIMPLE Constant QmInvalidState. MF_E_QM_INVALIDSTATE Constant TopoCodecNotFound. MF_E_TOPO_CODEC_NOT_FOUND Constant DrmHardwareInconsistent. MF_E_DRM_HARDWARE_INCONSISTENT Constant TopoLoopsInTopology. MF_E_TOPO_LOOPS_IN_TOPOLOGY Constant VideoRenSurfaceNotShared. MF_E_VIDEO_REN_SURFACE_NOT_SHARED Constant AsfOufOfRange. MF_E_ASF_OUTOFRANGE Constant TopoCannotFindDecrementYptor. MF_E_TOPO_CANNOT_FIND_DECRYPTOR Constant AsfUnsupportedStreamType. MF_E_ASF_UNSUPPORTED_STREAM_TYPE Constant NetRedirectToProxy. MF_E_NET_REDIRECT_TO_PROXY Constant WmdrmotaDrmEncryptionSchemeNotSupported. MF_E_WMDRMOTA_DRM_ENCRYPTION_SCHEME_NOT_SUPPORTED Constant GrlRenewalNotFound. MF_E_GRL_RENEWAL_NOT_FOUND Constant LicenseIncorrectRights. MF_E_LICENSE_INCORRECT_RIGHTS Constant MissingAsfLeakybucket. MF_E_MISSING_ASF_LEAKYBUCKET Constant PropertyReadOnly. MF_E_PROPERTY_READ_ONLY Constant SessionPausewhilestopped. MF_E_SESSION_PAUSEWHILESTOPPED Constant TransformPropertyValueOutOfRange. MF_E_TRANSFORM_PROPERTY_VALUE_OUT_OF_RANGE Constant NoMoreQualityLevels. MF_E_NO_MORE_QUALITY_LEVELS Constant PropertyNotEmpty. MF_E_PROPERTY_NOT_EMPTY Constant NoEventsAvailable. MF_E_NO_EVENTS_AVAILABLE Constant NetCannotconnect. MF_E_NET_CANNOTCONNECT Constant PlatformNotInitializeD. MF_E_PLATFORM_NOT_INITIALIZED Constant AsfTooManyPayloads. MF_E_ASF_TOO_MANY_PAYLOADS Constant IncompatibleSampleProtection. MF_E_INCOMPATIBLE_SAMPLE_PROTECTION Constant HwAcceleratedThumbnailNotSupported. MF_E_HW_ACCELERATED_THUMBNAIL_NOT_SUPPORTED Functions Constant Video3D. MFSampleExtension_3DVideo Constant Video3DSampleFormat. MFSampleExtension_3DVideo_SampleFormat Constant BottomFieldFirst. MFSampleExtension_BottomFieldFirst Constant CleanPoint. MFSampleExtension_CleanPoint Constant DecodeTimestamp. MFSampleExtension_DecodeTimestamp Constant DerivedFromTopField. MFSampleExtension_DerivedFromTopField Constant Discontinuity. MFSampleExtension_Discontinuity Constant FrameCorruption. MFSampleExtension_FrameCorruption Constant Interlaced. MFSampleExtension_Interlaced Constant PacketCrossOffsets. MFSampleExtension_PacketCrossOffsets Constant RepeatFirstField. MFSampleExtension_RepeatFirstField Constant SingleField. MFSampleExtension_SingleField Constant Token. MFSampleExtension_Token Constant VideoEncodePictureType. MFSampleExtension_VideoEncodePictureType Constant VideoEncodeQP. MFSampleExtension_VideoEncodeQP Constant DescrambleData. MFSampleExtension_DescrambleData Constant SampleKeyID. MFSampleExtension_SampleKeyID Constant GenKeyFunc. MFSampleExtension_GenKeyFunc Constant GenKeyCtx. MFSampleExtension_GenKeyCtx Functions Functions Constant LowLatency. MF_LOW_LATENCY Constant ReadwriteD3DOptional. MF_READWRITE_D3D_OPTIONAL Constant ReadwriteDisableConverters. MF_READWRITE_DISABLE_CONVERTERS Constant ReadwriteEnableHardwareTransforms. MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS Constant ReadwriteMmcssClass. MF_READWRITE_MMCSS_CLASS Constant ReadwriteMmcssClassAudio. MF_READWRITE_MMCSS_CLASS_AUDIO Constant ReadwriteMmcssPriority. MF_READWRITE_MMCSS_PRIORITY Constant ReadwriteMmcssPriorityAudio. MF_READWRITE_MMCSS_PRIORITY_AUDIO Constant AsyncCallback. MF_SINK_WRITER_ASYNC_CALLBACK Constant D3DManager. MF_SINK_WRITER_D3D_MANAGER Constant DisableThrottling. MF_SINK_WRITER_DISABLE_THROTTLING Constant EncoderConfig. MF_SINK_WRITER_ENCODER_CONFIG Functions Constant AsyncCallback. MF_SOURCE_READER_ASYNC_CALLBACK Constant D3DManager. MF_SOURCE_READER_D3D_MANAGER Constant DisableCameraPlugins. MF_SOURCE_READER_DISABLE_CAMERA_PLUGINS Constant DisableDxva. MF_SOURCE_READER_DISABLE_DXVA Constant DisconnectMediasourceOnShutdown. MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN Constant EnableAdvancedVideoProcessing. MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING Constant EnableTranscodeOnlyTransforms. MF_SOURCE_READER_ENABLE_TRANSCODE_ONLY_TRANSFORMS Constant EnableVideoProcessing. MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING Constant MediaSourceCharacteristics. MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS Constant MediaSourceConfig. MF_SOURCE_READER_MEDIASOURCE_CONFIG Functions Constant Language. MF_SD_LANGUAGE Constant MutuallyExclusive. MF_SD_MUTUALLY_EXCLUSIVE Constant Protected. MF_SD_PROTECTED Constant StreamName. MF_SD_STREAM_NAME Functions Constant DXVAMode. MF_TOPOLOGY_DXVA_MODE Constant NoMarkinMarkout. MF_TOPOLOGY_NO_MARKIN_MARKOUT Constant PlaybackMaxDimensions. MF_TOPOLOGY_PLAYBACK_MAX_DIMS Constant ProjectStart. MF_TOPOLOGY_PROJECTSTART Constant ProjectStop. MF_TOPOLOGY_PROJECTSTOP Constant StaticPlaybackOptimizations. MF_TOPOLOGY_STATIC_PLAYBACK_OPTIMIZATIONS Functions Functions Functions Constant DisableLocallyRegisteredPlugins. MF_DISABLE_LOCALLY_REGISTERED_PLUGINS Constant Enable3dvideoOutput. MF_ENABLE_3DVIDEO_OUTPUT Constant BuffersPerSample. MF_SA_BUFFERS_PER_SAMPLE Constant D3DAware. MF_SA_D3D_AWARE Constant D3D11Aware. MF_SA_D3D11_AWARE Constant D3D11Bindflags. MF_SA_D3D11_BINDFLAGS Constant D3D11Usage. MF_SA_D3D11_USAGE 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 MftDecoderExposeOutputTypesInNativeOrder. MFT_DECODER_EXPOSE_OUTPUT_TYPES_IN_NATIVE_ORDER Constant MftDecoderFinalVideoResolutionHint. MFT_DECODER_FINAL_VIDEO_RESOLUTION_HINT Constant MftEnumHardwareUrlAttribute. MFT_ENUM_HARDWARE_URL_Attribute Constant MftEnumHardwareVendorIdAttribute. MFT_ENUM_HARDWARE_VENDOR_ID_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 MftSupport3dvideo. MFT_SUPPORT_3DVIDEO Constant MftSupportDynamicFormatChange. MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE Constant MftTransformClsidAttribute. MFT_TRANSFORM_CLSID_Attribute Functions Constant Multiplexer. MFT_CATEGORY_MULTIPLEXER Constant Demultiplexer. MFT_CATEGORY_DEMULTIPLEXER Constant AudioEffect. MFT_CATEGORY_AUDIO_EFFECT Constant VideoDecoder. MFT_CATEGORY_VIDEO_DECODER Constant AudioDecoder. MFT_CATEGORY_AUDIO_DECODER Constant VideoProcessor. MFT_CATEGORY_VIDEO_PROCESSOR Constant Other. MFT_CATEGORY_OTHER Constant VideoEffect. MFT_CATEGORY_VIDEO_EFFECT Constant VideoEncoder. MFT_CATEGORY_VIDEO_ENCODER Constant AudioEncoder. MFT_CATEGORY_AUDIO_ENCODER Functions Constant Wmv1. MFVideoFormat_WMV1 Constant Wmv3. MFVideoFormat_WMV3 Constant I420. MFVideoFormat_I420 Constant Dvc. MFVideoFormat_DVC Constant Iyuv. MFVideoFormat_IYUV Constant Mp43. MFVideoFormat_MP43 Constant Mp4s. MFVideoFormat_MP4S Constant Mpg1. MFVideoFormat_MPG1 Constant Wmv2. MFVideoFormat_WMV2 Constant Rgb555. MFVideoFormat_RGB555 Constant MultisampledS2. MFVideoFormat_MSS2 Constant M4S2. MFVideoFormat_M4S2 Constant Dv25. MFVideoFormat_DV25 Constant Yvu9. MFVideoFormat_YVU9 Constant MultisampledS1. MFVideoFormat_MSS1 Constant Wvc1. MFVideoFormat_WVC1 Constant Hevc. MFVideoFormat_HEVC Constant Rgb8. MFVideoFormat_RGB8 Constant Rgb24. MFVideoFormat_RGB24 Constant Y41P. MFVideoFormat_Y41P Constant Dv50. MFVideoFormat_DV50 Constant Base. MFVideoFormat_Base Constant P010. MFVideoFormat_P010 Constant Mp4v. MFVideoFormat_MP4V Constant H264Es. MFVideoFormat_H264_ES Constant AI44. MFVideoFormat_AI44 Constant NV11. MFVideoFormat_NV11 Constant NV12. MFVideoFormat_NV12 Constant H263. MFVideoFormat_H263 Constant H264. MFVideoFormat_H264 Constant Yvyu. MFVideoFormat_YVYU Constant Y210. MFVideoFormat_Y210 Constant YUY2. MFVideoFormat_YUY2 Constant Rgb32. MFVideoFormat_RGB32 Constant Dvh1. MFVideoFormat_DVH1 Constant Dvhd. MFVideoFormat_DVHD 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 HevcEs. MFVideoFormat_HEVC_ES Constant Dvsl. MFVideoFormat_DVSL Constant Rgb565. MFVideoFormat_RGB565 Constant Mpeg2. MFVideoFormat_MPEG2 Constant Yv12. MFVideoFormat_YV12 Constant P016. MFVideoFormat_P016 Constant AYUV. MFVideoFormat_AYUV Constant Mjpg. MFVideoFormat_MJPG Constant Dvsd. MFVideoFormat_DVSD Constant Argb32. MFVideoFormat_ARGB32 Constant P210. MFVideoFormat_P210 Constant P216. MFVideoFormat_P216 Constant Y420O. MFVideoFormat_420O

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.

D3DERR_INVALIDCALL

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, Buffer] unsigned char** ppbScanline0,[Out] 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)

Copies the buffer to another 2D buffer object.

The destination buffer must be at least as large as the source buffer.

hh447828 IMF2DBuffer2 IMF2DBuffer2
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.

A member of the enumeration that specifies whether to lock the buffer for reading, writing, or both.

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.

Receives a reference to the start of the accessible buffer in memory.

Receives the length of the buffer, in bytes.

This method can return one of these values.

Return codeDescription

Success.

Invalid request. The buffer might already be locked with an incompatible locking flag. See Remarks.

E_OUTOFMEMORY

There is insufficient memory to complete the operation.

?

When you are done accessing the memory, call to unlock the buffer. You must call Unlock2D once for each call to Lock2DSize.

This method is equivalent to the method. However, Lock2DSize is preferred because it enables the caller to validate memory references, and because it supports read-only locks. A buffer is not guaranteed to support the interface. To access a buffer, you should try the following methods in the order listed:

The ppbBufferStart and pcbBufferLength parameters receive the bounds of the buffer memory. Use these values to guard against buffer overruns. Use the values of ppbScanline0 and plPitch to access the image data. If the image is bottom-up in memory, ppbScanline0 will point to the last scan line in memory and plPitch will be negative. For more information, see Image Stride.

The lockFlags parameter specifies whether the buffer is locked for read-only access, write-only access, or read/write access.

  • If the buffer is already locked for read-only access, it cannot be locked for write access.
  • If the buffer is already locked for write-only access, it cannot be locked for read access.
  • If the buffer is already locked for read/write acess, it can be locked for read or write acess.

When possible, use a read-only or write-only lock, and avoid locking the buffer for read/write access. If the buffer represents a DirectX Graphics Infrastructure (DXGI) surface, a read/write lock can cause an extra copy between CPU memory and GPU memory.

hh447829 HRESULT IMF2DBuffer2::Lock2DSize([In] MF2DBuffer_LockFlags lockFlags,[Out, Buffer] unsigned char** ppbScanline0,[Out] int* plPitch,[Out, Buffer] unsigned char** ppbBufferStart,[Out] unsigned int* pcbBufferLength) IMF2DBuffer2::Lock2DSize

Copies the buffer to another 2D buffer object.

A reference to the interface of the destination buffer.

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

The destination buffer must be at least as large as the source buffer.

hh447828 HRESULT IMF2DBuffer2::Copy2DTo([In] IMF2DBuffer2* pDestBuffer) IMF2DBuffer2::Copy2DTo

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

Controls how a network byte stream transfers data to a local cache. This interface extends the interface.

Byte streams object in Microsoft Media Foundation can optionally implement this inteface. To get a reference to this interface, call QueryInterface on the byte stream object.

hh447830 IMFByteStreamCacheControl2 IMFByteStreamCacheControl2
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 ranges of bytes that are currently stored in the cache.

Receives the number of ranges returned in the ppRanges array.

Receives an array of structures. Each structure specifies a range of bytes stored in the cache. The caller must free the array by calling CoTaskMemFree.

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

hh447831 HRESULT IMFByteStreamCacheControl2::GetByteRanges([Out] unsigned int* pcRanges,[Out, Buffer, Optional] MF_BYTE_STREAM_CACHE_RANGE** ppRanges) IMFByteStreamCacheControl2::GetByteRanges

Limits the cache size.

The maximum number of bytes to store in the cache, or ULONGLONG_MAX for no limit. The default value is no limit.

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

hh447833 HRESULT IMFByteStreamCacheControl2::SetCacheLimit([In] unsigned longlong qwBytes) IMFByteStreamCacheControl2::SetCacheLimit

Queries whether background transfer is active.

Receives the value TRUE if background transfer is currently active, or otherwise.

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

Background transfer might stop because the cache limit was reached (see ) or because the method was called.

hh447832 HRESULT IMFByteStreamCacheControl2::IsBackgroundTransferActive([Out] BOOL* pfActive) IMFByteStreamCacheControl2::IsBackgroundTransferActive

Limits the cache size.

hh447833 SetCacheLimit SetCacheLimit HRESULT IMFByteStreamCacheControl2::SetCacheLimit([In] unsigned longlong qwBytes)

Queries whether background transfer is active.

Background transfer might stop because the cache limit was reached (see ) or because the method was called.

hh447832 IsBackgroundTransferActive IsBackgroundTransferActive HRESULT IMFByteStreamCacheControl2::IsBackgroundTransferActive([Out] BOOL* pfActive)

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)

Seeks a byte stream by time position.

A byte stream can implement this interface if it supports time-based seeking. For example, a byte stream that reads data from a server might implement the interface. Typically, a local file-based byte stream would not implement it.

To get a reference to this interface, call QueryInterface on the byte stream object.

hh447836 IMFByteStreamTimeSeek IMFByteStreamTimeSeek
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 byte stream supports time-based seeking.

Receives the value TRUE if the byte stream supports time-based seeking, or otherwise.

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

hh447838 HRESULT IMFByteStreamTimeSeek::IsTimeSeekSupported([Out] BOOL* pfTimeSeekIsSupported) IMFByteStreamTimeSeek::IsTimeSeekSupported

Seeks to a new position in the byte stream.

The new position, in 100-nanosecond units.

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

If the byte stream reads from a server, it might cache the seek request until the next read request. Therefore, the byte stream might not send a request to the server immediately.

hh447839 HRESULT IMFByteStreamTimeSeek::TimeSeek([In] unsigned longlong qwTimePosition) IMFByteStreamTimeSeek::TimeSeek

Gets the result of a time-based seek.

Receives the new position after the seek, in 100-nanosecond units.

Receives the stop time, in 100-nanosecond units. If the stop time is unknown, the value is zero.

Receives the total duration of the file, in 100-nanosecond units. If the duration is unknown, the value is ?1.

This method can return one of these values.

Return codeDescription

The method succeeded.

The byte stream does not support time-based seeking, or no data is available.

?

This method returns the server response from a previous time-based seek.

Note??This method normally cannot be invoked until some data is read from the byte stream, because the method does not send a server request immediately.

hh447837 HRESULT IMFByteStreamTimeSeek::GetTimeSeekResult([Out] unsigned longlong* pqwStartTime,[Out] unsigned longlong* pqwStopTime,[Out] unsigned longlong* pqwDuration) IMFByteStreamTimeSeek::GetTimeSeekResult

Queries whether the byte stream supports time-based seeking.

hh447838 IsTimeSeekSupported IsTimeSeekSupported HRESULT IMFByteStreamTimeSeek::IsTimeSeekSupported([Out] BOOL* pfTimeSeekIsSupported)

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)

Represents a buffer that contains a Microsoft DirectX Graphics Infrastructure (DXGI) surface.

To create a DXGI media buffer, first create the DXGI surface. Then call .

hh447901 IMFDXGIBuffer IMFDXGIBuffer
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 Microsoft DirectX Graphics Infrastructure (DXGI) surface for an interface.

The interface identifer (IID) of the interface being requested.

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

This method can return one of these values.

Return codeDescription

Success.

E_NOINTERFACE

The object does not support the specified interface.

Invalid request.

?

You can use this method to get a reference to the interface of the surface. If the buffer is locked, the method returns .

hh447902 HRESULT IMFDXGIBuffer::GetResource([In] const GUID& riid,[Out] void** ppvObject) IMFDXGIBuffer::GetResource

Gets the index of the subresource that is associated with this media buffer.

Receives the zero-based index of the subresource.

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

The subresource index is specified when you create the media buffer object. See .

For more information about texture subresources, see .

hh447903 HRESULT IMFDXGIBuffer::GetSubresourceIndex([Out] unsigned int* puSubresource) IMFDXGIBuffer::GetSubresourceIndex

Gets an reference that was previously stored in the media buffer object.

No documentation. No documentation. No documentation.

This method can return one of these values.

Return codeDescription

Success.

E_NOINTERFACE

The object does not support the specified interface.

The specified key was not found.

?

hh447904 HRESULT IMFDXGIBuffer::GetUnknown([In] const GUID& guid,[In] const GUID& riid,[Out] void** ppvObject) IMFDXGIBuffer::GetUnknown

Stores an arbitrary reference in the media buffer object.

No documentation. No documentation.

This method can return one of these values.

Return codeDescription

Success.

An item already exists with this key.

?

To retrieve the reference from the object, call .

hh447905 HRESULT IMFDXGIBuffer::SetUnknown([In] const GUID& guid,[In, Optional] IUnknown* pUnkData) IMFDXGIBuffer::SetUnknown

Gets the index of the subresource that is associated with this media buffer.

The subresource index is specified when you create the media buffer object. See .

For more information about texture subresources, see .

hh447903 GetSubresourceIndex GetSubresourceIndex HRESULT IMFDXGIBuffer::GetSubresourceIndex([Out] unsigned int* puSubresource)

Provides functionality for getting the from the Microsoft Media Foundation video rendering sink.

dn280687 IMFDXGIDeviceManagerSource IMFDXGIDeviceManagerSource
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 from the Microsoft Media Foundation video rendering sink.

No documentation.

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

dn280688 HRESULT IMFDXGIDeviceManagerSource::GetManager([Out] IMFDXGIDeviceManager** ppManager) IMFDXGIDeviceManagerSource::GetManager

Gets the from the Microsoft Media Foundation video rendering sink.

dn280688 GetManager GetManager HRESULT IMFDXGIDeviceManagerSource::GetManager([Out] IMFDXGIDeviceManager** ppManager)

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 IMFContentEnabler 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 IMFContentEnabler methods to perform whatever actions are needed, such as individualization or obtaining a license. The content enabler object must encapsulate this functionality through the IMFContentEnabler 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

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.
MFCreateDXSurfaceBuffer 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.

D3DERR_INVALIDCALL

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)

Enables an application to load media resources in the Media Engine.

To use this interface, set the attribute when you call the method.

hh447924 IMFMediaEngineExtension IMFMediaEngineExtension
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 can load a specified type of media resource.

If TRUE, the Media Engine is set to audio-only mode. Otherwise, the Media Engine is set to audio-video mode.

A string that contains a MIME type with an optional codecs parameter, as defined in RFC 4281.

Receives a member of the enumeration.

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

Implement this method if your Media Engine extension supports one or more MIME types.

hh447927 HRESULT IMFMediaEngineExtension::CanPlayType([In] BOOL AudioOnly,[In] wchar_t* MimeType,[Out] MF_MEDIA_ENGINE_CANPLAY* pAnswer) IMFMediaEngineExtension::CanPlayType

Begins an asynchronous request to create either a byte stream or a media source.

The URL of the media resource.

A reference to the interface.

If the type parameter equals , this parameter is null.

If type equals , this parameter either contains a reference to a byte stream or is null. See Remarks for more information.

A member of the enumeration that specifies which type of object to create.

ValueMeaning

Create a byte stream. The byte stream must support the interface.

Create a media source. The media source must support the interface.

?

Receives a reference to the interface. This reference can be used to cancel the asynchronous operation, by passing the reference to the method.

The caller must release the interface. This parameter can be null.

A reference to the interface. This interface is used to signal the completion of the asynchronous operation.

A reference to the interface of an object impemented by the caller. You can use this object to hold state information for the callback. The object is returned to the caller when the callback is invoked. This parameter can be null.

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

This method requests the object to create either a byte stream or a media source, depending on the value of the type parameter:

  • If type is , the method creates a byte stream for the URL that is specified in bstrURL. In this case, the pByteStream parameter is null.
  • If type is , the method creates a media source, using the byte stream that is specified in the pByteStream parameter. Note that pByteStream can also be null in this case.

The method is performed asynchronously. The Media Engine calls the method to complete the operation.

hh447925 HRESULT IMFMediaEngineExtension::BeginCreateObject([In] wchar_t* bstrURL,[In, Optional] IMFByteStream* pByteStream,[In] MF_OBJECT_TYPE type,[Out] IUnknown** ppIUnknownCancelCookie,[In] IMFAsyncCallback* pCallback,[In, Optional] IUnknown* punkState) IMFMediaEngineExtension::BeginCreateObject

Cancels the current request to create an object.

The reference that was returned in the the ppIUnknownCancelCookie parameter of the method.

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

This method attempts to cancel a previous call to BeginCreateObject. Because that method is asynchronous, however, it might complete before the operation can be canceled.

hh447926 HRESULT IMFMediaEngineExtension::CancelObjectCreation([In] IUnknown* pIUnknownCancelCookie) IMFMediaEngineExtension::CancelObjectCreation

Completes an asynchronous request to create a byte stream or media source.

A reference to the interface.

Receives a reference to the interface of the byte stream or media source. The caller must release the interface

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

The Media Engine calls this method to complete the method.

hh447928 HRESULT IMFMediaEngineExtension::EndCreateObject([In] IMFAsyncResult* pResult,[Out] IUnknown** ppObject) IMFMediaEngineExtension::EndCreateObject

Sets the application's certificate.

Call this method to access protected video content in frame-server mode.

hh447966 IMFMediaEngineProtectedContent IMFMediaEngineProtectedContent
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.

Enables the Media Engine to access protected content while in frame-server mode.

A reference to the Direct3D?11 device content. The Media Engine queries this reference for the interface.

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

In frame-server mode, this method enables the Media Engine to share protected content with the Direct3D?11 device.

hh447969 HRESULT IMFMediaEngineProtectedContent::ShareResources([In] IUnknown* pUnkDeviceContext) IMFMediaEngineProtectedContent::ShareResources

Gets the content protections that must be applied in frame-server mode.

Receives a bitwise OR of zero or more flags from the enumeration.

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

hh447965 HRESULT IMFMediaEngineProtectedContent::GetRequiredProtections([Out] unsigned int* pFrameProtectionFlags) IMFMediaEngineProtectedContent::GetRequiredProtections

Specifies the window that should receive output link protections.

A handle to the window.

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

In frame-server mode, call this method to specify the destination window for protected video content. The Media Engine uses this window to set link protections, using the Output Protection Manager (OPM).

hh447968 HRESULT IMFMediaEngineProtectedContent::SetOPMWindow([In] HWND hwnd) IMFMediaEngineProtectedContent::SetOPMWindow

Copies a protected video frame to a DXGI surface.

A reference to the interface of the destination surface.

A reference to an structure that specifies the source rectangle.

A reference to a structure that specifies the destination rectangle.

A reference to an structure that specifies the border color.

Receives a bitwise OR of zero or more flags from the enumeration. These flags indicate which content protections the application must apply before presenting the surface.

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

For protected content, call this method instead of the method.

hh447970 HRESULT IMFMediaEngineProtectedContent::TransferVideoFrame([In] IUnknown* pDstSurf,[In, Optional] const MFVideoNormalizedRect* pSrc,[In] const RECT* pDst,[In, Optional] const MFARGB* pBorderClr,[Out] unsigned int* pFrameProtectionFlags) IMFMediaEngineProtectedContent::TransferVideoFrame

Sets the content protection manager (CPM).

A reference to the IMFContentProtectionManager interface, implemented by the caller.

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

The Media Engine uses the CPM to handle events related to protected content, such as license acquisition.

hh447967 HRESULT IMFMediaEngineProtectedContent::SetContentProtectionManager([In, Optional] void* pCPM) IMFMediaEngineProtectedContent::SetContentProtectionManager

Sets the application's certificate.

A reference to a buffer that contains the certificate in X.509 format, followed by the application identifier signed with a SHA-256 signature using the private key from the certificate.

The size of the pbBlob buffer, in bytes.

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

Call this method to access protected video content in frame-server mode.

hh447966 HRESULT IMFMediaEngineProtectedContent::SetApplicationCertificate([In, Buffer] const unsigned char* pbBlob,[In] unsigned int cbBlob) IMFMediaEngineProtectedContent::SetApplicationCertificate

Gets the content protections that must be applied in frame-server mode.

hh447965 GetRequiredProtections GetRequiredProtections HRESULT IMFMediaEngineProtectedContent::GetRequiredProtections([Out] unsigned int* pFrameProtectionFlags)

Specifies the window that should receive output link protections.

In frame-server mode, call this method to specify the destination window for protected video content. The Media Engine uses this window to set link protections, using the Output Protection Manager (OPM).

hh447968 SetOPMWindow SetOPMWindow HRESULT IMFMediaEngineProtectedContent::SetOPMWindow([In] HWND hwnd)

Sets the content protection manager (CPM).

The Media Engine uses the CPM to handle events related to protected content, such as license acquisition.

hh447967 SetContentProtectionManager SetContentProtectionManager HRESULT IMFMediaEngineProtectedContent::SetContentProtectionManager([In, Optional] void* pCPM)

Provides the Media Engine with a list of media resources.

The interface represents an ordered list of media resources.

This interface enables the application to provide the same audio/video content in several different encoding formats, such as H.264 and Windows Media Video. If a particular codec is not present on the user's computer, the Media Engine will try the next URL in the list. To use this interface, do the following:

  1. Create an implementation of this interface.
  2. Initialize your implementation with a list of URLs. Optionally, provide MIME types and media query strings for each URL.
  3. Call the method.
hh447971 IMFMediaEngineSrcElements IMFMediaEngineSrcElements
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 source elements in the list.

Returns the number of source elements.

hh447973 unsigned int IMFMediaEngineSrcElements::GetLength() IMFMediaEngineSrcElements::GetLength

Gets the URL of an element in the list.

The zero-based index of the source element. To get the number of source elements, call .

Receives a BSTR that contains the URL of the source element. The caller must free the BSTR by calling SysFreeString. If no URL is set, this parameter receives the value null.

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

hh447976 HRESULT IMFMediaEngineSrcElements::GetURL([In] unsigned int index,[Out] wchar_t** pURL) IMFMediaEngineSrcElements::GetURL

Gets the MIME type of an element in the list.

The zero-based index of the source element. To get the number of source elements, call .

Receives a BSTR that contains the MIME type. The caller must free the BSTR by calling SysFreeString. If no MIME type is set, this parameter receives the value null.

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

hh447975 HRESULT IMFMediaEngineSrcElements::GetType([In] unsigned int index,[Out] wchar_t** pType) IMFMediaEngineSrcElements::GetType

Gets the intended media type of an element in the list.

The zero-based index of the source element. To get the number of source elements, call .

Receives a BSTR that contains a media-query string. The caller must free the BSTR by calling SysFreeString. If no media type is set, this parameter receives the value null.

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

The string returned in pMedia should be a media-query string that conforms to the W3C Media Queries specification.

hh447974 HRESULT IMFMediaEngineSrcElements::GetMedia([In] unsigned int index,[Out] wchar_t** pMedia) IMFMediaEngineSrcElements::GetMedia

Adds a source element to the end of the list.

The URL of the source element, or null.

The MIME type of the source element, or null.

A media-query string that specifies the intended media type, or null. If specified, the string should conform to the W3C Media Queries specification.

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

Any of the parameters to this method can be null.

This method allocates copies of the BSTRs that are passed in.

hh447972 HRESULT IMFMediaEngineSrcElements::AddElement([In, Optional] wchar_t* pURL,[In, Optional] wchar_t* pType,[In, Optional] wchar_t* pMedia) IMFMediaEngineSrcElements::AddElement

Removes all of the source elements from the list.

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

hh447977 HRESULT IMFMediaEngineSrcElements::RemoveAllElements() IMFMediaEngineSrcElements::RemoveAllElements

Gets the number of source elements in the list.

hh447973 GetLength GetLength unsigned int IMFMediaEngineSrcElements::GetLength()

Provides the current error status for the Media Engine.

The interface corresponds to the MediaError object in HTML5.

To get a reference to this interface, call .

hh448022 IMFMediaError IMFMediaError
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 error code.

Returns a value from the enumeration.

Windows?Phone?8: This API is supported.

hh448023 unsigned short IMFMediaError::GetErrorCode() IMFMediaError::GetErrorCode

Gets the extended error code.

Returns an value that gives additional information about the last error.

Windows?Phone?8: This API is supported.

hh448024 HRESULT IMFMediaError::GetExtendedErrorCode() IMFMediaError::GetExtendedErrorCode

Sets the error code.

The error code, specified as an value.

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

hh448025 HRESULT IMFMediaError::SetErrorCode([In] MF_MEDIA_ENGINE_ERR error) IMFMediaError::SetErrorCode

Sets the extended error code.

An value that gives additional information about the last error.

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

hh448026 HRESULT IMFMediaError::SetExtendedErrorCode([In] HRESULT error) IMFMediaError::SetExtendedErrorCode

Gets or sets the extended error code.

Windows?Phone?8: This API is supported.

hh448024 GetExtendedErrorCode / SetExtendedErrorCode GetExtendedErrorCode HRESULT IMFMediaError::GetExtendedErrorCode()

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

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)

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 .

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)

Extends the interface to provide additional capabilities for a media source.

To get a reference to this interface, call QueryInterface on the media source.

Implementations of this interface can return E_NOTIMPL for any methods that are not required by the media source.

hh448029 IMFMediaSourceEx IMFMediaSourceEx
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 an attribute store for the media source.

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

This method can return one of these values.

Return codeDescription

Success.

E_NOTIMPL

The media source does not support source-level attributes.

?

Use the reference to get or set attributes that apply to the entire source. For stream-level attributes, use the method instead.

hh448030 HRESULT IMFMediaSourceEx::GetSourceAttributes([Out] IMFAttributes** ppAttributes) IMFMediaSourceEx::GetSourceAttributes

Gets an attribute store for a stream on the media source.

The identifier of the stream. To get the identifier, call on the stream descriptor.

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

This method can return one of these values.

Return codeDescription

Success.

E_NOTIMPL

The media source does not support stream-level attributes.

Invalid stream identifier.

?

Use the reference to get or set attributes that apply to the specified stream. For attributes that apply to the entire source, use the method instead.

hh448031 HRESULT IMFMediaSourceEx::GetStreamAttributes([In] unsigned int dwStreamIdentifier,[Out] IMFAttributes** ppAttributes) IMFMediaSourceEx::GetStreamAttributes

Sets a reference to the Microsoft DirectX Graphics Infrastructure (DXGI) Device Manager on the media source.

A reference to the interface of the DXGI Manager. The media source should query this reference for the interface.

This method can return one of these values.

Return codeDescription

Success.

E_NOTIMPL

The media source does not support source-level attributes.

?

hh448032 HRESULT IMFMediaSourceEx::SetD3DManager([In, Optional] IUnknown* pManager) IMFMediaSourceEx::SetD3DManager

Gets an attribute store for the media source.

Use the reference to get or set attributes that apply to the entire source. For stream-level attributes, use the method instead.

hh448030 GetSourceAttributes GetSourceAttributes HRESULT IMFMediaSourceEx::GetSourceAttributes([Out] IMFAttributes** ppAttributes)

Sets a reference to the Microsoft DirectX Graphics Infrastructure (DXGI) Device Manager on the media source.

hh448032 SetD3DManager SetD3DManager HRESULT IMFMediaSourceEx::SetD3DManager([In, Optional] IUnknown* pManager)

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)

Represents a request for a sample from a MediaStreamSource.

MFMediaStreamSourceSampleRequest is implemented by the Windows.Media.Core.MediaStreamSourceSampleRequest runtime class.

dn280741 IMFMediaStreamSourceSampleRequest IMFMediaStreamSourceSampleRequest
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 sample for the media stream source.

The sample for the media stream source.

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

dn280742 HRESULT IMFMediaStreamSourceSampleRequest::SetSample([In, Optional] IMFSample* value) IMFMediaStreamSourceSampleRequest::SetSample

Sets the sample for the media stream source.

dn280742 SetSample SetSample HRESULT IMFMediaStreamSourceSampleRequest::SetSample([In, Optional] IMFSample* value)

Represents a list of time ranges, where each range is defined by a start and end time.

The interface corresponds to the TimeRanges interface in HTML5.

Several methods return references.

hh448033 IMFMediaTimeRange IMFMediaTimeRange
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 time ranges contained in the object.

Returns the number of time ranges.

This method corresponds to the TimeRanges.length attribute in HTML5.

hh448038 unsigned int IMFMediaTimeRange::GetLength() IMFMediaTimeRange::GetLength

Gets the start time for a specified time range.

The zero-based index of the time range to query. To get the number of time ranges, call .

Receives the start time, in seconds.

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

This method corresponds to the TimeRanges.start method in HTML5.

hh448039 HRESULT IMFMediaTimeRange::GetStart([In] unsigned int index,[Out] double* pStart) IMFMediaTimeRange::GetStart

Gets the end time for a specified time range.

The zero-based index of the time range to query. To get the number of time ranges, call .

Receives the end time, in seconds.

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

This method corresponds to the TimeRanges.end method in HTML5.

hh448037 HRESULT IMFMediaTimeRange::GetEnd([In] unsigned int index,[Out] double* pEnd) IMFMediaTimeRange::GetEnd

Queries whether a specified time falls within any of the time ranges.

The time, in seconds.

Returns TRUE if any time range contained in this object spans the value of the time parameter. Otherwise, returns .

This method returns TRUE if the following condition holds for any time range in the list:

(start <= time) && (time <= end)
hh448036 BOOL IMFMediaTimeRange::ContainsTime([In] double time) IMFMediaTimeRange::ContainsTime

Adds a new range to the list of time ranges.

The start time, in seconds.

The end time, in seconds.

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

If the new range intersects a range already in the list, the two ranges are combined. Otherwise, the new range is added to the list.

hh448034 HRESULT IMFMediaTimeRange::AddRange([In] double startTime,[In] double endTime) IMFMediaTimeRange::AddRange

Clears the list of time ranges.

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

hh448035 HRESULT IMFMediaTimeRange::Clear() IMFMediaTimeRange::Clear

Gets the number of time ranges contained in the object.

This method corresponds to the TimeRanges.length attribute in HTML5.

hh448038 GetLength GetLength unsigned int IMFMediaTimeRange::GetLength()

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 MFVIDEOFORMAT 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)

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, Optional] 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.

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 IEVRTrustedVideoPlugin 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)

Provides a mechanism for a media source to implement content protection functionality in a Windows Store apps.

When to implement: A media source implements in order to implement content protection functionality for Windows Store apps.

jj128316 IMFPMPClientApp IMFPMPClientApp
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 reference to the interface allowing a media source to create objects in the PMP process.

No documentation.

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

jj128317 HRESULT IMFPMPClientApp::SetPMPHost([In] IMFPMPHostApp* pPMPHost) IMFPMPClientApp::SetPMPHost

Sets a reference to the interface allowing a media source to create objects in the PMP process.

jj128317 SetPMPHost SetPMPHost HRESULT IMFPMPClientApp::SetPMPHost([In] IMFPMPHostApp* pPMPHost)

Creates a Windows Runtime object in the protected media path (PMP) process.

jj128319 IMFPMPHostApp IMFPMPHostApp
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.

jj128320 HRESULT IMFPMPHostApp::LockProcess() IMFPMPHostApp::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.

jj128321 HRESULT IMFPMPHostApp::UnlockProcess() IMFPMPHostApp::UnlockProcess

Creates a Windows Runtime object in the protected media path (PMP) process.

Id of object to create.

Data to be passed to the object by way of a IPersistStream.

The interface identifier (IID) of the interface to retrieve.

Receives a reference to the created object.

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

jj128319 HRESULT IMFPMPHostApp::ActivateClassById([In] const wchar_t* id,[In, Optional] IStream* pStream,[In] const GUID& riid,[Out] void** ppv) IMFPMPHostApp::ActivateClassById

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 MFCreatePresentationClock 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 IMFMediaSession::GetClock.

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 MFCreateSystemTimeSource 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)

Provides a method that allows content protection systems to perform a handshake with the protected environment. This is needed because the CreateFile and DeviceIoControl APIs are not available to Windows Store apps.

See MFCreateProtectedEnvironmentAccess for an example of how to create and use an object.

hh448045 IMFProtectedEnvironmentAccess IMFProtectedEnvironmentAccess
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.

Allows content protection systems to access the protected environment.

The length in bytes of the input data.

A reference to the input data.

The length in bytes of the output data.

A reference to the output data.

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

Return codeDescription

The method succeeded.

?

See MFCreateProtectedEnvironmentAccess for an example of how to create an object and use the Call method.

hh448046 HRESULT IMFProtectedEnvironmentAccess::Call([In] unsigned int inputLength,[In, Buffer] const unsigned char* input,[In] unsigned int outputLength,[Out, Buffer] unsigned char* output) IMFProtectedEnvironmentAccess::Call

Gets the Global Revocation List (GLR).

The length of the data returned in output.

Receives the contents of the global revocation list file.

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

Allows reading of the system Global Revocation List (GRL).

jj128322 HRESULT IMFProtectedEnvironmentAccess::ReadGRL([Out] unsigned int* outputLength,[Out, Buffer] unsigned char** output) IMFProtectedEnvironmentAccess::ReadGRL

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 IMFQualityManager::NotifyTopology 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)

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).

This interface is a replacement for the IMFRealTimeClient interface.

hh448047 IMFRealTimeClientEx IMFRealTimeClientEx
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. If the value is zero on input, the object should create a new MCCSS task group. See Remarks.

The name of the MMCSS task.

The base priority of the thread.

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

If the object does not create worker threads, the method should simply return and take no further action.

Otherwise, if the value of *pdwTaskIndex is zero on input, the object should perform the following steps:

  1. A single worker thread calls AvSetMmThreadCharacteristics to create a new MMCSS task identifier. Store this value.
  2. Any additional worker threads call AvSetMmThreadCharacteristics using the new task identifier.
  3. Return the new task identifier to the caller, by setting *pdwTaskIndex equal to the task identifier.

If the value of *pdwTaskIndex is nonzero on input, the parameter contains an existing MMCSS task identifer. In that case, all worker threads of the object should register themselves for that task by calling AvSetMmThreadCharacteristics.

hh448048 HRESULT IMFRealTimeClientEx::RegisterThreadsEx([InOut] unsigned int* pdwTaskIndex,[In] const wchar_t* wszClassName,[In] int lBasePriority) IMFRealTimeClientEx::RegisterThreadsEx

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.

hh448050 HRESULT IMFRealTimeClientEx::UnregisterThreads() IMFRealTimeClientEx::UnregisterThreads

Specifies the work queue that this object should use for asynchronous work items.

The work queue identifier.

The base priority for work items.

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

The object should use the values of dwMultithreadedWorkQueueId and lWorkItemBasePriority when it queues new work items. Use the or function to queue the work item.

hh448049 HRESULT IMFRealTimeClientEx::SetWorkQueueEx([In] unsigned int dwMultithreadedWorkQueueId,[In] int lWorkItemBasePriority) IMFRealTimeClientEx::SetWorkQueueEx

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)

Completes an asynchronous request to write a media sample to the stream.

Call this method when the method completes asynchronously.

hh448053 IMFSampleOutputStream IMFSampleOutputStream
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 write a media sample to the stream.

A reference to the interface of the sample.

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 sample has been written to the stream, the callback object's method is called. At that point, the caller should call to complete the asynchronous request.

hh448052 HRESULT IMFSampleOutputStream::BeginWriteSample([In, Optional] IMFSample* pSample,[In, Optional] IMFAsyncCallback* pCallback,[In, Optional] IUnknown* punkState) IMFSampleOutputStream::BeginWriteSample

Completes an asynchronous request to write a media sample to the stream.

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

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

Call this method when the method completes asynchronously.

hh448053 HRESULT IMFSampleOutputStream::EndWriteSample([In, Optional] IMFAsyncResult* pResult) IMFSampleOutputStream::EndWriteSample
No documentation. No documentation. HRESULT IMFSampleOutputStream::Close() IMFSampleOutputStream::Close

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)

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

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 MFGetService 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 (IMFContentEnabler 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 MFShutdownObject 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)

Provides a method that allows content protection systems to get the procedure address of a function in the signed library. This method provides the same functionality as GetProcAddress which is not available to Windows Store apps.

See MFLoadSignedLibrary for an example of how to create and use an object.

hh448058 IMFSignedLibrary IMFSignedLibrary
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 procedure address of the specified function in the signed library.

The entry point name in the DLL that specifies the function.

Receives the address of the entry point.

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

Return codeDescription

The method succeeded.

?

See MFLoadSignedLibrary for an example of how to create an object and call the GetProcedureAddress method.

hh448059 HRESULT IMFSignedLibrary::GetProcedureAddress([In] const char* name,[Out] void** address) IMFSignedLibrary::GetProcedureAddress

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 .

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 IMFFinalizableMediaSink::BeginFinalize and EndFinalize if the media sink supports the IMFFinalizableMediaSink 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

Provides additional functionality on the sink writer for dynamically changing the media type and encoder configuration.

The Sink Writer implements this interface in Windows?8.1. To get a reference to this interface, call QueryInterface on the .

dn302046 IMFSinkWriterEncoderConfig IMFSinkWriterEncoderConfig
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.

Dynamically changes the target media type that Sink Writer is encoding to.

Specifies the stream index.

The new media format to encode to.

The new set of encoding parameters to configure the encoder with. If not specified, previously provided parameters will be used.

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

The new media type must be supported by the media sink being used and by the encoder MFTs installed on the system.

dn302048 HRESULT IMFSinkWriterEncoderConfig::SetTargetMediaType([In] unsigned int dwStreamIndex,[In] IMFMediaType* pTargetMediaType,[In, Optional] IMFAttributes* pEncodingParameters) IMFSinkWriterEncoderConfig::SetTargetMediaType

Dynamically updates the encoder configuration with a collection of new encoder settings.

Specifies the stream index.

A set of encoding parameters to configure the encoder with.

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

The encoder will be configured with these settings after all previously queued input media samples have been sent to it through .

dn302047 HRESULT IMFSinkWriterEncoderConfig::PlaceEncodingParameters([In] unsigned int dwStreamIndex,[In] IMFAttributes* pEncodingParameters) IMFSinkWriterEncoderConfig::PlaceEncodingParameters

Extends the interface.

The Sink Writer implements this interface in Windows?8. To get a reference to this interface, call QueryInterface on the Sink Writer.

hh448060 IMFSinkWriterEx IMFSinkWriterEx
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 reference to a Media Foundation transform (MFT) for a specified stream.

The zero-based index of a stream.

The zero-based index of the MFT to retreive.

Receives a reference to a that specifies the category of the MFT. For a list of possible values, see MFT_CATEGORY.

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

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

hh448061 HRESULT IMFSinkWriterEx::GetTransformForStream([In] unsigned int dwStreamIndex,[In] unsigned int dwTransformIndex,[Out, Optional] GUID* pGuidCategory,[Out] IMFTransform** ppTransform) IMFSinkWriterEx::GetTransformForStream

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 .

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

Sets the native media type for a stream on the media source.

This method sets the output type that is produced by the media source. Unlike the method, this method does not insert any decoders, video processors, or other transforms. The media source must support the specified media type natively. To get a list of supported types from the media source, call .

In asynchronous mode, this method fails if a sample request is pending. In that case, wait for the OnReadSample callback to be invoked before calling the method. For more information about using the Source Reader in asynchronous mode, see .

This method can trigger a change in the output format for the stream. If so, the flag is returned in the pdwStreamFlags parameter. The method might also cause the Source Reader to remove any effects that were added by the method. If this occurs, the flag is returned in pdwStreamFlags.

This method is useful with audio and video capture devices, because a device might support several output formats. This method enables the application to choose the device format before decoders and other transforms are added.

hh448066 IMFSourceReaderEx IMFSourceReaderEx
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 native media type for a stream on the media source.

A reference to the interface of the media type.

Receives a bitwise OR of zero or more of the following flags.

ValueMeaning

All effects were removed from the stream.

The current output type changed.

?

This method can return one of these values.

Return codeDescription

Success.

Invalid request.

The dwStreamIndex parameter is invalid.

?

This method sets the output type that is produced by the media source. Unlike the method, this method does not insert any decoders, video processors, or other transforms. The media source must support the specified media type natively. To get a list of supported types from the media source, call .

In asynchronous mode, this method fails if a sample request is pending. In that case, wait for the OnReadSample callback to be invoked before calling the method. For more information about using the Source Reader in asynchronous mode, see .

This method can trigger a change in the output format for the stream. If so, the flag is returned in the pdwStreamFlags parameter. The method might also cause the Source Reader to remove any effects that were added by the method. If this occurs, the flag is returned in pdwStreamFlags.

This method is useful with audio and video capture devices, because a device might support several output formats. This method enables the application to choose the device format before decoders and other transforms are added.

hh448066 HRESULT IMFSourceReaderEx::SetNativeMediaType([In] unsigned int dwStreamIndex,[In, Optional] IMFMediaType* pMediaType,[Out] unsigned int* pdwStreamFlags) IMFSourceReaderEx::SetNativeMediaType

Adds a transform, such as an audio or video effect, to a stream.

The stream to configure. 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.

?

A reference to one of the following:

  • A Media Foundation transform (MFT) that exposes the interface.
  • An MFT activation object that exposes the interface.

This method can return one of these values.

Return codeDescription

Success.

The transform does not support the current stream format, and no conversion was possible. See Remarks for more information.

Invalid request.

The dwStreamIndex parameter is invalid.

?

This method attempts to add the transform at the end of the current processing chain.

To use this method, make the following sequence of calls:

  1. Call to set the output type that you want for the stream. In this step, you can specify a media type that contains only the major type and subtype GUIDs. For example, to get 32-bit RGB output, set a major type of and a subtype of . (For more information, see Media Type GUIDs.)
  2. Call AddTransformForStream. If the Source Reader successfully connects the transform, it sets the output type on the transform.
  3. Call to get the output type from the transform. This method returns a media type with a complete format description.
  4. Optionally, if you want to modify the output type, call again to set a complete media type on the transform.

The AddTransformForStream method will not insert a decoder into the processing chain. If the native stream format is encoded, and the transform requires an uncompressed format, call SetCurrentMediaType to set the uncompressed format (step 1 in the previous list). However, the method will insert a video processor to convert between RGB and YUV formats, if required.

The method fails if the source reader was configured with the or attributes.

In asynchronous mode, the method also fails if a sample request is pending. In that case, wait for the OnReadSample callback to be invoked before calling the method. For more information about using the Source Reader in asynchronous mode, see .

You can add a transform at any time during streaming. However, the method does not flush or drain the pipeline before inserting the transform. Therefore, if data is already in the pipeline, the next sample is not guaranteed to have the transform applied.

hh448063 HRESULT IMFSourceReaderEx::AddTransformForStream([In] unsigned int dwStreamIndex,[In] IUnknown* pTransformOrActivate) IMFSourceReaderEx::AddTransformForStream

Removes all of the Media Foundation transforms (MFTs) for a specified stream, with the exception of the decoder.

The stream for which to remove the MFTs. 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.

?

This method can return one of these values.

Return codeDescription

Success.

Invalid request.

The dwStreamIndex parameter is invalid.

?

Calling this method can reset the current output type for the stream. To get the new output type, call .

In asynchronous mode, this method fails if a sample request is pending. In that case, wait for the OnReadSample callback to be invoked before calling the method. For more information about using the Source Reader in asynchronous mode, see .

hh448065 HRESULT IMFSourceReaderEx::RemoveAllTransformsForStream([In] unsigned int dwStreamIndex) IMFSourceReaderEx::RemoveAllTransformsForStream

Gets a reference to a Media Foundation transform (MFT) for a specified stream.

The stream to query for the MFT. 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 MFT to retreive.

Receives a that specifies the category of the MFT. For a list of possible values, see MFT_CATEGORY.

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

This method can return one of these values.

Return codeDescription

Success.

The dwTransformIndex parameter is out of range.

The dwStreamIndex parameter is invalid.

?

You can use this method to configure an MFT after it is inserted into the processing chain. Do not use the reference returned in ppTransform to set media types on the MFT or to process data. In particular, calling any of the following methods could have unexpected results.

  • AddInputStreams
  • DeleteInputStream
  • ProcessEvent
  • ProcessInput
  • ProcessMessage
  • ProcessOutput
  • SetInputType
  • SetOutputType

If a decoder is present, it appears at index position zero.

To avoid losing any data, you should drain the source reader before calling this method. For more information, see Draining the Data Pipeline.

hh448064 HRESULT IMFSourceReaderEx::GetTransformForStream([In] unsigned int dwStreamIndex,[In] unsigned int dwTransformIndex,[Out, Optional] GUID* pGuidCategory,[Out] IMFTransform** ppTransform) IMFSourceReaderEx::GetTransformForStream

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

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)

Provides a method that retireves system id data.

hh448067 IMFSystemId IMFSystemId
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 system id data.

The size in bytes of the returned data.

Receives the returned data. The caller must free this buffer 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.

?

hh448068 HRESULT IMFSystemId::GetData([Out] unsigned int* size,[Out, Buffer] unsigned char** data) IMFSystemId::GetData

Sets up the .

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

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

jj128323 HRESULT IMFSystemId::Setup([In] unsigned int stage,[In] unsigned int cbIn,[In, Buffer] const unsigned char* pbIn,[Out] unsigned int* pcbOut,[Out, Buffer] unsigned char** ppbOut) IMFSystemId::Setup

Tracks the reference counts on a video media sample. Video samples created by the MFCreateVideoSampleFromSurface 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 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 MFTGetInfo 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 MFTGetInfo 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 IMediaObject::ProcessInput 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 IMediaObject::ProcessOutput 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)

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 MR_VIDEO_ACCELERATION_SERVICE. 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 IDirect3DDeviceManager9 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 MR_VIDEO_ACCELERATION_SERVICE 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)

Initializes the video sample allocator object.

hh448077 IMFVideoSampleAllocatorEx IMFVideoSampleAllocatorEx
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 video sample allocator object.

The initial number of samples to allocate.

The maximum number of samples to allocate.

A reference to the interface. You can use this interface to configure the allocator. Currently, the following configuration attributes are defined:

  • MF_SA_D3D11_SHARED
  • MF_SA_D3D11_SHARED_WITHOUT_MUTEX

A reference to the interface of a media type that describes the video format.

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

hh448077 HRESULT IMFVideoSampleAllocatorEx::InitializeSampleAllocatorEx([In] unsigned int cInitialSamples,[In] unsigned int cMaximumSamples,[In, Optional] IMFAttributes* pAttributes,[In] IMFMediaType* pMediaType) IMFVideoSampleAllocatorEx::InitializeSampleAllocatorEx

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

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

Specifies a range of bytes.

hh162808 MF_BYTE_STREAM_CACHE_RANGE MF_BYTE_STREAM_CACHE_RANGE

The offset, in bytes, of the start of the range.

hh162808 unsigned longlong qwStartOffset unsigned longlong qwStartOffset

The offset, in bytes, of the end of the range.

hh162808 unsigned longlong qwEndOffset unsigned longlong qwEndOffset
No documentation. CapturedMetadataExposureCompensation CapturedMetadataExposureCompensation No documentation. unsigned longlong Flags unsigned longlong Flags No documentation. int Value int Value

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. FaceRectInfo FaceRectInfo No documentation. RECT Region RECT Region No documentation. int confidenceLevel int confidenceLevel No documentation. FaceRectInfoBlobHeader FaceRectInfoBlobHeader No documentation. unsigned int Size unsigned int Size No documentation. unsigned int Count unsigned int Count

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

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

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

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

Defines a regions of interest.

dn302212 ROI_AREA ROI_AREA

The bounds of the region.

dn302212 RECT rect RECT rect

Specifies the quantization parameter delta for the specified region from the rest of the frame.

dn302212 int QPDelta int QPDelta

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

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

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

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

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
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. Delegate MediaEngineNotifyDelegate {CC2D43FA-BBC4-448A-9D0B-7B57ADF2655C} The media event. The param1. The param2. Attributes used when instantiating class. Initializes a new instance of class. A native COM pointer to a MediaEngineAttributes Initializes a new instance of class. Size of the data to allocate

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
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. 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.