From: Dmitrii Ovchinnikov via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: Dmitrii Ovchinnikov <code@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH] avutil/hwcontext_d3d11va: added resource and heap flags to DeviceContext (PR #20659) Date: Tue, 07 Oct 2025 14:36:30 -0000 Message-ID: <175984779084.65.16228515567393645419@bf249f23a2c8> (raw) PR #20659 opened by Dmitrii Ovchinnikov (OvchinnikovDmitrii) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20659 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20659.patch >From 06c3e466890b71232e36f1859fe64bcb2dc33476 Mon Sep 17 00:00:00 2001 From: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com> Date: Tue, 7 Oct 2025 16:12:42 +0200 Subject: [PATCH] avutil/hwcontext_d3d11va: added resource and heap flags to DeviceContext --- doc/APIchanges | 3 +++ libavutil/hwcontext_d3d11va.c | 15 +++++++++++++++ libavutil/hwcontext_d3d11va.h | 14 ++++++++++++++ libavutil/version.h | 2 +- 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 6e7f5d2037..5e2068767e 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28 API changes, most recent first: +2025-10-xx - xxxxxxxxxx - lavu 60.14.100 - hwcontext_d3d11va.h + Add BindFlags and MiscFlags to AVD3D11VADeviceContext + 2025-08-xx - xxxxxxxxxx - lavf 62.6.100 - oggparsevorbis.h oggparseopus.h oggparseflac.h Drop header packets from secondary chained ogg/{flac, opus, vorbis} streams from demuxer output. diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c index 83414ad0d4..418fe9dfda 100644 --- a/libavutil/hwcontext_d3d11va.c +++ b/libavutil/hwcontext_d3d11va.c @@ -290,6 +290,9 @@ static int d3d11va_frames_init(AVHWFramesContext *ctx) return AVERROR(EINVAL); } + hwctx->BindFlags |= device_hwctx->BindFlags; + hwctx->MiscFlags |= device_hwctx->MiscFlags; + ctx->initial_pool_size = FFMIN(ctx->initial_pool_size, MAX_ARRAY_SIZE); texDesc = (D3D11_TEXTURE2D_DESC){ @@ -710,6 +713,18 @@ static int d3d11va_device_create(AVHWDeviceContext *ctx, const char *device, } #endif + if (av_dict_get(opts, "SHADER", NULL, 0)) + device_hwctx->BindFlags |= D3D11_BIND_SHADER_RESOURCE; + + if (av_dict_get(opts, "UAV", NULL, 0)) + device_hwctx->BindFlags |= D3D11_BIND_UNORDERED_ACCESS; + + if (av_dict_get(opts, "RTV", NULL, 0)) + device_hwctx->BindFlags |= D3D11_BIND_RENDER_TARGET; + + if (av_dict_get(opts, "SHARED", NULL, 0)) + device_hwctx->MiscFlags |= D3D11_RESOURCE_MISC_SHARED; + return 0; } diff --git a/libavutil/hwcontext_d3d11va.h b/libavutil/hwcontext_d3d11va.h index 77d2d72f1b..b87b1e8fa2 100644 --- a/libavutil/hwcontext_d3d11va.h +++ b/libavutil/hwcontext_d3d11va.h @@ -94,6 +94,20 @@ typedef struct AVD3D11VADeviceContext { void (*lock)(void *lock_ctx); void (*unlock)(void *lock_ctx); void *lock_ctx; + /** + * D3D11_TEXTURE2D_DESC.BindFlags to be applied to D3D11 resources allocated + * for frames using this device context. + * + * It applies globally to all AVD3D11VAFramesContext allocated from this device context. + */ + UINT BindFlags; + /** + * D3D11_TEXTURE2D_DESC.MiscFlags to be applied to D3D11 resources allocated + * for frames using this device context. + * + * It applies globally to all AVD3D11VAFramesContext allocated from this device context. + */ + UINT MiscFlags; } AVD3D11VADeviceContext; /** diff --git a/libavutil/version.h b/libavutil/version.h index 1099715076..176b99aef3 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 60 -#define LIBAVUTIL_VERSION_MINOR 13 +#define LIBAVUTIL_VERSION_MINOR 14 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2025-10-07 14:37 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=175984779084.65.16228515567393645419@bf249f23a2c8 \ --to=ffmpeg-devel@ffmpeg.org \ --cc=code@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror http://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ http://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git