[EME] Support the 'encrypted' event for FPS encrypted streams
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Dec 2017 21:04:21 +0000 (21:04 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Dec 2017 21:04:21 +0000 (21:04 +0000)
commit90961e91ea8dd76174f9933ba114350d505035bc
tree743b921fb191845f69f5cabfdd312f9bf9998d52
parente0050390d6625f15d3feb3b08fc6a03e8dd4321b
[EME] Support the 'encrypted' event for FPS encrypted streams
https://bugs.webkit.org/show_bug.cgi?id=180480

Reviewed by Eric Carlson.

Source/WebCore:

Test: platform/mac/media/encrypted-media/fps-encrypted-event.html

Pass initData and initDataType up to HTMLMediaElement from SourceBufferPrivateAVFObjC.

Drive-by fix: initialize the initData and initDataType values of MediaEncryptedEvent from
values in its initializer struct.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
* html/MediaEncryptedEvent.cpp:
(WebCore::MediaEncryptedEvent::MediaEncryptedEvent):
(WebCore::MediaEncryptedEvent::initDataType): Deleted.
(WebCore::MediaEncryptedEvent::initData): Deleted.
* html/MediaEncryptedEvent.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):

LayoutTests:

* platform/mac/TestExpectations:
* platform/mac/media/encrypted-media/content/fps-cbcs.mp4: Added.
* platform/mac/media/encrypted-media/fps-encrypted-event-expected.txt: Added.
* platform/mac/media/encrypted-media/fps-encrypted-event.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/mac/media/encrypted-media/content/fps-cbcs.mp4 [new file with mode: 0644]
LayoutTests/platform/mac/media/encrypted-media/fps-encrypted-event-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/media/encrypted-media/fps-encrypted-event.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/MediaEncryptedEvent.cpp
Source/WebCore/html/MediaEncryptedEvent.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm