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
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.
* 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.
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.