haikuwebkit/LayoutTests/webrtc/h264-packetization-mode.html

61 lines
2.0 KiB
HTML
Raw Permalink Normal View History

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Testing H264 packetization mode</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body>
<script>
promise_test(async t => {
const pc = new RTCPeerConnection;
pc.addTransceiver("video");
const offer = await pc.createOffer();
assert_true(offer.sdp.indexOf("packetization-mode=1;profile-level-id=42e01f") !== -1, "baseline, packetization mode 1");
Update WebRTC liwebrtc to M87 https://bugs.webkit.org/show_bug.cgi?id=218436 LayoutTests/imported/w3c: Reviewed by Eric Carlson. * web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-transceivers.https-expected.txt: * web-platform-tests/webrtc/RTCRtpTransceiver-stop-expected.txt: Source/ThirdParty/libwebrtc: Reviewed by Eric Carlson. * CMakeLists.txt: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Source/webrtc: Resynced. * WebKit/libwebrtc-m87-diff: Added. * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Reviewed by Eric Carlson. Move from deprecated to new APIs. Covered by existing tests. * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::LibWebRTCRtpTransceiverBackend::setDirection): (WebCore::LibWebRTCRtpTransceiverBackend::stop): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCDataChannelStats): * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: (WebCore::GStreamerVideoFrameLibWebRTC::ToI420): * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerEncodedImageBuffer::create): (WebCore::GStreamerEncodedImageBuffer::GStreamerEncodedImageBuffer): (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder): (WebCore::GStreamerVideoEncoder::Fragmentize): Deleted. * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: * testing/MockLibWebRTCPeerConnection.h: Source/WebKit: Reviewed by Eric Carlson. Update code now that fragmentation headers are computed at packetization time. * Configurations/WebKit.xcconfig: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: (WebKit::LibWebRTCCodecsProxy::createEncoder): * Scripts/webkit/messages.py: * Shared/RTCNetwork.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: (WebKit::LibWebRTCCodecs::completedEncoding): * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: LayoutTests: Reviewed by Eric Carlson. We now have to explicitly support all packetization modes, which is similar to what Chrome is doing. * webrtc/h264-packetization-mode.html: Canonical link: https://commits.webkit.org/231430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-10 20:49:45 +00:00
assert_true(offer.sdp.indexOf("packetization-mode=0") !== -1, "packetization mode 0 is not offered");
}, "Make sure packetization mode 1 is offered");
const sdpStart = `v=0
o=- 3761869441 3761869441 IN IP4 0.0.0.0
s=test
c=IN IP4 0.0.0.0
t=0 0
a=group:BUNDLE video0
m=video 1 RTP/SAVPF 99
a=setup:actpass
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-mux
a=recvonly
a=mid:video0
a=rtpmap:99 H264/90000
a=ssrc:3599710107 cname:test-cname
a=ice-ufrag:ZLgu
a=ice-pwd:3/gb3GZYQ2wgxAHnFRT1bf
a=fingerprint:sha-256 5A:08:09:0D:E9:1C:78:20:65:64:95:6E:FE:29:91:E1:CC:6E:47:F1:A4:7A:8E:F9:6F:4D:A4:7A:7A:A2:76:BF`;
promise_test(async t => {
const sdp = sdpStart +`
`;
const pc = new RTCPeerConnection();
Update WebRTC liwebrtc to M87 https://bugs.webkit.org/show_bug.cgi?id=218436 LayoutTests/imported/w3c: Reviewed by Eric Carlson. * web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-transceivers.https-expected.txt: * web-platform-tests/webrtc/RTCRtpTransceiver-stop-expected.txt: Source/ThirdParty/libwebrtc: Reviewed by Eric Carlson. * CMakeLists.txt: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Source/webrtc: Resynced. * WebKit/libwebrtc-m87-diff: Added. * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Reviewed by Eric Carlson. Move from deprecated to new APIs. Covered by existing tests. * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::LibWebRTCRtpTransceiverBackend::setDirection): (WebCore::LibWebRTCRtpTransceiverBackend::stop): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCDataChannelStats): * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: (WebCore::GStreamerVideoFrameLibWebRTC::ToI420): * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerEncodedImageBuffer::create): (WebCore::GStreamerEncodedImageBuffer::GStreamerEncodedImageBuffer): (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder): (WebCore::GStreamerVideoEncoder::Fragmentize): Deleted. * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: * testing/MockLibWebRTCPeerConnection.h: Source/WebKit: Reviewed by Eric Carlson. Update code now that fragmentation headers are computed at packetization time. * Configurations/WebKit.xcconfig: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: (WebKit::LibWebRTCCodecsProxy::createEncoder): * Scripts/webkit/messages.py: * Shared/RTCNetwork.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: (WebKit::LibWebRTCCodecs::completedEncoding): * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: LayoutTests: Reviewed by Eric Carlson. We now have to explicitly support all packetization modes, which is similar to what Chrome is doing. * webrtc/h264-packetization-mode.html: Canonical link: https://commits.webkit.org/231430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-10 20:49:45 +00:00
return pc.setRemoteDescription(new RTCSessionDescription({sdp: sdp, type: 'offer'}));
}, "Offer without explicit H264 packetization mode");
promise_test(async t => {
const sdp = sdpStart +`
a=fmtp:99 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=0
`;
const pc = new RTCPeerConnection();
Update WebRTC liwebrtc to M87 https://bugs.webkit.org/show_bug.cgi?id=218436 LayoutTests/imported/w3c: Reviewed by Eric Carlson. * web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-transceivers.https-expected.txt: * web-platform-tests/webrtc/RTCRtpTransceiver-stop-expected.txt: Source/ThirdParty/libwebrtc: Reviewed by Eric Carlson. * CMakeLists.txt: * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: * Source/webrtc: Resynced. * WebKit/libwebrtc-m87-diff: Added. * libwebrtc.xcodeproj/project.pbxproj: Source/WebCore: Reviewed by Eric Carlson. Move from deprecated to new APIs. Covered by existing tests. * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::LibWebRTCRtpTransceiverBackend::setDirection): (WebCore::LibWebRTCRtpTransceiverBackend::stop): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCDataChannelStats): * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: (WebCore::GStreamerVideoFrameLibWebRTC::ToI420): * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerEncodedImageBuffer::create): (WebCore::GStreamerEncodedImageBuffer::GStreamerEncodedImageBuffer): (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder): (WebCore::GStreamerVideoEncoder::Fragmentize): Deleted. * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: * testing/MockLibWebRTCPeerConnection.h: Source/WebKit: Reviewed by Eric Carlson. Update code now that fragmentation headers are computed at packetization time. * Configurations/WebKit.xcconfig: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: (WebKit::LibWebRTCCodecsProxy::createEncoder): * Scripts/webkit/messages.py: * Shared/RTCNetwork.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: (WebKit::LibWebRTCCodecs::completedEncoding): * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: LayoutTests: Reviewed by Eric Carlson. We now have to explicitly support all packetization modes, which is similar to what Chrome is doing. * webrtc/h264-packetization-mode.html: Canonical link: https://commits.webkit.org/231430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-10 20:49:45 +00:00
return pc.setRemoteDescription(new RTCSessionDescription({sdp: sdp, type: 'offer'}));
}, "Offer with explicit H264 packetization mode 0");
promise_test(async t => {
const sdp = sdpStart +`
a=fmtp:99 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1
`;
const pc = new RTCPeerConnection;
return pc.setRemoteDescription(new RTCSessionDescription({sdp: sdp, type: 'offer'}));
}, "Offer with explicit H264 packetization mode 1");
</script>