本文整理汇总了C++中ImgBufQueNode::setStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ ImgBufQueNode::setStatus方法的具体用法?C++ ImgBufQueNode::setStatus怎么用?C++ ImgBufQueNode::setStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImgBufQueNode
的用法示例。
在下文中一共展示了ImgBufQueNode::setStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//
// Callback of Postview for Display
//
// Arguments:
// i8Timestamp
// [I] Postview timestamp
//
// u4PostviewSize
// [I] Postview buffer size in bytes.
//
// puPostviewBuf
// [I] Postview buffer with its size = u4PostviewSize
//
bool
CamAdapter::
onCB_PostviewDisplay(
int64_t const i8Timestamp,
uint32_t const u4PostviewSize,
uint8_t const* puPostviewBuf
)
{
MY_LOGD("timestamp(%lld), size/buf=%d/%p", i8Timestamp, u4PostviewSize, puPostviewBuf);
#if 1
//
if ( ! u4PostviewSize || ! puPostviewBuf )
{
MY_LOGW("Bad callback: size/buf=%d/%p", i8Timestamp, u4PostviewSize, puPostviewBuf);
return false;
}
//
sp<IImgBufProvider> pImgBufPvdr = mpImgBufProvidersMgr->getProvider(IImgBufProvider::eID_DISPLAY);
if ( pImgBufPvdr == 0 )
{
MY_LOGW("Bad IImgBufProvider");
return false;
}
//
ImgBufQueNode node;
if ( ! pImgBufPvdr->dequeProvider(node) )
{
MY_LOGW("dequeProvider fail");
return false;
}
//
sp<IImgBuf> pImgBuf = node.getImgBuf();
if ( u4PostviewSize != pImgBuf->getBufSize() )
{
MY_LOGW(
"callback size(%d) != display:[%d %s %dx%d]",
u4PostviewSize, pImgBuf->getBufSize(), pImgBuf->getImgFormat().string(),
pImgBuf->getImgWidth(), pImgBuf->getImgHeight()
);
node.setStatus(ImgBufQueNode::eSTATUS_CANCEL);
}
else
{
::memcpy(pImgBuf->getVirAddr(), puPostviewBuf, u4PostviewSize);
globalcacheFlushAll();
MY_LOGD_IF(1, "- globalcacheFlushAll()");
//
pImgBuf->setTimestamp(i8Timestamp);
node.setStatus(ImgBufQueNode::eSTATUS_DONE);
}
//
if ( ! pImgBufPvdr->enqueProvider(node) )
{
MY_LOGW("enqueProvider fail");
return false;
}
//
#endif
return true;
}