Enable VCP for iOS and reenable it for MacOS
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2018 17:15:56 +0000 (17:15 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2018 17:15:56 +0000 (17:15 +0000)
commit8057c4062293b3df93eaa783b8f9bca7800a9260
treeb945cc65cedfd6622b3dbbcbb91b449fb0fc06a9
parent5ae9b351505ec3336d111d0493ba3904ddbecf7f
Enable VCP for iOS and reenable it for MacOS
https://bugs.webkit.org/show_bug.cgi?id=189635
<rdar://problem/43621029>

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Make sure VCP API is used to set encoding session parameters.

* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc:
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h:

Source/WebCore:

Covered by exsiting and modified tests.
Instead of using libwebrtc YUV frames for black frames, use CVPixelBuffer to make it efficient.
Add internal API to know whether VCP is enabled so as to make capture-webrtc test pass on all platforms.

* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer):
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::createBlackFrame):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* testing/Internals.cpp:
(WebCore::Internals::supportsVCPEncoder):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html:
For platforms suppporting VCP, arbitrary size should be supported.
* webrtc/routines.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html
LayoutTests/webrtc/routines.js
Source/ThirdParty/libwebrtc/ChangeLog
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h
Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj
Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp
Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h
Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h
Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h
Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl