<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181893] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181893">181893</a></dd>
<dt>Author</dt> <dd>philn@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-24 08:18:21 -0700 (Tue, 24 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[OpenWebRTC] RealtimeMediaSourceCenter implementation
https://bugs.webkit.org/show_bug.cgi?id=142476

Reviewed by Eric Carlson.

The old GStreamer MediaStreamCenter is replaced by the OpenWebRTC
RealtimeMediaSourceCenter. It is not yet able to correctly assess
MediaConstraints so it selects the first audio/video sources
available through OpenWebRTC.

* PlatformEfl.cmake: Add new files to the build.
* PlatformGTK.cmake: Ditto.
* platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp: Removed.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Added.
(WebCore::initializeOpenWebRTC): Simple function to initialize the
framework, it is going to be used by the PeerConnection backend as well.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Added.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Added.
(WebCore::mediaSourcesAvailableCallback): Function invoked once
the media sources discovery succeeded within OpenWebRTC.
(WebCore::RealtimeMediaSourceCenter::platformCenter): Instantiate
the OpenWebRTC RealtimeMediaSourceCenter.
(WebCore::RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr):
(WebCore::RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr):
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
Schedule a discovery process for the capture sources.
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Pick
the first audio/video sources and create a MediaStream accordingly.
(WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources):
Not yet implemented.
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
Method invoked once the capture sources process succeeded. Parse
them and create an internal cache of RealtimeMediaSources accordingly.
(WebCore::RealtimeMediaSourceCenterOwr::firstSource): Utility
function to fetch the first source of the given type from the
RealtimeMediaSources cache.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformEflcmake">trunk/Source/WebCore/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/platform/mediastream/openwebrtc/</li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcOpenWebRTCUtilitiescpp">trunk/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcOpenWebRTCUtilitiesh">trunk/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceCenterOwrcpp">trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceCenterOwrh">trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceOwrh">trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerMediaStreamCenterGStreamercpp">trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerMediaStreamCenterGStreamerh">trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181892 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-24 15:11:39 UTC (rev 181892)
+++ trunk/Source/WebCore/ChangeLog        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2015-03-17  Philippe Normand  &lt;pnormand@igalia.com&gt;
+
+        [OpenWebRTC] RealtimeMediaSourceCenter implementation
+        https://bugs.webkit.org/show_bug.cgi?id=142476
+
+        Reviewed by Eric Carlson.
+
+        The old GStreamer MediaStreamCenter is replaced by the OpenWebRTC
+        RealtimeMediaSourceCenter. It is not yet able to correctly assess
+        MediaConstraints so it selects the first audio/video sources
+        available through OpenWebRTC.
+
+        * PlatformEfl.cmake: Add new files to the build.
+        * PlatformGTK.cmake: Ditto.
+        * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp: Removed.
+        * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Added.
+        (WebCore::initializeOpenWebRTC): Simple function to initialize the
+        framework, it is going to be used by the PeerConnection backend as well.
+        * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Added.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Added.
+        (WebCore::mediaSourcesAvailableCallback): Function invoked once
+        the media sources discovery succeeded within OpenWebRTC.
+        (WebCore::RealtimeMediaSourceCenter::platformCenter): Instantiate
+        the OpenWebRTC RealtimeMediaSourceCenter.
+        (WebCore::RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr):
+        (WebCore::RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr):
+        (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
+        Schedule a discovery process for the capture sources.
+        (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Pick
+        the first audio/video sources and create a MediaStream accordingly.
+        (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources):
+        Not yet implemented.
+        (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
+        Method invoked once the capture sources process succeeded. Parse
+        them and create an internal cache of RealtimeMediaSources accordingly.
+        (WebCore::RealtimeMediaSourceCenterOwr::firstSource): Utility
+        function to fetch the first source of the given type from the
+        RealtimeMediaSources cache.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Added.
+
</ins><span class="cx"> 2015-03-24  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] Add OpenWebRTC in jhbuild
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformEfl.cmake (181892 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformEfl.cmake        2015-03-24 15:11:39 UTC (rev 181892)
+++ trunk/Source/WebCore/PlatformEfl.cmake        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/texmap&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/texmap/coordinated&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/linux&quot;
</span><del>-    &quot;${WEBCORE_DIR}/platform/mediastream/gstreamer&quot;
</del><ins>+    &quot;${WEBCORE_DIR}/platform/mediastream/openwebrtc&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/platform/mock/mediasource&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/network/soup&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/text/efl&quot;
</span><span class="lines">@@ -213,7 +213,8 @@
</span><span class="cx">     platform/linux/GamepadDeviceLinux.cpp
</span><span class="cx">     platform/linux/MemoryPressureHandlerLinux.cpp
</span><span class="cx"> 
</span><del>-    platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp
</del><ins>+    platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp
+    platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp
</ins><span class="cx"> 
</span><span class="cx">     platform/network/efl/NetworkStateNotifierEfl.cpp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (181892 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2015-03-24 15:11:39 UTC (rev 181892)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/opentype&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/wayland&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/linux&quot;
</span><del>-    &quot;${WEBCORE_DIR}/platform/mediastream/gstreamer&quot;
</del><ins>+    &quot;${WEBCORE_DIR}/platform/mediastream/openwebrtc&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/platform/mock/mediasource&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/network/gtk&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/network/soup&quot;
</span><span class="lines">@@ -153,7 +153,8 @@
</span><span class="cx">     platform/linux/GamepadDeviceLinux.cpp
</span><span class="cx">     platform/linux/MemoryPressureHandlerLinux.cpp
</span><span class="cx"> 
</span><del>-    platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp
</del><ins>+    platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp
+    platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp
</ins><span class="cx"> 
</span><span class="cx">     platform/network/soup/AuthenticationChallengeSoup.cpp
</span><span class="cx">     platform/network/soup/CertificateInfo.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerMediaStreamCenterGStreamercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp (181892 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp        2015-03-24 15:11:39 UTC (rev 181892)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -1,91 +0,0 @@
</span><del>-/*
- * 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
- * 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
- * &quot;AS IS&quot; 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 &quot;config.h&quot;
-
-#if ENABLE(MEDIA_STREAM)
-
-#include &quot;MediaStreamCenterGStreamer.h&quot;
-
-#include &quot;MediaStreamCreationClient.h&quot;
-#include &quot;MediaStreamPrivate.h&quot;
-#include &quot;MediaStreamTrackSourcesRequestClient.h&quot;
-#include &quot;NotImplemented.h&quot;
-#include &quot;RealtimeMediaSourceCapabilities.h&quot;
-#include &lt;wtf/MainThread.h&gt;
-
-namespace WebCore {
-
-RealtimeMediaSourceCenter&amp; RealtimeMediaSourceCenter::platformCenter()
-{
-    ASSERT(isMainThread());
-    DEPRECATED_DEFINE_STATIC_LOCAL(MediaStreamCenterGStreamer, center, ());
-    return center;
-}
-
-MediaStreamCenterGStreamer::MediaStreamCenterGStreamer()
-{
-}
-
-MediaStreamCenterGStreamer::~MediaStreamCenterGStreamer()
-{
-}
-
-void MediaStreamCenterGStreamer::validateRequestConstraints(PassRefPtr&lt;MediaStreamCreationClient&gt; prpQueryClient, PassRefPtr&lt;MediaConstraints&gt;, PassRefPtr&lt;MediaConstraints&gt;)
-{
-    RefPtr&lt;MediaStreamCreationClient&gt; client = prpQueryClient;
-    // FIXME: Actually do constraints validation. The MediaConstraints
-    // need to comply with the available audio/video device(s)
-    // capabilities. See bug #123345.
-    client-&gt;constraintsValidated();
-}
-    
-void MediaStreamCenterGStreamer::createMediaStream(PassRefPtr&lt;MediaStreamCreationClient&gt; prpQueryClient, PassRefPtr&lt;MediaConstraints&gt;, PassRefPtr&lt;MediaConstraints&gt;)
-{
-    RefPtr&lt;MediaStreamCreationClient&gt; client = prpQueryClient;
-    ASSERT(client);
-
-    Vector&lt;RefPtr&lt;RealtimeMediaSource&gt;&gt; audioSources;
-    Vector&lt;RefPtr&lt;RealtimeMediaSource&gt;&gt; videoSources;
-    // FIXME: fill source vectors, see bug #110150.
-    client-&gt;didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
-
-}
-
-bool MediaStreamCenterGStreamer::getMediaStreamTrackSources(PassRefPtr&lt;MediaStreamTrackSourcesRequestClient&gt;)
-{
-    notImplemented();
-    return false;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerMediaStreamCenterGStreamerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h (181892 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h        2015-03-24 15:11:39 UTC (rev 181892)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -1,62 +0,0 @@
</span><del>-/*
- * 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
- * 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
- * &quot;AS IS&quot; 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 MediaStreamCenterGStreamer_h
-#define MediaStreamCenterGStreamer_h
-
-#if ENABLE(MEDIA_STREAM)
-
-#include &quot;RealtimeMediaSourceCenter.h&quot;
-
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-class MediaStreamPrivate;
-class RealtimeMediaSource;
-class MediaStreamSourcesQueryClient;
-
-class MediaStreamCenterGStreamer : public RealtimeMediaSourceCenter {
-public:
-    MediaStreamCenterGStreamer();
-    ~MediaStreamCenterGStreamer();
-
-    virtual void validateRequestConstraints(PassRefPtr&lt;MediaStreamCreationClient&gt;, PassRefPtr&lt;MediaConstraints&gt; audioConstraints, PassRefPtr&lt;MediaConstraints&gt; videoConstraints);
-    virtual void createMediaStream(PassRefPtr&lt;MediaStreamCreationClient&gt;, PassRefPtr&lt;MediaConstraints&gt; audioConstraints, PassRefPtr&lt;MediaConstraints&gt; videoConstraints);
-    virtual bool getMediaStreamTrackSources(PassRefPtr&lt;MediaStreamTrackSourcesRequestClient&gt;) override;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
-
-#endif // MediaStreamCenterGStreamer_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcOpenWebRTCUtilitiescpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp (0 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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 &quot;config.h&quot;
+
+#if USE(OPENWEBRTC)
+#include &quot;OpenWebRTCUtilities.h&quot;
+
+#include &lt;owr/owr.h&gt;
+
+namespace WebCore {
+
+void initializeOpenWebRTC()
+{
+    owr_init_with_main_context(g_main_context_default());
+}
+
+}
+
+#endif // USE(OPENWEBRTC)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcOpenWebRTCUtilitiesh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.h (0 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/OpenWebRTCUtilities.h        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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();
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceCenterOwrcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp (0 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -0,0 +1,187 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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 &quot;config.h&quot;
+
+#if ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
+#include &quot;RealtimeMediaSourceCenterOwr.h&quot;
+
+#include &quot;MediaStreamCreationClient.h&quot;
+#include &quot;MediaStreamPrivate.h&quot;
+#include &quot;MediaStreamTrackSourcesRequestClient.h&quot;
+#include &quot;NotImplemented.h&quot;
+#include &quot;OpenWebRTCUtilities.h&quot;
+#include &quot;RealtimeMediaSource.h&quot;
+#include &quot;RealtimeMediaSourceCapabilities.h&quot;
+#include &quot;UUID.h&quot;
+#include &lt;owr/owr.h&gt;
+#include &lt;owr/owr_local.h&gt;
+#include &lt;owr/owr_media_source.h&gt;
+#include &lt;wtf/MainThread.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/gobject/GUniquePtr.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+#include &lt;wtf/text/StringHash.h&gt;
+
+
+namespace WebCore {
+
+RealtimeMediaSourceCenter&amp; RealtimeMediaSourceCenter::platformCenter()
+{
+    ASSERT(isMainThread());
+    static NeverDestroyed&lt;RealtimeMediaSourceCenterOwr&gt; center;
+    return center;
+}
+
+static void mediaSourcesAvailableCallback(GList* sources, gpointer userData)
+{
+    RealtimeMediaSourceCenterOwr* center = reinterpret_cast&lt;RealtimeMediaSourceCenterOwr*&gt;(userData);
+    center-&gt;mediaSourcesAvailable(sources);
+}
+
+RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr()
+{
+    initializeOpenWebRTC();
+}
+
+RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr()
+{
+}
+
+void RealtimeMediaSourceCenterOwr::validateRequestConstraints(PassRefPtr&lt;MediaStreamCreationClient&gt; prpClient, PassRefPtr&lt;MediaConstraints&gt; prpAudioConstraints, PassRefPtr&lt;MediaConstraints&gt; prpVideoConstraints)
+{
+    m_client = prpClient;
+    ASSERT(m_client);
+
+    // FIXME: Actually do constraints validation. The MediaConstraints
+    // need to comply with the available audio/video device(s)
+    // capabilities. See bug #123345.
+    RefPtr&lt;MediaConstraints&gt; audioConstraints = prpAudioConstraints;
+    RefPtr&lt;MediaConstraints&gt; videoConstraints = prpVideoConstraints;
+
+    int types;
+    if (audioConstraints)
+        types |= OWR_MEDIA_TYPE_AUDIO;
+    if (videoConstraints)
+        types |= OWR_MEDIA_TYPE_VIDEO;
+
+    owr_get_capture_sources(static_cast&lt;OwrMediaType&gt;(types), mediaSourcesAvailableCallback, this);
+}
+
+void RealtimeMediaSourceCenterOwr::createMediaStream(PassRefPtr&lt;MediaStreamCreationClient&gt; prpQueryClient, PassRefPtr&lt;MediaConstraints&gt; audioConstraints, PassRefPtr&lt;MediaConstraints&gt; videoConstraints)
+{
+    RefPtr&lt;MediaStreamCreationClient&gt; client = prpQueryClient;
+    ASSERT(client);
+
+    UNUSED_PARAM(audioConstraints);
+    UNUSED_PARAM(videoConstraints);
+
+    Vector&lt;RefPtr&lt;RealtimeMediaSource&gt;&gt; audioSources;
+    Vector&lt;RefPtr&lt;RealtimeMediaSource&gt;&gt; videoSources;
+
+    if (audioConstraints) {
+        // TODO: verify constraints according to registered
+        // sources. For now, unconditionally pick the first source, see bug #123345.
+        RefPtr&lt;RealtimeMediaSource&gt; audioSource = firstSource(RealtimeMediaSource::Audio);
+        if (audioSource) {
+            audioSource-&gt;reset();
+            audioSource-&gt;setReadyState(RealtimeMediaSource::Live);
+            audioSources.append(audioSource.release());
+        }
+    }
+
+    if (videoConstraints) {
+        // TODO: verify constraints according to registered
+        // sources. For now, unconditionally pick the first source, see bug #123345.
+        RefPtr&lt;RealtimeMediaSource&gt; videoSource = firstSource(RealtimeMediaSource::Video);
+        if (videoSource) {
+            videoSource-&gt;reset();
+            videoSource-&gt;setReadyState(RealtimeMediaSource::Live);
+            videoSources.append(videoSource.release());
+        }
+    }
+
+    client-&gt;didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
+}
+
+bool RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources(PassRefPtr&lt;MediaStreamTrackSourcesRequestClient&gt;)
+{
+    notImplemented();
+    return false;
+}
+
+void RealtimeMediaSourceCenterOwr::mediaSourcesAvailable(GList* sources)
+{
+    for (auto item = sources; item; item = item-&gt;next) {
+        OwrMediaSource* source = OWR_MEDIA_SOURCE(item-&gt;data);
+
+        GUniqueOutPtr&lt;gchar&gt; name;
+        OwrMediaType mediaType;
+        g_object_get(source, &quot;media-type&quot;, &amp;mediaType, &quot;name&quot;, &amp;name.outPtr(), NULL);
+        String sourceName(name.get());
+        String id(createCanonicalUUIDString());
+
+        RealtimeMediaSource::Type sourceType;
+        if (mediaType &amp; OWR_MEDIA_TYPE_AUDIO)
+            sourceType = RealtimeMediaSource::Audio;
+        else if (mediaType &amp; OWR_MEDIA_TYPE_VIDEO)
+            sourceType = RealtimeMediaSource::Video;
+        else
+            ASSERT_NOT_REACHED();
+
+        RefPtr&lt;RealtimeMediaSourceOwr&gt; mediaSource = adoptRef(new RealtimeMediaSourceOwr(source, id, sourceType, sourceName));
+
+        RealtimeMediaSourceOwrMap::iterator sourceIterator = m_sourceMap.find(id);
+        if (sourceIterator == m_sourceMap.end())
+            m_sourceMap.add(id, mediaSource);
+
+    }
+
+    // TODO: Make sure contraints are actually validated by checking source types.
+    m_client-&gt;constraintsValidated();
+}
+
+PassRefPtr&lt;RealtimeMediaSource&gt; RealtimeMediaSourceCenterOwr::firstSource(RealtimeMediaSource::Type type)
+{
+    for (auto iter = m_sourceMap.begin(); iter != m_sourceMap.end(); ++iter) {
+        RefPtr&lt;RealtimeMediaSource&gt; source = iter-&gt;value;
+        if (source-&gt;type() == type)
+            return source;
+    }
+
+    return nullptr;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceCenterOwrhfromrev181892trunkSourceWebCoreplatformmediastreamgstreamerMediaStreamCenterGStreamerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h (from rev 181892, trunk/Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h) (0 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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 RealtimeMediaSourceCenterOwr_h
+#define RealtimeMediaSourceCenterOwr_h
+
+#if ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
+
+#include &quot;RealtimeMediaSourceCenter.h&quot;
+
+#include &quot;RealtimeMediaSourceOwr.h&quot;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace WebCore {
+
+class MediaStreamPrivate;
+class RealtimeMediaSource;
+class MediaStreamSourcesQueryClient;
+
+class RealtimeMediaSourceCenterOwr final : public RealtimeMediaSourceCenter {
+public:
+    RealtimeMediaSourceCenterOwr();
+    ~RealtimeMediaSourceCenterOwr();
+
+    virtual void validateRequestConstraints(PassRefPtr&lt;MediaStreamCreationClient&gt;, PassRefPtr&lt;MediaConstraints&gt; audioConstraints, PassRefPtr&lt;MediaConstraints&gt; videoConstraints);
+    virtual void createMediaStream(PassRefPtr&lt;MediaStreamCreationClient&gt;, PassRefPtr&lt;MediaConstraints&gt; audioConstraints, PassRefPtr&lt;MediaConstraints&gt; videoConstraints);
+    virtual bool getMediaStreamTrackSources(PassRefPtr&lt;MediaStreamTrackSourcesRequestClient&gt;) override;
+
+    void mediaSourcesAvailable(GList* sources);
+
+private:
+    PassRefPtr&lt;RealtimeMediaSource&gt; firstSource(RealtimeMediaSource::Type);
+    RealtimeMediaSourceOwrMap m_sourceMap;
+    RefPtr&lt;MediaStreamCreationClient&gt; m_client;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
+
+#endif // RealtimeMediaSourceCenterOwr_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceOwrh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h (0 => 181893)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h        2015-03-24 15:18:21 UTC (rev 181893)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * 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
+ * &quot;AS IS&quot; 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) &amp;&amp; USE(OPENWEBRTC)
+
+#include &quot;GRefPtrGStreamer.h&quot;
+#include &quot;RealtimeMediaSource.h&quot;
+#include &lt;owr/owr_media_source.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class RealtimeMediaSourceCapabilities;
+
+class RealtimeMediaSourceOwr final : public RealtimeMediaSource {
+public:
+RealtimeMediaSourceOwr(OwrMediaSource* mediaSource, const String&amp; id, RealtimeMediaSource::Type type, const String&amp; name)
+    : RealtimeMediaSource(id, type, name)
+    , m_mediaSource(mediaSource)
+    {
+    }
+
+    virtual ~RealtimeMediaSourceOwr() { }
+
+    virtual RefPtr&lt;RealtimeMediaSourceCapabilities&gt; capabilities() const { return m_capabilities; }
+    virtual const RealtimeMediaSourceStates&amp; states() { return m_currentStates; }
+
+    OwrMediaSource* mediaSource() const { return m_mediaSource; }
+
+private:
+    RefPtr&lt;RealtimeMediaSourceCapabilities&gt; m_capabilities;
+    RealtimeMediaSourceStates m_currentStates;
+    OwrMediaSource* m_mediaSource;
+};
+
+typedef HashMap&lt;String, RefPtr&lt;RealtimeMediaSourceOwr&gt;&gt; RealtimeMediaSourceOwrMap;
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
+
+#endif // RealtimeMediaSourceOwr_h
</ins></span></pre>
</div>
</div>

</body>
</html>