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

Function av_opt_serialize

libavutil/opt.c:2776–2803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2774}
2775
2776int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer,
2777 const char key_val_sep, const char pairs_sep)
2778{
2779 AVBPrint bprint;
2780 int ret, cnt = 0;
2781
2782 if (pairs_sep == '\0' || key_val_sep == '\0' || pairs_sep == key_val_sep ||
2783 pairs_sep == '\\' || key_val_sep == '\\') {
2784 av_log(obj, AV_LOG_ERROR, "Invalid separator(s) found.");
2785 return AVERROR(EINVAL);
2786 }
2787
2788 if (!obj || !buffer)
2789 return AVERROR(EINVAL);
2790
2791 *buffer = NULL;
2792 av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
2793
2794 ret = opt_serialize(obj, opt_flags, flags, &cnt, &bprint,
2795 key_val_sep, pairs_sep);
2796 if (ret < 0)
2797 return ret;
2798
2799 ret = av_bprint_finalize(&bprint, buffer);
2800 if (ret < 0)
2801 return ret;
2802 return 0;
2803}

Callers 2

mainFunction · 0.85
of_serialize_optionsFunction · 0.85

Calls 4

av_logFunction · 0.85
av_bprint_initFunction · 0.85
opt_serializeFunction · 0.85
av_bprint_finalizeFunction · 0.85

Tested by 1

mainFunction · 0.68