We may run into similar issues as bug 1927020 since the `mShutdownBlocker` in both decoder and encoder hold strong references to themselves: https://searchfox.org/mozilla-central/rev/81ac0fe96e1bd6020408c2ae7eae6e5b5114d1db/dom/media/webcodecs/DecoderTemplate.cpp#861 https://searchfox.org/mozilla-central/rev/2deb9bcf801f9de83d4f30c890d442072b9b6595/dom/media/webcodecs/EncoderTemplate.cpp#1109 It's better to use similar techniques as [`ShutdownWatcher`](https://searchfox.org/mozilla-central/rev/2deb9bcf801f9de83d4f30c890d442072b9b6595/dom/media/systemservices/MediaUtils.h#238) introduced in bug 1927020 to replace the `UniquePtr<media::ShutdownBlockingTicket> mShutdownBlocker` in `DecoderTemplate` and `EncoderTemplate`. However, the replacement will require [adding a nsIAsyncShutdownBlocker on main thread](https://searchfox.org/mozilla-central/rev/2deb9bcf801f9de83d4f30c890d442072b9b6595/dom/media/webcodecs/DecoderTemplate.h#242-253) into the `ShutdownWatcher` or its equivalent, so that `RemoteMediaDataDecoder` can be safely used under the hood.
Bug 1932526 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
We may run into similar issues as bug 1927020 since the `mShutdownBlocker` in both decoder and encoder hold strong references to themselves: https://searchfox.org/mozilla-central/rev/81ac0fe96e1bd6020408c2ae7eae6e5b5114d1db/dom/media/webcodecs/DecoderTemplate.cpp#861 https://searchfox.org/mozilla-central/rev/2deb9bcf801f9de83d4f30c890d442072b9b6595/dom/media/webcodecs/EncoderTemplate.cpp#1109 It's better to use similar techniques as [`ShutdownWatcher`](https://searchfox.org/mozilla-central/rev/2deb9bcf801f9de83d4f30c890d442072b9b6595/dom/media/systemservices/MediaUtils.h#238) / [`ShutdownConsumer`](https://searchfox.org/mozilla-central/rev/75de397838825ba741820fec27225342ba15fd5b/dom/media/systemservices/MediaUtils.h#225) pair introduced in bug 1927020 to replace the `UniquePtr<media::ShutdownBlockingTicket> mShutdownBlocker` in `DecoderTemplate` and `EncoderTemplate`. However, the replacement will require [adding a nsIAsyncShutdownBlocker on main thread](https://searchfox.org/mozilla-central/rev/2deb9bcf801f9de83d4f30c890d442072b9b6595/dom/media/webcodecs/DecoderTemplate.h#242-253) for decoders, so that `RemoteMediaDataDecoder` can be safely used under the hood.