The codec-specific context now contains both the common context and the codec-specific options directly.
Showing the changes to libavcodec/vaapi_encode.c (1 of 8 files). Show all
Unified · Split
| @@ -1372,17 +1372,9 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) · 1371 unmodified lines | |||
| 1372 | return AVERROR(EINVAL); | 1372 | return AVERROR(EINVAL); |
| 1373 | } | 1373 | } |
| 1374 | 1374 | ||
| 1375 | ctx->codec_options = ctx->codec_options_data; | ||
| 1376 | |||
| 1377 | ctx->va_config = VA_INVALID_ID; | 1375 | ctx->va_config = VA_INVALID_ID; |
| 1378 | ctx->va_context = VA_INVALID_ID; | 1376 | ctx->va_context = VA_INVALID_ID; |
| 1379 | 1377 | ||
| 1380 | ctx->priv_data = av_mallocz(ctx->codec->priv_data_size); | ||
| 1381 | if (!ctx->priv_data) { | ||
| 1382 | err = AVERROR(ENOMEM); | ||
| 1383 | goto fail; | ||
| 1384 | } | ||
| 1385 | |||
| 1386 | ctx->input_frames_ref = av_buffer_ref(avctx->hw_frames_ctx); | 1378 | ctx->input_frames_ref = av_buffer_ref(avctx->hw_frames_ctx); |
| 1387 | if (!ctx->input_frames_ref) { | 1379 | if (!ctx->input_frames_ref) { |
| 1388 | err = AVERROR(ENOMEM); | 1380 | err = AVERROR(ENOMEM); |
| @@ -1583,7 +1575,5 @@ av_cold int ff_vaapi_encode_close(AVCodecContext *avctx) · 194 unmodified lines | |||
| 1583 | av_buffer_unref(&ctx->input_frames_ref); | 1575 | av_buffer_unref(&ctx->input_frames_ref); |
| 1584 | av_buffer_unref(&ctx->device_ref); | 1576 | av_buffer_unref(&ctx->device_ref); |
| 1585 | 1577 | ||
| 1586 | av_freep(&ctx->priv_data); | ||
| 1587 | |||
| 1588 | return 0; | 1578 | return 0; |
| 1589 | } | 1579 | } |