<!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 <pnormand@igalia.com>
+
+ [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 <ossy@webkit.org>
</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"> "${WEBCORE_DIR}/platform/graphics/texmap"
</span><span class="cx"> "${WEBCORE_DIR}/platform/graphics/texmap/coordinated"
</span><span class="cx"> "${WEBCORE_DIR}/platform/linux"
</span><del>- "${WEBCORE_DIR}/platform/mediastream/gstreamer"
</del><ins>+ "${WEBCORE_DIR}/platform/mediastream/openwebrtc"
</ins><span class="cx"> "${WEBCORE_DIR}/platform/mock/mediasource"
</span><span class="cx"> "${WEBCORE_DIR}/platform/network/soup"
</span><span class="cx"> "${WEBCORE_DIR}/platform/text/efl"
</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"> "${WEBCORE_DIR}/platform/graphics/opentype"
</span><span class="cx"> "${WEBCORE_DIR}/platform/graphics/wayland"
</span><span class="cx"> "${WEBCORE_DIR}/platform/linux"
</span><del>- "${WEBCORE_DIR}/platform/mediastream/gstreamer"
</del><ins>+ "${WEBCORE_DIR}/platform/mediastream/openwebrtc"
</ins><span class="cx"> "${WEBCORE_DIR}/platform/mock/mediasource"
</span><span class="cx"> "${WEBCORE_DIR}/platform/network/gtk"
</span><span class="cx"> "${WEBCORE_DIR}/platform/network/soup"
</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
- * "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 "MediaStreamCenterGStreamer.h"
-
-#include "MediaStreamCreationClient.h"
-#include "MediaStreamPrivate.h"
-#include "MediaStreamTrackSourcesRequestClient.h"
-#include "NotImplemented.h"
-#include "RealtimeMediaSourceCapabilities.h"
-#include <wtf/MainThread.h>
-
-namespace WebCore {
-
-RealtimeMediaSourceCenter& RealtimeMediaSourceCenter::platformCenter()
-{
- ASSERT(isMainThread());
- DEPRECATED_DEFINE_STATIC_LOCAL(MediaStreamCenterGStreamer, center, ());
- return center;
-}
-
-MediaStreamCenterGStreamer::MediaStreamCenterGStreamer()
-{
-}
-
-MediaStreamCenterGStreamer::~MediaStreamCenterGStreamer()
-{
-}
-
-void MediaStreamCenterGStreamer::validateRequestConstraints(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints>, PassRefPtr<MediaConstraints>)
-{
- RefPtr<MediaStreamCreationClient> client = prpQueryClient;
- // FIXME: Actually do constraints validation. The MediaConstraints
- // need to comply with the available audio/video device(s)
- // capabilities. See bug #123345.
- client->constraintsValidated();
-}
-
-void MediaStreamCenterGStreamer::createMediaStream(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints>, PassRefPtr<MediaConstraints>)
-{
- RefPtr<MediaStreamCreationClient> client = prpQueryClient;
- ASSERT(client);
-
- Vector<RefPtr<RealtimeMediaSource>> audioSources;
- Vector<RefPtr<RealtimeMediaSource>> videoSources;
- // FIXME: fill source vectors, see bug #110150.
- client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
-
-}
-
-bool MediaStreamCenterGStreamer::getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>)
-{
- 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
- * "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 MediaStreamCenterGStreamer_h
-#define MediaStreamCenterGStreamer_h
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "RealtimeMediaSourceCenter.h"
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class MediaStreamPrivate;
-class RealtimeMediaSource;
-class MediaStreamSourcesQueryClient;
-
-class MediaStreamCenterGStreamer : public RealtimeMediaSourceCenter {
-public:
- MediaStreamCenterGStreamer();
- ~MediaStreamCenterGStreamer();
-
- virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
- virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
- virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) 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
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include "config.h"
+
+#if USE(OPENWEBRTC)
+#include "OpenWebRTCUtilities.h"
+
+#include <owr/owr.h>
+
+namespace WebCore {
+
+void initializeOpenWebRTC()
+{
+ 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
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+namespace WebCore {
+
+void initializeOpenWebRTC();
+
+}
</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
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
+#include "RealtimeMediaSourceCenterOwr.h"
+
+#include "MediaStreamCreationClient.h"
+#include "MediaStreamPrivate.h"
+#include "MediaStreamTrackSourcesRequestClient.h"
+#include "NotImplemented.h"
+#include "OpenWebRTCUtilities.h"
+#include "RealtimeMediaSource.h"
+#include "RealtimeMediaSourceCapabilities.h"
+#include "UUID.h"
+#include <owr/owr.h>
+#include <owr/owr_local.h>
+#include <owr/owr_media_source.h>
+#include <wtf/MainThread.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/gobject/GUniquePtr.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
+
+
+namespace WebCore {
+
+RealtimeMediaSourceCenter& RealtimeMediaSourceCenter::platformCenter()
+{
+ ASSERT(isMainThread());
+ static NeverDestroyed<RealtimeMediaSourceCenterOwr> center;
+ return center;
+}
+
+static void mediaSourcesAvailableCallback(GList* sources, gpointer userData)
+{
+ RealtimeMediaSourceCenterOwr* center = reinterpret_cast<RealtimeMediaSourceCenterOwr*>(userData);
+ center->mediaSourcesAvailable(sources);
+}
+
+RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr()
+{
+ initializeOpenWebRTC();
+}
+
+RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr()
+{
+}
+
+void RealtimeMediaSourceCenterOwr::validateRequestConstraints(PassRefPtr<MediaStreamCreationClient> prpClient, PassRefPtr<MediaConstraints> prpAudioConstraints, PassRefPtr<MediaConstraints> 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<MediaConstraints> audioConstraints = prpAudioConstraints;
+ RefPtr<MediaConstraints> videoConstraints = prpVideoConstraints;
+
+ int types;
+ if (audioConstraints)
+ types |= OWR_MEDIA_TYPE_AUDIO;
+ if (videoConstraints)
+ types |= OWR_MEDIA_TYPE_VIDEO;
+
+ owr_get_capture_sources(static_cast<OwrMediaType>(types), mediaSourcesAvailableCallback, this);
+}
+
+void RealtimeMediaSourceCenterOwr::createMediaStream(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
+{
+ RefPtr<MediaStreamCreationClient> client = prpQueryClient;
+ ASSERT(client);
+
+ UNUSED_PARAM(audioConstraints);
+ UNUSED_PARAM(videoConstraints);
+
+ Vector<RefPtr<RealtimeMediaSource>> audioSources;
+ Vector<RefPtr<RealtimeMediaSource>> videoSources;
+
+ if (audioConstraints) {
+ // TODO: verify constraints according to registered
+ // sources. For now, unconditionally pick the first source, see bug #123345.
+ RefPtr<RealtimeMediaSource> audioSource = firstSource(RealtimeMediaSource::Audio);
+ if (audioSource) {
+ audioSource->reset();
+ audioSource->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<RealtimeMediaSource> videoSource = firstSource(RealtimeMediaSource::Video);
+ if (videoSource) {
+ videoSource->reset();
+ videoSource->setReadyState(RealtimeMediaSource::Live);
+ videoSources.append(videoSource.release());
+ }
+ }
+
+ client->didCreateStream(MediaStreamPrivate::create(audioSources, videoSources));
+}
+
+bool RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>)
+{
+ notImplemented();
+ return false;
+}
+
+void RealtimeMediaSourceCenterOwr::mediaSourcesAvailable(GList* sources)
+{
+ for (auto item = sources; item; item = item->next) {
+ OwrMediaSource* source = OWR_MEDIA_SOURCE(item->data);
+
+ GUniqueOutPtr<gchar> name;
+ OwrMediaType mediaType;
+ g_object_get(source, "media-type", &mediaType, "name", &name.outPtr(), NULL);
+ String sourceName(name.get());
+ String id(createCanonicalUUIDString());
+
+ RealtimeMediaSource::Type sourceType;
+ if (mediaType & OWR_MEDIA_TYPE_AUDIO)
+ sourceType = RealtimeMediaSource::Audio;
+ else if (mediaType & OWR_MEDIA_TYPE_VIDEO)
+ sourceType = RealtimeMediaSource::Video;
+ else
+ ASSERT_NOT_REACHED();
+
+ RefPtr<RealtimeMediaSourceOwr> 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->constraintsValidated();
+}
+
+PassRefPtr<RealtimeMediaSource> RealtimeMediaSourceCenterOwr::firstSource(RealtimeMediaSource::Type type)
+{
+ for (auto iter = m_sourceMap.begin(); iter != m_sourceMap.end(); ++iter) {
+ RefPtr<RealtimeMediaSource> source = iter->value;
+ if (source->type() == type)
+ return source;
+ }
+
+ return nullptr;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) && 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
+ * "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 RealtimeMediaSourceCenterOwr_h
+#define RealtimeMediaSourceCenterOwr_h
+
+#if ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
+
+#include "RealtimeMediaSourceCenter.h"
+
+#include "RealtimeMediaSourceOwr.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class MediaStreamPrivate;
+class RealtimeMediaSource;
+class MediaStreamSourcesQueryClient;
+
+class RealtimeMediaSourceCenterOwr final : public RealtimeMediaSourceCenter {
+public:
+ RealtimeMediaSourceCenterOwr();
+ ~RealtimeMediaSourceCenterOwr();
+
+ virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
+ virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
+ virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) override;
+
+ void mediaSourcesAvailable(GList* sources);
+
+private:
+ PassRefPtr<RealtimeMediaSource> firstSource(RealtimeMediaSource::Type);
+ RealtimeMediaSourceOwrMap m_sourceMap;
+ RefPtr<MediaStreamCreationClient> m_client;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) && 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
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RealtimeMediaSourceOwr_h
+#define RealtimeMediaSourceOwr_h
+
+#if ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
+
+#include "GRefPtrGStreamer.h"
+#include "RealtimeMediaSource.h"
+#include <owr/owr_media_source.h>
+#include <wtf/HashMap.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class RealtimeMediaSourceCapabilities;
+
+class RealtimeMediaSourceOwr final : public RealtimeMediaSource {
+public:
+RealtimeMediaSourceOwr(OwrMediaSource* mediaSource, const String& id, RealtimeMediaSource::Type type, const String& name)
+ : RealtimeMediaSource(id, type, name)
+ , m_mediaSource(mediaSource)
+ {
+ }
+
+ virtual ~RealtimeMediaSourceOwr() { }
+
+ virtual RefPtr<RealtimeMediaSourceCapabilities> capabilities() const { return m_capabilities; }
+ virtual const RealtimeMediaSourceStates& states() { return m_currentStates; }
+
+ OwrMediaSource* mediaSource() const { return m_mediaSource; }
+
+private:
+ RefPtr<RealtimeMediaSourceCapabilities> m_capabilities;
+ RealtimeMediaSourceStates m_currentStates;
+ OwrMediaSource* m_mediaSource;
+};
+
+typedef HashMap<String, RefPtr<RealtimeMediaSourceOwr>> RealtimeMediaSourceOwrMap;
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) && USE(OPENWEBRTC)
+
+#endif // RealtimeMediaSourceOwr_h
</ins></span></pre>
</div>
</div>
</body>
</html>