Skip to content

Commit

Permalink
ffmpeg - убрано предупреждение(связано с нашим кастомным кодом). Дора…
Browse files Browse the repository at this point in the history
…ботан код d3d11va для HEVC Rext форматов, теперь можно с ними спокойно использовать av_hwframe_transfer_data() - у нас он не используется на данный момент но так зато правки ffmpeg закончены.
  • Loading branch information
Aleksoid1978 committed Feb 22, 2024
1 parent fd13cf6 commit b7ad4b0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/custom_code/ffmpeg.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* libavcodec/aacsbr_template.c
* libavcodec/bsf_list.c
* libavcodec/codec_list.c
* libavcodec/d3d12va_hevc.c
* libavcodec/dxva2.c
* libavcodec/dxva2_hevc.c
* libavcodec/dxva2_internal.h
Expand Down
4 changes: 3 additions & 1 deletion src/ExtLib/ffmpeg/libavcodec/d3d12va_hevc.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ static int d3d12va_hevc_start_frame(AVCodecContext *avctx, av_unused const uint8

ctx->used_mask = 0;

ff_dxva2_hevc_fill_picture_parameters(avctx, (AVDXVAContext *)ctx, &ctx_pic->pp);
// ==> Start patch MPC
ff_dxva2_hevc_fill_picture_parameters(avctx, (AVDXVAContext *)ctx, (DXVA_PicParams_HEVC_Rext*)&ctx_pic->pp);
// ==> End patch MPC

ff_dxva2_hevc_fill_scaling_lists(avctx, (AVDXVAContext *)ctx, &ctx_pic->qm);

Expand Down
25 changes: 25 additions & 0 deletions src/ExtLib/ffmpeg/libavutil/hwcontext_d3d11va.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,36 @@ static void fill_texture_ptrs(uint8_t *data[4], int linesize[4],
D3D11_TEXTURE2D_DESC *desc,
D3D11_MAPPED_SUBRESOURCE *map)
{
// ==> Start patch MPC
/*
int i;
for (i = 0; i < 4; i++)
linesize[i] = map->RowPitch;
*/
int width;
int codedbytes = 1;

switch (ctx->sw_format) {
case AV_PIX_FMT_P010:
case AV_PIX_FMT_P016:
case AV_PIX_FMT_YUYV422:
codedbytes = 2;
break;
case AV_PIX_FMT_Y210:
case AV_PIX_FMT_Y212:
case AV_PIX_FMT_VUYX:
case AV_PIX_FMT_XV30:
codedbytes = 4;
break;
case AV_PIX_FMT_XV36:
codedbytes = 8;
break;
}

width = map->RowPitch / codedbytes;
av_image_fill_linesizes(linesize, ctx->sw_format, width);
// ==> End patch MPC
av_image_fill_pointers(data, ctx->sw_format, desc->Height,
(uint8_t*)map->pData, linesize);
}
Expand Down

0 comments on commit b7ad4b0

Please sign in to comment.