g++>= 4.9 or
clang(with C++11 support)
Future versions of libmediasoupclient will include a more recent version of libwebrtc. For now,
m73 branch is required.
Get the libmediasoupclient sources via git and check-out the branch
$ git clone https://github.com/versatica/libmediasoupclient.git $ cd libmediasoupclient/ $ git checkout v3
$ cmake . -Bbuild \ -DLIBWEBRTC_INCLUDE_PATH:PATH=PATH_TO_LIBWEBRTC_SOURCES \ -DLIBWEBRTC_BINARY_PATH:PATH=PATH_TO_LIBWEBRTC_BINARY # Compile libmediasoupclient. $ make -C build/ # or: cd build/ && make # Optionally install it in the system. $ make install -C build/ # or: $ cd build/ && make install
Depending on the host, it will generate the following static lib and header files:
-- Installing: /usr/local/lib/libmediasoupclient.a -- Up-to-date: /usr/local/include/mediasoupclient/mediasoupclient.hpp
|LIBWEBRTC_INCLUDE_PATH||Path||libwebrtc include path.||Yes|
|LIBWEBRTC_BINARY_PATH||Path||libwebrtc binary path.||Yes|
The application is responsible for defining the symbol visibility of the resulting binary. Symbol visibility mismatch among different libraries will generate plenty of linker warnings such us the one below:
ld: warning: direct access in function 'webrtc::I010Buffer::Rotate(webrtc::I010BufferInterface const&, webrtc::VideoRotation)' from file '/Users/jmillan/src/webrtc-checkout/src/out/m73/obj/libwebrtc.a(i010_buffer.o)' to global weak symbol 'void rtc::webrtc_checks_impl::LogStreamer<>::Call<>(char const*, int, char const*)::t' from file '../libmediasoupclient.a(PeerConnection.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
In order to avoid such warnings make sure the corresponding visibility compilation flags are provided. For example, if libwebrtc was built with hidden symbol visibility, libmediasoupclient needs to be provided with the correspoinding compilation flag:
cmake . -Bbuild \ -DLIBWEBRTC_INCLUDE_PATH:PATH=PATH_TO_LIBWEBRTC_SOURCES \ -DLIBWEBRTC_BINARY_PATH:PATH=PATH_TO_LIBWEBRTC_BINARY \ -DCMAKE_CXX_FLAGS="-fvisibility=hidden"
Once installed include the library into your C++ application:
And add the libmediasoupclient static library to your C++ project.
The C++ application should also include the required libwebrtc headers.