Closed
Bug 1274626
Opened 8 years ago
Closed 8 years ago
video fasts forwards when it was sitting in a background tab
Categories
(Core :: Audio/Video: Playback, defect, P3)
Core
Audio/Video: Playback
Tracking
()
VERIFIED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox47 | --- | unaffected |
firefox48 | --- | unaffected |
firefox49 | --- | disabled |
firefox50 | --- | wontfix |
firefox51 | --- | verified |
People
(Reporter: Felipe, Assigned: kaku)
References
(Blocks 1 open bug)
Details
(Keywords: regression)
Attachments
(8 files, 1 obsolete file)
(deleted),
video/quicktime
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
text/x-review-board-request
|
ehsan.akhgari
:
review+
jwwang
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
jya
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
jya
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
jya
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
jwwang
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
jya
:
review+
|
Details |
STR:
- Open a page with an animated GIF
- open a second tab and switch to it
- wait a few seconds, move back to the tab with the animated GIF
Result:
the GIF will be played sped up for a while, related to the amount of time it remained in the background
Expected:
GIF will resume playing smoothly
This appears to be a new regression as of 1 or max 2 weeks ago
Comment 1•8 years ago
|
||
Hmm, not sure that I can reproduce this. I tried nightly and http://imgur.com/gallery/uGsjT in a background tab. Can you give some more details for how to see this bug?
Reporter | ||
Comment 2•8 years ago
|
||
It's not clear to me if it happens on every gif, but you do need one with a lot of motion to be able to see it. See a recorded screencast that I got using this link: https://www.reddit.com/r/sports/comments/4k86aw/how_to_keep_a_runner_from_going_1st_to_3rd/
Comment 3•8 years ago
|
||
I can see the problem with that link, thanks! I'll look into it. Thanks for filing.
Comment 4•8 years ago
|
||
regression-window |
The gif is actually a video which explains the following:
Regression range:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=13e4cb81d4eb1c4996daf34c68301ca8a8ab0183&tochange=2fe467985f04512869ca7daa1a2db286642ce127
-> bug 1224973
Blocks: 1224973
Component: ImageLib → Audio/Video: Playback
Flags: needinfo?(dglastonbury)
Keywords: regressionwindow-wanted → regression
Summary: Animated GIF fasts forwards when it was sitting in a background tab → looping video fasts forwards when it was sitting in a background tab
Updated•8 years ago
|
Version: 47 Branch → 49 Branch
Yes, we a suspending video decoders in background tabs to save on power usage. I'll take it.
Assignee: nobody → dglastonbury
Flags: needinfo?(dglastonbury)
Updated•8 years ago
|
Priority: -- → P1
Comment 6•8 years ago
|
||
[Tracking Requested - why for this release]: Regression
This feature is enabled for nightly only at this point.
status-firefox50:
--- → affected
Updated•8 years ago
|
Priority: P1 → P2
Mass change P2 -> P3
Priority: P2 → P3
Assignee | ||
Comment 10•8 years ago
|
||
* How to reproduce:
So, the issue only happens to videos without audio channel and are set to be looping. And the effect could be reproduced by playing a video, switch it to background, wait for a moment until the video has reached the end and been restarted from the beginning again, then switch back to the foreground.
Assignee | ||
Comment 11•8 years ago
|
||
* The root cause:
(1) For videos without audio channel, the playback is driven by the system clock and the system clock keeps going when the videos are switched to the background.
(2) The media time is stopped when the video is switched to the background because no video frames are drawn from VideoSink, so the media time is not updated.
(3) However, while switching back to foreground, we initiate a VideoOnlyAccurateSeek (or DecodeRecoverySeek) and set the target to the media time which was stopped.
So, after the seek is resolved, the newly decoded video frames' time are much smaller than the system clock which prohibits the VideoSink to do scheduling but just keeps drawing the incoming video frames till the end of the video.
Assignee | ||
Comment 12•8 years ago
|
||
I have two proposals:
* Proposal 1:
While switching back to the foreground, use the system clock to calculate the right target (by mod duration). Stop the palyback for a while, invoke VideoOnlySeekOperation to the right target. Once the seek is resolved, start decoding and restart the playback.
This could be a quick work around, however, there are two problems:
(1) The MDSM must know weather the video is set to be looping.
(2) Should we fire the ended event? and when? also the time-updated event.
Assignee | ||
Comment 13•8 years ago
|
||
* Proposal 2:
In Bug 1224973, we stopped requesting video data when a video is switched to the background. Instead, I think we should still requesting video frames from the reader but let the reader know that do demuxing only (not decoding) and return NULL data. The MDSM still pushes the returned NULL data into video queue and the VideoSink keeps the playback without drawing the NULL data.
Assignee | ||
Comment 14•8 years ago
|
||
Personally, I think proposal 2 is better than 1 because it doesn't change data flow and keeps all the behaviors of MDSM, MediaDecoder and HTMLMediaElement. VideoSink is slightly modified to prevent drawing NULL data but it keeps all its playback behavior. MediaFormatReader is the where we will modify most, however the NULL data concept is already implemented in Bug 1257107 of which we might take advantage.
Dan, WDYT? I think if we take proposal 2, it should also solve the "sending ended event" problem you faced while writing mochitests.
Flags: needinfo?(dglastonbury)
Updated•8 years ago
|
Comment 15•8 years ago
|
||
Why all the mess about looping? It happens with any video, e.g. attachment 8754969 [details].
I thought everybody already knew this.
Summary: looping video fasts forwards when it was sitting in a background tab → video fasts forwards when it was sitting in a background tab
Assignee | ||
Comment 16•8 years ago
|
||
(In reply to arni2033 from comment #15)
> Why all the mess about looping? It happens with any video, e.g. attachment
> 8754969 [details].
> I thought everybody already knew this.
Yes, you are right, my fault. I was so focused on figuring out how to handle the looping cases so got confused and so did I write the wrong comment. Thanks for your reminding, this phenomenon is nothing about looping.
Assignee | ||
Comment 17•8 years ago
|
||
(In reply to Tzuhao Kuo [:kaku] (PTO 6/30 ~ 7/3) from comment #16)
> Thanks for your reminding, this phenomenon is nothing about looping.
But the solution needs to consider looping cases!
Updated•8 years ago
|
status-firefox47:
--- → unaffected
Version: 50 Branch → Trunk
Comment 18•8 years ago
|
||
(In reply to Tzuhao Kuo [:kaku] (PTO 6/30 ~ 7/3) from comment #14)
> Dan, WDYT? I think if we take proposal 2, it should also solve the "sending
> ended event" problem you faced while writing mochitests.
I didn't some thinking and prototyping of a solution for decoder shutdown. At the moment, we don't decode video and that saves CPU time but we don't free the decoder, so don't get saving on memory and freeing of, potential, H/W decoders.
The prototype was very similar to Proposal 2. Instead of returning null frames, I tricked the MFR into releasing the video decoder it held and replaced it with the blank decoder.
So, I think we should pursue Proposal 2.
Flags: needinfo?(dglastonbury)
Assignee | ||
Comment 19•8 years ago
|
||
(In reply to Dan Glastonbury :kamidphish from comment #18)
> (In reply to Tzuhao Kuo [:kaku] (PTO 6/30 ~ 7/3) from comment #14)
> > Dan, WDYT? I think if we take proposal 2, it should also solve the "sending
> > ended event" problem you faced while writing mochitests.
>
> I didn't some thinking and prototyping of a solution for decoder shutdown.
^^^^^^^^^^^^^^^
Do you mean "I did have"?
> The prototype was very similar to Proposal 2. Instead of returning null
> frames, I tricked the MFR into releasing the video decoder it held and
> replaced it with the blank decoder.
I have discussed with JW and he think switching the video decode is a good idea, I think I could go on this way. Did you face any problems while prototyping?
Flags: needinfo?(dglastonbury)
Comment 20•8 years ago
|
||
(In reply to Tzuhao Kuo [:kaku] (PTO 6/30 ~ 7/3) from comment #19)
> (In reply to Dan Glastonbury :kamidphish from comment #18)
> > I didn't some thinking and prototyping of a solution for decoder shutdown.
> ^^^^^^^^^^^^^^^
> Do you mean "I did have"?
Yes, I meant to write "I did some thinking...". Sorry.
> I have discussed with JW and he think switching the video decode is a good
> idea, I think I could go on this way. Did you face any problems while
> prototyping?
The problem we face is resuming the decode without seeing a black (null decoder) or green (blank decoder) frame on resume.
Otherwise, I hacked the MFR, it's inelegant and not the way to do it, but it was enough for testing. I'll forward you the patches.
Flags: needinfo?(dglastonbury) → needinfo?(kaku)
Comment 21•8 years ago
|
||
Kaku, This is the hack that I made to switch to blank decoder. It's messy. The Seek() to next keyframe (In VisibilityChanged()) is not strictly necessary. I was attempting to speed up the recovery.
We should speak with :jya on the best way to get decoder switching into MFR.
Assignee | ||
Comment 22•8 years ago
|
||
(In reply to Dan Glastonbury :kamidphish from comment #21)
> Created attachment 8770338 [details] [diff] [review]
> blank-decoder-hack.patch
>
> Kaku, This is the hack that I made to switch to blank decoder. It's messy.
> The Seek() to next keyframe (In VisibilityChanged()) is not strictly
> necessary. I was attempting to speed up the recovery.
>
> We should speak with :jya on the best way to get decoder switching into MFR.
Thanks, Dan. I have a similar WIP implementation. I will upload it later and ask for :jya's comment.
Flags: needinfo?(kaku)
Assignee | ||
Comment 23•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/64266/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/64266/
Attachment #8770989 -
Flags: review?(kaku)
Attachment #8770990 -
Flags: review?(kaku)
Assignee | ||
Comment 24•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/64268/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/64268/
Assignee | ||
Comment 25•8 years ago
|
||
(In reply to Tzuhao Kuo [:kaku] (PTO 6/30 ~ 7/3) from comment #24)
> Created attachment 8770990 [details]
> Bug 1274626 part 2 - [WIP] - switch the video decoder to blank decoder
> dynamically;
>
> Review commit: https://reviewboard.mozilla.org/r/64268/diff/#index_header
> See other reviews: https://reviewboard.mozilla.org/r/64268/
@jya,
Dan and I are now working on another version of suspending video decoding for non-visible video elements. Instead of stop requesting video data at the MDSM side (the implementation of bug 1224973), we would like to keep requesting video data but dynamically switch the video decoder to blank decoder. By this way, we make sure the playback logic is not affected so that the playback events are still filed as usual.
This review request is a WIP patch and I would like to seek your feedback, especially on the "switching decoder part". Please have a look on this patch when you have time, thanks!
Flags: needinfo?(jyavenard)
Comment 26•8 years ago
|
||
(In reply to Tzuhao Kuo [:kaku] (PTO 6/30 ~ 7/3) from comment #25)
> (In reply to Tzuhao Kuo [:kaku] (PTO 6/30 ~ 7/3) from comment #24)
> > Created attachment 8770990 [details]
> > Bug 1274626 part 2 - [WIP] - switch the video decoder to blank decoder
> > dynamically;
> >
> > Review commit: https://reviewboard.mozilla.org/r/64268/diff/#index_header
> > See other reviews: https://reviewboard.mozilla.org/r/64268/
>
> @jya,
>
> Dan and I are now working on another version of suspending video decoding
> for non-visible video elements. Instead of stop requesting video data at the
> MDSM side (the implementation of bug 1224973), we would like to keep
> requesting video data but dynamically switch the video decoder to blank
> decoder. By this way, we make sure the playback logic is not affected so
> that the playback events are still filed as usual.
>
> This review request is a WIP patch and I would like to seek your feedback,
> especially on the "switching decoder part". Please have a look on this patch
> when you have time, thanks!
I'm not entirely convinced it's going to be an easier approach.
Because as far as the MediaFormatReader is concerned you're only going to add complexity over the existing code:
You'll still need to seek in the video when resuming, recreate a decoder and handle catching up with the new video position.
That means that the MDSM will have to deal with going backward in the decoding and handling of the now unnecessary future frames (as the MDSM is always about 10 video frames ahead of currentTime, those frames must be removed and redecoded with the real decoder)
Flags: needinfo?(jyavenard)
Assignee | ||
Comment 27•8 years ago
|
||
(In reply to Jean-Yves Avenard [:jya] from comment #26)
> I'm not entirely convinced it's going to be an easier approach.
> Because as far as the MediaFormatReader is concerned you're only going to
> add complexity over the existing code:
Agree with that it adds complexity, however, I think it is a smoother approach.
Previously, we stopped requesting video data from the MDSM side which causes problems: (1) "timeupdate" event might not be filed, (2) "ended" event is never be filed and (3) the side effect of this bug.
The (1) happens with video files without audio track or video files whos video track is shorter than audio track. In these cases, the playback is driven by the system clock which never stops, however, the MDSM stops receiving video data from reader, it also stops filing "timeupdate" event because MDSM thinks that playback position is not possible to be where audio and video data haven't be decoded.
The (2) happens with all video files. Since the MDSM stops requesting video data, the VideoQueue then never ends and the MDSM never files the "ended" event. Dan had a proposal to use "duration" to trigger "ended" event, but duration is not reliable which might changes while more video data is decoded, so JW didn't approve it.
For (3), please refer to comment 11, comment 12 and comment 13.
All (1), (2) and (3) will be solved together if we keep the video data flow (with only demuxing not real decoding) and that's why I think we should pursue the approach of switching decoder.
@Dan, please correct me if any of the above description is wrong.
> You'll still need to seek in the video when resuming, recreate a decoder and
> handle catching up with the new video position.
Even thought we do not change decoder, we still need to invoke a seek while resuming to catch up the audio's position. So, the extra effort is only recreating video decoder.
> That means that the MDSM will have to deal with going backward in the
> decoding and handling of the now unnecessary future frames (as the MDSM is
> always about 10 video frames ahead of currentTime, those frames must be
> removed and redecoded with the real decoder)
The 10 video frames will be removed before the seek operation which resets the VideoQueue and they will be re-decoded because we seek to the currentTime which is in front of the 10 video frames.
Flags: needinfo?(dglastonbury)
Assignee | ||
Comment 28•8 years ago
|
||
@jya, does comment 27 make this approach more convincing?
Flags: needinfo?(jyavenard)
Comment 29•8 years ago
|
||
if you think it will be easier that way.. then sure...
Flags: needinfo?(jyavenard)
Assignee | ||
Comment 30•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/65544/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/65544/
Attachment #8770989 -
Attachment description: Bug 1274626 part 1 - [WIP] - add a method to HTMLMediaElement for debugger; → Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change;
Attachment #8770990 -
Attachment description: Bug 1274626 part 2 - [WIP] - switch the video decoder to blank decoder dynamically; → Bug 1274626 part 2 - implement NullDecodeModule;
Attachment #8772807 -
Flags: review?(jyavenard)
Attachment #8772808 -
Flags: review?(jyavenard)
Attachment #8772809 -
Flags: review?(jwwang)
Attachment #8770989 -
Flags: review?(kaku) → review?(jwwang)
Attachment #8770990 -
Flags: review?(kaku) → review?(jyavenard)
Assignee | ||
Comment 31•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/65546/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/65546/
Assignee | ||
Comment 32•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/65548/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/65548/
Assignee | ||
Comment 33•8 years ago
|
||
Comment on attachment 8770989 [details]
Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64266/diff/1-2/
Assignee | ||
Comment 34•8 years ago
|
||
Comment on attachment 8770990 [details]
Bug 1274626 part 2 - make the blank video data creator return a white image;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64268/diff/1-2/
Assignee | ||
Comment 35•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/1-2/
Assignee | ||
Comment 36•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/1-2/
Comment 37•8 years ago
|
||
Comment on attachment 8770989 [details]
Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change;
https://reviewboard.mozilla.org/r/64266/#review62760
::: dom/html/HTMLMediaElement.h:607
(Diff revision 2)
> // data. Used for debugging purposes.
> void GetMozDebugReaderData(nsAString& aString);
>
> void MozDumpDebugInfo();
>
> + void SetVisible(bool aVisible);
Let's call it MozSetVisibility and comment that this function is to simulate visibility changes to help debug and write tests about suspend-video-decoding.
::: dom/webidl/HTMLMediaElement.webidl:218
(Diff revision 2)
> partial interface HTMLMediaElement {
> [Throws, Pref="media.seekToNextFrame.enabled"]
> Promise<void> seekToNextFrame();
> };
> +
> +partial interface HTMLMediaElement {
We need a DOM peer to review this. Please also hide this function behind a pref so it is never exposed to the public.
Attachment #8770989 -
Flags: review?(jwwang)
Comment 38•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
https://reviewboard.mozilla.org/r/65548/#review62762
Attachment #8772809 -
Flags: review?(jwwang) → review+
Comment 39•8 years ago
|
||
Comment on attachment 8770990 [details]
Bug 1274626 part 2 - make the blank video data creator return a white image;
https://reviewboard.mozilla.org/r/64268/#review63426
<p>I don't see the point of creating a NullDecodeModule (why not just reuse blankdecodermodule instead, at least it contains properly allocated data and is less likely to introduce regression)</p>
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:264
(Diff revision 2)
> + aDTS.ToMicroseconds(),
> + aDuration.ToMicroseconds(),
> + VideoData::YCbCrBuffer(),
> + true,
> + aDTS.ToMicroseconds(),
> + gfx::IntRect());
you'll want to use mInfo.ImageRect()
as otherwise the HTMLMediaElement will consider the video frame as being invalid.
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:270
(Diff revision 2)
> + }
> +private:
> + VideoInfo mInfo;
> +};
> +
> +class NullAudioDataCreator {
When would you ever use a NullAudioDataDecoder?
Any particular reason you're just not using the BlankDecoderModule instead?
seems all this is unecessary complication.
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:285
(Diff revision 2)
> + {
> + // Convert duration to frames. We add 1 to duration to account for
> + // rounding errors, so we get a consistent tone.
> + CheckedInt64 frames =
> + UsecsToFrames(aDuration.ToMicroseconds()+1, mSampleRate);
> + if (!frames.isValid() ||
please put that into two lines instead
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:287
(Diff revision 2)
> + // rounding errors, so we get a consistent tone.
> + CheckedInt64 frames =
> + UsecsToFrames(aDuration.ToMicroseconds()+1, mSampleRate);
> + if (!frames.isValid() ||
> + !mChannelCount ||
> + !mSampleRate ||
There's no point testing the number of channel cound or sampling rate. Those are the original metadata values. The decoder is only ever created if those are valid
Attachment #8770990 -
Flags: review?(jyavenard) → review-
Comment 40•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
https://reviewboard.mozilla.org/r/65544/#review63424
This API is too complicated.
Simply have a method to create an empty video decoder. Not having to set the platformdecoder module to null.Plus, this seems to configure the PDMFactory to create a null decoder module. Why? it can always be created when the PDMFactory is initialised the first time.
So the use would now simply become: CreateDecoder with a parameter to always return a blank
::: dom/media/platforms/PDMFactory.h:47
(Diff revision 1)
> // that we use on on aTaskQueue to decode the decrypted stream.
> // This is called on the decode task queue.
> void SetCDMProxy(CDMProxy* aProxy);
> #endif
>
> + void SetNullDecode();
this is unecessary.
Can always create the blank PDM in InitPDM() and store it separately like you've done here
::: dom/media/platforms/PDMFactory.cpp:53
(Diff revision 1)
>
> namespace mozilla {
>
> extern already_AddRefed<PlatformDecoderModule> CreateAgnosticDecoderModule();
> extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule();
> +extern already_AddRefed<PlatformDecoderModule> CreateNullDecoderModule();
I don't think we need this NullDecoder, the Blank one is better provided it returns valid frames.
::: dom/media/platforms/PlatformDecoderModule.h:39
(Diff revision 1)
> static LazyLogModule sPDMLog("PlatformDecoderModule");
>
> +enum class UseNullDecoder {
> + USE_NULL_DECODER,
> + NOT_USE_NULL_DECODER
> +};
this is to complicated, and I don't see the advantage of an enum.
Please use a bool
Attachment #8772807 -
Flags: review?(jyavenard) → review-
Comment 41•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
https://reviewboard.mozilla.org/r/65546/#review63428
::: dom/media/MediaFormatReader.cpp:409
(Diff revision 2)
> return false;
> #endif
> }
> }
>
> + if (decoder.mIsNullDecode) {
don't need this. Just call a new PDMFactory::CreateBlankVideoDecoder()
::: dom/media/MediaFormatReader.cpp:727
(Diff revision 2)
> LOG("MediaFormatReader called DrainComplete() before flushing, ignoring.");
> return;
> }
> decoder.mDrainComplete = true;
> +
> + if (decoder.mIsNullDecode) {
why do so only when draining and only for the null decoder?
::: dom/media/MediaFormatReader.cpp:2066
(Diff revision 2)
> + decoder.mIsNullDecode = aIsNullDecode;
> +
> + if (decoder.mIsNullDecode) {
> + decoder.mNeedDraining = true;
> + } else {
> + // We are now using the null decoder, close it directly.
shouldn't you finish the currently pending and already demuxed data, so that there's no discontinuity in the timestamp between the real decoded frames and the blank one?
Attachment #8772808 -
Flags: review?(jyavenard)
Assignee | ||
Comment 42•8 years ago
|
||
https://reviewboard.mozilla.org/r/64268/#review63426
Jw and I thought that NullDecodeModule could even make VideoSink not draw the VideoData, slightly more efficient. But, you're right, it might be more error-prone and I should just use BlankDecoderModule. BTW, is it okay to change the default color of blank video decoder? It's now green which is uncomfortable (to me).
Assignee | ||
Comment 43•8 years ago
|
||
https://reviewboard.mozilla.org/r/65544/#review63424
Sure, this is simpler, thanks.
> this is to complicated, and I don't see the advantage of an enum.
>
> Please use a bool
I tried to prevent using a primitive type since we are not able to overload the CreateDecoderParams::Set() method. But, yes, this is over-optimized and we could delay this to the time the situation occurs.
Assignee | ||
Comment 44•8 years ago
|
||
https://reviewboard.mozilla.org/r/65546/#review63428
> shouldn't you finish the currently pending and already demuxed data, so that there's no discontinuity in the timestamp between the real decoded frames and the blank one?
While switching from NullDecoder(or BlankDecoder) to normal decoder, a seek operations always follows, so the pending and already demuxed data will be removed. However, from your comments, I realized that while changing decoder, we should always drain and then shutdown the existing one so that we can create a new one, right?
Assignee | ||
Comment 45•8 years ago
|
||
Comment on attachment 8770989 [details]
Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64266/diff/2-3/
Attachment #8770990 -
Attachment description: Bug 1274626 part 2 - implement NullDecodeModule; → Bug 1274626 part 2 - make the video blank decoder return a white image;
Attachment #8772807 -
Attachment description: Bug 1274626 part 3 - export NullDecoderModule via PDMFactory; → Bug 1274626 part 3 - provide APIs to create blank decoders;
Attachment #8772808 -
Attachment description: Bug 1274626 part 4 - provide APIs to switch to null decoder dynamically; → Bug 1274626 part 4 - provide APIs to switch to blank decoders dynamically;
Attachment #8770989 -
Flags: review?(jwwang)
Attachment #8770989 -
Flags: review?(ehsan)
Attachment #8770990 -
Flags: review- → review?(jyavenard)
Attachment #8772807 -
Flags: review- → review?(jyavenard)
Attachment #8772808 -
Flags: review?(jyavenard)
Assignee | ||
Comment 46•8 years ago
|
||
Comment on attachment 8770990 [details]
Bug 1274626 part 2 - make the blank video data creator return a white image;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64268/diff/2-3/
Assignee | ||
Comment 47•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65544/diff/1-2/
Assignee | ||
Comment 48•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/2-3/
Assignee | ||
Comment 49•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/2-3/
Comment 50•8 years ago
|
||
Comment on attachment 8770990 [details]
Bug 1274626 part 2 - make the blank video data creator return a white image;
https://reviewboard.mozilla.org/r/64268/#review63842
please update the commit comment. it is no longer relevant
s/execpt/except
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:98
(Diff revision 3)
> {
> // Create a fake YUV buffer in a 420 format. That is, an 8bpp Y plane,
> // with a U and V plane that are half the size of the Y plane, i.e 8 bit,
> - // 2x2 subsampled. Have the data pointers of each frame point to the
> - // first plane, they'll always be zero'd memory anyway.
> - auto frame = MakeUnique<uint8_t[]>(mFrameWidth * mFrameHeight);
> + // 2x2 subsampled.
> + const int sizeY = mFrameWidth * mFrameHeight;
> + const int sizeCbCr = (mFrameWidth / 2) * (mFrameHeight / 2);
(mFrameWidth+1)/2 * ((mFrameHeight+1)/2
so proper allocation is done should the with or height be odd
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:119
(Diff revision 3)
> buffer.mPlanes[1].mWidth = mFrameWidth / 2;
> buffer.mPlanes[1].mOffset = 0;
> buffer.mPlanes[1].mSkip = 0;
>
> // Cr plane.
> - buffer.mPlanes[2].mData = frame.get();
> + buffer.mPlanes[2].mData = frame.get() + sizeY + sizeCbCr;
you could reduce the amount of memory used by 1/3 by making the 3rd plane point to the 2nd plane.
I understand that it hurts your eyes. But that's allocating significantly more memory just to get white I must say.
in which case you don't need the 3rd memset
Attachment #8770990 -
Flags: review?(jyavenard) → review+
Assignee | ||
Comment 51•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Hi JW,
According to :jya's comments, this patch is also modified, please have another look, please.
Attachment #8772809 -
Flags: review+ → review?(jwwang)
Comment 52•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
https://reviewboard.mozilla.org/r/65544/#review63856
::: dom/media/platforms/PDMFactory.cpp:105
(Diff revision 2)
> }
> }
> }
>
> already_AddRefed<MediaDataDecoder>
> PDMFactory::CreateDecoder(const CreateDecoderParams& aParams)
I would instead use a CreateBlankDecoder method.
Seems easier to me than messing with the CreateDecoderParam.
But I don't mind either way.
Attachment #8772807 -
Flags: review?(jyavenard) → review+
Comment 53•8 years ago
|
||
Comment on attachment 8770989 [details]
Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change;
https://reviewboard.mozilla.org/r/64266/#review63860
r+ with my comment below addressed. Thanks!
::: dom/webidl/HTMLMediaElement.webidl:224
(Diff revision 3)
> + * This is an API for simulating visibility changes to help debug and write
> + * tests about suspend-video-decoding.
> + */
> +partial interface HTMLMediaElement {
> + [Pref="media.test.setVisible"]
> + void mozSetVisible(boolean aVisible);
You shouldn't use moz prefixes any more. This is an unfortunate community culture baggage that we need to get rid of. See <https://wiki.mozilla.org/WebAPI/ExposureGuidelines#Guiding_Principles>. :-)
Please rename this to setVisible. The fact that this is behind a pref disabled by default is enough.
Attachment #8770989 -
Flags: review?(ehsan) → review+
Updated•8 years ago
|
Attachment #8772808 -
Flags: review?(jyavenard) → review-
Comment 54•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
https://reviewboard.mozilla.org/r/65546/#review63858
::: dom/media/MediaFormatReader.h:436
(Diff revision 3)
> RefPtr<SharedTrackInfo> mInfo;
> Maybe<media::TimeUnit> mFirstDemuxedSampleTime;
> +
> + // Use BlankDecoderModule or not.
> + bool mIsBlankDecode;
> + MozPromiseHolder<GenericPromise> mSwitchDecoderPromise;
Why do you need a separate promise to handle switching decoder?
Do we even care to know when the decoder has been switched over?
After all, this is called when the video element has been hidden, what is going to be returned to the MDSM by that time is irrelevant.
It could be a real decoded frame or a blank one it doesn't matter.
The MDSM can already start to ignore all returned frames from the time SetBlankDecoder is called, without needing to wait until the change is actually active.
::: dom/media/MediaFormatReader.cpp:725
(Diff revision 3)
> LOG("MediaFormatReader called DrainComplete() before flushing, ignoring.");
> return;
> }
> decoder.mDrainComplete = true;
> +
> + if (!decoder.mSwitchDecoderPromise.IsEmpty()) {
I don't believe we need to care about the current decoder having been drained or not.
At the time the MDSM calls SetVideoBlandDecode, the element is already hidden.
we can already totally ignore the returned framed.
There is no need to worry about the decoder being drained nor worry about the ability of the blank decoder to resume as it doesn't decode anything and can take whatever is being thrown at him.
The blank decoder will likely require some changes to make sure the timestamps are correct and in the proper order.
::: dom/media/MediaFormatReader.cpp:2061
(Diff revision 3)
> + return GenericPromise::CreateAndResolve(true, __func__);
> + }
> +
> + RefPtr<GenericPromise> p = decoder.mSwitchDecoderPromise.Ensure(__func__);
> + decoder.mIsBlankDecode = aIsBlankDecode;
> + decoder.mNeedDraining = true;
I don't think this helps in anyway.
There are big impact when you need to drain the decoder. It will automatically cause the video to perform an internal seek to resume to the point where it stopped, greatly confusing the demuxer too.
So you don't want to drain, and you don't want to wait for draining until you can delete the current decoder.
So long as the next frame returned by the blank decoder is located after the last returned frame.
You'll want to reset the Input/Output counter however so that decoding can proceed as is.
Updated•8 years ago
|
Attachment #8770989 -
Flags: review?(jwwang) → review+
Comment 55•8 years ago
|
||
Comment on attachment 8770989 [details]
Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change;
https://reviewboard.mozilla.org/r/64266/#review63872
::: modules/libpref/init/all.js:5467
(Diff revision 3)
> pref("media.seekToNextFrame.enabled", false);
> #else
> pref("media.seekToNextFrame.enabled", true);
> #endif
>
> +// Turn on/off the API for simulating visibility changes.
We don't need this entry. We only need to change the pref value to true during mochitests.
Comment 56•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
https://reviewboard.mozilla.org/r/65548/#review63878
::: dom/media/MediaDecoderStateMachine.cpp:1380
(Diff revision 3)
>
> - if (mIsReaderSuspended) {
> + // We should invoke the seek operation after the SetVideoBlankDecode() is
> + // done, otherwise the seek operation resets the reader, which also cancels
> + // the switching-decoder operation.
> + RefPtr<MediaDecoderStateMachine> self = this;
> + mSwitchDecoderRequest.Begin(mReader->SetVideoBlankDecode(false)
Can you explain how SetVideoBlankDecode() works and why do we wait for the promise before beginning InitiateDecodeRecoverySeek()?
Attachment #8772809 -
Flags: review?(jwwang)
Comment 57•8 years ago
|
||
Assigned to Kaku since he has so much fun here!
Assignee: dglastonbury → kaku
Assignee | ||
Comment 58•8 years ago
|
||
https://reviewboard.mozilla.org/r/65546/#review63858
> Why do you need a separate promise to handle switching decoder?
>
> Do we even care to know when the decoder has been switched over?
>
> After all, this is called when the video element has been hidden, what is going to be returned to the MDSM by that time is irrelevant.
> It could be a real decoded frame or a blank one it doesn't matter.
>
> The MDSM can already start to ignore all returned frames from the time SetBlankDecoder is called, without needing to wait until the change is actually active.
I use a promise to make sure that MDSM doesn't invoke a seek operation before the decoder has been switched since the seek operation resets the mNeedDraing flag. But now we are not going to drain the decoder before switching, we don't need this promise.
Assignee | ||
Comment 59•8 years ago
|
||
https://reviewboard.mozilla.org/r/65546/#review63858
> I don't think this helps in anyway.
>
> There are big impact when you need to drain the decoder. It will automatically cause the video to perform an internal seek to resume to the point where it stopped, greatly confusing the demuxer too.
>
> So you don't want to drain, and you don't want to wait for draining until you can delete the current decoder.
> So long as the next frame returned by the blank decoder is located after the last returned frame.
>
> You'll want to reset the Input/Output counter however so that decoding can proceed as is.
I understand that we don't need to drain the decoder now. But what's your idea to make the blank decoder catch up the original decoder? I come up with the idea that utilizes the decoder.mLastSampleTime (or decoder.mOutput.LastElement()->mTime) to modiify the first output of blank decoder. Does this match your idea?
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(jyavenard)
Comment 60•8 years ago
|
||
https://reviewboard.mozilla.org/r/65546/#review63858
> I use a promise to make sure that MDSM doesn't invoke a seek operation before the decoder has been switched since the seek operation resets the mNeedDraing flag. But now we are not going to drain the decoder before switching, we don't need this promise.
I would prefer a design where the reader should do seek internally when switching decoders without bothering MDSM. It is really a bad smell in the design whenever we add new features to the reader, MDSM has to change accordingly.
Comment 61•8 years ago
|
||
https://reviewboard.mozilla.org/r/65546/#review63858
> I understand that we don't need to drain the decoder now. But what's your idea to make the blank decoder catch up the original decoder? I come up with the idea that utilizes the decoder.mLastSampleTime (or decoder.mOutput.LastElement()->mTime) to modiify the first output of blank decoder. Does this match your idea?
yes, I think that should work...
I do believe you'll need to modify the blank decoder to output frames in the proper order. Right now it returns frames in decode order which is wrong.
Assignee | ||
Comment 62•8 years ago
|
||
https://reviewboard.mozilla.org/r/64268/#review63842
> you could reduce the amount of memory used by 1/3 by making the 3rd plane point to the 2nd plane.
>
> I understand that it hurts your eyes. But that's allocating significantly more memory just to get white I must say.
>
> in which case you don't need the 3rd memset
This is quite good, thanks!
Assignee | ||
Comment 63•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/67764/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/67764/
Attachment #8770990 -
Attachment description: Bug 1274626 part 2 - make the video blank decoder return a white image; → Bug 1274626 part 2 - make the blank video data creator return a white image;
Attachment #8772807 -
Attachment description: Bug 1274626 part 3 - provide APIs to create blank decoders; → Bug 1274626 part 5 - provide APIs to create blank decoders;
Attachment #8772808 -
Attachment description: Bug 1274626 part 4 - provide APIs to switch to blank decoders dynamically; → Bug 1274626 part 6 - provide APIs to switch to blank decoders dynamically;
Attachment #8772809 -
Attachment description: Bug 1274626 part 5 - make MDSM change video decoder dynamically; → Bug 1274626 part 7 - make MDSM change video decoder dynamically;
Attachment #8775597 -
Flags: review?(jyavenard)
Attachment #8775598 -
Flags: review?(jyavenard)
Attachment #8772808 -
Flags: review- → review?(jyavenard)
Attachment #8772809 -
Flags: review?(jwwang)
Assignee | ||
Comment 64•8 years ago
|
||
Pass the time information of the original decoder's latest decoded sample into
the newly created blank decoder so that the blank decoder could adjust its
first sample's time.
Review commit: https://reviewboard.mozilla.org/r/67766/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/67766/
Assignee | ||
Comment 65•8 years ago
|
||
Comment on attachment 8770989 [details]
Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64266/diff/3-4/
Assignee | ||
Comment 66•8 years ago
|
||
Comment on attachment 8770990 [details]
Bug 1274626 part 2 - make the blank video data creator return a white image;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64268/diff/3-4/
Assignee | ||
Comment 67•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65544/diff/2-3/
Assignee | ||
Comment 68•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/3-4/
Assignee | ||
Comment 69•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/3-4/
Assignee | ||
Comment 70•8 years ago
|
||
https://reviewboard.mozilla.org/r/65548/#review63878
> Can you explain how SetVideoBlankDecode() works and why do we wait for the promise before beginning InitiateDecodeRecoverySeek()?
I dropped the promise-based API so this is a non-issue now.
Comment 71•8 years ago
|
||
Comment on attachment 8775597 [details]
Bug 1274626 part 3 - make the blank video decoder return samples in PTS order;
https://reviewboard.mozilla.org/r/67764/#review64948
What you could do as a temporary, less optimised solution is if the data is H264 then you set mMaxRefFrames to 16. By spec this is the highest value it can ever be.
It will cause unecessary latency in the decoder, but it's still much better than the WMF decoder (That can buffer over 30 frames!)
And you do the proper way in a follow up bug
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:35
(Diff revision 1)
>
> BlankMediaDataDecoder(BlankMediaDataCreator* aCreator,
> const CreateDecoderParams& aParams)
> : mCreator(aCreator)
> , mCallback(aParams.mCallback)
> + , mMaxRefFrames(aParams.mConfig.GetType() == TrackInfo::kVideoTrack
For this to work, you must guarantee that the video config will contain an extra data (SPS/PSS NAL for h264)
If the video is AVC3, the extradata is inband and by default the videoconfig doesn't have one.
It also won't work with the other supported video codecs (vp9 and vp8 and soon theora).
To guarantee that the videoconfig contains the proper data, you can use the H264Converter ; if videoconfig doesn't contain SPS and PPS NAL, it will postponed the creation of the video decoder until one is seen inband. Only then will it create the decoder with the information it needs.
You'll need to amend the BlankDecoderModule so it can be wrapped by the H264Converter and only do so if the data it will receive will be H264.
::: dom/media/platforms/moz.build:61
(Diff revision 1)
> ]
>
> if CONFIG['MOZ_APPLEMEDIA']:
> EXPORTS += [
> 'apple/AppleDecoderModule.h',
> + 'apple/ReorderQueue.h',
you must move that header outside the apple folder; otherwise this will not compile on platforms other than apple.
Attachment #8775597 -
Flags: review?(jyavenard)
Comment 72•8 years ago
|
||
Comment on attachment 8775598 [details]
Bug 1274626 part 4 - make the blank decoders adjust the start time of the first processed sample;
https://reviewboard.mozilla.org/r/67766/#review64952
I don't understand why this would be required. If you pass the MediaRawData to the BlankDecoderModule it should use that time. The reordering queue will ensure that the right frame comes out.
If you have gap in the returned timestamps because of the frames that got discarded when you flushed/shutdown the active decoders, it won't matter.
Fairly sure you can drop that change.
If not, please comment it extensively in the commit comment.
Attachment #8775598 -
Flags: review?(jyavenard)
Comment 73•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
https://reviewboard.mozilla.org/r/65546/#review64954
::: dom/media/MediaFormatReader.cpp:2053
(Diff revision 4)
> + if (decoder.mIsBlankDecode == aIsBlankDecode) {
> + return;
> + }
> +
> + decoder.mIsBlankDecode = aIsBlankDecode;
> + decoder.ShutdownDecoder();
shouldn't you want to flush the decoder first. this will also set the counters to 0 and reset any pending draining if there was one.
(you'll need to call NotifyDecodingRequested at the end)
Attachment #8772808 -
Flags: review?(jyavenard) → review+
Comment 74•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
https://reviewboard.mozilla.org/r/65548/#review64956
Attachment #8772809 -
Flags: review?(jwwang) → review+
Assignee | ||
Comment 75•8 years ago
|
||
Comment on attachment 8775597 [details]
Bug 1274626 part 3 - make the blank video decoder return samples in PTS order;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67764/diff/1-2/
Attachment #8772807 -
Attachment description: Bug 1274626 part 5 - provide APIs to create blank decoders; → Bug 1274626 part 4 - provide APIs to create blank decoders;
Attachment #8772808 -
Attachment description: Bug 1274626 part 6 - provide APIs to switch to blank decoders dynamically; → Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Attachment #8772809 -
Attachment description: Bug 1274626 part 7 - make MDSM change video decoder dynamically; → Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Attachment #8775597 -
Flags: review?(jyavenard)
Assignee | ||
Comment 76•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65544/diff/3-4/
Assignee | ||
Comment 77•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/4-5/
Assignee | ||
Comment 78•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/4-5/
Assignee | ||
Updated•8 years ago
|
Attachment #8775598 -
Attachment is obsolete: true
Assignee | ||
Comment 79•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/5-6/
Assignee | ||
Comment 80•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/5-6/
Assignee | ||
Comment 81•8 years ago
|
||
https://reviewboard.mozilla.org/r/67764/#review64994
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:24
(Diff revision 2)
> #include "TimeUnits.h"
> #include "VideoUtils.h"
>
> namespace mozilla {
>
> +extern uint32_t ComputeMaxRefFrames(const MediaByteBuffer* aExtraData);
The definition of ComputeMaxRefFrames() should also be moved out of the apple folder, otherwise it won't compile on other platforms.
Assignee | ||
Comment 82•8 years ago
|
||
https://reviewboard.mozilla.org/r/67764/#review64994
> The definition of ComputeMaxRefFrames() should also be moved out of the apple folder, otherwise it won't compile on other platforms.
Not sure where to put the definition. I will move the definition to the BlankDecoderModule.cpp and make the one in the AppleVTDecoder.cpp an extern deceleration
Assignee | ||
Comment 83•8 years ago
|
||
https://reviewboard.mozilla.org/r/65544/#review65058
::: dom/media/platforms/PDMFactory.cpp:283
(Diff revision 4)
>
> +void
> +PDMFactory::CreateBlankPDM()
> +{
> + mBlankPDM = CreateBlankDecoderModule();
> + StartupPDM(mBlankPDM);
Should not call StartupPDM() here, which puts the blank decoder into mCurrentPDMs. This cause some mochitest failures.
Comment 84•8 years ago
|
||
https://reviewboard.mozilla.org/r/67764/#review64994
> Not sure where to put the definition. I will move the definition to the BlankDecoderModule.cpp and make the one in the AppleVTDecoder.cpp an extern deceleration
why don't you put it in the SPS class?
Or within the H264Wrapper ; it's more logical to me that it's there than in the BlankDecoder
Assignee | ||
Comment 85•8 years ago
|
||
https://reviewboard.mozilla.org/r/67764/#review64994
> why don't you put it in the SPS class?
> Or within the H264Wrapper ; it's more logical to me that it's there than in the BlankDecoder
Sure, will do. I am not familiar with the structure here, thanks for your suggestion!
Assignee | ||
Comment 86•8 years ago
|
||
Comment on attachment 8775597 [details]
Bug 1274626 part 3 - make the blank video decoder return samples in PTS order;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67764/diff/2-3/
Assignee | ||
Comment 87•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65544/diff/4-5/
Assignee | ||
Comment 88•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/6-7/
Assignee | ||
Comment 89•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/6-7/
Comment 90•8 years ago
|
||
Comment on attachment 8775597 [details]
Bug 1274626 part 3 - make the blank video decoder return samples in PTS order;
https://reviewboard.mozilla.org/r/67764/#review65288
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:40
(Diff revision 3)
> + , mMaxRefFrames(0)
> , mType(aParams.mConfig.GetType())
> {
> + if (aParams.mConfig.GetType() == TrackInfo::kVideoTrack &&
> + H264Converter::IsH264(aParams.mConfig)) {
> + mp4_demuxer::H264::ComputeMaxRefFrames(aParams.VideoConfig().mExtraData);
and what do you do with the returned value ??
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:111
(Diff revision 3)
> + }
> +
> +private:
> nsAutoPtr<BlankMediaDataCreator> mCreator;
> MediaDataDecoderCallback* mCallback;
> + const uint32_t mMaxRefFrames;
the way it's initialised, you can't make that const (once you fix the initialisation problem)
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:274
(Diff revision 3)
> }
>
> ConversionRequired
> DecoderNeedsConversion(const TrackInfo& aConfig) const override
> {
> + if (aConfig.IsVideo()) {
for clarity,it would be better to only return kNeedAVCC if the configuration is for h264
Attachment #8775597 -
Flags: review?(jyavenard) → review+
Assignee | ||
Comment 91•8 years ago
|
||
https://reviewboard.mozilla.org/r/67764/#review65288
> and what do you do with the returned value ??
I feel shame for this...
Will assign the result to mMaxRefFrames and make the mMaxRefFrames non-const.
Assignee | ||
Comment 92•8 years ago
|
||
Comment on attachment 8770989 [details]
Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64266/diff/4-5/
Assignee | ||
Comment 93•8 years ago
|
||
Comment on attachment 8770990 [details]
Bug 1274626 part 2 - make the blank video data creator return a white image;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64268/diff/4-5/
Assignee | ||
Comment 94•8 years ago
|
||
Comment on attachment 8775597 [details]
Bug 1274626 part 3 - make the blank video decoder return samples in PTS order;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67764/diff/3-4/
Assignee | ||
Comment 95•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65544/diff/5-6/
Assignee | ||
Comment 96•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/7-8/
Assignee | ||
Comment 97•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/7-8/
Comment 98•8 years ago
|
||
you could keep it const and in the constructor do something like
mMaxRefFrames(aParams.mConfig.GetType() == TrackInfo::kVideoTrack &&
H264Converter::IsH264(aParams.mConfig) ?
: mp4_demuxer::H264::ComputeMaxRefFrames(aParams.VideoConfig().mExtraData)
? 0
Which is what JW changed form my earlier code doing like you suggest
Flags: needinfo?(jyavenard)
Assignee | ||
Comment 99•8 years ago
|
||
Comment on attachment 8775597 [details]
Bug 1274626 part 3 - make the blank video decoder return samples in PTS order;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67764/diff/4-5/
Assignee | ||
Comment 100•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65544/diff/6-7/
Assignee | ||
Comment 101•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/8-9/
Assignee | ||
Comment 102•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/8-9/
Comment 103•8 years ago
|
||
https://reviewboard.mozilla.org/r/67764/#review65322
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:58
(Diff revision 5)
> RefPtr<MediaData> data =
> mCreator->Create(media::TimeUnit::FromMicroseconds(aSample->mTime),
> media::TimeUnit::FromMicroseconds(aSample->mDuration),
> aSample->mOffset);
> - if (!data) {
> - mCallback->Error(MediaDataDecoderError::FATAL_ERROR);
> +
> + OutputFrame(data.get());
the get() is unecessaru, as RefPtr<T> has a () operator that will perform the conversion to T* automatically
::: dom/media/platforms/agnostic/BlankDecoderModule.cpp:73
(Diff revision 5)
> }
>
> - nsresult Drain() override {
> + nsresult Drain() override
> + {
> + while (!mReorderQueue.IsEmpty()) {
> + mCallback->Output(mReorderQueue.Pop().get());
don't need the get here either.
Assignee | ||
Comment 104•8 years ago
|
||
https://reviewboard.mozilla.org/r/67764/#review65322
> the get() is unecessaru, as RefPtr<T> has a () operator that will perform the conversion to T* automatically
Oh, yup. I do it on purpose to get rid of my editor's warnning. My editor is so stupid that it does not know the conversion. Will remove it.
Assignee | ||
Comment 105•8 years ago
|
||
https://reviewboard.mozilla.org/r/67764/#review65322
> don't need the get here either.
Do not apply to this one since converting a r-value RefPtr<T> to T* is forbidden here http://searchfox.org/mozilla-central/source/mfbt/RefPtr.h#294 .
Assignee | ||
Comment 106•8 years ago
|
||
Comment on attachment 8775597 [details]
Bug 1274626 part 3 - make the blank video decoder return samples in PTS order;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67764/diff/5-6/
Assignee | ||
Comment 107•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65544/diff/7-8/
Assignee | ||
Comment 108•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/9-10/
Assignee | ||
Comment 109•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/9-10/
Assignee | ||
Comment 110•8 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9731f698f61d
Looks good.
Comment 112•8 years ago
|
||
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eb7f310f128d
Part 1 - add a method to HTMLMediaElement for debugging visibilty change; r=jwwang,ehsan
https://hg.mozilla.org/integration/mozilla-inbound/rev/a722438c2be6
Part 2 - make the blank video data creator return a white image; r=jya
https://hg.mozilla.org/integration/mozilla-inbound/rev/12e3777de139
Part 3 - make the blank video decoder return samples in PTS order; r=jya
https://hg.mozilla.org/integration/mozilla-inbound/rev/222b4883bf79
Part 4 - provide APIs to create blank decoders; r=jya
https://hg.mozilla.org/integration/mozilla-inbound/rev/c5b79d4a6913
Part 5 - provide APIs to switch to blank decoders dynamically; r=jya
https://hg.mozilla.org/integration/mozilla-inbound/rev/221e8d2b180e
Part 6 - make MDSM change video decoder dynamically; r=jwwang
Keywords: checkin-needed
Comment 113•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eb7f310f128d
https://hg.mozilla.org/mozilla-central/rev/a722438c2be6
https://hg.mozilla.org/mozilla-central/rev/12e3777de139
https://hg.mozilla.org/mozilla-central/rev/222b4883bf79
https://hg.mozilla.org/mozilla-central/rev/c5b79d4a6913
https://hg.mozilla.org/mozilla-central/rev/221e8d2b180e
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Comment 114•8 years ago
|
||
had to back this out since this broke unified builds after a clobber like https://treeherder.mozilla.org/logviewer.html#?job_id=4539803&repo=mozilla-central
Status: RESOLVED → REOPENED
status-firefox51:
fixed → ---
Flags: needinfo?(kaku)
Resolution: FIXED → ---
Comment 115•8 years ago
|
||
Backout by cbook@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/a33effc45c9e
Backed out changeset 221e8d2b180e
https://hg.mozilla.org/mozilla-central/rev/746d944389b2
Backed out changeset c5b79d4a6913
https://hg.mozilla.org/mozilla-central/rev/14c8480b5e58
Backed out changeset 222b4883bf79
https://hg.mozilla.org/mozilla-central/rev/1f0d8ecf400a
Backed out changeset 12e3777de139
https://hg.mozilla.org/mozilla-central/rev/4a3d68cc57ba
Backed out changeset a722438c2be6
https://hg.mozilla.org/mozilla-central/rev/6608e5864780
Backed out changeset eb7f310f128d for breaking unified builds
Assignee | ||
Comment 116•8 years ago
|
||
Here, https://hg.mozilla.org/mozilla-central/rev/100d3954e65d, the IsH264() static utility is moved form H264Converter to MP4Decoder.
Will update the patches soon.
Flags: needinfo?(kaku)
Assignee | ||
Comment 117•8 years ago
|
||
Comment on attachment 8770989 [details]
Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64266/diff/5-6/
Assignee | ||
Comment 118•8 years ago
|
||
Comment on attachment 8770990 [details]
Bug 1274626 part 2 - make the blank video data creator return a white image;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64268/diff/5-6/
Assignee | ||
Comment 119•8 years ago
|
||
Comment on attachment 8775597 [details]
Bug 1274626 part 3 - make the blank video decoder return samples in PTS order;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67764/diff/6-7/
Assignee | ||
Comment 120•8 years ago
|
||
Comment on attachment 8772807 [details]
Bug 1274626 part 4 - provide APIs to create blank decoders;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65544/diff/8-9/
Assignee | ||
Comment 121•8 years ago
|
||
Comment on attachment 8772808 [details]
Bug 1274626 part 5 - provide APIs to switch to blank decoders dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65546/diff/10-11/
Assignee | ||
Comment 122•8 years ago
|
||
Comment on attachment 8772809 [details]
Bug 1274626 part 6 - make MDSM change video decoder dynamically;
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65548/diff/10-11/
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 123•8 years ago
|
||
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ee3afceea687
part 1 - add a method to HTMLMediaElement for debugging visibilty change; r=jwwang,ehsan
https://hg.mozilla.org/integration/mozilla-inbound/rev/876f15c4bfff
part 2 - make the blank video data creator return a white image; r=jya
https://hg.mozilla.org/integration/mozilla-inbound/rev/a2b41bc89af1
part 3 - make the blank video decoder return samples in PTS order; r=jya
https://hg.mozilla.org/integration/mozilla-inbound/rev/fd97d47edbb9
part 4 - provide APIs to create blank decoders; r=jya
https://hg.mozilla.org/integration/mozilla-inbound/rev/e15f10941eed
part 5 - provide APIs to switch to blank decoders dynamically; r=jya
https://hg.mozilla.org/integration/mozilla-inbound/rev/4adc486250b6
part 6 - make MDSM change video decoder dynamically; r=jwwang
Keywords: checkin-needed
Comment 124•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ee3afceea687
https://hg.mozilla.org/mozilla-central/rev/876f15c4bfff
https://hg.mozilla.org/mozilla-central/rev/a2b41bc89af1
https://hg.mozilla.org/mozilla-central/rev/fd97d47edbb9
https://hg.mozilla.org/mozilla-central/rev/e15f10941eed
https://hg.mozilla.org/mozilla-central/rev/4adc486250b6
Status: REOPENED → RESOLVED
Closed: 8 years ago → 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Updated•8 years ago
|
Comment 125•8 years ago
|
||
Too late to fix in 50.1.0 release
Updated•8 years ago
|
Flags: qe-verify+
Comment 126•8 years ago
|
||
I reproduced this issue using Fx 49.0a1, build ID: 20160520030251, on Windows 10 x64.
I can confirm this issue is fixed, I verified using Fx 51.0b10, build ID: 20161222080852, on Windows 10 x64, Ubuntu 14.04 LTS and Mac OS X 10.11.
Cheers!
You need to log in
before you can comment on or make changes to this bug.
Description
•