Closed
Bug 1128411
Opened 10 years ago
Closed 10 years ago
Refactor MediaDecoderStateMachine::SendStreamData()
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: jwwang, Assigned: jwwang)
References
Details
Attachments
(2 files)
13.47 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
8.46 KB,
patch
|
roc
:
review+
lmandel
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 1•10 years ago
|
||
Following bug 1127171, this is the 2nd step to refactor the stream-capture code in MediaDecoderStateMachine.
Assignee | ||
Comment 2•10 years ago
|
||
Assignee | ||
Comment 3•10 years ago
|
||
Part 1 - fix some bugs in MediaDecoderStateMachine::SendStreamData().
Assignee | ||
Comment 4•10 years ago
|
||
Comment on attachment 8557897 [details] [diff] [review]
1128411_part1_fix_some_bugs-v1.patch
Review of attachment 8557897 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/media/MediaDecoderStateMachine.cpp
@@ -337,2 @@
> AudioSegment silence;
> - silence.InsertNullDataAtStart(frameOffset.value() - audioWrittenOffset.value());
Stream time is required instead of frame count.
@@ -347,5 @@
> - // We're starting in the middle of a packet. Split the packet.
> - offset = audioWrittenOffset.value() - frameOffset.value();
> - } else {
> - // Write the entire packet.
> - offset = 0;
This doesn't handle overlap in adjacent frames.
@@ +415,5 @@
> AudioSegment* audio = new AudioSegment();
> mediaStream->AddAudioTrack(kAudioTrack, mInfo.mAudio.mRate, 0, audio);
> stream->mStream->DispatchWhenNotEnoughBuffered(kAudioTrack,
> GetStateMachineThread(), GetWakeDecoderRunnable());
> + stream->mNextAudioTime = mStartTime + stream->mInitialTime;
mNext{Audio,Video}Time needs to take mStartTime into account.
Attachment #8557897 -
Flags: review?(roc)
Assignee | ||
Comment 5•10 years ago
|
||
Part 2 - call SendStreamData() in AdvanceFrame() only to simplify the code of SendStreamData().
Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8557899 [details] [diff] [review]
1128411_part2_call_SendStreamData_in_AdvanceFrame_only-v1.patch
Review of attachment 8557899 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/media/MediaDecoderStateMachine.cpp
@@ +379,5 @@
> }
>
> void MediaDecoderStateMachine::SendStreamData()
> {
> + MOZ_ASSERT(OnStateMachineThread(), "Should be on state machine thread");
This function is now called in AdvanceFrame() which is called in the state machine thread.
@@ +384,2 @@
> AssertCurrentThreadInMonitor();
> + MOZ_ASSERT(!mAudioSink, "Should've been stopped in CallRunStateMachine()");
StopAudioThread() won't return until audio thread is shut down. We can assert mAudioSink is null here.
@@ -387,3 @@
>
> DecodedStreamData* stream = mDecoder->GetDecodedStream();
> - if (!stream) {
We can get rid of these checks for this function is called in AdvanceFrame() only when mAudioCaptured is true.
@@ -572,5 @@
> - // audio/video samples are received, we need to keep decoding to ensure
> - // the stream is initialized.
> - if (stream && !stream->mStreamInitialized) {
> - return false;
> - }
We can get rid of this workaround since AdvanceFrame() will call SendStreamData() to initialize the stream even if the 1st sample is large enough to stop decoding.
@@ -596,5 @@
> DecodedStreamData* stream = mDecoder->GetDecodedStream();
>
> - if (stream && !stream->mStreamInitialized) {
> - return false;
> - }
Ditto.
Attachment #8557899 -
Flags: review?(roc)
Assignee | ||
Comment 7•10 years ago
|
||
Try is green: https://tbpl.mozilla.org/?tree=Try&rev=77c8f23cfee2
The oranges in B2G ICS Emulator Debug is not about capture stream.
Attachment #8557897 -
Flags: review?(roc) → review+
Attachment #8557899 -
Flags: review?(roc) → review+
Assignee | ||
Comment 8•10 years ago
|
||
Hi Ryan,
It looks like the inbound tree was closed and caused some error in my push. Only part 2 get into the tree without part 1. Can you back out the patch? Thanks.
https://hg.mozilla.org/integration/mozilla-inbound/rev/d28c88e9705d
Flags: needinfo?(ryanvm)
Comment 9•10 years ago
|
||
Flags: needinfo?(ryanvm)
Comment 10•10 years ago
|
||
Assignee | ||
Comment 11•10 years ago
|
||
I see. Thanks.
Assignee | ||
Comment 12•10 years ago
|
||
Comment 13•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/123ecd63f082
https://hg.mozilla.org/mozilla-central/rev/975698b131d8
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment 14•10 years ago
|
||
JW Wang, any idea why this causes orange with a media recorder test on aurora? I'd like to uplift this as a blocking dependency. Applied to aurora this causes a crash on try debug builds with dom/media/test/test_bug1113600.html. I can't reproduce the crash locally, but do get a leak report.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=030a49f0899e
Flags: needinfo?(jwwang)
Assignee | ||
Comment 15•10 years ago
|
||
Since this bug depends on bug 1127171, maybe you also need to uplift bug 1127171. Any particular reason to uplift this bug which is not about MSE to Aurora?
Flags: needinfo?(jwwang)
Comment 16•10 years ago
|
||
Thanks. I'll give bug 1127171 a try.
> Any particular reason to uplift this bug which is not about MSE to Aurora?
This touches the same code as later MSE patches, so if it looks like a backport won't cause problems I like to nominate patches like this as well. Significantly reduces the work to backport further changes, and reduces code variance between the branches which helps with testing.
Do you anticipate any issues from uplifting this?
Comment 17•10 years ago
|
||
Comment on attachment 8557899 [details] [diff] [review]
1128411_part2_call_SendStreamData_in_AdvanceFrame_only-v1.patch
Requesting 37 uplift of both patches as a dependency for later MSE fixes.
Approval Request Comment
[Feature/regressing bug #]: MSE
[User impact if declined]: Less consistent testing, harder to backport MSE changes.
[Describe test coverage new/current, TreeHerder]: Landed on m-c.
[Risks and why]: This affects general media playback, but has had a week to settle on nightly. Risk looks low.
[String/UUID change made/needed]: None.
Attachment #8557899 -
Flags: approval-mozilla-aurora?
Updated•10 years ago
|
status-firefox37:
--- → affected
status-firefox38:
--- → fixed
Comment 18•10 years ago
|
||
Comment on attachment 8557899 [details] [diff] [review]
1128411_part2_call_SendStreamData_in_AdvanceFrame_only-v1.patch
Taking this MSE related refactoring, which has already been on m-c for a couple of weeks. Aurora+
Attachment #8557899 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 19•10 years ago
|
||
Assignee | ||
Comment 20•10 years ago
|
||
(In reply to Ralph Giles (:rillian) from comment #16)
> This touches the same code as later MSE patches, so if it looks like a
> backport won't cause problems I like to nominate patches like this as well.
> Significantly reduces the work to backport further changes, and reduces code
> variance between the branches which helps with testing.
I see the reason. Thanks for the explanation.
> Do you anticipate any issues from uplifting this?
Since it works fine on Central, I think Aurora should also be fine.
You need to log in
before you can comment on or make changes to this bug.
Description
•