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

Francois Cartegnie fcvlcdev at free.fr
Wed Oct 14 19:32:56 CEST 2020


Le 14/10/2020 à 18:02, Rémi Denis-Courmont a écrit :
> Le keskiviikkona 14. lokakuuta 2020, 17.52.52 EEST Francois Cartegnie a écrit 
> :
>> diff --git a/modules/demux/json/json.h b/modules/demux/json/json.h
>> index 8274ceb652..bc254693f3 100644
>> --- a/modules/demux/json/json.h
>> +++ b/modules/demux/json/json.h
>> @@ -59,11 +59,16 @@ struct json_member {
>>      struct json_value value;
>>  };
>>
>> -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.
>

Because we probably might want to use the extra json object info
provided with the message or don't want to pass a mandatory vlc object
or vlc logger.

-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list