Microsoft DirectX 9.0

DeleteMediaType

The DeleteMediaType function deletes an allocated AM_MEDIA_TYPE structure, including the format block.

Syntax

void WINAPI DeleteMediaType(
    AM_MEDIA_TYPE *pmt
);

Parameters

pmt

Pointer to an AM_MEDIA_TYPE structure.

Return Value

No return value.

Remarks

Use this function to release any media type structure that was allocated using either CoTaskMemAlloc or CreateMediaType.

If you prefer not to link to the base class library, you can use the following code directly:

void MyDeleteMediaType(AM_MEDIA_TYPE *pmt)
{
    if (pmt != NULL)
    {
        MyFreeMediaType(*pmt); // See FreeMediaType for the implementation.
        CoTaskMemFree(pmt);
    }
}

See Also