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.

Protected Member VariablesDescription
m_pFilter Pointer to the owning filter.
m_pMediaType Pointer to the current media type.
Protected Methods Description
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 MethodsDescription
CImageAllocator Constructor method.
NotifyMediaType Informs the object of the current media type.
IMemAllocator Methods Description
SetProperties Specifies the number of buffers to allocate and the size of each buffer.

 

Requirements

Header

Winutil.h (include Streams.h)

Library

Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CDrawImage Class

 

 

Show: