MCPcopy Index your code
hub / github.com/byhook/ffmpeg4android / parse_option

Function parse_option

ffmpeg-single-cmd/src/main/cpp/cmdutils.c:350–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350int parse_option(void *optctx, const char *opt, const char *arg,
351 const OptionDef *options)
352{
353 const OptionDef *po;
354 int ret;
355
356 po = find_option(options, opt);
357 if (!po->name && opt[0] == 'n' && opt[1] == 'o') {
358 /* handle 'no' bool option */
359 po = find_option(options, opt + 2);
360 if ((po->name && (po->flags & OPT_BOOL)))
361 arg = "0";
362 } else if (po->flags & OPT_BOOL)
363 arg = "1";
364
365 if (!po->name)
366 po = find_option(options, "default");
367 if (!po->name) {
368 av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", opt);
369 return AVERROR(EINVAL);
370 }
371 if (po->flags & HAS_ARG && !arg) {
372 av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'\n", opt);
373 return AVERROR(EINVAL);
374 }
375
376 ret = write_option(optctx, po, opt, arg);
377 if (ret < 0)
378 return ret;
379
380 return !!(po->flags & HAS_ARG);
381}
382
383void parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
384 void (*parse_arg_function)(void *, const char*))

Callers 15

opt_audio_codecFunction · 0.85
opt_video_codecFunction · 0.85
opt_subtitle_codecFunction · 0.85
opt_data_codecFunction · 0.85
opt_recording_timestampFunction · 0.85
open_output_fileFunction · 0.85
opt_targetFunction · 0.85
opt_video_framesFunction · 0.85
opt_audio_framesFunction · 0.85
opt_data_framesFunction · 0.85
opt_old2newFunction · 0.85
opt_qscaleFunction · 0.85

Calls 2

find_optionFunction · 0.85
write_optionFunction · 0.85

Tested by

no test coverage detected