MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / vaapi_encode_av1_write_extra_header

Function vaapi_encode_av1_write_extra_header

libavcodec/vaapi_encode_av1.c:809–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807}
808
809static int vaapi_encode_av1_write_extra_header(AVCodecContext *avctx,
810 FFHWBaseEncodePicture *base_pic,
811 int index, int *type,
812 char *data, size_t *data_len)
813{
814 VAAPIEncodeAV1Context *priv = avctx->priv_data;
815 CodedBitstreamFragment *obu = &priv->current_obu;
816 AV1RawOBU *mh_obu;
817 char mh_data[MAX_PARAM_BUFFER_SIZE];
818 size_t mh_data_len;
819 int ret = 0;
820
821 if (index >= priv->nb_mh)
822 return AVERROR_EOF;
823
824 mh_obu = &priv->mh[index];
825 ret = vaapi_encode_av1_add_obu(avctx, obu, AV1_OBU_METADATA, mh_obu);
826 if (ret < 0)
827 goto end;
828
829 ret = vaapi_encode_av1_write_obu(avctx, mh_data, &mh_data_len, obu);
830 if (ret < 0)
831 goto end;
832
833 memcpy(data, mh_data, MAX_PARAM_BUFFER_SIZE * sizeof(char));
834 *data_len = mh_data_len;
835 *type = VAEncPackedHeaderRawData;
836
837end:
838 ff_cbs_fragment_reset(obu);
839 return ret;
840}
841
842static const VAAPIEncodeProfile vaapi_encode_av1_profiles[] = {
843 { AV_PROFILE_AV1_MAIN, 8, 3, 1, 1, VAProfileAV1Profile0 },

Callers

nothing calls this directly

Calls 2

vaapi_encode_av1_add_obuFunction · 0.85

Tested by

no test coverage detected