On Mon, 16 Dec 2013 01:48:27 +0100, Luca Barbato <[email protected]> wrote:
> ---
> 
> Not sure which is better, ran it out of habit...
> 
>  libavutil/opt.h | 66 
> +++++++++++++++++++++++++++++++++++++++------------------
>  1 file changed, 45 insertions(+), 21 deletions(-)
> 
> diff --git a/libavutil/opt.h b/libavutil/opt.h
> index 0181379..e17bfbd 100644
> --- a/libavutil/opt.h
> +++ b/libavutil/opt.h
> @@ -215,7 +214,7 @@
>   * before the file is actually opened.
>   */
> 
> -enum AVOptionType{
> +enum AVOptionType {
>      AV_OPT_TYPE_FLAGS,
>      AV_OPT_TYPE_INT,
>      AV_OPT_TYPE_INT64,
> @@ -326,7 +325,8 @@ void av_opt_free(void *obj);
>   * @return non-zero if the flag is set, zero if the flag isn't set,
>   *         isn't of the right type, or the flags field doesn't exist.
>   */
> -int av_opt_flag_is_set(void *obj, const char *field_name, const char 
> *flag_name);
> +int av_opt_flag_is_set(void *obj, const char *field_name,
> +                       const char *flag_name);
> 
>  /*
>   * Set all the options from a given dictionary on an object.
> @@ -358,18 +358,34 @@ int av_opt_set_dict(void *obj, struct AVDictionary 
> **options);
>   *
>   * @return 0 on success, a negative number on failure.
>   */
> -int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int    
>     *flags_out);
> -int av_opt_eval_int   (void *obj, const AVOption *o, const char *val, int    
>     *int_out);
> -int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, 
> int64_t    *int64_out);
> -int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float  
>     *float_out);
> -int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double 
>     *double_out);
> -int av_opt_eval_q     (void *obj, const AVOption *o, const char *val, 
> AVRational *q_out);
> +int av_opt_eval_flags(void *obj,
> +                      const AVOption *o,
> +                      const char *val,
> +                      int *flags_out);
> +int av_opt_eval_int(void *obj, const AVOption *o, const char *val,
> +                    int *int_out);
> +int av_opt_eval_int64(void *obj,
> +                      const AVOption *o,
> +                      const char *val,
> +                      int64_t *int64_out);
> +int av_opt_eval_float(void *obj,
> +                      const AVOption *o,
> +                      const char *val,
> +                      float *float_out);
> +int av_opt_eval_double(void *obj,
> +                       const AVOption *o,
> +                       const char *val,
> +                       double *double_out);
> +int av_opt_eval_q(void *obj,
> +                  const AVOption *o,
> +                  const char *val,
> +                  AVRational *q_out);

I do not think this is better

>  /**
>   * @}
>   */
> 
>  #define AV_OPT_SEARCH_CHILDREN   0x0001 /**< Search in possible children of 
> the
> -                                             given object first. */
> +                                         *   given object first. */
>  /**
>   *  The obj passed to av_opt_find() is fake -- only a double pointer to 
> AVClass
>   *  instead of a required pointer to a struct containing AVClass. This is
> @@ -425,7 +441,8 @@ const AVOption *av_opt_find(void *obj, const char *name, 
> const char *unit,
>   *         was found.
>   */
>  const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
> -                             int opt_flags, int search_flags, void 
> **target_obj);
> +                             int opt_flags, int search_flags,
> +                             void **target_obj);
> 
>  /**
>   * Iterate over all AVOptions belonging to obj.
> @@ -452,7 +469,8 @@ void *av_opt_child_next(void *obj, void *prev);
>   * @param prev result of a previous call to this function or NULL
>   * @return AVClass corresponding to next potential child or NULL
>   */
> -const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass 
> *prev);
> +const AVClass *av_opt_child_class_next(const AVClass *parent,
> +                                       const AVClass *prev);
> 
>  /**
>   * @defgroup opt_set_funcs Option setting functions
> @@ -480,11 +498,13 @@ const AVClass *av_opt_child_class_next(const AVClass 
> *parent, const AVClass *pre
>   * AVERROR(ERANGE) if the value is out of range
>   * AVERROR(EINVAL) if the value is not valid
>   */
> -int av_opt_set       (void *obj, const char *name, const char *val, int 
> search_flags);
> -int av_opt_set_int   (void *obj, const char *name, int64_t     val, int 
> search_flags);
> -int av_opt_set_double(void *obj, const char *name, double      val, int 
> search_flags);
> -int av_opt_set_q     (void *obj, const char *name, AVRational  val, int 
> search_flags);
> -int av_opt_set_bin   (void *obj, const char *name, const uint8_t *val, int 
> size, int search_flags);
> +int av_opt_set(void *obj, const char *name, const char *val, int 
> search_flags);
> +int av_opt_set_int(void *obj, const char *name, int64_t val, int 
> search_flags);
> +int av_opt_set_double(void *obj, const char *name, double val,
> +                      int search_flags);
> +int av_opt_set_q(void *obj, const char *name, AVRational val, int 
> search_flags);
> +int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int size,
> +                   int search_flags);
>  /**
>   * @}
>   */
> @@ -504,10 +524,14 @@ int av_opt_set_bin   (void *obj, const char *name, 
> const uint8_t *val, int size,
>  /**
>   * @note the returned string will av_malloc()ed and must be av_free()ed by 
> the caller
>   */
> -int av_opt_get       (void *obj, const char *name, int search_flags, uint8_t 
>   **out_val);
> -int av_opt_get_int   (void *obj, const char *name, int search_flags, int64_t 
>    *out_val);
> -int av_opt_get_double(void *obj, const char *name, int search_flags, double  
>    *out_val);
> -int av_opt_get_q     (void *obj, const char *name, int search_flags, 
> AVRational *out_val);
> +int av_opt_get(void *obj, const char *name, int search_flags,
> +               uint8_t **out_val);
> +int av_opt_get_int(void *obj, const char *name, int search_flags,
> +                   int64_t *out_val);
> +int av_opt_get_double(void *obj, const char *name, int search_flags,
> +                      double *out_val);
> +int av_opt_get_q(void *obj, const char *name, int search_flags,
> +                 AVRational *out_val);

Neither is this

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to