Esempio n. 1
0
SharedPtr<VideoFrame> VaapiDecoderBase::getOutput()
{
    SharedPtr<VideoFrame> frame;
    DecSurfacePoolPtr pool = m_surfacePool;
    if (!pool)
        return frame;
    VideoRenderBuffer *buffer = pool->getOutput();
    if (buffer) {
        frame.reset(new VideoFrame, BufferRecycler(pool, buffer));
        frame->surface = (intptr_t)buffer->surface;
        frame->timeStamp = buffer->timeStamp;
        frame->crop.x = 0;
        frame->crop.y = 0;
        frame->crop.width = m_videoFormatInfo.width;
        frame->crop.height = m_videoFormatInfo.height;
    }
    return frame;
}
Esempio n. 2
0
SharedPtr<VideoFrame> VaapiDecoderBase::getOutput()
{
    SharedPtr<VideoFrame> frame;
    DecSurfacePoolPtr pool = m_surfacePool;
    if (!pool)
        return frame;
    VideoRenderBuffer *buffer = pool->getOutput();
    if (buffer) {
        frame.reset(new VideoFrame, BufferRecycler(pool, buffer));
        memset(frame.get(), 0, sizeof(VideoFrame));
        frame->surface = (intptr_t)buffer->surface;
        frame->timeStamp = buffer->timeStamp;
        frame->crop.x = 0;
        frame->crop.y = 0;
        frame->crop.width = m_videoFormatInfo.width;
        frame->crop.height = m_videoFormatInfo.height;
        //TODO: get fourcc directly from surface allocator
        frame->fourcc = YAMI_FOURCC_NV12;
    }
    return frame;
}