本文整理汇总了C++中VideoSource::getFrameBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoSource::getFrameBuffer方法的具体用法?C++ VideoSource::getFrameBuffer怎么用?C++ VideoSource::getFrameBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoSource
的用法示例。
在下文中一共展示了VideoSource::getFrameBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SessionFrame
LRESULT Frameserver::SessionFrame(LPARAM lParam, WPARAM original_frame) {
FrameserverSession *fs = SessionLookup(lParam);
if (!fs)
return VDSRVERR_BADSESSION;
try {
const void *ptr = vSrc->getFrameBuffer();
const BITMAPINFOHEADER *bmih = vSrc->getDecompressedFormat();
VDPosition sample;
bool is_preroll;
if (fs->arena_size < ((filters.LastBitmap()->w*3+3)&-4)*filters.LastBitmap()->h)
return VDSRVERR_TOOBIG;
sample = mVideoFrameMap[original_frame].mDisplayFrame;
if (sample < 0)
return VDSRVERR_FAILED;
vSrc->streamSetDesiredFrame(sample);
VDPosition targetSample = vSrc->displayToStreamOrder(sample);
VDPosition frame = vSrc->streamGetNextRequiredFrame(is_preroll);
if (frame >= 0) {
do {
uint32 lSize;
int hr;
// _RPT1(0,"feeding frame %ld\n", frame);
hr = vSrc->read(frame, 1, NULL, 0x7FFFFFFF, &lSize, NULL);
if (hr)
return VDSRVERR_FAILED;
uint32 bufSize = (lSize + 65535 + vSrc->streamGetDecodePadding()) & ~65535;
if (mInputBuffer.size() < bufSize)
mInputBuffer.resize(bufSize);
hr = vSrc->read(frame, 1, mInputBuffer.data(), lSize, &lSize, NULL);
if (hr)
return VDSRVERR_FAILED;
vSrc->streamFillDecodePadding(mInputBuffer.data(), lSize);
ptr = vSrc->streamGetFrame(mInputBuffer.data(), lSize, is_preroll, frame, targetSample);
} while(-1 != (frame = vSrc->streamGetNextRequiredFrame(is_preroll)));
} else
ptr = vSrc->streamGetFrame(NULL, 0, FALSE, targetSample, targetSample);
VDPixmap pxdst(VDPixmapFromLayout(mFrameLayout, fs->arena));
if (!g_listFA.IsEmpty()) {
VDPixmapBlt(VDAsPixmap(*filters.InputBitmap()), vSrc->getTargetFormat());
fsi.lCurrentFrame = original_frame;
fsi.lCurrentSourceFrame = sample;
fsi.lSourceFrameMS = MulDiv(fsi.lCurrentSourceFrame, fsi.lMicrosecsPerSrcFrame, 1000);
fsi.lDestFrameMS = MulDiv(fsi.lCurrentFrame, fsi.lMicrosecsPerFrame, 1000);
filters.RunFilters(fsi);
VDPixmapBlt(pxdst, VDAsPixmap(*filters.LastBitmap()));
} else
VDPixmapBlt(pxdst, vSrc->getTargetFormat());
} catch(const MyError&) {
return VDSRVERR_FAILED;
}
return VDSRVERR_OK;
}