[FFmpeg-devel] [PATCH 1/2] lavf: add info_probe_size option.

Stefano Sabatini stefasab at gmail.com
Tue Apr 24 17:32:11 CEST 2012


On date Monday 2012-04-23 23:36:11 +0200, Nicolas George encoded:
> This option separates the "probe format" and "probe packets
> for various info" semantic of the probesize option.
> Input formats are now allowed to raise it if necessary under
> special circumstances (example: large rawvideo frames).
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavformat/avformat.h      |    6 ++++++
>  libavformat/options_table.h |    1 +
>  libavformat/utils.c         |    8 +++++---
>  libavformat/version.h       |    2 +-
>  4 files changed, 13 insertions(+), 4 deletions(-)
> 
> 
> Fixed the place of the field to avoid ABI breakage. I do not know how it
> ended up where it was in the first version. Sorry again.
> 
> Second patch unchanged.
> 
> 
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index d2727d4..7ed747f 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -1051,6 +1051,12 @@ typedef struct AVFormatContext {
>       */
>      int max_chunk_size;
>  
> +    /**
> +     * decoding: size of data to probe for stream information;
> +     * encoding: unused.
> +     */
> +    unsigned int info_probe_size;

Comparing it with probesize:

    /**
     * decoding: size of data to probe; encoding: unused.
     */
    unsigned int probesize;

info_probesize could be preferred (more consistent with "probesize" =>
less confusing).

I suppose probesize should be intended as "format probesize", that is
the size of data to probe for guessing the format, while
info_probesize expresses the size of data to probe for getting stream
information, e.g. the stream framerate and pixel format.

In this case maybe "stream_probesize" may suit better.

> +
>      /*****************************************************************
>       * All fields below this line are not part of the public API. They
>       * may not be used outside of libavformat and can be changed and
> diff --git a/libavformat/options_table.h b/libavformat/options_table.h
> index 8d57c27..0cf2680 100644
> --- a/libavformat/options_table.h
> +++ b/libavformat/options_table.h
> @@ -64,6 +64,7 @@ static const AVOption options[]={
>  {"careful",    "consider things that violate the spec and have not been seen in the wild as errors", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_CAREFUL }, INT_MIN, INT_MAX, D, "err_detect"},
>  {"compliant",  "consider all spec non compliancies as errors", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_COMPLIANT }, INT_MIN, INT_MAX, D, "err_detect"},
>  {"aggressive", "consider things that a sane encoder shouldnt do as an error", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_AGGRESSIVE }, INT_MIN, INT_MAX, D, "err_detect"},
> +{"info_probe_size", "maximum size to probe for stream info", OFFSET(info_probe_size), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX-1, D},

why -1?

[...]
-- 
FFmpeg = Forgiving and Fiendish Murdering Perennial Elected Game


More information about the ffmpeg-devel mailing list