typedef struct _AllocatorProperties {
long cBuffers;
long cbBuffer;
long cbAlign;
long cbPrefix;
} ALLOCATOR_PROPERTIES;
谁能具体说明一下long cbAlign; long cbPrefix;的意义?
------解决方案--------------------------------------------------------
cbAlign
Alignment of the buffer; buffer start will be aligned on a multiple of this value.
cbPrefix
Each buffer is preceded by a prefix of this many bytes.
sdk上说的挺清楚啊,cbAlign就是buffer地址要求多少byte对齐。
cbPrefix 就是每块buffer前面有多少前缀空间。
需要注意的是下面:
Since the buffer pointer returned by IMediaSample::GetPointer points to the area immediately following the prefix, the cbPrefix address (the value returned by IMediaSample::GetPointer minus cbPrefix) should be aligned on an address that is a multiple of cbAlign bytes.
------解决方案--------------------------------------------------------
楼上说的对
没有特殊要求的话,一般cbAlign就是1,cbPrefix是0
------解决方案--------------------------------------------------------
如果下游filter也是你自己写的话,就可以用prefix,你可以通过sample buffer将参数传递下去,下游filter计算好buffer地址就可以。
如buffer中前10bytes存储的是数据,之后才是真正的sample data,那么下游filter就要知道这块buffer的分布情况。