[vlc-commits] avcodec: va: add a helper macro to set the module (typed) callback/priority
Steve Lhomme
git at videolan.org
Mon Jul 22 11:43:24 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jul 22 10:13:19 2019 +0200| [a08f24329ff42f7bb40a3210fe3d05375f1a8cc4] | committer: Steve Lhomme
avcodec: va: add a helper macro to set the module (typed) callback/priority
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a08f24329ff42f7bb40a3210fe3d05375f1a8cc4
---
modules/codec/avcodec/va.c | 3 +--
modules/codec/avcodec/va.h | 11 +++++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/va.c b/modules/codec/avcodec/va.c
index d491fed0e9..edfe3b6f43 100644
--- a/modules/codec/avcodec/va.c
+++ b/modules/codec/avcodec/va.c
@@ -95,8 +95,7 @@ static int vlc_va_Start(void *func, bool forced, va_list ap)
enum PixelFormat pix_fmt = va_arg(ap, enum PixelFormat);
const es_format_t *fmt = va_arg(ap, const es_format_t *);
void *p_sys = va_arg(ap, void *);
- int (*open)(vlc_va_t *, AVCodecContext *, enum PixelFormat,
- const es_format_t *, void *) = func;
+ vlc_va_open open = func;
(void) forced;
return open(va, ctx, pix_fmt, fmt, p_sys);
diff --git a/modules/codec/avcodec/va.h b/modules/codec/avcodec/va.h
index aeab69b34b..a03374c038 100644
--- a/modules/codec/avcodec/va.h
+++ b/modules/codec/avcodec/va.h
@@ -40,6 +40,17 @@ struct vlc_va_t {
const struct vlc_va_operations *ops;
};
+typedef int (*vlc_va_open)(vlc_va_t *, AVCodecContext *, enum PixelFormat,
+ const es_format_t *, void *);
+
+#define set_va_callback(activate, priority) \
+ { \
+ vlc_va_open open__ = activate; \
+ (void) open__; \
+ set_callback(activate) \
+ } \
+ set_capability( "hw decoder", priority )
+
/**
* Determines the VLC video chroma value for a pair of hardware acceleration
* PixelFormat and software PixelFormat.
More information about the vlc-commits
mailing list