1 diff --git a/CMakeLists.txt b/CMakeLists.txt
6 find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
7 find_package(KF5IdentityManagement ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
10 include(KDEInstallDirs)
11 include(KDECompilerSettings NO_POLICY_SCOPE)
12 diff --git a/cmake/modules/FindLiboRTP.cmake b/cmake/modules/FindLiboRTP.cmake
13 --- a/cmake/modules/FindLiboRTP.cmake
14 +++ b/cmake/modules/FindLiboRTP.cmake
17 SET( LIBORTP_FOUND FALSE )
19 -pkg_check_modules(ortp ortp)
20 +pkg_check_modules(ORTP ortp)
22 FIND_PATH( LIBORTP_INCLUDE_DIR
25 if ( run_result EQUAL 0 )
27 SET( LIBORTP_FOUND TRUE )
28 - MESSAGE( STATUS "Found libortp: ${LIBORTP_LIBRARY}" )
29 + MESSAGE( STATUS "Found libortp: ${LIBORTP_LIBRARY} ${ORTP_VERSION}" )
30 + IF (ORTP_VERSION VERSION_LESS 1.0.1)
31 + SET(ORTP_LESS_1_0_1 TRUE)
32 + ELSE (ORTP_VERSION VERSION_LESS 1.0.1)
33 + SET(ORTP_LESS_1_0_1 FALSE)
34 + ENDIF (ORTP_VERSION VERSION_LESS 1.0.1)
36 endif ( run_result EQUAL 0 )
37 endif( compile_result )
38 ENDIF( LIBORTP_INCLUDE_DIR AND LIBORTP_LIBRARY )
39 diff --git a/cmake/modules/FindMediastreamer.cmake b/cmake/modules/FindMediastreamer.cmake
40 --- a/cmake/modules/FindMediastreamer.cmake
41 +++ b/cmake/modules/FindMediastreamer.cmake
44 IF (MEDIASTREAMER_FOUND)
45 IF (NOT MEDIASTREAMER_FIND_QUIETLY)
47 MESSAGE(STATUS "Found Mediastreamer: ${MEDIASTREAMER_LIBRARIES} (version: ${MEDIASTREAMER_VERSION})")
49 + SET(MEDIASTREAMER_LESS_2_9 FALSE)
50 + SET(MEDIASTREAMER_LESS_2_11 FALSE)
51 + SET(MEDIASTREAMER_LESS_2_14 FALSE)
53 IF (MEDIASTREAMER_VERSION VERSION_LESS 2.9)
54 SET(MEDIASTREAMER_LESS_2_9 TRUE)
55 - SET(MEDIASTREAMER_LESS_2_11 TRUE)
56 - ELSEIF (MEDIASTREAMER_VERSION VERSION_LESS 2.11)
57 - SET(MEDIASTREAMER_LESS_2_9 FALSE)
58 - SET(MEDIASTREAMER_LESS_2_11 TRUE)
59 - ELSE (MEDIASTREAMER_VERSION VERSION_LESS 2.9)
60 - SET(MEDIASTREAMER_LESS_2_9 FALSE)
61 - SET(MEDIASTREAMER_LESS_2_11 FALSE)
62 ENDIF (MEDIASTREAMER_VERSION VERSION_LESS 2.9)
64 + IF (MEDIASTREAMER_VERSION VERSION_LESS 2.11)
65 + SET(MEDIASTREAMER_LESS_2_11 TRUE)
66 + ENDIF (MEDIASTREAMER_VERSION VERSION_LESS 2.11)
68 + IF (MEDIASTREAMER_VERSION VERSION_LESS 2.14)
69 + SET(MEDIASTREAMER_LESS_2_14 TRUE)
70 + ENDIF (MEDIASTREAMER_VERSION VERSION_LESS 2.14)
72 ENDIF (NOT MEDIASTREAMER_FIND_QUIETLY)
73 ELSE (MEDIASTREAMER_FOUND)
74 IF (MEDIASTREAMER_FIND_REQUIRED)
75 diff --git a/protocols/jabber/libjingle/CMakeLists.txt b/protocols/jabber/libjingle/CMakeLists.txt
76 --- a/protocols/jabber/libjingle/CMakeLists.txt
77 +++ b/protocols/jabber/libjingle/CMakeLists.txt
79 add_definitions ( -DMEDIASTREAMER_LESS_2_11 )
80 endif ( MEDIASTREAMER_LESS_2_11 )
82 +if ( MEDIASTREAMER_LESS_2_14 )
83 + add_definitions ( -DMEDIASTREAMER_LESS_2_14 )
84 +endif ( MEDIASTREAMER_LESS_2_14 )
86 if ( CMAKE_BUILD_TYPE STREQUAL "Debug" )
87 add_definitions ( -D_DEBUG )
88 endif ( CMAKE_BUILD_TYPE STREQUAL "Debug" )
91 ${MEDIASTREAMER_LIBRARIES}
93 + ${CMAKE_THREAD_LIBS_INIT}
97 diff --git a/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.h b/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.h
98 --- a/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.h
99 +++ b/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.h
101 class LinphoneMediaEngine : public MediaEngineInterface {
103 LinphoneMediaEngine(const std::string& ringWav, const std::string& callWav);
104 +#ifdef MEDIASTREAMER_LESS_2_14
105 virtual ~LinphoneMediaEngine() {}
107 + ~LinphoneMediaEngine();
110 // Implement pure virtual methods of MediaEngine.
111 virtual bool Init() { return true; }
116 +#ifndef MEDIASTREAMER_LESS_2_14
117 + MSFactory *factory;
121 std::vector<AudioCodec> voice_codecs_;
122 std::vector<VideoCodec> video_codecs_;
124 class LinphoneVoiceChannel : public VoiceMediaChannel {
126 LinphoneVoiceChannel(LinphoneMediaEngine *eng);
127 +#ifdef MEDIASTREAMER_LESS_2_14
128 virtual ~LinphoneVoiceChannel();
130 + ~LinphoneVoiceChannel();
133 // Implement pure virtual methods of VoiceMediaChannel.
134 virtual bool SetRecvCodecs(const std::vector<AudioCodec>& codecs);
135 diff --git a/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.cc b/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.cc
136 --- a/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.cc
137 +++ b/protocols/jabber/libjingle/talk/session/phone/linphonemediaengine.cc
139 ///////////////////////////////////////////////////////////////////////////
140 LinphoneMediaEngine::LinphoneMediaEngine(const std::string& ringWav, const std::string& callWav) : ring_wav_(ringWav), call_wav_(callWav) {
142 +#ifdef MEDIASTREAMER_LESS_2_14
145 + factory = ms_factory_new();
146 + ms_factory_init_voip(factory);
147 + ms_factory_init_plugins(factory);
151 char * path = strdup(MSILBC_LIBRARY);
152 char * dirc = dirname(path);
153 +#ifdef MEDIASTREAMER_LESS_2_14
154 ms_load_plugins(dirc);
156 + ms_factory_load_plugins(factory, dirc);
161 +#ifdef MEDIASTREAMER_LESS_2_14
162 have_ilbc = ms_filter_codec_supported("iLBC");
163 have_speex = ms_filter_codec_supported("speex");
164 have_gsm = ms_filter_codec_supported("gsm");
166 + have_ilbc = ms_factory_codec_supported(factory, "iLBC");
167 + have_speex = ms_factory_codec_supported(factory, "speex");
168 + have_gsm = ms_factory_codec_supported(factory, "gsm");
172 voice_codecs_.push_back(AudioCodec(110, payload_type_speex_wb.mime_type, payload_type_speex_wb.clock_rate, 0, 1, 8));
174 voice_codecs_.push_back(AudioCodec(101, payload_type_telephone_event.mime_type, payload_type_telephone_event.clock_rate, 0, 1, 1));
177 +#ifndef MEDIASTREAMER_LESS_2_14
178 +LinphoneMediaEngine::~LinphoneMediaEngine() {
179 + ms_factory_uninit_plugins(factory);
180 + ms_factory_uninit_voip(factory);
181 + ms_factory_destroy(factory);
185 void LinphoneMediaEngine::Terminate() {
188 @@ -149,15 +173,25 @@
189 playport2 = PORT_UNUSED;
192 +#ifdef MEDIASTREAMER_LESS_2_14
193 ortp_set_log_level_mask(ORTP_DEBUG|ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
195 + ortp_set_log_level_mask(ORTP_LOG_DOMAIN, ORTP_DEBUG|ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
198 +#ifdef MEDIASTREAMER_LESS_2_14
199 ortp_set_log_level_mask(ORTP_FATAL);
201 + ortp_set_log_level_mask(ORTP_LOG_DOMAIN, ORTP_FATAL);
205 #ifdef MEDIASTREAMER_LESS_2_9
206 audio_stream_ = audio_stream_new(-1, 0); /* -1 means that function will choose some free port */
208 +#elif MEDIASTREAMER_LESS_2_14
209 audio_stream_ = audio_stream_new(-1, -1, 0); /* -1 means that function will choose some free port */
211 + audio_stream_ = audio_stream_new(engine_->factory, -1, -1, 0); /* -1 means that function will choose some free port */
215 @@ -272,11 +306,22 @@
219 +#ifdef MEDIASTREAMER_LESS_2_14
220 + MSSndCardManager *snd_manager = ms_snd_card_manager_get();
221 MSSndCard *playcard = ms_snd_card_manager_get_default_playback_card(ms_snd_card_manager_get());
223 + MSSndCardManager *snd_manager = ms_factory_get_snd_card_manager(engine_->factory);
224 + MSSndCard *playcard = ms_snd_card_manager_get_default_playback_card(snd_manager);
230 +#ifdef MEDIASTREAMER_LESS_2_14
231 MSSndCard *captcard = ms_snd_card_manager_get_default_capture_card(ms_snd_card_manager_get());
233 + MSSndCard *captcard = ms_snd_card_manager_get_default_capture_card(snd_manager);
240 void LinphoneVoiceChannel::StartRing(bool bIncomingCall)
242 +#ifdef MEDIASTREAMER_LESS_2_14
243 + MSSndCardManager *snd_manager = ms_snd_card_manager_get();
245 + MSSndCardManager *snd_manager = ms_factory_get_snd_card_manager(engine_->factory);
248 MSSndCard *sndcard = NULL;
249 +#ifdef MEDIASTREAMER_LESS_2_14
250 sndcard=ms_snd_card_manager_get_default_card(ms_snd_card_manager_get());
252 + sndcard=ms_snd_card_manager_get_default_card(snd_manager);
258 if (engine_->GetRingWav().size() > 0)
260 LOG(LS_VERBOSE) << "incoming ring. sound file: " << engine_->GetRingWav().c_str() << "\n";
261 +#ifdef MEDIASTREAMER_LESS_2_14
262 ring_stream_ = ring_start (engine_->GetRingWav().c_str(), 1, sndcard);
264 + ring_stream_ = ring_start (engine_->factory, engine_->GetRingWav().c_str(), 1, sndcard);
270 if (engine_->GetCallWav().size() > 0)
272 LOG(LS_VERBOSE) << "outgoing ring. sound file: " << engine_->GetCallWav().c_str() << "\n";
273 +#ifdef MEDIASTREAMER_LESS_2_14
274 ring_stream_ = ring_start (engine_->GetCallWav().c_str(), 1, sndcard);
276 + ring_stream_ = ring_start (engine_->factory, engine_->GetCallWav().c_str(), 1, sndcard);