Closed Bug 1241153 Opened 9 years ago Closed 9 years ago

Find some way to make setParameters and GMP init less fragile

Categories

(Core :: WebRTC: Signaling, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox46 --- affected
firefox47 --- fixed

People

(Reporter: bwc, Assigned: bwc)

Details

Attachments

(1 file)

Right now, setParameters will not work if GMP is not initted yet, since addTrack will not have completed. We need to work out some way of handling this better.
What does this block (or make a pain)?
backlog: --- → webrtc/webaudio+
Rank: 25
Priority: -- → P2
Assignee: nobody → docfaraday
I can think of several ways to do this for setParameters, but I think getParameters is going to be harder. getParameters is synchronous, and since we cannot init GMP synchronously, we are left with a few options: 1. Ensure GMP is initted before a PeerConnection is ever created (basically init GMP on startup). This ensures that content JS has an accurate picture of what is supported, allows us to remove a bunch of complexity, but is maybe wasteful of resources. 2. Create tracks with the full list of codecs we _might_ support, and if we don't end up supporting H264 or something, oh well we tried. This is pretty efficient, allows content JS to tweak codec params without a hacky wait on GMP init, and simplifies the code a little. However, it is kinda lame that we advertise stuff to content JS that we don't know we support yet. 3. Create tracks with only what we know we support, and update things once GMP init is done. This is again pretty efficient, and allows for some simplification of existing code. However, content JS still needs to do a hacky wait on GMP init to figure out the full list of codecs.
I suppose a fourth option is to change the W3C spec to make addTrack async.
What do you guys think about these options?
Flags: needinfo?(rjesup)
Flags: needinfo?(jib)
How often does the information from GMP change? Could we perhaps cache information from last GMP was up? This might make a version of #2 bearable, where we return cached information from last boot until the GMP has loaded on this boot. That should make the information stable most of the time, right? We could even do #1 on the very first launch of a clean profile.
Flags: needinfo?(jib)
(In reply to Jan-Ivar Bruaroey [:jib] from comment #5) > How often does the information from GMP change? Could we perhaps cache > information from last GMP was up? This might make a version of #2 bearable, > where we return cached information from last boot until the GMP has loaded > on this boot. That should make the information stable most of the time, > right? We could even do #1 on the very first launch of a clean profile. This information changes pretty infrequently I would think. Caching might work most of the time, but if the performance characteristics of option 1 aren't too onerous that would be my preference.
Wfm. Caching may be an additional optimization we could pursue if option 1 gets blowback.
I could also live with option 2, and don't think we'd see much push-back.
Comment on attachment 8718970 [details] MozReview Request: Bug 1241153: Stop blocking addTrack on GMP init, and update codecs on existing tracks when GMP init finishes. r?jesup Review request updated; see interdiff: https://reviewboard.mozilla.org/r/34817/diff/1-2/
Attachment #8718970 - Attachment description: MozReview Request: Bug 1241153: Stop blocking addTrack on GMP init, and update codecs on existing tracks when GMP init finishes. → MozReview Request: Bug 1241153: Stop blocking addTrack on GMP init, and update codecs on existing tracks when GMP init finishes. r?jesup
Attachment #8718970 - Flags: review?(rjesup)
Comment on attachment 8718970 [details] MozReview Request: Bug 1241153: Stop blocking addTrack on GMP init, and update codecs on existing tracks when GMP init finishes. r?jesup https://reviewboard.mozilla.org/r/34817/#review32151
Attachment #8718970 - Flags: review?(rjesup) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Flags: needinfo?(rjesup)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: