Register modules with macro

This commit is contained in:
Martin Pulec
2015-08-26 13:58:36 +02:00
parent 2dc341d847
commit 072ea8cbb5
87 changed files with 194 additions and 1531 deletions

View File

@@ -52,30 +52,13 @@
#include "audio/audio_capture.h"
#include "audio/audio.h"
#include "audio/capture/coreaudio.h"
#include "audio/capture/none.h"
#include "audio/capture/sdi.h"
#include "audio/capture/testcard.h"
/* vidcap flags */
#include "video_capture.h"
#include "lib_common.h"
static void init_static_acap() __attribute__((constructor));
static void init_static_acap() {
#ifndef UV_IN_YURI
register_library("embedded", &acap_sdi_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
register_library("AESEBU", &acap_sdi_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
register_library("analog", &acap_sdi_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
#if defined HAVE_COREAUDIO
register_library("coreaudio", &acap_coreaudio_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
#endif
register_library("testcard", &acap_testcard_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
#endif
register_library("none", &acap_none_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
};
struct state_audio_capture {
char name[128];
const struct audio_capture_info *funcs;

View File

@@ -49,9 +49,6 @@
#include "audio/audio.h"
#include "audio/audio_playback.h"
#include "audio/playback/coreaudio.h"
#include "audio/playback/dummy.h"
#include "audio/playback/none.h"
#include "audio/playback/sdi.h"
#include "lib_common.h"
@@ -64,20 +61,6 @@ struct state_audio_playback {
void *state;
};
static void init_static_aplay() __attribute__((constructor));
static void init_static_aplay() {
#ifndef UV_IN_YURI
register_library("embedded", &aplay_sdi_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
register_library("AESEBU", &aplay_sdi_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
register_library("analog", &aplay_sdi_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
#if defined HAVE_COREAUDIO
register_library("coreaudio", &aplay_coreaudio_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
#endif
register_library("dummy", &aplay_dummy_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
#endif
register_library("none", &aplay_none_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
};
void audio_playback_help()
{
printf("Available audio playback devices:\n");

View File

@@ -395,11 +395,6 @@ static const struct audio_capture_info acap_alsa_info = {
audio_cap_alsa_done
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("alsa", &acap_alsa_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(alsa, &acap_alsa_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
#endif /* HAVE_ALSA */

View File

@@ -43,9 +43,9 @@
#include "audio/audio.h"
#include "audio/audio_capture.h"
#include "audio/utils.h"
#include "audio/capture/coreaudio.h"
#include "utils/ring_buffer.h"
#include "debug.h"
#include "lib_common.h"
#include <stdlib.h>
#include <string.h>
#include <AudioUnit/AudioUnit.h>
@@ -493,13 +493,14 @@ static void audio_cap_ca_done(void *state)
free(s);
}
const struct audio_capture_info acap_coreaudio_info = {
static const struct audio_capture_info acap_coreaudio_info = {
audio_cap_ca_help,
audio_cap_ca_init,
audio_cap_ca_read,
audio_cap_ca_done
};
MODULE_REGISTER(coreaudio, &acap_coreaudio_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
#endif /* HAVE_COREAUDIO */

View File

@@ -1,51 +0,0 @@
/*
* FILE: audio/capture/coreaudio.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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 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.
*
*
*/
struct audio_capture_info;
extern const struct audio_capture_info acap_coreaudio_info;

View File

@@ -283,10 +283,5 @@ static const struct audio_capture_info acap_jack_info = {
audio_cap_jack_done
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("jack", &acap_jack_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(jack, &acap_jack_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);

View File

@@ -52,9 +52,8 @@
#endif
#include "audio/audio_capture.h"
#include "audio/capture/none.h"
#include "debug.h"
#include "lib_common.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
@@ -95,10 +94,12 @@ static void audio_cap_none_done(void *state)
free(s);
}
const struct audio_capture_info acap_none_info = {
static const struct audio_capture_info acap_none_info = {
audio_cap_none_help,
audio_cap_none_init,
audio_cap_none_read,
audio_cap_none_done
};
REGISTER_MODULE(none, &acap_none_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);

View File

@@ -1,51 +0,0 @@
/*
* FILE: audio/capture/none.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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 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.
*
*
*/
struct audio_capture_info;
extern const struct audio_capture_info acap_none_info;

View File

@@ -370,10 +370,5 @@ static const struct audio_capture_info acap_portaudio_info = {
audio_cap_portaudio_done
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("portaudio", &acap_portaudio_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(portaudio, &acap_portaudio_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);

View File

@@ -48,6 +48,7 @@
#include "compat/platform_semaphore.h"
#include "debug.h"
#include "host.h"
#include "lib_common.h"
#include <condition_variable>
#include <chrono>
@@ -172,11 +173,15 @@ void sdi_capture_new_incoming_frame(void *state, struct audio_frame *frame)
}
const struct audio_capture_info acap_sdi_info = {
static const struct audio_capture_info acap_sdi_info = {
audio_cap_sdi_help,
audio_cap_sdi_init,
audio_cap_sdi_read,
audio_cap_sdi_done
};
REGISTER_MODULE(embedded, &acap_sdi_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
REGISTER_MODULE(AESEBU, &acap_sdi_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
REGISTER_MODULE(analog, &acap_sdi_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);
/* vim: set expandtab: sw=8 */

View File

@@ -46,9 +46,6 @@
*
*/
struct audio_capture_info;
extern const struct audio_capture_info acap_sdi_info;
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -44,14 +44,12 @@
#endif
#include "audio/audio_capture.h"
#include "audio/capture/testcard.h"
#include "audio/audio.h"
#include "audio/utils.h"
#include "audio/wav_reader.h"
#include "debug.h"
#include "host.h"
#include "lib_common.h"
#include <assert.h>
#include <stdlib.h>
@@ -282,10 +280,12 @@ static void audio_cap_testcard_done(void *state)
delete s;
}
const struct audio_capture_info acap_testcard_info = {
static const struct audio_capture_info acap_testcard_info = {
audio_cap_testcard_help,
audio_cap_testcard_init,
audio_cap_testcard_read,
audio_cap_testcard_done
};
REGISTER_MODULE(testcard, &acap_testcard_info, LIBRARY_CLASS_AUDIO_CAPTURE, AUDIO_CAPTURE_ABI_VERSION);

View File

@@ -1,51 +0,0 @@
/*
* FILE: audio/capture/testcard.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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 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.
*
*
*/
struct audio_capture_info;
extern const struct audio_capture_info acap_testcard_info;

View File

@@ -589,11 +589,6 @@ static const struct audio_playback_info aplay_alsa_info = {
audio_play_alsa_done
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("alsa", &aplay_alsa_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
}
REGISTER_MODULE(alsa, &aplay_alsa_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
#endif /* HAVE_ALSA */

View File

@@ -41,9 +41,9 @@
#include "audio/audio.h"
#include "audio/audio_playback.h"
#include "audio/playback/coreaudio.h"
#include "utils/ring_buffer.h"
#include "debug.h"
#include "lib_common.h"
#include <chrono>
#include <stdlib.h>
#include <string.h>
@@ -347,7 +347,7 @@ static void audio_play_ca_done(void *state)
delete s;
}
const struct audio_playback_info aplay_coreaudio_info = {
static const struct audio_playback_info aplay_coreaudio_info = {
audio_play_ca_help,
audio_play_ca_init,
audio_play_ca_put_frame,
@@ -356,5 +356,7 @@ const struct audio_playback_info aplay_coreaudio_info = {
audio_play_ca_done
};
REGISTER_MODULE(coreaudio, &aplay_coreaudio_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
#endif /* HAVE_COREAUDIO */

View File

@@ -1,51 +0,0 @@
/*
* FILE: audio/playback/coreaudio.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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 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.
*
*
*/
struct audio_playback_info;
extern const struct audio_playback_info aplay_coreaudio_info;

View File

@@ -567,11 +567,5 @@ static const struct audio_playback_info aplay_decklink_info = {
audio_play_decklink_done
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("decklink", &aplay_decklink_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
}
REGISTER_MODULE(decklink, &aplay_decklink_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);

View File

@@ -43,7 +43,7 @@
#include "audio/audio.h"
#include "audio/audio_playback.h"
#include "audio/playback/dummy.h"
#include "lib_common.h"
static int state;
@@ -75,7 +75,7 @@ static int audio_play_dummy_reconfigure(void *, struct audio_desc)
return TRUE;
}
const struct audio_playback_info aplay_dummy_info = {
static const struct audio_playback_info aplay_dummy_info = {
audio_play_dummy_help,
audio_play_dummy_init,
audio_play_dummy_put_frame,
@@ -84,3 +84,5 @@ const struct audio_playback_info aplay_dummy_info = {
audio_play_dummy_done
};
REGISTER_MODULE(dummy, &aplay_dummy_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);

View File

@@ -1,40 +0,0 @@
/**
* @file audio/playback/dummy.h
* @author Martin Pulec <pulec@cesnet.cz>
*/
/*
* Copyright (c) 2015 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.
*/
struct audio_playback_info;
extern const struct audio_playback_info aplay_dummy_info;

View File

@@ -350,11 +350,5 @@ static const struct audio_playback_info aplay_jack_info = {
audio_play_jack_done
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("jack", &aplay_jack_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
}
REGISTER_MODULE(jack, &aplay_jack_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);

View File

@@ -54,8 +54,8 @@
#include "audio/audio.h"
#include "audio/audio_playback.h"
#include "audio/playback/none.h"
#include "debug.h"
#include "lib_common.h"
#include <stdlib.h>
#include <string.h>
@@ -116,7 +116,7 @@ static int audio_play_none_reconfigure(void *state, struct audio_desc desc)
return TRUE;
}
const struct audio_playback_info aplay_none_info = {
static const struct audio_playback_info aplay_none_info = {
audio_play_none_help,
audio_play_none_init,
audio_play_none_put_frame,
@@ -125,3 +125,5 @@ const struct audio_playback_info aplay_none_info = {
audio_play_none_done
};
REGISTER_MODULE(none, &aplay_none_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);

View File

@@ -1,51 +0,0 @@
/*
* FILE: audio/playback/none.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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 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.
*
*
*/
struct audio_playback_info;
extern const struct audio_playback_info aplay_none_info;

View File

@@ -441,11 +441,5 @@ static const struct audio_playback_info aplay_portaudio_info = {
audio_play_portaudio_done
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("portaudio", &aplay_portaudio_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
}
REGISTER_MODULE(portaudio, &aplay_portaudio_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);

View File

@@ -56,6 +56,7 @@
#include "audio/audio_playback.h"
#include "audio/playback/sdi.h"
#include "debug.h"
#include "lib_common.h"
#include "video_display.h"
#include <stdlib.h>
@@ -145,7 +146,7 @@ static void audio_play_sdi_done(void *s)
UNUSED(s);
}
const struct audio_playback_info aplay_sdi_info = {
static const struct audio_playback_info aplay_sdi_info = {
audio_play_sdi_help,
audio_play_sdi_init,
audio_play_sdi_put_frame,
@@ -154,6 +155,10 @@ const struct audio_playback_info aplay_sdi_info = {
audio_play_sdi_done
};
REGISTER_MODULE(embedded, &aplay_sdi_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
REGISTER_MODULE(AESEBU, &aplay_sdi_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
REGISTER_MODULE(analog, &aplay_sdi_info, LIBRARY_CLASS_AUDIO_PLAYBACK, AUDIO_PLAYBACK_ABI_VERSION);
/* vim: set expandtab: sw=8 */

View File

@@ -55,9 +55,6 @@ void sdi_register_display_callbacks(void *state, void *udata, void (*putf)(void
int (*get_property)(void *, int, void *, size_t *)
);
struct audio_playback_info;
extern const struct audio_playback_info aplay_sdi_info;
#ifdef __cplusplus
}
#endif

View File

@@ -50,24 +50,10 @@
#include "utils/list.h"
#include "video.h"
#include "capture_filter/blank.h"
#include "capture_filter/every.h"
#include "capture_filter/logo.h"
#include "capture_filter/none.h"
#include "capture_filter/scale.h"
#include <vector>
using namespace std;
static void init_capture_filters() __attribute__((constructor));
static void init_capture_filters() {
register_library("every", &capture_filter_every, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);
register_library("logo", &capture_filter_logo, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);
register_library("none", &capture_filter_none, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);
register_library("scale", &capture_filter_scale, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);
};
struct capture_filter {
struct module mod;
struct simple_linked_list *filters;

View File

@@ -289,17 +289,12 @@ static struct video_frame *filter(void *state, struct video_frame *in)
return in;
}
struct capture_filter_info capture_filter_blank = {
static const struct capture_filter_info capture_filter_blank = {
.name = "blank",
.init = init,
.done = done,
.filter = filter,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("capture_filter_blank", &capture_filter_blank, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);
}
REGISTER_MODULE(blank, &capture_filter_blank, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);

View File

@@ -1,61 +0,0 @@
/*
* FILE: capture_filter/blank.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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 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.
*
*
*/
#ifndef CAPTURE_FILTER_BLANK_H_
#define CAPTURE_FILTER_BLANK_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_win32.h"
#include "config_unix.h"
#endif // HAVE_CONFIG_H
struct capture_filter_info;
extern struct capture_filter_info capture_filter_blank;
#endif // CAPTURE_FILTER_BLANK_H_

View File

@@ -55,6 +55,7 @@
#include "capture_filter.h"
#include "debug.h"
#include "lib_common.h"
#include "video.h"
#include "video_codec.h"
@@ -139,10 +140,12 @@ static struct video_frame *filter(void *state, struct video_frame *in)
}
}
struct capture_filter_info capture_filter_every = {
static const struct capture_filter_info capture_filter_every = {
.name = "every",
.init = init,
.done = done,
.filter = filter,
};
REGISTER_MODULE(every, &capture_filter_every, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);

View File

@@ -1,61 +0,0 @@
/*
* FILE: capture_filter/every.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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 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.
*
*
*/
#ifndef CAPTURE_FILTER_EVERY_H_
#define CAPTURE_FILTER_EVERY_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_win32.h"
#include "config_unix.h"
#endif // HAVE_CONFIG_H
struct capture_filter_info;
extern struct capture_filter_info capture_filter_every;
#endif // CAPTURE_FILTER_EVERY_H_

View File

@@ -45,9 +45,8 @@
#include <iostream>
#include "capture_filter.h"
#include "debug.h"
#include "lib_common.h"
#include "video.h"
#include "video_codec.h"
@@ -251,10 +250,12 @@ static struct video_frame *filter(void *state, struct video_frame *in)
return in;
}
struct capture_filter_info capture_filter_logo = {
static const struct capture_filter_info capture_filter_logo = {
"logo",
init,
done,
filter,
};
REGISTER_MODULE(logo, &capture_filter_logo, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);

View File

@@ -1,46 +0,0 @@
/**
* @file capture_filter/logo.h
* @author Martin Pulec <pulec@cesnet.cz>
*/
/*
* Copyright (c) 2013 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.
*/
#ifndef CAPTURE_FILTER_LOGO_H_
#define CAPTURE_FILTER_LOGO_H_
struct capture_filter_info;
extern struct capture_filter_info capture_filter_logo;
#endif // CAPTURE_FILTER_LOGO_H_

View File

@@ -42,9 +42,8 @@
#endif /* HAVE_CONFIG_H */
#include "capture_filter.h"
#include "debug.h"
#include "lib_common.h"
#include "video.h"
#include "video_codec.h"
@@ -77,10 +76,12 @@ static struct video_frame *filter(void *state, struct video_frame *in)
return in;
}
struct capture_filter_info capture_filter_none = {
static const struct capture_filter_info capture_filter_none = {
.name = "none",
.init = init,
.done = done,
.filter = filter,
};
REGISTER_MODULE(none, &capture_filter_none, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);

View File

@@ -1,45 +0,0 @@
/**
* @file capture_filter/none.h
* @author Martin Pulec <pulec@cesnet.cz>
* Copyright (c) 2005-2010 CESNET z.s.p.o.
*/
/*
* Copyright (c) 2013 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.
*/
#ifndef CAPTURE_FILTER_NONE_H_
#define CAPTURE_FILTER_NONE_H_
struct capture_filter_info;
extern struct capture_filter_info capture_filter_none;
#endif // CAPTURE_FILTER_NONE_H_

View File

@@ -190,11 +190,6 @@ static struct capture_filter_info capture_filter_resize = {
}
#endif
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("capture_filter_resize", &capture_filter_resize, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);
}
REGISTER_MODULE(resize, &capture_filter_resize, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);
/* vim: set expandtab: sw=4 */

View File

@@ -53,9 +53,8 @@
#endif /* HAVE_CONFIG_H */
#include "capture_filter.h"
#include "debug.h"
#include "lib_common.h"
#include "video.h"
#include "video_codec.h"
#include "utils/video_frame_pool.h"
@@ -120,10 +119,12 @@ static struct video_frame *filter(void *state, struct video_frame *in_frame)
return s->frame;
}
struct capture_filter_info capture_filter_scale = {
static const struct capture_filter_info capture_filter_scale = {
.name = "scale",
.init = init,
.done = done,
.filter = filter,
};
REGISTER_MODULE(scale, &capture_filter_scale, LIBRARY_CLASS_CAPTURE_FILTER, CAPTURE_FILTER_ABI_VERSION);

View File

@@ -1,62 +0,0 @@
/*
* FILE: capture_filter/every.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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 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.
*
*
*/
#ifndef CAPTURE_FILTER_SCALE_H_
#define CAPTURE_FILTER_SCALE_H_
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_win32.h"
#include "config_unix.h"
#endif // HAVE_CONFIG_H
struct capture_filter_info;
extern struct capture_filter_info capture_filter_scale;
#endif // CAPTURE_FILTER_SCALE_H_

View File

@@ -163,16 +163,11 @@ static int openssl_decrypt(struct openssl_decrypt *decrypt,
return data_len;
}
static struct openssl_decrypt_info functions = {
static const struct openssl_decrypt_info functions = {
openssl_decrypt_init,
openssl_decrypt_destroy,
openssl_decrypt,
};
static void init(void) __attribute__((constructor));
static void init(void)
{
register_library("openssl_decrypt", &functions, LIBRARY_CLASS_UNDEFINED, OPENSSL_DECRYPT_ABI_VERSION);
}
REGISTER_MODULE(openssl_decrypt, &functions, LIBRARY_CLASS_UNDEFINED, OPENSSL_DECRYPT_ABI_VERSION);

View File

@@ -164,17 +164,12 @@ static int openssl_get_overhead(struct openssl_encrypt *s)
}
}
static struct openssl_encrypt_info functions = {
static const struct openssl_encrypt_info functions = {
openssl_encrypt_init,
openssl_encrypt_destroy,
openssl_encrypt,
openssl_get_overhead,
};
static void init(void) __attribute__((constructor));
static void init(void)
{
register_library("openssl_encrypt", &functions, LIBRARY_CLASS_UNDEFINED, OPENSSL_ENCRYPT_ABI_VERSION);
}
REGISTER_MODULE(openssl_encrypt, &functions, LIBRARY_CLASS_UNDEFINED, OPENSSL_ENCRYPT_ABI_VERSION);

View File

@@ -89,5 +89,26 @@ void list_all_modules();
std::map<std::string, const void *> get_libraries_for_class(enum library_class cls, int abi_version);
#endif
/**
* @brief Registers module to global modules' registry
* @param name name of the module to be used to load the module (Note that
* it has to be without quotation marks!)
* @param info pointer to structure with the (class specific) info about module
* @param lclass member of @ref library_class
* @param abi ABI version of info parameter, usually defined per class
* in appropriate class header (eg. video_display.h)
* @note
* Mangling of the constructor function name is because some files may define
* multiple modules (eg. audio playback SDI) and without that, function would
* be defined multiple times under the same name.
*/
#define REGISTER_MODULE(name, info, lclass, abi) static void mod_reg_##lclass##_##name(void) __attribute__((constructor));\
\
static void mod_reg_##lclass##_##name(void)\
{\
register_library(#name, info, lclass, abi);\
}\
struct NOT_DEFINED_STRUCT_THAT_SWALLOWS_SEMICOLON
#endif // defined LIB_COMMON_H

View File

@@ -6,10 +6,5 @@ static LDGM_session_gpu *new_ldgm_session_gpu() {
return new LDGM_session_gpu();
}
static void init(void) __attribute__((constructor));
static void init(void)
{
register_library("ldgm_gpu", reinterpret_cast<void *>(new_ldgm_session_gpu), LIBRARY_CLASS_UNDEFINED,
LDGM_GPU_API_VERSION);
}
REGISTER_MODULE(ldgm_gpu, reinterpret_cast<const void *>(new_ldgm_session_gpu), LIBRARY_CLASS_UNDEFINED, LDGM_GPU_API_VERSION);

View File

@@ -63,11 +63,6 @@
#include "module.h"
#include "utils/config_file.h"
#include "video_capture.h"
#include "video_capture/aggregate.h"
#include "video_capture/import.h"
#include "video_capture/null.h"
#include "video_capture/switcher.h"
#include "video_capture/ug_input.h"
#include <string>
@@ -107,17 +102,6 @@ struct vidcap {
struct capture_filter *capture_filter; ///< capture_filter_state
};
static void init_static_vidcap() __attribute__((constructor));
static void init_static_vidcap() {
#ifndef UV_IN_YURI
register_library("aggregate", &vidcap_aggregate_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
register_library("import", &vidcap_import_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
register_library("switcher", &vidcap_switcher_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
register_library("none", &vidcap_null_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
register_library("ug_input", &vidcap_null_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
#endif
}
/* API for probing capture devices ****************************************************************/
void list_video_capture_devices()
{

View File

@@ -1295,12 +1295,7 @@ static const struct video_capture_info vidcap_dshow_info = {
vidcap_dshow_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("dshow", &vidcap_dshow_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(dshow, &vidcap_dshow_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
/* vim: set noexpandtab: */

View File

@@ -42,12 +42,12 @@
#include "config_win32.h"
#include "debug.h"
#include "lib_common.h"
#include "video.h"
#include "video_capture.h"
#include "tv.h"
#include "video_capture/aggregate.h"
#include "audio/audio.h"
#include <stdio.h>
@@ -240,10 +240,12 @@ vidcap_aggregate_grab(void *state, struct audio_frame **audio)
return s->frame;
}
const struct video_capture_info vidcap_aggregate_info = {
static const struct video_capture_info vidcap_aggregate_info = {
vidcap_aggregate_probe,
vidcap_aggregate_init,
vidcap_aggregate_done,
vidcap_aggregate_grab,
};
REGISTER_MODULE(aggregate, &vidcap_aggregate_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -1,50 +0,0 @@
/*
* FILE: aggregate.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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.
*
*/
struct video_capture_info;
extern const struct video_capture_info vidcap_aggregate_info;

View File

@@ -635,10 +635,5 @@ static const struct video_capture_info vidcap_aja_info = {
vidcap_aja_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("aja", &vidcap_aja_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(aja, &vidcap_aja_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -515,10 +515,5 @@ static const struct video_capture_info vidcap_avfoundation_info = {
vidcap_avfoundation_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("avfoundation", &vidcap_avfoundation_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(avfoundation, &vidcap_avfoundation_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -1090,10 +1090,5 @@ static const struct video_capture_info vidcap_bluefish444_info = {
vidcap_bluefish444_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("bluefish444", &vidcap_bluefish444_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(bluefish444, &vidcap_bluefish444_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -1463,11 +1463,6 @@ static const struct video_capture_info vidcap_decklink_info = {
vidcap_decklink_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("decklink", &vidcap_decklink_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(decklink, &vidcap_decklink_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
#endif /* HAVE_DECKLINK */

View File

@@ -577,10 +577,5 @@ static const struct video_capture_info vidcap_deltacast_info = {
vidcap_deltacast_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("deltacast", &vidcap_deltacast_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(deltacast, &vidcap_deltacast_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -773,10 +773,5 @@ static const struct video_capture_info vidcap_deltacast_dvi_info = {
vidcap_deltacast_dvi_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("deltacast_dvi", &vidcap_deltacast_dvi_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(deltacast_dvi, &vidcap_deltacast_dvi_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -651,12 +651,7 @@ static const struct video_capture_info vidcap_dvs_info = {
vidcap_dvs_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("dvs", &vidcap_dvs_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(dvs, &vidcap_dvs_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
#endif /* HAVE_DVS */

View File

@@ -43,6 +43,7 @@
#include "debug.h"
#include "host.h"
#include "lib_common.h"
#include "video.h"
#include "video_capture.h"
@@ -53,7 +54,6 @@
#include "utils/ring_buffer.h"
#include "utils/worker.h"
#include "video_export.h"
#include "video_capture/import.h"
//#include "audio/audio.h"
#include <stdio.h>
@@ -1254,10 +1254,12 @@ vidcap_import_grab(void *state, struct audio_frame **audio)
return ret;
}
const struct video_capture_info vidcap_import_info = {
static const struct video_capture_info vidcap_import_info = {
vidcap_import_probe,
vidcap_import_init,
vidcap_import_done,
vidcap_import_grab,
};
REGISTER_MODULE(import, &vidcap_import_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -1,50 +0,0 @@
/*
* FILE: import.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* 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.
*
*/
struct video_capture_info;
extern const struct video_capture_info vidcap_import_info;

View File

@@ -52,9 +52,9 @@
#include "config_unix.h"
#include "config_win32.h"
#include "debug.h"
#include "lib_common.h"
#include "video.h"
#include "video_capture.h"
#include "video_capture/null.h"
static int capture_state = 0;
@@ -90,10 +90,12 @@ static struct vidcap_type *vidcap_null_probe(bool verbose)
return vt;
}
const struct video_capture_info vidcap_null_info = {
static const struct video_capture_info vidcap_null_info = {
vidcap_null_probe,
vidcap_null_init,
vidcap_null_done,
vidcap_null_grab,
};
REGISTER_MODULE(none, &vidcap_null_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -1,48 +0,0 @@
/*
* FILE: vidcap_null.h
* AUTHOR: Colin Perkins <csp@isi.edu>
*
* Copyright (c) 2002 University of Southern California
*
* 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 the University of Southern
* California Information Sciences Institute.
*
* 4. Neither the name of the University nor of the Institute 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.
*
* $Revision: 1.3 $
* $Date: 2009/12/02 10:37:30 $
*
*/
struct video_capture_info;
extern const struct video_capture_info vidcap_null_info;

View File

@@ -1217,11 +1217,6 @@ static const struct video_capture_info vidcap_quicktime_info = {
vidcap_quicktime_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("quicktime", &vidcap_quicktime_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(quicktime, &vidcap_quicktime_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
#endif /* HAVE_MACOSX */

View File

@@ -1195,10 +1195,5 @@ static const struct video_capture_info vidcap_rtsp_info = {
vidcap_rtsp_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("rtsp", &vidcap_rtsp_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(rtsp, &vidcap_rtsp_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -243,10 +243,5 @@ static const struct video_capture_info vidcap_screen_osx_info = {
vidcap_screen_osx_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("screen", &vidcap_screen_osx_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(screen, &vidcap_screen_osx_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -426,10 +426,5 @@ static const struct video_capture_info vidcap_screen_x11_info = {
vidcap_screen_x11_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("screen", &vidcap_screen_x11_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(screen, &vidcap_screen_x11_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -40,12 +40,12 @@
#include "config_win32.h"
#include "debug.h"
#include "lib_common.h"
#include "video.h"
#include "video_capture.h"
#include "tv.h"
#include "video_capture/switcher.h"
#include "audio/audio.h"
#include "module.h"
@@ -239,10 +239,12 @@ vidcap_switcher_grab(void *state, struct audio_frame **audio)
return frame;
}
const struct video_capture_info vidcap_switcher_info = {
static const struct video_capture_info vidcap_switcher_info = {
vidcap_switcher_probe,
vidcap_switcher_init,
vidcap_switcher_done,
vidcap_switcher_grab,
};
REGISTER_MODULE(switcher, &vidcap_switcher_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -1,40 +0,0 @@
/**
* @file video_capture/switcher.h
* @author Martin Pulec <pulec@cesnet.cz>
*/
/*
* 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.
*/
struct video_capture_info;
extern const struct video_capture_info vidcap_switcher_info;

View File

@@ -1329,10 +1329,5 @@ static const struct video_capture_info vidcap_swmix_info = {
vidcap_swmix_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("swmix", &vidcap_swmix_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(swmix, &vidcap_swmix_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -712,11 +712,6 @@ static const struct video_capture_info vidcap_testcard_info = {
vidcap_testcard_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("testcard", &vidcap_testcard_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(testcard, &vidcap_testcard_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
/* vim: set expandtab: sw=8 */

View File

@@ -548,11 +548,6 @@ static const struct video_capture_info vidcap_testcard2_info = {
vidcap_testcard2_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("testcard2", &vidcap_testcard2_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(testcard2, &vidcap_testcard2_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
#endif

View File

@@ -41,9 +41,9 @@
#include "debug.h"
#include "host.h"
#include "hd-rum-translator/hd-rum-decompress.h" // frame_recv_delegate
#include "lib_common.h"
#include "video.h"
#include "video_capture.h"
#include "video_capture/ug_input.h"
#include "video_display.h"
#include "video_rxtx.h"
#include "video_rxtx/ultragrid_rtp.h"
@@ -181,10 +181,12 @@ static struct vidcap_type *vidcap_ug_input_probe(bool /* verbose */)
return vt;
}
const struct video_capture_info vidcap_ug_input_info = {
static const struct video_capture_info vidcap_ug_input_info = {
vidcap_ug_input_probe,
vidcap_ug_input_init,
vidcap_ug_input_done,
vidcap_ug_input_grab,
};
REGISTER_MODULE(ug_input, &vidcap_ug_input_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -1,40 +0,0 @@
/**
* @file video_capture/ug_input.h
* @author Martin Pulec <pulec@cesnet.cz>
*/
/*
* 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.
*/
struct video_capture_info;
extern const struct video_capture_info vidcap_ug_input_info;

View File

@@ -698,10 +698,5 @@ static const struct video_capture_info vidcap_v4l2_info = {
vidcap_v4l2_grab,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("v4l2", &vidcap_v4l2_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
}
REGISTER_MODULE(v4l2, &vidcap_v4l2_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);

View File

@@ -62,12 +62,6 @@
#include "perf.h"
#include "video_display.h"
#include "video_display/aggregate.h"
#include "video_display/dummy.h"
#include "video_display/null.h"
#include "video_display/pipe.h"
#include "video_display/proxy.h"
#define DISPLAY_MAGIC 0x01ba7ef1
/// @brief This struct represents initialized video display state.
@@ -82,17 +76,6 @@ struct display {
* of module was successful but no state was created (eg. when driver had displayed help). */
int display_init_noerr;
static void init_static_display() __attribute__((constructor));
static void init_static_display() {
#ifndef UV_IN_YURI
register_library("aggregate", &display_aggregate_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
#endif
register_library("dummy", &display_dummy_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
register_library("none", &display_null_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
register_library("pipe", &display_pipe_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
register_library("proxy", &display_proxy_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
}
void list_video_display_devices()
{
printf("Available display devices:\n");

View File

@@ -44,10 +44,10 @@
#include "debug.h"
#include "host.h"
#include "lib_common.h"
#include "tv.h"
#include "video.h"
#include "video_display.h"
#include "video_display/aggregate.h"
#include <assert.h>
#include <host.h>
@@ -85,7 +85,7 @@ static void show_help() {
printf("\t\twhere devn_config is a complete configuration string of device involved in an aggregate device\n");
}
void display_aggregate_run(void *state)
static void display_aggregate_run(void *state)
{
struct display_aggregate_state *s = (struct display_aggregate_state *) state;
unsigned int i;
@@ -99,7 +99,7 @@ void display_aggregate_run(void *state)
}
}
void *display_aggregate_init(struct module *parent, const char *fmt, unsigned int flags)
static void *display_aggregate_init(struct module *parent, const char *fmt, unsigned int flags)
{
UNUSED(parent);
struct display_aggregate_state *s;
@@ -178,7 +178,7 @@ error:
return NULL;
}
void display_aggregate_done(void *state)
static void display_aggregate_done(void *state)
{
struct display_aggregate_state *s = (struct display_aggregate_state *) state;
@@ -197,7 +197,7 @@ void display_aggregate_done(void *state)
free(s);
}
struct video_frame *display_aggregate_getf(void *state)
static struct video_frame *display_aggregate_getf(void *state)
{
struct display_aggregate_state *s = (struct display_aggregate_state *)state;
unsigned int i;
@@ -217,7 +217,7 @@ struct video_frame *display_aggregate_getf(void *state)
return s->frame;
}
int display_aggregate_putf(void *state, struct video_frame *frame, int nonblock)
static int display_aggregate_putf(void *state, struct video_frame *frame, int nonblock)
{
unsigned int i;
struct display_aggregate_state *s = (struct display_aggregate_state *)state;
@@ -235,7 +235,7 @@ int display_aggregate_putf(void *state, struct video_frame *frame, int nonblock)
return 0;
}
int display_aggregate_reconfigure(void *state, struct video_desc desc)
static int display_aggregate_reconfigure(void *state, struct video_desc desc)
{
struct display_aggregate_state *s = (struct display_aggregate_state *)state;
unsigned int i;
@@ -257,7 +257,7 @@ int display_aggregate_reconfigure(void *state, struct video_desc desc)
return ret;
}
int display_aggregate_get_property(void *state, int property, void *val, size_t *len)
static int display_aggregate_get_property(void *state, int property, void *val, size_t *len)
{
struct display_aggregate_state *s = (struct display_aggregate_state *)state;
unsigned int i;
@@ -357,7 +357,7 @@ err:
return TRUE;
}
void display_aggregate_put_audio_frame(void *state, struct audio_frame *frame)
static void display_aggregate_put_audio_frame(void *state, struct audio_frame *frame)
{
struct display_aggregate_state *s = (struct display_aggregate_state *)state;
double seconds = tv_diff(s->t, s->t0);
@@ -372,14 +372,14 @@ void display_aggregate_put_audio_frame(void *state, struct audio_frame *frame)
display_put_audio_frame(s->devices[0], frame);
}
int display_aggregate_reconfigure_audio(void *state, int quant_samples, int channels,
static int display_aggregate_reconfigure_audio(void *state, int quant_samples, int channels,
int sample_rate)
{
struct display_aggregate_state *s = (struct display_aggregate_state *)state;
return display_reconfigure_audio(s->devices[0], quant_samples, channels, sample_rate);
}
const struct video_display_info display_aggregate_info = {
static const struct video_display_info display_aggregate_info = {
display_aggregate_init,
display_aggregate_run,
display_aggregate_done,
@@ -391,4 +391,5 @@ const struct video_display_info display_aggregate_info = {
display_aggregate_reconfigure_audio,
};
REGISTER_MODULE(aggregate, &display_aggregate_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -1,68 +0,0 @@
/*
* FILE: video_display/aggregate.h
* AUTHORS: Martin Benes <martinbenesh@gmail.com>
* Lukas Hejtmanek <xhejtman@ics.muni.cz>
* Petr Holub <hopet@ics.muni.cz>
* Milos Liska <xliska@fi.muni.cz>
* Jiri Matela <matela@ics.muni.cz>
* Dalibor Matura <255899@mail.muni.cz>
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
*
* Copyright (c) 2005-2209 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 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.
*
*
*/
struct audio_frame;
struct module;
struct video_desc;
struct video_frame;
void *display_aggregate_init(struct module *parent, const char *fmt, unsigned int flags);
void display_aggregate_run(void *state);
void display_aggregate_done(void *state);
struct video_frame *display_aggregate_getf(void *state);
int display_aggregate_putf(void *state, struct video_frame *frame, int nonblock);
int display_aggregate_reconfigure(void *state, struct video_desc desc);
int display_aggregate_get_property(void *state, int property, void *val, size_t *len);
void display_aggregate_put_audio_frame(void *state, struct audio_frame *frame);
int display_aggregate_reconfigure_audio(void *state, int quant_samples, int channels,
int sample_rate);
struct video_display_info;
extern const struct video_display_info display_aggregate_info;

View File

@@ -1031,10 +1031,5 @@ static const struct video_display_info display_bluefish444_info = {
display_bluefish444_reconfigure_audio,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("bluefish444", &display_bluefish444_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
}
REGISTER_MODULE(bluefish444, &display_bluefish444_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -1462,11 +1462,5 @@ static const struct video_display_info display_decklink_info = {
display_decklink_reconfigure_audio,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("decklink", &display_decklink_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
}
REGISTER_MODULE(decklink, &display_decklink_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -598,10 +598,5 @@ static const struct video_display_info display_deltacast_info = {
display_deltacast_reconfigure_audio,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("deltacast", &display_deltacast_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
}
REGISTER_MODULE(deltacast, &display_deltacast_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -40,40 +40,40 @@
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#include "lib_common.h"
#include "video.h"
#include "video_display.h"
#include "video_display/dummy.h"
struct dummy_display_state {
struct video_desc desc;
};
void *display_dummy_init(struct module *, const char *, unsigned int)
static void *display_dummy_init(struct module *, const char *, unsigned int)
{
return new dummy_display_state();
}
void display_dummy_run(void *)
static void display_dummy_run(void *)
{
}
void display_dummy_done(void *state)
static void display_dummy_done(void *state)
{
delete (dummy_display_state *) state;
}
struct video_frame *display_dummy_getf(void *state)
static struct video_frame *display_dummy_getf(void *state)
{
return vf_alloc_desc_data(((dummy_display_state *) state)->desc);
}
int display_dummy_putf(void *, struct video_frame *frame, int)
static int display_dummy_putf(void *, struct video_frame *frame, int)
{
vf_free(frame);
return 0;
}
int display_dummy_get_property(void *, int property, void *val, size_t *len)
static int display_dummy_get_property(void *, int property, void *val, size_t *len)
{
codec_t codecs[] = {UYVY, YUYV, v210, RGBA, RGB, BGR};
@@ -93,23 +93,23 @@ int display_dummy_get_property(void *, int property, void *val, size_t *len)
return TRUE;
}
int display_dummy_reconfigure(void *state, struct video_desc desc)
static int display_dummy_reconfigure(void *state, struct video_desc desc)
{
((dummy_display_state *) state)->desc = desc;
return TRUE;
}
void display_dummy_put_audio_frame(void *, struct audio_frame *)
static void display_dummy_put_audio_frame(void *, struct audio_frame *)
{
}
int display_dummy_reconfigure_audio(void *, int, int, int)
static int display_dummy_reconfigure_audio(void *, int, int, int)
{
return FALSE;
}
const struct video_display_info display_dummy_info = {
static const struct video_display_info display_dummy_info = {
display_dummy_init,
display_dummy_run,
display_dummy_done,
@@ -121,3 +121,5 @@ const struct video_display_info display_dummy_info = {
display_dummy_reconfigure_audio,
};
REGISTER_MODULE(dummy, &display_dummy_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -1,67 +0,0 @@
/**
* @file video_display/dummy.h
* @author Martin Pulec <pulec@cesnet.cz>
*
* @brief This is an umbrella header for video functions.
*/
/*
* Copyright (c) 2015 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.
*/
struct audio_frame;
struct video_desc;
struct video_frame;
#ifdef __cplusplus
extern "C" {
#endif
void *display_dummy_init(struct module *parent, const char *fmt, unsigned int flags);
void display_dummy_run(void *state);
void display_dummy_done(void *state);
struct video_frame *display_dummy_getf(void *state);
int display_dummy_putf(void *state, struct video_frame *frame,
int nonblock);
int display_dummy_reconfigure(void *state, struct video_desc desc);
int display_dummy_get_property(void *state, int property, void *val, size_t *len);
void display_dummy_put_audio_frame(void *state, struct audio_frame *frame);
int display_dummy_reconfigure_audio(void *state, int quant_samples, int channels,
int sample_rate);
struct video_display_info;
extern const struct video_display_info display_dummy_info;
#ifdef __cplusplus
}
#endif

View File

@@ -971,11 +971,6 @@ static const struct video_display_info display_dvs_info = {
display_dvs_reconfigure_audio,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("dvs", &display_dvs_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
}
REGISTER_MODULE(dvs, &display_dvs_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
#endif /* HAVE_DVS */

View File

@@ -1189,10 +1189,5 @@ static const struct video_display_info display_gl_info = {
display_gl_reconfigure_audio,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("gl", &display_gl_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
}
REGISTER_MODULE(gl, &display_gl_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -47,9 +47,9 @@
#include "config_unix.h"
#include "config_win32.h"
#include "debug.h"
#include "lib_common.h"
#include "video.h"
#include "video_display.h"
#include "video_display/null.h"
#define MAGIC_NULL 0x17bad83f
@@ -57,7 +57,7 @@ struct state_null {
uint32_t magic;
};
void *display_null_init(struct module *parent, const char *fmt, unsigned int flags)
static void *display_null_init(struct module *parent, const char *fmt, unsigned int flags)
{
UNUSED(fmt);
UNUSED(flags);
@@ -71,26 +71,26 @@ void *display_null_init(struct module *parent, const char *fmt, unsigned int fla
return s;
}
void display_null_run(void *arg)
static void display_null_run(void *arg)
{
UNUSED(arg);
}
void display_null_done(void *state)
static void display_null_done(void *state)
{
struct state_null *s = (struct state_null *)state;
assert(s->magic == MAGIC_NULL);
free(s);
}
struct video_frame *display_null_getf(void *state)
static struct video_frame *display_null_getf(void *state)
{
struct state_null *s = (struct state_null *)state;
assert(s->magic == MAGIC_NULL);
return NULL;
}
int display_null_putf(void *state, struct video_frame *frame, int nonblock)
static int display_null_putf(void *state, struct video_frame *frame, int nonblock)
{
struct state_null *s = (struct state_null *)state;
assert(s->magic == MAGIC_NULL);
@@ -99,7 +99,7 @@ int display_null_putf(void *state, struct video_frame *frame, int nonblock)
return 0;
}
int display_null_get_property(void *state, int property, void *val, size_t *len)
static int display_null_get_property(void *state, int property, void *val, size_t *len)
{
UNUSED(state);
UNUSED(property);
@@ -109,7 +109,7 @@ int display_null_get_property(void *state, int property, void *val, size_t *len)
return TRUE;
}
int display_null_reconfigure(void *state, struct video_desc desc)
static int display_null_reconfigure(void *state, struct video_desc desc)
{
UNUSED(desc);
struct state_null *s = (struct state_null *)state;
@@ -118,13 +118,13 @@ int display_null_reconfigure(void *state, struct video_desc desc)
return TRUE;
}
void display_null_put_audio_frame(void *state, struct audio_frame *frame)
static void display_null_put_audio_frame(void *state, struct audio_frame *frame)
{
UNUSED(state);
UNUSED(frame);
}
int display_null_reconfigure_audio(void *state, int quant_samples, int channels,
static int display_null_reconfigure_audio(void *state, int quant_samples, int channels,
int sample_rate)
{
UNUSED(state);
@@ -135,7 +135,7 @@ int display_null_reconfigure_audio(void *state, int quant_samples, int channels,
return FALSE;
}
const struct video_display_info display_null_info = {
static const struct video_display_info display_null_info = {
display_null_init,
display_null_run,
display_null_done,
@@ -147,3 +147,5 @@ const struct video_display_info display_null_info = {
display_null_reconfigure_audio,
};
REGISTER_MODULE(none, &display_null_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -1,65 +0,0 @@
/*
* FILE: display_null.h
* AUTHOR: Colin Perkins <csp@csperkins.org>
*
* Copyright (c) 2001-2003 University of Southern California
*
* 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 the University of Southern
* California Information Sciences Institute.
*
* 4. Neither the name of the University nor of the Institute 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.
*
* $Revision: 1.1 $
* $Date: 2007/11/08 09:48:59 $
*
*/
struct audio_frame;
struct video_desc;
struct video_frame;
void *display_null_init(struct module *parent, const char *fmt, unsigned int flags);
void display_null_run(void *state);
void display_null_done(void *state);
struct video_frame *display_null_getf(void *state);
int display_null_putf(void *state, struct video_frame *frame,
int nonblock);
int display_null_reconfigure(void *state, struct video_desc desc);
int display_null_get_property(void *state, int property, void *val, size_t *len);
void display_null_put_audio_frame(void *state, struct audio_frame *frame);
int display_null_reconfigure_audio(void *state, int quant_samples, int channels,
int sample_rate);
struct video_display_info;
extern const struct video_display_info display_null_info;

View File

@@ -40,10 +40,10 @@
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#include "lib_common.h"
#include "debug.h"
#include "video.h"
#include "video_display.h"
#include "video_display/pipe.h"
#include "hd-rum-translator/hd-rum-decompress.h"
@@ -65,7 +65,7 @@ static struct display *display_pipe_fork(void *state)
if (rc == 0) return out; else return NULL;
}
void *display_pipe_init(struct module *parent, const char *fmt, unsigned int flags)
static void *display_pipe_init(struct module *parent, const char *fmt, unsigned int flags)
{
UNUSED(flags);
frame_recv_delegate *delegate;
@@ -82,20 +82,20 @@ void *display_pipe_init(struct module *parent, const char *fmt, unsigned int fla
return s;
}
void display_pipe_done(void *state)
static void display_pipe_done(void *state)
{
struct state_pipe *s = (struct state_pipe *)state;
delete s;
}
struct video_frame *display_pipe_getf(void *state)
static struct video_frame *display_pipe_getf(void *state)
{
struct state_pipe *s = (struct state_pipe *)state;
return vf_alloc_desc_data(s->desc);
}
int display_pipe_putf(void *state, struct video_frame *frame, int flags)
static int display_pipe_putf(void *state, struct video_frame *frame, int flags)
{
struct state_pipe *s = (struct state_pipe *) state;
@@ -106,12 +106,12 @@ int display_pipe_putf(void *state, struct video_frame *frame, int flags)
return TRUE;
}
void display_pipe_run(void *state)
static void display_pipe_run(void *state)
{
UNUSED(state);
}
int display_pipe_get_property(void *state, int property, void *val, size_t *len)
static int display_pipe_get_property(void *state, int property, void *val, size_t *len)
{
UNUSED(state);
codec_t codecs[] = {UYVY};
@@ -163,7 +163,7 @@ int display_pipe_get_property(void *state, int property, void *val, size_t *len)
return TRUE;
}
int display_pipe_reconfigure(void *state, struct video_desc desc)
static int display_pipe_reconfigure(void *state, struct video_desc desc)
{
struct state_pipe *s = (struct state_pipe *) state;
@@ -172,13 +172,13 @@ int display_pipe_reconfigure(void *state, struct video_desc desc)
return 1;
}
void display_pipe_put_audio_frame(void *state, struct audio_frame *frame)
static void display_pipe_put_audio_frame(void *state, struct audio_frame *frame)
{
UNUSED(state);
UNUSED(frame);
}
int display_pipe_reconfigure_audio(void *state, int quant_samples, int channels,
static int display_pipe_reconfigure_audio(void *state, int quant_samples, int channels,
int sample_rate)
{
UNUSED(state);
@@ -189,7 +189,7 @@ int display_pipe_reconfigure_audio(void *state, int quant_samples, int channels,
return FALSE;
}
const struct video_display_info display_pipe_info = {
static const struct video_display_info display_pipe_info = {
display_pipe_init,
display_pipe_run,
display_pipe_done,
@@ -201,4 +201,5 @@ const struct video_display_info display_pipe_info = {
display_pipe_reconfigure_audio,
};
REGISTER_MODULE(pipe, &display_pipe_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -1,65 +0,0 @@
/**
* @file video_display/pipe.h
* @author Martin Pulec <pulec@cesnet.cz>
*/
/*
* 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.
*/
struct audio_frame;
struct video_desc;
struct video_frame;
#ifdef __cplusplus
extern "C" {
#endif
void *display_pipe_init(struct module *parent, const char *fmt, unsigned int flags);
void display_pipe_run(void *state);
void display_pipe_done(void *state);
struct video_frame *display_pipe_getf(void *state);
int display_pipe_putf(void *state, struct video_frame *frame,
int nonblock);
int display_pipe_reconfigure(void *state, struct video_desc desc);
int display_pipe_get_property(void *state, int property, void *val, size_t *len);
void display_pipe_put_audio_frame(void *state, struct audio_frame *frame);
int display_pipe_reconfigure_audio(void *state, int quant_samples, int channels,
int sample_rate);
struct video_display_info;
extern const struct video_display_info display_pipe_info;
#ifdef __cplusplus
}
#endif

View File

@@ -41,9 +41,9 @@
#include "config_unix.h"
#include "config_win32.h"
#include "debug.h"
#include "lib_common.h"
#include "video.h"
#include "video_display.h"
#include "video_display/proxy.h"
#include <condition_variable>
#include <chrono>
@@ -111,7 +111,7 @@ static struct display *display_proxy_fork(void *state)
return out;
}
void *display_proxy_init(struct module *parent, const char *fmt, unsigned int flags)
static void *display_proxy_init(struct module *parent, const char *fmt, unsigned int flags)
{
struct state_proxy *s;
char *fmt_copy = NULL;
@@ -157,7 +157,7 @@ static void check_reconf(struct state_proxy_common *s, struct video_desc desc)
}
}
void display_proxy_run(void *state)
static void display_proxy_run(void *state)
{
shared_ptr<struct state_proxy_common> s = ((struct state_proxy *)state)->common;
bool prefill = false;
@@ -306,20 +306,20 @@ void display_proxy_run(void *state)
pthread_join(s->thread_id, NULL);
}
void display_proxy_done(void *state)
static void display_proxy_done(void *state)
{
struct state_proxy *s = (struct state_proxy *)state;
delete s;
}
struct video_frame *display_proxy_getf(void *state)
static struct video_frame *display_proxy_getf(void *state)
{
struct state_proxy *s = (struct state_proxy *)state;
return vf_alloc_desc_data(s->desc);
}
int display_proxy_putf(void *state, struct video_frame *frame, int flags)
static int display_proxy_putf(void *state, struct video_frame *frame, int flags)
{
shared_ptr<struct state_proxy_common> s = ((struct state_proxy *)state)->common;
@@ -342,7 +342,7 @@ int display_proxy_putf(void *state, struct video_frame *frame, int flags)
return 0;
}
int display_proxy_get_property(void *state, int property, void *val, size_t *len)
static int display_proxy_get_property(void *state, int property, void *val, size_t *len)
{
shared_ptr<struct state_proxy_common> s = ((struct state_proxy *)state)->common;
if (property == DISPLAY_PROPERTY_SUPPORTS_MULTI_SOURCES) {
@@ -357,7 +357,7 @@ int display_proxy_get_property(void *state, int property, void *val, size_t *len
}
}
int display_proxy_reconfigure(void *state, struct video_desc desc)
static int display_proxy_reconfigure(void *state, struct video_desc desc)
{
struct state_proxy *s = (struct state_proxy *) state;
@@ -366,13 +366,13 @@ int display_proxy_reconfigure(void *state, struct video_desc desc)
return 1;
}
void display_proxy_put_audio_frame(void *state, struct audio_frame *frame)
static void display_proxy_put_audio_frame(void *state, struct audio_frame *frame)
{
UNUSED(state);
UNUSED(frame);
}
int display_proxy_reconfigure_audio(void *state, int quant_samples, int channels,
static int display_proxy_reconfigure_audio(void *state, int quant_samples, int channels,
int sample_rate)
{
UNUSED(state);
@@ -383,7 +383,7 @@ int display_proxy_reconfigure_audio(void *state, int quant_samples, int channels
return FALSE;
}
const struct video_display_info display_proxy_info = {
static const struct video_display_info display_proxy_info = {
display_proxy_init,
display_proxy_run,
display_proxy_done,
@@ -395,3 +395,5 @@ const struct video_display_info display_proxy_info = {
display_proxy_reconfigure_audio,
};
REGISTER_MODULE(proxy, &display_proxy_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -1,66 +0,0 @@
/**
* @file video_display/proxy.h
* @author Martin Pulec <pulec@cesnet.cz>
*/
/*
* 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.
*/
struct audio_frame;
struct video_desc;
struct video_frame;
#ifdef __cplusplus
extern "C" {
#endif
void *display_proxy_init(struct module *parent, const char *fmt, unsigned int flags);
void display_proxy_run(void *state);
void display_proxy_done(void *state);
struct video_frame *display_proxy_getf(void *state);
int display_proxy_putf(void *state, struct video_frame *frame,
int nonblock);
int display_proxy_reconfigure(void *state, struct video_desc desc);
int display_proxy_get_property(void *state, int property, void *val, size_t *len);
void display_proxy_put_audio_frame(void *state, struct audio_frame *frame);
int display_proxy_reconfigure_audio(void *state, int quant_samples, int channels,
int sample_rate);
struct video_display_info;
extern const struct video_display_info display_proxy_info;
#ifdef __cplusplus
}
#endif

View File

@@ -1309,12 +1309,7 @@ static const struct video_display_info display_quicktime_info = {
display_quicktime_reconfigure_audio,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("quicktime", &display_quicktime_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
}
REGISTER_MODULE(quicktime, &display_quicktime_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
#endif /* HAVE_MACOSX */

View File

@@ -559,10 +559,5 @@ static const struct video_display_info display_sage_info = {
display_sage_reconfigure_audio,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("sage", &display_sage_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
}
REGISTER_MODULE(sage, &display_sage_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);

View File

@@ -802,10 +802,5 @@ static const struct video_display_info display_sdl_info = {
display_sdl_reconfigure_audio,
};
static void mod_reg(void) __attribute__((constructor));
static void mod_reg(void)
{
register_library("sdl", &display_sdl_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);
}
REGISTER_MODULE(sdl, &display_sdl_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION);