Skip to content

Commit

Permalink
develop | seg fault handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitchaku-sprinklr committed Oct 3, 2022
1 parent 685aa43 commit ea67bdb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
20 changes: 20 additions & 0 deletions docs/build-from-source.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Build from Source

## Summary

Setup in a `ubuntu:focal` container with the following commands.

```
# docker pull ubuntu:focal
# docker run --rm -it ubuntu:focal bash
apt update -y
apt install -y build-essential flex libelf-dev binutils-dev libdwarf-dev git cmake curl vim wget screen npm python2
curl -sL https://deb.nodesource.com/setup_12.x -o /tmp/nodesource_setup.sh
apt install nodejs
git clone https://github.com/node-webrtc/node-webrtc.git
cd node-webrtc/
# apt install gcc-multilib
ln -s /usr/bin/python2 /usr/bin/python
SKIP_DOWNLOAD=true npm install
./node_modules/.bin/ncmake configure
./node_modules/.bin/ncmake build
```

## Prerequisites

node-webrtc uses [node-cmake](https://github.com/cjntaylor/node-cmake) to build
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
"p2p",
"peer"
],
"version": "0.4.7-dev",
"version": "0.4.7",
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
"homepage": "https://github.com/node-webrtc/node-webrtc",
"bugs": "https://github.com/node-webrtc/node-webrtc/issues",
"homepage": "https://github.com/rohitChaku/node-webrtc",
"bugs": "https://github.com/rohitChaku/node-webrtc/issues",
"license": "BSD-2-Clause",
"repository": {
"type": "git",
"url": "http://github.com/node-webrtc/node-webrtc.git"
"url": "http://github.com/rohitChaku/node-webrtc.git"
},
"main": "lib/index.js",
"browser": "lib/browser.js",
"binary": {
"module_name": "wrtc",
"module_path": "./build/{configuration}/",
"remote_path": "./{module_name}/v{version}/{configuration}/",
"remote_path": "./{module_name}-v{version}-{configuration}",
"package_name": "{platform}-{arch}.tar.gz",
"host": "https://node-webrtc.s3.amazonaws.com"
"host": "https://github.com/rohitChaku/node-webrtc/archive/refs/tags"
},
"engines": {
"node": "^8.11.2 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0"
Expand Down
4 changes: 4 additions & 0 deletions src/interfaces/media_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ MediaStream* MediaStream::Create(
auto env = MediaStream::constructor().Env();
Napi::HandleScope scope(env);

if (factory == nullptr) {
factory = PeerConnectionFactory::GetOrCreateDefault();
}

auto object = MediaStream::constructor().New({
factory->Value(),
Napi::External<rtc::scoped_refptr<webrtc::MediaStreamInterface>>::New(env, &stream)
Expand Down

0 comments on commit ea67bdb

Please sign in to comment.