Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/llamerada-jp/webrtc-cpp-sample
Sample program for using WebRTC on C++.
https://github.com/llamerada-jp/webrtc-cpp-sample
webrtc
Last synced: 3 months ago
JSON representation
Sample program for using WebRTC on C++.
- Host: GitHub
- URL: https://github.com/llamerada-jp/webrtc-cpp-sample
- Owner: llamerada-jp
- License: mit
- Created: 2016-05-07T06:56:21.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2022-08-16T13:37:33.000Z (about 2 years ago)
- Last Synced: 2024-04-08T02:16:10.483Z (7 months ago)
- Topics: webrtc
- Language: C++
- Size: 27.3 KB
- Stars: 202
- Watchers: 15
- Forks: 62
- Open Issues: 1
-
Metadata Files:
- Readme: README.en.md
- License: LICENSE
Awesome Lists containing this project
- awesome-webrtc - webrtc-cpp-sample - Sample program for using WebRTC on C++. (Samples)
README
# WebRTC C++ sample
Sample program for using WebRTC(DataChannel) on C++.# Requirement
* Mac OSX
* Ubuntu# Compile
```sh
$ cd
$ git clone --depth 1 https://github.com/llamerada-jp/webrtc-cpp-sample.git
$ cd webrtc-cpp-sample
$ git submodule init
$ git submodule update
$ sh build.sh
```# Run
This sample use two consoles to try interprocess communication by WebRTC.
It maybe cannot communicate over NAT each other, because it does not use ICE server.## Connection
memo : On this sample, Some commands requireing parameter need line of only a semicolon after parameter.
At CONSOLE-1.
```sh
$ cd
$ ./sample
0x7fff791c9000:Main thread
0x700000081000:RTC thread
sdp1
0x700000081000:PeerConnectionObserver::RenegotiationNeeded
0x700000081000:CreateSessionDescriptionObserver::OnSuccess
0x700000081000:PeerConnectionObserver::SignalingChange(1)
Offer SDP:beginOffer SDP:end
0x700000081000:SetSessionDescriptionObserver::OnSuccess
0x700000081000:PeerConnectionObserver::IceGatheringChange(1)
0x700000081000:PeerConnectionObserver::IceCandidate
0x700000081000:PeerConnectionObserver::IceCandidate
0x700000081000:PeerConnectionObserver::IceCandidate
0x700000081000:PeerConnectionObserver::IceGatheringChange(2)
sdp3;
0x700000081000:PeerConnectionObserver::SignalingChange(0)
0x700000081000:PeerConnectionObserver::IceConnectionChange(1)
0x700000081000:SetSessionDescriptionObserver::OnSuccess
ice10x700000081000:PeerConnectionObserver::IceConnectionChange(2)
0x700000081000:PeerConnectionObserver::IceConnectionChange(3)
0x700000081000:DataChannelObserver::StateChange
0x700000081000:PeerConnectionObserver::DataChannel(0x7fd8cb608750, 0x7fd8cb71bef0)
ice2;
```At CONSOLE-2.
```sh
$ cd
$ ./sample
0x7fff791c9000:Main thread
0x700000081000:RTC thread
sdp2;
0x700000081000:PeerConnectionObserver::RenegotiationNeeded
0x700000081000:PeerConnectionObserver::SignalingChange(3)
0x700000081000:SetSessionDescriptionObserver::OnSuccess
0x700000081000:CreateSessionDescriptionObserver::OnSuccess
0x700000081000:PeerConnectionObserver::SignalingChange(0)
Answer SDP:beginAnswer SDP:end
0x700000081000:SetSessionDescriptionObserver::OnSuccess
0x700000081000:PeerConnectionObserver::IceGatheringChange(1)
0x700000081000:PeerConnectionObserver::IceCandidate
0x700000081000:PeerConnectionObserver::IceCandidate
0x700000081000:PeerConnectionObserver::IceCandidate
0x700000081000:PeerConnectionObserver::IceGatheringChange(2)
ice2;
0x700000081000:PeerConnectionObserver::IceConnectionChange(1)
0x700000081000:PeerConnectionObserver::IceConnectionChange(2)
0x700000081000:DataChannelObserver::StateChange
0x700000081000:PeerConnectionObserver::DataChannel(0x7fa739e0c0d0, 0x7fa739e08b80)
ice1```
## Send message
You can send messages, after connection is enabled.
```
send
Hello world.
;
```## Quit
You can watch sequence of quit by typing of "quit".
```
quit
```EOD