Title: [110943] trunk/Source/WebCore
Revision
110943
Author
[email protected]
Date
2012-03-15 21:19:05 -0700 (Thu, 15 Mar 2012)

Log Message

MediaStream API (JSEP): Introducing SessionDescription
https://bugs.webkit.org/show_bug.cgi?id=81206

Reviewed by Adam Barth.

Patch #3 in a series of patches to change the PeerConnection from ROAP to JSEP,
see bug 80589 for more information.
Adding the SessionDescription JS object and its platform counterpart SessionDescriptionDescriptor.

Not possible to test until the entire JSEP feature is commited.

* GNUmakefile.list.am:
* Modules/mediastream/SessionDescription.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
(WebCore):
(WebCore::SessionDescription::create):
(WebCore::SessionDescription::SessionDescription):
(WebCore::SessionDescription::~SessionDescription):
(WebCore::SessionDescription::addCandidate):
(WebCore::SessionDescription::toSdp):
(WebCore::SessionDescription::descriptor):
* Modules/mediastream/SessionDescription.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
(WebCore):
(SessionDescription):
* Modules/mediastream/SessionDescription.idl: Added.
* WebCore.gypi:
* platform/mediastream/MediaStreamCenter.cpp:
(WebCore::MediaStreamCenter::constructSdp):
(WebCore):
* platform/mediastream/MediaStreamCenter.h:
(WebCore):
(MediaStreamCenter):
* platform/mediastream/SessionDescriptionDescriptor.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
(WebCore):
(WebCore::SessionDescriptionDescriptor::create):
(WebCore::SessionDescriptionDescriptor::SessionDescriptionDescriptor):
(WebCore::SessionDescriptionDescriptor::~SessionDescriptionDescriptor):
(WebCore::SessionDescriptionDescriptor::addCandidate):
(WebCore::SessionDescriptionDescriptor::toSdp):
(WebCore::SessionDescriptionDescriptor::numberOfAddedCandidates):
(WebCore::SessionDescriptionDescriptor::candidate):
(WebCore::SessionDescriptionDescriptor::initialSdp):
* platform/mediastream/SessionDescriptionDescriptor.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
(WebCore):
(SessionDescriptionDescriptor):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (110942 => 110943)


--- trunk/Source/WebCore/ChangeLog	2012-03-16 04:13:56 UTC (rev 110942)
+++ trunk/Source/WebCore/ChangeLog	2012-03-16 04:19:05 UTC (rev 110943)
@@ -1,3 +1,50 @@
+2012-03-15  Tommy Widenflycht  <[email protected]>
+
+        MediaStream API (JSEP): Introducing SessionDescription
+        https://bugs.webkit.org/show_bug.cgi?id=81206
+
+        Reviewed by Adam Barth.
+
+        Patch #3 in a series of patches to change the PeerConnection from ROAP to JSEP,
+        see bug 80589 for more information.
+        Adding the SessionDescription JS object and its platform counterpart SessionDescriptionDescriptor.
+
+        Not possible to test until the entire JSEP feature is commited.
+
+        * GNUmakefile.list.am:
+        * Modules/mediastream/SessionDescription.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
+        (WebCore):
+        (WebCore::SessionDescription::create):
+        (WebCore::SessionDescription::SessionDescription):
+        (WebCore::SessionDescription::~SessionDescription):
+        (WebCore::SessionDescription::addCandidate):
+        (WebCore::SessionDescription::toSdp):
+        (WebCore::SessionDescription::descriptor):
+        * Modules/mediastream/SessionDescription.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
+        (WebCore):
+        (SessionDescription):
+        * Modules/mediastream/SessionDescription.idl: Added.
+        * WebCore.gypi:
+        * platform/mediastream/MediaStreamCenter.cpp:
+        (WebCore::MediaStreamCenter::constructSdp):
+        (WebCore):
+        * platform/mediastream/MediaStreamCenter.h:
+        (WebCore):
+        (MediaStreamCenter):
+        * platform/mediastream/SessionDescriptionDescriptor.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
+        (WebCore):
+        (WebCore::SessionDescriptionDescriptor::create):
+        (WebCore::SessionDescriptionDescriptor::SessionDescriptionDescriptor):
+        (WebCore::SessionDescriptionDescriptor::~SessionDescriptionDescriptor):
+        (WebCore::SessionDescriptionDescriptor::addCandidate):
+        (WebCore::SessionDescriptionDescriptor::toSdp):
+        (WebCore::SessionDescriptionDescriptor::numberOfAddedCandidates):
+        (WebCore::SessionDescriptionDescriptor::candidate):
+        (WebCore::SessionDescriptionDescriptor::initialSdp):
+        * platform/mediastream/SessionDescriptionDescriptor.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
+        (WebCore):
+        (SessionDescriptionDescriptor):
+
 2012-03-15  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r110929.

Modified: trunk/Source/WebCore/GNUmakefile.list.am (110942 => 110943)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-03-16 04:13:56 UTC (rev 110942)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-03-16 04:19:05 UTC (rev 110943)
@@ -468,6 +468,8 @@
 	DerivedSources/WebCore/JSScriptProfile.h \
 	DerivedSources/WebCore/JSScriptProfileNode.cpp \
 	DerivedSources/WebCore/JSScriptProfileNode.h \
+	DerivedSources/WebCore/JSSessionDescription.cpp \
+	DerivedSources/WebCore/JSSessionDescription.h \
 	DerivedSources/WebCore/JSShadowRoot.cpp \
 	DerivedSources/WebCore/JSShadowRoot.h \
 	DerivedSources/WebCore/JSSharedWorkerContext.cpp \
@@ -673,6 +675,7 @@
 	$(WebCore)/Modules/mediastream/NavigatorUserMediaError.idl \
 	$(WebCore)/Modules/mediastream/NavigatorUserMediaErrorCallback.idl \
 	$(WebCore)/Modules/mediastream/NavigatorUserMediaSuccessCallback.idl \
+	$(WebCore)/Modules/mediastream/SessionDescription.idl \
 	$(WebCore)/Modules/mediastream/SignalingCallback.idl \
 	$(WebCore)/css/CSSCharsetRule.idl \
 	$(WebCore)/css/CSSFontFaceRule.idl \
@@ -1057,6 +1060,8 @@
 	Source/WebCore/Modules/mediastream/NavigatorUserMediaError.h \
 	Source/WebCore/Modules/mediastream/NavigatorUserMediaErrorCallback.h \
 	Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.h \
+	Source/WebCore/Modules/mediastream/SessionDescription.cpp \
+	Source/WebCore/Modules/mediastream/SessionDescription.h \
 	Source/WebCore/Modules/mediastream/SignalingCallback.h \
 	Source/WebCore/Modules/mediastream/UserMediaClient.h \
 	Source/WebCore/Modules/mediastream/UserMediaController.h \
@@ -3339,6 +3344,8 @@
 	Source/WebCore/platform/mediastream/MediaStreamComponent.h \
 	Source/WebCore/platform/mediastream/MediaStreamDescriptor.h \
 	Source/WebCore/platform/mediastream/MediaStreamSource.h \
+	Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.cpp \
+	Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.h \
 	Source/WebCore/platform/mediastream/gstreamer/DeprecatedPeerConnectionHandler.cpp \
 	Source/WebCore/platform/mock/DeviceOrientationClientMock.cpp \
 	Source/WebCore/platform/mock/DeviceOrientationClientMock.h \

Copied: trunk/Source/WebCore/Modules/mediastream/SessionDescription.cpp (from rev 110942, trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp) (0 => 110943)


--- trunk/Source/WebCore/Modules/mediastream/SessionDescription.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/SessionDescription.cpp	2012-03-16 04:19:05 UTC (rev 110943)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2012 Google 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 Google Inc. 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)
+
+#include "SessionDescription.h"
+
+#include "IceCandidate.h"
+#include "IceCandidateDescriptor.h"
+#include "MediaStreamCenter.h"
+#include "SessionDescriptionDescriptor.h"
+
+namespace WebCore {
+
+PassRefPtr<SessionDescription> SessionDescription::create(const String& sdp)
+{
+    return adoptRef(new SessionDescription(SessionDescriptionDescriptor::create(sdp)));
+}
+
+PassRefPtr<SessionDescription> SessionDescription::create(PassRefPtr<SessionDescriptionDescriptor> descriptor)
+{
+    return adoptRef(new SessionDescription(descriptor));
+}
+
+SessionDescription::SessionDescription(PassRefPtr<SessionDescriptionDescriptor> descriptor)
+    : m_descriptor(descriptor)
+{
+}
+
+SessionDescription::~SessionDescription()
+{
+}
+
+void SessionDescription::addCandidate(PassRefPtr<IceCandidate> candidate)
+{
+    m_descriptor->addCandidate(candidate->descriptor());
+}
+
+String SessionDescription::toSdp()
+{
+    return m_descriptor->toSdp();
+}
+
+SessionDescriptionDescriptor* SessionDescription::descriptor()
+{
+    return m_descriptor.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)

Copied: trunk/Source/WebCore/Modules/mediastream/SessionDescription.h (from rev 110942, trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp) (0 => 110943)


--- trunk/Source/WebCore/Modules/mediastream/SessionDescription.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/SessionDescription.h	2012-03-16 04:19:05 UTC (rev 110943)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2012 Google 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 Google Inc. 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 SessionDescription_h
+#define SessionDescription_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class IceCandidate;
+class SessionDescriptionDescriptor;
+
+class SessionDescription : public RefCounted<SessionDescription> {
+public:
+    static PassRefPtr<SessionDescription> create(const String& sdp);
+    static PassRefPtr<SessionDescription> create(PassRefPtr<SessionDescriptionDescriptor>);
+    virtual ~SessionDescription();
+
+    void addCandidate(PassRefPtr<IceCandidate>);
+    String toSdp();
+
+    SessionDescriptionDescriptor* descriptor();
+
+private:
+    SessionDescription(PassRefPtr<SessionDescriptionDescriptor>);
+
+    RefPtr<SessionDescriptionDescriptor> m_descriptor;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // SessionDescription_h

Added: trunk/Source/WebCore/Modules/mediastream/SessionDescription.idl (0 => 110943)


--- trunk/Source/WebCore/Modules/mediastream/SessionDescription.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/SessionDescription.idl	2012-03-16 04:19:05 UTC (rev 110943)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2012 Google 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 Google Inc. 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.
+ */
+
+module p2p {
+
+    interface [
+        Conditional=MEDIA_STREAM,
+        Constructor(in DOMString sdp)
+    ] SessionDescription {
+        // adds the specified candidate to the description
+        void addCandidate(in IceCandidate candidate);
+
+        // serializes the description to SDP
+        DOMString toSdp();
+    };
+
+}

Modified: trunk/Source/WebCore/WebCore.gypi (110942 => 110943)


--- trunk/Source/WebCore/WebCore.gypi	2012-03-16 04:13:56 UTC (rev 110942)
+++ trunk/Source/WebCore/WebCore.gypi	2012-03-16 04:19:05 UTC (rev 110943)
@@ -429,6 +429,8 @@
             'platform/mediastream/MediaStreamComponent.h',
             'platform/mediastream/MediaStreamDescriptor.h',
             'platform/mediastream/MediaStreamSource.h',
+            'platform/mediastream/SessionDescriptionDescriptor.cpp',
+            'platform/mediastream/SessionDescriptionDescriptor.h',
             'platform/mock/DeviceOrientationClientMock.h',
             'platform/mock/GeolocationClientMock.h',
             'platform/network/AuthenticationChallengeBase.h',
@@ -769,6 +771,7 @@
             'Modules/mediastream/NavigatorUserMediaError.idl',
             'Modules/mediastream/NavigatorUserMediaErrorCallback.idl',
             'Modules/mediastream/NavigatorUserMediaSuccessCallback.idl',
+            'Modules/mediastream/SessionDescription.idl',
             'Modules/mediastream/SignalingCallback.idl',
             'Modules/speech/DOMWindowSpeech.idl',
             'Modules/speech/SpeechGrammar.idl',
@@ -1413,6 +1416,8 @@
             'Modules/mediastream/NavigatorUserMediaError.h',
             'Modules/mediastream/NavigatorUserMediaErrorCallback.h',
             'Modules/mediastream/NavigatorUserMediaSuccessCallback.h',
+            'Modules/mediastream/SessionDescription.cpp',
+            'Modules/mediastream/SessionDescription.h',
             'Modules/mediastream/SignalingCallback.h',
             'Modules/mediastream/UserMediaClient.h',
             'Modules/mediastream/UserMediaController.cpp',

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp (110942 => 110943)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp	2012-03-16 04:13:56 UTC (rev 110942)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp	2012-03-16 04:19:05 UTC (rev 110943)
@@ -34,8 +34,10 @@
 
 #include "MediaStreamCenter.h"
 
+#include "IceCandidateDescriptor.h"
 #include "MainThread.h"
 #include "MediaStreamDescriptor.h"
+#include "SessionDescriptionDescriptor.h"
 
 namespace WebCore {
 
@@ -60,6 +62,11 @@
     return "";
 }
 
+String MediaStreamCenter::constructSdp(SessionDescriptionDescriptor*)
+{
+    return "";
+}
+
 #if !PLATFORM(CHROMIUM)
 
 // Empty implementations for ports that build with MEDIA_STREAM enabled by default, but haven't yet implemented MediaStreamCenter.

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.h (110942 => 110943)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.h	2012-03-16 04:13:56 UTC (rev 110942)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.h	2012-03-16 04:19:05 UTC (rev 110943)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 Ericsson AB. All rights reserved.
+ * Copyright (C) 2012 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -45,6 +46,7 @@
 class IceCandidateDescriptor;
 class MediaStreamComponent;
 class MediaStreamDescriptor;
+class SessionDescriptionDescriptor;
 
 class MediaStreamSourcesQueryClient : public RefCounted<MediaStreamSourcesQueryClient> {
 public:
@@ -76,6 +78,7 @@
     void didConstructMediaStream(MediaStreamDescriptor*);
 
     String constructSdp(IceCandidateDescriptor*);
+    String constructSdp(SessionDescriptionDescriptor*);
 
     // Calls from the platform to update the DOM objects
     void endLocalMediaStream(MediaStreamDescriptor*);

Copied: trunk/Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.cpp (from rev 110942, trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp) (0 => 110943)


--- trunk/Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.cpp	2012-03-16 04:19:05 UTC (rev 110943)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2012 Google 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 Google Inc. 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)
+
+#include "SessionDescriptionDescriptor.h"
+
+#include "IceCandidateDescriptor.h"
+#include "MediaStreamCenter.h"
+
+namespace WebCore {
+
+PassRefPtr<SessionDescriptionDescriptor> SessionDescriptionDescriptor::create(const String& sdp)
+{
+    return adoptRef(new SessionDescriptionDescriptor(sdp));
+}
+
+SessionDescriptionDescriptor::SessionDescriptionDescriptor(const String& sdp)
+    : m_initialSdp(sdp)
+{
+}
+
+SessionDescriptionDescriptor::~SessionDescriptionDescriptor()
+{
+}
+
+void SessionDescriptionDescriptor::addCandidate(PassRefPtr<IceCandidateDescriptor> candidate)
+{
+    m_candidates.append(candidate);
+}
+
+String SessionDescriptionDescriptor::toSdp()
+{
+    return MediaStreamCenter::instance().constructSdp(this);
+}
+
+size_t SessionDescriptionDescriptor::numberOfAddedCandidates() const
+{
+    return m_candidates.size();
+}
+
+IceCandidateDescriptor* SessionDescriptionDescriptor::candidate(size_t index) const
+{
+    return m_candidates[index].get();
+}
+
+const String& SessionDescriptionDescriptor::initialSdp()
+{
+    return m_initialSdp;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)

Copied: trunk/Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.h (from rev 110942, trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp) (0 => 110943)


--- trunk/Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.h	2012-03-16 04:19:05 UTC (rev 110943)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2012 Google 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 Google Inc. 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 SessionDescriptionDescriptor_h
+#define SessionDescriptionDescriptor_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class IceCandidateDescriptor;
+
+class SessionDescriptionDescriptor : public RefCounted<SessionDescriptionDescriptor> {
+public:
+    static PassRefPtr<SessionDescriptionDescriptor> create(const String& sdp);
+    virtual ~SessionDescriptionDescriptor();
+
+    void addCandidate(PassRefPtr<IceCandidateDescriptor>);
+    String toSdp();
+
+    size_t numberOfAddedCandidates() const;
+    IceCandidateDescriptor* candidate(size_t index) const;
+    const String& initialSdp();
+
+private:
+    SessionDescriptionDescriptor(const String& sdp);
+
+    String m_initialSdp;
+    Vector<RefPtr<IceCandidateDescriptor> > m_candidates;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // SessionDescriptionDescriptor_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to