Diff
Modified: trunk/LayoutTests/ChangeLog (235972 => 235973)
--- trunk/LayoutTests/ChangeLog 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/LayoutTests/ChangeLog 2018-09-13 15:31:04 UTC (rev 235973)
@@ -1,3 +1,13 @@
+2018-09-13 Youenn Fablet <[email protected]>
+
+ Introduce RTCRtpSendParameters
+ https://bugs.webkit.org/show_bug.cgi?id=189563
+
+ Reviewed by Eric Carlson.
+
+ * webrtc/video-getParameters-expected.txt:
+ * webrtc/video-getParameters.html:
+
2018-09-12 Dean Jackson <[email protected]>
Header parsing for experimental and internal debug features
Modified: trunk/LayoutTests/webrtc/video-getParameters-expected.txt (235972 => 235973)
--- trunk/LayoutTests/webrtc/video-getParameters-expected.txt 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/LayoutTests/webrtc/video-getParameters-expected.txt 2018-09-13 15:31:04 UTC (rev 235973)
@@ -1,3 +1,3 @@
-PASS Basic video stats
+PASS Sender and receiver parameters
Modified: trunk/LayoutTests/webrtc/video-getParameters.html (235972 => 235973)
--- trunk/LayoutTests/webrtc/video-getParameters.html 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/LayoutTests/webrtc/video-getParameters.html 2018-09-13 15:31:04 UTC (rev 235973)
@@ -40,17 +40,19 @@
assert_true(!!senderParameters, "sender parameters should not be undefined or null");
assert_true(!!receiverParameters, "receiver parameters should not be undefined or null");
+ assert_array_equals(receiverParameters.codecs, [], "receiver codecs");
+ assert_array_equals(receiverParameters.headerExtensions, [], "receiver header extensions");
+
+ senderParameters.encodings[0].ssrc = 1;
senderParameters.encodings[0].fec.ssrc = 1;
senderParameters.encodings[0].rtx.ssrc = 1;
- senderParameters.transactionId = "";
- receiverParameters.transactionId = "";
-
- senderParameters.encodings[0].ssrc = 1;
- assert_equals(JSON.stringify(senderParameters), '{"codecs":[],"degradationPreference":"balanced","encodings":[{"active":true,"fec":{"ssrc":1},"maxBitrate":0,"maxFramerate":0,"priority":"medium","rid":"","rtx":{"ssrc":1},"scaleResolutionDownBy":1,"ssrc":1}],"headerExtensions":[],"transactionId":""}', "Testing sanitized sender parameters");
- assert_equals(JSON.stringify(receiverParameters), '{"codecs":[],"degradationPreference":"balanced","encodings":[],"headerExtensions":[],"transactionId":""}', "Testing sanitized receiver parameters");
+ assert_true(!!senderParameters.transactionId, "sender transaction");
+ assert_array_equals(senderParameters.codecs, [], "sender codecs");
+ assert_array_equals(senderParameters.headerExtensions, [], "sender header extensions");
+ assert_equals(senderParameters.degradationPreference, "balanced", "sender degradation");
});
-}, "Basic video stats");
+}, "Sender and receiver parameters");
</script>
</body>
</html>
Modified: trunk/Source/WebCore/CMakeLists.txt (235972 => 235973)
--- trunk/Source/WebCore/CMakeLists.txt 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/CMakeLists.txt 2018-09-13 15:31:04 UTC (rev 235973)
@@ -327,6 +327,7 @@
Modules/mediastream/RTCRtpParameters.idl
Modules/mediastream/RTCRtpReceiver.idl
Modules/mediastream/RTCRtpRtxParameters.idl
+ Modules/mediastream/RTCRtpSendParameters.idl
Modules/mediastream/RTCRtpSender.idl
Modules/mediastream/RTCRtpTransceiver.idl
Modules/mediastream/RTCRtpTransceiverDirection.idl
Modified: trunk/Source/WebCore/ChangeLog (235972 => 235973)
--- trunk/Source/WebCore/ChangeLog 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/ChangeLog 2018-09-13 15:31:04 UTC (rev 235973)
@@ -1,3 +1,48 @@
+2018-09-13 Youenn Fablet <[email protected]>
+
+ Introduce RTCRtpSendParameters
+ https://bugs.webkit.org/show_bug.cgi?id=189563
+
+ Reviewed by Eric Carlson.
+
+ Introduce RTCRtpSendParameters to match the WebRTC specification.
+ Split RTCRtpPrameters fields accordingly and update call sites.
+
+ Covered by updated test.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * Modules/mediastream/PeerConnectionBackend.h:
+ * Modules/mediastream/RTCRtpCodingParameters.h: Added
+ * Modules/mediastream/RTCRtpCodingParameters.idl: Added
+ * Modules/mediastream/RTCRtpDecodingParameters.h: Added
+ * Modules/mediastream/RTCRtpDecodingParameters.idl: Added
+ * Modules/mediastream/RTCRtpEncodingParameters.h:
+ * Modules/mediastream/RTCRtpEncodingParameters.idl:
+ * Modules/mediastream/RTCRtpParameters.h:
+ * Modules/mediastream/RTCRtpParameters.idl:
+ * Modules/mediastream/RTCRtpReceiver.cpp:
+ * Modules/mediastream/RTCRtpSendParameters.h: Added.
+ (WebCore::RTCRtpSendParameters::RTCRtpSendParameters):
+ * Modules/mediastream/RTCRtpSendParameters.idl: Added.
+ * Modules/mediastream/RTCRtpSender.cpp:
+ (WebCore::RTCRtpSender::getParameters):
+ (WebCore::RTCRtpSender::setParameters):
+ * Modules/mediastream/RTCRtpSender.h:
+ * Modules/mediastream/RTCRtpSender.idl:
+ * Modules/mediastream/RTCRtpSenderBackend.h:
+ * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
+ (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
+ (WebCore::LibWebRTCRtpSenderBackend::setParameters):
+ * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
+ * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
+ (WebCore::toRTCRtpParameters):
+ (WebCore::toRTCRtpSendParameters):
+ (WebCore::fromRTCRtpSendParameters):
+ * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+
2018-09-13 Xabier Rodriguez Calvar <[email protected]>
[GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
Modified: trunk/Source/WebCore/DerivedSources.make (235972 => 235973)
--- trunk/Source/WebCore/DerivedSources.make 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/DerivedSources.make 2018-09-13 15:31:04 UTC (rev 235973)
@@ -251,6 +251,7 @@
$(WebCore)/Modules/mediastream/RTCRtpParameters.idl \
$(WebCore)/Modules/mediastream/RTCRtpReceiver.idl \
$(WebCore)/Modules/mediastream/RTCRtpRtxParameters.idl \
+ $(WebCore)/Modules/mediastream/RTCRtpSendParameters.idl \
$(WebCore)/Modules/mediastream/RTCRtpSender.idl \
$(WebCore)/Modules/mediastream/RTCRtpTransceiver.idl \
$(WebCore)/Modules/mediastream/RTCRtpTransceiverDirection.idl \
Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -35,7 +35,7 @@
#include "JSDOMPromiseDeferred.h"
#include "LibWebRTCProvider.h"
-#include "RTCRtpParameters.h"
+#include "RTCRtpSendParameters.h"
#include "RTCSessionDescription.h"
#include "RTCSignalingState.h"
#include <wtf/LoggerHelper.h>
Copied: trunk/Source/WebCore/Modules/mediastream/RTCRtpCodingParameters.h (from rev 235972, trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.h) (0 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpCodingParameters.h (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpCodingParameters.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEB_RTC)
+
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+struct RTCRtpCodingParameters {
+ String rid;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_RTC)
Copied: trunk/Source/WebCore/Modules/mediastream/RTCRtpCodingParameters.idl (from rev 235972, trunk/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.idl) (0 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpCodingParameters.idl (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpCodingParameters.idl 2018-09-13 15:31:04 UTC (rev 235973)
@@ -0,0 +1,32 @@
+/*
+* Copyright (C) 2018 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+* THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+[
+ Conditional=WEB_RTC,
+ EnabledAtRuntime=PeerConnection,
+ JSGenerateToJSObject,
+] dictionary RTCRtpCodingParameters {
+ DOMString rid;
+};
Copied: trunk/Source/WebCore/Modules/mediastream/RTCRtpDecodingParameters.h (from rev 235972, trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.h) (0 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpDecodingParameters.h (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpDecodingParameters.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEB_RTC)
+
+#include "RTCRtpCodingParameters.h"
+
+namespace WebCore {
+
+struct RTCRtpDecodingParameters : RTCRtpCodingParameters {
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_RTC)
Copied: trunk/Source/WebCore/Modules/mediastream/RTCRtpDecodingParameters.idl (from rev 235972, trunk/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.idl) (0 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpDecodingParameters.idl (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpDecodingParameters.idl 2018-09-13 15:31:04 UTC (rev 235973)
@@ -0,0 +1,31 @@
+/*
+* Copyright (C) 2018 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+* THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+[
+ Conditional=WEB_RTC,
+ EnabledAtRuntime=PeerConnection,
+ JSGenerateToJSObject,
+] dictionary RTCRtpDecodingParameters : RTCRtpCodingParameters {
+};
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.h (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.h 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -29,12 +29,13 @@
#include "RTCDtxStatus.h"
#include "RTCPriorityType.h"
+#include "RTCRtpCodingParameters.h"
#include "RTCRtpFecParameters.h"
#include "RTCRtpRtxParameters.h"
namespace WebCore {
-struct RTCRtpEncodingParameters {
+struct RTCRtpEncodingParameters : RTCRtpCodingParameters {
unsigned long ssrc { 0 };
RTCRtpRtxParameters rtx;
RTCRtpFecParameters fec;
@@ -43,7 +44,6 @@
RTCPriorityType priority { RTCPriorityType::Medium };
unsigned long maxBitrate { 0 };
unsigned long maxFramerate { 0 };
- String rid;
double scaleResolutionDownBy { 1 };
};
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.idl (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.idl 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpEncodingParameters.idl 2018-09-13 15:31:04 UTC (rev 235973)
@@ -27,7 +27,7 @@
Conditional=WEB_RTC,
EnabledAtRuntime=PeerConnection,
JSGenerateToJSObject,
-] dictionary RTCRtpEncodingParameters {
+] dictionary RTCRtpEncodingParameters : RTCRtpCodingParameters {
unsigned long ssrc;
RTCRtpRtxParameters rtx;
RTCRtpFecParameters fec;
@@ -36,6 +36,5 @@
RTCPriorityType priority;
unsigned long maxBitrate;
unsigned long maxFramerate;
- DOMString rid;
double scaleResolutionDownBy = 1;
};
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.h (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.h 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -27,21 +27,15 @@
#if ENABLE(WEB_RTC)
-#include "RTCDegradationPreference.h"
#include "RTCRtpCodecParameters.h"
-#include "RTCRtpEncodingParameters.h"
#include "RTCRtpHeaderExtensionParameters.h"
#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
namespace WebCore {
struct RTCRtpParameters {
- String transactionId;
- Vector<RTCRtpEncodingParameters> encodings;
Vector<RTCRtpHeaderExtensionParameters> headerExtensions;
Vector<RTCRtpCodecParameters> codecs;
- RTCDegradationPreference degradationPreference { RTCDegradationPreference::Balanced };
};
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.idl (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.idl 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.idl 2018-09-13 15:31:04 UTC (rev 235973)
@@ -28,10 +28,7 @@
EnabledAtRuntime=PeerConnection,
JSGenerateToJSObject,
] dictionary RTCRtpParameters {
- DOMString transactionId;
- sequence<RTCRtpEncodingParameters> encodings;
sequence<RTCRtpHeaderExtensionParameters> headerExtensions;
// FIXME: Add RTCRtcpParameters rtcp;
sequence<RTCRtpCodecParameters> codecs;
- RTCDegradationPreference degradationPreference = "balanced";
};
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpReceiver.cpp 2018-09-13 15:31:04 UTC (rev 235973)
@@ -33,8 +33,6 @@
#if ENABLE(WEB_RTC)
-#include "RTCRtpParameters.h"
-
namespace WebCore {
RTCRtpReceiver::RTCRtpReceiver(Ref<MediaStreamTrack>&& track, std::unique_ptr<RTCRtpReceiverBackend>&& backend)
Copied: trunk/Source/WebCore/Modules/mediastream/RTCRtpSendParameters.h (from rev 235972, trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.h) (0 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSendParameters.h (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSendParameters.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEB_RTC)
+
+#include "RTCDegradationPreference.h"
+#include "RTCRtpEncodingParameters.h"
+#include "RTCRtpParameters.h"
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+struct RTCRtpSendParameters : RTCRtpParameters {
+ RTCRtpSendParameters() = default;
+ explicit RTCRtpSendParameters(RTCRtpParameters&& parameters)
+ : RTCRtpParameters(WTFMove(parameters))
+ {
+ }
+
+ String transactionId;
+ Vector<RTCRtpEncodingParameters> encodings;
+ RTCDegradationPreference degradationPreference { RTCDegradationPreference::Balanced };
+};
+
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_RTC)
Copied: trunk/Source/WebCore/Modules/mediastream/RTCRtpSendParameters.idl (from rev 235972, trunk/Source/WebCore/Modules/mediastream/RTCRtpParameters.idl) (0 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSendParameters.idl (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSendParameters.idl 2018-09-13 15:31:04 UTC (rev 235973)
@@ -0,0 +1,34 @@
+/*
+* Copyright (C) 2018 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+* THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+[
+ Conditional=WEB_RTC,
+ EnabledAtRuntime=PeerConnection,
+ JSGenerateToJSObject,
+] dictionary RTCRtpSendParameters : RTCRtpParameters {
+ required DOMString transactionId;
+ required sequence<RTCRtpEncodingParameters> encodings;
+ RTCDegradationPreference degradationPreference = "balanced";
+};
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.cpp 2018-09-13 15:31:04 UTC (rev 235973)
@@ -94,7 +94,7 @@
m_backend->replaceTrack(context, *this, WTFMove(withTrack), WTFMove(promise));
}
-RTCRtpParameters RTCRtpSender::getParameters()
+RTCRtpSendParameters RTCRtpSender::getParameters()
{
if (isStopped())
return { };
@@ -101,7 +101,7 @@
return m_backend->getParameters();
}
-void RTCRtpSender::setParameters(const RTCRtpParameters& parameters, DOMPromiseDeferred<void>&& promise)
+void RTCRtpSender::setParameters(const RTCRtpSendParameters& parameters, DOMPromiseDeferred<void>&& promise)
{
if (isStopped()) {
promise.reject(InvalidStateError);
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.h (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.h 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -59,8 +59,8 @@
void replaceTrack(ScriptExecutionContext&, RefPtr<MediaStreamTrack>&&, DOMPromiseDeferred<void>&&);
- RTCRtpParameters getParameters();
- void setParameters(const RTCRtpParameters&, DOMPromiseDeferred<void>&&);
+ RTCRtpSendParameters getParameters();
+ void setParameters(const RTCRtpSendParameters&, DOMPromiseDeferred<void>&&);
RTCRtpSenderBackend* backend() { return m_backend.get(); }
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.idl (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.idl 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSender.idl 2018-09-13 15:31:04 UTC (rev 235973)
@@ -39,7 +39,7 @@
// FIXME 169662: missing rtcpTransport
// FIXME 169662: missing getCapabilities
// FIXME 169662: missing setStreams
- RTCRtpParameters getParameters();
- Promise<void> setParameters(RTCRtpParameters parameters);
+ RTCRtpSendParameters getParameters();
+ Promise<void> setParameters(RTCRtpSendParameters parameters);
[CallWith=ScriptExecutionContext] Promise<void> replaceTrack(MediaStreamTrack? withTrack);
};
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpSenderBackend.h (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpSenderBackend.h 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpSenderBackend.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -27,19 +27,19 @@
#if ENABLE(WEB_RTC)
#include "JSDOMPromiseDeferred.h"
-#include "RTCRtpParameters.h"
namespace WebCore {
class MediaStreamTrack;
class RTCRtpSender;
+struct RTCRtpSendParameters;
class ScriptExecutionContext;
class RTCRtpSenderBackend {
public:
virtual void replaceTrack(ScriptExecutionContext&, RTCRtpSender&, RefPtr<MediaStreamTrack>&&, DOMPromiseDeferred<void>&&) = 0;
- virtual RTCRtpParameters getParameters() const = 0;
- virtual void setParameters(const RTCRtpParameters&, DOMPromiseDeferred<void>&&) = 0;
+ virtual RTCRtpSendParameters getParameters() const = 0;
+ virtual void setParameters(const RTCRtpSendParameters&, DOMPromiseDeferred<void>&&) = 0;
virtual ~RTCRtpSenderBackend() = default;
};
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp 2018-09-13 15:31:04 UTC (rev 235973)
@@ -100,21 +100,21 @@
});
}
-RTCRtpParameters LibWebRTCRtpSenderBackend::getParameters() const
+RTCRtpSendParameters LibWebRTCRtpSenderBackend::getParameters() const
{
if (!m_rtcSender)
return { };
- return toRTCRtpParameters(m_rtcSender->GetParameters());
+ return toRTCRtpSendParameters(m_rtcSender->GetParameters());
}
-void LibWebRTCRtpSenderBackend::setParameters(const RTCRtpParameters& parameters, DOMPromiseDeferred<void>&& promise)
+void LibWebRTCRtpSenderBackend::setParameters(const RTCRtpSendParameters& parameters, DOMPromiseDeferred<void>&& promise)
{
if (!m_rtcSender) {
promise.reject(NotSupportedError);
return;
}
- auto error = m_rtcSender->SetParameters(fromRTCRtpParameters(parameters));
+ auto error = m_rtcSender->SetParameters(fromRTCRtpSendParameters(parameters));
if (!error.ok()) {
promise.reject(Exception { InvalidStateError, error.message() });
return;
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -96,8 +96,8 @@
private:
void replaceTrack(ScriptExecutionContext&, RTCRtpSender&, RefPtr<MediaStreamTrack>&&, DOMPromiseDeferred<void>&&) final;
- RTCRtpParameters getParameters() const final;
- void setParameters(const RTCRtpParameters&, DOMPromiseDeferred<void>&&) final;
+ RTCRtpSendParameters getParameters() const final;
+ void setParameters(const RTCRtpSendParameters&, DOMPromiseDeferred<void>&&) final;
WeakPtr<LibWebRTCPeerConnectionBackend> m_peerConnectionBackend;
rtc::scoped_refptr<webrtc::RtpSenderInterface> m_rtcSender;
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp 2018-09-13 15:31:04 UTC (rev 235973)
@@ -29,7 +29,7 @@
#include "LibWebRTCMacros.h"
#include "RTCPeerConnection.h"
-#include "RTCRtpParameters.h"
+#include "RTCRtpSendParameters.h"
#include <wtf/text/WTFString.h>
ALLOW_UNUSED_PARAMETERS_BEGIN
@@ -135,14 +135,22 @@
{
RTCRtpParameters parameters;
- parameters.transactionId = fromStdString(rtcParameters.transaction_id);
- for (auto& rtcEncoding : rtcParameters.encodings)
- parameters.encodings.append(toRTCEncodingParameters(rtcEncoding));
for (auto& extension : rtcParameters.header_extensions)
parameters.headerExtensions.append(toRTCHeaderExtensionParameters(extension));
for (auto& codec : rtcParameters.codecs)
parameters.codecs.append(toRTCCodecParameters(codec));
+ return parameters;
+}
+
+RTCRtpSendParameters toRTCRtpSendParameters(const webrtc::RtpParameters& rtcParameters)
+{
+ RTCRtpSendParameters parameters { toRTCRtpParameters(rtcParameters) };
+
+ parameters.transactionId = fromStdString(rtcParameters.transaction_id);
+ for (auto& rtcEncoding : rtcParameters.encodings)
+ parameters.encodings.append(toRTCEncodingParameters(rtcEncoding));
+
switch (rtcParameters.degradation_preference) {
// FIXME: Support DegradationPreference::DISABLED.
case webrtc::DegradationPreference::DISABLED:
@@ -159,7 +167,7 @@
return parameters;
}
-webrtc::RtpParameters fromRTCRtpParameters(const RTCRtpParameters& parameters)
+webrtc::RtpParameters fromRTCRtpSendParameters(const RTCRtpSendParameters& parameters)
{
webrtc::RtpParameters rtcParameters;
rtcParameters.transaction_id = parameters.transactionId.utf8().data();
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.h (235972 => 235973)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.h 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.h 2018-09-13 15:31:04 UTC (rev 235973)
@@ -38,6 +38,7 @@
namespace WebCore {
struct RTCRtpParameters;
+struct RTCRtpSendParameters;
struct RTCRtpTransceiverInit;
enum class RTCRtpTransceiverDirection;
@@ -44,6 +45,8 @@
RTCRtpParameters toRTCRtpParameters(const webrtc::RtpParameters&);
webrtc::RtpParameters fromRTCRtpParameters(const RTCRtpParameters&);
+RTCRtpSendParameters toRTCRtpSendParameters(const webrtc::RtpParameters&);
+webrtc::RtpParameters fromRTCRtpSendParameters(const RTCRtpSendParameters&);
RTCRtpTransceiverDirection toRTCRtpTransceiverDirection(webrtc::RtpTransceiverDirection);
webrtc::RtpTransceiverDirection fromRTCRtpTransceiverDirection(RTCRtpTransceiverDirection);
Modified: trunk/Source/WebCore/Sources.txt (235972 => 235973)
--- trunk/Source/WebCore/Sources.txt 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/Sources.txt 2018-09-13 15:31:04 UTC (rev 235973)
@@ -2884,6 +2884,7 @@
JSRTCRtpParameters.cpp
JSRTCRtpRtxParameters.cpp
JSRTCRtpReceiver.cpp
+JSRTCRtpSendParameters.cpp
JSRTCRtpSender.cpp
JSRTCRtpTransceiver.cpp
JSRTCRtpTransceiverDirection.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (235972 => 235973)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-09-13 13:39:55 UTC (rev 235972)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-09-13 15:31:04 UTC (rev 235973)
@@ -7232,6 +7232,12 @@
4147E2B41C89912600A7E715 /* FetchLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchLoader.cpp; sourceTree = "<group>"; };
4147E2B51C89912600A7E715 /* FetchLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchLoader.h; sourceTree = "<group>"; };
4147E2B61C89912600A7E715 /* FetchLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchLoaderClient.h; sourceTree = "<group>"; };
+ 414AD3FC2149842000521676 /* RTCRtpSendParameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCRtpSendParameters.h; sourceTree = "<group>"; };
+ 414AD3FE2149842000521676 /* RTCRtpSendParameters.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RTCRtpSendParameters.idl; sourceTree = "<group>"; };
+ 414AD3FF21498D3000521676 /* RTCRtpCodingParameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCRtpCodingParameters.h; sourceTree = "<group>"; };
+ 414AD40021498D3100521676 /* RTCRtpDecodingParameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCRtpDecodingParameters.h; sourceTree = "<group>"; };
+ 414AD40121498D3100521676 /* RTCRtpDecodingParameters.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RTCRtpDecodingParameters.idl; sourceTree = "<group>"; };
+ 414AD40221498D3200521676 /* RTCRtpCodingParameters.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RTCRtpCodingParameters.idl; sourceTree = "<group>"; };
414B82021D6DF0D90077EBE3 /* StructuredClone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructuredClone.cpp; sourceTree = "<group>"; };
414B82031D6DF0D90077EBE3 /* StructuredClone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructuredClone.h; sourceTree = "<group>"; };
414DEDE51F9FE9150047C40D /* EmptyFrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyFrameLoaderClient.h; sourceTree = "<group>"; };
@@ -15184,6 +15190,10 @@
41E593FD214865A900D3CB61 /* RTCPriorityType.idl */,
41FCB75F214866FF0038ADC6 /* RTCRtpCodecParameters.h */,
41FCB759214865D30038ADC6 /* RTCRtpCodecParameters.idl */,
+ 414AD3FF21498D3000521676 /* RTCRtpCodingParameters.h */,
+ 414AD40221498D3200521676 /* RTCRtpCodingParameters.idl */,
+ 414AD40021498D3100521676 /* RTCRtpDecodingParameters.h */,
+ 414AD40121498D3100521676 /* RTCRtpDecodingParameters.idl */,
41FCB761214867000038ADC6 /* RTCRtpEncodingParameters.h */,
41E593FF214865AA00D3CB61 /* RTCRtpEncodingParameters.idl */,
41FCB75B214866FD0038ADC6 /* RTCRtpFecParameters.h */,
@@ -15202,6 +15212,8 @@
5E2C435A1BCEE30D0001E2BC /* RTCRtpSender.h */,
5E2C435B1BCEE30D0001E2BC /* RTCRtpSender.idl */,
41D1A046213EDDEB0063FB6B /* RTCRtpSenderBackend.h */,
+ 414AD3FC2149842000521676 /* RTCRtpSendParameters.h */,
+ 414AD3FE2149842000521676 /* RTCRtpSendParameters.idl */,
5E5E2B101CFC3E4B000C0D85 /* RTCRtpTransceiver.cpp */,
5E5E2B111CFC3E4B000C0D85 /* RTCRtpTransceiver.h */,
5E5E2B121CFC3E4B000C0D85 /* RTCRtpTransceiver.idl */,