Commit Graph

48 Commits

Author SHA1 Message Date
Lukas Herman 5db4007e73 Enable non-webrtc sampler 2020-11-01 15:31:36 -08:00
Lukas Herman 77ebcecac6 Add codec selector by string names 2020-11-01 15:14:08 -08:00
Lukas Herman b089610c27 Fix incorrect audio latency 2020-11-01 00:32:20 -07:00
Lukas Herman e6c98a844f Remove unused fmt 2020-10-30 10:01:07 -07:00
Lukas Herman 2a70c031b8 Remove unwanted logging 2020-10-30 09:04:51 -07:00
Lukas Herman 765318feb6 Fix webrtc example 2020-10-30 01:19:03 -07:00
Lukas Herman 2f5e4ee914 New mediadevices design
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
2020-10-30 00:33:55 -07:00
Lukas Herman 559c6a13a1 Update readers to be memory pool friendly 2020-10-29 00:04:12 -07:00
Lukas Herman f4a4edcabd Update codec.Reader interface to return byte slice 2020-10-29 04:48:47 +00:00
Lukas Herman 238f190e71 Use MediaDeviceInfo instead of webrtc.RTPCodecType
Changes:
  * Add unit tests for mediastream
  * Remove webrtc.RTPCodecType dependency in mediastream
  * Add Kind to Tracker interface
2020-10-11 01:29:59 -04:00
Lukas Herman abdd96e6b2 Replace Name with RTPCodec in codec builder
Allowing users to implement RTPCodec will give users freedom to have
a custom encoder with custom RTP payload.
2020-10-08 11:33:38 -04:00
Lukas Herman 5703fd7e4b Remove webrtc dependency in codec and its sub packages 2020-10-05 22:23:52 -04:00
Atsushi Watanabe ecff5e63a5 prop: support ranged/exact/oneof constraints 2020-05-24 10:26:16 +09:00
Lukas Herman 0683f973b8 Fix formatting 2020-04-19 00:17:06 -04:00
Lukas Herman 8127ce3be6 Refractor track to be more DRY
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
2020-04-18 23:51:09 -04:00
Lukas Herman 354f2710b5 Update from io.ReadCloser to codec.ReadCloser 2020-03-25 23:21:25 -04:00
Lukas Herman c9b90fb233 Redesign codec
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
2020-03-21 07:45:10 -04:00
Atsushi Watanabe 2bac44aa8a Close drivers on stream initialization failure
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.
2020-02-19 20:21:21 -08:00
Atsushi Watanabe 32731904f8 Call OnEnded even if errored before registering
OnEnded handler was not called if something errored before
registering the handler. Store error and call handler immediately
on handler registration.
2020-02-19 19:45:49 -08:00
Atsushi Watanabe 6b32f6eac2 Fix LocalTrack interfacing 2020-02-14 07:06:29 -08:00
Lukas Herman 1635910909 Protect mmap allocated memory by copying it into Go heap
- Move closing synchronization to the driver level
- Create a buffer for copying the memory allocated by mmap to Go heap
2020-02-13 19:35:52 -08:00
Atsushi Watanabe c8bba53148 Stop video track safely
- 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.
2020-02-13 19:35:52 -08:00
Atsushi Watanabe bca254261d Allow to use user defined Track
Add WithTrackGenerator option to specify TrackGenerator.
This allows user to replace Track by user defined one that
has WriteSample() and Codec() interface.
2020-02-12 22:24:32 -08:00
Lukas Herman ed1352b6ff Fix Track's ID and Label are swapped
Resolves https://github.com/pion/mediadevices/issues/32
2020-02-12 22:22:36 -08:00
Lukas Herman c6d0f3ec02 Add custom video/audio transforms
Resolves https://github.com/pion/mediadevices/issues/31
2020-02-12 08:17:57 -08:00
Lukas Herman ec310e566b Move Codec from MediaTrackConstraints to prop.Codec 2020-02-10 20:07:41 -08:00
Atsushi Watanabe 00bcadc238 Add codec property
Add codec property, which stores general encoding parameters,
to MediaTrackConstraints.
2020-02-10 18:45:34 -08:00
Atsushi Watanabe 1e868fc3e3 Add OnEnded handler
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.
2020-02-10 17:43:31 -08:00
Atsushi Watanabe 2fd3907305 Add MediaDevicesFromCodecs
Add a constructor directly from lists of codecs.
It makes MediaDevices capable for non-WebRTC purposes
as same as the Web API.
2020-02-09 07:12:04 -08:00
Lukas Herman aece2b94c6 Refractor, unify some APIs to be more DRY 2020-02-06 22:44:29 -08:00
Lukas Herman 2640f6c1f4 Move all settings to video/audio under io 2020-02-06 22:44:29 -08:00
Lukas Herman 2d9bfcda4d Remove Kind in favor of type assertion 2020-02-06 22:44:29 -08:00
Lukas Herman dcf4524223 Fix audio stream 2020-02-06 22:44:29 -08:00
Lukas Herman e1365d8811 Convert video APIs to use video.Reader 2020-02-06 22:44:29 -08:00
Lukas Herman 9466cf89fc Update audio APIs to use audio.Reader instead 2020-02-06 22:44:29 -08:00
Lukas Herman 2465f227d7 Refractor track.go
* sampler now also sends the data to track
* Add a base track to reduce redundancy
2020-02-06 22:44:29 -08:00
Lukas Herman 61c0b53c55 Add initial audio support 2020-02-06 22:44:29 -08:00
Lukas Herman f95006bd5e Enhance driver Start error handling
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.
2020-02-06 22:44:29 -08:00
Lukas Herman 62aef6b8f3 Update codec to be dynamically registered 2020-01-05 22:12:44 -08:00
Lukas Herman 46b2c15bcf Rename Encoder/Decoder to VideoEncoder/VideoDecoder 2020-01-05 22:12:44 -08:00
Lukas Herman cf2a3436fe Merge github.com/pion/codec 2020-01-05 22:12:44 -08:00
Lukas Herman 5316a81aec Add some comments for better godoc 2019-12-28 09:39:31 -08:00
Lukas Herman 53244f8b27 Expose Tracker and Manager types for better godoc 2019-12-28 09:39:31 -08:00
Lukas Herman ec58fac1e7 Rename Spec to Setting 2019-12-28 09:39:31 -08:00
Lukas Herman 5679e3c0d7 Add SelectSettings algorithm and Codec to video constraints 2019-12-28 09:39:31 -08:00
Lukas Herman 9dbe3bfb9a Move reusable packages into pkg 2019-12-25 16:13:37 -08:00
Lukas Herman 417491ec95 Clean up driver's interfaces 2019-12-25 16:13:37 -08:00
Lukas Herman 709e56166f Completely rearchitect the overall project structure 2019-12-25 16:13:37 -08:00