diff --git a/Makefile.in b/Makefile.in index 320518883..4135c09ed 100644 --- a/Makefile.in +++ b/Makefile.in @@ -652,10 +652,10 @@ rtsp_server: @RTSP_SERVER_LIB_TARGET@ $(LINKER) $(LDFLAGS) -shared -Wl,-soname,module_aplay_decklink.so $^ @DECKLINK_LIB@ -o $@ @SCALE_LIB_TARGET@: @SCALE_OBJ@ @GL_COMMON_OBJ@ @X_OBJ@ - $(LINKER) $(LDFLAGS) -shared -Wl,-soname,vo_pp_scale.so.@vo_pp_abi_version@ $^ @SCALE_LIB@ -o $@ + $(LINKER) $(LDFLAGS) -shared -Wl,-soname,module_vo_pp_scale.so $^ @SCALE_LIB@ -o $@ @TEXT_LIB_TARGET@: @TEXT_OBJ@ - $(LINKER) $(LDFLAGS) -shared -Wl,-soname,vo_pp_text.so.@vo_pp_abi_version@ $^ @TEXT_LIB@ -o $@ + $(LINKER) $(LDFLAGS) -shared -Wl,-soname,module_vo_pp_text.so $^ @TEXT_LIB@ -o $@ @V4L2_LIB_TARGET@: @V4L2_OBJ@ $(LINKER) $(LDFLAGS) -shared -Wl,-soname,module_vidcap_v4l2.so $^ @V4L2_LIBS@ -o $@ diff --git a/configure.ac b/configure.ac index 07f97a59a..5094e9003 100644 --- a/configure.ac +++ b/configure.ac @@ -441,10 +441,7 @@ then fi video_rxtx_abi_version=1 -vo_pp_abi_version=3 AC_DEFINE_UNQUOTED([VIDEO_RXTX_ABI_VERSION], $video_rxtx_abi_version, [Specifies ABI version for video transmission]) -AC_DEFINE_UNQUOTED([VO_PP_ABI_VERSION], $vo_pp_abi_version, [Specifies ABI version for video postprocess]) -AC_SUBST(vo_pp_abi_version) # ------------------------------------------------------------------------------------------------ # environment variables @@ -2521,7 +2518,7 @@ then scale=yes SCALE_LIB="$SCALE_LIB $OPENGL_LIB $X11_LIB" SCALE_OBJ="$SCALE_OBJ src/vo_postprocess/scale.o" - AC_SUBST(SCALE_LIB_TARGET, "lib/ultragrid/vo_pp_scale.so.$vo_pp_abi_version") + AC_SUBST(SCALE_LIB_TARGET, "lib/ultragrid/module_vo_pp_scale.so") LIB_TARGETS="$LIB_TARGETS $SCALE_LIB_TARGET" LIB_OBJS="$LIB_OBJS $SCALE_OBJ" AC_DEFINE([HAVE_SCALE], [1], [Build scale postprocessor]) @@ -2560,7 +2557,7 @@ then COMMON_FLAGS="$COMMON_FLAGS $TEXT_CFLAGS" TEXT_LIB="$TEXT_LIBS" TEXT_OBJ="$TEXT_OBJ src/vo_postprocess/text.o" - AC_SUBST(TEXT_LIB_TARGET, "lib/ultragrid/vo_pp_text.so.$vo_pp_abi_version") + AC_SUBST(TEXT_LIB_TARGET, "lib/ultragrid/module_vo_pp_text.so") LIB_TARGETS="$LIB_TARGETS $TEXT_LIB_TARGET" LIB_OBJS="$LIB_OBJS $TEXT_OBJ" AC_DEFINE([HAVE_TEXT], [1], [Build text postprocessor]) diff --git a/src/lib_common.cpp b/src/lib_common.cpp index 3050320bc..1bc2d8981 100644 --- a/src/lib_common.cpp +++ b/src/lib_common.cpp @@ -72,6 +72,7 @@ const map library_class_info = { { LIBRARY_CLASS_AUDIO_COMPRESS, { "Audio compression", "acompress" }}, { LIBRARY_CLASS_VIDEO_DECOMPRESS, { "Video decompression", "vdecompress" }}, { LIBRARY_CLASS_VIDEO_COMPRESS, { "Video compression", "vcompress" }}, + { LIBRARY_CLASS_VIDEO_POSTPROCESS, { "Video postprocess", "vo_pp" }}, }; static map lib_errors; diff --git a/src/lib_common.h b/src/lib_common.h index 59813b93b..e87046512 100644 --- a/src/lib_common.h +++ b/src/lib_common.h @@ -75,6 +75,7 @@ enum library_class { LIBRARY_CLASS_AUDIO_COMPRESS, LIBRARY_CLASS_VIDEO_DECOMPRESS, LIBRARY_CLASS_VIDEO_COMPRESS, + LIBRARY_CLASS_VIDEO_POSTPROCESS, }; void open_all(const char *pattern); const void *load_library(const char *name, enum library_class, int abi_version); diff --git a/src/vo_postprocess.c b/src/vo_postprocess.c index d0e9e1da0..d46474e44 100644 --- a/src/vo_postprocess.c +++ b/src/vo_postprocess.c @@ -53,195 +53,20 @@ #include #include -#include "vo_postprocess.h" -#include "vo_postprocess/deinterlace.h" -#include "vo_postprocess/interlace.h" -#include "vo_postprocess/double-framerate.h" -#include "vo_postprocess/scale.h" -#include "vo_postprocess/split.h" -#include "vo_postprocess/text.h" -#include "vo_postprocess/3d-interlaced.h" #include "lib_common.h" +#include "vo_postprocess.h" extern char **uv_argv; -struct vo_postprocess_t { - const char * name; /* this is the user given name */ - const char * library_name; /* must be NULL if library is allways statically lined */ - vo_postprocess_init_t init; - const char *init_str; - vo_postprocess_reconfigure_t reconfigure; - const char *reconfigure_str; - vo_postprocess_getf_t getf; - const char *getf_str; - vo_postprocess_get_out_desc_t get_out_desc; - const char *get_out_desc_str; - vo_postprocess_get_property_t get_property; - const char *get_property_str; - vo_postprocess_t vo_postprocess; - const char *vo_postprocess_str; - vo_postprocess_done_t done; - const char *done_str; - - void *handle; /* for dynamically loaded libraries */ -}; - struct vo_postprocess_state { - struct vo_postprocess_t *handle; + struct vo_postprocess_info *funcs; void *state; }; -struct vo_postprocess_t vo_postprocess_modules[] = { - {"deinterlace", - NULL, - MK_STATIC(deinterlace_init), - MK_STATIC(deinterlace_reconfigure), - MK_STATIC(deinterlace_getf), - MK_STATIC(deinterlace_get_out_desc), - MK_STATIC(deinterlace_get_property), - MK_STATIC(deinterlace_postprocess), - MK_STATIC(deinterlace_done), - NULL - }, - {"interlace", - NULL, - MK_STATIC(interlace_init), - MK_STATIC(interlace_reconfigure), - MK_STATIC(interlace_getf), - MK_STATIC(interlace_get_out_desc), - MK_STATIC(interlace_get_property), - MK_STATIC(interlace_postprocess), - MK_STATIC(interlace_done), - NULL - }, - {"double-framerate", - NULL, - MK_STATIC(df_init), - MK_STATIC(df_reconfigure), - MK_STATIC(df_getf), - MK_STATIC(df_get_out_desc), - MK_STATIC(df_get_property), - MK_STATIC(df_postprocess), - MK_STATIC(df_done), - NULL - }, -#if defined HAVE_SCALE || defined BUILD_LIBRARIES - {"scale", - "scale", - MK_NAME(scale_init), - MK_NAME(scale_reconfigure), - MK_NAME(scale_getf), - MK_NAME(scale_get_out_desc), - MK_NAME(scale_get_property), - MK_NAME(scale_postprocess), - MK_NAME(scale_done), - NULL - }, -#endif /* HAVE_SCREEN_CAP */ - {"split", - NULL, - MK_STATIC(split_init), - MK_STATIC(split_postprocess_reconfigure), - MK_STATIC(split_getf), - MK_STATIC(split_get_out_desc), - MK_STATIC(split_get_property), - MK_STATIC(split_postprocess), - MK_STATIC(split_done), - NULL - }, - {"3d-interlaced", - NULL, - MK_STATIC(interlaced_3d_init), - MK_STATIC(interlaced_3d_postprocess_reconfigure), - MK_STATIC(interlaced_3d_getf), - MK_STATIC(interlaced_3d_get_out_desc), - MK_STATIC(interlaced_3d_get_property), - MK_STATIC(interlaced_3d_postprocess), - MK_STATIC(interlaced_3d_done), - NULL - }, -#if defined HAVE_TEXT || defined BUILD_LIBRARIES - {"text", - "text", - MK_NAME(text_init), - MK_NAME(text_postprocess_reconfigure), - MK_NAME(text_getf), - MK_NAME(text_get_out_desc), - MK_NAME(text_get_property), - MK_NAME(text_postprocess), - MK_NAME(text_done), - NULL - }, -#endif - { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } -}; - - - -#ifdef BUILD_LIBRARIES -#include -/* definded in video_display.c */ -void *open_library(const char *name); -static void *vo_pp_open_library(const char *vidcap_name); -static int vo_pp_fill_symbols(struct vo_postprocess_t *device); - -static void *vo_pp_open_library(const char *vidcap_name) -{ - char name[128]; - snprintf(name, sizeof(name), "vo_pp_%s.so.%d", vidcap_name, VO_PP_ABI_VERSION); - - return open_library(name); -} - - -static int vo_pp_fill_symbols(struct vo_postprocess_t *device) -{ - void *handle = device->handle; - - device->init = (vo_postprocess_init_t) - dlsym(handle, device->init_str); - device->reconfigure = - (vo_postprocess_reconfigure_t ) - dlsym(handle, device->reconfigure_str); - device->getf = - (vo_postprocess_getf_t) - dlsym(handle, device->getf_str); - device->get_out_desc = - (vo_postprocess_get_out_desc_t) - dlsym(handle, device->get_out_desc_str); - device->get_property = - (vo_postprocess_get_property_t) - dlsym(handle, device->get_property_str); - device->vo_postprocess= - (vo_postprocess_t) - dlsym(handle, device->vo_postprocess_str); - device->done = - (vo_postprocess_done_t) - dlsym(handle, device->done_str); - - if(!device->init || !device->reconfigure || - !device->getf || - !device->get_out_desc || - !device->get_property || - !device->vo_postprocess || - !device->done) { - fprintf(stderr, "Library %s opening error: %s \n", device->library_name, dlerror()); - return FALSE; - } - - return TRUE; -} -#endif /* BUILD_LIBRARIES */ - - - void show_vo_postprocess_help() { - int i; printf("Possible postprocess modules:\n"); - for(i = 0; vo_postprocess_modules[i].name != NULL; ++i) - printf("\t%s\n", vo_postprocess_modules[i].name); + list_modules(LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); } struct vo_postprocess_state *vo_postprocess_init(char *config_string) @@ -259,41 +84,25 @@ struct vo_postprocess_state *vo_postprocess_init(char *config_string) } s = (struct vo_postprocess_state *) malloc(sizeof(struct vo_postprocess_state)); - s->handle = NULL; - int i; - for(i = 0; vo_postprocess_modules[i].name != NULL; ++i) { - if(strncasecmp(config_string, vo_postprocess_modules[i].name, - strlen(vo_postprocess_modules[i].name)) == 0) { - /* found it */ -#ifdef BUILD_LIBRARIES - if(vo_postprocess_modules[i].library_name) { - vo_postprocess_modules[i].handle = - vo_pp_open_library(vo_postprocess_modules[i].library_name); - if(!vo_postprocess_modules[i].handle) { - free(s); - fprintf(stderr, "Unable to load postprocess library.\n"); - return NULL; - } - int ret = vo_pp_fill_symbols(&vo_postprocess_modules[i]); - if(!ret) { - free(s); - fprintf(stderr, "Unable to load postprocess library.\n"); - return NULL; - } - } -#endif /* BUILD_LIBRARIES */ - s->handle = &vo_postprocess_modules[i]; - if(config_string[strlen(vo_postprocess_modules[i].name)] == ':') - vo_postprocess_options = config_string + - strlen(vo_postprocess_modules[i].name) + 1; - } + + char *lib_name = strdup(config_string); + if (strchr(lib_name, ':')) { + *strchr(lib_name, ':') = '\0'; } - if(!s->handle) { - fprintf(stderr, "Unknown postprocess module: %s\n", config_string); + + const struct vo_postprocess_info *funcs = load_library(lib_name, LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); + if (!funcs) { + fprintf(stderr, "Unknown postprocess module: %s\n", lib_name); free(s); + free(lib_name); return NULL; } - s->state = s->handle->init(vo_postprocess_options); + free(lib_name); + + s->funcs = funcs; + if (strchr(config_string, ':')) + vo_postprocess_options = strchr(config_string, ':') + 1; + s->state = s->funcs->init(vo_postprocess_options); if(!s->state) { fprintf(stderr, "Postprocessing initialization failed: %s\n", config_string); free(s); @@ -306,7 +115,7 @@ int vo_postprocess_reconfigure(struct vo_postprocess_state *s, struct video_desc desc) { if(s) { - return s->handle->reconfigure(s->state, desc); + return s->funcs->reconfigure(s->state, desc); } else { return FALSE; } @@ -315,7 +124,7 @@ int vo_postprocess_reconfigure(struct vo_postprocess_state *s, struct video_frame * vo_postprocess_getf(struct vo_postprocess_state *s) { if(s) { - return s->handle->getf(s->state); + return s->funcs->getf(s->state); } else { return NULL; } @@ -325,24 +134,24 @@ bool vo_postprocess(struct vo_postprocess_state *s, struct video_frame *in, struct video_frame *out, int req_pitch) { if(s) - return s->handle->vo_postprocess(s->state, in, out, req_pitch); + return s->funcs->vo_postprocess(s->state, in, out, req_pitch); else return false; } void vo_postprocess_done(struct vo_postprocess_state *s) { - if(s) s->handle->done(s->state); + if(s) s->funcs->done(s->state); } void vo_postprocess_get_out_desc(struct vo_postprocess_state *s, struct video_desc *out, int *display_mode, int *out_frames_count) { - if(s) s->handle->get_out_desc(s->state, out, display_mode, out_frames_count); + if(s) s->funcs->get_out_desc(s->state, out, display_mode, out_frames_count); } bool vo_postprocess_get_property(struct vo_postprocess_state *s, int property, void *val, size_t *len) { - if(s) return s->handle->get_property(s, property, val, len); + if(s) return s->funcs->get_property(s, property, val, len); else return false; } diff --git a/src/vo_postprocess.h b/src/vo_postprocess.h index 0c38e8c54..d28bd4412 100644 --- a/src/vo_postprocess.h +++ b/src/vo_postprocess.h @@ -58,6 +58,8 @@ extern "C" { #define VO_PP_PROPERTY_CODECS 0 /* codec_t[] all uncompressed */ #define VO_PP_DOES_CHANGE_TILING_MODE 1 /* bool false */ +#define VO_PP_ABI_VERSION 4 + struct vo_postprocess_state; typedef void *(*vo_postprocess_init_t)(char *cfg); @@ -119,6 +121,17 @@ typedef bool (*vo_postprocess_t)(void *state, struct video_frame *in, struct vid */ typedef void (*vo_postprocess_done_t)(void *); + +struct vo_postprocess_info { + vo_postprocess_init_t init; + vo_postprocess_reconfigure_t reconfigure; + vo_postprocess_getf_t getf; + vo_postprocess_get_out_desc_t get_out_desc; + vo_postprocess_get_property_t get_property; + vo_postprocess_t vo_postprocess; + vo_postprocess_done_t done; +}; + /** * Semantic and parameters of following functions is same as their typedef counterparts */ diff --git a/src/vo_postprocess/3d-interlaced.c b/src/vo_postprocess/3d-interlaced.c index f9e9d020c..929706cda 100644 --- a/src/vo_postprocess/3d-interlaced.c +++ b/src/vo_postprocess/3d-interlaced.c @@ -55,15 +55,16 @@ #include #include "debug.h" +#include "lib_common.h" #include "video.h" #include "video_display.h" /* DISPLAY_PROPERTY_VIDEO_SEPARATE_FILES */ -#include "vo_postprocess/3d-interlaced.h" +#include "vo_postprocess.h" struct state_interlaced_3d { struct video_frame *in; }; -bool interlaced_3d_get_property(void *state, int property, void *val, size_t *len) +static bool interlaced_3d_get_property(void *state, int property, void *val, size_t *len) { UNUSED(state); UNUSED(property); @@ -74,7 +75,7 @@ bool interlaced_3d_get_property(void *state, int property, void *val, size_t *le } -void * interlaced_3d_init(char *config) { +static void * interlaced_3d_init(char *config) { struct state_interlaced_3d *s; if(config && strcmp(config, "help") == 0) { @@ -88,7 +89,7 @@ void * interlaced_3d_init(char *config) { return s; } -int interlaced_3d_postprocess_reconfigure(void *state, struct video_desc desc) +static int interlaced_3d_postprocess_reconfigure(void *state, struct video_desc desc) { struct state_interlaced_3d *s = (struct state_interlaced_3d *) state; @@ -111,7 +112,7 @@ int interlaced_3d_postprocess_reconfigure(void *state, struct video_desc desc) return TRUE; } -struct video_frame * interlaced_3d_getf(void *state) +static struct video_frame * interlaced_3d_getf(void *state) { struct state_interlaced_3d *s = (struct state_interlaced_3d *) state; @@ -126,7 +127,7 @@ struct video_frame * interlaced_3d_getf(void *state) * @param[out] out output frame to be written to. Should have only ony tile * @param[in] req_pitch requested pitch in buffer */ -bool interlaced_3d_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) +static bool interlaced_3d_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) { UNUSED (state); UNUSED (req_pitch); @@ -164,7 +165,7 @@ bool interlaced_3d_postprocess(void *state, struct video_frame *in, struct video return true; } -void interlaced_3d_done(void *state) +static void interlaced_3d_done(void *state) { struct state_interlaced_3d *s = (struct state_interlaced_3d *) state; @@ -174,7 +175,7 @@ void interlaced_3d_done(void *state) free(state); } -void interlaced_3d_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) +static void interlaced_3d_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) { struct state_interlaced_3d *s = (struct state_interlaced_3d *) state; @@ -189,3 +190,15 @@ void interlaced_3d_get_out_desc(void *state, struct video_desc *out, int *in_dis *out_frames = 1; } +static const struct vo_postprocess_info vo_pp_interlaced_3d_info = { + interlaced_3d_init, + interlaced_3d_postprocess_reconfigure, + interlaced_3d_getf, + interlaced_3d_get_out_desc, + interlaced_3d_get_property, + interlaced_3d_postprocess, + interlaced_3d_done, +}; + +REGISTER_MODULE(interlaced_3d, &vo_pp_interlaced_3d_info, LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); + diff --git a/src/vo_postprocess/3d-interlaced.h b/src/vo_postprocess/3d-interlaced.h deleted file mode 100644 index 90abc0b0c..000000000 --- a/src/vo_postprocess/3d-interlaced.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * FILE: video_decompress/dxt_glsl.c - * AUTHORS: Martin Benes - * Lukas Hejtmanek - * Petr Holub - * Milos Liska - * Jiri Matela - * Dalibor Matura <255899@mail.muni.cz> - * Ian Wesley-Smith - * - * Copyright (c) 2005-2010 CESNET z.s.p.o. - * - * Redistribution and use in source and binary forms, with or without - * modification, is permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * - * This product includes software developed by CESNET z.s.p.o. - * - * 4. Neither the name of the CESNET nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "types.h" - -void * interlaced_3d_init(char *config); -bool interlaced_3d_get_property(void *state, int property, void *val, size_t *len); - -int interlaced_3d_postprocess_reconfigure(void *state, struct video_desc desc); -struct video_frame * interlaced_3d_getf(void *state); -void interlaced_3d_get_out_desc(void *state, struct video_desc *out, int *display_mode, int *out_frames); -bool interlaced_3d_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch); -void interlaced_3d_done(void *state); - diff --git a/src/vo_postprocess/deinterlace.cpp b/src/vo_postprocess/deinterlace.cpp index 5462dce2e..cedd2d821 100644 --- a/src/vo_postprocess/deinterlace.cpp +++ b/src/vo_postprocess/deinterlace.cpp @@ -44,9 +44,10 @@ #include #include +#include "lib_common.h" #include "video.h" #include "video_display.h" -#include "vo_postprocess/deinterlace.h" +#include "vo_postprocess.h" struct state_deinterlace { struct video_frame *out; @@ -58,7 +59,7 @@ static void usage() printf("\t-p deinterlace\n"); } -void * deinterlace_init(char *config) { +static void * deinterlace_init(char *config) { if(config && strcmp(config, "help") == 0) { usage(); return NULL; @@ -69,12 +70,12 @@ void * deinterlace_init(char *config) { return s; } -bool deinterlace_get_property(void *, int, void *, size_t *) +static bool deinterlace_get_property(void *, int, void *, size_t *) { return false; } -int deinterlace_reconfigure(void *state, struct video_desc desc) +static int deinterlace_reconfigure(void *state, struct video_desc desc) { struct state_deinterlace *s = (struct state_deinterlace *) state; @@ -85,14 +86,14 @@ int deinterlace_reconfigure(void *state, struct video_desc desc) return TRUE; } -struct video_frame * deinterlace_getf(void *state) +static struct video_frame * deinterlace_getf(void *state) { struct state_deinterlace *s = (struct state_deinterlace *) state; return s->out; } -bool deinterlace_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) +static bool deinterlace_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) { UNUSED(state); assert (req_pitch == vc_get_linesize(in->tiles[0].width, in->color_spec)); @@ -107,7 +108,7 @@ bool deinterlace_postprocess(void *state, struct video_frame *in, struct video_f return true; } -void deinterlace_done(void *state) +static void deinterlace_done(void *state) { struct state_deinterlace *s = (struct state_deinterlace *) state; @@ -115,7 +116,7 @@ void deinterlace_done(void *state) delete s; } -void deinterlace_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) +static void deinterlace_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) { struct state_deinterlace *s = (struct state_deinterlace *) state; @@ -126,3 +127,15 @@ void deinterlace_get_out_desc(void *state, struct video_desc *out, int *in_displ *out_frames = 1; } +static const struct vo_postprocess_info vo_pp_deinterlace_info = { + deinterlace_init, + deinterlace_reconfigure, + deinterlace_getf, + deinterlace_get_out_desc, + deinterlace_get_property, + deinterlace_postprocess, + deinterlace_done, +}; + +REGISTER_MODULE(deinterlace, &vo_pp_deinterlace_info, LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); + diff --git a/src/vo_postprocess/deinterlace.h b/src/vo_postprocess/deinterlace.h deleted file mode 100644 index 8286fa891..000000000 --- a/src/vo_postprocess/deinterlace.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file vo_postprocess/deinterlace.h - * @author Martin Pulec - */ -/* - * Copyright (c) 2014 CESNET, z. s. p. o. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, is permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of CESNET nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -void * deinterlace_init(char *config); -bool deinterlace_get_property(void *state, int property, void *val, size_t *len); -int deinterlace_reconfigure(void *state, struct video_desc desc); -struct video_frame * deinterlace_getf(void *state); -void deinterlace_get_out_desc(void *state, struct video_desc *out, int *display_mode, int *out_frames); -bool deinterlace_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch); -void deinterlace_done(void *state); - -#ifdef __cplusplus -} -#endif - diff --git a/src/vo_postprocess/double-framerate.c b/src/vo_postprocess/double-framerate.c index 8621f9400..213ea9604 100644 --- a/src/vo_postprocess/double-framerate.c +++ b/src/vo_postprocess/double-framerate.c @@ -55,9 +55,10 @@ #include #include "debug.h" +#include "lib_common.h" #include "video.h" #include "video_display.h" -#include "vo_postprocess/double-framerate.h" +#include "vo_postprocess.h" struct state_df { struct video_frame *in; @@ -70,7 +71,7 @@ static void usage() printf("-p double_framerate\n"); } -void * df_init(char *config) { +static void * df_init(char *config) { struct state_df *s; if(config && strcmp(config, "help") == 0) { @@ -89,7 +90,7 @@ void * df_init(char *config) { return s; } -bool df_get_property(void *state, int property, void *val, size_t *len) +static bool df_get_property(void *state, int property, void *val, size_t *len) { UNUSED(state); UNUSED(property); @@ -99,7 +100,7 @@ bool df_get_property(void *state, int property, void *val, size_t *len) return false; } -int df_reconfigure(void *state, struct video_desc desc) +static int df_postprocess_reconfigure(void *state, struct video_desc desc) { struct state_df *s = (struct state_df *) state; struct tile *in_tile = vf_get_tile(s->in, 0); @@ -129,7 +130,7 @@ int df_reconfigure(void *state, struct video_desc desc) return TRUE; } -struct video_frame * df_getf(void *state) +static struct video_frame * df_getf(void *state) { struct state_df *s = (struct state_df *) state; @@ -139,7 +140,7 @@ struct video_frame * df_getf(void *state) return s->in; } -bool df_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) +static bool df_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) { struct state_df *s = (struct state_df *) state; unsigned int y; @@ -172,7 +173,7 @@ bool df_postprocess(void *state, struct video_frame *in, struct video_frame *out return true; } -void df_done(void *state) +static void df_done(void *state) { struct state_df *s = (struct state_df *) state; @@ -182,7 +183,7 @@ void df_done(void *state) free(state); } -void df_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) +static void df_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) { struct state_df *s = (struct state_df *) state; @@ -196,3 +197,16 @@ void df_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, *in_display_mode = DISPLAY_PROPERTY_VIDEO_MERGED; *out_frames = 2; } + +static const struct vo_postprocess_info vo_pp_df_info = { + df_init, + df_postprocess_reconfigure, + df_getf, + df_get_out_desc, + df_get_property, + df_postprocess, + df_done, +}; + +REGISTER_MODULE(double_framerate, &vo_pp_df_info, LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); + diff --git a/src/vo_postprocess/double-framerate.h b/src/vo_postprocess/double-framerate.h deleted file mode 100644 index 9ee58ae59..000000000 --- a/src/vo_postprocess/double-framerate.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * FILE: vo_postprocess/double-framerate.h - * AUTHORS: Martin Benes - * Lukas Hejtmanek - * Petr Holub - * Milos Liska - * Jiri Matela - * Dalibor Matura <255899@mail.muni.cz> - * Ian Wesley-Smith - * - * Copyright (c) 2005-2010 CESNET z.s.p.o. - * - * Redistribution and use in source and binary forms, with or without - * modification, is permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * - * This product includes software developed by CESNET z.s.p.o. - * - * 4. Neither the name of the CESNET nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "types.h" - -void * df_init(char *config); -bool df_get_property(void *state, int property, void *val, size_t *len); - -int df_reconfigure(void *state, struct video_desc desc); -struct video_frame * df_getf(void *state); -void df_get_out_desc(void *state, struct video_desc *out, int *display_mode, int *out_frames); -bool df_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch); -void df_done(void *state); - diff --git a/src/vo_postprocess/interlace.c b/src/vo_postprocess/interlace.c index 24b4b0fe4..a81a74e7f 100644 --- a/src/vo_postprocess/interlace.c +++ b/src/vo_postprocess/interlace.c @@ -54,9 +54,10 @@ #include #include +#include "lib_common.h" #include "video.h" #include "video_display.h" -#include "vo_postprocess/interlace.h" +#include "vo_postprocess.h" enum last_frame { ODD = 0, @@ -75,7 +76,7 @@ static void usage() printf("-p interlace\n"); } -void * interlace_init(char *config) { +static void * interlace_init(char *config) { struct state_interlace *s; if(config && strcmp(config, "help") == 0) { @@ -94,7 +95,7 @@ void * interlace_init(char *config) { return s; } -bool interlace_get_property(void *state, int property, void *val, size_t *len) +static bool interlace_get_property(void *state, int property, void *val, size_t *len) { UNUSED(state); UNUSED(property); @@ -104,7 +105,7 @@ bool interlace_get_property(void *state, int property, void *val, size_t *len) return false; } -int interlace_reconfigure(void *state, struct video_desc desc) +static int interlace_reconfigure(void *state, struct video_desc desc) { struct state_interlace *s = (struct state_interlace *) state; @@ -118,7 +119,7 @@ int interlace_reconfigure(void *state, struct video_desc desc) return TRUE; } -struct video_frame * interlace_getf(void *state) +static struct video_frame * interlace_getf(void *state) { struct state_interlace *s = (struct state_interlace *) state; struct video_frame *ret; @@ -134,7 +135,7 @@ struct video_frame * interlace_getf(void *state) return ret; } -bool interlace_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) +static bool interlace_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) { struct state_interlace *s = (struct state_interlace *) state; @@ -158,7 +159,7 @@ bool interlace_postprocess(void *state, struct video_frame *in, struct video_fra return true; } -void interlace_done(void *state) +static void interlace_done(void *state) { struct state_interlace *s = (struct state_interlace *) state; @@ -168,7 +169,7 @@ void interlace_done(void *state) free(state); } -void interlace_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) +static void interlace_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) { struct state_interlace *s = (struct state_interlace *) state; @@ -183,3 +184,16 @@ void interlace_get_out_desc(void *state, struct video_desc *out, int *in_display //*in_display_mode = DISPLAY_PROPERTY_VIDEO_MERGED; *out_frames = 1; } + +static const struct vo_postprocess_info vo_pp_interlace_info = { + interlace_init, + interlace_reconfigure, + interlace_getf, + interlace_get_out_desc, + interlace_get_property, + interlace_postprocess, + interlace_done, +}; + +REGISTER_MODULE(interlace, &vo_pp_interlace_info, LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); + diff --git a/src/vo_postprocess/interlace.h b/src/vo_postprocess/interlace.h deleted file mode 100644 index 34d4c5f6f..000000000 --- a/src/vo_postprocess/interlace.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * FILE: vo_postprocess/interlace.h - * AUTHORS: Martin Benes - * Lukas Hejtmanek - * Petr Holub - * Milos Liska - * Jiri Matela - * Dalibor Matura <255899@mail.muni.cz> - * Ian Wesley-Smith - * - * Copyright (c) 2005-2010 CESNET z.s.p.o. - * - * Redistribution and use in source and binary forms, with or without - * modification, is permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * - * This product includes software developed by CESNET z.s.p.o. - * - * 4. Neither the name of the CESNET nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "types.h" - -void * interlace_init(char *config); -bool interlace_get_property(void *state, int property, void *val, size_t *len); - -int interlace_reconfigure(void *state, struct video_desc desc); -struct video_frame * interlace_getf(void *state); -void interlace_get_out_desc(void *state, struct video_desc *out, int *display_mode, int *out_frames); -bool interlace_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch); -void interlace_done(void *state); - diff --git a/src/vo_postprocess/scale.c b/src/vo_postprocess/scale.c index b7354841c..0191ca7c4 100644 --- a/src/vo_postprocess/scale.c +++ b/src/vo_postprocess/scale.c @@ -55,11 +55,11 @@ #include #include "debug.h" +#include "lib_common.h" #include "gl_context.h" #include "video.h" #include "video_display.h" #include "vo_postprocess.h" -#include "vo_postprocess/scale.h" struct state_scale { struct video_frame *in; @@ -71,7 +71,7 @@ struct state_scale { GLuint fbo; }; -bool scale_get_property(void *state, int property, void *val, size_t *len) +static bool scale_get_property(void *state, int property, void *val, size_t *len) { bool ret = false; codec_t supported[] = {UYVY, RGBA}; @@ -100,7 +100,7 @@ static void usage() printf("\t-p scale:width:height\n"); } -void * scale_init(char *config) { +static void * scale_init(char *config) { struct state_scale *s; char *save_ptr = NULL; char *ptr; @@ -152,7 +152,7 @@ void * scale_init(char *config) { return s; } -int scale_reconfigure(void *state, struct video_desc desc) +static int scale_reconfigure(void *state, struct video_desc desc) { struct state_scale *s = (struct state_scale *) state; struct tile *in_tile; @@ -221,14 +221,14 @@ int scale_reconfigure(void *state, struct video_desc desc) return TRUE; } -struct video_frame * scale_getf(void *state) +static struct video_frame * scale_getf(void *state) { struct state_scale *s = (struct state_scale *) state; return s->in; } -bool scale_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) +static bool scale_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) { struct state_scale *s = (struct state_scale *) state; int i; @@ -307,7 +307,7 @@ bool scale_postprocess(void *state, struct video_frame *in, struct video_frame * return true; } -void scale_done(void *state) +static void scale_done(void *state) { struct state_scale *s = (struct state_scale *) state; @@ -324,7 +324,7 @@ void scale_done(void *state) free(state); } -void scale_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) +static void scale_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) { struct state_scale *s = (struct state_scale *) state; @@ -339,3 +339,15 @@ void scale_get_out_desc(void *state, struct video_desc *out, int *in_display_mod *out_frames = 1; } +static const struct vo_postprocess_info vo_pp_scale_info = { + scale_init, + scale_reconfigure, + scale_getf, + scale_get_out_desc, + scale_get_property, + scale_postprocess, + scale_done, +}; + +REGISTER_MODULE(scale, &vo_pp_scale_info, LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); + diff --git a/src/vo_postprocess/scale.h b/src/vo_postprocess/scale.h deleted file mode 100644 index 2af53d9ed..000000000 --- a/src/vo_postprocess/scale.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * FILE: vo_postprocess/scale.h - * AUTHORS: Martin Benes - * Lukas Hejtmanek - * Petr Holub - * Milos Liska - * Jiri Matela - * Dalibor Matura <255899@mail.muni.cz> - * Ian Wesley-Smith - * - * Copyright (c) 2005-2010 CESNET z.s.p.o. - * - * Redistribution and use in source and binary forms, with or without - * modification, is permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * - * This product includes software developed by CESNET z.s.p.o. - * - * 4. Neither the name of the CESNET nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "types.h" - -void * scale_init(char *config); -bool scale_get_property(void *state, int property, void *val, size_t *len); - -int scale_reconfigure(void *state, struct video_desc desc); -struct video_frame * scale_getf(void *state); -void scale_get_out_desc(void *state, struct video_desc *out, int *display_mode, int *out_frames); -bool scale_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch); -void scale_done(void *state); - diff --git a/src/vo_postprocess/split.c b/src/vo_postprocess/split.c index eaf8062a5..f92a51a81 100644 --- a/src/vo_postprocess/split.c +++ b/src/vo_postprocess/split.c @@ -52,13 +52,13 @@ #endif // HAVE_CONFIG_H #include "debug.h" +#include "lib_common.h" #include "utils/vf_split.h" #include "video.h" #include "video_display.h" /* DISPLAY_PROPERTY_VIDEO_SEPARATE_FILES */ #include "vo_postprocess.h" /* VO_PP_DOES_CHANGE_TILING_MODE */ #include #include -#include "vo_postprocess/split.h" struct state_split { struct video_frame *in; @@ -66,7 +66,7 @@ struct state_split { }; -bool split_get_property(void *state, int property, void *val, size_t *len) +static bool split_get_property(void *state, int property, void *val, size_t *len) { bool ret; @@ -95,7 +95,7 @@ static void usage() printf("\tsplit to XxY tiles\n"); } -void * split_init(char *config) { +static void * split_init(char *config) { struct state_split *s; char *save_ptr = NULL; char *item; @@ -123,7 +123,7 @@ void * split_init(char *config) { return s; } -int split_postprocess_reconfigure(void *state, struct video_desc desc) +static int split_postprocess_reconfigure(void *state, struct video_desc desc) { struct state_split *s = (struct state_split *) state; struct tile *in_tile = vf_get_tile(s->in, 0); @@ -142,14 +142,14 @@ int split_postprocess_reconfigure(void *state, struct video_desc desc) return TRUE; } -struct video_frame * split_getf(void *state) +static struct video_frame * split_getf(void *state) { struct state_split *s = (struct state_split *) state; return s->in; } -bool split_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) +static bool split_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) { struct state_split *s = (struct state_split *) state; UNUSED(req_pitch); @@ -159,7 +159,7 @@ bool split_postprocess(void *state, struct video_frame *in, struct video_frame * return true; } -void split_done(void *state) +static void split_done(void *state) { struct state_split *s = (struct state_split *) state; @@ -168,7 +168,7 @@ void split_done(void *state) free(state); } -void split_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) +static void split_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) { struct state_split *s = (struct state_split *) state; @@ -183,3 +183,15 @@ void split_get_out_desc(void *state, struct video_desc *out, int *in_display_mod *out_frames = 1; } +static const struct vo_postprocess_info vo_pp_split_info = { + split_init, + split_postprocess_reconfigure, + split_getf, + split_get_out_desc, + split_get_property, + split_postprocess, + split_done, +}; + +REGISTER_MODULE(split, &vo_pp_split_info, LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); + diff --git a/src/vo_postprocess/split.h b/src/vo_postprocess/split.h deleted file mode 100644 index 43afd0535..000000000 --- a/src/vo_postprocess/split.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * FILE: video_decompress/dxt_glsl.c - * AUTHORS: Martin Benes - * Lukas Hejtmanek - * Petr Holub - * Milos Liska - * Jiri Matela - * Dalibor Matura <255899@mail.muni.cz> - * Ian Wesley-Smith - * - * Copyright (c) 2005-2010 CESNET z.s.p.o. - * - * Redistribution and use in source and binary forms, with or without - * modification, is permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * - * This product includes software developed by CESNET z.s.p.o. - * - * 4. Neither the name of the CESNET nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "types.h" - -void * split_init(char *config); -bool split_get_property(void *state, int property, void *val, size_t *len); - -int split_postprocess_reconfigure(void *state, struct video_desc desc); -struct video_frame * split_getf(void *state); -void split_get_out_desc(void *state, struct video_desc *out, int *display_mode, int *out_frames); -bool split_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch); -void split_done(void *state); - diff --git a/src/vo_postprocess/text.cpp b/src/vo_postprocess/text.cpp index 0dd423d62..b8989da9d 100644 --- a/src/vo_postprocess/text.cpp +++ b/src/vo_postprocess/text.cpp @@ -50,9 +50,10 @@ #include #include "debug.h" +#include "lib_common.h" #include "video.h" #include "video_display.h" -#include "vo_postprocess/text.h" +#include "vo_postprocess.h" #include "tv.h" @@ -68,7 +69,7 @@ struct state_text { MagickWand *wand; }; -bool text_get_property(void *state, int property, void *val, size_t *len) +static bool text_get_property(void *state, int property, void *val, size_t *len) { UNUSED(state); UNUSED(property); @@ -90,7 +91,7 @@ static void init_text() { } -void * text_init(char *config) { +static void * text_init(char *config) { pthread_once(&vo_postprocess_text_initialized, init_text); struct state_text *s; @@ -108,7 +109,7 @@ void * text_init(char *config) { return s; } -int text_postprocess_reconfigure(void *state, struct video_desc desc) +static int text_postprocess_reconfigure(void *state, struct video_desc desc) { struct state_text *s = (struct state_text *) state; @@ -185,7 +186,7 @@ int text_postprocess_reconfigure(void *state, struct video_desc desc) return TRUE; } -struct video_frame * text_getf(void *state) +static struct video_frame * text_getf(void *state) { struct state_text *s = (struct state_text *) state; @@ -197,7 +198,7 @@ struct video_frame * text_getf(void *state) * Rendering of the text is a bit slow. Since the text doesn't change at all, it should be * prerendered and then only alpha blended. */ -bool text_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) +static bool text_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch) { struct state_text *s = (struct state_text *) state; @@ -247,7 +248,7 @@ bool text_postprocess(void *state, struct video_frame *in, struct video_frame *o return true; } -void text_done(void *state) +static void text_done(void *state) { struct state_text *s = (struct state_text *) state; @@ -259,7 +260,7 @@ void text_done(void *state) delete s; } -void text_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) +static void text_get_out_desc(void *state, struct video_desc *out, int *in_display_mode, int *out_frames) { struct state_text *s = (struct state_text *) state; @@ -269,3 +270,15 @@ void text_get_out_desc(void *state, struct video_desc *out, int *in_display_mode *out_frames = 1; } +static const struct vo_postprocess_info vo_pp_text_info = { + text_init, + text_postprocess_reconfigure, + text_getf, + text_get_out_desc, + text_get_property, + text_postprocess, + text_done, +}; + +REGISTER_MODULE(text, &vo_pp_text_info, LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); + diff --git a/src/vo_postprocess/text.h b/src/vo_postprocess/text.h deleted file mode 100644 index e28449f65..000000000 --- a/src/vo_postprocess/text.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file vo_postprocess/text.h - * @author Martin Pulec - */ -/* - * Copyright (c) 2014 CESNET, z. s. p. o. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, is permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of CESNET nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -void * text_init(char *config); -bool text_get_property(void *state, int property, void *val, size_t *len); -int text_postprocess_reconfigure(void *state, struct video_desc desc); -struct video_frame * text_getf(void *state); -void text_get_out_desc(void *state, struct video_desc *out, int *display_mode, int *out_frames); -bool text_postprocess(void *state, struct video_frame *in, struct video_frame *out, int req_pitch); -void text_done(void *state); - -#ifdef __cplusplus -} -#endif -