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

Function av_opt_get

libavutil/opt.c:1215–1256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1213}
1214
1215int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
1216{
1217 void *dst, *target_obj;
1218 const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
1219 uint8_t *out, buf[128];
1220 int ret;
1221
1222 if (!o || !target_obj || (o->offset<=0 && o->type != AV_OPT_TYPE_CONST))
1223 return AVERROR_OPTION_NOT_FOUND;
1224
1225 if (o->flags & AV_OPT_FLAG_DEPRECATED)
1226 av_log(obj, AV_LOG_WARNING, "The \"%s\" option is deprecated: %s\n", name, o->help);
1227
1228 dst = (uint8_t *)target_obj + o->offset;
1229
1230 if (o->type & AV_OPT_TYPE_FLAG_ARRAY) {
1231 ret = opt_get_array(o, dst, out_val);
1232 if (ret < 0)
1233 return ret;
1234 if (!*out_val && !(search_flags & AV_OPT_ALLOW_NULL)) {
1235 *out_val = av_strdup("");
1236 if (!*out_val)
1237 return AVERROR(ENOMEM);
1238 }
1239 return 0;
1240 }
1241
1242 buf[0] = 0;
1243 out = buf;
1244 ret = opt_get_elem(o, &out, sizeof(buf), dst, search_flags);
1245 if (ret < 0)
1246 return ret;
1247 if (out != buf) {
1248 *out_val = out;
1249 return 0;
1250 }
1251
1252 if (ret >= sizeof(buf))
1253 return AVERROR(EINVAL);
1254 *out_val = av_strdup(out);
1255 return *out_val ? 0 : AVERROR(ENOMEM);
1256}
1257
1258static int get_number(void *obj, const char *name, double *num, int *den, int64_t *intnum,
1259 int search_flags)

Callers 15

open_urlFunction · 0.85
parse_manifestFunction · 0.85
ffio_copy_url_optionsFunction · 0.85
mpjpeg_get_boundaryFunction · 0.85
pcm_read_headerFunction · 0.85
open_urlFunction · 0.85
parse_playlistFunction · 0.85
read_data_continuousFunction · 0.85
ff_rtp_chain_mux_openFunction · 0.85
av_probe_input_buffer2Function · 0.85
av_sdp_createFunction · 0.85
opt_serializeFunction · 0.85

Calls 5

av_opt_find2Function · 0.85
av_logFunction · 0.85
opt_get_arrayFunction · 0.85
av_strdupFunction · 0.85
opt_get_elemFunction · 0.85

Tested by 1

mainFunction · 0.68