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

Function set_format

libavutil/opt.c:950–972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

948}
949
950static int set_format(void *obj, const char *name, int fmt, int search_flags,
951 enum AVOptionType type, const char *desc, int nb_fmts)
952{
953 const AVOption *o;
954 int *dst;
955 int min, max, ret;
956
957 ret = opt_set_init(obj, name, search_flags, type, NULL, &o, (void**)&dst);
958 if (ret < 0)
959 return ret;
960
961 min = FFMAX(o->min, -1);
962 max = FFMIN(o->max, nb_fmts-1);
963
964 if (fmt < min || fmt > max) {
965 av_log(obj, AV_LOG_ERROR,
966 "Value %d for parameter '%s' out of %s format range [%d - %d]\n",
967 fmt, name, desc, min, max);
968 return AVERROR(ERANGE);
969 }
970 *dst = fmt;
971 return 0;
972}
973
974int av_opt_set_pixel_fmt(void *obj, const char *name, enum AVPixelFormat fmt, int search_flags)
975{

Callers 2

av_opt_set_pixel_fmtFunction · 0.85
av_opt_set_sample_fmtFunction · 0.85

Calls 1

av_logFunction · 0.85

Tested by

no test coverage detected