Showing the changes to libavcodec (11 of 11 files). Show all
Unified · Split
| @@ -409,7 +409,7 @@ static int vaapi_av1_decode_slice(AVCodecContext *avctx, · 408 unmodified lines | |||
| 409 | .tg_end = s->tg_end, | 409 | .tg_end = s->tg_end, |
| 410 | }; | 410 | }; |
| 411 | 411 | ||
| 412 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &slice_param, | 412 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &slice_param, 1, |
| 413 | sizeof(VASliceParameterBufferAV1), | 413 | sizeof(VASliceParameterBufferAV1), |
| 414 | buffer, | 414 | buffer, |
| 415 | size); | 415 | size); |
| @@ -63,6 +63,7 @@ int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, · 62 unmodified lines | |||
| 63 | int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, | 63 | int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, |
| 64 | VAAPIDecodePicture *pic, | 64 | VAAPIDecodePicture *pic, |
| 65 | const void *params_data, | 65 | const void *params_data, |
| 66 | int nb_params, | ||
| 66 | size_t params_size, | 67 | size_t params_size, |
| 67 | const void *slice_data, | 68 | const void *slice_data, |
| 68 | size_t slice_size) | 69 | size_t slice_size) |
| @@ -88,7 +89,7 @@ int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, · 19 unmodified lines | |||
| 88 | 89 | ||
| 89 | vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, | 90 | vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, |
| 90 | VASliceParameterBufferType, | 91 | VASliceParameterBufferType, |
| 91 | params_size, 1, (void*)params_data, | 92 | params_size, nb_params, (void*)params_data, |
| 92 | &pic->slice_buffers[index]); | 93 | &pic->slice_buffers[index]); |
| 93 | if (vas != VA_STATUS_SUCCESS) { | 94 | if (vas != VA_STATUS_SUCCESS) { |
| 94 | av_log(avctx, AV_LOG_ERROR, "Failed to create slice " | 95 | av_log(avctx, AV_LOG_ERROR, "Failed to create slice " |
| @@ -73,6 +73,7 @@ int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, · 72 unmodified lines | |||
| 73 | int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, | 73 | int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, |
| 74 | VAAPIDecodePicture *pic, | 74 | VAAPIDecodePicture *pic, |
| 75 | const void *params_data, | 75 | const void *params_data, |
| 76 | int nb_params, | ||
| 76 | size_t params_size, | 77 | size_t params_size, |
| 77 | const void *slice_data, | 78 | const void *slice_data, |
| 78 | size_t slice_size); | 79 | size_t slice_size); |
| @@ -375,7 +375,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, · 374 unmodified lines | |||
| 375 | slice_param.chroma_offset_l1); | 375 | slice_param.chroma_offset_l1); |
| 376 | 376 | ||
| 377 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, | 377 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 378 | &slice_param, sizeof(slice_param), | 378 | &slice_param, 1, sizeof(slice_param), |
| 379 | buffer, size); | 379 | buffer, size); |
| 380 | if (err) { | 380 | if (err) { |
| 381 | ff_vaapi_decode_cancel(avctx, pic); | 381 | ff_vaapi_decode_cancel(avctx, pic); |
| @@ -353,7 +353,7 @@ static int vaapi_hevc_end_frame(AVCodecContext *avctx) · 352 unmodified lines | |||
| 353 | if (pic->last_size) { | 353 | if (pic->last_size) { |
| 354 | last_slice_param->LongSliceFlags.fields.LastSliceOfPic = 1; | 354 | last_slice_param->LongSliceFlags.fields.LastSliceOfPic = 1; |
| 355 | ret = ff_vaapi_decode_make_slice_buffer(avctx, &pic->pic, | 355 | ret = ff_vaapi_decode_make_slice_buffer(avctx, &pic->pic, |
| 356 | &pic->last_slice_param, slice_param_size, | 356 | &pic->last_slice_param, 1, slice_param_size, |
| 357 | pic->last_buffer, pic->last_size); | 357 | pic->last_buffer, pic->last_size); |
| 358 | if (ret < 0) | 358 | if (ret < 0) |
| 359 | goto fail; | 359 | goto fail; |
| @@ -471,7 +471,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, · 111 unmodified lines | |||
| 471 | 471 | ||
| 472 | if (!sh->first_slice_in_pic_flag) { | 472 | if (!sh->first_slice_in_pic_flag) { |
| 473 | err = ff_vaapi_decode_make_slice_buffer(avctx, &pic->pic, | 473 | err = ff_vaapi_decode_make_slice_buffer(avctx, &pic->pic, |
| 474 | &pic->last_slice_param, slice_param_size, | 474 | &pic->last_slice_param, 1, slice_param_size, |
| 475 | pic->last_buffer, pic->last_size); | 475 | pic->last_buffer, pic->last_size); |
| 476 | pic->last_buffer = NULL; | 476 | pic->last_buffer = NULL; |
| 477 | pic->last_size = 0; | 477 | pic->last_size = 0; |
| @@ -131,7 +131,7 @@ static int vaapi_mjpeg_decode_slice(AVCodecContext *avctx, · 130 unmodified lines | |||
| 131 | sp.components[i].ac_table_selector = s->ac_index[i]; | 131 | sp.components[i].ac_table_selector = s->ac_index[i]; |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &sp, sizeof(sp), buffer, size); | 134 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &sp, 1, sizeof(sp), buffer, size); |
| 135 | if (err) | 135 | if (err) |
| 136 | goto fail; | 136 | goto fail; |
| 137 | 137 | ||
| @@ -162,7 +162,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer · 161 unmodified lines | |||
| 162 | }; | 162 | }; |
| 163 | 163 | ||
| 164 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, | 164 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 165 | &slice_param, sizeof(slice_param), | 165 | &slice_param, 1, sizeof(slice_param), |
| 166 | buffer, size); | 166 | buffer, size); |
| 167 | if (err < 0) { | 167 | if (err < 0) { |
| 168 | ff_vaapi_decode_cancel(avctx, pic); | 168 | ff_vaapi_decode_cancel(avctx, pic); |
| @@ -169,7 +169,7 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer · 168 unmodified lines | |||
| 169 | }; | 169 | }; |
| 170 | 170 | ||
| 171 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, | 171 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 172 | &slice_param, sizeof(slice_param), | 172 | &slice_param, 1, sizeof(slice_param), |
| 173 | buffer, size); | 173 | buffer, size); |
| 174 | if (err < 0) { | 174 | if (err < 0) { |
| 175 | ff_vaapi_decode_cancel(avctx, pic); | 175 | ff_vaapi_decode_cancel(avctx, pic); |
| @@ -490,7 +490,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, · 489 unmodified lines | |||
| 490 | }; | 490 | }; |
| 491 | 491 | ||
| 492 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, | 492 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 493 | &slice_param, sizeof(slice_param), | 493 | &slice_param, 1, sizeof(slice_param), |
| 494 | buffer, size); | 494 | buffer, size); |
| 495 | if (err < 0) { | 495 | if (err < 0) { |
| 496 | ff_vaapi_decode_cancel(avctx, pic); | 496 | ff_vaapi_decode_cancel(avctx, pic); |
| @@ -209,7 +209,7 @@ static int vaapi_vp8_decode_slice(AVCodecContext *avctx, · 208 unmodified lines | |||
| 209 | for (i = 0; i < 8; i++) | 209 | for (i = 0; i < 8; i++) |
| 210 | sp.partition_size[i+1] = s->coeff_partition_size[i]; | 210 | sp.partition_size[i+1] = s->coeff_partition_size[i]; |
| 211 | 211 | ||
| 212 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &sp, sizeof(sp), data, data_size); | 212 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, &sp, 1, sizeof(sp), data, data_size); |
| 213 | if (err) | 213 | if (err) |
| 214 | goto fail; | 214 | goto fail; |
| 215 | 215 | ||
| @@ -158,7 +158,7 @@ static int vaapi_vp9_decode_slice(AVCodecContext *avctx, · 157 unmodified lines | |||
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, | 160 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 161 | &slice_param, sizeof(slice_param), | 161 | &slice_param, 1, sizeof(slice_param), |
| 162 | buffer, size); | 162 | buffer, size); |
| 163 | if (err) { | 163 | if (err) { |
| 164 | ff_vaapi_decode_cancel(avctx, pic); | 164 | ff_vaapi_decode_cancel(avctx, pic); |