/* Converts 'match' to a string and returns the string. If 'priority' is * different from OFP_DEFAULT_PRIORITY, includes it in the string. The caller * must free the string (with free()). */ char * match_to_string(const struct match *match, unsigned int priority) { struct ds s = DS_EMPTY_INITIALIZER; match_format(match, &s, priority); return ds_steal_cstr(&s); }
AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { AVOutputFormat *fmt = NULL, *fmt_found; int score_max, score; /* specific test for image sequences */ #if CONFIG_IMAGE2_MUXER if (!short_name && filename && av_filename_number_test(filename) && ff_guess_image2_codec(filename) != AV_CODEC_ID_NONE) { return av_guess_format("image2", NULL, NULL); } #endif /* Find the proper file type. */ fmt_found = NULL; score_max = 0; while ((fmt = av_oformat_next(fmt))) { score = 0; if (fmt->name && short_name && match_format(short_name, fmt->name)) score += 100; if (fmt->mime_type && mime_type && !strcmp(fmt->mime_type, mime_type)) score += 10; if (filename && fmt->extensions && av_match_ext(filename, fmt->extensions)) { score += 5; } if (score > score_max) { score_max = score; fmt_found = fmt; } } return fmt_found; }
void flow_format(struct ds *ds, const struct flow *flow) { struct match match; match_wc_init(&match, flow); match_format(&match, ds, OFP_DEFAULT_PRIORITY); }
void flow_format(struct ds *ds, const struct flow *flow) { struct match match; match_wc_init(&match, flow); match_format(&match, ds, flow->skb_priority); }
AVInputFormat *av_find_input_format(const char *short_name) { AVInputFormat *fmt = NULL; while ((fmt = av_iformat_next(fmt))) if (match_format(short_name, fmt->name)) return fmt; return NULL; }
/* Appends a string representation of 'match' to 's'. If 'priority' is * different from OFP_DEFAULT_PRIORITY, includes it in 's'. */ void minimatch_format(const struct minimatch *match, struct ds *s, unsigned int priority) { struct match megamatch; minimatch_expand(match, &megamatch); match_format(&megamatch, s, priority); }
static int ffmpeg_seek_by_byte(AVFormatContext *pFormatCtx) { static const char *byte_seek_list[] = { "mpegts", 0 }; const char **p; if (pFormatCtx->iformat->flags & AVFMT_TS_DISCONT) { return TRUE; } p = byte_seek_list; while (*p) { if (match_format(*p++, pFormatCtx)) { return TRUE; } } return FALSE; }