Coder Social home page Coder Social logo

webrtc-sdk / libwebrtc Goto Github PK

View Code? Open in Web Editor NEW
333.0 17.0 74.0 1.5 MB

A C++ wrapper for binary release, mainly used for flutter-webrtc desktop (windows, linux, embedded).

License: MIT License

CMake 0.18% C++ 74.55% Shell 0.07% C 24.21% Python 0.99%
webrtc dll so

libwebrtc's Introduction

libwebrtc-{windows,linux}-{amd64,x86,armv7,arm64}.{dll,so}

WebRTC C++ wrapper A C++ binary wrapper for webrtc, mainly used for flutter-webrtc desktop (windows, linux, embedded) version release.

possible supported platforms

  • Windows (x86,x64)
  • Linux (x86,x64)
  • Embedded Linux (armv7, arm64)

Note

Use the https://github.com/webrtc-sdk/webrtc.git branch m114_release to compile.

Usage

Create checkout dir

mkdir libwebrtc_build
cd libwebrtc_build

Create .gclient

solutions = [
  {
    "name"        : 'src',
    "url"         : 'https://github.com/webrtc-sdk/webrtc.git@m114_release',
    "deps_file"   : 'DEPS',
    "managed"     : False,
    "custom_deps" : {
    },
    "custom_vars": {},
  },
]
target_os  = ['win']

Synchronize source code

gclient sync

Compile steps for libwebrtc

Confirm that it is currently in the src.

git clone https://github.com/webrtc-sdk/libwebrtc

Modify webrtc's src/BUILD.gn file and add libwebrtc to group("default").

diff --git a/BUILD.gn b/BUILD.gn
index e60d7dd0bd..b9b6acab8b 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -29,7 +29,7 @@ if (!build_with_chromium) {
   # 'ninja default' and then 'ninja all', the second build should do no work.
   group("default") {
     testonly = true
-    deps = [ ":webrtc" ]
+    deps = [ ":webrtc","//libwebrtc", ]
     if (rtc_build_examples) {
       deps += [ "examples" ]
     }

for Windows

Download and install the Visual Studio Community 2022

GN

set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2022
set GYP_GENERATORS=ninja,msvs-ninja
set GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2022\Community
cd src
gn gen out-debug/Windows-x64 --args="target_os=\"win\" target_cpu=\"x64\" is_component_build=false is_clang=true is_debug=true rtc_use_h264=true ffmpeg_branding=\"Chrome\" rtc_include_tests=false rtc_build_examples=false libwebrtc_desktop_capture=true" --ide=vs2022

Compile for windows

ninja -C out-debug/Windows-x64 libwebrtc

for Linux

export ARCH=x64 # x86, x64, arm, arm64
gn gen out/Linux-$ARCH --args="target_os=\"linux\" target_cpu=\"$ARCH\" is_debug=false rtc_include_tests=false rtc_use_h264=true ffmpeg_branding=\"Chrome\" is_component_build=false use_rtti=true use_custom_libcxx=false rtc_enable_protobuf=false"

Compile for Linux

ninja -C out-debug/Windows-x64 libwebrtc

libwebrtc's People

Contributors

ashellunts avatar cloudwebrtc avatar dkubrakov avatar fourleaftec avatar k-wasniowski avatar markdicks avatar netsy avatar nikohpng avatar pwinter1991 avatar wanchao-xu avatar wskfjtheqian avatar xiaowei-guan avatar zjzhang-cn 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

libwebrtc's Issues

Audio MediaRecord support

audio media record can't support in mac/ios and win. I think this is good feature.

Now I think we need increase the priority of this feature and I am willing to help implement this feature.

Below, I will explain my implementation ideas. If there are no problems, I will start working.

then RTCPeerConnectionFactoryImpl implements the AudioDeviceDataObserver interface to get all audio data, and then transfers it to flutter_webrtc, flutter_webrtc determines the format and method of storage. Of course, this method can be used in both Mac/iOS, and I have implemented the corresponding solution. like this

flutter_webrtc                                                            libwebrtc/ios/mac
FlutterWebRTCBase: AudioDeviceDataObserverSink                            RTCPeerConnectionFactoryImpl: public AudioDeviceDataObserver
                                                                          ADMWrapper(RTCPeerConnectionFactoryImpl)

registerObserver(base)                                                         
                                                                          audio_data =>AudioDeviceDataObserverSink

then we use MediaRecord to recieve FlutterWebRTCBase base audio data. You can do anything In MediaRecord

[build libwebrtc for Linux] libwebrtc/src/rtc_peerconnection_factory_impl.cc:75:112: error: too many arguments to function call, expected single argument 'audio_layer', have 2 arguments

source webrtc from (HEAD detached at branch-heads/m74)

I have error for build on Linux Ubuntu 20.04

user@ubuntu:~/work/webrtc-checkout/src$ ninja -C out/Default libwebrtc
ninja: Entering directory `out/Default'
[2439/2648] CXX obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.o
FAILED: obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.o 
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.o.d -DUSE_LIBYUV -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"354873-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DCR_LIBCXX_REVISION=354212 -DCR_LIBCXXABI_REVISION=354284 -D_LIBCPP_ENABLE_NODISCARD -DCR_SYSROOT_HASH=e7c53f04bd88d29d075bfd1f62b073aeb69cbe09 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DRTC_ENABLE_VP9 -DHAVE_SCTP -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DHAVE_WEBRTC_VIDEO -I../../libwebrtc -I../../libwebrtc/include -I../.. -Igen -I../../third_party/abseil-cpp -I../../libwebrtc/include -I../../third_party/libyuv/include -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -fcomplete-member-pointers -m64 -march=x86-64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wc++11-narrowing -Wimplicit-fallthrough -Wthread-safety -Winconsistent-missing-override -Wundef -Wunused-lambda-capture -Wno-shorten-64-to-32 -std=c++11 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_sid_amd64-sysroot -fvisibility-inlines-hidden -Wnon-virtual-dtor -Woverloaded-virtual -c ../../libwebrtc/src/rtc_peerconnection_factory_impl.cc -o obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.o
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc:75:112: error: too many arguments to function call, expected single argument 'audio_layer', have 2 arguments
    audio_device_module_ = webrtc::AudioDeviceModule::Create(webrtc::AudioDeviceModule::kPlatformDefaultAudio, nullptr);
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                   ^~~~~~~
../../modules/audio_device/include/audio_device.h:45:3: note: 'Create' declared here
  static rtc::scoped_refptr<AudioDeviceModule> Create(
  ^
1 error generated.
[2444/2648] CXX obj/libwebrtc/libwebrtc/rtc_media_stream_impl.o
ninja: build stopped: subcommand failed.

Please provide me how to build libwebrtc for Linux.

Build error on ubuntu 16.04

Maybe just some typo

../../libwebrtc/include/base/inlined_vector.h:195:71: error: use of undeclared identifier 'min'; did you mean 'fmin'?
        inlined_vector(size_type count, const T& value = T()):data_internal_(min(count, max_size()), value){
                                                                             ^~~
                                                                             fmin
../../buildtools/third_party/libc++/trunk/include/math.h:1292:1: note: 'fmin' declared here
fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
^
../../libwebrtc/src/libwebrtc.cc:38:15: error: no matching constructor for initialization of 'rtc::Thread'
          new rtc::Thread()

question: hard compile

The dependencies required for compilation cannot be accessed directly in China, which brings great obstacles to compilation. Can all the dependencies be placed in the repo, and the compilation project only needs Cmake?

How to listen for window closing

Description

I want to get closing event of other process when I share my application screen. So, I can do someting.

Present Situation

I have listened process to get closing event, such like this

auto existing_thread = std::thread([this, source, desktop_capturer]() {
    unsigned long long source_pid =
        std::strtoull(source->id().std_string().c_str(), 0, 10);
    DWORD pid;
    GetWindowThreadProcessId((HWND)source_pid, &pid);
    HANDLE source_hdl =
        ::OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | SYNCHRONIZE, FALSE, (DWORD)pid);
    if (source_hdl == NULL) {
      std::cout << "Can't open process: " << source->id().std_string() 
                << ", cause is: " << GetLastError() << std::endl;
      return;
    }
    auto status = ::WaitForSingleObject((HANDLE)source_hdl, INFINITE);
    switch (status) {
      case WAIT_OBJECT_0: 
      case WAIT_TIMEOUT:  
        std::cout << "hello: close" << std::endl;
        OnStop(desktop_capturer);
        break;
      case WAIT_ABANDONED:
        std::cout << "abandoned" << std::endl;
      default:
        std::cout
            << "hello: set_client_confirm_event: WaitForSingleObject failed: "
            << GetLastError() << std::endl;
        break;
    }
    
     CloseHandle(source_hdl);
  });
  existing_thread.detach();

But, this code can't get closing event from chrome or wechat, unless we kill chrome in taskbar instead of closing the window.

Question

I think that this feature is necessary.

  • Question one: Can we friendly listen to closing event of other process in windows ?
  • Question two: How can we do, if we can't listen to closing event of other process ?

Thanks!

call SetPlayoutDevice not work

I want to change output audio device in voice call, then call RTCAudioDevice::SetPlayoutDevice, but is not switch to the device.

Seems like code is either broken or need some information for compilation error. Can't find class "webrtc::AudioDeviceSink" anywhere.

Hi,

Some recent changes were made in the file "src\rtc_audio_device_impl.h" due to which I cannot compile the latest code.

"class AudioDeviceImpl : public RTCAudioDevice, public webrtc::AudioDeviceSink"

I cannot find any header file with the class "AudioDeviceSink" declaration. Can you please point me in the correct direction?
I also searched in webrtc source from the m104 branch.

Thanks in advance.

Please clarify which branch or start tagging build versions

It's unclear what is the best, most stable potential starting point for compiling the library. For example:

  1. The master branch readme says to use the m104_release branch.
  2. The m104_release branch readme says to use the m97_release branch.
  3. The m97_release branch readme says to use the M92 branch from a different repository.
  4. And so forth...

It's very unclear exactly what branching and versioning strategy is being used here given that each branch recommends building a different branch.

[Windows] Crash while using Intel-Media SDK to decode video stream.

Thanks for your great work!

I am using libwebrtc.dll into a WPF C# project, works great when rendering my internal camera from my PC,
but when I try to render my remote video I got "Access Violation" exception in file rtc_video_frame_impl.cc.

Notice: everything back to normal(no crash) after I comment out USE_INTEL_MEDIA_SDK in file rtc_peerconnection_factory_impl.cc.

Here is what I found, while using Intel-Media SDK to decode video steam, it produces owt::base::NativeHandleBuffer(which is webrtc::VideoFrameBuffer::Type::kNative) rather than webrtc::VideoFrameBuffer::Type::kI420, so if call buffer_->GetI420() it will return nullptr which led to crash.

Compilation with Conan on Ubuntu 20.04

Hello everyone, I'm currently trying to build the library using the provided conanfile.py and I am encountering several compilation errors.

I first wanted to build the project on Ubuntu 22.04 but it raises an error on the supported distros when running the install-sysroot.py --arch=i386

ERROR: The only supported distros are
 	Ubuntu 14.04 LTS (trusty with EoL April 2022)
 	Ubuntu 16.04 LTS (xenial with EoL April 2024)
 	Ubuntu 18.04 LTS (bionic with EoL April 2028)
 	Ubuntu 20.04 LTS (focal with Eol April 2030)
 	Ubuntu 20.10 (groovy)
 	Debian 10 (buster) or later

I defaulted back to ubuntu 20.04 with a clean environment, I execute conan create . on the release branch m114_release as per the readme instructions I encounter the following errors:

ninja: Entering directory `out'
[153/5245] CXX obj/api/rtp_sender_interface/rtp_sender_interface.o
FAILED: obj/api/rtp_sender_interface/rtp_sender_interface.o 
../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/api/rtp_sender_interface/rtp_sender_interface.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"llvmorg-17-init-8029-g27f27d15-3\" -DCR_SYSROOT_KEY=20230329T085712Z-1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_STRICT_FIELD_TRIALS=0 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DRTC_ENABLE_VP9 -DRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY -DWEBRTC_HAVE_SCTP -DWEBRTC_USE_H264 -DWEBRTC_LIBRARY_IMPL -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DLIBYUV_DISABLE_NEON -I.. -Igen -I../third_party/abseil-cpp -I../third_party/libyuv/include -Wall -Werror -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wshadow -fno-delete-null-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -ffp-contract=off -m64 -msse3 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wglobal-constructors -Wno-shadow -Wctad-maybe-unsupported -Wc++11-narrowing -Wundef -Wunused-lambda-capture -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti --sysroot=../build/linux/debian_bullseye_amd64-sysroot -fvisibility-inlines-hidden -Wnon-virtual-dtor -Woverloaded-virtual -c ../api/rtp_sender_interface.cc -o obj/api/rtp_sender_interface/rtp_sender_interface.o
In file included from ../api/rtp_sender_interface.cc:11:
In file included from ../api/rtp_sender_interface.h:25:
In file included from ../api/frame_transformer_interface.h:18:
In file included from ../api/video/encoded_frame.h:19:
In file included from ../modules/video_coding/encoded_frame.h:18:
../modules/video_coding/include/video_codec_interface.h:54:20: error: 'is_pod<webrtc::CodecSpecificInfoVP8>' is deprecated: use is_standard_layout && is_trivial instead [-Werror,-Wdeprecated-declarations]
static_assert(std::is_pod<CodecSpecificInfoVP8>::value, "");

(logs shortened as they are several pages of the same error)

My machine's profile for added info:

[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=9
os=Linux
os_build=Linux

Specifying a C++17 compiler with Conan yields the same result via conan create . -s compiler.cppstd=gnu17 :

[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=9
os=Linux
os_build=Linux

After some digging, it seems C++20 has deprecated std::is_pod in favour of std::is_standard_layout and std::is_trivial. Is there any configuration I might be missing perhaps in the .gclient file ?

Thanks in advance !

segfault trying to establish audio connection

running alpine linux, x86_64

versions:
libwebrtc: revision d9ea233ddcfa8ac246b7031bc30d7ba0f3018902
webrtc: revision b0f3927ad1472a3411fed7f5b8cd972907b63feb

my build process: https://gitlab.alpinelinux.org/selfisekai/aports/-/blob/b3bb963ebd296d59fe5405f5df2b2f6d50b98c50/testing/fluffychat/APKBUILD

gdb backtrace:

Thread 1 "fluffychat" received signal SIGSEGV, Segmentation fault.
0x00007ffff4bb55d3 in libwebrtc::scoped_refptr<libwebrtc::RTCVideoCapturer>::scoped_refptr(libwebrtc::scoped_refptr<libwebrtc::RTCVideoCapturer> const&) () at ../libwebrtc/include/base/scoped_ref_ptr.h:82
82	../libwebrtc/include/base/scoped_ref_ptr.h: No such file or directory.
(gdb) bt
#0  0x00007ffff4bb55d3 in libwebrtc::scoped_refptr<libwebrtc::RTCVideoCapturer>::scoped_refptr(libwebrtc::scoped_refptr<libwebrtc::RTCVideoCapturer> const&) () at ../libwebrtc/include/base/scoped_ref_ptr.h:82
#1  0x00007ffff4bb2e5e in libwebrtc::RTCPeerConnectionFactoryImpl::CreateVideoSource(libwebrtc::scoped_refptr<libwebrtc::RTCVideoCapturer>, portable::string, libwebrtc::scoped_refptr<libwebrtc::RTCMediaConstraints>) ()
    at ../libwebrtc/src/rtc_peerconnection_factory_impl.cc:184
#2  0x00007ffff7e96c5e in flutter_webrtc_plugin::FlutterMediaStream::GetUserAudio(std::map<flutter::EncodableValue, flutter::EncodableValue, std::less<flutter::EncodableValue>, std::allocator<std::pair<flutter::EncodableValue const, flutter::EncodableValue> > > const&, libwebrtc::scoped_refptr<libwebrtc::RTCMediaStream>, std::map<flutter::EncodableValue, flutter::EncodableValue, std::less<flutter::EncodableValue>, std::allocator<std::pair<flutter::EncodableValue const, flutter::EncodableValue> > >&) ()
    at /home/lauren/aports/testing/fluffychat/src/fluffychat-1.13.0/build/linux/x64/release/bundle/lib/libflutter_webrtc_plugin.so
#3  0x00007ffff7e94e7b in flutter_webrtc_plugin::FlutterMediaStream::GetUserMedia(std::map<flutter::EncodableValue, flutter::EncodableValue, std::less<flutter::EncodableValue>, std::allocator<std::pair<flutter::EncodableValue const, flutter::EncodableValue> > > const&, std::unique_ptr<MethodResultProxy, std::default_delete<MethodResultProxy> >) ()
    at /home/lauren/aports/testing/fluffychat/src/fluffychat-1.13.0/build/linux/x64/release/bundle/lib/libflutter_webrtc_plugin.so
#4  0x00007ffff7ef1e15 in flutter_webrtc_plugin::FlutterWebRTC::HandleMethodCall(MethodCallProxy const&, std::unique_ptr<MethodResultProxy, std::default_delete<MethodResultProxy> >) ()
    at /home/lauren/aports/testing/fluffychat/src/fluffychat-1.13.0/build/linux/x64/release/bundle/lib/libflutter_webrtc_plugin.so
#5  0x00007ffff7f0d6db in flutter_webrtc_plugin::FlutterWebRTCPluginImpl::HandleMethodCall(flutter::MethodCall<flutter::EncodableValue> const&, std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>, std::default_delete<flutter::MethodResult<flutter::EncodableValue> > >) ()
    at /home/lauren/aports/testing/fluffychat/src/fluffychat-1.13.0/build/linux/x64/release/bundle/lib/libflutter_webrtc_plugin.so
#6  0x00007ffff7f0d5fc in std::_Function_handler<void (flutter::MethodCall<flutter::EncodableValue> const&, std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>, std::default_delete<flutter::MethodResult<flutter::EncodableValue> > >), flutter_webrtc_plugin::FlutterWebRTCPluginImpl::RegisterWithRegistrar(flutter::PluginRegistrar*)::{lambda(auto:1 const&, auto:2)#1}>::_M_invoke(std::_Any_data const&, flutter::MethodCall<flutter::EncodableValue> const&, std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>, std::default_delete<flutter::MethodResult<flutter::EncodableValue> > >&&) ()
    at /home/lauren/aports/testing/fluffychat/src/fluffychat-1.13.0/build/linux/x64/release/bundle/lib/libflutter_webrtc_plugin.so
#7  0x00007ffff7f0cf47 in flutter::MethodChannel<flutter::EncodableValue>::SetMethodCallHandler(std::function<void (flutter::MethodCall<flutter::EncodableValue> const&, std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>, std::default_delete<flutter::MethodResult<flutter::EncodableValue> > >)>) const::{lambda(unsigned char const*, unsigned long, std::function<void (unsigned char con--Type <RET> for more, q to quit, c to continue without paging--
st*, unsigned long)>)#1}::operator()(unsigned char const*, unsigned long, std::function<void (unsigned char const*, unsigned long)>) const ()
    at /home/lauren/aports/testing/fluffychat/src/fluffychat-1.13.0/build/linux/x64/release/bundle/lib/libflutter_webrtc_plugin.so
#8  0x00007ffff7f0cdc9 in std::_Function_handler<void (unsigned char const*, unsigned long, std::function<void (unsigned char const*, unsigned long)>), flutter::MethodChannel<flutter::EncodableValue>::SetMethodCallHandler(std::function<void (flutter::MethodCall<flutter::EncodableValue> const&, std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>, std::default_delete<flutter::MethodResult<flutter::EncodableValue> > >)>) const::{lambda(unsigned char const*, unsigned long, std::function<void (unsigned char const*, unsigned long)>)#1}>::_M_invoke(std::_Any_data const&, unsigned char const*&&, unsigned long&&, std::function<void (unsigned char const*, unsigned long)>&&) ()
    at /home/lauren/aports/testing/fluffychat/src/fluffychat-1.13.0/build/linux/x64/release/bundle/lib/libflutter_webrtc_plugin.so
#9  0x00007ffff7f0dda9 in flutter::(anonymous namespace)::ForwardToHandler(_FlBinaryMessenger*, char const*, _GBytes*, _FlBinaryMessengerResponseHandle*, void*) ()
    at /home/lauren/aports/testing/fluffychat/src/fluffychat-1.13.0/build/linux/x64/release/bundle/lib/libflutter_webrtc_plugin.so
#10 0x00007ffff70eb7bf in  () at /usr/lib/libflutter_linux_gtk.so
#11 0x00007ffff70ed762 in  () at /usr/lib/libflutter_linux_gtk.so
#12 0x00007ffff7126ef7 in  () at /usr/lib/libflutter_linux_gtk.so
#13 0x00007ffff7131a7d in  () at /usr/lib/libflutter_linux_gtk.so
#14 0x00007ffff7131fc5 in  () at /usr/lib/libflutter_linux_gtk.so
#15 0x00007ffff712f1c8 in  () at /usr/lib/libflutter_linux_gtk.so
#16 0x00007ffff711fbab in  () at /usr/lib/libflutter_linux_gtk.so
#17 0x00007ffff7101b16 in  () at /usr/lib/libflutter_linux_gtk.so
#18 0x00007ffff7101c4a in  () at /usr/lib/libflutter_linux_gtk.so
#19 0x00007ffff65461ea in  () at /usr/lib/libglib-2.0.so.0
#20 0x00007ffff6545afa in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#21 0x00007ffff65a5b59 in  () at /usr/lib/libglib-2.0.so.0
#22 0x00007ffff65433ee in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#23 0x00007ffff6709d86 in g_application_run () at /usr/lib/libgio-2.0.so.0
#24 0x00005555555564ce in main ()

Libwebrtc sample files

Hi, I've been struggling with libwebrtc for a while trying to create a caller without any local media streams attached to it. Just to put in another words, I'm trying to call someone in my local network and receive just audio/video without sending anything to the callee. In order to speed up the peer connection implementation (as well as receiving/sending descriptors) I tried to find some sample code but I realized the existing sample file is empty. Is there another place where I can find it? Thanks!

JPEG parameter struct mismatch

Description

I build myself libwebrtc in window11. But in jpeg, It can't run!
like this:

JPEG parameter struct mismatch: library thinks size is 520, caller expects 504

How can i fix it?

Implementing Custom Capture in Libwebrtc?

I'm currently working on a project where I need to implement custom capture functionality using Libwebrtc.

As a beginner exploring the vast landscape of WebRTC, I've been trying to customize the VideoCapturer. While attempting to extend the RTCVideoCapturer class, I noticed there doesn't seem to be an 'OnFrame' method that allows me to pass my customized frame.

I'd like to confirm if this would be the appropriate and recommended way to achieve my objective. If not, could you kindly suggest an alternative approach?

Building LibWebRTC for windows leads to error

Hello all,

My build of LibWebRTC for windows is failing. I'm following the procedure as described in README.MD as follows:

set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2019
set GYP_GENERATORS=ninja,msvs-ninja
set GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community

md e:\google\libwebrtc_build
cd e:\google\libwebrtc_build
edit .gclient

solutions = [
{
"name" : 'src',
"url" : 'https://github.com/webrtc-sdk/webrtc.git@m104_release',
"deps_file" : 'DEPS',
"managed" : False,
"custom_deps" : {
},
"custom_vars": {},
},
]
target_os = ['win']

run in e:\google\libwebrtc_build>gclient sync >>>>>>>>>>>>>
Updating depot_tools...
Syncing projects: 100% (42/42), done.
Running hooks: 55% (15/27) clang_format_win
________ running 'python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=win32 --no_auth --bucket chromium-clang-format -s src/buildtools/win/clang-format.exe.sha1' in 'E:\google\libwebrtc_build'
0> Downloading src/buildtools/win/clang-format.exe@66882fadbf9e99cc00b8677d8c1e7e8b3cfdf4fe...
Downloading 1 files took 13.507035 second(s)
Hook 'python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --platform=win32 --no_auth --bucket chromium-clang-format -s src/buildtools/win/clang-format.exe.sha1' took 13.88 secs
Running hooks: 70% (19/27) rc_win
________ running 'python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang/rc -s src/build/toolchain/win/rc/win/rc.exe.sha1' in 'E:\google\libwebrtc_build'
0> Downloading src/build/toolchain/win/rc/win/rc.exe@7d3a485bb5bae0cf3c6b8af95d21f36aa7d02832...
Downloading 1 files took 6.302651 second(s)
Running hooks: 81% (22/27) test_fonts
________ running 'download_from_google_storage --no_resume --extract --no_auth --bucket chromium-fonts -s src/third_party/test_fonts/test_fonts.tar.gz.sha1' in 'E:\google\libwebrtc_build'
0> Downloading src/third_party/test_fonts/test_fonts.tar.gz@336e775eec536b2d785cc80eff6ac39051931286...
0> Extracting 33 entries from src/third_party/test_fonts/test_fonts.tar.gz to src/third_party/test_fonts/test_fonts
Downloading 1 files took 9.438952 second(s)
Hook 'download_from_google_storage --directory --recursive --num_threads=10 --no_auth --quiet --bucket chromium-webrtc-resources src/resources' took 214.28 secs
Running hooks: 100% (27/27), done.

e:\google\libwebrtc_build>cd E:\google\libwebrtc_build\src
e:\google\libwebrtc_build\src>git clone https://github.com/webrtc-sdk/libwebrtc
change BUILD.gn default to
{
....
deps = [ ":webrtc","//libwebrtc", ]
....
}

run E:\google\libwebrtc_build\src>gn gen out-debug/Windows-x64 --args="target_os="win" target_cpu="x64" is_component_build=false is_clang=true is_debug=true rtc_use_h264=true ffmpeg_branding="Chrome" rtc_include_tests=false rtc_build_examples=false libwebrtc_desktop_capture=true" --ide=vs2019 >>>>>>>>
Generating Visual Studio projects took 2732ms
Done. Made 1170 targets from 263 files in 23963ms

run E:\google\libwebrtc_build\src>ninja -C out-debug/Windows-x64 libwebrtc >>>>>>>>>>>>>>

ninja: Entering directory `out-debug/Windows-x64'
[3592/4058] CXX obj/libwebrtc/libwebrtc/vcm_capturer.obj
FAILED: obj/libwebrtc/libwebrtc/vcm_capturer.obj
....\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe /c ../../libwebrtc/src/internal/vcm_capturer.cc /Foobj/libwebrtc/libwebrtc/vcm_capturer.obj /nologo /showIncludes:user "-imsvcC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-imsvcC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" "-imsvcC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\ucrt" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\shared" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\um" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\winrt" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\cppwinrt" -DUSE_LIBYUV -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DLIB_WEBRTC_API_EXPORTS -DWEBRTC_WIN -DUSE_AURA=1 -D_HAS_NODISCARD -D_CRT_NONSTDC_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS "-DCR_CLANG_REVISION="llvmorg-15-init-11722-g3f3a235a-2"" -D_LIBCPP_ABI_NAMESPACE=Cr -D_LIBCPP_ABI_VERSION=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -D_LIBCPP_NO_AUTO_LINK -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2 -DWIN32 -D_SECURE_ATL -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=NTDDI_WIN10_FE -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DRTC_ENABLE_VP9 -DRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY -DWEBRTC_HAVE_SCTP -DWEBRTC_USE_H264 -DWEBRTC_ENABLE_AVX2 -DRTC_ENABLE_WIN_WGC -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DABSL_ALLOCATOR_NOTHROW=1 -DLIB_WEBRTC_API_DLL -DHAVE_WEBRTC_VIDEO -I../../libwebrtc -I../../libwebrtc/include -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/abseil-cpp -I../../third_party/libyuv/include -I../../third_party/boringssl/src/include -Wno-microsoft-extra-qualification -Wno-reorder /W4 -Wimplicit-fallthrough -Wunreachable-code-aggressive -Wthread-safety /WX -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-nonportable-include-path -Wno-null-pointer-subtraction -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-unqualified-std-cast-call -Xclang -no-opaque-pointers -Wmax-tokens -Wshadow -fno-delete-null-pointer-checks -fno-ident -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 /clang:-ffp-contract=off -fcomplete-member-pointers /Gy /FS /bigobj /utf-8 /Zc:twoPhase -ffile-reproducible /Zc:sizedDealloc- /D__WRL_ENABLE_FUNCTION_STATICS__ -fmsc-version=1916 -m64 -msse3 /Brepro -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern /O1 /Ob2 /Oy- /Zc:inline /Gw /Oi /Z7 -gcodeview-ghash -Xclang -fuse-ctor-homing /guard:cf /MT -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-shadow -Wc++11-narrowing -Wundef -Wunused-lambda-capture /std:c++17 -Wno-trigraphs /Zc:alignedNew- /TP /GR- -I../../buildtools/third_party/libc++/trunk/include /Fd"obj/libwebrtc/libwebrtc_cc.pdb"
../../libwebrtc/src/internal/vcm_capturer.cc(42,26): error: no member named 'BlockingCall' in 'rtc::Thread'
vcm_ = worker_thread_->BlockingCall(
~~~~~~~~~~~~~~ ^
../../libwebrtc/src/internal/vcm_capturer.cc(78,36): error: no member named 'BlockingCall' in 'rtc::Thread'
int32_t result = worker_thread_->BlockingCall(
~~~~~~~~~~~~~~ ^
../../libwebrtc/src/internal/vcm_capturer.cc(91,26): error: no member named 'BlockingCall' in 'rtc::Thread'
worker_thread_->BlockingCall([&] {
~~~~~~~~~~~~~~ ^
../../libwebrtc/src/internal/vcm_capturer.cc(97,19): error: no member named 'BlockingCall' in 'rtc::Thread'
worker_thread_->BlockingCall([&] {

4 errors generated.
[3600/4058] CXX obj/libwebrtc/libwebrtc/rtc_frame_cryptor_impl.obj
FAILED: obj/libwebrtc/libwebrtc/rtc_frame_cryptor_impl.obj
..\..\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe /c ../../libwebrtc/src/rtc_frame_cryptor_impl.cc /Foobj/libwebrtc/libwebrtc/rtc_frame_cryptor_impl.obj /nologo /showIncludes:user "-imsvcC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-imsvcC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" "-imsvcC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\ucrt" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\shared" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\um" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\winrt" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\cppwinrt" -DUSE_LIBYUV -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DLIB_WEBRTC_API_EXPORTS -DWEBRTC_WIN -DUSE_AURA=1 -D_HAS_NODISCARD -D_CRT_NONSTDC_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS "-DCR_CLANG_REVISION=\"llvmorg-15-init-11722-g3f3a235a-2\"" -D_LIBCPP_ABI_NAMESPACE=Cr -D_LIBCPP_ABI_VERSION=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -D_LIBCPP_NO_AUTO_LINK -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2 -DWIN32 -D_SECURE_ATL -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=NTDDI_WIN10_FE -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DRTC_ENABLE_VP9 -DRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY -DWEBRTC_HAVE_SCTP -DWEBRTC_USE_H264 -DWEBRTC_ENABLE_AVX2 -DRTC_ENABLE_WIN_WGC -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DABSL_ALLOCATOR_NOTHROW=1 -DLIB_WEBRTC_API_DLL -DHAVE_WEBRTC_VIDEO -I../../libwebrtc -I../../libwebrtc/include -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/abseil-cpp -I../../third_party/libyuv/include -I../../third_party/boringssl/src/include -Wno-microsoft-extra-qualification -Wno-reorder /W4 -Wimplicit-fallthrough -Wunreachable-code-aggressive -Wthread-safety /WX -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-nonportable-include-path -Wno-null-pointer-subtraction -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-unqualified-std-cast-call -Xclang -no-opaque-pointers -Wmax-tokens -Wshadow -fno-delete-null-pointer-checks -fno-ident -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 /clang:-ffp-contract=off -fcomplete-member-pointers /Gy /FS /bigobj /utf-8 /Zc:twoPhase -ffile-reproducible /Zc:sizedDealloc- /D__WRL_ENABLE_FUNCTION_STATICS__ -fmsc-version=1916 -m64 -msse3 /Brepro -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern /O1 /Ob2 /Oy- /Zc:inline /Gw /Oi /Z7 -gcodeview-ghash -Xclang -fuse-ctor-homing /guard:cf /MT -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-shadow -Wc++11-narrowing -Wundef -Wunused-lambda-capture /std:c++17 -Wno-trigraphs /Zc:alignedNew- /TP /GR- -I../../buildtools/third_party/libc++/trunk/include /Fd"obj/libwebrtc/libwebrtc_cc.pdb"
In file included from ../../libwebrtc/src/rtc_frame_cryptor_impl.cc:1:
../../libwebrtc/src/rtc_frame_cryptor_impl.h(22,17): error: no member named 'failure_tolerance' in 'webrtc::KeyProviderOptions'
  rtc_options.failure_tolerance = options->failure_tolerance;
  ~~~~~~~~~~~ ^
../../libwebrtc/src/rtc_frame_cryptor_impl.h(29,19): error: no member named 'SetSharedKey' in 'webrtc::DefaultKeyProviderImpl'
  return impl_->SetSharedKey(index, key.std_vector());
         ~~~~~~~^
../../libwebrtc/src/rtc_frame_cryptor_impl.h(33,19): error: no member named 'RatchetSharedKey' in 'webrtc::DefaultKeyProviderImpl'
  return impl_->RatchetSharedKey(key_index);
         ~~~~~~~^
../../libwebrtc/src/rtc_frame_cryptor_impl.h(37,19): error: no member named 'ExportSharedKey' in 'webrtc::DefaultKeyProviderImpl'
  return impl_->ExportSharedKey(key_index);
         ~~~~~~~^
../../libwebrtc/src/rtc_frame_cryptor_impl.h(58,12): error: no member named 'SetSifTrailer' in 'webrtc::DefaultKeyProviderImpl'
  impl_->SetSifTrailer(trailer.std_vector());
  ~~~~~~~^
../../libwebrtc/src/rtc_frame_cryptor_impl.cc(59,11): error: no matching constructor for initialization of 'webrtc::FrameCryptorTransformer'
    new webrtc::FrameCryptorTransformer(factoryImpl->signaling_thread(),
        ^                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../..\api/crypto/frame_crypto_transformer.h(247,12): note: candidate constructor not viable: requires 4 arguments, but 5 were provided
explicit FrameCryptorTransformer(const std::string participant_id,
         ^
../..\api/crypto/frame_crypto_transformer.h(234,18): note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 5 were provided
class RTC_EXPORT FrameCryptorTransformer
               ^
../../libwebrtc/src/rtc_frame_cryptor_impl.cc(63,22): error: no member named 'RegisterFrameCryptorTransformerObserver' in 'webrtc::FrameCryptorTransformer'
e2ee_transformer_->RegisterFrameCryptorTransformerObserver(observer_);
~~~~~~~~~~~~~~~~~~~^
../../libwebrtc/src/rtc_frame_cryptor_impl.cc(89,11): error: no matching constructor for initialization of 'webrtc::FrameCryptorTransformer'
    new webrtc::FrameCryptorTransformer(factoryImpl->signaling_thread(),
        ^                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../..\api/crypto/frame_crypto_transformer.h(247,12): note: candidate constructor not viable: requires 4 arguments, but 5 were provided
explicit FrameCryptorTransformer(const std::string participant_id,
         ^
../..\api/crypto/frame_crypto_transformer.h(234,18): note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 5 were provided
class RTC_EXPORT FrameCryptorTransformer
               ^
../../libwebrtc/src/rtc_frame_cryptor_impl.cc(93,22): error: no member named 'RegisterFrameCryptorTransformerObserver' in 'webrtc::FrameCryptorTransformer'
e2ee_transformer_->RegisterFrameCryptorTransformerObserver(observer_);
~~~~~~~~~~~~~~~~~~~^
../../libwebrtc/src/rtc_frame_cryptor_impl.cc(116,22): error: no member named 'UnRegisterFrameCryptorTransformerObserver' in 'webrtc::FrameCryptorTransformer'
e2ee_transformer_->UnRegisterFrameCryptorTransformerObserver();
~~~~~~~~~~~~~~~~~~~^
In file included from ../../libwebrtc/src/rtc_frame_cryptor_impl.cc:1:
In file included from ../../libwebrtc/src/rtc_frame_cryptor_impl.h:5:
In file included from ../../libwebrtc/src/rtc_rtp_receiver_impl.h:4:
In file included from ../..\api/rtp_receiver_interface.h:20:
In file included from ../..\api/crypto/frame_decryptor_interface.h:16:
In file included from ../..\api/array_view.h:19:
In file included from ../..\rtc_base/checks.h:59:
../..\api/scoped_refptr.h(103,13): error: no member named 'Release' in 'libwebrtc::RTCFrameCryptorObserverAdapter'
    ptr_->Release();
    ~~~~  ^
../../libwebrtc/src/rtc_frame_cryptor_impl.cc(39,22): note: in instantiation of member function 'rtc::scoped_refptr<libwebrtc::RTCFrameCryptorObserverAdapter>::~scoped_refptr' requested here
RTCFrameCryptorImpl::RTCFrameCryptorImpl(
                   ^
11 errors generated.
[3602/4058] CXX obj/libwebrtc/libwebrtc/rtc_peerconnection_impl.obj
FAILED: obj/libwebrtc/libwebrtc/rtc_peerconnection_impl.obj
..\..\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe /c ../../libwebrtc/src/rtc_peerconnection_impl.cc /Foobj/libwebrtc/libwebrtc/rtc_peerconnection_impl.obj /nologo /showIncludes:user "-imsvcC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-imsvcC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" "-imsvcC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\ucrt" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\shared" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\um" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\winrt" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\cppwinrt" -DUSE_LIBYUV -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DLIB_WEBRTC_API_EXPORTS -DWEBRTC_WIN -DUSE_AURA=1 -D_HAS_NODISCARD -D_CRT_NONSTDC_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS "-DCR_CLANG_REVISION=\"llvmorg-15-init-11722-g3f3a235a-2\"" -D_LIBCPP_ABI_NAMESPACE=Cr -D_LIBCPP_ABI_VERSION=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -D_LIBCPP_NO_AUTO_LINK -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2 -DWIN32 -D_SECURE_ATL -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=NTDDI_WIN10_FE -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DRTC_ENABLE_VP9 -DRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY -DWEBRTC_HAVE_SCTP -DWEBRTC_USE_H264 -DWEBRTC_ENABLE_AVX2 -DRTC_ENABLE_WIN_WGC -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DABSL_ALLOCATOR_NOTHROW=1 -DLIB_WEBRTC_API_DLL -DHAVE_WEBRTC_VIDEO -I../../libwebrtc -I../../libwebrtc/include -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/abseil-cpp -I../../third_party/libyuv/include -I../../third_party/boringssl/src/include -Wno-microsoft-extra-qualification -Wno-reorder /W4 -Wimplicit-fallthrough -Wunreachable-code-aggressive -Wthread-safety /WX -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-nonportable-include-path -Wno-null-pointer-subtraction -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-unqualified-std-cast-call -Xclang -no-opaque-pointers -Wmax-tokens -Wshadow -fno-delete-null-pointer-checks -fno-ident -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 /clang:-ffp-contract=off -fcomplete-member-pointers /Gy /FS /bigobj /utf-8 /Zc:twoPhase -ffile-reproducible /Zc:sizedDealloc- /D__WRL_ENABLE_FUNCTION_STATICS__ -fmsc-version=1916 -m64 -msse3 /Brepro -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern /O1 /Ob2 /Oy- /Zc:inline /Gw /Oi /Z7 -gcodeview-ghash -Xclang -fuse-ctor-homing /guard:cf /MT -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-shadow -Wc++11-narrowing -Wundef -Wunused-lambda-capture /std:c++17 -Wno-trigraphs /Zc:alignedNew- /TP /GR- -I../../buildtools/third_party/libc++/trunk/include /Fd"obj/libwebrtc/libwebrtc_cc.pdb"
../../libwebrtc/src/rtc_peerconnection_impl.cc(920,18): error: no member named 'timestamp' in 'webrtc::RTCStats'
return stats_->timestamp().us();
       ~~~~~~~~^
1 error generated.
[3605/4058] CXX obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.obj
FAILED: obj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.obj
..\..\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe /c ../../libwebrtc/src/rtc_peerconnection_factory_impl.cc /Foobj/libwebrtc/libwebrtc/rtc_peerconnection_factory_impl.obj /nologo /showIncludes:user "-imsvcC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-imsvcC:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include" "-imsvcC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\ucrt" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\shared" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\um" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\winrt" "-imsvcC:\Program Files (x86)\Windows Kits\10\include\10.0.20348.0\cppwinrt" -DUSE_LIBYUV -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DLIB_WEBRTC_API_EXPORTS -DWEBRTC_WIN -DUSE_AURA=1 -D_HAS_NODISCARD -D_CRT_NONSTDC_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS "-DCR_CLANG_REVISION=\"llvmorg-15-init-11722-g3f3a235a-2\"" -D_LIBCPP_ABI_NAMESPACE=Cr -D_LIBCPP_ABI_VERSION=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -D_LIBCPP_NO_AUTO_LINK -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2 -DWIN32 -D_SECURE_ATL -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=NTDDI_WIN10_FE -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DRTC_ENABLE_VP9 -DRTC_DAV1D_IN_INTERNAL_DECODER_FACTORY -DWEBRTC_HAVE_SCTP -DWEBRTC_USE_H264 -DWEBRTC_ENABLE_AVX2 -DRTC_ENABLE_WIN_WGC -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DABSL_ALLOCATOR_NOTHROW=1 -DLIB_WEBRTC_API_DLL -DHAVE_WEBRTC_VIDEO -I../../libwebrtc -I../../libwebrtc/include -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/abseil-cpp -I../../third_party/libyuv/include -I../../third_party/boringssl/src/include -Wno-microsoft-extra-qualification -Wno-reorder /W4 -Wimplicit-fallthrough -Wunreachable-code-aggressive -Wthread-safety /WX -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-nonportable-include-path -Wno-null-pointer-subtraction -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -Wno-unqualified-std-cast-call -Xclang -no-opaque-pointers -Wmax-tokens -Wshadow -fno-delete-null-pointer-checks -fno-ident -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 /clang:-ffp-contract=off -fcomplete-member-pointers /Gy /FS /bigobj /utf-8 /Zc:twoPhase -ffile-reproducible /Zc:sizedDealloc- /D__WRL_ENABLE_FUNCTION_STATICS__ -fmsc-version=1916 -m64 -msse3 /Brepro -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern /O1 /Ob2 /Oy- /Zc:inline /Gw /Oi /Z7 -gcodeview-ghash -Xclang -fuse-ctor-homing /guard:cf /MT -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-shadow -Wc++11-narrowing -Wundef -Wunused-lambda-capture /std:c++17 -Wno-trigraphs /Zc:alignedNew- /TP /GR- -I../../buildtools/third_party/libc++/trunk/include /Fd"obj/libwebrtc/libwebrtc_cc.pdb"
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc(63,21): error: no member named 'BlockingCall' in 'rtc::Thread'
  worker_thread_->BlockingCall([=] { CreateAudioDeviceModule_w(); });
  ~~~~~~~~~~~~~~~~^
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc(89,19): error: no member named 'BlockingCall' in 'rtc::Thread'
worker_thread_->BlockingCall([&] {
~~~~~~~~~~~~~~~~^
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc(95,21): error: no member named 'BlockingCall' in 'rtc::Thread'
  worker_thread_->BlockingCall([this] { DestroyAudioDeviceModule_w(); });
  ~~~~~~~~~~~~~~~~^
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc(137,21): error: no member named 'BlockingCall' in 'rtc::Thread'
  worker_thread_->BlockingCall([this] { CreateAudioDeviceModule_w(); });
  ~~~~~~~~~~~~~~~~^
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc(183,63): error: no member named 'BlockingCall' in 'rtc::Thread'
  scoped_refptr<RTCVideoSource> source = signaling_thread_->BlockingCall(
                                         ~~~~~~~~~~~~~~~~~~~^
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc(267,11): error: no viable conversion from 'rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>' to 'const std::string' (aka 'const basic_string<char, char_traits<char>, allocator<char>>')
        source_adapter->rtc_source_track(), track_id.std_string());
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../buildtools/third_party/libc++/trunk/include\string(779,5): note: candidate constructor not viable: no known conversion from 'rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>' to 'const std::string &' for 1st argument
  basic_string(const basic_string& __str);
  ^
../../buildtools/third_party/libc++/trunk/include\string(784,5): note: candidate constructor not viable: no known conversion from 'rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>' to 'std::string &&' for 1st argument
  basic_string(basic_string&& __str)
  ^
../../buildtools/third_party/libc++/trunk/include\string(797,5): note: candidate constructor template not viable: no known conversion from 'rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>' to 'const char *' for 1st argument
  basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) {
  ^
../../buildtools/third_party/libc++/trunk/include\string(850,5): note: candidate constructor not viable: no known conversion from 'rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>' to 'initializer_list<char>' for 1st argument
  basic_string(initializer_list<_CharT> __il);
  ^
../../buildtools/third_party/libc++/trunk/include\string(772,40): note: explicit constructor is not a candidate
  _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)
                                     ^
../../buildtools/third_party/libc++/trunk/include\string(836,18): note: explicit constructor is not a candidate
      explicit basic_string(const _Tp& __t);
               ^
../..\api/peer_connection_interface.h(1549,26): note: passing argument to parameter 'label' here
    const std::string& label,
                       ^
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc(304,28): error: no member named 'BlockingCall' in 'rtc::Thread'
      signaling_thread_->BlockingCall([this, media_type] {
      ~~~~~~~~~~~~~~~~~~~^
../../libwebrtc/src/rtc_peerconnection_factory_impl.cc(332,28): error: no member named 'BlockingCall' in 'rtc::Thread'
      signaling_thread_->BlockingCall([this, media_type] {
      ~~~~~~~~~~~~~~~~~~~^
8 errors generated.
ninja: build stopped: subcommand failed.

Shared Lib compilation Issue

Hi
I have tried to generate dynamic lib by performing the following steps.

  • source the depot-tools

  • cloned webrtc branch-head/m74
    
  • clone you project in webrtc/src
    
  • modified the main BUILD.gn file  in webrtc/src folder by adding the line as you have mentioned in readme  
      group("default") {
         testonly = true
         deps = [
        ":webrtc",
       "//libwebrtc:libwebrtc",
        ]
    
  • gn gen out/default "--args=enable_iterator_debugging=false is_component_build=false is_debug=false"

  • ninja -C out/Default libwebrtc

    it generates the following error

webrtc@webrtc-Virtual-Machine:~/webRTC/webrtc-checkout/src$  ninja -C out/Default libwebrtc
ninja: Entering directory `out/Default'
[1/1] Regenerating ninja files
FAILED: build.ninja
../../buildtools/linux64/gn --root=../.. -q gen .
ERROR at //BUILD.gn:33:31: Invalid token.
      "//libwebrtc:libwebrtc",
                              ^
You got a tab character in here. Tabs are evil. Convert to spaces.
ninja: error: rebuilding 'build.ninja': subcommand failed

What do you think What could be the potential issue?

Regards
GM

When i dispose videorender, it crashed

Description

One videorender leaveed When I work under high loads.
then the videorender will be disposed.
when it is disposing, the app crashed.
I find that _mtx_destroy_in_situ was called.

Log

2f823af38e3348aacf94463c32c3577

ViewPoint

I think there is a risk of being disposed of while rendering is being called. such like this

const FlutterDesktopPixelBuffer* FlutterVideoRenderer::CopyPixelBuffer(
    size_t width,
    size_t height) const {
  mutex_.lock();
  if (pixel_buffer_.get() && frame_.get()) {
    if (pixel_buffer_->width != frame_->width() ||
        pixel_buffer_->height != frame_->height()) {
      size_t buffer_size =
          (size_t(frame_->width()) * size_t(frame_->height())) * (32 >> 3);
      rgb_buffer_.reset(new uint8_t[buffer_size]);
      pixel_buffer_->width = frame_->width();
      pixel_buffer_->height = frame_->height();
    }

    frame_->ConvertToARGB(RTCVideoFrame::Type::kABGR, rgb_buffer_.get(), 0,
                          (int)pixel_buffer_->width,
                          (int)pixel_buffer_->height);

    pixel_buffer_->buffer = rgb_buffer_.get();
    mutex_.unlock();
    return pixel_buffer_.get();
  }
  mutex_.unlock();
  return nullptr;
}
void FlutterVideoRenderer::OnFrame(scoped_refptr<RTCVideoFrame> frame) {
mutex_.lock();
frame_ = frame;
// haven't do this
// mutex_.unlock();
}
//sametime
void FlutterVideoRendererManager::VideoRendererDispose(
    int64_t texture_id,
    std::unique_ptr<MethodResultProxy> result) {
  auto it = renderers_.find(texture_id);
  if (it != renderers_.end()) {
    base_->textures_->UnregisterTexture(texture_id);
    renderers_.erase(it);
    result->Success();
    return;
  }
  result->Error("VideoRendererDisposeFailed",
                "VideoRendererDispose() texture not found!");
}

because of asynchronous, when mutex_.lock(),we immediately call renderers_.erase(it). Then it will crash

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.