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.
In Web API, MediaStreamTrack.ended event is fired and
MediaStreamTrack.onended handler is called on device error.
This commit adds same way to handle errors.
Calling Start will now create a goroutine to run the underlying adapter
Start function concurrently. However, the driver Start function will
block until either it returns early with an error from adapter Start
function or after it receives the first data. This way, the caller
can make sure that the driver has started properly.