Closed Bug 1756260 Opened 2 years ago Closed 2 years ago

Implement a mechanism to communicate with the remote media engine

Categories

(Core :: Audio/Video: Playback, task, P1)

task

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(10 files, 3 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

In the content process, we would need communicate with IMFMediaEngine which will be implemented in the RDD process.

This bug aims to build up a complete mechanism between two processes.

In following patch, we will need to explicitly launch the RDD process outside the RemoteDecoderManagerChild, which requires to make LaunchRDDProcessIfNeeded() public.

Depends on D139204

Attachment #9264685 - Attachment is obsolete: true
Attachment #9264684 - Attachment description: WIP: Bug 1756260 - part2 : implement a mechanism to communicate with the MediaEngine in the remote process. → WIP: Bug 1756260 - part3 : implement a mechanism to communicate with the MediaEngine in the remote process.
Attachment #9264683 - Attachment is obsolete: true
Attachment #9264686 - Attachment is obsolete: true
Attachment #9265978 - Attachment description: WIP: Bug 1756260 - part1 : split some of current state machine methods and variables to another new base class preparing for a new type of state machine. → Bug 1756260 - part1 : split some of current state machine methods and variables to another new base class preparing for a new type of state machine.
Attachment #9265979 - Attachment description: WIP: Bug 1756260 - part2 : implement a new state machine for the external engine. → Bug 1756260 - part2 : implement a new state machine for the external engine.
Attachment #9264684 - Attachment description: WIP: Bug 1756260 - part3 : implement a mechanism to communicate with the MediaEngine in the remote process. → Bug 1756260 - part3 : implement a mechanism to communicate with the MediaEngine in the remote process.
Attachment #9266208 - Attachment description: WIP: Bug 1756260 - part4 : hook the remote decoders to associated MFMediaEngineParent. → Bug 1756260 - part4 : hook the remote decoders to associated MFMediaEngineParent.

Now it's just used for testing and development purpose.

In the future, this should only be used for encrypted playback and we would also need a fallback mechanism if the externak engine fails.

Depends on D140153

Blocks: 1758789
Attachment #9266208 - Attachment description: Bug 1756260 - part4 : hook the remote decoders to associated MFMediaEngineParent. → Bug 1756260 - part4 : set the media engine Id to the format reader, which would be used to find correct remote decoders.

By checking the id in the CreateDecoderParams, we can use it to find the correspond MFMediaEngineParent and ask it to create a real decoder, which is implemented by Media Engine API.

The data flow would be like that, the encoded data would be passed to the RDD process by using the remote decoder, and remote decoder would feed the data into media engine decoder, such as MFMediaEngineVideoStream and MFMediaEngineAudioStream.

Depends on D140153

Attachment #9266943 - Attachment description: Bug 1756260 - part5 : use ExternalEngineStateMachine in MediaSourceDecoder. → Bug 1756260 - part6 : use ExternalEngineStateMachine in MediaSourceDecoder.
Attachment #9272428 - Attachment description: WIP: Bug 1756260 - part6 : use a light-weight state object on ExternalEngineStateMachine. → Bug 1756260 - part7 : use a light-weight state object on ExternalEngineStateMachine.

We need to padd the media engine Id to the remote process in order to create correct remote decoders.

Depends on D140153

Attachment #9272431 - Attachment description: Bug 1756260 - part5 : create remote decoders based on the engine Id. → Bug 1756260 - part6 : create remote decoders based on the engine Id.
Attachment #9266943 - Attachment description: Bug 1756260 - part6 : use ExternalEngineStateMachine in MediaSourceDecoder. → Bug 1756260 - part7 : use ExternalEngineStateMachine in MediaSourceDecoder.
Attachment #9272428 - Attachment description: Bug 1756260 - part7 : use a light-weight state object on ExternalEngineStateMachine. → Bug 1756260 - part8 : use a light-weight state object on ExternalEngineStateMachine.

These patches are ready to be reviewed again. Now with these patches and bug 1758789, audio playback could be done via the Media Engine API.

If we call them too early, the IPC connection might not be created yet.

Depends on D143678

/builds/worker/fetches/MacOSX10.12.sdk/usr/include/MacTypes.h:542:16: error: reference to 'Point' is ambiguous

The point type is conflict with the gfx::Point, so move the media data out of the unify build.

Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ed9640359f3a
part1 : split some of current state machine methods and variables to another new base class preparing for a new type of state machine. r=jolin
https://hg.mozilla.org/integration/autoland/rev/34b10d427f0f
part2 : implement a new state machine for the external engine. r=jolin
https://hg.mozilla.org/integration/autoland/rev/9fc71b8478d5
part3 : implement a mechanism to communicate with the MediaEngine in the remote process. r=jolin
https://hg.mozilla.org/integration/autoland/rev/b69ee552b64e
part4 : set the media engine Id to the format reader, which would be used to find correct remote decoders. r=jolin
https://hg.mozilla.org/integration/autoland/rev/93245b0e2118
part5 : pass the engine Id via IPC. r=jolin
https://hg.mozilla.org/integration/autoland/rev/46e8a8457044
part6 : create remote decoders based on the engine Id. r=jolin
https://hg.mozilla.org/integration/autoland/rev/d624c80ba67f
part7 : use ExternalEngineStateMachine in MediaSourceDecoder. r=jolin
https://hg.mozilla.org/integration/autoland/rev/1a9aa3f175d0
part8 : use a light-weight state object on ExternalEngineStateMachine. r=jolin
https://hg.mozilla.org/integration/autoland/rev/391201cf338b
part9 : only execute engine's methods after it got intialized correctly and not in a shutdown state. r=jolin
https://hg.mozilla.org/integration/autoland/rev/d2339ec8194e
part10 : fix macOS build error. r=media-playback-reviewers,bryce

Backed out for causing build bustages on ExternalEngineStateMachine.obj

Flags: needinfo?(alwu)
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b6f98bdaa557
part1 : split some of current state machine methods and variables to another new base class preparing for a new type of state machine. r=jolin
https://hg.mozilla.org/integration/autoland/rev/a7190215baac
part2 : implement a new state machine for the external engine. r=jolin
https://hg.mozilla.org/integration/autoland/rev/4d2d5b2974cb
part3 : implement a mechanism to communicate with the MediaEngine in the remote process. r=jolin
https://hg.mozilla.org/integration/autoland/rev/79a967c1d605
part4 : set the media engine Id to the format reader, which would be used to find correct remote decoders. r=jolin
https://hg.mozilla.org/integration/autoland/rev/455935df901d
part5 : pass the engine Id via IPC. r=jolin
https://hg.mozilla.org/integration/autoland/rev/7f518efee9db
part6 : create remote decoders based on the engine Id. r=jolin
https://hg.mozilla.org/integration/autoland/rev/49644876a6a2
part7 : use ExternalEngineStateMachine in MediaSourceDecoder. r=jolin
https://hg.mozilla.org/integration/autoland/rev/9eacbae59c29
part8 : use a light-weight state object on ExternalEngineStateMachine. r=jolin
https://hg.mozilla.org/integration/autoland/rev/5613cede41c3
part9 : only execute engine's methods after it got intialized correctly and not in a shutdown state. r=jolin
https://hg.mozilla.org/integration/autoland/rev/d85b9d46c688
part10 : fix macOS build error. r=media-playback-reviewers,bryce
Regressions: 1120222
Regressions: 1808871
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: