You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
dxva: fix some warnings
Some existed since forever, some are new. The cast in get_surface() is silly, but unless we change the av_log function signature, or all callers of ff_dxva2_get_surface_index(), it's needed to remove the const warning. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
@@ -359,7 +359,6 @@ static int d3d11va_get_decoder_configuration(AVCodecContext *avctx,
|
|||||||
const D3D11_VIDEO_DECODER_DESC *desc,
|
const D3D11_VIDEO_DECODER_DESC *desc,
|
||||||
D3D11_VIDEO_DECODER_CONFIG *config)
|
D3D11_VIDEO_DECODER_CONFIG *config)
|
||||||
{
|
{
|
||||||
FFDXVASharedContext *sctx = DXVA_SHARED_CONTEXT(avctx);
|
|
||||||
unsigned cfg_count = 0;
|
unsigned cfg_count = 0;
|
||||||
D3D11_VIDEO_DECODER_CONFIG *cfg_list = NULL;
|
D3D11_VIDEO_DECODER_CONFIG *cfg_list = NULL;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
@@ -623,7 +622,6 @@ int ff_dxva2_decode_init(AVCodecContext *avctx)
|
|||||||
if (sctx->pix_fmt == AV_PIX_FMT_D3D11) {
|
if (sctx->pix_fmt == AV_PIX_FMT_D3D11) {
|
||||||
AVD3D11VADeviceContext *device_hwctx = frames_ctx->device_ctx->hwctx;
|
AVD3D11VADeviceContext *device_hwctx = frames_ctx->device_ctx->hwctx;
|
||||||
AVD3D11VAContext *d3d11_ctx = &sctx->ctx.d3d11va;
|
AVD3D11VAContext *d3d11_ctx = &sctx->ctx.d3d11va;
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
ff_dxva2_lock(avctx);
|
ff_dxva2_lock(avctx);
|
||||||
ret = d3d11va_create_decoder(avctx);
|
ret = d3d11va_create_decoder(avctx);
|
||||||
@@ -690,7 +688,7 @@ int ff_dxva2_decode_uninit(AVCodecContext *avctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *get_surface(AVCodecContext *avctx, const AVFrame *frame)
|
static void *get_surface(const AVCodecContext *avctx, const AVFrame *frame)
|
||||||
{
|
{
|
||||||
#if CONFIG_D3D11VA
|
#if CONFIG_D3D11VA
|
||||||
if (frame->format == AV_PIX_FMT_D3D11) {
|
if (frame->format == AV_PIX_FMT_D3D11) {
|
||||||
@@ -698,7 +696,7 @@ static void *get_surface(AVCodecContext *avctx, const AVFrame *frame)
|
|||||||
intptr_t index = (intptr_t)frame->data[1];
|
intptr_t index = (intptr_t)frame->data[1];
|
||||||
if (index < 0 || index >= sctx->nb_d3d11_views ||
|
if (index < 0 || index >= sctx->nb_d3d11_views ||
|
||||||
sctx->d3d11_texture != (ID3D11Texture2D *)frame->data[0]) {
|
sctx->d3d11_texture != (ID3D11Texture2D *)frame->data[0]) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer frame is invalid!\n");
|
av_log((void *)avctx, AV_LOG_ERROR, "get_buffer frame is invalid!\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return sctx->d3d11_views[index];
|
return sctx->d3d11_views[index];
|
||||||
@@ -759,7 +757,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
|
|||||||
#endif
|
#endif
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %u: 0x%x\n",
|
av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %u: 0x%x\n",
|
||||||
type, hr);
|
type, (unsigned)hr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (size <= dxva_size) {
|
if (size <= dxva_size) {
|
||||||
@@ -801,7 +799,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
|
|||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Failed to release buffer type %u: 0x%x\n",
|
"Failed to release buffer type %u: 0x%x\n",
|
||||||
type, hr);
|
type, (unsigned)hr);
|
||||||
result = -1;
|
result = -1;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -871,7 +869,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
} while(1);
|
} while(1);
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: 0x%x\n", hr);
|
av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: 0x%x\n", (unsigned)hr);
|
||||||
ff_dxva2_unlock(avctx);
|
ff_dxva2_unlock(avctx);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -966,7 +964,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Failed to execute: 0x%x\n", hr);
|
av_log(avctx, AV_LOG_ERROR, "Failed to execute: 0x%x\n", (unsigned)hr);
|
||||||
result = -1;
|
result = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -981,7 +979,7 @@ end:
|
|||||||
#endif
|
#endif
|
||||||
ff_dxva2_unlock(avctx);
|
ff_dxva2_unlock(avctx);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Failed to end frame: 0x%x\n", hr);
|
av_log(avctx, AV_LOG_ERROR, "Failed to end frame: 0x%x\n", (unsigned)hr);
|
||||||
result = -1;
|
result = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user