ethand91 / mediasoup-ios-client

Mediasoup 3 iOS Client
ISC License
131 stars 65 forks source link

WebRTC build broken link to get depot_tools #44

Closed xplatsolutions closed 4 years ago

xplatsolutions commented 4 years ago

Started a SwiftUI project mediasoup client and when started to build the WebRTC framework I found that the below link is broken. https://webrtc.org/native-code/development/prerequisite-sw/

https://github.com/ethand91/mediasoup-ios-client/blob/master/build/mediasoup%403%20iOS%20WebRTC%20Framework%20Build%20Instructions.md#mediasoup3-ios-webrtc-framework-build-instructions

ethand91 commented 4 years ago

Hello try using the below repo: https://github.com/ethand91/webrtc-mac-src/tree/m84

xplatsolutions commented 4 years ago

Hello :) thank you for your reply. I'm almost there, made it to this section Build libmediasoupclient

After # Build iOS arm64 with CMake command working fine but when executing make -C build will fail with the below error.

user@userr-mbp dependencies % make -C build

Scanning dependencies of target sdptransform
[  4%] Building CXX object libmediasoupclient/libsdptransform/CMakeFiles/sdptransform.dir/src/grammar.cpp.o
[  8%] Building CXX object libmediasoupclient/libsdptransform/CMakeFiles/sdptransform.dir/src/parser.cpp.o
[ 13%] Building CXX object libmediasoupclient/libsdptransform/CMakeFiles/sdptransform.dir/src/writer.cpp.o
[ 17%] Linking CXX static library libsdptransform.a
[ 17%] Built target sdptransform
Scanning dependencies of target mediasoupclient
[ 21%] Building CXX object libmediasoupclient/CMakeFiles/mediasoupclient.dir/src/Consumer.cpp.o
In file included from /Users/user/Documents/Source/mediasoup-clones/mediasoup-ios-client/mediasoup-client-ios/dependencies/libmediasoupclient/src/Consumer.cpp:3:
/Users/user/Documents/Source/mediasoup-clones/mediasoup-ios-client/mediasoup-client-ios/dependencies/libmediasoupclient/include/Consumer.hpp:5:10: fatal error:
      'api/media_stream_interface.h' file not found
#include <api/media_stream_interface.h> // webrtc::MediaStreamTrackInterface
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [libmediasoupclient/CMakeFiles/mediasoupclient.dir/src/Consumer.cpp.o] Error 1
make[1]: *** [libmediasoupclient/CMakeFiles/mediasoupclient.dir/all] Error 2
make: *** [all] Error 2

Since libmediasoupclient folder in dependencies folder was empty I copied the source from libmediasoupclient

Find below the output from the CMake command.

CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

--
========== libmediasoupclient iOS Build Configuration ==========

-- CMAKE_OSX_SYSROOT             = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/
-- CMAKE_OSX_ARCHITECTURES       = arm64

=========== libmediasoupclient Build Configuration ===========

-- MEDIASOUPCLIENT_BUILD_TESTS : OFF
-- MEDIASOUPCLIENT_LOG_TRACE   : OFF
-- MEDIASOUPCLIENT_LOG_DEV     : OFF
-- LIBWEBRTC_INCLUDE_PATH      : /Users/user/Documents/Source/mediasoup-clones/mediasoup-ios-client/mediasoup-client-ios/dependencies/webrtc/src
-- LIBWEBRTC_BINARY_PATH       : /Users/user/Documents/Source/mediasoup-clones/mediasoup-ios-client/mediasoup-client-ios/dependencies/webrtc/src/out_ios_libs/universal

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/Documents/Source/mediasoup-clones/mediasoup-ios-client/mediasoup-client-ios/dependencies/build
ethand91 commented 4 years ago

It seems the header file for [api/media_stream_interface.h] is not being found, is your [LIBWEBRTC_INCLUDE_PATH] correct? Does LIBWEBRTC_INCLUDE_PATH/api/media_stream_interface.h exist?

As for libmediasoupclient it is a submodule, so you need to clone the submodules too.

xplatsolutions commented 4 years ago

[LIBWEBRTC_INCLUDE_PATH] is correct =/Users/user/Documents/Source/mediasoup-clones/mediasoup-ios-client/mediasoup-client-ios/dependencies/webrtc/src

But

LIBWEBRTC_INCLUDE_PATH/api/media_stream_interface.h does not exist. Actually in LIBWEBRTC_INCLUDE_PATH folder it's the out_ios_libs folder I copied from previous step Move the output to the WebRTC dependencies folder.

Sounds like I am missing a step or how to add the LIBWEBRTC_INCLUDE_PATH/api/* files.

[Update] Now I read your last comment better, hmm I did clone libmediasoupclient into dependencies folder. Since I am new to this process I'd appreciate a steps guide how to do that, simple copy source from Github, special command into LIBWEBRTC_INCLUDE_PATH folder;

ethand91 commented 4 years ago

LIBWEBRTC_INCLUDE_PATH should be linked to where you cloned the webrtc repo.

https://github.com/ethand91/webrtc-mac-src/blob/master/api/media_stream_interface.h

xplatsolutions commented 4 years ago

I see, thanks! Lacking experience working with CMake and make I have now noticed that you set the directory in CMake, next time I won't have to copy the files.

I guess you follow this process every time libMediasoupClient updated and bridge to ObjC world right; My question is, do you independently sometimes update the libwebrtc.a universal binary in your project?

I am just trying to see what would be the best strategy for updating future releases. It makes sense to just follow the whole process building the libwebrtc.a, then againlibmediasoup.a and libsdptransform.a and refresh dependencies in the project and make sure it is working :)

Thanks so much, the project is successfully building, will continue to add creating and streaming video/audio now.

ethand91 commented 4 years ago

I guess you follow this process every time libMediasoupClient updated and bridge to ObjC world right;

When mediasoupclient is updated I just pull the submodule and rebuild.

My question is, do you independently sometimes update the libwebrtc.a universal binary in your project?

Only if libmediasoupclient has updated libwebrtc, if not this step is not needed.

I am just trying to see what would be the best strategy for updating future releases.

I agree the current process of building is not beginner friendly.. I eventually want to do all the steps automatically. Any advice is appreciated.

Thanks so much, the project is successfully building, will continue to add creating and streaming video/audio now.

Great :) I'll close this for now

xplatsolutions commented 4 years ago

Thanks!

While I'm learning this hopefully I can help with documentation, I am curious about something why checkout the below specific branch-head?

git checkout -b m84 refs/remotes/branch-heads/4147

Rockjan commented 4 years ago

Thanks!

While I'm learning this hopefully I can help with documentation, I am curious about something why checkout the below specific branch-head?

git checkout -b m84 refs/remotes/branch-heads/4147

Hi man, can you provide me a libwebrtc.a with arm64 and x86_64 ? It's not easy to build with the webrtc project because I am in China and we have a great-fire-wall. My email : rockjan@126.com Hope you can save my day! Thanks again!