[webkit-changes] [WebKit/WebKit] 7a74dc: [Cocoa] Legacy EME tests time out with SampleBuffe...
aestes
noreply at github.com
Fri Mar 8 09:06:29 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7a74dcab081bf155995c7eb7fb745d444dbb4eae
https://github.com/WebKit/WebKit/commit/7a74dcab081bf155995c7eb7fb745d444dbb4eae
Author: Andy Estes <aestes at apple.com>
Date: 2024-03-08 (Fri, 08 Mar 2024)
Changed paths:
M Source/WebCore/SourcesCocoa.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp
M Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.h
A Source/WebCore/platform/graphics/avfoundation/objc/CDMFairPlayStreamingAVFObjC.mm
M Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm
M Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h
M Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm
M Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h
M Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
Log Message:
-----------
[Cocoa] Legacy EME tests time out with SampleBufferContentKeySessionSupportEnabled enabled
https://bugs.webkit.org/show_bug.cgi?id=270678
rdar://problem/123089013
Reviewed by Jer Noble.
The following legacy EME + MSE tests time out when enabling SampleBufferContentKeySessionSupportEnabled:
- http/tests/media/fairplay/legacy-fairplay-mse-v2.html
- http/tests/media/fairplay/legacy-fairplay-mse-v3.html
This occurred because SourceBufferPrivateAVFObjC::canEnqueueSample would only consult m_cdmInstance
(the modern CDM) to determine if a usable key existed to decrypt a sample. When legacy EME is in use
there would not be a modern CDM instance, so all samples would be considered un-enqueueable and
ultimately the canplay event would never be dispatched.
Addressed this by teaching SourceBufferPrivateAVFObjC to check m_session (the legacy CDM) for usable
keys if m_cdmInstance is null. Also, taught CDMSessionAVContentKeySession to attach content keys to
samples rather than relying on AVStreamDataParser to do so; this matches how
CDMInstanceSessionFairPlayStreamingAVFObjC attaches handles content key attachment.
To fully resolve these timeouts, one additional change was necessary. In 274351 at main we taught the
FairPlay CDM how to decrypt MPEG2-TS streams, but we used a keyID that is incompatible with the
AVContentKeyRequests vended by AVContentKeySession. Since AVContentKeySession vends MPEG2-TS key
requests with an identifier of "TransportStreamIdentifier" and our CDM prefers to use the request
identifier over request initialization data to represent the keyID, this commit changes
CDMPrivateFairPlayStreaming::mptsKeyIDs() to return "TransportStreamIdentifier" instead of the
preivious 16-byte value
No new tests; covered by existing tests.
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMPrivateFairPlayStreaming::mptsKeyIDs):
* Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.h:
* Source/WebCore/platform/graphics/avfoundation/objc/CDMFairPlayStreamingAVFObjC.mm: Added.
(WebCore::CDMPrivateFairPlayStreaming::keyIDsForRequest):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::keyIDsForRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateKeyStatuses):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::contentKeyForSample):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::isAnyKeyUsable const):
(WebCore::CDMSessionAVContentKeySession::attachContentKeyToSample):
(WebCore::CDMSessionAVContentKeySession::contentKeyRequest const):
(WebCore::CDMSessionAVContentKeySession::contentKeyRequest): Deleted.
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::canEnqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::attachContentKeyToSampleIfNeeded):
Canonical link: https://commits.webkit.org/275839@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list