Поделиться через


IBuffering Interface (Compact 2013)

3/26/2014

This interface provides methods that allow you to control the size of the buffer filter in a capture graph. The buffer filter provides first-in-first-out storage within the filter graph for captured data. It allows recently captured frames be queued up while previously captured frame are processed in the filter graph.

The buffering filter allocates memory as needed and it releases this memory when it is done with it. In doing so, the filter buffer tries to make its use of memory as efficiently as possible. If the rate of captured data entering the buffer exceeds the rate of data leaving the buffer then the buffer filter will adaptively allocate more memory as needed. The buffer will grow until it reaches a memory limit, which will either be established by a prior call to IBuffering::SetBufferingDepth or until it nears the out-of-memory (OOM) threshold for the device. Specifically, the buffering filter will stop allocating more memory when it comes within 1.3 times the memory available on the system as determined by the OOM threshold. For example, if the OOM threshold is set so that 1MB of system memory is reserved for out-of-memory activities, then the buffing filter will stop allocating when 1.3 MB of memory remain.

When the buffer reaches a memory boundary it sends an EC_BUFFER_FULL notification to the application. If the application does not stop the capture process or change the capture parameters, the buffer filter will begin to drop frames from the front (the oldest frames) of the buffer while continuing to add new frames to the rear of the buffer. This allows the buffer filter to maintain better synchronization between audio and video. The buffer filter places the highest priority on preserving a continuous audio capture and will drop video frames to achieve this goal.

In addition to the methods inherited from IUnknown, the IBuffering interface exposes the methods shown in the following table.

Method

Description

IBuffering::GetBufferingDepth

Allows you to set the size of the capture buffer.

IBuffering::SetBufferingDepth

Allows you to determine the current size of the capture buffer.

Remarks

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

Requirements

Header

dshow.h

Library

Strmiids.lib

See Also

Reference

DirectShow Interfaces