Use a static helper to automatically start and shutdown Media Foundation
Categories
(Core :: Audio/Video: Playback, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: alwu, Assigned: alwu)
References
(Depends on 1 open bug)
Details
Attachments
(1 file)
According to [1], MFShutdown
will shutdown the media foundation for every other calls of MFStartup
, which means it's possible to shutdown the media foundation even if other components are still using that.
Therefore, we should consider to make the media foundation alive when the first time any component wants to use it, and shutdown it when the whole process destroys.
We already did similar thing on the RDD process [2] so it makes sense to do it as well on other places. Especially considering we will move the MFT decoder into the RDD process in the future, we definitely don't want an encoder incorrectly shutdown the media foundation while decoder is using it.
Also, it saves time to call MFStartup
if the media foundation is already started.
[1] https://docs.microsoft.com/en-us/windows/win32/api/mfapi/nf-mfapi-mfshutdown
[2] https://searchfox.org/mozilla-central/rev/eeeba8183d3268e0d563c2becf9f4adc21a37368/dom/media/ipc/RDDParent.cpp#111,303,315
Assignee | ||
Comment 1•2 years ago
|
||
According to [1], MFShutdown
will shutdown the media foundation for every other call of MFStartup
, which means it's possible to shutdown the media foundation even if other components are still using that.
Therefore, we should consider make the media foundation alive when the first time any component wants to use it, and shutdown it when the whole process destroys.
We already did similar thing on the RDD process [2] so it makes sense to do it as well on other places. Especially considering we will move the MFT decoder into the RDD process in the future, we definitely don't want an encoder incorrectly shutdown the media foundation the decoder is using.
Also, it saves time to call MFStartup
if the media foundation is already started.
[1] https://docs.microsoft.com/en-us/windows/win32/api/mfapi/nf-mfapi-mfshutdown
[2] https://searchfox.org/mozilla-central/rev/eeeba8183d3268e0d563c2becf9f4adc21a37368/dom/media/ipc/RDDParent.cpp#111,303,315
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/65d5050fe312 no longer start or shutdown MediaFoundation explictly, and ensure the media foundation's life cycle long enough. r=bryce
Comment 3•2 years ago
|
||
bugherder |
Description
•