Commit Graph

70 Commits

Author SHA1 Message Date
alwu
1a563a1fdb Bug 1833266 - part6 : support encrypted only mode. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D178208
2023-05-18 23:58:21 +00:00
alwu
f7054500be Bug 1833266 - part5 : make sure the engine play would be triggered properly whenever starting running the media engine. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D178207
2023-05-18 23:58:21 +00:00
alwu
c241dec847 Bug 1833266 - part2 : remove the pref 'media.wmf.media-engine.drm-playback'. r=jolin
We can simply use `media.wmf.media-engine.enabled` to control different
abilities for the media engine.

Differential Revision: https://phabricator.services.mozilla.com/D178125
2023-05-18 23:58:20 +00:00
alwu
421b328525 Bug 1833266 - part1 : check whether MDSM supports given CDM proxy. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D178124
2023-05-18 23:58:20 +00:00
alwu
078f585101 Bug 1814749 - part2 : do not call engine method until the recovery finishes. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D173374
2023-03-31 08:14:03 +00:00
alwu
918d104260 Bug 1814749 - part1 : do not recover the CDM process from crash unlimitedly. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D173240
2023-03-31 08:14:03 +00:00
Marian-Vasile Laza
4134cbe058 Backed out 3 changesets (bug 1814749) for build bustages on ExternalEngineStateMachine.cpp. CLOSED TREE
Backed out changeset 84c7cbeaccd6 (bug 1814749)
Backed out changeset babe4bfab4f7 (bug 1814749)
Backed out changeset a8eb0d7b8b65 (bug 1814749)
2023-03-31 06:25:09 +03:00
alwu
52befc8e32 Bug 1814749 - part2 : do not call engine method until the recovery finishes. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D173374
2023-03-31 03:06:10 +00:00
alwu
fc6ee0337f Bug 1814749 - part1 : do not recover the CDM process from crash unlimitedly. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D173240
2023-03-31 03:06:10 +00:00
alwu
1422eee739 Bug 1821803 - part4 : prevent setting CDM before the engine initialization. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D172489
2023-03-21 00:17:11 +00:00
Marian-Vasile Laza
dda8deb00c Backed out 4 changesets (bug 1821803) for build bustages on MFMediaEngineParent.cpp. CLOSED TREE
Backed out changeset 75db8a0db46f (bug 1821803)
Backed out changeset ec91bc6abbd4 (bug 1821803)
Backed out changeset a2ddd3db75c2 (bug 1821803)
Backed out changeset 14892860eaee (bug 1821803)
2023-03-20 22:48:42 +02:00
alwu
55bc68bbbf Bug 1821803 - part4 : prevent setting CDM before the engine initialization. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D172489
2023-03-20 18:49:39 +00:00
alwu
7a209dbb44 Bug 1820650 - part2 : send CDM proxy id to the MF CDM process. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D171801
2023-03-13 21:17:00 +00:00
alwu
73dbbe7442 Bug 1820650 - part1 : add another layer for setting CDM proxy. r=jolin
For media engine playback, we would like to let ExternalStateMachine
being aware of the CDM proxy, so that it can pass the the Id of MFCDM
actor to the remote media engine via MFMediaEngineChild in following
patches.

Differential Revision: https://phabricator.services.mozilla.com/D171800
2023-03-13 21:16:59 +00:00
Norisz Fay
0087d26701 Backed out 6 changesets (bug 1820650) for causing bustages on RefPtr.h
Backed out changeset 4ef516b179bf (bug 1820650)
Backed out changeset 59d2d028031c (bug 1820650)
Backed out changeset cf79d0de211f (bug 1820650)
Backed out changeset d3a683a93cf7 (bug 1820650)
Backed out changeset 751bdba95291 (bug 1820650)
Backed out changeset e0a4ae573d25 (bug 1820650)
2023-03-13 21:18:54 +02:00
alwu
3ebcd3bcd1 Bug 1820650 - part2 : send CDM proxy id to the MF CDM process. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D171801
2023-03-13 17:15:12 +00:00
alwu
476bbd601f Bug 1820650 - part1 : add another layer for setting CDM proxy. r=jolin
For media engine playback, we would like to let ExternalStateMachine
being aware of the CDM proxy, so that it can pass the the Id of MFCDM
actor to the remote media engine via MFMediaEngineChild in following
patches.

Differential Revision: https://phabricator.services.mozilla.com/D171800
2023-03-13 17:15:12 +00:00
alwu
aa810a3b97 Bug 1808804 - part4 : recover playback to what it was before crash. r=jolin
We will recover playback by performing seeking to the last played
position and keep the play state correct.

Differential Revision: https://phabricator.services.mozilla.com/D166490
2023-01-17 20:00:48 +00:00
alwu
94ac76bcef Bug 1808804 - part2 : handle the MF CDM process crash in the external state machine. r=jolin
This patch makes the external state machine be able to recover playback
when the MF CDM process crash.

In addition, one of the important thing is that, the external state
machine would need to recreate the MFMediaEngineParent/Child actor
first, before the media format reader recreate the remote decoder.

Otherwise, the new created remote decoder won't be able to find the
correct media engine stream, which would be created after finishing
the initializtion of the engine parent actor and the media source.

Differential Revision: https://phabricator.services.mozilla.com/D166411
2023-01-17 20:00:47 +00:00
alwu
8ef9b0adeb Bug 1805310 - remove some unuseful logs. r=media-playback-reviewers,karlt
Differential Revision: https://phabricator.services.mozilla.com/D164513
2022-12-13 17:00:09 +00:00
Andreas Pehrson
f1718108cc Bug 1796069 - Simplify and make more flexible the PerformanceRecorder API. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D160751
2022-12-01 09:52:44 +00:00
alwu
86983ad49e Bug 1790146 - part3 : set image to the secondary container for the media engine playabck. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D162159
2022-11-21 18:23:31 +00:00
alwu
f51260d20c Bug 1790146 - part2 : remove redundant mVideoFrameContainer which already exists in the base class. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D162158
2022-11-21 18:23:30 +00:00
alwu
2daf09643e Bug 1790146 - part1 : move mSecondaryVideoContainer to the base class and perform base members cleanup in the base class. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D162157
2022-11-21 18:23:30 +00:00
alwu
209f158f47 Bug 1795507 - part4 : update the frame status after really receiving the first decoded frame. r=jolin
As now the video stream would only return an image when the dcomp image
is ready, we should also delay sending first frame ready event and
notify next frame status correctly based on whether we've received the
decoded data.

Otherwise, it would cause the ready state in the media element in
incorrect status.

Differential Revision: https://phabricator.services.mozilla.com/D161551
2022-11-14 19:27:05 +00:00
alwu
eb323136b2 Bug 1771011 - part5 : report playback statistic data.r=jolin
Depends on D151707

Differential Revision: https://phabricator.services.mozilla.com/D151803
2022-08-13 23:48:08 +00:00
alwu
cd2d6a1c5f Bug 1771011 - part3 : support changing playback rate on the media engine playback.r=jolin
Depends on D151019

Differential Revision: https://phabricator.services.mozilla.com/D151585
2022-08-13 23:48:07 +00:00
alwu
b3d79ecc77 Bug 1771011 - part2 : wrap media engine's dcomp handle, and use it on our gfx pipeline in the GPU process.r=jolin,sotaro
In this patch, we ask the media engine to return a handle for shareable
dcomp surface, which will then be packaged into a new texture data type
and being shared with the GPU process via the video bridge.

DcompSurfaceImage is the image which contains the handle texture data,
which doesn't support being accessed in the content process. When the
compositor uploads the image to the GPU process, the corresponding
texture host will be created.

The render texture host will be created by that texture host, and it
will be used in DCLayerTree. In DCLayerTree, we create a new type of
surface for our dcomp handle. DCSurfaceHandle will ask the render
texture host to reconstruct the surface by the handle shared from the
remote process (the handle is actually duplicated to the parent process
first due to the sandbox policy, and then be duplicated to the GPU
process later)

DCSurfaceHandle will attach that surface to its visual in order to
display the video frame directly. In the whole process, it's not
possible for Gecko to access any decoded video data which is protected by the
media engine itself.

Depends on D149941

Differential Revision: https://phabricator.services.mozilla.com/D151019
2022-08-13 23:48:07 +00:00
alwu
0e10ee707d Bug 1778038 - part2 : reply engine data request after finishing reader seek. r=jolin
We should request new data after finishing seeking on the reader,
otherwise it would send incorrect data to the remote media engine.

Differential Revision: https://phabricator.services.mozilla.com/D151584
2022-07-26 05:20:10 +00:00
alwu
700e41aa62 Bug 1778038 - part1 : use seek target's time as a threshold when requesting a video data. r=jolin
During seeking, the current position might still be the wrong value and
hasn't been updated yet. Therefore, we should use the time of seek
target in order to avoid incorrectly discarding video frame due to the
wrong threshold time.

Differential Revision: https://phabricator.services.mozilla.com/D150988
2022-07-26 05:20:10 +00:00
alwu
2adf2473a2 Bug 1758789 - part18 : disable the media engine feature on MinGW. r=media-playback-reviewers,firefox-build-system-reviewers,jolin,ahochheiden
On MinGW, it lacks of the headers for RunTimeClass and we have trouble to make it work. This patch adds a new config for Media Engine in order not to build related files on MinGW environment.

In addition, MinGW build version of Firefox is only used for Tor browser and it's ok to disable this feature for them for now. If they want to port this feature in the future as well, then we can see if we can fix the build problems at that time.

Differential Revision: https://phabricator.services.mozilla.com/D150660
2022-06-30 22:34:22 +00:00
alwu
0fc60d68aa Bug 1758789 - part15 : handle some shutdown crashes. r=jolin
The init promise is also monitoring by other places, so we should keep it alive until we can ensure that all other places have disconnected from the promise.

Otherwise, it would cause the assertion [1] because the promise gets destroyed too early.

[1] https://searchfox.org/mozilla-central/rev/c6620104602decf1af7c6a9f78692426db6a5da2/xpcom/threads/MozPromise.h#524

Differential Revision: https://phabricator.services.mozilla.com/D145686
2022-06-30 22:34:21 +00:00
alwu
4c46008a9a Bug 1758789 - part14 : check type support earlier when finishing reading metadata. r=jolin
If we already know the type in unsupported, we can switch back to the normal state machine earlier without waiting the error from the media engine.

Differential Revision: https://phabricator.services.mozilla.com/D145403
2022-06-30 22:34:21 +00:00
alwu
62aad00f30 Bug 1758789 - part13 : fallback to our state machine when the external engine fails to work. r=jolin
This is important for testing because the media foundation doesn't support all the formats Firefox supports, we would need to fallback to the normal state machine in order to keep tests running without breaking them.

Differential Revision: https://phabricator.services.mozilla.com/D145402
2022-06-30 22:34:20 +00:00
alwu
01e5952910 Bug 1758789 - part7 : set a blank image to the video container. r=jolin
Before implmenting DCOMP video output, let's set blank image to the video container temporarily. This will result in a white image showing during a playback.

Differential Revision: https://phabricator.services.mozilla.com/D145155
2022-06-30 22:34:18 +00:00
alwu
7fe2d7d4c8 Bug 1758789 - part6 : handle multiple seeked events, which is caused by triggering new seeking before the previous one finishes. r=jolin
It's possible that a new seeking happens while the previous seeking hasn't finished yet. So multiple seeked events would be sent from the media engine.

We should wait for the finish of the last seeking to make sure the current time has changed to the target time in the last seek target.

Differential Revision: https://phabricator.services.mozilla.com/D145154
2022-06-30 22:34:17 +00:00
alwu
71b3063cfa Bug 1758789 - part4 : only trigger shutdown from the decoder. r=jolin
We should let the decoder to determine when the state machine should be shutdown. As there might be some reader tasks still running, shutdowning it too early would result in some crashes.

Differential Revision: https://phabricator.services.mozilla.com/D144769
2022-06-30 22:34:17 +00:00
smolnar
f51b8b4ac7 Backed out 18 changesets (bug 1758789) for causing win AArch64 build bustages. CLOSED TREE
Backed out changeset e3f1d216b7b0 (bug 1758789)
Backed out changeset 737731f1056d (bug 1758789)
Backed out changeset 76a2ae95718a (bug 1758789)
Backed out changeset c134ab07a603 (bug 1758789)
Backed out changeset 84f574f95348 (bug 1758789)
Backed out changeset 7dae17111210 (bug 1758789)
Backed out changeset cdec8c010960 (bug 1758789)
Backed out changeset a1976aeac84e (bug 1758789)
Backed out changeset 6aac8720ffa5 (bug 1758789)
Backed out changeset 48b798f102e5 (bug 1758789)
Backed out changeset 310e551d433b (bug 1758789)
Backed out changeset b3d6df1153c1 (bug 1758789)
Backed out changeset 61775207f73b (bug 1758789)
Backed out changeset f0c28aea2f4b (bug 1758789)
Backed out changeset 0a65ff00244a (bug 1758789)
Backed out changeset 0b747e748709 (bug 1758789)
Backed out changeset cdf4acea8c87 (bug 1758789)
Backed out changeset 0c4009da7d1e (bug 1758789)
2022-06-30 23:54:23 +03:00
alwu
f891b9ae96 Bug 1758789 - part18 : disable the media engine feature on MinGW. r=media-playback-reviewers,firefox-build-system-reviewers,jolin,ahochheiden
On MinGW, it lacks of the headers for RunTimeClass and we have trouble to make it work. This patch adds a new config for Media Engine in order not to build related files on MinGW environment.

In addition, MinGW build version of Firefox is only used for Tor browser and it's ok to disable this feature for them for now. If they want to port this feature in the future as well, then we can see if we can fix the build problems at that time.

Differential Revision: https://phabricator.services.mozilla.com/D150660
2022-06-30 18:14:50 +00:00
alwu
97f7225767 Bug 1758789 - part15 : handle some shutdown crashes. r=jolin
The init promise is also monitoring by other places, so we should keep it alive until we can ensure that all other places have disconnected from the promise.

Otherwise, it would cause the assertion [1] because the promise gets destroyed too early.

[1] https://searchfox.org/mozilla-central/rev/c6620104602decf1af7c6a9f78692426db6a5da2/xpcom/threads/MozPromise.h#524

Differential Revision: https://phabricator.services.mozilla.com/D145686
2022-06-30 18:14:49 +00:00
alwu
e2b0baf4fb Bug 1758789 - part14 : check type support earlier when finishing reading metadata. r=jolin
If we already know the type in unsupported, we can switch back to the normal state machine earlier without waiting the error from the media engine.

Differential Revision: https://phabricator.services.mozilla.com/D145403
2022-06-30 18:14:49 +00:00
alwu
6b669d3067 Bug 1758789 - part13 : fallback to our state machine when the external engine fails to work. r=jolin
This is important for testing because the media foundation doesn't support all the formats Firefox supports, we would need to fallback to the normal state machine in order to keep tests running without breaking them.

Differential Revision: https://phabricator.services.mozilla.com/D145402
2022-06-30 18:14:48 +00:00
alwu
6708ee0ca8 Bug 1758789 - part7 : set a blank image to the video container. r=jolin
Before implmenting DCOMP video output, let's set blank image to the video container temporarily. This will result in a white image showing during a playback.

Differential Revision: https://phabricator.services.mozilla.com/D145155
2022-06-30 18:14:46 +00:00
alwu
a3e06e7e4d Bug 1758789 - part6 : handle multiple seeked events, which is caused by triggering new seeking before the previous one finishes. r=jolin
It's possible that a new seeking happens while the previous seeking hasn't finished yet. So multiple seeked events would be sent from the media engine.

We should wait for the finish of the last seeking to make sure the current time has changed to the target time in the last seek target.

Differential Revision: https://phabricator.services.mozilla.com/D145154
2022-06-30 18:14:46 +00:00
alwu
dd1c8e4af2 Bug 1758789 - part4 : only trigger shutdown from the decoder. r=jolin
We should let the decoder to determine when the state machine should be shutdown. As there might be some reader tasks still running, shutdowning it too early would result in some crashes.

Differential Revision: https://phabricator.services.mozilla.com/D144769
2022-06-30 18:14:45 +00:00
smolnar
30979b47e3 Backed out 17 changesets (bug 1758789) for causing build bustages in dom/media/platforms/wmf/MFMediaEngineExtra.h CLOSED TREE
Backed out changeset f79b85886b3d (bug 1758789)
Backed out changeset b88968ae3985 (bug 1758789)
Backed out changeset 57af0b43d880 (bug 1758789)
Backed out changeset 3c325066c27f (bug 1758789)
Backed out changeset 776504da5d7b (bug 1758789)
Backed out changeset b66d3822afd4 (bug 1758789)
Backed out changeset 581fa3820b0e (bug 1758789)
Backed out changeset bdd37867341d (bug 1758789)
Backed out changeset 48c8b7df090a (bug 1758789)
Backed out changeset ec8e4b456e97 (bug 1758789)
Backed out changeset 7160b7ed5c7a (bug 1758789)
Backed out changeset 10fc120f05ae (bug 1758789)
Backed out changeset 4f9f771c22d5 (bug 1758789)
Backed out changeset 52bac96aa2b6 (bug 1758789)
Backed out changeset 7c6bf8ff8b2f (bug 1758789)
Backed out changeset 7ea0b6f1bbd5 (bug 1758789)
Backed out changeset d7485e0cfe18 (bug 1758789)
2022-06-28 10:14:16 +03:00
alwu
18f599a8c6 Bug 1758789 - part15 : handle some shutdown crashes. r=jolin
The init promise is also monitoring by other places, so we should keep it alive until we can ensure that all other places have disconnected from the promise.

Otherwise, it would cause the assertion [1] because the promise gets destroyed too early.

[1] https://searchfox.org/mozilla-central/rev/c6620104602decf1af7c6a9f78692426db6a5da2/xpcom/threads/MozPromise.h#524

Differential Revision: https://phabricator.services.mozilla.com/D145686
2022-06-28 04:26:46 +00:00
alwu
47d2595b3e Bug 1758789 - part14 : check type support earlier when finishing reading metadata. r=jolin
If we already know the type in unsupported, we can switch back to the normal state machine earlier without waiting the error from the media engine.

Differential Revision: https://phabricator.services.mozilla.com/D145403
2022-06-28 04:26:46 +00:00
alwu
0ab6ca8ac9 Bug 1758789 - part13 : fallback to our state machine when the external engine fails to work. r=jolin
This is important for testing because the media foundation doesn't support all the formats Firefox supports, we would need to fallback to the normal state machine in order to keep tests running without breaking them.

Differential Revision: https://phabricator.services.mozilla.com/D145402
2022-06-28 04:26:46 +00:00
alwu
de28f473d0 Bug 1758789 - part7 : set a blank image to the video container. r=jolin
Before implmenting DCOMP video output, let's set blank image to the video container temporarily. This will result in a white image showing during a playback.

Differential Revision: https://phabricator.services.mozilla.com/D145155
2022-06-28 04:26:43 +00:00