Exemplo n.º 1
0
ImageRawPtr VaapiImage::map(VideoDataMemoryType memoryType)
{
    ImageRawPtr raw = m_rawImage.lock();
    if (raw) {
        if (raw->getMemoryType() != memoryType) {
            ERROR("map image to different memory type, wanted %d, mapped = %d", memoryType, raw->getMemoryType());
            raw.reset();
        }
        return raw;
    }
    raw = VaapiImageRaw::create(m_display, shared_from_this(), memoryType);
    m_rawImage = raw;
    return raw;
}
Exemplo n.º 2
0
ImageRawPtr mapVaapiImage(ImagePtr img, VideoDataMemoryType memoryType)
{
    ImageRawPtr raw = img->m_rawImage.lock();
    if (raw) {
        if (raw->getMemoryType() != memoryType) {
            ERROR("map image to different memory type, wanted %d, mapped = %d", memoryType, raw->getMemoryType());
            raw.reset();
        }
        return raw;
    }
    raw = VaapiImageRaw::create(img->m_display, img, memoryType);
    img->m_rawImage = raw;
    return raw;
}