1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-03 13:32:16 +00:00

vd_lavc: restore --hwdec-image-format and d3d11 opaque mode

When the ifdeffery for the frame_params API was added, the new code
accidentally didn't include this.
This commit is contained in:
wm4 2017-11-02 15:53:22 +01:00
parent 09c61347a8
commit ff17760c00
2 changed files with 6 additions and 1 deletions

View File

@ -87,7 +87,10 @@ void d3d_hwframes_refine(struct lavc_ctx *ctx, AVBufferRef *hw_frames_ctx)
if (fctx->format == AV_PIX_FMT_D3D11) { if (fctx->format == AV_PIX_FMT_D3D11) {
AVD3D11VAFramesContext *hwctx = fctx->hwctx; AVD3D11VAFramesContext *hwctx = fctx->hwctx;
hwctx->BindFlags |= D3D11_BIND_SHADER_RESOURCE; // According to hwcontex_d3d11va.h, yuv420p means DXGI_FORMAT_420_OPAQUE,
// which has no shader support.
if (fctx->sw_format != AV_PIX_FMT_YUV420P)
hwctx->BindFlags |= D3D11_BIND_SHADER_RESOURCE;
} }
} }

View File

@ -725,6 +725,8 @@ static int init_generic_hwaccel(struct dec_video *vd, enum AVPixelFormat hw_fmt)
if (hwdec->image_format == IMGFMT_VIDEOTOOLBOX) if (hwdec->image_format == IMGFMT_VIDEOTOOLBOX)
new_fctx->sw_format = imgfmt2pixfmt(vd->opts->videotoolbox_format); new_fctx->sw_format = imgfmt2pixfmt(vd->opts->videotoolbox_format);
if (vd->opts->hwdec_image_format)
new_fctx->sw_format = imgfmt2pixfmt(vd->opts->hwdec_image_format);
// The video output might not support all formats. // The video output might not support all formats.
// Note that supported_formats==NULL means any are accepted. // Note that supported_formats==NULL means any are accepted.