Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IMemAllocator
Collapse the table of content
Expand the table of content

IMemAllocator interface

The IMemAllocator interface allocates media samples, for moving data between pins.

This interface is used by pins that share allocators, when the input pin exposes the IMemInputPin interface. The pins negotiate which pin will provide the allocator. The allocator is used to allocate memory buffers, retrieve empty buffers, and release buffers. Not every filter creates its own allocator, so one allocator might be used by several filters. For more information, see How Filters Connect.

Applications typically do not use this interface.

To use an allocator, perform the following steps:

  1. Call the IMemAllocator::SetProperties method to specify the buffer requirements, including the number of buffers and the size of each buffer.
  2. Call the IMemAllocator::Commit method to allocate the buffers.
  3. Call the IMemAllocator::GetBuffer method to retrieve media samples. This method blocks until the next sample becomes available.
  4. When you are done with each sample, call the IUnknown::Release method on the sample. The sample is not deleted when its reference count reaches zero. Instead, the sample returns to the allocator's free list.
  5. When you are done using the allocator, call the IMemAllocator::Decommit method to release the memory for the buffers.

Members

The IMemAllocator interface inherits from the IUnknown interface. IMemAllocator also has these types of members:

Methods

The IMemAllocator interface has these methods.

MethodDescription
Commit

Allocates the buffer memory.

Decommit

Releases the buffer memory.

GetBuffer

Retrieves a media sample that contains an empty buffer.

GetProperties

Retrieves the number of buffers that the allocator will create, and the buffer properties.

ReleaseBuffer

Releases a media sample.

SetProperties

Specifies the number of buffers to allocate and the size of each buffer.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Strmif.h (include Dshow.h)

Library

Strmiids.lib

 

 

Community Additions

ADD
Show:
© 2015 Microsoft