コード例 #1
0
ファイル: gl_hwdec_vaglx.c プロジェクト: muflax-scholars/mpv
static int load_image(struct gl_hwdec *hw, struct mp_image *hw_image,
                      GLuint *out_textures)
{
    struct priv *p = hw->priv;
    VAStatus status;

    if (!p->vaglx_surface)
        return -1;

    status = vaCopySurfaceGLX(p->display, p->vaglx_surface,
                              va_surface_id_in_mp_image(hw_image),
                              va_get_colorspace_flag(hw_image->colorspace));
    if (!check_va_status(status, "vaCopySurfaceGLX()"))
        return -1;

    out_textures[0] = p->gl_texture;
    return 0;
}
コード例 #2
0
ファイル: gl_hwdec_vaglx.c プロジェクト: LiminWang/mpv
static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image,
                     GLuint *out_textures)
{
    struct priv *p = hw->priv;
    VAStatus status;

    if (!p->vaglx_surface)
        return -1;

    va_lock(p->ctx);
    status = vaCopySurfaceGLX(p->display, p->vaglx_surface,
                              va_surface_id(hw_image),
                              va_get_colorspace_flag(hw_image->params.colorspace));
    va_unlock(p->ctx);
    if (!CHECK_VA_STATUS(p, "vaCopySurfaceGLX()"))
        return -1;

    out_textures[0] = p->gl_texture;
    return 0;
}
コード例 #3
0
ファイル: gl_hwdec_vaglx.c プロジェクト: c-14/mpv
static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image,
                     GLuint *out_textures)
{
    struct priv *p = hw->priv;
    VAStatus status;

    if (!p->pixmap)
        return -1;

    va_lock(p->ctx);
    status = vaPutSurface(p->display, va_surface_id(hw_image), p->pixmap,
                          0, 0, hw_image->w, hw_image->h,
                          0, 0, hw_image->w, hw_image->h,
                          NULL, 0,
                          va_get_colorspace_flag(hw_image->params.colorspace));
    CHECK_VA_STATUS(p, "vaPutSurface()");
    va_unlock(p->ctx);

    out_textures[0] = p->gl_texture;
    return 0;
}