Microsoft DirectX 9.0

CImageAllocator Class

CImageAllocator Class Hierarchy

The CImageAllocator class implements an allocator that manages GDI device-independent bitmaps (DIBs). This class derives from the CBaseAllocator class. It creates media samples that are implemented using the CImageSample class.

An allocator is shared by two connected pins, but is always owned by one of the filters in the connection. A filter that uses CImageAllocator must keep track of whether the allocator was provided by itself or by the other filter. If the allocator was provided by itself, the owning filter can rely on the fact that all media samples from the allocator are CImageSample objects. It can therefore use the CImageSample object to obtain information about the DIB, which is stored in a DIBDATA structure.

The owning filter should call NotifyMediaType whenever the media type changes.

Requirements

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

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

Protected Member Variables Description
m_pFilter Pointer to the owning filter.
m_pMediaType Pointer to the current media type.
Protected Methods  
Alloc Allocates memory for the buffers.
CheckSizes Checks allocator properties against the current media type.
CreateDIB Creates a DIB.
CreateImageSample Creates a media sample. Virtual.
Free Releases all of the buffer memory.
Public Methods  
CImageAllocator Constructor method.
NotifyMediaType Informs the object of the current media type.
IMemAllocator Methods  
SetProperties Specifies the number of buffers to allocate and the size of each buffer.

See Also