Remove OpenWebRTC backend
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Oct 2017 17:50:07 +0000 (17:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Oct 2017 17:50:07 +0000 (17:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177868

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-04
Reviewed by Alejandro G. Castro.

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/MediaEndpointPeerConnection.cpp: Removed.
* Modules/mediastream/MediaEndpointPeerConnection.h: Removed.
* Modules/mediastream/MediaEndpointSessionDescription.cpp: Removed.
* Modules/mediastream/MediaEndpointSessionDescription.h: Removed.
* Modules/mediastream/SDPProcessor.cpp: Removed.
* Modules/mediastream/SDPProcessor.h: Removed.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
* WebCore.xcodeproj/project.pbxproj:
* platform/GStreamer.cmake:
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Removed.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Removed.
* platform/mediastream/MediaEndpoint.cpp: Removed.
* platform/mediastream/MediaEndpoint.h: Removed.
* platform/mediastream/MediaEndpointSessionConfiguration.h: Removed.
* platform/mediastream/SDPProcessorScriptResource.cpp: Removed.
* platform/mediastream/SDPProcessorScriptResource.h: Removed.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Removed.
* platform/mediastream/openwebrtc/MediaEndpointOwr.h: Removed.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Removed.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Removed.
* platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Removed.
* platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
* platform/mock/MockMediaEndpoint.cpp: Removed.
* platform/mock/MockMediaEndpoint.h: Removed.
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
* platform/mock/MockRealtimeMediaSource.h:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::enableMockMediaEndpoint): Deleted.
* testing/Internals.h:

LayoutTests:

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222858 268f45cc-cd09-0410-ab3c-d52691b4dbfc

42 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp [deleted file]
Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h [deleted file]
Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp [deleted file]
Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.h [deleted file]
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/SDPProcessor.cpp [deleted file]
Source/WebCore/Modules/mediastream/SDPProcessor.h [deleted file]
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/GStreamer.cmake
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp [deleted file]
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h [deleted file]
Source/WebCore/platform/mediastream/MediaEndpoint.cpp [deleted file]
Source/WebCore/platform/mediastream/MediaEndpoint.h [deleted file]
Source/WebCore/platform/mediastream/MediaEndpointSessionConfiguration.h [deleted file]
Source/WebCore/platform/mediastream/MediaStreamPrivate.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp
Source/WebCore/platform/mediastream/SDPProcessorScriptResource.cpp [deleted file]
Source/WebCore/platform/mediastream/SDPProcessorScriptResource.h [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.h [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h [deleted file]
Source/WebCore/platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h [deleted file]
Source/WebCore/platform/mock/MockMediaEndpoint.cpp [deleted file]
Source/WebCore/platform/mock/MockMediaEndpoint.h [deleted file]
Source/WebCore/platform/mock/MockRealtimeMediaSource.cpp
Source/WebCore/platform/mock/MockRealtimeMediaSource.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h

index 30dd234..a4037ba 100644 (file)
@@ -1,3 +1,12 @@
+2017-10-04  Youenn Fablet  <youenn@apple.com>
+
+        Remove OpenWebRTC backend
+        https://bugs.webkit.org/show_bug.cgi?id=177868
+
+        Reviewed by Alejandro G. Castro.
+
+        * platform/gtk/TestExpectations:
+
 2017-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed GTK+ gardening. Remove tests from expectations passing since freetype upgrade in r221670.
index c9b5885..a97a28e 100644 (file)
@@ -591,82 +591,11 @@ webkit.org/b/99036 fast/shadow-dom/pointerlockelement-in-slot.html [ Skip ]
 webkit.org/b/85211 ietestcenter/css3/flexbox/flexbox-align-stretch-001.htm [ ImageOnlyFailure ]
 webkit.org/b/85212 ietestcenter/css3/flexbox/flexbox-layout-002.htm [ ImageOnlyFailure ]
 
-# WebRTC / MediaStream implementation is not complete yet.
-# Some of this tests are skipped on the general TestExpectations,
-# Enable them here and list the individual expectations in order to get
-# notifications of new failures.
 fast/mediastream [ Pass ]
-webrtc [ Pass ]
-# GTK uses OWR instead of libwebrtc
-webrtc/libwebrtc [ Skip ]
-# Some WebRTC features like datachannel are still not implemented
-webrtc/audio-replace-track.html [ Failure ]
-webrtc/audio-muted-stats.html [ Failure ]
-webrtc/audio-muted-stats2.html [ Failure ]
-webrtc/captureCanvas-webrtc.html [ Failure ]
-webrtc/closing-peerconnection.html [ Timeout ]
-webrtc/connection-state.html [ Failure ]
-webrtc/datachannel [ Skip ]
-webrtc/ephemeral-certificates-and-cnames.html [ Failure ]
-webrtc/multi-video.html [ Failure ]
-webrtc/no-port-zero-in-upd-candidates.html [ Timeout ]
-webrtc/peer-connection-audio-mute2.html [ Crash Failure ]
-webrtc/peer-connection-audio-mute.html [ Failure ]
-webrtc/peer-connection-audio-unmute.html [ Failure ]
-webrtc/peer-connection-remote-audio-mute2.html [ Crash Failure ]
-webrtc/peer-connection-remote-audio-mute.html [ Failure ]
-webrtc/peer-connection-track-end.html [ Failure ]
-webrtc/video-addTrack.html [ Crash ]
-webrtc/video-disabled-black.html [ Failure ]
-webrtc/video-mediastreamtrack-stats.html [ Failure ]
-webrtc/video-mute.html [ Failure Timeout ]
-webrtc/video-remote-mute.html [ Failure ]
-webrtc/video-replace-muted-track.html [ Failure Timeout Crash ]
-webkit.org/b/176801 webrtc/video-replace-track.html [ Failure Crash ]
-webkit.org/b/176801 webrtc/video-getParameters.html [ Failure Crash ]
-webkit.org/b/176801 webrtc/video.html [ Failure Crash ]
-webrtc/video-replace-track-to-null.html [ Failure ]
-webrtc/video-rotation.html [ Failure ]
-webrtc/video-stats.html [ Failure Crash ]
-webrtc/video-unmute.html [ Failure Timeout ]
-webrtc/video-with-data-channel.html [ Failure ]
-webrtc/video-with-receiver.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createAnswer.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCDataChannel-bufferedAmount.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCIceTransport.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-addTransceiver.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-connectionState.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-getStats.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-ondatachannel.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/RTCDTMFSender-insertDTMF.html [ Crash ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-ontrack.html [ Crash ]
-imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html [ Crash ]
-imported/w3c/web-platform-tests/webrtc/RTCRtpSender-replaceTrack.html [ Crash ]
-imported/w3c/web-platform-tests/webrtc/datachannel-emptystring.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/no-media-call.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/promises-call.html [ Failure ]
-imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/setRemoteDescription.html [ Failure ]
-http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html [ Timeout ]
-http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html [ Timeout ]
-http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html [ Timeout ]
-webrtc/filtering-ice-candidate-after-reload.html [ Timeout ]
-webrtc/ice-candidate-sdpMLineIndex.html [ Timeout ]
+# Skipping until backend is implemented
+webrtc [ Skip ]
+imported/w3c/web-platform-tests/webrtc/ [ Skip ]
 http/tests/media/media-stream/getusermedia-with-canvas.html [ Timeout ]
-webkit.org/b/169110 webrtc/audio-peer-connection-webaudio.html [ Failure Timeout ]
-webkit.org/b/173456 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html [ Crash ]
-webkit.org/b/173456 webrtc/createOfferAnswer.html  [ Crash ]
-webkit.org/b/173456 webrtc/video-addTransceiver.html [ Crash ]
 # The MediaStream implementation is also still not completed
 webkit.org/b/79203 fast/mediastream/mock-media-source-webaudio.html [ Timeout ]
 webkit.org/b/79203 fast/mediastream/getUserMedia-webaudio.html [ Failure ]
@@ -1231,7 +1160,6 @@ webkit.org/b/175419 imported/w3c/web-platform-tests/streams/readable-byte-stream
 fast/images/animated-image-mp4.html [ Skip ]
 
 webkit.org/b/177532 accessibility/image-load-on-delay.html [ Failure ]
-webkit.org/b/177533 webrtc/video-interruption.html [ Failure ]
 
 webkit.org/b/177632 fast/text/flag-codepoint.html [ ImageOnlyFailure ]
 
@@ -1360,7 +1288,6 @@ webkit.org/b/176805 media/media-higher-prio-audio-stream.html [ Crash ]
 webkit.org/b/176806 media/track/track-text-track-cue-list.html [ Crash ]
 
 webkit.org/b/176856 fast/mediastream/apply-constraints-video.html [ Crash ]
-webkit.org/b/176850 webrtc/clone-audio-track.html [ Failure Crash ]
 webkit.org/b/176861 imported/w3c/web-platform-tests/media-source/mediasource-sourcebuffer-mode.html [ Crash ]
 
 # See also webkit.org/b/141699
@@ -1372,8 +1299,6 @@ webkit.org/b/177537 http/tests/multipart/multipart-html.php [ Crash ]
 
 webkit.org/b/177816 webgl/1.0.2/conformance/ogles/GL/vec/vec_001_to_008.html [ Crash Pass ]
 
-webkit.org/b/177818 webrtc/negotiatedneeded-event-addStream.html [ Crash Pass ]
-
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of Crashing tests
 #////////////////////////////////////////////////////////////////////////////////////////
index 1cc16c7..7f22e51 100644 (file)
@@ -1093,8 +1093,6 @@ set(WebCore_SOURCES
     Modules/mediastream/MediaDevices.cpp
     Modules/mediastream/MediaDevicesEnumerationRequest.cpp
     Modules/mediastream/MediaDevicesRequest.cpp
-    Modules/mediastream/MediaEndpointPeerConnection.cpp
-    Modules/mediastream/MediaEndpointSessionDescription.cpp
     Modules/mediastream/MediaStream.cpp
     Modules/mediastream/MediaStreamEvent.cpp
     Modules/mediastream/MediaStreamRegistry.cpp
@@ -1116,7 +1114,6 @@ set(WebCore_SOURCES
     Modules/mediastream/RTCRtpTransceiver.cpp
     Modules/mediastream/RTCSessionDescription.cpp
     Modules/mediastream/RTCTrackEvent.cpp
-    Modules/mediastream/SDPProcessor.cpp
     Modules/mediastream/UserMediaController.cpp
     Modules/mediastream/UserMediaRequest.cpp
 
@@ -2554,13 +2551,11 @@ set(WebCore_SOURCES
     platform/mediastream/RealtimeMediaSource.cpp
     platform/mediastream/RealtimeMediaSourceCenter.cpp
     platform/mediastream/RealtimeMediaSourceSettings.cpp
-    platform/mediastream/SDPProcessorScriptResource.cpp
 
     platform/mediastream/libwebrtc/LibWebRTCProvider.cpp
 
     platform/mock/DeviceOrientationClientMock.cpp
     platform/mock/GeolocationClientMock.cpp
-    platform/mock/MockMediaEndpoint.cpp
     platform/mock/MockRealtimeAudioSource.cpp
     platform/mock/MockRealtimeMediaSource.cpp
     platform/mock/MockRealtimeMediaSourceCenter.cpp
@@ -3882,24 +3877,6 @@ if (WebCore_USER_AGENT_SCRIPTS)
     list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/UserAgentScriptsData.cpp)
 endif ()
 
-if (ENABLE_WEB_RTC)
-    # Necessary variables:
-    # WebCore_SDP_PROCESSOR_SCRIPTS containing the JavaScript sources list
-    # WebCore_SDP_PROCESSOR_SCRIPTS_DEPENDENCIES containing the source file that will load the scripts to add the proper
-    #   dependency and having them built at the right moment
-    set(WebCore_SDP_PROCESSOR_SCRIPTS ${WEBCORE_DIR}/Modules/mediastream/sdp.js)
-    set(WebCore_SDP_PROCESSOR_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/mediastream/SDPProcessorScriptResource.cpp)
-
-    MAKE_JS_FILE_ARRAYS(
-        ${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScriptsData.cpp
-        ${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScriptsData.h
-        WebCore
-        WebCore_SDP_PROCESSOR_SCRIPTS
-        WebCore_SDP_PROCESSOR_SCRIPTS_DEPENDENCIES
-    )
-    list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScriptsData.cpp)
-endif ()
-
 # Generate plug-in resources
 add_custom_command(
     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/PlugInsResourcesData.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/PlugInsResources.h
index e27d799..22deb90 100644 (file)
@@ -1,3 +1,52 @@
+2017-10-04  Youenn Fablet  <youenn@apple.com>
+
+        Remove OpenWebRTC backend
+        https://bugs.webkit.org/show_bug.cgi?id=177868
+
+        Reviewed by Alejandro G. Castro.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Modules/mediastream/MediaEndpointPeerConnection.cpp: Removed.
+        * Modules/mediastream/MediaEndpointPeerConnection.h: Removed.
+        * Modules/mediastream/MediaEndpointSessionDescription.cpp: Removed.
+        * Modules/mediastream/MediaEndpointSessionDescription.h: Removed.
+        * Modules/mediastream/SDPProcessor.cpp: Removed.
+        * Modules/mediastream/SDPProcessor.h: Removed.
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/GStreamer.cmake:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::buildMediaEnginesVector):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::supportsType):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Removed.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Removed.
+        * platform/mediastream/MediaEndpoint.cpp: Removed.
+        * platform/mediastream/MediaEndpoint.h: Removed.
+        * platform/mediastream/MediaEndpointSessionConfiguration.h: Removed.
+        * platform/mediastream/SDPProcessorScriptResource.cpp: Removed.
+        * platform/mediastream/SDPProcessorScriptResource.h: Removed.
+        * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Removed.
+        * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Removed.
+        * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Removed.
+        * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Removed.
+        * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Removed.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Removed.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Removed.
+        * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
+        * platform/mock/MockMediaEndpoint.cpp: Removed.
+        * platform/mock/MockMediaEndpoint.h: Removed.
+        * platform/mock/MockRealtimeMediaSource.cpp:
+        (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
+        * platform/mock/MockRealtimeMediaSource.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::Internals):
+        (WebCore::Internals::enableMockMediaEndpoint): Deleted.
+        * testing/Internals.h:
+
 2017-10-04  Zalan Bujtas  <zalan@apple.com>
 
         Remove RenderTreeInternalMutationScope
index 1d5ef02..d36a198 100644 (file)
@@ -1184,23 +1184,6 @@ ColorData.cpp : platform/ColorData.gperf $(WebCore)/make-hash-tools.pl
 
 # --------
 
-# WebRTC scripts
-
-WEBCORE_SDP_PROCESSOR_SCRIPTS = 
-
-ifeq ($(OS),MACOS)
-    WEBCORE_SDP_PROCESSOR_SCRIPTS := $(WEBCORE_SDP_PROCESSOR_SCRIPTS) $(WebCore)/Modules/mediastream/sdp.js
-endif
-
-ifdef WEBCORE_SDP_PROCESSOR_SCRIPTS
-all : SDPProcessorScriptsData.h
-
-SDPProcessorScriptsData.h : $(JavaScriptCore_SCRIPTS_DIR)/make-js-file-arrays.py $(WEBCORE_SDP_PROCESSOR_SCRIPTS)
-       $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/make-js-file-arrays.py -n WebCore $@ SDPProcessorScriptsData.cpp $(WEBCORE_SDP_PROCESSOR_SCRIPTS)
-endif
-
-# --------
-
 # user agent style sheets
 
 USER_AGENT_STYLE_SHEETS = $(WebCore)/css/html.css $(WebCore)/css/quirks.css $(WebCore)/css/plugIns.css
diff --git a/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp b/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
deleted file mode 100644 (file)
index 1e92527..0000000
+++ /dev/null
@@ -1,893 +0,0 @@
-/*
- * Copyright (C) 2015 Ericsson AB. All rights reserved.
- * 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#include "config.h"
-#include "MediaEndpointPeerConnection.h"
-
-#if ENABLE(WEB_RTC)
-
-#include "EventNames.h"
-#include "JSRTCSessionDescription.h"
-#include "MediaEndpointSessionConfiguration.h"
-#include "MediaEndpointSessionDescription.h"
-#include "MediaStream.h"
-#include "MediaStreamEvent.h"
-#include "MediaStreamTrack.h"
-#include "NotImplemented.h"
-#include "PeerMediaDescription.h"
-#include "RTCAnswerOptions.h"
-#include "RTCConfiguration.h"
-#include "RTCIceCandidate.h"
-#include "RTCOfferOptions.h"
-#include "RTCPeerConnection.h"
-#include "RTCPeerConnectionIceEvent.h"
-#include "RTCRtpTransceiver.h"
-#include "RTCTrackEvent.h"
-#include "SDPProcessor.h"
-#include <wtf/Function.h>
-#include <wtf/MainThread.h>
-#include <wtf/text/Base64.h>
-
-namespace WebCore {
-
-using namespace PeerConnection;
-
-using MediaDescriptionVector = Vector<PeerMediaDescription>;
-using RtpTransceiverVector = Vector<RefPtr<RTCRtpTransceiver>>;
-
-// We use base64 to generate the random strings so we need a size that avoids padding to get ice-chars.
-static const size_t cnameSize = 18;
-// Size range from 4 to 256 ice-chars defined in RFC 5245.
-static const size_t iceUfragSize = 6;
-// Size range from 22 to 256 ice-chars defined in RFC 5245.
-static const size_t icePasswordSize = 24;
-
-#if !USE(LIBWEBRTC)
-static std::unique_ptr<PeerConnectionBackend> createMediaEndpointPeerConnection(RTCPeerConnection& peerConnection)
-{
-    return std::unique_ptr<PeerConnectionBackend>(new MediaEndpointPeerConnection(peerConnection));
-}
-
-CreatePeerConnectionBackend PeerConnectionBackend::create = createMediaEndpointPeerConnection;
-#endif
-
-static String randomString(size_t size)
-{
-    unsigned char randomValues[size];
-    cryptographicallyRandomValues(randomValues, size);
-    return base64Encode(randomValues, size);
-}
-
-MediaEndpointPeerConnection::MediaEndpointPeerConnection(RTCPeerConnection& peerConnection)
-    : PeerConnectionBackend(peerConnection)
-    , m_mediaEndpoint(MediaEndpoint::create(*this))
-    , m_sdpProcessor(std::make_unique<SDPProcessor>(m_peerConnection.scriptExecutionContext()))
-    , m_cname(randomString(cnameSize))
-    , m_iceUfrag(randomString(iceUfragSize))
-    , m_icePassword(randomString(icePasswordSize))
-{
-    ASSERT(m_mediaEndpoint);
-
-    m_defaultAudioPayloads = m_mediaEndpoint->getDefaultAudioPayloads();
-    m_defaultVideoPayloads = m_mediaEndpoint->getDefaultVideoPayloads();
-
-    // Tasks (see runTask()) will be deferred until we get the DTLS fingerprint.
-    m_mediaEndpoint->generateDtlsInfo();
-}
-
-static RTCRtpTransceiver* matchTransceiver(const RtpTransceiverVector& transceivers, const WTF::Function<bool(RTCRtpTransceiver&)>& matchFunction)
-{
-    for (auto& transceiver : transceivers) {
-        if (matchFunction(*transceiver))
-            return transceiver.get();
-    }
-    return nullptr;
-}
-
-static RTCRtpTransceiver* matchTransceiverByMid(const RtpTransceiverVector& transceivers, const String& mid)
-{
-    return matchTransceiver(transceivers, [&mid] (RTCRtpTransceiver& current) {
-        return current.mid() == mid;
-    });
-}
-
-static bool hasUnassociatedTransceivers(const RtpTransceiverVector& transceivers)
-{
-    return matchTransceiver(transceivers, [] (RTCRtpTransceiver& current) {
-        return current.mid().isNull() && !current.stopped();
-    });
-}
-
-void MediaEndpointPeerConnection::runTask(Function<void ()>&& task)
-{
-    if (m_dtlsFingerprint.isNull()) {
-        // Only one task needs to be deferred since it will hold off any others until completed.
-        ASSERT(!m_initialDeferredTask);
-        m_initialDeferredTask = WTFMove(task);
-    } else
-        callOnMainThread(WTFMove(task));
-}
-
-void MediaEndpointPeerConnection::startRunningTasks()
-{
-    if (!m_initialDeferredTask)
-        return;
-
-    m_initialDeferredTask();
-    m_initialDeferredTask = nullptr;
-}
-
-void MediaEndpointPeerConnection::doCreateOffer(RTCOfferOptions&& options)
-{
-    runTask([this, protectedOptions = WTFMove(options)]() mutable {
-        createOfferTask(protectedOptions);
-    });
-}
-
-void MediaEndpointPeerConnection::createOfferTask(const RTCOfferOptions&)
-{
-    ASSERT(!m_dtlsFingerprint.isEmpty());
-
-    MediaEndpointSessionDescription* localDescription = internalLocalDescription();
-    RefPtr<MediaEndpointSessionConfiguration> configurationSnapshot = localDescription ?
-        localDescription->configuration()->clone() : MediaEndpointSessionConfiguration::create();
-
-    configurationSnapshot->setBundlePolicy(m_peerConnection.getConfiguration().bundlePolicy);
-    configurationSnapshot->setSessionVersion(m_sdpOfferSessionVersion++);
-
-    auto transceivers = RtpTransceiverVector(m_peerConnection.getTransceivers());
-
-    // Remove any transceiver objects from transceivers that can be matched to an existing media description.
-    for (auto& mediaDescription : configurationSnapshot->mediaDescriptions()) {
-        if (!mediaDescription.port) {
-            // This media description should be recycled.
-            continue;
-        }
-
-        RTCRtpTransceiver* transceiver = matchTransceiverByMid(transceivers, mediaDescription.mid);
-        if (!transceiver)
-            continue;
-
-        mediaDescription.mode = transceiver->directionString();
-        if (transceiver->hasSendingDirection()) {
-            auto& sender = transceiver->sender();
-
-            mediaDescription.mediaStreamId = sender.mediaStreamIds()[0];
-            mediaDescription.mediaStreamTrackId = sender.trackId();
-        }
-
-        transceivers.removeFirst(transceiver);
-    }
-
-    // Add media descriptions for remaining transceivers.
-    for (auto& transceiver : transceivers) {
-        PeerMediaDescription mediaDescription;
-        auto& sender = transceiver->sender();
-
-        mediaDescription.mode = transceiver->directionString();
-        mediaDescription.mid = transceiver->provisionalMid();
-        mediaDescription.mediaStreamId = sender.mediaStreamIds()[0];
-        mediaDescription.type = sender.trackKind();
-        mediaDescription.payloads = sender.trackKind() == "audio" ? m_defaultAudioPayloads : m_defaultVideoPayloads;
-        mediaDescription.dtlsFingerprintHashFunction = m_dtlsFingerprintFunction;
-        mediaDescription.dtlsFingerprint = m_dtlsFingerprint;
-        mediaDescription.cname = m_cname;
-        mediaDescription.addSsrc(cryptographicallyRandomNumber());
-        mediaDescription.iceUfrag = m_iceUfrag;
-        mediaDescription.icePassword = m_icePassword;
-
-        if (sender.track())
-            mediaDescription.mediaStreamTrackId = sender.trackId();
-
-        configurationSnapshot->addMediaDescription(WTFMove(mediaDescription));
-    }
-
-    String sdp;
-    SDPProcessor::Result result = m_sdpProcessor->generate(*configurationSnapshot, sdp);
-    if (result != SDPProcessor::Result::Success) {
-        createOfferFailed(Exception { OperationError, "SDPProcessor internal error" });
-        return;
-    }
-    createOfferSucceeded(WTFMove(sdp));
-}
-
-void MediaEndpointPeerConnection::doCreateAnswer(RTCAnswerOptions&& options)
-{
-    runTask([this, protectedOptions = WTFMove(options)]() mutable {
-        createAnswerTask(protectedOptions);
-    });
-}
-
-void MediaEndpointPeerConnection::createAnswerTask(const RTCAnswerOptions&)
-{
-    ASSERT(!m_dtlsFingerprint.isEmpty());
-
-    if (!internalRemoteDescription()) {
-        createAnswerFailed(Exception { InvalidStateError, "No remote description set" });
-        return;
-    }
-
-    MediaEndpointSessionDescription* localDescription = internalLocalDescription();
-    RefPtr<MediaEndpointSessionConfiguration> configurationSnapshot = localDescription ?
-        localDescription->configuration()->clone() : MediaEndpointSessionConfiguration::create();
-
-    configurationSnapshot->setBundlePolicy(m_peerConnection.getConfiguration().bundlePolicy);
-    configurationSnapshot->setSessionVersion(m_sdpAnswerSessionVersion++);
-
-    auto transceivers = RtpTransceiverVector(m_peerConnection.getTransceivers());
-    auto& remoteMediaDescriptions = internalRemoteDescription()->configuration()->mediaDescriptions();
-
-    for (unsigned i = 0; i < remoteMediaDescriptions.size(); ++i) {
-        auto& remoteMediaDescription = remoteMediaDescriptions[i];
-
-        auto* transceiver = matchTransceiverByMid(transceivers, remoteMediaDescription.mid);
-        if (!transceiver) {
-            LOG_ERROR("Could not find a matching transceiver for remote description while creating answer");
-            continue;
-        }
-
-        if (i >= configurationSnapshot->mediaDescriptions().size()) {
-            PeerMediaDescription newMediaDescription;
-
-            auto& sender = transceiver->sender();
-            if (sender.track()) {
-                if (sender.mediaStreamIds().size())
-                    newMediaDescription.mediaStreamId = sender.mediaStreamIds()[0];
-                newMediaDescription.mediaStreamTrackId = sender.trackId();
-                newMediaDescription.addSsrc(cryptographicallyRandomNumber());
-            }
-
-            newMediaDescription.mode = transceiver->directionString();
-            newMediaDescription.type = remoteMediaDescription.type;
-            newMediaDescription.mid = remoteMediaDescription.mid;
-            newMediaDescription.dtlsSetup = remoteMediaDescription.dtlsSetup == "active" ? "passive" : "active";
-            newMediaDescription.dtlsFingerprintHashFunction = m_dtlsFingerprintFunction;
-            newMediaDescription.dtlsFingerprint = m_dtlsFingerprint;
-            newMediaDescription.cname = m_cname;
-            newMediaDescription.iceUfrag = m_iceUfrag;
-            newMediaDescription.icePassword = m_icePassword;
-
-            configurationSnapshot->addMediaDescription(WTFMove(newMediaDescription));
-        }
-
-        PeerMediaDescription& localMediaDescription = configurationSnapshot->mediaDescriptions()[i];
-
-        localMediaDescription.payloads = remoteMediaDescription.payloads;
-        localMediaDescription.rtcpMux = remoteMediaDescription.rtcpMux;
-
-        if (!localMediaDescription.ssrcs.size())
-            localMediaDescription.addSsrc(cryptographicallyRandomNumber());
-
-        if (localMediaDescription.dtlsSetup == "actpass")
-            localMediaDescription.dtlsSetup = "passive";
-
-        transceivers.removeFirst(transceiver);
-    }
-
-    // Unassociated (non-stopped) transceivers need to be negotiated in a follow-up offer.
-    if (hasUnassociatedTransceivers(transceivers))
-        markAsNeedingNegotiation();
-
-    String sdp;
-    SDPProcessor::Result result = m_sdpProcessor->generate(*configurationSnapshot, sdp);
-    if (result != SDPProcessor::Result::Success) {
-        createAnswerFailed(Exception { OperationError, "SDPProcessor internal error" });
-        return;
-    }
-    createAnswerSucceeded(WTFMove(sdp));
-}
-
-static RealtimeMediaSourceMap createSourceMap(const MediaDescriptionVector& remoteMediaDescriptions, unsigned localMediaDescriptionCount, const RtpTransceiverVector& transceivers)
-{
-    RealtimeMediaSourceMap sourceMap;
-
-    for (unsigned i = 0; i < remoteMediaDescriptions.size() && i < localMediaDescriptionCount; ++i) {
-        auto& remoteMediaDescription = remoteMediaDescriptions[i];
-        if (remoteMediaDescription.type != "audio" && remoteMediaDescription.type != "video")
-            continue;
-
-        RTCRtpTransceiver* transceiver = matchTransceiverByMid(transceivers, remoteMediaDescription.mid);
-        if (transceiver) {
-            if (transceiver->hasSendingDirection() && transceiver->sender().track())
-                sourceMap.set(transceiver->mid(), &transceiver->sender().track()->source());
-        }
-    }
-
-    return sourceMap;
-}
-
-void MediaEndpointPeerConnection::doSetLocalDescription(RTCSessionDescription& description)
-{
-    runTask([this, protectedDescription = RefPtr<RTCSessionDescription>(&description)]() mutable {
-        setLocalDescriptionTask(WTFMove(protectedDescription));
-    });
-}
-
-void MediaEndpointPeerConnection::setLocalDescriptionTask(RefPtr<RTCSessionDescription>&& description)
-{
-    if (m_peerConnection.isClosed())
-        return;
-
-    auto result = MediaEndpointSessionDescription::create(WTFMove(description), *m_sdpProcessor);
-    if (result.hasException()) {
-        setLocalDescriptionFailed(result.releaseException());
-        return;
-    }
-    auto newDescription = result.releaseReturnValue();
-
-    const RtpTransceiverVector& transceivers = m_peerConnection.getTransceivers();
-    const MediaDescriptionVector& mediaDescriptions = newDescription->configuration()->mediaDescriptions();
-    MediaEndpointSessionDescription* localDescription = internalLocalDescription();
-    unsigned previousNumberOfMediaDescriptions = localDescription ? localDescription->configuration()->mediaDescriptions().size() : 0;
-    bool hasNewMediaDescriptions = mediaDescriptions.size() > previousNumberOfMediaDescriptions;
-    bool isInitiator = newDescription->type() == RTCSdpType::Offer;
-
-    if (hasNewMediaDescriptions) {
-        MediaEndpoint::UpdateResult result = m_mediaEndpoint->updateReceiveConfiguration(newDescription->configuration(), isInitiator);
-
-        if (result == MediaEndpoint::UpdateResult::SuccessWithIceRestart) {
-            if (m_peerConnection.iceGatheringState() != RTCIceGatheringState::Gathering)
-                m_peerConnection.updateIceGatheringState(RTCIceGatheringState::Gathering);
-
-            if (m_peerConnection.iceConnectionState() != RTCIceConnectionState::Completed)
-                m_peerConnection.updateIceConnectionState(RTCIceConnectionState::Connected);
-
-            LOG_ERROR("ICE restart is not implemented");
-            notImplemented();
-
-        } else if (result == MediaEndpoint::UpdateResult::Failed) {
-            setLocalDescriptionFailed(Exception { OperationError, "Unable to apply session description" });
-            return;
-        }
-
-        // Associate media descriptions with transceivers (set provisional mid to 'final' mid).
-        for (auto& mediaDescription : mediaDescriptions) {
-            RTCRtpTransceiver* transceiver = matchTransceiver(transceivers, [&mediaDescription] (RTCRtpTransceiver& current) {
-                return current.provisionalMid() == mediaDescription.mid;
-            });
-            if (transceiver)
-                transceiver->setMid(transceiver->provisionalMid());
-        }
-    }
-
-    if (internalRemoteDescription()) {
-        MediaEndpointSessionConfiguration* remoteConfiguration = internalRemoteDescription()->configuration();
-        RealtimeMediaSourceMap sendSourceMap = createSourceMap(remoteConfiguration->mediaDescriptions(), mediaDescriptions.size(), transceivers);
-
-        if (m_mediaEndpoint->updateSendConfiguration(remoteConfiguration, sendSourceMap, isInitiator) == MediaEndpoint::UpdateResult::Failed) {
-            setLocalDescriptionFailed(Exception { OperationError, "Unable to apply session description" });
-            return;
-        }
-    }
-
-    if (!hasUnassociatedTransceivers(transceivers))
-        clearNegotiationNeededState();
-
-    RTCSignalingState newSignalingState;
-
-    // Update state and local descriptions according to setLocal/RemoteDescription processing model
-    switch (newDescription->type()) {
-    case RTCSdpType::Offer:
-        m_pendingLocalDescription = WTFMove(newDescription);
-        newSignalingState = RTCSignalingState::HaveLocalOffer;
-        break;
-
-    case RTCSdpType::Answer:
-        m_currentLocalDescription = WTFMove(newDescription);
-        m_currentRemoteDescription = m_pendingRemoteDescription;
-        m_pendingLocalDescription = nullptr;
-        m_pendingRemoteDescription = nullptr;
-        newSignalingState = RTCSignalingState::Stable;
-        break;
-
-    case RTCSdpType::Rollback:
-        m_pendingLocalDescription = nullptr;
-        newSignalingState = RTCSignalingState::Stable;
-        break;
-
-    case RTCSdpType::Pranswer:
-        m_pendingLocalDescription = WTFMove(newDescription);
-        newSignalingState = RTCSignalingState::HaveLocalPranswer;
-        break;
-    }
-
-    updateSignalingState(newSignalingState);
-
-    if (m_peerConnection.iceGatheringState() == RTCIceGatheringState::New && mediaDescriptions.size())
-        m_peerConnection.updateIceGatheringState(RTCIceGatheringState::Gathering);
-
-    markAsNeedingNegotiation();
-    setLocalDescriptionSucceeded();
-}
-
-RefPtr<RTCSessionDescription> MediaEndpointPeerConnection::localDescription() const
-{
-    return createRTCSessionDescription(internalLocalDescription());
-}
-
-RefPtr<RTCSessionDescription> MediaEndpointPeerConnection::currentLocalDescription() const
-{
-    return createRTCSessionDescription(m_currentLocalDescription.get());
-}
-
-RefPtr<RTCSessionDescription> MediaEndpointPeerConnection::pendingLocalDescription() const
-{
-    return createRTCSessionDescription(m_pendingLocalDescription.get());
-}
-
-void MediaEndpointPeerConnection::doSetRemoteDescription(RTCSessionDescription& description)
-{
-    runTask([this, protectedDescription = RefPtr<RTCSessionDescription>(&description)]() mutable {
-        setRemoteDescriptionTask(WTFMove(protectedDescription));
-    });
-}
-
-void MediaEndpointPeerConnection::setRemoteDescriptionTask(RefPtr<RTCSessionDescription>&& description)
-{
-    auto result = MediaEndpointSessionDescription::create(WTFMove(description), *m_sdpProcessor);
-    if (result.hasException()) {
-        setRemoteDescriptionFailed(result.releaseException());
-        return;
-    }
-    auto newDescription = result.releaseReturnValue();
-
-    auto& mediaDescriptions = newDescription->configuration()->mediaDescriptions();
-    for (auto& mediaDescription : mediaDescriptions) {
-        if (mediaDescription.type != "audio" && mediaDescription.type != "video")
-            continue;
-
-        mediaDescription.payloads = m_mediaEndpoint->filterPayloads(mediaDescription.payloads, mediaDescription.type == "audio" ? m_defaultAudioPayloads : m_defaultVideoPayloads);
-    }
-
-    bool isInitiator = newDescription->type() == RTCSdpType::Answer;
-    const RtpTransceiverVector& transceivers = m_peerConnection.getTransceivers();
-
-    RealtimeMediaSourceMap sendSourceMap;
-    if (internalLocalDescription())
-        sendSourceMap = createSourceMap(mediaDescriptions, internalLocalDescription()->configuration()->mediaDescriptions().size(), transceivers);
-
-    if (m_mediaEndpoint->updateSendConfiguration(newDescription->configuration(), sendSourceMap, isInitiator) == MediaEndpoint::UpdateResult::Failed) {
-        setRemoteDescriptionFailed(Exception { OperationError, "Unable to apply session description" });
-        return;
-    }
-
-    // One legacy MediaStreamEvent will be fired for every new MediaStream created as this remote description is set.
-    Vector<RefPtr<MediaStreamEvent>> legacyMediaStreamEvents;
-
-    for (auto& mediaDescription : mediaDescriptions) {
-        RTCRtpTransceiver* transceiver = matchTransceiverByMid(transceivers, mediaDescription.mid);
-        if (!transceiver) {
-            bool receiveOnlyFlag = false;
-
-            if (mediaDescription.mode == "sendrecv" || mediaDescription.mode == "recvonly") {
-                // Try to match an existing transceiver.
-                transceiver = matchTransceiver(transceivers, [&mediaDescription] (RTCRtpTransceiver& current) {
-                    return !current.stopped() && current.mid().isNull() && current.sender().trackKind() == mediaDescription.type;
-                });
-
-                if (transceiver) {
-                    // This transceiver was created locally with a provisional mid. Its real mid will now be set by the remote
-                    // description so we need to update the mid of the transceiver's muted source to preserve the association.
-                    transceiver->setMid(mediaDescription.mid);
-                    m_mediaEndpoint->replaceMutedRemoteSourceMid(transceiver->provisionalMid(), mediaDescription.mid);
-                } else
-                    receiveOnlyFlag = true;
-            }
-
-            if (!transceiver) {
-                auto sender = RTCRtpSender::create(String(mediaDescription.type), Vector<String>(), m_peerConnection.senderBackend());
-                auto receiver = createReceiver(mediaDescription.mid, mediaDescription.type, mediaDescription.mediaStreamTrackId);
-
-                auto newTransceiver = RTCRtpTransceiver::create(WTFMove(sender), WTFMove(receiver));
-                newTransceiver->setMid(mediaDescription.mid);
-                if (receiveOnlyFlag)
-                    newTransceiver->disableSendingDirection();
-
-                transceiver = newTransceiver.ptr();
-                m_peerConnection.addTransceiver(WTFMove(newTransceiver));
-            }
-        }
-
-        if (mediaDescription.mode == "sendrecv" || mediaDescription.mode == "sendonly") {
-            auto& receiver = transceiver->receiver();
-            if (receiver.isDispatched())
-                continue;
-            receiver.setDispatched(true);
-
-            Vector<String> mediaStreamIds;
-            if (!mediaDescription.mediaStreamId.isEmpty())
-                mediaStreamIds.append(mediaDescription.mediaStreamId);
-
-            // A remote track can be associated with 0..* MediaStreams. We create a new stream for
-            // a track in case of an unrecognized stream id, or just add the track if the stream
-            // already exists.
-            HashMap<String, RefPtr<MediaStream>> trackEventMediaStreams;
-            for (auto& id : mediaStreamIds) {
-                if (m_remoteStreamMap.contains(id)) {
-                    RefPtr<MediaStream> stream = m_remoteStreamMap.get(id);
-                    stream->addTrack(*receiver.track());
-                    trackEventMediaStreams.add(id, WTFMove(stream));
-                } else {
-                    auto newStream = MediaStream::create(*m_peerConnection.scriptExecutionContext(), MediaStreamTrackVector({ receiver.track() }));
-                    m_remoteStreamMap.add(id, newStream.copyRef());
-                    legacyMediaStreamEvents.append(MediaStreamEvent::create(eventNames().addstreamEvent, false, false, newStream.copyRef()));
-                    trackEventMediaStreams.add(id, WTFMove(newStream));
-                }
-            }
-
-            Vector<RefPtr<MediaStream>> streams;
-            copyValuesToVector(trackEventMediaStreams, streams);
-
-            m_peerConnection.fireEvent(RTCTrackEvent::create(eventNames().trackEvent, false, false,
-                &receiver, receiver.track(), WTFMove(streams), transceiver));
-        }
-    }
-
-    // Fire legacy addstream events.
-    for (auto& event : legacyMediaStreamEvents)
-        m_peerConnection.fireEvent(*event);
-
-    RTCSignalingState newSignalingState;
-
-    // Update state and local descriptions according to setLocal/RemoteDescription processing model
-    switch (newDescription->type()) {
-    case RTCSdpType::Offer:
-        m_pendingRemoteDescription = WTFMove(newDescription);
-        newSignalingState = RTCSignalingState::HaveRemoteOffer;
-        break;
-
-    case RTCSdpType::Answer:
-        m_currentRemoteDescription = WTFMove(newDescription);
-        m_currentLocalDescription = m_pendingLocalDescription;
-        m_pendingRemoteDescription = nullptr;
-        m_pendingLocalDescription = nullptr;
-        newSignalingState = RTCSignalingState::Stable;
-        break;
-
-    case RTCSdpType::Rollback:
-        m_pendingRemoteDescription = nullptr;
-        newSignalingState = RTCSignalingState::Stable;
-        break;
-
-    case RTCSdpType::Pranswer:
-        m_pendingRemoteDescription = WTFMove(newDescription);
-        newSignalingState = RTCSignalingState::HaveRemotePranswer;
-        break;
-    }
-
-    updateSignalingState(newSignalingState);
-    setRemoteDescriptionSucceeded();
-}
-
-RefPtr<RTCSessionDescription> MediaEndpointPeerConnection::remoteDescription() const
-{
-    return createRTCSessionDescription(internalRemoteDescription());
-}
-
-RefPtr<RTCSessionDescription> MediaEndpointPeerConnection::currentRemoteDescription() const
-{
-    return createRTCSessionDescription(m_currentRemoteDescription.get());
-}
-
-RefPtr<RTCSessionDescription> MediaEndpointPeerConnection::pendingRemoteDescription() const
-{
-    return createRTCSessionDescription(m_pendingRemoteDescription.get());
-}
-
-bool MediaEndpointPeerConnection::setConfiguration(MediaEndpointConfiguration&& configuration)
-{
-    m_mediaEndpoint->setConfiguration(WTFMove(configuration));
-    return true;
-}
-
-void MediaEndpointPeerConnection::doAddIceCandidate(RTCIceCandidate& rtcCandidate)
-{
-    runTask([this, protectedCandidate = RefPtr<RTCIceCandidate>(&rtcCandidate)]() mutable {
-        addIceCandidateTask(*protectedCandidate);
-    });
-}
-
-void MediaEndpointPeerConnection::addIceCandidateTask(RTCIceCandidate& rtcCandidate)
-{
-    if (!internalRemoteDescription()) {
-        addIceCandidateFailed(Exception { InvalidStateError, "No remote description set" });
-        return;
-    }
-
-    auto& remoteMediaDescriptions = internalRemoteDescription()->configuration()->mediaDescriptions();
-    PeerMediaDescription* targetMediaDescription = nullptr;
-
-    // When identifying the target media description, sdpMid takes precedence over sdpMLineIndex
-    // if both are present.
-    if (!rtcCandidate.sdpMid().isNull()) {
-        const String& mid = rtcCandidate.sdpMid();
-        for (auto& description : remoteMediaDescriptions) {
-            if (description.mid == mid) {
-                targetMediaDescription = &description;
-                break;
-            }
-        }
-
-        if (!targetMediaDescription) {
-            addIceCandidateFailed(Exception { OperationError, "sdpMid did not match any media description" });
-            return;
-        }
-    } else if (rtcCandidate.sdpMLineIndex()) {
-        unsigned short sdpMLineIndex = rtcCandidate.sdpMLineIndex().value();
-        if (sdpMLineIndex >= remoteMediaDescriptions.size()) {
-            addIceCandidateFailed(Exception { OperationError, "sdpMLineIndex is out of range" });
-            return;
-        }
-        targetMediaDescription = &remoteMediaDescriptions[sdpMLineIndex];
-    } else {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    auto result = m_sdpProcessor->parseCandidateLine(rtcCandidate.candidate());
-    if (result.parsingStatus() != SDPProcessor::Result::Success) {
-        if (result.parsingStatus() == SDPProcessor::Result::ParseError)
-            addIceCandidateFailed(Exception { OperationError, "Invalid candidate content" });
-        else
-            LOG_ERROR("SDPProcessor internal error");
-        return;
-    }
-
-    ASSERT(targetMediaDescription);
-    m_mediaEndpoint->addRemoteCandidate(result.candidate(), targetMediaDescription->mid, targetMediaDescription->iceUfrag, targetMediaDescription->icePassword);
-
-    targetMediaDescription->addIceCandidate(WTFMove(result.candidate()));
-
-    addIceCandidateSucceeded();
-}
-
-void MediaEndpointPeerConnection::getStats(MediaStreamTrack* track, Ref<DeferredPromise>&& promise)
-{
-    m_mediaEndpoint->getStats(track, WTFMove(promise));
-}
-
-Vector<RefPtr<MediaStream>> MediaEndpointPeerConnection::getRemoteStreams() const
-{
-    Vector<RefPtr<MediaStream>> remoteStreams;
-    copyValuesToVector(m_remoteStreamMap, remoteStreams);
-    return remoteStreams;
-}
-
-Ref<RTCRtpReceiver> MediaEndpointPeerConnection::createReceiver(const String& transceiverMid, const String& trackKind, const String& trackId)
-{
-    RealtimeMediaSource::Type sourceType = trackKind == "audio" ? RealtimeMediaSource::Type::Audio : RealtimeMediaSource::Type::Video;
-
-    // Create a muted remote source that will be unmuted once media starts arriving.
-    auto remoteSource = m_mediaEndpoint->createMutedRemoteSource(transceiverMid, sourceType);
-    auto remoteTrackPrivate = MediaStreamTrackPrivate::create(WTFMove(remoteSource), String(trackId));
-    auto remoteTrack = MediaStreamTrack::create(*m_peerConnection.scriptExecutionContext(), WTFMove(remoteTrackPrivate));
-
-    return RTCRtpReceiver::create(WTFMove(remoteTrack));
-}
-
-std::unique_ptr<RTCDataChannelHandler> MediaEndpointPeerConnection::createDataChannelHandler(const String& label, const RTCDataChannelInit& options)
-{
-    return m_mediaEndpoint->createDataChannelHandler(label, options);
-}
-
-void MediaEndpointPeerConnection::replaceTrack(RTCRtpSender& sender, Ref<MediaStreamTrack>&& withTrack, DOMPromiseDeferred<void>&& promise)
-{
-    RTCRtpTransceiver* transceiver = matchTransceiver(m_peerConnection.getTransceivers(), [&sender] (RTCRtpTransceiver& current) {
-        return &current.sender() == &sender;
-    });
-    ASSERT(transceiver);
-
-    const String& mid = transceiver->mid();
-    if (mid.isNull()) {
-        // Transceiver is not associated with a media description yet.
-        sender.setTrack(WTFMove(withTrack));
-        promise.resolve();
-        return;
-    }
-
-    runTask([this, protectedSender = RefPtr<RTCRtpSender>(&sender), mid, protectedTrack = WTFMove(withTrack), protectedPromise = WTFMove(promise)]() mutable {
-        replaceTrackTask(*protectedSender, mid, WTFMove(protectedTrack), protectedPromise);
-    });
-}
-
-void MediaEndpointPeerConnection::replaceTrackTask(RTCRtpSender& sender, const String& mid, Ref<MediaStreamTrack>&& withTrack, DOMPromiseDeferred<void>& promise)
-{
-    if (m_peerConnection.isClosed())
-        return;
-
-    m_mediaEndpoint->replaceSendSource(withTrack->source(), mid);
-
-    sender.setTrack(WTFMove(withTrack));
-    promise.resolve();
-}
-
-void MediaEndpointPeerConnection::doStop()
-{
-    m_mediaEndpoint->stop();
-}
-
-void MediaEndpointPeerConnection::emulatePlatformEvent(const String& action)
-{
-    m_mediaEndpoint->emulatePlatformEvent(action);
-}
-
-MediaEndpointSessionDescription* MediaEndpointPeerConnection::internalLocalDescription() const
-{
-    return m_pendingLocalDescription ? m_pendingLocalDescription.get() : m_currentLocalDescription.get();
-}
-
-MediaEndpointSessionDescription* MediaEndpointPeerConnection::internalRemoteDescription() const
-{
-    return m_pendingRemoteDescription ? m_pendingRemoteDescription.get() : m_currentRemoteDescription.get();
-}
-
-RefPtr<RTCSessionDescription> MediaEndpointPeerConnection::createRTCSessionDescription(MediaEndpointSessionDescription* description) const
-{
-    return description ? description->toRTCSessionDescription(*m_sdpProcessor) : nullptr;
-}
-
-void MediaEndpointPeerConnection::gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction)
-{
-    ASSERT(isMainThread());
-
-    m_dtlsFingerprint = fingerprint;
-    m_dtlsFingerprintFunction = fingerprintFunction;
-
-    startRunningTasks();
-}
-
-void MediaEndpointPeerConnection::gotIceCandidate(const String& mid, IceCandidate&& candidate)
-{
-    ASSERT(isMainThread());
-
-    auto& mediaDescriptions = internalLocalDescription()->configuration()->mediaDescriptions();
-    size_t mediaDescriptionIndex = notFound;
-
-    for (size_t i = 0; i < mediaDescriptions.size(); ++i) {
-        if (mediaDescriptions[i].mid == mid) {
-            mediaDescriptionIndex = i;
-            break;
-        }
-    }
-    ASSERT(mediaDescriptionIndex != notFound);
-
-    String candidateLine;
-    auto result = m_sdpProcessor->generateCandidateLine(candidate, candidateLine);
-    if (result != SDPProcessor::Result::Success) {
-        LOG_ERROR("SDPProcessor internal error");
-        return;
-    }
-
-    mediaDescriptions[mediaDescriptionIndex].addIceCandidate(WTFMove(candidate));
-
-    fireICECandidateEvent(RTCIceCandidate::create(candidateLine, mid, mediaDescriptionIndex));
-}
-
-void MediaEndpointPeerConnection::doneGatheringCandidates(const String& mid)
-{
-    ASSERT(isMainThread());
-
-    RtpTransceiverVector transceivers = RtpTransceiverVector(m_peerConnection.getTransceivers());
-    RTCRtpTransceiver* notifyingTransceiver = matchTransceiverByMid(transceivers, mid);
-    ASSERT(notifyingTransceiver);
-
-    notifyingTransceiver->iceTransport().setGatheringState(RTCIceGatheringState::Complete);
-
-    // Don't notify the script if there are transceivers still gathering.
-    RTCRtpTransceiver* stillGatheringTransceiver = matchTransceiver(transceivers, [] (RTCRtpTransceiver& current) {
-        return !current.stopped() && !current.mid().isNull()
-            && current.iceTransport().gatheringState() != RTCIceGatheringState::Complete;
-    });
-    if (!stillGatheringTransceiver)
-        PeerConnectionBackend::doneGatheringCandidates();
-}
-
-static RTCIceConnectionState deriveAggregatedIceConnectionState(const Vector<RTCIceTransportState>& states)
-{
-    unsigned newCount = 0;
-    unsigned checkingCount = 0;
-    unsigned connectedCount = 0;
-    unsigned completedCount = 0;
-    unsigned failedCount = 0;
-    unsigned disconnectedCount = 0;
-    unsigned closedCount = 0;
-
-    for (auto& state : states) {
-        switch (state) {
-        case RTCIceTransportState::New:
-            ++newCount;
-            break;
-        case RTCIceTransportState::Checking:
-            ++checkingCount;
-            break;
-        case RTCIceTransportState::Connected:
-            ++connectedCount;
-            break;
-        case RTCIceTransportState::Completed:
-            ++completedCount;
-            break;
-        case RTCIceTransportState::Failed:
-            ++failedCount;
-            break;
-        case RTCIceTransportState::Disconnected:
-            ++disconnectedCount;
-            break;
-        case RTCIceTransportState::Closed:
-            ++closedCount;
-            break;
-        }
-    }
-
-    // The aggregated RTCIceConnectionState is derived from the RTCIceTransportState of all RTCIceTransports.
-    if ((newCount > 0 && !checkingCount && !failedCount && !disconnectedCount) || (closedCount == states.size()))
-        return RTCIceConnectionState::New;
-
-    if (checkingCount > 0 && !failedCount && !disconnectedCount)
-        return RTCIceConnectionState::Checking;
-
-    if ((connectedCount + completedCount + closedCount) == states.size() && connectedCount > 0)
-        return RTCIceConnectionState::Connected;
-
-    if ((completedCount + closedCount) == states.size() && completedCount > 0)
-        return RTCIceConnectionState::Completed;
-
-    if (failedCount > 0)
-        return RTCIceConnectionState::Failed;
-
-    if (disconnectedCount > 0) // Any failed caught above.
-        return RTCIceConnectionState::Disconnected;
-
-    ASSERT_NOT_REACHED();
-    return RTCIceConnectionState::New;
-}
-
-void MediaEndpointPeerConnection::iceTransportStateChanged(const String& mid, RTCIceTransportState mediaEndpointIceTransportState)
-{
-    ASSERT(isMainThread());
-
-    RTCRtpTransceiver* transceiver = matchTransceiverByMid(m_peerConnection.getTransceivers(), mid);
-    ASSERT(transceiver);
-
-    RTCIceTransportState transportState = static_cast<RTCIceTransportState>(mediaEndpointIceTransportState);
-    transceiver->iceTransport().setState(transportState);
-
-    // Determine if the script needs to be notified.
-    Vector<RTCIceTransportState> transportStates;
-    transportStates.reserveInitialCapacity(m_peerConnection.getTransceivers().size());
-    for (auto& transceiver : m_peerConnection.getTransceivers())
-        transportStates.uncheckedAppend(transceiver->iceTransport().state());
-
-    m_peerConnection.updateIceConnectionState(deriveAggregatedIceConnectionState(transportStates));
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h b/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h
deleted file mode 100644 (file)
index bb81312..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2015, 2016 Ericsson AB. All rights reserved.
- * 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 "MediaEndpoint.h"
-#include "PeerConnectionBackend.h"
-#include "RTCSessionDescription.h"
-#include <wtf/Function.h>
-
-namespace WebCore {
-
-class MediaEndpointSessionDescription;
-class SDPProcessor;
-
-class MediaEndpointPeerConnection final : public PeerConnectionBackend, public MediaEndpointClient {
-public:
-    WEBCORE_EXPORT explicit MediaEndpointPeerConnection(RTCPeerConnection&);
-
-private:
-    RefPtr<RTCSessionDescription> localDescription() const final;
-    RefPtr<RTCSessionDescription> currentLocalDescription() const final;
-    RefPtr<RTCSessionDescription> pendingLocalDescription() const final;
-
-    RefPtr<RTCSessionDescription> remoteDescription() const final;
-    RefPtr<RTCSessionDescription> currentRemoteDescription() const final;
-    RefPtr<RTCSessionDescription> pendingRemoteDescription() const final;
-
-    bool setConfiguration(MediaEndpointConfiguration&&) final;
-
-    void getStats(MediaStreamTrack*, Ref<DeferredPromise>&&) final;
-
-    Vector<RefPtr<MediaStream>> getRemoteStreams() const final;
-
-    Ref<RTCRtpReceiver> createReceiver(const String& transceiverMid, const String& trackKind, const String& trackId) final;
-    void replaceTrack(RTCRtpSender&, Ref<MediaStreamTrack>&&, DOMPromiseDeferred<void>&&) final;
-
-    void emulatePlatformEvent(const String& action) final;
-
-    void runTask(Function<void ()>&&);
-    void startRunningTasks();
-
-    void doCreateOffer(RTCOfferOptions&&) final;
-    void doCreateAnswer(RTCAnswerOptions&&) final;
-    void doSetLocalDescription(RTCSessionDescription&) final;
-    void doSetRemoteDescription(RTCSessionDescription&) final;
-    void doAddIceCandidate(RTCIceCandidate&) final;
-    void doStop() final;
-
-    void createOfferTask(const RTCOfferOptions&);
-    void createAnswerTask(const RTCAnswerOptions&);
-
-    void setLocalDescriptionTask(RefPtr<RTCSessionDescription>&&);
-    void setRemoteDescriptionTask(RefPtr<RTCSessionDescription>&&);
-
-    void addIceCandidateTask(RTCIceCandidate&);
-
-    void replaceTrackTask(RTCRtpSender&, const String& mid, Ref<MediaStreamTrack>&&, DOMPromiseDeferred<void>&);
-
-    bool localDescriptionTypeValidForState(RTCSdpType) const;
-    bool remoteDescriptionTypeValidForState(RTCSdpType) const;
-
-    MediaEndpointSessionDescription* internalLocalDescription() const;
-    MediaEndpointSessionDescription* internalRemoteDescription() const;
-    RefPtr<RTCSessionDescription> createRTCSessionDescription(MediaEndpointSessionDescription*) const;
-
-    // MediaEndpointClient
-    void gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction) final;
-    void gotIceCandidate(const String& mid, IceCandidate&&) final;
-    void doneGatheringCandidates(const String& mid) final;
-    void iceTransportStateChanged(const String& mid, RTCIceTransportState) final;
-
-    std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) final;
-
-    std::unique_ptr<MediaEndpoint> m_mediaEndpoint;
-
-    Function<void ()> m_initialDeferredTask;
-
-    std::unique_ptr<SDPProcessor> m_sdpProcessor;
-
-    Vector<MediaPayload> m_defaultAudioPayloads;
-    Vector<MediaPayload> m_defaultVideoPayloads;
-
-    String m_cname;
-    String m_iceUfrag;
-    String m_icePassword;
-    String m_dtlsFingerprint;
-    String m_dtlsFingerprintFunction;
-    unsigned m_sdpOfferSessionVersion { 0 };
-    unsigned m_sdpAnswerSessionVersion { 0 };
-
-    RefPtr<MediaEndpointSessionDescription> m_currentLocalDescription;
-    RefPtr<MediaEndpointSessionDescription> m_pendingLocalDescription;
-
-    RefPtr<MediaEndpointSessionDescription> m_currentRemoteDescription;
-    RefPtr<MediaEndpointSessionDescription> m_pendingRemoteDescription;
-
-    HashMap<String, RefPtr<MediaStream>> m_remoteStreamMap;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp b/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.cpp
deleted file mode 100644 (file)
index 1c606f5..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2015, 2016 Ericsson AB. All rights reserved.
- * 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#include "config.h"
-#include "MediaEndpointSessionDescription.h"
-
-#if ENABLE(WEB_RTC)
-
-#include "SDPProcessor.h"
-#include <wtf/NeverDestroyed.h>
-
-namespace WebCore {
-
-#define STRING_FUNCTION(name) \
-    static const String& name##String() \
-    { \
-        static NeverDestroyed<const String> name(MAKE_STATIC_STRING_IMPL(#name)); \
-        return name; \
-    }
-
-STRING_FUNCTION(offer)
-STRING_FUNCTION(pranswer)
-STRING_FUNCTION(answer)
-STRING_FUNCTION(rollback)
-
-Ref<MediaEndpointSessionDescription> MediaEndpointSessionDescription::create(RTCSdpType type, RefPtr<MediaEndpointSessionConfiguration>&& configuration)
-{
-    return adoptRef(*new MediaEndpointSessionDescription(type, WTFMove(configuration), nullptr));
-}
-
-ExceptionOr<Ref<MediaEndpointSessionDescription>> MediaEndpointSessionDescription::create(RefPtr<RTCSessionDescription>&& rtcDescription, const SDPProcessor& sdpProcessor)
-{
-    RefPtr<MediaEndpointSessionConfiguration> configuration;
-    auto result = sdpProcessor.parse(rtcDescription->sdp(), configuration);
-    if (result != SDPProcessor::Result::Success) {
-        if (result == SDPProcessor::Result::ParseError)
-            return Exception { InvalidAccessError, ASCIILiteral("SDP content is invalid") };
-        LOG_ERROR("SDPProcessor internal error");
-        return Exception { AbortError, ASCIILiteral("Internal error") };
-    }
-    return adoptRef(*new MediaEndpointSessionDescription(rtcDescription->type(), WTFMove(configuration), WTFMove(rtcDescription)));
-}
-
-RefPtr<RTCSessionDescription> MediaEndpointSessionDescription::toRTCSessionDescription(const SDPProcessor& sdpProcessor) const
-{
-    String sdpString;
-    SDPProcessor::Result result = sdpProcessor.generate(*m_configuration, sdpString);
-    if (result != SDPProcessor::Result::Success) {
-        LOG_ERROR("SDPProcessor internal error");
-        return nullptr;
-    }
-
-    // If this object was created from an RTCSessionDescription, toRTCSessionDescription will return
-    // that same instance but with an updated sdp. It is used for RTCPeerConnection's description
-    // atributes (e.g. localDescription and pendingLocalDescription).
-    if (m_rtcDescription) {
-        m_rtcDescription->setSdp(WTFMove(sdpString));
-        return m_rtcDescription;
-    }
-
-    return RTCSessionDescription::create(m_type, WTFMove(sdpString));
-}
-
-// FIXME: unify with LibWebRTCMediaEndpoint sessionDescriptionType().
-const String& MediaEndpointSessionDescription::typeString() const
-{
-    switch (m_type) {
-    case RTCSdpType::Offer:
-        return offerString();
-    case RTCSdpType::Pranswer:
-        return pranswerString();
-    case RTCSdpType::Answer:
-        return answerString();
-    case RTCSdpType::Rollback:
-        return rollbackString();
-    }
-
-    ASSERT_NOT_REACHED();
-    return emptyString();
-}
-
-bool MediaEndpointSessionDescription::isLaterThan(MediaEndpointSessionDescription* other) const
-{
-    return !other || configuration()->sessionVersion() > other->configuration()->sessionVersion();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.h b/Source/WebCore/Modules/mediastream/MediaEndpointSessionDescription.h
deleted file mode 100644 (file)
index 1d05c72..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2015, 2016 Ericsson AB. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 "ExceptionOr.h"
-#include "RTCSessionDescription.h"
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class MediaEndpointSessionConfiguration;
-class SDPProcessor;
-
-class MediaEndpointSessionDescription : public RefCounted<MediaEndpointSessionDescription> {
-public:
-    static Ref<MediaEndpointSessionDescription> create(RTCSdpType, RefPtr<MediaEndpointSessionConfiguration>&&);
-    static ExceptionOr<Ref<MediaEndpointSessionDescription>> create(RefPtr<RTCSessionDescription>&&, const SDPProcessor&);
-    virtual ~MediaEndpointSessionDescription() { } // FIXME: Why is this virtual? There are no other virtual functions in this class.
-
-    RefPtr<RTCSessionDescription> toRTCSessionDescription(const SDPProcessor&) const;
-
-    RTCSdpType type() const { return m_type; }
-    const String& typeString() const;
-    MediaEndpointSessionConfiguration* configuration() const { return m_configuration.get(); }
-
-    bool isLaterThan(MediaEndpointSessionDescription* other) const;
-
-private:
-    MediaEndpointSessionDescription(RTCSdpType type, RefPtr<MediaEndpointSessionConfiguration>&& configuration, RefPtr<RTCSessionDescription>&& rtcDescription)
-        : m_type(type)
-        , m_configuration(configuration)
-        , m_rtcDescription(WTFMove(rtcDescription))
-    { }
-
-    RTCSdpType m_type;
-    RefPtr<MediaEndpointSessionConfiguration> m_configuration;
-
-    RefPtr<RTCSessionDescription> m_rtcDescription;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
index 3f2b95f..2ad84bd 100644 (file)
@@ -46,6 +46,15 @@ namespace WebCore {
 
 using namespace PAL;
 
+#if !USE(LIBWEBRTC)
+static std::unique_ptr<PeerConnectionBackend> createNoPeerConnectionBackend(RTCPeerConnection&)
+{
+    return nullptr;
+}
+
+CreatePeerConnectionBackend PeerConnectionBackend::create = createNoPeerConnectionBackend;
+#endif
+
 PeerConnectionBackend::PeerConnectionBackend(RTCPeerConnection& peerConnection)
     : m_peerConnection(peerConnection)
 #if !RELEASE_LOG_DISABLED
diff --git a/Source/WebCore/Modules/mediastream/SDPProcessor.cpp b/Source/WebCore/Modules/mediastream/SDPProcessor.cpp
deleted file mode 100644 (file)
index 715cf2f..0000000
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- * Copyright (C) 2015, 2016 Ericsson AB. All rights reserved.
- * Copyright (C) 2016-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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_RTC)
-#include "SDPProcessor.h"
-
-#include "CommonVM.h"
-#include "Document.h"
-#include "Frame.h"
-#include "SDPProcessorScriptResource.h"
-#include "ScriptController.h"
-#include "ScriptSourceCode.h"
-#include "inspector/InspectorValues.h"
-#include <bindings/ScriptObject.h>
-#include <runtime/CatchScope.h>
-#include <wtf/NeverDestroyed.h>
-
-using namespace Inspector;
-
-namespace WebCore {
-
-#define STRING_FUNCTION(name) \
-    static const String& name##String() \
-    { \
-        static NeverDestroyed<const String> name(MAKE_STATIC_STRING_IMPL(#name)); \
-        return name; \
-    }
-
-STRING_FUNCTION(address)
-STRING_FUNCTION(apt)
-STRING_FUNCTION(bundlePolicy)
-STRING_FUNCTION(candidates)
-STRING_FUNCTION(ccmfir)
-STRING_FUNCTION(channels)
-STRING_FUNCTION(clockRate)
-STRING_FUNCTION(cname)
-STRING_FUNCTION(componentId)
-STRING_FUNCTION(dtls)
-STRING_FUNCTION(encodingName)
-STRING_FUNCTION(fingerprint)
-STRING_FUNCTION(fingerprintHashFunction)
-STRING_FUNCTION(foundation)
-STRING_FUNCTION(ice)
-STRING_FUNCTION(mediaDescriptions)
-STRING_FUNCTION(mediaStreamId)
-STRING_FUNCTION(mediaStreamTrackId)
-STRING_FUNCTION(mid)
-STRING_FUNCTION(mode)
-STRING_FUNCTION(mux)
-STRING_FUNCTION(nack)
-STRING_FUNCTION(nackpli)
-STRING_FUNCTION(originator)
-STRING_FUNCTION(packetizationMode)
-STRING_FUNCTION(parameters)
-STRING_FUNCTION(password)
-STRING_FUNCTION(payloads)
-STRING_FUNCTION(port)
-STRING_FUNCTION(priority)
-STRING_FUNCTION(relatedAddress)
-STRING_FUNCTION(relatedPort)
-STRING_FUNCTION(rtcp)
-STRING_FUNCTION(rtcpAddress)
-STRING_FUNCTION(rtcpPort)
-STRING_FUNCTION(rtxTime)
-STRING_FUNCTION(sessionId)
-STRING_FUNCTION(sessionVersion)
-STRING_FUNCTION(setup)
-STRING_FUNCTION(ssrcs)
-STRING_FUNCTION(tcpType)
-STRING_FUNCTION(transport)
-STRING_FUNCTION(type)
-STRING_FUNCTION(ufrag)
-
-SDPProcessor::SDPProcessor(ScriptExecutionContext* context)
-    : ContextDestructionObserver(context)
-{
-}
-
-// Note that MediaEndpointSessionConfiguration is a "flatter" structure that the JSON representation. For
-// example, the JSON representation has an "ice" object which collects a set of properties under a
-// namespace. MediaEndpointSessionConfiguration has "ice"-prefixes on the corresponding properties.
-
-static RefPtr<InspectorObject> createCandidateObject(const IceCandidate& candidate)
-{
-    RefPtr<InspectorObject> candidateObject = InspectorObject::create();
-
-    candidateObject->setString(typeString(), candidate.type);
-    candidateObject->setString(foundationString(), candidate.foundation);
-    candidateObject->setInteger(componentIdString(), candidate.componentId);
-    candidateObject->setString(transportString(), candidate.transport);
-    candidateObject->setInteger(priorityString(), candidate.priority);
-    candidateObject->setString(addressString(), candidate.address);
-    candidateObject->setInteger(portString(), candidate.port);
-    if (!candidate.tcpType.isEmpty())
-        candidateObject->setString(tcpTypeString(), candidate.tcpType);
-    if (candidate.type.convertToASCIIUppercase() != "HOST") {
-        candidateObject->setString(relatedAddressString(), candidate.relatedAddress);
-        candidateObject->setInteger(relatedPortString(), candidate.relatedPort);
-    }
-
-    return candidateObject;
-}
-
-static IceCandidate createCandidate(const InspectorObject& candidateObject)
-{
-    IceCandidate candidate;
-    String stringValue;
-    unsigned intValue;
-
-    if (candidateObject.getString(typeString(), stringValue))
-        candidate.type = stringValue;
-
-    if (candidateObject.getString(foundationString(), stringValue))
-        candidate.foundation = stringValue;
-
-    if (candidateObject.getInteger(componentIdString(), intValue))
-        candidate.componentId = intValue;
-
-    if (candidateObject.getString(transportString(), stringValue))
-        candidate.transport = stringValue;
-
-    if (candidateObject.getInteger(priorityString(), intValue))
-        candidate.priority = intValue;
-
-    if (candidateObject.getString(addressString(), stringValue))
-        candidate.address = stringValue;
-
-    if (candidateObject.getInteger(portString(), intValue))
-        candidate.port = intValue;
-
-    if (candidateObject.getString(tcpTypeString(), stringValue))
-        candidate.tcpType = stringValue;
-
-    if (candidateObject.getString(relatedAddressString(), stringValue))
-        candidate.relatedAddress = stringValue;
-
-    if (candidateObject.getInteger(relatedPortString(), intValue))
-        candidate.relatedPort = intValue;
-
-    return candidate;
-}
-
-static RefPtr<MediaEndpointSessionConfiguration> configurationFromJSON(const String& json)
-{
-    RefPtr<InspectorValue> value;
-    if (!InspectorValue::parseJSON(json, value))
-        return nullptr;
-
-    RefPtr<InspectorObject> object;
-    if (!value->asObject(object))
-        return nullptr;
-
-    RefPtr<MediaEndpointSessionConfiguration> configuration = MediaEndpointSessionConfiguration::create();
-
-    String stringValue;
-    unsigned intValue;
-    bool boolValue;
-
-    RefPtr<InspectorObject> originatorObject = InspectorObject::create();
-    if (object->getObject(originatorString(), originatorObject)) {
-        if (originatorObject->getString(sessionIdString(), stringValue))
-            configuration->setSessionId(stringValue.toInt64());
-        if (originatorObject->getInteger(sessionVersionString(), intValue))
-            configuration->setSessionVersion(intValue);
-    }
-
-    RefPtr<InspectorArray> mediaDescriptionsArray = InspectorArray::create();
-    object->getArray(mediaDescriptionsString(), mediaDescriptionsArray);
-
-    for (unsigned i = 0; i < mediaDescriptionsArray->length(); ++i) {
-        RefPtr<InspectorObject> mediaDescriptionObject = InspectorObject::create();
-        mediaDescriptionsArray->get(i)->asObject(mediaDescriptionObject);
-
-        PeerMediaDescription mediaDescription;
-
-        if (mediaDescriptionObject->getString(typeString(), stringValue))
-            mediaDescription.type = stringValue;
-
-        if (mediaDescriptionObject->getInteger(portString(), intValue))
-            mediaDescription.port = intValue;
-
-        if (mediaDescriptionObject->getString(addressString(), stringValue))
-            mediaDescription.address = stringValue;
-
-        if (mediaDescriptionObject->getString(modeString(), stringValue))
-            mediaDescription.mode = stringValue;
-
-        if (mediaDescriptionObject->getString(midString(), stringValue))
-            mediaDescription.mid = stringValue;
-
-        RefPtr<InspectorArray> payloadsArray = InspectorArray::create();
-        mediaDescriptionObject->getArray(payloadsString(), payloadsArray);
-
-        for (unsigned j = 0; j < payloadsArray->length(); ++j) {
-            RefPtr<InspectorObject> payloadsObject = InspectorObject::create();
-            payloadsArray->get(j)->asObject(payloadsObject);
-
-            MediaPayload payload;
-
-            if (payloadsObject->getInteger(typeString(), intValue))
-                payload.type = intValue;
-
-            if (payloadsObject->getString(encodingNameString(), stringValue))
-                payload.encodingName = stringValue;
-
-            if (payloadsObject->getInteger(clockRateString(), intValue))
-                payload.clockRate = intValue;
-
-            if (payloadsObject->getInteger(channelsString(), intValue))
-                payload.channels = intValue;
-
-            if (payloadsObject->getBoolean(ccmfirString(), boolValue))
-                payload.ccmfir = boolValue;
-
-            if (payloadsObject->getBoolean(nackpliString(), boolValue))
-                payload.nackpli = boolValue;
-
-            if (payloadsObject->getBoolean(nackString(), boolValue))
-                payload.nack = boolValue;
-
-            RefPtr<InspectorObject> parametersObject = InspectorObject::create();
-            if (payloadsObject->getObject(parametersString(), parametersObject)) {
-                if (parametersObject->getInteger(packetizationModeString(), intValue))
-                    payload.addParameter("packetizationMode", intValue);
-
-                if (parametersObject->getInteger(aptString(), intValue))
-                    payload.addParameter("apt", intValue);
-
-                if (parametersObject->getInteger(rtxTimeString(), intValue))
-                    payload.addParameter("rtxTime", intValue);
-            }
-
-            mediaDescription.addPayload(WTFMove(payload));
-        }
-
-        RefPtr<InspectorObject> rtcpObject = InspectorObject::create();
-        if (mediaDescriptionObject->getObject(rtcpString(), rtcpObject)) {
-            if (rtcpObject->getBoolean(muxString(), boolValue))
-                mediaDescription.rtcpMux = boolValue;
-
-            if (rtcpObject->getString(rtcpAddressString(), stringValue))
-                mediaDescription.rtcpAddress = stringValue;
-
-            if (rtcpObject->getInteger(rtcpPortString(), intValue))
-                mediaDescription.rtcpPort = intValue;
-        }
-
-        if (mediaDescriptionObject->getString(mediaStreamIdString(), stringValue))
-            mediaDescription.mediaStreamId = stringValue;
-
-        if (mediaDescriptionObject->getString(mediaStreamTrackIdString(), stringValue))
-            mediaDescription.mediaStreamTrackId = stringValue;
-
-        RefPtr<InspectorObject> dtlsObject = InspectorObject::create();
-        if (mediaDescriptionObject->getObject(dtlsString(), dtlsObject)) {
-            if (dtlsObject->getString(setupString(), stringValue))
-                mediaDescription.dtlsSetup = stringValue;
-
-            if (dtlsObject->getString(fingerprintHashFunctionString(), stringValue))
-                mediaDescription.dtlsFingerprintHashFunction = stringValue;
-
-            if (dtlsObject->getString(fingerprintString(), stringValue))
-                mediaDescription.dtlsFingerprint = stringValue;
-        }
-
-        RefPtr<InspectorArray> ssrcsArray = InspectorArray::create();
-        mediaDescriptionObject->getArray(ssrcsString(), ssrcsArray);
-
-        for (unsigned j = 0; j < ssrcsArray->length(); ++j) {
-            ssrcsArray->get(j)->asInteger(intValue);
-            mediaDescription.addSsrc(intValue);
-        }
-
-        if (mediaDescriptionObject->getString(cnameString(), stringValue))
-            mediaDescription.cname = stringValue;
-
-        RefPtr<InspectorObject> iceObject = InspectorObject::create();
-        if (mediaDescriptionObject->getObject(iceString(), iceObject)) {
-            if (iceObject->getString(ufragString(), stringValue))
-                mediaDescription.iceUfrag = stringValue;
-
-            if (iceObject->getString(passwordString(), stringValue))
-                mediaDescription.icePassword = stringValue;
-
-            RefPtr<InspectorArray> candidatesArray = InspectorArray::create();
-            iceObject->getArray(candidatesString(), candidatesArray);
-
-            for (unsigned j = 0; j < candidatesArray->length(); ++j) {
-                RefPtr<InspectorObject> candidateObject = InspectorObject::create();
-                candidatesArray->get(j)->asObject(candidateObject);
-
-                mediaDescription.addIceCandidate(createCandidate(*candidateObject));
-            }
-        }
-
-        configuration->addMediaDescription(WTFMove(mediaDescription));
-    }
-
-    return configuration;
-}
-
-static std::optional<IceCandidate> iceCandidateFromJSON(const String& json)
-{
-    RefPtr<InspectorValue> value;
-    if (!InspectorValue::parseJSON(json, value))
-        return std::nullopt;
-
-    RefPtr<InspectorObject> candidateObject;
-    if (!value->asObject(candidateObject))
-        return std::nullopt;
-
-    return createCandidate(*candidateObject);
-}
-
-static String getBundlePolicyName(const PeerConnectionStates::BundlePolicy bundlePolicy)
-{
-    switch (bundlePolicy) {
-    case PeerConnectionStates::BundlePolicy::MaxCompat:
-        return "max-compat";
-    case PeerConnectionStates::BundlePolicy::MaxBundle:
-        return "max-bundle";
-    case PeerConnectionStates::BundlePolicy::Balanced:
-    default:
-        return "balanced";
-    };
-}
-
-static String configurationToJSON(const MediaEndpointSessionConfiguration& configuration)
-{
-    RefPtr<InspectorObject> object = InspectorObject::create();
-    object->setString(bundlePolicyString(), getBundlePolicyName(configuration.bundlePolicy()));
-
-    RefPtr<InspectorObject> originatorObject = InspectorObject::create();
-    originatorObject->setString(sessionIdString(), String::number(configuration.sessionId()));
-    originatorObject->setInteger(sessionVersionString(), configuration.sessionVersion());
-    object->setObject(originatorString(), originatorObject);
-
-    RefPtr<InspectorArray> mediaDescriptionsArray = InspectorArray::create();
-
-    for (const auto& mediaDescription : configuration.mediaDescriptions()) {
-        RefPtr<InspectorObject> mediaDescriptionObject = InspectorObject::create();
-
-        mediaDescriptionObject->setString(typeString(), mediaDescription.type);
-        mediaDescriptionObject->setInteger(portString(), mediaDescription.port);
-        mediaDescriptionObject->setString(addressString(), mediaDescription.address);
-        mediaDescriptionObject->setString(modeString(), mediaDescription.mode);
-        mediaDescriptionObject->setString(midString(), mediaDescription.mid);
-
-        RefPtr<InspectorArray> payloadsArray = InspectorArray::create();
-
-        for (auto& payload : mediaDescription.payloads) {
-            RefPtr<InspectorObject> payloadObject = InspectorObject::create();
-
-            payloadObject->setInteger(typeString(), payload.type);
-            payloadObject->setString(encodingNameString(), payload.encodingName);
-            payloadObject->setInteger(clockRateString(), payload.clockRate);
-            payloadObject->setInteger(channelsString(), payload.channels);
-            payloadObject->setBoolean(ccmfirString(), payload.ccmfir);
-            payloadObject->setBoolean(nackpliString(), payload.nackpli);
-            payloadObject->setBoolean(nackString(), payload.nack);
-
-            if (!payload.parameters.isEmpty()) {
-                RefPtr<InspectorObject> parametersObject = InspectorObject::create();
-
-                for (auto& name : payload.parameters.keys())
-                    parametersObject->setInteger(name, payload.parameters.get(name));
-
-                payloadObject->setObject(parametersString(), parametersObject);
-            }
-
-            payloadsArray->pushObject(payloadObject);
-        }
-        mediaDescriptionObject->setArray(payloadsString(), payloadsArray);
-
-        RefPtr<InspectorObject> rtcpObject = InspectorObject::create();
-        rtcpObject->setBoolean(muxString(), mediaDescription.rtcpMux);
-        rtcpObject->setString(addressString(), mediaDescription.rtcpAddress);
-        rtcpObject->setInteger(portString(), mediaDescription.rtcpPort);
-        mediaDescriptionObject->setObject(rtcpString(), rtcpObject);
-
-        mediaDescriptionObject->setString(mediaStreamIdString(), mediaDescription.mediaStreamId);
-        mediaDescriptionObject->setString(mediaStreamTrackIdString(), mediaDescription.mediaStreamTrackId);
-
-        RefPtr<InspectorObject> dtlsObject = InspectorObject::create();
-        dtlsObject->setString(setupString(), mediaDescription.dtlsSetup);
-        dtlsObject->setString(fingerprintHashFunctionString(), mediaDescription.dtlsFingerprintHashFunction);
-        dtlsObject->setString(fingerprintString(), mediaDescription.dtlsFingerprint);
-        mediaDescriptionObject->setObject(dtlsString(), dtlsObject);
-
-        RefPtr<InspectorArray> ssrcsArray = InspectorArray::create();
-
-        for (auto ssrc : mediaDescription.ssrcs)
-            ssrcsArray->pushDouble(ssrc);
-        mediaDescriptionObject->setArray(ssrcsString(), ssrcsArray);
-
-        mediaDescriptionObject->setString(cnameString(), mediaDescription.cname);
-
-        RefPtr<InspectorObject> iceObject = InspectorObject::create();
-        iceObject->setString(ufragString(), mediaDescription.iceUfrag);
-        iceObject->setString(passwordString(), mediaDescription.icePassword);
-
-        RefPtr<InspectorArray> candidatesArray = InspectorArray::create();
-
-        for (auto& candidate : mediaDescription.iceCandidates)
-            candidatesArray->pushObject(createCandidateObject(candidate));
-
-        iceObject->setArray(candidatesString(), candidatesArray);
-        mediaDescriptionObject->setObject(iceString(), iceObject);
-
-        mediaDescriptionsArray->pushObject(mediaDescriptionObject);
-    }
-    object->setArray(mediaDescriptionsString(), mediaDescriptionsArray);
-
-    return object->toJSONString();
-}
-
-static String iceCandidateToJSON(const IceCandidate& candidate)
-{
-    return createCandidateObject(candidate)->toJSONString();
-}
-
-SDPProcessor::Result SDPProcessor::generate(const MediaEndpointSessionConfiguration& configuration, String& outSdpString) const
-{
-    String sdpString;
-    if (!callScript("generate", configurationToJSON(configuration), sdpString))
-        return Result::InternalError;
-
-    outSdpString = sdpString;
-    return Result::Success;
-}
-
-SDPProcessor::Result SDPProcessor::parse(const String& sdp, RefPtr<MediaEndpointSessionConfiguration>& outConfiguration) const
-{
-    String scriptOutput;
-    if (!callScript("parse", sdp, scriptOutput))
-        return Result::InternalError;
-
-    if (scriptOutput == "ParseError")
-        return Result::ParseError;
-
-    RefPtr<MediaEndpointSessionConfiguration> configuration = configurationFromJSON(scriptOutput);
-    if (!configuration)
-        return Result::InternalError;
-
-    outConfiguration = configuration;
-    return Result::Success;
-}
-
-SDPProcessor::Result SDPProcessor::generateCandidateLine(const IceCandidate& candidate, String& outCandidateLine) const
-{
-    String candidateLine;
-    if (!callScript("generateCandidateLine", iceCandidateToJSON(candidate), candidateLine))
-        return Result::InternalError;
-
-    outCandidateLine = candidateLine;
-    return Result::Success;
-}
-
-SDPProcessor::ParsingResult SDPProcessor::parseCandidateLine(const String& candidateLine) const
-{
-    String scriptOutput;
-    if (!callScript("parseCandidateLine", candidateLine, scriptOutput))
-        return { Result::InternalError };
-
-    if (scriptOutput == "ParseError")
-        return { Result::ParseError };
-
-    auto candidate = iceCandidateFromJSON(scriptOutput);
-    if (!candidate)
-        return { Result::InternalError };
-    return { WTFMove(candidate.value()) };
-}
-
-bool SDPProcessor::callScript(const String& functionName, const String& argument, String& outResult) const
-{
-    if (!scriptExecutionContext())
-        return false;
-
-    Document* document = downcast<Document>(scriptExecutionContext());
-    if (!document->frame())
-        return false;
-
-    if (!m_isolatedWorld)
-        m_isolatedWorld = DOMWrapperWorld::create(commonVM());
-
-    ScriptController& scriptController = document->frame()->script();
-    JSDOMGlobalObject* globalObject = JSC::jsCast<JSDOMGlobalObject*>(scriptController.globalObject(*m_isolatedWorld));
-    JSC::VM& vm = globalObject->vm();
-    JSC::JSLockHolder lock(vm);
-    auto scope = DECLARE_CATCH_SCOPE(vm);
-    JSC::ExecState* exec = globalObject->globalExec();
-
-    JSC::JSValue probeFunctionValue = globalObject->get(exec, JSC::Identifier::fromString(exec, "generate"));
-    if (!probeFunctionValue.isFunction()) {
-        URL scriptURL;
-        scriptController.evaluateInWorld(ScriptSourceCode(SDPProcessorScriptResource::scriptString(), scriptURL), *m_isolatedWorld);
-        if (UNLIKELY(scope.exception())) {
-            scope.clearException();
-            return false;
-        }
-    }
-
-    JSC::JSValue functionValue = globalObject->get(exec, JSC::Identifier::fromString(exec, functionName));
-    if (!functionValue.isFunction())
-        return false;
-
-    JSC::JSObject* function = functionValue.toObject(exec);
-    JSC::CallData callData;
-    JSC::CallType callType = function->methodTable(vm)->getCallData(function, callData);
-    if (callType == JSC::CallType::None)
-        return false;
-
-    JSC::MarkedArgumentBuffer argList;
-    argList.append(JSC::jsString(exec, argument));
-
-    JSC::JSValue result = JSC::call(exec, function, callType, callData, globalObject, argList);
-    if (UNLIKELY(scope.exception())) {
-        LOG_ERROR("SDPProcessor script threw in function %s", functionName.ascii().data());
-        scope.clearException();
-        return false;
-    }
-
-    if (!result.isString())
-        return false;
-
-    outResult = asString(result)->value(exec);
-    return true;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/Modules/mediastream/SDPProcessor.h b/Source/WebCore/Modules/mediastream/SDPProcessor.h
deleted file mode 100644 (file)
index ca61c9a..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2015 Ericsson AB. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 "ContextDestructionObserver.h"
-#include "IceCandidate.h"
-#include "MediaEndpointSessionConfiguration.h"
-#include <wtf/RefPtr.h>
-#include <wtf/Variant.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class DOMWrapperWorld;
-class ScriptExecutionContext;
-
-class SDPProcessor : public ContextDestructionObserver {
-public:
-    enum class Result {
-        Success = 1,
-        InternalError = 2,
-        ParseError = 3
-    };
-
-    SDPProcessor(ScriptExecutionContext*);
-
-    Result generate(const MediaEndpointSessionConfiguration&, String& outSdpString) const;
-    Result parse(const String& sdp, RefPtr<MediaEndpointSessionConfiguration>&) const;
-
-    Result generateCandidateLine(const IceCandidate&, String& outCandidateLine) const;
-
-    struct ParsingResult {
-        Variant<IceCandidate, Result> result;
-
-        Result parsingStatus() const { return WTF::holds_alternative<IceCandidate>(result) ? Result::Success : WTF::get<SDPProcessor::Result>(result); }
-        IceCandidate& candidate() { return WTF::get<IceCandidate>(result); }
-    };
-    ParsingResult parseCandidateLine(const String& candidateLine) const;
-
-private:
-    bool callScript(const String& functionName, const String& argument, String& outResult) const;
-
-    mutable RefPtr<DOMWrapperWorld> m_isolatedWorld;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
index 6eb4a74..23851f9 100644 (file)
@@ -80,7 +80,6 @@ bool LibWebRTCMediaEndpoint::setConfiguration(LibWebRTCProvider& client, webrtc:
     return m_backend->SetConfiguration(WTFMove(configuration));
 }
 
-// FIXME: unify with MediaEndpointSessionDescription::typeString()
 static inline const char* sessionDescriptionType(RTCSdpType sdpType)
 {
     switch (sdpType) {
index b0e7549..3738a0e 100644 (file)
                41ABE67B1D0580DB006D862D /* CrossOriginPreflightChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 41ABE67A1D0580D5006D862D /* CrossOriginPreflightChecker.h */; };
                41ABE67C1D0580E0006D862D /* CrossOriginPreflightChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41ABE6791D0580D5006D862D /* CrossOriginPreflightChecker.cpp */; };
                41AD753A1CEF6BD100A31486 /* FetchOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 41AD75391CEF6BCE00A31486 /* FetchOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               41B28B141F8501A600FB52AC /* MediaEndpointConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41B28B131F8501A400FB52AC /* MediaEndpointConfiguration.cpp */; };
+               41B28B151F8501D300FB52AC /* MediaEndpointConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 41B28B121F8501A300FB52AC /* MediaEndpointConfiguration.h */; };
                41B2A6261EF1BF6D002B9D7A /* WebAudioSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 41B2A6251EF1BF60002B9D7A /* WebAudioSourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
                41B459EF1F55EBD10000F6FD /* ReadableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41B459ED1F55EBC70000F6FD /* ReadableStream.cpp */; };
                41BF700C0FE86F49005E8DEC /* MessagePortChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 41BF700A0FE86F49005E8DEC /* MessagePortChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5DFE8F560D16477B0076E937 /* ScheduledAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */; };
                5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA378BB0D15F64200B793D6 /* ScheduledAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5DFEBAB718592B6D00C75BEB /* WebKitAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5E16A2E41BFA650B0029A21E /* MediaEndpointPeerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E16A2E31BFA64FB0029A21E /* MediaEndpointPeerConnection.h */; };
-               5E16A2E51BFA650F0029A21E /* MediaEndpointPeerConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E16A2E21BFA64FB0029A21E /* MediaEndpointPeerConnection.cpp */; };
                5E2C43511BCEE2F60001E2BC /* PeerConnectionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C434D1BCEE2E50001E2BC /* PeerConnectionBackend.h */; };
                5E2C435F1BCEE31E0001E2BC /* RTCRtpSenderReceiverBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C435D1BCEE30D0001E2BC /* RTCRtpSenderReceiverBase.h */; };
                5E2C43601BCEE3230001E2BC /* RTCRtpSender.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E2C43591BCEE30D0001E2BC /* RTCRtpSender.cpp */; };
                5E2C43741BCF0D750001E2BE /* JSRTCRtpParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C43701BCF0D690001E2BE /* JSRTCRtpParameters.h */; };
                5E2C437B1BCF9A570001E2BC /* RTCPeerConnectionBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C43761BCF9A0B0001E2BC /* RTCPeerConnectionBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5E2C437C1BCF9A840001E2BC /* RTCPeerConnectionInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C43791BCF9A0B0001E2BC /* RTCPeerConnectionInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5E4EAB041D07166A0006A184 /* MediaEndpointSessionDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E4EAB031D07164C0006A184 /* MediaEndpointSessionDescription.h */; };
-               5E4EAB051D07166E0006A184 /* MediaEndpointSessionDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E4EAB021D07164C0006A184 /* MediaEndpointSessionDescription.cpp */; };
                5E5E2B131CFC3E70000C0D85 /* RTCRtpTransceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E5E2B101CFC3E4B000C0D85 /* RTCRtpTransceiver.cpp */; };
                5E5E2B141CFC3E75000C0D85 /* RTCRtpTransceiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E5E2B111CFC3E4B000C0D85 /* RTCRtpTransceiver.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5EA3D6DF1C859D7F00300BBB /* MockMediaEndpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA3D6DE1C859D5300300BBB /* MockMediaEndpoint.h */; };
-               5EA3D6E01C859D8400300BBB /* MockMediaEndpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA3D6DD1C859D5300300BBB /* MockMediaEndpoint.cpp */; };
-               5EA3D6E31C859DC100300BBB /* SDPProcessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA3D6E11C859DAA00300BBB /* SDPProcessor.cpp */; };
-               5EA3D6E41C859DC100300BBB /* SDPProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA3D6E21C859DAA00300BBB /* SDPProcessor.h */; };
-               5EA3D6E71C85A9DB00300BBB /* SDPProcessorScriptResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA3D6E51C85A9C300300BBB /* SDPProcessorScriptResource.cpp */; };
-               5EA3D6E81C85A9DB00300BBB /* SDPProcessorScriptResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA3D6E61C85A9C300300BBB /* SDPProcessorScriptResource.h */; };
                5EA725D21ACABD4700EAD17B /* MediaDevices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA725CD1ACABCD900EAD17B /* MediaDevices.cpp */; };
                5EA725D31ACABD4700EAD17B /* MediaDevices.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA725CE1ACABCD900EAD17B /* MediaDevices.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5EA725D51ACABD5700EAD17B /* NavigatorMediaDevices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA725CA1ACABCB500EAD17B /* NavigatorMediaDevices.cpp */; };
                5EA725D61ACABD5700EAD17B /* NavigatorMediaDevices.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA725CB1ACABCB500EAD17B /* NavigatorMediaDevices.h */; };
                5EBB89311C7777FF00C65D41 /* MediaPayload.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB892F1C7777D000C65D41 /* MediaPayload.h */; };
-               5EBB89321C77782300C65D41 /* MediaEndpointSessionConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB892E1C7777D000C65D41 /* MediaEndpointSessionConfiguration.h */; };
                5EBB89331C77782900C65D41 /* IceCandidate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB89301C7777E100C65D41 /* IceCandidate.h */; };
-               5EBB89341C77782900C65D41 /* MediaEndpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBB892A1C7777D000C65D41 /* MediaEndpoint.cpp */; };
-               5EBB89351C77782900C65D41 /* MediaEndpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB892B1C7777D000C65D41 /* MediaEndpoint.h */; };
-               5EBB89361C77782900C65D41 /* MediaEndpointConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBB892C1C7777D000C65D41 /* MediaEndpointConfiguration.cpp */; };
-               5EBB89371C77782900C65D41 /* MediaEndpointConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB892D1C7777D000C65D41 /* MediaEndpointConfiguration.h */; };
                5EBB89391C77C39900C65D41 /* PeerMediaDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EBB89381C77BDA400C65D41 /* PeerMediaDescription.h */; };
                5F2DBBE9178E3C8100141486 /* CertificateInfoMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */; };
                5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F2DBBE8178E336900141486 /* CertificateInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CDAB6D2E17C814EE00C60B34 /* JSMediaControlsHost.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2C17C814EE00C60B34 /* JSMediaControlsHost.h */; };
                CDAB6D3117C9259500C60B34 /* UserAgentScripts.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAB6D2F17C9259500C60B34 /* UserAgentScripts.h */; };
                CDAB6D3217C9259500C60B34 /* UserAgentScriptsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAB6D3017C9259500C60B34 /* UserAgentScriptsData.cpp */; };
-               CDAB6D3217C9259500C60B35 /* SDPProcessorScriptsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAB6D3017C9259500C60B35 /* SDPProcessorScriptsData.cpp */; };
                CDAE8C091746B95700532D78 /* PlatformMediaSessionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDAE8C071746B95700532D78 /* PlatformMediaSessionManager.cpp */; };
                CDBEAEAC19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDBEAEAA19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm */; };
                CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDBEAEAB19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h */; };
                41ABE6791D0580D5006D862D /* CrossOriginPreflightChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossOriginPreflightChecker.cpp; sourceTree = "<group>"; };
                41ABE67A1D0580D5006D862D /* CrossOriginPreflightChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossOriginPreflightChecker.h; sourceTree = "<group>"; };
                41AD75391CEF6BCE00A31486 /* FetchOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchOptions.h; sourceTree = "<group>"; };
+               41B28B121F8501A300FB52AC /* MediaEndpointConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpointConfiguration.h; sourceTree = "<group>"; };
+               41B28B131F8501A400FB52AC /* MediaEndpointConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaEndpointConfiguration.cpp; sourceTree = "<group>"; };
                41B2A6251EF1BF60002B9D7A /* WebAudioSourceProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebAudioSourceProvider.h; sourceTree = "<group>"; };
                41B459DA1F4CADB90000F6FD /* ReadableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStream.h; sourceTree = "<group>"; };
                41B459ED1F55EBC70000F6FD /* ReadableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStream.cpp; sourceTree = "<group>"; };
                5DB1BC6810715A6400EFAA49 /* TransformSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformSource.h; sourceTree = "<group>"; };
                5DB1BC6910715A6400EFAA49 /* TransformSourceLibxslt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformSourceLibxslt.cpp; sourceTree = "<group>"; };
                5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAvailability.h; sourceTree = "<group>"; };
-               5E16A2E21BFA64FB0029A21E /* MediaEndpointPeerConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaEndpointPeerConnection.cpp; sourceTree = "<group>"; };
-               5E16A2E31BFA64FB0029A21E /* MediaEndpointPeerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpointPeerConnection.h; sourceTree = "<group>"; };
                5E2C434D1BCEE2E50001E2BC /* PeerConnectionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeerConnectionBackend.h; sourceTree = "<group>"; };
                5E2C43541BCEE30D0001E2BC /* RTCPeerConnection.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = RTCPeerConnection.js; sourceTree = "<group>"; };
                5E2C43551BCEE30D0001E2BC /* RTCPeerConnectionInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = RTCPeerConnectionInternals.js; sourceTree = "<group>"; };
                5E2C43761BCF9A0B0001E2BC /* RTCPeerConnectionBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionBuiltins.h; sourceTree = "<group>"; };
                5E2C43781BCF9A0B0001E2BC /* RTCPeerConnectionInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCPeerConnectionInternalsBuiltins.cpp; sourceTree = "<group>"; };
                5E2C43791BCF9A0B0001E2BC /* RTCPeerConnectionInternalsBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionInternalsBuiltins.h; sourceTree = "<group>"; };
-               5E4EAB021D07164C0006A184 /* MediaEndpointSessionDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaEndpointSessionDescription.cpp; sourceTree = "<group>"; };
-               5E4EAB031D07164C0006A184 /* MediaEndpointSessionDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpointSessionDescription.h; sourceTree = "<group>"; };
                5E5E2B101CFC3E4B000C0D85 /* RTCRtpTransceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCRtpTransceiver.cpp; sourceTree = "<group>"; };
                5E5E2B111CFC3E4B000C0D85 /* RTCRtpTransceiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCRtpTransceiver.h; sourceTree = "<group>"; };
                5E5E2B121CFC3E4B000C0D85 /* RTCRtpTransceiver.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCRtpTransceiver.idl; sourceTree = "<group>"; };
                5E6653091DA437BF00FDD84C /* RTCIceTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCIceTransport.h; sourceTree = "<group>"; };
-               5EA3D6DD1C859D5300300BBB /* MockMediaEndpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockMediaEndpoint.cpp; sourceTree = "<group>"; };
-               5EA3D6DE1C859D5300300BBB /* MockMediaEndpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockMediaEndpoint.h; sourceTree = "<group>"; };
-               5EA3D6E11C859DAA00300BBB /* SDPProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SDPProcessor.cpp; sourceTree = "<group>"; };
-               5EA3D6E21C859DAA00300BBB /* SDPProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDPProcessor.h; sourceTree = "<group>"; };
-               5EA3D6E51C85A9C300300BBB /* SDPProcessorScriptResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SDPProcessorScriptResource.cpp; sourceTree = "<group>"; };
-               5EA3D6E61C85A9C300300BBB /* SDPProcessorScriptResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDPProcessorScriptResource.h; sourceTree = "<group>"; };
                5EA725CA1ACABCB500EAD17B /* NavigatorMediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorMediaDevices.cpp; sourceTree = "<group>"; };
                5EA725CB1ACABCB500EAD17B /* NavigatorMediaDevices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorMediaDevices.h; sourceTree = "<group>"; };
                5EA725CC1ACABCB500EAD17B /* NavigatorMediaDevices.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorMediaDevices.idl; sourceTree = "<group>"; };
                5EA725CD1ACABCD900EAD17B /* MediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDevices.cpp; sourceTree = "<group>"; };
                5EA725CE1ACABCD900EAD17B /* MediaDevices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaDevices.h; sourceTree = "<group>"; };
                5EA725CF1ACABCD900EAD17B /* MediaDevices.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaDevices.idl; sourceTree = "<group>"; };
-               5EBB892A1C7777D000C65D41 /* MediaEndpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaEndpoint.cpp; sourceTree = "<group>"; };
-               5EBB892B1C7777D000C65D41 /* MediaEndpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpoint.h; sourceTree = "<group>"; };
-               5EBB892C1C7777D000C65D41 /* MediaEndpointConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaEndpointConfiguration.cpp; sourceTree = "<group>"; };
-               5EBB892D1C7777D000C65D41 /* MediaEndpointConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpointConfiguration.h; sourceTree = "<group>"; };
-               5EBB892E1C7777D000C65D41 /* MediaEndpointSessionConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEndpointSessionConfiguration.h; sourceTree = "<group>"; };
                5EBB892F1C7777D000C65D41 /* MediaPayload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPayload.h; sourceTree = "<group>"; };
                5EBB89301C7777E100C65D41 /* IceCandidate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IceCandidate.h; sourceTree = "<group>"; };
                5EBB89381C77BDA400C65D41 /* PeerMediaDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeerMediaDescription.h; sourceTree = "<group>"; };
                CDAB6D2C17C814EE00C60B34 /* JSMediaControlsHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaControlsHost.h; sourceTree = "<group>"; };
                CDAB6D2F17C9259500C60B34 /* UserAgentScripts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserAgentScripts.h; sourceTree = "<group>"; };
                CDAB6D3017C9259500C60B34 /* UserAgentScriptsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserAgentScriptsData.cpp; sourceTree = "<group>"; };
-               CDAB6D3017C9259500C60B35 /* SDPProcessorScriptsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SDPProcessorScriptsData.cpp; sourceTree = "<group>"; };
                CDAE8C071746B95700532D78 /* PlatformMediaSessionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformMediaSessionManager.cpp; sourceTree = "<group>"; };
                CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformMediaSessionManager.h; sourceTree = "<group>"; };
                CDBEAEAA19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaSelectionGroupAVFObjC.mm; sourceTree = "<group>"; };
                                07ABEF6D1D8A1C7600F21972 /* MediaDevicesEnumerationRequest.h */,
                                07394EC71BAB2CCD00BE99CD /* MediaDevicesRequest.cpp */,
                                07394EC91BAB2CD700BE99CD /* MediaDevicesRequest.h */,
-                               5E16A2E21BFA64FB0029A21E /* MediaEndpointPeerConnection.cpp */,
-                               5E16A2E31BFA64FB0029A21E /* MediaEndpointPeerConnection.h */,
-                               5E4EAB021D07164C0006A184 /* MediaEndpointSessionDescription.cpp */,
-                               5E4EAB031D07164C0006A184 /* MediaEndpointSessionDescription.h */,
                                07221B4C17CEC32700848E51 /* MediaStream.cpp */,
                                07221B4D17CEC32700848E51 /* MediaStream.h */,
                                07221B4E17CEC32700848E51 /* MediaStream.idl */,
                                5E2C43641BCEE3720001E2BC /* RTCTrackEvent.cpp */,
                                5E2C43651BCEE3720001E2BC /* RTCTrackEvent.h */,
                                5E2C43661BCEE3720001E2BC /* RTCTrackEvent.idl */,
-                               5EA3D6E11C859DAA00300BBB /* SDPProcessor.cpp */,
-                               5EA3D6E21C859DAA00300BBB /* SDPProcessor.h */,
                                07221B8D17CEC32700848E51 /* UserMediaClient.h */,
                                07221B8E17CEC32700848E51 /* UserMediaController.cpp */,
                                07221B8F17CEC32700848E51 /* UserMediaController.h */,
                                5EBB89301C7777E100C65D41 /* IceCandidate.h */,
                                1BE5BFC11D515715001666D9 /* MediaConstraints.cpp */,
                                07221B9917CF0AD400848E51 /* MediaConstraints.h */,
-                               5EBB892A1C7777D000C65D41 /* MediaEndpoint.cpp */,
-                               5EBB892B1C7777D000C65D41 /* MediaEndpoint.h */,
-                               5EBB892C1C7777D000C65D41 /* MediaEndpointConfiguration.cpp */,
-                               5EBB892D1C7777D000C65D41 /* MediaEndpointConfiguration.h */,
-                               5EBB892E1C7777D000C65D41 /* MediaEndpointSessionConfiguration.h */,
+                               41B28B131F8501A400FB52AC /* MediaEndpointConfiguration.cpp */,
+                               41B28B121F8501A300FB52AC /* MediaEndpointConfiguration.h */,
                                5EBB892F1C7777D000C65D41 /* MediaPayload.h */,
                                070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */,
                                0711588F17DF633700EDFE2B /* MediaStreamPrivate.cpp */,
                                07221BAD17CF0AD400848E51 /* RTCSessionDescriptionRequest.h */,
                                313591051E7DDC6000F30630 /* RTCSignalingState.h */,
                                07221BB017CF0AD400848E51 /* RTCVoidRequest.h */,
-                               5EA3D6E51C85A9C300300BBB /* SDPProcessorScriptResource.cpp */,
-                               5EA3D6E61C85A9C300300BBB /* SDPProcessorScriptResource.h */,
                                070E81D01BF27656001FDA48 /* VideoTrackPrivateMediaStream.h */,
                                41B2A6251EF1BF60002B9D7A /* WebAudioSourceProvider.h */,
                        );
                                077B64151B95F703003E9AD5 /* MediaPlaybackTargetMock.h */,
                                077B64101B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.cpp */,
                                077B64111B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h */,
-                               5EA3D6DD1C859D5300300BBB /* MockMediaEndpoint.cpp */,
-                               5EA3D6DE1C859D5300300BBB /* MockMediaEndpoint.h */,
                                07D6A4F11BED5F8800174146 /* MockRealtimeAudioSource.cpp */,
                                07D6A4F21BED5F8800174146 /* MockRealtimeAudioSource.h */,
                                07D6A4ED1BECF2D200174146 /* MockRealtimeMediaSource.cpp */,
                                5E2C43761BCF9A0B0001E2BC /* RTCPeerConnectionBuiltins.h */,
                                5E2C43781BCF9A0B0001E2BC /* RTCPeerConnectionInternalsBuiltins.cpp */,
                                5E2C43791BCF9A0B0001E2BC /* RTCPeerConnectionInternalsBuiltins.h */,
-                               CDAB6D3017C9259500C60B35 /* SDPProcessorScriptsData.cpp */,
                                43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */,
                                43B85ED318CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.gperf */,
                                26AA0F9D18D2A18B00419381 /* SelectorPseudoElementTypeMap.cpp */,
                        children = (
                                CE2616A4187E65C1007955F3 /* ios */,
                                2D5036661BCDDDC400E20BB3 /* mac */,
+                               7CD0E2B61F80A4820016A4CE /* AbortController.cpp */,
+                               7CD0E2B51F80A4820016A4CE /* AbortController.h */,
+                               7CD0E2B71F80A4820016A4CE /* AbortController.idl */,
+                               7CD0E2BD1F80A56E0016A4CE /* AbortSignal.cpp */,
+                               7CD0E2BC1F80A56E0016A4CE /* AbortSignal.h */,
+                               7CD0E2BE1F80A56E0016A4CE /* AbortSignal.idl */,
                                7C5222971E1DAE16002CB8F7 /* ActiveDOMCallback.cpp */,
                                7C5222981E1DAE16002CB8F7 /* ActiveDOMCallback.h */,
                                7CD0BA021B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.cpp */,
                                E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */,
                                E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */,
                                83BB5C871D5D6F3A005A71F4 /* AllDescendantsCollection.h */,
-                               7CD0E2B51F80A4820016A4CE /* AbortController.h */,
-                               7CD0E2B61F80A4820016A4CE /* AbortController.cpp */,
-                               7CD0E2B71F80A4820016A4CE /* AbortController.idl */,
-                               7CD0E2BC1F80A56E0016A4CE /* AbortSignal.h */,
-                               7CD0E2BD1F80A56E0016A4CE /* AbortSignal.cpp */,
-                               7CD0E2BE1F80A56E0016A4CE /* AbortSignal.idl */,
                                319847FE1A1D816700A13318 /* AnimationEvent.cpp */,
                                319847FF1A1D816700A13318 /* AnimationEvent.h */,
                                319848001A1D816700A13318 /* AnimationEvent.idl */,
                        isa = PBXHeadersBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               7CD0E2B81F80A4820016A4CE /* AbortController.h in Headers */,
+                               7CD0E2BF1F80A56E0016A4CE /* AbortSignal.h in Headers */,
                                F48223131E386E240066FC79 /* AbstractPasteboard.h in Headers */,
                                41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */,
                                29A8122E0FBB9C1D00510293 /* AccessibilityARIAGridCell.h in Headers */,
                                2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */,
                                1C21E57D183ED1FF001C289D /* IOSurfacePool.h in Headers */,
                                07AC47021952102100EE9723 /* ISOVTTCue.h in Headers */,
+                               7C30D9841F815AEC00268356 /* JSAbortController.h in Headers */,
+                               7C30D9861F815AEC00268356 /* JSAbortSignal.h in Headers */,
                                418F88050FF957AF0080F045 /* JSAbstractWorker.h in Headers */,
                                5704405A1E53936200356601 /* JSAesCbcCfbParams.h in Headers */,
                                57E1E5AD1E8DD09B00EE37C9 /* JSAesCtrParams.h in Headers */,
                                07FE99DD18807A7D00256648 /* MediaElementSession.h in Headers */,
                                2D9BF7061DBFBB24007A7D99 /* MediaEncryptedEvent.h in Headers */,
                                2D9BF7081DBFBB24007A7D99 /* MediaEncryptedEventInit.h in Headers */,
-                               5EBB89351C77782900C65D41 /* MediaEndpoint.h in Headers */,
-                               5EBB89371C77782900C65D41 /* MediaEndpointConfiguration.h in Headers */,
-                               5E16A2E41BFA650B0029A21E /* MediaEndpointPeerConnection.h in Headers */,
-                               5EBB89321C77782300C65D41 /* MediaEndpointSessionConfiguration.h in Headers */,
-                               5E4EAB041D07166A0006A184 /* MediaEndpointSessionDescription.h in Headers */,
+                               41B28B151F8501D300FB52AC /* MediaEndpointConfiguration.h in Headers */,
                                E44613AD0CD6331000FADA75 /* MediaError.h in Headers */,
                                4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */,
                                07A6D1EC1491137700051D0C /* MediaFragmentURIParser.h in Headers */,
                                52F10866162B6DA8009AC81E /* MixedContentChecker.h in Headers */,
                                CDF2B0111820540600F2B424 /* MockBox.h in Headers */,
                                CDF4B7241E03BF8100E235A2 /* MockCDMFactory.h in Headers */,
-                               7C30D9841F815AEC00268356 /* JSAbortController.h in Headers */,
                                CDF4B7201E03BF6F00E235A2 /* MockCDMFactory.idl in Headers */,
                                51058AE01D67C229009A538C /* MockGamepad.h in Headers */,
                                51058AE21D67C229009A538C /* MockGamepadProvider.h in Headers */,
-                               5EA3D6DF1C859D7F00300BBB /* MockMediaEndpoint.h in Headers */,
                                CDF2B0131820540600F2B424 /* MockMediaPlayerMediaSource.h in Headers */,
                                CDF2B0151820540600F2B424 /* MockMediaSourcePrivate.h in Headers */,
                                07D6A4F41BED5F8800174146 /* MockRealtimeAudioSource.h in Headers */,
                                83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */,
                                93C09C860B0657AA005ABD4D /* ScrollTypes.h in Headers */,
                                BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
-                               5EA3D6E41C859DC100300BBB /* SDPProcessor.h in Headers */,
-                               5EA3D6E81C85A9DB00300BBB /* SDPProcessorScriptResource.h in Headers */,
                                F55B3DD21251F12D003EF269 /* SearchInputType.h in Headers */,
                                AB7170890B3118080017123E /* SearchPopupMenu.h in Headers */,
                                0E7058F41BC5CEDA0045A507 /* SearchPopupMenuCocoa.h in Headers */,
                                B22279950D00BF220071B782 /* SVGAnimateTransformElement.h in Headers */,
                                B22279980D00BF220071B782 /* SVGAnimationElement.h in Headers */,
                                439D334513A6911C00C20F4F /* SVGAnimatorFactory.h in Headers */,
-                               7C30D9861F815AEC00268356 /* JSAbortSignal.h in Headers */,
                                08FB3F8413BC754C0099FC18 /* SVGAttributeToPropertyMap.h in Headers */,
                                B222799C0D00BF220071B782 /* SVGCircleElement.h in Headers */,
                                B222799F0D00BF220071B782 /* SVGClipPathElement.h in Headers */,
                                B2227A060D00BF220071B782 /* SVGFETileElement.h in Headers */,
                                B2227A090D00BF220071B782 /* SVGFETurbulenceElement.h in Headers */,
                                845E72FC0FD2623900A87D79 /* SVGFilter.h in Headers */,
-                               7CD0E2BF1F80A56E0016A4CE /* AbortSignal.h in Headers */,
                                081EBF3B0FD34F4100DA7559 /* SVGFilterBuilder.h in Headers */,
                                B2227A0C0D00BF220071B782 /* SVGFilterElement.h in Headers */,
                                B2227A0F0D00BF220071B782 /* SVGFilterPrimitiveStandardAttributes.h in Headers */,
                                77A17A7812F28642004E02F6 /* WebGLVertexArrayObjectOES.h in Headers */,
                                316BDB8C1E6E153000DE0D5A /* WebGPULayer.h in Headers */,
                                A5E2123C1E4924A400CE1044 /* WebHeapAgent.h in Headers */,
-                               7CD0E2B81F80A4820016A4CE /* AbortController.h in Headers */,
                                A5840E25187B8AC200843B10 /* WebInjectedScriptHost.h in Headers */,
                                A584FE301864CB8400843B10 /* WebInjectedScriptManager.h in Headers */,
                                F48223111E3869B80066FC79 /* WebItemProviderPasteboard.h in Headers */,
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               7CD0E2B91F80A4820016A4CE /* AbortController.cpp in Sources */,
+                               7CD0E2C01F80A56E0016A4CE /* AbortSignal.cpp in Sources */,
                                41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
                                37F57AB91A50726900876F98 /* AccessibilityARIAGrid.cpp in Sources */,
                                37F57ABA1A50726F00876F98 /* AccessibilityARIAGridCell.cpp in Sources */,
                                CE2849891CA3614600B4A57F /* ContentSecurityPolicyDirectiveNames.cpp in Sources */,
                                CE799FA71C6A50570097B518 /* ContentSecurityPolicyMediaListDirective.cpp in Sources */,
                                CE6DADF91C591E6A003F6A88 /* ContentSecurityPolicyResponseHeaders.cpp in Sources */,
-                               7C30D9851F815AEC00268356 /* JSAbortSignal.cpp in Sources */,
                                CE799F9F1C6A4C160097B518 /* ContentSecurityPolicySource.cpp in Sources */,
                                CE799F971C6A46BC0097B518 /* ContentSecurityPolicySourceList.cpp in Sources */,
                                CE799FAB1C6A50660097B518 /* ContentSecurityPolicySourceListDirective.cpp in Sources */,
                                E1233F10185A4130008DFAF5 /* CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp in Sources */,
                                E1BD3319182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp in Sources */,
                                E1C266D818317AB4003F8B33 /* CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp in Sources */,
-                               7C30D9831F815AEC00268356 /* JSAbortController.cpp in Sources */,
                                E125F82B1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.cpp in Sources */,
                                E19AC3EE1824DC7900349426 /* CryptoAlgorithmSHA224.cpp in Sources */,
                                E19AC3F01824DC7900349426 /* CryptoAlgorithmSHA256.cpp in Sources */,
                                1C21E57C183ED1FF001C289D /* IOSurfacePool.cpp in Sources */,
                                AD9FF6E11908391D003B61E0 /* IOSurfacePoolCocoa.mm in Sources */,
                                07AC47011952102100EE9723 /* ISOVTTCue.cpp in Sources */,
+                               7C30D9831F815AEC00268356 /* JSAbortController.cpp in Sources */,
+                               7C30D9851F815AEC00268356 /* JSAbortSignal.cpp in Sources */,
                                418F88040FF957AE0080F045 /* JSAbstractWorker.cpp in Sources */,
                                5704405C1E53937900356601 /* JSAesCbcCfbParams.cpp in Sources */,
                                57E1E5AC1E8DD09B00EE37C9 /* JSAesCtrParams.cpp in Sources */,
                                A584FE3B1864E2D800843B10 /* JSCommandLineAPIHost.cpp in Sources */,
                                93F9B6E00BA0FB7200854064 /* JSComment.cpp in Sources */,
                                79AC9218109945C80021266E /* JSCompositionEvent.cpp in Sources */,
-                               7CD0E2C01F80A56E0016A4CE /* AbortSignal.cpp in Sources */,
                                FDA15EBD12B03F0B003A583A /* JSConvolverNode.cpp in Sources */,
                                FE6FD48D0F676E9300092873 /* JSCoordinates.cpp in Sources */,
                                14DCF3B21B6BE2080062D4C2 /* JSCountQueuingStrategy.cpp in Sources */,
                                836ACED21ECAAB19004BD012 /* JSDOMMatrix.cpp in Sources */,
                                7CBBBCCB1F56180D005EFAAC /* JSDOMMatrix2DInit.cpp in Sources */,
                                835657C71ECAB10700CDE72D /* JSDOMMatrixInit.cpp in Sources */,
-                               7CD0E2B91F80A4820016A4CE /* AbortController.cpp in Sources */,
                                836ACED51ECAAB19004BD012 /* JSDOMMatrixReadOnly.cpp in Sources */,
                                A9D248060D757E7D00FDF959 /* JSDOMMimeType.cpp in Sources */,
                                A9D248080D757E7D00FDF959 /* JSDOMMimeTypeArray.cpp in Sources */,
                                FD6F252C13F5EF0E0065165F /* MediaElementAudioSourceNode.cpp in Sources */,
                                07FE99DC18807A7D00256648 /* MediaElementSession.cpp in Sources */,
                                2D9BF7051DBFBB24007A7D99 /* MediaEncryptedEvent.cpp in Sources */,
-                               5EBB89341C77782900C65D41 /* MediaEndpoint.cpp in Sources */,
-                               5EBB89361C77782900C65D41 /* MediaEndpointConfiguration.cpp in Sources */,
-                               5E16A2E51BFA650F0029A21E /* MediaEndpointPeerConnection.cpp in Sources */,
-                               5E4EAB051D07166E0006A184 /* MediaEndpointSessionDescription.cpp in Sources */,
+                               41B28B141F8501A600FB52AC /* MediaEndpointConfiguration.cpp in Sources */,
                                4E1959210A39DABA00220FE5 /* MediaFeatureNames.cpp in Sources */,
                                07A6D1EB1491137700051D0C /* MediaFragmentURIParser.cpp in Sources */,
                                2D9BF7471DBFDC49007A7D99 /* MediaKeyMessageEvent.cpp in Sources */,
                                CDF2B0101820540600F2B424 /* MockBox.cpp in Sources */,
                                51058ADF1D67C229009A538C /* MockGamepad.cpp in Sources */,
                                51058AE11D67C229009A538C /* MockGamepadProvider.cpp in Sources */,
-                               5EA3D6E01C859D8400300BBB /* MockMediaEndpoint.cpp in Sources */,
                                CDF2B0121820540600F2B424 /* MockMediaPlayerMediaSource.cpp in Sources */,
                                CDF2B0141820540600F2B424 /* MockMediaSourcePrivate.cpp in Sources */,
                                07D6A4F31BED5F8800174146 /* MockRealtimeAudioSource.cpp in Sources */,
                                BC2441C40E8B65D00055320F /* ScrollView.cpp in Sources */,
                                E45390450EAFD637003695C8 /* ScrollViewIOS.mm in Sources */,
                                9353676B09AED88B00D35CD6 /* ScrollViewMac.mm in Sources */,
-                               5EA3D6E31C859DC100300BBB /* SDPProcessor.cpp in Sources */,
-                               5EA3D6E71C85A9DB00300BBB /* SDPProcessorScriptResource.cpp in Sources */,
-                               CDAB6D3217C9259500C60B35 /* SDPProcessorScriptsData.cpp in Sources */,
                                F55B3DD11251F12D003EF269 /* SearchInputType.cpp in Sources */,
                                0E7058EE1BC5BC190045A507 /* SearchPopupMenuCocoa.mm in Sources */,
                                976F36EA14686225005E93B4 /* SecurityContext.cpp in Sources */,
index 99cf5ff..7e224d7 100644 (file)
@@ -1,26 +1,3 @@
-list(APPEND WebCore_INCLUDE_DIRECTORIES
-    "${WEBCORE_DIR}/platform/mediastream/openwebrtc"
-)
-
-if (ENABLE_MEDIA_STREAM)
-    list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
-        ${OPENWEBRTC_INCLUDE_DIRS}
-    )
-
-    list(APPEND WebCore_LIBRARIES
-        ${OPENWEBRTC_LIBRARIES}
-    )
-
-    list(APPEND WebCore_SOURCES
-        platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp
-
-        platform/mediastream/openwebrtc/MediaEndpointOwr.cpp
-        platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp
-        platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp
-        platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp
-    )
-endif ()
-
 if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
     list(APPEND WebCore_INCLUDE_DIRECTORIES
         "${WEBCORE_DIR}/platform/graphics/gstreamer"
index 4877160..f093d45 100644 (file)
@@ -53,9 +53,6 @@
 
 #if USE(GSTREAMER)
 #include "MediaPlayerPrivateGStreamer.h"
-#if ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
-#include "MediaPlayerPrivateGStreamerOwr.h"
-#endif
 #define PlatformMediaEngineClassName MediaPlayerPrivateGStreamer
 #if ENABLE(VIDEO) && ENABLE(MEDIA_SOURCE) && ENABLE(VIDEO_TRACK)
 #include "MediaPlayerPrivateGStreamerMSE.h"
@@ -268,11 +265,6 @@ static void buildMediaEnginesVector()
         PlatformMediaEngineClassName::registerMediaEngine(addMediaEngine);
 #endif
 
-#if ENABLE(MEDIA_STREAM) && USE(GSTREAMER) && USE(OPENWEBRTC)
-    if (Settings::isGStreamerEnabled())
-        MediaPlayerPrivateGStreamerOwr::registerMediaEngine(addMediaEngine);
-#endif
-
 #if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(MEDIA_SOURCE) && ENABLE(VIDEO_TRACK)
     if (Settings::isGStreamerEnabled())
         MediaPlayerPrivateGStreamerMSE::registerMediaEngine(addMediaEngine);
index f38e637..84794f4 100644 (file)
@@ -1931,7 +1931,6 @@ MediaPlayer::SupportsType MediaPlayerPrivateGStreamer::supportsType(const MediaE
         return result;
 #endif
 
-    // MediaStream playback is handled by the OpenWebRTC player.
     if (parameters.isMediaStream)
         return result;
 
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp
deleted file mode 100644 (file)
index e51ff6c..0000000
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- *  Copyright (C) 2012 Collabora Ltd. All rights reserved.
- *  Copyright (C) 2014, 2015 Igalia S.L. All rights reserved.
- *  Copyright (C) 2015 Metrological All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-
-#include "MediaPlayerPrivateGStreamerOwr.h"
-
-#if ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(GSTREAMER) && USE(OPENWEBRTC)
-
-#include "GStreamerUtilities.h"
-#include "MediaPlayer.h"
-#include "MediaStreamPrivate.h"
-#include "NotImplemented.h"
-#include "RealtimeMediaSourceOwr.h"
-#include "URL.h"
-#include <owr/owr.h>
-#include <owr/owr_gst_audio_renderer.h>
-#include <owr/owr_gst_video_renderer.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/text/CString.h>
-
-GST_DEBUG_CATEGORY(webkit_openwebrtc_debug);
-#define GST_CAT_DEFAULT webkit_openwebrtc_debug
-
-namespace WebCore {
-
-MediaPlayerPrivateGStreamerOwr::MediaPlayerPrivateGStreamerOwr(MediaPlayer* player)
-    : MediaPlayerPrivateGStreamerBase(player)
-{
-    initializeGStreamerAndGStreamerDebugging();
-}
-
-MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr()
-{
-    GST_TRACE("Destroying");
-
-    if (hasAudio())
-        m_audioTrack->removeObserver(*this);
-    if (hasVideo())
-        m_videoTrack->removeObserver(*this);
-
-    m_audioTrackMap.clear();
-    m_videoTrackMap.clear();
-
-    stop();
-}
-
-void MediaPlayerPrivateGStreamerOwr::play()
-{
-    GST_DEBUG("Play");
-
-    if (!m_streamPrivate || !m_streamPrivate->active()) {
-        m_readyState = MediaPlayer::HaveNothing;
-        loadingFailed(MediaPlayer::Empty);
-        return;
-    }
-
-    m_ended = false;
-    m_paused = false;
-
-    GST_DEBUG("Connecting to live stream, descriptor: %p", m_streamPrivate.get());
-
-    if (m_videoTrack)
-        maybeHandleChangeMutedState(*m_videoTrack.get());
-
-    if (m_audioTrack)
-        maybeHandleChangeMutedState(*m_audioTrack.get());
-}
-
-void MediaPlayerPrivateGStreamerOwr::pause()
-{
-    GST_DEBUG("Pause");
-    m_paused = true;
-    disableMediaTracks();
-}
-
-bool MediaPlayerPrivateGStreamerOwr::hasVideo() const
-{
-    return m_videoTrack;
-}
-
-bool MediaPlayerPrivateGStreamerOwr::hasAudio() const
-{
-    return m_audioTrack;
-}
-
-void MediaPlayerPrivateGStreamerOwr::setVolume(float volume)
-{
-    if (!m_audioTrack)
-        return;
-
-    auto& realTimeMediaSource = static_cast<RealtimeMediaSourceOwr&>(m_audioTrack->source());
-    auto mediaSource = OWR_MEDIA_SOURCE(realTimeMediaSource.mediaSource());
-
-    GST_DEBUG("Setting volume: %f", volume);
-    g_object_set(mediaSource, "volume", static_cast<gdouble>(volume), nullptr);
-}
-
-void MediaPlayerPrivateGStreamerOwr::setMuted(bool muted)
-{
-    if (!m_audioTrack)
-        return;
-
-    auto& realTimeMediaSource = static_cast<RealtimeMediaSourceOwr&>(m_audioTrack->source());
-    auto mediaSource = OWR_MEDIA_SOURCE(realTimeMediaSource.mediaSource());
-    if (!mediaSource)
-        return;
-
-    GST_DEBUG("Setting mute: %s", muted ? "on":"off");
-    g_object_set(mediaSource, "mute", muted, nullptr);
-}
-
-float MediaPlayerPrivateGStreamerOwr::currentTime() const
-{
-    gint64 position = GST_CLOCK_TIME_NONE;
-    GstQuery* query = gst_query_new_position(GST_FORMAT_TIME);
-
-    if (m_videoTrack && gst_element_query(m_videoSink.get(), query))
-        gst_query_parse_position(query, 0, &position);
-    else if (m_audioTrack && gst_element_query(m_audioSink.get(), query))
-        gst_query_parse_position(query, 0, &position);
-
-    float result = 0;
-    if (static_cast<GstClockTime>(position) != GST_CLOCK_TIME_NONE)
-        result = static_cast<double>(position) / GST_SECOND;
-
-    GST_LOG("Position %" GST_TIME_FORMAT, GST_TIME_ARGS(position));
-    gst_query_unref(query);
-
-    return result;
-}
-
-void MediaPlayerPrivateGStreamerOwr::load(const String &)
-{
-    // Properly fail so the global MediaPlayer tries to fallback to the next MediaPlayerPrivate.
-    m_networkState = MediaPlayer::FormatError;
-    m_player->networkStateChanged();
-}
-
-#if ENABLE(MEDIA_SOURCE)
-void MediaPlayerPrivateGStreamerOwr::load(const String&, MediaSourcePrivateClient*)
-{
-    // Properly fail so the global MediaPlayer tries to fallback to the next MediaPlayerPrivate.
-    m_networkState = MediaPlayer::FormatError;
-    m_player->networkStateChanged();
-}
-#endif
-
-void MediaPlayerPrivateGStreamerOwr::load(MediaStreamPrivate& streamPrivate)
-{
-    if (!initializeGStreamer())
-        return;
-
-    m_streamPrivate = &streamPrivate;
-    if (!m_streamPrivate->active()) {
-        loadingFailed(MediaPlayer::NetworkError);
-        return;
-    }
-
-    if (streamPrivate.hasVideo() && !m_videoSink)
-        createVideoSink();
-
-    if (streamPrivate.hasAudio() && !m_audioSink)
-        createGSTAudioSinkBin();
-
-    GST_DEBUG("Loading MediaStreamPrivate %p video: %s, audio: %s", &streamPrivate, streamPrivate.hasVideo() ? "yes":"no", streamPrivate.hasAudio() ? "yes":"no");
-
-    m_readyState = MediaPlayer::HaveNothing;
-    m_networkState = MediaPlayer::Loading;
-    m_player->networkStateChanged();
-    m_player->readyStateChanged();
-
-    for (auto track : m_streamPrivate->tracks()) {
-        if (!track->enabled()) {
-            GST_DEBUG("Track %s disabled", track->label().ascii().data());
-            continue;
-        }
-
-        GST_DEBUG("Processing track %s", track->label().ascii().data());
-
-        bool observeTrack = false;
-
-        // TODO: Support for multiple tracks of the same type.
-
-        switch (track->type()) {
-        case RealtimeMediaSource::Type::Audio:
-            if (!m_audioTrack) {
-                String preSelectedDevice = getenv("WEBKIT_AUDIO_DEVICE");
-                if (!preSelectedDevice || (preSelectedDevice == track->label())) {
-                    m_audioTrack = track;
-                    auto audioTrack = AudioTrackPrivateMediaStream::create(*m_audioTrack.get());
-                    m_player->addAudioTrack(*audioTrack);
-                    m_audioTrackMap.add(track->id(), audioTrack);
-                    observeTrack = true;
-                }
-            }
-            break;
-        case RealtimeMediaSource::Type::Video:
-            if (!m_videoTrack) {
-                String preSelectedDevice = getenv("WEBKIT_VIDEO_DEVICE");
-                if (!preSelectedDevice || (preSelectedDevice == track->label())) {
-                    m_videoTrack = track;
-                    auto videoTrack = VideoTrackPrivateMediaStream::create(*m_videoTrack.get());
-                    m_player->addVideoTrack(*videoTrack);
-                    videoTrack->setSelected(true);
-                    m_videoTrackMap.add(track->id(), videoTrack);
-                    observeTrack = true;
-                }
-            }
-            break;
-        case RealtimeMediaSource::Type::None:
-            GST_WARNING("Loading a track with None type");
-        }
-
-        if (observeTrack)
-            track->addObserver(*this);
-    }
-
-    m_readyState = MediaPlayer::HaveEnoughData;
-    m_player->readyStateChanged();
-}
-
-void MediaPlayerPrivateGStreamerOwr::loadingFailed(MediaPlayer::NetworkState error)
-{
-    if (m_networkState != error) {
-        GST_WARNING("Loading failed, error: %d", error);
-        m_networkState = error;
-        m_player->networkStateChanged();
-    }
-    if (m_readyState != MediaPlayer::HaveNothing) {
-        m_readyState = MediaPlayer::HaveNothing;
-        m_player->readyStateChanged();
-    }
-}
-
-bool MediaPlayerPrivateGStreamerOwr::didLoadingProgress() const
-{
-    // FIXME: Implement loading progress support.
-    return true;
-}
-
-void MediaPlayerPrivateGStreamerOwr::disableMediaTracks()
-{
-    if (m_audioTrack) {
-        GST_DEBUG("Stop: disconnecting audio");
-        g_object_set(m_audioRenderer.get(), "disabled", true, nullptr);
-        owr_media_renderer_set_source(OWR_MEDIA_RENDERER(m_audioRenderer.get()), nullptr);
-    }
-
-    if (m_videoTrack) {
-        GST_DEBUG("Stop: disconnecting video");
-        g_object_set(m_videoRenderer.get(), "disabled", true, nullptr);
-        owr_media_renderer_set_source(OWR_MEDIA_RENDERER(m_videoRenderer.get()), nullptr);
-    }
-}
-
-void MediaPlayerPrivateGStreamerOwr::stop()
-{
-    disableMediaTracks();
-    if (m_videoTrack) {
-        auto videoTrack = m_videoTrackMap.get(m_videoTrack->id());
-        if (videoTrack)
-            videoTrack->setSelected(false);
-    }
-}
-
-void MediaPlayerPrivateGStreamerOwr::registerMediaEngine(MediaEngineRegistrar registrar)
-{
-    if (initializeGStreamerAndGStreamerDebugging()) {
-        registrar([](MediaPlayer* player) {
-            return std::make_unique<MediaPlayerPrivateGStreamerOwr>(player);
-        }, getSupportedTypes, supportsType, nullptr, nullptr, nullptr, nullptr);
-    }
-}
-
-void MediaPlayerPrivateGStreamerOwr::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types)
-{
-    // Not supported in this media player.
-    static NeverDestroyed<HashSet<String, ASCIICaseInsensitiveHash>> cache;
-    types = cache;
-}
-
-MediaPlayer::SupportsType MediaPlayerPrivateGStreamerOwr::supportsType(const MediaEngineSupportParameters& parameters)
-{
-    if (parameters.isMediaStream)
-        return MediaPlayer::IsSupported;
-    return MediaPlayer::IsNotSupported;
-}
-
-bool MediaPlayerPrivateGStreamerOwr::initializeGStreamerAndGStreamerDebugging()
-{
-    if (!initializeGStreamer())
-        return false;
-
-    static std::once_flag debugRegisteredFlag;
-    std::call_once(debugRegisteredFlag, [] {
-        GST_DEBUG_CATEGORY_INIT(webkit_openwebrtc_debug, "webkitowrplayer", 0, "WebKit OpenWebRTC player");
-    });
-
-    return true;
-}
-
-void MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin()
-{
-    ASSERT(!m_audioSink);
-    GST_DEBUG("Creating audio sink");
-    // FIXME: volume/mute support: https://webkit.org/b/153828.
-
-    // Pre-roll an autoaudiosink so that the platform audio sink is created and
-    // can be retrieved from the autoaudiosink bin.
-    GRefPtr<GstElement> sink = gst_element_factory_make("autoaudiosink", nullptr);
-    GstChildProxy* childProxy = GST_CHILD_PROXY(sink.get());
-    gst_element_set_state(sink.get(), GST_STATE_READY);
-    GRefPtr<GstElement> platformSink = adoptGRef(GST_ELEMENT(gst_child_proxy_get_child_by_index(childProxy, 0)));
-    GstElementFactory* factory = gst_element_get_factory(platformSink.get());
-
-    // Dispose now un-needed autoaudiosink.
-    gst_element_set_state(sink.get(), GST_STATE_NULL);
-
-    // Create a fresh new audio sink compatible with the platform.
-    m_audioSink = gst_element_factory_create(factory, nullptr);
-    m_audioRenderer = adoptGRef(owr_gst_audio_renderer_new(m_audioSink.get()));
-}
-
-void MediaPlayerPrivateGStreamerOwr::trackEnded(MediaStreamTrackPrivate& track)
-{
-    GST_DEBUG("Track ended");
-
-    if (!m_streamPrivate || !m_streamPrivate->active()) {
-        stop();
-        return;
-    }
-
-    if (&track == m_audioTrack)
-        g_object_set(m_audioRenderer.get(), "disabled", true, nullptr);
-    else if (&track == m_videoTrack) {
-        g_object_set(m_videoRenderer.get(), "disabled", true, nullptr);
-        auto& realTimeMediaSource = static_cast<RealtimeMediaSourceOwr&>(m_videoTrack->source());
-        realTimeMediaSource.setWidth(0);
-        realTimeMediaSource.setHeight(0);
-        auto videoTrack = m_videoTrackMap.get(m_videoTrack->id());
-        if (videoTrack)
-            videoTrack->setSelected(false);
-    }
-
-    gboolean audioDisabled;
-    gboolean videoDisabled;
-    g_object_get(m_audioRenderer.get(), "disabled", &audioDisabled, nullptr);
-    g_object_get(m_videoRenderer.get(), "disabled", &videoDisabled, nullptr);
-    if (audioDisabled && videoDisabled) {
-        m_ended = true;
-        m_player->timeChanged();
-    }
-}
-
-void MediaPlayerPrivateGStreamerOwr::trackMutedChanged(MediaStreamTrackPrivate& track)
-{
-    GST_DEBUG("Track muted state changed");
-
-    maybeHandleChangeMutedState(track);
-}
-
-void MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState(MediaStreamTrackPrivate& track)
-{
-    auto& realTimeMediaSource = static_cast<RealtimeMediaSourceOwr&>(track.source());
-    auto mediaSource = OWR_MEDIA_SOURCE(realTimeMediaSource.mediaSource());
-
-    GST_DEBUG("%s track now %s", track.type() == RealtimeMediaSource::Type::Audio ? "audio":"video", realTimeMediaSource.muted() ? "muted":"un-muted");
-    switch (track.type()) {
-    case RealtimeMediaSource::Type::Audio:
-        if (!realTimeMediaSource.muted()) {
-            g_object_set(m_audioRenderer.get(), "disabled", false, nullptr);
-            owr_media_renderer_set_source(OWR_MEDIA_RENDERER(m_audioRenderer.get()), mediaSource);
-        } else {
-            g_object_set(m_audioRenderer.get(), "disabled", true, nullptr);
-            owr_media_renderer_set_source(OWR_MEDIA_RENDERER(m_audioRenderer.get()), nullptr);
-        }
-        if (mediaSource)
-            g_object_set(mediaSource, "mute", !track.enabled(), nullptr);
-        break;
-    case RealtimeMediaSource::Type::Video:
-        if (!realTimeMediaSource.muted()) {
-            g_object_set(m_videoRenderer.get(), "disabled", false, nullptr);
-            owr_media_renderer_set_source(OWR_MEDIA_RENDERER(m_videoRenderer.get()), mediaSource);
-        } else {
-            g_object_set(m_videoRenderer.get(), "disabled", true, nullptr);
-            owr_media_renderer_set_source(OWR_MEDIA_RENDERER(m_videoRenderer.get()), nullptr);
-        }
-        break;
-    case RealtimeMediaSource::Type::None:
-        GST_WARNING("Trying to change mute state of a track with None type");
-    }
-}
-
-void MediaPlayerPrivateGStreamerOwr::trackSettingsChanged(MediaStreamTrackPrivate&)
-{
-    GST_DEBUG("Track settings changed");
-}
-
-void MediaPlayerPrivateGStreamerOwr::trackEnabledChanged(MediaStreamTrackPrivate& track)
-{
-    GST_DEBUG("%s track now %s", track.type() == RealtimeMediaSource::Type::Audio ? "audio":"video", track.enabled() ? "enabled":"disabled");
-
-    switch (track.type()) {
-    case RealtimeMediaSource::Type::Audio:
-        g_object_set(m_audioRenderer.get(), "disabled", !track.enabled(), nullptr);
-        break;
-    case RealtimeMediaSource::Type::Video:
-        g_object_set(m_videoRenderer.get(), "disabled", !track.enabled(), nullptr);
-        break;
-    case RealtimeMediaSource::Type::None:
-        GST_WARNING("Trying to change enabled state of a track with None type");
-    }
-}
-
-GstElement* MediaPlayerPrivateGStreamerOwr::createVideoSink()
-{
-    GstElement* sink;
-#if USE(GSTREAMER_GL)
-    // No need to create glupload and glcolorconvert here because they are
-    // already created by the video renderer.
-    // FIXME: This should probably return a RefPtr. See https://bugs.webkit.org/show_bug.cgi?id=164709.
-    sink = MediaPlayerPrivateGStreamerBase::createGLAppSink();
-    m_videoSink = sink;
-#else
-    if (m_streamPrivate->getVideoRenderer()) {
-        m_videoRenderer = m_streamPrivate->getVideoRenderer();
-        m_videoSink = m_streamPrivate->getVideoSinkElement();
-        g_signal_connect_swapped(m_videoSink.get(), "repaint-requested", G_CALLBACK(MediaPlayerPrivateGStreamerBase::repaintCallback), this);
-        g_object_get(m_videoRenderer.get(), "sink", &sink, nullptr);
-    } else {
-        GstElement* gldownload = gst_element_factory_make("gldownload", nullptr);
-        GstElement* videoconvert = gst_element_factory_make("videoconvert", nullptr);
-        GstElement* webkitSink = MediaPlayerPrivateGStreamerBase::createVideoSink();
-        sink = gst_bin_new(nullptr);
-        gst_bin_add_many(GST_BIN(sink), gldownload, videoconvert, webkitSink, nullptr);
-        gst_element_link_many(gldownload, videoconvert, webkitSink, nullptr);
-        GRefPtr<GstPad> pad = adoptGRef(gst_element_get_static_pad(gldownload, "sink"));
-        gst_element_add_pad(sink, gst_ghost_pad_new("sink", pad.get()));
-    }
-#endif
-    if (!m_videoRenderer) {
-        m_videoRenderer = adoptGRef(owr_gst_video_renderer_new(sink));
-#if USE(GSTREAMER_GL)
-        owr_video_renderer_set_request_context_callback(OWR_VIDEO_RENDERER(m_videoRenderer.get()), (OwrVideoRendererRequestContextCallback) MediaPlayerPrivateGStreamerBase::requestGLContext, this, nullptr);
-#endif
-        m_streamPrivate->setVideoRenderer(m_videoRenderer.get(), videoSink());
-    }
-    return sink;
-}
-
-void MediaPlayerPrivateGStreamerOwr::setSize(const IntSize& size)
-{
-    if (size == m_size)
-        return;
-
-    MediaPlayerPrivateGStreamerBase::setSize(size);
-    if (m_videoRenderer)
-        g_object_set(m_videoRenderer.get(), "width", size.width(), "height", size.height(), nullptr);
-
-    if (!m_videoTrack)
-        return;
-
-    auto& realTimeMediaSource = static_cast<RealtimeMediaSourceOwr&>(m_videoTrack->source());
-    realTimeMediaSource.setWidth(size.width());
-    realTimeMediaSource.setHeight(size.height());
-}
-
-FloatSize MediaPlayerPrivateGStreamerOwr::naturalSize() const
-{
-    auto size = MediaPlayerPrivateGStreamerBase::naturalSize();
-
-    // In case we are not playing the video we return the size we set to the media source.
-    if (m_videoTrack && size.isZero()) {
-        auto& realTimeMediaSource = static_cast<RealtimeMediaSourceOwr&>(m_videoTrack->source());
-        return realTimeMediaSource.size();
-    }
-
-    return size;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(GSTREAMER) && USE(OPENWEBRTC)
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h
deleted file mode 100644 (file)
index 334630e..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *  Copyright (C) 2015 Igalia S.L. All rights reserved.
- *  Copyright (C) 2015 Metrological. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef MediaPlayerPrivateGStreamerOwr_h
-#define MediaPlayerPrivateGStreamerOwr_h
-
-#if ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(GSTREAMER) && USE(OPENWEBRTC)
-
-#include "AudioTrackPrivateMediaStream.h"
-#include "MediaPlayerPrivateGStreamerBase.h"
-#include "MediaStreamTrackPrivate.h"
-#include "VideoTrackPrivateMediaStream.h"
-
-typedef struct _OwrGstVideoRenderer OwrGstVideoRenderer;
-typedef struct _OwrGstAudioRenderer OwrGstAudioRenderer;
-
-namespace WebCore {
-
-class MediaStreamPrivate;
-class RealtimeMediaSourceOwr;
-
-class MediaPlayerPrivateGStreamerOwr : public MediaPlayerPrivateGStreamerBase, private MediaStreamTrackPrivate::Observer {
-public:
-    explicit MediaPlayerPrivateGStreamerOwr(MediaPlayer*);
-    ~MediaPlayerPrivateGStreamerOwr();
-
-    static void registerMediaEngine(MediaEngineRegistrar);
-
-    void setSize(const IntSize&) final;
-
-    FloatSize naturalSize() const final;
-
-private:
-    GstElement* createVideoSink() final;
-    GstElement* audioSink() const final { return m_audioSink.get(); }
-    bool isLiveStream() const final { return true; }
-
-    String engineDescription() const final { return "OpenWebRTC"; }
-
-    void load(const String&) final;
-#if ENABLE(MEDIA_SOURCE)
-    void load(const String&, MediaSourcePrivateClient*) final;
-#endif
-    void load(MediaStreamPrivate&) final;
-    void cancelLoad() final { }
-
-    void prepareToPlay() final { }
-    void play() final;
-    void pause() final;
-
-    bool hasVideo() const final;
-    bool hasAudio() const final;
-
-    float duration() const final { return 0; }
-
-    float currentTime() const final;
-    void seek(float) final { }
-    bool seeking() const final { return false; }
-
-    void setRate(float) final { }
-    void setPreservesPitch(bool) final { }
-    bool paused() const final { return m_paused; }
-
-    void setVolume(float) final;
-    void setMuted(bool) final;
-
-    bool hasClosedCaptions() const final { return false; }
-    void setClosedCaptionsVisible(bool) final { };
-
-    float maxTimeSeekable() const final { return 0; }
-    std::unique_ptr<PlatformTimeRanges> buffered() const final { return std::make_unique<PlatformTimeRanges>(); }
-    bool didLoadingProgress() const final;
-
-    unsigned long long totalBytes() const final { return 0; }
-
-    bool canLoadPoster() const final { return false; }
-    void setPoster(const String&) final { }
-    bool ended() const final { return m_ended; }
-
-    // MediaStreamTrackPrivate::Observer implementation.
-    void trackEnded(MediaStreamTrackPrivate&) final;
-    void trackMutedChanged(MediaStreamTrackPrivate&) final;
-    void trackSettingsChanged(MediaStreamTrackPrivate&) final;
-    void trackEnabledChanged(MediaStreamTrackPrivate&) final;
-
-    static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>&);
-    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
-    static bool initializeGStreamerAndGStreamerDebugging();
-    void createGSTAudioSinkBin();
-    void loadingFailed(MediaPlayer::NetworkState error);
-    void stop();
-    void maybeHandleChangeMutedState(MediaStreamTrackPrivate&);
-    void disableMediaTracks();
-
-    bool m_paused { true };
-    bool m_ended { false };
-    RefPtr<MediaStreamTrackPrivate> m_videoTrack;
-    RefPtr<MediaStreamTrackPrivate> m_audioTrack;
-    GRefPtr<GstElement> m_audioSink;
-    RefPtr<MediaStreamPrivate> m_streamPrivate;
-    GRefPtr<OwrGstVideoRenderer> m_videoRenderer;
-    GRefPtr<OwrGstAudioRenderer> m_audioRenderer;
-
-    HashMap<String, RefPtr<AudioTrackPrivateMediaStream>> m_audioTrackMap;
-    HashMap<String, RefPtr<VideoTrackPrivateMediaStream>> m_videoTrackMap;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(GSTREAMER) && USE(OPENWEBRTC)
-
-#endif // MediaPlayerPrivateGStreamerOwr_h
diff --git a/Source/WebCore/platform/mediastream/MediaEndpoint.cpp b/Source/WebCore/platform/mediastream/MediaEndpoint.cpp
deleted file mode 100644 (file)
index d1375fd..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2015 Ericsson AB. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_RTC)
-#include "MediaEndpoint.h"
-
-#include "MediaPayload.h"
-#include "RTCDataChannelHandler.h"
-#include "RealtimeMediaSource.h"
-
-namespace WebCore {
-
-class EmptyRealtimeMediaSource final : public RealtimeMediaSource {
-public:
-    static Ref<EmptyRealtimeMediaSource> create() { return adoptRef(*new EmptyRealtimeMediaSource()); }
-
-private:
-    EmptyRealtimeMediaSource() : RealtimeMediaSource(emptyString(), Type::None, emptyString()) { }
-
-    const RealtimeMediaSourceCapabilities& capabilities() const final { return RealtimeMediaSourceCapabilities::emptyCapabilities(); }
-    const RealtimeMediaSourceSettings& settings() const final { return m_sourceSettings; }
-
-    RealtimeMediaSourceSettings m_sourceSettings;
-};
-
-class EmptyMediaEndpoint final : public MediaEndpoint {
-private:
-    void setConfiguration(MediaEndpointConfiguration&&) final { }
-
-    void generateDtlsInfo() final { }
-    MediaPayloadVector getDefaultAudioPayloads() final { return MediaPayloadVector(); }
-    MediaPayloadVector getDefaultVideoPayloads() final { return MediaPayloadVector(); }
-    MediaPayloadVector filterPayloads(const MediaPayloadVector&, const MediaPayloadVector&) final { return MediaPayloadVector(); }
-
-    UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool) final { return UpdateResult::Failed; }
-    UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, const RealtimeMediaSourceMap&, bool) final { return UpdateResult::Failed; }
-
-    void addRemoteCandidate(const IceCandidate&, const String&, const String&, const String&) final { }
-
-    Ref<RealtimeMediaSource> createMutedRemoteSource(const String&, RealtimeMediaSource::Type) final { return EmptyRealtimeMediaSource::create(); }
-    void replaceSendSource(RealtimeMediaSource&, const String&) final { }
-    void replaceMutedRemoteSourceMid(const String&, const String&) final { };
-
-    std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) final { return nullptr; }
-    void stop() final { }
-};
-
-static std::unique_ptr<MediaEndpoint> createMediaEndpoint(MediaEndpointClient&)
-{
-    return std::make_unique<EmptyMediaEndpoint>();
-}
-
-CreateMediaEndpoint MediaEndpoint::create = createMediaEndpoint;
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/platform/mediastream/MediaEndpoint.h b/Source/WebCore/platform/mediastream/MediaEndpoint.h
deleted file mode 100644 (file)
index 51b51d4..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2015 Ericsson AB. All rights reserved.
- * 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 "MediaEndpointConfiguration.h"
-#include "PeerConnectionBackend.h"
-#include "RTCIceTransportState.h"
-#include "RealtimeMediaSource.h"
-#include <wtf/HashMap.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class MediaEndpoint;
-class MediaEndpointClient;
-class MediaEndpointSessionConfiguration;
-class MediaStreamTrack;
-class RTCDataChannelHandler;
-class RealtimeMediaSource;
-
-struct IceCandidate;
-struct MediaPayload;
-struct RTCDataChannelInit;
-
-typedef std::unique_ptr<MediaEndpoint> (*CreateMediaEndpoint)(MediaEndpointClient&);
-typedef Vector<MediaPayload> MediaPayloadVector;
-typedef HashMap<String, RealtimeMediaSource*> RealtimeMediaSourceMap;
-
-class MediaEndpoint {
-public:
-    WEBCORE_EXPORT static CreateMediaEndpoint create;
-    virtual ~MediaEndpoint() { }
-
-    enum class UpdateResult {
-        Success,
-        SuccessWithIceRestart,
-        Failed
-    };
-
-    virtual void setConfiguration(MediaEndpointConfiguration&&) = 0;
-
-    virtual void generateDtlsInfo() = 0;
-    virtual MediaPayloadVector getDefaultAudioPayloads() = 0;
-    virtual MediaPayloadVector getDefaultVideoPayloads() = 0;
-    virtual MediaPayloadVector filterPayloads(const MediaPayloadVector& remotePayloads, const MediaPayloadVector& defaultPayloads) = 0;
-
-    virtual UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) = 0;
-    virtual UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, const RealtimeMediaSourceMap&, bool isInitiator) = 0;
-
-    virtual void addRemoteCandidate(const IceCandidate&, const String& mid, const String& ufrag, const String& password) = 0;
-
-    virtual Ref<RealtimeMediaSource> createMutedRemoteSource(const String& mid, RealtimeMediaSource::Type) = 0;
-    virtual void replaceSendSource(RealtimeMediaSource&, const String& mid) = 0;
-    virtual void replaceMutedRemoteSourceMid(const String& oldMid, const String& newMid) = 0;
-
-    virtual std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) = 0;
-
-    virtual void stop() = 0;
-
-    virtual void emulatePlatformEvent(const String&) { };
-
-    virtual void getStats(MediaStreamTrack*, PeerConnection::StatsPromise&& promise) { promise.reject(NotSupportedError); }
-};
-
-class MediaEndpointClient {
-public:
-    virtual void gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction) = 0;
-    virtual void gotIceCandidate(const String& mid, IceCandidate&&) = 0;
-    virtual void doneGatheringCandidates(const String& mid) = 0;
-    virtual void iceTransportStateChanged(const String& mid, RTCIceTransportState) = 0;
-
-    virtual ~MediaEndpointClient() { }
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/platform/mediastream/MediaEndpointSessionConfiguration.h b/Source/WebCore/platform/mediastream/MediaEndpointSessionConfiguration.h
deleted file mode 100644 (file)
index bf2bd1e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2015 Ericsson AB. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#ifndef MediaEndpointSessionConfiguration_h
-#define MediaEndpointSessionConfiguration_h
-
-#if ENABLE(WEB_RTC)
-
-#include "PeerConnectionStates.h"
-#include "PeerMediaDescription.h"
-#include <wtf/CryptographicallyRandomNumber.h>
-
-namespace WebCore {
-
-class MediaEndpointSessionConfiguration : public RefCounted<MediaEndpointSessionConfiguration> {
-public:
-    static RefPtr<MediaEndpointSessionConfiguration> create()
-    {
-        return adoptRef(new MediaEndpointSessionConfiguration());
-    }
-    virtual ~MediaEndpointSessionConfiguration() { }
-
-    int64_t sessionId() const { return m_sessionId; }
-    void setSessionId(int64_t sessionId) { m_sessionId = sessionId; }
-
-    unsigned sessionVersion() const { return m_sessionVersion; }
-    void setSessionVersion(unsigned sessionVersion) { m_sessionVersion = sessionVersion; }
-
-    Vector<PeerMediaDescription>& mediaDescriptions() { return m_mediaDescriptions; }
-    const Vector<PeerMediaDescription>& mediaDescriptions() const { return m_mediaDescriptions; }
-    void addMediaDescription(PeerMediaDescription&& description) { m_mediaDescriptions.append(WTFMove(description)); }
-
-    PeerConnectionStates::BundlePolicy bundlePolicy() const { return m_bundlePolicy; }
-    void setBundlePolicy(PeerConnectionStates::BundlePolicy bundlePolicy) { m_bundlePolicy = bundlePolicy; }
-
-    RefPtr<MediaEndpointSessionConfiguration> clone() const
-    {
-        RefPtr<MediaEndpointSessionConfiguration> copy = create();
-        copy->m_sessionId = m_sessionId;
-        copy->m_sessionVersion = m_sessionVersion;
-        copy->m_mediaDescriptions = m_mediaDescriptions;
-        copy->m_bundlePolicy = m_bundlePolicy;
-
-        return copy;
-    }
-
-private:
-    MediaEndpointSessionConfiguration()
-    {
-        m_sessionId = cryptographicallyRandomNumber();
-        m_sessionId = m_sessionId << 31 | cryptographicallyRandomNumber();
-    }
-
-    int64_t m_sessionId;
-    unsigned m_sessionVersion { 0 };
-
-    Vector<PeerMediaDescription> m_mediaDescriptions;
-
-    PeerConnectionStates::BundlePolicy m_bundlePolicy { PeerConnectionStates::BundlePolicy::Balanced };
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
-
-#endif // MediaEndpointSessionConfiguration_h
index 9f1ab52..3318aab 100644 (file)
 #include <wtf/Vector.h>
 #include <wtf/WeakPtr.h>
 
-#if USE(GSTREAMER)
-#include "GRefPtrGStreamer.h"
-#include <owr/owr_gst_video_renderer.h>
-#endif
-
 namespace WebCore {
 
 class MediaStream;
@@ -111,16 +106,6 @@ public:
 
     void monitorOrientation(OrientationNotifier&);
 
-#if USE(GSTREAMER)
-    void setVideoRenderer(OwrGstVideoRenderer* renderer, GstElement* sink) { m_gstVideoRenderer = renderer; m_gstVideoSinkElement = sink; }
-    GRefPtr<GstElement> getVideoSinkElement() const { return m_gstVideoSinkElement; }
-    GRefPtr<OwrGstVideoRenderer> getVideoRenderer() const { return m_gstVideoRenderer; }
-
-private:
-    GRefPtr<GstElement> m_gstVideoSinkElement;
-    GRefPtr<OwrGstVideoRenderer> m_gstVideoRenderer;
-#endif
-
 private:
     MediaStreamPrivate(const MediaStreamTrackPrivateVector&, String&&);
 
index 763fb2e..6ad9afd 100644 (file)
 
 #if ENABLE(MEDIA_STREAM)
 
+// FIXME: GTK to implement its own RealtimeMediaSourceCenter.
+#if PLATFORM(GTK)
+#include "MockRealtimeMediaSourceCenter.h"
+#endif
+
 #include "CaptureDeviceManager.h"
 #include "Logging.h"
 #include "MediaStreamPrivate.h"
@@ -59,8 +64,14 @@ RealtimeMediaSourceCenter& RealtimeMediaSourceCenter::singleton()
     RealtimeMediaSourceCenter* override = mediaStreamCenterOverride();
     if (override)
         return *override;
-    
+#if PLATFORM(GTK)
+    WTFLogAlways("WebKitGTK LIBWEBRTC RealtimeMediaSourceCenter NOT IMPLEMENTED. Returning MockRealtimeMediaSourceCenter instead to avoid crash!\n");
+    ASSERT(isMainThread());
+    static NeverDestroyed<MockRealtimeMediaSourceCenter> center;
+    return center;
+#else
     return RealtimeMediaSourceCenter::platformCenter();
+#endif
 }
 
 void RealtimeMediaSourceCenter::setSharedStreamCenterOverride(RealtimeMediaSourceCenter* center)
diff --git a/Source/WebCore/platform/mediastream/SDPProcessorScriptResource.cpp b/Source/WebCore/platform/mediastream/SDPProcessorScriptResource.cpp
deleted file mode 100644 (file)
index 669ed2a..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2015 Ericsson AB. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_RTC)
-#include "SDPProcessorScriptResource.h"
-
-#include "SDPProcessorScriptsData.h"
-#include <wtf/NeverDestroyed.h>
-
-namespace WebCore {
-
-namespace SDPProcessorScriptResource {
-
-const String& scriptString()
-{
-    static NeverDestroyed<const String> script(sdpJavaScript, sizeof(sdpJavaScript));
-    return script;
-}
-
-} // namespace SDPProcessorScriptResource
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/platform/mediastream/SDPProcessorScriptResource.h b/Source/WebCore/platform/mediastream/SDPProcessorScriptResource.h
deleted file mode 100644 (file)
index cb5443b..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2015 Ericsson AB. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#ifndef SDPProcessorScriptResource_h
-#define SDPProcessorScriptResource_h
-
-#if ENABLE(WEB_RTC)
-
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-namespace SDPProcessorScriptResource {
-
-const String& scriptString();
-
-} // namespace SDPProcessorScriptResource
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
-
-#endif // SDPProcessorScriptResource_h
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp b/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp
deleted file mode 100644 (file)
index 8a58486..0000000
+++ /dev/null
@@ -1,750 +0,0 @@
-/*
- * Copyright (C) 2015, 2016 Ericsson AB. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_RTC)
-#include "MediaEndpointOwr.h"
-
-#include "MediaEndpointSessionConfiguration.h"
-#include "MediaPayload.h"
-#include "NotImplemented.h"
-#include "OpenWebRTCUtilities.h"
-#include "PeerConnectionStates.h"
-#include "RTCDataChannelHandler.h"
-#include "RealtimeAudioSourceOwr.h"
-#include "RealtimeVideoSourceOwr.h"
-#include <owr/owr.h>
-#include <owr/owr_audio_payload.h>
-#include <owr/owr_crypto_utils.h>
-#include <owr/owr_media_session.h>
-#include <owr/owr_transport_agent.h>
-#include <owr/owr_video_payload.h>
-#include <wtf/text/CString.h>
-
-namespace WebCore {
-
-static void gotCandidate(OwrSession*, OwrCandidate*, MediaEndpointOwr*);
-static void candidateGatheringDone(OwrSession*, MediaEndpointOwr*);
-static void iceConnectionStateChange(OwrSession*, GParamSpec*, MediaEndpointOwr*);
-static void gotIncomingSource(OwrMediaSession*, OwrMediaSource*, MediaEndpointOwr*);
-
-static const Vector<String> candidateTypes = { "host", "srflx", "prflx", "relay" };
-static const Vector<String> candidateTcpTypes = { "", "active", "passive", "so" };
-static const Vector<String> codecTypes = { "NONE", "PCMU", "PCMA", "OPUS", "H264", "VP8" };
-
-static const char* helperServerRegEx = "(turns|turn|stun):([\\w\\.\\-]+|\\[[\\w\\:]+\\])(:\\d+)?(\\?.+)?";
-
-static const unsigned short helperServerDefaultPort = 3478;
-static const unsigned short candidateDefaultPort = 9;
-
-static std::unique_ptr<MediaEndpoint> createMediaEndpointOwr(MediaEndpointClient& client)
-{
-    return std::unique_ptr<MediaEndpoint>(new MediaEndpointOwr(client));
-}
-
-CreateMediaEndpoint MediaEndpoint::create = createMediaEndpointOwr;
-
-MediaEndpointOwr::MediaEndpointOwr(MediaEndpointClient& client)
-    : m_transportAgent(nullptr)
-    , m_client(client)
-    , m_numberOfReceivePreparedSessions(0)
-    , m_numberOfSendPreparedSessions(0)
-{
-    initializeOpenWebRTC();
-
-    GRegexCompileFlags compileFlags = G_REGEX_JAVASCRIPT_COMPAT;
-    GRegexMatchFlags matchFlags = static_cast<GRegexMatchFlags>(0);
-    m_helperServerRegEx = g_regex_new(helperServerRegEx, compileFlags, matchFlags, nullptr);
-}
-
-MediaEndpointOwr::~MediaEndpointOwr()
-{
-    stop();
-
-    g_regex_unref(m_helperServerRegEx);
-}
-
-void MediaEndpointOwr::setConfiguration(MediaEndpointConfiguration&& configuration)
-{
-    m_configuration = WTFMove(configuration);
-}
-
-std::unique_ptr<RTCDataChannelHandler> MediaEndpointOwr::createDataChannelHandler(const String&, const RTCDataChannelInit&)
-{
-    // FIXME: Implement data channel.
-    ASSERT_NOT_REACHED();
-    return nullptr;
-}
-
-static void cryptoDataCallback(gchar* privateKey, gchar* certificate, gchar* fingerprint, gchar* fingerprintFunction, gpointer data)
-{
-    MediaEndpointOwr* mediaEndpoint = (MediaEndpointOwr*) data;
-    mediaEndpoint->dispatchDtlsFingerprint(g_strdup(privateKey), g_strdup(certificate), String(fingerprint), String(fingerprintFunction));
-}
-
-void MediaEndpointOwr::generateDtlsInfo()
-{
-    owr_crypto_create_crypto_data(cryptoDataCallback, this);
-}
-
-MediaPayloadVector MediaEndpointOwr::getDefaultAudioPayloads()
-{
-    MediaPayloadVector payloads;
-
-    // FIXME: This list should be based on what is available in the platform (bug: http://webkit.org/b/163723)
-    MediaPayload payload1;
-    payload1.type = 111;
-    payload1.encodingName = "OPUS";
-    payload1.clockRate = 48000;
-    payload1.channels = 2;
-    payloads.append(WTFMove(payload1));
-
-    MediaPayload payload2;
-    payload2.type = 8;
-    payload2.encodingName = "PCMA";
-    payload2.clockRate = 8000;
-    payload2.channels = 1;
-    payloads.append(WTFMove(payload2));
-
-    MediaPayload payload3;
-    payload3.type = 0;
-    payload3.encodingName = "PCMU";
-    payload3.clockRate = 8000;
-    payload3.channels = 1;
-    payloads.append(WTFMove(payload3));
-
-    return payloads;
-}
-
-MediaPayloadVector MediaEndpointOwr::getDefaultVideoPayloads()
-{
-    MediaPayloadVector payloads;
-
-    // FIXME: This list should be based on what is available in the platform (bug: http://webkit.org/b/163723)
-    MediaPayload payload1;
-    payload1.type = 103;
-    payload1.encodingName = "H264";
-    payload1.clockRate = 90000;
-    payload1.ccmfir = true;
-    payload1.nackpli = true;
-    payload1.addParameter("packetizationMode", 1);
-    payloads.append(WTFMove(payload1));
-
-    MediaPayload payload2;
-    payload2.type = 100;
-    payload2.encodingName = "VP8";
-    payload2.clockRate = 90000;
-    payload2.ccmfir = true;
-    payload2.nackpli = true;
-    payload2.nack = true;
-    payloads.append(WTFMove(payload2));
-
-    MediaPayload payload3;
-    payload3.type = 120;
-    payload3.encodingName = "RTX";
-    payload3.clockRate = 90000;
-    payload3.addParameter("apt", 100);
-    payload3.addParameter("rtxTime", 200);
-    payloads.append(WTFMove(payload3));
-
-    return payloads;
-}
-
-static bool payloadsContainType(const Vector<const MediaPayload*>& payloads, unsigned payloadType)
-{
-    for (auto payload : payloads) {
-        ASSERT(payload);
-        if (payload->type == payloadType)
-            return true;
-    }
-    return false;
-}
-
-MediaPayloadVector MediaEndpointOwr::filterPayloads(const MediaPayloadVector& remotePayloads, const MediaPayloadVector& defaultPayloads)
-{
-    Vector<const MediaPayload*> filteredPayloads;
-
-    for (auto& remotePayload : remotePayloads) {
-        const MediaPayload* defaultPayload = nullptr;
-        for (auto& p : defaultPayloads) {
-            if (p.encodingName == remotePayload.encodingName.convertToASCIIUppercase()) {
-                defaultPayload = &p;
-                break;
-            }
-        }
-        if (!defaultPayload)
-            continue;
-
-        if (defaultPayload->parameters.contains("packetizationMode") && remotePayload.parameters.contains("packetizationMode")
-            && (defaultPayload->parameters.get("packetizationMode") != defaultPayload->parameters.get("packetizationMode")))
-            continue;
-
-        filteredPayloads.append(&remotePayload);
-    }
-
-    MediaPayloadVector filteredAptPayloads;
-
-    for (auto filteredPayload : filteredPayloads) {
-        if (filteredPayload->parameters.contains("apt") && (!payloadsContainType(filteredPayloads, filteredPayload->parameters.get("apt"))))
-            continue;
-        filteredAptPayloads.append(*filteredPayload);
-    }
-
-    return filteredAptPayloads;
-}
-
-MediaEndpoint::UpdateResult MediaEndpointOwr::updateReceiveConfiguration(MediaEndpointSessionConfiguration* configuration, bool isInitiator)
-{
-    Vector<TransceiverConfig> transceiverConfigs;
-    for (unsigned i = m_transceivers.size(); i < configuration->mediaDescriptions().size(); ++i) {
-        TransceiverConfig config;
-        config.type = SessionTypeMedia;
-        config.isDtlsClient = configuration->mediaDescriptions()[i].dtlsSetup == "active";
-        config.mid = configuration->mediaDescriptions()[i].mid;
-        transceiverConfigs.append(WTFMove(config));
-    }
-
-    ensureTransportAgentAndTransceivers(isInitiator, transceiverConfigs);
-
-    // Prepare the new sessions.
-    for (unsigned i = m_numberOfReceivePreparedSessions; i < m_transceivers.size(); ++i) {
-        OwrSession* session = m_transceivers[i]->session();
-        prepareMediaSession(OWR_MEDIA_SESSION(session), &configuration->mediaDescriptions()[i], isInitiator);
-        owr_transport_agent_add_session(m_transportAgent, session);
-    }
-
-    owr_transport_agent_start(m_transportAgent);
-    m_numberOfReceivePreparedSessions = m_transceivers.size();
-
-    return UpdateResult::Success;
-}
-
-static const MediaPayload* findRtxPayload(const MediaPayloadVector& payloads, unsigned apt)
-{
-    for (auto& payload : payloads) {
-        if (payload.encodingName.convertToASCIIUppercase() == "RTX" && payload.parameters.contains("apt")
-            && (payload.parameters.get("apt") == apt))
-            return &payload;
-    }
-    return nullptr;
-}
-
-MediaEndpoint::UpdateResult MediaEndpointOwr::updateSendConfiguration(MediaEndpointSessionConfiguration* configuration, const RealtimeMediaSourceMap& sendSourceMap, bool isInitiator)
-{
-    Vector<TransceiverConfig> transceiverConfigs;
-    for (unsigned i = m_transceivers.size(); i < configuration->mediaDescriptions().size(); ++i) {
-        TransceiverConfig config;
-        config.type = SessionTypeMedia;
-        config.isDtlsClient = configuration->mediaDescriptions()[i].dtlsSetup != "active";
-        config.mid = configuration->mediaDescriptions()[i].mid;
-        transceiverConfigs.append(WTFMove(config));
-    }
-
-    ensureTransportAgentAndTransceivers(isInitiator, transceiverConfigs);
-
-    for (unsigned i = 0; i < m_transceivers.size(); ++i) {
-        auto* session = m_transceivers[i]->session();
-        auto& mdesc = configuration->mediaDescriptions()[i];
-
-        if (mdesc.type == "audio" || mdesc.type == "video")
-            g_object_set(session, "rtcp-mux", mdesc.rtcpMux, nullptr);
-
-        if (mdesc.iceCandidates.size()) {
-            for (auto& candidate : mdesc.iceCandidates)
-                internalAddRemoteCandidate(session, candidate, mdesc.iceUfrag, mdesc.icePassword);
-        }
-
-        if (i < m_numberOfSendPreparedSessions)
-            continue;
-
-        if (!sendSourceMap.contains(mdesc.mid))
-            continue;
-
-        const MediaPayload* payload = nullptr;
-        for (auto& p : mdesc.payloads) {
-            if (p.encodingName.convertToASCIIUppercase() != "RTX") {
-                payload = &p;
-                break;
-            }
-        }
-
-        if (!payload)
-            return UpdateResult::Failed;
-
-        auto* rtxPayload = findRtxPayload(mdesc.payloads, payload->type);
-        auto* source = static_cast<RealtimeMediaSourceOwr*>(sendSourceMap.get(mdesc.mid));
-
-        ASSERT(codecTypes.find(payload->encodingName.convertToASCIIUppercase()) != notFound);
-        auto codecType = static_cast<OwrCodecType>(codecTypes.find(payload->encodingName.convertToASCIIUppercase()));
-
-        OwrPayload* sendPayload;
-        if (mdesc.type == "audio")
-            sendPayload = owr_audio_payload_new(codecType, payload->type, payload->clockRate, payload->channels);
-        else {
-            sendPayload = owr_video_payload_new(codecType, payload->type, payload->clockRate, payload->ccmfir, payload->nackpli);
-            g_object_set(sendPayload, "rtx-payload-type", rtxPayload ? rtxPayload->type : -1,
-                "rtx-time", rtxPayload && rtxPayload->parameters.contains("rtxTime") ? rtxPayload->parameters.get("rtxTime") : 0, nullptr);
-        }
-
-        owr_media_session_set_send_payload(OWR_MEDIA_SESSION(session), sendPayload);
-        owr_media_session_set_send_source(OWR_MEDIA_SESSION(session), source->mediaSource());
-
-        // FIXME: Support for group-ssrc SDP line is missing.
-        const Vector<unsigned> receiveSsrcs = mdesc.ssrcs;
-        if (receiveSsrcs.size()) {
-            g_object_set(session, "receive-ssrc", receiveSsrcs[0], nullptr);
-            if (receiveSsrcs.size() == 2)
-                g_object_set(session, "receive-rtx-ssrc", receiveSsrcs[1], nullptr);
-        }
-
-        m_numberOfSendPreparedSessions = i + 1;
-    }
-
-    return UpdateResult::Success;
-}
-
-void MediaEndpointOwr::addRemoteCandidate(const IceCandidate& candidate, const String& mid, const String& ufrag, const String& password)
-{
-    for (auto& transceiver : m_transceivers) {
-        if (transceiver->mid() == mid) {
-            internalAddRemoteCandidate(transceiver->session(), candidate, ufrag, password);
-            break;
-        }
-    }
-}
-
-void MediaEndpointOwr::replaceMutedRemoteSourceMid(const String& oldMid, const String& newMid)
-{
-    RefPtr<RealtimeMediaSourceOwr> remoteSource = m_mutedRemoteSources.take(oldMid);
-    m_mutedRemoteSources.set(newMid, remoteSource);
-}
-
-Ref<RealtimeMediaSource> MediaEndpointOwr::createMutedRemoteSource(const String& mid, RealtimeMediaSource::Type type)
-{
-    String name;
-    String id("not used");
-    RefPtr<RealtimeMediaSourceOwr> source;
-
-    switch (type) {
-    case RealtimeMediaSource::Type::Audio:
-        name = "remote audio";
-        source = adoptRef(new RealtimeAudioSourceOwr(nullptr, id, type, name));
-        break;
-    case RealtimeMediaSource::Type::Video:
-        name = "remote video";
-        source = adoptRef(new RealtimeVideoSourceOwr(nullptr, id, type, name));
-        break;
-    case RealtimeMediaSource::Type::None:
-        ASSERT_NOT_REACHED();
-    }
-
-    m_mutedRemoteSources.set(mid, source);
-
-    return *source;
-}
-
-void MediaEndpointOwr::replaceSendSource(RealtimeMediaSource& newSource, const String& mid)
-{
-    UNUSED_PARAM(newSource);
-    UNUSED_PARAM(mid);
-
-    // FIXME: We want to use owr_media_session_set_send_source here, but it doesn't work as intended.
-    // Issue tracked by OpenWebRTC bug: https://github.com/EricssonResearch/openwebrtc/issues/533
-
-    notImplemented();
-}
-
-void MediaEndpointOwr::stop()
-{
-    if (!m_transportAgent)
-        return;
-
-    for (auto& transceiver : m_transceivers)
-        owr_media_session_set_send_source(OWR_MEDIA_SESSION(transceiver->session()), nullptr);
-
-    g_object_unref(m_transportAgent);
-    m_transportAgent = nullptr;
-}
-
-size_t MediaEndpointOwr::transceiverIndexForSession(OwrSession* session) const
-{
-    for (unsigned i = 0; i < m_transceivers.size(); ++i) {
-        if (m_transceivers[i]->session() == session)
-            return i;
-    }
-
-    ASSERT_NOT_REACHED();
-    return notFound;
-}
-
-const String& MediaEndpointOwr::sessionMid(OwrSession* session) const
-{
-    size_t index = transceiverIndexForSession(session);
-    return m_transceivers[index]->mid();
-}
-
-OwrTransceiver* MediaEndpointOwr::matchTransceiverByMid(const String& mid) const
-{
-    for (auto& transceiver : m_transceivers) {
-        if (transceiver->mid() == mid)
-            return transceiver.get();
-    }
-    return nullptr;
-}
-
-void MediaEndpointOwr::dispatchNewIceCandidate(const String& mid, IceCandidate&& iceCandidate)
-{
-    m_client.gotIceCandidate(mid, WTFMove(iceCandidate));
-}
-
-void MediaEndpointOwr::dispatchGatheringDone(const String& mid)
-{
-    m_client.doneGatheringCandidates(mid);
-}
-
-void MediaEndpointOwr::processIceTransportStateChange(OwrSession* session)
-{
-    OwrIceState owrIceState;
-    g_object_get(session, "ice-connection-state", &owrIceState, nullptr);
-
-    OwrTransceiver& transceiver = *m_transceivers[transceiverIndexForSession(session)];
-    if (owrIceState < transceiver.owrIceState())
-        return;
-
-    transceiver.setOwrIceState(owrIceState);
-
-    // We cannot go to Completed if there may be more remote candidates.
-    if (owrIceState == OWR_ICE_STATE_READY && !transceiver.gotEndOfRemoteCandidates())
-        return;
-
-    RTCIceTransportState transportState;
-    switch (owrIceState) {
-    case OWR_ICE_STATE_CONNECTING:
-        transportState = RTCIceTransportState::Checking;
-        break;
-    case OWR_ICE_STATE_CONNECTED:
-        transportState = RTCIceTransportState::Connected;
-        break;
-    case OWR_ICE_STATE_READY:
-        transportState = RTCIceTransportState::Completed;
-        break;
-    case OWR_ICE_STATE_FAILED:
-        transportState = RTCIceTransportState::Failed;
-        break;
-    default:
-        return;
-    }
-
-    m_client.iceTransportStateChanged(transceiver.mid(), transportState);
-}
-
-void MediaEndpointOwr::dispatchDtlsFingerprint(gchar* privateKey, gchar* certificate, const String& fingerprint, const String& fingerprintFunction)
-{
-    m_dtlsPrivateKey = String(privateKey);
-    m_dtlsCertificate = String(certificate);
-
-    g_free(privateKey);
-    g_free(certificate);
-
-    m_client.gotDtlsFingerprint(fingerprint, fingerprintFunction);
-}
-
-void MediaEndpointOwr::unmuteRemoteSource(const String& mid, OwrMediaSource* realSource)
-{
-    RefPtr<RealtimeMediaSourceOwr> remoteSource = m_mutedRemoteSources.take(mid);
-    if (!remoteSource) {
-        LOG_ERROR("Unable to find muted remote source.");
-        return;
-    }
-
-    if (remoteSource->isProducingData())
-        remoteSource->swapOutShallowSource(*realSource);
-}
-
-void MediaEndpointOwr::prepareSession(OwrSession* session, PeerMediaDescription* mediaDescription)
-{
-    g_object_set_data_full(G_OBJECT(session), "ice-ufrag", g_strdup(mediaDescription->iceUfrag.ascii().data()), g_free);
-    g_object_set_data_full(G_OBJECT(session), "ice-password", g_strdup(mediaDescription->icePassword.ascii().data()), g_free);
-
-    g_signal_connect(session, "on-new-candidate", G_CALLBACK(gotCandidate), this);
-    g_signal_connect(session, "on-candidate-gathering-done", G_CALLBACK(candidateGatheringDone), this);
-    g_signal_connect(session, "notify::ice-connection-state", G_CALLBACK(iceConnectionStateChange), this);
-}
-
-void MediaEndpointOwr::prepareMediaSession(OwrMediaSession* mediaSession, PeerMediaDescription* mediaDescription, bool isInitiator)
-{
-    prepareSession(OWR_SESSION(mediaSession), mediaDescription);
-
-    bool useRtcpMux = !isInitiator && mediaDescription->rtcpMux;
-    g_object_set(mediaSession, "rtcp-mux", useRtcpMux, nullptr);
-
-    if (!mediaDescription->cname.isEmpty() && mediaDescription->ssrcs.size()) {
-        g_object_set(mediaSession, "cname", mediaDescription->cname.ascii().data(),
-            "send-ssrc", mediaDescription->ssrcs[0],
-            nullptr);
-    }
-
-    g_signal_connect(mediaSession, "on-incoming-source", G_CALLBACK(gotIncomingSource), this);
-
-    for (auto& payload : mediaDescription->payloads) {
-        if (payload.encodingName.convertToASCIIUppercase() == "RTX")
-            continue;
-
-        auto* rtxPayload = findRtxPayload(mediaDescription->payloads, payload.type);
-
-        ASSERT_WITH_MESSAGE(codecTypes.find(payload.encodingName.convertToASCIIUppercase()) != notFound, "Unable to find codec: %s", payload.encodingName.utf8().data());
-        OwrCodecType codecType = static_cast<OwrCodecType>(codecTypes.find(payload.encodingName.convertToASCIIUppercase()));
-
-        OwrPayload* receivePayload;
-        if (mediaDescription->type == "audio")
-            receivePayload = owr_audio_payload_new(codecType, payload.type, payload.clockRate, payload.channels);
-        else {
-            receivePayload = owr_video_payload_new(codecType, payload.type, payload.clockRate, payload.ccmfir, payload.nackpli);
-            g_object_set(receivePayload, "rtx-payload-type", rtxPayload ? rtxPayload->type : -1,
-                "rtx-time", rtxPayload && rtxPayload->parameters.contains("rtxTime") ? rtxPayload->parameters.get("rtxTime") : 0, nullptr);
-        }
-
-        owr_media_session_add_receive_payload(mediaSession, receivePayload);
-    }
-}
-
-struct HelperServerUrl {
-    String protocol;
-    String host;
-    unsigned short port;
-    String query;
-};
-
-static void parseHelperServerUrl(GRegex& regex, const URL& url, HelperServerUrl& outUrl)
-{
-    GMatchInfo* matchInfo;
-
-    if (g_regex_match(&regex, url.string().ascii().data(), static_cast<GRegexMatchFlags>(0), &matchInfo)) {
-        gchar** matches =  g_match_info_fetch_all(matchInfo);
-        gint matchCount = g_strv_length(matches);
-
-        outUrl.protocol = matches[1];
-        outUrl.host = matches[2][0] == '[' ? String(matches[2] + 1, strlen(matches[2]) - 2) // IPv6
-            : matches[2];
-
-        outUrl.port = 0;
-        if (matchCount >= 4) {
-            String portString = String(matches[3] + 1); // Skip port colon
-            outUrl.port = portString.toUIntStrict();
-        }
-
-        if (matchCount == 5)
-            outUrl.query = String(matches[4] + 1); // Skip question mark
-
-        g_strfreev(matches);
-    }
-
-    g_match_info_free(matchInfo);
-}
-
-void MediaEndpointOwr::ensureTransportAgentAndTransceivers(bool isInitiator, const Vector<TransceiverConfig>& transceiverConfigs)
-{
-    ASSERT(m_dtlsPrivateKey);
-    ASSERT(m_dtlsCertificate);
-
-    if (!m_transportAgent) {
-        // FIXME: Handle SDP BUNDLE line from the remote source instead of falling back to balanced.
-        OwrBundlePolicyType bundlePolicy = OWR_BUNDLE_POLICY_TYPE_BALANCED;
-
-        switch (m_configuration->bundlePolicy) {
-        case PeerConnectionStates::BundlePolicy::Balanced:
-            bundlePolicy = OWR_BUNDLE_POLICY_TYPE_BALANCED;
-            break;
-        case PeerConnectionStates::BundlePolicy::MaxCompat:
-            bundlePolicy = OWR_BUNDLE_POLICY_TYPE_MAX_COMPAT;
-            break;
-        case PeerConnectionStates::BundlePolicy::MaxBundle:
-            bundlePolicy = OWR_BUNDLE_POLICY_TYPE_MAX_BUNDLE;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        };
-
-        m_transportAgent = owr_transport_agent_new(false, bundlePolicy);
-
-        ASSERT(m_configuration);
-        for (auto& server : m_configuration->iceServers) {
-            for (auto& webkitUrl : server.urls) {
-                HelperServerUrl url;
-                // WebKit's URL class can't handle ICE helper server urls properly
-                parseHelperServerUrl(*m_helperServerRegEx, webkitUrl, url);
-
-                unsigned short port = url.port ? url.port : helperServerDefaultPort;
-
-                if (url.protocol == "stun") {
-                    owr_transport_agent_add_helper_server(m_transportAgent, OWR_HELPER_SERVER_TYPE_STUN,
-                        url.host.ascii().data(), port, nullptr, nullptr);
-
-                } else if (url.protocol == "turn") {
-                    OwrHelperServerType serverType = url.query == "transport=tcp" ? OWR_HELPER_SERVER_TYPE_TURN_TCP
-                        : OWR_HELPER_SERVER_TYPE_TURN_UDP;
-
-                    owr_transport_agent_add_helper_server(m_transportAgent, serverType,
-                        url.host.ascii().data(), port,
-                        server.username.ascii().data(), server.credential.ascii().data());
-                } else if (url.protocol == "turns") {
-                    owr_transport_agent_add_helper_server(m_transportAgent, OWR_HELPER_SERVER_TYPE_TURN_TLS,
-                        url.host.ascii().data(), port,
-                        server.username.ascii().data(), server.credential.ascii().data());
-                } else
-                    ASSERT_NOT_REACHED();
-            }
-        }
-    }
-
-    g_object_set(m_transportAgent, "ice-controlling-mode", isInitiator, nullptr);
-
-    for (auto& config : transceiverConfigs) {
-        OwrSession* session = OWR_SESSION(owr_media_session_new(config.isDtlsClient));
-        g_object_set(session, "dtls-certificate", m_dtlsCertificate.utf8().data(),
-            "dtls-key", m_dtlsPrivateKey.utf8().data(),
-            nullptr);
-
-        m_transceivers.append(OwrTransceiver::create(config.mid, session));
-    }
-}
-
-void MediaEndpointOwr::internalAddRemoteCandidate(OwrSession* session, const IceCandidate& candidate, const String& ufrag, const String& password)
-{
-    gboolean rtcpMux;
-    g_object_get(session, "rtcp-mux", &rtcpMux, nullptr);
-
-    if (rtcpMux && candidate.componentId == OWR_COMPONENT_TYPE_RTCP)
-        return;
-
-    ASSERT(candidateTypes.find(candidate.type) != notFound);
-
-    OwrCandidateType candidateType = static_cast<OwrCandidateType>(candidateTypes.find(candidate.type));
-    OwrComponentType componentId = static_cast<OwrComponentType>(candidate.componentId);
-    OwrTransportType transportType;
-
-    if (candidate.transport.convertToASCIIUppercase() == "UDP")
-        transportType = OWR_TRANSPORT_TYPE_UDP;
-    else {
-        ASSERT(candidateTcpTypes.find(candidate.tcpType) != notFound);
-        transportType = static_cast<OwrTransportType>(candidateTcpTypes.find(candidate.tcpType));
-    }
-
-    OwrCandidate* owrCandidate = owr_candidate_new(candidateType, componentId);
-    g_object_set(owrCandidate, "transport-type", transportType,
-        "address", candidate.address.ascii().data(),
-        "port", candidate.port,
-        "base-address", candidate.relatedAddress.ascii().data(),
-        "base-port", candidate.relatedPort,
-        "priority", candidate.priority,
-        "foundation", candidate.foundation.ascii().data(),
-        "ufrag", ufrag.ascii().data(),
-        "password", password.ascii().data(),
-        nullptr);
-
-    owr_session_add_remote_candidate(session, owrCandidate);
-}
-
-static void gotCandidate(OwrSession* session, OwrCandidate* candidate, MediaEndpointOwr* mediaEndpoint)
-{
-    OwrCandidateType candidateType;
-    gchar* foundation;
-    OwrComponentType componentId;
-    OwrTransportType transportType;
-    gint priority;
-    gchar* address;
-    guint port;
-    gchar* relatedAddress;
-    guint relatedPort;
-
-    g_object_get(candidate, "type", &candidateType,
-        "foundation", &foundation,
-        "component-type", &componentId,
-        "transport-type", &transportType,
-        "priority", &priority,
-        "address", &address,
-        "port", &port,
-        "base-address", &relatedAddress,
-        "base-port", &relatedPort,
-        nullptr);
-
-    ASSERT(candidateType >= 0 && candidateType < candidateTypes.size());
-    ASSERT(transportType >= 0 && transportType < candidateTcpTypes.size());
-
-    IceCandidate iceCandidate;
-    iceCandidate.type = candidateTypes[candidateType];
-    iceCandidate.foundation = foundation;
-    iceCandidate.componentId = componentId;
-    iceCandidate.priority = priority;
-    iceCandidate.address = address;
-    iceCandidate.port = port ? port : candidateDefaultPort;
-
-    if (transportType == OWR_TRANSPORT_TYPE_UDP)
-        iceCandidate.transport = "UDP";
-    else {
-        iceCandidate.transport = "TCP";
-        iceCandidate.tcpType = candidateTcpTypes[transportType];
-    }
-
-    if (candidateType != OWR_CANDIDATE_TYPE_HOST) {
-        iceCandidate.relatedAddress = relatedAddress;
-        iceCandidate.relatedPort = relatedPort ? relatedPort : candidateDefaultPort;
-    }
-
-    g_object_set(G_OBJECT(candidate), "ufrag", g_object_get_data(G_OBJECT(session), "ice-ufrag"),
-        "password", g_object_get_data(G_OBJECT(session), "ice-password"),
-        nullptr);
-
-    mediaEndpoint->dispatchNewIceCandidate(mediaEndpoint->sessionMid(session), WTFMove(iceCandidate));
-
-    g_free(foundation);
-    g_free(address);
-    g_free(relatedAddress);
-}
-
-static void candidateGatheringDone(OwrSession* session, MediaEndpointOwr* mediaEndpoint)
-{
-    mediaEndpoint->dispatchGatheringDone(mediaEndpoint->sessionMid(session));
-}
-
-static void iceConnectionStateChange(OwrSession* session, GParamSpec*, MediaEndpointOwr* mediaEndpoint)
-{
-    mediaEndpoint->processIceTransportStateChange(session);
-}
-
-static void gotIncomingSource(OwrMediaSession* mediaSession, OwrMediaSource* source, MediaEndpointOwr* mediaEndpoint)
-{
-    mediaEndpoint->unmuteRemoteSource(mediaEndpoint->sessionMid(OWR_SESSION(mediaSession)), source);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h b/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h
deleted file mode 100644 (file)
index f31048c..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (C) 2015, 2016 Ericsson AB. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 "MediaEndpoint.h"
-#include <owr/owr_session.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-typedef struct _OwrMediaSession OwrMediaSession;
-typedef struct _OwrMediaSource OwrMediaSource;
-typedef struct _OwrTransportAgent OwrTransportAgent;
-
-namespace WebCore {
-
-class RealtimeMediaSourceOwr;
-class RTCConfigurationPrivate;
-
-struct PeerMediaDescription;
-
-class OwrTransceiver : public RefCounted<OwrTransceiver> {
-public:
-    static Ref<OwrTransceiver> create(const String& mid, OwrSession* session)
-    {
-        return adoptRef(*new OwrTransceiver(mid, session));
-    }
-    virtual ~OwrTransceiver() { }
-
-    const String& mid() const { return m_mid; }
-    OwrSession* session() const { return m_session; }
-
-    OwrIceState owrIceState() const { return m_owrIceState; }
-    void setOwrIceState(OwrIceState state) { m_owrIceState = state; }
-
-    bool gotEndOfRemoteCandidates() const { return m_gotEndOfRemoteCandidates; }
-    void markGotEndOfRemoteCandidates() { m_gotEndOfRemoteCandidates = true; }
-
-private:
-    OwrTransceiver(const String& mid, OwrSession* session)
-        : m_mid(mid)
-        , m_session(session)
-    { }
-
-    String m_mid;
-    OwrSession* m_session;
-
-    OwrIceState m_owrIceState { OWR_ICE_STATE_DISCONNECTED };
-    bool m_gotEndOfRemoteCandidates { false };
-};
-
-class MediaEndpointOwr : public MediaEndpoint {
-public:
-    MediaEndpointOwr(MediaEndpointClient&);
-    ~MediaEndpointOwr();
-
-    void setConfiguration(MediaEndpointConfiguration&&) override;
-
-    void generateDtlsInfo() override;
-    MediaPayloadVector getDefaultAudioPayloads() override;
-    MediaPayloadVector getDefaultVideoPayloads() override;
-    MediaPayloadVector filterPayloads(const MediaPayloadVector& remotePayloads, const MediaPayloadVector& defaultPayloads) override;
-
-    UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) override;
-    UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, const RealtimeMediaSourceMap&, bool isInitiator) override;
-
-    void addRemoteCandidate(const IceCandidate&, const String& mid, const String& ufrag, const String& password) override;
-
-    Ref<RealtimeMediaSource> createMutedRemoteSource(const String& mid, RealtimeMediaSource::Type) override;
-    void replaceMutedRemoteSourceMid(const String&, const String&) final;
-    void replaceSendSource(RealtimeMediaSource&, const String& mid) override;
-
-    void stop() override;
-
-    size_t transceiverIndexForSession(OwrSession*) const;
-    const String& sessionMid(OwrSession*) const;
-    OwrTransceiver* matchTransceiverByMid(const String& mid) const;
-
-    void dispatchNewIceCandidate(const String& mid, IceCandidate&&);
-    void dispatchGatheringDone(const String& mid);
-    void processIceTransportStateChange(OwrSession*);
-    void dispatchDtlsFingerprint(gchar* privateKey, gchar* certificate, const String& fingerprint, const String& fingerprintFunction);
-    void unmuteRemoteSource(const String& mid, OwrMediaSource*);
-
-private:
-    enum SessionType { SessionTypeMedia };
-
-    struct TransceiverConfig {
-        SessionType type;
-        bool isDtlsClient;
-        String mid;
-    };
-
-    std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) final;
-
-    void prepareSession(OwrSession*, PeerMediaDescription*);
-    void prepareMediaSession(OwrMediaSession*, PeerMediaDescription*, bool isInitiator);
-
-    void ensureTransportAgentAndTransceivers(bool isInitiator, const Vector<TransceiverConfig>&);
-    void internalAddRemoteCandidate(OwrSession*, const IceCandidate&, const String& ufrag, const String& password);
-
-    std::optional<MediaEndpointConfiguration> m_configuration;
-    GRegex* m_helperServerRegEx;
-
-    OwrTransportAgent* m_transportAgent;
-    Vector<RefPtr<OwrTransceiver>> m_transceivers;
-    HashMap<String, RefPtr<RealtimeMediaSourceOwr>> m_mutedRemoteSources;
-
-    MediaEndpointClient& m_client;
-
-    unsigned m_numberOfReceivePreparedSessions;
-    unsigned m_numberOfSendPreparedSessions;
-
-    String m_dtlsPrivateKey;
-    String m_dtlsCertificate;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp b/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp
deleted file mode 100644 (file)
index e4cfb59..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2015 Igalia S.L
- * Copyright (C) 2015 Metrological
- *
- * 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.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * HOLDER OR 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.
- */
-
-
-#include "config.h"
-
-#if USE(OPENWEBRTC)
-#include "OpenWebRTCUtilities.h"
-
-#include <owr/owr.h>
-
-namespace WebCore {
-
-void initializeOpenWebRTC()
-{
-    static bool isInitialized = false;
-    if (isInitialized)
-        return;
-
-    owr_init(g_main_context_default());
-    isInitialized = true;
-}
-
-}
-
-#endif // USE(OPENWEBRTC)
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.h b/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.h
deleted file mode 100644 (file)
index bed474b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2015 Igalia S.L
- * Copyright (C) 2015 Metrological
- *
- * 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.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * HOLDER OR 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.
- */
-
-
-namespace WebCore {
-
-void initializeOpenWebRTC();
-
-}
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h b/Source/WebCore/platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h
deleted file mode 100644 (file)
index cab7050..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2015,2016 Igalia S.L
- * Copyright (C) 2015 Metrological
- *
- * 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.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * HOLDER OR 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(MEDIA_STREAM) && USE(OPENWEBRTC)
-
-#include "RealtimeMediaSourceOwr.h"
-
-namespace WebCore {
-
-class RealtimeAudioSourceOwr : public RealtimeMediaSourceOwr {
-public:
-RealtimeAudioSourceOwr(OwrMediaSource* mediaSource, const String& id, RealtimeMediaSource::Type type, const String& name)
-    : RealtimeMediaSourceOwr(mediaSource, id, type, name)
-    {
-    }
-
-RealtimeAudioSourceOwr(const String& id, RealtimeMediaSource::Type type, const String& name)
-    : RealtimeMediaSourceOwr(id, type, name)
-    {
-    }
-
-    virtual ~RealtimeAudioSourceOwr() { }
-
-    bool applySize(const IntSize&) final { return false; }
-
-protected:
-    void initializeSettings() final {
-        if (m_currentSettings.deviceId().isEmpty())
-            m_currentSettings.setSupportedConstraints(supportedConstraints());
-
-        m_currentSettings.setDeviceId(id());
-    }
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp b/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp
deleted file mode 100644 (file)
index aaad8a2..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (C) 2011 Ericsson AB. All rights reserved.
- * Copyright (C) 2012 Google Inc. All rights reserved.
- * Copyright (C) 2015 Igalia S.L. All rights reserved.
- * Copyright (C) 2015 Metrological. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#include "config.h"
-
-#if ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
-#include "RealtimeMediaSourceCenterOwr.h"
-
-#include "CaptureDevice.h"
-#include "MediaStreamPrivate.h"
-#include "NotImplemented.h"
-#include "OpenWebRTCUtilities.h"
-#include "RealtimeAudioSourceOwr.h"
-#include "RealtimeMediaSourceCapabilities.h"
-#include "RealtimeVideoSourceOwr.h"
-#include <owr/owr.h>
-#include <owr/owr_local.h>
-#include <owr/owr_media_source.h>
-#include <wtf/MainThread.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/UUID.h>
-#include <wtf/glib/GUniquePtr.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringHash.h>
-
-namespace WebCore {
-
-RealtimeMediaSourceCenter& RealtimeMediaSourceCenter::platformCenter()
-{
-    ASSERT(isMainThread());
-    static NeverDestroyed<RealtimeMediaSourceCenterOwr> center;
-    return center;
-}
-
-static void mediaSourcesAvailableCallback(GList* sources, gpointer userData)
-{
-    RealtimeMediaSourceCenterOwr* center = reinterpret_cast<RealtimeMediaSourceCenterOwr*>(userData);
-    center->mediaSourcesAvailable(sources);
-}
-
-RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr()
-{
-    initializeOpenWebRTC();
-}
-
-RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr()
-{
-}
-
-void RealtimeMediaSourceCenterOwr::validateRequestConstraints(ValidConstraintsHandler&& validHandler, InvalidConstraintsHandler&& invalidHandler, const MediaConstraints& audioConstraints, const MediaConstraints& videoConstraints, String&& deviceIdentifierHashSalt)
-{
-    m_validConstraintsHandler = WTFMove(validHandler);
-    m_invalidConstraintsHandler = WTFMove(invalidHandler);
-
-    Vector<String> audioSources;
-    Vector<String> videoSources;
-
-    // FIXME: Actually do constraints validation. The MediaConstraints
-    // need to comply with the available audio/video device(s)
-    // capabilities. See bug #123345.
-    if (audioConstraints.isValid)
-        audioSources.append(String("audio"));
-
-    if (videoConstraints.isValid)
-        videoSources.append(String("video"));
-
-    m_validConstraintsHandler(WTFMove(audioSources), WTFMove(videoSources), WTFMove(deviceIdentifierHashSalt));
-    m_validConstraintsHandler = nullptr;
-    m_invalidConstraintsHandler = nullptr;
-}
-
-void RealtimeMediaSourceCenterOwr::createMediaStream(NewMediaStreamHandler&& completionHandler, const String& audioDeviceID, const String& videoDeviceID, const MediaConstraints*, const MediaConstraints*)
-{
-    int types = OWR_MEDIA_TYPE_UNKNOWN;
-
-    if (!audioDeviceID.isEmpty())
-        types |= OWR_MEDIA_TYPE_AUDIO;
-    if (!videoDeviceID.isEmpty())
-        types |= OWR_MEDIA_TYPE_VIDEO;
-
-    m_completionHandler = WTFMove(completionHandler);
-
-    owr_get_capture_sources(static_cast<OwrMediaType>(types), mediaSourcesAvailableCallback, this);
-}
-
-Vector<CaptureDevice> RealtimeMediaSourceCenterOwr::getMediaStreamDevices()
-{
-    notImplemented();
-    return Vector<CaptureDevice>();
-}
-
-void RealtimeMediaSourceCenterOwr::mediaSourcesAvailable(GList* sources)
-{
-    Vector<Ref<RealtimeMediaSource>> audioSources;
-    Vector<Ref<RealtimeMediaSource>> videoSources;
-
-    for (auto item = sources; item; item = item->next) {
-        OwrMediaSource* source = OWR_MEDIA_SOURCE(item->data);
-
-        GUniqueOutPtr<gchar> name;
-        OwrMediaType mediaType;
-        g_object_get(source, "media-type", &mediaType, "name", &name.outPtr(), NULL);
-        String sourceName(name.get());
-        String id(createCanonicalUUIDString());
-
-        if (g_getenv("OWR_USE_TEST_SOURCES")) {
-            OwrSourceType sourceType = OWR_SOURCE_TYPE_UNKNOWN;
-            g_object_get(source, "type", &sourceType, NULL);
-            if (sourceType != OWR_SOURCE_TYPE_TEST)
-                continue;
-        }
-
-        RealtimeMediaSource::Type mediaSourceType;
-        if (mediaType & OWR_MEDIA_TYPE_AUDIO)
-            mediaSourceType = RealtimeMediaSource::Type::Audio;
-        else if (mediaType & OWR_MEDIA_TYPE_VIDEO)
-            mediaSourceType = RealtimeMediaSource::Type::Video;
-        else {
-            mediaSourceType = RealtimeMediaSource::Type::None;
-            ASSERT_NOT_REACHED();
-        }
-
-        RefPtr<RealtimeMediaSourceOwr> mediaSource;
-        if (mediaSourceType == RealtimeMediaSource::Type::Audio)
-            mediaSource = adoptRef(new RealtimeAudioSourceOwr(source, id, mediaSourceType, sourceName));
-        else
-            mediaSource = adoptRef(new RealtimeVideoSourceOwr(source, id, mediaSourceType, sourceName));
-
-        RealtimeMediaSourceOwrMap::iterator sourceIterator = m_sourceMap.find(id);
-        if (sourceIterator == m_sourceMap.end())
-            m_sourceMap.add(id, mediaSource.copyRef());
-
-        if (mediaType & OWR_MEDIA_TYPE_AUDIO)
-            audioSources.append(mediaSource.releaseNonNull());
-        else if (mediaType & OWR_MEDIA_TYPE_VIDEO)
-            videoSources.append(mediaSource.releaseNonNull());
-
-    }
-
-    if (videoSources.isEmpty() && audioSources.isEmpty())
-        m_completionHandler(nullptr);
-    else
-        m_completionHandler(MediaStreamPrivate::create(audioSources, videoSources));
-
-}
-
-RealtimeMediaSource* RealtimeMediaSourceCenterOwr::firstSource(RealtimeMediaSource::Type type)
-{
-    for (auto iter = m_sourceMap.begin(); iter != m_sourceMap.end(); ++iter) {
-        RefPtr<RealtimeMediaSource> source = iter->value;
-        if (source->type() == type)
-            return source.get();
-    }
-
-    return nullptr;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h b/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h
deleted file mode 100644 (file)
index 680d918..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2011 Ericsson AB. All rights reserved.
- * Copyright (C) 2012 Google Inc. All rights reserved.
- * Copyright (C) 2015 Igalia S.L. All rights reserved.
- * Copyright (C) 2015 Metrological. 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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(MEDIA_STREAM) && USE(OPENWEBRTC)
-
-#include "CaptureDeviceManager.h"
-#include "RealtimeMediaSourceCenter.h"
-#include "RealtimeMediaSourceOwr.h"
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class CaptureDevice;
-class MediaStreamPrivate;
-class RealtimeMediaSource;
-class MediaStreamSourcesQueryClient;
-class TrackSourceInfo;
-
-class RealtimeMediaSourceCenterOwr final : public RealtimeMediaSourceCenter {
-public:
-    RealtimeMediaSourceCenterOwr();
-    ~RealtimeMediaSourceCenterOwr();
-
-    void validateRequestConstraints(ValidConstraintsHandler&& validHandler, InvalidConstraintsHandler&& invalidHandler, const MediaConstraints& audioConstraints, const MediaConstraints& videoConstraints, String&&) final;
-
-    void createMediaStream(NewMediaStreamHandler&&, const String& audioDeviceID, const String& videoDeviceID, const MediaConstraints* videoConstraints, const MediaConstraints* audioConstraints) final;
-
-    Vector<CaptureDevice> getMediaStreamDevices() final;
-
-    void mediaSourcesAvailable(GList* sources);
-
-private:
-    RealtimeMediaSource::AudioCaptureFactory& defaultAudioFactory() final { return m_defaultAudioFactory; }
-    RealtimeMediaSource::VideoCaptureFactory& defaultVideoFactory() final { return m_defaultVideoFactory; }
-    CaptureDeviceManager& defaultAudioCaptureDeviceManager() final { return m_defaultAudioCaptureDeviceManager; }
-    CaptureDeviceManager& defaultVideoCaptureDeviceManager() final { return m_defaultVideoCaptureDeviceManager; }
-
-    RealtimeMediaSource* firstSource(RealtimeMediaSource::Type);
-    RealtimeMediaSourceOwrMap m_sourceMap;
-    ValidConstraintsHandler m_validConstraintsHandler;
-    InvalidConstraintsHandler m_invalidConstraintsHandler;
-    NewMediaStreamHandler m_completionHandler;
-
-    class AudioCaptureFactoryOwr : public RealtimeMediaSource::AudioCaptureFactory {
-    private:
-        CaptureSourceOrError createAudioCaptureSource(const String&, const MediaConstraints*) final { return { }; }
-    };
-
-    class VideoCaptureFactoryOwr : public RealtimeMediaSource::VideoCaptureFactory {
-    private:
-        CaptureSourceOrError createVideoCaptureSource(const String&, const MediaConstraints*) final { return { }; }
-    };
-
-    class CaptureDeviceManagerOwr : public CaptureDeviceManager {
-    private:
-        Vector<CaptureDevice>& captureDevices() final { return m_devices; }
-
-        Vector<CaptureDevice> m_devices;
-    };
-
-    AudioCaptureFactoryOwr m_defaultAudioFactory;
-    VideoCaptureFactoryOwr m_defaultVideoFactory;
-    CaptureDeviceManagerOwr m_defaultAudioCaptureDeviceManager;
-    CaptureDeviceManagerOwr m_defaultVideoCaptureDeviceManager;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp b/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp
deleted file mode 100644 (file)
index ee7499d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2016 Igalia S.L
- *
- * 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.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * HOLDER OR 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.
- */
-
-#include "config.h"
-
-#if ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
-#include "RealtimeMediaSourceOwr.h"
-
-namespace WebCore {
-
-const RealtimeMediaSourceSettings& RealtimeMediaSourceOwr::settings() const
-{
-    const_cast<RealtimeMediaSourceOwr&>(*this).initializeSettings();
-    return m_currentSettings;
-}
-
-RealtimeMediaSourceSupportedConstraints& RealtimeMediaSourceOwr::supportedConstraints()
-{
-    if (m_supportedConstraints.supportsDeviceId())
-        return m_supportedConstraints;
-
-    m_supportedConstraints.setSupportsDeviceId(true);
-    initializeSupportedConstraints(m_supportedConstraints);
-
-    return m_supportedConstraints;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h b/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h
deleted file mode 100644 (file)
index 7cfbf78..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2015 Igalia S.L
- * Copyright (C) 2015 Metrological
- *
- * 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.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * HOLDER OR 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.
- */
-
-#ifndef RealtimeMediaSourceOwr_h
-#define RealtimeMediaSourceOwr_h
-
-#if ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
-
-#include "GRefPtrGStreamer.h"
-#include "RealtimeMediaSource.h"
-#include <owr/owr_media_source.h>
-#include <wtf/HashMap.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class RealtimeMediaSourceCapabilities;
-
-class RealtimeMediaSourceOwr : public RealtimeMediaSource {
-public:
-RealtimeMediaSourceOwr(OwrMediaSource* mediaSource, const String& id, RealtimeMediaSource::Type type, const String& name)
-    : RealtimeMediaSource(id, type, name)
-    , m_mediaSource(mediaSource)
-    {
-        if (!mediaSource)
-            notifyMutedChange(true);
-    }
-
-RealtimeMediaSourceOwr(const String& id, RealtimeMediaSource::Type type, const String& name)
-    : RealtimeMediaSource(id, type, name)
-    , m_mediaSource(nullptr)
-    {
-    }
-
-    virtual ~RealtimeMediaSourceOwr() { }
-
-    void swapOutShallowSource(OwrMediaSource& realSource)
-    {
-        m_mediaSource = &realSource;
-        setMuted(false);
-    }
-
-    const RealtimeMediaSourceCapabilities& capabilities() const override { return m_capabilities; }
-    const RealtimeMediaSourceSettings& settings() const override;
-
-    OwrMediaSource* mediaSource() const { return m_mediaSource; }
-
-protected:
-    virtual void initializeSettings() { };
-    virtual void initializeSupportedConstraints(RealtimeMediaSourceSupportedConstraints&) { };
-    RealtimeMediaSourceSupportedConstraints& supportedConstraints();
-
-    RealtimeMediaSourceSettings m_currentSettings;
-
-private:
-    RealtimeMediaSourceSupportedConstraints m_supportedConstraints;
-    RealtimeMediaSourceCapabilities m_capabilities;
-    OwrMediaSource* m_mediaSource;
-};
-
-typedef HashMap<String, RefPtr<RealtimeMediaSourceOwr>> RealtimeMediaSourceOwrMap;
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
-
-#endif // RealtimeMediaSourceOwr_h
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h b/Source/WebCore/platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h
deleted file mode 100644 (file)
index 418ef84..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2015,2016 Igalia S.L
- * Copyright (C) 2015 Metrological
- *
- * 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.
- *
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * HOLDER OR 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(MEDIA_STREAM) && USE(OPENWEBRTC)
-
-#include "RealtimeMediaSourceOwr.h"
-
-namespace WebCore {
-
-class RealtimeVideoSourceOwr : public RealtimeMediaSourceOwr {
-public:
-RealtimeVideoSourceOwr(OwrMediaSource* mediaSource, const String& id, RealtimeMediaSource::Type type, const String& name)
-    : RealtimeMediaSourceOwr(mediaSource, id, type, name)
-    {
-    }
-
-RealtimeVideoSourceOwr(const String& id, RealtimeMediaSource::Type type, const String& name)
-    : RealtimeMediaSourceOwr(id, type, name)
-    {
-    }
-
-    virtual ~RealtimeVideoSourceOwr() { }
-
-    bool applySize(const IntSize&) final { return true; }
-
-protected:
-    void initializeSettings() final {
-        if (m_currentSettings.deviceId().isEmpty())
-            m_currentSettings.setSupportedConstraints(supportedConstraints());
-
-        m_currentSettings.setDeviceId(id());
-
-        m_currentSettings.setFrameRate(frameRate());
-        m_currentSettings.setWidth(size().width());
-        m_currentSettings.setHeight(size().height());
-    }
-
-    void initializeSupportedConstraints(RealtimeMediaSourceSupportedConstraints& supportedConstraints) final {
-        supportedConstraints.setSupportsFacingMode(RealtimeMediaSourceSettings::Unknown);
-        supportedConstraints.setSupportsWidth(true);
-        supportedConstraints.setSupportsHeight(true);
-        supportedConstraints.setSupportsAspectRatio(true);
-        supportedConstraints.setSupportsFrameRate(true);
-    }
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
diff --git a/Source/WebCore/platform/mock/MockMediaEndpoint.cpp b/Source/WebCore/platform/mock/MockMediaEndpoint.cpp
deleted file mode 100644 (file)
index 0e9b41e..0000000
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright (C) 2015 Ericsson AB. All rights reserved.
- * 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_RTC)
-#include "MockMediaEndpoint.h"
-
-#include "MediaEndpointSessionConfiguration.h"
-#include "MediaPayload.h"
-#include "MockRealtimeAudioSource.h"
-#include "MockRealtimeVideoSource.h"
-#include "RTCDataChannelHandlerMock.h"
-#include "RealtimeMediaSource.h"
-#include <wtf/MainThread.h>
-
-namespace WebCore {
-
-static const char* fingerprint = "8B:87:09:8A:5D:C2:F3:33:EF:C5:B1:F6:84:3A:3D:D6:A3:E2:9C:17:4C:E7:46:3B:1B:CE:84:98:DD:8E:AF:7B";
-static const char* fingerprintFunction = "sha-256";
-
-std::unique_ptr<MediaEndpoint> MockMediaEndpoint::create(MediaEndpointClient& client)
-{
-    return std::unique_ptr<MediaEndpoint>(new MockMediaEndpoint(client));
-}
-
-MockMediaEndpoint::MockMediaEndpoint(MediaEndpointClient& client)
-    : m_client(client)
-    , m_iceCandidateTimer(*this, &MockMediaEndpoint::iceCandidateTimerFired)
-    , m_iceTransportTimer(*this, &MockMediaEndpoint::iceTransportTimerFired)
-    , m_unmuteTimer(*this, &MockMediaEndpoint::unmuteTimerFired)
-{
-}
-
-MockMediaEndpoint::~MockMediaEndpoint()
-{
-    stop();
-}
-
-std::unique_ptr<RTCDataChannelHandler> MockMediaEndpoint::createDataChannelHandler(const String& label, const RTCDataChannelInit& options)
-{
-    return std::make_unique<RTCDataChannelHandlerMock>(label, options);
-}
-
-void MockMediaEndpoint::generateDtlsInfo()
-{
-    auto weakThis = m_weakPtrFactory.createWeakPtr(*this);
-
-    callOnMainThread([weakThis] {
-        if (weakThis)
-            weakThis->m_client.gotDtlsFingerprint(fingerprint, fingerprintFunction);
-    });
-}
-
-MediaPayloadVector MockMediaEndpoint::getDefaultAudioPayloads()
-{
-    MediaPayloadVector payloads;
-
-    MediaPayload payload1;
-    payload1.type = 111;
-    payload1.encodingName = "OPUS";
-    payload1.clockRate = 48000;
-    payload1.channels = 2;
-    payloads.append(WTFMove(payload1));
-
-    MediaPayload payload2;
-    payload2.type = 8;
-    payload2.encodingName = "PCMA";
-    payload2.clockRate = 8000;
-    payload2.channels = 1;
-    payloads.append(WTFMove(payload2));
-
-    MediaPayload payload3;
-    payload3.type = 0;
-    payload3.encodingName = "PCMU";
-    payload3.clockRate = 8000;
-    payload3.channels = 1;
-    payloads.append(WTFMove(payload3));
-
-    return payloads;
-}
-
-MediaPayloadVector MockMediaEndpoint::getDefaultVideoPayloads()
-{
-    MediaPayloadVector payloads;
-
-    MediaPayload payload1;
-    payload1.type = 103;
-    payload1.encodingName = "H264";
-    payload1.clockRate = 90000;
-    payload1.ccmfir = true;
-    payload1.nackpli = true;
-    payload1.addParameter("packetizationMode", 1);
-    payloads.append(WTFMove(payload1));
-
-    MediaPayload payload2;
-    payload2.type = 100;
-    payload2.encodingName = "VP8";
-    payload2.clockRate = 90000;
-    payload2.ccmfir = true;
-    payload2.nackpli = true;
-    payload2.nack = true;
-    payloads.append(WTFMove(payload2));
-
-    MediaPayload payload3;
-    payload3.type = 120;
-    payload3.encodingName = "RTX";
-    payload3.clockRate = 90000;
-    payload3.addParameter("apt", 100);
-    payload3.addParameter("rtxTime", 200);
-    payloads.append(WTFMove(payload3));
-
-    return payloads;
-}
-
-MediaPayloadVector MockMediaEndpoint::filterPayloads(const MediaPayloadVector& remotePayloads, const MediaPayloadVector& defaultPayloads)
-{
-    MediaPayloadVector filteredPayloads;
-
-    for (auto& remotePayload : remotePayloads) {
-        const MediaPayload* defaultPayload = nullptr;
-        for (auto& payload : defaultPayloads) {
-            if (payload.encodingName == remotePayload.encodingName.convertToASCIIUppercase()) {
-                defaultPayload = &payload;
-                break;
-            }
-        }
-        if (!defaultPayload)
-            continue;
-
-        if (defaultPayload->parameters.contains("packetizationMode") && remotePayload.parameters.contains("packetizationMode")
-            && (defaultPayload->parameters.get("packetizationMode") != defaultPayload->parameters.get("packetizationMode")))
-            continue;
-
-        filteredPayloads.append(remotePayload);
-    }
-
-    return filteredPayloads;
-}
-
-MediaEndpoint::UpdateResult MockMediaEndpoint::updateReceiveConfiguration(MediaEndpointSessionConfiguration* configuration, bool isInitiator)
-{
-    UNUSED_PARAM(isInitiator);
-
-    updateConfigurationMids(*configuration);
-    return UpdateResult::Success;
-}
-
-MediaEndpoint::UpdateResult MockMediaEndpoint::updateSendConfiguration(MediaEndpointSessionConfiguration* configuration, const RealtimeMediaSourceMap& sendSourceMap, bool isInitiator)
-{
-    UNUSED_PARAM(sendSourceMap);
-    UNUSED_PARAM(isInitiator);
-
-    updateConfigurationMids(*configuration);
-    return UpdateResult::Success;
-}
-
-void MockMediaEndpoint::addRemoteCandidate(const IceCandidate& candidate, const String& mid, const String& ufrag, const String& password)
-{
-    UNUSED_PARAM(candidate);
-    UNUSED_PARAM(mid);
-    UNUSED_PARAM(ufrag);
-    UNUSED_PARAM(password);
-}
-
-Ref<RealtimeMediaSource> MockMediaEndpoint::createMutedRemoteSource(const String& mid, RealtimeMediaSource::Type type)
-{
-    RefPtr<RealtimeMediaSource> source;
-
-    switch (type) {
-    case RealtimeMediaSource::Type::Audio:
-        source = MockRealtimeAudioSource::createMuted("remote audio");
-        break;
-    case RealtimeMediaSource::Type::Video:
-        source = MockRealtimeVideoSource::createMuted("remote video");
-        break;
-    case RealtimeMediaSource::Type::None:
-        ASSERT_NOT_REACHED();
-    }
-
-    m_mutedRemoteSources.set(mid, source);
-    return source.releaseNonNull();
-}
-
-void MockMediaEndpoint::replaceSendSource(RealtimeMediaSource& newSource, const String& mid)
-{
-    UNUSED_PARAM(newSource);
-    UNUSED_PARAM(mid);
-}
-
-void MockMediaEndpoint::replaceMutedRemoteSourceMid(const String& oldMid, const String& newMid)
-{
-    RefPtr<RealtimeMediaSource> remoteSource = m_mutedRemoteSources.take(oldMid);
-    m_mutedRemoteSources.set(newMid, WTFMove(remoteSource));
-}
-
-void MockMediaEndpoint::stop()
-{
-}
-
-void MockMediaEndpoint::emulatePlatformEvent(const String& action)
-{
-    if (action == "dispatch-fake-ice-candidates")
-        dispatchFakeIceCandidates();
-    else if (action == "step-ice-transport-states")
-        stepIceTransportStates();
-    else if (action == "unmute-remote-sources-by-mid")
-        unmuteRemoteSourcesByMid();
-}
-
-void MockMediaEndpoint::updateConfigurationMids(const MediaEndpointSessionConfiguration& configuration)
-{
-    Vector<String> mids;
-    for (auto& mediaDescription : configuration.mediaDescriptions())
-        mids.append(mediaDescription.mid);
-    m_mids.swap(mids);
-}
-
-void MockMediaEndpoint::dispatchFakeIceCandidates()
-{
-    m_fakeIceCandidates.append({ "host", "1", 1, "UDP", 2013266431, "192.168.0.100", 38838, { }, { }, 0 });
-    m_fakeIceCandidates.append({ "host", "2", 1, "TCP", 1019216383, "192.168.0.100", 9, "active", { }, 0 });
-    m_fakeIceCandidates.append({ "srflx", "3", 1, "UDP", 1677722111, "172.18.0.1", 47989, { }, "192.168.0.100", 47989 });
-
-    // Reverse order to use takeLast() while keeping the above order
-    m_fakeIceCandidates.reverse();
-
-    m_iceCandidateTimer.startOneShot(0_s);
-}
-
-void MockMediaEndpoint::iceCandidateTimerFired()
-{
-    if (m_mids.isEmpty())
-        return;
-
-    if (!m_fakeIceCandidates.isEmpty()) {
-        m_client.gotIceCandidate(m_mids[0], m_fakeIceCandidates.takeLast());
-        m_iceCandidateTimer.startOneShot(0_s);
-    } else
-        m_client.doneGatheringCandidates(m_mids[0]);
-}
-
-void MockMediaEndpoint::stepIceTransportStates()
-{
-    if (m_mids.size() != 3) {
-        LOG_ERROR("The 'step-ice-transport-states' action requires 3 transceivers");
-        return;
-    }
-
-    // Should go to:
-    // 'checking'
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[0], RTCIceTransportState::Checking));
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[1], RTCIceTransportState::Checking));
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[2], RTCIceTransportState::Checking));
-
-    // 'connected'
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[0], RTCIceTransportState::Connected));
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[1], RTCIceTransportState::Completed));
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[2], RTCIceTransportState::Closed));
-
-    // 'completed'
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[0], RTCIceTransportState::Completed));
-
-    // 'failed'
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[0], RTCIceTransportState::Failed));
-
-    // 'disconnected'
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[1], RTCIceTransportState::Disconnected));
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[0], RTCIceTransportState::Closed));
-
-    // 'new'
-    m_iceTransportStateChanges.append(std::make_pair(m_mids[1], RTCIceTransportState::Closed));
-
-    // Reverse order to use takeLast() while keeping the above order
-    m_iceTransportStateChanges.reverse();
-
-    m_iceTransportTimer.startOneShot(0_s);
-}
-
-void MockMediaEndpoint::iceTransportTimerFired()
-{
-    if (m_iceTransportStateChanges.isEmpty() || m_mids.size() != 3)
-        return;
-
-    auto stateChange = m_iceTransportStateChanges.takeLast();
-    m_client.iceTransportStateChanged(stateChange.first, stateChange.second);
-
-    m_iceTransportTimer.startOneShot(0_s);
-}
-
-void MockMediaEndpoint::unmuteRemoteSourcesByMid()
-{
-    if (m_mids.isEmpty())
-        return;
-
-    // Looking up each source by its mid, instead of simply iterating over the list of muted sources,
-    // emulates remote media arriving on a media description with a specific mid (RTCRtpTransceiver).
-
-    // Copy values in reverse order to maintain the original order while using takeLast()
-    for (int i = m_mids.size() - 1; i >= 0; --i)
-        m_midsOfSourcesToUnmute.append(m_mids[i]);
-
-    m_unmuteTimer.startOneShot(0_s);
-}
-
-void MockMediaEndpoint::unmuteTimerFired()
-{
-    auto* source = m_mutedRemoteSources.get(m_midsOfSourcesToUnmute.takeLast());
-    if (source)
-        source->setMuted(false);
-
-    if (!m_midsOfSourcesToUnmute.isEmpty())
-        m_unmuteTimer.startOneShot(0_s);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
diff --git a/Source/WebCore/platform/mock/MockMediaEndpoint.h b/Source/WebCore/platform/mock/MockMediaEndpoint.h
deleted file mode 100644 (file)
index 7f6664f..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2015 Ericsson AB. All rights reserved.
- * 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.
- * 3. Neither the name of Ericsson nor the names of its contributors
- *    may be used to endorse or promote products derived from this
- *    software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 "MediaEndpoint.h"
-#include "RTCIceTransportState.h"
-#include "Timer.h"
-
-namespace WebCore {
-
-class MockMediaEndpoint final : public MediaEndpoint {
-public:
-    WEBCORE_EXPORT static std::unique_ptr<MediaEndpoint> create(MediaEndpointClient&);
-
-    MockMediaEndpoint(MediaEndpointClient&);
-    ~MockMediaEndpoint();
-
-    void setConfiguration(MediaEndpointConfiguration&&) final { };
-
-    void generateDtlsInfo() final;
-    MediaPayloadVector getDefaultAudioPayloads() final;
-    MediaPayloadVector getDefaultVideoPayloads() final;
-    MediaPayloadVector filterPayloads(const MediaPayloadVector& remotePayloads, const MediaPayloadVector& defaultPayloads) final;
-
-    UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) final;
-    UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, const RealtimeMediaSourceMap&, bool isInitiator) final;
-
-    void addRemoteCandidate(const IceCandidate&, const String& mid, const String& ufrag, const String& password) final;
-
-    Ref<RealtimeMediaSource> createMutedRemoteSource(const String& mid, RealtimeMediaSource::Type) final;
-    void replaceSendSource(RealtimeMediaSource&, const String& mid) final;
-    void replaceMutedRemoteSourceMid(const String& oldMid, const String& newMid) final;
-
-    void stop() final;
-
-    void emulatePlatformEvent(const String& action) final;
-
-private:
-    void updateConfigurationMids(const MediaEndpointSessionConfiguration&);
-
-    std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) final;
-
-    void dispatchFakeIceCandidates();
-    void iceCandidateTimerFired();
-
-    void stepIceTransportStates();
-    void iceTransportTimerFired();
-
-    void unmuteRemoteSourcesByMid();
-    void unmuteTimerFired();
-
-    MediaEndpointClient& m_client;
-    Vector<String> m_mids;
-    HashMap<String, RefPtr<RealtimeMediaSource>> m_mutedRemoteSources;
-
-    Vector<IceCandidate> m_fakeIceCandidates;
-    Timer m_iceCandidateTimer;
-
-    Vector<std::pair<String, RTCIceTransportState>> m_iceTransportStateChanges;
-    Timer m_iceTransportTimer;
-
-    Vector<String> m_midsOfSourcesToUnmute;
-    Timer m_unmuteTimer;
-    
-    WeakPtrFactory<MockMediaEndpoint> m_weakPtrFactory;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
index b42427b..8791945 100644 (file)
@@ -82,7 +82,7 @@ Vector<CaptureDevice>& MockRealtimeMediaSource::videoDevices()
 }
 
 MockRealtimeMediaSource::MockRealtimeMediaSource(const String& id, RealtimeMediaSource::Type type, const String& name)
-    : BaseRealtimeMediaSourceClass(id, type, name)
+    : RealtimeMediaSource(id, type, name)
 {
     switch (type) {
     case RealtimeMediaSource::Type::Audio:
index 9507f01..1ea115d 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef MockRealtimeMediaSource_h
-#define MockRealtimeMediaSource_h
+#pragma once
 
 #if ENABLE(MEDIA_STREAM)
 
 #include "RealtimeMediaSource.h"
 
-#if USE(OPENWEBRTC)
-#include "RealtimeMediaSourceOwr.h"
-#endif
-
 namespace WebCore {
 
 class CaptureDevice;
 
-#if USE(OPENWEBRTC)
-using BaseRealtimeMediaSourceClass = RealtimeMediaSourceOwr;
-#else
-using BaseRealtimeMediaSourceClass = RealtimeMediaSource;
-#endif
-
-class MockRealtimeMediaSource : public BaseRealtimeMediaSourceClass {
+class MockRealtimeMediaSource : public RealtimeMediaSource {
 public:
     virtual ~MockRealtimeMediaSource() { }
 
@@ -61,9 +50,7 @@ protected:
 
     virtual void updateSettings(RealtimeMediaSourceSettings&) = 0;
     virtual void initializeCapabilities(RealtimeMediaSourceCapabilities&) = 0;
-#if !USE(OPENWEBRTC)
     virtual void initializeSupportedConstraints(RealtimeMediaSourceSupportedConstraints&) = 0;
-#endif
 
     const RealtimeMediaSourceCapabilities& capabilities() const override;
     const RealtimeMediaSourceSettings& settings() const override;
@@ -74,11 +61,7 @@ protected:
 
 private:
     void initializeCapabilities();
-#if USE(OPENWEBRTC)
-    void initializeSettings() final;
-#else
     void initializeSettings();
-#endif
 
     RealtimeMediaSourceSettings m_currentSettings;
     RealtimeMediaSourceSupportedConstraints m_supportedConstraints;
@@ -89,5 +72,3 @@ private:
 } // namespace WebCore
 
 #endif // ENABLE(MEDIA_STREAM)
-
-#endif // MockRealtimeMediaSource_h
index bee580a..8bbd86b 100644 (file)
 #endif
 
 #if ENABLE(WEB_RTC)
-#include "MockMediaEndpoint.h"
 #include "RTCPeerConnection.h"
 #endif
 
@@ -486,12 +485,6 @@ Internals::Internals(Document& document)
     WebCore::Settings::setMediaCaptureRequiresSecureConnection(false);
 #endif
 
-#if ENABLE(WEB_RTC)
-#if USE(OPENWEBRTC)
-    enableMockMediaEndpoint();
-#endif
-#endif
-
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     if (document.page())
         document.page()->setMockMediaPlaybackTargetPickerEnabled(true);
@@ -1249,13 +1242,6 @@ void Internals::enableMockSpeechSynthesizer()
 
 #if ENABLE(WEB_RTC)
 
-#if USE(OPENWEBRTC)
-void Internals::enableMockMediaEndpoint()
-{
-    MediaEndpoint::create = MockMediaEndpoint::create;
-}
-#endif
-
 void Internals::emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection& connection, const String& action)
 {
     if (!LibWebRTCProvider::webRTCAvailable())
index 308e39f..2ea5847 100644 (file)
@@ -429,9 +429,6 @@ public:
 #endif
 
 #if ENABLE(WEB_RTC)
-#if USE(OPENWEBRTC)
-    void enableMockMediaEndpoint();
-#endif
     void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection&, const String& action);
     void useMockRTCPeerConnectionFactory(const String&);
     void setICECandidateFiltering(bool);