mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
d3d11: move code for d3d11eglrgb hack
This commit is contained in:
parent
7e87feaf15
commit
9345964bad
@ -119,6 +119,9 @@ static void d3d11_complete_image_params(struct mp_image *img)
|
|||||||
// According to hwcontex_d3d11va.h, this means DXGI_FORMAT_420_OPAQUE.
|
// According to hwcontex_d3d11va.h, this means DXGI_FORMAT_420_OPAQUE.
|
||||||
img->params.hw_flags = hw_frames->sw_format == AV_PIX_FMT_YUV420P
|
img->params.hw_flags = hw_frames->sw_format == AV_PIX_FMT_YUV420P
|
||||||
? MP_IMAGE_HW_FLAG_OPAQUE : 0;
|
? MP_IMAGE_HW_FLAG_OPAQUE : 0;
|
||||||
|
|
||||||
|
if (img->params.hw_subfmt == IMGFMT_NV12)
|
||||||
|
mp_image_setfmt(img, IMGFMT_D3D11NV12);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct hwcontext_fns hwcontext_fns_d3d11 = {
|
const struct hwcontext_fns hwcontext_fns_d3d11 = {
|
||||||
|
@ -78,22 +78,12 @@ static struct mp_hwdec_ctx *d3d11_create_dev(struct mpv_global *global,
|
|||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mp_image *d3d11_update_image_attribs(struct lavc_ctx *s,
|
|
||||||
struct mp_image *img)
|
|
||||||
{
|
|
||||||
if (img->params.hw_subfmt == IMGFMT_NV12)
|
|
||||||
mp_image_setfmt(img, IMGFMT_D3D11NV12);
|
|
||||||
|
|
||||||
return img;
|
|
||||||
}
|
|
||||||
|
|
||||||
const struct vd_lavc_hwdec mp_vd_lavc_d3d11va = {
|
const struct vd_lavc_hwdec mp_vd_lavc_d3d11va = {
|
||||||
.type = HWDEC_D3D11VA,
|
.type = HWDEC_D3D11VA,
|
||||||
.image_format = IMGFMT_D3D11VA,
|
.image_format = IMGFMT_D3D11VA,
|
||||||
.generic_hwaccel = true,
|
.generic_hwaccel = true,
|
||||||
.set_hwframes = true,
|
.set_hwframes = true,
|
||||||
.hwframes_refine = d3d_hwframes_refine,
|
.hwframes_refine = d3d_hwframes_refine,
|
||||||
.process_image = d3d11_update_image_attribs,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct vd_lavc_hwdec mp_vd_lavc_d3d11va_copy = {
|
const struct vd_lavc_hwdec mp_vd_lavc_d3d11va_copy = {
|
||||||
|
Loading…
Reference in New Issue
Block a user