本文整理汇总了C++中sp::dequeProcessor方法的典型用法代码示例。如果您正苦于以下问题:C++ sp::dequeProcessor方法的具体用法?C++ sp::dequeProcessor怎么用?C++ sp::dequeProcessor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp
的用法示例。
在下文中一共展示了sp::dequeProcessor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _l
bool
RecordClient::
waitAndHandleReturnBuffers(sp<IImgBufQueue>const& rpBufQueue)
{
bool ret = false;
uint32_t i,size;
Vector<ImgBufQueNode> vQueNode;
//
MY_LOGD_IF(ENABLE_LOG_PER_FRAME, "+");
//
{
Mutex::Autolock _l(mModuleMtx);
//
size = mvRecBufInfo.size();
for(i=0; i<size; i++)
{
if(mvRecBufInfo[i].Sta == REC_BUF_STA_ENQUE)
{
break;
}
}
}
//
if(i == size)
{
MY_LOGW("No ENQUE buf");
usleep(NO_ENQUE_WAIT_TIME);
return ret;
}
//
// (1) deque buffers from processor.
rpBufQueue->dequeProcessor(vQueNode);
if ( vQueNode.empty() ) {
MY_LOGW("vQueNode.empty()");
usleep(EMPTY_QUE_WAIT_TIME);
goto lbExit;
}
//
// (2) handle buffers dequed from processor.
ret = handleReturnBuffers(vQueNode);
lbExit:
//
MY_LOGD_IF(ENABLE_LOG_PER_FRAME, "- ret(%d)", ret);
return ret;
}
示例2: handleReturnBuffers
/******************************************************************************
* buffer can be reached either by client enque back buffer
* or by previewclient.
*******************************************************************************/
bool
PREFEATUREABSE::
waitAndHandleReturnBuffers(sp<IImgBufQueue>const& rpBufQueue, ImgBufQueNode &rQueNode)
{
bool ret = false;
Vector<ImgBufQueNode> vQueNode;
//
MY_LOGD_IF(ENABLE_LOG_PER_FRAME, "+");
//
// (1) wait and deque from processor
rpBufQueue->dequeProcessor(vQueNode);
if ( vQueNode.empty() )
{
ret = false;
MY_LOGD("Deque from processor is empty. Suppose stopProcessor has been called");
goto lbExit;
}
// (2) check vQueNode:
// - TODO or CANCEL
// - get and keep the latest one with TODO tag;
// - otherwise, return to processors
for (size_t i = 0; i < vQueNode.size(); i++)
{
if (vQueNode[i].isDONE() && vQueNode[i].getImgBuf() != 0)
{
if (rQueNode.getImgBuf() != 0 ) // already got
{
handleReturnBuffers(rpBufQueue, rQueNode);
}
rQueNode = vQueNode[i]; // update a latest one
ret = true;
}
else
{
handleReturnBuffers(rpBufQueue, vQueNode[i]);
}
}
lbExit:
//
MY_LOGD_IF(ENABLE_LOG_PER_FRAME, "-");
return ret;
}