Try compile libmediasoupclient C++ client sdk with lastest libwebrtc, but compiles error

I’m trying to compile libmediasoupclient C++ client sdk with lastest libwebrtc:

CMakeLists.txt:

# Project configuration.
set(LIBWEBRTC_INCLUDE_PATH "/Users/chenzx/repo/webrtc/src/" CACHE STRING "libwebrtc include path")
set(LIBWEBRTC_BINARY_PATH "/Users/chenzx/repo/webrtc/src/out/Debug/obj/" CACHE STRING "libwebrtc binary path")

But compiles error:

[ 60%] Building CXX object CMakeFiles/mediasoupclient.dir/src/ortc.cpp.o
/Users/banma-0643/repo/webrtc_server_demo/libmediasoupclient/src/ortc.cpp:1603:18: error: no type named 'CodecParameterMap' in namespace 'webrtc::H264'
                        webrtc::H264::CodecParameterMap aParameters;
                        ~~~~~~~~~~~~~~^
/Users/banma-0643/repo/webrtc_server_demo/libmediasoupclient/src/ortc.cpp:1604:36: error: use of undeclared identifier 'bParameters'; did you mean 'aParameters'?
                        webrtc::H264::CodecParameterMap bParameters;
                                                        ^~~~~~~~~~~
                                                        aParameters

It seems latest libwebrtc source code removed webrtc::H264 related code? How can i switch libwebrtc’s version to mediasoup-compliant M74?

We write documentation for something.

Yes, i saw this, but since it’s not in readme of libmediasoupclient repo , so i didn’t take care~

Try with m84 branch, i got:

src % gn gen out/m84 --args='is_debug=false is_component_build=false is_clang=true rtc_include_tests=false rtc_use_h264=true use_rtti=true mac_deployment_target="10.11" use_custom_libcxx=false'
ERROR at //build/config/mac/mac_sdk.gni:106:7: Script returned non-zero exit code.
      exec_script("//build/mac/find_sdk.py", find_sdk_args, "list lines")
      ^----------
Current dir: /Users/chenzx/repo/webrtc/src/out/m84/
Command: python /Users/chenzx/repo/webrtc/src/build/mac/find_sdk.py --print_sdk_path --print_bin_path 10.12
Returned 1.
stderr:

Traceback (most recent call last):
  File "/Users/chenzx/repo/webrtc/src/build/mac/find_sdk.py", line 97, in <module>
    print(main())
  File "/Users/chenzx/repo/webrtc/src/build/mac/find_sdk.py", line 80, in main
    raise Exception('No %s+ SDK found' % min_sdk_version)
Exception: No 10.12+ SDK found

See //build/config/sysroot.gni:71:5: whence it was imported.
    import("//build/config/mac/mac_sdk.gni")
    ^--------------------------------------
See //build/config/linux/pkg_config.gni:5:1: whence it was imported.
import("//build/config/sysroot.gni")
^----------------------------------
See //BUILD.gn:15:1: whence it was imported.
import("//build/config/linux/pkg_config.gni")
^-------------------------------------------

I’m using Mac 10.15, and:

src % ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ 
DriverKit20.2.sdk	MacOSX.sdk		MacOSX11.1.sdk

i guess the m84 build script is not robust enough

I’m afraid that is a pure libwebrtc issue. We cannot give support about libwebrtc. Maybe others can.

I fixed this, i changed src/build/mac/find_sdk.py to adapt to new version sdk:

line:

  sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]

changed to

  sdks = [re.findall('^MacOSX([0-9]{2}\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
1 Like