Closed Bug 1561179 Opened 5 years ago Closed 5 years ago

Create a PVideoBridge connection from the RDD process to the GPU process

Categories

(Core :: Audio/Video: Playback, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox69 --- wontfix
firefox72 --- fixed

People

(Reporter: mattwoodrow, Assigned: u480271)

References

(Regression)

Details

(Keywords: regression)

Attachments

(6 files)

Once we have the infrastructure for creating a video bridge from RDD to parent process (bug 1561178), we should also do it for the GPU process.

The setup for this will likely be the same (except that we have to also send the Endpoint across PGPU to the GPU process) and then we'll have two available in the RDD process.

We send across a TextureFactoryIdentifier when setting up a decoder, and that includes the GeckoProcessType of the compositor that will use the decoded frames, so we can use that to pick which video bridge to use.

The hard bit here is that both the RDD process and GPU process can crash at any time, and we want to recreate this connection whenever the crashed process re-initializes.

We need to think through what the desired behaviour is in each case.

Priority: -- → P2

A patch for this will likely look quite similar to 'Create a VideoBridge connection from the RDD process to the parent process' from bug 1561178.

Instead of posting the parent endpoint to the compositor thread, it'll need to be sent across PGPU to the GPU process, and then posted to the compositor thread.

We'll need to wait until both process are created, rather than doing it from the RDD process creation, and do it again if either process crashes.

There's probably some work to be done to make sure we gracefully handle the other process going away at any time (or decide that we always want to intentionally take them both down and restart both).

There's also some weird race conditions, like handing content asking for a video to be decoded and sent to the GPU before we've managed to setup the RDD<->GPU link. Having the RDD process crash, then the GPU process crash in the middle of RDD startup would also be fun. There's probably more things to explore and test here.

VideoBridgeParent also expects there to be only one bridge terminating in a given process, but this patch can make there be two (one from the gpu process decoder to gpu process compositor, one from RDD process decoder to gpu process compositor). We need to fix VideoBridgeParent::GetSingleton to handle this (by just duplicating it?), and fix the caller to know which one to look or (or to just look at both serially).

Michael, is this something you'd be interested in looking at? I'm going to be fairly busy with fission for the near future, so my progress on this will be slow.

Flags: needinfo?(mfroman)

Sorry for the slow response. I have a couple things I need to do first, but then I can take a look.

Flags: needinfo?(mfroman)

To bring the naming more inline with ImageBridge.

LaunchRDDProcess() and CreateContentBridge() create a sync creation. Merge the
functions into one function. Keep the IPDL messaging async to avoid adding a
exception for the message being sync.

Combine sVideoBridgeToParentProcess and sVideoBridgeToGPUProcess into one
sVideoBridge. Each producing process, GPU or RDD, is only ever started with one
VideoBridgeChild endpoint. This is enough to get RemoteVideoDecoders in RDD
process to start using GPU memory to send video to compositor over PVideoBridge.

Add an observer to restart the PVideoBridge connection when GPU process
restarts.

Assignee: nobody → dglastonbury
Status: NEW → ASSIGNED
Pushed by dglastonbury@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4037cce56491
P1: Enable the creation of multiple VideoBridgeParent actors. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/55340b999a4e
P2: Rename VideoBridge methods and members. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/4678da971197
P3: Merge LaunchRDDProcess and CreateContentBridge. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/e90af73ef3c4
P4: Create PVideoBridge between RDDProcess and GPUProcess. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/90c207dd2cc2
P5: Remove separate VideoBridgeChild Singletons. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/5d8059472045
P6: Handle shutdown of the GPU process and reconnect PVideoBridge. r=mattwoodrow

Which is strange because this change should only affect AV1 playback on Windows and these tests fail on Linux and my try runs were green. Will investigate.

Flags: needinfo?(dglastonbury)
Attachment #9103801 - Attachment description: Bug 1561179 - P3: Merge LaunchRDDProcess and CreateContentBridge. → Bug 1561179 - P3: Merge EnsureRDDReady into LaunchRDDProcess.
Pushed by dglastonbury@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9942990fbff5
P1: Enable the creation of multiple VideoBridgeParent actors. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/8b9accb33804
P2: Rename VideoBridge methods and members. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/dc3f655d626e
P3: Merge EnsureRDDReady into LaunchRDDProcess. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/e4d3547739db
P4: Create PVideoBridge between RDDProcess and GPUProcess. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/fa6bf31d950b
P5: Remove separate VideoBridgeChild Singletons. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/7a1c07e301a9
P6: Handle shutdown of the GPU process and reconnect PVideoBridge. r=mattwoodrow
Regressed by: 1660727
Keywords: regression
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: