当前位置: 首页>>代码示例>>C++>>正文


C++ DisplayPtr::getID方法代码示例

本文整理汇总了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;
}
开发者ID:TangXinT,项目名称:libyami,代码行数:30,代码来源:vaapiimage.cpp

示例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;

}
开发者ID:TangXinT,项目名称:libyami,代码行数:17,代码来源:vaapiimage.cpp

示例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);
    }
}
开发者ID:edgar1992,项目名称:libyami,代码行数:19,代码来源:vaapidecsurfacepool.cpp

示例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;
}
开发者ID:edgar1992,项目名称:libyami,代码行数:38,代码来源:vaapisurface.cpp

示例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;
}
开发者ID:01org,项目名称:libyami,代码行数:24,代码来源:vaapibuffer.cpp


注:本文中的DisplayPtr::getID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。