[vlc-devel] [PATCH v2 1/3] decoder device: add a helper macro to set the module callbacks/priority
Steve Lhomme
robux4 at ycbcr.xyz
Tue Jul 16 09:10:51 CEST 2019
Replaces https://patches.videolan.org/patch/23919/
- It uses the original names when calling set_callbacks()
- It still checks that the cast to the proper callback signature is
correct (tested with clang)
- It doesn't add warning that the casted variables are not used
On 2019-07-16 9:06, Steve Lhomme wrote:
> ---
> include/vlc_codec.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/vlc_codec.h b/include/vlc_codec.h
> index 86f092c029..118d1d059f 100644
> --- a/include/vlc_codec.h
> +++ b/include/vlc_codec.h
> @@ -534,6 +534,16 @@ typedef int (*vlc_decoder_device_Open)(vlc_decoder_device *device,
> /** "decoder device" module close entry point */
> typedef void (*vlc_decoder_device_Close)(vlc_decoder_device *device);
>
> +#define set_callbacks_dec_device(activate, deactivate, priority) \
> + { \
> + vlc_decoder_device_Open open__ = activate; \
> + vlc_decoder_device_Close close__ = deactivate; \
> + (void) open__; (void) close__; \
> + set_callbacks(activate, deactivate) \
> + } \
> + set_capability( "decoder device", priority )
> +
> +
> /**
> * Create a decoder device from a window
> *
> --
> 2.17.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list