本文整理汇总了C++中sp::dequeueBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ sp::dequeueBuffer方法的具体用法?C++ sp::dequeueBuffer怎么用?C++ sp::dequeueBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp
的用法示例。
在下文中一共展示了sp::dequeueBuffer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepareBuffer
status_t GuiExtPoolItem::prepareBuffer(sp<IGraphicBufferProducer> producer, uint32_t usage, uint32_t type, uint32_t gralloc_usage, uint32_t bufNum)
{
status_t err = NO_ERROR;
uint32_t usg = (gralloc_usage & GRALLOC_USAGE_SECURE) != 0 ? (LOCK_FOR_USAGE | GRALLOC_USAGE_SECURE) : LOCK_FOR_USAGE;
uint32_t fmt = gAcquiredFormat[usage];
GUIEXT_LOGV("prepareBuffer, type=%d, fmt=%x, usage=%x, usg=%x, bufNum=%d", usage, fmt, gralloc_usage, usg, bufNum);
for (uint32_t i = 0; i < bufNum; i++) {
int buf = -1;
sp<Fence> fence;
producer->dequeueBuffer(&buf, &fence, false, 0, 0, fmt, usg);
uint32_t combine_id = POOL_COMBINED_ID(usage, type, i);
sp<ConsumerSlot> consumerSlot = mConsumerList.valueFor(combine_id);
if (consumerSlot == 0) {
sp<ConsumerSlot> slot = new ConsumerSlot();
slot->token = NULL;
slot->pid = -1;
slot->usage = usage;
slot->type = type;
slot->idx = i;
mConsumerList.add(combine_id, slot);
}
#ifdef TOUCH_ION_BUFFER
sp<GraphicBuffer> gb;
producer->requestBuffer(buf, &gb);
touchIonBuffer(gb);
#endif
}
for (uint32_t i = 0; i < bufNum; i++) {
sp<Fence> fence = Fence::NO_FENCE;
producer->cancelBuffer(i, fence);
}
return err;
}
示例2: Flip
STDMETHODIMP CGfxAndroidISurfOverlay::Flip(LONG num, DWORD dwFlags)
{
if (m_isurface == NULL) return E_FAIL;
if(!m_bShow) return S_OK;
if(num >= ISURFACEOVL_BACKBUFF_NUM) return E_INVALIDARG;
EnterCriticalSection(&m_csDisplay);
overlay_buffer_t buf = (overlay_buffer_t)&mOverlayBuffer[num];
if(dwFlags == GFXOVERLAY_FLIP_FIXED)
mOverlayBuffer[num].vaddr = m_pBuffStraight;
else
mOverlayBuffer[num].vaddr = m_pBuff[num];
mOverlayBuffer[num].time.tv_sec = -1;
mOverlayBuffer[num].time.tv_usec = -1;
m_pOverlay->queueBuffer(buf);
m_pOverlay->dequeueBuffer(&buf);
LeaveCriticalSection(&m_csDisplay);
return S_OK;
}