本文整理汇总了C++中vdrefptr::ReadSpan方法的典型用法代码示例。如果您正苦于以下问题:C++ vdrefptr::ReadSpan方法的具体用法?C++ vdrefptr::ReadSpan怎么用?C++ vdrefptr::ReadSpan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vdrefptr
的用法示例。
在下文中一共展示了vdrefptr::ReadSpan方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _read
int VDVideoSourceFLM::_read(VDPosition lStart, uint32 lCount, void *lpBuffer, uint32 cbBuffer, uint32 *lBytesRead, uint32 *lSamplesRead) {
if (lCount > 1)
lCount = 1;
int ret = 0;
if (lCount > 0) {
if (lpBuffer) {
if (mVisibleFrameSize > cbBuffer)
ret = IVDStreamSource::kBufferTooSmall;
else {
mpParent->ReadSpan((uint64)mFrameSize * lStart, lpBuffer, mVisibleFrameSize);
// Swizzle the frame now. Easier this way. We need to go from RGBA to BGRA.
uint8 *p = (uint8 *)lpBuffer;
uint32 count = mVisibleFrameSize >> 2;
do {
uint8 r = p[0];
uint8 b = p[2];
p[0] = b;
p[2] = r;
p += 4;
} while(--count);
}
}
}
if (lBytesRead)
*lBytesRead = mVisibleFrameSize;
if (lSamplesRead)
*lSamplesRead = lCount;
return ret;
}