本文整理汇总了C++中PicturePtr::getSurface方法的典型用法代码示例。如果您正苦于以下问题:C++ PicturePtr::getSurface方法的具体用法?C++ PicturePtr::getSurface怎么用?C++ PicturePtr::getSurface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PicturePtr
的用法示例。
在下文中一共展示了PicturePtr::getSurface方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: outputPicture
YamiStatus VaapiDecoderBase::outputPicture(const PicturePtr& picture)
{
//TODO: reorder poc
return m_surfacePool->output(picture->getSurface(),
picture->m_timeStamp)
? YAMI_SUCCESS
: YAMI_FAIL;
}
示例2:
void VaapiDecoderVP9::updateReference(const PicturePtr& picture, const Vp9FrameHdr* hdr)
{
uint8_t flag = 1;
uint8_t refresh_frame_flags;
if (hdr->frame_type == VP9_KEY_FRAME) {
refresh_frame_flags = 0xff;
} else {
refresh_frame_flags = hdr->refresh_frame_flags;
}
for (int i = 0; i < VP9_REF_FRAMES; i++) {
if (refresh_frame_flags & flag) {
m_reference[i] = picture->getSurface();
}
flag <<= 1;
}
}
示例3: outputPicture
Decode_Status VaapiDecoderVP9::decode(const Vp9FrameHdr* hdr, const uint8_t* data, uint32_t size, uint64_t timeStamp)
{
Decode_Status ret;
ret = ensureContext(hdr);
if (ret != DECODE_SUCCESS)
return ret;
PicturePtr picture = createPicture(timeStamp);
if (!picture)
return DECODE_MEMORY_FAIL;
if (!picture->getSurface()->resize(hdr->width, hdr->height)) {
ERROR("resize to %dx%d failed", hdr->width, hdr->height);
return DECODE_MEMORY_FAIL;
}
if (hdr->show_existing_frame) {
SurfacePtr& surface = m_reference[hdr->frame_to_show];
if (!surface) {
ERROR("frame to show is invalid, idx = %d", hdr->frame_to_show);
return DECODE_SUCCESS;
}
picture->setSurface(surface);
return outputPicture(picture);
}
if (!ensurePicture(picture, hdr))
return DECODE_FAIL;
if (!ensureSlice(picture, data, size))
return DECODE_FAIL;
ret = picture->decode();
if (ret != DECODE_SUCCESS)
return ret;
updateReference(picture, hdr);
if (hdr->show_frame)
return outputPicture(picture);
return DECODE_SUCCESS;
}