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

Function ff_vulkan_write_global_header

libavcodec/vulkan_encode.c:709–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707}
708
709av_cold int ff_vulkan_write_global_header(AVCodecContext *avctx,
710 FFVulkanEncodeContext *ctx)
711{
712 int err;
713
714 /* Write extradata if needed */
715 if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
716 uint8_t data[4096];
717 size_t data_len = sizeof(data);
718
719 err = ctx->codec->write_sequence_headers(avctx, NULL, data, &data_len);
720 if (err < 0) {
721 av_log(avctx, AV_LOG_ERROR, "Failed to write sequence header "
722 "for extradata: %d.\n", err);
723 return err;
724 } else {
725 avctx->extradata_size = data_len;
726 avctx->extradata = av_mallocz(avctx->extradata_size +
727 AV_INPUT_BUFFER_PADDING_SIZE);
728 if (!avctx->extradata) {
729 err = AVERROR(ENOMEM);
730 return err;
731 }
732 memcpy(avctx->extradata, data, avctx->extradata_size);
733 }
734 }
735
736 return 0;
737}
738
739av_cold int ff_vulkan_encode_init(AVCodecContext *avctx, FFVulkanEncodeContext *ctx,
740 const FFVulkanEncodeDescriptor *vk_desc,

Callers 2

vulkan_encode_h265_initFunction · 0.85
vulkan_encode_h264_initFunction · 0.85

Calls 2

av_logFunction · 0.85
av_malloczFunction · 0.50

Tested by

no test coverage detected