Closed Bug 1213177 Opened 9 years ago Closed 9 years ago

Dynamically enable VP9 MSE when H.264 hardware decoders are not available

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox41 --- wontfix
firefox42 --- wontfix
firefox43 --- affected
firefox44 --- fixed

People

(Reporter: cpeterson, Assigned: jya)

References

Details

Attachments

(1 file)

In bug 1190970, we enabled VP9 MSE on Linux and disabled it on Windows and OS X at compile time. We should also enable VP9 MSE for desktop users who can't use hardware decoders because they have are missing WMF codecs or have a blocklisted GPU.

Do we always want to prefer Flash over VP9 if Flash is installed? What if a user has Flash but also has a GPU on our blocklist? If we think Flash is not going to use the GPU or will use it and fail, we might want to prefer our VP9 SW decoder over Flash's H.264 SW decoder.

So some logic like this:

  VP9 = (!WMF || !GPU) && !Flash; // prefer Flash over VP9?

  VP9 = !GPU || (!WMF && !Flash); // or don't use Flash if GPU is blocklisted?
Show me how to test if Flash is installed and I'll wrap that up for you.

With the fixed SupporsMimeType/canPlayType implementing such logic is trivial.
I think you can use something like:

  nsRefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
  bool isFlashEnabled = pluginHost && pluginHost->HavePluginForType((NS_LITERAL_CSTRING("application/x-shockwave-flash");
Priority: -- → P1
We won't need this fix if we enable VP9 on all platforms first (bug 1198715).
Depends on: 1198715
Blocks: 1217170
Seeing that flash isn't used anyway. Should we still care that flash is installed or not?
(In reply to Jean-Yves Avenard [:jya] from comment #4)
> Seeing that flash isn't used anyway. Should we still care that flash is
> installed or not?

Good point. We no longer care whether Flash is installed or not.

Is this only an issue for Windows? If the user has H.264 platform decoders but their GPU is blocklisted, should we enable VP9 then? Do OS X users ever have missing codecs or blocklisted GPUs?
Flags: needinfo?(jyavenard)
Summary: Dynamically enable VP9 MSE when H.264 hardware decoding is not available and Flash is not installed → Dynamically enable VP9 MSE when H.264 platform decoders are not available
(In reply to Chris Peterson [:cpeterson] from comment #5)
> (In reply to Jean-Yves Avenard [:jya] from comment #4)
> > Seeing that flash isn't used anyway. Should we still care that flash is
> > installed or not?
> 
> Good point. We no longer care whether Flash is installed or not.

in which case this bug is likely now a duplicate of bug 1217170.
It enables WebM wherever MP4 isn't supported.

> 
> Is this only an issue for Windows? If the user has H.264 platform decoders
> but their GPU is blocklisted, should we enable VP9 then? Do OS X users ever
> have missing codecs or blocklisted GPUs?
not that I'm aware off.

That's the thing with Apple, they always use high-end gear of stuff that they know works.
Flags: needinfo?(jyavenard)
Hmmm... still have to handle where H264 HW is disabled.

this is more work
(In reply to Jean-Yves Avenard [:jya] from comment #6)
> (In reply to Chris Peterson [:cpeterson] from comment #5)
> > Good point. We no longer care whether Flash is installed or not.
> 
> in which case this bug is likely now a duplicate of bug 1217170.
> It enables WebM wherever MP4 isn't supported.

OK. Let's repurpose this bug to handle the case where H.264 HW is disabled. (That was the original bug title, anyways. :-)
Summary: Dynamically enable VP9 MSE when H.264 platform decoders are not available → Dynamically enable VP9 MSE when H.264 hardware decoders are not available
Assignee: nobody → jyavenard
Jean-Yves said this fix is pretty safe, so we may want to uplift it to Aurora 43. It will give a small performance improvement to users who can't use H.264 hardware decoding because they have blocklisted GPUs. (VP9 software decoding is faster than H.264 software decoding.)
Comment on attachment 8679798 [details] [diff] [review]
Enable WebM on machines where H264 HW decoding is disabled or unavailable.

Review of attachment 8679798 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/media/mediasource/MediaSource.cpp
@@ +79,5 @@
>  static bool
>  IsWebMForced()
>  {
>    bool mp4supported =
>      DecoderTraits::IsMP4TypeAndEnabled(NS_LITERAL_CSTRING("video/mp4"));

Comment: There is something about that function name that is telling me that it is trying to do two things....
Attachment #8679798 - Flags: review?(ajones) → review+
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #11)
> >    bool mp4supported =
> >      DecoderTraits::IsMP4TypeAndEnabled(NS_LITERAL_CSTRING("video/mp4"));
> 
> Comment: There is something about that function name that is telling me that
> it is trying to do two things....

it does, and that's why I changed the function name.
It checks that it's MP4 *and* that it's prefed on *and* we have a decoder for it. We know it's mp4 ; that leaves us with just it being prefed on and have a decoder.
https://hg.mozilla.org/mozilla-central/rev/8ef8edb2980f
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: