Re: [FFmpeg-devel] [PATCH] lavfi/drawtext: add alias expr_int_format to expansion function eif

2014-07-18 Thread Clément Bœsch
On Fri, Jul 18, 2014 at 12:05:42AM +0200, Nicolas George wrote:
 Le decadi 30 messidor, an CCXXII, Andrey Utkin a écrit :
  ---
   doc/filters.texi  | 2 +-
   libavfilter/vf_drawtext.c | 3 ++-
   2 files changed, 3 insertions(+), 2 deletions(-)
 
 IMHO, since the function was added extremely recently, it is ok to just
 change the name.
 

It's not present in 2.3 release?

[...]

-- 
Clément B.


pgpDHEq12DjM8.pgp
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi/drawtext: add alias expr_int_format to expansion function eif

2014-07-18 Thread Nicolas George
Le decadi 30 messidor, an CCXXII, Clément Bœsch a écrit :
 It's not present in 2.3 release?

No, it was applied a little bit later.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi/drawtext: add alias expr_int_format to expansion function eif

2014-07-18 Thread Michael Niedermayer
On Fri, Jul 18, 2014 at 07:53:48AM +0200, Stefano Sabatini wrote:
 On date Friday 2014-07-18 01:00:40 +0300, Andrey Utkin encoded:
  ---
   doc/filters.texi  | 2 +-
   libavfilter/vf_drawtext.c | 3 ++-
   2 files changed, 3 insertions(+), 2 deletions(-)
  
  diff --git a/doc/filters.texi b/doc/filters.texi
  index 8cde277..a7919a3 100644
  --- a/doc/filters.texi
  +++ b/doc/filters.texi
  @@ -3916,7 +3916,7 @@ example the text size is not known when evaluating 
  the expression, so
   the constants @var{text_w} and @var{text_h} will have an undefined
   value.
   
  -@item eif
  +@item expr_int_format, eif
   Evaluate the expression's value and output as formatted integer.
   
   First argument is expression to be evaluated, same as for @var{expr} 
  function.
  diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
  index c744d93..b7a295f 100644
  --- a/libavfilter/vf_drawtext.c
  +++ b/libavfilter/vf_drawtext.c
  @@ -949,7 +949,7 @@ static int func_eval_expr_int_format(AVFilterContext 
  *ctx, AVBPrint *bp,
   if (argc == 3) {
   ret = sscanf(argv[2], %u, positions);
   if (ret != 1) {
  -av_log(ctx, AV_LOG_ERROR, eif(): Invalid number of positions
  +av_log(ctx, AV_LOG_ERROR, expr_int_format(): Invalid number 
  of positions
to print: '%s'\n, argv[2]);
   return AVERROR(EINVAL);
   }
  @@ -982,6 +982,7 @@ static const struct drawtext_function {
   } functions[] = {
   { expr,  1, 1, 0,   func_eval_expr },
   { e, 1, 1, 0,   func_eval_expr },
  +{ expr_int_format, 2, 3, 0, func_eval_expr_int_format },
   { eif,   2, 3, 0,   func_eval_expr_int_format },
   { pict_type, 0, 0, 0,   func_pict_type },
   { pts,   0, 2, 0,   func_pts  },
 
 LGTM.

applied

thanks

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

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavfi/drawtext: add alias expr_int_format to expansion function eif

2014-07-17 Thread Andrey Utkin
---
 doc/filters.texi  | 2 +-
 libavfilter/vf_drawtext.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 8cde277..a7919a3 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -3916,7 +3916,7 @@ example the text size is not known when evaluating the 
expression, so
 the constants @var{text_w} and @var{text_h} will have an undefined
 value.
 
-@item eif
+@item expr_int_format, eif
 Evaluate the expression's value and output as formatted integer.
 
 First argument is expression to be evaluated, same as for @var{expr} function.
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index c744d93..b7a295f 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -949,7 +949,7 @@ static int func_eval_expr_int_format(AVFilterContext *ctx, 
AVBPrint *bp,
 if (argc == 3) {
 ret = sscanf(argv[2], %u, positions);
 if (ret != 1) {
-av_log(ctx, AV_LOG_ERROR, eif(): Invalid number of positions
+av_log(ctx, AV_LOG_ERROR, expr_int_format(): Invalid number of 
positions
  to print: '%s'\n, argv[2]);
 return AVERROR(EINVAL);
 }
@@ -982,6 +982,7 @@ static const struct drawtext_function {
 } functions[] = {
 { expr,  1, 1, 0,   func_eval_expr },
 { e, 1, 1, 0,   func_eval_expr },
+{ expr_int_format, 2, 3, 0, func_eval_expr_int_format },
 { eif,   2, 3, 0,   func_eval_expr_int_format },
 { pict_type, 0, 0, 0,   func_pict_type },
 { pts,   0, 2, 0,   func_pts  },
-- 
1.8.5.5

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi/drawtext: add alias expr_int_format to expansion function eif

2014-07-17 Thread Nicolas George
Le decadi 30 messidor, an CCXXII, Andrey Utkin a écrit :
 ---
  doc/filters.texi  | 2 +-
  libavfilter/vf_drawtext.c | 3 ++-
  2 files changed, 3 insertions(+), 2 deletions(-)

IMHO, since the function was added extremely recently, it is ok to just
change the name.

May I suggest: format_expr()? That way, if somebody extends it to accept
more versatile format strings, including floats, the name still works.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi/drawtext: add alias expr_int_format to expansion function eif

2014-07-17 Thread Andrey Utkin
2014-07-18 1:05 GMT+03:00 Nicolas George geo...@nsup.org:
 Le decadi 30 messidor, an CCXXII, Andrey Utkin a écrit :
 ---
  doc/filters.texi  | 2 +-
  libavfilter/vf_drawtext.c | 3 ++-
  2 files changed, 3 insertions(+), 2 deletions(-)

 IMHO, since the function was added extremely recently, it is ok to just
 change the name.

Not principal on this, i just think it is natural, as long as we have
e alias for expr. I think eif is good to have, too. Aliases cost
nothing there.

 May I suggest: format_expr()? That way, if somebody extends it to accept
 more versatile format strings, including floats, the name still works.

Floats are output by expr.
And i'm afraid that making the formatting function more generic would
add a lot of complexity (including safety checks). Actually now i
cannot imagine how would it look like, and what are the use cases.

-- 
Andrey Utkin
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi/drawtext: add alias expr_int_format to expansion function eif

2014-07-17 Thread Stefano Sabatini
On date Friday 2014-07-18 01:00:40 +0300, Andrey Utkin encoded:
 ---
  doc/filters.texi  | 2 +-
  libavfilter/vf_drawtext.c | 3 ++-
  2 files changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/doc/filters.texi b/doc/filters.texi
 index 8cde277..a7919a3 100644
 --- a/doc/filters.texi
 +++ b/doc/filters.texi
 @@ -3916,7 +3916,7 @@ example the text size is not known when evaluating the 
 expression, so
  the constants @var{text_w} and @var{text_h} will have an undefined
  value.
  
 -@item eif
 +@item expr_int_format, eif
  Evaluate the expression's value and output as formatted integer.
  
  First argument is expression to be evaluated, same as for @var{expr} 
 function.
 diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
 index c744d93..b7a295f 100644
 --- a/libavfilter/vf_drawtext.c
 +++ b/libavfilter/vf_drawtext.c
 @@ -949,7 +949,7 @@ static int func_eval_expr_int_format(AVFilterContext 
 *ctx, AVBPrint *bp,
  if (argc == 3) {
  ret = sscanf(argv[2], %u, positions);
  if (ret != 1) {
 -av_log(ctx, AV_LOG_ERROR, eif(): Invalid number of positions
 +av_log(ctx, AV_LOG_ERROR, expr_int_format(): Invalid number of 
 positions
   to print: '%s'\n, argv[2]);
  return AVERROR(EINVAL);
  }
 @@ -982,6 +982,7 @@ static const struct drawtext_function {
  } functions[] = {
  { expr,  1, 1, 0,   func_eval_expr },
  { e, 1, 1, 0,   func_eval_expr },
 +{ expr_int_format, 2, 3, 0, func_eval_expr_int_format },
  { eif,   2, 3, 0,   func_eval_expr_int_format },
  { pict_type, 0, 0, 0,   func_pict_type },
  { pts,   0, 2, 0,   func_pts  },

LGTM.
-- 
FFmpeg = Frightening  Furious Mega Perfectionist Ermetic Gospel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel