Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 64af5f4

Browse files
committed
Set SSRC when create RTP receiver.
1 parent 71974f2 commit 64af5f4

File tree

4 files changed

+71
-2
lines changed

4 files changed

+71
-2
lines changed

talk/owt/docker/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (C) <2021> Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
FROM ubuntu:20.04
6+
SHELL ["/bin/bash", "-c"]
7+
RUN apt-get update && apt-get install -y git curl wget python python3
8+
RUN mkdir workspace
9+
WORKDIR /workspace
10+
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
11+
ENV PATH="$PATH:/workspace/depot_tools"
12+
RUN mkdir owt
13+
WORKDIR /workspace/owt
14+
RUN echo $'solutions = [\n\
15+
{\n\
16+
"name" : "src",\n\
17+
"url" : "https://github.com/open-webrtc-toolkit/owt-client-native.git",\n\
18+
"deps_file" : "DEPS",\n\
19+
"managed" : False,\n\
20+
"custom_deps" : {\n\
21+
},\n\
22+
"custom_vars": {},\n\
23+
},\n\
24+
]' > .gclient
25+
RUN git config --global user.name owt-bot
26+
RUN git config --global user.email [email protected]
27+
RUN gclient sync

talk/owt/gn/toolchain/.emscripten

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (C) 2021 The Android Open Source Project
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# This is the init script that is passed to `emcc --em-config=.emscripten`
16+
# (Wasm toolchain). It sets vars to locate the various emsdk / llvm dirs.
17+
18+
import os
19+
import sys
20+
from platform import system
21+
22+
# We cannot use __file__ here.
23+
this_file = os.getenv('EM_CONFIG')
24+
if this_file is None:
25+
sys.stderr.write('Could not find EM_CONFIG in .emscripten\n')
26+
sys.exit(1)
27+
28+
root_dir = os.path.dirname(os.path.dirname(os.path.dirname(this_file)))
29+
buildools_os = 'mac' if system().lower() == 'darwin' else 'linux64'
30+
node_path = os.path.join(root_dir, 'buildtools', buildools_os, 'nodejs')
31+
emsdk_path = os.path.join(root_dir, 'buildtools', buildools_os, 'emsdk')
32+
33+
# Exported vars.
34+
NODE_JS = os.path.join(node_path, 'bin', 'node')
35+
LLVM_ROOT = os.path.join(emsdk_path, 'bin')
36+
BINARYEN_ROOT = emsdk_path
37+
EMSCRIPTEN_ROOT = os.path.join(emsdk_path, 'emscripten')
38+
COMPILER_ENGINE = NODE_JS
39+
JS_ENGINES = [NODE_JS]

talk/owt/sdk/wasm/media_session.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ MediaSession::MediaSession()
3232
call_ = std::unique_ptr<webrtc::Call>(webrtc::Call::Create(config));
3333
}
3434

35-
std::shared_ptr<RtpVideoReceiver> MediaSession::CreateRtpVideoReceiver() {
35+
std::shared_ptr<RtpVideoReceiver> MediaSession::CreateRtpVideoReceiver(
36+
uint32_t remote_ssrc) {
3637
webrtc::VideoReceiveStream::Config config(this);
38+
config.rtp.remote_ssrc = remote_ssrc;
3739
config.rtp.local_ssrc = 1;
3840
// Same as `kNackRtpHistoryMs` in third_party/webrtc/media/engine/webrtc_voice_engine.cc.
3941
config.rtp.nack.rtp_history_ms = 5000;

talk/owt/sdk/wasm/media_session.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class MediaSession : public webrtc::Transport {
1818
public:
1919
explicit MediaSession();
2020
virtual ~MediaSession() = default;
21-
std::shared_ptr<RtpVideoReceiver> CreateRtpVideoReceiver();
21+
std::shared_ptr<RtpVideoReceiver> CreateRtpVideoReceiver(
22+
uint32_t remote_ssrc);
2223
void SetRtcpCallback(emscripten::val callback);
2324

2425
// Overrides webrtc::Transport.

0 commit comments

Comments
 (0)