| 852 | } |
| 853 | |
| 854 | static int vaapi_encode_free(AVCodecContext *avctx, FFHWBaseEncodePicture *pic) |
| 855 | { |
| 856 | VAAPIEncodePicture *priv = pic->priv; |
| 857 | int i; |
| 858 | |
| 859 | if (pic->encode_issued) |
| 860 | vaapi_encode_discard(avctx, pic); |
| 861 | |
| 862 | if (priv->slices) { |
| 863 | for (i = 0; i < priv->nb_slices; i++) |
| 864 | av_freep(&priv->slices[i].codec_slice_params); |
| 865 | } |
| 866 | |
| 867 | av_freep(&priv->param_buffers); |
| 868 | av_freep(&priv->slices); |
| 869 | // Output buffer should already be destroyed. |
| 870 | av_assert0(priv->output_buffer == VA_INVALID_ID); |
| 871 | |
| 872 | av_freep(&priv->codec_picture_params); |
| 873 | av_freep(&priv->roi); |
| 874 | |
| 875 | return 0; |
| 876 | } |
| 877 | |
| 878 | static av_cold void vaapi_encode_add_global_param(AVCodecContext *avctx, int type, |
| 879 | void *buffer, size_t size) |
no test coverage detected