mswebrtc.c 2.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 mswebrtc.c
 Copyright (C) 2013 Belledonne Communications, Grenoble, France

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
17
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 19
 */

20
#ifdef HAVE_CONFIG_H
21
#include "config.h"
Ghislain MARY's avatar
Ghislain MARY committed
22
#endif
23

24
#ifdef BUILD_ISAC
25
#include "isac_constants.h"
26 27 28
#include "isacfix.h"
#endif

29 30 31 32
#ifdef BUILD_ILBC
#include "ilbc.h"
#endif

33
#include "signal_processing_library.h"
34 35 36 37 38

#include "mediastreamer2/msfilter.h"
#include "mediastreamer2/mscodecutils.h"


39
#ifdef BUILD_ISAC
40 41
extern MSFilterDesc ms_isac_dec_desc;
extern MSFilterDesc ms_isac_enc_desc;
42 43
#endif
#ifdef BUILD_AEC
44
extern MSFilterDesc ms_webrtc_aec_desc;
45
#endif
46 47 48
#ifdef BUILD_AECM
extern MSFilterDesc ms_webrtc_aecm_desc;
#endif
49
#ifdef BUILD_ILBC
Simon Morlat's avatar
Simon Morlat committed
50 51
extern MSFilterDesc ms_webrtc_ilbc_enc_desc;
extern MSFilterDesc ms_webrtc_ilbc_dec_desc;
52
#endif
Erwan Croze's avatar
Erwan Croze committed
53 54 55
#ifdef BUILD_VAD
extern MSFilterDesc ms_webrtc_vad_desc;
#endif
56 57 58 59 60 61 62 63 64 65 66

#ifndef VERSION
#define VERSION "debug"
#endif

#ifdef _MSC_VER
#define MS_PLUGIN_DECLARE(type) __declspec(dllexport) type
#else
#define MS_PLUGIN_DECLARE(type) type
#endif

67
MS_PLUGIN_DECLARE ( void ) libmswebrtc_init(MSFactory* factory) {
68
#ifdef BUILD_ISAC
69
	char isac_version[20] = "";
70
#endif
71 72 73
#ifdef BUILD_ILBC
	char ilbc_version[20] = "";
#endif
Erwan Croze's avatar
Erwan Croze committed
74

75 76
	WebRtcSpl_Init();

77 78
#ifdef BUILD_ISAC
	WebRtcIsacfix_version(isac_version);
79 80
	ms_factory_register_filter(factory, &ms_isac_enc_desc);
	ms_factory_register_filter(factory, &ms_isac_dec_desc);
81 82
#endif
#ifdef BUILD_AEC
83
	ms_factory_register_filter(factory, &ms_webrtc_aec_desc);
84
#endif
85 86 87
#ifdef BUILD_AECM
	ms_factory_register_filter(factory, &ms_webrtc_aecm_desc);
#endif
88 89
#ifdef BUILD_ILBC
	WebRtcIlbcfix_version(ilbc_version);
90 91
	ms_factory_register_filter(factory, &ms_webrtc_ilbc_enc_desc);
	ms_factory_register_filter(factory, &ms_webrtc_ilbc_dec_desc);
92
#endif
Erwan Croze's avatar
Erwan Croze committed
93 94 95
#ifdef BUILD_VAD
	ms_factory_register_filter(factory, &ms_webrtc_vad_desc);
#endif
96

97 98
	ms_message("libmswebrtc " VERSION " plugin loaded"
#ifdef BUILD_ISAC
99 100 101 102 103 104 105 106 107 108
	", iSAC codec version %s"
#endif
#ifdef BUILD_ILBC
	", iLBC codec version %s"
#endif
#ifdef BUILD_ISAC
	, isac_version
#endif
#ifdef BUILD_ILBC
	, ilbc_version
109 110
#endif
	);
111 112 113
}