Fix#633
Here the signalCh could have been closed by another goroutine, we should
use returned signalCh from `track.removeActivePeerConnection()` to close
the channel.
Actually, I don't know why we need to close the signalCh, we're using it
to send over the doneCh, why ever close it?
Also make the ReadCloser an Controllable allows to uncouple
the controller implementation from the encoder.
This is not needed for the 2 codec controller already implemented (openh264 and vpx)
but is more future proof in case it required for other codecs.
With webrtc v3, users no longer need to bind or unbind manually anymore.
Changes:
* Switch from webrtc.RTPCodec to webrtc.RTPCodecParameters
* Fix broken examples after the upgrade
* NewRTPReader now accepts ssrc as a parameter
* Track interface now fulfills webrtc.TrackLocal requirements
Changes:
* [BREAKING CHANGE] NewEncodedReader is renamed to NewEncodedIOReader
* NewEncodedReader now returns a non-standard buffer reader to give
more meta data such as sample count
Changelog:
* Better support for non-webrtc use cases
* Enable multiple readers
* Enhance codec selectors
* Update APIs to reflect on the new v3 webrtc design
* Cleaner APIs
Resolves https://github.com/pion/mediadevices/issues/141
* Remove newVideoTrack and newAudioTrack
* Add a generic encoderBuilder struct
* Add newVideoEncoderBuilders and newAudioEncoderBuilders helpers
* Update sampler to be functional and add support for audio sampler
* Reduce boilerplates by using closure
Resolves https://github.com/pion/mediadevices/issues/114
* Remove codec registrar
* Completely redesign how codec is being discovered, tuned, and built
* Update examples
* Update unit tests
In GetUserMedia and GetDisplayMedia, driver was left opened if
initialization failure. Since Trackers are not returned on error,
there was no way to close them.
This commit closes Trackers on GetUserMedia/GetDisplayMedia failure.
- Treat camera read timeout as error and return detailed errors.
- Return io.EOF on Read after Close.
- Wait finishing video read loop to avoid memory violation
as the video frames might be alloced by C or on shared memory.
Add WithTrackGenerator option to specify TrackGenerator.
This allows user to replace Track by user defined one that
has WriteSample() and Codec() interface.