From 75fd88c7c36be695d0b5417bbdbc22b8a60315ce Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 6 Nov 2019 14:14:20 +0100 Subject: [PATCH] Show hidden modules when fullhelp is given + updated copyrights in that files --- src/audio/audio_capture.c | 6 +++--- src/audio/audio_capture.h | 37 ++++++++++++++---------------------- src/audio/audio_playback.c | 6 +++--- src/audio/audio_playback.h | 39 ++++++++++++++------------------------ src/lib_common.cpp | 10 +++++++--- src/lib_common.h | 4 ++-- src/main.cpp | 22 ++++++++++----------- src/video_capture.cpp | 4 ++-- src/video_capture.h | 2 +- src/video_compress.cpp | 11 +++++------ src/video_compress.h | 2 +- src/video_display.c | 10 +++++----- src/video_display.h | 4 ++-- src/video_rxtx.cpp | 6 +++--- src/vo_postprocess.c | 11 +++++------ src/vo_postprocess.h | 32 +++++++++++-------------------- 16 files changed, 89 insertions(+), 117 deletions(-) diff --git a/src/audio/audio_capture.c b/src/audio/audio_capture.c index c50711eb9..f0e29525e 100644 --- a/src/audio/audio_capture.c +++ b/src/audio/audio_capture.c @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2015 CESNET, z. s. p. o. + * Copyright (c) 2015-2019 CESNET, z. s. p. o. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -107,10 +107,10 @@ struct state_audio_capture *audio_capture_init_null_device() return device; } -void audio_capture_print_help() +void audio_capture_print_help(bool full) { printf("Available audio capture devices:\n"); - list_modules(LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION); + list_modules(LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION, full); } void audio_capture_done(struct state_audio_capture *s) diff --git a/src/audio/audio_capture.h b/src/audio/audio_capture.h index 7e756551a..376f4806f 100644 --- a/src/audio/audio_capture.h +++ b/src/audio/audio_capture.h @@ -1,35 +1,26 @@ +/** + * @file audio/audio_capture.h + * @author Martin Pulec + */ /* - * FILE: audio/audio_capture.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. + * Copyright (c) 2012-2019 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. 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 CESNET nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * + * + * 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 @@ -65,7 +56,7 @@ struct audio_frame; void audio_capture_init_devices(void); -void audio_capture_print_help(void); +void audio_capture_print_help(bool); /** * @see display_init diff --git a/src/audio/audio_playback.c b/src/audio/audio_playback.c index f474a2b3c..302fcba9b 100644 --- a/src/audio/audio_playback.c +++ b/src/audio/audio_playback.c @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2015 CESNET, z. s. p. o. + * Copyright (c) 2015-2019 CESNET, z. s. p. o. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,10 +62,10 @@ struct state_audio_playback { void *state; }; -void audio_playback_help() +void audio_playback_help(bool full) { printf("Available audio playback devices:\n"); - list_modules(LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION); + list_modules(LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION, full); } int audio_playback_init(const char *device, const char *cfg, struct state_audio_playback **state) diff --git a/src/audio/audio_playback.h b/src/audio/audio_playback.h index e07af3160..90830cead 100644 --- a/src/audio/audio_playback.h +++ b/src/audio/audio_playback.h @@ -1,35 +1,26 @@ +/** + * @file audio/audio_playback.h + * @author Martin Pulec + */ /* - * FILE: audio/audio_playback.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. + * Copyright (c) 2012-2019 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. 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 CESNET nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * + * + * 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 @@ -42,8 +33,6 @@ * 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" @@ -97,7 +86,7 @@ struct audio_playback_info { struct state_audio_playback; -void audio_playback_help(void); +void audio_playback_help(bool full); void audio_playback_init_devices(void); /** * @see display_init diff --git a/src/lib_common.cpp b/src/lib_common.cpp index 41e7b4d8d..8a199cadc 100644 --- a/src/lib_common.cpp +++ b/src/lib_common.cpp @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2012-2015 CESNET, z. s. p. o. + * Copyright (c) 2012-2019 CESNET, z. s. p. o. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -293,8 +293,12 @@ const void *load_library(const char *name, enum library_class cls, int abi_versi return NULL; } -void list_modules(enum library_class cls, int abi_version) { - const auto & class_set = get_libraries_for_class(cls, abi_version, false); +/** + * Prints list of modules of given class + * @param full include hidden modules + */ +void list_modules(enum library_class cls, int abi_version, bool full) { + const auto & class_set = get_libraries_for_class(cls, abi_version, full); for (auto && item : class_set) { cout << rang::style::bold << "\t" << item.first.c_str() << "\n" << rang::style::reset; } diff --git a/src/lib_common.h b/src/lib_common.h index f4c66ac7a..37572255b 100644 --- a/src/lib_common.h +++ b/src/lib_common.h @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2011-2015 CESNET, z. s. p. o. + * Copyright (c) 2011-2019 CESNET, z. s. p. o. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,7 +81,7 @@ enum library_class { void open_all(const char *pattern); const void *load_library(const char *name, enum library_class, int abi_version); void register_library(const char *name, const void *info, enum library_class, int abi_version, int hidden); -void list_modules(enum library_class, int abi_version); +void list_modules(enum library_class, int abi_version, bool full); void list_all_modules(); #ifdef __cplusplus } diff --git a/src/main.cpp b/src/main.cpp index 1dee90f66..51d188fdd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,8 +14,8 @@ * Gerard Castillo * Martin Pulec * + * Copyright (c) 2005-2019 CESNET z.s.p.o. * Copyright (c) 2005-2014 Fundació i2CAT, Internet I Innovació Digital a Catalunya - * Copyright (c) 2005-2018 CESNET z.s.p.o. * Copyright (c) 2001-2004 University of Southern California * Copyright (c) 2003-2004 University of Glasgow * @@ -714,8 +714,8 @@ int main(int argc, char *argv[]) NULL)) != -1) { switch (ch) { case 'd': - if (!strcmp(optarg, "help")) { - list_video_display_devices(); + if (strcmp(optarg, "help") == 0 || strcmp(optarg, "fullhelp") == 0) { + list_video_display_devices(strcmp(optarg, "fullhelp") == 0); return 0; } requested_display = optarg; @@ -726,8 +726,8 @@ int main(int argc, char *argv[]) } break; case 't': - if (!strcmp(optarg, "help")) { - list_video_capture_devices(); + if (strcmp(optarg, "help") == 0 || strcmp(optarg, "fullhelp") == 0) { + list_video_capture_devices(strcmp(optarg, "fullhelp") == 0); return 0; } vidcap_params_set_device(vidcap_params_tail, optarg); @@ -753,8 +753,8 @@ int main(int argc, char *argv[]) print_configuration(); return EXIT_SUCCESS; case 'c': - if (!strcmp(optarg, "help")) { - show_compress_help(); + if (strcmp(optarg, "help") == 0 || strcmp(optarg, "fullhelp") == 0) { + show_compress_help(strcmp(optarg, "fullhelp") == 0); return EXIT_SUCCESS; } requested_compression = optarg; @@ -801,15 +801,15 @@ int main(int argc, char *argv[]) } break; case 'r': - if (strcmp(optarg, "help") == 0) { - audio_playback_help(); + if (strcmp(optarg, "help") == 0 || strcmp(optarg, "fullhelp") == 0) { + audio_playback_help(strcmp(optarg, "full") == 0); return EXIT_SUCCESS; } audio_recv = optarg; break; case 's': - if (strcmp(optarg, "help") == 0) { - audio_capture_print_help(); + if (strcmp(optarg, "help") == 0 || strcmp(optarg, "fullhelp") == 0) { + audio_capture_print_help(strcmp(optarg, "full") == 0); return EXIT_SUCCESS; } audio_send = optarg; diff --git a/src/video_capture.cpp b/src/video_capture.cpp index de14b2e73..9ab1827c5 100644 --- a/src/video_capture.cpp +++ b/src/video_capture.cpp @@ -98,10 +98,10 @@ struct vidcap { }; /* API for probing capture devices ****************************************************************/ -void list_video_capture_devices() +void list_video_capture_devices(bool full) { printf("Available capture devices:\n"); - list_modules(LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION); + list_modules(LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION, full); } void print_available_capturers() diff --git a/src/video_capture.h b/src/video_capture.h index 1c8f064ba..48d94f4c5 100644 --- a/src/video_capture.h +++ b/src/video_capture.h @@ -146,7 +146,7 @@ struct video_capture_info { struct module; struct vidcap; -void list_video_capture_devices(void); +void list_video_capture_devices(bool); void print_available_capturers(void); int initialize_video_capture(struct module *parent, struct vidcap_params *params, diff --git a/src/video_compress.cpp b/src/video_compress.cpp index ef8c6e8ff..cf60c6d87 100644 --- a/src/video_compress.cpp +++ b/src/video_compress.cpp @@ -6,7 +6,7 @@ * @brief Video compress functions. */ /* - * Copyright (c) 2011-2013 CESNET z.s.p.o. + * Copyright (c) 2011-2019 CESNET z.s.p.o. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -115,10 +115,10 @@ static shared_ptr compress_frame_tiles(struct compress_state *proxy static void compress_done(struct module *mod); /// @brief Displays list of available compressions. -void show_compress_help() +void show_compress_help(bool full) { printf("Possible compression modules (see '-c :help' for options):\n"); - list_modules(LIBRARY_CLASS_VIDEO_COMPRESS, VIDEO_COMPRESS_ABI_VERSION); + list_modules(LIBRARY_CLASS_VIDEO_COMPRESS, VIDEO_COMPRESS_ABI_VERSION, full); } static void async_poison(struct compress_state_real *s){ @@ -234,9 +234,8 @@ compress_state_real::compress_state_real(struct module *parent, const char *conf if (!config_string) throw -1; - if (strcmp(config_string, "help") == 0) - { - show_compress_help(); + if (strcmp(config_string, "help") == 0 || strcmp(config_string, "fullhelp") == 0) { + show_compress_help(strcmp(config_string, "fullhelp") == 0); throw 1; } diff --git a/src/video_compress.h b/src/video_compress.h index cdb58adb7..28142b27f 100644 --- a/src/video_compress.h +++ b/src/video_compress.h @@ -89,7 +89,7 @@ extern struct module compress_init_noerr; typedef struct module *(*compress_init_t)(struct module *parent, const char *cfg); -void show_compress_help(void); +void show_compress_help(bool full); int compress_init(struct module *parent, const char *config_string, struct compress_state **); const char *get_compress_name(struct compress_state *); diff --git a/src/video_display.c b/src/video_display.c index 72a960dfb..b02ad9c5a 100644 --- a/src/video_display.c +++ b/src/video_display.c @@ -14,7 +14,7 @@ */ /* * Copyright (c) 2001-2003 University of Southern California - * Copyright (c) 2005-2015 CESNET z.s.p.o. + * Copyright (c) 2005-2019 CESNET z.s.p.o. * * Redistribution and use in source and binary forms, with or without * modification, is permitted provided that the following conditions @@ -89,10 +89,10 @@ struct display { * of module was successful but no state was created (eg. when driver had displayed help). */ int display_init_noerr; -void list_video_display_devices() +void list_video_display_devices(bool full) { printf("Available display devices:\n"); - list_modules(LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION); + list_modules(LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION, full); } /* @@ -112,8 +112,8 @@ void list_video_display_devices() int initialize_video_display(struct module *parent, const char *requested_display, const char *fmt, unsigned int flags, const char *postprocess, struct display **out) { - if (postprocess && strcmp(postprocess, "help") == 0) { - show_vo_postprocess_help(); + if (postprocess && (strcmp(postprocess, "help") == 0 || strcmp(postprocess, "fullhelp") == 0)) { + show_vo_postprocess_help(strcmp(postprocess, "fullhelp") == 0); return 1; } diff --git a/src/video_display.h b/src/video_display.h index 60fe3fc05..f297eef94 100644 --- a/src/video_display.h +++ b/src/video_display.h @@ -13,7 +13,7 @@ * @ingroup display */ /* Copyright (c) 2001-2003 University of Southern California - * Copyright (c) 2005-2013 CESNET z.s.p.o. + * Copyright (c) 2005-2019 CESNET z.s.p.o. * * Redistribution and use in source and binary forms, with or without * modification, is permitted provided that the following conditions @@ -160,7 +160,7 @@ struct module; extern int display_init_noerr; -void list_video_display_devices(void); +void list_video_display_devices(bool full); int initialize_video_display(struct module *parent, const char *requested_display, const char *fmt, unsigned int flags, const char *postprocess, struct display **out); diff --git a/src/video_rxtx.cpp b/src/video_rxtx.cpp index 114c7072e..b51715b1f 100644 --- a/src/video_rxtx.cpp +++ b/src/video_rxtx.cpp @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2013-2017 CESNET z.s.p.o. + * Copyright (c) 2013-2019 CESNET z.s.p.o. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -208,9 +208,9 @@ exit: video_rxtx *video_rxtx::create(string const & proto, std::map const ¶ms) { - if (proto == "help") { + if (proto == "help" || proto == "fullhelp") { printf("Available TX protocols:\n"); - list_modules(LIBRARY_CLASS_VIDEO_RXTX, VIDEO_RXTX_ABI_VERSION); + list_modules(LIBRARY_CLASS_VIDEO_RXTX, VIDEO_RXTX_ABI_VERSION, proto == "fullhelp"); } auto vri = static_cast(load_library(proto.c_str(), LIBRARY_CLASS_VIDEO_RXTX, VIDEO_RXTX_ABI_VERSION)); if (vri) { diff --git a/src/vo_postprocess.c b/src/vo_postprocess.c index 22cdb5df8..ab4d74141 100644 --- a/src/vo_postprocess.c +++ b/src/vo_postprocess.c @@ -8,7 +8,7 @@ * Dalibor Matura <255899@mail.muni.cz> * Ian Wesley-Smith * - * Copyright (c) 2005-2010 CESNET z.s.p.o. + * Copyright (c) 2005-2019 CESNET z.s.p.o. * * Redistribution and use in source and binary forms, with or without * modification, is permitted provided that the following conditions @@ -61,10 +61,10 @@ struct vo_postprocess_state { void *state; }; -void show_vo_postprocess_help() +void show_vo_postprocess_help(bool full) { printf("Possible postprocess modules:\n"); - list_modules(LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION); + list_modules(LIBRARY_CLASS_VIDEO_POSTPROCESS, VO_PP_ABI_VERSION, full); } struct vo_postprocess_state *vo_postprocess_init(const char *config_string) @@ -75,9 +75,8 @@ struct vo_postprocess_state *vo_postprocess_init(const char *config_string) if(!config_string) return NULL; - if(strcmp(config_string, "help") == 0) - { - show_vo_postprocess_help(); + if (strcmp(config_string, "help") == 0 || strcmp(config_string, "fullhelp") == 0) { + show_vo_postprocess_help(strcmp(config_string, "fullhelp") == 0); return NULL; } diff --git a/src/vo_postprocess.h b/src/vo_postprocess.h index 7fd93aa50..2fc4df3a0 100644 --- a/src/vo_postprocess.h +++ b/src/vo_postprocess.h @@ -1,32 +1,23 @@ +/** + * @file vo_postprocess.h + * @author Martin Pulec + */ /* - * FILE: video_codec.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. + * Copyright (c) 2011-2019 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. 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 + * + * 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. * @@ -42,7 +33,6 @@ * 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. - * */ #ifndef __vo_postprocess_h @@ -145,7 +135,7 @@ bool vo_postprocess_get_property(struct vo_postprocess_state *, int property, vo bool vo_postprocess(struct vo_postprocess_state *, struct video_frame*, struct video_frame*, int req_pitch); void vo_postprocess_done(struct vo_postprocess_state *s); -void show_vo_postprocess_help(void); +void show_vo_postprocess_help(bool full); #ifdef __cplusplus }