[vlc-devel] [RFC PATCH 1/5] filter: add a way to signal error from callbacks
Rémi Denis-Courmont
remi at remlab.net
Thu Feb 28 20:07:54 CET 2019
Hi,
This requires that callbacks are all serialized, which I don't think that's a good idea for extensibility and generality.
And then I don't think filters should be allowed to fail after initialisation, as it won't typically be possible or reasonable to handle errors.
Le 28 février 2019 17:59:50 GMT+02:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>TODO:
> - document for video/spu
> - Check if all filters are loaded with error = false
>---
> include/vlc_filter.h | 9 ++++++++-
> src/misc/filter.c | 1 +
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
>diff --git a/include/vlc_filter.h b/include/vlc_filter.h
>index b2a8f871a4..4822de7771 100644
>--- a/include/vlc_filter.h
>+++ b/include/vlc_filter.h
>@@ -83,12 +83,19 @@ struct filter_t
> /* Filter configuration */
> config_chain_t * p_cfg;
>
>+ /** Set to true to signal an error from any callbacks */
>+ bool error;
>+
> union
> {
> /** Filter a picture (video filter) */
> picture_t * (*pf_video_filter)( filter_t *, picture_t * );
>
>- /** Filter an audio block (audio filter) */
>+ /**
>+ * Filter an audio block (audio filter)A
>+ * @return a valid output block or NULL (if the module need
>more data
>+ * to output a block). Set filter_t.error to true to signal an
>error.
>+ */
> block_t * (*pf_audio_filter)( filter_t *, block_t * );
>
> /** Blend a subpicture onto a picture (blend) */
>diff --git a/src/misc/filter.c b/src/misc/filter.c
>index 465677a12f..678b88965e 100644
>--- a/src/misc/filter.c
>+++ b/src/misc/filter.c
>@@ -148,6 +148,7 @@ int filter_ConfigureBlend( filter_t *p_blend,
> p_blend->fmt_out.video.i_visible_width = i_dst_width;
> p_blend->fmt_out.video.i_height =
> p_blend->fmt_out.video.i_visible_height = i_dst_height;
>+ p_blend->error = false;
>
> /* */
> if( !p_blend->p_module )
>--
>2.20.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190228/bce46959/attachment.html>
More information about the vlc-devel
mailing list