| 707 | } |
| 708 | |
| 709 | av_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 | |
| 739 | av_cold int ff_vulkan_encode_init(AVCodecContext *avctx, FFVulkanEncodeContext *ctx, |
| 740 | const FFVulkanEncodeDescriptor *vk_desc, |
no test coverage detected