Closed
Bug 1050031
Opened 10 years ago
Closed 9 years ago
Shut down dormant video/audio decoders
Categories
(Core :: Audio/Video, defect, P5)
Tracking
()
RESOLVED
FIXED
People
(Reporter: ajones, Assigned: sotaro)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [MemShrink:P1])
We could get most of the benefits that we need by cutting scope to instead make a media element dormant when any of the following are true:
The media element is a video element and is in a background tab and has been paused or ended for at least 60s.
The media element is a video or audio element and has moved into the bfcache.
That drops the stress-test and visibility issues from our use cases. It should be quite easy to do this.
When a video element is dormant on desktop, we should retain the current Image in the VideoFrameContainer, so we can still render it when the tab is brought into the foreground.
Comment 1•10 years ago
|
||
Sotaro, can you let us know how much work you think this would be?
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 2•10 years ago
|
||
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #0)
> When a video element is dormant on desktop, we should retain the current
> Image in the VideoFrameContainer, so we can still render it when the tab is
> brought into the foreground.
On b2g gonk case, the current Image can not be retained when HwCodec is released. Because, OMXCodec requests all decoded buffers to be released before the codec shutdown. I do not know similar restriction exists on other cases like WMF.
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 3•10 years ago
|
||
cpearce, do you know if a restriction exists like in gonk in Comment 2?
Flags: needinfo?(cpearce)
Assignee | ||
Comment 4•10 years ago
|
||
(In reply to Milan Sreckovic [:milan] (PTO 8/11 - 8/15) from comment #1)
> Sotaro, can you let us know how much work you think this would be?
It might be about 3 weeks work. Implementation seems not difficult, but need to be done by dividing it to sub-problems and need to address them one by one. Especially, we need to modify all MediaDecoderReader derived classes to support dormant. The dormant mode is alredy implemented only at MediaOmxReader on gonk. It's implementation is not good enough. It also seems better to update it.
Comment 5•10 years ago
|
||
There is no restriction on what you can do with the Images produced by the WMF backends.
The only thing like that is there is a limit to how many DXVA decoders we can create at once. Currently we just keep a running count of how many we keep open at once inside the WMFReader. I think we can just keep doing that; there's no need to create a CodecProxy for WMF at this stage.
(In reply to Sotaro Ikeda [:sotaro] from comment #4)
> Especially, we need to modify all MediaDecoderReader derived classes to
> support dormant.
The top priority are the MP4Reader and the WebMReader, please do them first. Don't bother with the WMFReader or the GStreamerReader, we're going to deprecate those and use MP4Reader instead.
Flags: needinfo?(cpearce)
Reporter | ||
Comment 6•10 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #2)
> On b2g gonk case, the current Image can not be retained when HwCodec is
> released. Because, OMXCodec requests all decoded buffers to be released
> before the codec shutdown. I do not know similar restriction exists on other
> cases like WMF.
Could it could be copied into a regular image?
Assignee | ||
Comment 7•10 years ago
|
||
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #6)
>
> Could it could be copied into a regular image?
It can be copied to GrallocImage. But we need to extend GrallocImage to support specifying android::Graphicbuffer's pixel format.
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #7)
> (In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #6)
> >
> > Could it could be copied into a regular image?
>
> It can be copied to GrallocImage. But we need to extend GrallocImage to
> support specifying android::Graphicbuffer's pixel format.
The above is to do copy by same pixel format. If we convert to other color format, extending GrallocImage is not necessary. But copying take time, it could degrade the performance on low end b2g phone.
Comment 9•10 years ago
|
||
(In reply to Chris Pearce (:cpearce) from comment #5)
> ...
>
> (In reply to Sotaro Ikeda [:sotaro] from comment #4)
> > Especially, we need to modify all MediaDecoderReader derived classes to
> > support dormant.
>
> The top priority are the MP4Reader and the WebMReader, please do them first.
> Don't bother with the WMFReader or the GStreamerReader, we're going to
> deprecate those and use MP4Reader instead.
Chris, somebody else (i.e., not Sotaro) should be able to do this. Three weeks is a large chunk of time, and it sounds like there are some pointers from Sotaro in here that should enable somebody else to get more progress on this before we go back to him (Sotaro) for more direction.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → sotaro.ikeda.g
Comment 10•10 years ago
|
||
These bugs are fit and finish issues that might block EME uplift to Aurora.
Blocks: eme-m3
Assignee | ||
Comment 11•10 years ago
|
||
(In reply to Milan Sreckovic [:milan] from comment #9)
> >
> > The top priority are the MP4Reader and the WebMReader, please do them first.
> > Don't bother with the WMFReader or the GStreamerReader, we're going to
> > deprecate those and use MP4Reader instead.
>
> Chris, somebody else (i.e., not Sotaro) should be able to do this. Three
> weeks is a large chunk of time, and it sounds like there are some pointers
> from Sotaro in here that should enable somebody else to get more progress on
> this before we go back to him (Sotaro) for more direction.
Sorry, for my delay. If I do not receive a new big bug, I could start from next week.
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Updated•10 years ago
|
Blocks: gfx-target-2.2
Assignee | ||
Comment 12•10 years ago
|
||
Before start implementation. I am catching up the media's current implementation. MediaSource's diagram is created as a part of it.
https://github.com/sotaroikeda/firefox-diagrams/blob/master/media/dom_media_MediaSource_2_2.pdf?raw=true
Assignee | ||
Comment 13•10 years ago
|
||
I also created some media diagrams(MediaDecoderStateMachine, AudioSink, MP4Decoder) to the following.
https://github.com/sotaroikeda/firefox-diagrams/wiki/Firefox-Diagrams
Reporter | ||
Updated•10 years ago
|
Priority: -- → P1
Assignee | ||
Comment 15•10 years ago
|
||
Since today, I backed from PTO. I am going to work as high priority.
Flags: needinfo?(sotaro.ikeda.g)
Reporter | ||
Comment 16•10 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro PTO Dec/24-Jan/6] from comment #15)
> Since today, I backed from PTO. I am going to work as high priority.
Excellent. Much appreciated.
Updated•10 years ago
|
Whiteboard: [MEMSHRINK]
Comment 17•10 years ago
|
||
How much memory is saved by making a decoder dormant? (Trying to prioritize for MemShrink.)
Whiteboard: [MEMSHRINK] → [MemShrink]
Comment 18•10 years ago
|
||
We're aiming to ship most of the functionality for MP4 in 36 along with MSE.
I don't know exact numbers, but on Windows our media stack maintains a buffer of 10 decoded frames in RGB format in GPU memory. So for a 1920x1080 video, that's ~8.3MB per frame, plus the 1 frame visible onscreen, so that's about 92MB of GPU memory. The decoder also internally will do some allocation/buffering, and create about 6 threads.
For MSE we also have a memory buffer of about 75MB in memory per video. We plan to make this backed by disk storage, but that probably won't make 36.
Comment 21•9 years ago
|
||
Sotaro, what's the status of this? It looks like it might be mostly or totally fixed? Thank you.
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 22•9 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #21)
> Sotaro, what's the status of this? It looks like it might be mostly or
> totally fixed? Thank you.
The all necessary bugs are already fixed.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(sotaro.ikeda.g)
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•