Esempio n. 1
0
bool VideoDecoderVAAPIPrivate::setup(void **hwctx, AVPixelFormat *chroma, int w, int h)
{
    if (surface_width == w && surface_height == h) {
        *hwctx = &hw_ctx;
        *chroma = surface_chroma;
        return true;
    }
    *hwctx = NULL;
    //*chroma = QTAV_PIX_FMT_C(NONE);
    if (surface_width || surface_height)
        destroySurfaces();
    if (w > 0 && h > 0)
        return createSurfaces(hwctx, chroma, w, h);
    return false;
}
Esempio n. 2
0
void VideoDecoderVAAPIPrivate::close()
{
    restore();
    if (surface_width || surface_height)
        destroySurfaces();

    if (config_id != VA_INVALID_ID) {
        vaDestroyConfig(display, config_id);
        config_id = VA_INVALID_ID;
    }
    if (display) {
        vaTerminate(display);
        display = 0;
    }
    if (display_x11) {
        XCloseDisplay(display_x11);
        display_x11 = 0;
    }
}
void MakeCurrentPerfCase::deinit (void)
{
	destroyContexts();
	destroySurfaces();
}