webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

Make TrackLocalContext an interface

Open kevmo314 opened this issue 4 years ago • 4 comments

This allows external users to provide their own TrackLocalContext to be bound to a track.

kevmo314 avatar Apr 05 '22 04:04 kevmo314

Codecov Report

Patch coverage: 81.25% and project coverage change: -1.71% :warning:

Comparison is base (6a3a97f) 79.42% compared to head (5f0e980) 77.72%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2170      +/-   ##
==========================================
- Coverage   79.42%   77.72%   -1.71%     
==========================================
  Files          76       87      +11     
  Lines        8477     9374     +897     
==========================================
+ Hits         6733     7286     +553     
- Misses       1359     1657     +298     
- Partials      385      431      +46     
Flag Coverage Δ
go 79.49% <81.25%> (+0.07%) :arrow_up:
wasm 70.23% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
rtpsender.go 81.94% <80.00%> (ø)
track_local.go 83.33% <83.33%> (+16.66%) :arrow_up:

... and 14 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 05 '22 04:04 codecov[bot]

That's pretty interesting @kevmo314 !

Are you calling Bind yourself? I had only really thought is something that webrtc calls for the users.

Sean-Der avatar Apr 05 '22 14:04 Sean-Der

Switching it from a struct to a pointer technically is API breakage

Let me check ion-sfu and mediadevices first to make sure we don't cause any problems (I hope not though)

Sean-Der avatar Apr 05 '22 14:04 Sean-Der

Switching it from a struct to a pointer technically is API breakage

Let me check ion-sfu and mediadevices first to make sure we don't cause any problems (I hope not though)

I think because all the properties are private it shouldn't cause any breakages but I'll hold off, let me know when you're comfortable merging :)

I'm calling Bind() because I'm trying another approach to multihoming a track. Turns out using UDPMux didn't work very well and the interceptor API doesn't let me spawn new tracks easily

kevmo314 avatar Apr 05 '22 15:04 kevmo314

I tested pion/mediadevices, glimesh/broadcast-box and livekit/livekit (all users of TrackLocalContext)

This could have negative effects on users using reflection. I hope that this doesn't effect anyone. If it does reach out and happy to undo!

thanks

Sean-Der avatar Aug 03 '23 17:08 Sean-Der

I second this change, but I believe we should migrate versioning rule to semver someday (bump MAJOR version when making incompatible API changes)

at-wat avatar Sep 01 '23 01:09 at-wat