The branch, master has been updated via a8097d32ae1406e55b4c4e2c746e75f326604a05 (commit) from 48115181438b4d7258f38c7083b5def083ee345a (commit)
- Log ----------------------------------------------------------------- commit a8097d32ae1406e55b4c4e2c746e75f326604a05 Author: Marton Balint <c...@passwd.hu> AuthorDate: Thu Aug 14 22:59:58 2025 +0200 Commit: Marton Balint <c...@passwd.hu> CommitDate: Tue Aug 26 14:41:44 2025 +0000 avformat/img2dec: remove deprecated glob_sequence pattern type "glob_sequence" was deprecated since 2012. This also changes the default pattern to "sequence", because "glob_sequence" was also the default. Signed-off-by: Marton Balint <c...@passwd.hu> diff --git a/doc/demuxers.texi b/doc/demuxers.texi index c6b72c3b69..3de9992976 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -664,30 +664,9 @@ Select a glob wildcard pattern type. The pattern is interpreted like a @code{glob()} pattern. This is only selectable if libavformat was compiled with globbing support. - -@item glob_sequence @emph{(deprecated, will be removed)} -Select a mixed glob wildcard/sequence pattern. - -If your version of libavformat was compiled with globbing support, and -the provided pattern contains at least one glob meta character among -@code{%*?[]@{@}} that is preceded by an unescaped "%", the pattern is -interpreted like a @code{glob()} pattern, otherwise it is interpreted -like a sequence pattern. - -All glob special characters @code{%*?[]@{@}} must be prefixed -with "%". To escape a literal "%" you shall use "%%". - -For example the pattern @code{foo-%*.jpeg} will match all the -filenames prefixed by "foo-" and terminating with ".jpeg", and -@code{foo-%?%?%?.jpeg} will match all the filenames prefixed with -"foo-", followed by a sequence of three characters, and terminating -with ".jpeg". - -This pattern type is deprecated in favor of @var{glob} and -@var{sequence}. @end table -Default value is @var{glob_sequence}. +Default value is @var{sequence}. @item pixel_format Set the pixel format of the images to read. If not specified the pixel format is guessed from the first image file in the sequence. diff --git a/libavformat/img2.h b/libavformat/img2.h index e98902c96f..0781e681c5 100644 --- a/libavformat/img2.h +++ b/libavformat/img2.h @@ -31,8 +31,7 @@ #endif enum PatternType { - PT_GLOB_SEQUENCE, - PT_GLOB, + PT_GLOB = 1, PT_SEQUENCE, PT_NONE, PT_DEFAULT diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index f0ed84f8f6..a3f4ef14fa 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -84,27 +84,6 @@ static int infer_size(int *width_ptr, int *height_ptr, int size) return -1; } -static int is_glob(const char *path) -{ -#if HAVE_GLOB - size_t span = 0; - const char *p = path; - - while (p = strchr(p, '%')) { - if (*(++p) == '%') { - ++p; - continue; - } - if (span = strspn(p, "*?[]{}")) - break; - } - /* Did we hit a glob char or get to the end? */ - return span != 0; -#else - return 0; -#endif -} - /** * Get index range of image files matched by path. * @@ -172,8 +151,6 @@ static int img_read_probe(const AVProbeData *p) if (p->filename && ff_guess_image2_codec(p->filename)) { if (av_filename_number_test(p->filename)) return AVPROBE_SCORE_MAX; - else if (is_glob(p->filename)) - return AVPROBE_SCORE_MAX; else if (p->filename[strcspn(p->filename, "*?{")]) // probably PT_GLOB return AVPROBE_SCORE_EXTENSION + 2; // score chosen to be a tad above the image pipes else if (p->buf_size == 0) @@ -242,44 +219,9 @@ int ff_img_read_header(AVFormatContext *s1) if (s1->pb) { s->pattern_type = PT_NONE; } else - s->pattern_type = PT_GLOB_SEQUENCE; - } - - if (s->pattern_type == PT_GLOB_SEQUENCE) { - s->use_glob = is_glob(s->path); - if (s->use_glob) { -#if HAVE_GLOB - char *p = s->path, *q, *dup; - int gerr; -#endif - - av_log(s1, AV_LOG_WARNING, "Pattern type 'glob_sequence' is deprecated: " - "use pattern_type 'glob' instead\n"); -#if HAVE_GLOB - dup = q = av_strdup(p); - while (*q) { - /* Do we have room for the next char and a \ insertion? */ - if ((p - s->path) >= (sizeof(s->path) - 2)) - break; - if (*q == '%' && strspn(q + 1, "%*?[]{}")) - ++q; - else if (strspn(q, "\\*?[]{}")) - *p++ = '\\'; - *p++ = *q++; - } - *p = 0; - av_free(dup); - - gerr = glob(s->path, GLOB_NOCHECK|GLOB_BRACE|GLOB_NOMAGIC, NULL, &s->globstate); - if (gerr != 0) { - return AVERROR(ENOENT); - } - first_index = 0; - last_index = s->globstate.gl_pathc - 1; -#endif - } + s->pattern_type = PT_SEQUENCE; } - if ((s->pattern_type == PT_GLOB_SEQUENCE && !s->use_glob) || s->pattern_type == PT_SEQUENCE) { + if (s->pattern_type == PT_SEQUENCE) { if (find_image_range(s1->pb, &first_index, &last_index, s->path, s->start_number, s->start_number_range) < 0) { av_log(s1, AV_LOG_ERROR, @@ -303,7 +245,7 @@ int ff_img_read_header(AVFormatContext *s1) "is not supported by this libavformat build\n"); return AVERROR(ENOSYS); #endif - } else if (s->pattern_type != PT_GLOB_SEQUENCE && s->pattern_type != PT_NONE) { + } else if (s->pattern_type != PT_NONE) { av_log(s1, AV_LOG_ERROR, "Unknown value '%d' for pattern_type option\n", s->pattern_type); return AVERROR(EINVAL); @@ -623,7 +565,6 @@ static int img_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp #if CONFIG_IMAGE2_DEMUXER const AVOption ff_img_options[] = { { "pattern_type", "set pattern type", OFFSET(pattern_type), AV_OPT_TYPE_INT, {.i64=PT_DEFAULT}, 0, INT_MAX, DEC, .unit = "pattern_type"}, - { "glob_sequence","select glob/sequence pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_GLOB_SEQUENCE}, INT_MIN, INT_MAX, DEC, .unit = "pattern_type" }, { "glob", "select glob pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_GLOB }, INT_MIN, INT_MAX, DEC, .unit = "pattern_type" }, { "sequence", "select sequence pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_SEQUENCE }, INT_MIN, INT_MAX, DEC, .unit = "pattern_type" }, { "none", "disable pattern matching", 0, AV_OPT_TYPE_CONST, {.i64=PT_NONE }, INT_MIN, INT_MAX, DEC, .unit = "pattern_type" }, ----------------------------------------------------------------------- Summary of changes: doc/demuxers.texi | 23 +----------------- libavformat/img2.h | 3 +-- libavformat/img2dec.c | 65 +++------------------------------------------------ 3 files changed, 5 insertions(+), 86 deletions(-) hooks/post-receive -- _______________________________________________ ffmpeg-cvslog mailing list -- ffmpeg-cvslog@ffmpeg.org To unsubscribe send an email to ffmpeg-cvslog-le...@ffmpeg.org