Changeset 197702 in webkit
- Timestamp:
- Mar 7, 2016 1:25:03 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 13 edited
- 5 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r197700 r197702 1 2016-03-07 Adam Bergkvist <adam.bergkvist@ericsson.com> 2 3 WebRTC: Implement MediaEndpointPeerConnection::createOffer() 4 https://bugs.webkit.org/show_bug.cgi?id=154867 5 6 Reviewed by Eric Carlson and Jer Noble. 7 8 The output SDP from createOffer() is processed by verifying all variable 9 identifiers, such as session and user id, and replacing them with 10 predefined values to make the SDP comparable with an expected result. 11 12 The test is currently skipped on the mac port until support to read the 13 SDPProcessor JavaScript resource is added. 14 15 * fast/mediastream/RTCPeerConnection-inspect-offer-expected.txt: Added. 16 * fast/mediastream/RTCPeerConnection-inspect-offer.html: Added. 17 * platform/mac/TestExpectations: 18 1 19 2016-03-07 Ryan Haddad <ryanhaddad@apple.com> 2 20 -
trunk/LayoutTests/platform/mac/TestExpectations
r197696 r197702 179 179 fast/mediastream/RTCPeerConnection-stable.html 180 180 fast/mediastream/RTCPeerConnection.html 181 fast/mediastream/RTCPeerConnection-inspect-offer.html 181 182 182 183 # Asserts in debug. -
trunk/Source/WebCore/CMakeLists.txt
r197628 r197702 941 941 Modules/mediastream/RTCStatsResponse.cpp 942 942 Modules/mediastream/RTCTrackEvent.cpp 943 Modules/mediastream/SDPProcessor.cpp 943 944 Modules/mediastream/SourceInfo.cpp 944 945 Modules/mediastream/UserMediaController.cpp … … 2298 2299 platform/mock/GeolocationClientMock.cpp 2299 2300 platform/mock/MediaConstraintsMock.cpp 2301 platform/mock/MockMediaEndpoint.cpp 2300 2302 platform/mock/MockRealtimeAudioSource.cpp 2301 2303 platform/mock/MockRealtimeMediaSource.cpp … … 3584 3586 endif () 3585 3587 3588 if (WebCore_SDP_PROCESSOR_SCRIPTS) 3589 # Necessary variables: 3590 # WebCore_SDP_PROCESSOR_SCRIPTS containing the JavaScript sources list 3591 # WebCore_SDP_PROCESSOR_SCRIPTS_DEPENDENCIES containing the source file that will load the scripts to add the proper 3592 # dependency and having them built at the right moment 3593 3594 add_custom_command( 3595 OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScriptsData.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScripts.h 3596 MAIN_DEPENDENCY ${WEBCORE_DIR}/Scripts/make-js-file-arrays.py 3597 DEPENDS ${WebCore_SDP_PROCESSOR_SCRIPTS} 3598 COMMAND "PYTHONPATH=${JavaScriptCore_SCRIPTS_DIR}" ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/Scripts/make-js-file-arrays.py ${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScripts.h ${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScriptsData.cpp ${WebCore_SDP_PROCESSOR_SCRIPTS} 3599 VERBATIM) 3600 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/SDPProcessorScriptsData.cpp) 3601 ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WebCore_SDP_PROCESSOR_SCRIPTS_DEPENDENCIES} SDPProcessorScriptsData.cpp SDPProcessorScripts.h) 3602 endif () 3603 3586 3604 # Generate plug-in resources 3587 3605 add_custom_command( -
trunk/Source/WebCore/ChangeLog
r197697 r197702 1 2016-03-07 Adam Bergkvist <adam.bergkvist@ericsson.com> 2 3 WebRTC: Implement MediaEndpointPeerConnection::createOffer() 4 https://bugs.webkit.org/show_bug.cgi?id=154867 5 6 Reviewed by Eric Carlson and Jer Noble. 7 8 - MediaEndpointPeerConnection: Initial implementation of createOffer() 9 added. createOffer() is split up into a synchronous part, and a 10 scheduled task. The task will be deferred until information, requiring 11 some amount of work, such as the DTLS fingerprint is available. Other 12 async API functions will also follow this pattern. 13 14 - SDPProcessor (added): The SDPProcessors parses SDP to a 15 MediaEndpointSessionConfiguration object and generates SDP in the 16 reverse direction. Any SDP string handling is confined to the 17 SDPProcessor and all configuration of the media session is done via the 18 MediaEndpointSessionConfiguration object. 19 20 The SDP parser and generator logic is implemented in JavaScript and 21 works with JSON (SDP->JSON, JSON->SDP). The SDPProcessor runs JS in an 22 isolated scope and converts JSON to a MediaEndpointSessionConfiguration 23 object and the reverse. Using JSON signaling (nonstandard) can be 24 helpful during debugging. 25 26 - MockMediaEndpoint (added): Mock MediaEndpoint implementation with 27 support for generating offers. DTLS information, such as fingerprint, 28 is hard coded to facilitate testing with expected values. 29 30 Test: fast/mediastream/RTCPeerConnection-inspect-offer.html 31 32 The test is currently skipped on the mac port until support to read the 33 SDPProcessor JavaScript resource is added. 34 35 * CMakeLists.txt: 36 * Modules/mediastream/MediaEndpointPeerConnection.cpp: 37 (WebCore::WrappedSessionDescriptionPromise::create): 38 (WebCore::WrappedSessionDescriptionPromise::promise): 39 (WebCore::WrappedSessionDescriptionPromise::WrappedSessionDescriptionPromise): 40 (WebCore::randomString): 41 (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): 42 (WebCore::MediaEndpointPeerConnection::runTask): 43 (WebCore::MediaEndpointPeerConnection::startRunningTasks): 44 (WebCore::MediaEndpointPeerConnection::createOffer): 45 (WebCore::MediaEndpointPeerConnection::createOfferTask): 46 (WebCore::MediaEndpointPeerConnection::gotDtlsFingerprint): 47 * Modules/mediastream/MediaEndpointPeerConnection.h: 48 * Modules/mediastream/SDPProcessor.cpp: Added. 49 (WebCore::SDPProcessor::SDPProcessor): 50 (WebCore::createCandidateObject): 51 (WebCore::createCandidate): 52 (WebCore::configurationFromJSON): 53 (WebCore::iceCandidateFromJSON): 54 (WebCore::configurationToJSON): 55 (WebCore::iceCandidateToJSON): 56 (WebCore::SDPProcessor::generate): 57 (WebCore::SDPProcessor::parse): 58 (WebCore::SDPProcessor::generateCandidateLine): 59 (WebCore::SDPProcessor::parseCandidateLine): 60 (WebCore::SDPProcessor::callScript): 61 * Modules/mediastream/SDPProcessor.h: Added. 62 * Modules/mediastream/sdp.js: Added. 63 (match): 64 (addDefaults): 65 (fillTemplate): 66 (SDP.parse): 67 (SDP.generate): 68 (SDP.generateCandidateLine): 69 (hasAllProperties): 70 (SDP.verifyObject): 71 (generate): 72 (parse): 73 (generateCandidateLine): 74 (parseCandidateLine): 75 * PlatformGTK.cmake: 76 * WebCore.xcodeproj/project.pbxproj: 77 * platform/mediastream/MediaEndpoint.cpp: 78 (WebCore::createMediaEndpoint): 79 * platform/mediastream/MediaEndpoint.h: 80 * platform/mediastream/PeerMediaDescription.h: 81 * platform/mediastream/SDPProcessorScriptResource.cpp: Added. 82 (WebCore::SDPProcessorScriptResource::scriptString): 83 * platform/mediastream/SDPProcessorScriptResource.h: Added. 84 * platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp: Added. 85 (WebCore::SDPProcessorScriptResource::scriptString): 86 * platform/mock/MockMediaEndpoint.cpp: Added. 87 (WebCore::MockMediaEndpoint::create): 88 (WebCore::MockMediaEndpoint::MockMediaEndpoint): 89 (WebCore::MockMediaEndpoint::~MockMediaEndpoint): 90 (WebCore::MockMediaEndpoint::setConfiguration): 91 (WebCore::MockMediaEndpoint::generateDtlsInfo): 92 (WebCore::MockMediaEndpoint::getDefaultAudioPayloads): 93 (WebCore::MockMediaEndpoint::getDefaultVideoPayloads): 94 (WebCore::MockMediaEndpoint::updateReceiveConfiguration): 95 (WebCore::MockMediaEndpoint::updateSendConfiguration): 96 (WebCore::MockMediaEndpoint::addRemoteCandidate): 97 (WebCore::MockMediaEndpoint::replaceSendSource): 98 (WebCore::MockMediaEndpoint::stop): 99 * platform/mock/MockMediaEndpoint.h: Added. 100 * testing/Internals.cpp: 101 (WebCore::Internals::Internals): 102 (WebCore::Internals::enableMockMediaEndpoint): 103 * testing/Internals.h: 104 1 105 2016-03-07 Daniel Bates <dabates@apple.com> 2 106 -
trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
r197053 r197702 36 36 #include "DOMError.h" 37 37 #include "JSDOMError.h" 38 #include "JSRTCSessionDescription.h" 39 #include "MediaEndpointSessionConfiguration.h" 40 #include "MediaStreamTrack.h" 41 #include "RTCOfferAnswerOptions.h" 42 #include "RTCRtpSender.h" 43 #include "SDPProcessor.h" 38 44 #include <wtf/MainThread.h> 45 #include <wtf/text/Base64.h> 39 46 40 47 namespace WebCore { … … 49 56 CreatePeerConnectionBackend PeerConnectionBackend::create = createMediaEndpointPeerConnection; 50 57 58 class WrappedSessionDescriptionPromise : public RefCounted<WrappedSessionDescriptionPromise> { 59 public: 60 static Ref<WrappedSessionDescriptionPromise> create(SessionDescriptionPromise&& promise) 61 { 62 return *adoptRef(new WrappedSessionDescriptionPromise(WTFMove(promise))); 63 } 64 65 SessionDescriptionPromise& promise() { return m_promise; } 66 67 private: 68 WrappedSessionDescriptionPromise(SessionDescriptionPromise&& promise) 69 : m_promise(WTFMove(promise)) 70 { } 71 72 SessionDescriptionPromise m_promise; 73 }; 74 75 static String randomString(size_t length) 76 { 77 const size_t size = ceil(length * 3 / 4); 78 unsigned char randomValues[size]; 79 cryptographicallyRandomValues(randomValues, size); 80 return base64Encode(randomValues, size); 81 } 82 51 83 MediaEndpointPeerConnection::MediaEndpointPeerConnection(PeerConnectionBackendClient* client) 52 { 53 UNUSED_PARAM(client); 84 : m_client(client) 85 , m_sdpProcessor(std::unique_ptr<SDPProcessor>(new SDPProcessor(m_client->scriptExecutionContext()))) 86 , m_cname(randomString(16)) 87 , m_iceUfrag(randomString(4)) 88 , m_icePassword(randomString(22)) 89 { 90 m_mediaEndpoint = MediaEndpoint::create(*this); 91 ASSERT(m_mediaEndpoint); 92 93 m_defaultAudioPayloads = m_mediaEndpoint->getDefaultAudioPayloads(); 94 m_defaultVideoPayloads = m_mediaEndpoint->getDefaultVideoPayloads(); 95 96 // Tasks (see runTask()) will be deferred until we get the DTLS fingerprint. 97 m_mediaEndpoint->generateDtlsInfo(); 98 } 99 100 void MediaEndpointPeerConnection::runTask(std::function<void()> task) 101 { 102 if (m_dtlsFingerprint.isNull()) { 103 // Only one task needs to be deferred since it will hold off any others until completed. 104 ASSERT(!m_initialDeferredTask); 105 m_initialDeferredTask = task; 106 } else 107 callOnMainThread(task); 108 } 109 110 void MediaEndpointPeerConnection::startRunningTasks() 111 { 112 if (!m_initialDeferredTask) 113 return; 114 115 m_initialDeferredTask(); 116 m_initialDeferredTask = nullptr; 54 117 } 55 118 56 119 void MediaEndpointPeerConnection::createOffer(RTCOfferOptions& options, SessionDescriptionPromise&& promise) 57 120 { 58 UNUSED_PARAM(options); 59 60 notImplemented(); 61 62 promise.reject(DOMError::create("NotSupportedError")); 121 const RefPtr<RTCOfferOptions> protectedOptions = &options; 122 RefPtr<WrappedSessionDescriptionPromise> wrappedPromise = WrappedSessionDescriptionPromise::create(WTFMove(promise)); 123 124 runTask([this, protectedOptions, wrappedPromise]() { 125 createOfferTask(*protectedOptions, wrappedPromise->promise()); 126 }); 127 } 128 129 void MediaEndpointPeerConnection::createOfferTask(RTCOfferOptions&, SessionDescriptionPromise& promise) 130 { 131 ASSERT(!m_dtlsFingerprint.isEmpty()); 132 133 RefPtr<MediaEndpointSessionConfiguration> configurationSnapshot = MediaEndpointSessionConfiguration::create(); 134 135 configurationSnapshot->setSessionVersion(m_sdpSessionVersion++); 136 137 RtpSenderVector senders = m_client->getSenders(); 138 139 // Add media descriptions for senders. 140 for (auto& sender : senders) { 141 RefPtr<PeerMediaDescription> mediaDescription = PeerMediaDescription::create(); 142 MediaStreamTrack* track = sender->track(); 143 144 mediaDescription->setMediaStreamId(sender->mediaStreamIds()[0]); 145 mediaDescription->setMediaStreamTrackId(track->id()); 146 mediaDescription->setType(track->kind()); 147 mediaDescription->setPayloads(track->kind() == "audio" ? m_defaultAudioPayloads : m_defaultVideoPayloads); 148 mediaDescription->setDtlsFingerprintHashFunction(m_dtlsFingerprintFunction); 149 mediaDescription->setDtlsFingerprint(m_dtlsFingerprint); 150 mediaDescription->setCname(m_cname); 151 mediaDescription->addSsrc(cryptographicallyRandomNumber()); 152 mediaDescription->setIceUfrag(m_iceUfrag); 153 mediaDescription->setIcePassword(m_icePassword); 154 155 configurationSnapshot->addMediaDescription(WTFMove(mediaDescription)); 156 } 157 158 String sdpString; 159 SDPProcessor::Result result = m_sdpProcessor->generate(*configurationSnapshot, sdpString); 160 if (result != SDPProcessor::Result::Success) { 161 LOG_ERROR("SDPProcessor internal error"); 162 return; 163 } 164 165 promise.resolve(RTCSessionDescription::create("offer", sdpString)); 63 166 } 64 167 … … 180 283 ASSERT(isMainThread()); 181 284 182 UNUSED_PARAM(fingerprint);183 UNUSED_PARAM(fingerprintFunction);184 185 notImplemented();285 m_dtlsFingerprint = fingerprint; 286 m_dtlsFingerprintFunction = fingerprintFunction; 287 288 startRunningTasks(); 186 289 } 187 290 -
trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h
r197563 r197702 43 43 44 44 class MediaStreamTrack; 45 class SDPProcessor; 46 47 typedef Vector<RefPtr<RTCRtpSender>> RtpSenderVector; 45 48 46 49 class MediaEndpointPeerConnection : public PeerConnectionBackend, public MediaEndpointClient { … … 75 78 76 79 private: 80 void runTask(std::function<void()>); 81 void startRunningTasks(); 82 83 void createOfferTask(RTCOfferOptions&, PeerConnection::SessionDescriptionPromise&); 84 77 85 // MediaEndpointClient 78 86 void gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction) override; … … 80 88 void doneGatheringCandidates(unsigned mdescIndex) override; 81 89 void gotRemoteSource(unsigned mdescIndex, RefPtr<RealtimeMediaSource>&&) override; 90 91 PeerConnectionBackendClient* m_client; 92 std::unique_ptr<MediaEndpoint> m_mediaEndpoint; 93 94 std::function<void()> m_initialDeferredTask; 95 96 std::unique_ptr<SDPProcessor> m_sdpProcessor; 97 98 Vector<RefPtr<MediaPayload>> m_defaultAudioPayloads; 99 Vector<RefPtr<MediaPayload>> m_defaultVideoPayloads; 100 101 String m_cname; 102 String m_iceUfrag; 103 String m_icePassword; 104 String m_dtlsFingerprint; 105 String m_dtlsFingerprintFunction; 106 unsigned m_sdpSessionVersion { 0 }; 82 107 }; 83 108 -
trunk/Source/WebCore/Modules/mediastream/SDPProcessor.h
r197701 r197702 29 29 */ 30 30 31 #include "config.h" 31 #ifndef SDPProcessor_h 32 #define SDPProcessor_h 32 33 33 34 #if ENABLE(MEDIA_STREAM) 34 #include "MediaEndpoint.h" 35 36 #include "ContextDestructionObserver.h" 37 #include "IceCandidate.h" 38 #include "MediaEndpointSessionConfiguration.h" 39 #include <wtf/RefPtr.h> 40 #include <wtf/text/WTFString.h> 35 41 36 42 namespace WebCore { 37 43 38 static std::unique_ptr<MediaEndpoint> createMediaEndpoint(MediaEndpointClient*) 39 { 40 return nullptr; 41 } 44 class DOMWrapperWorld; 45 class ScriptExecutionContext; 42 46 43 CreateMediaEndpoint MediaEndpoint::create = createMediaEndpoint; 47 class SDPProcessor : public ContextDestructionObserver { 48 public: 49 enum class Result { 50 Success = 1, 51 InternalError = 2, 52 ParseError = 3 53 }; 54 55 SDPProcessor(ScriptExecutionContext*); 56 57 Result generate(const MediaEndpointSessionConfiguration&, String& outSdpString) const; 58 Result parse(const String& sdp, RefPtr<MediaEndpointSessionConfiguration>&) const; 59 60 Result generateCandidateLine(const IceCandidate&, String& outCandidateLine) const; 61 Result parseCandidateLine(const String& candidateLine, RefPtr<IceCandidate>&) const; 62 63 private: 64 bool callScript(const String& functionName, const String& argument, String& outResult) const; 65 66 mutable RefPtr<DOMWrapperWorld> m_isolatedWorld; 67 }; 44 68 45 69 } // namespace WebCore 46 70 47 71 #endif // ENABLE(MEDIA_STREAM) 72 73 #endif // SDPProcessor_h -
trunk/Source/WebCore/PlatformGTK.cmake
r197623 r197702 45 45 "${WEBCORE_DIR}/platform/graphics/wayland" 46 46 "${WEBCORE_DIR}/platform/graphics/x11" 47 "${WEBCORE_DIR}/platform/mediastream/gtk" 47 48 "${WEBCORE_DIR}/platform/mock/mediasource" 48 49 "${WEBCORE_DIR}/platform/network/gtk" … … 155 156 platform/image-decoders/cairo/ImageDecoderCairo.cpp 156 157 158 platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp 159 157 160 platform/network/gtk/CredentialBackingStore.cpp 158 161 … … 248 251 249 252 set(WebCore_USER_AGENT_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/gtk/RenderThemeGtk.cpp) 253 254 set(WebCore_SDP_PROCESSOR_SCRIPTS ${WEBCORE_DIR}/Modules/mediastream/sdp.js) 255 set(WebCore_SDP_PROCESSOR_SCRIPTS_DEPENDENCIES ${WEBCORE_DIR}/platform/mediastream/gtk/SDPProcessorScriptResource.cpp) 250 256 251 257 list(APPEND WebCore_LIBRARIES -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r197628 r197702 2397 2397 5E2C437B1BCF9A570001E2BC /* RTCPeerConnectionBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C43761BCF9A0B0001E2BC /* RTCPeerConnectionBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2398 2398 5E2C437C1BCF9A840001E2BC /* RTCPeerConnectionInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C43791BCF9A0B0001E2BC /* RTCPeerConnectionInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2399 5EA3D6DF1C859D7F00300BBB /* MockMediaEndpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA3D6DE1C859D5300300BBB /* MockMediaEndpoint.h */; }; 2400 5EA3D6E01C859D8400300BBB /* MockMediaEndpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA3D6DD1C859D5300300BBB /* MockMediaEndpoint.cpp */; }; 2401 5EA3D6E31C859DC100300BBB /* SDPProcessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA3D6E11C859DAA00300BBB /* SDPProcessor.cpp */; }; 2402 5EA3D6E41C859DC100300BBB /* SDPProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA3D6E21C859DAA00300BBB /* SDPProcessor.h */; }; 2403 5EA3D6E71C85A9DB00300BBB /* SDPProcessorScriptResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA3D6E51C85A9C300300BBB /* SDPProcessorScriptResource.cpp */; }; 2404 5EA3D6E81C85A9DB00300BBB /* SDPProcessorScriptResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA3D6E61C85A9C300300BBB /* SDPProcessorScriptResource.h */; }; 2399 2405 5EA725D21ACABD4700EAD17B /* MediaDevices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EA725CD1ACABCD900EAD17B /* MediaDevices.cpp */; }; 2400 2406 5EA725D31ACABD4700EAD17B /* MediaDevices.h in Headers */ = {isa = PBXBuildFile; fileRef = 5EA725CE1ACABCD900EAD17B /* MediaDevices.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 9973 9979 5E2C43781BCF9A0B0001E2BC /* RTCPeerConnectionInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCPeerConnectionInternalsBuiltins.cpp; sourceTree = "<group>"; }; 9974 9980 5E2C43791BCF9A0B0001E2BC /* RTCPeerConnectionInternalsBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionInternalsBuiltins.h; sourceTree = "<group>"; }; 9981 5EA3D6DD1C859D5300300BBB /* MockMediaEndpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockMediaEndpoint.cpp; sourceTree = "<group>"; }; 9982 5EA3D6DE1C859D5300300BBB /* MockMediaEndpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockMediaEndpoint.h; sourceTree = "<group>"; }; 9983 5EA3D6E11C859DAA00300BBB /* SDPProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SDPProcessor.cpp; sourceTree = "<group>"; }; 9984 5EA3D6E21C859DAA00300BBB /* SDPProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDPProcessor.h; sourceTree = "<group>"; }; 9985 5EA3D6E51C85A9C300300BBB /* SDPProcessorScriptResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SDPProcessorScriptResource.cpp; sourceTree = "<group>"; }; 9986 5EA3D6E61C85A9C300300BBB /* SDPProcessorScriptResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDPProcessorScriptResource.h; sourceTree = "<group>"; }; 9975 9987 5EA725CA1ACABCB500EAD17B /* NavigatorMediaDevices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorMediaDevices.cpp; sourceTree = "<group>"; }; 9976 9988 5EA725CB1ACABCB500EAD17B /* NavigatorMediaDevices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorMediaDevices.h; sourceTree = "<group>"; }; … … 15442 15454 5E2C43651BCEE3720001E2BC /* RTCTrackEvent.h */, 15443 15455 5E2C43661BCEE3720001E2BC /* RTCTrackEvent.idl */, 15456 5EA3D6E11C859DAA00300BBB /* SDPProcessor.cpp */, 15457 5EA3D6E21C859DAA00300BBB /* SDPProcessor.h */, 15444 15458 076306D417E149CF005A7C4E /* SourceInfo.cpp */, 15445 15459 076306D517E149CF005A7C4E /* SourceInfo.h */, … … 15503 15517 07221BAF17CF0AD400848E51 /* RTCStatsResponseBase.h */, 15504 15518 07221BB017CF0AD400848E51 /* RTCVoidRequest.h */, 15519 5EA3D6E51C85A9C300300BBB /* SDPProcessorScriptResource.cpp */, 15520 5EA3D6E61C85A9C300300BBB /* SDPProcessorScriptResource.h */, 15505 15521 070E81D01BF27656001FDA48 /* VideoTrackPrivateMediaStream.h */, 15506 15522 ); … … 17439 17455 077B64101B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.cpp */, 17440 17456 077B64111B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h */, 17457 5EA3D6DD1C859D5300300BBB /* MockMediaEndpoint.cpp */, 17458 5EA3D6DE1C859D5300300BBB /* MockMediaEndpoint.h */, 17441 17459 07D6A4F11BED5F8800174146 /* MockRealtimeAudioSource.cpp */, 17442 17460 07D6A4F21BED5F8800174146 /* MockRealtimeAudioSource.h */, … … 25662 25680 85DF2EED0AA387CB00AD64C5 /* DOMHTMLElement.h in Headers */, 25663 25681 85E711A70AC5D5350053270F /* DOMHTMLElementInternal.h in Headers */, 25682 5EA3D6DF1C859D7F00300BBB /* MockMediaEndpoint.h in Headers */, 25664 25683 8540756A0AD6CBF900620C57 /* DOMHTMLEmbedElement.h in Headers */, 25665 25684 855247D00AD850B80012093B /* DOMHTMLEmbedElementInternal.h in Headers */, … … 25863 25882 31C0FF4E0E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h in Headers */, 25864 25883 85C7F5E70AAFBAFB004014DD /* DOMWheelEvent.h in Headers */, 25884 5EA3D6E41C859DC100300BBB /* SDPProcessor.h in Headers */, 25865 25885 85989DD10ACC8BBD00A0BC51 /* DOMWheelEventInternal.h in Headers */, 25866 25886 1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */, … … 27336 27356 F3820893147D35F90010BC06 /* PageConsoleAgent.h in Headers */, 27337 27357 DAED203116F244480070EC0F /* PageConsoleClient.h in Headers */, 27358 5EA3D6E81C85A9DB00300BBB /* SDPProcessorScriptResource.h in Headers */, 27338 27359 A5A2AF0C1829734300DE1729 /* PageDebuggable.h in Headers */, 27339 27360 F34742DD134362F000531BC2 /* PageDebuggerAgent.h in Headers */, … … 30300 30321 BC2ED7A50C6C0F3600920BFF /* JSHTMLFrameElementCustom.cpp in Sources */, 30301 30322 BC926F800C0552470082776B /* JSHTMLFrameSetElement.cpp in Sources */, 30323 5EA3D6E31C859DC100300BBB /* SDPProcessor.cpp in Sources */, 30302 30324 BCD41ABB0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp in Sources */, 30303 30325 A80E7B140A19D606007FB8C5 /* JSHTMLHeadElement.cpp in Sources */, … … 31342 31364 5824ABA21AE81116009074B7 /* RubyElement.cpp in Sources */, 31343 31365 5824ABA61AE81384009074B7 /* RubyTextElement.cpp in Sources */, 31366 5EA3D6E71C85A9DB00300BBB /* SDPProcessorScriptResource.cpp in Sources */, 31344 31367 A79BADA1161E7F3F00C2E652 /* RuleFeature.cpp in Sources */, 31345 31368 A79BADA3161E7F3F00C2E652 /* RuleSet.cpp in Sources */, … … 31385 31408 1AF62EE614DA22A70041556C /* ScrollingCoordinatorMac.mm in Sources */, 31386 31409 93C38BFE164473C700091EB2 /* ScrollingStateFixedNode.cpp in Sources */, 31410 5EA3D6E01C859D8400300BBB /* MockMediaEndpoint.cpp in Sources */, 31387 31411 0FEA3E7C191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.cpp in Sources */, 31388 31412 0FA88EBD16A8D1BD00F99984 /* ScrollingStateFrameScrollingNodeMac.mm in Sources */, -
trunk/Source/WebCore/platform/mediastream/MediaEndpoint.cpp
r197053 r197702 36 36 namespace WebCore { 37 37 38 static std::unique_ptr<MediaEndpoint> createMediaEndpoint(MediaEndpointClient *)38 static std::unique_ptr<MediaEndpoint> createMediaEndpoint(MediaEndpointClient&) 39 39 { 40 40 return nullptr; -
trunk/Source/WebCore/platform/mediastream/MediaEndpoint.h
r197053 r197702 55 55 }; 56 56 57 typedef std::unique_ptr<MediaEndpoint> (*CreateMediaEndpoint)(MediaEndpointClient *);57 typedef std::unique_ptr<MediaEndpoint> (*CreateMediaEndpoint)(MediaEndpointClient&); 58 58 59 59 class MediaEndpoint { -
trunk/Source/WebCore/platform/mediastream/PeerMediaDescription.h
r197053 r197702 151 151 152 152 String m_type; 153 unsigned short m_port { 0};154 String m_address ;155 String m_mode ;153 unsigned short m_port { 9 }; 154 String m_address { "0.0.0.0" }; 155 String m_mode { "sendrecv" }; 156 156 157 157 Vector<RefPtr<MediaPayload>> m_payloads; 158 158 159 bool m_rtcpMux { false };159 bool m_rtcpMux { true }; 160 160 String m_rtcpAddress; 161 161 unsigned short m_rtcpPort { 0 }; … … 164 164 String m_mediaStreamTrackId; 165 165 166 String m_dtlsSetup ;166 String m_dtlsSetup { "actpass" }; 167 167 String m_dtlsFingerprintHashFunction; 168 168 String m_dtlsFingerprint; -
trunk/Source/WebCore/platform/mediastream/SDPProcessorScriptResource.cpp
r197701 r197702 32 32 33 33 #if ENABLE(MEDIA_STREAM) 34 #include " MediaEndpoint.h"34 #include "SDPProcessorScriptResource.h" 35 35 36 36 namespace WebCore { 37 37 38 static std::unique_ptr<MediaEndpoint> createMediaEndpoint(MediaEndpointClient*) 38 namespace SDPProcessorScriptResource { 39 40 const String& scriptString() 39 41 { 40 return nullptr;42 return emptyString(); 41 43 } 42 44 43 CreateMediaEndpoint MediaEndpoint::create = createMediaEndpoint; 45 } // namespace SDPProcessorScriptResource 44 46 45 47 } // namespace WebCore -
trunk/Source/WebCore/platform/mediastream/SDPProcessorScriptResource.h
r197701 r197702 29 29 */ 30 30 31 #include "config.h" 31 #ifndef SDPProcessorScriptResource_h 32 #define SDPProcessorScriptResource_h 32 33 33 34 #if ENABLE(MEDIA_STREAM) 34 #include "MediaEndpoint.h" 35 36 #include <wtf/text/WTFString.h> 35 37 36 38 namespace WebCore { 37 39 38 static std::unique_ptr<MediaEndpoint> createMediaEndpoint(MediaEndpointClient*) 39 { 40 return nullptr; 41 } 40 namespace SDPProcessorScriptResource { 42 41 43 CreateMediaEndpoint MediaEndpoint::create = createMediaEndpoint; 42 const String& scriptString(); 43 44 } // namespace SDPProcessorScriptResource 44 45 45 46 } // namespace WebCore 46 47 47 48 #endif // ENABLE(MEDIA_STREAM) 49 50 #endif // SDPProcessorScriptResource_h -
trunk/Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp
r197701 r197702 32 32 33 33 #if ENABLE(MEDIA_STREAM) 34 #include "MediaEndpoint.h" 34 #include "SDPProcessorScriptResource.h" 35 36 #include "SDPProcessorScripts.h" 37 #include <wtf/NeverDestroyed.h> 35 38 36 39 namespace WebCore { 37 40 38 static std::unique_ptr<MediaEndpoint> createMediaEndpoint(MediaEndpointClient*) 41 namespace SDPProcessorScriptResource { 42 43 const String& scriptString() 39 44 { 40 return nullptr; 45 static NeverDestroyed<const String> script = String(sdpJavaScript); 46 return script; 41 47 } 42 48 43 CreateMediaEndpoint MediaEndpoint::create = createMediaEndpoint; 49 } // namespace SDPProcessorScriptResource 44 50 45 51 } // namespace WebCore -
trunk/Source/WebCore/platform/mock/MockMediaEndpoint.h
r197701 r197702 29 29 */ 30 30 31 #include "config.h" 31 #ifndef MockMediaEndpoint_h 32 #define MockMediaEndpoint_h 32 33 33 34 #if ENABLE(MEDIA_STREAM) 35 34 36 #include "MediaEndpoint.h" 35 37 36 38 namespace WebCore { 37 39 38 static std::unique_ptr<MediaEndpoint> createMediaEndpoint(MediaEndpointClient*) 39 { 40 return nullptr; 41 } 40 class MockMediaEndpoint : public MediaEndpoint { 41 public: 42 WEBCORE_EXPORT static std::unique_ptr<MediaEndpoint> create(MediaEndpointClient&); 42 43 43 CreateMediaEndpoint MediaEndpoint::create = createMediaEndpoint; 44 MockMediaEndpoint(MediaEndpointClient&); 45 ~MockMediaEndpoint(); 46 47 void setConfiguration(RefPtr<MediaEndpointConfiguration>&&) override; 48 49 void generateDtlsInfo() override; 50 Vector<RefPtr<MediaPayload>> getDefaultAudioPayloads() override; 51 Vector<RefPtr<MediaPayload>> getDefaultVideoPayloads() override; 52 53 UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) override; 54 UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) override; 55 56 void addRemoteCandidate(IceCandidate&, unsigned mdescIndex, const String& ufrag, const String& password) override; 57 58 void replaceSendSource(RealtimeMediaSource&, unsigned mdescIndex) override; 59 60 void stop() override; 61 62 private: 63 MediaEndpointClient& m_client; 64 }; 44 65 45 66 } // namespace WebCore 46 67 47 68 #endif // ENABLE(MEDIA_STREAM) 69 70 #endif // MockMediaEndpoint_h -
trunk/Source/WebCore/testing/Internals.cpp
r197626 r197702 177 177 178 178 #if ENABLE(MEDIA_STREAM) 179 #include "MockMediaEndpoint.h" 179 180 #include "MockRealtimeMediaSourceCenter.h" 180 181 #include "RTCPeerConnection.h" … … 417 418 #if ENABLE(MEDIA_STREAM) 418 419 setMockMediaCaptureDevicesEnabled(true); 420 enableMockMediaEndpoint(); 419 421 enableMockRTCPeerConnectionHandler(); 420 422 #endif … … 1017 1019 1018 1020 #if ENABLE(MEDIA_STREAM) 1021 void Internals::enableMockMediaEndpoint() 1022 { 1023 MediaEndpoint::create = MockMediaEndpoint::create; 1024 } 1025 1019 1026 void Internals::enableMockRTCPeerConnectionHandler() 1020 1027 { -
trunk/Source/WebCore/testing/Internals.h
r197626 r197702 371 371 372 372 #if ENABLE(MEDIA_STREAM) 373 void enableMockMediaEndpoint(); 373 374 void enableMockRTCPeerConnectionHandler(); 374 375 void setMockMediaCaptureDevicesEnabled(bool);
Note: See TracChangeset
for help on using the changeset viewer.