[FFmpeg-devel] [PATCH 2/7] Extend the nullsrc source, make it accepts a parameter for specifying the timebase (useful for debugging timebase configuration issues).

Michael Niedermayer michaelni
Mon Oct 11 16:43:50 CEST 2010


On Mon, Oct 11, 2010 at 12:23:13PM +0200, Stefano Sabatini wrote:
> ---
>  doc/filters.texi           |   12 ++++++---
>  libavfilter/vsrc_nullsrc.c |   53 +++++++++++++++++++++++++++++++++++++++++--
>  2 files changed, 58 insertions(+), 7 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 68dcf7f..3c3285e 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -652,11 +652,15 @@ Null video source, never return images. It is mainly useful as a
>  template and to be employed in analysis / debugging tools.
>  
>  It accepts as optional parameter a string of the form
> - at var{width}:@var{height}, where @var{width} and @var{height} specify the size of
> -the configured source.
> + at var{width}:@var{height}:@var{timebase}.
>  
> -The default values of @var{width} and @var{height} are respectively 352
> -and 288 (corresponding to the CIF size format).
> + at var{width} and @var{height} specify the size of the configured
> +source. The default values of @var{width} and @var{height} are
> +respectively 352 and 288 (corresponding to the CIF size format).
> +
> + at var{timebase} specifies an arithmetic expression representing a
> +timebase. The expression can contain the constants "PI", "E", "PHI",
> +"AVTB" (the default timebase), and default to the value "AVTB".
>  
>  @c man end VIDEO SOURCES
>  
> diff --git a/libavfilter/vsrc_nullsrc.c b/libavfilter/vsrc_nullsrc.c
> index f319ceb..80978c8 100644
> --- a/libavfilter/vsrc_nullsrc.c
> +++ b/libavfilter/vsrc_nullsrc.c
> @@ -21,10 +21,32 @@
>   * null video source
>   */
>  
> +#include "libavutil/avstring.h"
> +#include "libavutil/eval.h"
> +#include "libavcore/parseutils.h"
>  #include "avfilter.h"
>  
> +static const char *var_names[] = {
> +    "E",
> +    "PHI",
> +    "PI",
> +    "AVTB",   /* default timebase 1/AV_TIME_BASE */
> +    NULL
> +};
> +
> +enum var_name {
> +    VAR_E,
> +    VAR_PHI,
> +    VAR_PI,
> +    VAR_AVTB,
> +    VAR_INTB,
> +    VAR_VARS_NB
> +};
> +
[...]
> +    priv->var_values[VAR_E]    = M_E;
> +    priv->var_values[VAR_PHI]  = M_PHI;
> +    priv->var_values[VAR_PI]   = M_PI;
> +    priv->var_values[VAR_AVTB] = av_q2d(AV_TIME_BASE_Q);

iam thinking some code factorization between filters could at some point make
sense.
thats off topic though, so patch ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101011/8a0c008e/attachment.pgp>



More information about the ffmpeg-devel mailing list