Microsoft DirectX 9.0

Media Type Functions

The DirectShow base classes provides helper functions for handling the AM_MEDIA_TYPE structure.

The AM_MEDIA_TYPE structure contains a pointer (the pbFormat member) to another block of memory, which is called the format block. When you work with this structure, therefore, you must be careful about memory allocation in order to avoid memory leaks.

The following functions allocate memory:

The following functions free memory:


Header: Declared in Mtype.h; include Streams.h.

Library: Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).

Function Description
CopyMediaType Copies a task-allocated AM_MEDIA_TYPE structure.
CreateAudioMediaType Initializes a media type structure given a wave format structure.
CreateMediaType Allocates and initializes an AM_MEDIA_TYPE structure, from an existing AM_MEDIA_TYPE structure.
DeleteMediaType Deletes a task-allocated AM_MEDIA_TYPE structure.
FreeMediaType Frees a task-allocated AM_MEDIA_TYPE structure from memory.