다음을 통해 공유


CMemAllocator Class (Windows CE 5.0)

Send Feedback

ms926735.filter10(en-us,MSDN.10).gif

This class provides support for IMemAllocator by using the new operator to allocate memory.

Derived from CBaseAllocator, it overrides the CBaseAllocator::Alloc member function to allocate a single block of memory large enough to hold all requested data areas, and then allocates (using the new operator) a CMediaSample object for each requested buffer pointing into the data area.

The CBaseInputPin and CBaseOutputPin classes instantiate CMemAllocator objects as the default allocator if no other suitable allocator is provided.

All member functions in this class that return HRESULT and accept a pointer as a parameter return E_POINTER when passed a null pointer.

Member Functions

Member function Description
Alloc Allocates memory for a media sample (overrides CBaseAllocator::Alloc).
CMemAllocator Constructs a CMemAllocator object.
ReallyFree Frees memory when called from the destructor (or from Alloc when reallocating for new size or count).

Overrideable Member Functions

Member function Description
Free Indicates an overridden CBaseAllocator::Free member function, called when a decommit operation is complete to free memory.

Implemented IMemAllocator Methods

Method Description
CreateInstance Creates new instances of CMemAllocator in the factory template.
SetProperties Sets the number of media samples and the size of each.

Requirements

DirectShow applications and DirectShow filters have different include file and link library requirements.

For more information, see Setting Up the Build Environment.

OS Versions: Windows CE 2.12 and later. Version 2.12 requires DXPAK 1.0 or later.
Header:

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.