[vlc-devel] [PATCH 1/3] decoder device: add a helper macro to set the module callbacks/priority

Steve Lhomme robux4 at ycbcr.xyz
Mon Jul 15 13:55:56 CEST 2019


---
 include/vlc_codec.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index 86f092c029..087426e7a4 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -534,6 +534,15 @@ 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; \
+        set_callbacks(open__, close__); \
+    } \
+    set_capability( "decoder device", priority )
+
+
 /**
  * Create a decoder device from a window
  *
-- 
2.17.1



More information about the vlc-devel mailing list