Bug 203170 - Add MediaCapabilities support for DolbyVision codecs.
Summary: Add MediaCapabilities support for DolbyVision codecs.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-18 16:19 PDT by Jer Noble
Modified: 2019-10-21 16:47 PDT (History)
7 users (show)

See Also:


Attachments
Patch (24.59 KB, patch)
2019-10-18 16:21 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (24.71 KB, patch)
2019-10-18 17:15 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (24.85 KB, patch)
2019-10-21 13:19 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (24.87 KB, patch)
2019-10-21 13:37 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2019-10-18 16:19:50 PDT
Add MediaCapabilities support for DolbyVision codecs.
Comment 1 Jer Noble 2019-10-18 16:21:45 PDT
Created attachment 381343 [details]
Patch
Comment 2 Jer Noble 2019-10-18 16:22:51 PDT
<rdar://problem/35131321>
Comment 3 Eric Carlson 2019-10-18 16:47:24 PDT
Comment on attachment 381343 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=381343&action=review

> Source/WebCore/platform/graphics/HEVCUtilities.cpp:178
> +    switch (profileID) {
> +    case 9:  return codecName == "avc1" || codecName == "avc3";
> +    default: return codecName == "hvc1" || codecName == "hev1";

Nit: a switch statement with one case and a default is odd, why not just use:

    if (profileID == 9) 
        return codecName == "avc1" || codecName == "avc3";

    return codecName == "hvc1" || codecName == "hev1";

> Source/WebCore/platform/graphics/HEVCUtilities.cpp:189
> +    if (nextElement == codecSplit.end())
> +        return WTF::nullopt;

if (nextElement == codecSplit.end() || ++nextElement == codecSplit.end())
    return WTF::nullopt;

> Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:196
> +    auto& map = codecStringToCodecTypeMap();
> +    auto findResult = map.find(parameters.codecName);
> +    if (findResult == map.end())
> +        return false;
> +    auto codecType = findResult->value;

Nit: Any reason to not wrap this in a function like you did with profileIDForAlphabeticDoViProfile and codecStringForDoViCodecType?
Comment 4 Jer Noble 2019-10-18 16:59:05 PDT
Comment on attachment 381343 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=381343&action=review

>> Source/WebCore/platform/graphics/HEVCUtilities.cpp:178
>> +    default: return codecName == "hvc1" || codecName == "hev1";
> 
> Nit: a switch statement with one case and a default is odd, why not just use:
> 
>     if (profileID == 9) 
>         return codecName == "avc1" || codecName == "avc3";
> 
>     return codecName == "hvc1" || codecName == "hev1";

Sure.

>> Source/WebCore/platform/graphics/HEVCUtilities.cpp:189
>> +        return WTF::nullopt;
> 
> if (nextElement == codecSplit.end() || ++nextElement == codecSplit.end())
>     return WTF::nullopt;

No this would skip the codec type portion of the string. Need that later.

>> Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:196
>> +    auto codecType = findResult->value;
> 
> Nit: Any reason to not wrap this in a function like you did with profileIDForAlphabeticDoViProfile and codecStringForDoViCodecType?

I only split it out before because I ended up with multiple “auto& map =...” statements. But yes, I should convert this into a static query instead.
Comment 5 Jer Noble 2019-10-18 17:15:32 PDT
Created attachment 381352 [details]
Patch for landing
Comment 6 Jer Noble 2019-10-21 13:19:56 PDT
Created attachment 381435 [details]
Patch for landing
Comment 7 Jer Noble 2019-10-21 13:37:46 PDT
Created attachment 381441 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2019-10-21 16:47:19 PDT
Comment on attachment 381441 [details]
Patch for landing

Clearing flags on attachment: 381441

Committed r251396: <https://trac.webkit.org/changeset/251396>
Comment 9 WebKit Commit Bot 2019-10-21 16:47:21 PDT
All reviewed patches have been landed.  Closing bug.