* [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK.
@ 2025-05-30 13:58 Dmitrii Ovchinnikov
2025-05-30 13:58 ` [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_amf: add support for d3d12va initialisation Dmitrii Ovchinnikov
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dmitrii Ovchinnikov @ 2025-05-30 13:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Dmitrii Ovchinnikov
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index a1f483f02c..b9de840ec2 100755
--- a/configure
+++ b/configure
@@ -7476,7 +7476,7 @@ fi
enabled amf &&
check_cpp_condition amf "AMF/core/Version.h" \
- "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400230000"
+ "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400240000"
# Funny iconv installations are not unusual, so check it after all flags have been set
if enabled libc_iconv; then
--
2.47.1.windows.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_amf: add support for d3d12va initialisation
2025-05-30 13:58 [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK Dmitrii Ovchinnikov
@ 2025-05-30 13:58 ` Dmitrii Ovchinnikov
2025-05-30 13:58 ` [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_amf: fix error logging on amf_init_from_device Dmitrii Ovchinnikov
2025-06-06 12:01 ` [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK Zhao Zhili
2 siblings, 0 replies; 5+ messages in thread
From: Dmitrii Ovchinnikov @ 2025-05-30 13:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Dmitrii Ovchinnikov
---
libavutil/hwcontext_amf.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/libavutil/hwcontext_amf.c b/libavutil/hwcontext_amf.c
index 24731c20ec..7903109445 100644
--- a/libavutil/hwcontext_amf.c
+++ b/libavutil/hwcontext_amf.c
@@ -28,6 +28,9 @@
#if CONFIG_D3D11VA
#include "libavutil/hwcontext_d3d11va.h"
#endif
+#if CONFIG_D3D12VA
+#include "libavutil/hwcontext_d3d12va.h"
+#endif
#if CONFIG_DXVA2
#define COBJMACROS
#include "libavutil/hwcontext_dxva2.h"
@@ -146,6 +149,9 @@ static const enum AVPixelFormat supported_formats[] = {
#if CONFIG_D3D11VA
AV_PIX_FMT_D3D11,
#endif
+#if CONFIG_D3D12VA
+ AV_PIX_FMT_D3D12,
+#endif
#if CONFIG_DXVA2
AV_PIX_FMT_DXVA2_VLD,
#endif
@@ -555,10 +561,33 @@ static int amf_init_from_d3d11_device(AVAMFDeviceContext* amf_ctx, AVD3D11VADevi
av_log(hwctx, AV_LOG_ERROR, "AMF failed to initialise on the given D3D11 device: %d.\n", res);
return AVERROR(ENODEV);
}
+ av_log(hwctx, AV_LOG_ERROR, "AMF via D3D11");
return 0;
}
#endif
+#if CONFIG_D3D12VA
+static int amf_init_from_d3d12_device(AVAMFDeviceContext* amf_ctx, AVD3D12VADeviceContext *hwctx)
+{
+ AMF_RESULT res;
+ AMFContext2 *context2 = NULL;
+ AMFGuid guid = IID_AMFContext2();
+ res = amf_ctx->context->pVtbl->QueryInterface(amf_ctx->context, &guid, (void**)&context2);
+ AMF_RETURN_IF_FALSE(hwctx, res == AMF_OK, AVERROR_UNKNOWN, "CreateContext2() failed with error %d\n", res);
+ res = context2->pVtbl->InitDX12(context2, hwctx->device, AMF_DX12);
+ context2->pVtbl->Release(context2);
+ if (res != AMF_OK && res != AMF_ALREADY_INITIALIZED) {
+ if (res == AMF_NOT_SUPPORTED)
+ av_log(hwctx, AV_LOG_ERROR, "AMF via D3D12 is not supported on the given device.\n");
+ else
+ av_log(hwctx, AV_LOG_ERROR, "AMF failed to initialise on the given D3D12 device: %d.\n", res);
+ return AVERROR(ENODEV);
+ }
+ return 0;
+}
+#endif
+
+
static int amf_device_derive(AVHWDeviceContext *device_ctx,
AVHWDeviceContext *child_device_ctx, AVDictionary *opts,
int flags)
@@ -588,6 +617,13 @@ static int amf_device_derive(AVHWDeviceContext *device_ctx,
return amf_init_from_d3d11_device(amf_ctx, child_device_hwctx);
}
break;
+#endif
+#if CONFIG_D3D12VA
+ case AV_HWDEVICE_TYPE_D3D12VA: {
+ AVD3D12VADeviceContext *child_device_hwctx = child_device_ctx->hwctx;
+ return amf_init_from_d3d12_device(amf_ctx, child_device_hwctx);
+ }
+ break;
#endif
default: {
av_log(child_device_ctx, AV_LOG_ERROR, "AMF initialisation from a %s device is not supported.\n",
--
2.47.1.windows.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_amf: fix error logging on amf_init_from_device.
2025-05-30 13:58 [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK Dmitrii Ovchinnikov
2025-05-30 13:58 ` [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_amf: add support for d3d12va initialisation Dmitrii Ovchinnikov
@ 2025-05-30 13:58 ` Dmitrii Ovchinnikov
2025-06-06 12:01 ` [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK Zhao Zhili
2 siblings, 0 replies; 5+ messages in thread
From: Dmitrii Ovchinnikov @ 2025-05-30 13:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Dmitrii Ovchinnikov
---
libavutil/hwcontext_amf.c | 40 ++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/libavutil/hwcontext_amf.c b/libavutil/hwcontext_amf.c
index 7903109445..a020b0e2e1 100644
--- a/libavutil/hwcontext_amf.c
+++ b/libavutil/hwcontext_amf.c
@@ -505,8 +505,9 @@ static int amf_device_create(AVHWDeviceContext *device_ctx,
}
#if CONFIG_DXVA2
-static int amf_init_from_dxva2_device(AVAMFDeviceContext * amf_ctx, AVDXVA2DeviceContext *hwctx)
+static int amf_init_from_dxva2_device(AVAMFDeviceContext * amf_ctx, AVHWDeviceContext *child_device_ctx)
{
+ AVDXVA2DeviceContext *hwctx = child_device_ctx->hwctx;
IDirect3DDevice9 *device;
HANDLE device_handle;
HRESULT hr;
@@ -515,7 +516,7 @@ static int amf_init_from_dxva2_device(AVAMFDeviceContext * amf_ctx, AVDXVA2Devic
hr = IDirect3DDeviceManager9_OpenDeviceHandle(hwctx->devmgr, &device_handle);
if (FAILED(hr)) {
- av_log(hwctx, AV_LOG_ERROR, "Failed to open device handle for Direct3D9 device: %lx.\n", (unsigned long)hr);
+ av_log(child_device_ctx, AV_LOG_ERROR, "Failed to open device handle for Direct3D9 device: %lx.\n", (unsigned long)hr);
return AVERROR_EXTERNAL;
}
@@ -524,7 +525,7 @@ static int amf_init_from_dxva2_device(AVAMFDeviceContext * amf_ctx, AVDXVA2Devic
IDirect3DDeviceManager9_UnlockDevice(hwctx->devmgr, device_handle, FALSE);
ret = 0;
} else {
- av_log(hwctx, AV_LOG_ERROR, "Failed to lock device handle for Direct3D9 device: %lx.\n", (unsigned long)hr);
+ av_log(child_device_ctx, AV_LOG_ERROR, "Failed to lock device handle for Direct3D9 device: %lx.\n", (unsigned long)hr);
ret = AVERROR_EXTERNAL;
}
@@ -540,49 +541,53 @@ static int amf_init_from_dxva2_device(AVAMFDeviceContext * amf_ctx, AVDXVA2Devic
if (res != AMF_OK && res != AMF_ALREADY_INITIALIZED) {
if (res == AMF_NOT_SUPPORTED)
- av_log(hwctx, AV_LOG_ERROR, "AMF via D3D9 is not supported on the given device.\n");
+ av_log(child_device_ctx, AV_LOG_ERROR, "AMF via D3D9 is not supported on the given device.\n");
else
- av_log(hwctx, AV_LOG_ERROR, "AMF failed to initialise on given D3D9 device: %d.\n", res);
+ av_log(child_device_ctx, AV_LOG_ERROR, "AMF failed to initialise on given D3D9 device: %d.\n", res);
return AVERROR(ENODEV);
}
+ av_log(child_device_ctx, AV_LOG_INFO, "AMF via DXVA2.\n");
return 0;
}
#endif
#if CONFIG_D3D11VA
-static int amf_init_from_d3d11_device(AVAMFDeviceContext* amf_ctx, AVD3D11VADeviceContext *hwctx)
+static int amf_init_from_d3d11_device(AVAMFDeviceContext* amf_ctx, AVHWDeviceContext *child_device_ctx)
{
AMF_RESULT res;
+ AVD3D11VADeviceContext *hwctx = child_device_ctx->hwctx;
res = amf_ctx->context->pVtbl->InitDX11(amf_ctx->context, hwctx->device, AMF_DX11_1);
if (res != AMF_OK && res != AMF_ALREADY_INITIALIZED) {
if (res == AMF_NOT_SUPPORTED)
- av_log(hwctx, AV_LOG_ERROR, "AMF via D3D11 is not supported on the given device.\n");
+ av_log(child_device_ctx, AV_LOG_ERROR, "AMF via D3D11 is not supported on the given device.\n");
else
- av_log(hwctx, AV_LOG_ERROR, "AMF failed to initialise on the given D3D11 device: %d.\n", res);
+ av_log(child_device_ctx, AV_LOG_ERROR, "AMF failed to initialise on the given D3D11 device: %d.\n", res);
return AVERROR(ENODEV);
}
- av_log(hwctx, AV_LOG_ERROR, "AMF via D3D11");
+ av_log(child_device_ctx, AV_LOG_INFO, "AMF via D3D11.\n");
return 0;
}
#endif
#if CONFIG_D3D12VA
-static int amf_init_from_d3d12_device(AVAMFDeviceContext* amf_ctx, AVD3D12VADeviceContext *hwctx)
+static int amf_init_from_d3d12_device(AVAMFDeviceContext* amf_ctx, AVHWDeviceContext *child_device_ctx)
{
+ AVD3D12VADeviceContext *hwctx = child_device_ctx->hwctx;
AMF_RESULT res;
AMFContext2 *context2 = NULL;
AMFGuid guid = IID_AMFContext2();
res = amf_ctx->context->pVtbl->QueryInterface(amf_ctx->context, &guid, (void**)&context2);
- AMF_RETURN_IF_FALSE(hwctx, res == AMF_OK, AVERROR_UNKNOWN, "CreateContext2() failed with error %d\n", res);
+ AMF_RETURN_IF_FALSE(child_device_ctx, res == AMF_OK, AVERROR_UNKNOWN, "CreateContext2() failed with error %d\n", res);
res = context2->pVtbl->InitDX12(context2, hwctx->device, AMF_DX12);
context2->pVtbl->Release(context2);
if (res != AMF_OK && res != AMF_ALREADY_INITIALIZED) {
if (res == AMF_NOT_SUPPORTED)
- av_log(hwctx, AV_LOG_ERROR, "AMF via D3D12 is not supported on the given device.\n");
+ av_log(child_device_ctx, AV_LOG_ERROR, "AMF via D3D12 is not supported on the given device.\n");
else
- av_log(hwctx, AV_LOG_ERROR, "AMF failed to initialise on the given D3D12 device: %d.\n", res);
+ av_log(child_device_ctx, AV_LOG_ERROR, "AMF failed to initialise on the given D3D12 device: %d.\n", res);
return AVERROR(ENODEV);
}
+ av_log(child_device_ctx, AV_LOG_INFO, "AMF via D3D12.\n");
return 0;
}
#endif
@@ -605,23 +610,20 @@ static int amf_device_derive(AVHWDeviceContext *device_ctx,
#if CONFIG_DXVA2
case AV_HWDEVICE_TYPE_DXVA2: {
- AVDXVA2DeviceContext *child_device_hwctx = child_device_ctx->hwctx;
- return amf_init_from_dxva2_device(amf_ctx, child_device_hwctx);
+ return amf_init_from_dxva2_device(amf_ctx, child_device_ctx);
}
break;
#endif
#if CONFIG_D3D11VA
case AV_HWDEVICE_TYPE_D3D11VA: {
- AVD3D11VADeviceContext *child_device_hwctx = child_device_ctx->hwctx;
- return amf_init_from_d3d11_device(amf_ctx, child_device_hwctx);
+ return amf_init_from_d3d11_device(amf_ctx, child_device_ctx);
}
break;
#endif
#if CONFIG_D3D12VA
case AV_HWDEVICE_TYPE_D3D12VA: {
- AVD3D12VADeviceContext *child_device_hwctx = child_device_ctx->hwctx;
- return amf_init_from_d3d12_device(amf_ctx, child_device_hwctx);
+ return amf_init_from_d3d12_device(amf_ctx, child_device_ctx);
}
break;
#endif
--
2.47.1.windows.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK.
2025-05-30 13:58 [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK Dmitrii Ovchinnikov
2025-05-30 13:58 ` [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_amf: add support for d3d12va initialisation Dmitrii Ovchinnikov
2025-05-30 13:58 ` [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_amf: fix error logging on amf_init_from_device Dmitrii Ovchinnikov
@ 2025-06-06 12:01 ` Zhao Zhili
2025-06-06 12:21 ` Dmitrii Ovchinnikov
2 siblings, 1 reply; 5+ messages in thread
From: Zhao Zhili @ 2025-06-06 12:01 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On May 30, 2025, at 21:58, Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com> wrote:
>
> ---
> configure | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index a1f483f02c..b9de840ec2 100755
> --- a/configure
> +++ b/configure
> @@ -7476,7 +7476,7 @@ fi
>
> enabled amf &&
> check_cpp_condition amf "AMF/core/Version.h" \
> - "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400230000"
> + "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400240000"
1.4.36 was just released in Apr 30, so does AMF always require the latest version?
https://github.com/GPUOpen-LibrariesAndSDKs/AMF/releases
>
> # Funny iconv installations are not unusual, so check it after all flags have been set
> if enabled libc_iconv; then
> --
> 2.47.1.windows.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK.
2025-06-06 12:01 ` [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK Zhao Zhili
@ 2025-06-06 12:21 ` Dmitrii Ovchinnikov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitrii Ovchinnikov @ 2025-06-06 12:21 UTC (permalink / raw)
To: FFmpeg development discussions and patches
>
>
> AMF doesn't always require the latest version,
however, since the library is under active development, I periodically
update it before integrating newly added features.
Without updating the header version, some defines (such as names of new
parameters) are unavailable.
For the user, everything remains backward compatible, as this only affects
the FFmpeg build process itself.
--
Sincerely, Ovchinnikov D.A.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-06-06 12:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-30 13:58 [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK Dmitrii Ovchinnikov
2025-05-30 13:58 ` [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_amf: add support for d3d12va initialisation Dmitrii Ovchinnikov
2025-05-30 13:58 ` [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_amf: fix error logging on amf_init_from_device Dmitrii Ovchinnikov
2025-06-06 12:01 ` [FFmpeg-devel] [PATCH 1/3] amfenc: Update the min version to 1.4.36.0 for AMF SDK Zhao Zhili
2025-06-06 12:21 ` Dmitrii Ovchinnikov
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 https://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/ https://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