avutil/hwcontext_qsv: fix GCC 14.1 warnings

Tested-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: oltolm <oleg.tolmatcev@gmail.com>
(cherry picked from commit 45d31614bc)
release/6.1
oltolm 8 months ago committed by Timo Rothenpieler
parent e821e6c21d
commit c859363910
  1. 33
      libavutil/hwcontext_qsv.c

@ -36,6 +36,7 @@
#include "hwcontext_d3d11va.h" #include "hwcontext_d3d11va.h"
#endif #endif
#if CONFIG_DXVA2 #if CONFIG_DXVA2
#include <initguid.h>
#include "hwcontext_dxva2.h" #include "hwcontext_dxva2.h"
#endif #endif
@ -739,9 +740,11 @@ static int qsv_d3d9_update_config(void *ctx, mfxHDL handle, mfxConfig cfg)
#if CONFIG_DXVA2 #if CONFIG_DXVA2
mfxStatus sts; mfxStatus sts;
IDirect3DDeviceManager9* devmgr = handle; IDirect3DDeviceManager9* devmgr = handle;
IDirect3DDevice9Ex *device = NULL; IDirect3DDevice9 *device = NULL;
IDirect3DDevice9Ex *device_ex = NULL;
HANDLE device_handle = 0; HANDLE device_handle = 0;
IDirect3D9Ex *d3d9ex = NULL; IDirect3D9Ex *d3d9ex = NULL;
IDirect3D9 *d3d9 = NULL;
LUID luid; LUID luid;
D3DDEVICE_CREATION_PARAMETERS params; D3DDEVICE_CREATION_PARAMETERS params;
HRESULT hr; HRESULT hr;
@ -759,18 +762,31 @@ static int qsv_d3d9_update_config(void *ctx, mfxHDL handle, mfxConfig cfg)
IDirect3DDeviceManager9_CloseDeviceHandle(devmgr, device_handle); IDirect3DDeviceManager9_CloseDeviceHandle(devmgr, device_handle);
goto fail; goto fail;
} }
hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9Ex, (void **)&device_ex);
IDirect3DDevice9_Release(device);
if (FAILED(hr)) {
av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9_QueryInterface %d\n", hr);
goto unlock;
}
hr = IDirect3DDevice9Ex_GetCreationParameters(device, &params); hr = IDirect3DDevice9Ex_GetCreationParameters(device_ex, &params);
if (FAILED(hr)) { if (FAILED(hr)) {
av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9_GetCreationParameters %d\n", hr); av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9_GetCreationParameters %d\n", hr);
IDirect3DDevice9Ex_Release(device); IDirect3DDevice9Ex_Release(device_ex);
goto unlock; goto unlock;
} }
hr = IDirect3DDevice9Ex_GetDirect3D(device, &d3d9ex); hr = IDirect3DDevice9Ex_GetDirect3D(device_ex, &d3d9);
if (FAILED(hr)) { if (FAILED(hr)) {
av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9Ex_GetAdapterLUID %d\n", hr); av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9Ex_GetDirect3D %d\n", hr);
IDirect3DDevice9Ex_Release(device); IDirect3DDevice9Ex_Release(device_ex);
goto unlock;
}
hr = IDirect3D9_QueryInterface(d3d9, &IID_IDirect3D9Ex, (void **)&d3d9ex);
IDirect3D9_Release(d3d9);
if (FAILED(hr)) {
av_log(ctx, AV_LOG_ERROR, "Error IDirect3D9_QueryInterface3D %d\n", hr);
IDirect3DDevice9Ex_Release(device_ex);
goto unlock; goto unlock;
} }
@ -794,7 +810,7 @@ static int qsv_d3d9_update_config(void *ctx, mfxHDL handle, mfxConfig cfg)
release: release:
IDirect3D9Ex_Release(d3d9ex); IDirect3D9Ex_Release(d3d9ex);
IDirect3DDevice9Ex_Release(device); IDirect3DDevice9Ex_Release(device_ex);
unlock: unlock:
IDirect3DDeviceManager9_UnlockDevice(devmgr, device_handle, FALSE); IDirect3DDeviceManager9_UnlockDevice(devmgr, device_handle, FALSE);
@ -1334,8 +1350,9 @@ static int qsv_frames_derive_from(AVHWFramesContext *dst_ctx,
case AV_HWDEVICE_TYPE_D3D11VA: case AV_HWDEVICE_TYPE_D3D11VA:
{ {
D3D11_TEXTURE2D_DESC texDesc; D3D11_TEXTURE2D_DESC texDesc;
AVD3D11VAFramesContext *dst_hwctx;
dst_ctx->initial_pool_size = src_ctx->initial_pool_size; dst_ctx->initial_pool_size = src_ctx->initial_pool_size;
AVD3D11VAFramesContext *dst_hwctx = dst_ctx->hwctx; dst_hwctx = dst_ctx->hwctx;
dst_hwctx->texture_infos = av_calloc(src_hwctx->nb_surfaces, dst_hwctx->texture_infos = av_calloc(src_hwctx->nb_surfaces,
sizeof(*dst_hwctx->texture_infos)); sizeof(*dst_hwctx->texture_infos));
if (!dst_hwctx->texture_infos) if (!dst_hwctx->texture_infos)

Loading…
Cancel
Save