Microsoft KB Archive/326229

= INFO: Use of the FileAlignment Member of the KSALLOCATOR_FRAMING Structure =

Article ID: 326229

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Windows XP Driver Development Kit

-



This article was previously published under Q326229



SUMMARY
The FileAlignment member of the KSALLOCATOR_FRAMING structure is used by a Kernel Streaming driver to specify memory alignment requirements.

For example, if your device requires that memory be aligned on quad boundaries, it is best that you specify the FILE_QUAD_ALIGNMENT flag for this member.

Although you have better results when allocators support FILE_QUAD_ALIGNMENT requests, this may not always be possible. For example, the Video Renderer filter that is provided by DirectShow includes an allocator that uses DirectDraw surfaces to fulfill its allocation requests. This memory may not be quad aligned. Therefore, the allocator of the Video Renderer supports only word alignment requests and rejects connections for any other alignment requirements.



MORE INFORMATION
If a capture driver specified FILE_QUAD_ALGINMENT, DirectShow inserts an additional filter between the capture filter and the Video Renderer. This is because the Video Renderer rejects a direct connection with the capture driver because of its alignment requirement. A filter that supports the aligned allocation request on its input pin and supports the word-aligned allocation on its output pin is inserted between the two filters to perform the alignment transformation. The side effect of this is that the data will be copied by this filter from its input pin to its output pin. This additional copy can slow down performance.

To prevent this in video capture drivers, specify 0 in the FileAlignment member of KSALLOCATOR_FRAMING, unless you have other alignment requirements.

Keywords: kbinfo KB326229

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.