Closed Bug 1230004 Opened 9 years ago Closed 9 years ago

Remove MediaDecoderStateMachine::mDecoder

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox44 --- wontfix
firefox45 --- fixed

People

(Reporter: jwwang, Unassigned)

References

Details

Attachments

(4 files)

This will eliminate the circular reference between MediaDecoder and MDSM, and therefore reducing the bi-directional dependency.
Bug 1230004. Part 1 - cache data in MDSM so it won't need to ask MediaDecoder.
Attachment #8695079 - Flags: review?(cpearce)
Bug 1230004. Part 2 - have MDSM::BeginShutdown return a promise and remove MDSM::mDecoder.
Attachment #8695080 - Flags: review?(cpearce)
Comment on attachment 8695079 [details]
MozReview Request: Bug 1230004. Part 1 - cache data in MDSM so it won't need to ask MediaDecoder.

https://reviewboard.mozilla.org/r/26995/#review24391

::: dom/media/MediaDecoderStateMachine.cpp:400
(Diff revision 1)
> -                  mDecoder->GetFrameStatistics(),
> +                  *mFrameStats,

I feel like a GetFrameStatistics() accessor would be nice here. Rather than needing to deref mFrameStats. Up to you though.
Attachment #8695079 - Flags: review?(cpearce) → review+
Comment on attachment 8695080 [details]
MozReview Request: Bug 1230004. Part 2 - have MDSM::BeginShutdown return a promise and remove MDSM::mDecoder.

https://reviewboard.mozilla.org/r/26997/#review24397

::: dom/media/MediaDecoderStateMachine.cpp:2166
(Diff revision 1)
> -{
> +MediaDecoderStateMachine::BeginShutdown()

Do we need separate MediaDecoderStateMachine::Shutdown() and MediaDecoderStateMachine::BeginShutdown() methods? It's confusing having two things with similar names.

Can we move the mStreamSink->BeginShutdown() call into MediaDecoderStateMachine::Shutdown(), and just have the caller of MediaDecoderStateMachine::BeginShutdown() just InvokeAsync MediaDecoderStateMachine::Shutdown() instead?

::: dom/media/MediaDecoderStateMachine.cpp:2214
(Diff revision 1)
>    // We must daisy-chain these events to destroy the decoder. We must

This comment is now out of date. It probably can just be removed.

The whole daisy-chain thing here always bugged me. Glad to be rid of the last vestiges of it. :)
Attachment #8695080 - Flags: review?(cpearce) → review+
https://reviewboard.mozilla.org/r/26997/#review24397

> Do we need separate MediaDecoderStateMachine::Shutdown() and MediaDecoderStateMachine::BeginShutdown() methods? It's confusing having two things with similar names.
> 
> Can we move the mStreamSink->BeginShutdown() call into MediaDecoderStateMachine::Shutdown(), and just have the caller of MediaDecoderStateMachine::BeginShutdown() just InvokeAsync MediaDecoderStateMachine::Shutdown() instead?

It is unfortunate DecodedStream::BeginShutdown() must be called on the main thread. I have a todo item to remove it.
Thanks for the review!
https://hg.mozilla.org/mozilla-central/rev/5836cdd7d259
https://hg.mozilla.org/mozilla-central/rev/c0be6f556504
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Blocks: 1207220
This is a rework for beta. It only includes the changes related to having MDSM::Shutdown uses ShutdownPromise. Unfortunately the patch contained also the removal of mDecoder as using ShutdownPromise was the last straw in cleaning up the MDSM.

I'm confident the rebase is good, but another set of eyes would be good. This is required to uplift 1207220 which is a top-crasher
Attachment #8703999 - Flags: feedback?(jwwang)
Attachment #8703998 - Attachment description: . Part 1 - cache data in MDSM so it won't need to ask MediaDecoder. → Part 1 - cache data in MDSM so it won't need to ask MediaDecoder.
Attachment #8703999 - Flags: feedback?(jwwang) → feedback+
Comment on attachment 8703998 [details] [diff] [review]
Part 1 - cache data in MDSM so it won't need to ask MediaDecoder.

Approval is for both patches.

Approval Request Comment
[Feature/regressing bug #]: 1230004
[User impact if declined]: Can uplift bug 1207220 that depends on this patch to be applied. bug 1207220 is the proper fix for 1217135 (top crasher)
[Describe test coverage new/current, TreeHerder]: In aurora/central for a while
[Risks and why]: Minimal, code is well tested and fundamentally only allows us to track when an operation has ended, which will be used in bug 1207229. Three set of eyes on patch.
[String/UUID change made/needed]: None
Attachment #8703998 - Flags: approval-mozilla-beta?
Jean-Yves, is the patch from bug 1207220 sufficient to fix the top crasher bug 1217315? If yes, I am not inclined to take this bug's patch.
Flags: needinfo?(jyavenard)
(In reply to Ritu Kothari (:ritu) from comment #13)
> Jean-Yves, is the patch from bug 1207220 sufficient to fix the top crasher
> bug 1217315? If yes, I am not inclined to take this bug's patch.

no...

fix from bug 1207220 can't work without this patch being included (and it won't apply either).
The scope of the rebase is much smaller than the original ticket. It was edited to narrow the scope.
Flags: needinfo?(jyavenard)
Comment on attachment 8703998 [details] [diff] [review]
Part 1 - cache data in MDSM so it won't need to ask MediaDecoder.

Both Milan and I feel that while these fixes are needed, the timing of these changes is worrisome. Let these ride with Aurora45 -> Beta45. Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1207220#c34 and comment 35 for more info.
Attachment #8703998 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: