Commit Graph

344 Commits

Author SHA1 Message Date
Yutaka Takeda
7d99edd21a Added logging throughput
Resolves #778
2019-12-08 01:03:17 -08:00
Sean DuBois
1d42a11bde Add vnet to SettingEngine
Also add simple example to show usage

Resolves #778
2019-12-08 01:03:17 -08:00
David Hamilton
6fc786b6a9 Add examples of setting a different port
Those new to Go may be unfamiliar with the syntax for listening on all.
2019-11-23 18:32:26 -08:00
David Hamilton
7d28b4adba Add required step to get source to run examples
Go get with modules on no longer puts source in src.
2019-11-23 18:32:26 -08:00
Sean DuBois
721b342e2e Properly generate DataChannel streamId
Before we computed DataChannel IDs before signaling, this
is incorrect because IDs must take into account if we are
running an DTLS Client or Server.

This updates the DataChannel ID generation code to take this
into account before generating a streamId.

Resolves #908
2019-11-14 10:51:05 -08:00
Vicken Simonian
5f25df2209 Various spell fixes
For error types, vars, docs and comments
2019-10-17 23:31:21 -07:00
Hugo Arregui
6997cc792c Linter fixes
Disable funlen and some fixes

Co-authored-by: Sean DuBois <sean@siobud.com>
2019-09-10 21:48:25 -07:00
Hugo Arregui
a595db7fcc Refactor pion-to-pion-tricke example
To use a js compatible candidate buffering pattern
2019-09-10 21:48:25 -07:00
Cecylia Bocovich
5bceb0126f Use synchronization to fix trickle example
This commit uses synchronization primitives so that peers in the
pion-to-pion-trickle example adhere to the trickle ICE specification
https://tools.ietf.org/html/draft-ietf-mmusic-trickle-ice-02
To be more specific, the offering peer waits to send the answering peer
remote ICE candidates until after they have sent the initial offer. The
answering peer then waits to add any remote candidates until after it
has processed the initial offer. Similarly, the offering peer waits to
add remote candidates until it has processed the corresponding answer.
2019-09-06 15:04:51 -04:00
sylba2050
444e0bc576 Rename examples/echo -> examples/reflect
"echo" has two meanings: a Linux command and a pre-built binary.
 so change it to make it easier to identify.
2019-09-04 00:27:48 -07:00
Yutaka Takeda
542ba318f6 Added examples/datachannels-flow-control
Resolves #811
2019-09-01 02:32:08 +00:00
Gareth Hayes
63b2d4da42 Update examples/README.md for modules
Append `v2` to the import path for `go get`

Relates to: #795
2019-08-20 03:17:10 -07:00
Sean DuBois
6209597312 Fix OpusWriter issues that break VLC
* Correctly calculate page CRC
Ogg uses slightly non-standard version of CRC, we are unable to
use the Go's version. You can see the details here[0], in summary
"direct algorithm, initial val and final XOR = 0,
generator polynomial=0x04c11db7"

[0] https://xiph.org/vorbis/doc/framing.html

* Properly set EOS value
Before we created a new page with an EOS. Instead seek backwards
and update the last page with valid Opus to have EOS header and
re-generate the CRC

* Only use 0 timestamp/granule for headers
Audio itself should start from 0

* Rename OpusWriter -> OggWriter
Ogg supports more then just Opus, renaming gives us the flexibility to
expand in the future.
2019-08-15 17:12:01 -07:00
Sean DuBois
0d585106c0 Add examples/play-from-disk
Using IVFReader demonstrate how users can stream a video
from hard disk to browser.

Relates to #636
2019-08-08 16:44:50 -07:00
Mike Coleman
4095d2cde9 Fix for Safari and latest Firefox
This fixes the echo program so it works properly on Safari
and Firefox, where the preferred offered dynamic media type
is not 96/VP8. It loads MediaEngine with codecs found in the
offer and then uses the payload type of the offer's preferred
video codec in the answer.
2019-08-07 11:53:42 -07:00
Sean DuBois
91a3a81fec Fix pion-to-pion-trickle signaling
Answer was sending candidates to itself. This was slowing down
ICE since all we had was prflx candidates on the other side.
2019-08-01 18:33:10 -07:00
Sean DuBois
f6734d4474 Simplify pion-to-pion-trickle example
Close Response body right away and use http.Server to block
instead of select{}
2019-08-01 18:03:44 -07:00
Sean DuBois
7124c22824 Add pion-to-pion-trickle
Demonstrate how to use Trickle ICE when communicating pion-to-pion
2019-07-31 12:44:22 +00:00
Ato Araki
60405fe3bd Fix echo example jsfiddle html
The example javascript appends logs to a div element
with id of 'logs', this element was incorrectly named 'div'
before.
2019-07-28 17:42:27 -07:00
Sean DuBois
e12a7bf1e7 Fix examples error handling
Panic on the actual error we are checking in
data-channels-close and data-channels
2019-07-18 10:12:55 -07:00
Sean DuBois
2228e7f61e Add custom-logger example
Demonstrate how users can user their own logger via the
SettingEngine

Resolves #726
2019-07-11 20:24:07 +01:00
Sean DuBois
10d2ca3d88 Enable gochecknoglobals linter
Resolves #434
2019-07-09 23:31:56 +01:00
Sean DuBois
cc940bc5f4 Rename pion-webrtc -> Pion WebRTC
Mass rename everywhere we forgot to update
2019-06-30 21:29:35 -07:00
Sean DuBois
77cacbb787 Add examples/echo
The echo example demonstrates how to have Pion
send back to the user exactly what it receives
using the same PeerConnection.

Relates to #560

Co-authored-by: Patrice Ferlet <patrice.ferlet@smile.fr>
2019-05-18 23:59:19 -07:00
Alex Harford
c13256b890 Remove duplicate entry from examples/README.md
Remove duplicate line referring to Pion to Pion
2019-05-16 22:56:45 -07:00
xsbchen
879a2b1fec Update examples
Add sfu to example list
2019-05-05 20:47:46 -07:00
Sean DuBois
e8fe7aa48d Bump SRTP/RTCP and update RTCP API
Reading/Writing RTCP packets now return a slice

Relates to pion/srtp#29
2019-04-11 16:03:26 -07:00
Sean DuBois
dbde6114a2 Update import paths
Add /v2 to import paths everywhere
2019-04-07 02:17:15 -07:00
Sean DuBois
596ef378b0 Extract examples that use 3rd party libraries
We are moving all examples that use 3rd party libraries to
https://github.com/pion/example-webrtc-applications

Resolves #561
2019-04-07 01:14:32 -07:00
Michael MacDonald
64eecd6d39 Disable quic by default; enable with build tag
Taking a more extreme approach than #588... This patch
disables quic by default. The advantage here would be
that webrtc builds with older versions of go than
quic-go supports (currently 1.12+).
2019-04-05 15:32:40 -04:00
Sean DuBois
4c781e64d9 Return error on certificate fingerprint failure
Instead of printing the error to stdout return the error to the user.
This may not be a hard error (as later certificates would have passed)
but it never is good to be in a state where you have certificates in a
broken state.

Resolves #586
2019-04-05 00:48:22 -07:00
Sean DuBois
1cdfc10c84 Mass replace pions -> pion
Pions organization was renamed to pion
2019-04-04 15:32:03 -07:00
Sean DuBois
1202dbaa06 Migrate SDP generation to Unified Plan
This commit has breaking changes. This API change means we
can no longer support an arbitrary number of receivers. For every track
you want to receive you MUST call PeerConnection.AddTransceiver

We do now support sending an multiple audio/video feeds. You can see
this behavior via gstreamer-receive and gstreamer-send currently.

Resolves #54
2019-04-04 12:55:36 -07:00
Sean DuBois
bc94eaa968 Rewrite gstreamer-src/Pipeline for multi-track
This allows us to demonstrate multi-track easier, without having to
worry about encoding multiple times

Relates to #54
2019-04-04 12:55:36 -07:00
Sean DuBois
0884380abc Update pion-to-pion Dockerfile
Remove OpenSSL dependency, also update to Go 1.12

Resolves #576
2019-04-01 18:35:06 -07:00
backkem
d906c2b43b Detach: WASM Shim
JS/WASM shim for Detach API
2019-04-01 21:00:41 +02:00
backkem
f1c3fb8e81 Change detach to interface
This is in preparation of a JS/WASM shim.
2019-04-01 15:40:45 +02:00
Max Hawkins
2a9d654143 Rename media.Writer AddPacket -> WriteRTP
Makes the name consistent with webrtc's WriteRTP
and makes webrtc.Track a Writer.

Fixes #566
2019-03-31 00:03:37 -07:00
Max Hawkins
4298892dc0 Rename SendRTCP -> WriteRTCP
Makes method name consistent with WriteRTP

Fixes #557
2019-03-30 10:21:46 -07:00
jinleileiking
8ef5b7034f Example: Update Sfu-ws to use prommod
Update modules to use version of Pion WebRTC this example is shipped
with
2019-03-28 00:52:10 -07:00
simonacca-fotokite
79d29886d9 Fix broken link in README
Update sfu-ws link, incorrectly pointed to sfu-websocket before
2019-03-27 00:05:30 -07:00
Alex Browne
5ee8b1a5c5 Add ICE candidate event handlers
Add OnICECandidate and OnICEGatheringStateChange methods to
PeerConnection. The main goal of this change is to improve API
compatibility with the JavaScript/Wasm bindings. It does not actually
add trickle ICE support or change the ICE candidate gathering process,
which is still synchronous in the Go implementation. Rather, it fires
the appropriate events similar to they way they would be fired in a true
trickle ICE process.

Remove unused OnNegotiationNeeded event handler. This handler is not
required for most applications and would be difficult to implement in
Go. This commit removes the handler from the JavaScript/Wasm bindings,
which leads to a more similar API for Go and JavaScript/Wasm.

Add OnICEGatheringStateChange to the JavaScript/Wasm bindings. Also
changes the Go implementation so that the function signatures match.
2019-03-25 14:22:11 -07:00
Sean DuBois
fdcb1a3941 Rewrite examples to avoid onnegotiationneeded
onnegotiationneeded is broken in libwebrtc M73, so
just rewrite all examples to only set the offer once

Resolves #545
2019-03-23 13:36:06 -07:00
zigazeljko
ee5aa24977 Fix error reporting
Wrong error variable was used in data-channels-create example.
2019-03-22 22:29:40 -07:00
Alex Browne
012a7ea686 Improve build tags for Wasm
Fixes #515

This includes a few small and closely related changes:

1. All occurrences of the build tag `+build js` have been changed to the
   more precise `+build js,wasm`. This will exclude the files from being
   included by third-party compilers like GopherJS, with which they are
   incompatible.
2. Some files which are incompatible with JavaScript/Wasm now have the
   correct build tag (`+build -js`) so they will be excluded from Wasm
   builds.
3. Some configuration options which are incompatible with
   JavaScript/Wasm (or at least the current bindings) will now no longer
   appear in Wasm builds. This meant creating new files with new struct
   definitions and the appropriate build tags.
2019-03-22 10:48:03 -07:00
imalic3
768536cade Extend sfu-ws with data-channel broadcasting
Relates to #534
2019-03-21 22:41:46 -07:00
Sean DuBois
f174986c74 Fix all lint errors in examples/
Resolves #531 and Resolves #470
2019-03-21 09:31:27 -07:00
Sean DuBois
c89940a0bd Rename sfu -> sfu-minimal
We have a websocket SFU example now also

Resolves #507
2019-03-11 11:07:55 -07:00
adwpc
fb72f20f66 Add sfu example with websocket
sfu example with websocket, support video and audio. easy to use

Resolves #507
2019-03-11 10:56:01 -07:00
backkem
90b85e8c7a WASM: Document WASM support
Resolves #501
2019-03-08 14:06:02 +01:00