[vlc-devel] [PATCH] demux: json: add json_reader context

Rémi Denis-Courmont remi at remlab.net
Wed Oct 21 16:31:10 CEST 2020


Le keskiviikkona 21. lokakuuta 2020, 15.47.24 EEST Francois Cartegnie a écrit 
:
> Le 14/10/2020 à 19:38, Rémi Denis-Courmont a écrit :
> >>>> -size_t json_read(void *data, void *buf, size_t max);
> >>>> -void json_parse_error(void *log, const char *msg);
> >>>> +struct json_reader {
> >>>> +    void *priv;
> >>>> +    ssize_t (*read)(void *, void *, size_t);
> >>>> +    void (*logger)(void *, const struct json_object *, const char *);
> >>>> +};
> >>> 
> >>> I don't see the point in having a log callback. The VLC logger is
> >>> already
> >>> essentially a log callback by itself. We don't need two indirection
> >>> layers.
> 
> Not having another indirection means to have includes inside gammar code
> to perform vlc_error() on the log callback.

That's kind of the point of using link-time indirection. We don't have any 
single module that would need two or more sets of JSON parser callbacks.

-- 
Rémi Denis-Courmont
http://www.remlab.net/





More information about the vlc-devel mailing list