MediaStream API (JSEP): Introducing IceCandidate
authortommyw@google.com <tommyw@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2012 19:53:23 +0000 (19:53 +0000)
committertommyw@google.com <tommyw@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2012 19:53:23 +0000 (19:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80699

Reviewed by Adam Barth.

Patch #2 in a series of patches to change the PeerConnection from ROAP to JSEP,
see bug 80589 for more information.
Adding the JS object IceCandidate and its WebCore/platform sibling IceCandidateDescriptor.
This object will be created both from JS and the embedder.

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

* GNUmakefile.list.am:
* Modules/mediastream/IceCandidate.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
(WebCore):
(WebCore::IceCandidate::create):
(WebCore::IceCandidate::IceCandidate):
(WebCore::IceCandidate::~IceCandidate):
(WebCore::IceCandidate::label):
(WebCore::IceCandidate::candidateLine):
(WebCore::IceCandidate::toSdp):
(WebCore::IceCandidate::descriptor):
* Modules/mediastream/IceCandidate.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
(WebCore):
(IceCandidate):
* Modules/mediastream/IceCandidate.idl: Added.
* WebCore.gypi:
* platform/mediastream/IceCandidateDescriptor.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
(WebCore):
(WebCore::IceCandidateDescriptor::create):
(WebCore::IceCandidateDescriptor::IceCandidateDescriptor):
(WebCore::IceCandidateDescriptor::~IceCandidateDescriptor):
(WebCore::IceCandidateDescriptor::toSdp):
* platform/mediastream/IceCandidateDescriptor.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
(WebCore):
(IceCandidateDescriptor):
(WebCore::IceCandidateDescriptor::label):
(WebCore::IceCandidateDescriptor::candidateLine):
* platform/mediastream/MediaStreamCenter.cpp:
(WebCore::MediaStreamCenter::constructSdp):
(WebCore):
* platform/mediastream/MediaStreamCenter.h:
(WebCore):
(MediaStreamCenter):

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

Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Modules/mediastream/IceCandidate.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediastream/IceCandidate.h [new file with mode: 0644]
Source/WebCore/Modules/mediastream/IceCandidate.idl [new file with mode: 0644]
Source/WebCore/WebCore.gypi
Source/WebCore/platform/mediastream/IceCandidateDescriptor.cpp [new file with mode: 0644]
Source/WebCore/platform/mediastream/IceCandidateDescriptor.h [new file with mode: 0644]
Source/WebCore/platform/mediastream/MediaStreamCenter.cpp
Source/WebCore/platform/mediastream/MediaStreamCenter.h

index 19de6ba..548bb9c 100644 (file)
@@ -1,3 +1,50 @@
+2012-03-14  Tommy Widenflycht  <tommyw@google.com>
+
+        MediaStream API (JSEP): Introducing IceCandidate
+        https://bugs.webkit.org/show_bug.cgi?id=80699
+
+        Reviewed by Adam Barth.
+
+        Patch #2 in a series of patches to change the PeerConnection from ROAP to JSEP,
+        see bug 80589 for more information.
+        Adding the JS object IceCandidate and its WebCore/platform sibling IceCandidateDescriptor.
+        This object will be created both from JS and the embedder.
+
+        Not possible to test until the entire JSEP feature is commited.
+
+        * GNUmakefile.list.am:
+        * Modules/mediastream/IceCandidate.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
+        (WebCore):
+        (WebCore::IceCandidate::create):
+        (WebCore::IceCandidate::IceCandidate):
+        (WebCore::IceCandidate::~IceCandidate):
+        (WebCore::IceCandidate::label):
+        (WebCore::IceCandidate::candidateLine):
+        (WebCore::IceCandidate::toSdp):
+        (WebCore::IceCandidate::descriptor):
+        * Modules/mediastream/IceCandidate.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
+        (WebCore):
+        (IceCandidate):
+        * Modules/mediastream/IceCandidate.idl: Added.
+        * WebCore.gypi:
+        * platform/mediastream/IceCandidateDescriptor.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
+        (WebCore):
+        (WebCore::IceCandidateDescriptor::create):
+        (WebCore::IceCandidateDescriptor::IceCandidateDescriptor):
+        (WebCore::IceCandidateDescriptor::~IceCandidateDescriptor):
+        (WebCore::IceCandidateDescriptor::toSdp):
+        * platform/mediastream/IceCandidateDescriptor.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp.
+        (WebCore):
+        (IceCandidateDescriptor):
+        (WebCore::IceCandidateDescriptor::label):
+        (WebCore::IceCandidateDescriptor::candidateLine):
+        * platform/mediastream/MediaStreamCenter.cpp:
+        (WebCore::MediaStreamCenter::constructSdp):
+        (WebCore):
+        * platform/mediastream/MediaStreamCenter.h:
+        (WebCore):
+        (MediaStreamCenter):
+
 2012-03-14  Simon Fraser  <simon.fraser@apple.com>
 
         background-visibility:hidden should create a RenderLayer
index 4b1e8b7..0576859 100644 (file)
@@ -344,6 +344,8 @@ webcore_built_sources += \
        DerivedSources/WebCore/JSHTMLUListElement.h \
        DerivedSources/WebCore/JSHTMLVideoElement.cpp \
        DerivedSources/WebCore/JSHTMLVideoElement.h \
+       DerivedSources/WebCore/JSIceCandidate.cpp \
+       DerivedSources/WebCore/JSIceCandidate.h \
        DerivedSources/WebCore/JSImageData.cpp \
        DerivedSources/WebCore/JSImageData.h \
        DerivedSources/WebCore/JSInjectedScriptHost.cpp \
@@ -660,6 +662,7 @@ dom_binding_idls += \
        $(WebCore)/Modules/geolocation/PositionErrorCallback.idl \
        $(WebCore)/Modules/mediastream/DeprecatedPeerConnection.idl \
        $(WebCore)/Modules/mediastream/DOMWindowMediaStream.idl \
+       $(WebCore)/Modules/mediastream/IceCandidate.idl \
        $(WebCore)/Modules/mediastream/LocalMediaStream.idl \
        $(WebCore)/Modules/mediastream/MediaStream.idl \
        $(WebCore)/Modules/mediastream/MediaStreamEvent.idl \
@@ -1033,6 +1036,8 @@ webcore_sources += \
        Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h \
        Source/WebCore/Modules/mediastream/DeprecatedPeerConnection.cpp \
        Source/WebCore/Modules/mediastream/DeprecatedPeerConnection.h \
+       Source/WebCore/Modules/mediastream/IceCandidate.cpp \
+       Source/WebCore/Modules/mediastream/IceCandidate.h \
        Source/WebCore/Modules/mediastream/LocalMediaStream.cpp \
        Source/WebCore/Modules/mediastream/LocalMediaStream.h \
        Source/WebCore/Modules/mediastream/MediaStream.cpp \
@@ -3322,6 +3327,8 @@ webcore_sources += \
        Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h \
        Source/WebCore/platform/mediastream/DeprecatedPeerConnectionHandler.h \
        Source/WebCore/platform/mediastream/DeprecatedPeerConnectionHandlerClient.h \
+       Source/WebCore/platform/mediastream/IceCandidateDescriptor.cpp \
+       Source/WebCore/platform/mediastream/IceCandidateDescriptor.h \
        Source/WebCore/platform/mediastream/MediaStreamCenter.cpp \
        Source/WebCore/platform/mediastream/MediaStreamCenter.h \
        Source/WebCore/platform/mediastream/MediaStreamComponent.h \
diff --git a/Source/WebCore/Modules/mediastream/IceCandidate.cpp b/Source/WebCore/Modules/mediastream/IceCandidate.cpp
new file mode 100644 (file)
index 0000000..f0ce41e
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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 "IceCandidate.h"
+
+#include "IceCandidateDescriptor.h"
+
+namespace WebCore {
+
+PassRefPtr<IceCandidate> IceCandidate::create(const String& label, const String& candidateLine)
+{
+    return adoptRef(new IceCandidate(IceCandidateDescriptor::create(label, candidateLine)));
+}
+
+PassRefPtr<IceCandidate> IceCandidate::create(PassRefPtr<IceCandidateDescriptor> descriptor)
+{
+    return adoptRef(new IceCandidate(descriptor));
+}
+
+IceCandidate::IceCandidate(PassRefPtr<IceCandidateDescriptor> descriptor)
+    : m_descriptor(descriptor)
+{
+}
+
+IceCandidate::~IceCandidate()
+{
+}
+
+const String& IceCandidate::label()
+{
+    return m_descriptor->label();
+}
+
+const String& IceCandidate::candidateLine()
+{
+    return m_descriptor->candidateLine();
+}
+
+String IceCandidate::toSdp()
+{
+    return m_descriptor->toSdp();
+}
+
+IceCandidateDescriptor* IceCandidate::descriptor()
+{
+    return m_descriptor.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
diff --git a/Source/WebCore/Modules/mediastream/IceCandidate.h b/Source/WebCore/Modules/mediastream/IceCandidate.h
new file mode 100644 (file)
index 0000000..c5ef120
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * 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 IceCandidate_h
+#define IceCandidate_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class IceCandidateDescriptor;
+
+class IceCandidate : public RefCounted<IceCandidate> {
+public:
+    static PassRefPtr<IceCandidate> create(const String& label, const String& candidateLine);
+    static PassRefPtr<IceCandidate> create(PassRefPtr<IceCandidateDescriptor>);
+    virtual ~IceCandidate();
+
+    const String& label();
+    const String& candidateLine();
+
+    String toSdp();
+
+    IceCandidateDescriptor* descriptor();
+
+private:
+    IceCandidate(PassRefPtr<IceCandidateDescriptor>);
+
+    RefPtr<IceCandidateDescriptor> m_descriptor;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // IceCandidate_h
diff --git a/Source/WebCore/Modules/mediastream/IceCandidate.idl b/Source/WebCore/Modules/mediastream/IceCandidate.idl
new file mode 100644 (file)
index 0000000..e1c42fa
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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 label, in DOMString candidateLine)
+    ] IceCandidate {
+        readonly attribute DOMString label;
+
+        DOMString toSdp();
+    };
+
+}
index 5712fd4..c79f655 100644 (file)
             'platform/mac/WebFontCache.h',
             'platform/mediastream/DeprecatedPeerConnectionHandler.h',
             'platform/mediastream/DeprecatedPeerConnectionHandlerClient.h',
+            'platform/mediastream/IceCandidateDescriptor.cpp',
+            'platform/mediastream/IceCandidateDescriptor.h',
             'platform/mediastream/MediaStreamCenter.cpp',
             'platform/mediastream/MediaStreamCenter.h',
             'platform/mediastream/MediaStreamComponent.h',
             'Modules/intents/NavigatorIntents.idl',
             'Modules/mediastream/DeprecatedPeerConnection.idl',
             'Modules/mediastream/DOMWindowMediaStream.idl',
+            'Modules/mediastream/IceCandidate.idl',
             'Modules/mediastream/LocalMediaStream.idl',
             'Modules/mediastream/MediaStream.idl',
             'Modules/mediastream/MediaStreamEvent.idl',
             'Modules/intents/NavigatorIntents.h',
             'Modules/mediastream/DeprecatedPeerConnection.cpp',
             'Modules/mediastream/DeprecatedPeerConnection.h',
+            'Modules/mediastream/IceCandidate.cpp',
+            'Modules/mediastream/IceCandidate.h',
             'Modules/mediastream/LocalMediaStream.cpp',
             'Modules/mediastream/LocalMediaStream.h',
             'Modules/mediastream/MediaStream.cpp',
diff --git a/Source/WebCore/platform/mediastream/IceCandidateDescriptor.cpp b/Source/WebCore/platform/mediastream/IceCandidateDescriptor.cpp
new file mode 100644 (file)
index 0000000..332576f
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * 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 "IceCandidateDescriptor.h"
+
+#include "MediaStreamCenter.h"
+
+namespace WebCore {
+
+PassRefPtr<IceCandidateDescriptor> IceCandidateDescriptor::create(const String& label, const String& candidateLine)
+{
+    return adoptRef(new IceCandidateDescriptor(label, candidateLine));
+}
+
+IceCandidateDescriptor::IceCandidateDescriptor(const String& label, const String& candidateLine)
+    : m_label(label)
+    , m_candidateLine(candidateLine)
+{
+}
+
+IceCandidateDescriptor::~IceCandidateDescriptor()
+{
+}
+
+String IceCandidateDescriptor::toSdp()
+{
+    return MediaStreamCenter::instance().constructSdp(this);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
diff --git a/Source/WebCore/platform/mediastream/IceCandidateDescriptor.h b/Source/WebCore/platform/mediastream/IceCandidateDescriptor.h
new file mode 100644 (file)
index 0000000..b8bccf0
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * 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 IceCandidateDescriptor_h
+#define IceCandidateDescriptor_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class IceCandidateDescriptor : public RefCounted<IceCandidateDescriptor> {
+public:
+    static PassRefPtr<IceCandidateDescriptor> create(const String& label, const String& candidateLine);
+    virtual ~IceCandidateDescriptor();
+
+    const String& label() { return m_label; }
+    const String& candidateLine() { return m_candidateLine; }
+
+    String toSdp();
+
+private:
+    IceCandidateDescriptor(const String& label, const String& candidateLine);
+
+    String m_label;
+    String m_candidateLine;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // IceCandidateDescriptor_h
index abccf5b..9db3d0c 100644 (file)
@@ -55,6 +55,11 @@ void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescrip
         streamDescriptor->setEnded();
 }
 
+String MediaStreamCenter::constructSdp(IceCandidateDescriptor*)
+{
+    return "";
+}
+
 #if !PLATFORM(CHROMIUM)
 
 // Empty implementations for ports that build with MEDIA_STREAM enabled by default, but haven't yet implemented MediaStreamCenter.
index a37d66a..dcb9594 100644 (file)
@@ -42,6 +42,7 @@ namespace WebCore {
 class MediaStreamCenterInternal;
 #endif
 
+class IceCandidateDescriptor;
 class MediaStreamComponent;
 class MediaStreamDescriptor;
 
@@ -74,6 +75,8 @@ public:
     void didStopLocalMediaStream(MediaStreamDescriptor*);
     void didConstructMediaStream(MediaStreamDescriptor*);
 
+    String constructSdp(IceCandidateDescriptor*);
+
     // Calls from the platform to update the DOM objects
     void endLocalMediaStream(MediaStreamDescriptor*);