Enable H264 simulcast
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2018 12:11:23 +0000 (12:11 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2018 12:11:23 +0000 (12:11 +0000)
commitad6593d4ea539f8e5f303aec644cdb5db8a6d85e
tree04bff711b8af52608fe5701afe0645367a9d48fa
parent32cc0bb134bc4aec01d36851d2e017a603b7e7e0
Enable H264 simulcast
https://bugs.webkit.org/show_bug.cgi?id=190167

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Rename .m files to .mm to enable C++ compilation of included header files.
Rename RTCH264VideoEncoder to RTCSingleH264Encoder.
Implement a new RTCH264VideoEncoder that spawns as many RTCSingleH264Encoder as needed for simulcast.
Update ObjC API to allow passing simulcast parameters to/from RTCH264VideoEncoder.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:
* Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCDefaultVideoDecoderFactory.mm: Renamed from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCDefaultVideoDecoderFactory.m.
* Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCDefaultVideoEncoderFactory.mm: Renamed from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCDefaultVideoEncoderFactory.m.
* Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec+Private.h:
* Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm:
(-[RTCCodecSpecificInfoH264 nativeCodecSpecificInfo]):
* Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoEncoderSettings.mm:
(-[RTCVideoEncoderSettings initWithNativeVideoCodec:]):
* Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCWrappedNativeVideoEncoder.mm:
(-[RTCWrappedNativeVideoEncoder setBitrate:framerate:]):
(-[RTCWrappedNativeVideoEncoder setRateAllocation:framerate:]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCSingleVideoEncoderH264 initWithCodecInfo:simulcastIndex:]):
(-[RTCSingleVideoEncoderH264 startEncodeWithSettings:numberOfCores:]):
(-[RTCSingleVideoEncoderH264 encode:codecSpecificInfo:frameTypes:]):
(-[RTCSingleVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
(-[RTCSingleVideoEncoderH264 scalingSettings]):
(-[RTCSingleVideoEncoderH264 setRateAllocation:framerate:]):
(-[RTCVideoEncoderH264 initWithCodecInfo:]):
(-[RTCVideoEncoderH264 setCallback:]):
(-[RTCVideoEncoderH264 startEncodeWithSettings:numberOfCores:]):
(-[RTCVideoEncoderH264 releaseEncoder]):
(-[RTCVideoEncoderH264 encode:codecSpecificInfo:frameTypes:]):
(-[RTCVideoEncoderH264 setRateAllocation:framerate:]):
(-[RTCVideoEncoderH264 implementationName]):
(-[RTCVideoEncoderH264 scalingSettings]):
(-[RTCVideoEncoderH264 setBitrate:framerate:]):
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h:
* Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodecH264.h:
* Source/webrtc/sdk/objc/Framework/Native/src/objc_video_encoder_factory.mm:
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Activate H264 simulcast trial field.
Make track.getSettings() expose width and height for incoming tracks.

Test: webrtc/simulcast-h264.html

* Configurations/WebCore.xcconfig:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):

LayoutTests:

* TestExpectations:
* webrtc/simulcast-h264-expected.txt: Added.
* webrtc/simulcast-h264.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/webrtc/simulcast-h264-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/simulcast-h264.html [new file with mode: 0644]
Source/ThirdParty/libwebrtc/ChangeLog
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCDefaultVideoDecoderFactory.mm [moved from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCDefaultVideoDecoderFactory.m with 97% similarity]
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCDefaultVideoEncoderFactory.mm [moved from Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCDefaultVideoEncoderFactory.m with 96% similarity]
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec+Private.h
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoEncoderSettings.mm
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCWrappedNativeVideoEncoder.mm
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodec.h
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCVideoCodecH264.h
Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Native/src/objc_video_encoder_factory.mm
Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/platform/mediastream/RealtimeIncomingVideoSource.cpp