Giter Club home page Giter Club logo

libmediasoupclient's People

Contributors

adriancretu avatar ahmouse15 avatar conchfeng avatar copiltembel avatar fedulvtubudul avatar gaoyingie avatar geverding avatar ibc avatar im-sj avatar jmillan avatar marler8997 avatar maxweisel avatar pablito25sp avatar penguinol avatar ploverlake avatar spccman avatar whatisor avatar yangpeiyong avatar zyzniewski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libmediasoupclient's Issues

std::move() in constructors, safe?

{
Producer::Producer(
  Producer::Listener* listener,
  Producer::PublicListener* publicListener,
  std::string id,
  webrtc::MediaStreamTrackInterface* track,
  json rtpParameters,
  uint8_t maxSpatialLayer,
  json appData)
  : listener(listener), publicListener(publicListener), id(std::move(id)), track(track),
    rtpParameters(std::move(rtpParameters)), appData(std::move(appData))
{

id(std::move(id)) means that such a string will be "mem-moved" to here. Is this really safe? What would happen if the called want to print such a id (that it got somehow from the server) after producer is done?

Enable VP9 SVC and keep user given encoding.scalabilityMode

Like here. This is needed for letting the app set VP9 SVC available layers (at least for now).

However, the webrtc::RtpEncodingParameters struct does not have a scalabilityMode field so we have a problem. Perhaps we may have a derived class with it?

In the other side, in order to have VP9 SVC we should set the corresponding flag in webrtc. I assume it's something as follows (to be confirmed):

webrtc::field_trial::InitFieldTrialsFromString("WebRTC-SupportVP9SVC/EnabledByFlag_3SL3TL/");

H264 proper matching

Move README doc to website

The README has lot of information about installation and linkage considerations. In order to not have such a info divided into the README and the mediasoup website, I suggest moving that info the the "Installation" page in the website and add a link to it:

## Website and documentation

* [mediasoup.org][mediasoup-website]

Same as mediasoup-client does in its README.

Fatal error: api/media_stream_interface.h: No such file or directory

Hi. I have download and compiled webrtc sources for Android OS. But when I am trying to compile mediasoup with links to WebRTC - I am getting this error:
/MediaSoupClient/libmediasoupclient/include/Consumer.hpp:6:69: fatal error: api/media_stream_interface.h: No such file or directory

This is my links to WebRTC sources
cmake . -Bbuild
-DLIBWEBRTC_INCLUDE_PATH:PATH=$/media/0872773872772A183/Android_Dev/projects/WebRTCSources/WEBRTC/src/
-DLIBWEBRTC_BINARY_PATH:PATH=$/media/0872773872772A183/Android_Dev/projects/WebRTCSources/WEBRTC/src/build

On this screen you can see the contents of WebRTC sources
http://joxi.ru/LmGvVM6UwJE4Zr

I am using 73 branch and doble-checked that api folder contains media_stream_interface.h

Could you please help me and tell what I am doing wrong? may something wrong with the paths?

linker warnings due to different symbol visilibity configurations in libwebrtc and the rest of the code

It looks like the symbol visibility compilation flags must be the same among all the code being linked. Otherwise this kind of linker warnings are thrown:

ld: warning: direct access in function 'nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const& nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>::operator[]<char const>(char const*) const' from file 'CMakeFiles/test_mediasoupclient.dir/Device.test.cpp.o' to global weak symbol 'typeinfo for nlohmann::detail::type_error' from file '../libsdptransform/libsdptransform.a(parser.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.

These warnings are silenced if every linked piece is set the same visibiliy as libwebrtc does: -fvisibility=hidden, which means libmediasoupclient, libsdptransform, and the projects using libmediasoupclient...

Current state is trying to guess how to tell libwebrtc not to set -fvisibility=hidden since we cannot mandate libmediasoupclient users to set such option in their project. That should be up to the project using it, but not mandated.

I've tested the libwebrtc ng option: rtc_enable_symbol_export = true so far but I see that the sources are compiled with the hidden visibility set.

Return json as reference

In Device.hpp:

- inline json Device::GetRtpCapabilities() const
+ inline json& Device::GetRtpCapabilities() const

this->recvRtpCapabilities already exists within the Device memory so it's safe to return it as reference.

This may happen in other places.

How to build libmediasoupclient for Windows?

Hi,

I am trying to build libmediasoupclient for Windows on a Windows 10 machine. I have successfully built webrtc.lib in the m73 branch, but when I built libmediasoupclient I got a lot errors.

José mentioned in the other issue that libmediasoupclient has been tested on Windows. Is there any documentation about how to do it?

Thanks a lot!

If gcc, require >= 4.9

gcc 4.8 regex support is completely broken and incomplete so >= 4.9 is required, otherwise it will crash in runtime due the ScalabiliyModeRegex regex.

Here a way to detect gcc < 4.9 (just if gcc, it should not affect clang AFAIK) that we may want to include in libmediasoupclient and mediasoup:

# Check compiler
AX_COMPILER_VENDOR
AX_COMPILER_VERSION

# GCC 4.9 is the first compiler that implements <regex>: 4.8 shipped a broken
# implementation, so we have to explicitly check for a version >= 4.9
AS_VAR_IF([ax_cv_cxx_compiler_vendor], [gnu], [dnl
  AX_COMPARE_VERSION([${ax_cv_cxx_compiler_version}], [lt], [4.9], [AC_MSG_ERROR([GCC v. 4.9 is required])])
])

(however that such a code is in the configure.ac file...).

More:

Multi arguments vs Object

In the JS version we use Object as argument in most of the public API. This is to allow easy extensibility and to not force the user to set useless parameters (such as maxSpatialLayer when in an audio Producer).

The C++ uses multi arguments:

Producer* SendTransport::Produce(
  Producer::PublicListener* producerPublicListener,
  webrtc::MediaStreamTrackInterface* track,
  json simulcast,
  uint8_t maxSpatialLayer,
  json appData);

NOTE: It should be json& simulcast and json& appData BTW.

So if I want to send a simple audio track I must do this:

json simulcast{ nullptr };
json appData{ json::object() };

// I just wanted to send a simple audio track, but...
transport->Produce(this, track, simulcast, 0, appData);

Tomorrow we may add a new foo param into Produce and the API would break.

Would it make sense to have a public options struct?:

struct ProducerOptions
{
  webrtc::MediaStreamTrackInterface* track{ nullptr },
  json simulcast{ json::value_t::null },
  uint8_t maxSpatialLayer{ 0 },
  json appData{ json::value_t::object }
};

Producer* SendTransport::Produce(
  Producer::PublicListener* producerPublicListener,
  ProducerOptions& options);

Add L1T3 for H264 (libwebrtc >= M74)

Chrome 74.0.3729.157 (desktop current stable) uses temporal layers in H264 and signals them via framemarking RTP extension. So, if the current libwebrtc version in libmediasoupclient also does it, it must announce "scalabilityMode: "L1T3" in H264, as in mediasoup-client.

NOTE: In mediasoup-client Chrome75 handler has been renamed to Chrome74 since it does everything that we expect from Chrome 75.

Use auto* with pointers

To be more descriptive:

- auto transport = new SendTransport(
+ auto* transport = new SendTransport(

ortc.getReceivingFullRtpParameters() is just for Plan-B

It just makes sense for Plan-B in which all the receiving tracks must share the very same RTP parameters. However, in Unified-Plan each remote Producer RTP parameters are kept.

I mean: getReceivingFullRtpParameters() could just be removed.

Avoid JSON value copy in return

The signature of json PeerConnection::GetNativeRtpCapabilities() could be:

void PeerConnection::GetNativeRtpCapabilities(json& jsonObject)

So internally it fills jsonObject["codecs"], etc.

Also, in:

json Handler::GetNativeRtpCapabilities()
{
	std::unique_ptr<PeerConnection> pc(new PeerConnection(nullptr, {}));

	return pc->GetNativeRtpCapabilities();
}

the very same:

void Handler::GetNativeRtpCapabilities(json& jsonObject)
{
	std::unique_ptr<PeerConnection> pc(new PeerConnection(nullptr, {}));

	pc->GetNativeRtpCapabilities(jsonObject);
}

Add parseScalabilityMode() API

The rtpParameters.encodings of the Consumer may have a scalabilityMode string. This new API lets the app parse it.

Some as here.

C++ side of this thing here in mediasoup.

Use bigger buffers in reception

There is a experiment/flag/trial in WebRTC to use bigger buffers in reception. This would be useful for the broadcasting scenario, so if we find where to set it, it should be an option (not hardcoded).

However, more buffering means more possible delay.

Is it possible to compile mediasoup v3 for usage in Android project?

Hi. I am trying to compile and use mediasoup client library and then use it im my Android project
I am wondering if it is possible at all?
According to the documentation - to compile mediasoup - at first we need to compile webrtc and provide paths to webrtc sources and binaries to the CMake script of mediasoup
But the documentation talks us to compile webrtc as a static library (for desktop platforms) - but this static library cannot be used in android, because android is working with shared libraries and the compilation process for android is a bit different that standard webrtc compilation. I have compiled webrtc and got and webrtc.aar library as a result. Then I have provided paths to this .aar file and to webrtc sources into the mediasoup build script and have got a static mediasoup .a library.
But when I have imported them into my android project and tried to get an access to mediasoup classes from my android C++ code - I have got lots of exceptions about missing references between mediasoup, libsdptransform and webrtc. I think this happens because of wrong compilation params or something like this. Maybe because webrtc was compiled for android like an .aar file and not .a library
Could you please tell me is it really possible to compile and use mediasoup v3 client library with webrtc in android project?
And if it is possible - could you please describe me basic steps of how they all can be compiled and placed together?

Exposed public API (namespace required)

I assume that mediasoupclient.hpp is the public header file that users should include into their apps. It looks as follows:

#ifndef MEDIASOUP_CLIENT_HPP
#define MEDIASOUP_CLIENT_HPP

#include "Consumer.hpp"
#include "Device.hpp"
#include "Producer.hpp"
#include "Transport.hpp"

using SendTransportListener = SendTransport::Listener;
using TransportListener     = Transport::Listener;
using ConsumerListener      = Consumer::PublicListener;
using ProducerListener      = Producer::PublicListener;

#endif

AFAIS it's exporting the following symbols:

  • SendTransportListener
  • TransportListener
  • ConsumerListener
  • ProducerListener

Those public symbols should be within the mediasoupclient namespace.

Naming stuff

Just "divagating":

  • If this is a C or C++ library, it's name may/should be libmediasoupclient.
  • ./build/test/test_mediasoup-client (my eyes!).

Create react-native-mediasoupclient

Instead of using the super outdated react-native-webrtc (which poorly implements a WebRTC API of 2013) we should create react-native-mediasoupclient (based on libmediasoupclient, of course).

Let's this issue stay here until we initiate the new project.

Refactor API parameters

  • Commit in mediasoup-client v3.

Refactor: replace ugly transportRemoteParameters, consumerRemoteParameters, transportLocalParameters, producerLocalParameters, etc. with destructuring Objects with proper and well known keys.

Note that there is also this naming change:

- async restartIce({ remoteIceParameters } = {})
+ async restartIce({ iceParameters } = {})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.