Unified · Split
| @@ -409,7 +409,7 @@ static int vaapi_av1_decode_slice(AVCodecContext *avctx, · 408 unmodified lines | ||
| 409 | 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 | 413 | sizeof(VASliceParameterBufferAV1), |
| 414 | 414 | buffer, |
| 415 | 415 | size); |
| @@ -63,6 +63,7 @@ int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, · 62 unmodified lines | ||
| 63 | 63 | int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, |
| 64 | 64 | VAAPIDecodePicture *pic, |
| 65 | 65 | const void *params_data, |
| 66 | + int nb_params, | |
| 66 | 67 | size_t params_size, |
| 67 | 68 | const void *slice_data, |
| 68 | 69 | size_t slice_size) |
| @@ -88,7 +89,7 @@ int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, · 19 unmodified lines | ||
| 88 | 89 | |
| 89 | 90 | vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, |
| 90 | 91 | VASliceParameterBufferType, |
| 91 | − params_size, 1, (void*)params_data, | |
| 92 | + params_size, nb_params, (void*)params_data, | |
| 92 | 93 | &pic->slice_buffers[index]); |
| 93 | 94 | if (vas != VA_STATUS_SUCCESS) { |
| 94 | 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 | 73 | int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, |
| 74 | 74 | VAAPIDecodePicture *pic, |
| 75 | 75 | const void *params_data, |
| 76 | + int nb_params, | |
| 76 | 77 | size_t params_size, |
| 77 | 78 | const void *slice_data, |
| 78 | 79 | size_t slice_size); |
| @@ -375,7 +375,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, · 374 unmodified lines | ||
| 375 | 375 | slice_param.chroma_offset_l1); |
| 376 | 376 | |
| 377 | 377 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 378 | − &slice_param, sizeof(slice_param), | |
| 378 | + &slice_param, 1, sizeof(slice_param), | |
| 379 | 379 | buffer, size); |
| 380 | 380 | if (err) { |
| 381 | 381 | ff_vaapi_decode_cancel(avctx, pic); |
| @@ -353,7 +353,7 @@ static int vaapi_hevc_end_frame(AVCodecContext *avctx) · 352 unmodified lines | ||
| 353 | 353 | if (pic->last_size) { |
| 354 | 354 | last_slice_param->LongSliceFlags.fields.LastSliceOfPic = 1; |
| 355 | 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 | 357 | pic->last_buffer, pic->last_size); |
| 358 | 358 | if (ret < 0) |
| 359 | 359 | goto fail; |
| @@ -471,7 +471,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, · 111 unmodified lines | ||
| 471 | 471 | |
| 472 | 472 | if (!sh->first_slice_in_pic_flag) { |
| 473 | 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 | 475 | pic->last_buffer, pic->last_size); |
| 476 | 476 | pic->last_buffer = NULL; |
| 477 | 477 | pic->last_size = 0; |
| @@ -131,7 +131,7 @@ static int vaapi_mjpeg_decode_slice(AVCodecContext *avctx, · 130 unmodified lines | ||
| 131 | 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 | 135 | if (err) |
| 136 | 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 | 164 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 165 | − &slice_param, sizeof(slice_param), | |
| 165 | + &slice_param, 1, sizeof(slice_param), | |
| 166 | 166 | buffer, size); |
| 167 | 167 | if (err < 0) { |
| 168 | 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 | 171 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 172 | − &slice_param, sizeof(slice_param), | |
| 172 | + &slice_param, 1, sizeof(slice_param), | |
| 173 | 173 | buffer, size); |
| 174 | 174 | if (err < 0) { |
| 175 | 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 | 492 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 493 | − &slice_param, sizeof(slice_param), | |
| 493 | + &slice_param, 1, sizeof(slice_param), | |
| 494 | 494 | buffer, size); |
| 495 | 495 | if (err < 0) { |
| 496 | 496 | ff_vaapi_decode_cancel(avctx, pic); |
| @@ -209,7 +209,7 @@ static int vaapi_vp8_decode_slice(AVCodecContext *avctx, · 208 unmodified lines | ||
| 209 | 209 | for (i = 0; i < 8; i++) |
| 210 | 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 | 213 | if (err) |
| 214 | 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 | 160 | err = ff_vaapi_decode_make_slice_buffer(avctx, pic, |
| 161 | − &slice_param, sizeof(slice_param), | |
| 161 | + &slice_param, 1, sizeof(slice_param), | |
| 162 | 162 | buffer, size); |
| 163 | 163 | if (err) { |
| 164 | 164 | ff_vaapi_decode_cancel(avctx, pic); |