[Cocoa] Add MediaCapabilities support for SW VP9 decoder.
<rdar://problem/65561815>
Created attachment 404274 [details] Patch
Created attachment 404276 [details] Patch
Created attachment 404282 [details] Patch
Created attachment 404293 [details] Patch
Comment on attachment 404293 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=404293&action=review > Source/WebCore/ChangeLog:11 > + both on the system battery status, but also power adapter status, and these need to be shipped Nit: s/both on the system battery status, but also power adapter status/both on the system battery status and the power adapter status/ > Source/WebCore/platform/cocoa/SystemBattery.mm:104 > + CFDictionaryRef description = IOPSGetPowerSourceDescription(powerSourcesInfo.get(), CFArrayGetValueAtIndex(powerSourcesList.get(), i)); IOPSGetPowerSourceDescription can return NULL according to the docs, and CFDictionaryGetValue(NULL) will crash. > Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:97 > + // HW VP9 Decoder Profile 0 & 2: > + if (!codecConfiguration.profile && codecConfiguration.profile != 2) I don't think you want the `!` here > Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:101 > + // HW VP9 Decoder supports up to Level 6: > + if (codecConfiguration.level > 60) Is it 6 or 60? > Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:109 > + if (codecConfiguration.chromaSubsampling > 1) It'd be nice to have an enum for the chromaSubsampling values, or at least a named constant for 420 > Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:117 > + if (videoConfiguration.height <= 2160 && videoConfiguration.framerate > 120) Named constants would be helpful for future engineers. > Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:119 > + else if (videoConfiguration.height > 2160 && videoConfiguration.framerate > 30) Ditto > Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:130 > + if (videoConfiguration.height <= 1080 && videoConfiguration.framerate > 60) Ditto > Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:132 > + if (videoConfiguration.height <= 2160 && videoConfiguration.framerate > 30) Ditto > Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:153 > + auto is4kScreen = [](float width, float height, float scale) { Why have the width parameter if it isn't used? > Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:155 > + return height * scale >= 2160; `2160` again. > Source/WebCore/testing/Internals.h:1025 > + void setHardwareVP9DecoderDisabledForTesting(bool); > + void setVP9ScreenSizeAndScale(double, double, double); All four should have the "ForTesting" suffix or none should.
Created attachment 404358 [details] Patch for landing
Created attachment 404446 [details] Patch for landing
Committed r264476: <https://trac.webkit.org/changeset/264476> All reviewed patches have been landed. Closing bug and clearing flags on attachment 404446 [details].