<!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>[159971] trunk/Source/Platform</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/159971">159971</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-02 14:59:05 -0800 (Mon, 02 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Nix Upstream: Updating Platform files
https://bugs.webkit.org/show_bug.cgi?id=124982

Patch by Thiago de Barros Lacerda &lt;thiago.lacerda@openbossa.org&gt; on 2013-12-02
Reviewed by Benjamin Poulain.

Adding new Platform files that are missing in the trunk.

* PlatformNix.cmake:
* nix/public/AudioDestinationConsumer.h: Added.
(Nix::AudioDestinationConsumer::~AudioDestinationConsumer):
* nix/public/MediaConstraints.h: Added.
* nix/public/MediaStream.h: Added.
* nix/public/MediaStreamAudioSource.h: Added.
* nix/public/MediaStreamCenter.h: Added.
* nix/public/MediaStreamSource.h: Added.
* nix/public/PrivatePtr.h: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourcePlatformChangeLog">trunk/Source/Platform/ChangeLog</a></li>
<li><a href="#trunkSourcePlatformPlatformNixcmake">trunk/Source/Platform/PlatformNix.cmake</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourcePlatformnixpublicAudioDestinationConsumerh">trunk/Source/Platform/nix/public/AudioDestinationConsumer.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaConstraintsh">trunk/Source/Platform/nix/public/MediaConstraints.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaStreamh">trunk/Source/Platform/nix/public/MediaStream.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaStreamAudioSourceh">trunk/Source/Platform/nix/public/MediaStreamAudioSource.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaStreamCenterh">trunk/Source/Platform/nix/public/MediaStreamCenter.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicMediaStreamSourceh">trunk/Source/Platform/nix/public/MediaStreamSource.h</a></li>
<li><a href="#trunkSourcePlatformnixpublicPrivatePtrh">trunk/Source/Platform/nix/public/PrivatePtr.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourcePlatformChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/Platform/ChangeLog (159970 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/ChangeLog        2013-12-02 22:56:01 UTC (rev 159970)
+++ trunk/Source/Platform/ChangeLog        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2013-12-02  Thiago de Barros Lacerda  &lt;thiago.lacerda@openbossa.org&gt;
+
+        Nix Upstream: Updating Platform files
+        https://bugs.webkit.org/show_bug.cgi?id=124982
+
+        Reviewed by Benjamin Poulain.
+
+        Adding new Platform files that are missing in the trunk.
+
+        * PlatformNix.cmake:
+        * nix/public/AudioDestinationConsumer.h: Added.
+        (Nix::AudioDestinationConsumer::~AudioDestinationConsumer):
+        * nix/public/MediaConstraints.h: Added.
+        * nix/public/MediaStream.h: Added.
+        * nix/public/MediaStreamAudioSource.h: Added.
+        * nix/public/MediaStreamCenter.h: Added.
+        * nix/public/MediaStreamSource.h: Added.
+        * nix/public/PrivatePtr.h: Added.
+
</ins><span class="cx"> 2013-11-26  Marcelo Lira  &lt;marcelo.lira@openbossa.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Nix upstreaming - Adding build files and supporting scripts
</span></span></pre></div>
<a id="trunkSourcePlatformPlatformNixcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/Platform/PlatformNix.cmake (159970 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/PlatformNix.cmake        2013-12-02 22:56:01 UTC (rev 159970)
+++ trunk/Source/Platform/PlatformNix.cmake        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> set(Platform_HEADERS
</span><ins>+    nix/public/AudioDestinationConsumer.h
</ins><span class="cx">     nix/public/AudioDevice.h
</span><span class="cx">     nix/public/Canvas.h
</span><span class="cx">     nix/public/Color.h
</span><span class="lines">@@ -13,9 +14,15 @@
</span><span class="cx">     nix/public/FFTFrame.h
</span><span class="cx">     nix/public/Gamepad.h
</span><span class="cx">     nix/public/Gamepads.h
</span><ins>+    nix/public/MediaConstraints.h
</ins><span class="cx">     nix/public/MediaPlayer.h
</span><ins>+    nix/public/MediaStream.h
+    nix/public/MediaStreamAudioSource.h
+    nix/public/MediaStreamCenter.h
+    nix/public/MediaStreamSource.h
</ins><span class="cx">     nix/public/MultiChannelPCMData.h
</span><span class="cx">     nix/public/Platform.h
</span><ins>+    nix/public/PrivatePtr.h
</ins><span class="cx">     nix/public/Rect.h
</span><span class="cx">     nix/public/Size.h
</span><span class="cx">     nix/public/ThemeEngine.h
</span></span></pre></div>
<a id="trunkSourcePlatformnixpublicAudioDestinationConsumerh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/AudioDestinationConsumer.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/AudioDestinationConsumer.h                                (rev 0)
+++ trunk/Source/Platform/nix/public/AudioDestinationConsumer.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 Nix_AudioDestinationConsumer_h
+#define Nix_AudioDestinationConsumer_h
+
+#include &lt;cstddef&gt;
+#include &lt;vector&gt;
+
+namespace Nix {
+
+class AudioDestinationConsumer {
+public:
+    virtual ~AudioDestinationConsumer() { }
+
+    virtual void setFormat(size_t numberOfChannels, float sampleRate) = 0;
+
+    // The size of the vector is the number of audio channels, and numberOfFrames is the
+    // number of audio frames in the (possibly multi-channel) buffer in a planar format.
+    virtual void consumeAudio(const std::vector&lt;const float*&gt;&amp; pcmData, size_t numberOfFrames) = 0;
+};
+
+} // namespace Nix
+
+#endif // Nix_AudioDestinationConsumer_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaConstraintsh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaConstraints.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaConstraints.h                                (rev 0)
+++ trunk/Source/Platform/nix/public/MediaConstraints.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * 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 Nix_MediaConstraints_h
+#define Nix_MediaConstraints_h
+
+#include &quot;Common.h&quot;
+#include &quot;PrivatePtr.h&quot;
+
+#include &lt;cstddef&gt;
+#include &lt;string&gt;
+#include &lt;vector&gt;
+
+namespace WebCore {
+struct MediaConstraint;
+class MediaConstraints;
+}
+
+namespace Nix {
+
+struct MediaConstraint {
+    MediaConstraint()
+    {
+    }
+
+    MediaConstraint(std::string name, std::string value)
+        : m_name(name)
+        , m_value(value)
+    {
+    }
+
+    std::string m_name;
+    std::string m_value;
+};
+
+class MediaConstraints {
+public:
+    MediaConstraints() { }
+    ~MediaConstraints() { reset(); }
+
+    void assign(const MediaConstraints&amp;);
+
+    void reset();
+    NIX_EXPORT bool isNull() const { return m_private.isNull(); }
+
+    NIX_EXPORT void getMandatoryConstraints(std::vector&lt;MediaConstraint&gt;&amp;) const;
+    NIX_EXPORT void getOptionalConstraints(std::vector&lt;MediaConstraint&gt;&amp;) const;
+
+    NIX_EXPORT bool getMandatoryConstraintValue(const char* name, std::string&amp; value) const;
+    NIX_EXPORT bool getOptionalConstraintValue(const char* name, std::string&amp; value) const;
+
+#ifdef BUILDING_NIX__
+    MediaConstraints(const WTF::PassRefPtr&lt;WebCore::MediaConstraints&gt;&amp;);
+    MediaConstraints(WebCore::MediaConstraints*);
+#endif
+
+private:
+    PrivatePtr&lt;WebCore::MediaConstraints&gt; m_private;
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaConstraints_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaStreamh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaStream.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaStream.h                                (rev 0)
+++ trunk/Source/Platform/nix/public/MediaStream.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 Nix_MediaStream_h
+#define Nix_MediaStream_h
+
+#include &quot;Common.h&quot;
+#include &quot;PrivatePtr.h&quot;
+
+#include &lt;cstddef&gt;
+#include &lt;vector&gt;
+
+namespace WebCore {
+class MediaStreamPrivate;
+}
+
+namespace Nix {
+
+class MediaStreamSource;
+class MediaStreamAudioSource;
+
+class MediaStream {
+public:
+    MediaStream() { }
+    MediaStream(const MediaStream&amp; other) { assign(other); }
+    ~MediaStream() { reset(); }
+
+    MediaStream&amp; operator=(const MediaStream&amp; other)
+    {
+        assign(other);
+        return *this;
+    }
+
+    NIX_EXPORT void assign(const MediaStream&amp;);
+
+    // Takes ownership of the MediaStreamSource* pointers, deleting them.
+    NIX_EXPORT void initialize(std::vector&lt;MediaStreamSource*&gt;&amp; audioTracks, std::vector&lt;MediaStreamSource*&gt;&amp; videoTracks);
+
+    NIX_EXPORT void reset();
+    NIX_EXPORT bool isNull() const;
+
+
+    NIX_EXPORT const char* id() const;
+
+    // Caller must delete the returned MediaStreamSource*
+    NIX_EXPORT std::vector&lt;MediaStreamSource*&gt; audioSources() const;
+    NIX_EXPORT std::vector&lt;MediaStreamSource*&gt; videoSources() const;
+
+    NIX_EXPORT void addSource(const MediaStreamSource&amp;);
+    NIX_EXPORT void removeSource(const MediaStreamSource&amp;);
+
+#if BUILDING_NIX__
+    MediaStream(WebCore::MediaStreamPrivate*);
+    MediaStream(const WTF::PassRefPtr&lt;WebCore::MediaStreamPrivate&gt;&amp;);
+    operator WTF::PassRefPtr&lt;WebCore::MediaStreamPrivate&gt;() const;
+    operator WebCore::MediaStreamPrivate*() const;
+    MediaStream&amp; operator=(const WTF::PassRefPtr&lt;WebCore::MediaStreamPrivate&gt;&amp;);
+#endif
+
+private:
+    PrivatePtr&lt;WebCore::MediaStreamPrivate&gt; m_private;
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaStream_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaStreamAudioSourceh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaStreamAudioSource.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaStreamAudioSource.h                                (rev 0)
+++ trunk/Source/Platform/nix/public/MediaStreamAudioSource.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * 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 Nix_MediaStreamAudioSource_h
+#define Nix_MediaStreamAudioSource_h
+
+#include &quot;Common.h&quot;
+#include &quot;MediaStreamSource.h&quot;
+
+namespace WebCore {
+class MediaStreamAudioSource;
+}
+
+namespace Nix {
+class AudioDestinationConsumer;
+
+class MediaStreamAudioSource : public MediaStreamSource {
+public:
+    NIX_EXPORT MediaStreamAudioSource();
+    MediaStreamAudioSource(const MediaStreamAudioSource&amp; other) : MediaStreamSource(other) { assign(other); }
+    ~MediaStreamAudioSource() { reset(); }
+
+    MediaStreamAudioSource&amp; operator=(const MediaStreamAudioSource&amp; other)
+    {
+        assign(other);
+        return *this;
+    }
+
+    NIX_EXPORT void assign(const MediaStreamAudioSource&amp;);
+
+    NIX_EXPORT void reset();
+    bool isNull() const { return m_private.isNull(); }
+
+    NIX_EXPORT const char* deviceId() const;
+    NIX_EXPORT void setDeviceId(const char*);
+
+    // The Nix::AudioDestinationConsumer is not owned, and has to be disposed of separately
+    // after calling removeAudioConsumer.
+    NIX_EXPORT void addAudioConsumer(AudioDestinationConsumer*);
+    NIX_EXPORT bool removeAudioConsumer(AudioDestinationConsumer*);
+
+#if BUILDING_NIX__
+    MediaStreamAudioSource(const WTF::PassRefPtr&lt;WebCore::MediaStreamAudioSource&gt;&amp;);
+    MediaStreamAudioSource&amp; operator=(WebCore::MediaStreamAudioSource*);
+    operator WTF::PassRefPtr&lt;WebCore::MediaStreamAudioSource&gt;() const;
+    operator WebCore::MediaStreamAudioSource*() const;
+private:
+    WebCore::MediaStreamAudioSource* toWebCoreAudioSource() const;
+#endif
+
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaStreamAudioSource_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaStreamCenterh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaStreamCenter.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaStreamCenter.h                                (rev 0)
+++ trunk/Source/Platform/nix/public/MediaStreamCenter.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 Nix_MediaStreamCenter_h
+#define Nix_MediaStreamCenter_h
+
+#include &quot;Common.h&quot;
+#include &quot;PrivatePtr.h&quot;
+
+namespace WebCore {
+class MediaStreamCenter;
+}
+
+namespace Nix {
+class MediaStream;
+class MediaStreamSource;
+class MediaConstraints;
+
+class NIX_EXPORT MediaStreamCenter {
+public:
+    MediaStreamCenter();
+    void request();
+    // Return the name of the failed constraint. 0 if successful.
+    virtual const char* validateRequestConstraints(MediaConstraints&amp; audioConstraints, MediaConstraints&amp; videoConstraints) = 0;
+    virtual MediaStream createMediaStream(MediaConstraints&amp; audioConstraints, MediaConstraints&amp; videoConstraints) = 0;
+
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaStreamCenter_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicMediaStreamSourceh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/MediaStreamSource.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/MediaStreamSource.h                                (rev 0)
+++ trunk/Source/Platform/nix/public/MediaStreamSource.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ *
+ * 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 Nix_MediaStreamSource_h
+#define Nix_MediaStreamSource_h
+
+#include &quot;Common.h&quot;
+#include &quot;PrivatePtr.h&quot;
+
+namespace WebCore {
+class MediaStreamSource;
+}
+
+namespace Nix {
+
+class MediaStreamSource {
+public:
+
+    enum Type {
+        Audio,
+        Video
+    };
+
+    enum ReadyState {
+        ReadyStateLive = 0,
+        ReadyStateMuted = 1,
+        ReadyStateEnded = 2
+    };
+
+    MediaStreamSource() { }
+    MediaStreamSource(const MediaStreamSource&amp; other) { assign(other); }
+    virtual ~MediaStreamSource() { reset(); }
+
+    MediaStreamSource&amp; operator=(const MediaStreamSource&amp; other)
+    {
+        assign(other);
+        return *this;
+    }
+
+    NIX_EXPORT void assign(const MediaStreamSource&amp;);
+
+    NIX_EXPORT void reset();
+    bool isNull() const { return m_private.isNull(); }
+
+    NIX_EXPORT const char* id() const;
+    NIX_EXPORT Type type() const;
+    NIX_EXPORT const char* name() const;
+
+    NIX_EXPORT void setReadyState(ReadyState);
+    NIX_EXPORT ReadyState readyState() const;
+
+    NIX_EXPORT bool enabled() const;
+    NIX_EXPORT void setEnabled(bool);
+
+    NIX_EXPORT bool muted() const;
+    NIX_EXPORT void setMuted(bool);
+
+    NIX_EXPORT bool readonly() const;
+    NIX_EXPORT void setReadonly(bool);
+
+    // FIXME Add support for capabilites.
+
+#if BUILDING_NIX__
+    MediaStreamSource(const WTF::PassRefPtr&lt;WebCore::MediaStreamSource&gt;&amp;);
+    MediaStreamSource&amp; operator=(WebCore::MediaStreamSource*);
+    operator WTF::PassRefPtr&lt;WebCore::MediaStreamSource&gt;() const;
+    operator WebCore::MediaStreamSource*() const;
+#endif
+
+protected:
+    PrivatePtr&lt;WebCore::MediaStreamSource&gt; m_private;
+};
+
+} // namespace Nix
+
+#endif // Nix_MediaStreamSource_h
+
</ins></span></pre></div>
<a id="trunkSourcePlatformnixpublicPrivatePtrh"></a>
<div class="addfile"><h4>Added: trunk/Source/Platform/nix/public/PrivatePtr.h (0 => 159971)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/nix/public/PrivatePtr.h                                (rev 0)
+++ trunk/Source/Platform/nix/public/PrivatePtr.h        2013-12-02 22:59:05 UTC (rev 159971)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &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 Nix_PrivatePtr_h
+#define Nix_PrivatePtr_h
+
+#include &quot;Common.h&quot;
+
+#if BUILDING_NIX__
+#include &lt;wtf/PassRefPtr.h&gt;
+#endif
+
+#include &lt;cassert&gt;
+
+namespace Nix {
+
+// This class is an implementation detail of the Nix API. It exists
+// to help simplify the implementation of Nix interfaces that merely
+// wrap a reference counted WebCore class.
+template &lt;typename T&gt;
+class PrivatePtr {
+public:
+    PrivatePtr() : m_ptr(0) { }
+    ~PrivatePtr() { assert(!m_ptr); }
+
+    bool isNull() const { return !m_ptr; }
+
+#if BUILDING_NIX__
+    PrivatePtr(const PassRefPtr&lt;T&gt;&amp; prp)
+        : m_ptr(prp.leakRef())
+    {
+    }
+
+    void reset()
+    {
+        assign(0);
+    }
+
+    PrivatePtr&lt;T&gt;&amp; operator=(const PrivatePtr&lt;T&gt;&amp; other)
+    {
+        T* p = other.m_ptr;
+        if (p)
+            p-&gt;ref();
+        assign(p);
+        return *this;
+    }
+
+    PrivatePtr&lt;T&gt;&amp; operator=(const PassRefPtr&lt;T&gt;&amp; prp)
+    {
+        assign(prp.leakRef());
+        return *this;
+    }
+
+    T* get() const
+    {
+        return m_ptr;
+    }
+
+    T* operator-&gt;() const
+    {
+        assert(m_ptr);
+        return m_ptr;
+    }
+
+private:
+    void assign(T* p)
+    {
+        // p is already ref'd for us by the caller
+        if (m_ptr)
+            m_ptr-&gt;deref();
+        m_ptr = p;
+    }
+#endif
+
+private:
+
+    T* m_ptr;
+};
+
+} // namespace Nix
+
+#endif // Nix_PrivatePtr_h
+
</ins></span></pre>
</div>
</div>

</body>
</html>