[FFmpeg-devel] [PATCH] lavfi/hue: add dynamic expression support
Jérémy TRAN
tran.jeremy.av at gmail.com
Mon Sep 10 05:52:29 CEST 2012
2012/9/9 Stefano Sabatini <stefasab at gmail.com>:
>> #define HUE_DEFAULT_VAL 0
>> #define SAT_DEFAULT_VAL 1
>>
>> +#define STR(s) #s
>> +#define STRINGIFY(s) STR(s)
>> +#define HUE_DEFAULT_VAL_STRING STRINGIFY(HUE_DEFAULT_VAL)
>> +#define SAT_DEFAULT_VAL_STRING STRINGIFY(SAT_DEFAULT_VAL)
>
> Slightly overkill, you could simply do:
>
> #define HUE_DEFAULT_VAL 0
> #define HUE_DEFAULT_VAL_STRING "0"
> #define SAT_DEFAULT_VAL 1
> #define SAT_DEFAULT_VAL_STRING "1"
There seems to be an AV_STRINGIFY macro so I think that will also do the job.
But in the end, for now it may not be wise to initialize the
expressions with their default values in the options table. If we do
that, when using the filter with the flat syntax with arguments
different than the default ones, the expressions wouldn’t match the
hue and saturation. This becomes an issue if we send a reinit command
and use the named options syntax without redefining both options : the
filter would use the default expression instead of the current
hue/saturation value.
--
Jérémy Tran
ACU 2013
EPITA GISTRE 2013
More information about the ffmpeg-devel
mailing list