Minimal build

409 views
Skip to first unread message

Simon Menke

unread,
Jun 5, 2014, 11:38:52 AM6/5/14
to discuss...@googlegroups.com
Hi everyone,

Is it possible to build libjingle_peerconnection without any audio/video support.
I would like to have just the DataChannel API (while still using the PeerConnection API).


- simon

Guillaume Egles

unread,
Feb 20, 2015, 2:21:27 PM2/20/15
to discuss...@googlegroups.com
I have the exact same question and would love to know.

Did you end up figuring it out?

Cheers. G.

Kaiduan Xie

unread,
Feb 20, 2015, 3:36:09 PM2/20/15
to discuss...@googlegroups.com
You need to make some changes in the code and some changes in the gyp file.

1. In talk/build/common.gypi

comment out HAVE_WEBRTC_VIDEO and HAVE_WEBRTC_VOICE

2. In talk/app/webrtc/peerconnectionfactory.cc, set FakeMediaEngine as the media engine.

  channel_manager_.reset(new cricket::ChannelManager(
      new cricket::FakeMediaEngine, device_manager, worker_thread_));

With these two changes, webrtc media engine will not be built, and SCTP data channel will work.

/Kaiduan



--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin Uberti

unread,
Feb 20, 2015, 7:55:28 PM2/20/15
to discuss-webrtc, Peter Thatcher
We should use a NullMediaEngine if HAVE_WEBRTC_VOICE/VIDEO are not set.

The create method in MediaEngineFactory should do this, but feel free to send a patch if this is not currently working.

Bill Gibson

unread,
Feb 22, 2015, 9:21:28 PM2/22/15
to discuss...@googlegroups.com, ptha...@google.com
I've given this a try with my iOS build. I'm getting 35 link errors for items I would have expected to not be in the minimal build. Are you working on the Java version? If iOS, which build version are you working with?

Thanks.
Bill

Kaiduan Xie

unread,
Feb 23, 2015, 3:55:05 PM2/23/15
to discuss...@googlegroups.com, ptha...@google.com
Justin, I tried the NullMediaEngine, however it does not work on the version I have (my version is quite old) because NullMediaEngine returns a null voice channel. I will try NullMediaEngine with the latest trunk.

Bill, you only need libjingle_peerconnection, libjingle_p2p, libsrtp, libjingle_media, libusrsctp, libjingle_sound, libjingle, jsoncpp to build.

It works on my code base.

/Kaiduan

Bill Gibson

unread,
Feb 24, 2015, 1:58:09 PM2/24/15
to discuss...@googlegroups.com, ptha...@google.com
Thank you for the advice, Kaiduan. The link errors are in the libjingle_media.a library. I think the code structure has changed significantly since your version. It looks like the libjingle.gyp needs additional modification in order to not include the media engines (just use the null one) and possibly others too. As the minimal solution does not seem to be a simple set of changes, I need to defer additional research time until after my current deadline.

Kaiduan Xie

unread,
Mar 11, 2015, 2:02:42 PM3/11/15
to discuss...@googlegroups.com, Peter Thatcher
I managed to get data channel only build working using NullMediaEngine with latest webrtc native code.

Some minor changes in talk/media/webrtc/webrtcmediaengine.cc are required, please see the attached diff file.

You need to link the following libraries,

                -ljingle_peerconnection \
-ljingle_p2p \
-lsrtp \
-ljingle_media \
-lusrsctplib \
-ljsoncpp \
-lfield_trial_default \
-lrtc_p2p \
-lrtc_base \
-lrtc_base_approved \
-lyuv \
-lyuv_neon \

Hope it helps.

/Kaiduan
datachannel.diff

Guillaume Egles

unread,
Mar 11, 2015, 6:47:44 PM3/11/15
to discuss...@googlegroups.com, ptha...@google.com
Kaiduan,

I tried to apply your patch below on the latest WebRTC codebase (from today) but it would not apply as the code looks quite a bit different that from your patch.

I don't have the bandwidth to investigate further at the moment, but any pointer on this is appreciated.

Our app only needs the DataChannel and I would love to not need to link with 50 unused libraries... ;)

Cheers. G.

Kaiduan Xie

unread,
Mar 11, 2015, 8:58:05 PM3/11/15
to discuss...@googlegroups.com, ptha...@google.com
I fetched the code on Feb 24, let me see what have changed and send you a patch.

/Kaiduan

Nazmus Shakeeb

unread,
Mar 11, 2015, 11:50:19 PM3/11/15
to discuss...@googlegroups.com
Hi Simon,

You can go through the following project. They are using libjingle without media. 


May be it will be helpful for you.

Thanks,
Shakeeb

Kaiduan Xie

unread,
Mar 12, 2015, 9:54:26 AM3/12/15
to discuss...@googlegroups.com
Guillaume,

Please use the attached webrtcvoicemediaengine/webrtcvideocapturefactory.cc, they are based on the latest trunk, in fact the change is very minor.

/Kaiduan

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
webrtcmediaengine-datachannel.cc
webrtcvideocapturerfactory-datachannel.cc

Guillaume Egles

unread,
Mar 12, 2015, 4:42:06 PM3/12/15
to discuss...@googlegroups.com
Kaiduan,

Thanks once again for spending the time. I tried your patched files, but sadly to no avail. I still get a bunch of compilation errors (see attached logs).

The exact set of changes I make based on the latest codebase is attached. I only comment out the HAVE_VIDEO/AUDIO defines and apply your 2 changed files. (I did try with and without the change you had suggested in one of your previous post (" In talk/app/webrtc/peerconnectionfactory.cc, set FakeMediaEngine as the media engine."), but no more successful.

Let me know if you see something obviously wrong in what I am doing...

CHeers. G. 
build_errors.txt
minimal_build.diff

Guillaume Egles

unread,
Mar 12, 2015, 9:09:15 PM3/12/15
to discuss...@googlegroups.com
Kaiduan,

Boy, it wasn't easy and I still had to make quite a few modification to the files you pointed at and to the mediaengine.h, but I finally got the minimal build compiling and even my application working with only the subset you listed above!

Thank you so much for guiding me through this process. I really hope this will get smoother over time and that we won't have to redo the patching over and over.

Still not clear why I needed to make more changes from your patch. Maybe our environments are different or we are not exactly working on the same version.

In any case, I could not have done it with your help. SO major thanks!

I am attaching my final patch for whoever wants it.

Cheers. G.

Note: You also need to disable the UTs (GYP_DEFINES=include_tests=0)
minimal_build.patch

Guillaume Egles

unread,
Nov 13, 2015, 7:53:15 PM11/13/15
to discuss-webrtc
Guys,

With the code changes in webrtc the past couple of months, I am now unable to update my patch in order to keep this minimal build (datachannel only).

Has anybody been able to do this? I am still a bit confused as to which library does, what is needed and what is not (esp. libjingle_* vs. libwebrtc_*).

I am now looking into disabling things in the build config to try and reduce the audio/video footprint (disable protobuf/vp9, etc..).

Let me know if you have any insights into this...

Thanks. G.
Reply all
Reply to author
Forward
0 new messages