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

Alexandre Janniaux ajanni at videolabs.io
Wed Oct 21 15:40:45 CEST 2020


Hi,

On Wed, Oct 21, 2020 at 02:47:24PM +0200, Francois Cartegnie wrote:
> 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.

I agree, a log callback is much simpler, but maybe we want to call
it (*error) instead? Like Rémi, I'm not sure we want to forward the
incomplete json_object* too, but otherwise LGTM, thanks for taking
care of this.

Regards,
--
Alexandre Janniaux
Videolabs


More information about the vlc-devel mailing list