本文整理汇总了C++中DisplayPtr::getID方法的典型用法代码示例。如果您正苦于以下问题:C++ DisplayPtr::getID方法的具体用法?C++ DisplayPtr::getID怎么用?C++ DisplayPtr::getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DisplayPtr
的用法示例。
在下文中一共展示了DisplayPtr::getID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
ImageRawPtr VaapiImageRaw::create(const DisplayPtr& display, const ImagePtr& image, VideoDataMemoryType memoryType)
{
ImageRawPtr raw;
RealeaseCallback release;
uintptr_t handle;
VAStatus status;
VAImagePtr& vaImage = image->m_image;
if (memoryType == VIDEO_DATA_MEMORY_TYPE_RAW_POINTER || memoryType == VIDEO_DATA_MEMORY_TYPE_RAW_COPY) {
void* data;
status = vaMapBuffer(display->getID(), vaImage->buf, &data);
release = vaUnmapBuffer;
handle = (uintptr_t)data;
} else {
VABufferInfo bufferInfo;
if (memoryType == VIDEO_DATA_MEMORY_TYPE_DRM_NAME)
bufferInfo.mem_type = VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM;
else if (memoryType == VIDEO_DATA_MEMORY_TYPE_DMA_BUF)
bufferInfo.mem_type = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME;
else
ASSERT(0);
status = vaAcquireBufferHandle(display->getID(), vaImage->buf, &bufferInfo);
release = vaReleaseBufferHandle;
handle = (uintptr_t)bufferInfo.handle;
}
if (!checkVaapiStatus(status, "VaapiImageRaw::create()"))
return raw;
raw.reset(new VaapiImageRaw(display, image, memoryType, handle, release));
return raw;
}
示例2: derive
ImagePtr VaapiImage::derive(const SurfacePtr& surface)
{
ImagePtr image;
if (!surface)
return image;
DisplayPtr display = surface->getDisplay();
VAImagePtr vaImage(new VAImage);
VAStatus status = vaDeriveImage(display->getID(), surface->getID(), vaImage.get());
if (!checkVaapiStatus(status, "vaDeriveImage()")) {
return image;
}
image.reset(new VaapiImage(display, surface, vaImage));
return image;
}
示例3:
VaapiDecSurfacePool::VaapiDecSurfacePool(const DisplayPtr& display, std::vector<SurfacePtr> surfaces):
m_cond(m_lock),
m_flushing(false)
{
size_t size = surfaces.size();
m_surfaces.swap(surfaces);
m_renderBuffers.resize(size);
for (size_t i = 0; i < size; ++i) {
const SurfacePtr& s = m_surfaces[i];
VASurfaceID id = m_surfaces[i]->getID();
m_renderBuffers[i].display = display->getID();
m_renderBuffers[i].surface = id;
m_renderBuffers[i].timeStamp = 0;
m_renderMap[id] = &m_renderBuffers[i];
m_surfaceMap[id] = s.get();
m_freed.push_back(id);
}
}
示例4: create
SurfacePtr VaapiSurface::create(const DisplayPtr& display,
VaapiChromaType chromaType,
uint32_t width,
uint32_t height,
void *surfAttribArray,
uint32_t surfAttribNum)
{
VAStatus status;
uint32_t format, i;
VASurfaceAttrib *surfAttribs = (VASurfaceAttrib *) surfAttribArray;
SurfacePtr surface;
VASurfaceID id;
assert((surfAttribs && surfAttribNum)
|| (!surfAttribs && !surfAttribNum));
format = vaapiChromaToVaChroma(chromaType);
uint32_t externalBufHandle = 0;
status = vaCreateSurfaces(display->getID(), format, width, height,
&id, 1, surfAttribs, surfAttribNum);
if (!checkVaapiStatus(status, "vaCreateSurfacesWithAttribute()"))
return surface;
for (int i = 0; i < surfAttribNum; i++) {
if (surfAttribs[i].type == VASurfaceAttribExternalBufferDescriptor) {
VASurfaceAttribExternalBuffers *surfAttribExtBuf
=
(VASurfaceAttribExternalBuffers *) surfAttribs[i].value.
value.p;
externalBufHandle = surfAttribExtBuf->buffers[0];
break;
}
}
surface.reset(new VaapiSurface(display, id, chromaType,
width, height,externalBufHandle));
return surface;
}
示例5: create
BufObjectPtr VaapiBufObject::create(const ContextPtr& context,
VABufferType bufType,
uint32_t size,
const void *data, void **mapped_data)
{
BufObjectPtr buf;
if (size == 0) {
ERROR("buffer size is zero");
return buf;
}
DisplayPtr display = context->getDisplay();
VABufferID bufID;
if (!vaapiCreateBuffer(display->getID(), context->getID(),
bufType, size, data, &bufID, mapped_data)) {
ERROR("create buffer failed");
return buf;
}
void *mapped = mapped_data ? *mapped_data : NULL;
buf.reset(new VaapiBufObject(display, bufID, mapped, size));
return buf;
}