<!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>[210499] trunk</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/210499">210499</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-01-09 03:03:35 -0800 (Mon, 09 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html
https://bugs.webkit.org/show_bug.cgi?id=165316

Patch by Alejandro G. Castro &lt;alex@igalia.com&gt; on 2017-01-09
Reviewed by Philippe Normand.

Source/WebCore:

Fixed the ended support of the video element in the OWR player and
fixed the videoTracks support. Now the OW player properly adds and
removes the audio and video tracks. Added the getSettings support
to the mediastream interface. Solved also the size handling in
some of the enable/muted situations.

Unskipping fast/mediastream/MediaStream-video-element-track-stop.html.

* platform/GStreamer.cmake: Added the new
RealtimeMediaSourceOwr.cpp with the new code handling the
settings.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
Release the new video and audio maps that creates a relationship
of the mediastream tracks with the mediatracks of the video element.
(WebCore::MediaPlayerPrivateGStreamerOwr::play): Set ended to
false when we start playing.
(WebCore::MediaPlayerPrivateGStreamerOwr::load): Create the media
tracks to the player so that the videoTracks API returns it, and
add an entry in the map to be able to restore it using the
mediastream track.
(WebCore::MediaPlayerPrivateGStreamerOwr::disableMediaTracks):
Move some part of the stop function to this one in order to use it
in pause method and avoid changing the video selection in that
case.
(WebCore::MediaPlayerPrivateGStreamerOwr::stop): Now we call the
function disableMediaTracks and we also change teh selected
videoTrack.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): For
videoTrack reset the size and the selected element. In case there
is no media playing we Make sure we set the ended variable to true
and call the timeChange to modify the state of the player.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
Handle properly the situation when the user changed the enabled
value, we disable the media.
(WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Modify the
size of the source.
(WebCore::MediaPlayerPrivateGStreamerOwr::naturalSize): Overrided
to make sure we return a size even when the sample is not ready
for gst.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
Added the ended attribute and the maps.
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::createMutedRemoteSource): Use the new
realtime video and audio sources classes, this new classes
implement the settings of each type of media element.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
Use the new audio and video source classes instead of the general
one in order to handle the settings properly.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Added
(WebCore::RealtimeMediaSourceOwr::settings): Initialize using the
subclass and return the new currentSettings attribute.
(WebCore::RealtimeMediaSourceOwr::supportedConstraints): Call the
subclass initialization of the supportedSettings.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::initializeSettings): Added to
initialize the settings before returning the value. Implemented in
the subclass.
(WebCore::RealtimeMediaSourceOwr::initializeSupportedConstraints):
Added to initialize the supported settings of the
media. Implemented in the subclass.
(WebCore::RealtimeMediaSourceOwr::settings): Moved to the cpp
file, implemented using the initialize functions of the subclass
* platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Added
this new class to handle the settings of the video elements. The
class initializes the settings and the supportedSettings.
* platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Added
this new class to handle the settings of the audio elements. The
class initializes the settings and the supportedSettings.

LayoutTests:

* platform/gtk/TestExpectations: Unskipped the test and moved the
stop one, now it does not timeout because we correctly handle the
ended value but still fails, we need more features in the mock
classes for owr.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformGStreamercmake">trunk/Source/WebCore/platform/GStreamer.cmake</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerOwrcpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerOwrh">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcMediaEndpointOwrcpp">trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceCenterOwrcpp">trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceOwrh">trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeAudioSourceOwrh">trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceOwrcpp">trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeVideoSourceOwrh">trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (210498 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-01-09 05:35:14 UTC (rev 210498)
+++ trunk/LayoutTests/ChangeLog        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-01-09  Alejandro G. Castro  &lt;alex@igalia.com&gt;
+
+        [OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html
+        https://bugs.webkit.org/show_bug.cgi?id=165316
+
+        Reviewed by Philippe Normand.
+
+        * platform/gtk/TestExpectations: Unskipped the test and moved the
+        stop one, now it does not timeout because we correctly handle the
+        ended value but still fails, we need more features in the mock
+        classes for owr.
+
</ins><span class="cx"> 2017-01-08  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, since this test is slow it should run in fewer configurations. This resolves the
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (210498 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2017-01-09 05:35:14 UTC (rev 210498)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -310,7 +310,6 @@
</span><span class="cx"> webkit.org/b/79203 webaudio/mediastreamaudiodestinationnode.html [ Skip ]
</span><span class="cx"> webkit.org/b/79203 webaudio/mediastreamaudiosourcenode.html [ Skip ]
</span><span class="cx"> webkit.org/b/79203 fast/mediastream/MediaStream-video-element.html [ Skip ]
</span><del>-webkit.org/b/79203 fast/mediastream/MediaStream-video-element-track-stop.html [ Skip ]
</del><span class="cx"> webkit.org/b/151344 fast/mediastream/MediaStream-add-ended-tracks.html [ Skip ]
</span><span class="cx"> webkit.org/b/151344 fast/mediastream/MediaStream-add-remove-tracks.html [ Skip ]
</span><span class="cx"> webkit.org/b/79203 fast/mediastream/mock-media-source.html [ Skip ]
</span><span class="lines">@@ -319,6 +318,7 @@
</span><span class="cx"> webkit.org/b/160996 fast/mediastream/apply-constraints-advanced.html [ Skip ]
</span><span class="cx"> webkit.org/b/160996 fast/mediastream/apply-constraints-audio.html [ Skip ]
</span><span class="cx"> webkit.org/b/160996 fast/mediastream/apply-constraints-video.html [ Skip ]
</span><ins>+webkit.org/b/161956 fast/mediastream/MediaStream-video-element-displays-buffer.html [ Skip ]
</ins><span class="cx"> 
</span><span class="cx"> # Proximity Events is not supported.
</span><span class="cx"> webkit.org/b/99060 proximity [ Failure ]
</span><span class="lines">@@ -817,8 +817,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/153937 http/tests/misc/detach-during-notifyDone.html [ Crash Pass ]
</span><span class="cx"> 
</span><del>-webkit.org/b/161956 fast/mediastream/MediaStream-video-element-displays-buffer.html [ Timeout ]
-
</del><span class="cx"> webkit.org/b/131546 media/track/track-in-band.html [ Crash Timeout Failure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/163782 media/video-played-ranges-1.html [ Crash Pass ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210498 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-09 05:35:14 UTC (rev 210498)
+++ trunk/Source/WebCore/ChangeLog        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -1,3 +1,82 @@
</span><ins>+2017-01-09  Alejandro G. Castro  &lt;alex@igalia.com&gt;
+
+        [OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html
+        https://bugs.webkit.org/show_bug.cgi?id=165316
+
+        Reviewed by Philippe Normand.
+
+        Fixed the ended support of the video element in the OWR player and
+        fixed the videoTracks support. Now the OW player properly adds and
+        removes the audio and video tracks. Added the getSettings support
+        to the mediastream interface. Solved also the size handling in
+        some of the enable/muted situations.
+
+        Unskipping fast/mediastream/MediaStream-video-element-track-stop.html.
+
+        * platform/GStreamer.cmake: Added the new
+        RealtimeMediaSourceOwr.cpp with the new code handling the
+        settings.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
+        Release the new video and audio maps that creates a relationship
+        of the mediastream tracks with the mediatracks of the video element.
+        (WebCore::MediaPlayerPrivateGStreamerOwr::play): Set ended to
+        false when we start playing.
+        (WebCore::MediaPlayerPrivateGStreamerOwr::load): Create the media
+        tracks to the player so that the videoTracks API returns it, and
+        add an entry in the map to be able to restore it using the
+        mediastream track.
+        (WebCore::MediaPlayerPrivateGStreamerOwr::disableMediaTracks):
+        Move some part of the stop function to this one in order to use it
+        in pause method and avoid changing the video selection in that
+        case.
+        (WebCore::MediaPlayerPrivateGStreamerOwr::stop): Now we call the
+        function disableMediaTracks and we also change teh selected
+        videoTrack.
+        (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): For
+        videoTrack reset the size and the selected element. In case there
+        is no media playing we Make sure we set the ended variable to true
+        and call the timeChange to modify the state of the player.
+        (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
+        Handle properly the situation when the user changed the enabled
+        value, we disable the media.
+        (WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Modify the
+        size of the source.
+        (WebCore::MediaPlayerPrivateGStreamerOwr::naturalSize): Overrided
+        to make sure we return a size even when the sample is not ready
+        for gst.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
+        Added the ended attribute and the maps.
+        * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
+        (WebCore::MediaEndpointOwr::createMutedRemoteSource): Use the new
+        realtime video and audio sources classes, this new classes
+        implement the settings of each type of media element.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
+        (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
+        Use the new audio and video source classes instead of the general
+        one in order to handle the settings properly.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Added
+        (WebCore::RealtimeMediaSourceOwr::settings): Initialize using the
+        subclass and return the new currentSettings attribute.
+        (WebCore::RealtimeMediaSourceOwr::supportedConstraints): Call the
+        subclass initialization of the supportedSettings.
+        * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
+        (WebCore::RealtimeMediaSourceOwr::initializeSettings): Added to
+        initialize the settings before returning the value. Implemented in
+        the subclass.
+        (WebCore::RealtimeMediaSourceOwr::initializeSupportedConstraints):
+        Added to initialize the supported settings of the
+        media. Implemented in the subclass.
+        (WebCore::RealtimeMediaSourceOwr::settings): Moved to the cpp
+        file, implemented using the initialize functions of the subclass
+        * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Added
+        this new class to handle the settings of the video elements. The
+        class initializes the settings and the supportedSettings.
+        * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Added
+        this new class to handle the settings of the audio elements. The
+        class initializes the settings and the supportedSettings.
+
+
</ins><span class="cx"> 2017-01-08  Konstantin Tokarev  &lt;annulen@yandex.ru&gt;
</span><span class="cx"> 
</span><span class="cx">         Introduce CPU(X86_SSE2) instead of various SSE2 checks
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformGStreamercmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/GStreamer.cmake (210498 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/GStreamer.cmake        2017-01-09 05:35:14 UTC (rev 210498)
+++ trunk/Source/WebCore/platform/GStreamer.cmake        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -16,6 +16,7 @@
</span><span class="cx"> 
</span><span class="cx">         platform/mediastream/openwebrtc/MediaEndpointOwr.cpp
</span><span class="cx">         platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp
</span><ins>+        platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp
</ins><span class="cx">         platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp
</span><span class="cx">     )
</span><span class="cx"> endif ()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerOwrcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp (210498 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp        2017-01-09 05:35:14 UTC (rev 210498)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -56,6 +56,9 @@
</span><span class="cx">     if (hasVideo())
</span><span class="cx">         m_videoTrack-&gt;removeObserver(*this);
</span><span class="cx"> 
</span><ins>+    m_audioTrackMap.clear();
+    m_videoTrackMap.clear();
+
</ins><span class="cx">     stop();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -69,6 +72,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    m_ended = false;
</ins><span class="cx">     m_paused = false;
</span><span class="cx"> 
</span><span class="cx">     GST_DEBUG(&quot;Connecting to live stream, descriptor: %p&quot;, m_streamPrivate.get());
</span><span class="lines">@@ -84,7 +88,7 @@
</span><span class="cx"> {
</span><span class="cx">     GST_DEBUG(&quot;Pause&quot;);
</span><span class="cx">     m_paused = true;
</span><del>-    stop();
</del><ins>+    disableMediaTracks();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MediaPlayerPrivateGStreamerOwr::hasVideo() const
</span><span class="lines">@@ -201,6 +205,9 @@
</span><span class="cx">                 String preSelectedDevice = getenv(&quot;WEBKIT_AUDIO_DEVICE&quot;);
</span><span class="cx">                 if (!preSelectedDevice || (preSelectedDevice == track-&gt;label())) {
</span><span class="cx">                     m_audioTrack = track;
</span><ins>+                    auto audioTrack = AudioTrackPrivateMediaStream::create(*m_audioTrack.get());
+                    m_player-&gt;addAudioTrack(*audioTrack);
+                    m_audioTrackMap.add(track-&gt;id(), audioTrack);
</ins><span class="cx">                     observeTrack = true;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -210,6 +217,10 @@
</span><span class="cx">                 String preSelectedDevice = getenv(&quot;WEBKIT_VIDEO_DEVICE&quot;);
</span><span class="cx">                 if (!preSelectedDevice || (preSelectedDevice == track-&gt;label())) {
</span><span class="cx">                     m_videoTrack = track;
</span><ins>+                    auto videoTrack = VideoTrackPrivateMediaStream::create(*m_videoTrack.get());
+                    m_player-&gt;addVideoTrack(*videoTrack);
+                    videoTrack-&gt;setSelected(true);
+                    m_videoTrackMap.add(track-&gt;id(), videoTrack);
</ins><span class="cx">                     observeTrack = true;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -245,20 +256,31 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateGStreamerOwr::stop()
</del><ins>+void MediaPlayerPrivateGStreamerOwr::disableMediaTracks()
</ins><span class="cx"> {
</span><span class="cx">     if (m_audioTrack) {
</span><span class="cx">         GST_DEBUG(&quot;Stop: disconnecting audio&quot;);
</span><del>-        g_object_set(m_audioRenderer.get(), &quot;disabled&quot;, TRUE, nullptr);
</del><ins>+        g_object_set(m_audioRenderer.get(), &quot;disabled&quot;, true, nullptr);
</ins><span class="cx">         owr_media_renderer_set_source(OWR_MEDIA_RENDERER(m_audioRenderer.get()), nullptr);
</span><span class="cx">     }
</span><ins>+
</ins><span class="cx">     if (m_videoTrack) {
</span><span class="cx">         GST_DEBUG(&quot;Stop: disconnecting video&quot;);
</span><del>-        g_object_set(m_videoRenderer.get(), &quot;disabled&quot;, TRUE, nullptr);
</del><ins>+        g_object_set(m_videoRenderer.get(), &quot;disabled&quot;, true, nullptr);
</ins><span class="cx">         owr_media_renderer_set_source(OWR_MEDIA_RENDERER(m_videoRenderer.get()), nullptr);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MediaPlayerPrivateGStreamerOwr::stop()
+{
+    disableMediaTracks();
+    if (m_videoTrack) {
+        auto videoTrack = m_videoTrackMap.get(m_videoTrack-&gt;id());
+        if (videoTrack)
+            videoTrack-&gt;setSelected(false);
+    }
+}
+
</ins><span class="cx"> void MediaPlayerPrivateGStreamerOwr::registerMediaEngine(MediaEngineRegistrar registrar)
</span><span class="cx"> {
</span><span class="cx">     if (initializeGStreamerAndGStreamerDebugging()) {
</span><span class="lines">@@ -327,9 +349,25 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (&amp;track == m_audioTrack)
</span><del>-        g_object_set(m_audioRenderer.get(), &quot;disabled&quot;, TRUE, nullptr);
-    else if (&amp;track == m_videoTrack)
-        g_object_set(m_videoRenderer.get(), &quot;disabled&quot;, TRUE, nullptr);
</del><ins>+        g_object_set(m_audioRenderer.get(), &quot;disabled&quot;, true, nullptr);
+    else if (&amp;track == m_videoTrack) {
+        g_object_set(m_videoRenderer.get(), &quot;disabled&quot;, true, nullptr);
+        auto&amp; realTimeMediaSource = static_cast&lt;RealtimeMediaSourceOwr&amp;&gt;(m_videoTrack-&gt;source());
+        realTimeMediaSource.setWidth(0);
+        realTimeMediaSource.setHeight(0);
+        auto videoTrack = m_videoTrackMap.get(m_videoTrack-&gt;id());
+        if (videoTrack)
+            videoTrack-&gt;setSelected(false);
+    }
+
+    bool audioDisabled;
+    bool videoDisabled;
+    g_object_get(m_audioRenderer.get(), &quot;disabled&quot;, &amp;audioDisabled, nullptr);
+    g_object_get(m_videoRenderer.get(), &quot;disabled&quot;, &amp;videoDisabled, nullptr);
+    if (audioDisabled &amp;&amp; videoDisabled) {
+        m_ended = true;
+        m_player-&gt;timeChanged();
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayerPrivateGStreamerOwr::trackMutedChanged(MediaStreamTrackPrivate&amp; track)
</span><span class="lines">@@ -379,7 +417,17 @@
</span><span class="cx"> void MediaPlayerPrivateGStreamerOwr::trackEnabledChanged(MediaStreamTrackPrivate&amp; track)
</span><span class="cx"> {
</span><span class="cx">     GST_DEBUG(&quot;%s track now %s&quot;, track.type() == RealtimeMediaSource::Audio ? &quot;audio&quot;:&quot;video&quot;, track.enabled() ? &quot;enabled&quot;:&quot;disabled&quot;);
</span><del>-    maybeHandleChangeMutedState(track);
</del><ins>+
+    switch (track.type()) {
+    case RealtimeMediaSource::Audio:
+        g_object_set(m_audioRenderer.get(), &quot;disabled&quot;, !track.enabled(), nullptr);
+        break;
+    case RealtimeMediaSource::Video:
+        g_object_set(m_videoRenderer.get(), &quot;disabled&quot;, !track.enabled(), nullptr);
+        break;
+    case RealtimeMediaSource::None:
+        GST_WARNING(&quot;Trying to change enabled state of a track with None type&quot;);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GstElement* MediaPlayerPrivateGStreamerOwr::createVideoSink()
</span><span class="lines">@@ -426,8 +474,28 @@
</span><span class="cx">     MediaPlayerPrivateGStreamerBase::setSize(size);
</span><span class="cx">     if (m_videoRenderer)
</span><span class="cx">         g_object_set(m_videoRenderer.get(), &quot;width&quot;, size.width(), &quot;height&quot;, size.height(), nullptr);
</span><ins>+
+    if (!m_videoTrack)
+        return;
+
+    auto&amp; realTimeMediaSource = static_cast&lt;RealtimeMediaSourceOwr&amp;&gt;(m_videoTrack-&gt;source());
+    realTimeMediaSource.setWidth(size.width());
+    realTimeMediaSource.setHeight(size.height());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+FloatSize MediaPlayerPrivateGStreamerOwr::naturalSize() const
+{
+    auto size = MediaPlayerPrivateGStreamerBase::naturalSize();
+
+    // In case we are not playing the video we return the size we set to the media source.
+    if (m_videoTrack &amp;&amp; size.isZero()) {
+        auto&amp; realTimeMediaSource = static_cast&lt;RealtimeMediaSourceOwr&amp;&gt;(m_videoTrack-&gt;source());
+        return realTimeMediaSource.size();
+    }
+
+    return size;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(VIDEO) &amp;&amp; ENABLE(MEDIA_STREAM) &amp;&amp; USE(GSTREAMER) &amp;&amp; USE(OPENWEBRTC)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerOwrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h (210498 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h        2017-01-09 05:35:14 UTC (rev 210498)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -22,8 +22,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO) &amp;&amp; ENABLE(MEDIA_STREAM) &amp;&amp; USE(GSTREAMER) &amp;&amp; USE(OPENWEBRTC)
</span><span class="cx"> 
</span><ins>+#include &quot;AudioTrackPrivateMediaStream.h&quot;
</ins><span class="cx"> #include &quot;MediaPlayerPrivateGStreamerBase.h&quot;
</span><span class="cx"> #include &quot;MediaStreamTrackPrivate.h&quot;
</span><ins>+#include &quot;VideoTrackPrivateMediaStream.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> typedef struct _OwrGstVideoRenderer OwrGstVideoRenderer;
</span><span class="cx"> typedef struct _OwrGstAudioRenderer OwrGstAudioRenderer;
</span><span class="lines">@@ -42,6 +44,8 @@
</span><span class="cx"> 
</span><span class="cx">     void setSize(const IntSize&amp;) final;
</span><span class="cx"> 
</span><ins>+    FloatSize naturalSize() const final;
+
</ins><span class="cx"> private:
</span><span class="cx">     GstElement* createVideoSink() final;
</span><span class="cx">     GstElement* audioSink() const final { return m_audioSink.get(); }
</span><span class="lines">@@ -87,6 +91,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool canLoadPoster() const final { return false; }
</span><span class="cx">     void setPoster(const String&amp;) final { }
</span><ins>+    bool ended() const final { return m_ended; }
</ins><span class="cx"> 
</span><span class="cx">     // MediaStreamTrackPrivate::Observer implementation.
</span><span class="cx">     void trackEnded(MediaStreamTrackPrivate&amp;) final;
</span><span class="lines">@@ -101,8 +106,10 @@
</span><span class="cx">     void loadingFailed(MediaPlayer::NetworkState error);
</span><span class="cx">     void stop();
</span><span class="cx">     void maybeHandleChangeMutedState(MediaStreamTrackPrivate&amp;);
</span><ins>+    void disableMediaTracks();
</ins><span class="cx"> 
</span><span class="cx">     bool m_paused { true };
</span><ins>+    bool m_ended { false };
</ins><span class="cx">     RefPtr&lt;MediaStreamTrackPrivate&gt; m_videoTrack;
</span><span class="cx">     RefPtr&lt;MediaStreamTrackPrivate&gt; m_audioTrack;
</span><span class="cx">     GRefPtr&lt;GstElement&gt; m_audioSink;
</span><span class="lines">@@ -109,6 +116,9 @@
</span><span class="cx">     RefPtr&lt;MediaStreamPrivate&gt; m_streamPrivate;
</span><span class="cx">     GRefPtr&lt;OwrGstVideoRenderer&gt; m_videoRenderer;
</span><span class="cx">     GRefPtr&lt;OwrGstAudioRenderer&gt; m_audioRenderer;
</span><ins>+
+    HashMap&lt;String, RefPtr&lt;AudioTrackPrivateMediaStream&gt;&gt; m_audioTrackMap;
+    HashMap&lt;String, RefPtr&lt;VideoTrackPrivateMediaStream&gt;&gt; m_videoTrackMap;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcMediaEndpointOwrcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp (210498 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp        2017-01-09 05:35:14 UTC (rev 210498)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -39,7 +39,8 @@
</span><span class="cx"> #include &quot;OpenWebRTCUtilities.h&quot;
</span><span class="cx"> #include &quot;PeerConnectionStates.h&quot;
</span><span class="cx"> #include &quot;RTCDataChannelHandler.h&quot;
</span><del>-#include &quot;RealtimeMediaSourceOwr.h&quot;
</del><ins>+#include &quot;RealtimeAudioSourceOwr.h&quot;
+#include &quot;RealtimeVideoSourceOwr.h&quot;
</ins><span class="cx"> #include &lt;owr/owr.h&gt;
</span><span class="cx"> #include &lt;owr/owr_audio_payload.h&gt;
</span><span class="cx"> #include &lt;owr/owr_crypto_utils.h&gt;
</span><span class="lines">@@ -350,15 +351,21 @@
</span><span class="cx"> {
</span><span class="cx">     String name;
</span><span class="cx">     String id(&quot;not used&quot;);
</span><ins>+    RefPtr&lt;RealtimeMediaSourceOwr&gt; source;
</ins><span class="cx"> 
</span><span class="cx">     switch (type) {
</span><del>-    case RealtimeMediaSource::Audio: name = &quot;remote audio&quot;; break;
-    case RealtimeMediaSource::Video: name = &quot;remote video&quot;; break;
</del><ins>+    case RealtimeMediaSource::Audio:
+        name = &quot;remote audio&quot;;
+        source = adoptRef(new RealtimeAudioSourceOwr(nullptr, id, type, name));
+        break;
+    case RealtimeMediaSource::Video:
+        name = &quot;remote video&quot;;
+        source = adoptRef(new RealtimeVideoSourceOwr(nullptr, id, type, name));
+        break;
</ins><span class="cx">     case RealtimeMediaSource::None:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;RealtimeMediaSourceOwr&gt; source = adoptRef(new RealtimeMediaSourceOwr(nullptr, id, type, name));
</del><span class="cx">     m_mutedRemoteSources.set(mid, source);
</span><span class="cx"> 
</span><span class="cx">     return *source;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeAudioSourceOwrhfromrev210498trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceOwrh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h (from rev 210498, trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h) (0 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * Copyright (C) 2015,2016 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.
+ */
+
+#pragma once
+
+#if ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
+
+#include &quot;RealtimeMediaSourceOwr.h&quot;
+
+namespace WebCore {
+
+class RealtimeAudioSourceOwr : public RealtimeMediaSourceOwr {
+public:
+RealtimeAudioSourceOwr(OwrMediaSource* mediaSource, const String&amp; id, RealtimeMediaSource::Type type, const String&amp; name)
+    : RealtimeMediaSourceOwr(mediaSource, id, type, name)
+    {
+    }
+
+RealtimeAudioSourceOwr(const String&amp; id, RealtimeMediaSource::Type type, const String&amp; name)
+    : RealtimeMediaSourceOwr(id, type, name)
+    {
+    }
+
+    virtual ~RealtimeAudioSourceOwr() { }
+
+    bool applySize(const IntSize&amp;) final { return false; }
+
+protected:
+    void initializeSettings() final {
+        if (m_currentSettings.deviceId().isEmpty())
+            m_currentSettings.setSupportedConstraits(supportedConstraints());
+
+        m_currentSettings.setDeviceId(id());
+    }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceCenterOwrcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp (210498 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp        2017-01-09 05:35:14 UTC (rev 210498)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -40,7 +40,9 @@
</span><span class="cx"> #include &quot;MediaStreamPrivate.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><span class="cx"> #include &quot;OpenWebRTCUtilities.h&quot;
</span><ins>+#include &quot;RealtimeAudioSourceOwr.h&quot;
</ins><span class="cx"> #include &quot;RealtimeMediaSourceCapabilities.h&quot;
</span><ins>+#include &quot;RealtimeVideoSourceOwr.h&quot;
</ins><span class="cx"> #include &quot;UUID.h&quot;
</span><span class="cx"> #include &lt;owr/owr.h&gt;
</span><span class="cx"> #include &lt;owr/owr_local.h&gt;
</span><span class="lines">@@ -149,7 +151,11 @@
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        auto mediaSource = adoptRef(*new RealtimeMediaSourceOwr(source, id, mediaSourceType, sourceName));
</del><ins>+        RefPtr&lt;RealtimeMediaSourceOwr&gt; mediaSource;
+        if (mediaSourceType == RealtimeMediaSource::Audio)
+            mediaSource = adoptRef(new RealtimeAudioSourceOwr(source, id, mediaSourceType, sourceName));
+        else
+            mediaSource = adoptRef(new RealtimeVideoSourceOwr(source, id, mediaSourceType, sourceName));
</ins><span class="cx"> 
</span><span class="cx">         RealtimeMediaSourceOwrMap::iterator sourceIterator = m_sourceMap.find(id);
</span><span class="cx">         if (sourceIterator == m_sourceMap.end())
</span><span class="lines">@@ -156,9 +162,10 @@
</span><span class="cx">             m_sourceMap.add(id, mediaSource.copyRef());
</span><span class="cx"> 
</span><span class="cx">         if (mediaType &amp; OWR_MEDIA_TYPE_AUDIO)
</span><del>-            audioSources.append(WTFMove(mediaSource));
</del><ins>+            audioSources.append(mediaSource.releaseNonNull());
</ins><span class="cx">         else if (mediaType &amp; OWR_MEDIA_TYPE_VIDEO)
</span><del>-            videoSources.append(WTFMove(mediaSource));
</del><ins>+            videoSources.append(mediaSource.releaseNonNull());
+
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (videoSources.isEmpty() &amp;&amp; audioSources.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceOwrcppfromrev210498trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceOwrh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp (from rev 210498, trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h) (0 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2016 Igalia S.L
+ *
+ * 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 ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
+#include &quot;RealtimeMediaSourceOwr.h&quot;
+
+namespace WebCore {
+
+const RealtimeMediaSourceSettings&amp; RealtimeMediaSourceOwr::settings() const
+{
+    const_cast&lt;RealtimeMediaSourceOwr&amp;&gt;(*this).initializeSettings();
+    return m_currentSettings;
+}
+
+RealtimeMediaSourceSupportedConstraints&amp; RealtimeMediaSourceOwr::supportedConstraints()
+{
+    if (m_supportedConstraints.supportsDeviceId())
+        return m_supportedConstraints;
+
+    m_supportedConstraints.setSupportsDeviceId(true);
+    initializeSupportedConstraints(m_supportedConstraints);
+
+    return m_supportedConstraints;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceOwrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h (210498 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h        2017-01-09 05:35:14 UTC (rev 210498)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -73,13 +73,20 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RealtimeMediaSourceCapabilities&gt; capabilities() const override { return m_capabilities; }
</span><del>-    const RealtimeMediaSourceSettings&amp; settings() const override { return m_currentSettings; }
</del><ins>+    const RealtimeMediaSourceSettings&amp; settings() const override;
</ins><span class="cx"> 
</span><span class="cx">     OwrMediaSource* mediaSource() const { return m_mediaSource; }
</span><span class="cx"> 
</span><ins>+protected:
+    virtual void initializeSettings() { };
+    virtual void initializeSupportedConstraints(RealtimeMediaSourceSupportedConstraints&amp;) { };
+    RealtimeMediaSourceSupportedConstraints&amp; supportedConstraints();
+
+    RealtimeMediaSourceSettings m_currentSettings;
+
</ins><span class="cx"> private:
</span><ins>+    RealtimeMediaSourceSupportedConstraints m_supportedConstraints;
</ins><span class="cx">     RefPtr&lt;RealtimeMediaSourceCapabilities&gt; m_capabilities;
</span><del>-    RealtimeMediaSourceSettings m_currentSettings;
</del><span class="cx">     OwrMediaSource* m_mediaSource;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeVideoSourceOwrhfromrev210498trunkSourceWebCoreplatformmediastreamopenwebrtcRealtimeMediaSourceOwrh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h (from rev 210498, trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h) (0 => 210499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h                                (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h        2017-01-09 11:03:35 UTC (rev 210499)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+/*
+ * Copyright (C) 2015,2016 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.
+ */
+
+#pragma once
+
+#if ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
+
+#include &quot;RealtimeMediaSourceOwr.h&quot;
+
+namespace WebCore {
+
+class RealtimeVideoSourceOwr : public RealtimeMediaSourceOwr {
+public:
+RealtimeVideoSourceOwr(OwrMediaSource* mediaSource, const String&amp; id, RealtimeMediaSource::Type type, const String&amp; name)
+    : RealtimeMediaSourceOwr(mediaSource, id, type, name)
+    {
+    }
+
+RealtimeVideoSourceOwr(const String&amp; id, RealtimeMediaSource::Type type, const String&amp; name)
+    : RealtimeMediaSourceOwr(id, type, name)
+    {
+    }
+
+    virtual ~RealtimeVideoSourceOwr() { }
+
+    bool applySize(const IntSize&amp;) final { return true; }
+
+protected:
+    void initializeSettings() final {
+        if (m_currentSettings.deviceId().isEmpty())
+            m_currentSettings.setSupportedConstraits(supportedConstraints());
+
+        m_currentSettings.setDeviceId(id());
+
+        m_currentSettings.setFrameRate(frameRate());
+        m_currentSettings.setWidth(size().width());
+        m_currentSettings.setHeight(size().height());
+    }
+
+    void initializeSupportedConstraints(RealtimeMediaSourceSupportedConstraints&amp; supportedConstraints) final {
+        supportedConstraints.setSupportsFacingMode(RealtimeMediaSourceSettings::Unknown);
+        supportedConstraints.setSupportsWidth(true);
+        supportedConstraints.setSupportsHeight(true);
+        supportedConstraints.setSupportsAspectRatio(true);
+        supportedConstraints.setSupportsFrameRate(true);
+    }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM) &amp;&amp; USE(OPENWEBRTC)
</ins></span></pre>
</div>
</div>

</body>
</html>