From 2ec634bbfacb1f90850bb845e88559ae2958cbed Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 27 Aug 2024 10:31:04 +0200 Subject: [PATCH] added magic to change_pixfmt and cf/vo_pp wrap. --- src/capture_filter/change_pixfmt.c | 6 ++++++ src/vo_postprocess/capture_filter_wrapper.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/capture_filter/change_pixfmt.c b/src/capture_filter/change_pixfmt.c index 3f2862375..3d262427c 100644 --- a/src/capture_filter/change_pixfmt.c +++ b/src/capture_filter/change_pixfmt.c @@ -41,17 +41,22 @@ #include "config_win32.h" #endif /* HAVE_CONFIG_H */ +#include + #include "capture_filter.h" #include "debug.h" #include "lib_common.h" #include "utils/color_out.h" #include "video.h" #include "video_codec.h" +#include "utils/macros.h" #include "vo_postprocess/capture_filter_wrapper.h" +#define MAGIC to_fourcc('C', 'F', 'C', 'P') #define MOD_NAME "[change pixfmt cap. f.] " struct state_capture_filter_change_pixfmt { + uint32_t magic; codec_t to_codec; void *vo_pp_out_buffer; ///< buffer to write to if we use vo_pp wrapper (otherwise unused) }; @@ -68,6 +73,7 @@ static int init(struct module *parent, const char *cfg, void **state) } struct state_capture_filter_change_pixfmt *s = calloc(1, sizeof(struct state_capture_filter_change_pixfmt)); + s->magic = MAGIC; s->to_codec = get_codec_from_name(cfg); if (!s->to_codec) { log_msg(LOG_LEVEL_ERROR, MOD_NAME "Wrong codec: %s\n", cfg); diff --git a/src/vo_postprocess/capture_filter_wrapper.h b/src/vo_postprocess/capture_filter_wrapper.h index d27039f42..e0a738594 100644 --- a/src/vo_postprocess/capture_filter_wrapper.h +++ b/src/vo_postprocess/capture_filter_wrapper.h @@ -44,12 +44,17 @@ #define CAPTURE_FILTER_WRAPPER_H_4106D5BE_4B1D_4367_B506_67B358514C50 #include +#include #include "capture_filter.h" +#include "utils/macros.h" #include "video_display.h" #include "vo_postprocess.h" +#define CFW_MAGIC to_fourcc('V', 'P', 'C', 'F') + struct vo_pp_capture_filter_wrapper { + uint32_t magic; void *state; ///< capture filter state vo_postprocess_get_property_t get_property; struct video_frame *f; @@ -65,6 +70,7 @@ static void *CF_WRAPPER_MERGE(vo_pp_init_, name)(const char *cfg) {\ }\ struct vo_pp_capture_filter_wrapper *s = (struct vo_pp_capture_filter_wrapper *) \ calloc(1, sizeof(struct vo_pp_capture_filter_wrapper));\ + s->magic = CFW_MAGIC;\ s->state = state;\ s->get_property = get_prop_callb;\ return s;\