pion / mediadevices

Go implementation of the MediaDevices API.
https://pion.ly/
MIT License
528 stars 121 forks source link

Reduce mediadevices complexity #142

Open lherman-cs opened 4 years ago

lherman-cs commented 4 years ago

As of now, mediadevices uses many interfaces:

While using interfaces makes the design very flexible, it doesn't give that benefit for free. Following are some of the downsides:

While I've laid out some of the downsides of using interfaces above, I still think that they're great and should be used appropriately. So, I think we should try to get rid of some of the interfaces and replace them with structs, we should remove the ones that don't require flexibilities.

In my opinion, we should convert MediaDevices and MediaStream interfaces to structs.

Note: Hopefully when pion/webrtc v3 is ready, Tracker and LocalTrack interfaces can get merged to pion/webrtc.

lherman-cs commented 4 years ago

@at-wat Do you have some thoughts on this?

EmrysMyrddin commented 2 years ago

Do you still think this is something to do ? Do you have any new though now that pion/webrtc v3 is out ?