<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello,<div><br></div><div>I'm using ffmpeg to decode mp4 videos in hwaccel mode with d3d11va and I'm trying to draw the decoded surface (NV12 format) to the screen using DX11, without copying the surface to CPU and upload again to another texture. For this I need to add D3D11_BIND_SHADER_RESOURCE to hw_frames_ctx->hwctx->BindFlags. These flags are used to create the internal Texture2DArray with all the surfaces needed to decode by ffmpeg, but I can't find a way to do it without modifying ffmpeg source code.</div><div><br></div><div>The way I modify ffmpeg is removing the const qualifier to the declaration and definition of the ff_hwcontext_type_d3d11va struct in hwcontext_d3d11va.c and hwcontext_internal.h, so in my user code I can change all the hooks, in particular "frames_init" function pointer to a custom function that add the D3D11_BIND_SHADER_RESOURCE to the BindFlags and then calls the original d3d11va_frames_init function.</div><div><br></div><div>I'm not sure if there is any other better way to do this. Does anyone knows something that can be useful?</div><div><br></div><div>Thank you in advance, have a nice weekend.</div><div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br><img src="http://storage.googleapis.com/provisioning/golden-race-logo-bw.png" width="210"><br><b>Benjamín de la Fuente </b>• <b>3D Senior Programmer</b><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>