summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-05-23 13:56:08 +0200
committerClément Bœsch <ubitux@gmail.com>2013-05-23 17:22:05 +0200
commita0a41db3398e2ea15b85d534877c53bc381de73b (patch)
tree323035ce73d15f1d63c662f6c78858bf462a6521
parent288f9166430285224c689906d002499096acc1a9 (diff)
lavfi/testsrc: make nb_decimals available only in testsrc.
-rw-r--r--doc/filters.texi2
-rw-r--r--libavfilter/version.h2
-rw-r--r--libavfilter/vsrc_testsrc.c24
3 files changed, 13 insertions, 15 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index a1adb31cb2..779238faf5 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7453,7 +7453,7 @@ If not specified, or the expressed duration is negative, the video is
supposed to be generated forever.
@item decimals, n
-Set the number of decimals to show in the timestamp, only used in the
+Set the number of decimals to show in the timestamp, only available in the
@code{testsrc} source.
The displayed timestamp value will correspond to the original
diff --git a/libavfilter/version.h b/libavfilter/version.h
index a12283eeec..9043b5058a 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -31,7 +31,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 69
-#define LIBAVFILTER_VERSION_MICRO 100
+#define LIBAVFILTER_VERSION_MICRO 101
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index a8a45a21ef..075026d9ef 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -55,13 +55,15 @@ typedef struct {
int64_t pts;
int64_t duration; ///< duration expressed in microseconds
AVRational sar; ///< sample aspect ratio
- int nb_decimals;
int draw_once; ///< draw only the first frame, always put out the same picture
int draw_once_reset; ///< draw only the first frame or in case of reset
AVFrame *picref; ///< cached reference containing the painted picture
void (* fill_picture_fn)(AVFilterContext *ctx, AVFrame *frame);
+ /* only used by testsrc */
+ int nb_decimals;
+
/* only used by color */
FFDrawContext draw;
FFDrawColor color;
@@ -86,23 +88,13 @@ typedef struct {
static const AVOption options[] = {
COMMON_OPTIONS
- /* only used by testsrc */
- { "decimals", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.i64=0}, 0, 17, FLAGS },
- { "n", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.i64=0}, 0, 17, FLAGS },
-
- { NULL },
+ { NULL }
};
static av_cold int init(AVFilterContext *ctx)
{
TestSourceContext *test = ctx->priv;
- if (test->nb_decimals && strcmp(ctx->filter->name, "testsrc")) {
- av_log(ctx, AV_LOG_WARNING,
- "Option 'decimals' is ignored with source '%s'\n",
- ctx->filter->name);
- }
-
test->time_base = av_inv_q(test->frame_rate);
test->nb_frame = 0;
test->pts = 0;
@@ -317,7 +309,13 @@ AVFilter avfilter_vsrc_nullsrc = {
#if CONFIG_TESTSRC_FILTER
-#define testsrc_options options
+static const AVOption testsrc_options[] = {
+ COMMON_OPTIONS
+ { "decimals", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.i64=0}, 0, 17, FLAGS },
+ { "n", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.i64=0}, 0, 17, FLAGS },
+ { NULL }
+};
+
AVFILTER_DEFINE_CLASS(testsrc);
/**