Title: [266176] trunk/Source/WebCore
- Revision
- 266176
- Author
- [email protected]
- Date
- 2020-08-26 10:57:06 -0700 (Wed, 26 Aug 2020)
Log Message
[Mac,EME] Netflix.com shows HDCP error for all streams
https://bugs.webkit.org/show_bug.cgi?id=215825
Reviewed by Eric Carlson.
New API added to AVContentKeySession hits a sandbox restriction when run in the WebContent process, and the default
behavior when an error checking HDCP status is to report that the output is restricted, regardless of the displays
actual capabilities. To work around this behavior for now, pass in an empty displayID array, rather than the actual
displayID. This causes AVFoundation to do a "lowest common level of support" rather than a specific display check.
The upside is that this call no longer requires a connection to the WindowServer. The downside is that the
AVContentKeyRequest will report that its output is restricted if any non-HDCP compliant display is attached.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyRequestHasInsufficientProtectionForDisplayID const):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateProtectionStatusForDisplayID):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (266175 => 266176)
--- trunk/Source/WebCore/ChangeLog 2020-08-26 17:53:27 UTC (rev 266175)
+++ trunk/Source/WebCore/ChangeLog 2020-08-26 17:57:06 UTC (rev 266176)
@@ -1,3 +1,24 @@
+2020-08-26 Jer Noble <[email protected]>
+
+ [Mac,EME] Netflix.com shows HDCP error for all streams
+ https://bugs.webkit.org/show_bug.cgi?id=215825
+
+ Reviewed by Eric Carlson.
+
+ New API added to AVContentKeySession hits a sandbox restriction when run in the WebContent process, and the default
+ behavior when an error checking HDCP status is to report that the output is restricted, regardless of the displays
+ actual capabilities. To work around this behavior for now, pass in an empty displayID array, rather than the actual
+ displayID. This causes AVFoundation to do a "lowest common level of support" rather than a specific display check.
+ The upside is that this call no longer requires a connection to the WindowServer. The downside is that the
+ AVContentKeyRequest will report that its output is restricted if any non-HDCP compliant display is attached.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
+ * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
+ (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
+ (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyRequestHasInsufficientProtectionForDisplayID const):
+ (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateProtectionStatusForDisplayID):
+
2020-08-26 Oriol Brufau <[email protected]>
[css-grid] Set available column space before grid items prelayout
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h (266175 => 266176)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h 2020-08-26 17:53:27 UTC (rev 266175)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h 2020-08-26 17:57:06 UTC (rev 266176)
@@ -190,10 +190,12 @@
bool ensureSessionOrGroup();
bool isLicenseTypeSupported(LicenseType) const;
- KeyStatusVector keyStatuses() const;
+ KeyStatusVector keyStatuses(Optional<PlatformDisplayID> = WTF::nullopt) const;
void nextRequest();
AVContentKeyRequest* lastKeyRequest() const;
+ bool keyRequestHasInsufficientProtectionForDisplayID(AVContentKeyRequest *, PlatformDisplayID) const;
+
#if !RELEASE_LOG_DISABLED
WTF::Logger* loggerPtr() const { return m_logger.get(); };
const void* logIdentifier() const { return m_logIdentifier; }
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm (266175 => 266176)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm 2020-08-26 17:53:27 UTC (rev 266175)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm 2020-08-26 17:57:06 UTC (rev 266176)
@@ -1340,10 +1340,13 @@
}
}
-CDMInstanceSession::KeyStatusVector CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses() const
+CDMInstanceSession::KeyStatusVector CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses(Optional<PlatformDisplayID> displayID) const
{
KeyStatusVector keyStatuses;
+ if (!displayID && m_client)
+ displayID = m_client->displayID();
+
for (auto& request : m_requests) {
for (auto& oneRequest : request.requests) {
auto keyIDs = keyIDsForRequest(oneRequest.get());
@@ -1351,6 +1354,9 @@
if (m_outputObscured || oneRequest.get().error.code == SecurityLevelError)
status = CDMKeyStatus::OutputRestricted;
+ if (displayID && keyRequestHasInsufficientProtectionForDisplayID(oneRequest.get(), *displayID))
+ status = CDMKeyStatus::OutputRestricted;
+
for (auto& keyID : keyIDs)
keyStatuses.append({ WTFMove(keyID), status });
}
@@ -1379,21 +1385,35 @@
updateProtectionStatusForDisplayID(m_client->displayID());
}
+bool CDMInstanceSessionFairPlayStreamingAVFObjC::keyRequestHasInsufficientProtectionForDisplayID(AVContentKeyRequest *request, PlatformDisplayID displayID) const
+{
+ // willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays will always return "YES" prior to
+ // receiving a response.
+ if (request.status != AVContentKeyRequestStatusReceivedResponse && request.status != AVContentKeyRequestStatusRenewed) {
+ ALWAYS_LOG_IF_POSSIBLE(LOGIDENTIFIER, "request has insufficient status ", (int)request.status);
+ return false;
+ }
+
+ // FIXME: AVFoundation requires a connection to the WindowServer in order to query the HDCP status of individual
+ // displays. Passing in an empty NSArray will cause AVFoundation to fall back to a "minimum supported HDCP level"
+ // across all displays. Replace the below with explicit APIs to query the per-display HDCP status in the UIProcess
+ // and to query the HDCP level required by each AVContentKeyRequest, and do the comparison between the two in the
+ // WebProcess.
+ UNUSED_PARAM(displayID);
+ if ([request respondsToSelector:@selector(willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:)]) {
+ auto obscured = [request willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:@[ ]];
+ ALWAYS_LOG_IF_POSSIBLE(LOGIDENTIFIER, "request willOutputBeObscured...forDisplays:[ nil ] = ", obscured ? "true" : "false");
+ return obscured;
+ }
+ return false;
+};
+
+
void CDMInstanceSessionFairPlayStreamingAVFObjC::updateProtectionStatusForDisplayID(PlatformDisplayID displayID)
{
- if (m_requests.isEmpty())
+ if (m_requests.isEmpty() || !m_client)
return;
-
- auto keyRequestHasInsufficientProtectionForDisplayID = [displayID] (auto& request) -> bool {
- if ([request respondsToSelector:@selector(willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:)])
- return [request willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:@[ @(displayID) ]];
- return false;
- };
-
- bool outputWillBeObscured = WTF::anyOf(m_requests, [&](Request& request) {
- return WTF::anyOf(request.requests, keyRequestHasInsufficientProtectionForDisplayID);
- });
- outputObscuredDueToInsufficientExternalProtectionChanged(outputWillBeObscured);
+ m_client->updateKeyStatuses(keyStatuses(displayID));
}
bool CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSessionOrGroup()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes