Bug 197064

Summary: Add support for parsing FairPlayStreaming PSSH boxes.
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, eric.carlson, ews-watchlist, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Jer Noble 2019-04-18 11:08:44 PDT
Add support for parsing FairPlayStreaming PSSH boxes.
Comment 1 Radar WebKit Bug Importer 2019-04-18 11:11:41 PDT
<rdar://problem/50021692>
Comment 2 Jer Noble 2019-04-18 11:11:52 PDT
Created attachment 367737 [details]
Patch
Comment 3 Eric Carlson 2019-04-18 13:00:21 PDT
Comment on attachment 367737 [details]
Patch

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

Here are a couple of minor nits to consider while you redo the parts we talked about in person.

> Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:189
> +    SchemeAndKeyResult result;

Minor nit: you can define this just before the loop so it isn't allocated if the array buffer allocation fails.

> Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp:64
> +    if (m_size - (localOffset - offset) < 16)
> +        return false;
> +
> +    auto buffer = view.possiblySharedBuffer();
> +    if (!buffer)
> +        return false;
> +
> +    auto keyID = buffer->slice(localOffset, localOffset + 16);
> +    localOffset += 16;
> +
> +    m_keyID.resize(16);
> +    memcpy(m_keyID.data(), keyID->data(), 16);

Nit: "16" should be a named constant.
Comment 4 Jer Noble 2019-04-18 13:14:07 PDT
Created attachment 367744 [details]
Patch
Comment 5 EWS Watchlist 2019-04-18 13:23:24 PDT
Attachment 367744 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:35:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:37:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:47:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:50:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:60:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:61:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:71:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:72:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:82:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:83:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:93:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:95:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:96:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:97:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:98:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:111:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:113:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:114:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:127:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
Total errors found: 19 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Jer Noble 2019-04-18 13:38:04 PDT
Created attachment 367745 [details]
Patch
Comment 7 EWS Watchlist 2019-04-18 13:40:01 PDT
Attachment 367745 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:35:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:37:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:47:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:50:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:60:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:61:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:71:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:72:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:82:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:83:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:93:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:95:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:96:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:97:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:98:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:111:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:113:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:114:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
ERROR: Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h:127:  Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line.  [build/webcore_export] [4]
Total errors found: 19 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 WebKit Commit Bot 2019-04-18 15:08:02 PDT
Comment on attachment 367745 [details]
Patch

Clearing flags on attachment: 367745

Committed r244439: <https://trac.webkit.org/changeset/244439>
Comment 9 WebKit Commit Bot 2019-04-18 15:08:05 PDT
All reviewed patches have been landed.  Closing bug.